Commit 9bdd51ee by 匡雅琴

省市

1 parent 09692fb1
import { Http } from 'glsx-common'
export const provinceList = function() {
return new Http().get('https://oss-config.dev.glsx.com.cn/mock/617ba1df1072f92988f05a14/account/provinceList')
}
<template>
<div>
<el-form ref="provinceForm" :model="provinceForm" label-width="80px" inline="true" class="province">
<el-select v-model="provinceForm.province" placeholder="选择省份" @change="selectProvince">
<el-option v-for="item in AllData" :key="item.provinceId" :label="item.provinceName" :value="item.provinceName" @click.native="selectProvince(item)"></el-option>
</el-select>
<el-select v-model="provinceForm.city" placeholder="选择您所在的市" style="width:250px" @change="selectCity">
<el-option v-for="item in cityList" :key="item.cityId" :label="item.cityName" :value="item.cityName" @click.native="selectCity(item)"></el-option>
</el-select>
</el-form>
</div>
</template>
<script>
import { provinceList } from './index'
export default {
name: 'Province',
// props: ['provinceName', 'cityName'],
data() {
return {
provinceList: provinceList(),
AllData: [],
cityList: [{ cityId: '', cityName: '请先选择省' }],
provinceForm: {
province: '', // 省值
city: '' // 市值
}
}
},
mounted() {
// 初始化
this.getProvinceList()
console.log(this.provinceName)
},
methods: {
init(provinceName, cityName) {
this.provinceForm = {
province: provinceName,
city: cityName
}
console.log(this.AllData)
this.AllData.map(item => {
if (provinceName == item.provinceName) {
this.cityList = item.cityInfoList
}
})
},
async getProvinceList() {
const { provinceInfoList: provinceList } = await this.provinceList
// this.AllData = provinceList
this.$set(this, 'AllData', provinceList)
console.log(this.AllData)
},
// 选择省
selectProvince(val) {
console.log(val)
this.provinceForm.city = ''
this.cityList = val.cityInfoList
this.$emit('getProvince', val.provinceName, val.provinceId)
},
// 选择市
selectCity(val) {
this.$emit('getCity', val.cityName, val.cityId)
}
}
}
</script>
<style scoped lang="scss">
.province {
display: inline-flex;
}
</style>
...@@ -11,17 +11,17 @@ ...@@ -11,17 +11,17 @@
let cfg = require('./conf.js') let cfg = require('./conf.js')
import { Http } from 'glsx-common' import { Http } from 'glsx-common'
let timeout = 30000 //超时时间 let timeout = 30000 //超时时间
export const fetchConfig = function (isEnv = true) { export const fetchConfig = function(isEnv = true) {
// if (isEnv) { // if (isEnv) {
// let { request } = cfg // let { request } = cfg
// Object.assign(request, { timeout }) // Object.assign(request, { timeout })
// return Promise.resolve(cfg) // return Promise.resolve(cfg)
// } // }
return new Http().get('https://oss-config.test.glsx.com.cn/mock/617ba1df1072f92988f05a14/account/config') return new Http().get('https://oss-config.test.glsx.com.cn/mock/617ba1df1072f92988f05a14/account/config')
// return new Http().get('http://oss-config.dev.glsx.com.cn/mock/617ba1df1072f92988f05a14/account/config') // return new Http().get('http://oss-config.dev.glsx.com.cn/mock/617ba1df1072f92988f05a14/account/config')
} }
export const config = { export const config = {
install(vue, cfg) {
vue.prototype.$config = cfg
}
}
\ No newline at end of file \ No newline at end of file
install(vue, cfg) {
vue.prototype.$config = cfg
}
}
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item size="small" label="商户地址" class="form-row"> <el-form-item size="small" label="商户地址" class="form-row">
<Province ref="provinceForm" @getProvince="getProvince" @getCity="getCity"></Province>
<el-input readonly v-model="accountAddForm.merchantAddress"></el-input> <el-input readonly v-model="accountAddForm.merchantAddress"></el-input>
<el-button type="primary" class="form-btn" @click="hanleSelectMap">选择地址</el-button> <el-button type="primary" class="form-btn" @click="hanleSelectMap">选择地址</el-button>
</el-form-item> </el-form-item>
...@@ -143,11 +144,13 @@ ...@@ -143,11 +144,13 @@
import util from '@/utils/util' import util from '@/utils/util'
import mapView from '@/components/mapView/index' import mapView from '@/components/mapView/index'
import SelectBrand from '../../baseInfo/selectBrand.vue' import SelectBrand from '../../baseInfo/selectBrand.vue'
import Province from '@/components/province-city'
export default { export default {
name: 'base', name: 'base',
components: { components: {
mapView, mapView,
SelectBrand SelectBrand,
Province
}, },
props: { props: {
accountAddForm: { accountAddForm: {
...@@ -191,7 +194,11 @@ export default { ...@@ -191,7 +194,11 @@ export default {
{ validator: validatePhone, trigger: 'blur' } { validator: validatePhone, trigger: 'blur' }
] ]
}, },
brandListTree: [] brandListTree: [],
provinceCode: '',
provinceName: '',
cityCode: '',
cityName: ''
} }
}, },
watch: { watch: {
...@@ -201,7 +208,7 @@ export default { ...@@ -201,7 +208,7 @@ export default {
}, },
methods: { methods: {
checkBrandList(chant) { checkBrandList(chant) {
let merchantBrandMain = chant.filter(item=>item) let merchantBrandMain = chant.filter(item => item)
this.$set(this.accountAddForm, 'merchantBrandMain', merchantBrandMain) this.$set(this.accountAddForm, 'merchantBrandMain', merchantBrandMain)
console.log(this.accountAddForm.merchantBrandMain) console.log(this.accountAddForm.merchantBrandMain)
if (!this.accountAddForm.merchantBrandMain) { if (!this.accountAddForm.merchantBrandMain) {
...@@ -228,7 +235,7 @@ export default { ...@@ -228,7 +235,7 @@ export default {
const brandListTree = await this.$apis.baseInfo.brandList({}) const brandListTree = await this.$apis.baseInfo.brandList({})
brandListTree.forEach(item => { brandListTree.forEach(item => {
let child = item.children let child = item.children
if(!child) return if (!child) return
child.forEach(k => { child.forEach(k => {
delete k.children delete k.children
}) })
...@@ -259,11 +266,42 @@ export default { ...@@ -259,11 +266,42 @@ export default {
this.$message.error('请选择地址') this.$message.error('请选择地址')
return return
} }
this.dialogMapVisible = false
this.accountAddForm.merchantAddress = this.$refs.mapForm.address this.accountAddForm.merchantAddress = this.$refs.mapForm.address
var address = this.accountAddForm.merchantAddress
let lnglat = this.$refs.mapForm.lnglat let lnglat = this.$refs.mapForm.lnglat
this.accountAddForm.lat = lnglat.lat this.accountAddForm.lat = lnglat.lat
this.accountAddForm.lng = lnglat.lng this.accountAddForm.lng = lnglat.lng
// 截取省市
var provinceIdx = address.indexOf('省')
var cityIdx = address.indexOf('市')
var province = address.slice(0, provinceIdx)
var city = address.slice(provinceIdx + 1, cityIdx)
// 判断省市是否匹配
if (this.provinceName) {
if (this.provinceName !== province && this.cityName !== city) {
this.$message.error('您选择的地址错误,请重新选择')
this.accountAddForm.merchantAddress = ''
return
}
}
this.dialogMapVisible = false
this.provinceName = province
this.cityName = city
this.$refs.provinceForm.init(province, city)
},
// 获取省
getProvince(provinceName, provinceId) {
console.log(this.accountAddForm.merchantAddress)
this.accountAddForm.merchantAddress = ''
console.log(this.accountAddForm.merchantAddress)
this.provinceName = provinceName
this.provinceId = provinceId
},
// 获取市
getCity(cityName, cityId) {
this.cityName = cityName
this.cityId = cityId
this.accountAddForm.merchantAddress = ''
}, },
delImg(index) { delImg(index) {
this.accountAddForm.merchantFiles.splice(index, 1) this.accountAddForm.merchantFiles.splice(index, 1)
...@@ -321,7 +359,7 @@ export default { ...@@ -321,7 +359,7 @@ export default {
this.brandList() this.brandList()
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.base-info { .base-info {
...@@ -459,4 +497,4 @@ export default { ...@@ -459,4 +497,4 @@ export default {
} }
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<div class="information-form-box"> <div class="information-form-box">
<el-form ref="baseForm" :model="infoForm" class="account-body-form" label-width="120px"> <el-form ref="baseForm" :model="infoForm" class="account-body-form" label-width="120px">
<el-form-item size="small" label="商户地址" class="map-row"> <el-form-item size="small" label="商户地址" class="map-row">
<Province ref="provinceForm" @getProvince="getProvince" @getCity="getCity"></Province>
<el-input v-model="infoForm.merchantAddress" placeholder="请选择商户地址" readonly="readonly"></el-input> <el-input v-model="infoForm.merchantAddress" placeholder="请选择商户地址" readonly="readonly"></el-input>
<el-button @click="hanleSelectMap" type="primary">选择地址</el-button> <el-button @click="hanleSelectMap" type="primary">选择地址</el-button>
</el-form-item> </el-form-item>
...@@ -23,6 +24,10 @@ ...@@ -23,6 +24,10 @@
<el-form-item size="small" label="营业时间" class="time-row"> <el-form-item size="small" label="营业时间" class="time-row">
<el-time-picker size="small" value-format="HH:mm:ss" is-range v-model="infoForm.bussinessTime" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围"></el-time-picker> <el-time-picker size="small" value-format="HH:mm:ss" is-range v-model="infoForm.bussinessTime" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围"></el-time-picker>
</el-form-item> </el-form-item>
<el-form-item size="small" label="驻店电话">
<el-input v-model="infoForm.residentPhone" placeholder="此电话会在小程序上显示,请填写真实有效的电话或手机号"></el-input>
<span>显示位置</span>
</el-form-item>
<el-form-item size="small" label="主营品牌" style="height: 500px"> <el-form-item size="small" label="主营品牌" style="height: 500px">
<select-brand :brandListTree="brandListTree" ref="brandListTree"></select-brand> <select-brand :brandListTree="brandListTree" ref="brandListTree"></select-brand>
</el-form-item> </el-form-item>
...@@ -45,9 +50,11 @@ ...@@ -45,9 +50,11 @@
<script> <script>
import mapView from '@/components/mapView/index' import mapView from '@/components/mapView/index'
import SelectBrand from './selectBrand.vue' import SelectBrand from './selectBrand.vue'
import Province from '@/components/province-city/index.vue'
export default { export default {
name: 'EditInfo', name: 'EditInfo',
components: { components: {
Province,
mapView, mapView,
SelectBrand SelectBrand
}, },
...@@ -62,7 +69,9 @@ export default { ...@@ -62,7 +69,9 @@ export default {
bussinessTime: [] bussinessTime: []
}, },
businessType: [], businessType: [],
brandListTree: [] brandListTree: [],
provinceName: '',
cityName: ''
} }
}, },
mounted() { mounted() {
...@@ -130,11 +139,38 @@ export default { ...@@ -130,11 +139,38 @@ export default {
this.$message.error('请选择地址') this.$message.error('请选择地址')
return return
} }
this.dialogMapVisible = false
this.infoForm.merchantAddress = this.$refs.mapForm.address this.infoForm.merchantAddress = this.$refs.mapForm.address
var address = this.infoForm.merchantAddress
let lnglat = this.$refs.mapForm.lnglat let lnglat = this.$refs.mapForm.lnglat
this.infoForm.lat = lnglat.lat this.infoForm.lat = lnglat.lat
this.infoForm.lng = lnglat.lng this.infoForm.lng = lnglat.lng
// 截取省市
var provinceIdx = address.indexOf('省')
var cityIdx = address.indexOf('市')
var province = address.slice(0, provinceIdx)
var city = address.slice(provinceIdx + 1, cityIdx)
// 判断省市是否匹配
if (this.provinceName) {
if (this.provinceName !== province && this.cityName !== city) {
this.$message.error('您选择的地址错误,请重新选择')
this.infoForm.merchantAddress = ''
return
}
}
this.dialogMapVisible = false
this.provinceName = province
this.cityName = city
this.$refs.provinceForm.init(province, city)
},
// 获取省
getProvince(val) {
this.provinceName = val
this.infoForm.merchantAddress = ''
},
// 获取市
getCity(val) {
this.cityName = val
this.infoForm.merchantAddress = ''
}, },
handleSave() { handleSave() {
const params = this.infoForm const params = this.infoForm
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</p> </p>
</div> </div>
<div class="follow-form" :style="{ 'min-height': formHeight + 'px' }"> <div class="follow-form" :style="{ 'min-height': formHeight + 'px' }">
<el-form :inline="true" :model="searchForm" class="follow-form-item"> <!-- <el-form :inline="true" :model="searchForm" class="follow-form-item">
<el-form-item label="跟进专员类型"> <el-form-item label="跟进专员类型">
<el-select size="small" v-model="searchForm.followerTypeId" placeholder="请选择"> <el-select size="small" v-model="searchForm.followerTypeId" placeholder="请选择">
<el-option v-for="item in optionsType" :key="item.id" :label="item.followName" :value="item.id"></el-option> <el-option v-for="item in optionsType" :key="item.id" :label="item.followName" :value="item.id"></el-option>
...@@ -23,11 +23,16 @@ ...@@ -23,11 +23,16 @@
<el-button @click="handleReset" size="small">重置</el-button> <el-button @click="handleReset" size="small">重置</el-button>
<el-button type="primary" @click="handleSearch" size="small">查询</el-button> <el-button type="primary" @click="handleSearch" size="small">查询</el-button>
</el-form-item> </el-form-item>
<el-form-item class="follow-form-jump"> <el-form-item class="follow-form-jump"> -->
<!-- <GLButton fn="新增" size="small" icon="el-icon-plus" type="primary" @click="openDrawer">跟进专员</GLButton> --> <!-- <GLButton fn="新增" size="small" icon="el-icon-plus" type="primary" @click="openDrawer">跟进专员</GLButton> -->
<el-button size="small" icon="el-icon-plus" type="primary" @click="openDrawer">跟进专员</el-button> <!-- <el-button size="small" icon="el-icon-plus" type="primary" @click="openDrawer">跟进专员</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form> -->
<GLCombiForm ref="showSearch" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData" :inline="true" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="follow-btn">
<!-- <GLButton fn="新增" size="small" icon="el-icon-plus" type="primary" @click="openDrawer">跟进专员</GLButton> -->
<el-button size="small" icon="el-icon-plus" type="primary" @click="openDrawer">跟进专员</el-button>
</div>
<GLTable ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="handleSearch"> <GLTable ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="handleSearch">
<template slot="auth-button" slot-scope="scope" :data="scope.scope"> <template slot="auth-button" slot-scope="scope" :data="scope.scope">
<GLButton fn="删除" type="text" @click="handleDele(scope.scope)">删除</GLButton> <GLButton fn="删除" type="text" @click="handleDele(scope.scope)">删除</GLButton>
...@@ -44,11 +49,9 @@ ...@@ -44,11 +49,9 @@
import addSale from './components/addSale' import addSale from './components/addSale'
export default { export default {
name: 'index', name: 'index',
components: { components: {
addSale addSale
}, },
data() { data() {
return { return {
alertStatus: true, alertStatus: true,
...@@ -59,18 +62,23 @@ export default { ...@@ -59,18 +62,23 @@ export default {
followerTypeId: '', followerTypeId: '',
staffName: '' staffName: ''
}, },
optionsType: [ searchFormData: [
{
value: '',
label: '全部'
},
{ {
value: '1', label: '跟进专员类型',
label: '新车跟进专员' name: 'followerTypeId',
type: 'select',
placeholder: '全部',
optionsType: [],
optionList: [],
optionId: 'id',
optionLabel: 'followName',
optionsName: 'followName'
}, },
{ {
value: '2', label: '员工搜索',
label: '售后跟进专员' name: 'staffName',
type: 'input',
placeholder: '请输入员工姓名'
} }
], ],
scope: { scope: {
...@@ -158,7 +166,7 @@ export default { ...@@ -158,7 +166,7 @@ export default {
userIds, userIds,
businessTypeId businessTypeId
} }
console.log(params, '1253715427'); console.log(params, '1253715427')
this.$apis.emp.saveFollowerStaff(params).then(res => { this.$apis.emp.saveFollowerStaff(params).then(res => {
if (res) { if (res) {
this.handleClose() this.handleClose()
...@@ -190,6 +198,8 @@ export default { ...@@ -190,6 +198,8 @@ export default {
listEntFollowerType() { listEntFollowerType() {
this.$apis.emp.listEntFollowerType({ merchantId: this.$globalState.session.merchantId }).then(res => { this.$apis.emp.listEntFollowerType({ merchantId: this.$globalState.session.merchantId }).then(res => {
this.optionsType = [{ followName: '全部', id: '' }].concat(res) this.optionsType = [{ followName: '全部', id: '' }].concat(res)
let idx = this.searchFormData.findIndex(item => item.name == 'followerTypeId')
this.searchFormData[idx].optionList = this.optionsType
}) })
}, },
handleDele(scope) { handleDele(scope) {
...@@ -247,7 +257,7 @@ export default { ...@@ -247,7 +257,7 @@ export default {
this.formHeight = document.documentElement.clientHeight - 230 this.formHeight = document.documentElement.clientHeight - 230
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.slide-fade-enter-active { .slide-fade-enter-active {
...@@ -321,4 +331,9 @@ export default { ...@@ -321,4 +331,9 @@ export default {
overflow-y: auto; overflow-y: auto;
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
.follow-btn {
display: flex;
justify-content: flex-end;
margin-bottom: 20px;
}
</style>
...@@ -28,12 +28,7 @@ ...@@ -28,12 +28,7 @@
<el-button size="small" @click="reSetFindData">重置</el-button> <el-button size="small" @click="reSetFindData">重置</el-button>
<el-button type="primary" size="small" @click="toFindData">查询</el-button> <el-button type="primary" size="small" @click="toFindData">查询</el-button>
</div> --> </div> -->
<GLCombiForm ref="showSearch" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData" :inline="true" @handleOk="toFindData" @handleRest="reSetFindData"> <GLCombiForm ref="showSearch" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData" :inline="true" @handleOk="toFindData" @handleRest="reSetFindData"></GLCombiForm>
<!-- <span slot="footer" slot-scope="scope">
<el-button size="small" @click="reSetFindData">重置</el-button>
<el-button type="primary" size="small" @click="toFindData">查询</el-button>
</span> -->
</GLCombiForm>
</div> </div>
<GLTable v-if="distoryTable" ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="getTableData"> <GLTable v-if="distoryTable" ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="getTableData">
<template slot="auth-button" slot-scope="scope" :data="scope.scope"> <template slot="auth-button" slot-scope="scope" :data="scope.scope">
...@@ -69,7 +64,7 @@ export default { ...@@ -69,7 +64,7 @@ export default {
optionId: 'id', optionId: 'id',
optionLabel: 'merchantName', optionLabel: 'merchantName',
optionsName: 'merchantName', optionsName: 'merchantName',
isDisabled: false isHide: true
}, },
{ {
label: '状态', label: '状态',
...@@ -167,7 +162,6 @@ export default { ...@@ -167,7 +162,6 @@ export default {
getTableData() { getTableData() {
let { delFlag, roleName, merchantId } = this.searchForm let { delFlag, roleName, merchantId } = this.searchForm
let para = {} let para = {}
console.log(merchantId)
if (!this.distoryTable) { if (!this.distoryTable) {
//代表重置 //代表重置
para = { para = {
...@@ -204,16 +198,12 @@ export default { ...@@ -204,16 +198,12 @@ export default {
getMerchantName() { getMerchantName() {
this.$apis.role.merchantDataList({ source: 'glsx' }).then(res => { this.$apis.role.merchantDataList({ source: 'glsx' }).then(res => {
this.merchantList = res || [] this.merchantList = res || []
// this.merchantList.unshift({ this.merchantList.unshift({
// merchantName: '全部', merchantName: '全部',
// id: 0 id: ''
// })
let idx = this.searchFormData.findIndex(item => item.name == 'merchantId')
res.unshift({
id: '',
merchantName: '全部'
}) })
this.materialFormData[idx].optionList = res let idx = this.searchFormData.findIndex(item => item.name == 'merchantId')
this.searchFormData[idx].optionList = this.merchantList
// this.filterList() // this.filterList()
}) })
}, },
...@@ -280,11 +270,12 @@ export default { ...@@ -280,11 +270,12 @@ export default {
created() { created() {
const { session } = this.$globalState const { session } = this.$globalState
let accountLevel = session.accountLevel let accountLevel = session.accountLevel
console.log(accountLevel)
if (accountLevel != 4) { if (accountLevel != 4) {
this.tableParams.tableColumns.splice(2, 0, { label: '所属商户名', prop: 'merchantName' }) this.tableParams.tableColumns.splice(2, 0, { label: '所属商户名', prop: 'merchantName' })
this.getMerchantName() this.getMerchantName()
let idx = this.searchFormData.findIndex(item => item.name == 'merchantId') let idx = this.searchFormData.findIndex(item => item.name == 'merchantId')
this.searchFormData[idx].isDisabled = true this.searchFormData[idx].isHide = false
} }
this.accountLevel = accountLevel this.accountLevel = accountLevel
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!