Переглянути джерело

评估-发票流程修改

lizhenhao 2 роки тому
батько
коміт
c288b38893

+ 58 - 28
src/views/modules/finance/invoice/InvoiceFormTask.vue

@@ -1,10 +1,10 @@
 <template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
   <div>
-    <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="formReadOnly"
+    <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="status === 'audit' || status === 'taskFormDetail'"
              label-width="160px" @submit.native.prevent>
       <el-divider content-position="left"><i class="el-icon-document"></i>
         基本信息
-        <el-button style="margin-left: 20px" type="primary" :disabled="formReadOnly" size="mini" @click="insertEvent('base')"  plain>
+        <el-button style="margin-left: 20px" type="primary" :disabled="status === 'audit' || status === 'taskFormDetail'" size="mini" @click="insertEvent('base')"  plain>
           新增
         </el-button>
       </el-divider>
@@ -520,7 +520,7 @@
       <div v-if="false">
       <el-divider content-position="left"><i class="el-icon-document"></i>
         收款明细
-        <el-button style="margin-left: 20px" :disabled="formReadOnly" type="primary" size="mini" @click="insertEvent('receivables')" plain>
+        <el-button style="margin-left: 20px" :disabled="status === 'audit' || status === 'taskFormDetail'" type="primary" size="mini" @click="insertEvent('receivables')" plain>
           新增
         </el-button>
       </el-divider>
@@ -788,7 +788,7 @@
             if (this.commonJS.isEmpty(this.inputForm.financeInvoiceReceivablesDTOList) || this.inputForm.financeInvoiceReceivablesDTOList.length === 0) {
               this.inputForm.financeInvoiceReceivablesDTOList = []
             }
-            if (this.formReadOnly === true) {
+            if (this.status === 'audit' || this.status === 'taskFormDetail') {
               method = 'view'
             }
             if (!this.commonJS.isEmpty(this.status) && this.status === 'audit' && this.inputForm.financeInvoiceDetailDTOList.length === 0) {
@@ -823,6 +823,16 @@
           }
         })
       },
+      reapplyForm (callback) {
+        this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
+          if (data.status !== '4') { // 审核状态不是“驳回”,就弹出提示
+            this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+            throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+          } else {
+            this.doSubmit('reapply', callback)
+          }
+        })
+      },
       // 表单提交
       async doSubmit (status, callback) {
         if (await this.$refs.uploadComponent.checkProgress()) {
@@ -847,6 +857,8 @@
         } else if (status === 'agree') {
           // 审核同意
           this.inputForm.status = '5'
+        } else if (status === 'reapply') {
+          this.inputForm.status = '2'
         }
         if (this.commonJS.isEmpty(this.inputForm.financeInvoiceBaseDTOList)) {
           this.$message.error('至少新增一条基本信息')
@@ -1150,34 +1162,52 @@
           this.financeInvoiceDetailDTOList.push({account: this.inputForm.account})
         }
       },
-      async updateStatusById (type) {
+      async updateStatusById (type, callback) {
         if (await this.$refs.uploadComponent.checkProgress()) {
           this.loading = false
           throw new Error()
-        }
-        await this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
-          if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
-            this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
-            throw new Error()
-          } else {
-            // if (type === 'agree') {
-            //   // 同意
-            //   this.inputForm.status = '5'
-            // }
-            if (type === 'reject') {
-              // 驳回
-              this.inputForm.status = '4'
-            }
-            if (type === 'reback') {
-              // 撤回
-              this.inputForm.status = '3'
-            }
-            if (type === 'reject' || type === 'reback') {
-              let param = {status: this.inputForm.status, id: this.inputForm.id}
-              this.financeInvoiceService.updateStatusById(param)
-            }
+        } else {
+          if (type === 'reject' || type === 'reback') {
+            this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
+              if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+                this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+                throw new Error()
+              } else {
+                // if (type === 'agree') {
+                //   // 同意
+                //   this.inputForm.status = '5'
+                // }
+                if (type === 'reject') {
+                  // 驳回
+                  this.inputForm.status = '4'
+                }
+                if (type === 'reback') {
+                  // 撤回
+                  this.inputForm.status = '3'
+                }
+                if (type === 'reject' || type === 'reback') {
+                  let param = {status: this.inputForm.status, id: this.inputForm.id}
+                  this.financeInvoiceService.updateStatusById(param).then(() => {
+                    callback()
+                  })
+                }
+              }
+            })
+          } else if (type === 'hold') {
+            this.financeInvoiceService.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.financeInvoiceService.updateStatusById(param).then(() => {
+                  callback()
+                })
+              }
+            })
           }
