|
|
|
@ -277,7 +277,7 @@
|
|
|
|
<i class="el-icon-time" /> 查看同类历史记录
|
|
|
|
<i class="el-icon-time" /> 查看同类历史记录
|
|
|
|
</el-button>
|
|
|
|
</el-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 根据是否有第二个表格决定显示方式 -->
|
|
|
|
<!-- 根据是否有第二个表格决定显示方式 -->
|
|
|
|
<div v-if="hasSecondPostPaymentForm">
|
|
|
|
<div v-if="hasSecondPostPaymentForm">
|
|
|
|
<!-- 有第二个表格时显示Tab切换 -->
|
|
|
|
<!-- 有第二个表格时显示Tab切换 -->
|
|
|
|
@ -717,14 +717,14 @@ export default {
|
|
|
|
type: 'selection'
|
|
|
|
type: 'selection'
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: '分类',
|
|
|
|
label: '预算类型',
|
|
|
|
prop: 'type',
|
|
|
|
prop: 'type_detail.name',
|
|
|
|
formatter: (cell, data, value) => {
|
|
|
|
// formatter: (cell, data, value) => {
|
|
|
|
const res = this.planTypes.filter(item => {
|
|
|
|
// const res = this.planTypes.filter(item => {
|
|
|
|
return item.id === value
|
|
|
|
// return item.id === value
|
|
|
|
})
|
|
|
|
// })
|
|
|
|
return res[0]?.value || '未知'
|
|
|
|
// return res[0]?.value || '未知'
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: '名称',
|
|
|
|
label: '名称',
|
|
|
|
@ -1041,7 +1041,7 @@ export default {
|
|
|
|
this.forms = this.contractTemplate
|
|
|
|
this.forms = this.contractTemplate
|
|
|
|
// 初始化第一个tab的数据源
|
|
|
|
// 初始化第一个tab的数据源
|
|
|
|
this.forms1 = this.contractTemplate
|
|
|
|
this.forms1 = this.contractTemplate
|
|
|
|
|
|
|
|
|
|
|
|
// 检查是否有第二个事后支付表格模板
|
|
|
|
// 检查是否有第二个事后支付表格模板
|
|
|
|
if (this.contract.contract_template2 && this.contract.contract_template2.template) {
|
|
|
|
if (this.contract.contract_template2 && this.contract.contract_template2.template) {
|
|
|
|
this.hasSecondPostPaymentForm = true
|
|
|
|
this.hasSecondPostPaymentForm = true
|
|
|
|
@ -1054,7 +1054,7 @@ export default {
|
|
|
|
this.hasSecondPostPaymentForm = false
|
|
|
|
this.hasSecondPostPaymentForm = false
|
|
|
|
this.forms2 = null
|
|
|
|
this.forms2 = null
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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 || []
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -1154,7 +1154,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
// 更新DOM中的值
|
|
|
|
// 更新DOM中的值
|
|
|
|
const dom = tableIndex === 1 ? this.$refs.mainTable1 : this.$refs.mainTable2
|
|
|
|
const dom = tableIndex === 1 ? this.$refs.mainTable1 : this.$refs.mainTable2
|
|
|
|
|
|
|
|
|
|
|
|
if (dom) {
|
|
|
|
if (dom) {
|
|
|
|
const input = dom.querySelector(`[data-field="${field.field}"]`)
|
|
|
|
const input = dom.querySelector(`[data-field="${field.field}"]`)
|
|
|
|
if (input) {
|
|
|
|
if (input) {
|
|
|
|
@ -1192,7 +1192,7 @@ export default {
|
|
|
|
// 根据当前选择的tab获取对应的表格DOM和模板字段
|
|
|
|
// 根据当前选择的tab获取对应的表格DOM和模板字段
|
|
|
|
let currentDom = null
|
|
|
|
let currentDom = null
|
|
|
|
let templateFields = null
|
|
|
|
let templateFields = null
|
|
|
|
|
|
|
|
|
|
|
|
if (this.activePostPaymentTab === 'form1' && this.contract.contract_template) {
|
|
|
|
if (this.activePostPaymentTab === 'form1' && this.contract.contract_template) {
|
|
|
|
currentDom = this.$refs.mainTable1
|
|
|
|
currentDom = this.$refs.mainTable1
|
|
|
|
templateFields = this.contract.contract_template.contract_template_fields
|
|
|
|
templateFields = this.contract.contract_template.contract_template_fields
|
|
|
|
@ -1200,7 +1200,7 @@ export default {
|
|
|
|
currentDom = this.$refs.mainTable2
|
|
|
|
currentDom = this.$refs.mainTable2
|
|
|
|
templateFields = this.contract.contract_template2.contract_template_fields
|
|
|
|
templateFields = this.contract.contract_template2.contract_template_fields
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (currentDom && templateFields) {
|
|
|
|
if (currentDom && templateFields) {
|
|
|
|
// 获取所有输入控件
|
|
|
|
// 获取所有输入控件
|
|
|
|
const inputs = currentDom.querySelectorAll('input, select, textarea')
|
|
|
|
const inputs = currentDom.querySelectorAll('input, select, textarea')
|
|
|
|
@ -1377,7 +1377,7 @@ export default {
|
|
|
|
} else if (this.activePostPaymentTab === 'form2') {
|
|
|
|
} else if (this.activePostPaymentTab === 'form2') {
|
|
|
|
currentDom = this.$refs.mainTable2
|
|
|
|
currentDom = this.$refs.mainTable2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (currentDom) {
|
|
|
|
if (currentDom) {
|
|
|
|
const currentPaymentInput = currentDom.querySelector('input[data-field="currentDuePayment"]')
|
|
|
|
const currentPaymentInput = currentDom.querySelector('input[data-field="currentDuePayment"]')
|
|
|
|
if (currentPaymentInput) {
|
|
|
|
if (currentPaymentInput) {
|
|
|
|
@ -1398,7 +1398,7 @@ export default {
|
|
|
|
} else if (this.activePostPaymentTab === 'form2') {
|
|
|
|
} else if (this.activePostPaymentTab === 'form2') {
|
|
|
|
currentDom = this.$refs.mainTable2
|
|
|
|
currentDom = this.$refs.mainTable2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (currentDom && this.contract.contract_template) {
|
|
|
|
if (currentDom && this.contract.contract_template) {
|
|
|
|
const updatedForms = syncFormDomToHtml(currentDom, this.contract.contract_template.contract_template_fields)
|
|
|
|
const updatedForms = syncFormDomToHtml(currentDom, this.contract.contract_template.contract_template_fields)
|
|
|
|
// 更新对应的数据源
|
|
|
|
// 更新对应的数据源
|
|
|
|
@ -1449,7 +1449,7 @@ export default {
|
|
|
|
// 根据当前选择的tab获取对应的表格DOM
|
|
|
|
// 根据当前选择的tab获取对应的表格DOM
|
|
|
|
let currentDom = null
|
|
|
|
let currentDom = null
|
|
|
|
let templateFields = null
|
|
|
|
let templateFields = null
|
|
|
|
|
|
|
|
|
|
|
|
if (this.activePostPaymentTab === 'form1') {
|
|
|
|
if (this.activePostPaymentTab === 'form1') {
|
|
|
|
currentDom = this.$refs.mainTable1
|
|
|
|
currentDom = this.$refs.mainTable1
|
|
|
|
if (this.contract.contract_template) {
|
|
|
|
if (this.contract.contract_template) {
|
|
|
|
@ -1461,7 +1461,7 @@ export default {
|
|
|
|
templateFields = this.contract.contract_template2.contract_template_fields
|
|
|
|
templateFields = this.contract.contract_template2.contract_template_fields
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (currentDom && templateFields) {
|
|
|
|
if (currentDom && templateFields) {
|
|
|
|
//console.log(templateFields)
|
|
|
|
//console.log(templateFields)
|
|
|
|
const updatedForms = syncFormDomToHtml(currentDom, templateFields)
|
|
|
|
const updatedForms = syncFormDomToHtml(currentDom, templateFields)
|
|
|
|
@ -1494,22 +1494,22 @@ export default {
|
|
|
|
} else if (this.activePostPaymentTab === 'form2' && this.contract.contract_template2) {
|
|
|
|
} else if (this.activePostPaymentTab === 'form2' && this.contract.contract_template2) {
|
|
|
|
templateFields = this.contract.contract_template2.contract_template_fields
|
|
|
|
templateFields = this.contract.contract_template2.contract_template_fields
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (templateFields) {
|
|
|
|
if (templateFields) {
|
|
|
|
// 从放大窗口获取更新后的数据
|
|
|
|
// 从放大窗口获取更新后的数据
|
|
|
|
const updatedForms = syncFormDomToHtml(dom, templateFields)
|
|
|
|
const updatedForms = syncFormDomToHtml(dom, templateFields)
|
|
|
|
|
|
|
|
|
|
|
|
// 只更新当前激活tab的数据源
|
|
|
|
// 只更新当前激活tab的数据源
|
|
|
|
if (this.activePostPaymentTab === 'form1') {
|
|
|
|
if (this.activePostPaymentTab === 'form1') {
|
|
|
|
this.forms1 = updatedForms
|
|
|
|
this.forms1 = updatedForms
|
|
|
|
} else if (this.activePostPaymentTab === 'form2') {
|
|
|
|
} else if (this.activePostPaymentTab === 'form2') {
|
|
|
|
this.forms2 = updatedForms
|
|
|
|
this.forms2 = updatedForms
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 更新共享的forms数据(用于提交)
|
|
|
|
// 更新共享的forms数据(用于提交)
|
|
|
|
this.forms = updatedForms
|
|
|
|
this.forms = updatedForms
|
|
|
|
this.contract.forms = updatedForms
|
|
|
|
this.contract.forms = updatedForms
|
|
|
|
|
|
|
|
|
|
|
|
// 重新设置监听器
|
|
|
|
// 重新设置监听器
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
if (this.activePostPaymentTab === 'form1' && this.$refs.mainTable1) {
|
|
|
|
if (this.activePostPaymentTab === 'form1' && this.$refs.mainTable1) {
|
|
|
|
@ -1701,7 +1701,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
// 初始计算一次
|
|
|
|
// 初始计算一次
|
|
|
|
// this.calculateTotal()
|
|
|
|
// this.calculateTotal()
|
|
|
|
|
|
|
|
|
|
|
|
console.log('setupAmountListeners: listeners setup completed for dom', dom)
|
|
|
|
console.log('setupAmountListeners: listeners setup completed for dom', dom)
|
|
|
|
console.log('Found inputs:', {
|
|
|
|
console.log('Found inputs:', {
|
|
|
|
sdate: dom.querySelectorAll('input[data-field^="sdate"]').length,
|
|
|
|
sdate: dom.querySelectorAll('input[data-field^="sdate"]').length,
|
|
|
|
@ -1726,7 +1726,7 @@ export default {
|
|
|
|
} else if (this.activePostPaymentTab === 'form2') {
|
|
|
|
} else if (this.activePostPaymentTab === 'form2') {
|
|
|
|
currentDom = this.$refs.mainTable2
|
|
|
|
currentDom = this.$refs.mainTable2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (currentDom) {
|
|
|
|
if (currentDom) {
|
|
|
|
const sdateInput = currentDom.querySelector('input[data-field^="sdate"]')
|
|
|
|
const sdateInput = currentDom.querySelector('input[data-field^="sdate"]')
|
|
|
|
const edateInput = currentDom.querySelector('input[data-field^="edate"]')
|
|
|
|
const edateInput = currentDom.querySelector('input[data-field^="edate"]')
|
|
|
|
@ -1768,7 +1768,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
calculateTotal() {
|
|
|
|
calculateTotal() {
|
|
|
|
console.log('calculateTotal called')
|
|
|
|
console.log('calculateTotal called')
|
|
|
|
|
|
|
|
|
|
|
|
// 计算当前激活的表格的总金额
|
|
|
|
// 计算当前激活的表格的总金额
|
|
|
|
let currentDom = null
|
|
|
|
let currentDom = null
|
|
|
|
if (this.activePostPaymentTab === 'form1') {
|
|
|
|
if (this.activePostPaymentTab === 'form1') {
|
|
|
|
@ -1776,12 +1776,12 @@ export default {
|
|
|
|
} else if (this.activePostPaymentTab === 'form2') {
|
|
|
|
} else if (this.activePostPaymentTab === 'form2') {
|
|
|
|
currentDom = this.$refs.mainTable2
|
|
|
|
currentDom = this.$refs.mainTable2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (currentDom) {
|
|
|
|
if (currentDom) {
|
|
|
|
console.log('calculateTotal: calculating for current tab dom', currentDom)
|
|
|
|
console.log('calculateTotal: calculating for current tab dom', currentDom)
|
|
|
|
this.calculateTableTotal(currentDom)
|
|
|
|
this.calculateTableTotal(currentDom)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 计算放大表格的总金额
|
|
|
|
// 计算放大表格的总金额
|
|
|
|
if (this.$refs.zoomedTable) {
|
|
|
|
if (this.$refs.zoomedTable) {
|
|
|
|
console.log('calculateTotal: calculating for zoomed table')
|
|
|
|
console.log('calculateTotal: calculating for zoomed table')
|
|
|
|
|