Просмотр исходного кода

修复了组织架构编辑的时候不能新增岗位的问题

ZGC4846 2 дней назад
Родитель
Сommit
cb8d7312ef
1 измененных файлов с 16 добавлено и 15 удалено
  1. 16 15
      src/views/enterpriseModel/dept/components/org-edit.vue

+ 16 - 15
src/views/enterpriseModel/dept/components/org-edit.vue

@@ -638,16 +638,18 @@
           if (emptyNew) {
             continue;
           }
-          if (
-            !row.positionId ||
-            !row.positionName ||
-            !row.positionLevelId ||
-            row.establishmentCount === undefined ||
-            row.establishmentCount === null ||
-            row.establishmentCount === ''
-          ) {
-            this.$message.warning('请完善部门岗位信息');
-            return false;
+          if (isNew) {
+            if (
+              !row.positionId ||
+              !row.positionName ||
+              !row.positionLevelId ||
+              row.establishmentCount === undefined ||
+              row.establishmentCount === null ||
+              row.establishmentCount === ''
+            ) {
+              this.$message.warning('请完善部门岗位信息');
+              return false;
+            }
           }
           rows.push({
             ...(row.id ? { id: row.id } : {}),
@@ -671,11 +673,10 @@
         );
       },
       addDeptPosition() {
-        if (
-          this.departmentPositionList.some(
-            (item) => !this.isDeptPositionFilled(item)
-          )
-        ) {
+        const hasEmptyNew = this.departmentPositionList
+          .filter((item) => !item.id)
+          .some((item) => !this.isDeptPositionFilled(item));
+        if (hasEmptyNew) {
           this.$message.warning('请先填写岗位名称、岗位层级和编制人数');
           return;
         }