|
|
@@ -324,7 +324,7 @@
|
|
|
{{ item.label }}</el-radio>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12" v-if="inputForm.redInvoiceFlag === '1' && inputForm.relatedInvoice === '1'">
|
|
|
+ <el-col :span="12" v-if="inputForm.redInvoiceFlag === '1'">
|
|
|
<el-form-item label="红冲原因" prop="redFlushReason" :rules="[
|
|
|
{ required: true, message: '红冲原因不能为空', trigger: 'blur' }
|
|
|
]">
|
|
|
@@ -394,13 +394,13 @@
|
|
|
</el-radio>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="24">
|
|
|
+ <!-- <el-col :span="24">
|
|
|
<el-form-item label="开票内容要求" prop="billingContentTerms" :rules="[
|
|
|
]">
|
|
|
<el-input type="textarea" maxlength="500" v-model="inputForm.billingContentTerms"
|
|
|
placeholder="开票内容要求" show-word-limit></el-input>
|
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
+ </el-col> -->
|
|
|
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="开票人" prop="billingPeople" :rules="[
|
|
|
@@ -583,13 +583,21 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="备注" prop="remarks" :rules="[
|
|
|
- ]">
|
|
|
- <el-input maxlength="500" type="textarea" placeholder="请填写备注" v-model="inputForm.remarks"
|
|
|
- show-word-limit></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
+
|
|
|
+ <el-form :disabled="status === 'taskFormDetail' || isDisabled" style="width: 100%" :model="inputForm"
|
|
|
+ v-loading="loading" :class="method === 'view' ? 'readonly' : ''" label-width="160px"
|
|
|
+ @submit.native.prevent>
|
|
|
+ <el-row :gutter="15">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="备注" prop="remarks" :rules="[
|
|
|
+ ]">
|
|
|
+ <el-input maxlength="500" type="textarea" placeholder="请填写备注"
|
|
|
+ v-model="inputForm.remarks" show-word-limit></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
@@ -761,6 +769,7 @@
|
|
|
</div>
|
|
|
</el-form>
|
|
|
<!-- 附件-->
|
|
|
+ <UpLoadComponent ref="invoiceComponent"></UpLoadComponent>
|
|
|
<UpLoadComponent ref="uploadComponent"></UpLoadComponent>
|
|
|
<UpLoadComponentSignContract ref="uploadComponentSignContract"></UpLoadComponentSignContract>
|
|
|
|
|
|
@@ -893,6 +902,7 @@ export default {
|
|
|
status: '',
|
|
|
procInsId: '',
|
|
|
processDefinitionId: '',
|
|
|
+ invoiceList: [],
|
|
|
workAttachmentDtoList: [],
|
|
|
workAttachmenSignContract: [],
|
|
|
financeInvoiceDetailDTOList: [],
|
|
|
@@ -977,6 +987,7 @@ export default {
|
|
|
handler(newVal) {
|
|
|
this.$emit('changeLoading', newVal)
|
|
|
this.$refs.uploadComponent.changeLoading(newVal)
|
|
|
+ this.$refs.invoiceComponent.changeLoading(newVal)
|
|
|
this.$refs.uploadComponentSignContract.changeLoading(newVal)
|
|
|
}
|
|
|
}
|
|
|
@@ -1028,6 +1039,7 @@ export default {
|
|
|
status: '',
|
|
|
procInsId: '',
|
|
|
processDefinitionId: '',
|
|
|
+ invoiceList: [],
|
|
|
workAttachmentDtoList: [],
|
|
|
workAttachmenSignContract: [],
|
|
|
financeInvoiceDetailDTOList: [],
|
|
|
@@ -1077,6 +1089,7 @@ export default {
|
|
|
this.$refs.inputForm.resetFields()
|
|
|
this.loading = true
|
|
|
financeInvoiceService.queryById(this.inputForm.id).then((data) => {
|
|
|
+ this.$refs.invoiceComponent.clearUpload()
|
|
|
this.$refs.uploadComponent.clearUpload()
|
|
|
this.$refs.uploadComponentSignContract.clearUpload()
|
|
|
this.inputForm = this.recover(this.inputForm, data)
|
|
|
@@ -1150,6 +1163,10 @@ export default {
|
|
|
if (this.commonJS.isEmpty(this.inputForm.workAttachmentDtoList) || this.inputForm.workAttachmentDtoList.length === 0) {
|
|
|
this.inputForm.workAttachmentDtoList = []
|
|
|
}
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.invoiceList) || this.inputForm.invoiceList.length === 0) {
|
|
|
+ this.inputForm.invoiceList = []
|
|
|
+ }
|
|
|
+
|
|
|
if (this.commonJS.isEmpty(this.inputForm.workAttachmenSignContract) || this.inputForm.workAttachmenSignContract.length === 0) {
|
|
|
this.inputForm.workAttachmenSignContract = []
|
|
|
}
|
|
|
@@ -1201,6 +1218,10 @@ export default {
|
|
|
allAmount: ''
|
|
|
})
|
|
|
}
|
|
|
+ if (redInvoice == "1") {
|
|
|
+ this.inputForm.invoiceList = []
|
|
|
+ }
|
|
|
+ this.$refs.invoiceComponent.newUpload("view", this.inputForm.invoiceList, 'CW_OMS_invoice_file', null, "发票文件")
|
|
|
this.$refs.uploadComponent.newUpload(method, this.inputForm.workAttachmentDtoList, 'invoice')
|
|
|
this.$refs.uploadComponentSignContract.newUpload(method, this.inputForm.workAttachmenSignContract, 'signContract')
|
|
|
|
|
|
@@ -1319,6 +1340,7 @@ export default {
|
|
|
},
|
|
|
// 表单提交
|
|
|
async doSubmit(status, callback) {
|
|
|
+
|
|
|
this.loading = true
|
|
|
if (await this.$refs.uploadComponent.checkProgress()) {
|
|
|
this.loading = false
|
|
|
@@ -1421,54 +1443,56 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
if (this.inputForm.status === '5') {
|
|
|
- let acc = 0
|
|
|
- this.inputForm.financeInvoiceDetailDTOList.forEach((item, index) => {
|
|
|
- if (this.commonJS.isEmpty(item.number)) {
|
|
|
- this.loading = false
|
|
|
- this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 为空')
|
|
|
- throw new Error()
|
|
|
- }
|
|
|
- if (this.commonJS.isEmpty(item.account)) {
|
|
|
+ if (this.inputForm.redInvoiceFlag == 1 && this.inputForm.relatedInvoice == 0) {
|
|
|
+ let acc = 0
|
|
|
+ this.inputForm.financeInvoiceDetailDTOList.forEach((item, index) => {
|
|
|
+ if (this.commonJS.isEmpty(item.number)) {
|
|
|
+ this.loading = false
|
|
|
+ this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 为空')
|
|
|
+ throw new Error()
|
|
|
+ }
|
|
|
+ if (this.commonJS.isEmpty(item.account)) {
|
|
|
+ this.loading = false
|
|
|
+ this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “开票金额” 为空')
|
|
|
+ throw new Error()
|
|
|
+ }
|
|
|
+ acc = (acc + parseFloat(parseFloat(item.account).toFixed(2)))
|
|
|
+ })
|
|
|
+ if (parseFloat(acc).toFixed(2) !== parseFloat(this.inputForm.account).toFixed(2)) {
|
|
|
this.loading = false
|
|
|
- this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “开票金额” 为空')
|
|
|
+ this.$message.warning('发票明细中 “开票金额”总和 与发票详情中 “发票金额” 不等')
|
|
|
throw new Error()
|
|
|
}
|
|
|
- acc = (acc + parseFloat(parseFloat(item.account).toFixed(2)))
|
|
|
- })
|
|
|
- if (parseFloat(acc).toFixed(2) !== parseFloat(this.inputForm.account).toFixed(2)) {
|
|
|
- this.loading = false
|
|
|
- this.$message.warning('发票明细中 “开票金额”总和 与发票详情中 “发票金额” 不等')
|
|
|
- throw new Error()
|
|
|
- }
|
|
|
- this.inputForm.financeInvoiceDetailDTOList.forEach((item, index) => {
|
|
|
- this.inputForm.financeInvoiceDetailDTOList.forEach((item2, index2) => {
|
|
|
- if (index !== index2) {
|
|
|
- if (item.number === item2.number) {
|
|
|
+ this.inputForm.financeInvoiceDetailDTOList.forEach((item, index) => {
|
|
|
+ this.inputForm.financeInvoiceDetailDTOList.forEach((item2, index2) => {
|
|
|
+ if (index !== index2) {
|
|
|
+ if (item.number === item2.number) {
|
|
|
+ this.loading = false
|
|
|
+ this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 存在重复')
|
|
|
+ throw new Error()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ for await (let [index, item] of this.inputForm.financeInvoiceDetailDTOList.entries()) {
|
|
|
+ if (this.commonJS.isEmpty(item.number)) {
|
|
|
+ this.loading = false
|
|
|
+ this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 为空')
|
|
|
+ this.err = true
|
|
|
+ }
|
|
|
+ await financeInvoiceService.queryByNumber(item.number, item.id).then((data) => {
|
|
|
+ if (data === true) {
|
|
|
this.loading = false
|
|
|
this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 存在重复')
|
|
|
- throw new Error()
|
|
|
+ this.err = data
|
|
|
}
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- for await (let [index, item] of this.inputForm.financeInvoiceDetailDTOList.entries()) {
|
|
|
- if (this.commonJS.isEmpty(item.number)) {
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (this.err === true) {
|
|
|
this.loading = false
|
|
|
- this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 为空')
|
|
|
- this.err = true
|
|
|
+ this.err = ''
|
|
|
+ throw new Error()
|
|
|
}
|
|
|
- await financeInvoiceService.queryByNumber(item.number, item.id).then((data) => {
|
|
|
- if (data === true) {
|
|
|
- this.loading = false
|
|
|
- this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 存在重复')
|
|
|
- this.err = data
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- if (this.err === true) {
|
|
|
- this.loading = false
|
|
|
- this.err = ''
|
|
|
- throw new Error()
|
|
|
}
|
|
|
}
|
|
|
if (this.status === 'audit') {
|
|
|
@@ -1517,20 +1541,21 @@ export default {
|
|
|
this.inputForm.title = `${this.$store.state.user.name} 发起了 ${data.no} [财务-发票申请]`
|
|
|
}
|
|
|
}
|
|
|
- // 触发开票接口
|
|
|
- if (this.inputForm.status === '5') {
|
|
|
- // 区分红票,蓝票
|
|
|
- if (this.inputForm.redInvoiceFlag === '1') {
|
|
|
- let params = {
|
|
|
- allEinvno: this.inputForm.invoiceNumberStr,
|
|
|
- workInvoiceId: this.inputForm.id
|
|
|
- }
|
|
|
- financeInvoiceService.invoiceFastRedOMSView(params)
|
|
|
- }
|
|
|
- if (this.inputForm.redInvoiceFlag === '0') {
|
|
|
- financeInvoiceService.invoiceOMSView(this.inputForm.id)
|
|
|
- }
|
|
|
- }
|
|
|
+ // // 请求开票接口
|
|
|
+ // if (this.inputForm.status === '12') {
|
|
|
+ // // 区分红票,蓝票
|
|
|
+ // if (this.inputForm.redInvoiceFlag === '1') {
|
|
|
+ // let params = {
|
|
|
+ // originalInvno: this.inputForm.invoiceNumberStr,
|
|
|
+ // workInvoiceId: this.inputForm.id,
|
|
|
+ // redInvoiceRelevancyId: this.inputForm.redInvoiceRelevancyId
|
|
|
+ // }
|
|
|
+ // financeInvoiceService.invoiceAllScenarioRedOMSView(params)
|
|
|
+ // }
|
|
|
+ // if (this.inputForm.redInvoiceFlag === '0') {
|
|
|
+ // financeInvoiceService.invoiceOMSView(this.inputForm.id)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
this.inputForm.id = data.businessId
|
|
|
callback(data.businessTable, data.businessId, this.inputForm, data.recordType)
|
|
|
@@ -1580,6 +1605,7 @@ export default {
|
|
|
reconciliationArea: '',
|
|
|
remarks: '',
|
|
|
name: '',
|
|
|
+ invoiceList: [],
|
|
|
workAttachmentDtoList: [],
|
|
|
financeInvoiceDetailDTOList: [],
|
|
|
financeInvoiceReceivablesDTOList: [],
|
|
|
@@ -2109,6 +2135,7 @@ export default {
|
|
|
if (value === '0') {
|
|
|
this.inputForm.redInvoiceRelevancyNumber = ''
|
|
|
this.inputForm.invoiceNumberStr = ''
|
|
|
+ this.inputForm.redInvoiceRelevancyId = ''
|
|
|
} else {
|
|
|
this.inputForm.situationDetail = ''
|
|
|
}
|