diff --git a/public/index.html b/public/index.html index cd88591..9d4c016 100644 --- a/public/index.html +++ b/public/index.html @@ -12,7 +12,7 @@ securityJsCode: '68787c7a64e7240670e6a538b326d64b', } - + diff --git a/src/components/villagePick/index.vue b/src/components/villagePick/index.vue new file mode 100644 index 0000000..1584f8b --- /dev/null +++ b/src/components/villagePick/index.vue @@ -0,0 +1,70 @@ + + + + + diff --git a/src/main.js b/src/main.js index b283a1e..a611e6b 100644 --- a/src/main.js +++ b/src/main.js @@ -50,7 +50,7 @@ Vue.use(avue) import VueAMap from "vue-amap"; VueAMap.initAMapApiLoader({ key:'1a9ee0079fcb3c6c64c96dc903989994', - plugins:['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor','MarkerClusterer','AMap.DistrictSearch'], + plugins:['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor','AMap.MarkerClusterer','AMap.DistrictSearch'], v: "1.4.4", 'uVersion':'1.0' }) @@ -77,6 +77,8 @@ import XyDialog from '@/components/XyDialog' Vue.component('xy-dialog',XyDialog) import XySelectors from '@/components/XySelectors' Vue.component('xy-selectors',XySelectors) +import VillagePick from "@/components/villagePick/index.vue"; +Vue.component('village-pick', VillagePick) Vue.prototype.$integrateData = (target,value) => { for(let i in target){ diff --git a/src/store/getters.js b/src/store/getters.js index a108508..f126990 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -5,6 +5,7 @@ const getters = { avatar: state => state.user.avatar, name: state => state.user.name, roles: state => state.user.roles, - permission_routes: state => state.permission.routes + permission_routes: state => state.permission.routes, + village_codes: state => state.app.villageCodes } export default getters diff --git a/src/store/index.js b/src/store/index.js index 6ae5dad..76ec425 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -18,4 +18,5 @@ const store = new Vuex.Store({ getters }) +store.dispatch('app/getVillageCodes') export default store diff --git a/src/store/modules/app.js b/src/store/modules/app.js index 7ea7e33..f7d9a15 100644 --- a/src/store/modules/app.js +++ b/src/store/modules/app.js @@ -1,14 +1,33 @@ import Cookies from 'js-cookie' +import { getVillages } from "@/api/common" const state = { sidebar: { opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true, withoutAnimation: false }, - device: 'desktop' + device: 'desktop', + + villageCodes: [], } const mutations = { + SET_VILLAGE_CODES: (state, { val, pcode = 0 }) => { + if (pcode === 0) { + state.villageCodes = val + } else { + if (pcode instanceof Array) { + let temp = state.villageCodes; + pcode.forEach((ipcode, index) => { + temp = index === 0 ? temp?.find(i => i.code === ipcode) : temp?.children?.find(i => i.code === ipcode) + }) + if (temp && !temp._isload) { + temp.children = val + temp._isload = true + } + } + } + }, TOGGLE_SIDEBAR: state => { state.sidebar.opened = !state.sidebar.opened state.sidebar.withoutAnimation = false @@ -29,6 +48,14 @@ const mutations = { } const actions = { + getVillageCodes({ commit }, pcode) { + return new Promise((resolve, reject) => { + getVillages({ pcode },false).then(res => { + commit('SET_VILLAGE_CODES', { val: res.list, pcode }) + resolve(res) + }).catch(err => reject(err)) + }) + }, toggleSideBar({ commit }) { commit('TOGGLE_SIDEBAR') }, diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 17b8de3..a07f864 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -24,6 +24,8 @@ const getDefaultState = () => { typeAuth: [], areaAuth: [], myRoles: [], + + myInfo: {} } } diff --git a/src/views/customer/component/addCustomer.vue b/src/views/customer/component/addCustomer.vue index 32184f3..8c2f83b 100644 --- a/src/views/customer/component/addCustomer.vue +++ b/src/views/customer/component/addCustomer.vue @@ -8,7 +8,7 @@ *名称:
- +
@@ -23,7 +23,7 @@ multiple :value="form.product_type_customer_links.map(item => item.product_type_id)" placeholder="请选择业务板块" - style="width: 300px" + style="width: 400px" @change="productTypePick"> @@ -37,7 +37,7 @@ *联系电话:
- +
@@ -48,7 +48,7 @@ *身份证号:
- +
@@ -59,7 +59,7 @@ 委托人:
- +
@@ -70,7 +70,7 @@ 委托人电话:
- +
@@ -81,28 +81,39 @@ *户籍地址:
- +
- - @@ -74,6 +84,7 @@ export default { }, data() { return { + villageText: "", isShow:false, id:'', type:'', @@ -82,6 +93,7 @@ export default { name:'', product_type_id:'', area_id:'', + village_code: '', }, rules:{ name:[ @@ -98,6 +110,9 @@ export default { async getDetail(){ const res = await getForm(this.id) this.$integrateData(this.form,res) + this.form.village_code = res.village?.at(-1) ? Number(res.village?.at(-1)?.village_code) : '' + this.villageText = res.village?.reduce((pre, cur, index) => (pre + (index === 0 ? "" : "/") + cur.village_name),"") + this.$refs['villagePick'].val = res.village?.map(i => Number(i.village_code)) }, submit(){ diff --git a/src/views/order/objects.vue b/src/views/order/objects.vue index d5b3862..26c64a3 100644 --- a/src/views/order/objects.vue +++ b/src/views/order/objects.vue @@ -59,9 +59,16 @@ export default { align:'left' }, { - prop:'area_detail.value', + prop:'village', label:'所属区域', - width: 140 + width: 160, + customFn: row => ( + + { + row.village?.reduce((pre, cur, index) => (pre + (index === 0 ? "" : "/") + cur?.village_name),"") + } + + ) }, { prop:'product_type_id', diff --git a/src/views/product/productComponent/addProduct.vue b/src/views/product/productComponent/addProduct.vue index 17041bf..4d7cb01 100644 --- a/src/views/product/productComponent/addProduct.vue +++ b/src/views/product/productComponent/addProduct.vue @@ -34,29 +34,39 @@ -