ShopMerchantInfo.vue
3.02 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<!-- 查看 - 流量方信息 -->
<template>
<div class="edit-page shop-merchant-info-detail">
<div class="title">
<span>流量方信息</span>
</div>
<div style="padding: 20px 20px 0;">
<el-form :model="merchantInfo" label-width="150px">
<el-form-item v-for="(item, index) in editFormData" :key="index" class="form-item" :style="{ 'width': '48%'}">
<span slot="label" class="label">{{item.label}}:</span>
<span>{{merchantInfo[item.name] || '-'}}{{item.suffix}}</span>
</el-form-item>
</el-form>
</div>
</div>
</template>
<script>
import { sceneCodeList } from '@/common/constants.js'
import { busiModeList, operationModeList } from '../../constant/baseData'
export default {
name: 'ShopMerchantInfo',
props: {
merchantInfo: {
type: Object,
default: () => { }
}
},
watch: {
merchantInfo(val) {
this.dealInitData()
}
},
data() {
//这里存放数据
return {
editFormData: [{
label: "流量方信息",
name: 'merchantName',
}, {
label: "集团(上级商户)",
name: 'parentMerchantName',
}, {
label: "业务模式",
name: 'businessModeName',
attrName: 'businessMode',
optionsName: 'busiModeList'
}, {
label: "签约主体",
name: 'contractingMerchantName',
}, {
label: "业务场景",
name: 'sceneTypeName',
attrName: 'sceneType',
optionLabel: 'confValue',
optionsName: 'sceneCodeList'
}, {
label: "园区店",
name: 'yqMerchantName',
}, {
label: '预估流量/月',
name: 'estimatedFlow',
}, {
label: '预估转化率',
name: 'estimatedUpgradeRate',
suffix: '%',
}, {
label: "运营模式",
name: 'operationModeName',
attrName: 'operationMode',
optionsName: 'operationModeList'
}, {
label: "服务商",
name: 'partnerMerchantName',
}, {
label: "上级服务商",
name: 'parentPartnerMerchantName',
}],
baseData: {
busiModeList: busiModeList,
sceneCodeList: sceneCodeList,
operationModeList: operationModeList
}
}
},
methods: {
dealInitData() {
console.log(this.merchantInfo, 'merchantInfo')
this.editFormData.forEach(item => {
if (item.attrName) {
const obj = this.baseData[item.optionsName].find(k => k[item.optionId || 'confId'] == this.merchantInfo[item.attrName]) || {}
this.merchantInfo[item.name] = obj[item.optionLabel || 'confName']
}
})
},
},
};
</script>
<style lang="scss">
@import "../../style/editdetailCon.scss";
.shop-merchant-info-detail {
.el-form-item__label {
padding-right: 0;
}
.el-form-item__label,
.el-form-item__content {
line-height: 20px !important;
}
.form-item {
display: inline-block;
line-height: 20px;
margin-bottom: 20px;
}
.download {
margin-left: 8px;
}
}
</style>