|
@@ -361,6 +361,13 @@
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
+ },
|
|
|
+ 'loading': {
|
|
|
+ handler (newVal) {
|
|
|
+ console.log(newVal)
|
|
|
+ this.$emit('changeLoading', newVal)
|
|
|
+ this.$refs.uploadComponent.changeLoading(newVal)
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
@@ -467,10 +474,32 @@
|
|
|
})
|
|
|
},
|
|
|
saveForm (callback) {
|
|
|
- this.doSubmit('save', callback)
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.id)) {
|
|
|
+ this.projectReportArchiveService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
+ if (data.status !== '0' && data.status !== '1' && data.status !== '3') { // 审核状态不是“未发起”或“暂存”,就弹出提示
|
|
|
+ this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ throw new Error()
|
|
|
+ } else {
|
|
|
+ this.doSubmit('save', callback)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.doSubmit('save', callback)
|
|
|
+ }
|
|
|
},
|
|
|
startForm (callback) {
|
|
|
- this.doSubmit('start', callback)
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.id)) {
|
|
|
+ this.projectReportArchiveService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
+ if (data.status !== '0' && data.status !== '1' && data.status !== '3') { // 审核状态不是“未发起”或“暂存”或“撤回”,就弹出提示
|
|
|
+ this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ throw new Error()
|
|
|
+ } else {
|
|
|
+ this.doSubmit('start', callback)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.doSubmit('start', callback)
|
|
|
+ }
|
|
|
},
|
|
|
async agreeForm (callback) {
|
|
|
await this.projectReportArchiveService.queryById(this.inputForm.id).then(({data}) => {
|
|
@@ -508,6 +537,7 @@
|
|
|
})
|
|
|
this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
|
|
this.projectReportArchiveService.saveForm(this.inputForm).then(({data}) => {
|
|
|
+ this.inputForm.id = data.businessId
|
|
|
callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
this.loading = false
|
|
|
}).catch(() => {
|