|
|
|
@ -59,8 +59,8 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<template v-slot:act_date v-if="currentStep === 1">
|
|
|
|
<template v-slot:act_date>
|
|
|
|
<div class="xy-table-item">
|
|
|
|
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2)" class="xy-table-item">
|
|
|
|
<div class="xy-table-item-label">实付日期</div>
|
|
|
|
<div class="xy-table-item-label">实付日期</div>
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
<el-date-picker type="date" v-model="paymentRegistrationForm.act_date" value-format="yyyy-MM-dd" style="width: 150px;">
|
|
|
|
<el-date-picker type="date" v-model="paymentRegistrationForm.act_date" value-format="yyyy-MM-dd" style="width: 150px;">
|
|
|
|
@ -69,8 +69,8 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<template v-slot:applyMoney v-if="currentStep === 1">
|
|
|
|
<template v-slot:applyMoney>
|
|
|
|
<div class="xy-table-item">
|
|
|
|
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2)" class="xy-table-item">
|
|
|
|
<div class="xy-table-item-label">
|
|
|
|
<div class="xy-table-item-label">
|
|
|
|
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>申请付款金额
|
|
|
|
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>申请付款金额
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@ -81,8 +81,8 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<template v-slot:audit_money v-if="currentStep === 1">
|
|
|
|
<template v-slot:audit_money>
|
|
|
|
<div class="xy-table-item">
|
|
|
|
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2)" class="xy-table-item">
|
|
|
|
<div class="xy-table-item-label">审计金额</div>
|
|
|
|
<div class="xy-table-item-label">审计金额</div>
|
|
|
|
<div class="xy-table-item-content xy-table-item-price">
|
|
|
|
<div class="xy-table-item-content xy-table-item-price">
|
|
|
|
<el-input clearable placeholder="请填写审计金额" v-model="form.audit_money" style="width: 150px;" />
|
|
|
|
<el-input clearable placeholder="请填写审计金额" v-model="form.audit_money" style="width: 150px;" />
|
|
|
|
@ -90,8 +90,8 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<template v-slot:deductionMoney v-if="currentStep === 1">
|
|
|
|
<template v-slot:deductionMoney>
|
|
|
|
<div class="xy-table-item">
|
|
|
|
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2)" class="xy-table-item">
|
|
|
|
<div class="xy-table-item-label">
|
|
|
|
<div class="xy-table-item-label">
|
|
|
|
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>本期扣款金额
|
|
|
|
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>本期扣款金额
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@ -102,8 +102,8 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<template v-slot:remark v-if="currentStep === 1">
|
|
|
|
<template v-slot:remark>
|
|
|
|
<div class="xy-table-item">
|
|
|
|
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2)" class="xy-table-item">
|
|
|
|
<div class="xy-table-item-label">备注</div>
|
|
|
|
<div class="xy-table-item-label">备注</div>
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
<el-input type="textarea" clearable placeholder="进度款日期:2022.6.8-2022.7.7"
|
|
|
|
<el-input type="textarea" clearable placeholder="进度款日期:2022.6.8-2022.7.7"
|
|
|
|
@ -112,8 +112,8 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<template v-slot:type v-if="currentStep === 1">
|
|
|
|
<template v-slot:type>
|
|
|
|
<div class="xy-table-item">
|
|
|
|
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2)" class="xy-table-item">
|
|
|
|
<div class="xy-table-item-label">
|
|
|
|
<div class="xy-table-item-label">
|
|
|
|
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>款项类型
|
|
|
|
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>款项类型
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@ -127,8 +127,8 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<template v-slot:isLast v-if="currentStep === 1">
|
|
|
|
<template v-slot:isLast>
|
|
|
|
<div class="xy-table-item">
|
|
|
|
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2)" class="xy-table-item">
|
|
|
|
<div class="xy-table-item-label" style="width: 200px">
|
|
|
|
<div class="xy-table-item-label" style="width: 200px">
|
|
|
|
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>是否为最后一笔
|
|
|
|
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>是否为最后一笔
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@ -137,8 +137,9 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<template v-slot:end_time v-if="currentStep === 1">
|
|
|
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
<template v-slot:end_time>
|
|
|
|
|
|
|
|
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2)" class="xy-table-item">
|
|
|
|
<div class="xy-table-item-label">项目完成时间</div>
|
|
|
|
<div class="xy-table-item-label">项目完成时间</div>
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
<el-date-picker type="date" v-model="paymentRegistrationForm.end_time" value-format="yyyy-MM-dd HH:mm:ss" style="width: 150px;">
|
|
|
|
<el-date-picker type="date" v-model="paymentRegistrationForm.end_time" value-format="yyyy-MM-dd HH:mm:ss" style="width: 150px;">
|
|
|
|
@ -146,8 +147,9 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<template v-slot:isCheck v-if="currentStep === 1">
|
|
|
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
<template v-slot:isCheck>
|
|
|
|
|
|
|
|
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2)" class="xy-table-item">
|
|
|
|
<div class="xy-table-item-label" style="width: 200px">
|
|
|
|
<div class="xy-table-item-label" style="width: 200px">
|
|
|
|
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>是否验收
|
|
|
|
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>是否验收
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@ -158,7 +160,7 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<template v-slot:extraFormBottom>
|
|
|
|
<template v-slot:extraFormBottom>
|
|
|
|
<div v-if="currentStep === 2" class="payment-table-section">
|
|
|
|
<div v-if="hasPostPaymentForm && currentStep === 1" class="payment-table-section">
|
|
|
|
<div class="section-title">
|
|
|
|
<div class="section-title">
|
|
|
|
事后支付表格
|
|
|
|
事后支付表格
|
|
|
|
<el-button type="text" @click="openZoomedTable" style="margin-left: 10px;">
|
|
|
|
<el-button type="text" @click="openZoomedTable" style="margin-left: 10px;">
|
|
|
|
@ -173,9 +175,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
<template v-slot:footerContent>
|
|
|
|
<template v-slot:footerContent>
|
|
|
|
<div class="dialog-footer">
|
|
|
|
<div class="dialog-footer">
|
|
|
|
<el-button v-if="currentStep === 2" @click="currentStep = 1">上一步</el-button>
|
|
|
|
<el-button v-if="hasPostPaymentForm && currentStep === 2" @click="currentStep = 1">上一步</el-button>
|
|
|
|
<el-button v-if="currentStep === 1 && forms && forms.length > 0" @click="nextStep">下一步</el-button>
|
|
|
|
<el-button v-if="hasPostPaymentForm && currentStep === 1" @click="nextStep">下一步</el-button>
|
|
|
|
<el-button v-if="currentStep === 2 || (currentStep === 1 && (!forms || !forms.length))" type="primary" @click="submit">确定</el-button>
|
|
|
|
<el-button v-if="(hasPostPaymentForm && currentStep === 2) || (!hasPostPaymentForm)" type="primary" @click="submit">确定</el-button>
|
|
|
|
<el-button @click="resetForm">重置</el-button>
|
|
|
|
<el-button @click="resetForm">重置</el-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
@ -349,9 +351,24 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
],
|
|
|
|
showZoomedTable: false, // 控制放大表格弹窗的显示
|
|
|
|
showZoomedTable: false, // 控制放大表格弹窗的显示
|
|
|
|
|
|
|
|
hasPostPaymentForm: false, // 是否有事后支付表格
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
getDefaultPaymentRegistrationForm() {
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
applyMoney: "",
|
|
|
|
|
|
|
|
deductionMoney: "",
|
|
|
|
|
|
|
|
audit_money: "",
|
|
|
|
|
|
|
|
act_date: '',
|
|
|
|
|
|
|
|
type: "",
|
|
|
|
|
|
|
|
isLast: false,
|
|
|
|
|
|
|
|
end_time:'',
|
|
|
|
|
|
|
|
isCheck:false,
|
|
|
|
|
|
|
|
plan: [],
|
|
|
|
|
|
|
|
remark: ""
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
checkIsEnd (e) {
|
|
|
|
checkIsEnd (e) {
|
|
|
|
this.paymentRegistrationForm.isLast = (Number(this.totalMoney()) + Number(e)) >= (this.contract.money * 0.95);
|
|
|
|
this.paymentRegistrationForm.isLast = (Number(this.totalMoney()) + Number(e)) >= (this.contract.money * 0.95);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
@ -406,7 +423,6 @@
|
|
|
|
this.contract = await detailContract({
|
|
|
|
this.contract = await detailContract({
|
|
|
|
id: info.id
|
|
|
|
id: info.id
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
this.paymentRegistrationForm.plan = this.contract.plans.map(item => {
|
|
|
|
this.paymentRegistrationForm.plan = this.contract.plans.map(item => {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
plan_id: item.id,
|
|
|
|
plan_id: item.id,
|
|
|
|
@ -414,29 +430,27 @@
|
|
|
|
new_money: item.money,
|
|
|
|
new_money: item.money,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
this.form.audit_money = this.contract.audit_money;
|
|
|
|
this.form.audit_money = this.contract.audit_money;
|
|
|
|
|
|
|
|
|
|
|
|
const res = await getFundLog({
|
|
|
|
const res = await getFundLog({
|
|
|
|
contract_id: this.contract.id,
|
|
|
|
contract_id: this.contract.id,
|
|
|
|
page: 1,
|
|
|
|
page: 1,
|
|
|
|
page_size: 999
|
|
|
|
page_size: 999
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
this.payment = res.data;
|
|
|
|
this.payment = res.data;
|
|
|
|
console.log(this.contract.contract_template)
|
|
|
|
// 判断是否有事后支付表格模板
|
|
|
|
console.log(this.contract.forms)
|
|
|
|
if (this.contract.contract_template && this.contract.contract_template.template) {
|
|
|
|
// 获取合同模板和表单数据
|
|
|
|
this.hasPostPaymentForm = true;
|
|
|
|
if (this.contract.contract_template) {
|
|
|
|
this.currentStep = 1;
|
|
|
|
this.contractTemplate = this.contract.contract_template.template;
|
|
|
|
this.contractTemplate = this.contract.contract_template.template;
|
|
|
|
this.forms = this.contract.forms;
|
|
|
|
this.forms = this.contract.forms;
|
|
|
|
|
|
|
|
|
|
|
|
// 确保 contract_template_fields 存在
|
|
|
|
|
|
|
|
if (!this.contract.contract_template.contract_template_fields) {
|
|
|
|
if (!this.contract.contract_template.contract_template_fields) {
|
|
|
|
this.contract.contract_template.contract_template_fields = this.contract.other_data || [];
|
|
|
|
this.contract.contract_template.contract_template_fields = this.contract.other_data || [];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
console.log('Contract template fields:', this.contract.contract_template.contract_template_fields);
|
|
|
|
this.hasPostPaymentForm = false;
|
|
|
|
|
|
|
|
this.currentStep = 1;
|
|
|
|
|
|
|
|
this.contractTemplate = null;
|
|
|
|
|
|
|
|
this.forms = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
@ -561,10 +575,21 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
nextStep() {
|
|
|
|
nextStep() {
|
|
|
|
// 使用和提交一样的验证逻辑
|
|
|
|
// 如果有事后支付表格,下一步不做表单校验,直接切换 currentStep=2
|
|
|
|
|
|
|
|
if (this.hasPostPaymentForm) {
|
|
|
|
|
|
|
|
// 保存事后支付表格HTML数据,参考 openZoomedTable 逻辑
|
|
|
|
|
|
|
|
const dom = this.$refs.zoomedForms || this.$refs.zoomedTemplate;
|
|
|
|
|
|
|
|
if (dom && this.contract.contract_template) {
|
|
|
|
|
|
|
|
this.forms = syncFormDomToHtml(dom, this.contract.contract_template.contract_template_fields);
|
|
|
|
|
|
|
|
this.contract.forms = this.forms;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.currentStep = 2;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// 没有事后支付表格时,下一步其实就是提交,校验在 submit 里
|
|
|
|
|
|
|
|
if (this.$refs['paymentRegistration'] && this.$refs['paymentRegistration'].$refs['elForm']) {
|
|
|
|
this.$refs['paymentRegistration'].$refs['elForm'].validate().then(res => {
|
|
|
|
this.$refs['paymentRegistration'].$refs['elForm'].validate().then(res => {
|
|
|
|
if (res) {
|
|
|
|
if (res) {
|
|
|
|
this.currentStep = 2;
|
|
|
|
this.submit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).catch(err => {
|
|
|
|
}).catch(err => {
|
|
|
|
this.$Message.warning({
|
|
|
|
this.$Message.warning({
|
|
|
|
@ -572,6 +597,10 @@
|
|
|
|
duration: 1
|
|
|
|
duration: 1
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.submit();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
resetForm() {
|
|
|
|
resetForm() {
|
|
|
|
@ -611,6 +640,13 @@
|
|
|
|
if (newVal) {
|
|
|
|
if (newVal) {
|
|
|
|
this.getBudgets();
|
|
|
|
this.getBudgets();
|
|
|
|
this.currentStep = 1; // 重置到第一步
|
|
|
|
this.currentStep = 1; // 重置到第一步
|
|
|
|
|
|
|
|
this.paymentRegistrationForm = this.getDefaultPaymentRegistrationForm(); // 每次弹窗打开时重置表单
|
|
|
|
|
|
|
|
// 重置校验状态,避免立刻弹出必填项提示
|
|
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
|
|
if (this.$refs.paymentRegistration && this.$refs.paymentRegistration.$refs.elForm) {
|
|
|
|
|
|
|
|
this.$refs.paymentRegistration.$refs.elForm.resetFields();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|