merchantRelationships.vue
10.4 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
<template>
<div class="merchantRelationships" v-if="formItem">
<div class="title">流量方信息</div>
<div class="content">
<table class="detail_table">
<tr>
<td class="lb">流量方信息</td>
<td class="cb">
<text-popover :refName="'merchantName'" :content="formItem.merchantName || '-'" />
</td>
<td class="lb">业务类型</td>
<td class="cb">
<text-popover :refName="'scene'" :content="filterItem(formItem.scene , 'sceneCodeList')" />
</td>
</tr>
<tr>
<td class="lb">一级流量方</td>
<td class="cb">
<text-popover :refName="'firstFlowMerchantName'" :content="formItem.firstFlowMerchantName || '-'" />
</td>
<td class="lb">流量通道方</td>
<td class="cb">
<text-popover :refName="'flowChannelMerchantName'" :content="formItem.flowChannelMerchantName || '-'" />
</td>
</tr>
<tr>
<td class="lb">合作模式</td>
<td class="cb">
<text-popover :refName="'cooperationModel'" :content="filterItem(formItem.cooperationModel, 'cooperationModeList')" />
</td>
<td class="lb">收款方式</td>
<td class="cb">
<text-popover :refName="'paymentMethodList'" :content="filterItem(formItem.paymentMethod , 'paymentMethodList')" />
</td>
</tr>
<tr>
<td class="lb">流量方合同规定发票税率</td>
<td class="cb">
<text-popover :refName="'contractStipulateRate'" :content="filterItem(formItem.contractStipulateRate, 'invoiceTaxRateList')" />
</td>
<td class="lb">流量方实际发票税率</td>
<td class="cb">
<text-popover :refName="'contractActualRate'" :content="filterItem(formItem.contractActualRate, 'invoiceTaxRateList')" />
</td>
</tr>
<tr>
<td class="lb">合同归属</td>
<td class="cb">
<text-popover :refName="'contractOwnerMerchantName'" :content="formItem.contractOwnerMerchantName || '-'" />
</td>
<td class="lb">合同编码</td>
<td class="cb">
<text-popover :refName="'contractCode'" :content="formItem.contractCode || '-'" />
</td>
</tr>
<tr>
<td class="lb">园区店信息</td>
<td class="cb">
<text-popover :refName="'yqMerchantName'" :content="formItem.yqMerchantName || '-'" />
</td>
<td class="lb"></td>
<td class="cb"></td>
</tr>
</table>
</div>
<div class="title">服务商信息</div>
<div class="content">
<table class="detail_table">
<tr>
<td class="lb">一级服务商</td>
<td class="cb">
<text-popover :refName="'firstServiceMerchantName'" :content="$$(formItem.firstServiceMerchant, 'serviceMerchantName') ? formItem.firstServiceMerchant.serviceMerchantName : '-'" />
</td>
<td class="lb">二级服务商</td>
<td class="cb">
<text-popover :refName="'secondServiceMerchantName'" :content="$$(formItem.secondServiceMerchant, 'serviceMerchantName') ? formItem.secondServiceMerchant.serviceMerchantName : '-'" />
</td>
</tr>
</table>
<div v-if="$$(formItem.marketServiceList, 'length')">
<div class="sub-title">三级服务商(营销)</div>
<el-table :data="formItem.marketServiceList" class="sub-table" border>
<el-table-column label="序号" width="60px" align="center">
<template slot-scope="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column v-for="(item, index) in filterTableColumns" :key="index" :label="item['label']" align="center">
<template slot-scope="scope" >
<span v-if="item.name == 'subBusiness'" v-html="filterItem(scope.row[item['name']], item.filterList )"></span>
<template v-else>
<text-popover :refName="item.name + 'marketTable'" :content="filterItem(scope.row[item['name']], item.filterList)" />
</template>
</template>
</el-table-column>
</el-table>
</div>
<div v-if="$$(formItem.installServiceList, 'length')">
<div class="sub-title">三级服务商(安装)</div>
<el-table :data="formItem.installServiceList" class="sub-table" border>
<el-table-column label="序号" width="60px" align="center">
<template slot-scope="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column v-for="(item, index) in filterTableColumns" :key="index" :label="item['label']" align="center">
<template slot-scope="scope" v-if="!item.isHide">
<span v-if="item.name == 'subBusiness'" v-html="filterItem(scope.row[item['name']], item.filterList )"></span>
<template v-else>
<text-popover :refName="item.name + 'installTable'" :content="filterItem(scope.row[item['name']], item.filterList)" />
</template>
</template>
</el-table-column>
</el-table>
</div>
</div>
<div class="title">其他信息</div>
<div class="content">
<table class="detail_table">
<tr>
<td class="lb">收入所属公司</td>
<td class="cb">
<text-popover :refName="'incomeOwnerMerchantAccount'" :content="formItem.incomeOwnerMerchantAccount || formItem.incomeOwnerMerchantName || '-'" />
</td>
<td class="lb">是否为一般纳税人</td>
<td class="cb">
<text-popover :refName="'generalTaxpayer'" :content="formItem.generalTaxpayer == '0' ? '否' : formItem.generalTaxpayer == '1' ? '是' : '-'" />
</td>
</tr>
</table>
</div>
</div>
</template>
<script>
import { sceneCodeList, invoiceTaxRateList, cooperationModeList, paymentMethodList, partnerClassifyList, subBusinessList } from '@/common/constants.js'
import textPopover from './textPopover.vue'
export default {
name: 'merchantRelationships',
components: {
textPopover
},
props: {
formItem: {
type: Object,
default: () => { }
}
},
data () {
return {
tableColumns: [{
label: '服务商名称',
name: 'serviceMerchantName'
}, {
label: '服务商分类',
name: 'serviceProviderType',
filter: true,
filterList: 'partnerClassifyList'
}, {
label: '子业务',
name: 'subBusiness',
filter: true,
filterList: 'subBusinessList',
isHide: false
}, {
label: '合同规定发票税率',
name: 'contractStipulateRate',
filter: true,
filterList: 'invoiceTaxRateList'
}, {
label: '实际发票税率',
name: 'contractActualRate',
filter: true,
filterList: 'invoiceTaxRateList'
}, {
label: '合同归属',
name: 'contractOwnerMerchantName'
}, {
label: '合同编码',
name: 'contractCode'
}],
baseData: {
sceneCodeList, // 场景编码
invoiceTaxRateList, // 发票税率
cooperationModeList, // 合作模式
paymentMethodList, // 收款方式
partnerClassifyList, // 服务商分类
subBusinessList // 子业务
}
}
},
watch: {
'formItem.scene': {
handler(val) { // 监听业务类型 会员权益/升级 有子业务
if (val == 0) {
this.tableColumns.find(v => v.name == 'subBusiness').isHide = false
} else {
this.tableColumns.find(v => v.name == 'subBusiness').isHide = true
}
},
deep: true,
immediate: true
}
},
computed: {
filterTableColumns() {
return this.tableColumns.filter(v => !v.isHide)
},
isOverflown() {
return (name, it) => {
console.log(this.$refs, name, it)
const element = this.$refs?.[name + it]?.[0] // 获取组件的根元素
return element.scrollWidth > element.offsetWidth // 检查是否溢出
}
}
},
methods: {
filterItem(value, item) {
if (item == 'subBusinessList') { // 子业务特殊处理
let valueR = value?.split(',')?.sort((a, b) => a - b)
const result = valueR?.map(confId => {
const found = this.baseData[item]?.find(item => item.confId == confId)
return found ? found.confValue : null
})
return result?.filter(confValue => confValue != null)?.join(' ') || '-'
}
return item ? (this.baseData[item]?.filter(v => v.confId == value)[0]?.['confValue'] || '-') : (value || '-')
},
}
}
</script>
<style lang="scss" scoped>
.merchantRelationships {
background: #fff;
padding-bottom: 30px;
.title {
height: 50px;
line-height: 50px;
padding: 0 20px;
border-bottom: 1px solid #E5E5E5;
font-size: 16px;
font-weight: 600;
color: #333333;
margin-bottom: 20px;
}
.content{
padding: 0 20px;
font-size: 14px;
color: #1d1d1d;
}
.detail_table {
padding: 0 20px;
width: 100%;
background: #fff;
border-collapse: collapse;
tr {
width: 100%;
display: flex;
}
&:first-of-type {
& > tr > td {
border-top: 1px solid #cccccc;
}
}
&:last-of-type {
border-bottom: 1px solid #cccccc;
}
td {
border: 1px solid #cccccc;
border-bottom: none;
border-right: none;
// padding: 10px;
padding: 6px;
text-align: center;
&.lb {
width: 0;
flex: 1;
}
&.cb {
width: 0;
flex: 2;
}
}
td:last-child{
border-right: 1px solid #cccccc;
}
}
.sub-title{
margin: 10px 0;
}
}
::v-deep .sub-table{
color: #1d1d1d;
thead{
color: #666 !important;
}
}
::v-deep .sub-table .el-table__header-wrapper th{
background: #fafafa !important;
}
// 修改el-table border颜色
::v-deep .el-table--border{
border-color: #cccccc;
tr{
th {
border-color: #cccccc;
}
td{
border-color: #cccccc;
}
}
}
::v-deep .el-table::before{
background-color: #cccccc;
}
::v-deep .el-table::after{
background-color: #cccccc;
}
::v-deep .el-table__row .cell{
padding: 0 10px;
}
</style>