From 5cd763edc85f3b14bc98af906828521d65276f48 Mon Sep 17 00:00:00 2001
From: “dzb” <2632970487@qq.com>
Date: 星期四, 13 十月 2022 17:57:11 +0800
Subject: [PATCH] 修改系统框架、消息管理新增

---
 src/components/dispatch/index.vue |   30 ++++++++++++++++++------------
 1 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/src/components/dispatch/index.vue b/src/components/dispatch/index.vue
index 66d3df2..5e8c919 100644
--- a/src/components/dispatch/index.vue
+++ b/src/components/dispatch/index.vue
@@ -15,7 +15,7 @@
             <!-- 閫夋嫨鎵ф硶杞� -->
             <el-form-item label="閫夋嫨鎵ф硶杞�:" prop="enforcementCar">
                 <el-select v-model="dispatch.enforcementCar" placeholder="璇烽�夋嫨">
-                    <el-option v-for="item in carOptions" :key="item.value" :label="item.label" :value="item.value">
+                    <el-option v-for="item in carOptions" :key="item.id" :label="item.carNumber" :value="item.id">
                     </el-option>
                 </el-select>
             </el-form-item>
@@ -74,7 +74,7 @@
     components: {
         MyMap
     },
-    props: ['id', 'changeDialog', 'refresh', 'mytype'],
+    props: ['id', 'changeDialog', 'refresh', 'mytype'], 
     created() {
         // 鍒ゆ柇杞﹁締绫诲瀷
         this.mytype === 1 ? this.getLawCarList() : this.getSoilCarList();
@@ -118,14 +118,14 @@
             if (value) {
                 callback();
             } else {
-                callback(new Error('鎵ф硶浜哄憳涓嶈兘涓虹┖'))
+                callback()
             }
         }
         const checkNumber = (rule, value, callback) => {
             if (value) {
                 callback();
             } else {
-                callback(new Error('鎵ф硶浜哄憳缂栧彿涓嶈兘涓虹┖'))
+                callback()
             }
         }
         return {
@@ -143,7 +143,7 @@
             rules: {
                 contactWay: [
                     {
-                        required: true, trigger: 'blur', validator: checkPhone
+                        required: false, trigger: 'blur', validator: checkPhone
                     }
                 ],
                 dispatchOpinion: [
@@ -159,7 +159,7 @@
                     { required: true, trigger: 'change', validator: checkPerson }
                 ],
                 lawEnforcerName: [
-                    { required: true, trigger: 'change', validator: checkNumber }
+                    { required: false, trigger: 'change', validator: checkNumber }
                 ],
             },
             carOptions: [
@@ -232,8 +232,8 @@
                 url: `sccg/car_Manage/query_enforce?current=1&size=1000`
             })
                 .then(res => {
-                    this.carOptions = res.data.orders;
-                    console.log(res);
+                    this.carOptions = res.data.records;
+                    console.log(res,this.carOptions);
                 })
         },
         // 鑾峰彇娓e湡杞﹁締
@@ -243,7 +243,7 @@
                 url: `sccg/car_Manage/query_slag?current=1&size=1000`
             })
                 .then(res => {
-                    this.carOptions = res.data.orders;
+                    this.carOptions = res.data.records;
                     console.log(res);
                 })
         },
@@ -291,7 +291,9 @@
             this.dispatch.lawEnforcer = '';
             this.dispatch.enforcementTeam = '';
             await this.getTeamList(id);
-            await this.getDepartUserList(id);
+            if(this.squadronOptions.length===0){
+                await this.getDepartUserList(id);
+            }
         },
         // 涓槦鏇存敼
         async handleMidChange(id) {
@@ -300,17 +302,21 @@
         },
         // 浜哄憳鏇存敼
         async handlePerChange(id){
-            await this.getLawUser(id);
+            let obj =  await this.getLawUser(id);
+            this.dispatch.lawEnforcerName = obj.nickName;
+            this.dispatch.contactWay = obj.mobile;
         },
         // 鑾峰彇鎵ф硶浜哄憳淇℃伅
         async getLawUser(id){
+            let obj = {}
             await this.$axios({
                 method:'get',
                 url:`sccg/admin/${id}`
             })
             .then(res=>{
-                console.log(res);
+                obj = res.data;
             })
+            return obj;
         }
     }
 }

--
Gitblit v1.8.0