|
@@ -12,20 +12,19 @@
|
|
|
<el-col :span="24">
|
|
|
<vxe-table
|
|
|
border
|
|
|
- show-overflow
|
|
|
+
|
|
|
show-footer
|
|
|
ref="baseTable"
|
|
|
:key="baseKey"
|
|
|
class="vxe-table-element"
|
|
|
:data="inputForm.financeInvoiceBaseDTOList"
|
|
|
:footer-method="footerMethod"
|
|
|
- :footer-cell-class-name="footerCellClassName"
|
|
|
style="margin-left: 5em"
|
|
|
highlight-current-row
|
|
|
:edit-rules="validRules"
|
|
|
:edit-config="{trigger: 'click', mode: 'cell', showStatus: true, autoClear: true, icon: '-'}"
|
|
|
>
|
|
|
- <vxe-table-column field="programName" align="center" title="项目名称" :edit-render="{}">
|
|
|
+ <vxe-table-column field="programName" align="center" title="项目名称" :edit-render="{}" show-overflow="title">
|
|
|
<template v-slot:edit="scope">
|
|
|
<el-input @focus="openProgramPageForm(scope.$rowIndex)" placeholder="请填写项目名称" :readonly="true" v-model="scope.row.programName"/>
|
|
|
</template>
|
|
@@ -43,13 +42,17 @@
|
|
|
<vxe-table-column field="account" align="center" title="发票金额(元)" :edit-render="{}">
|
|
|
<template v-slot:edit="scope">
|
|
|
<el-input-number
|
|
|
+ style="width: 240px"
|
|
|
+ :readonly="false"
|
|
|
:precision="2"
|
|
|
:max="9999999999"
|
|
|
:step="0.01"
|
|
|
:min="0"
|
|
|
:controls="false"
|
|
|
clearable
|
|
|
- placeholder="请填写发票金额" v-model="scope.row.account" />
|
|
|
+ placeholder="请填写发票金额"
|
|
|
+ v-model="scope.row.account"
|
|
|
+ @input="fixedAccount"/>
|
|
|
</template>
|
|
|
</vxe-table-column>
|
|
|
<!-- <vxe-table-column field="clientName" title="委托方" :edit-render="{}">-->
|
|
@@ -260,12 +263,11 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="发票金额(元)" prop="accountTotal"
|
|
|
+ <el-form-item label="发票金额(元)" prop="account"
|
|
|
:rules="[
|
|
|
{required: true, message:'发票金额不能为空', trigger:'blur'}
|
|
|
]">
|
|
|
<el-input
|
|
|
- @input="fixedAccount"
|
|
|
placeholder="请填写发票金额"
|
|
|
maxlength="15"
|
|
|
v-model="inputForm.accountTotal"
|
|
@@ -273,17 +275,6 @@
|
|
|
>
|
|
|
|
|
|
</el-input>
|
|
|
-<!-- <el-input-number-->
|
|
|
-<!-- v-model="inputForm.account"-->
|
|
|
-<!-- controls-position="right"-->
|
|
|
-<!-- :controls="false"-->
|
|
|
-<!-- style="width:100%;"-->
|
|
|
-<!-- :max="999999999999999"-->
|
|
|
-<!-- :precision="2"-->
|
|
|
-<!-- placeholder="请填写发票金额"-->
|
|
|
-<!-- :step="0.01"-->
|
|
|
-<!-- clearable>-->
|
|
|
-<!-- </el-input-number>-->
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
@@ -696,7 +687,6 @@
|
|
|
programName: '',
|
|
|
contractName: '',
|
|
|
programNo: '',
|
|
|
- account:'',
|
|
|
clientName: '',
|
|
|
reportNo: '',
|
|
|
type: '1',
|
|
@@ -741,11 +731,11 @@
|
|
|
baseKey: '',
|
|
|
detailKey: '',
|
|
|
receivablesKey: '',
|
|
|
- validRules: {
|
|
|
- account: [
|
|
|
- { required: true, message: '必须输入发票金额',trigger:"change"},
|
|
|
- ]
|
|
|
- }
|
|
|
+ // validRules: {
|
|
|
+ // account: [
|
|
|
+ // { required: true, message: '必须输入发票金额',trigger:"change"},
|
|
|
+ // ]
|
|
|
+ // }
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
@@ -805,7 +795,6 @@
|
|
|
programName: '',
|
|
|
contractName: '',
|
|
|
programNo: '',
|
|
|
- account:'',
|
|
|
clientName: '',
|
|
|
reportNo: '',
|
|
|
type: '1',
|
|
@@ -920,10 +909,16 @@
|
|
|
}
|
|
|
if (!this.commonJS.isEmpty(this.status) && this.status === 'audit' && (this.commonJS.isEmpty(this.inputForm.financeInvoiceDetailDTOList) || this.inputForm.financeInvoiceDetailDTOList.length === 0)) {
|
|
|
this.inputForm.financeInvoiceDetailDTOList = []
|
|
|
+ let i = this.inputForm.financeInvoiceBaseDTOList.length
|
|
|
+ let sun = 0
|
|
|
+ for (let j = 0; j < i; j++) {
|
|
|
+ sun += parseFloat(this.inputForm.financeInvoiceBaseDTOList[j].account)
|
|
|
+ }
|
|
|
+ console.log(sun)
|
|
|
this.inputForm.financeInvoiceDetailDTOList.push({
|
|
|
code: '',
|
|
|
number: '',
|
|
|
- account: this.inputForm.account,
|
|
|
+ account: sun,
|
|
|
rate: '',
|
|
|
amount: '',
|
|
|
tax: '',
|
|
@@ -986,6 +981,8 @@
|
|
|
this.loading = false
|
|
|
throw new Error()
|
|
|
}
|
|
|
+ this.inputForm.account=this.inputForm.accountTotal
|
|
|
+ console.log(this.inputForm.account)
|
|
|
if (status === 'save') {
|
|
|
// 暂存
|
|
|
this.loading = true
|
|
@@ -1127,7 +1124,6 @@
|
|
|
programName: '',
|
|
|
contractName: '',
|
|
|
programNo: '',
|
|
|
- account:'',
|
|
|
clientName: '',
|
|
|
reportNo: '',
|
|
|
type: '1',
|
|
@@ -1180,6 +1176,8 @@
|
|
|
}
|
|
|
if (type === 'detail') {
|
|
|
this.$refs.detailTable.insert().then((data) => {
|
|
|
+ console.log(this.inputForm.accountTotal)
|
|
|
+ data.account=this.inputForm.accountTotal
|
|
|
this.inputForm.financeInvoiceDetailDTOList.push(data)
|
|
|
this.detailKey = Math.random()
|
|
|
})
|
|
@@ -1225,18 +1223,18 @@
|
|
|
r.programName = item.projectName
|
|
|
r.contractName = item.contractName
|
|
|
r.programNo = item.projectNumber
|
|
|
- r.account=item.account
|
|
|
r.contractId = item.contractId
|
|
|
r.programId = item.id
|
|
|
+ r.reportNo = item.reportNo
|
|
|
this.inputForm.financeInvoiceBaseDTOList[this.programRow] = r
|
|
|
} else {
|
|
|
let r = {
|
|
|
programName: item.projectName,
|
|
|
contractName: item.contractName,
|
|
|
programNo: item.projectNumber,
|
|
|
- account:item.account,
|
|
|
contractId: item.contractId,
|
|
|
- programId: item.id
|
|
|
+ programId: item.id,
|
|
|
+ reportNo: item.reportNo
|
|
|
}
|
|
|
this.$refs.baseTable.insertAt(r)
|
|
|
this.inputForm.financeInvoiceBaseDTOList.push(r)
|
|
@@ -1366,7 +1364,7 @@
|
|
|
// 获取发票金额,放到开票明细中第一条数据
|
|
|
getTotalAccount () {
|
|
|
if (!this.commonJS.isEmpty(this.inputForm.account)) {
|
|
|
- this.financeInvoiceDetailDTOList.push({account: this.inputForm.account})
|
|
|
+ this.financeInvoiceDetailDTOList.push({account: this.inputForm.accountTotal})
|
|
|
}
|
|
|
},
|
|
|
async updateStatusById (type, callback) {
|
|
@@ -1548,18 +1546,27 @@
|
|
|
const footerData = [
|
|
|
columns.map((column, columnIndex) => {
|
|
|
if (columnIndex === 0) {
|
|
|
- return '汇总'
|
|
|
+ return '发票金额汇总(元)'
|
|
|
}
|
|
|
if (['account'].includes(column.property)) {
|
|
|
// eslint-disable-next-line no-undef
|
|
|
this.inputForm.accountTotal = XEUtils.sum(data, column.property)
|
|
|
return XEUtils.sum(data, column.property)
|
|
|
}
|
|
|
+ // if (['accountTotal'].includes(column.property)) {
|
|
|
+ // // eslint-disable-next-line no-undef
|
|
|
+ // this.inputForm.accountTotal = XEUtils.sum(data, column.property)
|
|
|
+ // return XEUtils.sum(data, column.property)
|
|
|
+ // }
|
|
|
return null
|
|
|
})
|
|
|
]
|
|
|
return footerData
|
|
|
},
|
|
|
+ // 格式化 发票金额 保留两位小数
|
|
|
+ fixedAccount () {
|
|
|
+ this.inputForm.account=this.inputForm.account.replace(/[^\d.]/g,'').replace(/(\.\d+)\.+/g, '$1').replace(/(\..*)\./g, '$1')
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|