|
|
|
|
@ -7,7 +7,6 @@
|
|
|
|
|
type="form"
|
|
|
|
|
:form="form"
|
|
|
|
|
:rules="rules"
|
|
|
|
|
@submit="editor"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:extraFormTop>
|
|
|
|
|
<div class="payment-registration-row">
|
|
|
|
|
@ -22,10 +21,34 @@
|
|
|
|
|
<div class="payment-registration-row-title">合同金额</div>
|
|
|
|
|
<div class="payment-registration-row-content">{{ moneyFormat(form.contract.money) }} (元)</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="display: flex">
|
|
|
|
|
<div class="payment-registration-row">
|
|
|
|
|
<div class="payment-registration-row-title">申请付款金额</div>
|
|
|
|
|
<div class="payment-registration-row-content">{{ moneyFormat(form.apply_money) }} (元)</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="payment-registration-row">
|
|
|
|
|
<div class="payment-registration-row-title">实际支付金额</div>
|
|
|
|
|
<div class="payment-registration-row-content">{{ moneyFormat(form.act_money) }} (元)</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="display: flex">
|
|
|
|
|
<div class="payment-registration-row">
|
|
|
|
|
<div class="payment-registration-row-title">款项类型</div>
|
|
|
|
|
<div class="payment-registration-row-content">{{ form.type }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="payment-registration-row">
|
|
|
|
|
<div class="payment-registration-row-title">是否最后一笔</div>
|
|
|
|
|
<div class="payment-registration-row-content">{{ form.is_end === 1 ? '是' : '否' }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="form.remark" class="payment-registration-row">
|
|
|
|
|
<div class="payment-registration-row-title">备注</div>
|
|
|
|
|
<div class="payment-registration-row-content">{{ form.remark }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template v-slot:apply_money>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 1)" class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label">
|
|
|
|
|
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>申请付款金额
|
|
|
|
|
</div>
|
|
|
|
|
@ -35,7 +58,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:audit_money>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 1)" class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label">审计金额
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content xy-table-item-price">
|
|
|
|
|
@ -44,7 +67,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:act_money>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 1)" class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label">
|
|
|
|
|
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>实际支付金额
|
|
|
|
|
</div>
|
|
|
|
|
@ -54,7 +77,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:discount_money>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 1)" class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label">
|
|
|
|
|
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>本期扣款金额
|
|
|
|
|
</div>
|
|
|
|
|
@ -64,7 +87,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:type>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 1)" class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label">
|
|
|
|
|
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>款项类型
|
|
|
|
|
</div>
|
|
|
|
|
@ -83,7 +106,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:is_end>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 1)" 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>
|
|
|
|
|
@ -95,7 +118,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:remark>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div v-if="!hasPostPaymentForm || (hasPostPaymentForm && currentStep === 1)" class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label">备注
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
@ -109,37 +132,90 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-if="false" v-slot:extraFormBottom>
|
|
|
|
|
<Input v-model="searchContent" search enter-button="搜 索" placeholder="搜索预算计划.." @on-search="getBudgets" />
|
|
|
|
|
<xy-table
|
|
|
|
|
ref="planTable"
|
|
|
|
|
:list="plans"
|
|
|
|
|
:show-index="false"
|
|
|
|
|
:table-item="planTable"
|
|
|
|
|
:height="310"
|
|
|
|
|
style="margin-top: 10px;"
|
|
|
|
|
@select="selectPlan"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:btns>
|
|
|
|
|
<el-table-column label="使用金额" header-align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<Input :value="scope.row.use_money" @input="planInput($event,scope.row)" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template>
|
|
|
|
|
</xy-table>
|
|
|
|
|
<template v-slot:extraFormBottom>
|
|
|
|
|
<!-- 原来的预算计划功能(已禁用) -->
|
|
|
|
|
<div v-if="false">
|
|
|
|
|
<Input v-model="searchContent" search enter-button="搜 索" placeholder="搜索预算计划.." @on-search="getBudgets" />
|
|
|
|
|
<xy-table
|
|
|
|
|
ref="planTable"
|
|
|
|
|
:list="plans"
|
|
|
|
|
:show-index="false"
|
|
|
|
|
:table-item="planTable"
|
|
|
|
|
:height="310"
|
|
|
|
|
style="margin-top: 10px;"
|
|
|
|
|
@select="selectPlan"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:btns>
|
|
|
|
|
<el-table-column label="使用金额" header-align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<Input :value="scope.row.use_money" @input="planInput($event,scope.row)" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template>
|
|
|
|
|
</xy-table>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 新增的事后支付表格功能 -->
|
|
|
|
|
<div v-if="hasPostPaymentForm && currentStep === 2" class="payment-table-section">
|
|
|
|
|
<div class="section-header">
|
|
|
|
|
<div class="section-title">
|
|
|
|
|
事后支付表格
|
|
|
|
|
<el-button type="text" style="margin-left: 10px;" @click="openZoomedTable">
|
|
|
|
|
<i class="el-icon-zoom-in" /> 放大查看
|
|
|
|
|
</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- <div style="display: flex;justify-content: flex-end;">-->
|
|
|
|
|
<!-- <Page :total="planTotal" show-elevator @on-change="pageChange"/>-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
<!-- 根据是否有第二个表格决定显示方式 -->
|
|
|
|
|
<div v-if="hasSecondPostPaymentForm">
|
|
|
|
|
<!-- 有第二个表格时显示Tab切换 -->
|
|
|
|
|
<el-tabs v-model="activePostPaymentTab" @tab-click="handleTabClick">
|
|
|
|
|
<el-tab-pane label="事后支付表格1" name="form1">
|
|
|
|
|
<div ref="mainTable1" class="payment-table" v-html="forms1" />
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="事后支付表格2" name="form2">
|
|
|
|
|
<div ref="mainTable2" class="payment-table" v-html="forms2" />
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
</el-tabs>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else>
|
|
|
|
|
<!-- 只有一个表格时直接显示事后支付表格1 -->
|
|
|
|
|
<div ref="mainTable1" class="payment-table" v-html="forms1" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template v-slot:footerContent>
|
|
|
|
|
<div class="dialog-footer">
|
|
|
|
|
<el-button v-if="hasPostPaymentForm && currentStep === 2" @click="prevStep">上一步</el-button>
|
|
|
|
|
<el-button v-if="hasPostPaymentForm && currentStep === 1" @click="nextStep">下一步</el-button>
|
|
|
|
|
<el-button v-if="(hasPostPaymentForm && currentStep === 2) || (!hasPostPaymentForm)" type="primary" @click="editor">确定</el-button>
|
|
|
|
|
<el-button @click="isShow = false">取消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</xy-dialog>
|
|
|
|
|
|
|
|
|
|
<!-- 放大窗口 -->
|
|
|
|
|
<el-dialog
|
|
|
|
|
:title="getZoomedDialogTitle()"
|
|
|
|
|
:visible.sync="zoomedDialogVisible"
|
|
|
|
|
width="80%"
|
|
|
|
|
:append-to-body="false"
|
|
|
|
|
:destroy-on-close="true"
|
|
|
|
|
:modal-append-to-body="false"
|
|
|
|
|
:top="'5vh'"
|
|
|
|
|
custom-class="zoomed-table-dialog"
|
|
|
|
|
@close="handleZoomedDialogClose"
|
|
|
|
|
>
|
|
|
|
|
<div ref="zoomedTable" class="zoomed-table" v-html="getCurrentZoomedForms()" />
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {
|
|
|
|
|
moneyFormatter
|
|
|
|
|
moneyFormatter,
|
|
|
|
|
numberToChinese
|
|
|
|
|
} from '@/utils'
|
|
|
|
|
import {
|
|
|
|
|
editorContract
|
|
|
|
|
@ -161,6 +237,15 @@ export default {
|
|
|
|
|
id: '',
|
|
|
|
|
form: null,
|
|
|
|
|
paymentType: ['预付款', '进度款', '结算款', '质保金'],
|
|
|
|
|
currentStep: 1,
|
|
|
|
|
hasPostPaymentForm: false,
|
|
|
|
|
hasSecondPostPaymentForm: false,
|
|
|
|
|
forms1: null,
|
|
|
|
|
forms2: null,
|
|
|
|
|
activePostPaymentTab: 'form1',
|
|
|
|
|
zoomedDialogVisible: false,
|
|
|
|
|
total: 0,
|
|
|
|
|
otherTotal: 0,
|
|
|
|
|
|
|
|
|
|
plansPageIndex: 1,
|
|
|
|
|
planTotal: 0,
|
|
|
|
|
@ -181,16 +266,12 @@ export default {
|
|
|
|
|
switch (value) {
|
|
|
|
|
case 1:
|
|
|
|
|
return '部门预算'
|
|
|
|
|
break
|
|
|
|
|
case 2:
|
|
|
|
|
return '水务计划'
|
|
|
|
|
break
|
|
|
|
|
case 3:
|
|
|
|
|
return '补助经费'
|
|
|
|
|
break
|
|
|
|
|
case 4:
|
|
|
|
|
return '其他'
|
|
|
|
|
break
|
|
|
|
|
default:
|
|
|
|
|
return '未知'
|
|
|
|
|
}
|
|
|
|
|
@ -273,6 +354,35 @@ export default {
|
|
|
|
|
this.form = res
|
|
|
|
|
this.contract_form.audit_money = res.contract.audit_money
|
|
|
|
|
console.log(this.form)
|
|
|
|
|
|
|
|
|
|
// 判断是否有事后支付表格
|
|
|
|
|
if (this.form.forms) {
|
|
|
|
|
this.hasPostPaymentForm = true
|
|
|
|
|
this.currentStep = 1
|
|
|
|
|
this.forms1 = this.form.forms
|
|
|
|
|
|
|
|
|
|
// 检查是否有第二个事后支付表格(从 contract_template2 或 before_forms 判断)
|
|
|
|
|
// 注意:detailFundLog 返回的数据结构可能与 paymentRegistration 不同
|
|
|
|
|
if (this.form.contract && this.form.contract.contract_template2 && this.form.contract.contract_template2.template) {
|
|
|
|
|
this.hasSecondPostPaymentForm = true
|
|
|
|
|
this.forms2 = this.form.contract.contract_template2.template
|
|
|
|
|
} else if (this.form.before_forms) {
|
|
|
|
|
// 如果有 before_forms,也可以作为第二个表格
|
|
|
|
|
this.hasSecondPostPaymentForm = true
|
|
|
|
|
this.forms2 = this.form.before_forms
|
|
|
|
|
} else {
|
|
|
|
|
this.hasSecondPostPaymentForm = false
|
|
|
|
|
this.forms2 = null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 监听器在进入第二步时再设置(因为事后支付表格只在第二步显示)
|
|
|
|
|
} else {
|
|
|
|
|
this.hasPostPaymentForm = false
|
|
|
|
|
this.hasSecondPostPaymentForm = false
|
|
|
|
|
this.currentStep = 1
|
|
|
|
|
this.forms1 = null
|
|
|
|
|
this.forms2 = null
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async getBudgets() {
|
|
|
|
|
const res = await getBudget({
|
|
|
|
|
@ -289,7 +399,22 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
editor() {
|
|
|
|
|
editorFundLog(this.form).then(res => {
|
|
|
|
|
// 如果有事后支付表格,先同步表格数据到form
|
|
|
|
|
if (this.hasPostPaymentForm) {
|
|
|
|
|
// 根据当前激活的tab同步对应的表格数据
|
|
|
|
|
let currentDom = null
|
|
|
|
|
if (this.activePostPaymentTab === 'form1') {
|
|
|
|
|
currentDom = this.$refs.mainTable1
|
|
|
|
|
} else if (this.activePostPaymentTab === 'form2' && this.hasSecondPostPaymentForm) {
|
|
|
|
|
currentDom = this.$refs.mainTable2
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (currentDom) {
|
|
|
|
|
this.syncFormDomToHtml(currentDom)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
editorFundLog(this.form).then(() => {
|
|
|
|
|
this.$emit('success')
|
|
|
|
|
this.isShow = false
|
|
|
|
|
|
|
|
|
|
@ -297,13 +422,356 @@ export default {
|
|
|
|
|
editorContract({
|
|
|
|
|
id: this.form.contract_id,
|
|
|
|
|
audit_money: this.contract_form.audit_money
|
|
|
|
|
}).then(r => {
|
|
|
|
|
}).then(() => {
|
|
|
|
|
Message({
|
|
|
|
|
type: 'success',
|
|
|
|
|
message: '操作成功'
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
console.error('编辑失败:', err)
|
|
|
|
|
Message({
|
|
|
|
|
type: 'error',
|
|
|
|
|
message: '操作失败'
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
nextStep() {
|
|
|
|
|
// 第一步验证表单
|
|
|
|
|
if (this.currentStep === 1) {
|
|
|
|
|
if (this.hasPostPaymentForm) {
|
|
|
|
|
// 直接进入第二步显示事后支付表格
|
|
|
|
|
this.currentStep = 2
|
|
|
|
|
// 切换到第二步后,需要重新设置amount输入框的监听
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.setupAmountListeners(this.$refs.mainTable1)
|
|
|
|
|
this.setupAmountListeners(this.$refs.mainTable2)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
prevStep() {
|
|
|
|
|
// 从第二步返回第一步
|
|
|
|
|
this.currentStep = 1
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
handleTabClick(tab) {
|
|
|
|
|
this.activePostPaymentTab = tab.name
|
|
|
|
|
// 切换tab时重新设置监听器
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
if (tab.name === 'form1') {
|
|
|
|
|
this.setupAmountListeners(this.$refs.mainTable1)
|
|
|
|
|
} else if (tab.name === 'form2') {
|
|
|
|
|
this.setupAmountListeners(this.$refs.mainTable2)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 获取放大窗口标题
|
|
|
|
|
getZoomedDialogTitle() {
|
|
|
|
|
return `事后支付表格${this.activePostPaymentTab === 'form1' ? '1' : '2'}`
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 获取当前放大的表格内容
|
|
|
|
|
getCurrentZoomedForms() {
|
|
|
|
|
// 根据当前选择的tab获取对应的表格内容
|
|
|
|
|
if (this.activePostPaymentTab === 'form1') {
|
|
|
|
|
return this.forms1
|
|
|
|
|
} else if (this.activePostPaymentTab === 'form2') {
|
|
|
|
|
return this.forms2
|
|
|
|
|
}
|
|
|
|
|
return this.forms1
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 打开放大预览前,先同步当前表单数据
|
|
|
|
|
openZoomedTable() {
|
|
|
|
|
// 根据当前选择的tab获取对应的表格DOM
|
|
|
|
|
let currentDom = null
|
|
|
|
|
if (this.activePostPaymentTab === 'form1') {
|
|
|
|
|
currentDom = this.$refs.mainTable1
|
|
|
|
|
} else if (this.activePostPaymentTab === 'form2') {
|
|
|
|
|
currentDom = this.$refs.mainTable2
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (currentDom) {
|
|
|
|
|
// 先同步当前表格的数据
|
|
|
|
|
const updatedForms = this.syncFormDomToHtml(currentDom)
|
|
|
|
|
|
|
|
|
|
// 更新对应的数据源
|
|
|
|
|
if (this.activePostPaymentTab === 'form1') {
|
|
|
|
|
this.forms1 = updatedForms || this.forms1
|
|
|
|
|
} else if (this.activePostPaymentTab === 'form2') {
|
|
|
|
|
this.forms2 = updatedForms || this.forms2
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.zoomedDialogVisible = true
|
|
|
|
|
// 设置 amount 输入框的监听
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
// 使用setTimeout确保DOM完全加载
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.setupAmountListeners(this.$refs.zoomedTable)
|
|
|
|
|
}, 200)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
handleZoomedDialogClose() {
|
|
|
|
|
const dom = this.$refs.zoomedTable
|
|
|
|
|
if (dom) {
|
|
|
|
|
// 从放大窗口获取更新后的数据
|
|
|
|
|
const updatedForms = this.syncFormDomToHtml(dom)
|
|
|
|
|
|
|
|
|
|
// 只更新当前激活tab的数据源
|
|
|
|
|
if (this.activePostPaymentTab === 'form1') {
|
|
|
|
|
this.forms1 = updatedForms || this.forms1
|
|
|
|
|
} else if (this.activePostPaymentTab === 'form2') {
|
|
|
|
|
this.forms2 = updatedForms || this.forms2
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 重新设置监听器
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
if (this.activePostPaymentTab === 'form1' && this.$refs.mainTable1) {
|
|
|
|
|
this.setupAmountListeners(this.$refs.mainTable1)
|
|
|
|
|
} else if (this.activePostPaymentTab === 'form2' && this.$refs.mainTable2) {
|
|
|
|
|
this.setupAmountListeners(this.$refs.mainTable2)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.zoomedDialogVisible = false
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
syncFormDomToHtml(dom) {
|
|
|
|
|
if (!dom) return ''
|
|
|
|
|
const inputs = dom.querySelectorAll('input, select, textarea')
|
|
|
|
|
inputs.forEach(input => {
|
|
|
|
|
const fieldName = input.getAttribute('data-field')
|
|
|
|
|
if (fieldName) {
|
|
|
|
|
if (input.type === 'checkbox' || input.type === 'radio') {
|
|
|
|
|
const checkedInput = dom.querySelector(`[data-field="${fieldName}"]:checked`)
|
|
|
|
|
if (checkedInput) {
|
|
|
|
|
checkedInput.setAttribute('checked', 'checked')
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (input.tagName.toLowerCase() === 'textarea') {
|
|
|
|
|
input.textContent = input.value || ''
|
|
|
|
|
} else {
|
|
|
|
|
input.setAttribute('value', input.value || '')
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
// 更新form.forms
|
|
|
|
|
this.form.forms = dom.innerHTML
|
|
|
|
|
return dom.innerHTML
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
setupAmountListeners(dom) {
|
|
|
|
|
if (!dom) return
|
|
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
// 获取所有以 wan, qian, bai, shi, yuan, jiao, fen 开头的输入框
|
|
|
|
|
const fieldPrefixes = ['wan', 'qian', 'bai', 'shi', 'yuan', 'jiao', 'fen', 'amount']
|
|
|
|
|
fieldPrefixes.forEach(prefix => {
|
|
|
|
|
const inputs = dom.querySelectorAll(`input[data-field^="${prefix}"]`)
|
|
|
|
|
inputs.forEach(input => {
|
|
|
|
|
input.removeEventListener('input', this.calculateTotal)
|
|
|
|
|
input.removeEventListener('change', this.calculateTotal)
|
|
|
|
|
input.removeEventListener('blur', this.calculateTotal)
|
|
|
|
|
input.addEventListener('input', this.calculateTotal)
|
|
|
|
|
input.addEventListener('change', this.calculateTotal)
|
|
|
|
|
input.addEventListener('blur', this.calculateTotal)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}, 100)
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
calculateTotal() {
|
|
|
|
|
// 根据当前激活的tab选择对应的表格DOM
|
|
|
|
|
let currentDom = null
|
|
|
|
|
if (this.activePostPaymentTab === 'form1') {
|
|
|
|
|
currentDom = this.$refs.mainTable1
|
|
|
|
|
} else if (this.activePostPaymentTab === 'form2') {
|
|
|
|
|
currentDom = this.$refs.mainTable2
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (currentDom) {
|
|
|
|
|
this.calculateTableTotal(currentDom)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 计算放大表格的总金额
|
|
|
|
|
if (this.$refs.zoomedTable) {
|
|
|
|
|
this.calculateTableTotal(this.$refs.zoomedTable)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
calculateTableTotal(dom) {
|
|
|
|
|
if (!dom) return
|
|
|
|
|
|
|
|
|
|
let wanTotal = 0
|
|
|
|
|
const wanAmountInputs = dom.querySelectorAll('input[data-field^="wan"]')
|
|
|
|
|
wanAmountInputs.forEach(input => {
|
|
|
|
|
const value = parseFloat(input.value) || 0
|
|
|
|
|
wanTotal += value
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const wanInput = dom.querySelector('input[data-field="wTotal"]')
|
|
|
|
|
if (wanInput) {
|
|
|
|
|
wanInput.value = wanTotal === 0 ? '0' : wanTotal
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let qianTotal = 0
|
|
|
|
|
const qianAmountInputs = dom.querySelectorAll('input[data-field^="qian"]')
|
|
|
|
|
qianAmountInputs.forEach(input => {
|
|
|
|
|
const value = parseFloat(input.value) || 0
|
|
|
|
|
qianTotal += value
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const qianInput = dom.querySelector('input[data-field="qTotal"]')
|
|
|
|
|
if (qianInput) {
|
|
|
|
|
qianInput.value = qianTotal === 0 ? '0' : qianTotal
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let baiTotal = 0
|
|
|
|
|
const baiAmountInputs = dom.querySelectorAll('input[data-field^="bai"]')
|
|
|
|
|
baiAmountInputs.forEach(input => {
|
|
|
|
|
const value = parseFloat(input.value) || 0
|
|
|
|
|
baiTotal += value
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const baiInput = dom.querySelector('input[data-field="bTotal"]')
|
|
|
|
|
if (baiInput) {
|
|
|
|
|
baiInput.value = baiTotal === 0 ? '0' : baiTotal
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let shiTotal = 0
|
|
|
|
|
const shiAmountInputs = dom.querySelectorAll('input[data-field^="shi"]')
|
|
|
|
|
shiAmountInputs.forEach(input => {
|
|
|
|
|
const value = parseFloat(input.value) || 0
|
|
|
|
|
shiTotal += value
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const shiInput = dom.querySelector('input[data-field="sTotal"]')
|
|
|
|
|
if (shiInput) {
|
|
|
|
|
shiInput.value = shiTotal === 0 ? '0' : shiTotal
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let yuanTotal = 0
|
|
|
|
|
const yuanAmountInputs = dom.querySelectorAll('input[data-field^="yuan"]')
|
|
|
|
|
yuanAmountInputs.forEach(input => {
|
|
|
|
|
const value = parseFloat(input.value) || 0
|
|
|
|
|
yuanTotal += value
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const yuanInput = dom.querySelector('input[data-field="yTotal"]')
|
|
|
|
|
if (yuanInput) {
|
|
|
|
|
yuanInput.value = yuanTotal === 0 ? '0' : yuanTotal
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let jiaoTotal = 0
|
|
|
|
|
const jiaoAmountInputs = dom.querySelectorAll('input[data-field^="jiao"]')
|
|
|
|
|
jiaoAmountInputs.forEach(input => {
|
|
|
|
|
const value = parseFloat(input.value) || 0
|
|
|
|
|
jiaoTotal += value
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const jiaoInput = dom.querySelector('input[data-field="jTotal"]')
|
|
|
|
|
if (jiaoInput) {
|
|
|
|
|
jiaoInput.value = jiaoTotal === 0 ? '0' : jiaoTotal
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let fenTotal = 0
|
|
|
|
|
const fenAmountInputs = dom.querySelectorAll('input[data-field^="fen"]')
|
|
|
|
|
fenAmountInputs.forEach(input => {
|
|
|
|
|
const value = parseFloat(input.value) || 0
|
|
|
|
|
fenTotal += value
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const fenInput = dom.querySelector('input[data-field="fTotal"]')
|
|
|
|
|
if (fenInput) {
|
|
|
|
|
fenInput.value = fenTotal === 0 ? '0' : fenTotal
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 进位处理
|
|
|
|
|
if (fenTotal >= 10) {
|
|
|
|
|
jiaoTotal += Math.floor(fenTotal / 10)
|
|
|
|
|
fenTotal = fenTotal % 10
|
|
|
|
|
}
|
|
|
|
|
if (jiaoTotal >= 10) {
|
|
|
|
|
yuanTotal += Math.floor(jiaoTotal / 10)
|
|
|
|
|
jiaoTotal = jiaoTotal % 10
|
|
|
|
|
}
|
|
|
|
|
if (yuanTotal >= 10) {
|
|
|
|
|
shiTotal += Math.floor(yuanTotal / 10)
|
|
|
|
|
yuanTotal = yuanTotal % 10
|
|
|
|
|
}
|
|
|
|
|
if (shiTotal >= 10) {
|
|
|
|
|
baiTotal += Math.floor(shiTotal / 10)
|
|
|
|
|
shiTotal = shiTotal % 10
|
|
|
|
|
}
|
|
|
|
|
if (baiTotal >= 10) {
|
|
|
|
|
qianTotal += Math.floor(baiTotal / 10)
|
|
|
|
|
baiTotal = baiTotal % 10
|
|
|
|
|
}
|
|
|
|
|
if (qianTotal >= 10) {
|
|
|
|
|
wanTotal += Math.floor(qianTotal / 10)
|
|
|
|
|
qianTotal = qianTotal % 10
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 进位后同步更新input显示
|
|
|
|
|
const totalAmount = wanTotal * 10000 + qianTotal * 1000 + baiTotal * 100 + shiTotal * 10 + yuanTotal + jiaoTotal * 0.1 + fenTotal * 0.01
|
|
|
|
|
|
|
|
|
|
if (wanInput) {
|
|
|
|
|
wanInput.value = totalAmount >= 10000 ? (wanTotal === 0 ? '0' : wanTotal) : ''
|
|
|
|
|
}
|
|
|
|
|
if (qianInput) {
|
|
|
|
|
qianInput.value = totalAmount >= 1000 ? (qianTotal === 0 ? '0' : qianTotal) : ''
|
|
|
|
|
}
|
|
|
|
|
if (baiInput) {
|
|
|
|
|
baiInput.value = totalAmount >= 100 ? (baiTotal === 0 ? '0' : baiTotal) : ''
|
|
|
|
|
}
|
|
|
|
|
if (shiInput) {
|
|
|
|
|
shiInput.value = totalAmount >= 10 ? (shiTotal === 0 ? '0' : shiTotal) : ''
|
|
|
|
|
}
|
|
|
|
|
if (yuanInput) {
|
|
|
|
|
yuanInput.value = totalAmount >= 1 ? (yuanTotal === 0 ? '0' : yuanTotal) : ''
|
|
|
|
|
}
|
|
|
|
|
if (jiaoInput) {
|
|
|
|
|
jiaoInput.value = totalAmount >= 0.1 ? (jiaoTotal === 0 ? '0' : jiaoTotal) : ''
|
|
|
|
|
}
|
|
|
|
|
if (fenInput) {
|
|
|
|
|
fenInput.value = totalAmount >= 0.01 ? (fenTotal === 0 ? '0' : fenTotal) : ''
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.otherTotal = wanTotal * 10000 + qianTotal * 1000 + baiTotal * 100 + shiTotal * 10 + yuanTotal + jiaoTotal * 0.1 + fenTotal * 0.01
|
|
|
|
|
this.otherTotal = parseFloat(this.otherTotal.toFixed(2))
|
|
|
|
|
this.total = 0
|
|
|
|
|
|
|
|
|
|
const amountInputs = dom.querySelectorAll('input[data-field^="amount"]')
|
|
|
|
|
amountInputs.forEach(input => {
|
|
|
|
|
const value = parseFloat(input.value) || 0
|
|
|
|
|
this.total += value
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const totalInput = dom.querySelector('input[data-field="total"]')
|
|
|
|
|
if (totalInput) {
|
|
|
|
|
if (this.total === 0) {
|
|
|
|
|
this.total = parseFloat(totalInput.value.replace(/¥/g, '')) || 0
|
|
|
|
|
} else {
|
|
|
|
|
totalInput.value = '¥' + this.total.toFixed(2)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 更新大写金额
|
|
|
|
|
const upperCaseInput = dom.querySelector('input[data-field="upperCaseAmount"]')
|
|
|
|
|
if (upperCaseInput) {
|
|
|
|
|
if (this.otherTotal !== 0) {
|
|
|
|
|
upperCaseInput.value = numberToChinese(this.otherTotal)
|
|
|
|
|
} else {
|
|
|
|
|
upperCaseInput.value = numberToChinese(this.total)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async toggleSelection(e) {
|
|
|
|
|
@ -319,7 +787,7 @@ export default {
|
|
|
|
|
const list = this.plans.map(item => {
|
|
|
|
|
return item.id
|
|
|
|
|
})
|
|
|
|
|
if (list.indexOf(plan) != -1) {
|
|
|
|
|
if (list.indexOf(plan) !== -1) {
|
|
|
|
|
this.plans[list.indexOf(plan)].use_money = this.form.plan_link[index].use_money
|
|
|
|
|
console.log(this.plans[list.indexOf(plan)])
|
|
|
|
|
}
|
|
|
|
|
@ -335,7 +803,7 @@ export default {
|
|
|
|
|
this.$refs['planTable'].clearSelection()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
selectPlan(sel, row) {
|
|
|
|
|
selectPlan(sel) {
|
|
|
|
|
if (sel) {
|
|
|
|
|
this.form.plan_link = sel.map(item => {
|
|
|
|
|
return {
|
|
|
|
|
@ -365,7 +833,9 @@ export default {
|
|
|
|
|
padding: 0 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&-content {}
|
|
|
|
|
&-content {
|
|
|
|
|
/* empty */
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -407,4 +877,176 @@ export default {
|
|
|
|
|
z-index: 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.payment-table-section {
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
border-top: 1px solid #e6e6e6;
|
|
|
|
|
padding-top: 20px;
|
|
|
|
|
|
|
|
|
|
.section-header {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
|
|
|
|
|
.section-title {
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.payment-table {
|
|
|
|
|
width: 100%;
|
|
|
|
|
overflow-x: auto;
|
|
|
|
|
|
|
|
|
|
::v-deep table {
|
|
|
|
|
width: 100%;
|
|
|
|
|
border-collapse: collapse;
|
|
|
|
|
|
|
|
|
|
td {
|
|
|
|
|
border: 1px solid #000;
|
|
|
|
|
padding: 8px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
vertical-align: middle;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
::v-deep input {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 32px;
|
|
|
|
|
padding: 4px 8px;
|
|
|
|
|
border: 1px solid #DCDFE6;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
background: #fff;
|
|
|
|
|
color: #333;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
box-shadow: 0 0 4px rgba(220, 223, 230, 0.2);
|
|
|
|
|
|
|
|
|
|
&:focus {
|
|
|
|
|
outline: none;
|
|
|
|
|
border-color: #409EFF;
|
|
|
|
|
box-shadow: 0 0 8px rgba(64, 158, 255, 0.3);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
::v-deep textarea {
|
|
|
|
|
width: 100%;
|
|
|
|
|
min-height: 80px;
|
|
|
|
|
padding: 4px 8px;
|
|
|
|
|
border: 1px solid #DCDFE6;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
background: #fff;
|
|
|
|
|
color: #333;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
resize: vertical;
|
|
|
|
|
box-shadow: 0 0 4px rgba(220, 223, 230, 0.2);
|
|
|
|
|
|
|
|
|
|
&:focus {
|
|
|
|
|
outline: none;
|
|
|
|
|
border-color: #409EFF;
|
|
|
|
|
box-shadow: 0 0 8px rgba(64, 158, 255, 0.3);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.dialog-footer {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
gap: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
::v-deep .zoomed-table-dialog {
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: 5vh;
|
|
|
|
|
left: 50%;
|
|
|
|
|
transform: translateX(-50%);
|
|
|
|
|
margin: 0 !important;
|
|
|
|
|
max-height: 90vh;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
z-index: 2000;
|
|
|
|
|
|
|
|
|
|
.el-dialog__header {
|
|
|
|
|
padding: 15px 20px;
|
|
|
|
|
margin: 0;
|
|
|
|
|
border-bottom: 1px solid #EBEEF5;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.el-dialog__body {
|
|
|
|
|
flex: 1;
|
|
|
|
|
padding: 20px;
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
margin: 0;
|
|
|
|
|
max-height: calc(90vh - 120px);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.el-dialog__footer {
|
|
|
|
|
padding: 15px 20px;
|
|
|
|
|
margin: 0;
|
|
|
|
|
border-top: 1px solid #EBEEF5;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
::v-deep .el-dialog__wrapper {
|
|
|
|
|
padding-top: 0 !important;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.zoomed-table {
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
|
|
::v-deep table {
|
|
|
|
|
width: 100%;
|
|
|
|
|
border-collapse: collapse;
|
|
|
|
|
|
|
|
|
|
td {
|
|
|
|
|
border: 1px solid #000;
|
|
|
|
|
padding: 8px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
vertical-align: middle;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
::v-deep input {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 32px;
|
|
|
|
|
padding: 4px 8px;
|
|
|
|
|
border: 1px solid #DCDFE6;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
background: #fff;
|
|
|
|
|
color: #333;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
box-shadow: 0 0 4px rgba(220, 223, 230, 0.2);
|
|
|
|
|
|
|
|
|
|
&:focus {
|
|
|
|
|
outline: none;
|
|
|
|
|
border-color: #409EFF;
|
|
|
|
|
box-shadow: 0 0 8px rgba(64, 158, 255, 0.3);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
::v-deep textarea {
|
|
|
|
|
width: 100%;
|
|
|
|
|
min-height: 80px;
|
|
|
|
|
padding: 4px 8px;
|
|
|
|
|
border: 1px solid #DCDFE6;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
background: #fff;
|
|
|
|
|
color: #333;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
resize: vertical;
|
|
|
|
|
box-shadow: 0 0 4px rgba(220, 223, 230, 0.2);
|
|
|
|
|
|
|
|
|
|
&:focus {
|
|
|
|
|
outline: none;
|
|
|
|
|
border-color: #409EFF;
|
|
|
|
|
box-shadow: 0 0 8px rgba(64, 158, 255, 0.3);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|