daiqisheng 2 år sedan
förälder
incheckning
3377355ebd
1 ändrade filer med 38 tillägg och 16 borttagningar
  1. 38 16
      src/pages/main/performance/department.vue

+ 38 - 16
src/pages/main/performance/department.vue

@@ -83,9 +83,6 @@
           status="10"
           @save="handleSave"
         />
-        <!-- <analysis
-          :edit="edit_form.department_status === '待处理' && edit_visible"
-        /> -->
       </template>
       <template v-slot:footer><div></div></template>
     </simple-dialog>
@@ -194,7 +191,7 @@
                 :value="value"
               ></el-option>
             </el-select>
-            <div v-if="permission_type === 2">
+            <!-- <div v-if="permission_type === 2">
               <span class="form-content">可编辑行:</span>
               <el-select
                 class="margin-bottom-20 margin-right-10"
@@ -210,7 +207,7 @@
                   :value="item"
                 ></el-option>
               </el-select>
-            </div>
+            </div> -->
             <div v-if="permission_type === 2">
               <span class="form-content">可编辑列:</span>
               <el-select
@@ -710,7 +707,6 @@ export default {
     },
     // 查看按钮
     handleCheck(row) {
-      console.log(row, "row");
       this.edit_form = row;
       this.edit_visible = false;
       this.id = row.id;
@@ -787,11 +783,19 @@ export default {
     handleCharge(type) {
       switch (type) {
         case "add":
-          this.transfer_form.charge.push({
-            person: "",
-            allowEditingColumns: [],
-            rowNum: [],
-          });
+          if (
+            this.transfer_form.charge[this.transfer_form.charge.length - 1]
+              .allowEditingColumns.length
+          ) {
+            this.transfer_form.charge.push({
+              person: "",
+              allowEditingColumns: [],
+              rowNum: [],
+            });
+          } else {
+            this.$message.error("请先选择需要转派的列");
+          }
+
           break;
         case "delete":
           this.transfer_form.charge.pop();
@@ -827,13 +831,24 @@ export default {
       } else if (permission_type === 2) {
         // 特殊权限
         console.log(permission_type, "permission_type");
-        charge.forEach((el) => {
-          if (el.person && el.rowNum.length) {
+        if (this.transfer_form.charge.length === 1) {
+          charge.forEach((el) => {
+            if (el.person) {
+              flag = flag * 1;
+            } else {
+              flag = flag * 0;
+            }
+          });
+        } else if (this.transfer_form.charge.length > 1) {
+          if (
+            this.transfer_form.charge[this.transfer_form.charge.length - 1]
+              .allowEditingColumns.length
+          ) {
             flag = flag * 1;
           } else {
             flag = flag * 0;
           }
-        });
+        }
       }
       return flag;
     },
@@ -859,7 +874,7 @@ export default {
                   allowEditingColumns: el.allowEditingColumns.length
                     ? el.allowEditingColumns.join(",")
                     : this.transfer_cols_orgin.join(","),
-                  rowNum: el.rowNum.join(","),
+                  rowNum: this.transfer_rows_orgin.join(","),
                   principalId: el.person.split(",")[0],
                   principalName: el.person.split(",")[1],
                 })
@@ -889,7 +904,14 @@ export default {
             });
             console.log(params, "this.transfer_form");
           } else {
-            this.$message.error("请填写必要的信息");
+            if (
+              !this.transfer_form.charge[this.transfer_form.charge.length - 1]
+                .allowEditingColumns.length
+            ) {
+              this.$message.error("请填写完整可编辑列");
+            } else {
+              this.$message.error("请填写必要的信息");
+            }
           }
         }
       });