addDialog.vue
2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-09-06 09:49:46
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-09-24 10:18:44
* @FilePath: \dj-car-life-system\src\views\contentManager\packageConfig\components\addDialog.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!-- 月度库存结算单弹窗 -->
<template>
<d2-dialog
title="新增门店"
:is-visible="dialogVisible"
class="dailog-box"
width="36%"
@closeDialog="handleClose"
@confirmDialog="handleConfirm"
>
<div v-loading="loading">
<div class="dialog-title">
请选择新增门店,新增门店的素材会复用默认门店的素材,可自定义修改
</div>
<el-select
filterable
class="form-select"
v-model="formData.merchantId"
placeholder="请选择"
>
<el-option
v-for="(i, indx) in merchantIdList"
:key="i.merchantId"
:label="i.merchantName"
:value="i.merchantId"
></el-option>
</el-select>
</div>
</d2-dialog>
</template>
<script>
import { recepitonUpdate } from "@api/contentManager"
import { mapState, mapActions } from "vuex"
export default {
name: "addDialog",
data() {
return {
formData: {},
loading: false
}
},
props: {
dialogVisible: Boolean
},
computed: {
...mapState("d2admin/merchant", ["merchantIdList"])
},
async mounted() {
this.loading = true
await this.getMerchantIdList()
this.loading = false
},
methods: {
...mapActions("d2admin/merchant", ["getMerchantIdList"]),
handleConfirm() {
const { merchantId } = this.formData
if (!merchantId) {
return this.$message.error("请选择门店")
}
const merchantName = this.merchantIdList.find(
(i) => i.merchantId === merchantId
).merchantName
recepitonUpdate({ merchantId, configType: 0, merchantName }).then(
(res) => {
if (res) {
this.handleClose()
this.$message.success("新增成功")
}
}
)
},
handleClose() {
this.$emit("dialogClose")
}
}
}
</script>
<style lang="scss">
.dialog-title {
font-size: 14px;
line-height: 30px;
margin-bottom: 15px;
}
.form-select {
width: 50%;
}
</style>