Commit f5b849236f1ccda23d3f5e34f1a8cf2daf6e2cb2

Authored by gesilong
1 parent e24d713a

commit:联调外贸

... ... @@ -12,7 +12,11 @@
12 12 <uni-easyinput v-model="form.unitName" placeholder="请输入单位名称" :inputBorder="false" />
13 13 </template>
14 14 </uni-list-item>
15   -
  15 + <uni-list-item title="客户简称">
  16 + <template v-slot:footer>
  17 + <uni-easyinput v-model="form.customerShortName" placeholder="请输入客户简称" :inputBorder="false" />
  18 + </template>
  19 + </uni-list-item>
16 20 <uni-list-item class="select-item" :class="form.companyNatureName ? 'is-filled' : 'is-empty'" clickable
17 21 @click="openMultiSheet('companyNature')" :rightText="displayLabel('companyNatureName')" showArrow>
18 22 <template v-slot:body>
... ... @@ -295,10 +299,9 @@
295 299 </template>
296 300 </uni-list-item>
297 301
298   - <uni-list-item class="select-item" :class="form.purchaseDepartment ? 'is-filled' : 'is-empty'" clickable
299   - @click="openSheet('purchaseDepartment')" :rightText="displayLabel('purchaseDepartment')" showArrow>
300   - <template v-slot:body>
301   - <view class="item-title"><text>采购处</text></view>
  302 + <uni-list-item title="采购处">
  303 + <template v-slot:footer>
  304 + <uni-easyinput v-model="form.purchaseDepartmentName" disabled placeholder="" :inputBorder="false" />
