From c4e67a8942e514b65ab41bb19781d50576c15725 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Fri, 24 Sep 2021 19:56:52 +0800
Subject: [PATCH] 用户

---
 src/views/dispatch/dispatch.vue |  219 +++++++++++++++---------------------------------------
 1 files changed, 61 insertions(+), 158 deletions(-)

diff --git a/src/views/dispatch/dispatch.vue b/src/views/dispatch/dispatch.vue
index 62292e5..806c805 100644
--- a/src/views/dispatch/dispatch.vue
+++ b/src/views/dispatch/dispatch.vue
@@ -30,26 +30,24 @@
           </el-button>
 
           <el-button
-                type="success"
-                size="small"
-                plain
-                icon="el-icon-upload2"
-                @click="handleImport"
-                >批量导入
-              </el-button>
+            type="success"
+            size="small"
+            plain
+            icon="el-icon-upload2"
+            @click="handleImport"
+            >批量导入
+          </el-button>
         </template>
 
         <template slot-scope="{ row }" slot="jurisdiction">
-          {{row.jurisdiction==-1?"":row.jurisdiction}}
+          {{ row.jurisdiction == -1 ? "" : row.jurisdiction }}
         </template>
-
       </avue-crud>
 
       <el-dialog
         title="派遣单位导入"
         append-to-body
         :visible.sync="excelBox"
-        
         width="555px"
       >
         <avue-form
@@ -111,7 +109,7 @@
   remove1,
 } from "@/api/dispatch/dispatch";
 import { mapGetters } from "vuex";
-
+import { mapState } from "vuex";
 export default {
   data() {
     return {
@@ -216,7 +214,9 @@
             prop: "name",
             search: true,
             searchLabelWidth: 110,
+            overHidden: true,
             searchSpan: 4,
+            width: 210,
             // span: 12,
             labelWidth: 118,
           },
@@ -224,6 +224,7 @@
             label: "保安公司",
             prop: "deptId",
             type: "tree",
+            overHidden: true,
             dicUrl:
               "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
             props: {
@@ -243,7 +244,7 @@
               },
             ],
             labelWidth: 118,
-            width: 200,
+            width: 230,
             searchLabelWidth: 80,
             search: true,
             searchSpan: 4,
@@ -258,13 +259,14 @@
             // search: true,
             searchLabelWidth: 110,
             searchSpan: 4,
+            overHidden: true,
             // span: 12,
             labelWidth: 118,
           },
           {
             label: "合同生效时间",
             prop: "releaseTimeRange",
-            type: "datetime",
+            type: "date",
             format: "yyyy-MM-dd",
             valueFormat: "yyyy-MM-dd",
             searchValue: [this.getStartTime(), this.getEndTime()],
@@ -287,13 +289,14 @@
           {
             label: "所属辖区",
             prop: "jurisdiction",
-            // multiple: true,
+            hide: true,
             searchLabelWidth: 80,
             search: true,
             searchSpan: 4,
+            overHidden: true,
             labelWidth: 118,
             type: "tree",
-            dicUrl: "/api/jurisdiction/lazy-tree?parentId=0",
+            dicUrl: "/api/jurisdiction/lazy-tree",
             props: {
               label: "title",
               value: "id",
@@ -303,16 +306,42 @@
             rules: [
               {
                 required: true,
-                message: "请选择所属行政区",
+                message: "请选择所属辖区",
                 trigger: "click",
               },
             ],
           },
           {
-            label: " 派遣人数",
-            prop: "num",
+            label: "所属辖区",
+            prop: "jurisdictionName",
+            // multiple: true,
+            searchLabelWidth: 80,
+            addDisplay: false,
+            editDisplay: false,
+            viewDisplay: false,
+            overHidden: true,
             labelWidth: 118,
+            type: "tree",
+            dicUrl: "/api/jurisdiction/lazy-tree",
+            props: {
+              label: "title",
+              value: "id",
+            },
+            checkStrictly: true,
+            slot: true,
+            rules: [
+              {
+                required: true,
+                message: "请选择所属辖区",
+                trigger: "click",
+              },
+            ],
           },
+          // {
+          //   label: " 派遣人数",
+          //   prop: "num",
+          //   labelWidth: 118,
+          // },
           {
             label: "合同开始时间",
             prop: "startTime",
@@ -344,10 +373,21 @@
             label: "负责人联系方式",
             prop: "phone",
             labelWidth: 118,
+            width: 110,
           },
         ],
       },
     };
+  },
+  created() {
+    if (this.userInfo.role_name == "保安公司管理员") {
+      const deptColumn = this.findObject(this.option.column, "deptId");
+      deptColumn.search = false;
+      deptColumn.addDisplay = false;
+      deptColumn.editDisplay = false;
+      deptColumn.viewDisplay = false;
+      deptColumn.hide = true;
+    }
   },
   computed: {
     ...mapGetters(["userInfo"]),
@@ -365,6 +405,9 @@
       });
       return ids1.join(",");
     },
