|
@@ -164,6 +164,11 @@
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
+ },
|
|
|
+ 'loading': {
|
|
|
+ handler (newVal) {
|
|
|
+ this.$emit('changeLoading', newVal)
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
@@ -252,11 +257,22 @@
|
|
|
this.doSubmit('save', callback)
|
|
|
},
|
|
|
startForm (callback) {
|
|
|
- this.doSubmit('start', callback)
|
|
|
+ this.loading = true
|
|
|
+ this.reportCancellApplyService.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)
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
async agreeForm (callback) {
|
|
|
+ this.loading = true
|
|
|
await this.reportCancellApplyService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
if (data.status !== '2') { // 审核状态不是“待审核”,就弹出提示
|
|
|
+ this.loading = false
|
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
throw new Error()
|
|
|
} else {
|
|
@@ -274,8 +290,10 @@
|
|
|
// })
|
|
|
},
|
|
|
reapplyForm (callback) {
|
|
|
+ this.loading = true
|
|
|
this.reportCancellApplyService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
if (data.status !== '4') { // 审核状态不是“驳回”,就弹出提示
|
|
|
+ this.loading = false
|
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
} else {
|
|
@@ -339,13 +357,17 @@
|
|
|
// }).catch(() => {
|
|
|
// this.loading = false
|
|
|
// })
|
|
|
+ } else {
|
|
|
+ this.loading = false
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
async updateStatusById (type, callback) {
|
|
|
+ this.loading = true
|
|
|
if (type === 'reject' || type === 'reback') {
|
|
|
await this.reportCancellApplyService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
if (data.status !== '2') { // status的值不等于“审核中”就弹出提示
|
|
|
+ this.loading = false
|
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
throw new Error()
|
|
|
} else {
|
|
@@ -354,6 +376,7 @@
|
|
|
this.inputForm.status = '4'
|
|
|
let param = {status: '4', id: this.inputForm.id}
|
|
|
this.reportCancellApplyService.updateStatusById(param).then(() => {
|
|
|
+ this.loading = false
|
|
|
callback()
|
|
|
})
|
|
|
// this.projectRecordsService.updateStatusById(param)
|
|
@@ -363,6 +386,7 @@
|
|
|
let param = {status: '3', id: this.inputForm.id}
|
|
|
// this.projectRecordsService.updateStatusById(param)
|
|
|
this.reportCancellApplyService.updateStatusById(param).then(() => {
|
|
|
+ this.loading = false
|
|
|
callback()
|
|
|
})
|
|
|
}
|
|
@@ -391,12 +415,14 @@
|
|
|
} else if (type === 'hold') {
|
|
|
this.reportCancellApplyService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
if (data.status !== '4') { // status的值不等于“驳回”就弹出提示
|
|
|
+ this.loading = false
|
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
throw new Error()
|
|
|
} else {
|
|
|
// 终止
|
|
|
let param = {status: '1', id: this.inputForm.id}
|
|
|
this.reportCancellApplyService.updateStatusById(param).then(() => {
|
|
|
+ this.loading = false
|
|
|
callback()
|
|
|
})
|
|
|
}
|