From 1e802661b5396beaae4506986e78860af6115a03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=AC=E9=8B=86=E5=B1=BE?= <804461479@qq.com> Date: Fri, 13 Dec 2024 17:04:24 +0800 Subject: [PATCH] =?UTF-8?q?feated:=E6=B7=BB=E5=8A=A0=E7=BB=8F=E7=BA=AC?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/src/components/AreaSelect.vue | 442 +++++++++--------- .../admin/src/views/company/drawershow.vue | 18 + 2 files changed, 242 insertions(+), 218 deletions(-) diff --git a/enterprise-manager-ui/admin/src/components/AreaSelect.vue b/enterprise-manager-ui/admin/src/components/AreaSelect.vue index 605b428..9329b59 100644 --- a/enterprise-manager-ui/admin/src/components/AreaSelect.vue +++ b/enterprise-manager-ui/admin/src/components/AreaSelect.vue @@ -1,133 +1,140 @@ <template> <div id="addressHorizontalSelect"> <el-row :gutter="10"> - <el-col - :span="span"> + <el-col :span="span"> <el-select - size="small" - v-model="provinceCode" - @focus="getProvinces" - @change="changeProvince" - placeholder="鐪�" - filterable> + size="small" + v-model="provinceCode" + @focus="getProvinces" + @change="changeProvince" + placeholder="鐪�" + filterable + > <el-option - v-for="item in provinceList" - :key="item.iid" - :label="item.name" - :value="item.iid"> + v-for="item in provinceList" + :key="item.iid" + :label="item.name" + :value="item.iid" + > </el-option> </el-select> </el-col> - <el-col - :span="span" - v-if="!hideCity"> + <el-col :span="span" v-if="!hideCity"> <el-select - size="small" - v-model="cityCode" - @focus="getCities" - @change="changeCity" - placeholder="甯�" - filterable> + size="small" + v-model="cityCode" + @focus="getCities" + @change="changeCity" + placeholder="甯�" + filterable + > <el-option - v-for="item in cityList" - :key="item.iid" - :label="item.name" - :value="item.iid"> + v-for="item in cityList" + :key="item.iid" + :label="item.name" + :value="item.iid" + > </el-option> </el-select> </el-col> - <el-col - :span="span" - v-if="!hideCity && !hideArea"> + <el-col :span="span" v-if="!hideCity && !hideArea"> <el-select - size="small" - v-model="areaCode" - @focus="getAreas" - @change="changeArea" - placeholder="鍖�/鍘�" - filterable> + size="small" + v-model="areaCode" + @focus="getAreas" + @change="changeArea" + placeholder="鍖�/鍘�" + filterable + > <el-option - v-for="item in areaList" - :key="item.iid" - :label="item.name" - :value="item.iid"> + v-for="item in areaList" + :key="item.iid" + :label="item.name" + :value="item.iid" + > </el-option> </el-select> </el-col> - <el-col - :span="span" - v-if="!hideCity && !hideArea&& !hideStreet"> + <el-col :span="span" v-if="!hideCity && !hideArea && !hideStreet"> <el-select - size="small" - v-model="streetCode" - @focus="getStreet" - @change="changeStreet" - placeholder="琛楅亾" - filterable> + size="small" + v-model="streetCode" + @focus="getStreet" + @change="changeStreet" + placeholder="琛楅亾" + filterable + > <el-option - v-for="item in streetList" - :key="item.iid" - :label="item.name" - :value="item.iid"> + v-for="item in streetList" + :key="item.iid" + :label="item.name" + :value="item.iid" + > </el-option> </el-select> </el-col> <el-col - :span="span" - v-if="!hideCity && !hideArea&& !hideStreet&& !hideStreet"> + :span="span" + v-if="!hideCity && !hideArea && !hideStreet && !hideStreet" + > <el-select - size="small" - v-model="communityCode" - @focus="getCommunity" - @change="changeCommunity" - placeholder="绀惧尯" - filterable> + size="small" + v-model="communityCode" + @focus="getCommunity" + @change="changeCommunity" + placeholder="绀惧尯" + filterable + > <el-option - v-for="item in communityList" - :key="item.iid" - :label="item.name" - :value="item.iid"> + v-for="item in communityList" + :key="item.iid" + :label="item.name" + :value="item.iid" + > </el-option> </el-select> </el-col> - </el-row> </div> </template> <script> export default { - name: 'addressHorizontalSelect', + name: "addressHorizontalSelect", components: {}, props: { value: { type: [String, Number, Array], }, - hideCity: { // 闅愯棌甯� + hideCity: { + // 闅愯棌甯� type: Boolean, - default: false + default: false, }, - hideArea: { // 闅愯棌鍖�/鍘� + hideArea: { + // 闅愯棌鍖�/鍘� type: Boolean, - default: false + default: false, }, - hideStreet: { // 闅愯棌琛楅亾 + hideStreet: { + // 闅愯棌琛楅亾 type: Boolean, - default: false + default: false, }, - hideCommunity: { // 闅愯棌绀惧尯 + hideCommunity: { + // 闅愯棌绀惧尯 type: Boolean, - default: false + default: false, }, - addressCode: null // 鍦板潃缂栫爜 + addressCode: null, // 鍦板潃缂栫爜 }, model: { - prop: 'value', - event: 'addressSelect' + prop: "value", + event: "addressSelect", }, data() { @@ -137,242 +144,241 @@ export default { areaList: [], // 鍖�/鍘垮垪琛� streetList: [], // 琛楅亾鍒楄〃 communityList: [], // 绀惧尯鍒楄〃 - provinceCode: '', // 鐪佷唤缂栫爜 - cityCode: '', // 鍩庡競缂栫爜 - areaCode: '', // 鍖�/鍘跨紪鐮� - streetCode: '', // 琛楅亾缂栫爜 - communityCode: '', // 绀惧尯缂栫爜 + provinceCode: "", // 鐪佷唤缂栫爜 + cityCode: "", // 鍩庡競缂栫爜 + areaCode: "", // 鍖�/鍘跨紪鐮� + streetCode: "", // 琛楅亾缂栫爜 + communityCode: "", // 绀惧尯缂栫爜 cityFlag: false, // 閬垮厤閲嶅璇锋眰鐨勬爣蹇� provinceFlag: false, areaFlag: false, streetFlag: false, communityFlag: false, - provinceName:'', - cityName:'', - areaName:'', - streetName:'', - communityName:'' - } + provinceName: "", + cityName: "", + areaName: "", + streetName: "", + communityName: "", + }; }, computed: { span() { if (this.hideCity) { - return 24 + return 24; } if (this.hideArea) { - return 12 + return 12; } if (this.hideStreet) { - return 8 + return 8; } if (this.hideCommunity) { - return 6 + return 6; } - return 3 - } + return 3; + }, }, created() { - this.getProvinces() + this.getProvinces(); }, methods: { - fetchData(array, code) { var split = code.split("&"); - let parms = {pid: split[0], size: -1} - this.$post("/base/area/list", parms).then((res) => { - if (res.code == 1) { - array.splice(0, array.length); - res.data.data.map(i => { - let obj = {} - obj.name = i.name - obj.iid = i.iid + "&" + i.areaCode - array.push(obj) - return obj; - }) - } - }) - .catch((error) => { - this.$message.error(error.message); - }); + let parms = { pid: split[0], size: -1 }; + this.$post("/base/area/list", parms) + .then((res) => { + if (res.code == 1) { + array.splice(0, array.length); + res.data.data.map((i) => { + let obj = {}; + obj.name = i.name; + obj.iid = i.iid + "&" + i.areaCode; + array.push(obj); + return obj; + }); + } + }) + .catch((error) => { + this.$message.error(error.message); + }); }, // 鏍规嵁鍥藉缂栫爜鑾峰彇鐪佷唤鍒楄〃 getProvinces() { if (this.provinceFlag) { - return + return; } - this.fetchData(this.provinceList, "0&510000000000") - this.provinceFlag = true + this.fetchData(this.provinceList, "0&510000000000"); + this.provinceFlag = true; }, // 鐪佷唤淇敼锛屾媺鍙栧搴斿煄甯傚垪琛� changeProvince(val) { - this.fetchData(this.cityList, this.provinceCode) - this.cityFlag = true - this.cityCode = '' - this.areaCode = '' - this.streetCode = '' - this.communityCode = '' + this.fetchData(this.cityList, this.provinceCode); + this.cityFlag = true; + this.cityCode = ""; + this.areaCode = ""; + this.streetCode = ""; + this.communityCode = ""; - this.cityName='' - this.areaName='' - this.streetName='' - this.communityName='' + this.cityName = ""; + this.areaName = ""; + this.streetName = ""; + this.communityName = ""; var split = val.split("&"); this.$emit("input", split[1]); - this.$emit('addressSelect', split[1]) + this.$emit("addressSelect", split[1]); }, // 鏍规嵁鐪佷唤缂栫爜鑾峰彇鍩庡競鍒楄〃 getCities() { if (this.cityFlag) { - return + return; } if (this.provinceCode) { - this.fetchData(this.cityList, this.provinceCode) - this.cityFlag = true + this.fetchData(this.cityList, this.provinceCode); + this.cityFlag = true; } }, // 鍩庡競淇敼锛屾媺鍙栧搴斿尯鍩熷垪琛� changeCity(val) { - this.fetchData(this.areaList, this.cityCode) - this.areaFlag = true - this.areaCode = '' - this.streetCode = '' - this.communityCode = '' + this.fetchData(this.areaList, this.cityCode); + this.areaFlag = true; + this.areaCode = ""; + this.streetCode = ""; + this.communityCode = ""; - this.areaName='' - this.streetName='' - this.communityName='' + this.areaName = ""; + this.streetName = ""; + this.communityName = ""; var split = val.split("&"); this.$emit("input", split[1]); - this.$emit('addressSelect', split[1]) + this.$emit("addressSelect", split[1]); }, // 鏍规嵁鍩庡競缂栫爜鑾峰彇鍖哄煙鍒楄〃 getAreas() { if (this.areaFlag) { - return + return; } if (this.cityCode) { - this.fetchData(this.areaList, this.cityCode) + this.fetchData(this.areaList, this.cityCode); } }, // 鍖哄煙淇敼 changeArea(val) { - this.fetchData(this.streetList, this.areaCode) - this.areaFlag = true - this.streetCode = '' - this.communityCode = '' + this.fetchData(this.streetList, this.areaCode); + this.areaFlag = true; + this.streetCode = ""; + this.communityCode = ""; - this.streetName='' - this.communityName='' + this.streetName = ""; + this.communityName = ""; var split = val.split("&"); this.$emit("input", split[1]); - this.$emit('addressSelect', split[1]) + this.$emit("addressSelect", split[1]); }, - // 鏍规嵁鍖哄煙缂栫爜鑾峰彇琛楅亾鍒楄〃 getStreet() { if (this.streetFlag) { - return + return; } if (this.areaCode) { - this.fetchData(this.streetList, this.areaCode) - this.streetFlag = true + this.fetchData(this.streetList, this.areaCode); + this.streetFlag = true; } }, // 琛楅亾淇敼锛屾媺鍙栧搴旂ぞ鍖哄垪琛� changeStreet(val) { - this.fetchData(this.communityList, this.streetCode) - this.streetFlag = true - this.communityCode = '' + this.fetchData(this.communityList, this.streetCode); + this.streetFlag = true; + this.communityCode = ""; - this.communityName='' + this.communityName = ""; var split = val.split("&"); this.$emit("input", split[1]); - this.$emit('addressSelect', split[1]) + this.$emit("addressSelect", split[1]); }, - // 鏍规嵁鍖哄煙缂栫爜鑾峰彇琛楅亾鍒楄〃 getCommunity() { if (this.communityFlag) { - return + return; } if (this.streetCode) { - this.fetchData(this.communityList, this.streetCode) - this.communityFlag = true + this.fetchData(this.communityList, this.streetCode); + this.communityFlag = true; } }, // 绀惧尯淇敼锛屾媺鍙栫ぞ鍖哄垪琛� changeCommunity(val) { - this.fetchData(this.communityList, this.streetCode) - this.communityFlag = true + this.fetchData(this.communityList, this.streetCode); + this.communityFlag = true; var split = val.split("&"); this.$emit("input", split[1]); - this.$emit('addressSelect', split[1]) + this.$emit("addressSelect", split[1]); }, // 閲嶇疆鐪佸競鍖�/鍘跨紪鐮� reset() { - this.provinceCode = '', - this.cityCode = '', - this.areaCode = '', - this.streetCode = '', - this.communityCode = '' + (this.provinceCode = ""), + (this.cityCode = ""), + (this.areaCode = ""), + (this.streetCode = ""), + (this.communityCode = ""); }, // 鍦板潃缂栫爜杞崲鎴愮渷甯傚尯琛楅亾绀惧尯鍒楄〃 addressCodeToList(addressCode) { - if (!addressCode) return false - let parms = {areaCode:addressCode} - this.$post("/base/area/list", parms).then((res) => { - if (res.code == 1) { - if(res.data.data.length>0){ - let area = res.data.data[0]; - let pid = area.pid + "&" + area.areaCode + if (!addressCode) return false; + let parms = { areaCode: addressCode }; + this.$post("/base/area/list", parms) + .then((res) => { + if (res.code == 1) { + if (res.data.data.length > 0) { + let area = res.data.data[0]; + let pid = area.pid + "&" + area.areaCode; - if(area.areaLevel=='1'){ - //鐪� - this.provinceCode = area.iid + "&" + area.areaCode - this.provinceName = area.name - this.fetchData(this.provinceList, pid) - return - }else if(area.areaLevel=='2'){ - //甯� - this.cityCode = area.iid + "&" + area.areaCode - this.cityName = area.name - this.fetchData(this.cityList, pid) - }else if(area.areaLevel=='3'){ - //鍖哄幙 - this.areaCode = area.iid + "&" + area.areaCode - this.areaName = area.name - this.fetchData(this.areaList, pid) - }else if(area.areaLevel=='4'){ - //琛楅亾 - let pid = area.pid + "&" + area.areaCode - this.streetName = area.name - this.fetchData(this.streetList,pid) - this.streetCode = area.iid + "&" + area.areaCode - }else if(area.areaLevel=='5'){ - //绀惧尯 - this.fetchData(this.communityList, pid) - this.communityName = area.name - this.communityCode = area.iid + "&" + area.areaCode + if (area.areaLevel == "1") { + //鐪� + this.provinceCode = area.iid + "&" + area.areaCode; + this.provinceName = area.name; + this.fetchData(this.provinceList, pid); + return; + } else if (area.areaLevel == "2") { + //甯� + this.cityCode = area.iid + "&" + area.areaCode; + this.cityName = area.name; + this.fetchData(this.cityList, pid); + } else if (area.areaLevel == "3") { + //鍖哄幙 + this.areaCode = area.iid + "&" + area.areaCode; + this.areaName = area.name; + this.fetchData(this.areaList, pid); + } else if (area.areaLevel == "4") { + //琛楅亾 + let pid = area.pid + "&" + area.areaCode; + this.streetName = area.name; + this.fetchData(this.streetList, pid); + this.streetCode = area.iid + "&" + area.areaCode; + } else if (area.areaLevel == "5") { + //绀惧尯 + this.fetchData(this.communityList, pid); + this.communityName = area.name; + this.communityCode = area.iid + "&" + area.areaCode; + } + this.$post("/base/area/list", { iid: area.pid }).then((res) => { + this.addressCodeToList(res.data.data[0].areaCode); + }); } - this.$post("/base/area/list", {iid:area.pid}).then((res) => { - this.addressCodeToList(res.data.data[0].areaCode) - }) } - } - }).catch((error) => { - this.$message.error(error.message); - }); - - } + }) + .catch((error) => { + this.$message.error(error.message); + }); + }, }, watch: { @@ -381,16 +387,16 @@ export default { immediate: true, handler(newVal) { if (newVal) { - this.addressCodeToList(newVal) + this.addressCodeToList(newVal); } else { - this.$nextTick(() => { - this.reset() - }) + this.$nextTick(() => { + this.reset(); + }); } - } - } - } -} + }, + }, + }, +}; </script> <style lang="less" scoped> diff --git a/enterprise-manager-ui/admin/src/views/company/drawershow.vue b/enterprise-manager-ui/admin/src/views/company/drawershow.vue index 99b6ec2..6a5e34e 100644 --- a/enterprise-manager-ui/admin/src/views/company/drawershow.vue +++ b/enterprise-manager-ui/admin/src/views/company/drawershow.vue @@ -62,6 +62,24 @@ placeholder="璇疯緭鍏ヨ缁嗗湴鍧€" /> </el-row> + <el-row> + <!-- <Field label="鎵€鍦ㄥ湴" prop="location" v-model="form.location" placeholder="璇疯緭鍏ユ墍鍦ㄥ湴"/> --> + <Field + label="缁忓害" + prop="lon" + v-model="form.lon" + placeholder="璇疯緭鍏ョ粡搴�" + /> + </el-row> + <el-row> + <!-- <Field label="鎵€鍦ㄥ湴" prop="location" v-model="form.location" placeholder="璇疯緭鍏ユ墍鍦ㄥ湴"/> --> + <Field + label="绾害" + prop="lati" + v-model="form.lati" + placeholder="璇疯緭鍏ョ含搴�" + /> + </el-row> <!-- <Field label="鐢靛瓙閭欢鍦板潃" prop="email" v-model="form.email" placeholder="璇疯緭鍏ョ數瀛愰偖浠跺湴鍧€"/> <Field label="鍏徃缃戠珯" prop="website" v-model="form.website" placeholder="璇疯緭鍏ュ叕鍙哥綉绔�"/> <Field label="绋庡姟鐧昏鍙�" prop="taxRegistrationNumber" v-model="form.taxRegistrationNumber" placeholder="璇疯緭鍏ョ◣鍔$櫥璁板彿"/> -- 2.24.3