Commit b3858f7a6f3c7ce5049a4121a6f5240f0a182b21

Authored by 史婷婷
1 parent 46f6440f

feat: 资信管理-区域-改成 枚举—卡片&新增&编辑&查看&审核&审核详情&变更 —CREDIT_ZONE

@@ -14,9 +14,10 @@ @@ -14,9 +14,10 @@
14 </template> 14 </template>
15 </uni-list-item> 15 </uni-list-item>
16 16
17 - <uni-list-item title="区域">  
18 - <template v-slot:footer>  
19 - <uni-easyinput v-model="form.region" placeholder="请输入区域" :inputBorder="false" /> 17 + <uni-list-item class="select-item" :class="form.region ? 'is-filled' : 'is-empty'" clickable
  18 + @click="openSheet('region')" :rightText="displayLabel('regionName')" showArrow>
  19 + <template v-slot:body>
  20 + <view class="item-title"><text>区域</text></view>
20 </template> 21 </template>
21 </uni-list-item> 22 </uni-list-item>
22 <uni-list-item title="客户简称"> 23 <uni-list-item title="客户简称">
@@ -328,6 +329,7 @@ export default { @@ -328,6 +329,7 @@ export default {
328 form: { 329 form: {
329 serialNumber: '', 330 serialNumber: '',
330 region: '', 331 region: '',
  332 + regionName: '',
331 customerShortName: '', 333 customerShortName: '',
332 enterpriseType: '', 334 enterpriseType: '',
333 enterpriseTypeName: '', 335 enterpriseTypeName: '',
@@ -381,6 +383,7 @@ export default { @@ -381,6 +383,7 @@ export default {
381 sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, 383 sheet: { visible: false, title: '请选择', field: '', options: [], value: '' },
382 relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, 384 relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' },
383 enterpriseTypeOptions: [], 385 enterpriseTypeOptions: [],
  386 + regionOptions: [],
384 categoryOptions: [], 387 categoryOptions: [],
385 companyCategoryOptions: [], 388 companyCategoryOptions: [],
386 investigatorOptions: [], 389 investigatorOptions: [],
@@ -389,6 +392,7 @@ export default { @@ -389,6 +392,7 @@ export default {
389 }, 392 },
390 created() { 393 created() {
391 this.loadSerialNumber() 394 this.loadSerialNumber()
  395 + this.loadRegionOptions()
392 this.loadEnterpriseTypeOptions() 396 this.loadEnterpriseTypeOptions()
393 this.loadCategoryOptions() 397 this.loadCategoryOptions()
394 this.loadCompanyCategoryOptions() 398 this.loadCompanyCategoryOptions()
@@ -408,6 +412,7 @@ export default { @@ -408,6 +412,7 @@ export default {
408 displayLabel(field) { 412 displayLabel(field) {
409 const m = this.form 413 const m = this.form
410 const map = { 414 const map = {
  415 + regionName: '请选择区域',
411 enterpriseTypeName: '请选择企业类型', 416 enterpriseTypeName: '请选择企业类型',
412 suggestedCategoryName: '请选择建议客户分类', 417 suggestedCategoryName: '请选择建议客户分类',
413 } 418 }
@@ -420,6 +425,9 @@ export default { @@ -420,6 +425,9 @@ export default {
420 const match = (options || []).find(o => String(o.label) === String(current) || String(o.value) === String(current)) 425 const match = (options || []).find(o => String(o.label) === String(current) || String(o.value) === String(current))
421 this.sheet = { ...this.sheet, visible: true, title, options, field, value: match ? match.value : '' } 426 this.sheet = { ...this.sheet, visible: true, title, options, field, value: match ? match.value : '' }
422 } 427 }
  428 + if (field === 'region') {
  429 + setSheet('区域', this.regionOptions)
  430 + } else
423 if (field === 'enterpriseType') { 431 if (field === 'enterpriseType') {
424 setSheet('企业类型', this.enterpriseTypeOptions) 432 setSheet('企业类型', this.enterpriseTypeOptions)
425 } else if (field === 'suggestedCategory') { 433 } else if (field === 'suggestedCategory') {
@@ -490,6 +498,15 @@ export default { @@ -490,6 +498,15 @@ export default {
490 this.enterpriseTypeOptions = [] 498 this.enterpriseTypeOptions = []
491 } 499 }
492 }, 500 },
  501 + async loadRegionOptions() {
  502 + try {
  503 + const res = await getDicByCodeApi('CREDIT_ZONE')
  504 + const list = res.data || []
  505 + this.regionOptions = (list || []).map(it => ({ label: it.name || '', value: it.code || '' }))
  506 + } catch (e) {
  507 + this.regionOptions = []
  508 + }
  509 + },
493 async loadCategoryOptions() { 510 async loadCategoryOptions() {
494 try { 511 try {
495 const res = await getDicByCodeApi('CUSTOMER_CATEGORY') 512 const res = await getDicByCodeApi('CUSTOMER_CATEGORY')
@@ -552,6 +569,7 @@ export default { @@ -552,6 +569,7 @@ export default {
552 }) 569 })
553 console.log('onSubmit__payload_2', payload); 570 console.log('onSubmit__payload_2', payload);
554 delete payload.enterpriseTypeName 571 delete payload.enterpriseTypeName
  572 + delete payload.regionName
555 delete payload.suggestedCategoryName 573 delete payload.suggestedCategoryName
556 delete payload.companyIdName 574 delete payload.companyIdName
557 delete payload.investigatorName 575 delete payload.investigatorName
@@ -13,9 +13,10 @@ @@ -13,9 +13,10 @@
13 </template> 13 </template>
14 </uni-list-item> 14 </uni-list-item>
15 15
16 - <uni-list-item title="区域">  
17 - <template v-slot:footer>  
18 - <uni-easyinput v-model="form.region" placeholder="请输入区域" :inputBorder="false" /> 16 + <uni-list-item class="select-item" :class="form.region ? 'is-filled' : 'is-empty'" clickable
  17 + @click="openSheet('region')" :rightText="displayLabel('regionName')" showArrow>
  18 + <template v-slot:body>
  19 + <view class="item-title"><text>区域</text></view>
19 </template> 20 </template>
20 </uni-list-item> 21 </uni-list-item>
21 <uni-list-item title="客户简称"> 22 <uni-list-item title="客户简称">
@@ -328,6 +329,7 @@ export default { @@ -328,6 +329,7 @@ export default {
328 id: '', 329 id: '',
329 serialNumber: '', 330 serialNumber: '',
330 region: '', 331 region: '',
  332 + regionName: '',
331 customerShortName: '', 333 customerShortName: '',
332 enterpriseType: '', 334 enterpriseType: '',
333 enterpriseTypeName: '', 335 enterpriseTypeName: '',
@@ -383,6 +385,7 @@ export default { @@ -383,6 +385,7 @@ export default {
383 sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, 385 sheet: { visible: false, title: '请选择', field: '', options: [], value: '' },
384 relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, 386 relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' },
385 enterpriseTypeOptions: [], 387 enterpriseTypeOptions: [],
  388 + regionOptions: [],
386 categoryOptions: [], 389 categoryOptions: [],
387 investigatorOptions: [], 390 investigatorOptions: [],
388 genderOptions: [] 391 genderOptions: []
@@ -393,6 +396,7 @@ export default { @@ -393,6 +396,7 @@ export default {
393 if (this.id) this.loadDetail(this.id) 396 if (this.id) this.loadDetail(this.id)
394 }, 397 },
395 created() { 398 created() {
  399 + this.loadRegionOptions()
396 this.loadEnterpriseTypeOptions() 400 this.loadEnterpriseTypeOptions()
397 this.loadCategoryOptions() 401 this.loadCategoryOptions()
398 this.loadInvestigatorOptions() 402 this.loadInvestigatorOptions()
@@ -400,6 +404,7 @@ export default { @@ -400,6 +404,7 @@ export default {
400 }, 404 },
401 watch: { 405 watch: {
402 enterpriseTypeOptions() { this.refreshLabelFields() }, 406 enterpriseTypeOptions() { this.refreshLabelFields() },
  407 + regionOptions() { this.refreshLabelFields() },
403 categoryOptions() { this.refreshLabelFields() }, 408 categoryOptions() { this.refreshLabelFields() },
404 investigatorOptions() { this.refreshLabelFields() } 409 investigatorOptions() { this.refreshLabelFields() }
405 }, 410 },
@@ -425,6 +430,7 @@ export default { @@ -425,6 +430,7 @@ export default {
425 displayLabel(field) { 430 displayLabel(field) {
426 const m = this.form 431 const m = this.form
427 const map = { 432 const map = {
  433 + regionName: '请选择区域',
428 enterpriseTypeName: '请选择企业类型', 434 enterpriseTypeName: '请选择企业类型',
429 suggestedCategoryName: '请选择建议客户分类', 435 suggestedCategoryName: '请选择建议客户分类',
430 } 436 }
@@ -433,9 +439,11 @@ export default { @@ -433,9 +439,11 @@ export default {
433 }, 439 },
434 refreshLabelFields() { 440 refreshLabelFields() {
435 const et = this.enterpriseTypeOptions.find(o => String(o.value) === String(this.form.enterpriseType)) 441 const et = this.enterpriseTypeOptions.find(o => String(o.value) === String(this.form.enterpriseType))
  442 + const rn = this.regionOptions.find(o => String(o.value) === String(this.form.region))
436 const ct = this.categoryOptions.find(o => String(o.value) === String(this.form.suggestedCategory)) 443 const ct = this.categoryOptions.find(o => String(o.value) === String(this.form.suggestedCategory))
437 const iu = this.investigatorOptions.find(o => String(o.value) === String(this.form.investigator)) 444 const iu = this.investigatorOptions.find(o => String(o.value) === String(this.form.investigator))
438 this.form.enterpriseTypeName = et ? (et.label || '') : this.form.enterpriseTypeName 445 this.form.enterpriseTypeName = et ? (et.label || '') : this.form.enterpriseTypeName
  446 + this.form.regionName = rn ? (rn.label || '') : this.form.regionName
439 this.form.suggestedCategoryName = ct ? (ct.label || '') : this.form.suggestedCategoryName 447 this.form.suggestedCategoryName = ct ? (ct.label || '') : this.form.suggestedCategoryName
440 this.form.investigatorName = iu ? (iu.label || '') : this.form.investigatorName 448 this.form.investigatorName = iu ? (iu.label || '') : this.form.investigatorName
441 }, 449 },
@@ -445,6 +453,9 @@ export default { @@ -445,6 +453,9 @@ export default {
445 const match = (options || []).find(o => String(o.label) === String(current) || String(o.value) === String(current)) 453 const match = (options || []).find(o => String(o.label) === String(current) || String(o.value) === String(current))
446 this.sheet = { ...this.sheet, visible: true, title, options, field, value: match ? match.value : '' } 454 this.sheet = { ...this.sheet, visible: true, title, options, field, value: match ? match.value : '' }
447 } 455 }
  456 + if (field === 'region') {
  457 + setSheet('区域', this.regionOptions)
  458 + } else
448 if (field === 'enterpriseType') { 459 if (field === 'enterpriseType') {
449 setSheet('企业类型', this.enterpriseTypeOptions) 460 setSheet('企业类型', this.enterpriseTypeOptions)
450 } else if (field === 'suggestedCategory') { 461 } else if (field === 'suggestedCategory') {
@@ -515,6 +526,15 @@ export default { @@ -515,6 +526,15 @@ export default {
515 this.enterpriseTypeOptions = [] 526 this.enterpriseTypeOptions = []
516 } 527 }
517 }, 528 },
  529 + async loadRegionOptions() {
  530 + try {
  531 + const res = await getDicByCodeApi('CREDIT_ZONE')
  532 + const list = res.data || []
  533 + this.regionOptions = (list || []).map(it => ({ label: it.name || '', value: it.code || '' }))
  534 + } catch (e) {
  535 + this.regionOptions = []
  536 + }
  537 + },
518 async loadCategoryOptions() { 538 async loadCategoryOptions() {
519 try { 539 try {
520 const res = await getDicByCodeApi('CUSTOMER_CATEGORY') 540 const res = await getDicByCodeApi('CUSTOMER_CATEGORY')
@@ -557,6 +577,7 @@ export default { @@ -557,6 +577,7 @@ export default {
557 delete it.sexName 577 delete it.sexName
558 }) 578 })
559 delete payload.enterpriseTypeName 579 delete payload.enterpriseTypeName
  580 + delete payload.regionName
560 delete payload.suggestedCategoryName 581 delete payload.suggestedCategoryName
561 delete payload.companyIdName 582 delete payload.companyIdName
562 delete payload.investigatorName 583 delete payload.investigatorName
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 <text class="row company">{{ form.companyName }}</text> 6 <text class="row company">{{ form.companyName }}</text>
7 <view :class="['status', `status_${form.status}`]" /> 7 <view :class="['status', `status_${form.status}`]" />
8 <view class="row"><text class="label">编号</text><text class="value">{{ form.serialNumber }}</text></view> 8 <view class="row"><text class="label">编号</text><text class="value">{{ form.serialNumber }}</text></view>
9 - <view class="row"><text class="label">区域</text><text class="value">{{ form.region }}</text></view> 9 + <view class="row"><text class="label">区域</text><text class="value">{{ getDicName('CREDIT_ZONE', form.region, regionOptions) }}</text></view>
10 <view class="row"><text class="label">客户简称</text><text class="value">{{ form.customerShortName }}</text> 10 <view class="row"><text class="label">客户简称</text><text class="value">{{ form.customerShortName }}</text>
11 </view> 11 </view>
12 <view class="row"><text class="label">企业类型</text><text class="value">{{ getDicName('ENTERPRISE_TYPE', 12 <view class="row"><text class="label">企业类型</text><text class="value">{{ getDicName('ENTERPRISE_TYPE',
@@ -184,6 +184,7 @@ export default { @@ -184,6 +184,7 @@ export default {
184 return { 184 return {
185 form: {}, 185 form: {},
186 enterpriseTypeOptions: [], 186 enterpriseTypeOptions: [],
  187 + regionOptions: [],
187 genderOptions: [], 188 genderOptions: [],
188 categoryOptions: [], 189 categoryOptions: [],
189 historyList: [], 190 historyList: [],
@@ -192,7 +193,7 @@ export default { @@ -192,7 +193,7 @@ export default {
192 { text: '审核详情', visible: true, variant: 'outline', event: 'auditDetail' }, 193 { text: '审核详情', visible: true, variant: 'outline', event: 'auditDetail' },
193 { text: '审核', visible: true, variant: 'primary', event: 'audit' }, 194 { text: '审核', visible: true, variant: 'primary', event: 'audit' },
194 { text: '申请变更', visible: true, variant: 'outline', event: 'changeApply' }, 195 { text: '申请变更', visible: true, variant: 'outline', event: 'changeApply' },
195 - { text: '取消', visible: true, variant: 'outline', event: 'cancel', style: { color: 'rgba(0,0,0,0.9)', border: '1px solid #DCDCDC' } }, 196 + { text: '取消', visible: true, vxrariant: 'outline', event: 'cancel', style: { color: 'rgba(0,0,0,0.9)', border: '1px solid #DCDCDC' } },
196 ], 197 ],
197 } 198 }
198 }, 199 },
@@ -219,6 +220,7 @@ export default { @@ -219,6 +220,7 @@ export default {
219 } 220 }
220 }, 221 },
221 created() { 222 created() {
  223 + this.loadRegionOptions()
222 this.loadEnterpriseTypeOptions() 224 this.loadEnterpriseTypeOptions()
223 this.loadGenderOptions() 225 this.loadGenderOptions()
224 this.loadCategoryOptions() 226 this.loadCategoryOptions()
@@ -248,6 +250,15 @@ export default { @@ -248,6 +250,15 @@ export default {
248 this.enterpriseTypeOptions = [] 250 this.enterpriseTypeOptions = []
249 } 251 }
250 }, 252 },
  253 + async loadRegionOptions() {
  254 + try {
  255 + const res = await getDicByCodeApi('CREDIT_ZONE')
  256 + const list = res.data || []
  257 + this.regionOptions = Array.isArray(list) ? list : []
  258 + } catch (e) {
  259 + this.regionOptions = []
  260 + }
  261 + },
251 async loadGenderOptions() { 262 async loadGenderOptions() {
252 try { 263 try {
253 const res = await getDicByCodeApi('GENDER_TYPE') 264 const res = await getDicByCodeApi('GENDER_TYPE')
@@ -553,4 +564,4 @@ export default { @@ -553,4 +564,4 @@ export default {
553 font-weight: 600; 564 font-weight: 600;
554 } 565 }
555 } 566 }
556 -</style>  
  567 +</style>
@@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
33 <text>企业类型</text><text>{{ getDicName('ENTERPRISE_TYPE', item.enterpriseType, dicOptions.ENTERPRISE_TYPE) || '-' }}</text> 33 <text>企业类型</text><text>{{ getDicName('ENTERPRISE_TYPE', item.enterpriseType, dicOptions.ENTERPRISE_TYPE) || '-' }}</text>
34 </view> 34 </view>
35 <view class="info-row"> 35 <view class="info-row">
36 - <text>区域</text><text>{{ item.region || '-' }}</text> 36 + <text>区域</text><text>{{ getDicName('CREDIT_ZONE', item.region, dicOptions.CREDIT_ZONE) || '-' }}</text>
37 </view> 37 </view>
38 <view class="info-row"> 38 <view class="info-row">
39 <text>客户分类</text><text 39 <text>客户分类</text><text
@@ -122,7 +122,8 @@ @@ -122,7 +122,8 @@
122 dicOptions: { 122 dicOptions: {
123 CUSTOMER_CATEGORY: [], 123 CUSTOMER_CATEGORY: [],
124 AUDIT_STATUS: [], 124 AUDIT_STATUS: [],
125 - ENTERPRISE_TYPE: [] 125 + ENTERPRISE_TYPE: [],
  126 + CREDIT_ZONE: []
126 }, 127 },
127 statusLocal: [], 128 statusLocal: [],
128 categoryLocal: [] 129 categoryLocal: []
@@ -267,11 +268,12 @@ @@ -267,11 +268,12 @@
267 }) 268 })
268 }, 269 },
269 loadAllDicData() { 270 loadAllDicData() {
270 - const dicCodes = ['CUSTOMER_CATEGORY', 'AUDIT_STATUS', 'ENTERPRISE_TYPE'] 271 + const dicCodes = ['CUSTOMER_CATEGORY', 'AUDIT_STATUS', 'ENTERPRISE_TYPE', 'CREDIT_ZONE']
271 return getDicByCodes(dicCodes).then(results => { 272 return getDicByCodes(dicCodes).then(results => {
272 this.dicOptions.CUSTOMER_CATEGORY = results.CUSTOMER_CATEGORY.data || [] 273 this.dicOptions.CUSTOMER_CATEGORY = results.CUSTOMER_CATEGORY.data || []
273 this.dicOptions.AUDIT_STATUS = results.AUDIT_STATUS.data || [] 274 this.dicOptions.AUDIT_STATUS = results.AUDIT_STATUS.data || []
274 this.dicOptions.ENTERPRISE_TYPE = results.ENTERPRISE_TYPE.data || [] 275 this.dicOptions.ENTERPRISE_TYPE = results.ENTERPRISE_TYPE.data || []
  276 + this.dicOptions.CREDIT_ZONE = results.CREDIT_ZONE.data || [];
275 this.categoryLocal = (this.dicOptions.CUSTOMER_CATEGORY || []).map(it => ({ 277 this.categoryLocal = (this.dicOptions.CUSTOMER_CATEGORY || []).map(it => ({
276 value: it.code, 278 value: it.code,
277 text: it.name 279 text: it.name
@@ -284,7 +286,8 @@ @@ -284,7 +286,8 @@
284 this.dicOptions = { 286 this.dicOptions = {
285 CUSTOMER_CATEGORY: [], 287 CUSTOMER_CATEGORY: [],
286 AUDIT_STATUS: [], 288 AUDIT_STATUS: [],
287 - ENTERPRISE_TYPE: [] 289 + ENTERPRISE_TYPE: [],
  290 + CREDIT_ZONE: []
288 } 291 }
289 this.categoryLocal = [] 292 this.categoryLocal = []
290 this.statusLocal = [] 293 this.statusLocal = []
@@ -13,9 +13,10 @@ @@ -13,9 +13,10 @@
13 </template> 13 </template>
14 </uni-list-item> 14 </uni-list-item>
15 15
16 - <uni-list-item title="区域">  
17 - <template v-slot:footer>  
18 - <uni-easyinput v-model="form.region" placeholder="请输入区域" :inputBorder="false" /> 16 + <uni-list-item class="select-item" :class="form.region ? 'is-filled' : 'is-empty'" clickable
  17 + @click="openSheet('region')" :rightText="displayLabel('regionName')" showArrow>
  18 + <template v-slot:body>
  19 + <view class="item-title"><text>区域</text></view>
19 </template> 20 </template>
20 </uni-list-item> 21 </uni-list-item>
21 <uni-list-item title="客户简称"> 22 <uni-list-item title="客户简称">
@@ -328,6 +329,7 @@ export default { @@ -328,6 +329,7 @@ export default {
328 id: '', 329 id: '',
329 serialNumber: '', 330 serialNumber: '',
330 region: '', 331 region: '',
  332 + regionName: '',
331 customerShortName: '', 333 customerShortName: '',
332 enterpriseType: '', 334 enterpriseType: '',
333 enterpriseTypeName: '', 335 enterpriseTypeName: '',
@@ -383,6 +385,7 @@ export default { @@ -383,6 +385,7 @@ export default {
383 sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, 385 sheet: { visible: false, title: '请选择', field: '', options: [], value: '' },
384 relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, 386 relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' },
385 enterpriseTypeOptions: [], 387 enterpriseTypeOptions: [],
  388 + regionOptions: [],
386 categoryOptions: [], 389 categoryOptions: [],
387 investigatorOptions: [], 390 investigatorOptions: [],
388 genderOptions: [] 391 genderOptions: []
@@ -393,6 +396,7 @@ export default { @@ -393,6 +396,7 @@ export default {
393 if (this.id) this.loadDetail(this.id) 396 if (this.id) this.loadDetail(this.id)
394 }, 397 },
395 created() { 398 created() {
  399 + this.loadRegionOptions()
396 this.loadEnterpriseTypeOptions() 400 this.loadEnterpriseTypeOptions()
397 this.loadCategoryOptions() 401 this.loadCategoryOptions()
398 this.loadInvestigatorOptions() 402 this.loadInvestigatorOptions()
@@ -400,6 +404,7 @@ export default { @@ -400,6 +404,7 @@ export default {
400 }, 404 },
401 watch: { 405 watch: {
402 enterpriseTypeOptions() { this.refreshLabelFields() }, 406 enterpriseTypeOptions() { this.refreshLabelFields() },
  407 + regionOptions() { this.refreshLabelFields() },
403 categoryOptions() { this.refreshLabelFields() }, 408 categoryOptions() { this.refreshLabelFields() },
404 investigatorOptions() { this.refreshLabelFields() } 409 investigatorOptions() { this.refreshLabelFields() }
405 }, 410 },
@@ -425,6 +430,7 @@ export default { @@ -425,6 +430,7 @@ export default {
425 displayLabel(field) { 430 displayLabel(field) {
426 const m = this.form 431 const m = this.form
427 const map = { 432 const map = {
  433 + regionName: '请选择区域',
428 enterpriseTypeName: '请选择企业类型', 434 enterpriseTypeName: '请选择企业类型',
429 suggestedCategoryName: '请选择建议客户分类', 435 suggestedCategoryName: '请选择建议客户分类',
430 } 436 }
@@ -433,9 +439,11 @@ export default { @@ -433,9 +439,11 @@ export default {
433 }, 439 },
434 refreshLabelFields() { 440 refreshLabelFields() {
435 const et = this.enterpriseTypeOptions.find(o => String(o.value) === String(this.form.enterpriseType)) 441 const et = this.enterpriseTypeOptions.find(o => String(o.value) === String(this.form.enterpriseType))
  442 + const rn = this.regionOptions.find(o => String(o.value) === String(this.form.region))
436 const ct = this.categoryOptions.find(o => String(o.value) === String(this.form.suggestedCategory)) 443 const ct = this.categoryOptions.find(o => String(o.value) === String(this.form.suggestedCategory))
437 const iu = this.investigatorOptions.find(o => String(o.value) === String(this.form.investigator)) 444 const iu = this.investigatorOptions.find(o => String(o.value) === String(this.form.investigator))
438 this.form.enterpriseTypeName = et ? (et.label || '') : this.form.enterpriseTypeName 445 this.form.enterpriseTypeName = et ? (et.label || '') : this.form.enterpriseTypeName
  446 + this.form.regionName = rn ? (rn.label || '') : this.form.regionName
439 this.form.suggestedCategoryName = ct ? (ct.label || '') : this.form.suggestedCategoryName 447 this.form.suggestedCategoryName = ct ? (ct.label || '') : this.form.suggestedCategoryName
440 this.form.investigatorName = iu ? (iu.label || '') : this.form.investigatorName 448 this.form.investigatorName = iu ? (iu.label || '') : this.form.investigatorName
441 }, 449 },
@@ -445,6 +453,9 @@ export default { @@ -445,6 +453,9 @@ export default {
445 const match = (options || []).find(o => String(o.label) === String(current) || String(o.value) === String(current)) 453 const match = (options || []).find(o => String(o.label) === String(current) || String(o.value) === String(current))
446 this.sheet = { ...this.sheet, visible: true, title, options, field, value: match ? match.value : '' } 454 this.sheet = { ...this.sheet, visible: true, title, options, field, value: match ? match.value : '' }
447 } 455 }
  456 + if (field === 'region') {
  457 + setSheet('区域', this.regionOptions)
  458 + } else
448 if (field === 'enterpriseType') { 459 if (field === 'enterpriseType') {
449 setSheet('企业类型', this.enterpriseTypeOptions) 460 setSheet('企业类型', this.enterpriseTypeOptions)
450 } else if (field === 'suggestedCategory') { 461 } else if (field === 'suggestedCategory') {
@@ -515,6 +526,15 @@ export default { @@ -515,6 +526,15 @@ export default {
515 this.enterpriseTypeOptions = [] 526 this.enterpriseTypeOptions = []
516 } 527 }
517 }, 528 },
  529 + async loadRegionOptions() {
  530 + try {
  531 + const res = await getDicByCodeApi('CREDIT_ZONE')
  532 + const list = res.data || []
  533 + this.regionOptions = (list || []).map(it => ({ label: it.name || '', value: it.code || '' }))
  534 + } catch (e) {
  535 + this.regionOptions = []
  536 + }
  537 + },
518 async loadCategoryOptions() { 538 async loadCategoryOptions() {
519 try { 539 try {
520 const res = await getDicByCodeApi('CUSTOMER_CATEGORY') 540 const res = await getDicByCodeApi('CUSTOMER_CATEGORY')
@@ -557,6 +577,7 @@ export default { @@ -557,6 +577,7 @@ export default {
557 delete it.sexName 577 delete it.sexName
558 }) 578 })
559 delete payload.enterpriseTypeName 579 delete payload.enterpriseTypeName
  580 + delete payload.regionName
560 delete payload.suggestedCategoryName 581 delete payload.suggestedCategoryName
561 delete payload.companyIdName 582 delete payload.companyIdName
562 delete payload.investigatorName 583 delete payload.investigatorName
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <view class="section"> 3 <view class="section">
4 <text class="row company">{{ form.companyName }}</text> 4 <text class="row company">{{ form.companyName }}</text>
5 <view class="row"><text class="label">编号</text><text class="value">{{ form.serialNumber }}</text></view> 5 <view class="row"><text class="label">编号</text><text class="value">{{ form.serialNumber }}</text></view>
6 - <view class="row"><text class="label">区域</text><text class="value">{{ form.region }}</text></view> 6 + <view class="row"><text class="label">区域</text><text class="value">{{ getDicName('CREDIT_ZONE', form.region, regionOptions) }}</text></view>
7 <view class="row"><text class="label">客户简称</text><text class="value">{{ form.customerShortName }}</text> 7 <view class="row"><text class="label">客户简称</text><text class="value">{{ form.customerShortName }}</text>
8 </view> 8 </view>
9 <view class="row"><text class="label">企业类型</text><text class="value">{{ getDicName('ENTERPRISE_TYPE', 9 <view class="row"><text class="label">企业类型</text><text class="value">{{ getDicName('ENTERPRISE_TYPE',
@@ -188,12 +188,14 @@ export default { @@ -188,12 +188,14 @@ export default {
188 return { 188 return {
189 form: {}, 189 form: {},
190 enterpriseTypeOptions: [], 190 enterpriseTypeOptions: [],
  191 + regionOptions: [],
191 genderOptions: [], 192 genderOptions: [],
192 categoryOptions: [], 193 categoryOptions: [],
193 historyList: [] 194 historyList: []
194 } 195 }
195 }, 196 },
196 created() { 197 created() {
  198 + this.loadRegionOptions()
197 this.loadEnterpriseTypeOptions() 199 this.loadEnterpriseTypeOptions()
198 this.loadGenderOptions() 200 this.loadGenderOptions()
199 this.loadCategoryOptions() 201 this.loadCategoryOptions()
@@ -228,6 +230,15 @@ export default { @@ -228,6 +230,15 @@ export default {
228 this.enterpriseTypeOptions = [] 230 this.enterpriseTypeOptions = []
229 } 231 }
230 }, 232 },
  233 + async loadRegionOptions() {
  234 + try {
  235 + const res = await getDicByCodeApi('CREDIT_ZONE')
  236 + const list = res.data || []
  237 + this.regionOptions = Array.isArray(list) ? list : []
  238 + } catch (e) {
  239 + this.regionOptions = []
  240 + }
  241 + },
231 async loadGenderOptions() { 242 async loadGenderOptions() {
232 try { 243 try {
233 const res = await getDicByCodeApi('GENDER_TYPE') 244 const res = await getDicByCodeApi('GENDER_TYPE')
@@ -427,4 +438,4 @@ export default { @@ -427,4 +438,4 @@ export default {
427 .mgb10 { 438 .mgb10 {
428 margin-bottom: 20rpx; 439 margin-bottom: 20rpx;
429 } 440 }
430 -</style>  
  441 +</style>