|
|
|
|
@ -194,7 +194,7 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item
|
|
|
|
|
prop="meeting_flow_id"
|
|
|
|
|
:label="'资金上会流程' + (isMeetingFlowRequired ? ' *' : '')"
|
|
|
|
|
label="资金上会流程"
|
|
|
|
|
>
|
|
|
|
|
<!-- 调试信息 -->
|
|
|
|
|
|
|
|
|
|
@ -697,7 +697,7 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item
|
|
|
|
|
prop="meeting_flow_id"
|
|
|
|
|
:label="'资金上会流程' + (isMeetingFlowRequired ? ' *' : '')"
|
|
|
|
|
label="资金上会流程"
|
|
|
|
|
>
|
|
|
|
|
<!-- 调试信息 -->
|
|
|
|
|
|
|
|
|
|
@ -1592,26 +1592,7 @@ 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",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
// meeting_flow_id: 提示改为提交时校验
|
|
|
|
|
},
|
|
|
|
|
plans: [],
|
|
|
|
|
planSelect: {
|
|
|
|
|
@ -2044,68 +2025,27 @@ export default {
|
|
|
|
|
//submit
|
|
|
|
|
this.$refs["form"].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
// 验证资金上会流程
|
|
|
|
|
// 提示:金额达到阈值但未选择上会流程
|
|
|
|
|
if (this.isMeetingFlowRequired && !this.form.meeting_flow_id) {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: 'warning',
|
|
|
|
|
message: '资金上会流程为必选项'
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.btnLoading = true;
|
|
|
|
|
if (!this.form.use_framework_buy) {
|
|
|
|
|
this.form.contract_to_contracts = [];
|
|
|
|
|
} else {
|
|
|
|
|
this.form.contract_plan_links = [];
|
|
|
|
|
}
|
|
|
|
|
this.form.is_purchase =
|
|
|
|
|
(this.flowIds?.find((i) => i.id == this.form.flow_mod_id)?.type ==
|
|
|
|
|
2
|
|
|
|
|
? 1
|
|
|
|
|
: 0) || this.form.is_common_purchase;
|
|
|
|
|
if (this.form.is_common_purchase) {
|
|
|
|
|
this.form.is_contract = 1;
|
|
|
|
|
}
|
|
|
|
|
if (this.form.is_contract) {
|
|
|
|
|
this.form.is_tender_audit = 1;
|
|
|
|
|
}
|
|
|
|
|
if (this.form.is_simple) {
|
|
|
|
|
this.form.is_contract = 0;
|
|
|
|
|
this.form.is_tender_audit = 0;
|
|
|
|
|
}
|
|
|
|
|
// this.form.is_contract = this.flowIds?.find(i => i.id == this.form.flow_mod_id)?.type == 2 ? 0 : 1;
|
|
|
|
|
if (!this.form.money) {
|
|
|
|
|
this.form.money = this.form.plan_price;
|
|
|
|
|
}
|
|
|
|
|
if (this.type === "add") {
|
|
|
|
|
addContrant(this.form, true)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
this.btnLoading = false;
|
|
|
|
|
//this.step = 3;
|
|
|
|
|
this.$router.push({
|
|
|
|
|
path:
|
|
|
|
|
this.form.is_simple || !this.form.is_purchase
|
|
|
|
|
? "/contract/contractAll"
|
|
|
|
|
: "/contract/contractList",
|
|
|
|
|
query: {
|
|
|
|
|
keyword: this.form.name,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.catch((_) => (this.btnLoading = false));
|
|
|
|
|
}
|
|
|
|
|
if (this.type === "edit") {
|
|
|
|
|
editorContract({
|
|
|
|
|
id: this.contractId,
|
|
|
|
|
...this.form,
|
|
|
|
|
})
|
|
|
|
|
.then((res) => {
|
|
|
|
|
this.btnLoading = false;
|
|
|
|
|
this.step = 3;
|
|
|
|
|
})
|
|
|
|
|
.catch((_) => (this.btnLoading = false));
|
|
|
|
|
MessageBox.confirm(
|
|
|
|
|
'当前合同金额超出10万元,请确认是否需要选择资金上会流程',
|
|
|
|
|
'提示',
|
|
|
|
|
{
|
|
|
|
|
confirmButtonText: '直接提交',
|
|
|
|
|
cancelButtonText: '关闭',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
closeOnClickModal: false,
|
|
|
|
|
closeOnPressEscape: false
|
|
|
|
|
}
|
|
|
|
|
).then(() => {
|
|
|
|
|
this._proceedSubmit();
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
// 用户取消/关闭,不继续提交
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// 正常提交
|
|
|
|
|
this._proceedSubmit();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
@ -2251,7 +2191,105 @@ export default {
|
|
|
|
|
contract_to_contracts: [],
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
_proceedSubmit() {
|
|
|
|
|
this.btnLoading = true;
|
|
|
|
|
if (!this.form.use_framework_buy) {
|
|
|
|
|
this.form.contract_to_contracts = [];
|
|
|
|
|
} else {
|
|
|
|
|
this.form.contract_plan_links = [];
|
|
|
|
|
}
|
|
|
|
|
this.form.is_purchase =
|
|
|
|
|
(this.flowIds?.find((i) => i.id == this.form.flow_mod_id)?.type == 2
|
|
|
|
|
? 1
|
|
|
|
|
: 0) || this.form.is_common_purchase;
|
|
|
|
|
if (this.form.is_common_purchase) {
|
|
|
|
|
this.form.is_contract = 1;
|
|
|
|
|
}
|
|
|
|
|
if (this.form.is_contract) {
|
|
|
|
|
this.form.is_tender_audit = 1;
|
|
|
|
|
}
|
|
|
|
|
if (this.form.is_simple) {
|
|
|
|
|
this.form.is_contract = 0;
|
|
|
|
|
this.form.is_tender_audit = 0;
|
|
|
|
|
}
|
|
|
|
|
if (!this.form.money) {
|
|
|
|
|
this.form.money = this.form.plan_price;
|
|
|
|
|
}
|
|
|
|
|
if (this.type === 'add') {
|
|
|
|
|
addContrant(this.form, true)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
this.btnLoading = false;
|
|
|
|
|
this.$router.push({
|
|
|
|
|
path:
|
|
|
|
|
this.form.is_simple || !this.form.is_purchase
|
|
|
|
|
? '/contract/contractAll'
|
|
|
|
|
: '/contract/contractList',
|
|
|
|
|
query: {
|
|
|
|
|
keyword: this.form.name,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.catch((_) => (this.btnLoading = false));
|
|
|
|
|
}
|
|
|
|
|
if (this.type === 'edit') {
|
|
|
|
|
editorContract({ id: this.contractId, ...this.form })
|
|
|
|
|
.then((res) => {
|
|
|
|
|
this.btnLoading = false;
|
|
|
|
|
this.step = 3;
|
|
|
|
|
})
|
|
|
|
|
.catch((_) => (this.btnLoading = false));
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
_proceedSubmit() {
|
|
|
|
|
this.btnLoading = true;
|
|
|
|
|
if (!this.form.use_framework_buy) {
|
|
|
|
|
this.form.contract_to_contracts = [];
|
|
|
|
|
} else {
|
|
|
|
|
this.form.contract_plan_links = [];
|
|
|
|
|
}
|
|
|
|
|
this.form.is_purchase =
|
|
|
|
|
(this.flowIds?.find((i) => i.id == this.form.flow_mod_id)?.type == 2
|
|
|
|
|
? 1
|
|
|
|
|
: 0) || this.form.is_common_purchase;
|
|
|
|
|
if (this.form.is_common_purchase) {
|
|
|
|
|
this.form.is_contract = 1;
|
|
|
|
|
}
|
|
|
|
|
if (this.form.is_contract) {
|
|
|
|
|
this.form.is_tender_audit = 1;
|
|
|
|
|
}
|
|
|
|
|
if (this.form.is_simple) {
|
|
|
|
|
this.form.is_contract = 0;
|
|
|
|
|
this.form.is_tender_audit = 0;
|
|
|
|
|
}
|
|
|
|
|
if (!this.form.money) {
|
|
|
|
|
this.form.money = this.form.plan_price;
|
|
|
|
|
}
|
|
|
|
|
if (this.type === 'add') {
|
|
|
|
|
addContrant(this.form, true)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
this.btnLoading = false;
|
|
|
|
|
this.$router.push({
|
|
|
|
|
path:
|
|
|
|
|
this.form.is_simple || !this.form.is_purchase
|
|
|
|
|
? '/contract/contractAll'
|
|
|
|
|
: '/contract/contractList',
|
|
|
|
|
query: {
|
|
|
|
|
keyword: this.form.name,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.catch((_) => (this.btnLoading = false));
|
|
|
|
|
}
|
|
|
|
|
if (this.type === 'edit') {
|
|
|
|
|
editorContract({ id: this.contractId, ...this.form })
|
|
|
|
|
.then((res) => {
|
|
|
|
|
this.btnLoading = false;
|
|
|
|
|
this.step = 3;
|
|
|
|
|
})
|
|
|
|
|
.catch((_) => (this.btnLoading = false));
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
flowIdsFormat() {
|
|
|
|
|
let temp = this.form.is_trade;
|
|
|
|
|
|