update form

master
lynn 7 months ago
parent f48cee41ae
commit 3b155e4f28

@ -402,6 +402,46 @@
</div>
</div>
</div>
<!-- 预付款配置单独一栏 -->
<div class="form-section">
<div class="section-title">
<span style="color: red">*</span>预付款配置
</div>
<div class="checkbox-group" style="flex-wrap: wrap;">
<div style="min-width: 220px; margin-bottom: 8px;">
<el-checkbox v-model="form.payAmountShow">-</el-checkbox>
<el-checkbox v-model="form.payAmountRequired"><span style="color: red"></span>必填</el-checkbox>
</div>
<div style="min-width: 220px; margin-bottom: 8px;">
<el-checkbox v-model="form.deductAmountShow">-</el-checkbox>
<el-checkbox v-model="form.deductAmountRequired"><span style="color: red"></span>必填</el-checkbox>
</div>
<div style="min-width: 220px; margin-bottom: 8px;">
<el-checkbox v-model="form.auditAmountShow">-</el-checkbox>
<el-checkbox v-model="form.auditAmountRequired"></el-checkbox>
</div>
<div style="min-width: 220px; margin-bottom: 8px;">
<el-checkbox v-model="form.realPayDateShow">-</el-checkbox>
<el-checkbox v-model="form.realPayDateRequired"></el-checkbox>
</div>
<div style="min-width: 320px; margin-bottom: 8px; display: flex; align-items: center;">
<el-checkbox v-model="form.itemTypeShow">-</el-checkbox>
<el-checkbox v-model="form.itemTypeRequired"><span style="color: red"></span>必填</el-checkbox>
<el-select v-model="form.itemTypeDefault" placeholder="默认值" style="width: 120px; margin-left: 8px;">
<el-option v-for="item in itemTypeOptions" :key="item" :label="item" :value="item"></el-option>
</el-select>
</div>
<div style="min-width: 220px; margin-bottom: 8px;">
<el-checkbox v-model="form.isLastShow">-</el-checkbox>
<el-checkbox v-model="form.isLastRequired"><span style="color: red"></span>必填</el-checkbox>
</div>
<div style="min-width: 220px; margin-bottom: 8px;">
<el-checkbox v-model="form.remarkShow">-</el-checkbox>
<el-checkbox v-model="form.remarkRequired"></el-checkbox>
</div>
</div>
</div>
</el-form>
</div>
</div>
@ -467,7 +507,23 @@ export default {
is_simple_editable: true,
has_charge_editable: true,
isBudget_editable: true,
is_substitute_editable: true
is_substitute_editable: true,
advancePayment: false,
payAmountShow: false,
payAmountRequired: false,
deductAmountShow: false,
deductAmountRequired: false,
auditAmountShow: false,
auditAmountRequired: false,
realPayDateShow: false,
realPayDateRequired: false,
itemTypeShow: false,
itemTypeRequired: false,
isLastShow: false,
isLastRequired: false,
remarkShow: false,
remarkRequired: false,
itemTypeDefault: '',
},
rules: {
category: [
@ -493,7 +549,8 @@ export default {
]
},
originalPrePaymentForm: '',
originalPostPaymentForm: ''
originalPostPaymentForm: '',
itemTypeOptions: ['预付款', '进度款', '结算款', '质保金'],
}
},
created() {
@ -816,7 +873,23 @@ export default {
is_simple_editable: true,
has_charge_editable: true,
isBudget_editable: true,
is_substitute_editable: true
is_substitute_editable: true,
advancePayment: false,
payAmountShow: false,
payAmountRequired: false,
deductAmountShow: false,
deductAmountRequired: false,
auditAmountShow: false,
auditAmountRequired: false,
realPayDateShow: false,
realPayDateRequired: false,
itemTypeShow: false,
itemTypeRequired: false,
isLastShow: false,
isLastRequired: false,
remarkShow: false,
remarkRequired: false,
itemTypeDefault: '',
}
// 使
@ -866,7 +939,23 @@ export default {
is_simple: row.is_simple_default,
has_charge: row.has_charge_default,
isBudget: row.is_plan_default,
is_substitute: row.is_substitute_default
is_substitute: row.is_substitute_default,
advancePayment: row.advancePayment === true || row.advancePayment === 1,
payAmountShow: row.payAmountShow === true || row.payAmountShow === 1,
payAmountRequired: row.payAmountRequired === true || row.payAmountRequired === 1,
deductAmountShow: row.deductAmountShow === true || row.deductAmountShow === 1,
deductAmountRequired: row.deductAmountRequired === true || row.deductAmountRequired === 1,
auditAmountShow: row.auditAmountShow === true || row.auditAmountShow === 1,
auditAmountRequired: row.auditAmountRequired === true || row.auditAmountRequired === 1,
realPayDateShow: row.realPayDateShow === true || row.realPayDateShow === 1,
realPayDateRequired: row.realPayDateRequired === true || row.realPayDateRequired === 1,
itemTypeShow: row.itemTypeShow === true || row.itemTypeShow === 1,
itemTypeRequired: row.itemTypeRequired === true || row.itemTypeRequired === 1,
isLastShow: row.isLastShow === true || row.isLastShow === 1,
isLastRequired: row.isLastRequired === true || row.isLastRequired === 1,
remarkShow: row.remarkShow === true || row.remarkShow === 1,
remarkRequired: row.remarkRequired === true || row.remarkRequired === 1,
itemTypeDefault: row.itemTypeDefault || '',
}
//
@ -1006,7 +1095,22 @@ export default {
is_simple_default: this.form.is_simple,
has_charge_default: this.form.has_charge,
is_plan_default: this.form.isBudget,
is_substitute_default: this.form.is_substitute
is_substitute_default: this.form.is_substitute,
advancePayment: this.form.advancePayment ? 1 : 0,
payAmountShow: this.form.payAmountShow ? 1 : 0,
payAmountRequired: this.form.payAmountRequired ? 1 : 0,
deductAmountShow: this.form.deductAmountShow ? 1 : 0,
deductAmountRequired: this.form.deductAmountRequired ? 1 : 0,
auditAmountShow: this.form.auditAmountShow ? 1 : 0,
auditAmountRequired: this.form.auditAmountRequired ? 1 : 0,
realPayDateShow: this.form.realPayDateShow ? 1 : 0,
realPayDateRequired: this.form.realPayDateRequired ? 1 : 0,
itemTypeShow: this.form.itemTypeShow ? 1 : 0,
itemTypeRequired: this.form.itemTypeRequired ? 1 : 0,
isLastShow: this.form.isLastShow ? 1 : 0,
isLastRequired: this.form.isLastRequired ? 1 : 0,
remarkShow: this.form.remarkShow ? 1 : 0,
remarkRequired: this.form.remarkRequired ? 1 : 0
}
//

@ -59,8 +59,8 @@
</div>
</template>
<template v-slot:act_date v-if="currentStep === 1">
<div class="xy-table-item">
<template v-slot:act_date>
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2)" class="xy-table-item">
<div class="xy-table-item-label">实付日期</div>
<div class="xy-table-item-content">
<el-date-picker type="date" v-model="paymentRegistrationForm.act_date" value-format="yyyy-MM-dd" style="width: 150px;">
@ -69,8 +69,8 @@
</div>
</template>
<template v-slot:applyMoney v-if="currentStep === 1">
<div class="xy-table-item">
<template v-slot:applyMoney>
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2)" class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>申请付款金额
</div>
@ -81,8 +81,8 @@
</div>
</template>
<template v-slot:audit_money v-if="currentStep === 1">
<div class="xy-table-item">
<template v-slot:audit_money>
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2)" class="xy-table-item">
<div class="xy-table-item-label">审计金额</div>
<div class="xy-table-item-content xy-table-item-price">
<el-input clearable placeholder="请填写审计金额" v-model="form.audit_money" style="width: 150px;" />
@ -90,8 +90,8 @@
</div>
</template>
<template v-slot:deductionMoney v-if="currentStep === 1">
<div class="xy-table-item">
<template v-slot:deductionMoney>
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2)" class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>本期扣款金额
</div>
@ -102,8 +102,8 @@
</div>
</template>
<template v-slot:remark v-if="currentStep === 1">
<div class="xy-table-item">
<template v-slot:remark>
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2)" class="xy-table-item">
<div class="xy-table-item-label">备注</div>
<div class="xy-table-item-content">
<el-input type="textarea" clearable placeholder="进度款日期2022.6.8-2022.7.7"
@ -112,8 +112,8 @@
</div>
</template>
<template v-slot:type v-if="currentStep === 1">
<div class="xy-table-item">
<template v-slot:type>
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2)" class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>款项类型
</div>
@ -127,8 +127,8 @@
</div>
</template>
<template v-slot:isLast v-if="currentStep === 1">
<div class="xy-table-item">
<template v-slot:isLast>
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2)" class="xy-table-item">
<div class="xy-table-item-label" style="width: 200px">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>是否为最后一笔
</div>
@ -137,8 +137,9 @@
</div>
</div>
</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-content">
<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>
</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">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>是否验收
</div>
@ -158,7 +160,7 @@
</template>
<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">
事后支付表格
<el-button type="text" @click="openZoomedTable" style="margin-left: 10px;">
@ -173,9 +175,9 @@
<template v-slot:footerContent>
<div class="dialog-footer">
<el-button v-if="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="currentStep === 2 || (currentStep === 1 && (!forms || !forms.length))" type="primary" @click="submit"></el-button>
<el-button v-if="hasPostPaymentForm && currentStep === 2" @click="currentStep = 1"></el-button>
<el-button v-if="hasPostPaymentForm && currentStep === 1" @click="nextStep"></el-button>
<el-button v-if="(hasPostPaymentForm && currentStep === 2) || (!hasPostPaymentForm)" type="primary" @click="submit"></el-button>
<el-button @click="resetForm"></el-button>
</div>
</template>
@ -349,9 +351,24 @@
}
],
showZoomedTable: false, //
hasPostPaymentForm: false, //
}
},
methods: {
getDefaultPaymentRegistrationForm() {
return {
applyMoney: "",
deductionMoney: "",
audit_money: "",
act_date: '',
type: "",
isLast: false,
end_time:'',
isCheck:false,
plan: [],
remark: ""
}
},
checkIsEnd (e) {
this.paymentRegistrationForm.isLast = (Number(this.totalMoney()) + Number(e)) >= (this.contract.money * 0.95);
},
@ -406,7 +423,6 @@
this.contract = await detailContract({
id: info.id
});
this.paymentRegistrationForm.plan = this.contract.plans.map(item => {
return {
plan_id: item.id,
@ -414,29 +430,27 @@
new_money: item.money,
}
});
this.form.audit_money = this.contract.audit_money;
const res = await getFundLog({
contract_id: this.contract.id,
page: 1,
page_size: 999
})
this.payment = res.data;
console.log(this.contract.contract_template)
console.log(this.contract.forms)
//
if (this.contract.contract_template) {
//
if (this.contract.contract_template && this.contract.contract_template.template) {
this.hasPostPaymentForm = true;
this.currentStep = 1;
this.contractTemplate = this.contract.contract_template.template;
this.forms = this.contract.forms;
// contract_template_fields
if (!this.contract.contract_template.contract_template_fields) {
this.contract.contract_template.contract_template_fields = this.contract.other_data || [];
}
console.log('Contract template fields:', this.contract.contract_template.contract_template_fields);
} else {
this.hasPostPaymentForm = false;
this.currentStep = 1;
this.contractTemplate = null;
this.forms = null;
}
},
@ -561,17 +575,32 @@
}
},
nextStep() {
// 使
this.$refs['paymentRegistration'].$refs['elForm'].validate().then(res => {
if (res) {
this.currentStep = 2;
// 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;
}
}).catch(err => {
this.$Message.warning({
content: '请填写完整信息',
duration: 1
});
});
this.currentStep = 2;
} else {
// submit
if (this.$refs['paymentRegistration'] && this.$refs['paymentRegistration'].$refs['elForm']) {
this.$refs['paymentRegistration'].$refs['elForm'].validate().then(res => {
if (res) {
this.submit();
}
}).catch(err => {
this.$Message.warning({
content: '请填写完整信息',
duration: 1
});
});
} else {
this.submit();
}
}
},
resetForm() {
@ -611,6 +640,13 @@
if (newVal) {
this.getBudgets();
this.currentStep = 1; //
this.paymentRegistrationForm = this.getDefaultPaymentRegistrationForm(); //
//
this.$nextTick(() => {
if (this.$refs.paymentRegistration && this.$refs.paymentRegistration.$refs.elForm) {
this.$refs.paymentRegistration.$refs.elForm.resetFields();
}
});
}
}
},

