Browse Source

区域管理列表

gzb
guozhongbo 9 months ago
parent
commit
a5ca5265b6

+ 2
- 2
public/config.js View File

@@ -2,9 +2,9 @@ window.isTest = true; //测试环境true 正式环境false
2 2
 window._config = window.isTest
3 3
   ? {
4 4
       // 测试环境
5
-      baseUrl: "http://49.4.26.249:8331/",
5
+      baseUrl: "http://mcapitest.xhkjedu.com/",
6 6
       baseImageUrl: "http://49.4.26.249:8331/",
7
-      showImageUrl: "https://mctest.xhkjedu.com/",
7
+      showImageUrl: "https://mcapitest.xhkjedu.com/",
8 8
       axiosApiTimeout: 60, // 接口超时时间 单位秒
9 9
       axiosFileTimeout: 120, // 上传文件超时时间 单位秒
10 10
       // 开发者

+ 15
- 5
src/views/regionSection/applicationManage/applicationGroup.vue View File

@@ -57,9 +57,9 @@
57 57
         :label-width="100"
58 58
         inline
59 59
       >
60
-        <FormItem label="名称" prop="areaname" style="width: 100%">
60
+        <FormItem label="名称" prop="appgroupName" style="width: 100%">
61 61
           <Input
62
-            v-model="wallpaperInfo.appName"
62
+            v-model="wallpaperInfo.appgroupName"
63 63
             placeholder="请输入名称"
64 64
           ></Input>
65 65
         </FormItem>
@@ -130,6 +130,7 @@
130 130
 <script>
131 131
 import { date_format } from "@/utils";
132 132
 import axios from "axios";
133
+import {appgroup_add} from "@/api/appgroup";
133 134
 export default {
134 135
   data() {
135 136
     return {
@@ -276,13 +277,13 @@ export default {
276 277
         .then((res) => {
277 278
           this.showLoading = false;
278 279
           if (res.data.code === 0) {
279
-            console.log(res.data.obj);
280 280
             this.wallpaperInfo.iconPath = res.data.obj;
281
+            this.$Message.success(res.data.msg);
281 282
           } else {
282 283
             this.$Message.error(res.data.msg);
283 284
           }
284 285
         })
285
-        .catch(() => {
286
+        .catch((err) => {
286 287
           this.showLoading = false;
287 288
           this.$Message.error("图片上传失败");
288 289
         });
@@ -355,7 +356,16 @@ export default {
355 356
             return;
356 357
           }
357 358
           this.wallpaperInfo.show = false;
358
-
359
+          console.log(this.wallpaperInfo)
360
+          appgroup_add({appgroupName:this.wallpaperInfo.appgroupName,
361
+            iconPath:this.wallpaperInfo.iconPath,
362
+            comm:this.wallpaperInfo.comm,}).then(res=>{
363
+              if(res.code === 0){
364
+                  console.log(res.obj)
365
+              }else {
366
+                this.$Message.error(res.msg)
367
+              }
368
+          })
359 369
         }
360 370
       });
361 371
     },

+ 130
- 60
src/views/regionSection/regionManage/schoolManage.vue View File

@@ -16,15 +16,47 @@
16 16
             >{{ item.regionName }}</Option
17 17
           >
18 18
         </Select>
19
+        <Select
20
+          :transfer="true"
21
+          v-model="searchForm.provinceid"
22
+          style="width: 120px; margin: 0 10px"
23
+          placeholder="请选择省份"
24
+          @on-change="provinceChange(searchForm.provinceid, 1)"
25
+        >
26
+          <Option
27
+            v-for="item in areaList"
28
+            :value="item.areaCode"
29
+            :key="item.areaCode"
30
+            >{{ item.areaName }}</Option
31
+          >
32
+        </Select>
33
+        <Select
34
+          :transfer="true"
35
+          v-model="searchForm.marketid"
36
+          @on-change="marketChange(searchForm.marketid, 1)"
37
+          style="width: 120px"
38
+          placeholder="请选择市"
39
+        >
40
+          <Option
41
+            v-for="item in searchForm.marketList"
42
+            :value="item.areaCode"
43
+            :key="item.areaCode"
44
+            >{{ item.areaName }}</Option
45
+          >
46
+        </Select>
19 47
         <Select
20 48
           :transfer="true"
21 49
           v-model="searchForm.areaCode"
22
-          @on-change="searchList()"
23
-          style="margin-right: 10px; width: 150px"
50
+          @on-change="regionChange(1)"
51
+          style="width: 120px; margin: 0 10px"
52
+          placeholder="请选择区"
24 53
         >
25
-          <Option :value="0">所有状态</Option>
26
-          <Option :value="1">启用</Option>
27
-          <Option :value="2">禁用</Option>
54
+          <Option
55
+            v-for="item in searchForm.regionList"
56
+            :value="item.areaCode"
57
+            :key="item.areaCode"
58
+            >{{ item.areaName }}</Option
59
+          >
28 60
         </Select>
29 61
         <Input
30 62
           v-model="searchForm.schoolName"
@@ -101,45 +133,44 @@
101 133
         </FormItem>
102 134
         <FormItem label="省市区" class="require" style="width: 100%">
103 135
           <Select
104
-              :transfer="true"
105
-              v-model="adminInfo.provinceid"
106
-              style="width: 120px"
107
-              placeholder="请选择省份"
108
-              @on-change="provinceChange"
136
+            :transfer="true"
137
+            v-model="adminInfo.provinceid"
138
+            style="width: 120px"
139
+            placeholder="请选择省份"
140
+            @on-change="provinceChange(adminInfo.provinceid, null)"
109 141
           >
110 142
             <Option
111
-                v-for="item in areaList"
112
-                :value="item.areaCode"
113
-                :key="item.areaCode"
114
-            >{{ item.areaName }}</Option
143
+              v-for="item in areaList"
144
+              :value="item.areaCode"
145
+              :key="item.areaCode"
146
+              >{{ item.areaName }}</Option
115 147
             >
116 148
           </Select>
117 149
           <Select
118
-              :transfer="true"
119
-              v-model="adminInfo.marketid"
120
-              @on-change="marketChange"
121
-              style="width: 120px;margin: 0 10px"
122
-              placeholder="请选择市"
150
+            :transfer="true"
151
+            v-model="adminInfo.marketid"
152
+            @on-change="marketChange(adminInfo.marketid, null)"
153
+            style="width: 120px; margin: 0 10px"
154
+            placeholder="请选择市"
123 155
           >
124 156
             <Option
125
-                v-for="item in marketList"
126
-                :value="item.areaCode"
127
-                :key="item.areaCode"
128
-            >{{ item.areaName }}</Option
157
+              v-for="item in marketList"
158
+              :value="item.areaCode"
159
+              :key="item.areaCode"
160
+              >{{ item.areaName }}</Option
129 161
             >
130 162
           </Select>
131 163
           <Select
132
-              :transfer="true"
133
-              v-model="adminInfo.areaCode"
134
-              @on-change="regionChange"
135
-              style="width: 120px"
136
-              placeholder="请选择区"
164
+            :transfer="true"
165
+            v-model="adminInfo.areaCode"
166
+            style="width: 120px"
167
+            placeholder="请选择区"
137 168
           >
138 169
             <Option
139
-                v-for="item in regionList"
140
-                :value="item.areaCode"
141
-                :key="item.areaCode"
142
-            >{{ item.areaName }}</Option
170
+              v-for="item in regionList"
171
+              :value="item.areaCode"
172
+              :key="item.areaCode"
173
+              >{{ item.areaName }}</Option
143 174
             >
144 175
           </Select>
145 176
         </FormItem>
@@ -322,10 +353,12 @@ export default {
322 353
     return {
323 354
       searchForm: {
324 355
         dropList: [],
356
+        marketList: [],
357
+        regionList: [],
358
+        provinceid: "",
359
+        marketid: "",
325 360
         areaCode: "",
326
-        // 0所有区域
327
-        regionid: 0,
328
-        // 是否启用0所有 1启用 2禁用
361
+        regionid: 0, // 0所有区域
329 362
         schoolName: "",
330 363
         page: 1,
331 364
         size: 10,
@@ -432,7 +465,7 @@ export default {
432 465
         },
433 466
         {
434 467
           title: "省市区",
435
-          key: "regionName",
468
+          key: "areaName",
436 469
           align: "center"
437 470
         },
438 471
         {
@@ -471,40 +504,62 @@ export default {
471 504
       localStorage.getItem("xh_control_userInfo")
472 505
     ).content;
473 506
     this.getSearchRegionList();
474
-    this.getAreaList()
507
+    this.getAreaList();
475 508
     this.searchList();
476 509
   },
477 510
   mounted() {},
478 511
   methods: {
479 512
     //选择省份
480
-    provinceChange(){
481
-      let arr = this.areaList.filter(v=>v.areaCode === this.adminInfo.provinceid);
482
-      this.marketList = arr[0].childList;
483
-      this.adminInfo.marketid = "";
484
-      this.regionList = [];
485
-      this.adminInfo.areaCode = "";
513
+    provinceChange(id, type) {
514
+      let arr = this.areaList.filter((v) => v.areaCode === id);
515
+      if (type) {
516
+        this.searchForm.marketList = arr[0].childList;
517
+        this.searchForm.marketid = "";
518
+        this.searchForm.regionList = [];
519
+        this.searchForm.areaCode = "";
520
+      } else {
521
+        this.marketList = arr[0].childList;
522
+        this.adminInfo.marketid = "";
523
+        this.regionList = [];
524
+        this.adminInfo.areaCode = "";
525
+      }
486 526
     },
487 527
     //选择市
488
-    marketChange(){
489
-      let arr = this.marketList.filter(v=>v.areaCode === this.adminInfo.marketid);
490
-      this.regionList = arr[0].childList;
491
-      this.adminInfo.areaCode = "";
528
+    marketChange(id, type) {
529
+      if (!id) {
530
+        return;
531
+      }
532
+      if (type) {
533
+        let arr = this.searchForm.marketList.filter((v) => v.areaCode === id);
534
+        this.searchForm.regionList = arr[0].childList;
535
+        this.searchForm.areaCode = "";
536
+      } else {
537
+        let arr = this.marketList.filter((v) => v.areaCode === id);
538
+        this.regionList = arr[0].childList;
539
+        this.adminInfo.areaCode = "";
540
+      }
492 541
     },
493 542
     //选中区
494
-    regionChange(){
495
-      let arr = this.regionList.filter(v=>v.areaCode === this.adminInfo.areaCode)[0];
496
-      console.log(arr)
497
-      this.adminInfo.areaName = arr.areaName;
543
+    regionChange() {
544
+      if (!this.searchForm.areaCode) {
545
+        return;
546
+      }
547
+      let obj = this.searchForm.regionList.filter(
548
+        (v) => v.areaCode === this.searchForm.areaCode
549
+      )[0];
550
+      console.log(obj);
551
+      this.searchForm.areaName = obj.areaAll;
552
+      this.searchList();
498 553
     },
499
-    getAreaList(){
500
-      area_list_sel({}).then(res=>{
501
-        if(res.code === 0){
502
-          console.log(res.obj)
554
+    getAreaList() {
555
+      area_list_sel({}).then((res) => {
556
+        if (res.code === 0) {
557
+          console.log(res.obj);
503 558
           this.areaList = res.obj;
504
-        }else {
505
-          this.$Message.error(res.msg)
559
+        } else {
560
+          this.$Message.error(res.msg);
506 561
         }
507
-      })
562
+      });
508 563
     },
509 564
     // 获取搜索区域列表
510 565
     getSearchRegionList() {
@@ -641,6 +696,10 @@ export default {
641 696
               this.adminInfo.timer = null;
642 697
             }
643 698
           }
699
+          let areaObj = this.regionList.filter(
700
+            (v) => v.areaCode === this.adminInfo.areaCode
701
+          )[0];
702
+          this.adminInfo.areaName = areaObj.areaAll;
644 703
           this.adminInfo.show = false;
645 704
           let api = this.adminInfo.schoolid ? school_edit : school_add;
646 705
           let form = {
@@ -685,14 +744,24 @@ export default {
685 744
     toEdit(row) {
686 745
       school_detail({ schoolid: row.schoolid }).then((res) => {
687 746
         if (res.code === 0) {
747
+          let str = res.obj.areaCode;
748
+          //获取省市区
749
+          let obj1 = this.areaList.filter((v) =>
750
+            v.areaCode.includes(str.substring(0, 2))
751
+          )[0];
752
+          this.marketList = obj1.childList;
753
+          let obj2 = obj1.childList.filter((v) =>
754
+            v.areaCode.includes(str.substring(0, 4))
755
+          )[0];
756
+          this.regionList = obj2.childList;
688 757
           this.adminInfo = {
689 758
             show: true,
690 759
             timer: null,
691 760
             second: 0,
692 761
             schoolid: res.obj.schoolid,
693 762
             schoolName: res.obj.schoolName,
694
-            provinceid: "",
695
-            marketid: "",
763
+            provinceid: obj1.areaCode,
764
+            marketid: obj2.areaCode,
696 765
             areaCode: res.obj.areaCode,
697 766
             areaName: res.obj.areaName,
698 767
             address: res.obj.address,
@@ -702,6 +771,7 @@ export default {
702 771
             createAdmin: false,
703 772
             admin: {}
704 773
           };
774
+          console.log(this.adminInfo);
705 775
         } else {
706 776
           this.$Message.error(res.msg);
707 777
         }

Loading…
Cancel
Save