资金上会

master
lion 3 months ago
parent 98c9a3c7f7
commit 95b49b3728

@ -18,7 +18,7 @@
</el-form-item> </el-form-item>
<el-form-item <el-form-item
prop="meeting_flow_id" prop="meeting_flow_id"
:label="'资金上会流程' + (isMeetingFlowRequired ? ' *' : '')" label="资金上会流程"
> >
<el-select <el-select
v-model="form.meeting_flow_id" v-model="form.meeting_flow_id"
@ -1000,26 +1000,6 @@ export default {
}, },
trigger: 'change' 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: [ contractTypes: [
@ -1229,31 +1209,46 @@ export default {
}, },
submit() { submit() {
this.$refs['elForm'].validate().then(_ => { this.$refs['elForm'].validate().then(_ => {
// //
if (this.isMeetingFlowRequired && !this.form.meeting_flow_id) { if (this.isMeetingFlowRequired && !this.form.meeting_flow_id) {
this.$message({ this.$confirm(
type: 'warning', '当前合同金额超出10万元请确认是否需要选择资金上会流程',
message: '资金上会流程为必选项' '提示',
{
confirmButtonText: '直接提交',
cancelButtonText: '关闭',
type: 'warning',
closeOnClickModal: false,
closeOnPressEscape: false
}
).then(() => {
this._proceedSubmit()
}).catch(() => {
// /
}) })
return return
} }
this.form.contract_to_contracts = this.selections.map(i => { //
return { this._proceedSubmit()
contract_id: this.contrantId, })
to_contract_id: i.id, },
use_money: i.money _proceedSubmit() {
} this.form.contract_to_contracts = this.selections.map(i => {
}) return {
this.form.contract_flow_links = this.form.contract_flow_links.map(i => ({ contract_id: this.contrantId,
...i, to_contract_id: i.id,
tag: this.flowConfig.find(j => j.custom_model_id == i.custom_model_id)?.tag use_money: i.money
})) }
editorContract(this.form).then(_ => { })
this.$message.success('修改成功') this.form.contract_flow_links = this.form.contract_flow_links.map(i => ({
this.$emit('update:isShow', false) ...i,
this.$emit('refresh') tag: this.flowConfig.find(j => j.custom_model_id == i.custom_model_id)?.tag
}) }))
editorContract(this.form).then(_ => {
this.$message.success('修改成功')
this.$emit('update:isShow', false)
this.$emit('refresh')
}) })
} }
} }

@ -323,20 +323,6 @@ export default {
type: [{ type: [{
required: true, required: true,
message: '必选' message: '必选'
}],
meeting_flow_id: [{
required: true,
message: '资金上会流程为必选项',
validator: (rule, value, callback) => {
// 5
if (this.form.apply_money && Number(this.form.apply_money) >= 50000) {
if (!value) {
callback(new Error('资金上会流程为必选项'))
return
}
}
callback()
}
}] }]
}, },
// OA // OA
@ -425,15 +411,30 @@ export default {
}, },
editor() { editor() {
// //
if (this.isMeetingFlowRequired && !this.form.meeting_flow_id) { if (this.isMeetingFlowRequired && !this.form.meeting_flow_id) {
Message({ this.$confirm(
type: 'warning', '当前申请付款金额超出5万元请确认是否需要选择资金上会流程',
message: '资金上会流程为必选项' '提示',
{
confirmButtonText: '直接提交',
cancelButtonText: '关闭',
type: 'warning',
closeOnClickModal: false,
closeOnPressEscape: false
}
).then(() => {
this._proceedSubmit()
}).catch(() => {
// /
}) })
return return
} }
//
this._proceedSubmit()
},
_proceedSubmit() {
editorFundLog(this.form).then(res => { editorFundLog(this.form).then(res => {
this.$emit('success') this.$emit('success')
this.isShow = false this.isShow = false

@ -534,20 +534,6 @@ export default {
type: [{ type: [{
required: true, required: true,
message: '必选' message: '必选'
}],
meeting_flow_id: [{
required: true,
message: '资金上会流程为必选项',
validator: (rule, value, callback) => {
// 5
if (this.paymentRegistrationForm.applyMoney && Number(this.paymentRegistrationForm.applyMoney) >= 50000) {
if (!value) {
callback(new Error('资金上会流程为必选项'))
return
}
}
callback()
}
}] }]
}, },
departments: [], departments: [],
@ -913,15 +899,30 @@ export default {
}) })
}, },
submit() { submit() {
// //
if (this.isMeetingFlowRequired && !this.paymentRegistrationForm.meeting_flow_id) { if (this.isMeetingFlowRequired && !this.paymentRegistrationForm.meeting_flow_id) {
Message({ this.$confirm(
type: 'warning', '当前申请付款金额超出5万元请确认是否需要选择资金上会流程',
message: '资金上会流程为必选项' '提示',
{
confirmButtonText: '直接提交',
cancelButtonText: '关闭',
type: 'warning',
closeOnClickModal: false,
closeOnPressEscape: false
}
).then(() => {
this._proceedSubmit()
}).catch(() => {
// /
}) })
return return
} }
//
this._proceedSubmit()
},
_proceedSubmit() {
const data = { const data = {
contract_id: this.contract.id, contract_id: this.contract.id,
apply_money: this.paymentRegistrationForm.applyMoney, apply_money: this.paymentRegistrationForm.applyMoney,

@ -194,7 +194,7 @@
</el-form-item> </el-form-item>
<el-form-item <el-form-item
prop="meeting_flow_id" prop="meeting_flow_id"
:label="'资金上会流程' + (isMeetingFlowRequired ? ' *' : '')" label="资金上会流程"
> >
<!-- 调试信息 --> <!-- 调试信息 -->
@ -697,7 +697,7 @@
</el-form-item> </el-form-item>
<el-form-item <el-form-item
prop="meeting_flow_id" prop="meeting_flow_id"
:label="'资金上会流程' + (isMeetingFlowRequired ? ' *' : '')" label="资金上会流程"
> >
<!-- 调试信息 --> <!-- 调试信息 -->
@ -1592,26 +1592,7 @@ export default {
trigger: "change", trigger: "change",
}, },
], ],
meeting_flow_id: [ // 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",
},
],
}, },
plans: [], plans: [],
planSelect: { planSelect: {
@ -2044,68 +2025,27 @@ export default {
//submit //submit
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
// //
if (this.isMeetingFlowRequired && !this.form.meeting_flow_id) { if (this.isMeetingFlowRequired && !this.form.meeting_flow_id) {
this.$message({ MessageBox.confirm(
type: 'warning', '当前合同金额超出10万元请确认是否需要选择资金上会流程',
message: '资金上会流程为必选项' '提示',
}) {
return confirmButtonText: '直接提交',
} cancelButtonText: '关闭',
type: 'warning',
this.btnLoading = true; closeOnClickModal: false,
if (!this.form.use_framework_buy) { closeOnPressEscape: false
this.form.contract_to_contracts = []; }
} else { ).then(() => {
this.form.contract_plan_links = []; this._proceedSubmit();
} }).catch(() => {
this.form.is_purchase = // /
(this.flowIds?.find((i) => i.id == this.form.flow_mod_id)?.type == });
2 return;
? 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));
} }
//
this._proceedSubmit();
} }
}); });
} }
@ -2251,7 +2191,105 @@ export default {
contract_to_contracts: [], 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: { computed: {
flowIdsFormat() { flowIdsFormat() {
let temp = this.form.is_trade; let temp = this.form.is_trade;

Loading…
Cancel
Save