|
@@ -263,6 +263,12 @@
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
+ },
|
|
|
+ 'loading': {
|
|
|
+ handler (newVal) {
|
|
|
+ this.$emit('changeLoading', newVal)
|
|
|
+ this.$refs.uploadComponent.changeLoading(newVal)
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -431,15 +437,34 @@
|
|
|
}
|
|
|
},
|
|
|
reapplyForm (callback) {
|
|
|
+ this.loading = true
|
|
|
this.collectService.findById(this.inputForm.id).then(({data}) => {
|
|
|
if (data.status !== '4') { // 审核状态不是“驳回”,就弹出提示
|
|
|
+ this.loading = false
|
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
} else {
|
|
|
- this.startForm(callback)
|
|
|
+ this.startFormTrue(callback)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ startForm (callback) {
|
|
|
+ this.loading = true
|
|
|
+ if (this.commonJS.isNotEmpty(this.inputForm.id)) {
|
|
|
+ this.collectService.findById(this.inputForm.id).then(({data}) => {
|
|
|
+ // 审核状态不是“未发起”或“暂存”或“撤回”,就弹出提示
|
|
|
+ if (this.commonJS.isNotEmpty(data.status) && data.status !== '0' && data.status !== '1' && data.status !== '3') {
|
|
|
+ this.loading = false
|
|
|
+ this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ } else {
|
|
|
+ this.startFormTrue(callback)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.startFormTrue(callback)
|
|
|
+ }
|
|
|
+ },
|
|
|
// 暂存
|
|
|
async saveForm (callback) {
|
|
|
this.loading = true
|
|
@@ -462,7 +487,8 @@
|
|
|
})
|
|
|
},
|
|
|
// 送审
|
|
|
- async startForm (callback) {
|
|
|
+ async startFormTrue (callback) {
|
|
|
+ this.loading = true
|
|
|
this.$refs['inputForm'].validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
this.loading = true
|
|
@@ -506,6 +532,7 @@
|
|
|
this.inputForm.files = this.$refs.uploadComponent.getDataList()
|
|
|
this.inputForm.status = '2'
|
|
|
this.collectService.save(this.inputForm).then(({data}) => {
|
|
|
+ this.inputForm.id = data.businessId
|
|
|
callback(data.businessTable, data.businessId, this.inputForm)
|
|
|
this.$refs.inputForm.resetFields()
|
|
|
this.loading = false
|
|
@@ -513,11 +540,14 @@
|
|
|
this.$refs.inputForm.resetFields()
|
|
|
this.loading = false
|
|
|
})
|
|
|
+ } else {
|
|
|
+ this.loading = false
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
// 通过
|
|
|
async agreeForm (callback) {
|
|
|
+ this.loading = true
|
|
|
this.$refs['inputForm'].validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
this.loading = true
|
|
@@ -541,11 +571,14 @@
|
|
|
}).catch(() => {
|
|
|
this.loading = false
|
|
|
})
|
|
|
+ } else {
|
|
|
+ this.loading = false
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
// 修改状态
|
|
|
async updateStatusById (type, callback) {
|
|
|
+ this.loading = true
|
|
|
if (await this.$refs.uploadComponent.checkProgress()) {
|
|
|
this.loading = false
|
|
|
throw new Error()
|
|
@@ -553,6 +586,7 @@
|
|
|
if (type === 'reject' || type === 'reback') {
|
|
|
this.collectService.findById(this.inputForm.id).then(({data}) => {
|
|
|
if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
|
|
|
+ this.loading = false
|
|
|
this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
throw new Error()
|
|
|
} else {
|
|
@@ -567,6 +601,7 @@
|
|
|
if (type === 'reject' || type === 'reback') {
|
|
|
let param = {status: this.inputForm.status, id: this.inputForm.id}
|
|
|
this.collectService.updateStatusById(param).then(() => {
|
|
|
+ this.loading = false
|
|
|
callback()
|
|
|
})
|
|
|
}
|
|
@@ -575,12 +610,14 @@
|
|
|
} else if (type === 'hold') {
|
|
|
this.collectService.findById(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.collectService.updateStatusById(param).then(() => {
|
|
|
+ this.loading = false
|
|
|
callback()
|
|
|
})
|
|
|
}
|