浏览代码

离职审批添加撤回功能

lizhenhao 2 年之前
父节点
当前提交
3d7e009889

+ 6 - 17
src/views/modules/changes/dimission/DimissionAuditForm.vue

@@ -7,17 +7,6 @@
             <el-form-item label="姓名" prop="rosterId"
                           :rules="[{required: true, message: '姓名不能为空', trigger: 'blur'},{required: true, message: '姓名不能为空', trigger: 'change'}]"
             >
-              <!--              <el-select :disabled="method === 'sure'" v-model="inputForm.rosterId" style="width:100%" placeholder="请选择姓名">-->
-              <!--                <el-option-->
-              <!--                  v-for="item in supervisorList"-->
-              <!--                  :key="item.id"-->
-              <!--                  :label="item.name"-->
-              <!--                  :value="item.id">-->
-              <!--                </el-option>-->
-              <!--              </el-select>-->
-              <!--              <el-input style="width:100%" v-model="inputForm.rosterId" placeholder="请填写姓名"  disabled  >-->
-              <!--                <el-button slot="append" @click="openRoster" icon="el-icon-search"></el-button>-->
-              <!--              </el-input>-->
               <RosterSelectForm :limit='1' :disabled="true" :readonly="true" :value="inputForm.rosterId" @getValue='(value) => {inputForm.rosterId=value}'></RosterSelectForm>
             </el-form-item>
           </el-col>
@@ -196,8 +185,8 @@
           reaTypeList: [],
           changesDimissionFilesDTOList: [],
           handoverId: '',
-          socialSecurityLast: [],
-          providentFundLast: []
+          socialSecurityLast: '',
+          providentFundLast: ''
         },
         supervisorList: []
       }
@@ -252,8 +241,8 @@
           reaTypeList: [],
           changesDimissionFilesDTOList: [],
           handoverId: '',
-          socialSecurityLast: [],
-          providentFundLast: []
+          socialSecurityLast: '',
+          providentFundLast: ''
         }
         this.inputForm.id = id
         if (method === 'audit') {
@@ -325,8 +314,8 @@
           this.inputForm.vettingStatus = '5'
         }
         if (type === 'reback') {
-          // 撤回   撤回即回到暂存
-          this.inputForm.vettingStatus = '3'
+          // 撤回
+          this.inputForm.vettingStatus = '7'
         }
         this.dimissionService.updateVettingStatusById(this.inputForm)
       },

+ 2 - 2
src/views/modules/changes/dimission/DimissionHandoverForm.vue

@@ -293,8 +293,8 @@
           this.inputForm.handoverStatus = '5'
         }
         if (type === 'reback') {
-          // 撤回   撤回即回到暂存
-          this.inputForm.handoverStatus = '2'
+          // 撤回
+          this.inputForm.handoverStatus = '6'
         }
         this.dimissionHandoverService.updateStatusById(this.inputForm)
       },

+ 108 - 20
src/views/modules/changes/dimission/DimissionList.vue

@@ -5,6 +5,23 @@
       <el-form-item prop="rosterBaseDTO.name">
         <el-input size="small" v-model="searchForm.rosterBaseDTO.name" placeholder="姓名" clearable></el-input>
       </el-form-item>
+      <el-form-item prop="rosterBaseDTO.officeId">
+        <SelectTree
+          ref="officeTree"
+          :props="{
+                value: 'id',             // ID字段名
+                label: 'name',         // 显示名称
+                children: 'children'    // 子级字段名
+              }"
+          :url="`/sys/office/treeData?type=2`"
+          :value="searchForm.rosterBaseDTO.officeId"
+          :clearable="true"
+          :accordion="true"
+          @getValue="(value) => {searchForm.rosterBaseDTO.officeId=value}"/>
+      </el-form-item>
+      <el-form-item prop="rosterBaseDTO.mobile">
+        <el-input size="small" v-model="searchForm.rosterBaseDTO.mobile" placeholder="手机号" clearable></el-input>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
         <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
@@ -47,29 +64,47 @@
           </vxe-column>
           <vxe-column width="120" title="离职审批" field="vettingStatus">
             <template slot-scope="scope">
