Pārlūkot izejas kodu

去掉离职列表的强制办结

lihaiting 3 dienas atpakaļ
vecāks
revīzija
d8e9a9027a

+ 1 - 17
src/enum/dict.js

@@ -37,23 +37,7 @@ export const holderTypeOptions = [
   {
     label: '个人',
     value: '1',
-  },
-  {
-    label: '供应商',
-    value: '3',
-  },
-  {
-    label: '客户',
-    value: '4',
-  },
-  {
-    label: '企业资质',
-    value: '2',
-  },
-  {
-    label: '受托企业资质',
-    value: '6',
-  },
+  }
 ];
 
 export const treeClassifyCodeEnum = {

+ 53 - 21
src/views/hiring/hiringApproval/components/ApprovalFormDrawer.vue

@@ -306,8 +306,28 @@ export default {
         positionId: [
           { required: true, message: "请选择应聘岗位", trigger: "change" },
         ],
+        /* 岗位序列:部门未配置序列时,报错文案直接给出可操作指引(去主数据补部门岗位) */
         positionSequenceId: [
-          { required: true, message: "请选择岗位序列", trigger: "change" },
+          {
+            required: true,
+            validator: (rule, value, callback) => {
+              if (value != null && value !== "") {
+                callback();
+                return;
+              }
+              const departmentId =
+                this.form.departmentId ?? this.form.hiringDeptId ?? null;
+              let message = "请选择岗位序列";
+              if (departmentId == null || departmentId === "") {
+                message = "请先选择入职部门";
+              } else if (!this.positionSequenceOptions.length) {
+                message =
+                  "当前入职部门未配置岗位序列,请到「主数据 → 组织机构」完善该部门的岗位信息";
+              }
+              callback(new Error(message));
+            },
+            trigger: "change",
+          },
         ],
         positionLevelId: [
           { required: true, message: "请选择岗位层级", trigger: "change" },
@@ -535,8 +555,12 @@ export default {
       this.form.education = this.resolveEducation(this.form.education);
     },
     // ========== 部门岗位关联级联加载 ==========
-    /** 入职部门 → 岗位序列下拉选项 */
-    async loadPositionSequences(deptId) {
+    /**
+     * 入职部门 → 岗位序列下拉选项
+     * notifyEmpty:用户主动切换部门时,该部门没配岗位序列就给出可操作指引
+     * (普通回显路径不弹提示,避免打开弹窗时噪音;提交时由 rules 兜底提示)
+     */
+    async loadPositionSequences(deptId, { notifyEmpty = false } = {}) {
       if (deptId == null || deptId === "") {
         this.positionSequenceOptions = [];
         return;
@@ -547,6 +571,11 @@ export default {
         this.positionSequenceOptions = (asList(data) || []).filter(
           (item) => item && item.positionSequenceId != null,
         );
+        if (notifyEmpty && !this.positionSequenceOptions.length) {
+          this.$message.warning(
+            "该入职部门未配置岗位序列,请到「主数据 → 组织机构」完善该部门的岗位信息",
+          );
+        }
       } catch (error) {
         this.positionSequenceOptions = [];
         showRequestError(error, "岗位序列加载失败");
@@ -640,23 +669,26 @@ export default {
           }))
           .filter((item) => item.id != null && item.name);
         const byId = new Map(records.map((item) => [String(item.id), item]));
-        this.allDepartments = records.map((item) => {
-          let current = item;
-          const seen = new Set();
-          while (
-            current &&
-            byId.has(String(current.parentId)) &&
-            !seen.has(String(current.id))
-          ) {
-            seen.add(String(current.id));
-            current = byId.get(String(current.parentId));
-          }
-          return {
-            id: item.id,
-            name: item.name,
-            legalId: current?.id,
-          };
-        });
+        this.allDepartments = records
+          .map((item) => {
+            let current = item;
+            const seen = new Set();
+            while (
+              current &&
+              byId.has(String(current.parentId)) &&
+              !seen.has(String(current.id))
+            ) {
+              seen.add(String(current.id));
+              current = byId.get(String(current.parentId));
+            }
+            return {
+              id: item.id,
+              name: item.name,
+              legalId: current?.id,
+            };
+          })
+          /* 公司根节点(上级链顶到自己)不是部门,不进入职部门下拉 */
+          .filter((item) => String(item.id) !== String(item.legalId));
       } catch (error) {
         /* 机构选项来自登录缓存,不因组织列表接口失败而清空 */
         this.allDepartments = [];
@@ -788,7 +820,7 @@ export default {
       }
       this.form.departmentId = departmentId;
       this.syncOrgAndDeptFields();
-      await this.loadPositionSequences(departmentId);
+      await this.loadPositionSequences(departmentId, { notifyEmpty: true });
     },
     async fillRelatedInfo() {
       if (this.localOnly) return;

+ 5 - 22
src/views/hrManagement/employeeArchive/components/EmployeeArchiveForm.vue

@@ -697,34 +697,17 @@ export default {
       if (!value || /^1\d{10}$/.test(value) || /^1\d{2}\*{4}\d{4}$/.test(value)) callback();
       else callback(new Error('请输入正确的 11 位手机号码'));
     };
+    /**
+     * 身份证只校验位数(15 位纯数字 / 18 位且末位可为 X),与「办理入职」口径一致;
+     * 不再校验出生日期合法性、不再算校验位——避免真实/历史数据被前端拦下。
+     */
     const validateIdCard = (rule, value, callback) => {
       if (this._skipFormValidate) return callback();
       const text = String(value || '').trim();
       if (!text) return callback();
       // 脱敏展示(如 4301********1234)允许通过
       if (/^\d{6}\*{8}[\dXx]{4}$/.test(text)) return callback();
-      if (!/^\d{17}[\dXx]$/.test(text)) {
-        return callback(new Error('请输入正确的身份证号码'));
-      }
-      const birth = text.slice(6, 14);
-      const y = Number(birth.slice(0, 4));
-      const m = Number(birth.slice(4, 6));
-      const d = Number(birth.slice(6, 8));
-      const date = new Date(y, m - 1, d);
-      if (
-        date.getFullYear() !== y ||
-        date.getMonth() !== m - 1 ||
-        date.getDate() !== d ||
-        y < 1900 ||
-        date.getTime() > Date.now()
-      ) {
-        return callback(new Error('请输入正确的身份证号码'));
-      }
-      const weights = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
-      const codes = '10X98765432';
-      let sum = 0;
-      for (let i = 0; i < 17; i += 1) sum += Number(text[i]) * weights[i];
-      if (codes[sum % 11] !== text[17].toUpperCase()) {
+      if (!/^\d{15}$|^\d{17}[\dXx]$/.test(text)) {
         return callback(new Error('请输入正确的身份证号码'));
       }
       callback();

+ 3 - 3
src/views/hrManagement/resignationApplication/index.vue

@@ -109,10 +109,10 @@
             :disabled="submitting" @click="handleCommand('cancel', row)">
             取消
           </el-link>
-          <el-link v-if="canForce(row)" type="danger" :underline="false" icon="el-icon-warning-outline"
+          <!-- <el-link v-if="canForce(row)" type="danger" :underline="false" icon="el-icon-warning-outline"
             :disabled="submitting" @click="handleCommand('force', row)">
             强制办结
-          </el-link>
+          </el-link> -->
         </template>
         <template slot="empty">
           <el-empty :description="emptyText" />
@@ -709,7 +709,7 @@ export default {
         {
           columnKey: "action",
           label: "操作",
-          minWidth: 350,
+          minWidth: 300,
           fixed: "right",
           align: "left",
           slot: "action",

+ 3 - 3
src/views/hrManagement/resignationHandoverOrder/index.vue

@@ -150,10 +150,10 @@
             :disabled="submitting" @click="handleCommand('archive', row)">
             归档
           </el-link>
-          <el-link v-if="canForce(row)" type="danger" :underline="false" icon="el-icon-warning-outline"
+          <!-- <el-link v-if="canForce(row)" type="danger" :underline="false" icon="el-icon-warning-outline"
             :disabled="submitting" @click="handleCommand('force', row)">
             强制办结
-          </el-link>
+          </el-link> -->
         </template>
         <template slot="empty">
           <el-empty :description="emptyText" />
@@ -584,7 +584,7 @@ export default {
         {
           columnKey: "action",
           label: "操作",
-          minWidth: 360,
+          minWidth: 300,
           fixed: "right",
           align: "left",
           slot: "action",

+ 2 - 2
vue.config.js

@@ -41,8 +41,8 @@ function stripProxyCacheHeaders(proxyRes) {
 
 const apiProxy = resolveApiProxyTarget(
   process.env.VUE_APP_PROXY_TARGET ||
-    "http://192.168.1.147:18086",
-    // "http://aiot.zoomwin.com.cn:51001",
+    // "http://192.168.1.147:18086",
+    "http://aiot.zoomwin.com.cn:51001",
 );
 
 // element-ui / ele-admin 仍使用 Sass @import,静音 Dart Sass 弃用警告