Commit c5e165686168370be2ff0e32d99ee5ec55bf3acc

Authored by 史婷婷
1 parent 9ee66603

feat: 资信管理-增加办事处,只读,有单独接口(system/dept/getDept)

@@ -14,6 +14,12 @@ @@ -14,6 +14,12 @@
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 + <view class="readonly-text">{{ form.deptName }}</view>
  20 + </template>
  21 + </uni-list-item>
  22 +
17 <uni-list-item class="select-item" :class="form.region ? 'is-filled' : 'is-empty'" clickable 23 <uni-list-item class="select-item" :class="form.region ? 'is-filled' : 'is-empty'" clickable
18 @click="openSheet('region')" :rightText="displayLabel('regionName')" showArrow> 24 @click="openSheet('region')" :rightText="displayLabel('regionName')" showArrow>
19 <template v-slot:body> 25 <template v-slot:body>
@@ -309,7 +315,8 @@ @@ -309,7 +315,8 @@
309 @confirm="onSheetConfirm" /> 315 @confirm="onSheetConfirm" />
310 <RelateSelectSheet :visible.sync="relate.visible" :title="relate.title" :source="relate.source" 316 <RelateSelectSheet :visible.sync="relate.visible" :title="relate.title" :source="relate.source"
311 :display-fields="relate.display" :multiple="relate.multiple" :row-key="relate.rowKey" 317 :display-fields="relate.display" :multiple="relate.multiple" :row-key="relate.rowKey"
312 - :selectedKeys.sync="relate.selectedKeys" :source-extra="{ source: 'CUSTOMER_CREDIT' }" @confirm="onRelateConfirm" /> 318 + :selectedKeys.sync="relate.selectedKeys" :source-extra="{ source: 'CUSTOMER_CREDIT' }"
  319 + @confirm="onRelateConfirm" />
313 </view> 320 </view>
314 321
315 </template> 322 </template>
@@ -320,6 +327,7 @@ import RelateSelectSheet from '@/components/relate-select/index.vue' @@ -320,6 +327,7 @@ import RelateSelectSheet from '@/components/relate-select/index.vue'
320 import { generateCreditCode, getAllUser, getDeptUser, createApi, getArea } from '@/api/credit_manage.js' 327 import { generateCreditCode, getAllUser, getDeptUser, createApi, getArea } from '@/api/credit_manage.js'
321 import { getDicByCodeApi } from '@/api/base.js' 328 import { getDicByCodeApi } from '@/api/base.js'
322 import CorePersonnel from './corePersonnel.vue' 329 import CorePersonnel from './corePersonnel.vue'
  330 +import { getDeptApi } from '@/api/contract'
