完成编辑支付表格

master
lynn 8 months ago
parent 4a5725a689
commit 63e03e782c

@ -2107,27 +2107,66 @@ export default {
this.getTemplateConfig();
} else if (this.currentStep === 2) {
//
this.$refs.basicInfoForm.validate((valid) => {
if (valid) {
//
if (!this.form.type) {
this.form.type = '';
}
if (!this.form.contract_carry_department) {
this.form.contract_carry_department = [];
}
if (!this.form.moneyWay) {
this.form.moneyWay = [];
}
const visibleFields = [];
//
if (this.form.before_contract_template) {
this.form.showAfterPayment = false;
}
//
if (this.showFields.projectName) {
visibleFields.push('name');
}
//
if (this.showFields.projectType) {
visibleFields.push('type');
}
//
if (this.showFields.budgetPrice) {
visibleFields.push('price');
}
this.currentStep++;
//
if (this.showFields.fundChannel) {
visibleFields.push('moneyWay');
}
//
if (this.showFields.budgetPlan) {
visibleFields.push('plan');
}
//
const missingFields = visibleFields.filter(field => {
if (field === 'moneyWay') {
return !this.form.moneyWay || this.form.moneyWay.length === 0;
} else if (field === 'plan') {
return !this.form.plan || this.form.plan.length === 0;
} else {
return !this.form[field];
}
});
if (missingFields.length > 0) {
this.$Message.warning('请填写所有必填项');
return;
}
//
if (!this.form.type) {
this.form.type = '';
}
if (!this.form.contract_carry_department) {
this.form.contract_carry_department = [];
}
if (!this.form.moneyWay) {
this.form.moneyWay = [];
}
//
if (this.form.before_contract_template) {
this.form.showAfterPayment = false;
}
this.currentStep++;
} else if (this.currentStep === 3) {
this.currentStep++;
}
@ -2184,31 +2223,6 @@ export default {
}
},
validateCurrentStep() {
if (this.currentStep === 1) {
if (!this.form.category || !this.form.affairType || !this.form.contractType ||
!this.form.purchaseForm || !this.form.purchaseMethod) {
this.$Message.warning('请填写所有必填项')
return false
}
//
this.getTemplateConfig()
return false //
} else if (this.currentStep === 2) {
// 使
let isValid = false
this.$refs.basicInfoForm.validate(valid => {
isValid = valid
if (!valid) {
this.$Message.warning('请填写所有必填项')
}
})
return isValid
}
return true
},
//
async getTemplateConfig() {
try {

Loading…
Cancel
Save