|
@@ -21,6 +21,7 @@
|
|
|
<el-col :span="24">
|
|
|
<vxe-table
|
|
|
border
|
|
|
+ :footer-method="footerMethod2"
|
|
|
show-overflow
|
|
|
show-footer
|
|
|
ref="baseTable"
|
|
@@ -282,6 +283,32 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
+ <el-form-item label="是否红字发票" prop="redInvoiceFlag"
|
|
|
+ :rules="[
|
|
|
+ {required: true, message:'是否红字发票不能为空', trigger:'blur'}
|
|
|
+ ]">
|
|
|
+ <el-radio v-model="inputForm.redInvoiceFlag" v-for="item in $dictUtils.getDictList('yes_no')" :label="item.value" style="margin-right: 20px">
|
|
|
+ {{item.label}}</el-radio>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col v-if="inputForm.redInvoiceFlag === '1'" :span="12">
|
|
|
+ <el-form-item label="关联红字发票" prop="redInvoiceRelevancyNumber"
|
|
|
+ :rules="[
|
|
|
+ {required: true, message:'关联红字发票不能为空', trigger:'blur'},{required: true, message:'关联红字发票不能为空', trigger:'change'}
|
|
|
+ ]">
|
|
|
+ <el-input :readonly="true" placeholder="请关联红字发票" v-model="inputForm.redInvoiceRelevancyNumber" @focus="openWorkInvoiceForm()" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col v-if="inputForm.redInvoiceFlag === '1'" :span="12">
|
|
|
+ <el-form-item label="关联发票号" prop="invoiceNumberStr"
|
|
|
+ :rules="[
|
|
|
+ ]">
|
|
|
+ <el-input :disabled="true" placeholder="关联发票号" v-model="inputForm.invoiceNumberStr" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
<el-form-item label="报备类型" prop="reportType"
|
|
|
:rules="[]"
|
|
|
>
|
|
@@ -697,6 +724,7 @@
|
|
|
import WorkClientBillingChooseRadio from '@/views/cw/workClientInfo/WorkClientBillingChooseRadio'
|
|
|
import UserSelect1 from '@/views/utils/UserTreeSelect'
|
|
|
import UserSelect2 from '@/views/utils/UserTreeSelect'
|
|
|
+ import XEUtils from "xe-utils";
|
|
|
export default {
|
|
|
props: {
|
|
|
businessId: {
|
|
@@ -760,7 +788,11 @@
|
|
|
financeInvoiceInvalidDTO: {},
|
|
|
isMultiple: '',
|
|
|
billingId: '',
|
|
|
- reportType:''
|
|
|
+ reportType:'',
|
|
|
+ redInvoiceFlag: '0', //是否红字发票
|
|
|
+ redInvoiceRelevancyNumber: '', //红字发票编号
|
|
|
+ invoiceNumberStr: '', //红字发票号
|
|
|
+ redInvoiceRelevancyId: '', //红字发票id
|
|
|
},
|
|
|
programRow: '',
|
|
|
bankList: [],
|
|
@@ -874,7 +906,11 @@
|
|
|
remarks: ''
|
|
|
},
|
|
|
isMultiple: '',
|
|
|
- billingId: ''
|
|
|
+ billingId: '',
|
|
|
+ redInvoiceFlag: '0', //是否红字发票
|
|
|
+ redInvoiceRelevancyNumber: '', //红字发票编号
|
|
|
+ invoiceNumberStr: '', //红字发票号
|
|
|
+ redInvoiceRelevancyId: '', //红字发票id
|
|
|
}
|
|
|
if (method === 'add') {
|
|
|
this.title = `新建发票`
|
|
@@ -906,7 +942,9 @@
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.redInvoiceFlag)) {
|
|
|
+ this.inputForm.redInvoiceFlag = '0'
|
|
|
+ }
|
|
|
if (this.commonJS.isEmpty(this.inputForm.type)) {
|
|
|
this.inputForm.type = '1'
|
|
|
}
|
|
@@ -1650,6 +1688,34 @@
|
|
|
this.inputForm.reconciliationPeopleName=user[0].name
|
|
|
this.inputForm.reconciliationPeople=user[0].id
|
|
|
},
|
|
|
+ footerMethod2 ({ columns, data }) {
|
|
|
+ const footerData = [
|
|
|
+ columns.map((column, columnIndex) => {
|
|
|
+ if (columnIndex === 0) {
|
|
|
+ return '发票金额汇总(元)'
|
|
|
+ }
|
|
|
+ if (['account'].includes(column.property)) {
|
|
|
+ // eslint-disable-next-line no-undef
|
|
|
+ let sunAccount = XEUtils.sum(data, column.property)
|
|
|
+ this.inputForm.accountTotal = sunAccount
|
|
|
+ if(sunAccount<0){
|
|
|
+ this.inputForm.redInvoiceFlag = "1"
|
|
|
+ }else{
|
|
|
+ this.inputForm.redInvoiceFlag = "0"
|
|
|
+ }
|
|
|
+ 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
|
|
|
+ })
|
|
|
+ ]
|
|
|
+ console.log('accountTotal', this.inputForm.accountTotal)
|
|
|
+ return footerData
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|