Commit 7902aad1a80259aa1f7b7cc18e8c0531a7daf0e3

Authored by gesilong
2 parents d7dae6e7 5feec2a8

Merge branch 'cjerp-2.0-fix' into publish_cjerp

... ... @@ -18,6 +18,15 @@ export function domesticCustomerCreditSaveApi(data) {
18 18 })
19 19 }
20 20
  21 +export function domesticCustomerCreditUpdateApi(data) {
  22 + return request({
  23 + url: '/procurement/domesticCustomerCredit',
  24 + method: 'put',
  25 + data,
  26 + contentType: ContentTypeEnum.JSON
  27 + })
  28 +}
  29 +
21 30 export function domesticCustomerCreditGetApi(id) {
22 31 return request({
23 32 url: '/procurement/domesticCustomerCredit/get',
... ... @@ -42,6 +51,16 @@ export function domesticCustomerCreditCancelApi(id) {
42 51 })
43 52 }
44 53
  54 +export function domesticCustomerCreditSubmitApi(id) {
  55 + return request({
  56 + url: '/procurement/domesticCustomerCredit/submit',
  57 + method: 'get',
  58 + params: { id }
  59 + })
  60 +}
  61 +
  62 +
  63 +
45 64 export function getPurchaseDeptApi() {
46 65 return request({
47 66 url: '/system/dept/getPurchaseDept',
... ...
... ... @@ -762,8 +762,6 @@ export default {
762 762 { key: 'operationMode', label: '操作方式' },
763 763 { key: 'accountingProcess', label: '进销账务如何处理' },
764 764 { key: 'transportMode', label: '运输方式' },
765   - { key: 'commonMaterialIssue', label: '常见料质问题' },
766   - { key: 'otherIssue', label: '合作中的其它问题' },
767 765 { key: 'purchaseDepartment', label: '采购处' },
768 766 { key: 'reviewValidUntil', label: '评审有效期' },
769 767 { key: 'investigatorId', label: '资信调查人ID' }
... ...
... ... @@ -97,7 +97,9 @@
97 97 import { downloadFile } from '@/utils/downloadFile.js'
98 98 import DetailButtons from '@/components/detail-buttons/index.vue'
99 99 import { getDicByCodes, getDicName } from '@/utils/dic.js'
100   -import { domesticCustomerCreditCancelApi, domesticCustomerCreditGetApi, getPurchaseDeptApi, getAllRegionApi } from '@/api/procure-manage/domesticCustomerCredit.js'
  100 +import { boolText } from '@/utils/common.js'
  101 +import { domesticCustomerCreditCancelApi, domesticCustomerCreditGetApi, getPurchaseDeptApi, getAllRegionApi, domesticCustomerCreditSubmitApi } from '@/api/procure-manage/domesticCustomerCredit.js'
  102 +import { getInfo } from '@/api/login.js'
101 103
102 104 export default {
103 105 name: 'DomesticTradeDetail',
... ... @@ -109,6 +111,7 @@ export default {
109 111 id: '',
110 112 loading: false,
111 113 form: {},
  114 + investigatorId: '',
112 115 dicOptions: {
113 116 COMPANY_NATURE: [],
114 117 DEVELOP_NEW: [],
... ... @@ -144,6 +147,11 @@ export default {
144 147 visible: true,
145 148 variant: 'outline',
146 149 event: 'cancel',
  150 + },{
  151 + text: '提交',
  152 + visible: true,
  153 + variant: 'outline',
  154 + event: 'submit',
147 155 }]
148 156 }
149 157 },
... ... @@ -155,9 +163,10 @@ export default {
155 163 return [
156 164 { ...this.buttons[0], visible: d && this.$auth.hasPermi('procure-manage:domestic-trade:review') },
157 165 { ...this.buttons[1], visible: s === 'AUDIT' && e && this.$auth.hasPermi('procure-manage:domestic-trade:approve') },
158   - { ...this.buttons[2], visible: s === 'REFUSE' && this.$auth.hasPermi('procure-manage:domestic-trade:modify') },
  166 + { ...this.buttons[2], visible: (s === 'REFUSE' || !s) && this.$auth.hasPermi('procure-manage:domestic-trade:modify') },
159 167 // { ...this.buttons[3], visible: s === 'PASS' && this.$auth.hasPermi('procure-manage:domestic-trade:change') },
160 168 { ...this.buttons[3], visible: s === 'REFUSE' && this.$auth.hasPermi('procure-manage:domestic-trade:cancel') },
  169 + { ...this.buttons[4], visible: (s === 'REFUSE' || !s) && this.$auth.hasPermi('procure-manage:domestic-trade:submit') },
161 170 ]
162 171 },
163 172 companyNatureOptions() {
... ... @@ -219,6 +228,16 @@ export default {
219 228 this.loadDetail()
220 229 },
221 230 methods: {
  231 + async getUserInfo() {
  232 + getInfo()
  233 + .then((res) => {
  234 + console.log('获取用户信息成功:', res);
  235 + this.investigatorId = res?.data?.id || '';
  236 + })
  237 + .catch((err) => {
  238 + console.error('获取用户信息失败:', err);
  239 + });
  240 + },
222 241 async loadDicData() {
223 242 try {
224 243 const results = await getDicByCodes(['COMPANY_NATURE', 'DEVELOP_NEW', 'OPERATION_METHOD', 'PURCHASE_SOURCE'])
... ... @@ -291,7 +310,28 @@ export default {
291 310 if (e === 'audit') return this.onAudit(btn && btn.params)
292 311 if (e === 'auditDetail') return this.onAuditDetail(btn && btn.params)
293 312 if (e === 'cancel') return this.onCancel(btn && btn.params)
  313 + if (e === 'submit') return this.onSubmit(btn && btn.params)
294 314 },
  315 + onSubmit() {
  316 + const id = this.id || (this.form && this.form.id) || ''
  317 + if (!id) return
  318 + uni.showModal({
  319 + title: '系统提示',
  320 + content: '确认提交该资信调查表?',
  321 + confirmText: '确定',
  322 + cancelText: '取消',
  323 + success: (res) => {
  324 + if (res && res.confirm) {
  325 + domesticCustomerCreditSubmitApi(id).then(() => {
  326 + uni.showToast({ title: '已提交', icon: 'none' })
  327 + setTimeout(() => { uni.redirectTo({ url: '/pages/domestic_trade/index' }) }, 300)
  328 + }).catch((e) => {
  329 + uni.showToast({ title: (e && e.msg) || '提交失败', icon: 'none' })
  330 + })
  331 + }
  332 + }
  333 + })
  334 + },
295 335 onEdit(params) {
296 336 uni.navigateTo({ url: '/pages/domestic_trade/modify?id=' + this.id })
297 337 },
... ...
... ... @@ -351,7 +351,7 @@ import FileUpload from '@/components/file-upload/index.vue'
351 351 import SingleSelectSheet from '@/components/single-select/index.vue'
352 352 import MultiSelectSheet from '@/components/multi-select/index.vue'
353 353 import { getDicByCodes, getDicName } from '@/utils/dic.js'
354   -import { domesticCustomerCreditGetApi, domesticCustomerCreditSaveApi, getPurchaseDeptApi, getAllRegionApi, getRegionApi } from '@/api/procure-manage/domesticCustomerCredit.js'
  354 +import { domesticCustomerCreditGetApi, domesticCustomerCreditUpdateApi, getPurchaseDeptApi, getAllRegionApi, getRegionApi } from '@/api/procure-manage/domesticCustomerCredit.js'
355 355
356 356 export default {
357 357 name: 'DomesticTradeModify',
... ... @@ -751,8 +751,6 @@ export default {
751 751 { key: 'operationMode', label: '操作方式' },
752 752 { key: 'accountingProcess', label: '进销账务如何处理' },
753 753 { key: 'transportMode', label: '运输方式' },
754   - { key: 'commonMaterialIssue', label: '常见料质问题' },
755   - { key: 'otherIssue', label: '合作中的其它问题' },
756 754 { key: 'purchaseDepartment', label: '采购处' },
757 755 { key: 'reviewValidUntil', label: '评审有效期' },
758 756 { key: 'investigatorId', label: '资信调查人ID' }
... ... @@ -831,7 +829,7 @@ export default {
831 829 this.submitting = true
832 830 const payload = this.buildPayload()
833 831 try {
834   - await domesticCustomerCreditSaveApi(payload)
  832 + await domesticCustomerCreditUpdateApi(payload)
835 833 uni.showToast({ title: '保存成功', icon: 'success' })
836 834 setTimeout(() => { uni.redirectTo({ url: '/pages/domestic_trade/index' }) }, 300)
837 835 } catch (e) {
... ...
... ... @@ -543,10 +543,6 @@ export default {
543 543 }
544 544 console.log('审核__confirmApprove', payload)
545 545 this.$refs.approvePopup.close()
546   - uni.showToast({
547   - title: this.approveType === 'PASS' ? '已' + this.passText : '已' + this.rejectText,
548   - icon: 'none'
549   - })
550 546 }
551 547 }
552 548 }
... ...