Commit 34576e9e by 前端

Merge branch 'huy_dev_v2.3.0' into 'v2.3.0'

Huy dev v2.3.0

See merge request !52
2 parents d748e93d 583b076c
...@@ -6,57 +6,67 @@ ...@@ -6,57 +6,67 @@
* @param {*} params * @param {*} params
* @returns * @returns
*/ */
import { http_config,http } from '@/main' import { http_config, http } from '@/main'
const getMerchantTree = params => { const getMerchantTree = params => {
params.method = 'entmicro.api.common.findMerchantTreeByMerchantNo.list' params.method = 'entmicro.api.common.findMerchantTreeByMerchantNo.list'
return http_config({ return http_config({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const getDepartment = params => { const getDepartment = params => {
params.method = 'entmicro.api.department.listDepartmentTree' params.method = 'entmicro.api.department.listDepartment'
return http_config({ return http_config({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
}
const findDepartmentList = params => {
params.method = 'entmicro.api.department.findDepartmentListByPage'
return http_config({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
} }
const toGL = params => { const toGL = params => {
params.method = 'entmicro.api.common.relevanceEntmicro.list' params.method = 'entmicro.api.common.relevanceEntmicro.list'
return http_config({ return http_config({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const merchantInfo = params => { const merchantInfo = params => {
params.method = 'entmicro.api.common.findMerchantInfoByMerchantNo.list' params.method = 'entmicro.api.common.findMerchantInfoByMerchantNo.list'
return http_config({ return http_config({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const brandList = params => { const brandList = params => {
params.method = 'merchants.api.merchantCommon.getCarbrandTree' params.method = 'merchants.api.merchantCommon.getCarbrandTree'
return http({ return http({
url: '/rop-merchants/router', url: '/rop-merchants/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
export default { export default {
getMerchantTree,
getDepartment,
toGL,
merchantInfo,
brandList
}
\ No newline at end of file \ No newline at end of file
getMerchantTree,
getDepartment,
findDepartmentList,
toGL,
merchantInfo,
brandList
}
...@@ -124,4 +124,26 @@ const updateStatusApi = params => { ...@@ -124,4 +124,26 @@ const updateStatusApi = params => {
}) })
} }
export default { getListApi, getAllMerchantListApi, getRoleListApi, getAllDictApi, getMerchantTreeApi, getDetailInfoApi, getDetailLogApi, addEmployeeApi, updateEmployeeApi, deleteEmployeeApi, exportEmployeeApi, updateStatusApi } // 批量更新员工角色
const addStaffRoleBatch = params => {
params.method = `${defaultPath}staff.addStaffRoleBatch`
return http({
url: 'rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
// 批量更新员工状态
const updateStatusBatch = params => {
params.method = `${defaultPath}staff.updateStatusBatch`
return http({
url: 'rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getListApi, getAllMerchantListApi, getRoleListApi, getAllDictApi, getMerchantTreeApi, getDetailInfoApi, getDetailLogApi, addEmployeeApi, updateEmployeeApi, deleteEmployeeApi, exportEmployeeApi, updateStatusApi, addStaffRoleBatch, updateStatusBatch }
...@@ -127,7 +127,7 @@ img { ...@@ -127,7 +127,7 @@ img {
} }
.el-checkbox:last-of-type { .el-checkbox:last-of-type {
margin-right: 8px; margin-right: 0px;
} }
::-webkit-scrollbar { ::-webkit-scrollbar {
...@@ -212,4 +212,8 @@ img { ...@@ -212,4 +212,8 @@ img {
.dot5 { .dot5 {
background-color: #FDB757; background-color: #FDB757;
} }
}
.m-r-md {
margin-right: 20px;
} }
\ No newline at end of file \ No newline at end of file
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
.header-text { .header-text {
font-size: 16px; font-size: 16px;
color: #333333; color: #333333;
font-weight: 500; font-weight: 600;
} }
.el-button--primary.is-plain { .el-button--primary.is-plain {
......
<template> <template>
<div> <div v-if="provinceView">
<el-form ref="provinceForm" :model="provinceForm" inline="true" class="province"> <el-form ref="provinceForm" :model="provinceForm" inline="true" class="province">
<el-select :size="size" v-model="provinceForm.provinceName" clearable placeholder="选择省份" :style="{ width: defaultWidth }" @change="selectProvince" class="select-padding"> <el-select size="small" v-model="provinceForm.provinceName" clearable placeholder="选择省份" :style="{ width: defaultWidth }" @change="selectProvince" class="select-padding">
<el-option v-for="item in AllData" :key="item.adcode" :label="item.name" :value="item.name" @click.native="selectProvince(item)"></el-option> <el-option v-for="item in AllData" :key="item.adcode" :label="item.name" :value="item.name" @click.native="selectProvince(item)"></el-option>
</el-select> </el-select>
<el-select :size="size" v-model="provinceForm.cityName" clearable placeholder="选择市" :style="{ width: defaultWidth }" @change="selectCity" class="select-padding"> <el-select size="small" v-model="provinceForm.cityName" clearable placeholder="选择市" :style="{ width: defaultWidth }" @change="selectCity" class="select-padding">
<el-option v-for="item in cityList" :key="item.adcode" :label="item.name" :value="item.name" @click.native="selectCity(item)"></el-option> <el-option v-for="item in cityList" :key="item.adcode" :label="item.name" :value="item.name" @click.native="selectCity(item)"></el-option>
</el-select> </el-select>
<el-select v-if="subdistrict == 3" :size="size" v-model="provinceForm.townName" clearable placeholder="选择区" :style="{ width: defaultWidth }" @change="selectTown" class="select-padding"> <el-select v-if="subdistrict == 3" size="small" v-model="provinceForm.townName" clearable placeholder="选择区" :style="{ width: defaultWidth }" @change="selectTown" class="select-padding">
<el-option v-for="item in townList" :key="item.adcode" :label="item.name" :value="item.name" @click.native="selectTown(item)"></el-option> <el-option v-for="item in townList" :key="item.adcode" :label="item.name" :value="item.name" @click.native="selectTown(item)"></el-option>
</el-select> </el-select>
</el-form> </el-form>
...@@ -15,57 +15,124 @@ ...@@ -15,57 +15,124 @@
</template> </template>
<script> <script>
let map
export default { export default {
name: 'Province', name: 'GLProvince',
props: { props: {
// 省市级别,2--只显示省市,3--显示省市区,默认只显示省市
subdistrict: { subdistrict: {
type: Number, type: Number,
default: 2 default: 2
}, },
// 省市下拉组件宽度
defaultWidth: { defaultWidth: {
type: String, type: String,
default: '150px' default: '150px'
},
// 组件是否展示,默认展示
provinceView: {
type: Boolean,
default: true
} }
}, },
data() { data() {
return { return {
// 所有数据
AllData: [], AllData: [],
cityList: [{ adcode: '', name: '全部' }], // 城市列表
townList: [{ adcode: '', name: '全部' }], cityList: [],
// 地区列表
townList: [],
provinceForm: { provinceForm: {
provinceName: '', // 省值 // 省份名称
cityName: '', // 市值 provinceName: '',
// 城市名称
cityName: '',
// 地区名称
townName: '', townName: '',
// 省份代码
provinceCode: '', provinceCode: '',
// 城市代码
cityCode: '', cityCode: '',
// 地区代码
townCode: '' townCode: ''
} }
} }
}, },
mounted() { mounted() {},
this.mapInit()
},
methods: { methods: {
/*
* @params:传入的为一个key-value的对象
1、keywords --查询关键字,只支持单个关键词语搜索关键词支持:行政区名称、citycode、adcode
列如:this.provinceList({keywords: '山东省'}),这样就可以筛选出山东省下的市、区信息
2、subdistrict --设置显示下级行政区级数,0:不返回下级行政区;1:返回下一级行政区;2:返回下两级行政区;3:返回下三级行政区;
不传的话默认为2,可以在组件中穿,也可以在调用方法的时候传,如果需要展示省市组件,传值最小为2
3、page --最外层的districts最多会返回20个数据,若超过限制,请用page请求下一页数据。
例如page=2;page=3。默认page=1
4、extensions --控制行政区信息中返回行政区边界坐标点; 可选值:base、all;
base:不返回行政区边界坐标点;(默认)
all:只返回当前查询district的边界值,不返回子节点的边界值;目前不能返回乡镇/街道级别的边界值
5、filter -- 按照指定行政区划进行过滤,填入后则只返回该省/直辖市信息,需填入adcode,为了保证数据的正确,强烈建议填入此参数
6、callback -- callback值是用户定义的函数名称,此参数只在output=JSON时有效
7、output --返回数据格式类型,可选值:JSON,XML(默认JSON)
* @return:返回的是一个promise对象,如果不需要展示组件,只需要获取值,可以直接调用方法,异步获取返回值
列如:
const p = this.$refs.provinceForm.provinceList({xxxx(可传值,传值可参考上文params描述) })
p.then(r => {
// r 为返回结果
console.log(r)
})
**/
// 获取省市信息
provinceList(params = {}) {
params ? (params.subdistrict ? '' : (params.subdistrict = this.subdistrict)) : (params.subdistrict = this.subdistrict)
let data = ''
for (let key in params) {
data += '&' + key + '=' + params[key]
}
let path = `https://restapi.amap.com/v3/config/district?key=d22348363c34c266f772ae9b635eef2a`
path = path + data
const pro = fetch(path).then(res => {
return res.json()
})
if (this.provinceView) {
pro.then(r => {
this.AllData = r.districts[0].districts
})
}
return pro
},
// 省市回显 // 省市回显
init(province, city) { init(province, city, town) {
this.provinceForm = { this.provinceForm = {
provinceName: province, provinceName: province,
cityName: city cityName: city,
townName: town
} }
// this.mapInit(province, city)
if (province) { if (province) {
this.AllData.map(item => { this.AllData.map(item => {
if (item.name.indexOf(province) != -1) { if (item.name.indexOf(province) != -1) {
this.provinceForm.provinceName = item.name this.provinceForm.provinceName = item.name
this.cityList = item.districtList this.cityList = item.districts
this.provinceForm.provinceCode = item.adcode this.provinceForm.provinceCode = item.adcode
this.cityList.map(itm => { if (city) {
if (itm.name.indexOf(city) != -1) { this.cityList.map(itm => {
this.provinceForm.cityCode = itm.adcode if (itm.name.indexOf(city) != -1) {
this.provinceForm.cityName = itm.name this.provinceForm.cityCode = itm.adcode
} this.provinceForm.cityName = itm.name
}) this.townList = itm.districts
if (town) {
this.townList.map(itmx => {
if (itmx.name.indexOf(town) != -1) {
this.provinceForm.townCode = itmx.adcode
this.provinceForm.townName = itmx.name
}
})
}
}
})
}
} }
}) })
} }
...@@ -73,49 +140,19 @@ export default { ...@@ -73,49 +140,19 @@ export default {
// 选择省 // 选择省
selectProvince(val) { selectProvince(val) {
this.provinceForm.cityName = '' this.provinceForm.cityName = ''
this.cityList = val.districtList this.provinceForm.townName = ''
this.cityList = val.districts
this.$emit('selectProvince', val.name, val.adcode) this.$emit('selectProvince', val.name, val.adcode)
}, },
// 选择市 // 选择市
selectCity(val) { selectCity(val) {
this.provinceForm.townName = '' this.provinceForm.townName = ''
this.townList = val.districtList this.townList = val.districts
this.$emit('selectCity', val.name, val.adcode) this.$emit('selectCity', val.name, val.adcode)
}, },
// 选择区 // 选择区
selectTown(val) { selectTown(val) {
this.$emit('selectTown', val.name, val.adcode) this.$emit('selectTown', val.name, val.adcode)
},
mapInit() {
map = new AMap.Map('district', {
resizeEnable: true
})
AMap.plugin(['AMap.DistrictSearch'], () => {
var opts = {
subdistrict: this.subdistrict, //返回下一级行政区
level: 'city', //查询的范围
showbiz: true //查询行政级别为 市
}
var districtSearch = new AMap.DistrictSearch(opts)
districtSearch.search('中国', (status, result) => {
this.AllData = result.districtList[0].districtList
// if (provinceName) {
// this.AllData.map(item => {
// if (item.name.indexOf(provinceName) != -1) {
// this.provinceForm.provinceName = item.name
// this.cityList = item.districtList
// this.provinceForm.provinceCode = item.adcode
// this.cityList.map(itm => {
// if (itm.name.indexOf(cityName) != -1) {
// this.provinceForm.cityCode = itm.adcode
// this.provinceForm.cityName = itm.name
// }
// })
// }
// })
// }
})
})
} }
} }
} }
......
/* /*
* @Author: your name * @Author: your name
* @Date: 2022-03-02 15:56:07 * @Date: 2022-03-02 15:56:07
* @LastEditTime: 2022-04-12 16:36:12 * @LastEditTime: 2022-04-27 18:25:20
* @LastEditors: huyue * @LastEditors: huyue
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \scrm-micro-settings\src\setup\qiankun.js * @FilePath: \scrm-micro-settings\src\setup\qiankun.js
...@@ -10,12 +10,13 @@ import Vue from 'vue' ...@@ -10,12 +10,13 @@ import Vue from 'vue'
// import { message } from '@/plugins/element.js' // import { message } from '@/plugins/element.js'
import { fetchConfig } from '@/config' import { fetchConfig } from '@/config'
import ElementUI from 'element-ui' import ElementUI from 'element-ui'
import { GLButton, GLTable, GLFooter, GLCombiForm, GLTableButton } from 'glsx-components' //权限按钮 (根据权限动态创建) import { GLButton, GLTable, GLFooter, GLCombiForm, GLTableButton, GLDialog } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { getRoutes } from '@/router' import { getRoutes } from '@/router'
import render from './render' import render from './render'
Vue.use(ElementUI) Vue.use(ElementUI)
Vue.use(GLTable) Vue.use(GLTable)
Vue.use(GLFooter) Vue.use(GLFooter)
Vue.use(GLDialog)
Vue.use(GLCombiForm) Vue.use(GLCombiForm)
Vue.use(GLTableButton) Vue.use(GLTableButton)
// import GLTable from '@/components/glsx-table/index' // import GLTable from '@/components/glsx-table/index'
......
...@@ -285,7 +285,7 @@ export default { ...@@ -285,7 +285,7 @@ export default {
// }, 100) // }, 100)
// return // return
// } // }
const reg = /^((0\d{2,3}-\d{7,8})|(1[34578]\d{9}))$/ const reg = /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/
if (this.accountAddForm.residentPhone) { if (this.accountAddForm.residentPhone) {
const result = reg.test(this.accountAddForm.residentPhone) const result = reg.test(this.accountAddForm.residentPhone)
if (!result) { if (!result) {
...@@ -412,7 +412,8 @@ export default { ...@@ -412,7 +412,8 @@ export default {
this.findMerchantDetail() this.findMerchantDetail()
this.getCarbrandTree() this.getCarbrandTree()
this.findAllDictData('business_type') this.findAllDictData('business_type')
// this.$refs.baseInfoForm.brandList() this.$refs.baseInfoForm.brandList()
// 1
} }
} }
</script> </script>
......
...@@ -180,7 +180,7 @@ export default { ...@@ -180,7 +180,7 @@ export default {
} }
} }
const validatePhoneTwo = (rule, value, callback) => { const validatePhoneTwo = (rule, value, callback) => {
const reg = /^((0\d{2,3}-\d{7,8})|(1[34578]\d{9}))$/ const reg = /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/
if (value == '' || value == undefined || value == null) { if (value == '' || value == undefined || value == null) {
callback() callback()
} else { } else {
...@@ -213,7 +213,8 @@ export default { ...@@ -213,7 +213,8 @@ export default {
provinceName: '', provinceName: '',
cityCode: '', cityCode: '',
cityName: '', cityName: '',
isFirstBrand: false isFirstBrand: false,
addressData: {}
} }
}, },
watch: { watch: {
...@@ -296,11 +297,28 @@ export default { ...@@ -296,11 +297,28 @@ export default {
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 fullAddress = this.$refs.mapForm.geocoderAddress.addressComponent var fullAddress = ''
var provincecode = ''
if (this.$refs.mapForm.geocoderAddress.addressComponent) {
fullAddress = this.$refs.mapForm.geocoderAddress.addressComponent
provincecode = this.$refs.mapForm.geocoderAddress.adcode
this.addressData.fullAddress = this.$refs.mapForm.geocoderAddress.addressComponent
this.addressData.provincecode = this.$refs.mapForm.geocoderAddress.adcode
} else {
fullAddress = this.addressData.fullAddress
provincecode = this.addressData.provincecode
}
// 获取省市 // 获取省市
var provincecode = this.$refs.mapForm.geocoderAddress.adcode var province = ''
var province = fullAddress.province var city = ''
var city = fullAddress.city ? fullAddress.city : fullAddress.district if (fullAddress) {
province = fullAddress.province
city = fullAddress.city ? fullAddress.city : fullAddress.district
} else {
province = this.accountAddForm.provinceName
city = this.accountAddForm.cityName
provincecode = this.accountAddForm.cityCode
}
const municipalities = ['北京市', '天津市', '上海市', '重庆市'] const municipalities = ['北京市', '天津市', '上海市', '重庆市']
var municipality = municipalities.find(item => item == province) var municipality = municipalities.find(item => item == province)
if (municipality) { if (municipality) {
...@@ -335,13 +353,19 @@ export default { ...@@ -335,13 +353,19 @@ export default {
this.$set(this.accountAddForm, 'merchantAddress', '') this.$set(this.accountAddForm, 'merchantAddress', '')
// 强制更新 merchantAddress // 强制更新 merchantAddress
this.$forceUpdate() this.$forceUpdate()
this.accountAddForm.cityName = ''
this.accountAddForm.provinceName = provinceName this.accountAddForm.provinceName = provinceName
this.accountAddForm.provinceCode = provinceCode this.accountAddForm.provinceCode = provinceCode
}, },
// 获取市 // 获取市
selectCity(cityName, cityCode) { selectCity(cityName, cityCode) {
this.accountAddForm.cityName = cityName if (cityName) {
this.accountAddForm.cityCode = cityCode this.accountAddForm.cityName = cityName
this.accountAddForm.cityCode = cityCode
} else {
this.accountAddForm.cityName = ''
this.accountAddForm.cityCode = ''
}
this.$set(this.accountAddForm, 'merchantAddress', '') this.$set(this.accountAddForm, 'merchantAddress', '')
this.$forceUpdate() this.$forceUpdate()
}, },
...@@ -398,6 +422,7 @@ export default { ...@@ -398,6 +422,7 @@ export default {
}, },
mounted() { mounted() {
this.$refs.provinceForm.provinceList()
this.getUserInfo() this.getUserInfo()
} }
} }
......
...@@ -350,7 +350,7 @@ export default { ...@@ -350,7 +350,7 @@ export default {
}, },
//将后台返回数据中数值为空的字段全部替换为“-” //将后台返回数据中数值为空的字段全部替换为“-”
formateNullFieldData(initialData) { formateNullFieldData(initialData) {
const isEmpty = function (val) { const isEmpty = function(val) {
if (!String(val) || String(val) === 'null') { if (!String(val) || String(val) === 'null') {
return '-' return '-'
} }
...@@ -358,7 +358,7 @@ export default { ...@@ -358,7 +358,7 @@ export default {
} }
var that = this var that = this
if (initialData instanceof Array) { if (initialData instanceof Array) {
initialData.forEach(function (val, key, array) { initialData.forEach(function(val, key, array) {
array[key] = that.formateNullFieldData(val) array[key] = that.formateNullFieldData(val)
}) })
} else if (initialData instanceof Object) { } else if (initialData instanceof Object) {
...@@ -664,9 +664,8 @@ export default { ...@@ -664,9 +664,8 @@ export default {
padding-left: 2px; padding-left: 2px;
padding-bottom: 10px; padding-bottom: 10px;
.mainTitleWrap { .mainTitleWrap {
height: 32px; // height: 32px;
display: flex; display: flex;
.mainTitle { .mainTitle {
background-color: #f4f6fc; background-color: #f4f6fc;
height: 32px; height: 32px;
...@@ -685,8 +684,9 @@ export default { ...@@ -685,8 +684,9 @@ export default {
margin: 20px 10px 0; margin: 20px 10px 0;
.subTitleWrap { .subTitleWrap {
height: 40px; // height: 40px;
display: flex; display: flex;
flex-wrap: wrap;
background-color: #f4f6fc; background-color: #f4f6fc;
.subTitle { .subTitle {
padding: 0px 5px; padding: 0px 5px;
......
...@@ -301,7 +301,7 @@ export default { ...@@ -301,7 +301,7 @@ export default {
// }, 100) // }, 100)
// return // return
// } // }
const reg = /^((0\d{2,3}-\d{7,8})|(1[34578]\d{9}))$/ const reg = /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/
if (this.accountAddForm.residentPhone) { if (this.accountAddForm.residentPhone) {
const result = reg.test(this.accountAddForm.residentPhone) const result = reg.test(this.accountAddForm.residentPhone)
if (!result) { if (!result) {
......
<template> <template>
<div class="scrm-main"> <div class="scrm-main">
<div class="form-header" v-if="$globalState.session.accountLevel == 1 && $globalState.session.merchantModel == 1"> <div class="form-header" v-if="$globalState.session.accountLevel == 1 && $globalState.session.merchantModel == 1">
<GLButton @click="handleContact" icon="el-icon-link" fn="门店账户关联企微" type="primary" size="small" mode="el-button">门店账户关联企微</GLButton> <!-- <GLButton @click="handleContact" icon="el-icon-link" fn="门店账户关联企微" type="primary" size="small" mode="el-button">门店账户关联企微</GLButton> -->
<!-- <el-button type="primary" @click="handleContact" size="small" icon="el-icon-link" <el-button type="primary" @click="handleContact" size="small" icon="el-icon-link">门店账户关联企微</el-button>
>门店账户关联企微</el-button
>-->
</div> </div>
<div class="follow-form"> <div class="follow-form">
<GLCombiForm :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm> <GLCombiForm :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
...@@ -75,7 +73,7 @@ export default { ...@@ -75,7 +73,7 @@ export default {
{ {
label: '关联的企业微信', label: '关联的企业微信',
prop: 'entmicroName', prop: 'entmicroName',
width: '140', width: '200',
line: 1, line: 1,
formatter: cellValue => { formatter: cellValue => {
return cellValue.entmicroName ? cellValue.entmicroName : '-' return cellValue.entmicroName ? cellValue.entmicroName : '-'
...@@ -101,7 +99,7 @@ export default { ...@@ -101,7 +99,7 @@ export default {
{ {
label: '上级商户', label: '上级商户',
prop: 'parentMerchant', prop: 'parentMerchant',
width: '180', width: '200',
line: 1, line: 1,
formatter: cellValue => { formatter: cellValue => {
return cellValue.parentMerchant ? cellValue.parentMerchant : '-' return cellValue.parentMerchant ? cellValue.parentMerchant : '-'
...@@ -403,7 +401,7 @@ export default { ...@@ -403,7 +401,7 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.follow-form { .follow-form {
margin-top: 20px; margin-top: 10px;
background: #ffffff; background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1); box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 10px; padding: 10px;
......
<!--
* @Description: 选择层级的树结构
* @Author: huyue
* @Date: 2022-04-28 10:15:34
* @LastEditors: huyue
* @LastEditTime: 2022-05-05 18:32:18
-->
<template>
<div>
<GLDialog class="tree-dialog" :visible="visible" @close="handleClose" :title="dialogTitle" :showClose="true">
<div>
<div class="el-breadcrumb">
<span class="el-breadcrumb__item">
<span class="el-breadcrumb__inner" style="cursor: context-menu">{{ $globalState.session.merchantName }}</span>
<i class="el-breadcrumb__separator el-icon-arrow-right"></i>
</span>
<span class="el-breadcrumb__item" v-for="item in selectLevel" :key="item.departmentId" @click="backLevel(item)">
<span class="el-breadcrumb__inner">{{ item.departmentName }}</span>
<i class="el-breadcrumb__separator el-icon-arrow-right"></i>
</span>
<span class="el-breadcrumb__item last-level" v-if="lastLevel">
<span class="el-breadcrumb__inner">请选择下级组织结构</span>
<i class="el-breadcrumb__separator el-icon-arrow-right"></i>
</span>
</div>
<div v-loading="loading">
<div class="tree-list" :style="{ height: listHeight + 'px' }">
<el-radio-group v-model="checkObj.first" @change="selectChange">
<div class="tree-item" v-for="item in departmentList" :key="item.departmentId" @click.self="toNext(item, $event)">
<el-radio :label="item" :disabled="!item.relevanceMerchant">{{ item.departmentName }}</el-radio>
<i v-show="item.childrenNum" class="el-icon-arrow-right"></i>
</div>
</el-radio-group>
</div>
</div>
</div>
<div slot="footer">
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="submit">提交</el-button>
</div>
</GLDialog>
</div>
</template>
<script>
export default {
name: 'MerchantTree',
data() {
return {
loading: false,
visible: false,
dialogTitle: '选择商户账户',
listHeight: 220,
departmentList: [],
parentMerchantList: [],
subSubMerchantList: [],
checkObj: {
first: ''
},
// 选中的用来展示面包屑
selectLevel: [
// {
// merchantId: this.$globalState.session.merchantId,
// merchantName: this.$globalState.session.merchantName,
// level: 0
// }
],
lastLevel: true // 是否显示请选择
}
},
mounted() {
// this.getDepartmentList()
},
methods: {
// 获取门店数据
getDepartmentList(depth, id) {
this.loading = true
var params = {}
depth ? (params.depth = depth) : (params.depth = 0)
if (id) {
params.departmentId = id
}
this.$apis.baseInfo.getDepartment(params).then(res => {
console.log(res)
this.departmentList = res
console.log(this.departmentList)
this.loading = false
})
},
handleClose() {
this.visible = false
},
submit() {
console.log(this.checkObj)
if (!this.checkObj) {
this.$message({
message: '请选择门店',
type: 'warning'
})
return
}
this.$emit('select', this.checkObj)
this.visible = false
},
// 选中时触发
selectChange(val) {
console.log(val)
this.$set(this.selectLevel, val.depth - 1, val)
// this.lastLevel = false
val.childrenNum ? (this.lastLevel = true) : (this.lastLevel = false)
// this.lastLevel = val.hasChildren
},
// 跳转下一级,需判断是否有下一级
toNext(item, event) {
console.log(item, this.checkObj, event)
console.log(item.departmentId)
if (item.childrenNum) {
this.checkObj.first = ''
this.lastLevel = true
this.getDepartmentList(item.depth, item.id)
this.selectLevel[item.depth - 1] = item
console.log(this.selectLevel)
}
},
// 点击页签,返回
backLevel(item) {
console.log(item)
this.checkObj.first = ''
item.childrenNum ? (this.lastLevel = true) : (this.lastLevel = false)
console.log(this.selectLevel)
this.selectLevel = this.selectLevel.slice(0, item.depth - 1)
this.getDepartmentList(item.depth - 1)
console.log(this.selectLevel)
}
}
}
</script>
<style lang="scss" scoped>
.el-breadcrumb {
line-height: 28px;
}
.el-radio__label {
color: #333;
}
.tree-dialog {
/deep/ {
.last-level {
.el-breadcrumb__inner {
color: #5850ff;
}
}
.el-breadcrumb__inner {
font-weight: normal;
cursor: pointer;
}
.el-dialog__body {
padding: 20px;
}
}
}
.tree {
&-list {
margin-top: 10px;
overflow: auto;
.el-radio-group {
width: 100%;
}
}
&-item {
padding: 15px 0 11px;
border-top: 1px solid #e6e6e6;
width: 100%;
display: flex;
justify-content: space-between;
i {
font-size: 12px;
}
}
}
</style>
<!--
* @Description: 选择层级的树结构
* @Author: huyue
* @Date: 2022-04-28 10:15:34
* @LastEditors: huyue
* @LastEditTime: 2022-05-18 18:06:35
-->
<template>
<div>
<GLDialog class="tree-dialog" :visible="visible" @close="handleClose" :title="dialogTitle" :showClose="true">
<div>
<div class="el-breadcrumb">
<span class="el-breadcrumb__item">
<span class="el-breadcrumb__inner" style="cursor: context-menu">{{ $globalState.session.merchantName }}</span>
<i class="el-breadcrumb__separator el-icon-arrow-right"></i>
</span>
<span class="el-breadcrumb__item" v-for="item in selectLevel" :key="item.departmentId" @click="backLevel(item)">
<span class="el-breadcrumb__inner">{{ item.departmentName }}</span>
<i class="el-breadcrumb__separator el-icon-arrow-right"></i>
</span>
<span class="el-breadcrumb__item last-level" v-if="lastLevel">
<span class="el-breadcrumb__inner">请选择下级组织结构</span>
<i class="el-breadcrumb__separator el-icon-arrow-right"></i>
</span>
</div>
<div>
<div class="tree-list" :style="{ height: listHeight + 'px' }">
<el-radio-group v-model="checkObj.first" @change="selectChange">
<div class="tree-item" v-for="item in departmentList" :key="item.departmentId" @click.self="toNext(item, $event)">
<el-radio :label="item" :disabled="!item.relevanceMerchant">{{ item.departmentName }}</el-radio>
<i v-show="item.childrenNum" class="el-icon-arrow-right"></i>
</div>
</el-radio-group>
</div>
</div>
</div>
<div slot="footer">
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="submit">提交</el-button>
</div>
</GLDialog>
</div>
</template>
<script>
export default {
name: 'MerchantTree',
data() {
return {
visible: false,
dialogTitle: '选择商户账户',
listHeight: 220,
departmentList: [],
parentMerchantList: [],
subSubMerchantList: [],
checkObj: {
first: ''
},
// 选中的用来展示面包屑
selectLevel: [
// {
// merchantId: this.$globalState.session.merchantId,
// merchantName: this.$globalState.session.merchantName,
// level: 0
// }
],
lastLevel: true // 是否显示请选择
}
},
mounted() {
this.getDepartmentList()
},
methods: {
// 获取门店数据
getDepartmentList(depth, id) {
var params = {}
depth ? (params.depth = depth) : (params.depth = 0)
if (id) {
params.departmentId = id
}
this.$apis.baseInfo.getDepartment(params).then(res => {
console.log(res)
this.departmentList = res
console.log(this.departmentList)
})
},
handleClose() {
this.visible = false
},
submit() {
console.log(this.checkObj)
if (!this.checkObj) {
this.$message({
message: '请选择门店',
type: 'warning'
})
return
}
this.$emit('select', this.checkObj)
this.visible = false
},
// 选中时触发
selectChange(val) {
console.log(val)
this.$set(this.selectLevel, val.depth - 1, val)
// this.lastLevel = false
val.childrenNum ? (this.lastLevel = true) : (this.lastLevel = false)
// this.lastLevel = val.hasChildren
},
// 跳转下一级,需判断是否有下一级
toNext(item, event) {
console.log(item, this.checkObj, event)
console.log(item.departmentId)
if (item.childrenNum) {
this.checkObj.first = ''
this.lastLevel = true
this.getDepartmentList(item.depth, item.id)
this.selectLevel[item.depth - 1] = item
console.log(this.selectLevel)
}
},
// 点击页签,返回
backLevel(item) {
console.log(item)
this.checkObj.first = ''
item.childrenNum ? (this.lastLevel = true) : (this.lastLevel = false)
console.log(this.selectLevel)
this.selectLevel = this.selectLevel.slice(0, item.depth - 1)
this.getDepartmentList(item.depth - 1)
console.log(this.selectLevel)
}
}
}
</script>
<style lang="scss" scoped>
.el-breadcrumb {
line-height: 28px;
}
.el-radio__label {
color: #333;
}
.tree-dialog {
/deep/ {
.last-level {
.el-breadcrumb__inner {
color: #5850ff;
}
}
.el-breadcrumb__inner {
font-weight: normal;
cursor: pointer;
}
.el-dialog__body {
padding: 20px;
}
}
}
.tree {
&-list {
margin-top: 10px;
overflow: auto;
.el-radio-group {
width: 100%;
}
}
&-item {
padding: 15px 0 11px;
border-top: 1px solid #e6e6e6;
width: 100%;
display: flex;
justify-content: space-between;
i {
font-size: 12px;
}
}
}
</style>
<!--
* @Description: 搜索下拉组件
* @Author: huyue
* @Date: 2022-04-27 10:28:50
* @LastEditors: huyue
* @LastEditTime: 2022-05-06 17:29:35
-->
<template>
<div>
<el-popover :popper-class="'search-popper'" placement="bottom-start" width="280" trigger="manual" v-model="visible">
<ul class="el-scrollbar__view el-cascader__suggestion-list" v-infinite-scroll="load" style="overflow: auto">
<!-- <li class="el-cascader__suggestion-item" :class="isCheck ? 'is-checked' : ''">dafsd</li> -->
<template v-if="searchList.length">
<li class="el-cascader__suggestion-item" :class="item.departmentName == searchKey.departmentName" v-for="item in searchList" :key="item.id" @click.self="selectItem(item)">
<!-- <el-radio :label="item">{{ item.departmentName }}</el-radio> -->
<div>{{ item.departmentName }}</div>
<div class="parent-merchant">{{ item.entmicroParentName }}</div>
</li>
</template>
<template v-else>
<li>无数据</li>
</template>
</ul>
<el-input slot="reference" debounce style="width: 320px" v-model="searchKey.departmentName" :size="size" @input="handleInput" @focus="handleFocus" @blur="handleBlur" placeholder="请输入内容">
<!-- <i slot="suffix" class="el-input__icon el-icon-arrow-down" :class="isOpen ? 'is-focus' : ''"></i> -->
<template slot="append">
<div class="input_append" @click.stop="arrowClick">
<img src="@/assets/add_merchant.png" alt="" />
</div>
</template>
</el-input>
</el-popover>
<DepartmentTree ref="departmentTree" @select="select"></DepartmentTree>
</div>
</template>
<script>
import { utils } from 'glsx-common'
import DepartmentTree from './departmentTree.vue'
export default {
name: 'SearchSelect',
components: {
DepartmentTree
},
data() {
return {
loading: false,
searchKey: {
id: '',
departmentName: ''
}, // 绑定input的值
isOpen: false,
visible: false,
isCheck: false,
departmentList: [], // 接口返回数据
searchValue: '', // 搜索值
searchList: [], // 搜索结果
list: [],
count: 0,
pageParams: {
pageNum: 1,
pageSize: 10
}
}
},
mounted() {
// this.list = this.merchantList
},
methods: {
arrowClick() {
this.isOpen = true
this.visible = false
if (this.isOpen) {
this.$refs.departmentTree.visible = true
this.$refs.departmentTree.getDepartmentList()
}
},
handleInput: utils.debounce(function(val) {
console.log(val)
this.searchValue = val
this.pageParams.pageNum = 1
this.getSearchList(val)
}, 300),
// 根据输入内容搜索企微门店数据
getSearchList(val) {
this.loading = true
console.log(this.searchValue)
var params = JSON.parse(JSON.stringify(this.pageParams))
params.departmentName = val
console.log(params)
if (params.departmentName) {
this.$apis.baseInfo.findDepartmentList(params).then(res => {
console.log(res)
if (res.data.length) {
this.count = res.count
this.searchList = this.searchList.concat(res.data)
}
this.pageParams.pageNum++
console.log(this.searchList)
})
this.loading = false
} else {
this.searchList = []
}
this.visible = true
},
selectItem(val) {
console.log(val)
this.searchKey = val
// this.searchList = [val]
this.visible = false
this.$emit('getCurDepartment', val)
},
select(val) {
console.log(val)
// this.searchKey = {
// id: val.first.departmentId,
// departmentName: val.first.departmentName
// }
this.searchKey.id = val.first.departmentId + ''
this.searchKey.departmentName = val.first.departmentName
this.$emit('getCurDepartment', val.first)
},
handleBlur() {
this.visible = false
// this.searchKey = {}
this.searchList = []
},
handleFocus() {
this.getSearchList(this.searchKey.departmentName)
if (this.searchList.length) this.visible = true
},
load() {
// this.searchList.push(`Aaaaa${this.count++}`)
if (this.searchList.length < this.count) {
this.getSearchList(this.searchValue)
}
}
}
}
</script>
<style lang="scss" scoped>
// .el-select {
// .el-select__caret:first-child::before {
// content: '\e6e1';
// }
// .is-focus {
// .el-select__caret:first-child {
// transform: rotateZ(0deg);
// }
// }
// }
.is-focus.el-icon-arrow-down:first-child {
transform: rotateZ(180deg);
}
.el-cascader__suggestion-item {
position: relative;
flex-direction: column;
align-items: flex-start;
padding: 12px 16px;
.parent-merchant {
padding-top: 4px;
font-size: 10px;
color: #666666;
}
}
.el-cascader__suggestion-item::after {
content: '';
position: absolute;
bottom: 0;
border-bottom: 1px solid #eee;
width: calc(100% - 32px);
}
.el-cascader__suggestion-item.is-checked {
color: #5850ff;
}
.el-cascader__suggestion-list {
overflow: auto;
width: 100%;
}
/deep/.el-input-group__append {
padding: 0;
background-color: #5850ff;
border: 1px solid #5850ff;
}
.input_append {
width: 38px;
height: 30px;
}
</style>
<style>
.search-popper {
padding: 0 !important;
}
</style>
...@@ -64,7 +64,7 @@ export default { ...@@ -64,7 +64,7 @@ export default {
}, },
data() { data() {
const validatePhoneTwo = (rule, value, callback) => { const validatePhoneTwo = (rule, value, callback) => {
const reg = /^((0\d{2,3}-\d{7,8})|(1[34578]\d{9}))$/ const reg = /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/
if (value == '' || value == undefined || value == null) { if (value == '' || value == undefined || value == null) {
callback() callback()
} else { } else {
...@@ -96,10 +96,12 @@ export default { ...@@ -96,10 +96,12 @@ export default {
isFirstBrand: false, isFirstBrand: false,
baseFormRules: { baseFormRules: {
residentPhone: [{ validator: validatePhoneTwo, trigger: 'blur' }] residentPhone: [{ validator: validatePhoneTwo, trigger: 'blur' }]
} },
addressData: {}
} }
}, },
mounted() { mounted() {
this.$refs.provinceForm.provinceList()
this.getUserInfo() this.getUserInfo()
}, },
methods: { methods: {
...@@ -180,18 +182,34 @@ export default { ...@@ -180,18 +182,34 @@ export default {
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 fullAddress = this.$refs.mapForm.geocoderAddress.addressComponent var fullAddress = ''
var provincecode = ''
if (this.$refs.mapForm.geocoderAddress.addressComponent) {
fullAddress = this.$refs.mapForm.geocoderAddress.addressComponent
provincecode = this.$refs.mapForm.geocoderAddress.adcode
this.addressData.fullAddress = this.$refs.mapForm.geocoderAddress.addressComponent
this.addressData.provincecode = this.$refs.mapForm.geocoderAddress.adcode
} else {
fullAddress = this.addressData.fullAddress
provincecode = this.addressData.provincecode
}
// 获取省市 // 获取省市
var provincecode = this.$refs.mapForm.geocoderAddress.adcode var province = ''
var province = fullAddress.province var city = ''
var city = fullAddress.city ? fullAddress.city : fullAddress.district if (fullAddress) {
province = fullAddress.province
city = fullAddress.city ? fullAddress.city : fullAddress.district
} else {
province = this.infoForm.provinceName
city = this.infoForm.cityName
provincecode = this.infoForm.cityCode
}
const municipalities = ['北京市', '天津市', '上海市', '重庆市'] const municipalities = ['北京市', '天津市', '上海市', '重庆市']
var municipality = municipalities.find(item => item == province) var municipality = municipalities.find(item => item == province)
if (municipality) { if (municipality) {
city = city.slice(0, 2) + '城区' city = city.slice(0, 2) + '城区'
if (municipality === '重庆市') { if (municipality === '重庆市') {
provincecode = provincecode.slice(0, 4) provincecode = provincecode.slice(0, 4)
console.log(provincecode)
provincecode == 5001 ? (city = city.slice(0, 2) + '城区') : (city = city.slice(0, 2) + '郊县') provincecode == 5001 ? (city = city.slice(0, 2) + '城区') : (city = city.slice(0, 2) + '郊县')
} }
} }
...@@ -212,13 +230,19 @@ export default { ...@@ -212,13 +230,19 @@ export default {
// 获取省 // 获取省
selectProvince(provinceName, provinceCode) { selectProvince(provinceName, provinceCode) {
this.infoForm.merchantAddress = '' this.infoForm.merchantAddress = ''
this.infoForm.cityName = ''
this.infoForm.provinceName = provinceName this.infoForm.provinceName = provinceName
this.infoForm.provinceCode = provinceCode this.infoForm.provinceCode = provinceCode
}, },
// 获取市 // 获取市
selectCity(cityName, cityCode) { selectCity(cityName, cityCode) {
this.infoForm.cityName = cityName if (cityName) {
this.infoForm.cityCode = cityCode this.infoForm.cityName = cityName
this.infoForm.cityCode = cityCode
} else {
this.infoForm.cityName = ''
this.infoForm.cityCode = ''
}
this.infoForm.merchantAddress = '' this.infoForm.merchantAddress = ''
}, },
// 展示驻点电话弹框 // 展示驻点电话弹框
...@@ -227,7 +251,7 @@ export default { ...@@ -227,7 +251,7 @@ export default {
}, },
handleSave() { handleSave() {
const params = this.infoForm const params = this.infoForm
const reg = /^((0\d{2,3}-\d{7,8})|(1[34578]\d{9}))$/ const reg = /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/
if (params.residentPhone) { if (params.residentPhone) {
const result = reg.test(params.residentPhone) const result = reg.test(params.residentPhone)
if (!result) { if (!result) {
......
...@@ -35,13 +35,14 @@ ...@@ -35,13 +35,14 @@
</div> </div>
<div class="select_wrapper"> <div class="select_wrapper">
<div class="label">企业微信</div> <div class="label">企业微信</div>
<el-cascader ref="cascaderRef" @change="getCurDepartment" placeholder="请选择企微门店" :show-all-levels="false" v-model="selectedDepartment" :props="mypropsParam" :options="departmentList" size="small" style="width: 320px" separator=" " filterable> <SearchSelect @getCurDepartment="getCurDepartment"></SearchSelect>
<!-- <el-cascader ref="cascaderRef" @change="getCurDepartment" placeholder="请选择企微门店" :show-all-levels="false" v-model="selectedDepartment" :props="mypropsParam" :options="departmentList" size="small" style="width: 320px" separator=" " filterable>
<template slot-scope="{ data }"> <template slot-scope="{ data }">
<el-tooltip popper-class="myToolTipClass" style="border: none" :disabled="data.departmentName.length > 12 ? false : true" class="item" effect="light" :content="data.departmentName" placement="top-end"> <el-tooltip popper-class="myToolTipClass" style="border: none" :disabled="data.departmentName.length > 12 ? false : true" class="item" effect="light" :content="data.departmentName" placement="top-end">
<div class="limitText" style="width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis">{{ data.departmentName }}</div> <div class="limitText" style="width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis">{{ data.departmentName }}</div>
</el-tooltip> </el-tooltip>
</template> </template>
</el-cascader> </el-cascader> -->
</div> </div>
<!-- <div v-if="showTip2" class="tipContentClass"> <!-- <div v-if="showTip2" class="tipContentClass">
<div class="title">说明</div> <div class="title">说明</div>
...@@ -110,9 +111,12 @@ ...@@ -110,9 +111,12 @@
</template> </template>
<script> <script>
import SearchSelect from './components/search.vue'
export default { export default {
name: '', name: '',
components: {
SearchSelect
},
data() { data() {
return { return {
departmentList: [], departmentList: [],
...@@ -156,7 +160,7 @@ export default { ...@@ -156,7 +160,7 @@ export default {
// 设置底部按钮宽度 // 设置底部按钮宽度
setBtnWidth() { setBtnWidth() {
let _this = this let _this = this
this.$nextTick(function () { this.$nextTick(function() {
_this.customWidth = _this.$refs.btnWidth.clientWidth _this.customWidth = _this.$refs.btnWidth.clientWidth
}) })
}, },
...@@ -173,14 +177,19 @@ export default { ...@@ -173,14 +177,19 @@ export default {
}, },
// 获取当前选择的部门 // 获取当前选择的部门
getCurDepartment(val) { getCurDepartment(val) {
let ids = val[val.length - 1] console.log(val, '---')
let labels = this.$refs.cascaderRef.getCheckedNodes()[0].pathLabels
let curLabel = labels[labels.length - 1]
this.tempDepart = { this.tempDepart = {
departmentId: ids, departmentId: val.departmentId,
departmentName: curLabel departmentName: val.departmentName
} }
this.$refs.cascaderRef.dropDownVisible = false // let ids = val[val.length - 1]
// let labels = this.$refs.cascaderRef.getCheckedNodes()[0].pathLabels
// let curLabel = labels[labels.length - 1]
// this.tempDepart = {
// departmentId: ids,
// departmentName: curLabel
// }
// this.$refs.cascaderRef.dropDownVisible = false
}, },
getDepartmentList() { getDepartmentList() {
this.$apis.baseInfo.getDepartment({ id: 1, flag: true }).then(res => { this.$apis.baseInfo.getDepartment({ id: 1, flag: true }).then(res => {
...@@ -212,6 +221,7 @@ export default { ...@@ -212,6 +221,7 @@ export default {
...this.curTempMerchant, ...this.curTempMerchant,
...this.tempDepart ...this.tempDepart
} }
console.log(this.curGLData)
let flag = false let flag = false
this.dataList.forEach(item => { this.dataList.forEach(item => {
if (item.departmentId == this.curGLData.departmentId || item.merchantId == this.curGLData.merchantId) { if (item.departmentId == this.curGLData.departmentId || item.merchantId == this.curGLData.merchantId) {
...@@ -233,6 +243,7 @@ export default { ...@@ -233,6 +243,7 @@ export default {
}, },
// 批量关联 // 批量关联
handleMutiGL() { handleMutiGL() {
console.log(this.dataList)
if (!this.dataList.length) { if (!this.dataList.length) {
this.$message({ this.$message({
message: '请先选择您要关联的账户', message: '请先选择您要关联的账户',
...@@ -341,7 +352,7 @@ export default { ...@@ -341,7 +352,7 @@ export default {
this.getMerchantList() this.getMerchantList()
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.gl-page { .gl-page {
...@@ -480,10 +491,11 @@ export default { ...@@ -480,10 +491,11 @@ export default {
text-align: center; text-align: center;
padding: 12px 0; padding: 12px 0;
} }
.pruple {
background: #5850ff;
}
} }
.pruple {
background: #5850ff;
}
.wrap-title { .wrap-title {
font-size: 16px; font-size: 16px;
font-weight: 500; font-weight: 500;
...@@ -505,4 +517,4 @@ export default { ...@@ -505,4 +517,4 @@ export default {
border-color: #5850ff; border-color: #5850ff;
border-radius: 4px; border-radius: 4px;
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -89,7 +89,7 @@ export default { ...@@ -89,7 +89,7 @@ export default {
}) })
}, },
changeMerchantProTree() { changeMerchantProTree() {
if (!this.powerDataArray.length) { if (!this.powerDataArray.length) {
return [] return []
} else if (this.powerDataArray.length > 0 && this.powerDataArray[this.currentIndex].products.length == 0) { } else if (this.powerDataArray.length > 0 && this.powerDataArray[this.currentIndex].products.length == 0) {
return [] return []
...@@ -171,8 +171,9 @@ export default { ...@@ -171,8 +171,9 @@ export default {
padding-left: 2px; padding-left: 2px;
padding-bottom: 10px; padding-bottom: 10px;
.mainTitleWrap { .mainTitleWrap {
height: 32px; // height: 32px;
display: flex; display: flex;
flex-wrap: wrap;
.mainTitle { .mainTitle {
background-color: #f4f6fc; background-color: #f4f6fc;
...@@ -193,8 +194,9 @@ export default { ...@@ -193,8 +194,9 @@ export default {
margin: 20px 10px 0; margin: 20px 10px 0;
.subTitleWrap { .subTitleWrap {
height: 40px; // height: 40px;
display: flex; display: flex;
flex-wrap: wrap;
background-color: #f4f6fc; background-color: #f4f6fc;
.subTitle { .subTitle {
background-color: #f4f6fc; background-color: #f4f6fc;
......
...@@ -12,12 +12,14 @@ ...@@ -12,12 +12,14 @@
<div class="table-header"> <div class="table-header">
<div class="header-text">员工列表</div> <div class="header-text">员工列表</div>
<div class="table-btn"> <div class="table-btn">
<!-- <el-button @click="handleExport" :size="size" type="primary" plain mode="el-button">导出</el-button> --> <el-button @click="handleExport" :size="size" type="primary" plain mode="el-button">导出</el-button>
<GLButton @click="handleExport" fn="导出" :size="size" type="primary" plain mode="el-button">导出</GLButton> <GLButton @click="handleExport" fn="导出" :size="size" type="primary" plain mode="el-button">导出</GLButton>
<el-button v-if="userInfo.accountLevel == 4" :size="size" plain @click="batch(1)">批量分配角色</el-button>
<el-button v-if="userInfo.accountLevel == 4" :size="size" plain @click="batch(2)">批量启用</el-button>
</div> </div>
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="employeeRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"> <GLTable ref="employeeRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="$globalState.session.accountLevel == 4 ? tableParams1 : tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun" @paginationlisteners="paginationlisteners">
<div slot="optionBtns" slot-scope="scope"> <div slot="optionBtns" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope.scope"></GLTableButton> <GLTableButton :buttonList="buttonList" :buttonItem="scope.scope"></GLTableButton>
<!-- <el-button type="text" @click="handleDetail(scope.scope)">查看</el-button> <!-- <el-button type="text" @click="handleDetail(scope.scope)">查看</el-button>
...@@ -40,10 +42,27 @@ ...@@ -40,10 +42,27 @@
</GLTable> </GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
</div> </div>
<GLDialog :visible="roleVisible" :width="'720px'" @close="handleClose" title="批量分配账号角色" :showClose="true">
<el-form :model="roleForm" :rules="roleFormRules" ref="roleForm" label-width="200px">
<el-form-item label="角色权限:" prop="roleId">
<el-select style="width: 415px;" :size="size" v-model="roleForm.roleId" placeholder="请选择角色权限">
<el-option v-for="item in baseData.roleList" :key="item.id" :label="item.roleName" :value="item.id"></el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer">
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="handleAssign">确定</el-button>
</div>
</GLDialog>
</div> </div>
</template> </template>
<script> <script>
const handleObj = {
1: '角色',
2: '启用'
}
import { utils } from 'glsx-common' import { utils } from 'glsx-common'
export default { export default {
name: 'index', name: 'index',
...@@ -126,6 +145,8 @@ export default { ...@@ -126,6 +145,8 @@ export default {
tableParams: { tableParams: {
listName: 'data', listName: 'data',
tableOption: false, tableOption: false,
// mutiSelectName: 'employeeList',
// mutiSelectUniqueKey: 'id',
otherOptions: { otherOptions: {
label: '启用开关' label: '启用开关'
}, },
...@@ -133,14 +154,91 @@ export default { ...@@ -133,14 +154,91 @@ export default {
{ {
label: '员工姓名', label: '员工姓名',
prop: 'staffName', prop: 'staffName',
width: '100', width: '200',
line: 1 line: 1
}, },
{ {
label: '员工企微号', label: '员工企微号',
prop: 'entmicroName', prop: 'entmicroName',
line: 1, line: 1,
width: '200',
formatter: cellValue => {
return cellValue.entmicroName || '-'
}
},
{
label: '角色',
prop: 'roleName',
width: '200',
line: 1,
formatter: cellValue => {
return cellValue.roleName || '-'
}
},
{
label: '登录手机号',
prop: 'staffPhone',
width: '200'
},
{
label: '所属门店',
prop: 'merchantName',
width: '350',
line: 1
},
{
label: '所属企微',
prop: 'belongingEntmicroName',
width: '200',
line: 1
},
// {
// label: '状态',
// prop: 'statusName',
// width: '80px'
// },
{
label: '更新时间',
prop: 'updatedTime',
line: 1,
minWidth: '200'
},
{
label: '启用开关',
prop: 'otherOptions',
width: '120', width: '120',
addHtml: 'otherOptions',
fixed: 'right'
},
{
label: '操作',
prop: 'optionBtns',
width: '150',
addHtml: 'optionBtns',
fixed: 'right'
}
]
},
tableParams1: {
listName: 'data',
tableOption: false,
mutiSelectName: 'employeeList',
mutiSelectUniqueKey: 'id',
otherOptions: {
label: '启用开关'
},
tableColumns: [
{
label: '员工姓名',
prop: 'staffName',
width: '200',
line: 1
},
{
label: '员工企微号',
prop: 'entmicroName',
line: 1,
width: '200',
formatter: cellValue => { formatter: cellValue => {
return cellValue.entmicroName || '-' return cellValue.entmicroName || '-'
} }
...@@ -157,12 +255,12 @@ export default { ...@@ -157,12 +255,12 @@ export default {
{ {
label: '登录手机号', label: '登录手机号',
prop: 'staffPhone', prop: 'staffPhone',
width: '130' width: '200'
}, },
{ {
label: '所属门店', label: '所属门店',
prop: 'merchantName', prop: 'merchantName',
width: '300', width: '350',
line: 1 line: 1
}, },
{ {
...@@ -180,7 +278,7 @@ export default { ...@@ -180,7 +278,7 @@ export default {
label: '更新时间', label: '更新时间',
prop: 'updatedTime', prop: 'updatedTime',
line: 1, line: 1,
minWidth: '180' minWidth: '200'
}, },
{ {
label: '启用开关', label: '启用开关',
...@@ -250,15 +348,18 @@ export default { ...@@ -250,15 +348,18 @@ export default {
allMerchantList: [], allMerchantList: [],
roleList: [], roleList: [],
staffStatusList: [] staffStatusList: []
},
roleVisible: false,
roleForm: {},
roleFormRules: {
roleId: [{ required: true, message: '请选择角色权限', trigger: 'change' }]
} }
} }
}, },
mounted() { mounted() {
this.userInfo = this.$globalState.session this.userInfo = this.$globalState.session
// 门店 // 门店
if (this.userInfo.accountLevel == 4) { if (this.userInfo.accountLevel == 4) {
// this.searchFormData.splice(0, 1)
var idx = this.tableParams.tableColumns.findIndex(item => item.prop == 'merchantName') var idx = this.tableParams.tableColumns.findIndex(item => item.prop == 'merchantName')
this.tableParams.tableColumns.splice(idx, 1) this.tableParams.tableColumns.splice(idx, 1)
this.searchFormData[0].isHide = true this.searchFormData[0].isHide = true
...@@ -311,7 +412,7 @@ export default { ...@@ -311,7 +412,7 @@ export default {
this.getOptionsList('searchFormData', true, 'roleId') this.getOptionsList('searchFormData', true, 'roleId')
value && value &&
this.$apis.employee.getRoleListApi({ id: value }).then(res => { this.$apis.employee.getRoleListApi({ id: value }).then(res => {
this.baseData.roleList = res this.baseData.roleList = res.filter(item => item.delFlag == 0)
this.getOptionsList('searchFormData', true, 'roleId') this.getOptionsList('searchFormData', true, 'roleId')
}) })
}, },
...@@ -344,6 +445,7 @@ export default { ...@@ -344,6 +445,7 @@ export default {
// this.$refs.employeeRef.setTableHeightFun() // this.$refs.employeeRef.setTableHeightFun()
// } // }
this.$refs.employeeRef.data.length ? (this.$refs.employeeRef.tableHeightValues = '') : this.$refs.employeeRef.setTableHeightFun() this.$refs.employeeRef.data.length ? (this.$refs.employeeRef.tableHeightValues = '') : this.$refs.employeeRef.setTableHeightFun()
this.$refs.employeeRef.$refs.employeeListMutiTable.clearSelection()
}, },
handleDetail(row) { handleDetail(row) {
this.$router.push('/employee/detailEmployee/' + row.id) this.$router.push('/employee/detailEmployee/' + row.id)
...@@ -426,6 +528,98 @@ export default { ...@@ -426,6 +528,98 @@ export default {
document.body.appendChild(a) document.body.appendChild(a)
a.click() a.click()
}) })
},
batch(type) {
const name = handleObj[type]
const selectArr = this.$refs.employeeRef.mutiSelectArr[this.tableParams1.mutiSelectName]
if (!selectArr.length) {
return this.$message.error('您未选中需要批量操作的员工。')
}
if (name == '角色') {
const hasRole = selectArr.some(item => item.statusName == '启用')
if (hasRole) {
this.$confirm(`您选中的员工中包含已设置 “角色” 账号。请去除选中已设置 “角色” 员工账号。`, '', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
})
} else {
this.roleVisible = true
}
} else if (name == '启用') {
const hasNoRole = selectArr.some(item => !item.roleName)
if (hasNoRole) {
this.$message.error('您选中的员工中包含未设置“角色”账号,请去除选中未设置“角色”员工账号。')
} else {
this.$confirm(`是否将选中的账号批量进行启用?`, '', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const list = selectArr.map(item => {
return {
staffId: item.id,
status: 0
}
})
const param = {
list
}
this.$apis.employee.updateStatusBatch(param).then(res => {
if(res) {
this.$message.success('操作成功')
this.$refs.employeeRef.refreshTable(false)
} else {
this.$message.error('操作失败')
}
})
}).catch(() => {
console.log('点击了取消')
})
}
}
},
// 批量分配角色,确定按钮
handleAssign() {
this.$refs.roleForm.validate((valid) => {
if (valid) {
const { roleId } = this.roleForm
let staffIds = this.$refs.employeeRef.mutiSelectArr[this.tableParams1.mutiSelectName]
staffIds = staffIds.map(item => item.id)
// list = list.map(item => {
// return {
// staffId: item.id
// roleId,
// }
// })
const param = {
roleId,
staffIds
}
console.log(param)
this.$apis.employee.addStaffRoleBatch(param).then(res => {
console.log(res)
if (res) {
this.$message.success('操作成功')
this.roleVisible = false
this.roleForm = {}
this.$refs.employeeRef.refreshTable(false)
} else {
this.$message.error('操作失败')
}
})
}
})
},
handleClose() {
this.roleVisible = false
this.roleForm = {}
this.$refs.roleForm.resetFields()
},
// 表格分页穿透事件
paginationlisteners(val) {
console.log(val)
} }
} }
} }
......
...@@ -36,11 +36,11 @@ ...@@ -36,11 +36,11 @@
</div> </div>
<div class="sale-type-desc">跟进员工类型最多新增30个,已新增{{ empType.length - empTypeF.length }}个</div> <div class="sale-type-desc">跟进员工类型最多新增30个,已新增{{ empType.length - empTypeF.length }}个</div>
</el-form-item> </el-form-item>
<!-- <el-form-item label="负责的业务类型" v-if="typeIndex != 2 && typeIndex != 4"> <el-form-item label="负责的业务类型" v-if="typeIndex != 2 && typeIndex != 4">
<el-checkbox-group v-model="selectBusiness" @change="selectType"> <el-checkbox-group v-model="selectBusiness" @change="selectType">
<el-checkbox :disabled="(typeIndex == 0 && item.id != 1) || (typeIndex == 1 && item.id == 1)" v-for="item in businessType" :key="item" :label="item.id">{{ item.businessName }}</el-checkbox> <el-checkbox :disabled="(typeIndex == 0 && item.id != 1) || (typeIndex == 1 && item.id == 1)" v-for="item in businessType" :key="item" :label="item.id">{{ item.businessName }}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> --> </el-form-item>
<el-form-item style="text-align: center"> <el-form-item style="text-align: center">
<el-button @click="onCancel" size="small">取消</el-button> <el-button @click="onCancel" size="small">取消</el-button>
<el-button type="primary" @click="onSubmit" size="small">确定</el-button> <el-button type="primary" @click="onSubmit" size="small">确定</el-button>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<div class="header-text">跟进专员列表</div> <div class="header-text">跟进专员列表</div>
<div class="table-btn"> <div class="table-btn">
<GLButton fn="新增" size="small" type="primary" plain @click="openDrawer">跟进专员</GLButton> <GLButton fn="新增" size="small" type="primary" plain @click="openDrawer">跟进专员</GLButton>
<!-- <el-button size="small" type="primary" plain @click="openDrawer">跟进专员</el-button> --> <el-button size="small" type="primary" plain @click="openDrawer">跟进专员</el-button>
</div> </div>
</div> </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">
...@@ -85,24 +85,19 @@ export default { ...@@ -85,24 +85,19 @@ export default {
}, },
{ {
label: '部门', label: '部门',
prop: 'departmentName', prop: 'departmentName'
width: 120,
line: 1
}, },
{ {
label: '跟进专员类型', label: '跟进专员类型',
prop: 'followerTypeName', prop: 'followerTypeName'
minWidth: 150
}, },
{ {
label: '手机号', label: '手机号',
prop: 'staffPhone', prop: 'staffPhone'
minWidth: 150
}, },
{ {
label: '首次开通时间', label: '首次开通时间',
prop: 'followerCreatedTime', prop: 'followerCreatedTime'
minWidth: 150
}, },
{ {
label: '是否有外部联系人权限', label: '是否有外部联系人权限',
...@@ -317,7 +312,7 @@ export default { ...@@ -317,7 +312,7 @@ export default {
} }
.follow-form { .follow-form {
min-height: calc(100% - 200px); min-height: calc(100% - 200px);
margin-top: 20px; margin-top: 10px;
background: #ffffff; background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1); box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px; padding: 20px;
......
...@@ -93,12 +93,12 @@ export default { ...@@ -93,12 +93,12 @@ export default {
{ {
label: '角色名称', label: '角色名称',
prop: 'roleName', prop: 'roleName',
minWidth: '200' minWidth: '250'
}, },
{ {
label: '角色号', label: '角色号',
prop: 'roleCode', prop: 'roleCode',
minWidth: '200' minWidth: '220'
}, },
{ {
label: '状态', label: '状态',
...@@ -108,12 +108,12 @@ export default { ...@@ -108,12 +108,12 @@ export default {
{ {
label: '创建时间', label: '创建时间',
prop: 'createdTime', prop: 'createdTime',
width: '180' minWidth: '180'
}, },
{ {
label: '更新时间', label: '更新时间',
prop: 'updatedTime', prop: 'updatedTime',
width: '180', minWidth: '180',
formatter: val => { formatter: val => {
if (!val.updatedTime) { if (!val.updatedTime) {
return '--' return '--'
...@@ -297,7 +297,7 @@ export default { ...@@ -297,7 +297,7 @@ export default {
let accountLevel = session.accountLevel let accountLevel = session.accountLevel
console.log(accountLevel) console.log(accountLevel)
if (accountLevel != 4) { if (accountLevel != 4) {
this.tableParams.tableColumns.splice(2, 0, { label: '所属商户名', prop: 'merchantName', width: '300', line: 1 }) this.tableParams.tableColumns.splice(2, 0, { label: '所属商户名', prop: 'merchantName', width: '340', line: 1 })
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].isHide = false this.searchFormData[idx].isHide = false
......
...@@ -290,6 +290,7 @@ export default { ...@@ -290,6 +290,7 @@ export default {
padding: 10px; padding: 10px;
.menu_line_two { .menu_line_two {
display: flex; display: flex;
flex-wrap: wrap;
align-items: center; align-items: center;
.line_element_two { .line_element_two {
// width: 111px; // width: 111px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!