detail.vue
20.1 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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
<template>
<view class="page">
<scroll-view class="scroll" scroll-y>
<view class="detail-page">
<view class="section">
<text class="row company">{{ form.companyName }}</text>
<view :class="['status', `status_${form.status}`]" />
<view class="row"><text class="label">编号</text><text class="value">{{ form.serialNumber }}</text></view>
<view class="row"><text class="label">办事处</text><text class="value">{{ form.deptName }}</text></view>
<view class="row"><text class="label">区域</text><text class="value">{{ form.regionName }}</text></view>
<view class="row"><text class="label">简写名称</text><text class="value">{{ form.customerShortName }}</text>
</view>
<view class="row"><text class="label">企业类型</text><text class="value">{{ getDicName('ENTERPRISE_TYPE',
form.enterpriseType, enterpriseTypeOptions) }}</text></view>
<view class="row"><text class="label">企业操作类型</text><text class="value">{{ form.enterpriseOperationType
}}</text></view>
<view class="row"><text class="label">登记日期</text><text class="value">{{ form.registerDate }}</text></view>
</view>
<view class="title-header">
<image class="title-header_icon" src="/static/images/title.png" />
<span>基础资料</span>
</view>
<view class="section">
<view class="row"><text class="label">企业性质</text><text class="value">{{ form.companyNature }}</text></view>
<view class="row"><text class="label">注册资本</text><text class="value">{{ form.registeredCapital }}</text>
</view>
<view class="row"><text class="label">账号</text><text class="value">{{ form.bankAccount }}</text></view>
<view class="row"><text class="label">开户行</text><text class="value">{{ form.bankName }}</text></view>
<view class="row"><text class="label">税号</text><text class="value">{{ form.taxNumber }}</text></view>
<view class="row"><text class="label">注册时间</text><text class="value">{{ form.registrationTime }}</text></view>
<view class="row"><text class="label">经营年限</text><text class="value">{{ form.businessYears }}</text></view>
<view class="row"><text class="label">单位地址</text><text class="value">{{ form.companyAddress }}</text></view>
<view class="row"><text class="label">经营范围</text><text class="value">{{ form.businessScope }}</text></view>
<view class="row"><text class="label">工商信息</text><text class="value act">{{ form.businessFileName }}</text>
</view>
<view class="row"><text class="label">股东信息</text><text class="value act">{{ form.shareholderFileName }}</text>
</view>
</view>
<!-- 核心人员 -->
<view class="mgb10">
<CorePersonnel mode="view" :options="genderOptions" :list="form.corePersonnelList" />
</view>
<view class="title-header">
<image class="title-header_icon" src="/static/images/title.png" />
<span>资产经营情况</span>
</view>
<view class="section">
<view class="row"><text class="label">经营场地属性</text><text class="value">{{ form.businessProperty }}</text>
</view>
<view class="row"><text class="label">占地面积</text><text class="value">{{ form.landArea }} 平方米</text></view>
<view class="row"><text class="label">仓储条件</text><text class="value">{{ form.storageConditions }}</text>
</view>
<view class="row"><text class="label">员工人数</text><text class="value">{{ form.employeeCount }}</text></view>
<view class="row"><text class="label">设备属性</text><text class="value">{{ form.equipmentAttributes }}</text>
</view>
<view class="row"><text class="label">资产评估</text><text class="value">{{ form.assetEvaluation }}</text></view>
<view class="row"><text class="label">上年度销售额</text><text class="value">{{ form.lastYearSales }}</text></view>
<view class="row"><text class="label">月均销量</text><text class="value">{{ form.monthlyAvgSales }}</text></view>
<view class="row"><text class="label">销项发票所开品名与计量单位</text><text class="value">{{ form.invoiceItemUnit
}}</text></view>
<view class="row"><text class="label">认证证书</text><text class="value">{{ form.certificationCertificate
}}</text></view>
<view class="row"><text class="label">我司售与产品于经营范围是否匹配</text><text class="value">{{ form.productMatch }}</text>
</view>
<view class="row"><text class="label">主要客户</text><text class="value">{{ form.majorCustomers }}</text></view>
<view class="row"><text class="label">主营项目</text><text class="value">{{ form.mainProjects }}</text></view>
<view class="row"><text class="label">从事行业</text><text class="value">{{ form.industryInvolved }}</text></view>
<view class="row"><text class="label">在该行业中的经验</text><text class="value">{{ form.industryExperience }}</text>
</view>
<view class="row"><text class="label">是否与其他企业有经济纠纷 违规信息 拖欠员工薪资</text><text class="value">{{ form.hasDispute
}}</text></view>
</view>
<view class="title-header">
<image class="title-header_icon" src="/static/images/title.png" />
<span>与我司合作</span>
</view>
<view class="section">
<view class="row"><text class="label">与我司合作时间</text><text class="value">{{ form.cooperationStartDate }}</text>
</view>
<view class="row"><text class="label">月均操作量</text><text class="value">{{ form.monthlyAvgVolume }}</text>
</view>
<view class="row"><text class="label">是否口头协议操作</text><text class="value">{{ form.isVerbalAgreement }}</text>
</view>
<view class="row"><text class="label">是否签订其他协议</text><text class="value">{{ form.otherAgreements }}</text>
</view>
<view class="row"><text class="label">与我司操作是否签订长年合同</text><text class="value">{{ form.hasLongTermContract
}}</text>
</view>
<view class="row"><text class="label">合同类型</text><text class="value">{{ form.contractType }}</text></view>
<view class="row"><text class="label">是否有过中断及中断原因</text><text class="value">{{ form.hasInterruption }}</text>
</view>
</view>
<view class="title-header">
<image class="title-header_icon" src="/static/images/title.png" />
<span>办事处意见</span>
</view>
<view class="section">
<view class="row"><text class="label">建议客户分类</text>
<text class="value">
<text
:class="[form.suggestedCategory ? 'category' : '', getCategoryClass(getDicName('CUSTOMER_CATEGORY', form.suggestedCategory, categoryOptions))]">{{
getDicName('CUSTOMER_CATEGORY', form.suggestedCategory, categoryOptions) }}</text>
</text>
</view>
<view class="row"><text class="label">授信额度</text><text class="value">{{ form.creditLimit }}</text></view>
<view class="row"><text class="label">结算期限</text><text class="value">{{ form.settlementPeriod }}</text></view>
<view class="row"><text class="label">加工操作方案</text><text class="value">{{ form.materialSupplyPlan }}</text>
</view>
<view class="row"><text class="label">调查人</text><text class="value">{{ form.investigatorName }}</text></view>
<view class="row"><text class="label">审核主管</text><text class="value">{{ form.supervisorReviewName }}</text>
</view>
</view>
<view class="title-header">
<image class="title-header_icon" src="/static/images/title.png" />
<span>职能核对</span>
</view>
<view class="section">
<view class="row"><text class="label">年度总销量</text><text class="value">{{ form.annualTotalSales }}</text>
</view>
<view class="row"><text class="label">主要行业</text><text class="value">{{ form.mainIndustry }}</text></view>
<view class="row"><text class="label">年度款料概况</text><text class="value">{{ form.annualMaterialOverview
}}</text></view>
</view>
<view class="title-header">
<image class="title-header_icon" src="/static/images/title.png" />
<span>公司评审</span>
</view>
<view class="section">
<view class="row"><text class="label">客户分类</text>
<text class="value">
<text
:class="[form.companySuggestedCategory ? 'category' : '', getCategoryClass(getDicName('CUSTOMER_CATEGORY', form.companySuggestedCategory, categoryOptions))]">{{
getDicName('CUSTOMER_CATEGORY', form.companySuggestedCategory, categoryOptions) }}</text>
</text>
</view>
<view class="row"><text class="label">授信额度</text><text class="value">{{ form.companyCreditLimit }} 万元</text>
</view>
<view class="row"><text class="label">结算期限</text><text class="value">{{ form.companySettlementPeriod }}</text>
</view>
<view class="row"><text class="label">加工操作方案</text><text class="value">{{ form.companyMaterialSupplyPlan
}}</text></view>
</view>
<view class="title-header">
<image class="title-header_icon" src="/static/images/title.png" />
<span>变更记录</span>
</view>
<view class="section">
<view class="history-header">
<text class="col col1">序号</text>
<text class="col col2">变更时间</text>
<text class="col col3">操作</text>
</view>
<view v-for="(h, i) in historyList" :key="(h && (h.id || h.code)) || i" class="history-row">
<text class="col col1">{{ i + 1 }}</text>
<text class="col col2">{{ h.createTime || '' }}</text>
<text class="col col3 link" @click="onViewHistory(h)">查看</text>
</view>
</view>
</view>
</scroll-view>
<detail-buttons :buttons="displayButtons" @click="handleButtonClick" />
</view>
</template>
<script>
import { getDetailApi, getByIdCreditHistoryList, cancelApi } from '@/api/credit_manage.js'
import { getDicName } from '@/utils/dic.js'
import { getDicByCodeApi } from '@/api/base.js'
import CorePersonnel from './corePersonnel.vue'
import DetailButtons from '@/components/detail-buttons/index.vue'
export default {
name: 'CreditManageDetail',
components: { CorePersonnel, DetailButtons },
data() {
return {
form: {},
enterpriseTypeOptions: [],
regionOptions: [],
genderOptions: [],
categoryOptions: [],
historyList: [],
buttons: [
{ text: '编辑', visible: true, variant: 'outline', event: 'edit' },
{ text: '审核详情', visible: true, variant: 'outline', event: 'auditDetail' },
{ text: '审核', visible: true, variant: 'primary', event: 'audit' },
{ text: '申请变更', visible: true, variant: 'outline', event: 'changeApply' },
{ text: '取消', visible: true, vxrariant: 'outline', event: 'cancel', style: { color: 'rgba(0,0,0,0.9)', border: '1px solid #DCDCDC' } },
],
}
},
computed: {
statusFlags() {
const s = String((this.form && this.form.status) || '')
const e = (this.form && this.form.showExamine) || false
return {
isRefuse: s === 'REFUSE',
isPass: s === 'PASS',
isAudit: s === 'AUDIT',
canExamine: e,
}
},
displayButtons() {
const f = this.statusFlags
return [
{ ...this.buttons[0], visible: f.isRefuse && this.$auth.hasPermi('customer-credit-manage:customer-credit-plan:modify') },
{ ...this.buttons[1], visible: this.$auth.hasPermi('customer-credit-manage:customer-credit-plan:review') },
{ ...this.buttons[2], visible: f.isAudit && f.canExamine && this.$auth.hasPermi('customer-credit-manage:customer-credit-plan:approve') },
{ ...this.buttons[3], visible: f.isPass && this.$auth.hasPermi('customer-credit-manage:customer-credit-plan:change') },
{ ...this.buttons[4], visible: f.isRefuse && this.$auth.hasPermi('customer-credit-manage:customer-credit-plan:close') },
]
}
},
created() {
this.loadRegionOptions()
this.loadEnterpriseTypeOptions()
this.loadGenderOptions()
this.loadCategoryOptions()
},
onLoad(query) {
const id = (query && (query.id || query.code)) || ''
if (id) this.loadDetail(id)
},
methods: {
async loadDetail(id) {
try {
const res = await getDetailApi(id)
const data = res.data || {}
this.form = { ...data }
const cid = this.form.id || this.form.code || id
if (cid) this.loadHistoryList(cid)
} catch (e) {
this.form = {}
}
},
async loadEnterpriseTypeOptions() {
try {
const res = await getDicByCodeApi('ENTERPRISE_TYPE')
const list = res.data || []
this.enterpriseTypeOptions = Array.isArray(list) ? list : []
} catch (e) {
this.enterpriseTypeOptions = []
}
},
async loadRegionOptions() {
try {
const res = await getDicByCodeApi('CREDIT_ZONE')
const list = res.data || []
this.regionOptions = Array.isArray(list) ? list : []
} catch (e) {
this.regionOptions = []
}
},
async loadGenderOptions() {
try {
const res = await getDicByCodeApi('GENDER_TYPE')
const list = res.data || []
this.genderOptions = Array.isArray(list) ? list : []
} catch (e) {
this.genderOptions = []
}
},
async loadCategoryOptions() {
try {
const res = await getDicByCodeApi('CUSTOMER_CATEGORY')
const list = res.data || []
this.categoryOptions = Array.isArray(list) ? list : []
} catch (e) {
this.categoryOptions = []
}
},
async loadHistoryList(creditId) {
try {
const res = await getByIdCreditHistoryList(creditId);
console.log('historyList__res', res)
const _data = res.data || []
this.historyList = Array.isArray(_data) ? _data : []
} catch (e) {
this.historyList = []
}
},
onViewHistory(item) {
const id = item && (item.id)
if (!id) return
const query = '?id=' + encodeURIComponent(id)
uni.navigateTo({ url: '/pages/credit_manage/history_detail' + query })
},
handleButtonClick(btn) {
if (!btn || btn.disabled) return
const map = {
edit: () => this.onEdit(),
auditDetail: () => this.onAuditDetail(),
audit: () => this.onAudit(),
changeApply: () => this.onChangeApply(),
cancel: () => this.onCancel(),
}
const fn = map[btn.event]
if (typeof fn === 'function') fn()
},
getBusinessId() {
return (this.form && (this.form.id || this.form.code)) || ''
},
onEdit() {
const id = this.getBusinessId()
const query = id ? ('?id=' + encodeURIComponent(id)) : ''
uni.navigateTo({ url: '/pages/credit_manage/modify' + query })
},
onAuditDetail() {
const CACHE_KEY = 'sourceBusinessId'
uni.setStorageSync(CACHE_KEY, this.getBusinessId())
uni.navigateTo({ url: '/pages/flow/audit_detail' })
},
onAudit() {
const CACHE_KEY = 'sourceBusinessId'
uni.setStorageSync(CACHE_KEY, this.getBusinessId())
uni.navigateTo({ url: '/pages/flow/audit' })
},
onChangeApply() {
const id = this.getBusinessId()
const query = id ? ('?id=' + encodeURIComponent(id)) : ''
uni.navigateTo({ url: '/pages/credit_manage/change' + query })
},
onCancel() {
const id = this.getBusinessId()
if (!id) return
uni.showModal({
title: '系统提示',
content: '是否确定取消该流程?',
confirmText: '确定',
cancelText: '取消',
success: (res) => {
if (res && res.confirm) {
cancelApi(id).then(() => {
uni.showToast({ title: '已取消', icon: 'none' })
setTimeout(() => { uni.redirectTo({ url: '/pages/credit_manage/index' }) }, 300)
}).catch(() => {
uni.showToast({ title: '取消失败', icon: 'none' })
})
}
}
})
},
getDicName,
getCategoryClass(categoryName) {
if (!categoryName) return ''
if (categoryName.includes('A') || categoryName.includes('a')) {
return 'category_A'
} else if (categoryName.includes('B') || categoryName.includes('b')) {
return 'category_B'
} else if (categoryName.includes('C') || categoryName.includes('c')) {
return 'category_C'
} else if (categoryName.includes('D') || categoryName.includes('d')) {
return 'category_D'
}
},
}
}
</script>
<style lang="scss" scoped>
.page {
display: flex;
flex-direction: column;
height: 100%;
}
.scroll {
flex: 1;
padding: 8rpx 0 144rpx 0;
}
.detail-page {
background: #f3f3f3;
}
.section {
padding: 32rpx;
background: #fff;
margin-bottom: 20rpx;
position: relative;
.status {
position: absolute;
top: 16rpx;
right: 52rpx;
width: 180rpx;
height: 146rpx;
background-repeat: no-repeat;
background-size: 100% 100%;
background-position: center;
&_AUDIT {
background-image: url('~@/static/images/dev_manage/status_1.png');
}
&_PASS {
background-image: url('~@/static/images/dev_manage/status_2.png');
}
&_REFUSE {
background-image: url('~@/static/images/dev_manage/status_3.png');
}
&_CANCEL {
background-image: url('~@/static/images/dev_manage/status_4.png');
}
}
}
.mgb10 {
margin-bottom: 20rpx;
}
.row {
display: flex;
margin-bottom: 28rpx;
&:last-child {
margin-bottom: 0;
}
&.company {
font-size: 36rpx;
font-weight: 600;
color: rgba(0, 0, 0, 0.9);
padding-top: 32rpx;
line-height: 50rpx;
}
.label {
max-width: 420rpx;
line-height: 32rpx;
font-size: 28rpx;
color: rgba(0, 0, 0, 0.6);
}
.value {
flex: 1;
line-height: 32rpx;
font-size: 28rpx;
color: rgba(0, 0, 0, 0.9);
text-align: right;
&.act {
color: $theme-primary;
}
.category {
display: inline-block;
padding: 4rpx 12rpx;
border-radius: 6rpx;
font-size: 24rpx;
width: auto;
&.category_A {
background: #FFF0ED;
color: #D54941;
}
&.category_B {
background: #FFF1E9;
color: #E37318;
}
&.category_C {
background: #F2F3FF;
color: $theme-primary;
}
&.category_D {
background: #E3F9E9;
color: #2BA471;
}
}
}
}
.card {
padding: 16rpx 0 8rpx;
border-top: 1rpx solid #f0f0f0;
}
.history-header {
display: flex;
background: #F7F7F7;
padding: 20rpx 52rpx 20rpx 32rpx;
.col {
font-size: 28rpx;
color: rgba(0,0,0,0.9);
line-height: 40rpx;
}
.col1 {
width: 20%;
}
.col2 {
width: 50%;
text-align: center;
}
.col3 {
width: 30%;
text-align: right;
}
}
.history-row {
display: flex;
padding: 20rpx 52rpx 20rpx 32rpx;
border-bottom: 1rpx solid #f7f7f7;
.col {
font-size: 28rpx;
color: rgba(0,0,0,0.9);
line-height: 40rpx;
}
.col1 {
width: 20%;
}
.col2 {
width: 50%;
text-align: center;
}
.col3 {
width: 30%;
text-align: right;
}
.link {
color: $theme-primary;
}
}
.title-header {
background-color: #fff;
display: flex;
align-items: center;
padding: 32rpx 32rpx 22rpx;
border-bottom: 1rpx dashed #f0f0f0;
&_icon {
width: 32rpx;
height: 28rpx;
margin-right: 16rpx;
}
span {
color: rgba(0, 0, 0, 0.9);
font-size: 32rpx;
line-height: 44rpx;
font-weight: 600;
}
}
</style>