Commit 8515a437 by 杨北旺

Merge branch 'master' of 192.168.3.233:yangming/scrm-micro-config

2 parents 7fbdd4d0 c22ae062
...@@ -5126,7 +5126,8 @@ ...@@ -5126,7 +5126,8 @@
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
...@@ -5550,7 +5551,8 @@ ...@@ -5550,7 +5551,8 @@
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
...@@ -5606,6 +5608,7 @@ ...@@ -5606,6 +5608,7 @@
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
...@@ -5649,12 +5652,14 @@ ...@@ -5649,12 +5652,14 @@
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.1.1", "version": "3.1.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
} }
} }
}, },
...@@ -5901,6 +5906,7 @@ ...@@ -5901,6 +5906,7 @@
"version": "1.0.8", "version": "1.0.8",
"resolved": "https://registry.npmjs.org/glsx-components/-/glsx-components-1.0.8.tgz", "resolved": "https://registry.npmjs.org/glsx-components/-/glsx-components-1.0.8.tgz",
"integrity": "sha512-xfXyyglEZ1IUtaYp+WrTzjwsvNgIo9AfnBCDCfgHL9uFYUD63vedUzJMnSMy7RHAHUJ+u5Fic6mhpPLGc54jSQ==", "integrity": "sha512-xfXyyglEZ1IUtaYp+WrTzjwsvNgIo9AfnBCDCfgHL9uFYUD63vedUzJMnSMy7RHAHUJ+u5Fic6mhpPLGc54jSQ==",
"dev": true,
"requires": { "requires": {
"core-js": "^3.6.5", "core-js": "^3.6.5",
"element-ui": "^2.15.6", "element-ui": "^2.15.6",
...@@ -5911,12 +5917,14 @@ ...@@ -5911,12 +5917,14 @@
"core-js": { "core-js": {
"version": "3.18.3", "version": "3.18.3",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.18.3.tgz", "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.18.3.tgz",
"integrity": "sha512-tReEhtMReZaPFVw7dajMx0vlsz3oOb8ajgPoHVYGxr8ErnZ6PcYEvvmjGmXlfpnxpkYSdOQttjB+MvVbCGfvLw==" "integrity": "sha512-tReEhtMReZaPFVw7dajMx0vlsz3oOb8ajgPoHVYGxr8ErnZ6PcYEvvmjGmXlfpnxpkYSdOQttjB+MvVbCGfvLw==",
"dev": true
}, },
"element-ui": { "element-ui": {
"version": "2.15.6", "version": "2.15.6",
"resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.15.6.tgz", "resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.15.6.tgz",
"integrity": "sha512-rcYXEKd/j2G0AgficAOk1Zd1AsnHRkhmrK4yLHmNOiimU2JfsywgfKUjMoFuT6pQx0luhovj8lFjpE4Fnt58Iw==", "integrity": "sha512-rcYXEKd/j2G0AgficAOk1Zd1AsnHRkhmrK4yLHmNOiimU2JfsywgfKUjMoFuT6pQx0luhovj8lFjpE4Fnt58Iw==",
"dev": true,
"requires": { "requires": {
"async-validator": "~1.8.1", "async-validator": "~1.8.1",
"babel-helper-vue-jsx-merge-props": "^2.0.0", "babel-helper-vue-jsx-merge-props": "^2.0.0",
...@@ -11508,6 +11516,21 @@ ...@@ -11508,6 +11516,21 @@
"integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=", "integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=",
"dev": true "dev": true
}, },
"uppercamelcase": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/uppercamelcase/-/uppercamelcase-1.1.0.tgz",
"integrity": "sha1-Mk2YprOvx+iolT4QZBUJsOTiP5c=",
"requires": {
"camelcase": "^1.2.1"
},
"dependencies": {
"camelcase": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz",
"integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk="
}
}
},
"uri-js": { "uri-js": {
"version": "4.2.2", "version": "4.2.2",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz",
...@@ -11661,7 +11684,16 @@ ...@@ -11661,7 +11684,16 @@
"vue": { "vue": {
"version": "2.6.11", "version": "2.6.11",
"resolved": "https://registry.npmjs.org/vue/-/vue-2.6.11.tgz", "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.11.tgz",
"integrity": "sha512-VfPwgcGABbGAue9+sfrD4PuwFar7gPb1yl1UK1MwXoQPAw0BKSqWfoYCT/ThFrdEVWoI51dBuyCoiNU9bZDZxQ==" "integrity": "sha512-VfPwgcGABbGAue9+sfrD4PuwFar7gPb1yl1UK1MwXoQPAw0BKSqWfoYCT/ThFrdEVWoI51dBuyCoiNU9bZDZxQ==",
"dev": true
},
"vue-amap": {
"version": "0.5.10",
"resolved": "https://registry.npmjs.org/vue-amap/-/vue-amap-0.5.10.tgz",
"integrity": "sha512-9ViNCev1vx32+zZ5RvF/TmUZNbwL9QrdA2/OnD2GlXMfQBkJy7D08Vb7379t6guqnopDPtWJ8K6gg72h9+4GUg==",
"requires": {
"uppercamelcase": "^1.1.0"
}
}, },
"vue-cli-plugin-element": { "vue-cli-plugin-element": {
"version": "1.0.1", "version": "1.0.1",
......
...@@ -51,4 +51,24 @@ const getMerchantTreeApi = params => { ...@@ -51,4 +51,24 @@ const getMerchantTreeApi = params => {
}) })
} }
export { getListApi, getAllMerchantListApi, getRoleListApi, getAllDictApi, getMerchantTreeApi } const getDetailInfoApi = params => {
params.method = `${defaultPath}staff.staffSearchRequest`
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const getDetailLogApi = params => {
params.method = `${defaultPath}menu.findLog`
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
export { getListApi, getAllMerchantListApi, getRoleListApi, getAllDictApi, getMerchantTreeApi, getDetailInfoApi, getDetailLogApi }
...@@ -41,10 +41,22 @@ const staticRoutes = Object.freeze([{ ...@@ -41,10 +41,22 @@ const staticRoutes = Object.freeze([{
meta: {} meta: {}
}, },
{ {
name: 'employee', name: 'Account2EmployeeIndex',
path: '/employee/index',
meta: {},
component: resolve => require([`@/views/employee/index.vue`], resolve)
},
{
name: 'Account2EmployeeEditEmployee',
path: '/employee/editEmployee', path: '/employee/editEmployee',
meta: {}, meta: {},
component: resolve => require([`@/views/employee/editEmployee.vue`], resolve) component: resolve => require([`@/views/employee/editEmployee.vue`], resolve)
},
{
name: 'Account2EmployeeDetailEmployee',
path: '/employee/detailEmployee',
meta: {},
component: resolve => require([`@/views/employee/detailEmployee.vue`], resolve)
} }
]) ])
export default staticRoutes export default staticRoutes
\ No newline at end of file \ No newline at end of file
...@@ -13,7 +13,7 @@ let routes = [] ...@@ -13,7 +13,7 @@ let routes = []
let router = null let router = null
let instance = null let instance = null
export async function bootstrap({ name, id, history, common, messenger, globalState }) { export async function bootstrap({ name, id, history, common, messenger, globalState }) {
const { response, request, sign, secret, request_common, request_config } = await fetchConfig() const { response, request, sign, secret, request_common, request_config } = await fetchConfig(globalState.configSwitch)
console.log(request) console.log(request)
Vue.prototype.$history = history Vue.prototype.$history = history
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
<el-radio-group class="select-tree" v-model="form[targetItem.name]" @change="handleChangeRadio"> <el-radio-group class="select-tree" v-model="form[targetItem.name]" @change="handleChangeRadio">
<el-radio class="page-radio" :title="item.merchantName" v-for="item in currList" :key="item.id" :label="item.id">{{ item.merchantName }}</el-radio> <el-radio class="page-radio" :title="item.merchantName" v-for="item in currList" :key="item.id" :label="item.id">{{ item.merchantName }}</el-radio>
</el-radio-group> </el-radio-group>
<div class="btns"> <div class="btns" v-show="page.total > 20">
<el-button :size="size" :disabled="page.pageNum == 1" @click="handlePage(false)">上一页</el-button> <el-button :size="size" :disabled="page.pageNum == 1" @click="handlePage(false)">上一页</el-button>
<span>{{ page.pageNum }}/{{ page.totalPage }}</span> <span>{{ page.pageNum }}/{{ page.totalPage }}</span>
<el-button :size="size" :disabled="page.pageNum == page.totalPage" @click="handlePage(true)">下一页</el-button> <el-button :size="size" :disabled="page.pageNum == page.totalPage" @click="handlePage(true)">下一页</el-button>
</div> </div>
<!-- <el-tree ref="tree" class="select-tree" highlight-current default-expand-all node-key="id" :expand-on-click-node="isExpand" :style="`min-width: ${treeWidth}`" :data="treeData" :current-node-key="form[targetItem.name]" :props="defaultProps" :filter-node-method="handleFilterNode" @current-change="handleNodeClick"></el-tree> --> <!-- <el-tree ref="tree" class="select-tree" highlight-current default-expand-all node-key="id" :expand-on-click-node="isExpand" :style="`min-width: ${treeWidth}`" :data="treeData" :current-node-key="form[targetItem.name]" :props="defaultProps" :filter-node-method="handleFilterNode" @current-change="handleNodeClick"></el-tree> -->
<el-input slot="reference" ref="input" v-model="form[targetItem.nameLabel]" clearable :disabled="targetItem.isDisabled" :style="`width: ${width}px`" :class="{ rotate: popoverVisible }" suffix-icon="el-icon-arrow-down" :placeholder="'请选择' + targetItem.label" @change="handleClear"></el-input> <el-input slot="reference" ref="input" v-model="form[targetItem.nameLabel]" :clearable="!targetItem.noClearable" :disabled="targetItem.isDisabled" :style="`width: ${width}px`" :class="{ rotate: popoverVisible }" suffix-icon="el-icon-arrow-down" :placeholder="'请选择' + targetItem.label" @change="handleClear"></el-input>
</el-popover> </el-popover>
</div> </div>
</template> </template>
...@@ -26,7 +26,7 @@ export default { ...@@ -26,7 +26,7 @@ export default {
isExpand: false, isExpand: false,
// 树状菜单显示状态 // 树状菜单显示状态
popoverVisible: false, popoverVisible: false,
treeWidth: 'auto', // treeWidth: 'auto',
currList: [], currList: [],
allMerchantList: [], allMerchantList: [],
page: { page: {
...@@ -42,7 +42,7 @@ export default { ...@@ -42,7 +42,7 @@ export default {
// 输入框宽度 // 输入框宽度
width: { width: {
type: String, type: String,
default: '300px' default: '360'
}, },
form: { form: {
type: Object, type: Object,
...@@ -56,15 +56,6 @@ export default { ...@@ -56,15 +56,6 @@ export default {
type: Array, type: Array,
default: () => [] default: () => []
} }
// defaultProps: {
// type: Object,
// default: () => ({
// parent: 'parentId',
// value: 'id',
// label: 'menuName',
// children: 'childlist'
// })
// }
}, },
// watch: { // watch: {
...@@ -80,21 +71,13 @@ export default { ...@@ -80,21 +71,13 @@ export default {
created() { created() {
// 获取输入框宽度同步至树状菜单宽度 // 获取输入框宽度同步至树状菜单宽度
this.$nextTick(() => { // this.$nextTick(() => {
this.treeWidth = `${(this.width || this.$refs.input.$refs.input.clientWidth) - 24}px` // this.treeWidth = `${(this.width || this.$refs.input.$refs.input.clientWidth) - 24}px`
}) // })
}, },
mounted() { mounted() {
this.getAllMerchantList() this.getAllMerchantList()
// if (this.form[this.targetItem.name]) {
// // console.log(this.treeData)
// // console.log(this.form)
// this.form[this.targetItem.nameLabel] = this.queryTree(this.treeData, this.form[this.targetItem.name])
// this.$nextTick().then(() => {
// this.$refs.tree.setCheckedKeys([this.form[this.targetItem.name]])
// })
// }
}, },
methods: { methods: {
...@@ -107,7 +90,6 @@ export default { ...@@ -107,7 +90,6 @@ export default {
this.page.total = res.length this.page.total = res.length
this.page.totalPage = Math.ceil(res.length / this.page.pageSize) this.page.totalPage = Math.ceil(res.length / this.page.pageSize)
this.getCurrList() this.getCurrList()
// index + (page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1
}) })
}, },
handlePage(isNext) { handlePage(isNext) {
...@@ -119,9 +101,6 @@ export default { ...@@ -119,9 +101,6 @@ export default {
this.$emit('handleChange', val) this.$emit('handleChange', val)
this.onHidePopover() this.onHidePopover()
}, },
// handleClickRadio(item) {
// console.log(item)
// },
// 显示时触发 // 显示时触发
onShowPopover() { onShowPopover() {
this.popoverVisible = true this.popoverVisible = true
...@@ -131,37 +110,11 @@ export default { ...@@ -131,37 +110,11 @@ export default {
onHidePopover() { onHidePopover() {
this.popoverVisible = false this.popoverVisible = false
}, },
// 树节点过滤方法
// handleFilterNode(query, data) {
// if (!query) return true
// return data[this.defaultProps.label].indexOf(query) !== -1
// },
// handleNodeClick(val) {
// this.$emit('selected', { val: val, targetItem: this.targetItem, formName: this.targetItem.formName })
// this.onHidePopover()
// },
handleClear(val) { handleClear(val) {
this.form[this.targetItem.name] = '' this.form[this.targetItem.name] = ''
this.form[this.targetItem.nameLabel] = '' this.form[this.targetItem.nameLabel] = ''
this.$emit('handleChange') this.$emit('handleChange')
// this.$emit('selected', { val: val, targetItem: this.targetItem, formName: this.targetItem.formName })
// window.event.stopPropagation()
} }
// 搜索树状数据中的 ID
// queryTree(tree, id) {
// let stark = []
// stark = stark.concat(tree)
// while (stark.length) {
// const temp = stark.shift()
// if (temp[this.defaultProps.children]) {
// stark = stark.concat(temp[this.defaultProps.children])
// }
// if (temp[this.defaultProps.value] === id) {
// return temp[this.defaultProps.label]
// }
// }
// return
// }
} }
} }
</script> </script>
......
<!-- 配置管理 -->
<template>
<div class="config-employee">
<!-- <div class="container">
<p class="edit-title">{{ title }}</p>
</div> -->
<div class="container">
<!-- <p class="edit-sub-title p-rl-20">员工基本信息</p>
<glsx-combi-form class="p-rl-20" ref="editFormRef" labelWidth="160px" :isBlock="isBlock" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<template slot="merchantId" slot-scope="item">
<select-page :form="editForm" width="300px" :targetItem="item.scope" @handleChange="handleChangeMerchant"></select-page>
</template>
<template slot="visibleInferiorMer" slot-scope="item">
<el-input :style="{ width: item.width || '360px' }" placeholder="可见商户" v-model="filterText"></el-input>
<el-tree show-checkbox check-on-click-node check-strictly class="filter-tree" :data="baseData.merchantTree" :props="defaultProps" default-expand-all :filter-node-method="filterNode" ref="tree" @check="handleClickNode"></el-tree>
</template>
</glsx-combi-form> -->
</div>
</div>
</template>
<script>
export default {
name: 'config',
data() {
return {}
},
components: {},
computed: {},
mounted() {},
methods: {
handleClose() {
this.$router.push({
name: 'Account2EmployeeIndex'
})
}
}
}
</script>
<style>
.config-employee {
margin-bottom: 64px;
}
.config-employee .container {
margin-top: 20px;
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
}
.config-employee .p-rl-20 {
padding: 0 20px;
}
.config-employee .flex {
display: flex;
justify-content: space-between;
}
.config-employee .edit-container {
margin-bottom: 84px;
}
.config-employee .footer {
position: fixed;
bottom: 0;
width: 100%;
height: 64px;
text-align: center;
line-height: 64px;
background: #ffffff;
z-index: 999;
}
.config-employee .flex {
display: flex;
justify-content: space-between;
}
.config-employee .edit-title {
font-size: 20px;
font-weight: bold;
color: #333333;
line-height: 38px;
height: 38px;
margin: 0 0;
}
.config-employee .edit-sub-title {
height: 48px;
line-height: 48px;
font-size: 16px;
color: #333333;
font-weight: 600;
border-bottom: 1px solid #e7eaec;
margin: 0 0;
}
.config-employee .filter-tree {
width: 360px;
max-height: 200px;
overflow: scroll;
}
.config-employee .el-checkbox:last-of-type {
margin-right: 8px;
}
.config-employee .filter-tree .el-tree-node__label {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
<!-- 基本信息 -->
<template>
<div class="config-employee">
<div class="container">
<p class="edit-sub-title p-rl-20">员工基本信息</p>
<el-form label-width="140px">
<el-form-item style="margin-bottom: 0;" v-for="(item, index) in detailFormDaata" :key="index" :label="item.label + ':'">
<span>{{ info[item.name] || '无' }}</span>
</el-form-item>
</el-form>
</div>
<div class="container">
<p class="edit-sub-title p-rl-20">可见下级商户</p>
</div>
</div>
</template>
<script>
import { getDetailInfoApi } from '@/api/modules/employee'
export default {
name: 'info',
data() {
return {
info: {},
detailFormDaata: [{
label: '姓名',
name: 'staffName'
}, {
label: '登录手机号',
name: 'staffPhone'
}, {
label: '企微号',
name: 'entmicroName'
}, {
label: '职务',
name: 'staffJob'
}, {
label: '角色名称',
name: 'roleName'
}, {
label: '创建人',
name: 'createdAccount'
}]
}
},
props: {
id: {
type: String,
default: ''
}
},
mounted() {
this.getInfo()
},
methods: {
getInfo() {
getDetailInfoApi({ id: this.id }).then(res => {
console.log(res)
this.info = res
})
}
}
}
</script>
<style>
.config-employee {
margin-bottom: 64px;
}
.config-employee .container {
margin-top: 20px;
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
}
.config-employee .p-rl-20 {
padding: 0 20px;
}
.config-employee .flex {
display: flex;
justify-content: space-between;
}
.config-employee .edit-container {
margin-bottom: 84px;
}
.config-employee .footer {
position: fixed;
bottom: 0;
width: 100%;
height: 64px;
text-align: center;
line-height: 64px;
background: #ffffff;
z-index: 999;
}
.config-employee .flex {
display: flex;
justify-content: space-between;
}
.config-employee .edit-title {
font-size: 20px;
font-weight: bold;
color: #333333;
line-height: 38px;
height: 38px;
margin: 0 0;
}
.config-employee .edit-sub-title {
height: 48px;
line-height: 48px;
font-size: 16px;
color: #333333;
font-weight: 600;
border-bottom: 1px solid #e7eaec;
margin: 0 0;
}
.config-employee .filter-tree {
width: 360px;
max-height: 200px;
overflow: scroll;
}
.config-employee .el-checkbox:last-of-type {
margin-right: 8px;
}
.config-employee .filter-tree .el-tree-node__label {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
<!-- 修改记录 -->
<template>
<div class="config-employee">
<div class="container">
<p class="edit-sub-title p-rl-20">修改记录</p>
<GLTable ref="employeeRef" :getListApi="getListApi" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<template slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleDetail(scope.scope)">查看</el-button>
<el-button type="text" @click="handleEdit(2, scope.scope)">修改</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
</template>
</GLTable>
</div>
</div>
</template>
<script>
import { getDetailLogApi } from '@/api/modules/employee'
export default {
name: 'record',
data() {
return {
searchForm: {},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
getListApi: getDetailLogApi,
tableParams: {
listName: 'data',
tableColumns: [
{
label: '登录账户',
prop: 'operator',
line: 2
},
{
label: '登录产品',
prop: 'productName',
line: 2
},
{
label: '登录IP',
prop: 'ip',
line: 2
},
{
label: '修改内容',
prop: 'module',
formatter: cellValue => {
return cellValue.module + '-' + cellValue.action
}
},
{
label: '操作人',
prop: 'userName',
line: 2
},
{
label: '操作时间',
prop: 'createdTime',
width: '180px'
}
]
}
}
},
props: {
id: {
type: String,
default: ''
}
},
mounted() {
},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm = {
bussinessId: this.id,
moduleName: '员工模块'
}
resolve()
})
}
}
}
</script>
<style>
.config-employee {
margin-bottom: 64px;
}
.config-employee .container {
margin-top: 20px;
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
}
.config-employee .p-rl-20 {
padding: 0 20px;
}
.config-employee .flex {
display: flex;
justify-content: space-between;
}
.config-employee .edit-container {
margin-bottom: 84px;
}
.config-employee .footer {
position: fixed;
bottom: 0;
width: 100%;
height: 64px;
text-align: center;
line-height: 64px;
background: #ffffff;
z-index: 999;
}
.config-employee .flex {
display: flex;
justify-content: space-between;
}
.config-employee .edit-title {
font-size: 20px;
font-weight: bold;
color: #333333;
line-height: 38px;
height: 38px;
margin: 0 0;
}
.config-employee .edit-sub-title {
height: 48px;
line-height: 48px;
font-size: 16px;
color: #333333;
font-weight: 600;
border-bottom: 1px solid #e7eaec;
margin: 0 0;
}
.config-employee .filter-tree {
width: 360px;
max-height: 200px;
overflow: scroll;
}
.config-employee .el-checkbox:last-of-type {
margin-right: 8px;
}
.config-employee .filter-tree .el-tree-node__label {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
<!-- 员工详情 -->
<template>
<div class="config-employee">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="基本信息" name="info">
<info :id="id"></info>
</el-tab-pane>
<el-tab-pane label="账户权限" name="config">
<config :id="id"></config>
</el-tab-pane>
<el-tab-pane label="修改记录" name="record">
<record :id="id"></record>
</el-tab-pane>
</el-tabs>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" @click="handleClose">关闭</el-button>
</div>
</div>
</template>
<script>
import info from './detail/info'
import config from './detail/config'
import record from './detail/record'
export default {
name: 'detailEmployee',
data() {
return {
id: '',
activeName: 'info',
footerLeft: '0',
footerWidth: '0'
}
},
components: {
info,
config,
record
},
computed: {},
created() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.id = this.$route.params.id
console.log(this.id)
},
methods: {
handleClose() {
this.$router.push({
name: 'Account2EmployeeIndex'
})
}
}
}
</script>
<style scoped>
.config-employee {
margin-bottom: 64px;
}
.config-employee .container {
margin-top: 20px;
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
}
.config-employee .p-rl-20 {
padding: 0 20px;
}
.config-employee .flex {
display: flex;
justify-content: space-between;
}
.config-employee .edit-container {
margin-bottom: 84px;
}
.config-employee .footer {
position: fixed;
bottom: 0;
width: 100%;
height: 64px;
text-align: center;
line-height: 64px;
background: #ffffff;
z-index: 999;
}
.config-employee .flex {
display: flex;
justify-content: space-between;
}
.config-employee .edit-title {
font-size: 20px;
font-weight: bold;
color: #333333;
line-height: 38px;
height: 38px;
margin: 0 0;
}
.config-employee .edit-sub-title {
height: 48px;
line-height: 48px;
font-size: 16px;
color: #333333;
font-weight: 600;
border-bottom: 1px solid #e7eaec;
margin: 0 0;
}
.config-employee .filter-tree {
width: 360px;
max-height: 200px;
overflow: scroll;
}
.config-employee .el-checkbox:last-of-type {
margin-right: 8px;
}
.config-employee .filter-tree .el-tree-node__label {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
<!-- 编辑员工 --> <!-- 编辑员工 -->
<template> <template>
<div class="config-employee"> <div class="config-employee">
<div class="container"> <div class="container" style="margin-top: 0;">
<p class="edit-title">{{ title }}</p> <p class="edit-title">{{ title }}</p>
</div> </div>
<div class="container"> <div class="container">
<p class="edit-sub-title p-rl-20">员工基本信息</p> <p class="edit-sub-title p-rl-20">员工基本信息</p>
<glsx-combi-form class="p-rl-20" ref="editFormRef" labelWidth="160px" :isBlock="isBlock" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"> <glsx-combi-form class="p-rl-20" ref="editFormRef" labelWidth="160px" :isBlock="isBlock" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<template slot="merchantId" slot-scope="item"> <template slot="merchantId" slot-scope="item">
<select-page :form="editForm" width="300px" :targetItem="item.scope"></select-page> <select-page :form="editForm" width="300px" :targetItem="item.scope" @handleChange="handleChangeMerchant"></select-page>
<!-- <el-select v-model="editForm.merchantId" placeholder="请选择所属商户" @change="handleChangeMerchant($event, item)"> </template>
<el-option v-for="subItem in baseData.allMerchantList" :key="subItem.id" :label="subItem.merchantName" :value="subItem.id" :disabled="subItem.isDisabled || false"></el-option> <template slot="visibleInferiorMer" slot-scope="item">
</el-select> --> <el-input :style="{ width: item.width || '360px' }" placeholder="可见商户" v-model="filterText"></el-input>
<el-tree show-checkbox check-on-click-node check-strictly class="filter-tree" :data="baseData.merchantTree" :props="defaultProps" default-expand-all :filter-node-method="filterNode" ref="tree" @check="handleClickNode"></el-tree>
</template> </template>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<!-- <template
slot="menuTree"
slot-scope="scope"
>
<select-tree
:form="searchForm"
:targetItem="scope.scope"
:treeData="baseData.searchMenuTreeList"
:defaultProps="treeDefaultProps"
@selected="handleTreeSelect"
></select-tree>
</template> -->
<div class="footer">
<el-button type="primary" @click="handleConfirm">确定</el-button> <el-button type="primary" @click="handleConfirm">确定</el-button>
<el-button type="default" @click="handleCancel">取消</el-button> <el-button type="default" @click="handleCancel">取消</el-button>
</div> </div>
...@@ -49,19 +37,28 @@ export default { ...@@ -49,19 +37,28 @@ export default {
1: '新增员工', 1: '新增员工',
2: '编辑员工' 2: '编辑员工'
}, },
footerLeft: '0',
footerWidth: '0',
editChildRef: 'editChildRef', editChildRef: 'editChildRef',
routeInfo: { routeInfo: {
// 1-新增;2-编辑 // 1-新增;2-编辑
addOrEdit: 1, addOrEdit: 1,
id: '' id: ''
}, },
// 可见商户 - 树
filterText: '',
defaultProps: {
children: 'children',
value: 'id',
label: 'label'
},
editForm: { editForm: {
merchantId: '', merchantId: '',
merchantName: '', merchantName: '',
staffName: '', staffName: '',
staffPhone: '', staffPhone: '',
password: '', password: '',
searchMerchant: '', visibleInferiorMer: '',
roleId: '', roleId: '',
merhcnatImg: '' merhcnatImg: ''
}, },
...@@ -69,8 +66,9 @@ export default { ...@@ -69,8 +66,9 @@ export default {
merchantId: [{ required: true, message: '请选择所属商户', trigger: 'change' }], merchantId: [{ required: true, message: '请选择所属商户', trigger: 'change' }],
staffName: [{ required: true, message: '请输入员工姓名', trigger: 'change' }], staffName: [{ required: true, message: '请输入员工姓名', trigger: 'change' }],
staffPhone: [{ required: true, message: '请输入登录手机号', trigger: 'change' }], staffPhone: [{ required: true, message: '请输入登录手机号', trigger: 'change' }],
// 6-15位
password: [{ required: true, message: '请输入登录密码', trigger: 'change' }], password: [{ required: true, message: '请输入登录密码', trigger: 'change' }],
searchMerchant: [{ required: true, message: '请选择可见商户', trigger: 'change' }], visibleInferiorMer: [{ required: true, message: '请选择可见商户', trigger: 'change' }],
roleId: [{ required: true, message: '请选择角色权限', trigger: 'change' }] roleId: [{ required: true, message: '请选择角色权限', trigger: 'change' }]
}, },
isBlock: true, isBlock: true,
...@@ -79,6 +77,7 @@ export default { ...@@ -79,6 +77,7 @@ export default {
label: '所属商户', label: '所属商户',
name: 'merchantId', name: 'merchantId',
nameLabel: 'merchantName', nameLabel: 'merchantName',
noClearable: true,
optionList: [], optionList: [],
optionId: 'id', optionId: 'id',
optionLabel: 'merchantName', optionLabel: 'merchantName',
...@@ -109,13 +108,14 @@ export default { ...@@ -109,13 +108,14 @@ export default {
}, },
{ {
label: '可见商户', label: '可见商户',
name: 'searchMerchant', name: 'visibleInferiorMer',
addHtml: 'searchMerchant' addHtml: 'visibleInferiorMer'
}, },
{ {
label: '角色权限', label: '角色权限',
name: 'roleId', name: 'roleId',
type: 'select', type: 'select',
width: '360px',
optionList: [], optionList: [],
optionId: 'id', optionId: 'id',
optionLabel: 'roleName', optionLabel: 'roleName',
...@@ -160,14 +160,20 @@ export default { ...@@ -160,14 +160,20 @@ export default {
} }
}, },
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
components: { components: {
glsxCombiForm, glsxCombiForm,
selectPage selectPage
}, },
computed: {},
mounted() { mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.routeInfo = this.$route.params this.routeInfo = this.$route.params
this.getAllMerchantList() this.getAllMerchantList()
}, },
...@@ -178,11 +184,15 @@ export default { ...@@ -178,11 +184,15 @@ export default {
this.baseData.allMerchantList = res this.baseData.allMerchantList = res
}) })
}, },
handleChangeMerchant(e, item) { handleChangeMerchant(e) {
console.log(e) console.log(e)
console.log(item)
this.editForm.roleId = '' this.editForm.roleId = ''
// this.editForm.roleId = '' this.editForm.visibleInferiorMer = ''
if (!e) {
this.baseData.merchantTree = []
this.baseData.roleList = []
this.getOptionsList('editFormData', false, 'roleId')
}
this.getRoleList(e) this.getRoleList(e)
this.getMerchantTree(e) this.getMerchantTree(e)
}, },
...@@ -191,6 +201,10 @@ export default { ...@@ -191,6 +201,10 @@ export default {
this.baseData.merchantTree = res this.baseData.merchantTree = res
}) })
}, },
filterNode(value, data) {
if (!value) return true
return data.label.indexOf(value) !== -1
},
getRoleList(value) { getRoleList(value) {
getRoleListApi({ id: value }).then(res => { getRoleListApi({ id: value }).then(res => {
this.baseData.roleList = res this.baseData.roleList = res
...@@ -222,6 +236,27 @@ export default { ...@@ -222,6 +236,27 @@ export default {
} }
}) })
} }
},
handleClickNode(data, node) {
// console.log(node.checkedNodes)
this.editForm.visibleInferiorMer = node.checkedNodes.map(item => item.id)
this.$refs.editFormRef.$refs[this.editChildRef].validateField('visibleInferiorMer')
},
handleConfirm() {
// console.log(this.$refs.tree.getCheckedNodes())
console.log(this.editForm)
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
this.editForm.roleIds = [this.editForm.roleId]
console.log(this.editForm)
this.handleCancel()
}
})
},
handleCancel() {
this.$router.push({
name: 'Account2EmployeeIndex'
})
} }
} }
} }
...@@ -252,6 +287,7 @@ export default { ...@@ -252,6 +287,7 @@ export default {
bottom: 0; bottom: 0;
width: 100%; width: 100%;
height: 64px; height: 64px;
/* left: 220px; */
text-align: center; text-align: center;
line-height: 64px; line-height: 64px;
background: #ffffff; background: #ffffff;
...@@ -272,17 +308,6 @@ export default { ...@@ -272,17 +308,6 @@ export default {
margin: 0 0; margin: 0 0;
} }
/* .config-employee .edit-sub-title::before {
position: absolute;
display: inline-block;
content: '';
height: 18px;
width: 4px;
top: 2px;
left: 0;
background-color: #0947C6;
} */
.config-employee .edit-sub-title { .config-employee .edit-sub-title {
height: 48px; height: 48px;
line-height: 48px; line-height: 48px;
...@@ -292,4 +317,17 @@ export default { ...@@ -292,4 +317,17 @@ export default {
border-bottom: 1px solid #e7eaec; border-bottom: 1px solid #e7eaec;
margin: 0 0; margin: 0 0;
} }
.config-employee .filter-tree {
width: 360px;
max-height: 200px;
overflow: scroll;
}
.config-employee .el-checkbox:last-of-type {
margin-right: 8px;
}
.config-employee .filter-tree .el-tree-node__label {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style> </style>
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot> <slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
<el-input v-else-if="item.type === 'input'" :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :style="{ width: item.width || 'auto' }" :show-word-limit="item.showLimit || false" @keydown.native="e => handleInputDown(e, item)"></el-input> <el-input v-else-if="item.type === 'input'" :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :style="{ width: item.width || 'auto' }" :show-word-limit="item.showLimit || false" @keydown.native="e => handleInputDown(e, item)"></el-input>
<!-- 选择-输入框 --> <!-- 选择-输入框 -->
<el-input v-else-if="item.type === 'selectInput'" :placeholder="'请输入' + item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).label" v-model.trim="searchSelectObj[item.selectName].value" :clearable="item.isClear || false" class="input-with-select"> <el-input v-else-if="item.type === 'selectInput'" :placeholder="'请输入' + item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).label" :maxlength="item.maxlength" v-model.trim="searchSelectObj[item.selectName].value" :clearable="item.isClear || false" :style="{ width: item.inputWidth || '130px' }" class="input-with-select">
<el-select v-model="searchSelectObj[item.selectName].attr" style="width: 130px" slot="prepend" placeholder="请选择" @change="item.handleSelectChange"> <el-select v-model="searchSelectObj[item.selectName].attr" :style="{ width: item.selectWidth || '130px' }" slot="prepend" placeholder="请选择" @change="item.handleSelectChange">
<el-option v-for="(subItem, subIndex) in item.selectOption" :key="subIndex" :label="subItem.label" :value="subItem.name"></el-option> <el-option v-for="(subItem, subIndex) in item.selectOption" :key="subIndex" :label="subItem.label" :value="subItem.name"></el-option>
</el-select> </el-select>
</el-input> </el-input>
......
<!-- 员工管理 --> <!-- 员工管理 -->
<template> <template>
<div class="config-employee"> <div class="config-employee">
<!-- <div class="container"> -->
<div style="margin: 16px 0;">
<el-button :size="size" type="primary" @click="handleEdit(1)">创建员工</el-button>
</div>
<!-- </div> -->
<div class="container"> <div class="container">
<div class="flex"> <div>
<div style="margin-top: 16px;"> <glsx-combi-form ref="showSearch" labelWidth="90px" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData">
<el-button :size="size" type="primary" @click="handleEdit(1)">创建员工</el-button>
</div>
<glsx-combi-form ref="showSearch" labelWidth="100px" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData">
<template slot="merchantId" slot-scope="item"> <template slot="merchantId" slot-scope="item">
<select-page :form="searchForm" width="300px" :targetItem="item.scope" @handleChange="handleChangeMerchant"></select-page> <select-page :form="searchForm" width="200px" :targetItem="item.scope" @handleChange="handleChangeMerchant"></select-page>
</template> </template>
<template slot="footer"> <template slot="footer">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button> <el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
...@@ -19,11 +21,11 @@ ...@@ -19,11 +21,11 @@
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="employeeRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"> <GLTable ref="employeeRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<template slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleDetail(scope.scope)">查看</el-button> <el-button type="text" @click="handleDetail(scope.scope)">查看</el-button>
<el-button type="text" @click="handleEdit(2, scope.scope)">修改</el-button> <el-button type="text" @click="handleEdit(2, scope.scope)">修改</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button> <el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
</template> </div>
</GLTable> </GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
</div> </div>
...@@ -69,7 +71,7 @@ export default { ...@@ -69,7 +71,7 @@ export default {
label: '角色', label: '角色',
name: 'roleId', name: 'roleId',
type: 'select', type: 'select',
width: '192px', width: '140px',
optionList: [], optionList: [],
optionId: 'id', optionId: 'id',
optionLabel: 'roleName', optionLabel: 'roleName',
...@@ -79,7 +81,7 @@ export default { ...@@ -79,7 +81,7 @@ export default {
label: '状态', label: '状态',
name: 'status', name: 'status',
type: 'select', type: 'select',
width: '192px', width: '140px',
optionList: [], optionList: [],
optionId: 'dictValue', optionId: 'dictValue',
optionLabel: 'dictLabel', optionLabel: 'dictLabel',
...@@ -89,6 +91,9 @@ export default { ...@@ -89,6 +91,9 @@ export default {
type: 'selectInput', type: 'selectInput',
selectName: 'staffNameOrPhone', selectName: 'staffNameOrPhone',
isClear: true, isClear: true,
maxlength: 15,
inputWidth: '280px',
selectWidth: '100px',
selectOption: [ selectOption: [
{ {
label: '员工姓名', label: '员工姓名',
...@@ -127,7 +132,7 @@ export default { ...@@ -127,7 +132,7 @@ export default {
{ {
label: '登录手机号', label: '登录手机号',
prop: 'staffPhone', prop: 'staffPhone',
line: 2 width: '130px'
}, },
{ {
label: '所属门店', label: '所属门店',
...@@ -248,12 +253,19 @@ export default { ...@@ -248,12 +253,19 @@ export default {
resolve() resolve()
}) })
}, },
handleDetail(row) {
this.$router.push({
name: 'Account2EmployeeDetailEmployee',
params: {
id: row.id
}
})
},
// 1-新增;2-编辑 // 1-新增;2-编辑
handleEdit(addOrEdit, row) { handleEdit(addOrEdit, row) {
console.log(addOrEdit) console.log(addOrEdit)
this.$router.push({ this.$router.push({
name: 'employee', name: 'Account2EmployeeEditEmployee',
// name: 'ConfigEmployeeIndex',
params: { params: {
addOrEdit: addOrEdit, addOrEdit: addOrEdit,
id: row ? row.id : '-1' id: row ? row.id : '-1'
...@@ -261,13 +273,6 @@ export default { ...@@ -261,13 +273,6 @@ export default {
}) })
}, },
// handleReset() {
// this.searchForm = {
// name: ''
// }
// this.handleSearch()
// },
handleSearch() { handleSearch() {
this.$refs.employeeRef.refreshTable() this.$refs.employeeRef.refreshTable()
} }
...@@ -275,7 +280,10 @@ export default { ...@@ -275,7 +280,10 @@ export default {
} }
</script> </script>
<style lang="scss"> <style scoped>
.config-employee {
margin-bottom: 0;
}
.config-employee .container { .config-employee .container {
margin-top: 20px; margin-top: 20px;
background: #ffffff; background: #ffffff;
...@@ -286,4 +294,15 @@ export default { ...@@ -286,4 +294,15 @@ export default {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
.config-employee .table-btns .el-button {
padding: 0 0 0 5px;
margin-left: 5px;
border-left: 1px solid #DCDFE6;
border-radius: 0;
}
.config-employee .table-btns .el-button:first-child {
padding: 0;
border: 0;
}
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!