Commit 435a2809625bb32641996a056b18cf657b1a3bda

Authored by gesilong
1 parent ad130766

commit:补充提交功能

... ... @@ -42,6 +42,16 @@ export function domesticCustomerCreditCancelApi(id) {
42 42 })
43 43 }
44 44
  45 +export function domesticCustomerCreditSubmitApi(id) {
  46 + return request({
  47 + url: '/procurement/domesticCustomerCredit/submit',
  48 + method: 'get',
  49 + params: { id }
  50 + })
  51 +}
  52 +
  53 +
  54 +
45 55 export function getPurchaseDeptApi() {
46 56 return request({
47 57 url: '/system/dept/getPurchaseDept',
... ...
... ... @@ -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 },
... ...