@ -6,6 +6,7 @@
<RadioGroup v-model="currentForm" type="button">
<Radio label="pre" :disabled="!getBeforeForms">事前审批表格</Radio>
<Radio label="post" :disabled="!getForms">事后支付表格</Radio>
<Radio label="finance" :disabled="!fundLog">财务审核表</Radio>
</RadioGroup>
</div>
@ -18,10 +19,46 @@
</div>
<!-- Post-payment Form -->
<div v-else class="payment-form">
<div v-else-if="currentForm === 'post'" class="payment-form">
<div v-if="getForms" v-html="getForms"></div>
<div v-else class="no-form-message">暂无事后支付表格内容</div>
</div>
<!-- Finance Review Form -->
<div v-else-if="currentForm === 'finance'" class="payment-form">
<table class="finance-review-table">
<tr>
<th colspan="2" class="finance-header-row">合同信息</th>
<th colspan="5" class="finance-header-row">付款信息</th>
</tr>
<tr>
<td class="sub-header">受款单位</td>
<td>{{ fundLog && fundLog.contract && fundLog.contract.supply || '-' }}</td>
<td class="sub-header">申请付款金额</td>
<td>{{ fundLog && fundLog.apply_money || '-' }}</td>
<td class="sub-header">实际支付金额</td>
<td>{{ fundLog && fundLog.act_money || '-' }}</td>
<td class="sub-header">款项类型</td>
</tr>
<tr>
<td class="sub-header">合同名称</td>
<td>{{ fundLog && fundLog.contract && fundLog.contract.name || '-' }}</td>
<td class="sub-header">审计金额</td>
<td>{{ fundLog && fundLog.audit_money || '-' }}</td>
<td class="sub-header">本期扣款金额</td>
<td>{{ fundLog && fundLog.discount_money || '-' }}</td>
<td>{{ fundLog && fundLog.type || '-' }}</td>
</tr>
<tr>
<td class="sub-header">合同金额</td>
<td>{{ fundLog && fundLog.contract && moneyFormat(fundLog.contract.money) || '-' }} </td>
<td class="sub-header">是否为最后一笔</td>
<td>{{ fundLog && fundLog.is_end === 1 ? '是' : '否' }}</td>
<td class="sub-header">备注</td>
<td colspan="2">{{ fundLog && fundLog.remark || '-' }}</td>
</tr>
</table>
</div>
</div>
</div>
</template>
@ -56,10 +93,10 @@ export default {
try {
const res = await detailFundLog({ id })
this.fundLog = res
//
if (!this.getBeforeForms) {
this.currentForm = 'post'
}
// currentForm
// if (!this.getBeforeForms) {
// this.currentForm = 'post'
// }
} catch (error) {
console.error('获取付款详情失败:', error)
this.$Message.error('获取付款详情失败')
@ -156,13 +193,17 @@ export default {
printJS({
printable: canvas.toDataURL(),
type: 'image',
documentTitle: `苏州市河道管理处${this.currentForm === 'pre' ? '事前审批表格' : '事后支付表格'}`,
documentTitle: `苏州市河道管理处${this.currentForm === 'pre' ? '事前审批表格' : this.currentForm === 'post' ? '事后支付表格' : '财务审核表'}`,
style: '@page{margin:auto;}'
})
} catch (error) {
console.error('打印失败:', error)
this.$Message.error('打印失败')
}
},
moneyFormat(val) {
if (!val && val !== 0) return '-'
return Number(val).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
}
}
}
@ -198,6 +239,51 @@ export default {
font-size: 16px;
}
.finance-review-table {
width: 100%;
border-collapse: collapse;
margin: 20px 0;
font-size: 15px;
background: #fff;
th, td {
border: 1px solid #e0e0e0;
padding: 10px 8px;
text-align: center;
}
th.finance-header-row {
background: #eaf3ff;
color: #2d8cf0;
font-size: 16px;
font-weight: 600;
}
.sub-header {
background: #f5f7fa;
color: #333;
font-weight: 600;
width: 120px;
}
}
.finance-review-header {
margin-bottom: 16px;
}
.payment-registration-row {
display: flex;
margin-bottom: 4px;
}
.payment-registration-row-title {
width: 100px;
font-weight: bold;
color: #333;
}
.payment-registration-row-content {
flex: 1;
color: #666;
}
@media print {
.white-container {
padding: 0;

@ -163,6 +163,12 @@
>审核撤销</Button
>
</template>
<Button
size="small"
type="primary"
style="margin-left: 10px; margin-bottom: 4px"
@click="handlePrint(scope.row)"
>打印</Button>
</template>
</el-table-column>
</template>
@ -182,6 +188,7 @@
ref="examineRegistration"
@refresh="getFundLogs"
></examineRegistration>
<printPaymentForm ref="printPaymentForm"></printPaymentForm>
</div>
</template>
@ -197,9 +204,12 @@ import { Message } from "element-ui";
import { getBudget } from "@/api/budget/budget";
import { getparameter } from "@/api/system/dictionary";
import examineRegistration from "./components/examineRegistration";
import printPaymentForm from "@/views/contract/components/printPaymentForm";
export default {
components: {
examineRegistration,
printPaymentForm,
},
data() {
return {
@ -534,6 +544,21 @@ export default {
});
});
},
async handlePrint(row) {
try {
// if (row.contract && (row.contract.forms || row.contract.before_forms)) {
await this.$refs['printPaymentForm'].getDetailFundLog(row.id);
this.$refs['printPaymentForm'].currentForm = 'finance';
this.$refs['printPaymentForm'].isShow = true;
// return;
// }
// this.$Message.warning('');
} catch (err) {
console.error('打印错误:', err);
this.$Message.error('打印失败,请重试');
}
},
},
mounted() {
this.getMoneyWay();

Loading…
Cancel
Save