Commit c5e165686168370be2ff0e32d99ee5ec55bf3acc

Authored by 史婷婷
1 parent 9ee66603

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

... ... @@ -14,6 +14,12 @@
14 14 </template>
15 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 23 <uni-list-item class="select-item" :class="form.region ? 'is-filled' : 'is-empty'" clickable
18 24 @click="openSheet('region')" :rightText="displayLabel('regionName')" showArrow>
19 25 <template v-slot:body>
... ... @@ -309,7 +315,8 @@
309 315 @confirm="onSheetConfirm" />
310 316 <RelateSelectSheet :visible.sync="relate.visible" :title="relate.title" :source="relate.source"
311 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 320 </view>
314 321
315 322 </template>
... ... @@ -320,6 +327,7 @@ import RelateSelectSheet from '@/components/relate-select/index.vue'
320 327 import { generateCreditCode, getAllUser, getDeptUser, createApi, getArea } from '@/api/credit_manage.js'
321 328 import { getDicByCodeApi } from '@/api/base.js'
322 329 import CorePersonnel from './corePersonnel.vue'
  330 +import { getDeptApi } from '@/api/contract'
323 331
324 332 export default {
325 333 name: 'CreditManageAdd',
... ... @@ -379,6 +387,8 @@ export default {
379 387 mainIndustry: '',
380 388 annualMaterialOverview: '',
381 389 corePersonnelList: [],
  390 + deptName: '',
  391 + deptId: '',
382 392 },
383 393 sheet: { visible: false, title: '请选择', field: '', options: [], value: '' },
384 394 relate: { visible: false, title: '选择', source: '', display: [], multiple: false, rowKey: 'id', selectedKeys: [], fieldKey: '' },
... ... @@ -391,6 +401,7 @@ export default {
391 401 }
392 402 },
393 403 created() {
  404 + this.getDept()
394 405 this.loadSerialNumber()
395 406 this.loadRegionOptions()
396 407 this.loadEnterpriseTypeOptions()
... ... @@ -401,6 +412,15 @@ export default {
401 412 this.loadGenderOptions()
402 413 },
403 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 424 async loadSerialNumber() {
405 425 try {
406 426 const res = await generateCreditCode()
... ... @@ -428,13 +448,13 @@ export default {
428 448 if (field === 'region') {
429 449 setSheet('区域', this.regionOptions)
430 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 459 onSheetConfirm({ value, label }) {
440 460 const field = this.sheet.field
... ... @@ -558,7 +578,7 @@ export default {
558 578 },
559 579 async onSubmit() {
560 580 if (!this.validateRequired()) return
561   - const payload = {
  581 + const payload = {
562 582 ...this.form,
563 583 status: 'AUDIT'
564 584 }
... ... @@ -573,6 +593,7 @@ export default {
573 593 delete payload.suggestedCategoryName
574 594 delete payload.companyIdName
575 595 delete payload.investigatorName
  596 + delete payload.deptName
576 597 try {
577 598 await createApi(payload)
578 599 uni.showToast({ title: '提交成功', icon: 'success' })
... ... @@ -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 795 </style>
... ...
... ... @@ -13,6 +13,12 @@
13 13 </template>
14 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 22 <uni-list-item class="select-item" :class="form.region ? 'is-filled' : 'is-empty'" clickable
17 23 @click="openSheet('region')" :rightText="displayLabel('regionName')" showArrow>
18 24 <template v-slot:body>
... ... @@ -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 776 </style>
... ...
... ... @@ -6,6 +6,7 @@
6 6 <text class="row company">{{ form.companyName }}</text>
7 7 <view :class="['status', `status_${form.status}`]" />
8 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 10 <view class="row"><text class="label">区域</text><text class="value">{{ form.regionName }}</text></view>
10 11 <view class="row"><text class="label">简写名称</text><text class="value">{{ form.customerShortName }}</text>
11 12 </view>
... ...
... ... @@ -13,6 +13,11 @@
13 13 </template>
14 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 21 <uni-list-item class="select-item" :class="form.region ? 'is-filled' : 'is-empty'" clickable
17 22 @click="openSheet('region')" :rightText="displayLabel('regionName')" showArrow>
18 23 <template v-slot:body>
... ... @@ -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 776 </style>
... ...
... ... @@ -3,6 +3,7 @@
3 3 <view class="section">
4 4 <text class="row company">{{ form.companyName }}</text>
5 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 7 <view class="row"><text class="label">区域</text><text class="value">{{ form.regionName }}</text></view>
7 8 <view class="row"><text class="label">简写名称</text><text class="value">{{ form.customerShortName }}</text>
8 9 </view>
... ...