-        })
+        }
       },
       // 下载模板
       downloadTpl () {

+ 57 - 27
src/views/modules/finance/invoice/InvoiceFormTaskInvalid.vue

@@ -525,7 +525,7 @@
         </vxe-table>
       </el-row>
       <el-divider content-position="left"><i class="el-icon-document"></i>发票作废</el-divider>
-      <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="formReadOnly===true"
+      <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="status === 'audit' || status === 'taskFormDetail'"
                label-width="160px" @submit.native.prevent>
       <el-row :gutter="15">
         <el-col :span="24">
@@ -781,6 +781,16 @@
           }
         })
       },
+      reapplyForm (callback) {
+        this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
+          if (data.status !== '8') { // 审核状态不是“驳回”,就弹出提示
+            this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+            throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+          } else {
+            this.doSubmit('reapply', callback)
+          }
+        })
+      },
       // 表单提交
       async doSubmit (status, callback) {
         if (await this.$refs.uploadComponent.checkProgress()) {
@@ -807,6 +817,8 @@
           this.inputForm.status = '9'
           this.inputForm.financeInvoiceInvalidDTO.invalidStatus = '1'
           this.inputForm.invalidStatus = '1'
+        } else if (status === 'reapply') {
+          this.inputForm.status = '6'
         }
         if (this.commonJS.isEmpty(this.inputForm.financeInvoiceBaseDTOList)) {
           this.$message.error('至少新增一条基本信息')
@@ -1111,36 +1123,54 @@
           this.financeInvoiceDetailDTOList.push({account: this.inputForm.account})
         }
       },
-      async updateStatusById (type) {
+      async updateStatusById (type, callback) {
         if (await this.$refs.uploadComponent.checkProgress()) {
           this.loading = false
           throw new Error()
-        }
-        await this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
-          if (data.status !== '6') { // status的值不等于“审核中”,就弹出提示
-            this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
-            throw new Error()
-          } else {
-            if (type === 'agree') {
-              // 同意
-              this.inputForm.status = '9'
-            }
-            if (type === 'reject') {
-              // 驳回
-              // this.inputForm.status = '8'
-              this.inputForm.status = '5'
-            }
-            if (type === 'reback') {
-              // 撤回
-              // this.inputForm.status = '7'
-              this.inputForm.status = '5'
-            }
-            if (type === 'reject' || type === 'reback') {
-              let param = {status: this.inputForm.status, id: this.inputForm.id}
-              this.financeInvoiceService.updateStatusById(param)
-            }
+        } else {
+          if (type === 'reject' || type === 'reback') {
+            this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
+              if (data.status !== '6') { // status的值不等于“审核中”,就弹出提示
+                this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+                throw new Error()
+              } else {
+                if (type === 'agree') {
+                  // 同意
+                  this.inputForm.status = '9'
+                }
+                if (type === 'reject') {
+                  // 驳回
+                  this.inputForm.status = '8'
+                  // this.inputForm.status = '5'
+                }
+                if (type === 'reback') {
+                  // 撤回
+                  // this.inputForm.status = '7'
+                  this.inputForm.status = '5'
+                }
+                if (type === 'reject' || type === 'reback') {
+                  let param = {status: this.inputForm.status, id: this.inputForm.id}
+                  this.financeInvoiceService.updateStatusById(param).then(() => {
+                    callback()
+                  })
+                }
+              }
+            })
+          } else if (type === 'hold') {
+            this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
+              if (data.status !== '8') { // status的值不等于“驳回”就弹出提示
+                this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+                throw new Error()
+              } else {
+                // 终止
+                let param = {status: '5', id: this.inputForm.id}
+                this.financeInvoiceService.updateStatusById(param).then(() => {
+                  callback()
+                })
+              }
+            })
           }