-              <el-button v-if="scope.row.vettingStatus === '4'" type="primary" @click="auditDetail(scope.row)" size="mini" plain>
+              <el-button v-if="scope.row.vettingStatus === '4'" type="primary" @click="auditDetail(scope.row)" size="mini">
+                {{$dictUtils.getDictLabel("vetting_status", scope.row.vettingStatus, '-')}}
+              </el-button>
+              <el-button v-else-if="scope.row.vettingStatus === '6'" type="success" @click="auditDetail(scope.row)" size="mini">
+                {{$dictUtils.getDictLabel("vetting_status", scope.row.vettingStatus, '-')}}
+              </el-button>
+              <el-button v-else-if="scope.row.vettingStatus === '7'" type="warning" @click="auditDetail(scope.row)" size="mini">
+                {{$dictUtils.getDictLabel("vetting_status", scope.row.vettingStatus, '-')}}
+              </el-button>
+              <el-button v-else-if="scope.row.vettingStatus === '2'" type="info" size="mini" plain>
                 {{$dictUtils.getDictLabel("vetting_status", scope.row.vettingStatus, '-')}}
               </el-button>
-              <el-button v-else-if="scope.row.vettingStatus === '6'" type="success" @click="auditDetail(scope.row)" size="mini" plain>
+              <el-button v-else-if="scope.row.vettingStatus === '3'" type="info" size="mini">
                 {{$dictUtils.getDictLabel("vetting_status", scope.row.vettingStatus, '-')}}
               </el-button>
-              <el-button v-else-if="scope.row.vettingStatus === '2'" type="warning" size="mini" plain>
+              <el-button v-else-if="scope.row.vettingStatus === '5'" type="danger" @click="auditDetail(scope.row)" size="mini">
                 {{$dictUtils.getDictLabel("vetting_status", scope.row.vettingStatus, '-')}}
               </el-button>
-              <el-button v-else size="mini" plain>
+              <el-button v-else size="mini">
                 {{$dictUtils.getDictLabel("vetting_status", scope.row.vettingStatus, '-')}}
               </el-button>
             </template>
           </vxe-column>
           <vxe-column width="120" title="离职交接" field="handoverStatus">
             <template slot-scope="scope">
-              <el-button v-if="scope.row.handoverStatus === '3'" type="primary"  @click="handoverDetail(scope.row)" size="mini" plain>
+              <el-button v-if="scope.row.handoverStatus === '3'" type="primary"  @click="handoverDetail(scope.row)" size="mini">
+                {{$dictUtils.getDictLabel('handover_status', scope.row.handoverStatus, '-')}}
+              </el-button>
+              <el-button v-else-if="scope.row.handoverStatus === '4'" type="success"  @click="handoverDetail(scope.row)" size="mini">
                 {{$dictUtils.getDictLabel('handover_status', scope.row.handoverStatus, '-')}}
               </el-button>
-              <el-button v-else-if="scope.row.handoverStatus === '4'" type="success"  @click="handoverDetail(scope.row)" size="mini" plain>
+              <el-button v-else-if="scope.row.handoverStatus === '6'" type="warning"  @click="handoverDetail(scope.row)" size="mini">
                 {{$dictUtils.getDictLabel('handover_status', scope.row.handoverStatus, '-')}}
               </el-button>
-              <el-button v-else size="mini" plain>
+              <el-button v-else-if="scope.row.handoverStatus === '2'" type="info" size="mini">
+                {{$dictUtils.getDictLabel('handover_status', scope.row.handoverStatus, '-')}}
+              </el-button>
+              <el-button v-else-if="scope.row.handoverStatus === '5'" type="danger" @click="handoverDetail(scope.row)" size="mini">
+                {{$dictUtils.getDictLabel('handover_status', scope.row.handoverStatus, '-')}}
+              </el-button>
+              <el-button v-else size="mini">
                 {{$dictUtils.getDictLabel('handover_status', scope.row.handoverStatus, '-')}}
               </el-button>
 
