Explorar o código

财务-作废归档修改

wangqiang %!s(int64=2) %!d(string=hai) anos
pai
achega
6c81142862

+ 1 - 1
src/views/modules/cw/reportCancellApplyArchived/ReportCancellApplyArchivedList.vue

@@ -536,7 +536,7 @@
       },
       updateStatusById (row, type) {
         if (type === 'rebackFiledPaper') {
-          row.status = '3'
+          row.applyFileType = '3'
           this.reportCancellApplyArchivedService.updateStatusById(row)
         }
       }

+ 59 - 46
src/views/modules/cw/reportCancellApplyArchived/ReportCancellApplyArchivedTaskForm.vue

@@ -310,7 +310,7 @@
           archiveId: '',  // 报告作废id
           procInsId: '',
           processDefinitionId: '',
-          status: '',
+          applyFileType: '',
           workAttachmentDtoList: [],
           // cwProjectReportArchiveReportDTOList: [],
           cwProjectRecordsDTO: {
@@ -326,7 +326,7 @@
             projectLeaderId: '',
             procInsId: '',
             processDefinitionId: '',
-            status: '',
+            applyFileType: '',
             contractId: ''
           },
           fileNumber: '',
@@ -415,7 +415,7 @@
           archiveId: '',  // 报告作废id
           procInsId: '',
           processDefinitionId: '',
-          status: '',
+          applyFileType: '',
           workAttachmentDtoList: [],
           // cwProjectReportArchiveReportDTOList: [],
           cwProjectRecordsDTO: {
@@ -431,7 +431,7 @@
             projectLeaderId: '',
             procInsId: '',
             processDefinitionId: '',
-            status: '',
+            applyFileType: '',
             contractId: ''
           },
           fileNumber: '',
@@ -450,10 +450,11 @@
           this.$refs.inputForm.resetFields()
           this.loading = true
           this.reportCancellApplyArchivedService.queryById(this.inputForm.id).then(({data}) => {
-            this.inputForm.id = id
+            // this.inputForm.id = id
             this.$refs.uploadComponent.clearUpload()
             this.inputForm = this.recover(this.inputForm, data)
             this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+            this.inputForm.id = id
             if (this.commonJS.isEmpty(this.inputForm.workAttachmentDtoList)) {
               this.inputForm.workAttachmentDtoList = []
             }
@@ -489,6 +490,7 @@
       },
       async agreeForm (callback) {
         await this.reportCancellApplyArchivedService.queryById(this.inputForm.id).then(({data}) => {
+          console.log('data', data)
           if (data.applyFileType !== '2') { // 审核状态不是“待审核”,就弹出提示
             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
             throw new Error()
@@ -501,16 +503,17 @@
       doSubmit (status, callback) {
         if (status === 'save') {
           // 暂存
-          this.inputForm.status = '1'
+          this.inputForm.applyFileType = '1'
           this.loading = true
           if (this.$refs.uploadComponent.checkProgress()) {
             this.loading = false
             return
           }
-          this.$refs.uploadComponent.getDataList().then((list) => {
-            // list为返回数据
-            this.inputForm.workAttachmentDtoList = list
-          })
+          this.inputForm.workAttachmentDtoList = this.$refs.uploadComponent.getDataList()
+          // this.$refs.uploadComponent.getDataList().then((list) => {
+          //   // 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}) => {
@@ -522,7 +525,7 @@
           return
         } else if (status === 'start') {
           // 送审  待审核
-          this.inputForm.status = '2'
+          this.inputForm.applyFileType = '2'
         }
         this.$refs['inputForm'].validate((valid) => {
           if (valid) {
@@ -538,7 +541,7 @@
                     // 审核同意
                     _this.inputForm.auditDate = _this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
                     // this.inputForm.agreeUserId = this.$store.state.user.id
-                    _this.inputForm.status = '5'
+                    _this.inputForm.applyFileType = '5'
                     if (_this.inputForm.isNumber !== _this.inputForm.number) {
                       _this.$message.error('“案卷号”与“确认案卷号”不一致,请重新填写')
                       _this.loading = false
@@ -576,54 +579,64 @@
           }
         })
       },
-      async updateStatusById (type) {
+      async updateStatusById (type, callback) {
         if (type === 'reject' || type === 'reback') {
           if (await this.$refs.uploadComponent.checkProgress()) {
             this.loading = false
             throw new Error()
           }
           await this.reportCancellApplyArchivedService.queryById(this.inputForm.id).then(({data}) => {
+            console.log('data', data)
             if (data.applyFileType !== '2') { // status的值不等于“审核中”就弹出提示
               this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
               throw new Error()
             } else {
               if (type === 'reject') {
-                if (this.inputForm.isNumber !== this.inputForm.number) {
-                  this.$message.error('“案卷号”与“确认案卷号”不一致,请重新填写')
-                  this.loading = false
-                  throw new Error('“案卷号”与“确认案卷号”不一致,请重新填写')
-                } else {
-                  // 驳回
-                  let _this = this
-                  const wait = function () {
-                    return new Promise(function (resolve, reject) {
-                      _this.inputForm.status = '4'
-                      _this.loading = true
-                      if (_this.$refs.uploadComponent.checkProgress()) {
-                        _this.loading = false
-                        reject(new Error())
-                      }
-                      _this.$refs.uploadComponent.getDataList().then((list) => {
-                        // list为返回数据
-                        _this.inputForm.workAttachmentDtoList = list
-                      })
-                      resolve()
-                    })
-                  }
-                  wait().then(() => {
-                    this.reportCancellApplyArchivedService.saveForm(this.inputForm).then(({data}) => {
-                      this.loading = false
-                    }).catch(() => {
-                      this.loading = false
-                    })
-                  }).catch(() => {
-                    this.loading = false
-                  })
-                }
+                // 驳回
+                this.inputForm.applyFileType = '4'
+                let param = {applyFileType: '4', id: this.inputForm.id}
+                this.reportCancellApplyArchivedService.updateStatusById(param).then(() => {
+                  callback()
+                })
+                // this.projectRecordsService.updateStatusById(param)
               }
+              // if (type === 'reject') {
+              //   if (this.inputForm.isNumber !== this.inputForm.number) {
+              //     this.$message.error('“案卷号”与“确认案卷号”不一致,请重新填写')
+              //     this.loading = false
+              //     throw new Error('“案卷号”与“确认案卷号”不一致,请重新填写')
+              //   } else {
+              //     // 驳回
+              //     let _this = this
+              //     const wait = function () {
+              //       return new Promise(function (resolve, reject) {
+              //         _this.inputForm.applyFileType = '4'
+              //         _this.loading = true
+              //         if (_this.$refs.uploadComponent.checkProgress()) {
+              //           _this.loading = false
+              //           reject(new Error())
+              //         }
+              //         _this.$refs.uploadComponent.getDataList().then((list) => {
+              //           // list为返回数据
+              //           _this.inputForm.workAttachmentDtoList = list
+              //         })
+              //         resolve()
+              //       })
+              //     }
+              //     wait().then(() => {
+              //       this.reportCancellApplyArchivedService.saveForm(this.inputForm).then(({data}) => {
+              //         this.loading = false
+              //       }).catch(() => {
+              //         this.loading = false
+              //       })
+              //     }).catch(() => {
+              //       this.loading = false
+              //     })
+              //   }
+              // }
               if (type === 'reback') {
                 // 撤回
-                let param = {status: '3', id: this.inputForm.id}
+                let param = {applyFileType: '3', id: this.inputForm.id}
                 this.projectReportArchiveService.updateStatusById(param)
               }
             }