|
@@ -1609,6 +1609,7 @@
|
|
|
// throw new Error("已填写数电发票信息,请上传对应发票的xml文件!")
|
|
|
// }
|
|
|
//判定附件中xml文件数量是否小于电子发票报销行数量
|
|
|
+ let flag1 = false
|
|
|
if (this.commonJS.isNotEmpty(this.inputForm.invoiceReimbursements) && "1" === this.inputForm.reimbursementType) {
|
|
|
//获取电子报销行数
|
|
|
let invoiceReimbursementCount = this.inputForm.invoiceReimbursements.length
|
|
@@ -1632,19 +1633,41 @@
|
|
|
throw new Error("已填写数电发票信息,请上传对应发票的xml文件!")
|
|
|
}
|
|
|
}
|
|
|
+ //数电发票信息不为空的时候在提交时需要再次判断看当前数电发票是否有存在其他发起或完成的报销
|
|
|
+ let numbers =[];
|
|
|
+ for (let i = 0; i < this.inputForm.invoiceReimbursements.length; i++) {
|
|
|
+ numbers.push(this.inputForm.invoiceReimbursements[i].number)
|
|
|
+ }
|
|
|
+ const decide = await this.reimbursementApprovalService.getEffectiveDataByNumbers(numbers.join(","),this.inputForm.id)
|
|
|
+ // .then((decide) => {
|
|
|
+ if (!decide.success) {
|
|
|
+ //进行提醒
|
|
|
+ this.$message.warning(decide.message)
|
|
|
+ flag1 = true
|
|
|
+ }
|
|
|
+ // })
|
|
|
+ if (flag1){
|
|
|
+ this.loading = false
|
|
|
+ return
|
|
|
+ // throw new Error("已填写数电发票信息,请上传对应发票的xml文件!")
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
- this.inputForm.type = '2'
|
|
|
- this.reimbursementApprovalService.save(this.inputForm).then((data) => {
|
|
|
- this.inputForm.title = `${this.$store.state.user.name} 发起了 [${data.no}] - ` + describe
|
|
|
- this.inputForm.formTitle = title
|
|
|
- this.inputForm.id = data.businessId
|
|
|
- callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
- this.$refs.inputForm.resetFields()
|
|
|
- this.loading = false
|
|
|
- }).catch(() => {
|
|
|
- this.$refs.inputForm.resetFields()
|
|
|
- this.loading = false
|
|
|
- })
|
|
|
+ if (!flag1){
|
|
|
+ this.inputForm.type = '2'
|
|
|
+ this.reimbursementApprovalService.save(this.inputForm).then((data) => {
|
|
|
+ this.inputForm.title = `${this.$store.state.user.name} 发起了 [${data.no}] - ` + describe
|
|
|
+ this.inputForm.formTitle = title
|
|
|
+ this.inputForm.id = data.businessId
|
|
|
+ callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
+ this.loading = false
|
|
|
+ }).catch(() => {
|
|
|
+ this.$refs.inputForm.resetFields()
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
// this.reimbursementService.save(this.inputForm).then((data) => {
|
|
|
// callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
// this.$refs.inputForm.resetFields()
|