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,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 export function domesticCustomerCreditGetApi(id) { 30 export function domesticCustomerCreditGetApi(id) {
22 return request({ 31 return request({
23 url: '/procurement/domesticCustomerCredit/get', 32 url: '/procurement/domesticCustomerCredit/get',
@@ -42,6 +51,16 @@ export function domesticCustomerCreditCancelApi(id) { @@ -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 export function getPurchaseDeptApi() { 64 export function getPurchaseDeptApi() {
46 return request({ 65 return request({
47 url: '/system/dept/getPurchaseDept', 66 url: '/system/dept/getPurchaseDept',
@@ -762,8 +762,6 @@ export default { @@ -762,8 +762,6 @@ export default {
762 { key: 'operationMode', label: '操作方式' }, 762 { key: 'operationMode', label: '操作方式' },
763 { key: 'accountingProcess', label: '进销账务如何处理' }, 763 { key: 'accountingProcess', label: '进销账务如何处理' },
764 { key: 'transportMode', label: '运输方式' }, 764 { key: 'transportMode', label: '运输方式' },
765 - { key: 'commonMaterialIssue', label: '常见料质问题' },  
766 - { key: 'otherIssue', label: '合作中的其它问题' },  
767 { key: 'purchaseDepartment', label: '采购处' }, 765 { key: 'purchaseDepartment', label: '采购处' },
768 { key: 'reviewValidUntil', label: '评审有效期' }, 766 { key: 'reviewValidUntil', label: '评审有效期' },
769 { key: 'investigatorId', label: '资信调查人ID' } 767 { key: 'investigatorId', label: '资信调查人ID' }
@@ -97,7 +97,9 @@ @@ -97,7 +97,9 @@
97 import { downloadFile } from '@/utils/downloadFile.js' 97 import { downloadFile } from '@/utils/downloadFile.js'
98 import DetailButtons from '@/components/detail-buttons/index.vue' 98 import DetailButtons from '@/components/detail-buttons/index.vue'
99 import { getDicByCodes, getDicName } from '@/utils/dic.js' 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 export default { 104 export default {
103 name: 'DomesticTradeDetail', 105 name: 'DomesticTradeDetail',
@@ -109,6 +111,7 @@ export default { @@ -109,6 +111,7 @@ export default {
109 id: '', 111 id: '',
110 loading: false, 112 loading: false,
111 form: {}, 113 form: {},
  114 + investigatorId: '',
112 dicOptions: { 115 dicOptions: {
113 COMPANY_NATURE: [], 116 COMPANY_NATURE: [],
114 DEVELOP_NEW: [], 117 DEVELOP_NEW: [],
@@ -144,6 +147,11 @@ export default { @@ -144,6 +147,11 @@ export default {
144 visible: true, 147 visible: true,
145 variant: 'outline', 148 variant: 'outline',
146 event: 'cancel', 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,9 +163,10 @@ export default {
155 return [ 163 return [
156 { ...this.buttons[0], visible: d && this.$auth.hasPermi('procure-manage:domestic-trade:review') }, 164 { ...this.buttons[0], visible: d && this.$auth.hasPermi('procure-manage:domestic-trade:review') },
157 { ...this.buttons[1], visible: s === 'AUDIT' && e && this.$auth.hasPermi('procure-manage:domestic-trade:approve') }, 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 // { ...this.buttons[3], visible: s === 'PASS' && this.$auth.hasPermi('procure-manage:domestic-trade:change') }, 167 // { ...this.buttons[3], visible: s === 'PASS' && this.$auth.hasPermi('procure-manage:domestic-trade:change') },
160 { ...this.buttons[3], visible: s === 'REFUSE' && this.$auth.hasPermi('procure-manage:domestic-trade:cancel') }, 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 companyNatureOptions() { 172 companyNatureOptions() {
@@ -219,6 +228,16 @@ export default { @@ -219,6 +228,16 @@ export default {
219 this.loadDetail() 228 this.loadDetail()
220 }, 229 },
221 methods: { 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 async loadDicData() { 241 async loadDicData() {
223 try { 242 try {
224 const results = await getDicByCodes(['COMPANY_NATURE', 'DEVELOP_NEW', 'OPERATION_METHOD', 'PURCHASE_SOURCE']) 243 const results = await getDicByCodes(['COMPANY_NATURE', 'DEVELOP_NEW', 'OPERATION_METHOD', 'PURCHASE_SOURCE'])
@@ -291,7 +310,28 @@ export default { @@ -291,7 +310,28 @@ export default {
291 if (e === 'audit') return this.onAudit(btn && btn.params) 310 if (e === 'audit') return this.onAudit(btn && btn.params)
292 if (e === 'auditDetail') return this.onAuditDetail(btn && btn.params) 311 if (e === 'auditDetail') return this.onAuditDetail(btn && btn.params)
293 if (e === 'cancel') return this.onCancel(btn && btn.params) 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 onEdit(params) { 335 onEdit(params) {
296 uni.navigateTo({ url: '/pages/domestic_trade/modify?id=' + this.id }) 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,7 +351,7 @@ import FileUpload from '@/components/file-upload/index.vue'
351 import SingleSelectSheet from '@/components/single-select/index.vue' 351 import SingleSelectSheet from '@/components/single-select/index.vue'
352 import MultiSelectSheet from '@/components/multi-select/index.vue' 352 import MultiSelectSheet from '@/components/multi-select/index.vue'
353 import { getDicByCodes, getDicName } from '@/utils/dic.js' 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 export default { 356 export default {
357 name: 'DomesticTradeModify', 357 name: 'DomesticTradeModify',
@@ -751,8 +751,6 @@ export default { @@ -751,8 +751,6 @@ export default {
751 { key: 'operationMode', label: '操作方式' }, 751 { key: 'operationMode', label: '操作方式' },
752 { key: 'accountingProcess', label: '进销账务如何处理' }, 752 { key: 'accountingProcess', label: '进销账务如何处理' },
753 { key: 'transportMode', label: '运输方式' }, 753 { key: 'transportMode', label: '运输方式' },
754 - { key: 'commonMaterialIssue', label: '常见料质问题' },  
755 - { key: 'otherIssue', label: '合作中的其它问题' },  
756 { key: 'purchaseDepartment', label: '采购处' }, 754 { key: 'purchaseDepartment', label: '采购处' },
757 { key: 'reviewValidUntil', label: '评审有效期' }, 755 { key: 'reviewValidUntil', label: '评审有效期' },
758 { key: 'investigatorId', label: '资信调查人ID' } 756 { key: 'investigatorId', label: '资信调查人ID' }
@@ -831,7 +829,7 @@ export default { @@ -831,7 +829,7 @@ export default {
831 this.submitting = true 829 this.submitting = true
832 const payload = this.buildPayload() 830 const payload = this.buildPayload()
833 try { 831 try {
834 - await domesticCustomerCreditSaveApi(payload) 832 + await domesticCustomerCreditUpdateApi(payload)
835 uni.showToast({ title: '保存成功', icon: 'success' }) 833 uni.showToast({ title: '保存成功', icon: 'success' })
836 setTimeout(() => { uni.redirectTo({ url: '/pages/domestic_trade/index' }) }, 300) 834 setTimeout(() => { uni.redirectTo({ url: '/pages/domestic_trade/index' }) }, 300)
837 } catch (e) { 835 } catch (e) {
@@ -543,10 +543,6 @@ export default { @@ -543,10 +543,6 @@ export default {
543 } 543 }
544 console.log('审核__confirmApprove', payload) 544 console.log('审核__confirmApprove', payload)
545 this.$refs.approvePopup.close() 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 }