diff --git a/src/components/contractIntegration/index.vue b/src/components/contractIntegration/index.vue index 9ba68a8..f800cf5 100644 --- a/src/components/contractIntegration/index.vue +++ b/src/components/contractIntegration/index.vue @@ -131,7 +131,7 @@
已确认金额 - + {{confirmedAmount}}
+
+ 调试: is_common_purchase={{form.is_common_purchase}}, + total_money={{form.total_money}}, + disabled={{isMeetingFlowDisabled}}, + required={{isMeetingFlowRequired}} +
+ + :label="item.data.yiti+'-'+item.title" + > + {{ item.data.yiti }}-{{ item.title }} + 查看 + @@ -966,6 +989,26 @@ export default { }, trigger: 'change' } + ], + meeting_flow_id: [ + { + validator: (rule, value, callback) => { + // 如果是一般采购,则不是必选 + if (this.form.is_common_purchase) { + callback() + return + } + // 如果合同金额大于等于10万,则必选 + if (this.form.total_money && Number(this.form.total_money) >= 100000) { + if (!value) { + callback(new Error('资金上会流程为必选项')) + return + } + } + callback() + }, + trigger: 'change' + } ] }, contractTypes: [ @@ -1022,21 +1065,40 @@ export default { } } }, + + // 资金上会流程是否必选 + isMeetingFlowRequired() { + return !this.form.is_common_purchase && this.form.total_money && Number(this.form.total_money) >= 100000 + }, + + // 资金上会流程是否禁用 + isMeetingFlowDisabled() { + // 如果是一般采购,则不禁用 + if (this.form.is_common_purchase) { + return false + } + // 如果不是一般采购,且金额小于10万,则禁用 + return this.form.total_money && Number(this.form.total_money) < 100000 + } }, // 还原:不在此处强制加载上会列表,遵循原有调用链 created() { this.getSh() }, methods: { + // 查看OA流程 + viewOaFlow(flowId) { + // 调用父组件的toOaDetail方法 + this.$parent.toOaDetail('other', null, flowId) + }, // 获取上会列表 async getSh(){ const res = await getShList({ page:1, page_size:999, custom_model_id:103, - field_id:1225, - operator:'eq', - field_keyword:'采购事项' + sort_name:'created_at', + sort_type:'DESC' }) this.shList = res.data.data }, @@ -1152,6 +1214,15 @@ export default { }, submit() { this.$refs['elForm'].validate().then(_ => { + // 验证资金上会流程 + if (this.isMeetingFlowRequired && !this.form.meeting_flow_id) { + this.$message({ + type: 'warning', + message: '资金上会流程为必选项' + }) + return + } + this.form.contract_to_contracts = this.selections.map(i => { return { contract_id: this.contrantId, diff --git a/src/views/contract/components/detailPaymentRegistration.vue b/src/views/contract/components/detailPaymentRegistration.vue index 6e0ed43..f3019b9 100644 --- a/src/views/contract/components/detailPaymentRegistration.vue +++ b/src/views/contract/components/detailPaymentRegistration.vue @@ -23,20 +23,31 @@
{{ moneyFormat(form.contract.money) }} (元)
-
资金上会流程
+
+ 资金上会流程 + * +
+ :label="item.data.yiti+'-'+item.title" + > + {{ item.data.yiti }}-{{ item.title }} + 查看 +
@@ -178,6 +189,21 @@ + + + +
+