|
|
|
|
@ -489,7 +489,7 @@
|
|
|
|
|
v-show="true"
|
|
|
|
|
:label="formType === 'contract' ? '承包商/供应商' : '付款对象'"
|
|
|
|
|
prop="supply"
|
|
|
|
|
:rules="[{ required: true, message: formType === 'contract' ? '请输入承包商/供应商' : '请输入付款对象', trigger: 'submit' }]"
|
|
|
|
|
:rules="formType === 'contract' ? [] : [{ required: true, message: '请输入付款对象', trigger: 'submit' }]"
|
|
|
|
|
>
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="form.supply"
|
|
|
|
|
@ -2189,7 +2189,66 @@ export default {
|
|
|
|
|
// 提交新建
|
|
|
|
|
async submit() {
|
|
|
|
|
try {
|
|
|
|
|
console.log(this.form.showAfterPayment)
|
|
|
|
|
// 验证基本信息表单
|
|
|
|
|
const visibleFields = []
|
|
|
|
|
|
|
|
|
|
// 检查项目名称是否显示
|
|
|
|
|
if (this.showFields.projectName) {
|
|
|
|
|
visibleFields.push('name')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 检查项目类型是否显示
|
|
|
|
|
if (this.showFields.projectType) {
|
|
|
|
|
visibleFields.push('type')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 检查预算价格是否显示
|
|
|
|
|
if (this.showFields.budgetPrice) {
|
|
|
|
|
visibleFields.push('price')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 检查资金渠道是否显示
|
|
|
|
|
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 (this.formType !== 'contract' && !this.form.supply) {
|
|
|
|
|
this.$Message.warning('请输入付款对象')
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (missingFields.length > 0) {
|
|
|
|
|
// 生成具体的错误提示信息
|
|
|
|
|
const fieldNames = {
|
|
|
|
|
name: '项目名称',
|
|
|
|
|
type: '项目类型',
|
|
|
|
|
price: '合同预算金额',
|
|
|
|
|
moneyWay: '资金渠道',
|
|
|
|
|
plan: '关联预算计划',
|
|
|
|
|
supply: '付款对象'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const missingFieldNames = missingFields.map(field => fieldNames[field] || field).join('、')
|
|
|
|
|
this.$Message.warning(`请填写:${missingFieldNames}`)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 保存事前支付表格的数据
|
|
|
|
|
if (!this.form.showAfterPayment && this.form.before_contract_template) {
|
|
|
|
|
@ -2497,50 +2556,6 @@ export default {
|
|
|
|
|
// 获取模版配置
|
|
|
|
|
this.getTemplateConfig()
|
|
|
|
|
} else if (this.currentStep === 2) {
|
|
|
|
|
// 验证基本信息表单
|
|
|
|
|
const visibleFields = []
|
|
|
|
|
|
|
|
|
|
// 检查项目名称是否显示
|
|
|
|
|
if (this.showFields.projectName) {
|
|
|
|
|
visibleFields.push('name')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 检查项目类型是否显示
|
|
|
|
|
if (this.showFields.projectType) {
|
|
|
|
|
visibleFields.push('type')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 检查预算价格是否显示
|
|
|
|
|
if (this.showFields.budgetPrice) {
|
|
|
|
|
visibleFields.push('price')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 检查资金渠道是否显示
|
|
|
|
|
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 = ''
|
|
|
|
|
|