From b9b2d3d63335fa9c72078e64f1ac1b365cf2d8dd Mon Sep 17 00:00:00 2001
From: “dzb” <2632970487@qq.com>
Date: 星期五, 21 十月 2022 00:10:27 +0800
Subject: [PATCH] 修改用户管理

---
 src/views/operate/disposal/casepool/pool/createUser/vio/index.vue |   83 ++++++++++++++++++++++++++++-------------
 1 files changed, 57 insertions(+), 26 deletions(-)

diff --git a/src/views/operate/disposal/casepool/pool/createUser/vio/index.vue b/src/views/operate/disposal/casepool/pool/createUser/vio/index.vue
index 853168f..b3348c0 100644
--- a/src/views/operate/disposal/casepool/pool/createUser/vio/index.vue
+++ b/src/views/operate/disposal/casepool/pool/createUser/vio/index.vue
@@ -47,10 +47,9 @@
                     <!-- 妗堢敱 -->
                     <el-form-item class="optionItem anyou" label="妗堢敱:" prop="actionCause">
                         <el-select v-model="vio.actionCause" placeholder="璇疯緭鍏ユ鐢�" filterable @blur="selectBlur">
-                            <el-option v-for="item in anYouList" :key="item.id" :label="item.name" :value="item.name" >
+                            <el-option v-for="item in anYouList" :key="item.id" :label="item.name" :value="item.name">
                             </el-option>
                         </el-select>
-                        <!-- <el-input v-model="vio.actionCause" placeholder="璇疯緭鍏ユ鐢�"></el-input> -->
                     </el-form-item>
                     <!-- 鎵�灞炲尯鍘� -->
                     <!-- <el-form-item class="optionItems" label="鎵�灞炲尯鍘�:" prop="status">
@@ -64,16 +63,16 @@
                         <!-- 鎵�灞炶閬� -->
                         <el-form-item class="optionItems" label="鎵�灞炶閬�:" prop="streetId">
                             <el-select v-model="vio.streetId" placeholder="璇烽�夋嫨鎵�灞炶閬�" @change="handleStreet">
-                                <el-option v-for="item in streetList" :key="item.id" :label="item.name" :value="item.id"
-                                    :disabled="item.disabled">
+                                <el-option v-for="item in streetList" :key="item.id" :label="item.regionName" :value="item.id"
+                                    >
                                 </el-option>
                             </el-select>
                         </el-form-item>
                         <!-- 鎵�灞炵ぞ鍖� -->
                         <el-form-item class="optionItems" label="鎵�灞炵ぞ鍖�:" prop="communityId">
                             <el-select v-model="vio.communityId" placeholder="璇烽�夋嫨鎵�灞炵ぞ鍖�">
-                                <el-option v-for="item in communityList" :key="item.id" :label="item.name"
-                                    :value="item.id" :disabled="item.disabled">
+                                <el-option v-for="item in communityList" :key="item.id" :label="item.regionName"
+                                    :value="item.id" >
                                 </el-option>
                             </el-select>
                         </el-form-item>
@@ -106,11 +105,18 @@
                             v-model="vio.description">
                         </el-input>
                     </el-form-item>
-                    <!-- 鎶ヨ鏃堕棿 -->
-                    <el-form-item class="optionItems" label="鎶ヨ鏃堕棿:" prop="alarmTime">
-                        <el-date-picker v-model="vio.alarmTime" type="datetime" placeholder="閫夋嫨鎶ヨ鏃堕棿">
-                        </el-date-picker>
-                    </el-form-item>
+                    <div class="user-item">
+                        <!-- 鎶ヨ鏃堕棿 -->
+                        <el-form-item class="optionItems" label="鎶ヨ鏃堕棿:" prop="alarmTime">
+                            <el-date-picker v-model="vio.alarmTime" type="datetime" placeholder="閫夋嫨鎶ヨ鏃堕棿">
+                            </el-date-picker>
+                        </el-form-item>
+                        <!-- 璋冨害鏃堕檺 -->
+                        <el-form-item class="optionItems" label="璋冨害鏃堕檺:" prop="limitTime">
+                            <el-date-picker v-model="vio.limitTime" type="datetime" placeholder="閫夋嫨璋冨害鏃堕檺">
+                            </el-date-picker>
+                        </el-form-item>
+                    </div>
                     <!-- 濉啓鍙嶆槧浜轰俊鎭� -->
                     <el-form-item class="optionItems" label="濉啓鍙嶆槧浜轰俊鎭�">
                     </el-form-item>
