|
@@ -107,7 +107,8 @@
|
|
|
show-overflow="title" :rules="[{ required: true, message: '请输入费用', trigger: 'blur' }]">
|
|
|
<template #edit="scope">
|
|
|
<el-input maxlength="15" v-model="scope.row.ordinaryNumber"
|
|
|
- @input="handleNumberInput(scope.row)"></el-input>
|
|
|
+ @input="handleOrdinaryNumberInput(scope.row)"
|
|
|
+ @blur="handleNumberInput(scope.row)"></el-input>
|
|
|
</template>
|
|
|
</vxe-table-column>
|
|
|
<vxe-table-column field="numberCount" title="汇总" show-overflow="title"
|
|
@@ -232,7 +233,8 @@
|
|
|
show-overflow="title" :rules="[{ required: true, message: '请输入费用', trigger: 'blur' }]">
|
|
|
<template #edit="scope">
|
|
|
<el-input maxlength="15" v-model="scope.row.ordinaryNumber"
|
|
|
- @input="handleNumberInput(scope.row)"></el-input>
|
|
|
+ @input="handleOrdinaryNumberInput(scope.row)"
|
|
|
+ @blur="handleNumberInput(scope.row)"></el-input>
|
|
|
</template>
|
|
|
</vxe-table-column>
|
|
|
<vxe-table-column field="numberCount" title="汇总" show-overflow="title"
|
|
@@ -352,7 +354,8 @@
|
|
|
show-overflow="title" :rules="[{ required: true, message: '请输入费用', trigger: 'blur' }]">
|
|
|
<template #edit="scope">
|
|
|
<el-input maxlength="15" v-model="scope.row.ordinaryNumber"
|
|
|
- @input="handleNumberInput(scope.row)"></el-input>
|
|
|
+ @input="handleOrdinaryNumberInput(scope.row)"
|
|
|
+ @blur="handleNumberInput(scope.row)"></el-input>
|
|
|
</template>
|
|
|
</vxe-table-column>
|
|
|
<vxe-table-column field="numberCount" title="汇总" show-overflow="title"
|
|
@@ -458,7 +461,8 @@
|
|
|
:rules="[{ required: true, message: '请输入费用', trigger: 'blur' }]">
|
|
|
<template #edit="scope">
|
|
|
<el-input maxlength="15" v-model="scope.row.ordinaryNumber"
|
|
|
- @input="handleNumberInput(scope.row)"></el-input>
|
|
|
+ @input="handleOrdinaryNumberInput(scope.row)"
|
|
|
+ @blur="handleNumberInput(scope.row)"></el-input>
|
|
|
</template>
|
|
|
</vxe-table-column>
|
|
|
<vxe-table-column field="numberCount" title="汇总" show-overflow="title"
|
|
@@ -579,7 +583,8 @@
|
|
|
show-overflow="title" :rules="[{ required: true, message: '请输入费用', trigger: 'blur' }]">
|
|
|
<template #edit="scope">
|
|
|
<el-input maxlength="15" v-model="scope.row.ordinaryNumber"
|
|
|
- @input="handleNumberInput(scope.row)"></el-input>
|
|
|
+ @input="handleOrdinaryNumberInput(scope.row)"
|
|
|
+ @blur="handleNumberInput(scope.row)"></el-input>
|
|
|
</template>
|
|
|
</vxe-table-column>
|
|
|
<vxe-table-column field="numberCount" title="汇总" show-overflow="title"
|
|
@@ -698,7 +703,8 @@
|
|
|
show-overflow="title" :rules="[{ required: true, message: '请输入费用', trigger: 'blur' }]">
|
|
|
<template #edit="scope">
|
|
|
<el-input maxlength="15" v-model="scope.row.ordinaryNumber"
|
|
|
- @input="handleNumberInput(scope.row)"></el-input>
|
|
|
+ @input="handleOrdinaryNumberInput(scope.row)"
|
|
|
+ @blur="handleNumberInput(scope.row)"></el-input>
|
|
|
</template>
|
|
|
</vxe-table-column>
|
|
|
<vxe-table-column field="numberCount" title="汇总" show-overflow="title"
|
|
@@ -820,7 +826,8 @@
|
|
|
show-overflow="title" :rules="[{ required: true, message: '请输入费用', trigger: 'blur' }]">
|
|
|
<template #edit="scope">
|
|
|
<el-input maxlength="15" v-model="scope.row.ordinaryNumber"
|
|
|
- @input="handleNumberInput(scope.row)"></el-input>
|
|
|
+ @input="handleOrdinaryNumberInput(scope.row)"
|
|
|
+ @blur="handleNumberInput(scope.row)"></el-input>
|
|
|
</template>
|
|
|
</vxe-table-column>
|
|
|
<vxe-table-column field="numberCount" title="汇总" show-overflow="title"
|
|
@@ -925,7 +932,8 @@
|
|
|
:rules="[{ required: true, message: '请输入费用', trigger: 'blur' }]">
|
|
|
<template #edit="scope">
|
|
|
<el-input maxlength="15" v-model="scope.row.ordinaryNumber"
|
|
|
- @input="handleNumberInput(scope.row)"></el-input>
|
|
|
+ @input="handleOrdinaryNumberInput(scope.row)"
|
|
|
+ @blur="handleNumberInput(scope.row)"></el-input>
|
|
|
</template>
|
|
|
</vxe-table-column>
|
|
|
<vxe-table-column field="numberCount" title="汇总" show-overflow="title"
|
|
@@ -1063,7 +1071,8 @@
|
|
|
show-overflow="title" :rules="[{ required: true, message: '请输入费用', trigger: 'blur' }]">
|
|
|
<template #edit="scope">
|
|
|
<el-input maxlength="15" v-model="scope.row.ordinaryNumber"
|
|
|
- @input="handleNumberInput(scope.row)"></el-input>
|
|
|
+ @input="handleOrdinaryNumberInput(scope.row)"
|
|
|
+ @blur="handleNumberInput(scope.row)"></el-input>
|
|
|
</template>
|
|
|
</vxe-table-column>
|
|
|
<vxe-table-column field="numberCount" title="汇总" show-overflow="title"
|
|
@@ -1618,6 +1627,8 @@ export default {
|
|
|
return footerData
|
|
|
},
|
|
|
twoDecimalPlaces(num) {
|
|
|
+ num = parseFloat(num).toFixed(2);
|
|
|
+ // 解决精度问题
|
|
|
let str = num.toString()
|
|
|
str = str.replace(/\s+/g, "");
|
|
|
var len1 = str.substr(0, 1)
|
|
@@ -2456,12 +2467,11 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
handleExpand({ expanded, column, columnIndex, row, rowIndex }) {
|
|
|
+ this.handleTableInfo(this.inputForm.sourceType)
|
|
|
let tempUniqueId = ""
|
|
|
- this.inputForm.invoiceReimbursementFiles.forEach(item => {
|
|
|
- if (item.remarks) {
|
|
|
- tempUniqueId = item.remarks
|
|
|
- }
|
|
|
- })
|
|
|
+ if (this.tableData[0].uniqueId) {
|
|
|
+ tempUniqueId = this.tableData[0].uniqueId
|
|
|
+ }
|
|
|
this.inputForm.invoiceReimbursementFiles.forEach(item => {
|
|
|
if (!item.remarks) {
|
|
|
item.remarks = tempUniqueId
|
|
@@ -2591,14 +2601,27 @@ export default {
|
|
|
|
|
|
return arr
|
|
|
},
|
|
|
+ handleOrdinaryNumberInput(row) {
|
|
|
+ let value = row.ordinaryNumber;
|
|
|
+
|
|
|
+ // 正则:允许整数、带1~2位小数,也允许末尾点
|
|
|
+ const regex = /^(?:[1-9]\d*|0)?(?:\.\d{0,2})?$/;
|
|
|
+
|
|
|
+ // 非法字符直接删除
|
|
|
+ if (!regex.test(value)) {
|
|
|
+ row.ordinaryNumber = value.slice(0, -1);
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ row.numberCount = parseFloat(Number(row.number || 0) + Number(row.ordinaryNumber || 0)).toFixed(2)
|
|
|
+ this.handleTableInfo(this.inputForm.sourceType)
|
|
|
+ this.tableRef.updateFooter(this.tableData)
|
|
|
+ }
|
|
|
+ },
|
|
|
handleNumberInput(row) {
|
|
|
if (this.commonJS.isNotEmpty(row.number)) {
|
|
|
row.number = this.twoDecimalPlaces(row.number)
|
|
|
}
|
|
|
- if (this.commonJS.isNotEmpty(row.ordinaryNumber)) {
|
|
|
- row.ordinaryNumber = this.twoDecimalPlaces(row.ordinaryNumber)
|
|
|
- }
|
|
|
- row.numberCount = Number(row.number || 0) + Number(row.ordinaryNumber || 0)
|
|
|
+ row.numberCount = parseFloat(Number(row.number || 0) + Number(row.ordinaryNumber || 0)).toFixed(2)
|
|
|
this.handleTableInfo(this.inputForm.sourceType)
|
|
|
this.tableRef.updateFooter(this.tableData)
|
|
|
|