Forráskód Böngészése

Merge branch 'master' of http://git.zthymaoyi.com/gdc/yiliangyiyun-pc

gjy 2 éve
szülő
commit
07dddfe061

+ 3 - 1
src/api/V2/universalityAudit/index.js

@@ -13,4 +13,6 @@ export const API_GET_INFO= '/commonSysParameter/getInfo'
 // 审核流1
 export const API_GET_workflow= '/newWorkflow/query/workflowsByBusinessCode'
 // 审核流2
-export const API_GET_HIS= '/newWorkflow/query/workflowInfo'
+export const API_GET_HIS= '/newWorkflow/query/workflowInfo'
+// 发起人撤回
+export const API_SPONSOR_WITHDRAW ='/newWorkflow/api/stopInstance'

+ 6 - 3
src/model/universalityAudit/index.js

@@ -9,12 +9,13 @@ import {
     API_LIST_AUDITINFO,
     API_GET_INFO,
     API_GET_workflow,
-    API_GET_HIS
+    API_GET_HIS,
+    API_SPONSOR_WITHDRAW
 } from '@/api/V2/universalityAudit'
 // 查看
 export const getaduitinfo = appRx.get(API_GET_AUDITINFO, errorCatcher, errorHandle, filter)
 // 编辑
-export const editaduitinfo = appRx.get(API_EDIT_AUDITINFO, errorCatcher, errorHandle, filter)
+export const editaduitinfo = appRx.post(API_EDIT_AUDITINFO, errorCatcher, errorHandle, filter)
 // 删除
 export const deladuitinfo = appRx.post(API_DEL_AUDITINFO, errorCatcher, errorHandle, filter)
 // 添加
@@ -26,4 +27,6 @@ export const xiala = appRx.get(API_GET_INFO, errorCatcher, errorHandle, filter)
 // 审核流1
 export const workflow = appRx.get(API_GET_workflow, errorCatcher, errorHandle, filter)
 // 审核流2
-export const gethis = appRx.get(API_GET_HIS, errorCatcher, errorHandle, filter)
+export const gethis = appRx.get(API_GET_HIS, errorCatcher, errorHandle, filter)
+// 发起人撤回
+export const sponsorWithdraw = appRx.post(API_SPONSOR_WITHDRAW, errorCatcher, errorHandle, filter)

+ 80 - 26
src/views/universalityAudit/audit.vue

@@ -96,7 +96,9 @@
               <el-button v-if="scope.row.approveStatus&&scope.row.taskId" @click="pass(scope.row)" type="primary">通过</el-button>
               <el-button v-if="scope.row.approveStatus&&scope.row.taskId" @click="reject(scope.row)" type="primary">驳回</el-button>
               <!-- <div style="display:inline-block;"> -->
-                <el-button v-if="scope.row.status=='已驳回'" @click="del(scope.row)" type="danger">删除</el-button>
+                <el-button v-show="scope.row.showFlag" v-if="scope.row.approveStatus&&scope.row.approveStatus != '发起人撤回'" @click="withdraw(scope.row)" type="primary">撤回</el-button>
+                <el-button v-show="scope.row.showFlag" v-if="scope.row.status=='已驳回' || scope.row.approveStatus =='发起人撤回'" @click="del(scope.row)" type="danger">删除</el-button>
+                <el-button v-show="scope.row.showFlag" v-if="scope.row.status=='已驳回' || scope.row.approveStatus =='发起人撤回'" @click="edit(scope.row)" type="primary">编辑</el-button>
               <!-- </div> -->
             </template>
           </el-table-column>
@@ -129,7 +131,7 @@
   </el-form-item>
   <el-form-item>
     <el-button @click="addshow=false">取消</el-button>
-    <el-button type="primary" @click="onSubmit">提交</el-button>
+    <el-button type="primary" @click="onSubmit(flag)">提交</el-button>
   </el-form-item>
 </el-form>
 </el-dialog>
@@ -188,7 +190,10 @@
     addaduitinfo,
     deladuitinfo,
     workflow,
-    gethis
+    gethis,
+    sponsorWithdraw,
+    editaduitinfo,
+    getaduitinfo
   } from '@/model/universalityAudit/index'
   import { getUuid } from '../../utils'
   import WsUpload from '@/components/WsUpload'
