Commit 47ed925b by 匡雅琴

Merge branch 'v2.3.0' of http://192.168.3.233:8090/saas/scrm-micro-settings into v2.3.0

2 parents e5f1b28c 34576e9e
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* @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({
...@@ -17,7 +17,16 @@ const getMerchantTree = params => { ...@@ -17,7 +17,16 @@ const getMerchantTree = params => {
}) })
} }
const getDepartment = params => { const getDepartment = params => {
params.method = 'entmicro.api.department.listDepartmentTree' params.method = 'entmicro.api.department.listDepartment'
return http_config({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const findDepartmentList = params => {
params.method = 'entmicro.api.department.findDepartmentListByPage'
return http_config({ return http_config({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
...@@ -56,6 +65,7 @@ const brandList = params => { ...@@ -56,6 +65,7 @@ const brandList = params => {
export default { export default {
getMerchantTree, getMerchantTree,
getDepartment, getDepartment,
findDepartmentList,
toGL, toGL,
merchantInfo, merchantInfo,
brandList 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 {
...@@ -213,3 +213,7 @@ img { ...@@ -213,3 +213,7 @@ img {
background-color: #FDB757; background-color: #FDB757;
} }
} }
.m-r-md {
margin-right: 20px;
}
\ No newline at end of file \ No newline at end of file
...@@ -39,9 +39,9 @@ export default { ...@@ -39,9 +39,9 @@ export default {
// 所有数据 // 所有数据
AllData: [], AllData: [],
// 城市列表 // 城市列表
cityList: [{ adcode: '', name: '全部' }], cityList: [],
// 地区列表 // 地区列表
townList: [{ adcode: '', name: '全部' }], townList: [],
provinceForm: { provinceForm: {
// 省份名称 // 省份名称
provinceName: '', provinceName: '',
......
/* /*
* @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'
......
...@@ -359,8 +359,13 @@ export default { ...@@ -359,8 +359,13 @@ export default {
}, },
// 获取市 // 获取市
selectCity(cityName, cityCode) { selectCity(cityName, cityCode) {
if (cityName) {
this.accountAddForm.cityName = cityName this.accountAddForm.cityName = cityName
this.accountAddForm.cityCode = cityCode 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()
}, },
......
...@@ -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) {
...@@ -666,7 +666,6 @@ export default { ...@@ -666,7 +666,6 @@ export default {
.mainTitleWrap { .mainTitleWrap {
// height: 32px; // height: 32px;
display: flex; display: flex;
flex-wrap: wrap;
.mainTitle { .mainTitle {
background-color: #f4f6fc; background-color: #f4f6fc;
height: 32px; height: 32px;
......
<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>
......
<!--
* @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>
...@@ -236,8 +236,13 @@ export default { ...@@ -236,8 +236,13 @@ export default {
}, },
// 获取市 // 获取市
selectCity(cityName, cityCode) { selectCity(cityName, cityCode) {
if (cityName) {
this.infoForm.cityName = cityName this.infoForm.cityName = cityName
this.infoForm.cityCode = cityCode this.infoForm.cityCode = cityCode
} else {
this.infoForm.cityName = ''
this.infoForm.cityCode = ''
}
this.infoForm.merchantAddress = '' this.infoForm.merchantAddress = ''
}, },
// 展示驻点电话弹框 // 展示驻点电话弹框
......
...@@ -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: '请先选择您要关联的账户',
...@@ -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 {
.pruple {
background: #5850ff; background: #5850ff;
}
} }
.wrap-title { .wrap-title {
font-size: 16px; font-size: 16px;
font-weight: 500; font-weight: 500;
......
...@@ -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,85 @@ export default { ...@@ -126,6 +145,85 @@ export default {
tableParams: { tableParams: {
listName: 'data', listName: 'data',
tableOption: false, 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 => {
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',
addHtml: 'otherOptions',
fixed: 'right'
},
{
label: '操作',
prop: 'optionBtns',
width: '150',
addHtml: 'optionBtns',
fixed: 'right'
}
]
},
tableParams1: {
listName: 'data',
tableOption: false,
mutiSelectName: 'employeeList',
mutiSelectUniqueKey: 'id',
otherOptions: { otherOptions: {
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">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!