소스 검색

审批流程被驳回之后需要能再次提交审批

ZGC4846 1 주 전
부모
커밋
03874f864a

+ 4 - 7
src/views/hiring/hiringApproval/index.vue

@@ -352,12 +352,11 @@ export default {
       if (code === "DRAFT") return "is-muted";
       return "is-warning";
     },
-    // 未发起流程的草稿可发起 BPM(文档:hr_recruit_hiring_approval + 审批主键
+    // 草稿与已驳回可发起 / 重新拉起 BPM(已驳回可能仍挂着旧流程实例 id
     canLaunch(row) {
       return (
         Boolean(row?.id) &&
-        !row.processInstanceId &&
-        !["APPROVED", "REJECTED", "PENDING"].includes(row.statusCode)
+        ["DRAFT", "REJECTED", ""].includes(row.statusCode || "DRAFT")
       );
     },
     canApprove() {
@@ -365,10 +364,8 @@ export default {
       return false;
     },
     canEdit(row) {
-      return (
-        !row.processInstanceId &&
-        ["DRAFT", "REJECTED"].includes(row.statusCode)
-      );
+      // 草稿与已驳回可编辑后重新提交
+      return ["DRAFT", "REJECTED"].includes(row.statusCode);
     },
     canSendOffer(row) {
       return HIRING_APPROVED_STATUS.has(row.statusCode) && !row.offerSent;

+ 2 - 5
src/views/hrManagement/resignationApplication/index.vue

@@ -783,11 +783,8 @@ export default {
     canArchive: canArchiveResignation,
     canForce: canForceCompleteResignation,
     canLaunch(row) {
-      return (
-        canSubmitResignation(row) &&
-        !row.processInstanceId &&
-        !row.approvalInstanceId
-      );
+      // 草稿 / 已驳回均可提交审批(已驳回即使仍有旧流程实例 id 也允许重新发起)
+      return canSubmitResignation(row);
     },
     employeeLabel(item = {}) {
       return `${item.name || "-"}(${item.employeeNo || item.jobNumber || item.id})`;

+ 13 - 11
src/views/position/positionApplication/index.vue

@@ -394,7 +394,7 @@
       </div>
       <div class="drawer-footer">
         <span><i class="el-icon-lock"></i>
-          岗位申请将用于招聘需求岗位基础数据<em class="drawer-hint">新增保存成功后将直接发起审批流程</em></span>
+          岗位申请将用于招聘需求岗位基础数据<em class="drawer-hint">新建或已驳回再次保存后将弹出审批提交流程</em></span>
         <div v-if="readOnly">
           <el-button @click="drawerVisible = false">关闭</el-button><el-button v-if="canEdit(form)" type="primary"
             icon="el-icon-edit" @click="mode = 'edit'">编辑</el-button>
@@ -615,12 +615,12 @@ export default {
           formatter: (row) => `${row.headcount} 人`,
         },
         { prop: "applicant", label: "申请人", width: 100, align: "center" },
-        {
-          columnKey: "duties",
-          label: "岗位职责",
-          minWidth: 230,
-          slot: "duties",
-        },
+        // {
+        //   columnKey: "duties",
+        //   label: "岗位职责",
+        //   minWidth: 230,
+        //   slot: "duties",
+        // },
         {
           columnKey: "status",
           label: "状态",
@@ -1004,11 +1004,12 @@ export default {
       this.drawerVisible = false;
       if (typeof done === "function") done();
     },
-    // 保存岗位申请;新增保存成功后直接弹出 BPM 审批流程
+    // 保存岗位申请;新建或再次编辑已驳回单据保存后,弹出 BPM 审批流程
     saveApplication(validate = true) {
       const persist = async () => {
         const payload = serializePositionApplication(this.form);
         this.saving = true;
+        const wasRejected = this.form.status === "REJECTED";
         try {
           let id = this.form.id;
           const isCreate = !id;
@@ -1030,7 +1031,8 @@ export default {
           this.$message.success("岗位申请已保存");
           this.loadOverview();
           this.reloadTable();
-          if (isCreate && id) {
+          // 新建,或已驳回再次编辑保存后,重新弹出提交审批弹框
+          if (id && (isCreate || wasRejected)) {
             this.$nextTick(() => this.launchApplication(savedRow));
           }
         } catch (error) {
@@ -1043,9 +1045,9 @@ export default {
         this.$refs.applicationForm.validate((valid) => valid && persist());
       else persist();
     },
-    // 仅未提交(DRAFT)状态显示发起按钮 / 允许拉起流程
+    // 未提交、已驳回可发起 / 重新拉起流程
     canLaunch(row) {
-      return !row?.status || row.status === "DRAFT";
+      return !row?.status || ["DRAFT", "REJECTED"].includes(row.status);
     },
     // 发起岗位申请:打开 BPM 提交审核弹框(提交直接调 /bpm/process-instance/create)
     launchApplication(row) {