|
@@ -11,6 +11,7 @@
|
|
<el-row :gutter="15">
|
|
<el-row :gutter="15">
|
|
<vxe-table
|
|
<vxe-table
|
|
border
|
|
border
|
|
|
|
+ :footer-method="footerMethod2"
|
|
show-overflow
|
|
show-overflow
|
|
show-footer
|
|
show-footer
|
|
ref="baseTable"
|
|
ref="baseTable"
|
|
@@ -20,9 +21,10 @@
|
|
@cell-click=""
|
|
@cell-click=""
|
|
@edit-closed=""
|
|
@edit-closed=""
|
|
highlight-current-row
|
|
highlight-current-row
|
|
|
|
+ :edit-rules="tableRules"
|
|
:edit-config="{trigger: 'click', mode: 'cell', showStatus: true, autoClear: true, icon: '-'}"
|
|
: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="项目名称555" :edit-render="{}">
|
|
<template v-slot:edit="scope">
|
|
<template v-slot:edit="scope">
|
|
<el-input @focus="openProgramPageForm(scope.$rowIndex)" placeholder="请填写项目名称" :readonly="true" v-model="scope.row.programName"/>
|
|
<el-input @focus="openProgramPageForm(scope.$rowIndex)" placeholder="请填写项目名称" :readonly="true" v-model="scope.row.programName"/>
|
|
</template>
|
|
</template>
|
|
@@ -37,6 +39,11 @@
|
|
<el-input :readonly="true" placeholder="请填写项目编号" v-model="scope.row.programNo"/>
|
|
<el-input :readonly="true" placeholder="请填写项目编号" v-model="scope.row.programNo"/>
|
|
</template>
|
|
</template>
|
|
</vxe-table-column>
|
|
</vxe-table-column>
|
|
|
|
+ <vxe-table-column field="account" align="center" title="发票金额(元)" :edit-render="{}">
|
|
|
|
+ <template v-slot:edit="scope">
|
|
|
|
+ <el-input :readonly="true" placeholder="请填写发票金额" v-model="scope.row.account" @blur="scope.row.account = twoDecimalPlaces(scope.row.account)" maxlength="15"/>
|
|
|
|
+ </template>
|
|
|
|
+ </vxe-table-column>
|
|
<!-- <vxe-table-column field="clientName" title="委托方" :edit-render="{}">-->
|
|
<!-- <vxe-table-column field="clientName" title="委托方" :edit-render="{}">-->
|
|
<!-- <template v-slot:edit="scope">-->
|
|
<!-- <template v-slot:edit="scope">-->
|
|
<!-- <el-input :readonly="true" placeholder="请填写委托方" v-model="scope.row.clientName"/>-->
|
|
<!-- <el-input :readonly="true" placeholder="请填写委托方" v-model="scope.row.clientName"/>-->
|
|
@@ -566,6 +573,7 @@
|
|
import WorkClientForm from '../workClientInfo/WorkClientChooseRadio'
|
|
import WorkClientForm from '../workClientInfo/WorkClientChooseRadio'
|
|
import SelectUserTree from '@/views/modules/utils/treeUserSelect'
|
|
import SelectUserTree from '@/views/modules/utils/treeUserSelect'
|
|
import SelectTree from '@/components/treeSelect/treeSelect.vue'
|
|
import SelectTree from '@/components/treeSelect/treeSelect.vue'
|
|
|
|
+ import XEUtils from 'xe-utils'
|
|
export default {
|
|
export default {
|
|
props: {
|
|
props: {
|
|
businessId: {
|
|
businessId: {
|
|
@@ -583,11 +591,17 @@
|
|
},
|
|
},
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
|
|
+ tableRules: {
|
|
|
|
+ account: [
|
|
|
|
+ { required: true, message: '请填写发票金额' }
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
title: '',
|
|
title: '',
|
|
method: '',
|
|
method: '',
|
|
visible: false,
|
|
visible: false,
|
|
loading: false,
|
|
loading: false,
|
|
inputForm: {
|
|
inputForm: {
|
|
|
|
+ actualPrice: '',
|
|
id: '',
|
|
id: '',
|
|
financeInvoiceBaseDTOList: [],
|
|
financeInvoiceBaseDTOList: [],
|
|
programName: '',
|
|
programName: '',
|
|
@@ -688,6 +702,7 @@
|
|
init (method, id) {
|
|
init (method, id) {
|
|
this.method = method
|
|
this.method = method
|
|
this.inputForm = {
|
|
this.inputForm = {
|
|
|
|
+ actualPrice: '',
|
|
id: '',
|
|
id: '',
|
|
financeInvoiceBaseDTOList: [],
|
|
financeInvoiceBaseDTOList: [],
|
|
programName: '',
|
|
programName: '',
|
|
@@ -779,7 +794,8 @@
|
|
this.inputForm.financeInvoiceDetailDTOList.push({
|
|
this.inputForm.financeInvoiceDetailDTOList.push({
|
|
code: '',
|
|
code: '',
|
|
number: '',
|
|
number: '',
|
|
- account: this.inputForm.account,
|
|
|
|
|
|
+ account: this.inputForm.actualPrice,
|
|
|
|
+ // account: this.inputForm.account,
|
|
rate: '',
|
|
rate: '',
|
|
amount: '',
|
|
amount: '',
|
|
tax: '',
|
|
tax: '',
|
|
@@ -837,6 +853,7 @@
|
|
this.loading = false
|
|
this.loading = false
|
|
throw new Error()
|
|
throw new Error()
|
|
}
|
|
}
|
|
|
|
+ this.inputForm.account = this.inputForm.actualPrice
|
|
if (status === 'save') {
|
|
if (status === 'save') {
|
|
// 暂存
|
|
// 暂存
|
|
// this.inputForm.status = '1'
|
|
// this.inputForm.status = '1'
|
|
@@ -1183,7 +1200,8 @@
|
|
// 获取发票金额,放到开票明细中第一条数据
|
|
// 获取发票金额,放到开票明细中第一条数据
|
|
getTotalAccount () {
|
|
getTotalAccount () {
|
|
if (!this.commonJS.isEmpty(this.inputForm.account)) {
|
|
if (!this.commonJS.isEmpty(this.inputForm.account)) {
|
|
- this.financeInvoiceDetailDTOList.push({account: this.inputForm.account})
|
|
|
|
|
|
+ this.financeInvoiceDetailDTOList.push({account: this.inputForm.actualPrice})
|
|
|
|
+ // this.financeInvoiceDetailDTOList.push({account: this.inputForm.account})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
async updateStatusById (type, callback) {
|
|
async updateStatusById (type, callback) {
|
|
@@ -1239,7 +1257,57 @@
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ footerMethod2 ({ columns, data }) {
|
|
|
|
+ const footerData = [
|
|
|
|
+ columns.map((column, columnIndex) => {
|
|
|
|
+ if (columnIndex === 0) {
|
|
|
|
+ return '发票金额汇总(元)'
|
|
|
|
+ }
|
|
|
|
+ if (['account'].includes(column.property)) {
|
|
|
|
+ // eslint-disable-next-line no-undef
|
|
|
|
+ this.inputForm.actualPrice = XEUtils.sum(data, column.property)
|
|
|
|
+ return XEUtils.sum(data, column.property)
|
|
|
|
+ }
|
|
|
|
+ if (['actualPrice'].includes(column.property)) {
|
|
|
|
+ // eslint-disable-next-line no-undef
|
|
|
|
+ this.inputForm.actualPrice = XEUtils.sum(data, column.property)
|
|
|
|
+ return XEUtils.sum(data, column.property)
|
|
|
|
+ }
|
|
|
|
+ return null
|
|
|
|
+ })
|
|
|
|
+ ]
|
|
|
|
+ console.log('actualPrice', this.inputForm.actualPrice)
|
|
|
|
+ return footerData
|
|
|
|
+ },
|
|
|
|
+ twoDecimalPlaces (num) {
|
|
|
|
+ let str = num.toString()
|
|
|
|
+ var len1 = str.substr(0, 1)
|
|
|
|
+ var len2 = str.substr(1, 1)
|
|
|
|
+ // eslint-disable-next-line eqeqeq
|
|
|
|
+ if (str.length > 1 && len1 == 0 && len2 != '.') {
|
|
|
|
+ str = str.substr(1, 1)
|
|
}
|
|
}
|
|
|
|
+ // eslint-disable-next-line eqeqeq
|
|
|
|
+ if (len1 == '.') {
|
|
|
|
+ str = ''
|
|
|
|
+ }
|
|
|
|
+ // eslint-disable-next-line eqeqeq
|
|
|
|
+ if (str.indexOf('.') != -1) {
|
|
|
|
+ var str_ = str.substr(str.indexOf('.') + 1)
|
|
|
|
+ // eslint-disable-next-line eqeqeq
|
|
|
|
+ if (str_.indexOf('.') != -1) {
|
|
|
|
+ str = str.substr(0, str.indexOf('.') + str_.indexOf('.') + 1)
|
|
|
|
+ }
|
|
|
|
+ if (str_.length > 2) {
|
|
|
|
+ this.$message.warning(`金额小数点后只能输入两位,请正确输入!`)
|
|
|
|
+ return (str = '')
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // eslint-disable-next-line no-useless-escape
|
|
|
|
+ str = str.replace(/[^\d^\.]+/g, '') // 保留数字和小数点
|
|
|
|
+ return str
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|