@@ -77,10 +112,10 @@
           </vxe-column>
           <vxe-column width="120" title="离职状态" field="status">
             <template slot-scope="scope">
-              <el-button v-if="scope.row.status === '2'" type="success" size="mini" plain>
+              <el-button v-if="scope.row.status === '2'" type="success" size="mini">
                 {{$dictUtils.getDictLabel('dimission_status', scope.row.status, '-')}}
               </el-button>
-              <el-button v-else size="mini" plain>
+              <el-button v-else size="mini">
                 {{$dictUtils.getDictLabel('dimission_status', scope.row.status, '-')}}
               </el-button>
             </template>
@@ -145,34 +180,47 @@
                   <el-dropdown-item v-if="hasPermission('changes:dimission:edit')&&
                                               (scope.row.handoverStatus === '1'&&scope.row.status === '2')||
                                               (scope.row.handoverStatus === '2'&&scope.row.status === '2')||
-                                              (scope.row.handoverStatus === '5'&&scope.row.status === '2')"
+                                              (scope.row.handoverStatus === '5'&&scope.row.status === '2')||
+                                              (scope.row.handoverStatus === '6'&&scope.row.status === '2')"
                                     :command="{method:'removeSure', row:scope.row}">
                     取消确认
                   </el-dropdown-item>
                   <el-dropdown-item v-if="hasPermission('changes:dimission:edit')&&
                                               scope.row.status === '2'&&
-                                              scope.row.handoverStatus === '1'||scope.row.handoverStatus === '2'||scope.row.handoverStatus === '5'"
+                                              scope.row.handoverStatus === '1'||scope.row.handoverStatus === '2'||scope.row.handoverStatus === '5'||scope.row.handoverStatus === '6'"
                                     :command="{method:'handover', row:scope.row}">
-                    发起工作交接审批
+                    {{scope.row.handoverStatus === '1'?'发起工作交接审批':'修改工作交接审批'}}
                   </el-dropdown-item>
                   <el-dropdown-item v-if="hasPermission('changes:dimission:view')&&
                                               scope.row.status === '2'&&
-                                              scope.row.handoverStatus === '3'||scope.row.handoverStatus === '4'"
+                                              (scope.row.handoverStatus === '3'||scope.row.handoverStatus === '4'||scope.row.handoverStatus === '5'||scope.row.handoverStatus === '6')"
                                     :command="{method:'handoverDetail', row:scope.row}">
                     工作交接审批结果
                   </el-dropdown-item>
+                  <el-dropdown-item v-if="hasPermission('changes:dimission:view')&&
+                                              scope.row.status === '2'&&
+                                              scope.row.handoverStatus === '3'"
+                                    :command="{method:'handoverReback', row:scope.row}">
+                    撤销工作交接审批
+                  </el-dropdown-item>
                   <el-dropdown-item v-if="hasPermission('changes:dimission:edit')&&
                                               (scope.row.status === '1'&&scope.row.vettingStatus === '1')||
                                               (scope.row.status === '1'&&scope.row.vettingStatus === '3')||
-                                              (scope.row.status === '1'&&scope.row.vettingStatus === '5')"
+                                              (scope.row.status === '1'&&scope.row.vettingStatus === '5')||
+                                              (scope.row.status === '1'&&scope.row.vettingStatus === '7')"
                                     :command="{method:'audit', row:scope.row}">
-                    发起离职审批
+                    {{scope.row.vettingStatus === '1'?'发起离职审批':'修改离职审批'}}
                   </el-dropdown-item>
                   <el-dropdown-item v-if="hasPermission('changes:dimission:view')&&
-                                              (scope.row.vettingStatus === '4'||scope.row.vettingStatus === '6')"
+                                              (scope.row.vettingStatus === '4'||scope.row.vettingStatus === '5'||scope.row.vettingStatus === '6'||scope.row.vettingStatus === '7')"
                                     :command="{method:'auditDetail', row:scope.row}">
                     离职审批结果
                   </el-dropdown-item>
