detail.vue
9.12 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
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
<template>
<view>
<Navbar title="用户拜访/收费详情" canBack></Navbar>
<view class="bg-white">
<u-tabs :list="list" :current="current" :itemStyle="itemStyle" @click="onchange" lineColor="#EC1E19"
lineWidth="25"></u-tabs>
</view>
<basisCellCard class="margin-sm" title="基本信息" :list="dataList" v-if="current === 0"></basisCellCard>
<basisCellCard class="margin-sm" title="拜访信息" :list="bfDataList" v-if="current === 1"></basisCellCard>
<basisCellCard class="margin-sm" title="决策人信息" :list="jcrDataList" v-if="current === 2"></basisCellCard>
<basisCellCard class="margin-sm" title="收费信息" :list="sfDataList" v-if="current === 3"></basisCellCard>
<basisCellCard class="margin-sm" title="附件" v-if="current === 0 && fileList.length">
<view class="attachmentCss" v-if="fileList.length">
<view class="flexCss" v-for="(item,index) in fileList" :key="index">
<view class="leftCss overflow-one-lines">
<view class="textCss overflow-one-lines">{{item.fileName}}</view>
</view>
<view class="rightCss">
<view @click="viewAttachments(item.url)">查看</view>
</view>
</view>
</view>
</basisCellCard>
</view>
</template>
<script>
import {
getMcFileList,
getByUuid
} from '@/api/charge.js'
import basisCellCard from '@/components/basisCellCard/basisCellCard.vue'
export default {
components: {
basisCellCard,
},
props: {
},
data() {
return {
current: 0,
list: [{
name: '基本信息',
}, {
name: '拜访信息',
}, {
name: '决策人信息'
}, {
name: '收费信息'
}],
itemStyle: {
padding: '0',
marginBottom: '5px',
fontSize: '12rpx',
width: '25%',
height: '30px',
},
objData: {},
dataList: [{
name: "财年",
value: "",
key: "fiscalYear"
}, {
name: "收费人员",
value: "",
key: "billingPersonName"
}, {
name: "兼职/全职",
value: "— —",
key: "jobNature",
dict:"sys_mc_job_nature"
}, {
name: "入户时间",
value: "— —",
key: "entryTime",
mode:'time',
}, {
name: "项目公司/部门",
value: "— —",
key: "companyName"
}, {
name: "村(小区)",
value: "— —",
key: "vlgOrCmty"
}, {
name: "户名",
value: "— —",
key: "userName"
}, {
name: "联系方式",
value: "— —",
key: "userPhone"
}, {
name: "省/市/区/街道",
value: "— —",
key: "address"
}, {
name: "详细地址",
value: "— —",
key: "userDetailedAddress"
}, {
name: "备注",
value: "— —",
key: "remark"
}],
bfDataList:[
{
name: "是否有意向",
value: "",
key: "isIntent",
dict:'sys_mc_visit_intent'
},{
name: "房屋情况",
value: "",
key: "houseCondition"
},{
name: "现用做饭能源",
value: "",
key: "currentCookingEnergy"
},{
name: "现用取暖能源",
value: "",
key: "currentHeatingEnergy"
},{
name: "家庭人口情况",
value: "",
key: "familyMembers"
},{
name: "电冰箱",
value: "",
key: "fridgeStatus"
},{
name: "空调",
value: "",
key: "acStatus"
},{
name: "电视",
value: "",
key: "tvStatus"
},{
name: "洗衣机",
value: "",
key: "washerStatus"
},{
name: "热水器",
value: "",
key: "waterHeaterStatus"
},{
name: "光伏",
value: "",
key: "pvSystemStatus"
},
{
name: "当前地址",
value: "",
key: "visitDetailedAddress"
},
{
name: "上传图片",
value: [],
type:'photoList',
key: "fieldPhotoFile"
},
],
jcrDataList:[
{
name: "决策人年龄",
value: "",
key: "dmAge"
},{
name: "决策人收入来源",
value: "",
key: "dmIncomeSrc",
dict:"sys_mc_visit_dm_income",
},{
name: "决策人联系方式",
value: "",
key: "dmPhone"
}
],
sfDataList:[
{
name: "用户编号",
value: "",
key: "userCode"
},{
name: "身份证号",
value: "",
key: "userIdCard"
},{
name: "票据单号",
value: "",
key: "invoiceNo"
},{
name: "收费金额(元)",
value: "",
key: "chargeAmt"
},{
name: "缴费方式",
value: "",
key: "paymentMeth",
dict:"sys_mc_payment_meth",
},{
name: "收费类型",
value: "",
key: "chargeType",
dict:"sys_mc_charge_type",
},
],
fileList: []
}
},
computed: {
},
async onLoad(data) {
if (data.objData) {
this.objData = JSON.parse(data.objData);
console.log('传递data', JSON.parse(JSON.stringify(this.objData)));
this.dataList = this.$assignValues(this.objData, this.dataList);
if(this.objData.fieldPhotoFile){
await getByUuid(this.objData.fieldPhotoFile).then((res)=>{
this.objData.fieldPhotoFile=[{
type:'photoList',
url:res.data.url,
fileId:res.data.uuid
}];
})
}else{
this.objData.fieldPhotoFile = []
}
this.bfDataList = this.$assignValues(this.objData, this.bfDataList);
// console.log("拜访信息",this.bfDataList);
// console.log('打印this.objData',this.objData);
this.jcrDataList = this.$assignValues(this.objData, this.jcrDataList);
this.sfDataList = this.$assignValues(this.objData, this.sfDataList);
if(this.objData.invoiceYearType){
this.sfDataList.push({
name: "财务审批类型",
value: this.objData.invoiceYearType,
key: "invoiceYearType"
})
}
// console.log("收费信息", this.sfDataList);
this.dataList.map(item => {
if (item.key === 'address') {
item.value =
`${this.objData.userProvince}${this.objData.userCity}${this.objData.userDistrict}${this.objData.userStreet}`
}
})
}
this.initData()
},
methods: {
onchange(e) {
console.log(e);
this.current = e.index;
},
initData() {
let uuid = this.objData.attachmentFile;
console.log(uuid);
if (uuid) {
let uuids = uuid.split(",");
let data = {
uuids: uuids
}
getMcFileList(data).then(res => {
if (res.code === 200) {
this.fileList = res.data
}
})
}
},
viewAttachments(urls) {
console.log(urls);
uni.getSystemInfo({
success: function(res) {
var platform = res.platform.toLowerCase();
console.log(platform);
// 如果是安卓设备
if (platform === 'android' || platform === 'windows') {
window.open(urls, '_blank');
}
// 如果是 iOS 设备
else if (platform === 'ios') {
window.location.href = urls
}
}
});
}
}
}
</script>
<style lang="scss" scoped>
.attachmentCss {
margin-top: 38rpx;
padding: 20rpx;
border-radius: 10px;
background-color: #f8f9fd;
box-sizing: border-box;
}
.flexCss {
display: flex;
justify-content: space-between;
align-items: center;
margin: 32rpx 0;
}
.leftCss {
display: flex;
justify-content: flex-start;
align-items: center;
}
.textCss {
width: 466rpx;
height: 35rpx;
margin: 0 4px;
background-color: rgba(255, 255, 255, 0);
box-sizing: border-box;
font-family: '苹方 中等', '苹方', sans-serif;
color: #999db0;
text-align: left;
line-height: normal;
font-size: 26rpx;
}
.rightCss {
width: 60rpx;
height: 35rpx;
display: flex;
background-color: rgba(255, 255, 255, 0);
box-sizing: border-box;
font-family: '苹方 中等', '苹方', sans-serif;
color: #ff5630;
text-align: left;
font-size: 26rpx;
}
</style>