|
@@ -291,20 +291,52 @@
|
|
|
:rules="[
|
|
|
{required: true, message:'发票金额不能为空', trigger:'blur'}
|
|
|
]">
|
|
|
- <el-input-number
|
|
|
- v-model="inputForm.account"
|
|
|
- controls-position="right"
|
|
|
- style="width:100%"
|
|
|
- :precision="2"
|
|
|
- :max="9999999999"
|
|
|
- :step="0.01"
|
|
|
- :min="0"
|
|
|
+<!-- <el-input-number-->
|
|
|
+<!-- v-model="inputForm.account"-->
|
|
|
+<!-- controls-position="right"-->
|
|
|
+<!-- style="width:100%"-->
|
|
|
+<!-- :precision="2"-->
|
|
|
+<!-- :max="9999999999"-->
|
|
|
+<!-- :step="0.01"-->
|
|
|
+<!-- placeholder="请填写发票金额"-->
|
|
|
+<!-- :controls="false"-->
|
|
|
+<!-- clearable>-->
|
|
|
+<!-- </el-input-number>-->
|
|
|
+ <el-input
|
|
|
+ @input="fixedAccount"
|
|
|
placeholder="请填写发票金额"
|
|
|
- :controls="false"
|
|
|
- clearable>
|
|
|
- </el-input-number>
|
|
|
+ maxlength="15"
|
|
|
+ v-model="inputForm.account"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
</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" v-if="(this.commonJS.isNotEmpty(this.bj1)) && status === 'audit'">
|
|
|
<el-form-item label="项目类别" prop="reportType"
|
|
|
:rules="[]"
|
|
@@ -746,7 +778,9 @@
|
|
|
<ContractForm ref="contractForm" @getContract="getContract"></ContractForm>
|
|
|
<WorkClientForm ref="workClientForm" @getWorkClientRadioChoose="getWorkClient"></WorkClientForm>
|
|
|
<WorkClientBillingChooseRadio ref="billingChoose" @getBilling="getBilling"></WorkClientBillingChooseRadio>
|
|
|
- <!-- 邮箱弹窗-->
|
|
|
+ <WorkInvoiceForm ref="workInvoiceForm" @getWorkInvoiceRadioChoose="getWorkInvoice"></WorkInvoiceForm>
|
|
|
+
|
|
|
+ <!-- 邮箱弹窗-->
|
|
|
<el-dialog v-model="dialogFormVisible" style="width: 50%" title="邮箱修改">
|
|
|
<el-form :model="form" label-width="160px">
|
|
|
<el-row :gutter="15">
|
|
@@ -795,6 +829,8 @@
|
|
|
import WorkClientBillingChooseRadio from '@/views/cw/workClientInfo/WorkClientBillingChooseRadio'
|
|
|
import XEUtils from 'xe-utils'
|
|
|
import userService from "../../../api/sys/userService";
|
|
|
+ import WorkInvoiceForm from './WorkInvoiceChooseRadio'
|
|
|
+
|
|
|
export default {
|
|
|
props: {
|
|
|
businessId: {
|
|
@@ -868,7 +904,11 @@
|
|
|
billingId: '',
|
|
|
reportType: '',
|
|
|
tenantId: '',
|
|
|
- actualDrawerEmailAddress: ''
|
|
|
+ actualDrawerEmailAddress: '',
|
|
|
+ redInvoiceFlag: '', //是否红字发票
|
|
|
+ redInvoiceRelevancyNumber: '', //红字发票编号
|
|
|
+ invoiceNumberStr: '', //红字发票号
|
|
|
+ redInvoiceRelevancyId: '', //红字发票id
|
|
|
},
|
|
|
programRow: '',
|
|
|
bankList: [],
|
|
@@ -894,6 +934,7 @@
|
|
|
ProgramPageForm,
|
|
|
ContractForm,
|
|
|
WorkClientForm,
|
|
|
+ WorkInvoiceForm,
|
|
|
SelectUserTree,
|
|
|
SelectTree,
|
|
|
UpLoadComponent,
|
|
@@ -986,7 +1027,11 @@
|
|
|
billingId: '',
|
|
|
reportType: '',
|
|
|
tenantId: '',
|
|
|
- actualDrawerEmailAddress: ''
|
|
|
+ actualDrawerEmailAddress: '',
|
|
|
+ redInvoiceFlag: '',
|
|
|
+ redInvoiceRelevancyNumber: '', //红字发票编号
|
|
|
+ invoiceNumberStr: '', //红字发票号
|
|
|
+ redInvoiceRelevancyId: '', //红字发票id
|
|
|
};
|
|
|
|
|
|
this.inputForm.id = id;
|
|
@@ -1013,6 +1058,7 @@
|
|
|
this.$refs.uploadComponent.clearUpload();
|
|
|
this.inputForm = this.recover(this.inputForm, invoiceData);
|
|
|
|
|
|
+ console.log('this.inputForm',this.inputForm)
|
|
|
if (this.commonJS.isEmpty(this.inputForm.actualDrawerEmailAddress)) {
|
|
|
this.inputForm.actualDrawerEmailAddress = this.userEmail;
|
|
|
}
|
|
@@ -1057,7 +1103,11 @@
|
|
|
if (this.commonJS.isEmpty(this.inputForm.isMultiple) && this.status !== 'taskFormDetail') {
|
|
|
this.inputForm.isMultiple = '0';
|
|
|
}
|
|
|
-
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.redInvoiceFlag)) {
|
|
|
+ this.inputForm.redInvoiceFlag = '0'
|
|
|
+ }else {
|
|
|
+ this.inputForm.redInvoiceFlag = String(this.inputForm.redInvoiceFlag)
|
|
|
+ }
|
|
|
if (this.status === 'audit' || this.status === 'taskFormDetail') {
|
|
|
method = 'view';
|
|
|
if (this.status === 'audit') {
|
|
@@ -1197,7 +1247,17 @@
|
|
|
throw new Error()
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ //判断是否是红字发票
|
|
|
+ if (this.inputForm.account > 0 && this.inputForm.redInvoiceFlag == '1'){
|
|
|
+ this.loading = false
|
|
|
+ this.$message.error("发票金额为正数,不可为红字发票,请将是否红字发票请选择否")
|
|
|
+ throw new Error()
|
|
|
+ }
|
|
|
+ if (this.inputForm.account < 0 && this.inputForm.redInvoiceFlag == '0'){
|
|
|
+ this.loading = false
|
|
|
+ this.$message.error("发票金额为负数,请将是否红字发票请选择是,并选择关联的发票信息")
|
|
|
+ throw new Error()
|
|
|
+ }
|
|
|
if (this.commonJS.isNotEmpty(this.inputForm.financeInvoiceBaseDTOList)) {
|
|
|
let i = this.inputForm.financeInvoiceBaseDTOList.length
|
|
|
for (let j = 0; j < i; j++) {
|
|
@@ -1753,7 +1813,13 @@
|
|
|
}
|
|
|
if (['account'].includes(column.property)) {
|
|
|
// eslint-disable-next-line no-undef
|
|
|
- this.inputForm.accountTotal = XEUtils.sum(data, column.property)
|
|
|
+ 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)) {
|
|
@@ -1794,7 +1860,40 @@
|
|
|
throw new Error("请输入正确的邮箱地址")
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ openWorkInvoiceForm() {
|
|
|
+ this.$refs.workInvoiceForm.init()
|
|
|
+ },
|
|
|
+ getWorkInvoice(row) {
|
|
|
+ console.log("getWorkInvoice",row)
|
|
|
+ this.inputForm.redInvoiceRelevancyNumber = row.no
|
|
|
+ this.inputForm.invoiceNumberStr = row.number
|
|
|
+ this.inputForm.redInvoiceRelevancyId = row.id
|
|
|
+ this.$forceUpdate()
|
|
|
+ },
|
|
|
+ // 格式化 发票金额 保留两位小数
|
|
|
+ fixedAccount () {
|
|
|
+ if (isNaN(this.inputForm.account) && !/^-$/.test(this.inputForm.account)) {
|
|
|
+ this.inputForm.account = ''
|
|
|
+ }
|
|
|
+ if (!/^[+-]?\d*\.{0,1}\d{0,1}$/.test(this.inputForm.account)) {
|
|
|
+ this.inputForm.account = this.inputForm.account.replace(/\.\d{2,}$/, this.inputForm.account.substr(this.inputForm.account.indexOf('.'), 3))
|
|
|
+ }
|
|
|
+ // 禁止录入整数部分两位以上,但首位为0
|
|
|
+ var regStrs = [
|
|
|
+ ['^(\\-)?0(\\d+)$', '$1']
|
|
|
+ ]
|
|
|
+ for (var i = 0; i < regStrs.length; i++) {
|
|
|
+ var reg = new RegExp(regStrs[i][0])
|
|
|
+ var result = this.inputForm.account.replace(reg, regStrs[i][1])
|
|
|
+ this.inputForm.account = result
|
|
|
+ }
|
|
|
+ if(this.inputForm.account<0){
|
|
|
+ this.inputForm.redInvoiceFlag = "1"
|
|
|
+ }else{
|
|
|
+ this.inputForm.redInvoiceFlag = "0"
|
|
|
+ }
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|