+        ...mapState({
+      userInfo: (state) => state.user.userInfo,
+        })
   },
   methods: {
     handleChangeTABS(column) {
@@ -393,13 +436,7 @@
       //   this.$message.success("页码" + val);
     },
     rowSave(form, done, loading) {
-      // var that = this;
-      // var form = this.data[0];
-      // delete form.id;
-      // for (var k = 0; k < 13; k++) {
       form["deptId"] = this.userInfo.dept_id;
-      // form["tenantName"] = form.this.userInfo.user_name;
-
       adddata(form).then(
         (res) => {
           this.onLoad(this.page);
@@ -427,7 +464,6 @@
       this.onLoad(this.page);
     },
     rowUpdate(row, index, done, loading) {
-      console.log(row);
       update(row).then(
         () => {
           this.onLoad(this.page);
@@ -573,139 +609,6 @@
       this.refreshChange();
       done();
     },
-
-
-    //派遣服务公司登记
-
-    //派遣记录
-    // sizeChange1(val) {
-    //   this.page1.currentPage = 1;
-    //   this.page1.pageSize = val;
-    //   // this.getData();
-    //   this.onLoad1(this.page1, this.query1);
-    //   //   this.$message.success("行数" + val);
-    // },
-    // currentChange1(val) {
-    //   this.page1.currentPage = val;
-    //   // this.getData();
-    //   this.onLoad1(this.page1, this.query1);
-    //   //   this.$message.success("页码" + val);
-    // },
-    // rowSave1(form, done, loading) {
-    //   var that = this;
-    //   var form = this.data1[0];
-    //   delete form.id;
-    //   for (var k = 0; k < 13; k++) {
-    //     adddata1(form).then(
-    //       (res) => {
-    //         this.onLoad1(this.page1);
-    //         this.$message({
-    //           type: "success",
-    //           message: "操作成功!",
-    //         });
-    //         done();
-    //       },
-    //       (error) => {
-    //         window.console.log(error);
-    //         loading();
-    //       }
-    //     );
-    //   }
-    // },
-    // searchChange1(params, done) {
-    //   this.query1 = params;
-    //   this.page1.currentPage = 1;
-    //   this.onLoad1(this.page1, params);
-    //   done();
-    // },
-    // searchReset1() {
-    //   this.query = {};
-    //   this.onLoad1(this.page1);
-    // },
-    // rowUpdate1(row, index, done, loading) {
-    //   console.log(row);
-    //   update1(row).then(
-    //     () => {
-    //       this.onLoad1(this.page1);
-    //       this.$message({
-    //         type: "success",
-    //         message: "操作成功!",
-    //       });
-    //       done();
-    //     },
-    //     (error) => {
-    //       window.console.log(error);
-    //       loading();
-    //     }
-    //   );
-    // },
-    // rowDel1(row) {
-    //   this.$confirm("确定将选择数据删除?", {
-    //     confirmButtonText: "确定",
-    //     cancelButtonText: "取消",
-    //     type: "warning",
-    //   })
-    //     .then(() => {
-    //       return remove1(row.id);
-    //     })
-    //     .then(() => {
-    //       this.onLoad1(this.page1);
-    //       this.$message({
-    //         type: "success",
-    //         message: "操作成功!",
-    //       });
-    //     });
-    // },
-    // selectionChange1(list) {
-    //   this.selectionList1 = list;
-    //   console.log(this.selectionList1.length);
-    // },
-    // handleDelete1() {
-    //   console.log(this.selectionList1);
-    //   if (this.selectionList1.length === 0) {
-    //     this.$message.warning("请选择至少一条数据");
-    //     return;
-    //   }
-    //   this.$confirm("确定将选择数据删除?", {
-    //     confirmButtonText: "确定",
-    //     cancelButtonText: "取消",
-    //     type: "warning",
-    //   })
-    //     .then(() => {
-    //       return remove1(this.ids1);
-    //     })
-    //     .then(() => {
-    //       this.onLoad1(this.page1);
-    //       this.$message({
-    //         type: "success",
-    //         message: "操作成功!",
-    //       });
-    //       this.$refs.crudrec1.toggleSelection();
-    //     });
-    // },
-    // refreshChange1() {
-    //   // console.log(4534)
-    //   this.onLoad1(this.page1, this.query1);
-    // },
-
-    // //
-    // onLoad1(page, params = {}) {
-    //   this.loading1 = true;
-    //   // console.log(page);
-    //   getdata1(
-    //     page.currentPage,
-    //     page.pageSize,
-    //     Object.assign(params, this.query)
-    //   ).then((res) => {
-    //     // console.log(res);
-    //     const data = res.data.data;
-    //     this.page1.total = data.total;
-    //     this.data1 = data.records;
-    //     console.log(this.data1, 1);
-    //     this.loading1 = false;
-    //   });
-    // },
-    //派遣记录
   },
   mounted() {
     this.typeTABS = this.optionTABS.column[0];

--
Gitblit v1.9.3