Commit b511397c by 李长胜

提交合并

2 parents e51a6da7 5d3db988
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
"core-js": "^3.4.4", "core-js": "^3.4.4",
"el-tree-transfer": "^2.2.6", "el-tree-transfer": "^2.2.6",
"glsx-common": "^1.4.6", "glsx-common": "^1.4.6",
"glsx-components": "^1.0.8",
"glsx-table": "^1.0.9" "glsx-table": "^1.0.9"
}, },
"devDependencies": { "devDependencies": {
...@@ -28,6 +27,7 @@ ...@@ -28,6 +27,7 @@
"eslint": "^5.16.0", "eslint": "^5.16.0",
"eslint-plugin-prettier": "^3.1.1", "eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-vue": "^5.0.0", "eslint-plugin-vue": "^5.0.0",
"glsx-components": "^1.0.8",
"node-sass": "^4.14.1", "node-sass": "^4.14.1",
"prettier": "^1.19.1", "prettier": "^1.19.1",
"sass-loader": "^8.0.0", "sass-loader": "^8.0.0",
......
/**
* 新增参数sign 判断接口是否需要sign签名
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http } from '@/main'
const getMerchantTree = params => {
params.method = 'org.ore.api.common.findMerchantTreeByMerchantNo.list'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const getDepartment = params => {
params.method = 'cn.com.glsx.entmicro.department.listDepartmentTree'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const toGL = params => {
params.method = 'org.ore.api.common.relevanceEntmicro.list'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const merchantInfo = params => {
params.method = 'org.ore.api.common.findMerchantInfoByMerchantNo.list'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
getMerchantTree,
getDepartment,
toGL,
merchantInfo
}
\ No newline at end of file \ No newline at end of file
import { http } from '@/main'
var defaultPath = 'cn.com.glsx.merchants.'
const getListApi = params => {
params.method = `${defaultPath}staff.findStaffByPage`
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const getAllMerchantListApi = params => {
params.method = `${defaultPath}menu.findAllMerchant`
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const getRoleListApi = params => {
params.method = 'org.ore.api.role.list'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const getAllDictApi = params => {
params.method = `${defaultPath}menu.findAllDictData`
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const getMerchantTreeApi = params => {
params.method = `${defaultPath}merchant.findMerchantTree`
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
export { getListApi, getAllMerchantListApi, getRoleListApi, getAllDictApi, getMerchantTreeApi }
/**
* 新增参数sign 判断接口是否需要sign签名
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http } from '@/main'
const roleDataList = params => {
params.method = 'org.ore.api.role.page'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const merchantDataList = params => {
params.method = 'cn.com.glsx.merchants.menu.findAllMerchant'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const roleInfoData = params => {
params.method = 'org.ore.api.role.getById'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const roleTreeDataById = params => {
params.method = 'cn.com.glsx.merchants.merchant.findMenuFunTreeByRoleId'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const merchantRootById = params => {
params.method = 'cn.com.glsx.merchants.merchant.findMenuFunTreeByMerId'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const createRole = params => {
params.method = 'org.ore.api.role.insert'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const updateRole = params => {
params.method = 'org.ore.api.role.update'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const deleteRole = params => {
params.method = 'org.ore.api.role.deleteById'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
roleDataList,
merchantDataList,
roleInfoData,
roleTreeDataById,
merchantRootById,
createRole,
updateRole,
deleteRole
}
\ No newline at end of file \ No newline at end of file
...@@ -17,32 +17,35 @@ const findMerchantByPage = params => { ...@@ -17,32 +17,35 @@ const findMerchantByPage = params => {
}) })
} }
const findAllDictData = params => { const findAllDictData = params => {
params.method = 'cn.com.glsx.merchants.menu.findAllDictData' params.method = 'cn.com.glsx.merchants.menu.findAllDictData'
return http({ return http({
url: '/rop-merchants/router', url: '/rop-merchants/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
//主营品牌
const getCarbrandTree = params => { const getCarbrandTree = params => {
params.method = 'cn.com.glsx.merchants.merchantCommon.getCarbrandTree' params.method = 'cn.com.glsx.merchants.merchantCommon.getCarbrandTree'
return http({ return http({
url: '/rop-merchants/router', url: '/rop-merchants/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
//详情
const findMerchantDetail = params => { const findMerchantDetail = params => {
params.method = 'cn.com.glsx.merchants.merchant.findMerchantDetail' params.method = 'cn.com.glsx.merchants.merchant.findMerchantDetail'
return http({ return http({
url: '/rop-merchants/router', url: '/rop-merchants/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
//下一步
const saveMerchant = params => { const saveMerchant = params => {
params.method = 'cn.com.glsx.merchants.merchant.saveMerchant' params.method = 'cn.com.glsx.merchants.merchant.saveMerchant'
return http({ return http({
...@@ -52,8 +55,8 @@ const saveMerchant = params => { ...@@ -52,8 +55,8 @@ const saveMerchant = params => {
sign: true sign: true
}) })
} }
const findPermissionsByMerId = params => { const updateMerchant = params => {
params.method = 'cn.com.glsx.merchants.merchant.findPermissionsByMerId' params.method = 'cn.com.glsx.merchants.merchant.updateMerchant'
return http({ return http({
url: '/rop-merchants/router', url: '/rop-merchants/router',
method: 'POST', method: 'POST',
...@@ -61,8 +64,30 @@ const findPermissionsByMerId = params => { ...@@ -61,8 +64,30 @@ const findPermissionsByMerId = params => {
sign: true sign: true
}) })
} }
//功能权限
const findPermissionsByMerId = params => {
params.method = 'cn.com.glsx.merchants.merchant.findPermissionsByMerId'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
//功能权限
const findMenuFunTreeByMerId = params => { const findMenuFunTreeByMerId = params => {
params.method = 'cn.com.glsx.merchants.merchant.findMenuFunTreeByMerId' params.method = 'cn.com.glsx.merchants.merchant.findMenuFunTreeByMerId'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
//草稿保存
const updatePermissions = params => {
params.method = 'cn.com.glsx.merchants.merchant.updatePermissions'
return http({ return http({
url: '/rop-merchants/router', url: '/rop-merchants/router',
method: 'POST', method: 'POST',
...@@ -76,6 +101,8 @@ export default { ...@@ -76,6 +101,8 @@ export default {
getCarbrandTree, getCarbrandTree,
findMerchantDetail, findMerchantDetail,
saveMerchant, saveMerchant,
updateMerchant,
findPermissionsByMerId, findPermissionsByMerId,
findMenuFunTreeByMerId findMenuFunTreeByMerId,
updatePermissions
} }
\ No newline at end of file \ No newline at end of file
import Vue from 'vue' import Vue from 'vue'
import { Message,Autocomplete,Popover,Tag,Tooltip, Table, TableColumn, Steps, Step, Loading, Drawer, Pagination, Button, ButtonGroup, Form, FormItem, Input, Radio, RadioGroup, Checkbox, CheckboxGroup, Switch, Select, Option, TimePicker,Row, Col, DatePicker, Tree } from 'element-ui' import { Message, Autocomplete, Popover, Tag, Tooltip, Table, TableColumn, Steps, Step, Loading, Drawer, Pagination, Button, ButtonGroup, Form, FormItem, Input, Radio, RadioGroup, Checkbox, CheckboxGroup, Switch, Select, Option, TimePicker, Row, Col, DatePicker, Tree } from 'element-ui'
Vue.use(Button) Vue.use(Button)
Vue.use(ButtonGroup) Vue.use(ButtonGroup)
Vue.use(Form) Vue.use(Form)
......
const staticRoutes = Object.freeze([{ const staticRoutes = Object.freeze([
name: 'home', {
path: '/', name: 'account',
meta: {}, path: '/account/index',
component: resolve => require([`@/views/home/index.vue`], resolve) meta: {},
}, component: resolve => require([`@/views/account/index.vue`], resolve)
{ },
name: 'addAccount', {
path: '/acount/addAccount', name: 'addAccount',
meta: {}, path: '/account/addAccount',
component: resolve => require([`@/views/home/addAccount.vue`], resolve) meta: {},
}, component: resolve => require([`@/views/account/addAccount.vue`], resolve)
{ },
name: 'editAccount', {
path: '/acount/editAccount', name: 'editAccount',
meta: {}, path: '/account/editAccount',
component: resolve => require([`@/views/home/editAccount.vue`], resolve) meta: {},
}, component: resolve => require([`@/views/account/editAccount.vue`], resolve)
{ },
name: 'detailAccount', {
path: "/account/detailAccount", name: 'role',
component: resolve => require([`@/views/merchant/detail.vue`], resolve), path: '/role/index/index',
meta: {} component: resolve => require([`@/views/role/index/index.vue`], resolve),
}, meta: {}
},
{
name: 'role',
path: '/role/create/index',
component: resolve => require([`@/views/role/create/index.vue`], resolve),
meta: {}
},
{
name: 'role',
path: '/role/index/look',
component: resolve => require([`@/views/role/index/look.vue`], resolve),
meta: {}
},
{
name: 'baseInfo',
path: '/baseInfo/index',
component: resolve => require([`@/views/baseInfo/index.vue`], resolve),
meta: {}
},
{
name: 'baseInfo',
path: '/baseInfo/relevance',
component: resolve => require([`@/views/baseInfo/relevance.vue`], resolve),
meta: {}
},
{
name: 'employeeList',
path: '/employee/index',
meta: {},
component: resolve => require([`@/views/employee/index.vue`], resolve)
},
{
name: 'employee',
path: '/employee/editEmployee',
meta: {},
component: resolve => require([`@/views/employee/editEmployee.vue`], resolve)
},
{
name: 'detailAccount',
path: "/account/detailAccount",
component: resolve => require([`@/views/merchant/detail.vue`], resolve),
meta: {}
},
]) ])
export default staticRoutes
\ No newline at end of file \ No newline at end of file
export default staticRoutes
<template> <template>
<div class="scrm-main"> <div class="scrm-main">
<div v-show="!parentId"> <div v-show="step == 1">
<div class="account-header scrm-flex-between scrm-box-f">创建子商户/门店</div> <div class="account-header scrm-flex-between scrm-box-f">
<span>创建子商户/门店</span>
<el-select v-model="status" slot="prepend" placeholder="请选择">
<el-option label="门店" :value="1"></el-option>
<el-option label="商户" :value="2"></el-option>
</el-select>
</div>
<div class="account-body scrm-box-f"> <div class="account-body scrm-box-f">
<div class="form-title">企业基本信息</div> <div class="form-title">企业基本信息</div>
<el-form <el-form
...@@ -69,12 +75,14 @@ ...@@ -69,12 +75,14 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="商户地址"> <el-form-item size="small" label="商户地址" class="form-row">
<el-input size="small" v-model="accountAddForm.merchantAddress"> <el-input v-model="accountAddForm.merchantAddress"> </el-input>
<el-button slot="append" @click="dialogMapVisible = true" <el-button
>选择地址</el-button type="primary"
> class="form-btn"
</el-input> @click="dialogMapVisible = true"
>选择地址</el-button
>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -195,16 +203,36 @@ ...@@ -195,16 +203,36 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="门店照片"> <el-form-item label="门店照片">
<el-upload <div class="store-upload-list">
action="" <template
class="image-uploader" v-if="
:show-file-list="false" accountAddForm.merchantFiles &&
list-type="picture-card" accountAddForm.merchantFiles.length > 0
v-loading="loadingImg" "
:before-upload="upLoadImg" >
> <div
<i class="el-icon-plus"></i> :key="index"
</el-upload> v-for="(item, index) in accountAddForm.merchantFiles"
class="store-border"
>
<img :src="item.fileUrl" />
<div class="uploader-del-icon">
<i class="el-icon-delete-solid" @click.stop="delImg(index)"></i>
</div>
</div>
</template>
<el-upload
action=""
class="image-uploader"
:show-file-list="false"
list-type="picture-card"
v-loading="loadingImg"
:before-upload="upLoadImg"
>
<i class="el-icon-plus"></i>
</el-upload>
</div>
<div class="tips">图片格式仅支持JPG,PNG格式,大小1M</div> <div class="tips">图片格式仅支持JPG,PNG格式,大小1M</div>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -237,6 +265,7 @@ ...@@ -237,6 +265,7 @@
<el-form-item label="账户等级"> <el-form-item label="账户等级">
<el-select <el-select
size="small" size="small"
:disabled="nextStatus"
v-model="accountDetail.merchantAccountLevel" v-model="accountDetail.merchantAccountLevel"
placeholder="请选择" placeholder="请选择"
> >
...@@ -254,6 +283,7 @@ ...@@ -254,6 +283,7 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="登录账户名" prop="merchantLoginAccount"> <el-form-item label="登录账户名" prop="merchantLoginAccount">
<el-input <el-input
:disabled="nextStatus"
size="small" size="small"
v-model="accountInfoForm.merchantLoginAccount" v-model="accountInfoForm.merchantLoginAccount"
placeholder="请输入登录账户名" placeholder="请输入登录账户名"
...@@ -263,6 +293,7 @@ ...@@ -263,6 +293,7 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="登录密码" prop="merchantLoginPassword"> <el-form-item label="登录密码" prop="merchantLoginPassword">
<el-input <el-input
:disabled="nextStatus"
size="small" size="small"
type="password" type="password"
v-model="accountInfoForm.merchantLoginPassword" v-model="accountInfoForm.merchantLoginPassword"
...@@ -279,6 +310,7 @@ ...@@ -279,6 +310,7 @@
:key="index" :key="index"
:btnLabel="item.accounttypeName" :btnLabel="item.accounttypeName"
:btnValue="item.accounttypeId" :btnValue="item.accounttypeId"
:stopClick="nextStatus"
@getBtnStatus="getBtnStatus" @getBtnStatus="getBtnStatus"
></auto-button> ></auto-button>
</el-form-item> </el-form-item>
...@@ -288,14 +320,20 @@ ...@@ -288,14 +320,20 @@
</div> </div>
</div> </div>
<select-product <select-product
v-show="parentId" v-show="step == 2"
ref="productForm"
:parentId="parentId" :parentId="parentId"
:pid="accountAddForm.parentId" :pid="accountAddForm.parentId"
:accountlevel="accountDetail.merchantAccountLevel" :accountlevel="accountDetail.merchantAccountLevel"
></select-product> ></select-product>
<div class="footer-panel"> <div class="footer-panel">
<el-button type="primary" @click="handleNext">下一步</el-button> <el-button type="primary" @click="handleNext" v-show="step == 1">下一步</el-button>
<el-button type="primary">取消</el-button> <el-button type="primary" @click="handleSave(1)" v-show="step == 2"
>存草稿</el-button
>
<el-button type="primary" @click="handlePrev" v-show="step == 2">上一步</el-button>
<el-button type="primary" @click="handleSave(2)" v-show="step == 2">确定</el-button>
<el-button type="primary" @click="handleCancel">取消</el-button>
</div> </div>
<el-dialog :visible.sync="dialogMapVisible" width="60%"> <el-dialog :visible.sync="dialogMapVisible" width="60%">
<map-view ref="mapForm" :mapHeight="mapHeight"></map-view> <map-view ref="mapForm" :mapHeight="mapHeight"></map-view>
...@@ -320,20 +358,22 @@ export default { ...@@ -320,20 +358,22 @@ export default {
}, },
data() { data() {
return { return {
nextStatus: false,
filterText: "", filterText: "",
brandData: [], brandData: [],
defaultProps: { defaultProps: {
children: "children", children: "children",
label: "label", label: "label",
}, },
parentId: "1", parentId: "",
step: 1,
mapHeight: 400, mapHeight: 400,
typeLabel: "",
typeStatus: false, typeStatus: false,
loadingImg: false, loadingImg: false,
dialogMapVisible: false, dialogMapVisible: false,
businessScopeCustomize: [{ name: "" }], businessScopeCustomize: [{ name: "" }],
accountAddForm: { accountAddForm: {
status: 1,
merchantType: "1", merchantType: "1",
businessScope: [], businessScope: [],
parentId: "", parentId: "",
...@@ -343,7 +383,6 @@ export default { ...@@ -343,7 +383,6 @@ export default {
accountInfoForm: {}, accountInfoForm: {},
accountDetail: {}, accountDetail: {},
accountLevel: [], accountLevel: [],
accountType: [],
businessOption: [], businessOption: [],
accountValidityPeriod: [], accountValidityPeriod: [],
baseRules: { baseRules: {
...@@ -375,7 +414,6 @@ export default { ...@@ -375,7 +414,6 @@ export default {
getAddress() { getAddress() {
this.dialogMapVisible = false; this.dialogMapVisible = false;
this.accountAddForm.merchantAddress = this.$refs.mapForm.address; this.accountAddForm.merchantAddress = this.$refs.mapForm.address;
console.log(this.accountAddForm.merchantAddress);
}, },
getBtnStatus(status, value) { getBtnStatus(status, value) {
if (status) { if (status) {
...@@ -419,6 +457,24 @@ export default { ...@@ -419,6 +457,24 @@ export default {
}; };
} }
}, },
handleSave(status) {
let accountTypes = this.$refs.productForm.accountTypes;
if (!accountTypes.every((item) => item.products)) {
this.$message.error("请选择产品");
}
let params = {
status,
merchantId: this.parentId,
accountTypes: this.$refs.productForm.accountTypes,
};
this.$apis.store.updatePermissions(params).then((res) => {
console.log(res);
});
},
handleCancel() {},
handlePrev() {
this.step = 1;
},
//下一步 //下一步
handleNext() { handleNext() {
const pm1 = new Promise((resolve, reject) => { const pm1 = new Promise((resolve, reject) => {
...@@ -445,10 +501,22 @@ export default { ...@@ -445,10 +501,22 @@ export default {
let businessScopeCustomize = this.businessScopeCustomize.map((item) => item.name); let businessScopeCustomize = this.businessScopeCustomize.map((item) => item.name);
params.businessScopeCustomize = businessScopeCustomize.join(","); params.businessScopeCustomize = businessScopeCustomize.join(",");
params.accounttypeId = this.accounttypeId.join(","); params.accounttypeId = this.accounttypeId.join(",");
let merchant;
if (this.nextStatus) {
merchant = "updateMerchant";
params.id = this.parentId;
} else {
merchant = "saveMerchant";
}
Promise.all([pm1, pm2]).then(() => { Promise.all([pm1, pm2]).then(() => {
this.$apis.store.saveMerchant(params).then((res) => { this.$apis.store[merchant](params).then((res) => {
if (res) { if (res) {
this.parentId = res; this.step = 2;
this.nextStatus = true;
if (typeof res == "number") {
this.parentId = res;
}
this.twoMerchantDetail(this.parentId);
} }
}); });
}); });
...@@ -462,13 +530,6 @@ export default { ...@@ -462,13 +530,6 @@ export default {
if (dictType == "account_level") { if (dictType == "account_level") {
this.accountLevel = res; this.accountLevel = res;
} }
if (dictType == "account_type") {
this.accountType = res;
let idx = this.accountType.findIndex(
(item) => (item.dictValue = this.accountDetail.accountType)
);
this.typeLabel = this.accountType[idx].dictLabel;
}
if (dictType == "business_scope") { if (dictType == "business_scope") {
this.businessOption = res; this.businessOption = res;
} }
...@@ -485,7 +546,15 @@ export default { ...@@ -485,7 +546,15 @@ export default {
this.accountDetail = await this.$apis.store.findMerchantDetail({ this.accountDetail = await this.$apis.store.findMerchantDetail({
id: this.accountAddForm.parentId, id: this.accountAddForm.parentId,
}); });
this.findAllDictData("account_type"); },
twoMerchantDetail(pid) {
this.$apis.store
.findMerchantDetail({
id: pid,
})
.then((res) => {
console.log(res);
});
}, },
getCarbrandTree() { getCarbrandTree() {
this.$apis.store.getCarbrandTree({}).then((res) => { this.$apis.store.getCarbrandTree({}).then((res) => {
...@@ -543,6 +612,49 @@ export default { ...@@ -543,6 +612,49 @@ export default {
&-form { &-form {
width: 80%; width: 80%;
margin: 20px auto; margin: 20px auto;
.form-row {
/deep/ .el-form-item__content {
display: flex;
}
.form-btn {
margin-left: 10px;
}
}
.store-upload-list {
display: flex;
flex-wrap: wrap;
.store-border {
position: relative;
width: 120px;
height: 80px;
border-radius: 2px;
margin-right: 15px;
margin-bottom: 15px;
}
.uploader-del-icon {
position: absolute;
top: 0px;
right: 0px;
width: 30px;
height: 30px;
line-height: 30px;
background: rgba(0, 0, 0, 0.4);
border-radius: 0px 0px 0px 100px;
cursor: pointer;
}
.el-icon-delete-solid {
color: #c5c5c5;
font-size: 14px;
margin-left: 12px;
}
}
.image-uploader {
/deep/ .el-upload {
width: 120px;
height: 80px;
line-height: 80px;
}
}
.brand-tree { .brand-tree {
height: 300px; height: 300px;
overflow-y: auto; overflow-y: auto;
......
<template> <template>
<div class="scrm-main"> <div class="scrm-main">
<el-tabs v-model="step" @tab-click="handleClick" class="tab-edit-status">
<el-tab-pane label="修改功能权限" name="first"></el-tab-pane>
<el-tab-pane label="修改基本信息" name="second"></el-tab-pane>
</el-tabs>
<div v-show="step == 'second'">
<div class="account-body scrm-box-f"> <div class="account-body scrm-box-f">
<div class="form-title">修改账户信息</div> <div class="form-title">修改账户信息</div>
<el-form <el-form
...@@ -32,10 +37,19 @@ ...@@ -32,10 +37,19 @@
> >
<el-input <el-input
type="password" type="password"
:readonly="pwdStatus ? 'readonly' : false"
v-model="accountInfoForm.merchantLoginPassword" v-model="accountInfoForm.merchantLoginPassword"
placeholder="请输入登录密码" placeholder="请输入登录密码"
></el-input> ></el-input>
<el-button type="primary" class="form-btn">重置密码</el-button> <el-button
type="primary"
class="form-btn"
@click="
pwdStatus = false;
accountInfoForm.merchantLoginPassword = '';
"
>重置密码</el-button
>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -47,7 +61,11 @@ ...@@ -47,7 +61,11 @@
:key="index" :key="index"
:btnLabel="item.accounttypeName" :btnLabel="item.accounttypeName"
:btnValue="item.accounttypeId" :btnValue="item.accounttypeId"
typeStatus="true" :typeStatus="
accountAddForm.accountTypeNames.search(item.accounttypeName) == -1
? false
: true
"
stopClick="true" stopClick="true"
></auto-button> ></auto-button>
</el-form-item> </el-form-item>
...@@ -122,12 +140,11 @@ ...@@ -122,12 +140,11 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="商户地址"> <el-form-item size="small" label="商户地址" class="form-row">
<el-input size="small" v-model="accountAddForm.merchantAddress"> <el-input readonly size="small" v-model="accountAddForm.merchantAddress"> </el-input>
<el-button slot="append" @click="dialogMapVisible = true" <el-button type="primary" class="form-btn" @click="dialogMapVisible = true"
>选择地址</el-button >选择地址</el-button
> >
</el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -251,13 +268,13 @@ ...@@ -251,13 +268,13 @@
<div class="store-upload-list"> <div class="store-upload-list">
<template <template
v-if=" v-if="
accountAddForm.merchantFileResponses && accountAddForm.merchantFiles &&
accountAddForm.merchantFileResponses.length > 0 accountAddForm.merchantFiles.length > 0
" "
> >
<div <div
:key="index" :key="index"
v-for="(item, index) in accountAddForm.merchantFileResponses" v-for="(item, index) in accountAddForm.merchantFiles"
class="store-border" class="store-border"
> >
<img :src="item.fileUrl" /> <img :src="item.fileUrl" />
...@@ -284,6 +301,10 @@ ...@@ -284,6 +301,10 @@
</el-row> </el-row>
</el-form> </el-form>
</div> </div>
</div>
<div v-show="step == 'first'">
<select-product></select-product>
</div>
<div class="footer-panel"> <div class="footer-panel">
<el-button type="primary" @click="handleNext">确定</el-button> <el-button type="primary" @click="handleNext">确定</el-button>
<el-button type="primary">取消</el-button> <el-button type="primary">取消</el-button>
...@@ -301,15 +322,18 @@ ...@@ -301,15 +322,18 @@
<script> <script>
import mapView from "@/components/mapView/index"; import mapView from "@/components/mapView/index";
import autoButton from "@/components/auto-button/index"; import autoButton from "@/components/auto-button/index";
import selectProduct from "./components/selectProduct";
export default { export default {
name: "index", name: "index",
components: { components: {
mapView, mapView,
autoButton, autoButton,
selectProduct
}, },
data() { data() {
return { return {
activeName: "first", pwdStatus: true,
step: "first",
filterText: "", filterText: "",
brandData: [], brandData: [],
defaultProps: { defaultProps: {
...@@ -378,7 +402,7 @@ export default { ...@@ -378,7 +402,7 @@ export default {
} }
}, },
delImg(index) { delImg(index) {
this.accountAddForm.merchantFileResponses.splice(index, 1); this.accountAddForm.merchantFiles.splice(index, 1);
}, },
upLoadImg(file) { upLoadImg(file) {
let fileName = file.name; let fileName = file.name;
...@@ -408,7 +432,9 @@ export default { ...@@ -408,7 +432,9 @@ export default {
}) })
.then((res) => { .then((res) => {
if (res) { if (res) {
console.log(res); self.accountAddForm.merchantFiles.push({
fileUrl: res,
});
} }
}); });
}; };
...@@ -436,7 +462,6 @@ export default { ...@@ -436,7 +462,6 @@ export default {
} }
params.merchantBrand = this.$refs.brandTree.getCheckedKeys().join(","); params.merchantBrand = this.$refs.brandTree.getCheckedKeys().join(",");
params.isloginName ? (params.isloginName = 1) : (params.isloginName = 0); params.isloginName ? (params.isloginName = 1) : (params.isloginName = 0);
params.merchantAccountLevel = this.accountDetail.merchantAccountLevel;
let businessScopeCustomize = this.businessScopeCustomize.map((item) => item.name); let businessScopeCustomize = this.businessScopeCustomize.map((item) => item.name);
params.businessScopeCustomize = businessScopeCustomize.join(","); params.businessScopeCustomize = businessScopeCustomize.join(",");
params.accounttypeId = this.accounttypeId.join(","); params.accounttypeId = this.accounttypeId.join(",");
...@@ -466,32 +491,51 @@ export default { ...@@ -466,32 +491,51 @@ export default {
this.businessScopeCustomize.splice(index, 1); this.businessScopeCustomize.splice(index, 1);
}, },
async findMerchantDetail() { async findMerchantDetail() {
this.accountAddForm = await this.$apis.store.findMerchantDetail({ this.$apis.store
id: this.accountAddForm.parentId, .findMerchantDetail({
}); id: this.accountAddForm.parentId,
this.accountInfoForm.merchantLoginAccount = this.accountAddForm.merchantLoginAccount; })
this.accountInfoForm.merchantLoginPassword = this.accountAddForm.merchantLoginPassword; .then((res) => {
this.accountTypes = this.accountAddForm.accountTypes; this.accountAddForm = res;
this.accountAddForm.businessScope = this.accountAddForm.businessScope this.accountInfoForm.merchantLoginAccount = this.accountAddForm.merchantLoginAccount;
? this.accountAddForm.businessScope.split(",") this.accountInfoForm.merchantLoginPassword = this.accountAddForm.merchantLoginPassword;
: []; this.accountTypes = this.accountAddForm.accountTypes;
for (let i in this.accountAddForm.businessScope) { this.accountAddForm.businessScope = this.accountAddForm.businessScope
this.accountAddForm.businessScope[i] = parseInt( ? this.accountAddForm.businessScope.split(",")
this.accountAddForm.businessScope[i] : [];
); for (let i in this.accountAddForm.businessScope) {
} this.accountAddForm.businessScope[i] = parseInt(
this.accountAddForm.bussinessTime = [ this.accountAddForm.businessScope[i]
this.accountAddForm.bussinessBegintime, );
this.accountAddForm.bussinessEndtime, }
]; this.accountAddForm.bussinessTime = [
let businessScopeCustomize = this.accountAddForm.businessScopeCustomize this.accountAddForm.bussinessBegintime,
? this.accountAddForm.businessScopeCustomize.split(",") this.accountAddForm.bussinessEndtime,
: []; ];
this.businessScopeCustomize = businessScopeCustomize.map((item) => { let businessScopeCustomize = this.accountAddForm.businessScopeCustomize
return { ? this.accountAddForm.businessScopeCustomize.split(",")
name: item, : [""];
};
}); this.businessScopeCustomize = businessScopeCustomize.map((item) => {
return {
name: item,
};
});
this.accountAddForm.merchantFiles = this.accountAddForm.merchantFileResponses.map(
(item) => {
return {
fileUrl: item.fileUrl,
};
}
);
let merchantBrand = this.accountAddForm.merchantBrand
? this.accountAddForm.merchantBrand.split(",")
: [];
for (let i in merchantBrand) {
merchantBrand[i] = parseInt(merchantBrand[i]);
}
this.$refs.brandTree.setCheckedKeys(merchantBrand);
});
}, },
getCarbrandTree() { getCarbrandTree() {
this.$apis.store.getCarbrandTree({}).then((res) => { this.$apis.store.getCarbrandTree({}).then((res) => {
...@@ -509,6 +553,11 @@ export default { ...@@ -509,6 +553,11 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.tab-edit-status {
/deep/ .el-tabs__nav-wrap::after {
display: none;
}
}
.account-header { .account-header {
height: 78px; height: 78px;
box-sizing: border-box; box-sizing: border-box;
...@@ -531,8 +580,8 @@ export default { ...@@ -531,8 +580,8 @@ export default {
} }
} }
.account-body { .account-body {
margin-top: 20px; &:nth-of-type(3) {
&:nth-of-type(2) { margin-top: 20px;
margin-bottom: 70px; margin-bottom: 70px;
} }
.form-title { .form-title {
......
...@@ -141,9 +141,11 @@ export default { ...@@ -141,9 +141,11 @@ export default {
}, },
methods: { methods: {
handleLook() {}, handleLook() {},
handleEdit() {}, handleEdit(scope) {
this.$router.push({path:'/account/editAccount',query:{id:scope.id}})
},
handleAdd(scope) { handleAdd(scope) {
this.$router.push({path:'/acount/addAccount',query:{id:scope.id}}) this.$router.push({path:'/account/addAccount',query:{id:scope.id}})
}, },
findAllDictData(dictType) { findAllDictData(dictType) {
var params = { var params = {
......
<template>
<div class="bloc-info-module">
<div class="wrapper">
<div class="wrap_left">
<div class="out_box_wrap">
<div class="fixed_widget">
<div class="label_text">版本:{{ bloc.merchantModelName || '--'}}</div>
<div class="label_text dr_top">
开通门店数:
<span v-if="bloc.numberStores" class="num_text">{{ bloc.numberStores }}家</span>
<span v-else class="num_text">--</span>
</div>
<div class="label_text dr_top">门店详情</div>
</div>
<div :class="isOpen ? 'table_wrapper_open' : 'table_wrapper_close'">
<!-- <GLTable v-if="isOpen" :hasPage="false" :tableParams="tableParams" :tableData="list" :headerStyle="{ background: '#F4F6FC', color: '#333333', fontSize: '14px' }"></GLTable> -->
<template v-if="isOpen">
<div class="line_wrapper wrap_header">
<div class="tittle text_w">序号</div>
<div class="tittle1 text_w">门店名称</div>
<div class="tittle2 text_w">有效期</div>
</div>
<div class="line_body">
<template v-if="list.length">
<div v-for="(item, index) in list" :key="index" class="line_wrapper">
<div class="tittle">{{ index + 1 }}</div>
<div class="tittle1">{{ item.merchantName }}</div>
<div class="tittle2">{{ item.date }}</div>
</div>
</template>
<template v-if="!list.length">
<div class="line_wrapper">暂无数据</div>
</template>
</div>
</template>
</div>
<div class="fixed_footer" @click="changeRightOpenStatus(isOpen)">
<i :class="isOpen ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"></i>
<span class="dr_left">{{ isOpen ? '隐藏门店详情' : '展开门店详情' }}</span>
</div>
</div>
</div>
<!-- <div class="wrap_right">
<div v-for="(item, index) in rightData" :key="index" class="out_box_wrap">
<div class="fixed_widget">
<div class="label_text">版本:{{ item.name }}</div>
<div class="label_text dr_top">
开通门店数:
<span class="num_text">{{ item.num }}家</span>
</div>
<div class="label_text dr_top">门店详情</div>
</div>
<div :class="item.open ? 'table_wrapper_open' : 'table_wrapper_close'">
<glsx-table v-if="item.open" :hasPage="false" :tableParams="tableParams" :tableData="item.list" :headerStyle="{ background: '#F4F6FC', color: '#333333', fontSize: '14px' }"></glsx-table>
</div>
<div class="fixed_footer" @click="changeRightOpenStatus(item, index)">
<i :class="item.open ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"></i>
<span class="dr_left">{{ item.open ? '隐藏门店详情' : '展开门店详情' }}</span>
</div>
</div>
</div> -->
</div>
</div>
</template>
<script>
export default {
name: '',
data() {
return {
curOpenIndex: 0,
dataList: [],
leftData: [],
rightData: [],
tableParams: {
listName: 'list',
tableColumns: [
{
label: '门店名称',
prop: 'merchantName'
},
{
label: '有效期',
prop: 'date'
}
]
},
isOpen: false
}
},
props: {
list: Array,
bloc: null
},
methods: {
// changeLeftOpenStatus(item, index) {
// this.leftData[index].open = !item.open
// },
changeRightOpenStatus(isOpen) {
this.isOpen = !isOpen
},
// handlerData() {
// let arr = this.dataList
// let left = []
// let right = []
// arr.forEach((item, index) => {
// if (index % 2 == 0) {
// left.push(item)
// } else {
// right.push(item)
// }
// })
// this.leftData = left
// this.rightData = right
// console.log(left)
// console.log(right)
// }
},
mounted() {}
}
</script>
<style lang="scss" scoped>
.bloc-info-module {
box-sizing: border-box;
padding: 20px 0 0 40px;
}
.wrapper {
display: flex;
flex-wrap: wrap;
.wrap_left,
.wrap_right {
// min-width: 44.8%;
min-width: 520px;
min-height: 176px;
}
.wrap_left {
margin-right: 40px;
}
}
.out_box_wrap {
width: 100%;
min-height: 176px;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
border-radius: 10px;
border: 1px solid #e5e4ff;
margin: 0 40px 40px 0;
.fixed_widget {
width: 100%;
height: 140px;
box-sizing: border-box;
padding: 20px 0 0 20px;
.label_text {
color: #333333;
font-size: 14px;
font-weight: 400;
}
.num_text {
font-size: 14px;
font-weight: 400;
color: #5850ff;
}
.dr_top {
margin-top: 20px;
}
}
.table_wrapper_close {
height: 0;
// transition: height 0.1s ease-in-out;
}
.table_wrapper_open {
height: 378px;
// transition: height 0.1s ease-in-out;
}
.line_wrapper {
width: 100%;
min-height: 54px;
background: #ffffff;
display: flex;
align-items: center;
justify-content: center;
color: #909399;
font-size: 14px;
border-bottom: 1px solid #dcdfe6;
.tittle {
width: 20%;
text-align: center;
color: #333333;
font-size: 14px;
}
.tittle1 {
width: 40%;
text-align: center;
color: #333333;
font-size: 14px;
word-wrap: break-word;
word-break: break-all;
overflow: hidden;
}
.tittle2 {
width: 40%;
text-align: center;
color: #333333;
font-size: 14px;
}
}
.wrap_header {
background: #f4f6fc;
}
.text_w {
font-weight: bold;
}
.line_body {
width: 100%;
height: 324px;
overflow-y: auto;
overflow-x: hidden;
}
.line_body::-webkit-scrollbar {
height: 1px;
width: 8px;
}
.line_body::-webkit-scrollbar-thumb {
background: #e9e8ff;
border-radius: 7px;
}
.fixed_footer {
width: 100%;
height: 36px;
background: #f4f6fc;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
font-weight: 400;
color: #b9b8c7;
border-radius: 0px 0px 10px 10px;
cursor: pointer;
.dr_left {
margin-left: 12px;
}
}
}
// .bloc-info-module /deep/ .el-table__body-wrapper {
// height: 352px;
// overflow-y: auto;
// overflow-x: hidden;
// }
// .bloc-info-module /deep/ .el-table__body-wrapper::-webkit-scrollbar {
// height: 1px;
// width: 8px;
// }
// .bloc-info-module /deep/ .el-table__body-wrapper::-webkit-scrollbar-thumb {
// background: #e9e8ff;
// border-radius: 7px;
// }
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="out_main">
<!-- <div class="base-info-index"> -->
<div class="top_widget">
<img class="sign_icon" src="../../assets/scrm_base_info_icon_one.png" />
<div class="info_widget">
<div class="title_text">
{{ blocInfo.merchantName }}
<span class="min_text">(商户号:{{ blocInfo.merchantNo }})</span>
</div>
<div class="sec_title_text dr_top_1">
<span>关联企微:{{ blocInfo.entmicroName || '--' }}</span>
<div v-if="blocInfo.entmicroName" class="auth_btn" :class="accountLevel != 4 ? 'auth_btn_cp' : ''">已授权</div>
</div>
<div v-if="accountLevel==1" class="min_text dr_top_1">所属企业:--</div>
<div v-if="accountLevel!=1" class="min_text dr_top_1">所属企业:{{ blocInfo.parentName }}</div>
<div v-if="accountLevel==4" class="min_text">企微员工:{{ blocInfo.entMicroEmployeeCount }}人</div>
</div>
</div>
<blocModule :bloc="blocInfo" :list.sync="storesList" v-if="accountLevel != 4"></blocModule>
<shopModule v-if="accountLevel == 4"></shopModule>
<!-- </div> -->
</div>
</template>
<script>
import shopModule from './shop.vue'
import blocModule from './bloc.vue'
// import { merchantInfo } from '../../api/modules/baseinfoApi'
export default {
name: 'index',
components: {
shopModule,
blocModule
},
data() {
return {
platform: 1, //1 集团 2 门店
accountLevel:1,//1-工厂;2-省代;3-市代;4-门店
blocInfo: {
merchantName: ''
},
storesList: []
}
},
created() {
//this.$globalState.accountLevel
// const { session } = this.$globalState
// this.platform = session.merchantModel
// this.loginInfo = session
// this.accountLevel = session.accountLevel
this.getBlocData()
},
methods: {
getBlocData() {
// let para = {
// merchantId: this.loginInfo.merchantId,
// sessionId: this.loginInfo.sessionId
// }
this.$apis.baseInfo.merchantInfo({}).then(res => {
this.blocInfo = res
this.storesList = res.stores.map(item => {
item.date = `${this.dateFormat(item.starttime, 'YYYY.MM.DD')}--${this.dateFormat(item.endtime, 'YYYY.MM.DD')}`
return item
})
})
},
dateFormat: function (dateTime, format = 'yyyy-MM-dd') {
const date = new Date(dateTime)
const config = {
YYYY: date.getFullYear(),
MM: date.getMonth() + 1, //getMonth() 方法根据本地时间返回指定日期的月份(从 0 到 11)
DD: date.getDate(),
HH: date.getHours(),
mm: date.getMinutes(),
ss: date.getSeconds()
}
for (const key in config) {
format = format.replace(key, config[key])
}
return format
}
}
}
</script>
<style lang="scss" scoped>
.out_main {
box-sizing: border-box;
height: 100%;
// margin: 0 20px 64px 40px;
background: #fff;
// box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
// min-height: calc(100vh - 144px);
}
.base-info-index {
width: 100%;
height: calc(100vh - 144px);
background: #fff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
overflow: hidden;
overflow-y: scroll;
}
.out_main::-webkit-scrollbar {
height: 1px;
width: 8px;
}
.out_main::-webkit-scrollbar-thumb {
background: #e9e8ff;
border-radius: 7px;
}
.top_widget {
width: 100%;
box-sizing: border-box;
padding: 40px 0 0 40px;
display: flex;
.sign_icon {
width: 64px;
height: 64px;
border-radius: 50%;
}
.info_widget {
margin-left: 15px;
.title_text {
color: #333333;
font-size: 16px;
font-weight: 500;
}
.min_text {
color: #999999;
font-size: 12px;
line-height: 20px;
}
.sec_title_text {
color: #333333;
font-size: 14px;
font-weight: 400;
.auth_btn {
width: 48px;
height: 20px;
text-align: center;
line-height: 20px;
border-radius: 1px;
border: 1px solid #ff6d00;
font-size: 12px;
font-weight: 400;
color: #ff6d00;
display: inline-block;
margin-left: 16px;
}
.auth_btn_cp {
border: 1px solid #5850ff;
color: #5850ff;
}
}
.dr_top_1 {
margin-top: 8px;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="shop-info-module">
<div class="wrapper">
<div class="out_wrap dr_right">
<div class="elment_widget">
<div class="top_bg_wrap">
<div class="title_text">已购产品信息</div>
<div class="desc_text">
<span>标准版有效期:</span>
<span class="spc_text">2021年1月1日-2022年1月1日</span>
</div>
</div>
<div class="bottom_wrap">
<div class="info_text">已购版本:嘀加智慧门店SCRM标准版</div>
<div class="info_text dr_top">短信总条数:10000条</div>
<div class="info_text dr_top">外呼电话总数:5000个</div>
</div>
</div>
<div class="element_btn dr_top">续费</div>
</div>
<div class="out_wrap dr_right">
<div class="elment_widget dr_right">
<div class="top_bg_wrap">
<div class="title_text">智能语音电话套餐信息</div>
<div class="desc_text">
<span>剩余外呼电话数:</span>
<span class="spc_text max_text">3000</span>
<span class="unit_text">个</span>
</div>
</div>
<div class="bottom_wrap">
<div class="info_text">已呼电话个数:2000个</div>
<div class="info_text dr_top">已购版本:嘀加智慧门店SCRM标准版-智能语音…</div>
<div class="info_text dr_top">外呼电话总数:5000个</div>
</div>
</div>
<div class="element_btn dr_top disableBtn">续费</div>
</div>
<div class="out_wrap">
<div class="elment_widget">
<div class="top_bg_wrap">
<div class="title_text">短信套餐信息</div>
<div class="desc_text">
<span>剩余短信条数:</span>
<span class="spc_text max_text">8000</span>
<span class="unit_text">条</span>
</div>
</div>
<div class="bottom_wrap">
<div class="info_text">剩余短信条数:2000条</div>
<div class="dr_top min_text">
<span>营销短信:1000条</span>
<span class="dr_left">通知:1000条</span>
</div>
<div class="info_text dr_top">已购版本:嘀加智慧门店SCRM标准版-短信套餐</div>
<div class="info_text dr_top">短信总条数:10000条-短信套餐</div>
</div>
</div>
<div class="element_btn dr_top disableBtn">续费</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: '',
data() {
return {}
},
methods: {}
}
</script>
<style lang="scss" scoped>
.shop-info-module {
box-sizing: border-box;
padding: 60px 0 0 40px;
}
.wrapper {
display: flex;
.dr_right {
margin-right: 30px;
}
.out_wrap {
width: 29%;
height: 298px;
.elment_widget {
width: 100%;
height: 250px;
border: 1px solid #e5e4ff;
border-radius: 10px;
.top_bg_wrap {
width: 100%;
height: 108px;
background-image: url('../../assets/scrm_base_info_icon_two.png');
background-size: 100% 108px;
box-sizing: border-box;
padding: 20px 0 0 20px;
.title_text {
color: #333;
font-size: 18px;
font-weight: 600;
}
.desc_text {
font-size: 14px;
font-weight: 400;
color: #333333;
margin-top: 28px;
.spc_text {
font-weight: 600;
color: #5850ff;
}
.max_text {
font-size: 22px;
}
.unit_text {
margin-left: 4px;
}
}
}
.bottom_wrap {
width: 100%;
height: 142px;
box-sizing: border-box;
padding: 20px 0 0 20px;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
.info_text {
font-size: 14px;
font-weight: 400;
color: #666666;
}
.min_text {
font-size: 12px;
color: #666666;
}
.dr_left {
margin-left: 30px;
}
}
}
.element_btn {
width: 72px;
height: 36px;
text-align: center;
line-height: 36px;
background: #5850ff;
border-radius: 4px;
color: #fff;
font-size: 16px;
font-weight: 600;
margin: 0 auto;
cursor: pointer;
}
.disableBtn {
background: #CCC;
}
}
}
.dr_top {
margin-top: 10px !important;
}
</style>
\ No newline at end of file \ No newline at end of file
<!-- 选择分页 -->
<template>
<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-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-group>
<div class="btns">
<el-button :size="size" :disabled="page.pageNum == 1" @click="handlePage(false)">上一页</el-button>
<span>{{ page.pageNum }}/{{ page.totalPage }}</span>
<el-button :size="size" :disabled="page.pageNum == page.totalPage" @click="handlePage(true)">下一页</el-button>
</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-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-popover>
</div>
</template>
<script>
import { getAllMerchantListApi } from '@/api/modules/employee'
export default {
name: 'selectPage',
data() {
return {
size: 'small',
isExpand: false,
// 树状菜单显示状态
popoverVisible: false,
treeWidth: 'auto',
currList: [],
allMerchantList: [],
page: {
pageSize: 20,
pageNum: 1,
total: 0,
totalPage: 0
}
}
},
props: {
// 输入框宽度
width: {
type: String,
default: '300px'
},
form: {
type: Object,
default: () => {}
},
targetItem: {
type: Object,
default: () => {}
},
treeData: {
type: Array,
default: () => []
}
// defaultProps: {
// type: Object,
// default: () => ({
// parent: 'parentId',
// value: 'id',
// label: 'menuName',
// children: 'childlist'
// })
// }
},
// watch: {
// form(val) {
// if (this.form[this.targetItem.name]) {
// 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]])
// })
// }
// }
// },
created() {
// 获取输入框宽度同步至树状菜单宽度
this.$nextTick(() => {
this.treeWidth = `${(this.width || this.$refs.input.$refs.input.clientWidth) - 24}px`
})
},
mounted() {
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: {
getCurrList() {
this.currList = this.allMerchantList.slice((this.page.pageNum - 1) * this.page.pageSize, this.page.pageNum * this.page.pageSize)
},
getAllMerchantList() {
getAllMerchantListApi({}).then(res => {
this.allMerchantList = res
this.page.total = res.length
this.page.totalPage = Math.ceil(res.length / this.page.pageSize)
this.getCurrList()
// index + (page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1
})
},
handlePage(isNext) {
this.page.pageNum = isNext ? this.page.pageNum + 1 : this.page.pageNum - 1
this.getCurrList()
},
handleChangeRadio(val) {
this.form[this.targetItem.nameLabel] = this.currList.find(item => item.id == val).merchantName
this.$emit('handleChange', val)
this.onHidePopover()
},
// handleClickRadio(item) {
// console.log(item)
// },
// 显示时触发
onShowPopover() {
this.popoverVisible = true
// this.$refs.tree.filter(false)
},
// 隐藏时触发
onHidePopover() {
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) {
this.form[this.targetItem.name] = ''
this.form[this.targetItem.nameLabel] = ''
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>
<style>
.el-input.el-input--suffix.rotate .el-input__suffix .el-icon-arrow-down {
transform: rotate(-180deg);
}
.select-tree {
max-height: 400px;
overflow-y: scroll;
}
.page-radio {
display: block;
width: 320px;
height: 36px;
line-height: 36px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.select-page {
padding-bottom: 6px;
}
.select-page .btns {
display: flex;
justify-content: space-between;
align-items: center;
}
</style>
<!-- 编辑员工 -->
<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"></select-page>
<!-- <el-select v-model="editForm.merchantId" placeholder="请选择所属商户" @change="handleChangeMerchant($event, item)">
<el-option v-for="subItem in baseData.allMerchantList" :key="subItem.id" :label="subItem.merchantName" :value="subItem.id" :disabled="subItem.isDisabled || false"></el-option>
</el-select> -->
</template>
</glsx-combi-form>
</div>
<!-- <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="default" @click="handleCancel">取消</el-button>
</div>
</div>
</template>
<script>
import { utils } from 'glsx-common'
import selectPage from './components/selectPage'
import glsxCombiForm from './glsx-combi-form'
import { getAllMerchantListApi, getRoleListApi, getMerchantTreeApi } from '@/api/modules/employee'
export default {
name: 'editEmployee',
data() {
return {
title: '新增员工',
titleObj: {
1: '新增员工',
2: '编辑员工'
},
editChildRef: 'editChildRef',
routeInfo: {
// 1-新增;2-编辑
addOrEdit: 1,
id: ''
},
editForm: {
merchantId: '',
merchantName: '',
staffName: '',
staffPhone: '',
password: '',
searchMerchant: '',
roleId: '',
merhcnatImg: ''
},
editRule: {
merchantId: [{ required: true, message: '请选择所属商户', trigger: 'change' }],
staffName: [{ required: true, message: '请输入员工姓名', trigger: 'change' }],
staffPhone: [{ required: true, message: '请输入登录手机号', trigger: 'change' }],
password: [{ required: true, message: '请输入登录密码', trigger: 'change' }],
searchMerchant: [{ required: true, message: '请选择可见商户', trigger: 'change' }],
roleId: [{ required: true, message: '请选择角色权限', trigger: 'change' }]
},
isBlock: true,
editFormData: [
{
label: '所属商户',
name: 'merchantId',
nameLabel: 'merchantName',
optionList: [],
optionId: 'id',
optionLabel: 'merchantName',
optionsName: 'allMerchantList',
addHtml: 'merchantId'
},
{
label: '员工姓名',
name: 'staffName',
width: '360px',
type: 'input',
maxlength: 15
},
{
label: '登录手机号',
name: 'staffPhone',
width: '360px',
type: 'input',
placeholder: '请输入您有效的手机号作为登录账户',
maxlength: 11
},
{
label: '登录密码',
name: 'password',
width: '360px',
type: 'input',
maxlength: 15
},
{
label: '可见商户',
name: 'searchMerchant',
addHtml: 'searchMerchant'
},
{
label: '角色权限',
name: 'roleId',
type: 'select',
optionList: [],
optionId: 'id',
optionLabel: 'roleName',
optionsName: 'roleList'
},
{
label: '头像',
name: 'merhcnatImg',
type: 'upload',
maxPhotoNum: 1,
wdithLt: 800,
heightLt: 640,
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
// uploadImg({ file: base64, fileType: 'image' }).then(res => {
// this.editForm[targetItem.name] = res
// this.$refs.editFormRef.$refs[this.editChildRef].validateField(targetItem.name)
// })
}
},
{
label: '邮箱',
name: 'staffEmail',
width: '360px',
type: 'input',
maxlength: 30
},
{
label: '主要职务',
name: 'staffJob',
width: '360px',
type: 'input',
maxlength: 10
}
],
baseData: {
allMerchantList: [],
merchantTree: [],
roleList: []
}
}
},
components: {
glsxCombiForm,
selectPage
},
computed: {},
mounted() {
this.routeInfo = this.$route.params
this.getAllMerchantList()
},
methods: {
getAllMerchantList() {
getAllMerchantListApi({}).then(res => {
this.baseData.allMerchantList = res
})
},
handleChangeMerchant(e, item) {
console.log(e)
console.log(item)
this.editForm.roleId = ''
// this.editForm.roleId = ''
this.getRoleList(e)
this.getMerchantTree(e)
},
getMerchantTree(value) {
getMerchantTreeApi({ id: value }).then(res => {
this.baseData.merchantTree = res
})
},
getRoleList(value) {
getRoleListApi({ id: value }).then(res => {
this.baseData.roleList = res
this.getOptionsList('editFormData', false, 'roleId')
})
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
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] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
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]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
}
}
}
</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::before {
position: absolute;
display: inline-block;
content: '';
height: 18px;
width: 4px;
top: 2px;
left: 0;
background-color: #0947C6;
} */
.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;
}
</style>
/**
* 时间控件-限制月份
*/
export const beforeRangePickerOptions = {
disabledDate(date) {
if (date > new Date()) {
return true
}
return false
}
}
export const afterRangePickerOptions = {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate() - 1))
if (date < yesterday) {
return true
}
return false
}
}
<!-- 员工管理 -->
<template>
<div class="config-employee">
<div class="container">
<div class="flex">
<div style="margin-top: 16px;">
<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">
<select-page :form="searchForm" width="300px" :targetItem="item.scope" @handleChange="handleChangeMerchant"></select-page>
</template>
<template slot="footer">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" type="primary">导出</el-button>
</template>
</glsx-combi-form>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="employeeRef" :getListApi="getListApi" :searchForm="tableSearchForm" :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>
<!-- 表格区域 end -->
</div>
</div>
</template>
<script>
import { utils } from 'glsx-common'
import { getListApi, getAllMerchantListApi, getRoleListApi, getAllDictApi } from '@/api/modules/employee'
import glsxCombiForm from './glsx-combi-form'
import selectPage from './components/selectPage'
export default {
name: 'index',
data() {
return {
size: 'small',
searchForm: {
merchantId: '',
merchantName: '',
roleId: '',
status: ''
},
tableSearchForm: {},
searchSelectObj: {
staffNameOrPhone: {
attr: 'staffName',
value: ''
}
},
// 搜索
searchFormData: [
{
label: '商户名称',
name: 'merchantId',
nameLabel: 'merchantName',
optionList: [],
optionId: 'id',
optionLabel: 'merchantName',
optionsName: 'allMerchantList',
addHtml: 'merchantId'
},
{
label: '角色',
name: 'roleId',
type: 'select',
width: '192px',
optionList: [],
optionId: 'id',
optionLabel: 'roleName',
optionsName: 'roleList'
},
{
label: '状态',
name: 'status',
type: 'select',
width: '192px',
optionList: [],
optionId: 'dictValue',
optionLabel: 'dictLabel',
optionsName: 'staffStatusList'
},
{
type: 'selectInput',
selectName: 'staffNameOrPhone',
isClear: true,
selectOption: [
{
label: '员工姓名',
name: 'staffName'
},
{
label: '手机号',
name: 'staffPhone'
}
],
handleSelectChange: value => {
this.searchSelectObj.staffNameOrPhone.value = ''
}
}
],
// 表格
getListApi: getListApi,
tableParams: {
listName: 'data',
tableOption: true,
tableColumns: [
{
label: '员工姓名',
prop: 'staffName'
},
{
label: '员工企微号',
prop: 'entmicroName',
line: 2
},
{
label: '角色',
prop: 'roleName',
line: 2
},
{
label: '登录手机号',
prop: 'staffPhone',
line: 2
},
{
label: '所属门店',
prop: 'merchantName',
line: 2
},
{
label: '所属企微',
prop: 'belongingEntmicroName',
line: 2
},
{
label: '状态',
prop: 'statusName',
width: '80px'
},
{
label: '更新时间',
prop: 'updatedTime',
line: 2
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
baseData: {
allMerchantList: [],
roleList: [],
staffStatusList: []
}
}
},
components: {
glsxCombiForm,
selectPage
},
mounted() {
this.getBaseData().then(res => {
this.getOptionsList('searchFormData')
})
},
methods: {
getAllMerchantList() {
getAllMerchantListApi({}).then(res => {
this.baseData.allMerchantList = res
})
},
getBaseData() {
// 1.product(产品) 2.account_type(账户类型) 3.(functional_attributes) 功能属性 4.(owned_customer_group)所属客户群 5.channel渠道 6.account_level(商户层级)
return new Promise(resolve => {
Promise.all([getAllMerchantListApi({}), getAllDictApi({ dictType: 'staff_status' })]).then(([allMerchant, staffStatus]) => {
this.baseData.allMerchantList = allMerchant
this.baseData.staffStatusList = staffStatus
resolve()
})
})
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
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] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
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]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
handleChangeMerchant(value) {
this.searchForm.roleId = ''
this.baseData.roleList = []
this.getOptionsList('searchFormData', true, 'roleId')
value &&
getRoleListApi({ id: value }).then(res => {
this.baseData.roleList = res
this.getOptionsList('searchFormData', true, 'roleId')
})
},
getSelectInputParams() {
const list = Object.keys(this.searchSelectObj)
var params = {}
list.forEach(i => {
const item = this.searchSelectObj[i]
item.value && (params[item.attr] = item.value)
})
return params
},
getParams() {
var params = utils.deepClone(this.searchForm)
// params.productId.includes('') && (params.productId = [])
const tempParams = this.getSelectInputParams()
params = {
...params,
...tempParams
}
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
// 1-新增;2-编辑
handleEdit(addOrEdit, row) {
console.log(addOrEdit)
this.$router.push({
name: 'employee',
// name: 'ConfigEmployeeIndex',
params: {
addOrEdit: addOrEdit,
id: row ? row.id : '-1'
}
})
},
// handleReset() {
// this.searchForm = {
// name: ''
// }
// this.handleSearch()
// },
handleSearch() {
this.$refs.employeeRef.refreshTable()
}
}
}
</script>
<style lang="scss">
.config-employee .container {
margin-top: 20px;
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 10px;
}
.config-employee .flex {
display: flex;
justify-content: space-between;
}
</style>
<template>
<div class="account-body scrm-box-f">
<div class="account-title">功能权限</div>
<el-tabs v-model="tabName" type="card">
<el-tab-pane
:label="item.accounttypeName"
:name="item.accounttypeId"
v-for="(item, index) in tabMenu"
:key="index"
></el-tab-pane>
</el-tabs>
<div
class="account-select-pro"
v-for="(item, index) in tabMenu"
:key="index"
v-show="tabName == item.accounttypeId"
>
<label>选择产品</label>
<el-checkbox-group v-model="item.productsArr" @change="selectPro(index)">
<el-checkbox
v-for="(itm, idx) in item.products"
:label="itm.productName"
:key="idx"
></el-checkbox>
</el-checkbox-group>
</div>
<div class="account-select-menu">请选择产品权限</div>
<div class="menu-box">
<div :key="index" v-for="(item, index) in tabMenu">
<div
class="menu-box-tab"
v-show="tabName == item.accounttypeId"
>
<div class="tab-item text-hide" v-for="(itm, idx) in item.productsArr" :key="idx">
{{ itm }}
</div>
</div>
<div v-if="item.products[0]" class="menu-box-tree" v-show="tabName == item.accounttypeId && item.productsArr.indexOf(item.accounttypeName) != -1">
<el-tree
:data="item.products[0].merchantProTreeResponses"
show-checkbox
default-expand-all
node-key="id"
ref="brandTree"
highlight-current
:props="defaultProps"
>
</el-tree>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "product",
props: {
parentId: {
type: Number,
},
pId: {
type: Number,
},
accountlevel: {
type: Number,
},
},
data() {
return {
tabMenu: [],
selectIndex: 0,
products: [],
productsArr: [],
tabName: "",
defaultProps: {
children: "children",
label: "label",
},
};
},
methods: {
selectPro() {},
findPermissionsByMerId() {
let params = {
accountlevel: 2,
parentId: 41513,
id: 41555,
};
this.$apis.store.findMenuFunTreeByMerId(params).then((res) => {
this.tabMenu = res.map((item) => {
return {
productsArr: [],
products: item.products,
accounttypeName: item.accounttypeName,
accounttypeId: item.accounttypeId,
};
});
this.tabName = this.tabMenu[0].accounttypeId;
});
},
},
mounted() {
this.findPermissionsByMerId();
},
};
</script>
<style scoped lang="scss">
.account-body {
padding: 20px;
.account-title {
font-size: 20px;
font-weight: 600;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
margin-bottom: 30px;
}
.account-select-pro {
padding-left: 30px;
font-size: 14px;
font-weight: 500;
color: #333333;
line-height: 20px;
display: flex;
flex-wrap: wrap;
label {
margin-right: 20px;
}
}
.account-select-menu {
font-size: 14px;
font-weight: 500;
color: #333333;
line-height: 20px;
margin-top: 20px;
}
.menu-box {
margin-top: 10px;
background: #f4f6fc;
border-radius: 4px;
padding: 10px;
.tab-item {
width: 180px;
background: #ffffff;
border-radius: 4px 0px 0px 0px;
border: 1px solid #f4f6fc;
font-size: 14px;
line-height: 14px;
font-weight: 400;
color: #322ad9;
text-align: center;
padding: 12px 0px;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="role-home-page">
<div class="top_widget">
<el-button size="small" icon="el-icon-plus" type="primary" @click="toCreatePage">创建角色</el-button>
<div v-if="accountLevel != 4" class="top_select">
<span class="select_label">商户名称</span>
<el-select :filter-method="filterList" size="small" clearable filterable v-model="searchForm.merchantId" placeholder="请选择">
<el-option v-for="item in list" :key="item.id" :label="item.merchantName" :value="item.id"></el-option>
</el-select>
</div>
</div>
<div class="driver_line"></div>
<div class="table_widget">
<el-form :inline="true" :model="searchForm" class="follow-form-item">
<el-form-item label="状态">
<el-select size="small" v-model="searchForm.delFlag" placeholder="请选择">
<el-option v-for="item in optionData" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="角色名称">
<el-input size="small" v-model="searchForm.roleName" clearable placeholder="请输入"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="toFindData">查询</el-button>
</el-form-item>
</el-form>
<GLTable ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="getTableData">
<template slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="toLookPage(scope.scope)">查看</el-button>
<el-button type="text" @click="toEditPage(scope.scope)">修改</el-button>
<el-button v-if="scope.scope.delFlag" type="text" @click="todelete(scope.scope)">删除</el-button>
</template>
</GLTable>
</div>
</div>
</template>
<script>
export default {
name: '',
data() {
return {
searchForm: {
delFlag: 2,
roleName: '',
merchantId: ''
},
optionData: [
{
value: 2,
label: '全部'
},
{
value: 1,
label: '草稿'
},
{
value: 0,
label: '启用'
}
],
//表格配置
layout: 'sizes, prev, pager, next, jumper, ->, total',
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
tableParams: {
tableOption: true,
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableColumns: [
{
label: '角色名称',
prop: 'roleName'
},
{
label: '角色号',
prop: 'roleCode'
},
{
label: '状态',
prop: 'statusName',
width: '100px'
},
{
label: '创建时间',
prop: 'createdTime'
},
{
label: '更新时间',
prop: 'updatedTime',
formatter: val => {
if (!val.updatedTime) {
return '--'
} else {
return val.updatedTime
}
}
}
]
},
tableData: [],
merchantList: [],
tableTotal: 0,
accountLevel: 1,
list:[]
}
},
created() {
// const { session } = this.$globalState
// let accountLevel = session.accountLevel
let accountLevel = 1
if (accountLevel != 4) {
this.tableParams.tableColumns.splice(2, 0, { label: '所属商户名', prop: 'merchantName' })
this.getMerchantName()
}
this.accountLevel = accountLevel
},
mounted() {
this.getTableData()
},
methods: {
// 获取表格数据
getTableData() {
let { delFlag, roleName, merchantId } = this.searchForm
console.log(merchantId)
let para = {
pageNum: this.$refs.table.page.pageNum,
pageSize: this.$refs.table.page.pageSize
}
if (delFlag < 2) {
para.delFlag = delFlag
}
if (roleName) {
para.roleName = roleName
}
if (merchantId) {
para.merchantId = merchantId
}
this.$apis.role.roleDataList(para).then(res => {
this.tableData = res.data
this.tableTotal = res.count
this.$nextTick(() => {
this.$refs.table.setTableHeightFun()
})
})
},
getMerchantName() {
this.$apis.role.merchantDataList({ source: 'glsx' }).then(res => {
this.merchantList = res
this.filterList()
})
},
// 过滤数据
filterList(query = '') {
let arr = this.merchantList.filter(item => {
return item.merchantName.includes(query)
})
if (arr.length > 100) {
this.list = arr.slice(0, 100)
} else {
this.list = arr
}
},
// 查询
toFindData() {
this.getTableData()
},
// 去创建角色页面
toCreatePage() {
this.$router.push({ path: '/role/create/index', query: { page: 'create' } })
},
// 去查看角色页面
toLookPage(row) {
this.$router.push({ path: '/role/index/look', query: { row } })
},
// 去修改角色页面
toEditPage(row) {
this.$router.push({ path: '/role/create/index', query: { page: 'edit', row } })
},
// 去删除草稿
todelete(row){
console.log(row);
},
}
}
</script>
<style lang="scss" scoped>
.role-home-page {
box-sizing: border-box;
display: flex;
flex-direction: column;
height: 100%;
}
.top_widget {
width: 100%;
height: 78px;
display: flex;
align-items: center;
justify-content: space-between;
background: #ffffff;
box-sizing: border-box;
padding: 0 20px;
.top_select {
display: flex;
align-items: center;
.select_label {
font-size: 14px;
font-weight: 400;
color: #333333;
margin-right: 10px;
}
}
}
.driver_line {
width: 100%;
height: 20px;
}
.table_widget {
width: 100%;
// height: calc(100% - 138px);
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
box-sizing: border-box;
padding: 20px;
}
</style>
<template>
<div class="role-create-page">
<div class="top_title_widget">
<span class="title">角色基本信息</span>
<span class="store_title">{{ roleInfo.merchantName }}</span>
</div>
<div class="info_widget">
<div class="info_line_wrap">
<div class="info_line_label">角色名称:</div>
<div class="infl_line_con">{{ roleInfo.roleName }}</div>
</div>
<div class="info_line_wrap">
<div class="info_line_label">角色号:</div>
<div class="infl_line_con">{{ roleInfo.roleCode }}</div>
</div>
<div class="info_line_wrap">
<div class="info_line_label">角色说明:</div>
<div class="infl_line_con">{{ roleInfo.roleDescription || '无' }}</div>
</div>
</div>
<div class="main_widget">
<div class="main_title">角色权限</div>
<div class="wrapper">
<div class="menu_line_one">
<div v-for="(item, index) in rootList" :key="index" class="line_element" :class="curRootIndex == index ? 'line_element_active' : ''" @click="selectRootItem(index)">{{ item.accounttypeName }}</div>
</div>
</div>
<div class="wrapper">
<div class="main_body">
<div class="menu_line_two">
<div v-for="(item, index) in productList" :key="index" class="line_element_two" :class="curProductIndex == index ? 'line_element_two_active' : ''" @click="selectProductItem(index)">{{ item.productName }}</div>
</div>
<div class="tree_widget">
<el-tree v-if="productList.length" :data="productList[curProductIndex].merchantProTreeResponses" :props="defaultProps"></el-tree>
<div v-if="productList.length == 0" class="no_data_icon">
<div class="nodata_wrap">
<img class="icon" src="../../../assets/img/empty.png" />
<span class="text">暂无数据</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div style="height: 84px"></div>
<div class="fixed_bottom">
<el-button type="primary" @click="toBack">关闭</el-button>
</div>
</div>
</template>
<script>
export default {
name: '',
data() {
return {
rootList: [],
curRootIndex: 0,
productList: [],
curProductIndex: 0,
roleInfo: {
roleName: ''
},
defaultProps: {
children: 'children',
label: 'label'
}
}
},
created() {
let query = this.$route.query
let id = query.row.id
this.getRoleData(id)
this.getMerchantTree(id)
},
methods: {
// 获取角色信息
getRoleData(id) {
this.$apis.role.roleInfoData({ id }).then(res => {
this.roleInfo = res
})
},
// 获取商户树
getMerchantTree(id) {
this.$apis.role.roleTreeDataById({ id }).then(res => {
this.rootList = res
this.productList = this.rootList[0].products || []
})
},
selectRootItem(index) {
this.curRootIndex = index
this.productList = this.rootList[index].products || []
},
selectProductItem(index) {
this.curProductIndex = index
},
toBack() {
history.go(-1)
}
}
}
</script>
<style lang="scss" scoped>
.role-create-page {
height: 100%;
width: 100%;
}
.top_title_widget {
width: 100%;
height: 58px;
box-sizing: border-box;
padding: 0 20px;
border-bottom: 1px solid #d8d8d8;
display: flex;
align-items: center;
justify-content: space-between;
background: #ffffff;
.title {
font-size: 16px;
font-weight: 500;
color: #424242;
}
.store_title {
font-size: 14px;
font-weight: 500;
color: #333333;
}
}
.info_widget {
background: #ffffff;
height: 158px;
box-sizing: border-box;
padding: 20px 0 0 52px;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
.info_line_wrap {
display: flex;
align-items: center;
margin-bottom: 24px;
.info_line_label {
width: 78px;
font-size: 14px;
font-weight: 400;
color: #333333;
text-align: right;
}
.infl_line_con {
font-size: 14px;
font-weight: 400;
color: #666666;
}
}
}
.main_widget {
margin-top: 20px;
width: 100%;
min-height: calc(100% - 300px);
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
.main_title {
width: 100%;
box-sizing: border-box;
padding: 20px;
font-size: 16px;
font-weight: 500;
color: #333333;
}
.wrapper {
box-sizing: border-box;
padding: 0 20px;
.menu_line_one {
width: 100%;
height: 36px;
background: #f4f6fc;
border-radius: 4px;
display: flex;
align-items: center;
.line_element {
// width: 180px;
padding: 0 55px;
height: 32px;
text-align: center;
line-height: 32px;
font-size: 14px;
font-weight: 400;
color: #333333;
cursor: pointer;
}
.line_element_active {
background: #ffffff;
border-radius: 2px;
color: #5850ff;
}
}
.main_body {
width: 100%;
// height: calc(100% - 36px);
background: #f4f6fc;
border-radius: 4px;
box-sizing: border-box;
padding: 10px;
.menu_line_two {
display: flex;
align-items: center;
.line_element_two {
// width: 111px;
padding: 0 38px;
height: 40px;
text-align: center;
line-height: 40px;
background: #ffffff;
border-radius: 4px 0px 0px 0px;
border: 1px solid #f4f6fc;
color: #37383a;
font-size: 14px;
font-weight: 400;
cursor: pointer;
}
.line_element_two_active {
color: #322ad9;
}
}
.tree_widget {
width: 100%;
// height: calc(100% - 40px);
background: #ffffff;
border-radius: 0px 4px 4px 4px;
}
.tree_widget /deep/ .el-tree-node__expand-icon {
// content: "\e6d9";
color: #5850ff;
}
.tree_widget /deep/ .el-tree-node__expand-icon.is-leaf {
color: transparent;
}
.no_data_icon {
height: 150px;
display: flex;
align-items: center;
justify-content: center;
.nodata_wrap {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.icon {
width: 64px;
height: 41px;
}
.text {
font-size: 14px;
font-weight: 400;
color: #262626;
margin-top: 10px;
}
}
}
}
}
}
.fixed_bottom {
position: fixed;
left: 0;
right: 0;
bottom: 0;
// width: calc(100% - 60px);
width: 100%;
height: 64px;
background: #ffffff;
display: flex;
align-items: center;
justify-content: center;
.wrap_driver {
margin: 0 40px;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!