master
lynn 10 months ago
parent 3b155e4f28
commit 9033db6bc5

@ -185,6 +185,88 @@
</template>
</el-table-column>
</el-table-column>
<el-table-column label="预付款配置" min-width="220">
<template #default="scope">
<div style="font-size: 12px; line-height: 1.6;">
<div>
申请金额:
<span v-if="scope.row.show_apply_money == 1" style="color: #67C23A;"></span>
<span v-else style="color: #F56C6C;">隐藏</span>
/
<span v-if="scope.row.required_apply_money == 1" style="color: #67C23A;"></span>
<span v-else style="color: #F56C6C;">非必填</span>
<span v-if="scope.row.default_apply_money !== undefined && scope.row.default_apply_money !== ''" style="margin-left: 8px; color: #409EFF;">
默认值: {{ scope.row.default_apply_money }}
</span>
</div>
<div>
本期扣款:
<span v-if="scope.row.show_discount_money == 1" style="color: #67C23A;"></span>
<span v-else style="color: #F56C6C;">隐藏</span>
/
<span v-if="scope.row.required_discount_money == 1" style="color: #67C23A;"></span>
<span v-else style="color: #F56C6C;">非必填</span>
<span v-if="scope.row.default_discount_money !== undefined && scope.row.default_discount_money !== ''" style="margin-left: 8px; color: #409EFF;">
默认值: {{ scope.row.default_discount_money }}
</span>
</div>
<div>
审计金额:
<span v-if="scope.row.show_audit_money == 1" style="color: #67C23A;"></span>
<span v-else style="color: #F56C6C;">隐藏</span>
/
<span v-if="scope.row.required_audit_money == 1" style="color: #67C23A;"></span>
<span v-else style="color: #F56C6C;">非必填</span>
<span v-if="scope.row.default_audit_money !== undefined && scope.row.default_audit_money !== ''" style="margin-left: 8px; color: #409EFF;">
默认值: {{ scope.row.default_audit_money }}
</span>
</div>
<div>
实付日期:
<span v-if="scope.row.show_act_date == 1" style="color: #67C23A;"></span>
<span v-else style="color: #F56C6C;">隐藏</span>
/
<span v-if="scope.row.required_act_date == 1" style="color: #67C23A;"></span>
<span v-else style="color: #F56C6C;">非必填</span>
</div>
<div>
款项类型:
<span v-if="scope.row.show_type == 1" style="color: #67C23A;"></span>
<span v-else style="color: #F56C6C;">隐藏</span>
/
<span v-if="scope.row.required_type == 1" style="color: #67C23A;"></span>
<span v-else style="color: #F56C6C;">非必填</span>
<span v-if="scope.row.default_type" style="margin-left: 8px; color: #409EFF;">: {{ scope.row.default_type }}</span>
</div>
<div>
是否最后一笔:
<span v-if="scope.row.show_is_end == 1" style="color: #67C23A;"></span>
<span v-else style="color: #F56C6C;">隐藏</span>
/
<span v-if="scope.row.required_is_end == 1" style="color: #67C23A;"></span>
<span v-else style="color: #F56C6C;">非必填</span>
<span v-if="scope.row.default_is_end !== undefined && scope.row.default_is_end !== ''" style="margin-left: 8px; color: #409EFF;">
默认值:
{{
scope.row.default_is_end == 1 || scope.row.default_is_end === '1'
? '是'
: (scope.row.default_is_end == 0 || scope.row.default_is_end === '0'
? '否'
: scope.row.default_is_end)
}}
</span>
</div>
<div>
备注:
<span v-if="scope.row.show_remark == 1" style="color: #67C23A;"></span>
<span v-else style="color: #F56C6C;">隐藏</span>
/
<span v-if="scope.row.required_remark == 1" style="color: #67C23A;"></span>
<span v-else style="color: #F56C6C;">非必填</span>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="操作" width="150">
<template #default="scope">
<el-button size="small" @click="handleEdit(scope.row)"></el-button>
@ -410,16 +492,19 @@
</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>
<el-checkbox v-model="form.payAmountShow" :true-label="1" :false-label="0">-</el-checkbox>
<el-checkbox v-model="form.payAmountRequired" :true-label="1" :false-label="0"><span style="color: red"></span></el-checkbox>
<el-input v-model="form.payAmountDefault" type="number" placeholder="默认值" style="width: 120px; margin-left: 8px;"></el-input>
</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>
<el-checkbox v-model="form.deductAmountShow" :true-label="1" :false-label="0">-</el-checkbox>
<el-checkbox v-model="form.deductAmountRequired" :true-label="1" :false-label="0"><span style="color: red"></span></el-checkbox>
<el-input v-model="form.deductAmountDefault" type="number" placeholder="默认值" style="width: 120px; margin-left: 8px;"></el-input>
</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>
<el-checkbox v-model="form.auditAmountShow" :true-label="1" :false-label="0">-</el-checkbox>
<el-checkbox v-model="form.auditAmountRequired" :true-label="1" :false-label="0"></el-checkbox>
<el-input v-model="form.auditAmountDefault" type="number" placeholder="默认值" style="width: 120px; margin-left: 8px;"></el-input>
</div>
<div style="min-width: 220px; margin-bottom: 8px;">
<el-checkbox v-model="form.realPayDateShow">-</el-checkbox>
@ -433,8 +518,12 @@
</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>
<el-checkbox v-model="form.isLastShow" :true-label="1" :false-label="0">-</el-checkbox>
<el-checkbox v-model="form.isLastRequired" :true-label="1" :false-label="0"><span style="color: red"></span></el-checkbox>
<el-select v-model="form.isLastDefault" placeholder="默认值" style="width: 120px; margin-left: 8px;">
<el-option label="是" :value="1"></el-option>
<el-option label="否" :value="0"></el-option>
</el-select>
</div>
<div style="min-width: 220px; margin-bottom: 8px;">
<el-checkbox v-model="form.remarkShow">-</el-checkbox>
@ -524,6 +613,10 @@ export default {
remarkShow: false,
remarkRequired: false,
itemTypeDefault: '',
payAmountDefault: '',
deductAmountDefault: '',
auditAmountDefault: '',
isLastDefault: '',
},
rules: {
category: [
@ -591,48 +684,45 @@ export default {
//
if (res.data && Array.isArray(res.data)) {
//
this.tableData = res.data.map((item, index) => {
return {
index: index + 1,
id: item.id,
// ID
category_id: item.category,
work_type_id: item.work_type,
contract_type_id: item.contract_type,
purchase_form_id: item.purchase_form,
// 使name'-'
category: item.category_detail?.value || '-',
affairType: item.work_type_detail?.value || '-',
contractType: item.contract_type_detail?.value || '-',
purchaseForm: item.purchase_form_detail?.value || '-',
purchaseWay: item.purchase_way || false,
purchaseMethod: item.purchase_method,
projectName: item.project_name || false,
projectType: item.project_type || false,
budgetPrice: item.budget_price || false,
fundChannel: item.fund_channel || false,
budgetPlan: item.budget_plan || false,
request: item.flow_req || false,
purchaseApproval: item.flow_purchase || false,
tenderReview: item.flow_invite || false,
contractSign: item.flow_join || false,
prePaymentForm: item.before_contract_template?.name || '-',
postPaymentForm: item.contract_template?.name || '-',
// ID
before_contract_template_id: item.before_contract_template_id,
contract_template_id: item.contract_template_id,
//
is_simple_default: item.is_simple_default || 0,
has_charge_default: item.has_charge_default || 0,
is_plan_default: item.is_plan_default || 0,
is_substitute_default: item.is_substitute_default || 0,
edit_is_simple: item.edit_is_simple || 0,
edit_has_charge: item.edit_has_charge || 0,
edit_is_plan: item.edit_is_plan || 0,
edit_is_substitute: item.edit_is_substitute || 0
}
})
this.tableData = res.data.map((item, index) => ({
//
index: index + 1,
id: item.id,
category_id: item.category,
work_type_id: item.work_type,
contract_type_id: item.contract_type,
purchase_form_id: item.purchase_form,
affairType: item.work_type_detail?.value || '-',
contractType: item.contract_type_detail?.value || '-',
purchaseForm: item.purchase_form_detail?.value || '-',
purchaseWay: item.purchase_way || false,
purchaseMethod: item.purchase_method,
projectName: item.project_name || false,
projectType: item.project_type || false,
budgetPrice: item.budget_price || false,
fundChannel: item.fund_channel || false,
budgetPlan: item.budget_plan || false,
request: item.flow_req || false,
purchaseApproval: item.flow_purchase || false,
tenderReview: item.flow_invite || false,
contractSign: item.flow_join || false,
prePaymentForm: item.before_contract_template?.name || '-',
postPaymentForm: item.contract_template?.name || '-',
before_contract_template_id: item.before_contract_template_id,
contract_template_id: item.contract_template_id,
is_simple_default: item.is_simple_default || 0,
has_charge_default: item.has_charge_default || 0,
is_plan_default: item.is_plan_default || 0,
is_substitute_default: item.is_substitute_default || 0,
edit_is_simple: item.edit_is_simple || 0,
edit_has_charge: item.edit_has_charge || 0,
edit_is_plan: item.edit_is_plan || 0,
edit_is_substitute: item.edit_is_substitute || 0,
//
...item,
// category
category: item.category_detail?.value || '-',
}))
} else {
this.tableData = []
}
@ -874,7 +964,6 @@ export default {
has_charge_editable: true,
isBudget_editable: true,
is_substitute_editable: true,
advancePayment: false,
payAmountShow: false,
payAmountRequired: false,
deductAmountShow: false,
@ -890,6 +979,10 @@ export default {
remarkShow: false,
remarkRequired: false,
itemTypeDefault: '',
payAmountDefault: '',
deductAmountDefault: '',
auditAmountDefault: '',
isLastDefault: '',
}
// 使
@ -940,22 +1033,25 @@ export default {
has_charge: row.has_charge_default,
isBudget: row.is_plan_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 || '',
payAmountShow: row.show_apply_money === 1,
payAmountRequired: row.required_apply_money === 1,
deductAmountShow: row.show_discount_money === 1,
deductAmountRequired: row.required_discount_money === 1,
auditAmountShow: row.show_audit_money === 1,
auditAmountRequired: row.required_audit_money === 1,
realPayDateShow: row.show_act_date === 1,
realPayDateRequired: row.required_act_date === 1,
itemTypeShow: row.show_type === 1,
itemTypeRequired: row.required_type === 1,
isLastShow: row.show_is_end === 1,
isLastRequired: row.required_is_end === 1,
remarkShow: row.show_remark === 1,
remarkRequired: row.required_remark === 1,
payAmountDefault: row.default_apply_money ?? '',
deductAmountDefault: row.default_discount_money ?? '',
auditAmountDefault: row.default_audit_money ?? '',
isLastDefault: row.default_is_end !== undefined && row.default_is_end !== '' ? Number(row.default_is_end) : '',
itemTypeDefault: row.default_type !== undefined && row.default_type !== null ? String(row.default_type) : '',
}
//
@ -1085,7 +1181,6 @@ export default {
flow_invite: this.form.tenderReview,
flow_join: this.form.contractSign,
//
edit_is_simple: this.form.is_simple_editable ? 1 : 0,
edit_has_charge: this.form.has_charge_editable ? 1 : 0,
@ -1096,21 +1191,26 @@ export default {
has_charge_default: this.form.has_charge,
is_plan_default: this.form.isBudget,
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
show_apply_money: this.form.payAmountShow,
required_apply_money: this.form.payAmountRequired,
show_discount_money: this.form.deductAmountShow,
required_discount_money: this.form.deductAmountRequired,
show_audit_money: this.form.auditAmountShow,
required_audit_money: this.form.auditAmountRequired,
show_act_date: this.form.realPayDateShow,
required_act_date: this.form.realPayDateRequired,
show_type: this.form.itemTypeShow,
required_type: this.form.itemTypeRequired,
default_type: this.form.itemTypeDefault,
show_is_end: this.form.isLastShow,
required_is_end: this.form.isLastRequired,
show_remark: this.form.remarkShow,
required_remark: this.form.remarkRequired,
default_apply_money: this.form.payAmountDefault,
default_discount_money: this.form.deductAmountDefault,
default_audit_money: this.form.auditAmountDefault,
default_is_end: this.form.isLastDefault,
}
//

@ -60,8 +60,11 @@
</template>
<template v-slot:act_date>
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2)" class="xy-table-item">
<div class="xy-table-item-label">实付日期</div>
<div v-if="contract_category && contract_category.show_apply_money == 1 && (!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2))" class="xy-table-item">
<div class="xy-table-item-label">
<span v-if="contract_category && contract_category.required_act_date == 1" style="color: red;font-weight: 600;padding-right: 4px;">*</span>
实付日期
</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;">
</el-date-picker>
@ -70,9 +73,9 @@
</template>
<template v-slot:applyMoney>
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2)" class="xy-table-item">
<div v-if="contract_category && contract_category.show_apply_money == 1 && (!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>申请付款金
<span v-if="contract_category && contract_category.required_apply_money == 1" style="color: red;font-weight: 600;padding-right: 4px;">*</span>
</div>
<div class="xy-table-item-content xy-table-item-price">
<el-input clearable placeholder="请填写付款金额" v-model="paymentRegistrationForm.applyMoney"
@ -82,18 +85,20 @@
</template>
<template v-slot:audit_money>
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2)" class="xy-table-item">
<div class="xy-table-item-label">审计金额</div>
<div v-if="contract_category && contract_category.show_audit_money == 1 && (!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2))" class="xy-table-item">
<div class="xy-table-item-label">
<span v-if="contract_category && contract_category.required_audit_money == 1" style="color: red;font-weight: 600;padding-right: 4px;">*</span>
</div>
<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="paymentRegistrationForm.audit_money" style="width: 150px;" />
</div>
</div>
</template>
<template v-slot:deductionMoney>
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2)" class="xy-table-item">
<div v-if="contract_category && contract_category.show_discount_money == 1 && (!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>本期扣款金
<span v-if="contract_category && contract_category.required_discount_money == 1" style="color: red;font-weight: 600;padding-right: 4px;">*</span>
</div>
<div class="xy-table-item-content xy-table-item-price">
<el-input clearable placeholder="请填写扣款金额" v-model="paymentRegistrationForm.deductionMoney"
@ -103,8 +108,10 @@
</template>
<template v-slot:remark>
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2)" class="xy-table-item">
<div class="xy-table-item-label">备注</div>
<div v-if="contract_category && contract_category.show_remark == 1 && (!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2))" class="xy-table-item">
<div class="xy-table-item-label">
<span v-if="contract_category && contract_category.required_remark == 1" style="color: red;font-weight: 600;padding-right: 4px;">*</span>
</div>
<div class="xy-table-item-content">
<el-input type="textarea" clearable placeholder="进度款日期2022.6.8-2022.7.7"
v-model="paymentRegistrationForm.remark" style="width: 300px;" />
@ -113,9 +120,9 @@
</template>
<template v-slot:type>
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2)" class="xy-table-item">
<div v-if="contract_category && contract_category.show_type == 1 && (!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>款项类
<span v-if="contract_category && contract_category.required_type == 1" style="color: red;font-weight: 600;padding-right: 4px;">*</span>
</div>
<div class="xy-table-item-content">
<el-select placeholder="选择款项类型或直接录入其他类型" v-model="paymentRegistrationForm.type" style="width: 150px;"
@ -128,9 +135,9 @@
</template>
<template v-slot:isLast>
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2)" class="xy-table-item">
<div v-if="contract_category && contract_category.show_is_end == 1 && (!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>是否为最后一
<span v-if="contract_category && contract_category.required_is_end == 1" style="color: red;font-weight: 600;padding-right: 4px;">*</span>
</div>
<div class="xy-table-item-content">
<el-switch v-model="paymentRegistrationForm.isLast" />
@ -139,7 +146,7 @@
</template>
<template v-slot:end_time>
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2)" class="xy-table-item">
<div v-if="contract_category && contract_category.show_end_time == 1 && (!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;">
@ -149,7 +156,7 @@
</template>
<template v-slot:isCheck>
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 2)" class="xy-table-item">
<div v-if="contract_category && contract_category.show_check == 1 && (!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>
@ -300,30 +307,30 @@
form: {
audit_money: 0
},
paymentRegistrationRules: {
applyMoney: [{
required: true,
message: "必填"
},
{
pattern: /(^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d{1,2})?$)/,
message: '必须为数字'
}
],
deductionMoney: [{
required: true,
message: "必填"
},
{
pattern: /(^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d{1,2})?$)/,
message: '必须为数字'
}
],
type: [{
required: true,
message: "必选"
}]
},
// paymentRegistrationRules: {
// applyMoney: [{
// required: true,
// message: ""
// },
// {
// pattern: /(^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d{1,2})?$)/,
// message: ''
// }
// ],
// deductionMoney: [{
// required: true,
// message: ""
// },
// {
// pattern: /(^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d{1,2})?$)/,
// message: ''
// }
// ],
// type: [{
// required: true,
// message: ""
// }]
// },
planTable: [{
sortable: false,
width: 36,
@ -352,6 +359,7 @@
],
showZoomedTable: false, //
hasPostPaymentForm: false, //
contract_category: {},
}
},
methods: {
@ -370,7 +378,7 @@
}
},
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);
},
async getPlanTypes() {
@ -431,6 +439,82 @@
}
});
this.form.audit_money = this.contract.audit_money;
this.contract_category = this.contract.contract_category || {};
//
if (this.contract_category && this.contract_category.default_apply_money !== undefined) {
this.paymentRegistrationForm.applyMoney = this.contract_category.default_apply_money;
}
if (this.contract_category && this.contract_category.default_discount_money !== undefined) {
this.paymentRegistrationForm.deductionMoney = this.contract_category.default_discount_money;
}
if (this.contract_category && this.contract_category.default_audit_money !== undefined) {
this.paymentRegistrationForm.audit_money = this.contract_category.default_audit_money;
}
if (this.contract_category && this.contract_category.default_act_date !== undefined) {
this.paymentRegistrationForm.act_date = this.contract_category.default_act_date;
}
if (this.contract_category && this.contract_category.default_type !== undefined) {
this.paymentRegistrationForm.type = this.contract_category.default_type;
}
if (this.contract_category && this.contract_category.default_is_end !== undefined) {
this.paymentRegistrationForm.isLast = this.contract_category.default_is_end == 1 || this.contract_category.default_is_end === '1';
}
if (this.contract_category && this.contract_category.default_remark !== undefined) {
this.paymentRegistrationForm.remark = this.contract_category.default_remark;
}
// rules
this.paymentRegistrationRules = {
applyMoney: [
{
required: this.contract_category.required_apply_money == 1,
message: '必填'
},
{
pattern: /(^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d{1,2})?$)/,
message: '必须为数字'
}
],
deductionMoney: [
{
required: this.contract_category.required_discount_money == 1,
message: '必填'
},
{
pattern: /(^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d{1,2})?$)/,
message: '必须为数字'
}
],
audit_money: [
{
required: this.contract_category.required_audit_money == 1,
message: '必填'
}
],
type: [
{
required: this.contract_category.required_type == 1,
message: '必选'
}
],
isLast: [
{
required: this.contract_category.required_is_end == 1,
message: '必选'
}
],
remark: [
{
required: this.contract_category.required_remark == 1,
message: '必填'
}
],
act_date: [
{
required: this.contract_category.required_act_date == 1,
message: '必填'
}
]
};
const res = await getFundLog({
contract_id: this.contract.id,
page: 1,
@ -455,72 +539,87 @@
},
submit() {
//
if (this.contract.contract_template) {
const dom = this.$refs.zoomedForms || this.$refs.zoomedTemplate;
if (dom) {
//
const inputs = dom.querySelectorAll('input, select, textarea');
// HTML
inputs.forEach(input => {
const fieldName = input.getAttribute('data-field');
if (fieldName) {
const field = this.contract.contract_template.contract_template_fields.find(f => f.field === fieldName);
if (field) {
if (input.type === 'checkbox' || input.type === 'radio') {
//
const checkedInput = dom.querySelector(`[data-field="${fieldName}"]:checked`);
field.value = checkedInput ? checkedInput.value : '';
// HTML checked
if (checkedInput) {
checkedInput.setAttribute('checked', 'checked');
//
this.$refs['paymentRegistration'].$refs['elForm'].validate().then(res => {
if (res) {
//
if (this.contract.contract_template) {
const dom = this.$refs.zoomedForms || this.$refs.zoomedTemplate;
if (dom) {
//
const inputs = dom.querySelectorAll('input, select, textarea');
// HTML
inputs.forEach(input => {
const fieldName = input.getAttribute('data-field');
if (fieldName) {
const field = this.contract.contract_template.contract_template_fields.find(f => f.field === fieldName);
if (field) {
if (input.type === 'checkbox' || input.type === 'radio') {
//
const checkedInput = dom.querySelector(`[data-field="${fieldName}"]:checked`);
field.value = checkedInput ? checkedInput.value : '';
// HTML checked
if (checkedInput) {
checkedInput.setAttribute('checked', 'checked');
}
} else {
field.value = input.value;
// HTML value
input.setAttribute('value', input.value);
}
}
} else {
field.value = input.value;
// HTML value
input.setAttribute('value', input.value);
}
}
}
});
});
// HTML
this.forms = dom.innerHTML;
}
}
// HTML
this.forms = dom.innerHTML;
}
}
let data = {
contract_id: this.contract.id,
apply_money: this.paymentRegistrationForm.applyMoney,
discount_money: this.paymentRegistrationForm.deductionMoney,
type: this.paymentRegistrationForm.type,
is_end: this.paymentRegistrationForm.isLast ? 1 : 0,
remark: this.paymentRegistrationForm.remark,
audit_money: this.paymentRegistrationForm.audit_money,
end_time:this.paymentRegistrationForm.end_time,
is_check:this.paymentRegistrationForm.isCheck ? 1 : 0,
// HTML
forms: this.forms,
other_data: this.contract.contract_template?.contract_template_fields || []
}
addFundLog(data).then(res => {
this.isShowPaymentRegistration = false
//
editorContract({
id: this.contract.id,
audit_money: this.form.audit_money,
//
forms: this.forms,
other_data: this.contract.contract_template?.contract_template_fields || []
}).then(r => {
Message({
type: 'success',
message: "操作成功"
let data = {
contract_id: this.contract.id,
apply_money: this.paymentRegistrationForm.applyMoney,
discount_money: this.paymentRegistrationForm.deductionMoney,
type: this.paymentRegistrationForm.type,
is_end: this.paymentRegistrationForm.isLast ? 1 : 0,
remark: this.paymentRegistrationForm.remark,
audit_money: this.paymentRegistrationForm.audit_money,
end_time:this.paymentRegistrationForm.end_time,
is_check:this.paymentRegistrationForm.isCheck ? 1 : 0,
// HTML
forms: this.forms,
other_data: this.contract.contract_template?.contract_template_fields || []
}
addFundLog(data).then(res => {
this.isShowPaymentRegistration = false
//
editorContract({
id: this.contract.id,
audit_money: this.form.audit_money,
//
forms: this.forms,
other_data: this.contract.contract_template?.contract_template_fields || []
}).then(r => {
Message({
type: 'success',
message: "操作成功"
})
});
this.$refs['paymentRegistration'].reset()
})
} else {
this.$Message.warning({
content: '请填写完整信息',
duration: 1
});
}
}).catch(err => {
this.$Message.warning({
content: '请填写完整信息',
duration: 1
});
this.$refs['paymentRegistration'].reset()
})
});
},
//

Loading…
Cancel
Save