302 305 </template>
303 306 </uni-list-item>
304 307
... ... @@ -366,9 +369,9 @@ export default {
366 369 operationMethodOptions: [],
367 370 developNewOptions: [],
368 371 purchaseSourceOptions: [],
369   - purchaseDeptOptions: [],
370 372 form: {
371 373 unitName: '',
  374 + customerShortName: '',
372 375 companyNature: '',
373 376 companyNatureName: '',
374 377 companyNatureOther: '',
... ... @@ -415,6 +418,7 @@ export default {
415 418 investigatorId: '',
416 419 investigatorName: '',
417 420 purchaseDepartment: '',
  421 + purchaseDepartmentName: '',
418 422 reviewValidUntil: ''
419 423 }
420 424 }
... ... @@ -460,21 +464,14 @@ export default {
460 464 async loadPurchaseDeptOptions() {
461 465 try {
462 466 const res = await getPurchaseDeptApi()
463   - const list = (res && res.data) ? res.data : []
464   - this.purchaseDeptOptions = (Array.isArray(list) ? list : []).map(it => ({
465   - label: it && it.name != null ? String(it.name) : '',
466   - value: it && it.id != null ? String(it.id) : ''
467   - })).filter(it => it.value)
  467 + const data = (res && res.data) ? res.data : {}
  468 + this.form.purchaseDepartment = data && data.id != null ? String(data.id) : ''
  469 + this.form.purchaseDepartmentName = data && data.name != null ? String(data.name) : ''
468 470 } catch (e) {
469   - this.purchaseDeptOptions = []
  471 + this.form.purchaseDepartment = ''
  472 + this.form.purchaseDepartmentName = ''
470 473 }
471 474 },
472   - getOptionLabel(options, value) {
473   - const v = value == null ? '' : String(value)
474   - if (!v) return ''
475   - const found = (options || []).find(o => String(o.value) === v)
476   - return found ? String(found.label || '') : ''
477   - },
478 475 dicToSheetOptions(items) {
479 476 const list = Array.isArray(items) ? items : []
480 477 return list.map(it => ({ label: it && it.name != null ? String(it.name) : '', value: it && it.code != null ? String(it.code) : '' })).filter(it => it.value)
... ... @@ -498,7 +495,6 @@ export default {
498 495 purchaseSource: '请选择',
499 496 operationMode: '请选择',
500 497 isNewDevelopment: '请选择',
501   - purchaseDepartment: '请选择',
502 498 hasPreferentialPolicy: '请选择',
503 499 investInFutures: '请选择',
504 500 hasPenaltyRecord: '请选择',
... ... @@ -524,10 +520,6 @@ export default {
524 520 const v = m.isNewDevelopment
525 521 return v ? getDicName('DEVELOP_NEW', String(v), this.dicOptions.DEVELOP_NEW) : map[field]
526 522 }
527   - if (field === 'purchaseDepartment') {
528   - const label = this.getOptionLabel(this.purchaseDeptOptions, m.purchaseDepartment)
529   - return label || map[field]
530   - }
531 523 const v = m[field]
532 524 if (v === true) return '是'
533 525 if (v === false) return '否'
... ... @@ -538,7 +530,6 @@ export default {
538 530 purchaseSource: { title: '收购来源', options: this.purchaseSourceOptions },
539 531 operationMode: { title: '操作方式', options: this.operationMethodOptions },
540 532 isNewDevelopment: { title: '是否新开发', options: this.developNewOptions },
541   - purchaseDepartment: { title: '采购处', options: this.purchaseDeptOptions },
542 533 hasPreferentialPolicy: { title: '是否享有优惠政策', options: this.yesNoOptions },
543 534 investInFutures: { title: '是否投资期货', options: this.yesNoOptions },
544 535 hasPenaltyRecord: { title: '是否有被处罚记录', options: this.yesNoOptions },
... ... @@ -623,6 +614,7 @@ export default {
623 614 validate() {
624 615 const requiredTextFields = [
625 616 { key: 'unitName', label: '单位名称' },
  617 + { key: 'customerShortName', label: '客户简称' },
626 618 { key: 'companyNature', label: '公司性质' },
627 619 { key: 'bankName', label: '开户行' },
628 620 { key: 'bankAccount', label: '账号' },
... ... @@ -714,6 +706,7 @@ export default {
714 706 if (!this.showCompanyNatureOther) payload.companyNatureOther = ''
715 707 delete payload.companyNatureName
716 708 delete payload.investigatorName
  709 + delete payload.purchaseDepartmentName
717 710 payload.registeredCapital = Number(payload.registeredCapital)
718 711 const files = (Array.isArray(this.attachmentFiles) ? this.attachmentFiles : []).filter(it => it && it.id)
719 712 payload.attachmentFileIds = files.map(it => String(it.id || '')).filter(Boolean).join(',')
... ...
... ... @@ -4,6 +4,7 @@
4 4 <view class="detail-page">
5 5 <view class="section">
6 6 <text class="row company">{{ safeText(form.unitName) }}</text>
  7 + <view class="row"><text class="label">客户简称</text><text class="value">{{ safeText(form.customerShortName) }}</text></view>
7 8 <view class="row"><text class="label">公司性质</text><text class="value">{{ safeText(companyNatureName) }}</text></view>
8 9 <view v-if="showCompanyNatureOther" class="row"><text class="label">其他</text><text class="value">{{ safeText(form.companyNatureOther) }}</text></view>
9 10 <view class="row"><text class="label">开户行</text><text class="value">{{ safeText(form.bankName) }}</text></view>
... ... @@ -114,7 +115,7 @@ export default {
114 115 OPERATION_METHOD: [],
115 116 PURCHASE_SOURCE: []
116 117 },
117   - purchaseDeptOptions: [],
  118 + purchaseDept: null,
118 119 buttons: [{
119 120 text: '审核详情',
120 121 visible: true,
... ... @@ -183,10 +184,9 @@ export default {
183 184 return v ? getDicName('DEVELOP_NEW', v, this.dicOptions.DEVELOP_NEW) : '-'
184 185 },
185 186 purchaseDepartmentName() {
186   - const v = this.form && this.form.purchaseDepartment != null ? String(this.form.purchaseDepartment) : ''
187   - if (!v) return '-'
188   - const found = (this.purchaseDeptOptions || []).find(o => String(o.value) === v)
189   - return found ? String(found.label || '') : v
  187 + if (this.purchaseDept && this.purchaseDept.name != null) return String(this.purchaseDept.name)
  188 + const v = this.form && this.form.purchaseDepartmentName != null ? String(this.form.purchaseDepartmentName) : ''
  189 + return v || '-'
190 190 }
191 191 },
192 192 created() {
... ... @@ -216,13 +216,10 @@ export default {
216 216 async loadPurchaseDeptOptions() {
217 217 try {
218 218 const res = await getPurchaseDeptApi()
219   - const list = (res && res.data) ? res.data : []
220   - this.purchaseDeptOptions = (Array.isArray(list) ? list : []).map(it => ({
221   - label: it && it.name != null ? String(it.name) : '',
222   - value: it && it.id != null ? String(it.id) : ''
223   - })).filter(it => it.value)
  219 + const data = (res && res.data) ? res.data : {}
  220 + this.purchaseDept = (data && typeof data === 'object') ? data : null
224 221 } catch (e) {
225   - this.purchaseDeptOptions = []
  222 + this.purchaseDept = null
226 223 }
227 224 },
228 225 dicToSheetOptions(items) {
... ...
... ... @@ -3,6 +3,7 @@
3 3 <scroll-view class="scroll" scroll-y>
4 4 <view class="section">
5 5 <text class="row company">{{ safeText(form.unitName) }}</text>
  6 + <view class="row"><text class="label">客户简称</text><text class="value">{{ safeText(form.customerShortName) }}</text></view>
6 7 <view class="row"><text class="label">公司性质</text><text class="value">{{ safeText(companyNatureName) }}</text></view>
7 8 <view class="row"><text class="label">开户行</text><text class="value">{{ safeText(form.bankName) }}</text></view>
8 9 <view class="row"><text class="label">账号</text><text class="value">{{ safeText(form.bankAccount) }}</text></view>
... ... @@ -104,7 +105,7 @@ export default {
104 105 OPERATION_METHOD: [],
105 106 PURCHASE_SOURCE: []
106 107 },
107   - purchaseDeptOptions: []
  108 + purchaseDept: null
108 109 }
109 110 },
110 111 computed: {
... ... @@ -139,10 +140,9 @@ export default {
139 140 return v ? getDicName('DEVELOP_NEW', v, this.dicOptions.DEVELOP_NEW) : '-'
140 141 },
141 142 purchaseDepartmentName() {
142   - const v = this.form && this.form.purchaseDepartment != null ? String(this.form.purchaseDepartment) : ''
143   - if (!v) return '-'
144   - const found = (this.purchaseDeptOptions || []).find(o => String(o.value) === v)
145   - return found ? String(found.label || '') : v
  143 + if (this.purchaseDept && this.purchaseDept.name != null) return String(this.purchaseDept.name)
  144 + const v = this.form && this.form.purchaseDepartmentName != null ? String(this.form.purchaseDepartmentName) : ''
  145 + return v || '-'
146 146 }
147 147 },
148 148 created() {
... ... @@ -175,13 +175,10 @@ export default {
175 175 async loadPurchaseDeptOptions() {
176 176 try {
177 177 const res = await getPurchaseDeptApi()
178   - const list = (res && res.data) ? res.data : []
179   - this.purchaseDeptOptions = (Array.isArray(list) ? list : []).map(it => ({
180   - label: it && it.name != null ? String(it.name) : '',
181   - value: it && it.id != null ? String(it.id) : ''
182   - })).filter(it => it.value)
  178 + const data = (res && res.data) ? res.data : {}
  179 + this.purchaseDept = (data && typeof data === 'object') ? data : null
183 180 } catch (e) {
184   - this.purchaseDeptOptions = []
  181 + this.purchaseDept = null
185 182 }
186 183 },
187 184 dicToSheetOptions(items) {
... ...
... ... @@ -12,7 +12,11 @@
12 12 <uni-easyinput v-model="form.unitName" placeholder="请输入单位名称" :inputBorder="false" />
13 13 </template>
14 14 </uni-list-item>
15   -
  15 + <uni-list-item title="客户简称">
  16 + <template v-slot:footer>
  17 + <uni-easyinput v-model="form.customerShortName" placeholder="请输入客户简称" :inputBorder="false" />
  18 + </template>
  19 + </uni-list-item>
16 20 <uni-list-item class="select-item" :class="form.companyNatureName ? 'is-filled' : 'is-empty'" clickable
17 21 @click="openMultiSheet('companyNature')" :rightText="displayLabel('companyNatureName')" showArrow>
18 22 <template v-slot:body>
... ... @@ -295,10 +299,9 @@
295 299 </template>
296 300 </uni-list-item>
297 301
298   - <uni-list-item class="select-item" :class="form.purchaseDepartment ? 'is-filled' : 'is-empty'" clickable
299   - @click="openSheet('purchaseDepartment')" :rightText="displayLabel('purchaseDepartment')" showArrow>
300   - <template v-slot:body>
301   - <view class="item-title"><text>采购处</text></view>
  302 + <uni-list-item title="采购处">
  303 + <template v-slot:footer>
  304 + <uni-easyinput v-model="form.purchaseDepartmentName" disabled placeholder="" :inputBorder="false" />
302 305 </template>
303 306 </uni-list-item>
304 307
... ... @@ -368,10 +371,11 @@ export default {
368 371 operationMethodOptions: [],
369 372 developNewOptions: [],
370 373 purchaseSourceOptions: [],
371   - purchaseDeptOptions: [],
  374 + purchaseDept: null,
372 375 form: {
373 376 id: '',
374 377 unitName: '',
  378 + customerShortName: '',
375 379 companyNature: '',
376 380 companyNatureName: '',
377 381 companyNatureOther: '',
... ... @@ -418,6 +422,7 @@ export default {
418 422 investigatorId: '',
419 423 investigatorName: '',
420 424 purchaseDepartment: '',
  425 + purchaseDepartmentName: '',
421 426 reviewValidUntil: ''
422 427 }
423 428 }
... ... @@ -466,21 +471,16 @@ export default {
466 471 async loadPurchaseDeptOptions() {
467 472 try {
468 473 const res = await getPurchaseDeptApi()
469   - const list = (res && res.data) ? res.data : []
470   - this.purchaseDeptOptions = (Array.isArray(list) ? list : []).map(it => ({
471   - label: it && it.name != null ? String(it.name) : '',
472   - value: it && it.id != null ? String(it.id) : ''
473   - })).filter(it => it.value)
  474 + const data = (res && res.data) ? res.data : {}
  475 + this.purchaseDept = (data && typeof data === 'object') ? data : null
  476 + this.form.purchaseDepartment = data && data.id != null ? String(data.id) : ''
  477 + this.form.purchaseDepartmentName = data && data.name != null ? String(data.name) : ''
474 478 } catch (e) {
475   - this.purchaseDeptOptions = []
  479 + this.purchaseDept = null
  480 + this.form.purchaseDepartment = ''
  481 + this.form.purchaseDepartmentName = ''
476 482 }
477 483 },
478   - getOptionLabel(options, value) {
479   - const v = value == null ? '' : String(value)
480   - if (!v) return ''
481   - const found = (options || []).find(o => String(o.value) === v)
482   - return found ? String(found.label || '') : ''
483   - },
484 484 displayLabel(field) {
485 485 const m = this.form
486 486 const map = {
... ... @@ -488,7 +488,6 @@ export default {
488 488 purchaseSource: '请选择',
489 489 operationMode: '请选择',
490 490 isNewDevelopment: '请选择',
491   - purchaseDepartment: '请选择',
492 491 hasPreferentialPolicy: '请选择',
493 492 investInFutures: '请选择',
494 493 hasPenaltyRecord: '请选择',
... ... @@ -514,10 +513,6 @@ export default {
514 513 const v = m.isNewDevelopment
515 514 return v ? getDicName('DEVELOP_NEW', String(v), this.dicOptions.DEVELOP_NEW) : map[field]
516 515 }
517   - if (field === 'purchaseDepartment') {
518   - const label = this.getOptionLabel(this.purchaseDeptOptions, m.purchaseDepartment)
519   - return label || map[field]
520   - }
521 516 const v = m[field]
522 517 if (v === true) return '是'
523 518 if (v === false) return '否'
... ... @@ -528,7 +523,6 @@ export default {
528 523 purchaseSource: { title: '收购来源', options: this.purchaseSourceOptions },
529 524 operationMode: { title: '操作方式', options: this.operationMethodOptions },
530 525 isNewDevelopment: { title: '是否新开发', options: this.developNewOptions },
531   - purchaseDepartment: { title: '采购处', options: this.purchaseDeptOptions },
532 526 hasPreferentialPolicy: { title: '是否享有优惠政策', options: this.yesNoOptions },
533 527 investInFutures: { title: '是否投资期货', options: this.yesNoOptions },
534 528 hasPenaltyRecord: { title: '是否有被处罚记录', options: this.yesNoOptions },
... ... @@ -613,6 +607,7 @@ export default {
613 607 validate() {
614 608 const requiredTextFields = [
615 609 { key: 'unitName', label: '单位名称' },
  610 + { key: 'customerShortName', label: '客户简称' },
616 611 { key: 'companyNature', label: '公司性质' },
617 612 { key: 'bankName', label: '开户行' },
618 613 { key: 'bankAccount', label: '账号' },
... ... @@ -704,6 +699,7 @@ export default {
704 699 if (!this.showCompanyNatureOther) payload.companyNatureOther = ''
705 700 delete payload.companyNatureName
706 701 delete payload.investigatorName
  702 + delete payload.purchaseDepartmentName
707 703 payload.registeredCapital = Number(payload.registeredCapital)
708 704 const files = (Array.isArray(this.attachmentFiles) ? this.attachmentFiles : []).filter(it => it && it.id)
709 705 payload.attachmentFileIds = files.map(it => String(it.id || '')).filter(Boolean).join(',')
... ... @@ -731,6 +727,10 @@ export default {
731 727 const res = await domesticCustomerCreditGetApi(this.id)
732 728 const data = res && res.data ? res.data : {}
733 729 const next = { ...this.form, ...(data || {}) }
  730 + if (this.purchaseDept && this.purchaseDept.id != null) {
  731 + next.purchaseDepartment = String(this.purchaseDept.id)
  732 + next.purchaseDepartmentName = this.purchaseDept.name != null ? String(this.purchaseDept.name) : ''
  733 + }
734 734 next.id = next.id || this.id || ''
735 735 const u = (this.$store && this.$store.state && this.$store.state.user) ? this.$store.state.user : {}
736 736 if (!next.investigatorId) next.investigatorId = u && u.id ? String(u.id) : ''
... ...
... ... @@ -169,13 +169,19 @@
169 169 <span>供应商分类</span>
170 170 </view>
171 171
172   - <uni-list-item class="select-item mgb10" :class="form.supplierCategory ? 'is-filled' : 'is-empty'" clickable
  172 + <uni-list-item class="select-item" :class="form.supplierCategory ? 'is-filled' : 'is-empty'" clickable
173 173 @click="openSheet('supplierCategory')" :rightText="displayLabel('supplierCategory')" showArrow>
174 174 <template v-slot:body>
175 175 <view class="item-title"><text>供应商分类</text></view>
176 176 </template>
177 177 </uni-list-item>
178 178
  179 + <uni-list-item v-if="form.supplierCategory" class="mgb10" title="分类说明">
  180 + <template v-slot:footer>
  181 + <uni-easyinput type="textarea" :value="supplierCategoryDesc" :inputBorder="false" disabled placeholder="选择供应商分类后自动显示" maxlength="2000" />
  182 + </template>
  183 + </uni-list-item>
  184 +
179 185 <view class="title-header">
180 186 <image class="title-header_icon" src="/static/images/title.png" />
181 187 <span>操作方案</span>
... ... @@ -235,10 +241,9 @@
235 241 </template>
236 242 </uni-list-item>
237 243
238   - <uni-list-item class="select-item mgb10" :class="form.purchase_department ? 'is-filled' : 'is-empty'" clickable
239   - @click="openSheet('purchase_department')" :rightText="displayLabel('purchase_departmentName')" showArrow>
240   - <template v-slot:body>
241   - <view class="item-title"><text>采购处</text></view>
  244 + <uni-list-item class="mgb10" title="采购处">
  245 + <template v-slot:footer>
  246 + <uni-easyinput v-model="form.purchaseDepartmentName" :inputBorder="false" disabled />
242 247 </template>
243 248 </uni-list-item>
244 249 </uni-list>
... ... @@ -271,7 +276,6 @@ export default {
271 276 { label: 'D类供应商', value: 'D' }
272 277 ],
273 278 companyNatureOptions: [],
274   - purchaseDeptOptions: [],
275 279 sheet: { visible: false, title: '', options: [], field: '', value: '' },
276 280 form: {
277 281 id: '',
... ... @@ -313,8 +317,8 @@ export default {
313 317 reviewDepartment: '',
314 318 investigatorId: '',
315 319 investigatorName: '',
316   - purchase_department: '',
317   - purchase_departmentName: ''
  320 + purchaseDepartment: '',
  321 + purchaseDepartmentName: ''
318 322 }
319 323 }
320 324 },
... ... @@ -325,6 +329,18 @@ export default {
325 329 this.form.investigatorId = u && u.id ? String(u.id) : ''
326 330 this.form.investigatorName = u && u.name ? String(u.name) : ''
327 331 },
  332 + computed: {
  333 + supplierCategoryDesc() {
  334 + const v = this.form && this.form.supplierCategory != null ? String(this.form.supplierCategory) : ''
  335 + const map = {
  336 + A: '资信调查有担保函无资金风险、资料齐全,料质可控,价格较好,若出现质量、磅差问题可以索赔解决,进口倒挂时可协商延迟点价,可推迟发货,可试操作(前3个月每月操作量300-500吨);第一次计划货到厂验收结束后进行评审,正常后可以增量操作,要求每年评审一次;',
  337 + B: '资信调查无担保函,国外企业属国内企业控股,无资金风险、资料齐全,价格较好,料质可控,若出现质量、磅差问题可以索赔解决(前3个月每月操作量200-400吨),第一次货到厂验收合格后可增量操作;操作正常每年评审一次;',
  338 + C: '资信调查无担保函,资料齐全,料质可控,价格一般,出现质量、磅差问题可以索赔解决,可试单限量操作(前3个月每月操作量100-200吨),第一次货到厂验收合格后可增量操作,新开发供应商首年操作按每半年评审一次,操作正常则次年调整为每年评审一次;若出现索赔问题不及时解决可中止后续开信用证和中止到港货物的DP/TT付款,且立即暂停业务操作。',
  339 + D: '资信调查无担保函,通过委托第三方机构调查无风险,虽然资料不齐全,但料质可控,价格略高,出现质量、磅差问题索赔解决有难度,一单一议,D类供应商第一次货到厂验收、付款、退款或者索赔正常后,可继续操作逐步增量(每月操作量100-200吨),每半年评审一次,操作正常到则次年调整为每年评审一次;若出现索赔问题不及时解决可终止后续到港货物的付款,且立即停止业务操作。'
  340 + }
  341 + return map[v] || ''
  342 + }
  343 + },
328 344 methods: {
329 345 async loadDicData() {
330 346 try {
... ... @@ -341,20 +357,18 @@ export default {
341 357 async loadPurchaseDeptOptions() {
342 358 try {
343 359 const res = await getPurchaseDeptApi()
344   - const list = (res && res.data) ? res.data : []
345   - this.purchaseDeptOptions = (Array.isArray(list) ? list : []).map(it => ({
346   - label: it && it.name != null ? String(it.name) : '',
347   - value: it && it.id != null ? String(it.id) : ''
348   - })).filter(it => it.value)
  360 + const data = (res && res.data) ? res.data : {}
  361 + this.form.purchaseDepartment = data && data.id != null ? String(data.id) : ''
  362 + this.form.purchaseDepartmentName = data && data.name != null ? String(data.name) : ''
349 363 } catch (e) {
350   - this.purchaseDeptOptions = []
  364 + this.form.purchaseDepartment = ''
  365 + this.form.purchaseDepartmentName = ''
351 366 }
352 367 },
353 368 displayLabel(field) {
354 369 const m = this.form || {}
355 370 const map = {
356 371 companyNatureName: '请选择',
357   - purchase_departmentName: '请选择',
358 372 supplierCategory: '请选择'
359 373 }
360 374 if (field === 'supplierCategory') {
... ... @@ -369,8 +383,7 @@ export default {
369 383 openSheet(field) {
370 384 const map = {
371 385 companyNature: { title: '公司性质', options: this.companyNatureOptions, valueField: 'companyNature', labelField: 'companyNatureName' },
372   - supplierCategory: { title: '供应商分类', options: this.supplierCategoryOptions, valueField: 'supplierCategory', labelField: '' },
373   - purchase_department: { title: '采购处', options: this.purchaseDeptOptions, valueField: 'purchase_department', labelField: 'purchase_departmentName' }
  386 + supplierCategory: { title: '供应商分类', options: this.supplierCategoryOptions, valueField: 'supplierCategory', labelField: '' }
374 387 }
375 388 const cfg = map[field]
376 389 if (!cfg) return
... ... @@ -391,9 +404,7 @@ export default {
391 404 if (field === 'supplierCategory') {
392 405 this.form.supplierCategory = value
393 406 }
394   - if (field === 'purchase_department') this.form.purchase_departmentName = label
395 407 if (field === 'companyNature') this.form.companyNature = value
396   - if (field === 'purchase_department') this.form.purchase_department = value
397 408 this.sheet.visible = false
398 409 },
399 410 validate() {
... ... @@ -434,7 +445,7 @@ export default {
434 445 { key: 'nextReviewTime', label: '下次评审时间' },
435 446 { key: 'reviewDepartment', label: '评审部门' },
436 447 { key: 'investigatorId', label: '资信调查人ID' },
437   - { key: 'purchase_department', label: '采购处' }
  448 + { key: 'purchaseDepartment', label: '采购处' }
438 449 ]
439 450 for (let i = 0; i < requiredFields.length; i++) {
440 451 const f = requiredFields[i]
... ...
... ... @@ -85,7 +85,7 @@ export default {
85 85 AUDIT_STATUS: [],
86 86 COMPANY_NATURE: []
87 87 },
88   - purchaseDeptOptions: [],
  88 + purchaseDept: null,
89 89 buttons: [{
90 90 text: '审核详情',
91 91 visible: true,
... ... @@ -130,10 +130,9 @@ export default {
130 130 return getDicName('AUDIT_STATUS', v, this.dicOptions.AUDIT_STATUS) || v
131 131 },
132 132 purchaseDeptName() {
133   - const v = this.form && this.form.purchase_department != null ? String(this.form.purchase_department) : ''
134   - if (!v) return '-'
135   - const found = (this.purchaseDeptOptions || []).find(o => String(o.value) === v)
136   - return found ? String(found.label || '') : v
  133 + if (this.purchaseDept && this.purchaseDept.name != null) return String(this.purchaseDept.name)
  134 + const v = this.form && this.form.purchaseDepartmentName != null ? String(this.form.purchaseDepartmentName) : ''
  135 + return v || '-'
137 136 },
138 137 supplierCategoryName() {
139 138 const v = this.form && this.form.supplierCategory != null ? String(this.form.supplierCategory) : ''
... ... @@ -185,13 +184,10 @@ export default {
185 184 async loadPurchaseDeptOptions() {
186 185 try {
187 186 const res = await getPurchaseDeptApi()
188   - const list = (res && res.data) ? res.data : []
189   - this.purchaseDeptOptions = (Array.isArray(list) ? list : []).map(it => ({
190   - label: it && it.name != null ? String(it.name) : '',
191   - value: it && it.id != null ? String(it.id) : ''
192   - })).filter(it => it.value)
  187 + const data = (res && res.data) ? res.data : {}
  188 + this.purchaseDept = data && typeof data === 'object' ? data : null
193 189 } catch (e) {
194   - this.purchaseDeptOptions = []
  190 + this.purchaseDept = null
195 191 }
196 192 },
197 193 handleButtonClick(btn) {
... ...
... ... @@ -64,7 +64,7 @@ export default {
64 64 dicOptions: {
65 65 COMPANY_NATURE: []
66 66 },
67   - purchaseDeptOptions: []
  67 + purchaseDept: null
68 68 }
69 69 },
70 70 computed: {
... ... @@ -79,10 +79,9 @@ export default {
79 79 return map[v] || (v ? v : '-')
80 80 },
81 81 purchaseDeptName() {
82   - const v = this.form && this.form.purchase_department != null ? String(this.form.purchase_department) : ''
83   - if (!v) return '-'
84   - const found = (this.purchaseDeptOptions || []).find(o => String(o.value) === v)
85   - return found ? String(found.label || '') : v
  82 + if (this.purchaseDept && this.purchaseDept.name != null) return String(this.purchaseDept.name)
  83 + const v = this.form && this.form.purchaseDepartmentName != null ? String(this.form.purchaseDepartmentName) : ''
  84 + return v || '-'
86 85 }
87 86 },
88 87 created() {
... ... @@ -110,13 +109,10 @@ export default {
110 109 async loadPurchaseDeptOptions() {
111 110 try {
112 111 const res = await getPurchaseDeptApi()
113   - const list = (res && res.data) ? res.data : []
114   - this.purchaseDeptOptions = (Array.isArray(list) ? list : []).map(it => ({
115   - label: it && it.name != null ? String(it.name) : '',
116   - value: it && it.id != null ? String(it.id) : ''
117   - })).filter(it => it.value)
  112 + const data = (res && res.data) ? res.data : {}
  113 + this.purchaseDept = data && typeof data === 'object' ? data : null
118 114 } catch (e) {
119   - this.purchaseDeptOptions = []
  115 + this.purchaseDept = null
120 116 }
121 117 },
122 118 safeText(v) {
... ...
... ... @@ -169,13 +169,19 @@
169 169 <span>供应商分类</span>
170 170 </view>
171 171
172   - <uni-list-item class="select-item mgb10" :class="form.supplierCategory ? 'is-filled' : 'is-empty'" clickable
  172 + <uni-list-item class="select-item" :class="form.supplierCategory ? 'is-filled' : 'is-empty'" clickable
173 173 @click="openSheet('supplierCategory')" :rightText="displayLabel('supplierCategory')" showArrow>
174 174 <template v-slot:body>
175 175 <view class="item-title"><text>供应商分类</text></view>
176 176 </template>
177 177 </uni-list-item>
178 178
  179 + <uni-list-item v-if="form.supplierCategory" class="mgb10" title="分类说明">
  180 + <template v-slot:footer>
  181 + <uni-easyinput type="textarea" :value="supplierCategoryDesc" :inputBorder="false" disabled placeholder="选择供应商分类后自动显示" maxlength="2000" />
  182 + </template>
  183 + </uni-list-item>
  184 +
179 185 <view class="title-header">
180 186 <image class="title-header_icon" src="/static/images/title.png" />
181 187 <span>操作方案</span>
... ... @@ -235,10 +241,9 @@
235 241 </template>
236 242 </uni-list-item>
237 243
238   - <uni-list-item class="select-item mgb10" :class="form.purchase_department ? 'is-filled' : 'is-empty'" clickable
239   - @click="openSheet('purchase_department')" :rightText="displayLabel('purchase_departmentName')" showArrow>
240   - <template v-slot:body>
241   - <view class="item-title"><text>采购处</text></view>
  244 + <uni-list-item class="mgb10" title="采购处">
  245 + <template v-slot:footer>
  246 + <uni-easyinput v-model="form.purchaseDepartmentName" :inputBorder="false" disabled />
242 247 </template>
243 248 </uni-list-item>
244 249 </uni-list>
... ... @@ -273,7 +278,6 @@ export default {
273 278 { label: 'D类供应商', value: 'D' }
274 279 ],
275 280 companyNatureOptions: [],
276   - purchaseDeptOptions: [],
277 281 sheet: { visible: false, title: '', options: [], field: '', value: '' },
278 282 form: {
279 283 id: '',
... ... @@ -315,9 +319,21 @@ export default {
315 319 reviewDepartment: '',
316 320 investigatorId: '',
317 321 investigatorName: '',
318   - purchase_department: '',
319   - purchase_departmentName: ''
  322 + purchaseDepartment: '',
  323 + purchaseDepartmentName: ''
  324 + }
  325 + }
  326 + },
  327 + computed: {
  328 + supplierCategoryDesc() {
  329 + const v = this.form && this.form.supplierCategory != null ? String(this.form.supplierCategory) : ''
  330 + const map = {
  331 + A: '资信调查有担保函无资金风险、资料齐全,料质可控,价格较好,若出现质量、磅差问题可以索赔解决,进口倒挂时可协商延迟点价,可推迟发货,可试操作(前3个月每月操作量300-500吨);第一次计划货到厂验收结束后进行评审,正常后可以增量操作,要求每年评审一次;',
  332 + B: '资信调查无担保函,国外企业属国内企业控股,无资金风险、资料齐全,价格较好,料质可控,若出现质量、磅差问题可以索赔解决(前3个月每月操作量200-400吨),第一次货到厂验收合格后可增量操作;操作正常每年评审一次;',
  333 + C: '资信调查无担保函,资料齐全,料质可控,价格一般,出现质量、磅差问题可以索赔解决,可试单限量操作(前3个月每月操作量100-200吨),第一次货到厂验收合格后可增量操作,新开发供应商首年操作按每半年评审一次,操作正常则次年调整为每年评审一次;若出现索赔问题不及时解决可中止后续开信用证和中止到港货物的DP/TT付款,且立即暂停业务操作。',
  334 + D: '资信调查无担保函,通过委托第三方机构调查无风险,虽然资料不齐全,但料质可控,价格略高,出现质量、磅差问题索赔解决有难度,一单一议,D类供应商第一次货到厂验收、付款、退款或者索赔正常后,可继续操作逐步增量(每月操作量100-200吨),每半年评审一次,操作正常到则次年调整为每年评审一次;若出现索赔问题不及时解决可终止后续到港货物的付款,且立即停止业务操作。'
320 335 }
  336 + return map[v] || ''
321 337 }
322 338 },
323 339 async onLoad(query) {
... ... @@ -343,20 +359,18 @@ export default {
343 359 async loadPurchaseDeptOptions() {
344 360 try {
345 361 const res = await getPurchaseDeptApi()
346   - const list = (res && res.data) ? res.data : []
347   - this.purchaseDeptOptions = (Array.isArray(list) ? list : []).map(it => ({
348   - label: it && it.name != null ? String(it.name) : '',
349   - value: it && it.id != null ? String(it.id) : ''
350   - })).filter(it => it.value)
  362 + const data = (res && res.data) ? res.data : {}
  363 + this.form.purchaseDepartment = data && data.id != null ? String(data.id) : ''
  364 + this.form.purchaseDepartmentName = data && data.name != null ? String(data.name) : ''
351 365 } catch (e) {
352   - this.purchaseDeptOptions = []
  366 + this.form.purchaseDepartment = ''
  367 + this.form.purchaseDepartmentName = ''
353 368 }
354 369 },
355 370 displayLabel(field) {
356 371 const m = this.form || {}
357 372 const map = {
358 373 companyNatureName: '请选择',
359   - purchase_departmentName: '请选择',
360 374 supplierCategory: '请选择'
361 375 }
362 376 if (field === 'supplierCategory') {
... ... @@ -371,8 +385,7 @@ export default {
371 385 openSheet(field) {
372 386 const map = {
373 387 companyNature: { title: '公司性质', options: this.companyNatureOptions, valueField: 'companyNature', labelField: 'companyNatureName' },
374   - supplierCategory: { title: '供应商分类', options: this.supplierCategoryOptions, valueField: 'supplierCategory', labelField: '' },
375   - purchase_department: { title: '采购处', options: this.purchaseDeptOptions, valueField: 'purchase_department', labelField: 'purchase_departmentName' }
  388 + supplierCategory: { title: '供应商分类', options: this.supplierCategoryOptions, valueField: 'supplierCategory', labelField: '' }
376 389 }
377 390 const cfg = map[field]
378 391 if (!cfg) return
... ... @@ -393,9 +406,7 @@ export default {
393 406 if (field === 'supplierCategory') {
394 407 this.form.supplierCategory = value
395 408 }
396   - if (field === 'purchase_department') this.form.purchase_departmentName = label
397 409 if (field === 'companyNature') this.form.companyNature = value
398   - if (field === 'purchase_department') this.form.purchase_department = value
399 410 this.sheet.visible = false
400 411 },
401 412 async loadDetail() {
... ... @@ -412,10 +423,6 @@ export default {
412 423 const found = (this.companyNatureOptions || []).find(o => String(o.value) === String(this.form.companyNature))
413 424 if (found) this.form.companyNatureName = String(found.label || '')
414 425 }
415   - if (!this.form.purchase_departmentName && this.form.purchase_department) {
416   - const found = (this.purchaseDeptOptions || []).find(o => String(o.value) === String(this.form.purchase_department))
417   - if (found) this.form.purchase_departmentName = String(found.label || '')
418   - }
419 426 } catch (e) {
420 427 uni.showToast({ title: '详情加载失败', icon: 'none' })
421 428 } finally {
... ... @@ -460,7 +467,7 @@ export default {
460 467 { key: 'nextReviewTime', label: '下次评审时间' },
461 468 { key: 'reviewDepartment', label: '评审部门' },
462 469 { key: 'investigatorId', label: '资信调查人ID' },
463   - { key: 'purchase_department', label: '采购处' }
  470 + { key: 'purchaseDepartment', label: '采购处' }
464 471 ]
465 472 for (let i = 0; i < requiredFields.length; i++) {
466 473 const f = requiredFields[i]
... ...