-        })
+        }
       }
     }
   }

+ 16 - 9
src/views/modules/finance/invoice/InvoiceList.vue

@@ -230,14 +230,14 @@
           </vxe-column>
           <vxe-column min-width="300" title="操作"  fixed="right" align="center">
             <template  slot-scope="scope">
-              <el-button v-if="hasPermission('finance:invoice:edit')&&scope.row.status === '1'||scope.row.status === '3'||scope.row.status === '4'" type="text"  size="small" @click="invoicePush(scope.row)">修改</el-button>
+              <el-button v-if="hasPermission('finance:invoice:edit')&&scope.row.status === '1'||scope.row.status === '3'" type="text"  size="small" @click="invoicePush(scope.row)">修改</el-button>
               <el-button v-if="hasPermission('finance:invoice:edit')&&scope.row.status === '2'" type="text"  size="small" @click="invoiceReback(scope.row)">撤回</el-button>
               <el-button v-if="hasPermission('finance:invoice:edit:detail')&&scope.row.status === '5'&&scope.row.receivablesStatus !== '1'" type="text"  size="small" @click="editDetail(scope.row.id)">修改发票明细</el-button>
               <el-button v-if="hasPermission('finance:invoice:edit:receivables')&&scope.row.status === '5'&&scope.row.receivablesStatus !== '1'" type="text"   size="small" @click="view(true, scope.row.id)">收款</el-button>
               <el-button v-if="hasPermission('finance:invoice:edit:is_receivables')&&scope.row.status === '5'&&scope.row.receivablesStatus !== '1'" type="text"   size="small" @click="isReceivables(scope.row)">确认收款</el-button>
-              <el-button v-if="hasPermission('finance:invoice:edit:invalid')&&scope.row.status === '5'||scope.row.status === '7'||scope.row.status === '8'" type="text"  size="small" @click="invoiceInvalidPush(scope.row)">作废</el-button>
+              <el-button v-if="hasPermission('finance:invoice:edit:invalid')&&scope.row.status === '5'||scope.row.status === '7'" type="text"  size="small" @click="invoiceInvalidPush(scope.row)">作废</el-button>
               <el-button v-if="hasPermission('finance:invoice:edit:invalid')&&scope.row.status === '6'" type="text"  size="small" @click="invoiceInvalidReBack(scope.row)">作废撤回</el-button>
-              <el-button v-if="hasPermission('finance:invoice:edit')&&scope.row.status === '1'||scope.row.status === '3'||scope.row.status === '4'" type="text"   size="small" @click="del(scope.row.id)">删除</el-button>
+              <el-button v-if="hasPermission('finance:invoice:edit')&&scope.row.status === '1'||scope.row.status === '3'" type="text"   size="small" @click="del(scope.row.id)">删除</el-button>
             </template>
           </vxe-column>
         </vxe-table>
