|
@@ -99,7 +99,50 @@
|
99
|
99
|
placeholder="请输入学校简称"
|
100
|
100
|
></Input>
|
101
|
101
|
</FormItem>
|
102
|
|
- <FormItem label="省市区" style="width: 100%"> </FormItem>
|
|
102
|
+ <FormItem label="省市区" class="require" style="width: 100%">
|
|
103
|
+ <Select
|
|
104
|
+ :transfer="true"
|
|
105
|
+ v-model="adminInfo.provinceid"
|
|
106
|
+ style="width: 120px"
|
|
107
|
+ placeholder="请选择省份"
|
|
108
|
+ @on-change="provinceChange"
|
|
109
|
+ >
|
|
110
|
+ <Option
|
|
111
|
+ v-for="item in areaList"
|
|
112
|
+ :value="item.areaCode"
|
|
113
|
+ :key="item.areaCode"
|
|
114
|
+ >{{ item.areaName }}</Option
|
|
115
|
+ >
|
|
116
|
+ </Select>
|
|
117
|
+ <Select
|
|
118
|
+ :transfer="true"
|
|
119
|
+ v-model="adminInfo.marketid"
|
|
120
|
+ @on-change="marketChange"
|
|
121
|
+ style="width: 120px;margin: 0 10px"
|
|
122
|
+ placeholder="请选择市"
|
|
123
|
+ >
|
|
124
|
+ <Option
|
|
125
|
+ v-for="item in marketList"
|
|
126
|
+ :value="item.areaCode"
|
|
127
|
+ :key="item.areaCode"
|
|
128
|
+ >{{ item.areaName }}</Option
|
|
129
|
+ >
|
|
130
|
+ </Select>
|
|
131
|
+ <Select
|
|
132
|
+ :transfer="true"
|
|
133
|
+ v-model="adminInfo.areaCode"
|
|
134
|
+ @on-change="regionChange"
|
|
135
|
+ style="width: 120px"
|
|
136
|
+ placeholder="请选择区"
|
|
137
|
+ >
|
|
138
|
+ <Option
|
|
139
|
+ v-for="item in regionList"
|
|
140
|
+ :value="item.areaCode"
|
|
141
|
+ :key="item.areaCode"
|
|
142
|
+ >{{ item.areaName }}</Option
|
|
143
|
+ >
|
|
144
|
+ </Select>
|
|
145
|
+ </FormItem>
|
103
|
146
|
<FormItem label="地址" style="width: 100%">
|
104
|
147
|
<Input v-model="adminInfo.address" placeholder="请输入地址"></Input>
|
105
|
148
|
</FormItem>
|
|
@@ -240,19 +283,11 @@
|
240
|
283
|
</template>
|
241
|
284
|
|
242
|
285
|
<script>
|
243
|
|
-import {
|
244
|
|
- admin_list_pt,
|
245
|
|
- admin_add,
|
246
|
|
- admin_edit,
|
247
|
|
- admin_delete,
|
248
|
|
- admin_enable,
|
249
|
|
- admin_disabled,
|
250
|
|
- admin_list_qy
|
251
|
|
-} from "@/api/admin";
|
252
|
286
|
import { region_list_sel_pt } from "@/api/region";
|
253
|
287
|
import { login_msg_code } from "@/api/login";
|
254
|
288
|
import { generateRandomString } from "@/utils";
|
255
|
289
|
import {
|
|
290
|
+ area_list_sel,
|
256
|
291
|
school_add,
|
257
|
292
|
school_delete,
|
258
|
293
|
school_detail,
|
|
@@ -425,6 +460,9 @@ export default {
|
425
|
460
|
align: "center"
|
426
|
461
|
}
|
427
|
462
|
],
|
|
463
|
+ areaList: [],
|
|
464
|
+ marketList: [],
|
|
465
|
+ regionList: [],
|
428
|
466
|
userInfo: {}
|
429
|
467
|
};
|
430
|
468
|
},
|
|
@@ -433,10 +471,41 @@ export default {
|
433
|
471
|
localStorage.getItem("xh_control_userInfo")
|
434
|
472
|
).content;
|
435
|
473
|
this.getSearchRegionList();
|
|
474
|
+ this.getAreaList()
|
436
|
475
|
this.searchList();
|
437
|
476
|
},
|
438
|
477
|
mounted() {},
|
439
|
478
|
methods: {
|
|
479
|
+ //选择省份
|
|
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 = "";
|
|
486
|
+ },
|
|
487
|
+ //选择市
|
|
488
|
+ marketChange(){
|
|
489
|
+ let arr = this.marketList.filter(v=>v.areaCode === this.adminInfo.marketid);
|
|
490
|
+ this.regionList = arr[0].childList;
|
|
491
|
+ this.adminInfo.areaCode = "";
|
|
492
|
+ },
|
|
493
|
+ //选中区
|
|
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;
|
|
498
|
+ },
|
|
499
|
+ getAreaList(){
|
|
500
|
+ area_list_sel({}).then(res=>{
|
|
501
|
+ if(res.code === 0){
|
|
502
|
+ console.log(res.obj)
|
|
503
|
+ this.areaList = res.obj;
|
|
504
|
+ }else {
|
|
505
|
+ this.$Message.error(res.msg)
|
|
506
|
+ }
|
|
507
|
+ })
|
|
508
|
+ },
|
440
|
509
|
// 获取搜索区域列表
|
441
|
510
|
getSearchRegionList() {
|
442
|
511
|
region_list_sel_pt({}).then((data) => {
|
|
@@ -488,6 +557,8 @@ export default {
|
488
|
557
|
second: 60,
|
489
|
558
|
schoolid: null,
|
490
|
559
|
schoolName: "",
|
|
560
|
+ provinceid: "",
|
|
561
|
+ marketid: "",
|
491
|
562
|
areaCode: "",
|
492
|
563
|
areaName: "",
|
493
|
564
|
address: "",
|
|
@@ -586,7 +657,6 @@ export default {
|
586
|
657
|
form.schoolid = this.adminInfo.schoolid;
|
587
|
658
|
form.rversion = this.adminInfo.rversion;
|
588
|
659
|
}
|
589
|
|
- console.log(this.adminInfo);
|
590
|
660
|
//添加管理员
|
591
|
661
|
if (this.adminInfo.createAdmin) {
|
592
|
662
|
form.admin = {
|
|
@@ -597,6 +667,7 @@ export default {
|
597
|
667
|
msgcode: this.adminInfo.admin.msgcode
|
598
|
668
|
};
|
599
|
669
|
}
|
|
670
|
+ console.log(form);
|
600
|
671
|
api(form).then((data) => {
|
601
|
672
|
if (data.code === 0) {
|
602
|
673
|
this.searchList();
|
|
@@ -620,6 +691,8 @@ export default {
|
620
|
691
|
second: 0,
|
621
|
692
|
schoolid: res.obj.schoolid,
|
622
|
693
|
schoolName: res.obj.schoolName,
|
|
694
|
+ provinceid: "",
|
|
695
|
+ marketid: "",
|
623
|
696
|
areaCode: res.obj.areaCode,
|
624
|
697
|
areaName: res.obj.areaName,
|
625
|
698
|
address: res.obj.address,
|