|
@@ -723,6 +723,12 @@
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ 'loading': {
|
|
|
|
+ handler (newVal) {
|
|
|
|
+ this.$emit('changeLoading', newVal)
|
|
|
|
+ this.$refs.uploadComponent.changeLoading(newVal)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -840,11 +846,26 @@
|
|
this.doSubmit('save', callback)
|
|
this.doSubmit('save', callback)
|
|
},
|
|
},
|
|
startForm (callback) {
|
|
startForm (callback) {
|
|
- this.doSubmit('start', callback)
|
|
|
|
|
|
+ this.loading = true
|
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.id)) {
|
|
|
|
+ this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
|
+ if (data.status !== '0' && data.status !== '1' && data.status !== '3') { // 审核状态不是“未发起”或“暂存”或“撤回”,就弹出提示
|
|
|
|
+ this.loading = false
|
|
|
|
+ this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
|
+ throw new Error()
|
|
|
|
+ } else {
|
|
|
|
+ this.doSubmit('start', callback)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ this.doSubmit('start', callback)
|
|
|
|
+ }
|
|
},
|
|
},
|
|
async agreeForm (callback) {
|
|
async agreeForm (callback) {
|
|
|
|
+ this.loading = true
|
|
await this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
|
|
await this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
|
|
if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
|
|
if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
|
|
|
|
+ this.loading = false
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
throw new Error()
|
|
throw new Error()
|
|
} else {
|
|
} else {
|
|
@@ -853,8 +874,10 @@
|
|
})
|
|
})
|
|
},
|
|
},
|
|
reapplyForm (callback) {
|
|
reapplyForm (callback) {
|
|
|
|
+ this.loading = true
|
|
this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
|
|
this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
|
|
if (data.status !== '4') { // 审核状态不是“驳回”,就弹出提示
|
|
if (data.status !== '4') { // 审核状态不是“驳回”,就弹出提示
|
|
|
|
+ this.loading = false
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
} else {
|
|
} else {
|
|
@@ -864,6 +887,7 @@
|
|
},
|
|
},
|
|
// 表单提交
|
|
// 表单提交
|
|
async doSubmit (status, callback) {
|
|
async doSubmit (status, callback) {
|
|
|
|
+ this.loading = true
|
|
if (await this.$refs.uploadComponent.checkProgress()) {
|
|
if (await this.$refs.uploadComponent.checkProgress()) {
|
|
this.loading = false
|
|
this.loading = false
|
|
throw new Error()
|
|
throw new Error()
|
|
@@ -890,10 +914,12 @@
|
|
this.inputForm.status = '2'
|
|
this.inputForm.status = '2'
|
|
}
|
|
}
|
|
if (this.commonJS.isEmpty(this.inputForm.financeInvoiceBaseDTOList)) {
|
|
if (this.commonJS.isEmpty(this.inputForm.financeInvoiceBaseDTOList)) {
|
|
|
|
+ this.loading = false
|
|
this.$message.error('至少新增一条基本信息')
|
|
this.$message.error('至少新增一条基本信息')
|
|
throw new Error()
|
|
throw new Error()
|
|
} else {
|
|
} else {
|
|
if (this.inputForm.financeInvoiceBaseDTOList.length === 0) {
|
|
if (this.inputForm.financeInvoiceBaseDTOList.length === 0) {
|
|
|
|
+ this.loading = false
|
|
this.$message.error('至少新增一条基本信息')
|
|
this.$message.error('至少新增一条基本信息')
|
|
throw new Error()
|
|
throw new Error()
|
|
}
|
|
}
|
|
@@ -902,6 +928,7 @@
|
|
let i = this.inputForm.financeInvoiceBaseDTOList.length
|
|
let i = this.inputForm.financeInvoiceBaseDTOList.length
|
|
for (let j = 0; j < i; j++) {
|
|
for (let j = 0; j < i; j++) {
|
|
if (this.commonJS.isEmpty(this.inputForm.financeInvoiceBaseDTOList[j].programName)) {
|
|
if (this.commonJS.isEmpty(this.inputForm.financeInvoiceBaseDTOList[j].programName)) {
|
|
|
|
+ this.loading = false
|
|
this.$message.error('第' + (j + 1) + '行的基本信息不能为空')
|
|
this.$message.error('第' + (j + 1) + '行的基本信息不能为空')
|
|
throw new Error()
|
|
throw new Error()
|
|
}
|
|
}
|
|
@@ -911,16 +938,19 @@
|
|
let acc = 0
|
|
let acc = 0
|
|
this.inputForm.financeInvoiceDetailDTOList.forEach((item, index) => {
|
|
this.inputForm.financeInvoiceDetailDTOList.forEach((item, index) => {
|
|
if (this.commonJS.isEmpty(item.number)) {
|
|
if (this.commonJS.isEmpty(item.number)) {
|
|
|
|
+ this.loading = false
|
|
this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 为空')
|
|
this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 为空')
|
|
throw new Error()
|
|
throw new Error()
|
|
}
|
|
}
|
|
if (this.commonJS.isEmpty(item.account)) {
|
|
if (this.commonJS.isEmpty(item.account)) {
|
|
|
|
+ this.loading = false
|
|
this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “开票金额” 为空')
|
|
this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “开票金额” 为空')
|
|
throw new Error()
|
|
throw new Error()
|
|
}
|
|
}
|
|
acc = (acc + parseFloat(parseFloat(item.account).toFixed(2)))
|
|
acc = (acc + parseFloat(parseFloat(item.account).toFixed(2)))
|
|
})
|
|
})
|
|
if (acc !== this.inputForm.account) {
|
|
if (acc !== this.inputForm.account) {
|
|
|
|
+ this.loading = false
|
|
this.$message.warning('发票明细中 “开票金额”总和 与发票详情中 “发票金额” 不等')
|
|
this.$message.warning('发票明细中 “开票金额”总和 与发票详情中 “发票金额” 不等')
|
|
throw new Error()
|
|
throw new Error()
|
|
}
|
|
}
|
|
@@ -928,6 +958,7 @@
|
|
this.inputForm.financeInvoiceDetailDTOList.forEach((item2, index2) => {
|
|
this.inputForm.financeInvoiceDetailDTOList.forEach((item2, index2) => {
|
|
if (index !== index2) {
|
|
if (index !== index2) {
|
|
if (item.number === item2.number) {
|
|
if (item.number === item2.number) {
|
|
|
|
+ this.loading = false
|
|
this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 存在重复')
|
|
this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 存在重复')
|
|
throw new Error()
|
|
throw new Error()
|
|
}
|
|
}
|
|
@@ -936,17 +967,20 @@
|
|
})
|
|
})
|
|
for await (let [index, item] of this.inputForm.financeInvoiceDetailDTOList.entries()) {
|
|
for await (let [index, item] of this.inputForm.financeInvoiceDetailDTOList.entries()) {
|
|
if (this.commonJS.isEmpty(item.number)) {
|
|
if (this.commonJS.isEmpty(item.number)) {
|
|
|
|
+ this.loading = false
|
|
this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 为空')
|
|
this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 为空')
|
|
this.err = true
|
|
this.err = true
|
|
}
|
|
}
|
|
await this.financeInvoiceService.queryByNumber(item.number, item.id).then(({data}) => {
|
|
await this.financeInvoiceService.queryByNumber(item.number, item.id).then(({data}) => {
|
|
if (data === true) {
|
|
if (data === true) {
|
|
|
|
+ this.loading = false
|
|
this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 存在重复')
|
|
this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 存在重复')
|
|
this.err = data
|
|
this.err = data
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
if (this.err === true) {
|
|
if (this.err === true) {
|
|
|
|
+ this.loading = false
|
|
this.err = ''
|
|
this.err = ''
|
|
throw new Error()
|
|
throw new Error()
|
|
}
|
|
}
|
|
@@ -966,11 +1000,14 @@
|
|
if (status === 'start' || status === 'reapply') {
|
|
if (status === 'start' || status === 'reapply') {
|
|
this.inputForm.title = `${this.$store.state.user.name} 发起了 ${data.no} [财务-发票申请]`
|
|
this.inputForm.title = `${this.$store.state.user.name} 发起了 ${data.no} [财务-发票申请]`
|
|
}
|
|
}
|
|
|
|
+ this.inputForm.id = data.businessId
|
|
callback(data.businessTable, data.businessId, this.inputForm)
|
|
callback(data.businessTable, data.businessId, this.inputForm)
|
|
this.loading = false
|
|
this.loading = false
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
this.loading = false
|
|
this.loading = false
|
|
})
|
|
})
|
|
|
|
+ } else {
|
|
|
|
+ this.loading = false
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -1211,6 +1248,7 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
async updateStatusById (type, callback) {
|
|
async updateStatusById (type, callback) {
|
|
|
|
+ this.loading = true
|
|
if (await this.$refs.uploadComponent.checkProgress()) {
|
|
if (await this.$refs.uploadComponent.checkProgress()) {
|
|
this.loading = false
|
|
this.loading = false
|
|
throw new Error()
|
|
throw new Error()
|
|
@@ -1218,6 +1256,7 @@
|
|
if (type === 'reject' || type === 'reback') {
|
|
if (type === 'reject' || type === 'reback') {
|
|
this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
|
|
this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
|
|
if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
|
|
if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
|
|
|
|
+ this.loading = false
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
throw new Error()
|
|
throw new Error()
|
|
} else {
|
|
} else {
|
|
@@ -1236,6 +1275,7 @@
|
|
if (type === 'reject' || type === 'reback') {
|
|
if (type === 'reject' || type === 'reback') {
|
|
let param = {status: this.inputForm.status, id: this.inputForm.id}
|
|
let param = {status: this.inputForm.status, id: this.inputForm.id}
|
|
this.financeInvoiceService.updateStatusById(param).then(() => {
|
|
this.financeInvoiceService.updateStatusById(param).then(() => {
|
|
|
|
+ this.loading = false
|
|
callback()
|
|
callback()
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -1244,12 +1284,14 @@
|
|
} else if (type === 'hold') {
|
|
} else if (type === 'hold') {
|
|
this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
|
|
this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
|
|
if (data.status !== '4') { // status的值不等于“驳回”就弹出提示
|
|
if (data.status !== '4') { // status的值不等于“驳回”就弹出提示
|
|
|
|
+ this.loading = false
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
throw new Error()
|
|
throw new Error()
|
|
} else {
|
|
} else {
|
|
// 终止
|
|
// 终止
|
|
let param = {status: '1', id: this.inputForm.id}
|
|
let param = {status: '1', id: this.inputForm.id}
|
|
this.financeInvoiceService.updateStatusById(param).then(() => {
|
|
this.financeInvoiceService.updateStatusById(param).then(() => {
|
|
|
|
+ this.loading = false
|
|
callback()
|
|
callback()
|
|
})
|
|
})
|
|
}
|
|
}
|