+                  <el-dropdown-item v-if="hasPermission('changes:dimission:view')&&
+                                              (scope.row.vettingStatus === '4')"
+                                    :command="{method:'auditReback', row:scope.row}">
+                    撤销离职审批
+                  </el-dropdown-item>
                 </el-dropdown-menu>
               </el-dropdown>
             </template>
@@ -203,13 +251,16 @@
   import TaskService from '@/api/flowable/TaskService'
   import ProcessService from '@/api/flowable/ProcessService'
   import DimissionHandoverService from '@/api/changes/dimission/DimissionHandoverService'
+  import SelectTree from '@/components/treeSelect/treeSelect.vue'
   import pick from 'lodash.pick'
   export default {
     data () {
       return {
         searchForm: {
           rosterBaseDTO: {
-            name: ''
+            name: '',
+            officeId: '',
+            mobile: ''
           }
         },
         dataList: [],
@@ -243,7 +294,8 @@
     },
     components: {
       DimissionForm,
-      DimissionHandoverFormDialog
+      DimissionHandoverFormDialog,
+      SelectTree
     },
     activated () {
       this.refreshList()
@@ -346,17 +398,33 @@
             this.$router.push({
               path: '/flowable/task/TaskFormDetail',
               query: {
+                status: 'reback',
                 isShow: 'false',
                 readOnly: true,
                 title: '离职归档交接审批' + '流程详情',
                 formTitle: '离职归档交接审批' + '流程详情',
                 businessId: row.id,
-                ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId')
+                ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'title', 'businessId')
               }
             })
           })
         }
       },
+      // 撤回工作交接审批
+      handoverReback (row) {
+        this.$confirm(`确定要撤回该申请吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.processService.revokeProcIns(row.procInsId).then(({data}) => {
+            let form = {handoverStatus: '6', id: row.id}
+            this.dimissionHandoverService.updateStatusById(form)
+            this.$message.success(data)
+            this.refreshList()
+          })
+        })
+      },
       // 发起离职审批
       audit (row) {
         // 读取流程表单
@@ -399,12 +467,28 @@
                 title: '离职审批' + '流程详情',
                 formTitle: '离职审批' + '流程详情',
                 businessId: row.id,
-                ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId')
+                status: 'reback',
+                ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'title', 'businessId')
               }
             })
           })
         }
       },
+      // 撤回离职审批
+      auditReback (row) {
+        this.$confirm(`确定要撤回该申请吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.processService.revokeProcIns(row.changesDimissionAuditDTO.procInsId).then(({data}) => {
+            let form = {vettingStatus: '7', id: row.id}
+            this.dimissionService.updateVettingStatusById(form)
+            this.$message.success(data)
+            this.refreshList()
+          })
+        })
+      },
       // 删除
       del (id) {
         let ids = id || this.$refs.dimissionTable.getCheckboxRecords().map(item => {
@@ -457,6 +541,10 @@
           this.audit(command.row)
         } else if (command.method === 'auditDetail') {
           this.auditDetail(command.row)
+        } else if (command.method === 'auditReback') {
+          this.auditReback(command.row)
+        } else if (command.method === 'handoverReback') {
+          this.handoverReback(command.row)
         }
       },
       async removeSure (row) {

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

@@ -163,6 +163,8 @@
         this.buttons = [{code: '_flow_start', name: '送审', isHide: '0'}, {code: '_flow_close', name: '关闭', isHide: '0'}]
       } else if (this.status === 'startAndHold') {  // 送审、暂存、关闭
         this.buttons = [{code: '_flow_start', name: '送审', isHide: '0'}, {code: '_flow_save', name: '暂存', isHide: '0'}, {code: '_flow_close', name: '关闭', isHide: '0'}]
+      } else if (this.status === 'reback') {
+        this.buttons = [{code: '_flow_reback', name: '撤回', isHide: '0'}]
       } else if (this.procDefKey && this.taskDefKey) {
         // 读取按钮
         this.taskDefExtensionService.queryByDefIdAndTaskId({
@@ -536,6 +538,9 @@
           case '_flow_close':// 关闭
             this.close()
             break
+          case '_flow_reback':// 撤回
+            this.reback()
+            break
           default:
             this.commit(vars) // 自定义按钮提交
         }