|
@@ -384,6 +384,12 @@
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
+ },
|
|
|
+ 'loading': {
|
|
|
+ handler (newVal) {
|
|
|
+ this.$emit('changeLoading', newVal)
|
|
|
+ this.$refs.uploadComponent.changeLoading(newVal)
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
@@ -497,12 +503,22 @@
|
|
|
this.doSubmit('save', callback)
|
|
|
},
|
|
|
startForm (callback) {
|
|
|
- this.doSubmit('start', callback)
|
|
|
+ this.loading = true
|
|
|
+ this.reportCancellApplyArchivedService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
+ if (this.commonJS.isNotEmpty(data.applyFileType) && data.applyFileType !== '0' && data.applyFileType !== '1' && data.applyFileType !== '3') { // 审核状态不是“未发起”或“暂存”或“撤回”,就弹出提示
|
|
|
+ this.loading = false
|
|
|
+ this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ } else {
|
|
|
+ this.doSubmit('start', callback)
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
async agreeForm (callback) {
|
|
|
+ this.loading = true
|
|
|
await this.reportCancellApplyArchivedService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
- console.log('data', data)
|
|
|
if (data.applyFileType !== '2') { // 审核状态不是“待审核”,就弹出提示
|
|
|
+ this.loading = false
|
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
throw new Error()
|
|
|
} else {
|
|
@@ -511,8 +527,10 @@
|
|
|
})
|
|
|
},
|
|
|
reapplyForm (callback) {
|
|
|
+ this.loading = true
|
|
|
this.reportCancellApplyArchivedService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
if (data.applyFileType !== '4') { // 审核状态不是“驳回”,就弹出提示
|
|
|
+ this.loading = false
|
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
} else {
|
|
@@ -535,7 +553,6 @@
|
|
|
// // list为返回数据
|
|
|
// this.inputForm.workAttachmentDtoList = list
|
|
|
// })
|
|
|
- console.log('this.inputForm', this.inputForm)
|
|
|
this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
|
|
this.reportCancellApplyArchivedService.saveForm(this.inputForm).then(({data}) => {
|
|
|
callback(data.businessTable, data.businessId, this.inputForm)
|
|
@@ -599,18 +616,21 @@
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
+ } else {
|
|
|
+ this.loading = false
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
async updateStatusById (type, callback) {
|
|
|
+ this.loading = true
|
|
|
if (await this.$refs.uploadComponent.checkProgress()) {
|
|
|
this.loading = false
|
|
|
throw new Error()
|
|
|
} else {
|
|
|
if (type === 'reject' || type === 'reback') {
|
|
|
this.reportCancellApplyArchivedService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
- console.log('data', data)
|
|
|
if (data.applyFileType !== '2') { // status的值不等于“审核中”就弹出提示
|
|
|
+ this.loading = false
|
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
throw new Error()
|
|
|
} else {
|
|
@@ -619,6 +639,7 @@
|
|
|
this.inputForm.applyFileType = '4'
|
|
|
let param = {applyFileType: '4', id: this.inputForm.id}
|
|
|
this.reportCancellApplyArchivedService.updateStatusById(param).then(() => {
|
|
|
+ this.loading = false
|
|
|
callback()
|
|
|
})
|
|
|
// this.projectRecordsService.updateStatusById(param)
|
|
@@ -667,12 +688,14 @@
|
|
|
} else if (type === 'hold') {
|
|
|
this.reportCancellApplyArchivedService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
if (data.applyFileType !== '4') { // status的值不等于“驳回”就弹出提示
|
|
|
+ this.loading = false
|
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
throw new Error()
|
|
|
} else {
|
|
|
// 终止
|
|
|
let param = {applyFileType: '1', id: this.inputForm.id}
|
|
|
this.reportCancellApplyArchivedService.updateStatusById(param).then(() => {
|
|
|
+ this.loading = false
|
|
|
callback()
|
|
|
})
|
|
|
}
|