Commit 3d0875d4 by 杨北旺

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

2 parents 073412aa 7152a10d
...@@ -71,4 +71,57 @@ const getDetailLogApi = params => { ...@@ -71,4 +71,57 @@ const getDetailLogApi = params => {
}) })
} }
export default { getListApi, getAllMerchantListApi, getRoleListApi, getAllDictApi, getMerchantTreeApi, getDetailInfoApi, getDetailLogApi } const addEmployeeApi = params => {
params.method = `${defaultPath}staff.saveStaff`
return http({
url: 'rop-merchants/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const updateEmployeeApi = params => {
params.method = `${defaultPath}staff.updateStaff`
return http({
url: 'rop-merchants/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const deleteEmployeeApi = params => {
params.method = `${defaultPath}staff.deleteStaff`
return http({
url: 'rop-merchants/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const exportEmployeeApi = params => {
params.method = `${defaultPath}staff.exportData`
return http({
url: 'rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const updateStatusApi = params => {
params.method = `${defaultPath}staff.updateStatus`
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 }
...@@ -124,6 +124,10 @@ img { ...@@ -124,6 +124,10 @@ img {
justify-content: space-between; justify-content: space-between;
} }
.el-checkbox:last-of-type {
margin-right: 8px;
}
::-webkit-scrollbar { ::-webkit-scrollbar {
/*滚动条整体样式*/ /*滚动条整体样式*/
width: 6px; width: 6px;
......
const staticRoutes = Object.freeze([{ const staticRoutes = Object.freeze([{
name: 'account', name: 'account',
path: '/account/index', path: '/account/index',
meta: {}, meta: {},
component: resolve => require([`@/views/account/index.vue`], resolve) component: resolve => require([`@/views/account/index.vue`], resolve)
}, },
{ {
name: 'addAccount', name: 'addAccount',
path: '/account/addAccount/:id', path: '/account/addAccount/:id',
meta: {}, meta: {},
component: resolve => require([`@/views/account/addAccount.vue`], resolve) component: resolve => require([`@/views/account/addAccount.vue`], resolve)
}, },
{ {
name: 'editAccount', name: 'editAccount',
path: '/account/editAccount/:id', path: '/account/editAccount/:id',
meta: {}, meta: {},
component: resolve => require([`@/views/account/editAccount.vue`], resolve) component: resolve => require([`@/views/account/editAccount.vue`], resolve)
}, },
{ {
name: 'detailAccount', name: 'detailAccount',
path: '/account/detailAccount/:id', path: '/account/detailAccount/:id',
meta: {}, meta: {},
component: resolve => require([`@/views/account/detailAccount.vue`], resolve) component: resolve => require([`@/views/account/detailAccount.vue`], resolve)
}, },
{ {
name: 'role', name: 'role',
path: '/role/index', path: '/role/index',
component: resolve => require([`@/views/role/index.vue`], resolve), component: resolve => require([`@/views/role/index.vue`], resolve),
meta: {} meta: {}
}, },
{ {
name: 'role', name: 'role',
path: '/role/create/:id', path: '/role/create/:id',
component: resolve => require([`@/views/role/create.vue`], resolve), component: resolve => require([`@/views/role/create.vue`], resolve),
meta: {} meta: {}
}, },
{ {
name: 'role', name: 'role',
path: '/role/look:id', path: '/role/look:id',
component: resolve => require([`@/views/role/look.vue`], resolve), component: resolve => require([`@/views/role/look.vue`], resolve),
meta: {} meta: {}
}, },
{ {
name: 'Account2EmployeeIndex', name: 'Account2EmployeeIndex',
path: '/employee/index', path: '/employee/index',
meta: {}, meta: {},
component: resolve => require([`@/views/employee/index.vue`], resolve) component: resolve => require([`@/views/employee/index.vue`], resolve)
}, },
{ {
name: 'Account2EmployeeEditEmployee', name: 'Account2EmployeeEditEmployee',
path: '/employee/editEmployee', path: '/employee/editEmployee/:addOrEdit/:id',
meta: {}, meta: {},
component: resolve => require([`@/views/employee/editEmployee.vue`], resolve) component: resolve => require([`@/views/employee/editEmployee.vue`], resolve)
}, },
{ {
name: 'Account2EmployeeDetailEmployee', name: 'Account2EmployeeDetailEmployee',
path: '/employee/detailEmployee', path: '/employee/detailEmployee/:id',
meta: {}, meta: {},
component: resolve => require([`@/views/employee/detailEmployee.vue`], resolve) component: resolve => require([`@/views/employee/detailEmployee.vue`], resolve)
} },
{
name: 'baseInfo',
path: '/baseInfo/index',
meta: {},
component: resolve => require([`@/views/baseInfo/index.vue`], resolve)
},
{
name: 'relevance',
path: '/baseInfo/relevance',
meta: {},
component: resolve => require([`@/views/baseInfo/relevance.vue`], resolve)
}
]) ])
export default staticRoutes export default staticRoutes
\ No newline at end of file \ No newline at end of file
...@@ -29,4 +29,25 @@ util.checkisCard = function(card) { ...@@ -29,4 +29,25 @@ util.checkisCard = function(card) {
let myreg = /^(^\d{15}$)|(^\d{17}([0-9]|X)$)/; let myreg = /^(^\d{15}$)|(^\d{17}([0-9]|X)$)/;
return myreg.test(card); return myreg.test(card);
} }
util.deepClone = function(obj) {
// Handle the 3 simple types, and null or undefined or function
if (obj == null || typeof obj !== 'object') return obj
// Handle Date
if (obj instanceof Date) {
const copy = new Date()
copy.setTime(obj.getTime())
return copy
}
// Handle Array or Object
if ((obj instanceof Array) | (obj instanceof Object)) {
const copy = obj instanceof Array ? [] : {}
for (var attr in obj) {
if (obj.hasOwnProperty(attr)) {
copy[attr] = util.deepClone(obj[attr])
}
}
return copy
}
throw new Error("Unable to clone obj! Its type isn't supported.")
}
export default util export default util
\ No newline at end of file \ No newline at end of file
...@@ -40,8 +40,8 @@ ...@@ -40,8 +40,8 @@
slot="prepend" slot="prepend"
placeholder="请选择" placeholder="请选择"
> >
<el-option label="个人" value="1"></el-option> <el-option label="个人" :value="1"></el-option>
<el-option label="企业" value="2"></el-option> <el-option label="企业" :value="2"></el-option>
</el-select> </el-select>
</el-input> </el-input>
<el-input <el-input
...@@ -67,10 +67,7 @@ ...@@ -67,10 +67,7 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item size="small" label="商户地址" class="form-row"> <el-form-item size="small" label="商户地址" class="form-row">
<el-input readonly v-model="accountAddForm.merchantAddress"> </el-input> <el-input readonly v-model="accountAddForm.merchantAddress"> </el-input>
<el-button <el-button type="primary" class="form-btn" @click="dialogMapVisible = true"
type="primary"
class="form-btn"
@click="dialogMapVisible = true"
>选择地址</el-button >选择地址</el-button
> >
</el-form-item> </el-form-item>
...@@ -187,6 +184,7 @@ ...@@ -187,6 +184,7 @@
highlight-current highlight-current
:props="defaultProps" :props="defaultProps"
:filter-node-method="filterNode" :filter-node-method="filterNode"
@check="clickDeal"
> >
</el-tree> </el-tree>
</div> </div>
...@@ -258,7 +256,7 @@ export default { ...@@ -258,7 +256,7 @@ export default {
}, },
businessScopeCustomize: { businessScopeCustomize: {
type: Array, type: Array,
} },
}, },
data() { data() {
const validatePhone = (rule, value, callback) => { const validatePhone = (rule, value, callback) => {
...@@ -285,18 +283,29 @@ export default { ...@@ -285,18 +283,29 @@ export default {
}, },
}; };
}, },
watch: {
filterText(val) {
this.$refs.brandTree.filter(val);
},
},
methods: { methods: {
clickDeal() {
this.$parent.editStatus = true;
},
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
getAddress() { getAddress() {
if(!this.$refs.mapForm.address) { if (!this.$refs.mapForm.address) {
this.$message.error("请选择地址"); this.$message.error("请选择地址");
return; return;
} }
this.dialogMapVisible = false; this.dialogMapVisible = false;
this.accountAddForm.merchantAddress = this.$refs.mapForm.address; this.accountAddForm.merchantAddress = this.$refs.mapForm.address;
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;
}, },
delImg(index) { delImg(index) {
this.accountAddForm.merchantFiles.splice(index, 1); this.accountAddForm.merchantFiles.splice(index, 1);
...@@ -337,9 +346,8 @@ export default { ...@@ -337,9 +346,8 @@ export default {
if (res) { if (res) {
self.accountAddForm.merchantFiles.push({ self.accountAddForm.merchantFiles.push({
fileUrl: res, fileUrl: res,
fileName: '' fileName: "",
}); });
console.log(self.accountAddForm.merchantFiles)
} }
}); });
}; };
......
...@@ -13,29 +13,29 @@ ...@@ -13,29 +13,29 @@
<el-row> <el-row>
<el-col :span="14"> <el-col :span="14">
<span class="itemName">登录账户名:</span> <span class="itemName">登录账户名:</span>
<span class="itemValue">{{ firstPageObj.merchantLoginAccount }}</span> <span class="itemValue">{{ firstPageObj.merchantLoginAccount || '-' }}</span>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<span class="itemName itemNameCol2">账户等级:</span> <span class="itemName itemNameCol2">账户等级:</span>
<span class="itemValue">{{ firstPageObj.accountLevelName }}</span> <span class="itemValue">{{ firstPageObj.accountLevelName || '-' }}</span>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="14"> <el-col :span="14">
<span class="itemName">开通模式:</span> <span class="itemName">开通模式:</span>
<span class="itemValue">{{ firstPageObj.merchantModelName }}</span> <span class="itemValue">{{ firstPageObj.merchantModelName || '-' }}</span>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<span class="itemName itemNameCol2">账户状态:</span> <span class="itemName itemNameCol2">账户状态:</span>
<span class="itemValue"> <span class="itemValue">
{{ firstPageObj.statusName }} {{ firstPageObj.statusName || '-' }}
</span> </span>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="14"> <el-col :span="14">
<span class="itemName">关联企业微信名:</span> <span class="itemName">关联企业微信名:</span>
<span class="itemValue">{{ firstPageObj.entmicroName }}</span> <span class="itemValue">{{ firstPageObj.entmicroName || '-' }}</span>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<span class="itemName itemNameCol2">账户有效期:</span> <span class="itemName itemNameCol2">账户有效期:</span>
...@@ -86,23 +86,23 @@ ...@@ -86,23 +86,23 @@
<el-row> <el-row>
<el-col :span="14"> <el-col :span="14">
<span class="itemName">商户名称:</span> <span class="itemName">商户名称:</span>
<span class="itemValue">{{ firstPageObj.merchantName }}</span> <span class="itemValue">{{ firstPageObj.merchantName || '-' }}</span>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<span class="itemName itemNameCol2">简称:</span> <span class="itemName itemNameCol2">简称:</span>
<span class="itemValue"> <span class="itemValue">
{{ firstPageObj.merchantAbbreviation }} {{ firstPageObj.merchantAbbreviation || '-' }}
</span> </span>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="14"> <el-col :span="14">
<span class="itemName">商户类型:</span> <span class="itemName">商户类型:</span>
<span class="itemValue">{{ firstPageObj.merchantTypeName }}</span> <span class="itemValue">{{ firstPageObj.merchantTypeName || '-' }}</span>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<span class="itemName itemNameCol2">身份证:</span> <span class="itemName itemNameCol2">身份证:</span>
<span class="itemValue">{{ firstPageObj.merchantOrgcode }}</span> <span class="itemValue">{{ firstPageObj.merchantOrgcode || '-' }}</span>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
...@@ -110,28 +110,28 @@ ...@@ -110,28 +110,28 @@
<span class="itemName">地址:</span> <span class="itemName">地址:</span>
<span class="itemValue"> <span class="itemValue">
{{ firstPageObj.merchantAddress }} {{ firstPageObj.merchantAddress || '-' }}
</span> </span>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<span class="itemName itemNameCol2">联系人:</span> <span class="itemName itemNameCol2">联系人:</span>
<span class="itemValue">{{ firstPageObj.merchantLegalPerson }}</span> <span class="itemValue">{{ firstPageObj.merchantLegalPerson || '-' }}</span>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="14"> <el-col :span="14">
<span class="itemName">联系电话:</span> <span class="itemName">联系电话:</span>
<span class="itemValue">{{ firstPageObj.merchantLegalPersonPhone }}</span> <span class="itemValue">{{ firstPageObj.merchantLegalPersonPhone || '-' }}</span>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<span class="itemName itemNameCol2">营业范围:</span> <span class="itemName itemNameCol2">营业范围:</span>
<span class="itemValue">{{ firstPageObj.businessScopName }}</span> <span class="itemValue">{{ firstPageObj.businessScopName || '-' }}</span>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<span class="itemName">主营品牌:</span> <span class="itemName">主营品牌:</span>
<span class="itemValue">{{ firstPageObj.merchantBrandName }}</span> <span class="itemValue">{{ firstPageObj.merchantBrandName || '-' }}</span>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
...@@ -206,6 +206,15 @@ ...@@ -206,6 +206,15 @@
<GLTable ref="updateRecord" :tableTotal="tableTotal" :tableData="updateRecordList" :hasNum="true" :pageConf="pageConf" :tableParams="thirdtableParams" @refreshTable="getThirdTable"></GLTable> <GLTable ref="updateRecord" :tableTotal="tableTotal" :tableData="updateRecordList" :hasNum="true" :pageConf="pageConf" :tableParams="thirdtableParams" @refreshTable="getThirdTable"></GLTable>
</div> </div>
</div> </div>
<div
class="footer-panel"
:style="{
left: footerLeft + 'px',
width: footerWidth + 'px'
}"
>
<el-button type="primary" @click="handleCancel">关闭</el-button>
</div>
</div> </div>
</template> </template>
<script> <script>
...@@ -327,6 +336,9 @@ export default { ...@@ -327,6 +336,9 @@ export default {
// }, // },
methods: { methods: {
handleCancel() {
this.$router.push('/account/index')
},
tabClick(index) { tabClick(index) {
this.curIndex = index this.curIndex = index
switch (index) { switch (index) {
...@@ -440,6 +452,8 @@ export default { ...@@ -440,6 +452,8 @@ export default {
}, },
mounted() { mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.getThirdTable() this.getThirdTable()
this.getSecondTable() this.getSecondTable()
} }
...@@ -448,6 +462,7 @@ export default { ...@@ -448,6 +462,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.merchantDetail { .merchantDetail {
padding-bottom: 60px;
.titles { .titles {
display: flex; display: flex;
margin-bottom: 20px; margin-bottom: 20px;
...@@ -584,7 +599,7 @@ export default { ...@@ -584,7 +599,7 @@ export default {
} }
.contentTree { .contentTree {
padding: 20px; padding: 20px;
max-height: 250px; height: 250px;
position: relative; position: relative;
overflow: auto; overflow: auto;
...@@ -732,5 +747,17 @@ export default { ...@@ -732,5 +747,17 @@ export default {
padding: 20px; padding: 20px;
} }
} }
.footer-panel {
display: flex;
align-items: center;
justify-content: center;
position: fixed;
width: 100%;
bottom: 0px;
height: 64px;
background: #ffffff;
z-index: 999;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
}
} }
</style> </style>
<template> <template>
<div class="scrm-main"> <div class="scrm-main">
<div class="form-header"> <div class="form-header" v-if="$globalState.session.accountLevel == 1">
<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
> >
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
<el-button <el-button
type="text" type="text"
@click="handleAdd(scope.scope)" @click="handleAdd(scope.scope)"
v-if="scope.scope.status == 2 && $globalState.session.accountLevel != 4" v-if="scope.scope.status == 2 && scope.scope.merchantAccountLevel != 4"
>创建子商户/门店</el-button >创建子商户/门店</el-button
> >
</template> </template>
...@@ -219,6 +219,10 @@ export default { ...@@ -219,6 +219,10 @@ export default {
prop: "merchantLegalPersonPhone", prop: "merchantLegalPersonPhone",
width: "120px", width: "120px",
}, },
{
label: "更新时间",
prop: "updatedTime"
},
], ],
}, },
layout: "sizes, prev, pager, next, jumper, ->, total", layout: "sizes, prev, pager, next, jumper, ->, total",
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div> <div>
<el-popover popper-class="select-page" ref="popover" placement="bottom-start" trigger="click" v-model="popoverVisible" :disabled="targetItem.isDisabled" @show="onShowPopover" @hide="onHidePopover"> <el-popover popper-class="select-page" ref="popover" placement="bottom-start" trigger="click" v-model="popoverVisible" :disabled="targetItem.isDisabled" @show="onShowPopover" @hide="onHidePopover">
<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" :style="`width: ${width - 32}px`" :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" v-show="page.total > 20"> <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>
...@@ -127,7 +127,7 @@ export default { ...@@ -127,7 +127,7 @@ export default {
} }
.page-radio { .page-radio {
display: block; display: block;
width: 320px; /* width: 320px; */
height: 36px; height: 36px;
line-height: 36px; line-height: 36px;
overflow: hidden; overflow: hidden;
......
<!-- 配置管理 --> <!-- 配置管理 -->
<template> <template>
<div class="config-employee"> <div class="config-employee">
<!-- <div class="container">
<p class="edit-title">{{ title }}</p>
</div> -->
<div class="container"> <div class="container">
<!-- <p class="edit-sub-title p-rl-20">员工基本信息</p> <div class="MsgWrap powerlimt">
<glsx-combi-form class="p-rl-20" ref="editFormRef" labelWidth="160px" :isBlock="isBlock" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"> <span class="content-title">功能权限</span>
<template slot="merchantId" slot-scope="item">
<select-page :form="editForm" width="300px" :targetItem="item.scope" @handleChange="handleChangeMerchant"></select-page> <div class="powerTreeWrap">
</template> <div class="mainTitleWrap">
<template slot="visibleInferiorMer" slot-scope="item"> <div class="mainTitle" :class="{ activeMainTitle: currentIndex == index }" v-for="(item, index) in powerDataArray" :key="index" @click="powerTabClick(index)">
<el-input :style="{ width: item.width || '360px' }" placeholder="可见商户" v-model="filterText"></el-input> {{ item.accounttypeName || 'null' }}
<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> </div>
</template> </div>
</glsx-combi-form> --> <div class="content">
<div class="subTitleWrap" v-if="products.length > 0">
<div class="subTitle" :class="{ acitveSubTitle: subCurrentIndex == sindex }" v-for="(ele, sindex) in products" :key="sindex" @click="powerSubTabClick(sindex)">
{{ ele.productName }}
</div>
</div>
<div class="contentTree">
<template v-if="merchantProTreeResponses.length > 0">
<el-tree default-expand-all :data="merchantProTreeResponses" :props="defaultProps"></el-tree>
</template>
<div v-else class="noDataContent">
<img src="../../../assets/img/empty.png" alt="" />
<div>暂无数据</div>
</div>
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -23,16 +37,61 @@ ...@@ -23,16 +37,61 @@
export default { export default {
name: 'config', name: 'config',
data() { data() {
return {} return {
powerDataArray: [],
currentIndex: 0, //功能权限主标题的索引
subCurrentIndex: 0,
defaultProps: {
children: 'children',
label: 'label'
}
}
},
props: {
id: {
type: String,
default: ''
}
}, },
components: {}, computed: {
products() {
if (!this.powerDataArray.length) {
return []
}
return this.powerDataArray[this.currentIndex].products
},
//功能树的数据
merchantProTreeResponses() {
if (!this.powerDataArray.length) {
return []
} else if (this.powerDataArray.length > 0 && this.powerDataArray[this.currentIndex].products.length == 0) {
return []
}
computed: {}, return this.powerDataArray[this.currentIndex].products[this.subCurrentIndex].merchantProTreeResponses
}
},
mounted() {}, mounted() {
this.getInfo()
},
methods: { methods: {
getInfo() {
this.$apis.employee.getDetailInfoApi({ id: this.id }).then(res => {
this.powerDataArray = res.accountTypeTreeResponseList
})
},
powerTabClick(index) {
this.currentIndex = index
//每次切换将subCurrentIndex置为0
this.subCurrentIndex = 0
},
powerSubTabClick(index) {
this.subCurrentIndex = index
},
handleClose() { handleClose() {
this.$router.push({ this.$router.push({
name: 'Account2EmployeeIndex' name: 'Account2EmployeeIndex'
...@@ -41,7 +100,7 @@ export default { ...@@ -41,7 +100,7 @@ export default {
} }
} }
</script> </script>
<style> <style lang="scss">
.config-employee { .config-employee {
margin-bottom: 64px; margin-bottom: 64px;
} }
...@@ -50,63 +109,88 @@ export default { ...@@ -50,63 +109,88 @@ export default {
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;
} .content-title {
.config-employee .p-rl-20 { display: inline-block;
padding: 0 20px; position: relative;
} height: 48px;
.config-employee .flex { background-color: #fff;
display: flex; font-size: 16px;
justify-content: space-between; font-weight: 600;
} color: #333333;
.config-employee .edit-container { line-height: 48px;
margin-bottom: 84px; padding-left: 20px;
} }
.powerlimt {
.config-employee .footer { padding-bottom: 30px;
position: fixed; .powerTreeWrap {
bottom: 0; background-color: #f4f6fc;
width: 100%; margin: 0 20px;
height: 64px; border-radius: 4px;
text-align: center; min-height: 300px;
line-height: 64px; padding-top: 2px;
background: #ffffff; padding-left: 2px;
z-index: 999; padding-bottom: 10px;
} .mainTitleWrap {
height: 32px;
display: flex;
.config-employee .flex { .mainTitle {
display: flex; background-color: #f4f6fc;
justify-content: space-between; height: 32px;
} width: 180px;
line-height: 32px;
text-align: center;
border-radius: 2px;
cursor: pointer;
}
.activeMainTitle {
background-color: #fff;
color: #5850ff;
}
}
.content {
background-color: #fff;
.config-employee .edit-title { margin: 20px 10px 0;
font-size: 20px; .subTitleWrap {
font-weight: bold; height: 40px;
color: #333333; display: flex;
line-height: 38px; background-color: #f4f6fc;
height: 38px; .subTitle {
margin: 0 0; background-color: #f4f6fc;
} height: 40px;
width: 180px;
line-height: 40px;
text-align: center;
border-radius: 2px;
}
.acitveSubTitle {
background-color: #fff !important;
color: #5850ff;
}
}
.contentTree {
padding: 20px;
min-height: 250px;
height: 250px;
position: relative;
overflow: auto;
.config-employee .edit-sub-title { .noDataContent {
height: 48px; width: 64px;
line-height: 48px; height: 64px;
font-size: 16px; position: absolute;
color: #333333; left: 50%;
font-weight: 600; top: 50%;
border-bottom: 1px solid #e7eaec; margin-top: -32px;
margin: 0 0; margin-left: -32px;
} div {
.config-employee .filter-tree { margin-top: 12px;
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>
...@@ -4,25 +4,27 @@ ...@@ -4,25 +4,27 @@
<div class="container"> <div class="container">
<p class="edit-sub-title p-rl-20">员工基本信息</p> <p class="edit-sub-title p-rl-20">员工基本信息</p>
<el-form label-width="140px"> <el-form label-width="140px">
<el-form-item style="margin-bottom: 0;" v-for="(item, index) in detailFormDaata" :key="index" :label="item.label + ':'"> <el-form-item style="margin-bottom: 0;" v-for="(item, index) in detailFormData" :key="index" :label="item.label + ':'">
<span>{{ info[item.name] || '无' }}</span> <span>{{ info[item.name] || '无' }}</span>
</el-form-item> </el-form-item>
</el-form> </el-form>
</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>
<div class="config-mer-name">
<p class="mer-txt" v-for="(item, index) in info.visibleInferiorMerName.split(',')" :key="index">{{item}}</p>
</div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
// import { getDetailInfoApi } from '@/api/modules/employee'
export default { export default {
name: 'info', name: 'info',
data() { data() {
return { return {
info: {}, info: {},
detailFormDaata: [{ detailFormData: [{
label: '姓名', label: '姓名',
name: 'staffName' name: 'staffName'
}, { }, {
...@@ -58,7 +60,6 @@ export default { ...@@ -58,7 +60,6 @@ export default {
methods: { methods: {
getInfo() { getInfo() {
this.$apis.employee.getDetailInfoApi({ id: this.id }).then(res => { this.$apis.employee.getDetailInfoApi({ id: this.id }).then(res => {
console.log(res)
this.info = res this.info = res
}) })
} }
...@@ -133,4 +134,15 @@ export default { ...@@ -133,4 +134,15 @@ export default {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.config-employee .config-mer-name {
font-size: 14px;
line-height: 20px;
margin: 21px 0 0 140px;
min-height: 36px;
}
.config-employee .config-mer-name .mer-txt {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style> </style>
...@@ -45,13 +45,12 @@ export default { ...@@ -45,13 +45,12 @@ export default {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.id = this.$route.params.id this.id = this.$route.params.id
console.log(this.id)
}, },
methods: { methods: {
handleClose() { handleClose() {
this.$router.push({ this.$router.push({
name: 'Account2EmployeeIndex' path: '/employee/index'
}) })
} }
} }
......
...@@ -12,7 +12,10 @@ ...@@ -12,7 +12,10 @@
{{ item.label ? ':' : '' }} {{ item.label ? ':' : '' }}
</span> </span>
<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> <div v-else-if="item.type === 'input'">
<el-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" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)"></el-input>
<slot :name="item.suffixSlot" :scope="item"></slot>
</div>
<!-- 选择-输入框 --> <!-- 选择-输入框 -->
<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-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: item.selectWidth || '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">
...@@ -37,9 +40,12 @@ ...@@ -37,9 +40,12 @@
</el-select> </el-select>
</template> </template>
<!-- 选择框 --> <!-- 选择框 -->
<el-select v-else-if="item.type === 'select'" :style="{ width: item.width || '100%' }" v-model="formObj[item.name]" :clearable="item.isClear || false" :placeholder="'请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)"> <div v-else-if="item.type === 'select'">
<el-option v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionLabel]" :value="subItem[item.optionId]" :disabled="subItem.isDisabled || false"></el-option> <el-select :style="{ width: item.width || '100%' }" v-model="formObj[item.name]" :clearable="item.isClear || false" :placeholder="'请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)">
</el-select> <el-option v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionLabel]" :value="subItem[item.optionId]" :disabled="subItem.isDisabled || false"></el-option>
</el-select>
<slot :name="item.suffixSlot" :scope="item"></slot>
</div>
<!-- radio --> <!-- radio -->
<el-radio-group v-else-if="item.type === 'radio'" v-model="formObj[item.name]" :disabled="item.isDisabled" @change="item.handleRadioChange"> <el-radio-group v-else-if="item.type === 'radio'" v-model="formObj[item.name]" :disabled="item.isDisabled" @change="item.handleRadioChange">
<el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionId]">{{ subItem[item.optionLabel] }}</el-radio> <el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionId]">{{ subItem[item.optionLabel] }}</el-radio>
...@@ -187,6 +193,7 @@ export default { ...@@ -187,6 +193,7 @@ export default {
this.$message.error('图片尺寸最大为' + wdithLt + '像素*' + heightLt + '像素') this.$message.error('图片尺寸最大为' + wdithLt + '像素*' + heightLt + '像素')
} else { } else {
targetItem.handleUpload(e, file, targetItem) targetItem.handleUpload(e, file, targetItem)
// this.$emit('handleUpload', { e: e, file: file, targetItem: targetItem })
} }
} }
} }
...@@ -194,6 +201,7 @@ export default { ...@@ -194,6 +201,7 @@ export default {
// 图片删除 // 图片删除
handleImgDelete(targetItem, subIndex = -1) { handleImgDelete(targetItem, subIndex = -1) {
Array.isArray(this.formObj[targetItem.name]) ? this.formObj[targetItem.name].splice(subIndex, 1) : (this.formObj[targetItem.name] = '') Array.isArray(this.formObj[targetItem.name]) ? this.formObj[targetItem.name].splice(subIndex, 1) : (this.formObj[targetItem.name] = '')
this.$emit('handleImgDelete', targetItem)
}, },
// 图片查看 // 图片查看
handleImgLook(src) { handleImgLook(src) {
......
<!-- 员工管理 --> <!-- 员工管理 -->
<template> <template>
<div class="config-employee employee-list"> <div class="config-employee employee-list">
<!-- <div class="container"> -->
<div style="margin: 16px 0;"> <div style="margin: 16px 0;">
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">创建员工</el-button> <el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">创建员工</el-button>
</div> </div>
<!-- </div> -->
<div class="container"> <div class="container">
<div> <div>
<glsx-combi-form ref="showSearch" labelWidth="90px" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData"> <glsx-combi-form ref="showSearch" labelWidth="90px" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData">
<template slot="merchantId" slot-scope="item"> <template slot="merchantId" slot-scope="item">
<select-page :form="searchForm" width="200px" :targetItem="item.scope" @handleChange="handleChangeMerchant"></select-page> <select-page :form="searchForm" width="200" :targetItem="item.scope" @handleChange="handleChangeMerchant"></select-page>
</template> </template>
<span slot="footer" class="footer-btns"> <span slot="footer" class="footer-btns">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button> <el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" type="primary">导出</el-button> <el-button :size="size" type="primary" @click="handleExport">导出</el-button>
</span> </span>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<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">
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="optionBtns" 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>
</div> </div>
<template slot="otherOptions" slot-scope="scope">
<el-popover placement="left" width="260" trigger="hover">
<p>启用前,你可先为该员工创建角色,配置其所需的功能权限。如下所示:</p>
<p>1. 角色管理-创建角色;</p>
<p>2. 选择员工账户-修改角色</p>
<el-switch slot="reference" v-model="scope.scope.statusName" active-value="启用" inactive-value="禁用" @change="e => handleSwitchChange(e, scope.scope)"></el-switch>
</el-popover>
</template>
</GLTable> </GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
</div> </div>
...@@ -34,8 +40,8 @@ ...@@ -34,8 +40,8 @@
<script> <script>
import { utils } from 'glsx-common' import { utils } from 'glsx-common'
// import { getListApi, getAllMerchantListApi, getRoleListApi, getAllDictApi } from '@/api/modules/employee'
import glsxCombiForm from './glsx-combi-form' import glsxCombiForm from './glsx-combi-form'
// import glsxTable from '@/components/glsx-table'
import selectPage from './components/selectPage' import selectPage from './components/selectPage'
export default { export default {
name: 'index', name: 'index',
...@@ -113,7 +119,10 @@ export default { ...@@ -113,7 +119,10 @@ export default {
getListApi: this.$apis.employee.getListApi, getListApi: this.$apis.employee.getListApi,
tableParams: { tableParams: {
listName: 'data', listName: 'data',
tableOption: true, tableOption: false,
otherOptions: {
label: '启用开关'
},
tableColumns: [ tableColumns: [
{ {
label: '员工姓名', label: '员工姓名',
...@@ -122,7 +131,8 @@ export default { ...@@ -122,7 +131,8 @@ export default {
{ {
label: '员工企微号', label: '员工企微号',
prop: 'entmicroName', prop: 'entmicroName',
line: 2 line: 2,
minWidth: '100px'
}, },
{ {
label: '角色', label: '角色',
...@@ -153,6 +163,18 @@ export default { ...@@ -153,6 +163,18 @@ export default {
label: '更新时间', label: '更新时间',
prop: 'updatedTime', prop: 'updatedTime',
line: 2 line: 2
},
{
label: '操作',
prop: 'optionBtns',
width: '200px',
addHtml: 'optionBtns'
},
{
label: '启用开关',
prop: 'otherOptions',
width: '100px',
addHtml: 'otherOptions'
} }
] ]
}, },
...@@ -168,28 +190,32 @@ export default { ...@@ -168,28 +190,32 @@ export default {
components: { components: {
glsxCombiForm, glsxCombiForm,
selectPage selectPage
// glsxTable
}, },
mounted() { mounted() {
this.getBaseData().then(res => { this.userInfo = this.$globalState.session
this.getOptionsList('searchFormData') // 门店
}) if (this.userInfo.accountLevel == 4) {
this.searchFormData.splice(0, 1)
var idx = this.tableParams.tableColumns.findIndex(item => item.prop == 'merchantName')
this.tableParams.tableColumns.splice(idx, 1)
}
this.getAllMerchantList()
this.getStaffStatusList()
}, },
methods: { methods: {
getAllMerchantList() { getAllMerchantList() {
this.$apis.employee.getAllMerchantListApi({}).then(res => { this.$apis.employee.getAllMerchantListApi({}).then(res => {
this.baseData.allMerchantList = res this.baseData.allMerchantList = res
this.userInfo.accountLevel == 4 ? this.handleChangeMerchant(res[0].id) : this.getOptionsList('searchFormData', true, 'merchantId')
}) })
}, },
getBaseData() { getStaffStatusList() {
// 1.product(产品) 2.account_type(账户类型) 3.(functional_attributes) 功能属性 4.(owned_customer_group)所属客户群 5.channel渠道 6.account_level(商户层级) this.$apis.employee.getAllDictApi({ dictType: 'staff_status' }).then(res => {
return new Promise(resolve => { this.baseData.staffStatusList = res
Promise.all([this.$apis.employee.getAllMerchantListApi({}), this.$apis.employee.getAllDictApi({ dictType: 'staff_status' })]).then(([allMerchant, staffStatus]) => { this.getOptionsList('searchFormData', true, 'status')
this.baseData.allMerchantList = allMerchant
this.baseData.staffStatusList = staffStatus
resolve()
})
}) })
}, },
getOptionsList(formName, hasAll = true, refreshSigle) { getOptionsList(formName, hasAll = true, refreshSigle) {
...@@ -206,7 +232,6 @@ export default { ...@@ -206,7 +232,6 @@ export default {
} else { } else {
this[formName].forEach((item, index) => { this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) { if (item.type === 'select' && this.baseData[item.optionsName].length) {
// this.$set(this[formName][index], 'optionList', _.cloneDeep(this.baseData[item.optionsName]))
this.$set(this[formName][index], 'optionList', utils.deepClone(this.baseData[item.optionsName])) this.$set(this[formName][index], 'optionList', utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') { if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {} const temp = {}
...@@ -239,7 +264,6 @@ export default { ...@@ -239,7 +264,6 @@ export default {
}, },
getParams() { getParams() {
var params = utils.deepClone(this.searchForm) var params = utils.deepClone(this.searchForm)
// params.productId.includes('') && (params.productId = [])
const tempParams = this.getSelectInputParams() const tempParams = this.getSelectInputParams()
params = { params = {
...params, ...params,
...@@ -254,27 +278,58 @@ export default { ...@@ -254,27 +278,58 @@ export default {
}) })
}, },
handleDetail(row) { handleDetail(row) {
this.$router.push({ this.$router.push('/employee/detailEmployee/' + row.id)
name: 'Account2EmployeeDetailEmployee',
params: {
id: row.id
}
})
}, },
// 1-新增;2-编辑 // 1-新增;2-编辑
handleEdit(addOrEdit, row) { handleEdit(addOrEdit, row) {
console.log(addOrEdit) var id = row ? row.id : '-1'
this.$router.push({ this.$router.push('/employee/editEmployee/' + addOrEdit + '/' + id)
name: 'Account2EmployeeEditEmployee', },
params: {
addOrEdit: addOrEdit, handleSwitchChange(val, row) {
id: row ? row.id : '-1' if (!row.roleName) {
this.$message({
message: '您还未给该员工设置“角色”!设置角色:员工账户管理-修改-角色权限',
type: 'error'
})
this.handleSearch()
return false
}
this.$apis.employee.updateStatusApi({ id: row.id, status: val == '启用' ? 0 : 2 }).then(res => {
this.handleSearch()
})
},
handleDelete(row) {
this.$confirm('是否确认删除该员工?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis.employee.deleteEmployeeApi({ id: row.id }).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleSearch()
}
})
}
} }
}) })
}, },
handleSearch() { handleSearch() {
this.$refs.employeeRef.refreshTable() this.$refs.employeeRef.refreshTable()
},
handleExport() {
var params = this.getParams()
this.$apis.employee.exportEmployeeApi(params).then(res => {
window.open(res)
})
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!