@@ -141,8 +147,8 @@
 <script>
 import MyMap from '@/components/map'
 import { validateName, validatePhone, validateCarNum, validateCardId } from '@/utils/validate'
-import {getTypeList} from '@/utils/helper'
-import {parseTime} from "@/utils/index"
+import { getTypeList } from '@/utils/helper'
+import { parseTime } from "@/utils/index"
 export default {
     components: {
         MyMap
@@ -254,6 +260,13 @@
                 }
             }
         }
+        const checkLimit = (rule, value, callback) => {
+            if (value) {
+                callback();
+            } else {
+                callback(new Error('璋冨害鏃堕檺鏃堕棿涓嶈兘涓虹┖'))
+            }
+        }
         return {
             vio: {
                 actionCause: "",//妗堢敱
@@ -271,7 +284,8 @@
                 streetId: '',//鎵�灞炶閬�
                 typeId: '',//灏忕被
                 gradeId: '',//妗堜欢绛夌骇
-                alarmTime: ''
+                alarmTime: '',
+                limitTime: '',//璋冨害鏃堕檺
             },
             createRoleRules: {
                 //妗堢敱
@@ -353,6 +367,11 @@
                     {
                         required: true, trigger: 'change', validator: checkDate
                     }
+                ],
+                limitTime: [
+                    {
+                        required: true, trigger: 'change', validator: checkLimit
+                    }
                 ]
 
             },
@@ -379,7 +398,7 @@
         console.log(this.mytype);
         this.vio.category = this.mytype + 1;
         setBigKindList();
-        getStreetList();
+        getStreetList(0);
         getEventLevel();
     },
     methods: {
@@ -435,7 +454,7 @@
         },
         // 鑾峰彇妗堜欢绛夌骇鍒楄〃
         async getEventLevel() {
-            this.eventLevelList = await getTypeList(1,'02');
+            this.eventLevelList = await getTypeList(1, '02');
         },
         // 鏌ヨ鎵�灞炴鐢�
         async getAnYouList() {
@@ -460,7 +479,8 @@
                         url: 'sccg/base_case/addition_violation',
                         data: {
                             ...vio,
-                            alarmTime:parseTime(vio.alarmTime),
+                            alarmTime: parseTime(vio.alarmTime),
+                            limitTime:parseTime(vio.limitTime),
                         }
                     })
                         .then(res => {
@@ -489,8 +509,18 @@
             this.$emit('changeDialog', { flag: false })
         },
         // 鑾峰彇琛楅亾淇℃伅
-        async getStreetList() {
-            this.streetList = await getTypeList(1,'10');
+        async getStreetList(id) {
+            let arr
+            await this.$axios({
+                method:'get',
+                url:`sccg/sccg_region/getChildren/${id}`,
+            })
+            .then(res=>{
+                if(res.code === 200){
+                    arr = res.data;
+                }
+            })
+            this.streetList = arr;
         },
         // 琛楅亾鏇存敼
         handleStreet(id) {
@@ -499,7 +529,7 @@
             // this.communityList = getTypeList(1,'11')
             this.$axios({
                 method: 'get',
-                url: 'sccg/dict/query_social_type?id=' + id
+                url: `sccg/sccg_region/getChildren/${id}`
             })
                 .then(res => {
                     this.communityList = res.data;
@@ -521,8 +551,8 @@
             this.setAnYouList(id);
         },
         // 妗堢敱杈撳叆
-        selectBlur(e){
-            if(e.target.value){
+        selectBlur(e) {
+            if (e.target.value) {
                 this.vio.actionCause = e.target.value;
                 console.log(e.target.value);
             }
@@ -537,7 +567,7 @@
     padding: 20px 10px 50px;
 
     .input-area {
-        flex: 1;
+        flex: 3;
         padding: 10px 20px;
 
         .input-header {
@@ -584,10 +614,11 @@
     }
 
     .map-area {
-        flex: 1;
+        flex: 2;
     }
-    .anyou{
-        :deep(.el-select){
+
+    .anyou {
+        :deep(.el-select) {
             display: block;
         }
     }

--
Gitblit v1.8.0