@@ -513,6 +513,7 @@
             this.$router.push({
               path: '/flowable/task/TaskForm',
               query: {
+                ...pick(data.data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
                 procDefId: this.processDefinitionId,
                 procDefKey: this.procDefKey,
                 status: 'startAndHold',
@@ -533,8 +534,10 @@
         let title = `发起流程【发票申请】`
         let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了[发票申请]`
         let status = 'startAndHold'
-        if (row.status === '3' || row.status === '4') {
+        if (row.status === '3') {
           status = 'startAndClose'
+        } else if (row.status === '4') {
+          status = 'reapplyFlag'
         }
         this.taskService.getTaskDef({ procDefId: this.processDefinitionId,
           businessId: row.id,
@@ -542,6 +545,7 @@
             this.$router.push({
               path: '/flowable/task/TaskForm',
               query: {
+                ...pick(data.data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
                 procDefId: this.processDefinitionId,
                 procDefKey: this.procDefKey,
                 title: title,
@@ -563,8 +567,10 @@
         let title = `发起流程【发票作废】`
         let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了[发票作废]`
         let status = 'startAndHold'
-        if (row.status === '8' || row.status === '7') {
+        if (row.status === '7') {
           status = 'startAndClose'
+        } else if (row.status === '8') {
+          status = 'reapplyFlag'
         }
         this.taskService.getTaskDef({ procDefId: this.processDefinitionInvalidId,
           businessId: row.financeInvoiceInvalidDTO.id,
@@ -572,6 +578,7 @@
             this.$router.push({
               path: '/flowable/task/TaskForm',
               query: {
+                ...pick(data.data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
                 procDefId: this.processDefinitionInvalidId,
                 procDefKey: this.procDefInvalidKey,
                 title: title,
@@ -600,13 +607,13 @@
               this.$router.push({
                 path: '/flowable/task/TaskFormDetail',
                 query: {
+                  ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
                   isShow: 'false',
                   readOnly: true,
                   title: '发票申请' + '流程详情',
                   formTitle: '发票申请' + '流程详情',
                   businessId: row.id,
-                  status: 'reback',
-                  ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'title', 'businessId')
+                  status: 'reback'
                 }
               })
             })
@@ -622,13 +629,13 @@
           this.$router.push({
             path: '/flowable/task/TaskFormDetail',
             query: {
+              ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
               isShow: 'false',
               readOnly: true,
               title: '发票作废' + '流程详情',
               formTitle: '发票作废' + '流程详情',
               businessId: row.financeInvoiceInvalidDTO.id,
-              status: 'reback',
-              ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'title', 'businessId')
+              status: 'reback'
             }
           })
         })

+ 3 - 3
src/views/modules/finance/invoice/ProgramForm.vue

@@ -26,7 +26,7 @@
           >
             <vxe-table-column field="programName" align="center" title="项目名称">
               <template slot-scope="scope">
-                <el-link type="primary" :underline="false" @click="openProjectForm(scope.row.programId)" >{{scope.row.programName}}</el-link>
+                <el-link type="primary" :underline="false" @click="openProjectForm(scope.row)" >{{scope.row.programName}}</el-link>
               </template>
             </vxe-table-column>
             <vxe-table-column field="contractName" align="center" title="合同名称"></vxe-table-column>
@@ -223,8 +223,8 @@
           })
         })
       },
-      openProjectForm (id) {
-        this.$refs.projectForm.init('view', id)
+      openProjectForm (row) {
+        this.$refs.projectForm.init('view', row.programId, row.auditId1, row.auditId2, row.auditId3, row.archiveId)
       },
       // 表单提交
       async doSubmit () {

+ 5 - 1
src/views/modules/flowable/task/TaskForm.vue

@@ -458,6 +458,8 @@
       // Process_1669275081328 发票申请
       // Process_1669275380218 发票作废
       // Process_1672738002595 发起通知
+      // Process_1665628043339 评估-发票作废
+      // Process_1665458731435 评估-发票申请
       // 驳回
       reject (vars) {
         if (this.procDefId.includes('Process_1667978088459') ||
@@ -473,7 +475,9 @@
           this.procDefId.includes('Process_1669271524486') ||
           this.procDefId.includes('Process_1669275081328') ||
           this.procDefId.includes('Process_1669275380218') ||
-          this.procDefId.includes('Process_1672738002595')
+          this.procDefId.includes('Process_1672738002595') ||
+          this.procDefId.includes('Process_1665628043339') ||
+          this.procDefId.includes('Process_1665458731435')
         ) {
           console.log('进入新版驳回')
           this.$confirm(`确定驳回流程吗?`, '提示', {