diff --git a/src/views/contract/components/detailContract.vue b/src/views/contract/components/detailContract.vue index 425e33d..3a919a7 100644 --- a/src/views/contract/components/detailContract.vue +++ b/src/views/contract/components/detailContract.vue @@ -1,537 +1,535 @@ - - - - - diff --git a/src/views/contract/components/editorContract.vue b/src/views/contract/components/editorContract.vue index 007b106..fc0d2d4 100644 --- a/src/views/contract/components/editorContract.vue +++ b/src/views/contract/components/editorContract.vue @@ -496,31 +496,21 @@ ['qingshi',17], ['zhaobiaowenjianshencha',27] ]) + const flow2contractField = new Map([ + ['caigou',"purchase_status"], + ['hetonghuiqian',"join_status"], + ['qingshi',"req_status"], + ['zhaobiaowenjianshencha',"invite_status"] + ]) if (!this.oatoken) { this.oatoken = (await getOatoken()).oatoken; } - - const res = await httpCurl({ - oatoken: this.oatoken, - table, - keyword: this.detail.name - },true,'','get',`${process.env.VUE_APP_OUT_URL}/api/flow-list`) - - if (res.data.flow.data.length > 0) { - const oaFlow = res.data.flow.data[0] - console.log('oaFlow',oaFlow) - updateContract({ - out_contract_id: this.contrantId, - flow_type: flow_type.get(table), - status: oaFlow.status, - flow_id: this.oaFlow[table] - }) - } else { - this.$message({ - type: 'warning', - message: '内控系统未找到相应流程' - }) - } + updateContract({ + out_contract_id: this.contrantId, + flow_type: flow_type.get(table), + status: (this.detail[flow2contractField.get(table)] - 2), + flow_id: this.oaFlow[table] + }) }, //预算计划金额输入 planInput(e, row) { @@ -689,8 +679,14 @@ }, editor() { + const flow2contractField = new Map([ + ['caigou',"purchase_status"], + ['hetonghuiqian',"join_status"], + ['qingshi',"req_status"], + ['zhaobiaowenjianshencha',"invite_status"] + ]) for (let key in this.oaFlow) { - if (this.oaFlow[key]) { + if (this.oaFlow[key] && this.detail[flow2contractField.get(key)] && this.detail[flow2contractField.get(key)] !== 1) { this.getOaFlow(key).then(res => { }) }