@@ -204,7 +209,7 @@
     },
     data() {
       return {
-        value: "",
+        value: '',
         tableData: [],
         show:false,
         title:'',
@@ -216,14 +221,17 @@
         currentPage: 1,
         pageSize: 10,
         businessType:'',
-        searchType:"",
-        searchKeyWord:"",
-        startDate:"",
-        endDate:"",
+        searchType:'',
+        searchKeyWord:'',
+        startDate:'',
+        endDate:'',
+        showFlag:false,
+        flag:'',
         outtotal:0,
         xialaList:[],
         intotal:0,
         form:{},
+        generalAuditInfo:{},
         dialogVisible:false,
         contractList:[],
         datalist:{},
@@ -389,6 +397,22 @@
       //     index++
       //   }
       // },
+      withdraw(row) {
+      this.$confirm(`撤回成功后,可再次提交,确定撤回该申请吗?`, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+      }).then(() => {
+        sponsorWithdraw({
+          workflowId: row.workflowId,
+          businessKey: row.id,
+        }).toPromise()
+          .then((response) => {
+            this.$message.success('撤回成功')
+            this.getList()
+          })
+      })
+    },
       fujian(row) {
         this.id = row.id
         this.accessoryTFs = true
@@ -410,7 +434,14 @@
             this.getList()
           })
           })
-      },  
+      }, 
+      edit(row) {
+        getaduitinfo({ id: row.id }).toPromise().then(response => {
+          this.form = response
+        })
+        this.addshow = true
+        this.flag = 1
+      },
       onChange() {
         this.$refs.upload
           .handleSaveBill()
@@ -436,25 +467,47 @@
                 type: 'warning',
             })
         }
-        this.$confirm('确定发起审核?', '提示', {
+        if (this.flag != 1) {
+          this.$confirm('确定发起审核?', '提示', {
             confirmButtonText: '确定',
             cancelButtonText: '取消',
             type: 'warning'
           })
-          .then(() => {
-            this.form.compId=localStorage.getItem('ws-pf_compId')
-            this.form.sponsor=localStorage.getItem('ws-pf_staffName')
-          addaduitinfo(this.form).toPromise().then(response => {
-            this.$message({
-                message: '提交成功!',
-                type: 'success',
+            .then(() => {
+              this.form.compId = localStorage.getItem('ws-pf_compId')
+              this.form.sponsor = localStorage.getItem('ws-pf_staffName')
+              addaduitinfo(this.form).toPromise().then(response => {
+                this.$message({
+                  message: '提交成功!',
+                  type: 'success',
+                })
+                this.getList()
+              })
+              this.form = {}
+              this.$refs.upload.clearFiles()
+              this.addshow = false
             })
-            this.form={}
-            this.$refs.upload.clearFiles()
-            this.addshow=false
-            this.getList()
+        } else {
+          this.$confirm('确定提交本次修改?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
           })
-        })
+            .then(() => {
+              // this.form.compId = localStorage.getItem('ws-pf_compId')
+              // this.form.sponsor = localStorage.getItem('ws-pf_staffName')
+              editaduitinfo(this.form).toPromise().then(response => {
+                this.$message({
+                  message: '修改成功!',
+                  type: 'success',
+                })
+                this.getList()
+              })
+              this.form = {}
+              this.$refs.upload.clearFiles()
+              this.addshow = false
+            })
+        }
       },
       addlist(){
         this.addshow=true
@@ -487,7 +540,8 @@
             currentPage: this.currentPage,
             pageSize:this.pageSize ,
             searchType:this.searchType,
-            businessType:this.businessType
+            businessType:this.businessType,
+            flag:0
           })
           .toPromise()
           .then(response => {
@@ -500,11 +554,11 @@
                     if(arr[q]!=''){
                       response.records[i].addressUrlArray.push(arr[q])
                     }
-                    
                   }
-                  
                 }
-                
+                if(response.records[i].sponsor == localStorage.getItem('ws-pf_staffName')){
+                  response.records[i].showFlag = true
+                }
               }
             }
             this.tableData=response.records