|
@@ -536,6 +536,16 @@
|
|
|
startForm (callback) {
|
|
|
this.doSubmit('start', callback)
|
|
|
},
|
|
|
+ reapplyForm (callback) {
|
|
|
+ this.projectReportService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
+ if (data.status !== '4') { // 审核状态不是“驳回”,就弹出提示
|
|
|
+ this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ } else {
|
|
|
+ this.doSubmit('reapply', callback)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
async agreeForm (callback) {
|
|
|
await this.projectReportService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
// console.log('进来了看看data', data)
|
|
@@ -575,6 +585,8 @@
|
|
|
this.inputForm.agreeDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
|
|
this.inputForm.agreeUserId = this.$store.state.user.id
|
|
|
this.inputForm.status = '5'
|
|
|
+ } else if (status === 'reapply') {
|
|
|
+ this.inputForm.status = '2'
|
|
|
}
|
|
|
this.$refs['inputForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
@@ -615,51 +627,67 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- async updateStatusById (type) {
|
|
|
- if (type === 'reject' || type === 'reback') {
|
|
|
- // if (await this.$refs.uploadComponent.checkProgress()) {
|
|
|
- // this.loading = false
|
|
|
- // throw new Error()
|
|
|
- // }
|
|
|
- await this.projectReportService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
- if (data.status !== '2') { // status的值不等于“审核中”就弹出提示
|
|
|
- this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
- throw new Error()
|
|
|
- } else {
|
|
|
- if (type === 'reject') {
|
|
|
- // 驳回
|
|
|
- this.inputForm.status = '4'
|
|
|
- let param = {status: '4', id: this.inputForm.id}
|
|
|
- this.projectReportService.updateStatusById(param)
|
|
|
- // this.projectRecordsService.updateStatusById(param)
|
|
|
+ async updateStatusById (type, callback) {
|
|
|
+ if (await this.$refs.archiveFile.checkProgress()) {
|
|
|
+ this.loading = false
|
|
|
+ throw new Error()
|
|
|
+ } else {
|
|
|
+ if (type === 'reject' || type === 'reback') {
|
|
|
+ await this.projectReportService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
+ if (data.status !== '2') { // status的值不等于“审核中”就弹出提示
|
|
|
+ this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ throw new Error()
|
|
|
+ } else {
|
|
|
+ if (type === 'reject') {
|
|
|
+ // 驳回
|
|
|
+ this.inputForm.status = '4'
|
|
|
+ let param = {status: '4', id: this.inputForm.id}
|
|
|
+ this.projectReportService.updateStatusById(param).then(() => {
|
|
|
+ callback()
|
|
|
+ })
|
|
|
+ // this.projectRecordsService.updateStatusById(param)
|
|
|
+ }
|
|
|
+ if (type === 'reback') {
|
|
|
+ // 撤回
|
|
|
+ let param = {status: '3', id: this.inputForm.id}
|
|
|
+ // this.projectRecordsService.updateStatusById(param)
|
|
|
+ this.projectReportService.updateStatusById(param)
|
|
|
+ }
|
|
|
}
|
|
|
- if (type === 'reback') {
|
|
|
- // 撤回
|
|
|
- let param = {status: '3', id: this.inputForm.id}
|
|
|
- // this.projectRecordsService.updateStatusById(param)
|
|
|
- this.projectReportService.updateStatusById(param)
|
|
|
+ })
|
|
|
+ // await this.projectRecordsService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
+ // if (data.status !== '2') { // status的值不等于“审核中”就弹出提示
|
|
|
+ // this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ // throw new Error()
|
|
|
+ // } else {
|
|
|
+ // if (type === 'reject') {
|
|
|
+ // // 驳回
|
|
|
+ // this.inputForm.status = '4'
|
|
|
+ // let param = {status: '4', id: this.inputForm.id}
|
|
|
+ // this.projectRecordsService.updateStatusById(param)
|
|
|
+ // }
|
|
|
+ // if (type === 'reback') {
|
|
|
+ // // 撤回
|
|
|
+ // let param = {status: '3', id: this.inputForm.id}
|
|
|
+ // // this.projectRecordsService.updateStatusById(param)
|
|
|
+ // this.projectReportService.updateStatusById(param)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ } else if (type === 'hold') {
|
|
|
+ this.projectReportService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
+ if (data.status !== '4') { // status的值不等于“驳回”就弹出提示
|
|
|
+ this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
+ throw new Error()
|
|
|
+ } else {
|
|
|
+ // 终止
|
|
|
+ let param = {status: '1', id: this.inputForm.id}
|
|
|
+ this.projectReportService.updateStatusById(param).then(() => {
|
|
|
+ callback()
|
|
|
+ })
|
|
|
}
|
|
|
- }
|
|
|
- })
|
|
|
- // await this.projectRecordsService.queryById(this.inputForm.id).then(({data}) => {
|
|
|
- // if (data.status !== '2') { // status的值不等于“审核中”就弹出提示
|
|
|
- // this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
|
|
|
- // throw new Error()
|
|
|
- // } else {
|
|
|
- // if (type === 'reject') {
|
|
|
- // // 驳回
|
|
|
- // this.inputForm.status = '4'
|
|
|
- // let param = {status: '4', id: this.inputForm.id}
|
|
|
- // this.projectRecordsService.updateStatusById(param)
|
|
|
- // }
|
|
|
- // if (type === 'reback') {
|
|
|
- // // 撤回
|
|
|
- // let param = {status: '3', id: this.inputForm.id}
|
|
|
- // // this.projectRecordsService.updateStatusById(param)
|
|
|
- // this.projectReportService.updateStatusById(param)
|
|
|
- // }
|
|
|
- // }
|
|
|
- // })
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
close () {
|