323 331
324 export default { 332 export default {
325 name: 'CreditManageAdd', 333 name: 'CreditManageAdd',
@@ -379,6 +387,8 @@ export default { @@ -379,6 +387,8 @@ export default {
379 mainIndustry: '', 387 mainIndustry: '',
380 annualMaterialOverview: '', 388 annualMaterialOverview: '',
381 corePersonnelList: [], 389 corePersonnelList: [],
  390 + deptName: '',
  391 + deptId: '',
382 }, 392 },
383 sheet: { visible: false, title: '请选择', field: '', options: [], value: '' }, 393 sheet: { visible: false, title: '请选择', field: '', options: [], value: '' },
384 relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' }, 394 relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' },
@@ -391,6 +401,7 @@ export default { @@ -391,6 +401,7 @@ export default {
391 } 401 }
392 }, 402 },
393 created() { 403 created() {
  404 + this.getDept()
394 this.loadSerialNumber() 405 this.loadSerialNumber()
395 this.loadRegionOptions() 406 this.loadRegionOptions()
396 this.loadEnterpriseTypeOptions() 407 this.loadEnterpriseTypeOptions()
@@ -401,6 +412,15 @@ export default { @@ -401,6 +412,15 @@ export default {
401 this.loadGenderOptions() 412 this.loadGenderOptions()
402 }, 413 },
403 methods: { 414 methods: {
  415 + // 查询当前人所在办事处
  416 + getDept() {
  417 + getDeptApi().then(res => {
  418 + if (res.code === 200) {
  419 + this.form.deptName = res.data.name || ''
  420 + this.form.deptId = res.data.id || ''
  421 + }
  422 + })
  423 + },
404 async loadSerialNumber() { 424 async loadSerialNumber() {
405 try { 425 try {
406 const res = await generateCreditCode() 426 const res = await generateCreditCode()
@@ -428,13 +448,13 @@ export default { @@ -428,13 +448,13 @@ export default {
428 if (field === 'region') { 448 if (field === 'region') {
429 setSheet('区域', this.regionOptions) 449 setSheet('区域', this.regionOptions)
430 } else 450 } else
431 - if (field === 'enterpriseType') {  
432 - setSheet('企业类型', this.enterpriseTypeOptions)  
433 - } else if (field === 'suggestedCategory') {  
434 - setSheet('建议客户分类', this.categoryOptions)  
435 - } else if (field === 'investigator') {  
436 - setSheet('调查人', this.investigatorOptions)  
437 - } 451 + if (field === 'enterpriseType') {
  452 + setSheet('企业类型', this.enterpriseTypeOptions)
  453 + } else if (field === 'suggestedCategory') {
  454 + setSheet('建议客户分类', this.categoryOptions)
  455 + } else if (field === 'investigator') {
  456 + setSheet('调查人', this.investigatorOptions)
  457 + }
438 }, 458 },
439 onSheetConfirm({ value, label }) { 459 onSheetConfirm({ value, label }) {
440 const field = this.sheet.field 460 const field = this.sheet.field
@@ -558,7 +578,7 @@ export default { @@ -558,7 +578,7 @@ export default {
558 }, 578 },
559 async onSubmit() { 579 async onSubmit() {
560 if (!this.validateRequired()) return 580 if (!this.validateRequired()) return
561 - const payload = { 581 + const payload = {
562 ...this.form, 582 ...this.form,
563 status: 'AUDIT' 583 status: 'AUDIT'
564 } 584 }
@@ -573,6 +593,7 @@ export default { @@ -573,6 +593,7 @@ export default {
573 delete payload.suggestedCategoryName 593 delete payload.suggestedCategoryName
574 delete payload.companyIdName 594 delete payload.companyIdName
575 delete payload.investigatorName 595 delete payload.investigatorName
  596 + delete payload.deptName
576 try { 597 try {
577 await createApi(payload) 598 await createApi(payload)
578 uni.showToast({ title: '提交成功', icon: 'success' }) 599 uni.showToast({ title: '提交成功', icon: 'success' })
@@ -760,4 +781,15 @@ export default { @@ -760,4 +781,15 @@ export default {
760 } 781 }
761 } 782 }
762 } 783 }
  784 +
  785 +
  786 +/* 只读文本样式 */
  787 +.readonly-text {
  788 + color: rgba(0, 0, 0, 0.9);
  789 + font-size: 32rpx;
  790 + line-height: 48rpx;
  791 + text-align: right;
  792 + white-space: pre-wrap;
  793 + word-break: break-all;
  794 +}
763 </style> 795 </style>
@@ -13,6 +13,12 @@ @@ -13,6 +13,12 @@
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 + <view class="readonly-text">{{ form.deptName }}</view>
  19 + </template>
  20 + </uni-list-item>
  21 +
16 <uni-list-item class="select-item" :class="form.region ? 'is-filled' : 'is-empty'" clickable 22 <uni-list-item class="select-item" :class="form.region ? 'is-filled' : 'is-empty'" clickable
17 @click="openSheet('region')" :rightText="displayLabel('regionName')" showArrow> 23 @click="openSheet('region')" :rightText="displayLabel('regionName')" showArrow>
18 <template v-slot:body> 24 <template v-slot:body>
@@ -758,4 +764,13 @@ export default { @@ -758,4 +764,13 @@ export default {
758 } 764 }
759 } 765 }
760 } 766 }
  767 +/* 只读文本样式 */
  768 +.readonly-text {
  769 + color: rgba(0, 0, 0, 0.9);
  770 + font-size: 32rpx;
  771 + line-height: 48rpx;
  772 + text-align: right;
  773 + white-space: pre-wrap;
  774 + word-break: break-all;
  775 +}
761 </style> 776 </style>
@@ -6,6 +6,7 @@ @@ -6,6 +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.deptName }}</text></view>
9 <view class="row"><text class="label">区域</text><text class="value">{{ form.regionName }}</text></view> 10 <view class="row"><text class="label">区域</text><text class="value">{{ form.regionName }}</text></view>
10 <view class="row"><text class="label">简写名称</text><text class="value">{{ form.customerShortName }}</text> 11 <view class="row"><text class="label">简写名称</text><text class="value">{{ form.customerShortName }}</text>
11 </view> 12 </view>
@@ -13,6 +13,11 @@ @@ -13,6 +13,11 @@
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 + <view class="readonly-text">{{ form.deptName }}</view>
  19 + </template>
  20 + </uni-list-item>
16 <uni-list-item class="select-item" :class="form.region ? 'is-filled' : 'is-empty'" clickable 21 <uni-list-item class="select-item" :class="form.region ? 'is-filled' : 'is-empty'" clickable
17 @click="openSheet('region')" :rightText="displayLabel('regionName')" showArrow> 22 @click="openSheet('region')" :rightText="displayLabel('regionName')" showArrow>
18 <template v-slot:body> 23 <template v-slot:body>
@@ -759,4 +764,13 @@ export default { @@ -759,4 +764,13 @@ export default {
759 } 764 }
760 } 765 }
761 } 766 }
  767 +/* 只读文本样式 */
  768 +.readonly-text {
  769 + color: rgba(0, 0, 0, 0.9);
  770 + font-size: 32rpx;
  771 + line-height: 48rpx;
  772 + text-align: right;
  773 + white-space: pre-wrap;
  774 + word-break: break-all;
  775 +}
762 </style> 776 </style>
@@ -3,6 +3,7 @@ @@ -3,6 +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.deptName }}</text></view>
6 <view class="row"><text class="label">区域</text><text class="value">{{ form.regionName }}</text></view> 7 <view class="row"><text class="label">区域</text><text class="value">{{ form.regionName }}</text></view>
7 <view class="row"><text class="label">简写名称</text><text class="value">{{ form.customerShortName }}</text> 8 <view class="row"><text class="label">简写名称</text><text class="value">{{ form.customerShortName }}</text>
8 </view> 9 </view>