From 8e2a42e4a2da78f9cda9fa3e7732a0ef72f0c906 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 12 Nov 2021 09:29:02 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/zhba_enterprises

---
 src/views/dispatch/dispatch.vue |  102 +++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 86 insertions(+), 16 deletions(-)

diff --git a/src/views/dispatch/dispatch.vue b/src/views/dispatch/dispatch.vue
index e3800af..bac9f77 100644
--- a/src/views/dispatch/dispatch.vue
+++ b/src/views/dispatch/dispatch.vue
@@ -95,7 +95,7 @@
       <!-- <span v-else-if="typeTABS.prop === 'tab3'">选项卡内容3</span> -->
     </div>
   </basic-container>
-</template> 
+</template>
 
 <script>
 import {
@@ -112,6 +112,15 @@
 import { mapState } from "vuex";
 export default {
   data() {
+    var phones = (rule, value, callback) => {
+      window.yanzhengphons =
+        /^1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$/;
+      if (!yanzhengphons.test(value)) {
+        callback(new Error("请输入正确电话"));
+      } else {
+        callback();
+      }
+    };
     return {
       typeTABS: {}, //标签页
       deptId: "",
@@ -218,7 +227,14 @@
             searchSpan: 4,
             width: 210,
             // span: 12,
-            labelWidth: 118,
+            labelWidth: 138,
+            rules: [
+              {
+                required: true,
+                message: "请输入名称",
+                trigger: "click",
+              },
+            ],
           },
           {
             label: "保安公司",
@@ -242,7 +258,7 @@
                 trigger: "click",
               },
             ],
-            labelWidth: 118,
+            labelWidth: 138,
             width: 230,
             searchLabelWidth: 80,
             search: true,
@@ -260,7 +276,7 @@
             searchSpan: 4,
             overHidden: true,
             // span: 12,
-            labelWidth: 118,
+            labelWidth: 138,
           },
           {
             label: "合同生效时间",
@@ -293,7 +309,8 @@
             search: true,
             searchSpan: 4,
             overHidden: true,
-            labelWidth: 118,
+            labelWidth: 138,
+            parent:false,
             type: "tree",
             dicUrl: "/api/jurisdiction/lazy-tree",
             props: {
@@ -319,7 +336,7 @@
             editDisplay: false,
             viewDisplay: false,
             overHidden: true,
-            labelWidth: 118,
+            labelWidth: 138,
             type: "tree",
             dicUrl: "/api/jurisdiction/lazy-tree",
             props: {
@@ -339,40 +356,96 @@
           // {
           //   label: " 派遣人数",
           //   prop: "num",
-          //   labelWidth: 118,
+          //   labelWidth: 138,
+          // },
+          // {
+          //   label: "合同生效时间",
+          //   prop: "releaseTimeRange",
+          //   type: "date",
+          //   format: "yyyy-MM-dd",
+          //   valueFormat: "yyyy-MM-dd",
+          //   searchValue: [this.getStartTime(), this.getEndTime()],
+          //   // searchRange: true,
+          //   searchSpan: 5,
+          //   searchLabelWidth: 110,
+          //   hide: true,
+          //   value: [this.getStartTime(), this.getEndTime()],
+          //   // addDisplay: false,
+          //   // editDisplay: false,
+          //   // viewDisplay: false,
+          //   range: true,
+          //   rules: [
+          //     {
+          //       required: true,
+          //       message: "请输入时间",
+          //       trigger: "blur",
+          //     },
+          //   ],
           // },
           {
             label: "合同开始时间",
             prop: "startTime",
-            labelWidth: 118,
+            labelWidth: 138,
             type: "date",
             format: "yyyy-MM-dd",
             valueFormat: "yyyy-MM-dd",
             // search: true,
+            rules: [
+              {
+                required: true,
+                message: "请选择开始时间",
+                trigger: "click",
+              },
+            ],
             // searchSpan: 4,
             // overHidden: true
           },
           {
             label: "合同结束时间",
             prop: "endTime",
-            labelWidth: 118,
+            labelWidth: 138,
             type: "date",
             format: "yyyy-MM-dd",
             valueFormat: "yyyy-MM-dd",
             // search: true,
+            rules: [
+              {
+                required: true,
+                message: "请选择结束时间",
+                trigger: "click",
+              },
+            ],
             // searchSpan: 4,
             // overHidden: true
           },
           {
             label: " 负责人",
             prop: "linkman",
-            labelWidth: 118,
+            labelWidth: 138,
+            rules: [
+              {
+                required: true,
+                message: "请输入负责人",
+                trigger: "click",
+              },
+            ],
           },
           {
             label: "负责人联系方式",
             prop: "phone",
-            labelWidth: 118,
+            labelWidth: 138,
             width: 110,
+            rules: [
+              {
+                required: true,
+                message: "请输入联系方式",
+                trigger: "click",
+              },
+              {
+                validator: phones,
+                trigger: ["change", "blur"],
+              },
+            ],
           },
         ],
       },
@@ -543,7 +616,6 @@
       this.onLoad(this.page, this.query);
     },
     rowClick(row) {
-      // console.log(row);
       window.localStorage.setItem("paqiandata", JSON.stringify(row));
       this.$router.push({
         path: "/dispatchChild",
@@ -596,9 +668,8 @@
       if (this.useifid != 266) {
         values["deptId"] = this.useifid;
       }
-      // console.log(values);
       if (this.userInfo.role_name == "公安管理员") {
-        params["jurisdiction"] = that.userInfo.jurisdiction;
+        values["jurisdiction"] = that.userInfo.jurisdiction;
       }
       getdata(
         page.currentPage,
@@ -606,7 +677,6 @@
         // Object.assign(params, this.query)
         values
       ).then((res) => {
-        // console.log(res);
         const data = res.data.data;
         this.page.total = data.total;
         this.data = data.records;
@@ -656,4 +726,4 @@
 .el-collapse-item {
   padding-top: 15px !important;
 }
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.9.3