浏览代码

修改多人请假审批异常

sunyanqiang 3 年之前
父节点
当前提交
afcadcb67e
共有 1 个文件被更改,包括 81 次插入70 次删除
  1. 81 70
      src/views/peopleChuRu/bdglLeave/index.vue

+ 81 - 70
src/views/peopleChuRu/bdglLeave/index.vue

@@ -314,6 +314,13 @@
       </el-table-column>
     </el-table>
 
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
     <!-- 添加或修改人员请假对话框 -->
     <el-dialog
       :title="title"
@@ -532,7 +539,7 @@
       </div>
       <div v-if="statussp == '1'" class="dialog-footer" slot="footer">
         <el-button type="primary" @click="submitForms">通过</el-button>
-        <el-button @click="boHui">驳回</el-button>
+        <el-button @click="boHui" size="btn">驳回</el-button>
       </div>
     </el-dialog>
 
@@ -725,7 +732,7 @@
       </el-form>
       <div class="dialog-footer" slot="footer">
         <el-button type="primary" @click="TSsubmitForms">通过</el-button>
-        <el-button @click="TSboHui">驳回</el-button>
+        <el-button @click="TSboHui" size="btn">驳回</el-button>
       </div>
     </el-dialog>
   </div>
@@ -859,6 +866,10 @@ export default {
       trueng: true,
       // 归队数据
       guidui: {},
+      // 审批对象
+      shenPis: {},
+      // 特殊审批对象
+      teShu: {},
     };
   },
   created() {
@@ -890,6 +901,7 @@ export default {
     },
     // // 特殊审批按钮触发
     handleUpdatess(row) {
+      this.teShu = row;
       this.statussp = "2";
       this.getBuMeng();
       // 获取字典类型
@@ -906,6 +918,8 @@ export default {
     },
     // 审批按钮操作
     handleUpdates(row) {
+      console.log(row);
+      this.shenPis = row;
       this.statussp = "1";
       this.getBuMeng();
       // 获取字典类型
@@ -914,6 +928,7 @@ export default {
       const id = row.id || this.ids;
       getBdglLeave(id).then((response) => {
         this.form = response.data;
+        console.log(this.form);
         this.getYong(this.form.unitId);
         this.getRen(this.form.unitId);
         this.open = true;
@@ -1002,21 +1017,22 @@ export default {
     },
     //审批通过按钮
     submitForms() {
-      this.bdglLeaveList.forEach((item) => {
-        if (item.shenPiJiBie == "一级") {
-          this.form.status1 = 1;
-          this.form.contents = "一级审批通过";
-        } else if (item.shenPiJiBie == "二级") {
-          this.form.status2 = 1;
-          this.form.contents = "二级审批通过";
-        } else if (item.shenPiJiBie == "三级") {
-          this.form.status3 = 1;
-          this.form.contents = "三级审批通过";
-        } else if (item.shenPiJiBie == "四级") {
-          this.form.status4 = 1;
-          this.form.contents = "四级审批通过";
-        }
-      });
+      if (this.shenPis.shenPiJiBie == "一级") {
+        this.form.status1 = 1;
+        this.form.contents = "一级审批通过";
+      } else if (this.shenPis.shenPiJiBie == "二级") {
+        this.form.status2 = 1;
+        this.form.contents = "二级审批通过";
+        console.log("二级");
+      } else if (this.shenPis.shenPiJiBie == "三级") {
+        this.form.status3 = 1;
+        this.form.contents = "三级审批通过";
+        console.log("三级");
+      } else if (this.shenPis.shenPiJiBie == "四级") {
+        this.form.status4 = 1;
+        this.form.contents = "四级审批通过";
+        console.log("四级");
+      }
       updateBdglLeave(this.form).then((response) => {
         this.$modal.msgSuccess("审批成功");
         this.open = false;
@@ -1027,21 +1043,19 @@ export default {
     boHui() {
       this.$refs["form"].validate((valid) => {
         if (valid) {
-          this.bdglLeaveList.forEach((item) => {
-            if (item.shenPiJiBie == "一级") {
-              this.form.status1 = 2;
-              return (this.form.contents = "一级审批驳回");
-            } else if (item.shenPiJiBie == "二级") {
-              this.form.status2 = 2;
-              return (this.form.contents = "二级审批驳回");
-            } else if (item.shenPiJiBie == "三级") {
-              this.form.status3 = 2;
-              return (this.form.contents = "三级审批驳回");
-            } else if (item.shenPiJiBie == "四级") {
-              this.form.status4 = 2;
-              return (this.form.contents = "四级审批驳回");
-            }
-          });
+          if (this.shenPis.shenPiJiBie == "一级") {
+            this.form.status1 = 2;
+            return (this.shenPis.form.contents = "一级审批驳回");
+          } else if (item.shenPiJiBie == "二级") {
+            this.form.status2 = 2;
+            return (this.shenPis.form.contents = "二级审批驳回");
+          } else if (item.shenPiJiBie == "三级") {
+            this.form.status3 = 2;
+            return (this.shenPis.form.contents = "三级审批驳回");
+          } else if (item.shenPiJiBie == "四级") {
+            this.form.status4 = 2;
+            return (this.shenPis.form.contents = "四级审批驳回");
+          }
           updateBdglLeave(this.form).then((response) => {
             this.$modal.msgSuccess("审批成功");
             this.open = false;
@@ -1054,25 +1068,23 @@ export default {
     TSsubmitForms() {
       this.$refs["forms"].validateField("specialApproval", (valid) => {
         if (!valid) {
-          this.bdglLeaveList.forEach((item) => {
-            if (item.shenPiJiBie == "一级") {
-              this.form.status1 = 3;
-              this.form.common = "1";
-              this.form.contents = "一级审批通过";
-            } else if (item.shenPiJiBie == "二级") {
-              this.form.status2 = 3;
-              this.form.common = "2";
-              this.form.contents = "二级审批通过";
-            } else if (item.shenPiJiBie == "三级") {
-              this.form.status3 = 3;
-              this.form.common = "3";
-              this.form.contents = "三级审批通过";
-            } else if (item.shenPiJiBie == "四级") {
-              this.form.status4 = 3;
-              this.form.common = "4";
-              this.form.contents = "四级审批通过";
-            }
-          });
+          if (this.teShu.shenPiJiBie == "一级") {
+            this.form.status1 = 3;
+            this.form.common = "1";
+            this.form.contents = "一级审批通过";
+          } else if (this.teShu.shenPiJiBie == "二级") {
+            this.form.status2 = 3;
+            this.form.common = "2";
+            this.form.contents = "二级审批通过";
+          } else if (this.teShu.shenPiJiBie == "三级") {
+            this.form.status3 = 3;
+            this.form.common = "3";
+            this.form.contents = "三级审批通过";
+          } else if (this.teShu.shenPiJiBie == "四级") {
+            this.form.status4 = 3;
+            this.form.common = "4";
+            this.form.contents = "四级审批通过";
+          }
           if (this.form.id != null) {
             updateBdglLeave(this.form).then((response) => {
               this.$modal.msgSuccess("审批成功");
@@ -1087,25 +1099,24 @@ export default {
     TSboHui() {
       this.$refs["forms"].validate((valid) => {
         if (valid) {
-          this.bdglLeaveList.forEach((item) => {
-            if (item.shenPiJiBie == "一级") {
-              this.form.status1 = 2;
-              this.form.common = "1";
-              return (this.form.contents = "一级审批驳回");
-            } else if (item.shenPiJiBie == "二级") {
-              this.form.status2 = 2;
-              this.form.common = "2";
-              return (this.form.contents = "二级审批驳回");
-            } else if (item.shenPiJiBie == "三级") {
-              this.form.status3 = 2;
-              this.form.common = "3";
-              return (this.form.contents = "三级审批驳回");
-            } else if (item.shenPiJiBie == "四级") {
-              this.form.status4 = 2;
-              this.form.common = "4";
-              return (this.form.contents = "四级审批驳回");
-            }
-          });
+          console.log(this.teShu);
+          if (this.teShu.shenPiJiBie == "一级") {
+            this.form.status1 = 2;
+            this.form.common = "1";
+            this.form.contents = "一级审批驳回";
+          } else if (this.teShu.shenPiJiBie == "二级") {
+            this.form.status2 = 2;
+            this.form.common = "2";
+            this.form.contents = "二级审批驳回";
+          } else if (this.teShu.shenPiJiBie == "三级") {
+            this.form.status3 = 2;
+            this.form.common = "3";
+            this.form.contents = "三级审批驳回";
+          } else if (this.teShu.shenPiJiBie == "四级") {
+            this.form.status4 = 2;
+            this.form.common = "4";
+            this.form.contents = "四级审批驳回";
+          }
           if (this.form.id != null) {
             updateBdglLeave(this.form).then((response) => {
               this.$modal.msgSuccess("审批成功");