From 89106b70e53f796599f2daf63b685bd8e8631ed3 Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期一, 24 十月 2022 17:30:41 +0800
Subject: [PATCH] Merge branch 'master' of http://42.193.1.25:9521/r/sccg_ui

---
 src/views/operate/disposal/casepool/pool/createUser/ill/index.vue |   75 ++++++++++++++++++++++++++++++-------
 1 files changed, 60 insertions(+), 15 deletions(-)

diff --git a/src/views/operate/disposal/casepool/pool/createUser/ill/index.vue b/src/views/operate/disposal/casepool/pool/createUser/ill/index.vue
index e32248f..cc4d427 100644
--- a/src/views/operate/disposal/casepool/pool/createUser/ill/index.vue
+++ b/src/views/operate/disposal/casepool/pool/createUser/ill/index.vue
@@ -12,7 +12,7 @@
                         <!-- 闂绫诲瀷 -->
                         <el-form-item class="optionItem" label="闂绫诲瀷:" prop="category">
                             <el-select v-model="ill.type" placeholder="杩濆缓" disabled>
-                                <el-option v-for="item in typeList" :key="item.name" :label="item.name"
+                                <el-option v-for="item in communityList" :key="item.name" :label="item.name"
                                     :value="item.value" :disabled="item.disabled">
                                 </el-option>
                             </el-select>
@@ -43,11 +43,21 @@
                         <el-form-item class="optionItems" label="杩濆缓鍦扮偣:" prop="site">
                             <el-input placeholder="璇峰~鍐欒繚寤哄湴鐐�" v-model="ill.site"></el-input>
                         </el-form-item>
+                    </div>
+                    <div class="user-item">
+                        <!-- 鎵�灞炶閬� -->
+                        <el-form-item class="optionItems" label="鎵�灞炶閬�:" prop="streetId">
+                            <el-select v-model="ill.streetId" placeholder="璇烽�夋嫨鎵�灞炶閬�" @change="handleStreet">
+                                <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="ill.communityId" placeholder="璇烽�夋嫨鎵�灞炵ぞ鍖�">
-                                <el-option v-for="item in typeList" :key="item.name" :label="item.name"
-                                    :value="item.value">
+                                <el-option v-for="item in communityList" :key="item.id" :label="item.regionName"
+                                    :value="item.id">
                                 </el-option>
                             </el-select>
                         </el-form-item>
@@ -237,6 +247,13 @@
                 callback(new Error('鎶ヨ鏃堕棿涓嶈兘涓虹┖'))
             }
         }
+        const checkStreet=(rule, value, callback) => {
+            if (value) {
+                callback();
+            } else {
+                callback(new Error('鎵�灞炶閬撲笉鑳戒负绌�'))
+            }
+        }
         return {
             ill: {
                 buildingArea: '',
@@ -326,23 +343,23 @@
                     {
                         required: true, trigger: 'change', validator: checkDate
                     }
-                ]
+                ],
+                streetId: [
+                    {
+                        required: true, trigger: 'change', validator: checkStreet
+                    }
+                ],
             },
             bigKindList: [],
-            typeList: [
-                {
-                    name: '绀惧尯1',
-                    value: 1,
-                },
-                {
-                    name: '绀惧尯2',
-                    value: 2,
-                }
+            communityList: [
             ],
+            streetList: [],
         }
     },
     created() {
-        const { getBigKind, getCommityList } = this;
+        const { getBigKind, getCommityList,getStreetList } = this;
+        getStreetList(0);
+        
         // this.ill.category = this.mytype + 1;
         getBigKind();
         getCommityList();
@@ -437,6 +454,34 @@
                     console.log(res);
                 })
         },
+        // 鑾峰彇琛楅亾淇℃伅
+        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) {
+            console.log(id);
+            this.ill.communityId = '';
+            // this.communityList = getcommunityList(1,'11')
+            this.$axios({
+                method: 'get',
+                url: `sccg/sccg_region/getChildren/${id}`
+            })
+                .then(res => {
+                    console.log(res.data)
+                    this.communityList = res.data;
+                })
+        },
         handleBack(){
             this.$emit('changeDialog', { flag: false });
         }
@@ -465,7 +510,7 @@
 <style lang="scss" scoped>
 .ill {
     display: flex;
-    padding: 20px 50px;
+    padding: 20px 10px 50px;
 
     .user-item {
         display: flex;

--
Gitblit v1.8.0