Commit 3bca3c33 by 李长胜

合并

2 parents b84cb127 5976cb3d
......@@ -12,12 +12,10 @@
"cnpm": "^7.1.0",
"core-js": "^3.4.4",
"glsx-common": "^1.4.6",
"glsx-components": "^1.1.2",
"glsx-components": "^1.1.8",
"glsx-table": "^1.0.9",
"vue": "^2.6.11",
"vue-amap": "^0.5.10",
"vue-loader": "^15.9.8",
"vue-template-compiler": "^2.6.14"
"vue-amap": "^0.5.10"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0",
......@@ -32,7 +30,7 @@
"eslint": "^5.16.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-vue": "^5.0.0",
"glsx-components": "^1.1.2",
"glsx-components": "^1.1.8",
"node-sass": "^4.14.1",
"prettier": "^1.19.1",
"sass-loader": "^8.0.0",
......
......@@ -8,7 +8,7 @@
*/
import { http_config } from '@/main'
const getMerchantTree = params => {
params.method = 'org.ore.api.common.findMerchantTreeByMerchantNo.list'
params.method = 'entmicro.api.common.findMerchantTreeByMerchantNo.list'
return http_config({
url: '/rop-scrm-entmicro/router',
method: 'POST',
......@@ -17,7 +17,7 @@ const getMerchantTree = params => {
})
}
const getDepartment = params => {
params.method = 'cn.com.glsx.entmicro.department.listDepartmentTree'
params.method = 'entmicro.api.department.listDepartmentTree'
return http_config({
url: '/rop-scrm-entmicro/router',
method: 'POST',
......@@ -26,7 +26,7 @@ const getDepartment = params => {
})
}
const toGL = params => {
params.method = 'org.ore.api.common.relevanceEntmicro.list'
params.method = 'entmicro.api.common.relevanceEntmicro.list'
return http_config({
url: '/rop-scrm-entmicro/router',
method: 'POST',
......@@ -35,7 +35,7 @@ const toGL = params => {
})
}
const merchantInfo = params => {
params.method = 'org.ore.api.common.findMerchantInfoByMerchantNo.list'
params.method = 'entmicro.api.common.findMerchantInfoByMerchantNo.list'
return http_config({
url: '/rop-scrm-entmicro/router',
method: 'POST',
......
import { http } from '@/main'
var defaultPath = 'cn.com.glsx.merchants.'
var defaultPath = 'merchants.api.'
const getListApi = params => {
params.method = `${defaultPath}staff.findStaffByPage`
......@@ -22,7 +22,7 @@ const getAllMerchantListApi = params => {
}
const getRoleListApi = params => {
params.method = 'org.ore.api.role.list'
params.method = 'merchants.api.role.list'
return http({
url: '/rop-merchants/router',
method: 'POST',
......
......@@ -9,7 +9,7 @@
import { http } from '@/main'
export function getThirdTable(params) {
params.method = 'cn.com.glsx.merchants.menu.findLog'
params.method = 'merchants.api.menu.findLog'
return http({
url: '/rop-merchants/router',
......@@ -19,7 +19,7 @@ export function getThirdTable(params) {
})
}
// const getThirdTable =(params)=>{
// params.method = 'cn.com.glsx.merchants.menu.findLog'
// params.method = 'merchants.api.menu.findLog'
// return http({
// url: '/rop-merchants/router',
......@@ -31,7 +31,7 @@ export function getThirdTable(params) {
// }
//获取功能权限树
const findMenuFunTreeByMerId = params => {
params.method = 'cn.com.glsx.merchants.merchant.findMenuFunTreeByMerId'
params.method = 'merchants.api.merchant.findMenuFunTreeByMerId'
return http({
url: '/rop-merchants/router',
......@@ -42,7 +42,7 @@ const findMenuFunTreeByMerId = params => {
}
//获取商户信息
const getFirstInfo = params => {
params.method = 'cn.com.glsx.merchants.merchant.findMerchantDetail'
params.method = 'merchants.api.merchant.findMerchantDetail'
return http({
url: '/rop-merchants/router',
......@@ -53,7 +53,7 @@ const getFirstInfo = params => {
}
//获取上下级信息
const getSecondInfo = params => {
params.method = 'cn.com.glsx.merchants.menu.findSubordinateRelationship'
params.method = 'merchants.api.menu.findSubordinateRelationship'
return http({
url: '/rop-merchants/router',
......@@ -63,7 +63,7 @@ const getSecondInfo = params => {
})
}
const getSecondTree = params => {
params.method = 'cn.com.glsx.merchants.merchant.findMerchantTree'
params.method = 'merchants.api.merchant.findMerchantTree'
return http({
url: '/rop-merchants/router',
......@@ -73,7 +73,7 @@ const getSecondTree = params => {
})
}
const getSecondTable = params => {
params.method = 'cn.com.glsx.merchants.staff.findMerchantStaffList'
params.method = 'merchants.api.staff.findMerchantStaffList'
return http({
url: '/rop-merchants/router',
......
......@@ -8,7 +8,7 @@
*/
import { http } from '@/main'
const roleDataList = params => {
params.method = 'org.ore.api.role.page'
params.method = 'merchants.api.role.page'
return http({
url: '/rop-merchants/router',
method: 'POST',
......@@ -17,7 +17,7 @@ const roleDataList = params => {
})
}
const merchantDataList = params => {
params.method = 'cn.com.glsx.merchants.menu.findAllMerchant'
params.method = 'merchants.api.menu.findAllMerchant'
return http({
url: '/rop-merchants/router',
method: 'POST',
......@@ -26,7 +26,7 @@ const merchantDataList = params => {
})
}
const roleInfoData = params => {
params.method = 'org.ore.api.role.getById'
params.method = 'merchants.api.role.getById'
return http({
url: '/rop-merchants/router',
method: 'POST',
......@@ -35,7 +35,7 @@ const roleInfoData = params => {
})
}
const roleTreeDataById = params => {
params.method = 'cn.com.glsx.merchants.merchant.findMenuFunTreeByRoleId'
params.method = 'merchants.api.merchant.findMenuFunTreeByRoleId'
return http({
url: '/rop-merchants/router',
method: 'POST',
......@@ -44,7 +44,7 @@ const roleTreeDataById = params => {
})
}
const merchantRootById = params => {
params.method = 'cn.com.glsx.merchants.merchant.findMenuFunTreeByMerId'
params.method = 'merchants.api.merchant.findMenuFunTreeByMerId'
return http({
url: '/rop-merchants/router',
method: 'POST',
......@@ -53,7 +53,7 @@ const merchantRootById = params => {
})
}
const createRole = params => {
params.method = 'org.ore.api.role.insert'
params.method = 'merchants.api.role.insert'
return http({
url: '/rop-merchants/router',
method: 'POST',
......@@ -62,7 +62,7 @@ const createRole = params => {
})
}
const updateRole = params => {
params.method = 'org.ore.api.role.update'
params.method = 'merchants.api.role.update'
return http({
url: '/rop-merchants/router',
method: 'POST',
......@@ -71,7 +71,7 @@ const updateRole = params => {
})
}
const deleteRole = params => {
params.method = 'org.ore.api.role.deleteById'
params.method = 'merchants.api.role.deleteById'
return http({
url: '/rop-merchants/router',
method: 'POST',
......
......@@ -8,7 +8,7 @@
*/
import { http } from '@/main'
const findMerchantByPage = params => {
params.method = 'cn.com.glsx.merchants.menu.findMerchantByPage'
params.method = 'merchants.api.menu.findMerchantByPage'
return http({
url: '/rop-merchants/router',
method: 'POST',
......@@ -17,7 +17,7 @@ const findMerchantByPage = params => {
})
}
const findAllDictData = params => {
params.method = 'cn.com.glsx.merchants.menu.findAllDictData'
params.method = 'merchants.api.menu.findAllDictData'
return http({
url: '/rop-merchants/router',
method: 'POST',
......@@ -27,7 +27,7 @@ const findAllDictData = params => {
}
//主营品牌
const getCarbrandTree = params => {
params.method = 'cn.com.glsx.merchants.merchantCommon.getCarbrandTree'
params.method = 'merchants.api.merchantCommon.getCarbrandTree'
return http({
url: '/rop-merchants/router',
method: 'POST',
......@@ -37,7 +37,7 @@ const getCarbrandTree = params => {
}
//详情
const findMerchantDetail = params => {
params.method = 'cn.com.glsx.merchants.merchant.findMerchantDetail'
params.method = 'merchants.api.merchant.findMerchantDetail'
return http({
url: '/rop-merchants/router',
method: 'POST',
......@@ -47,7 +47,7 @@ const findMerchantDetail = params => {
}
//下一步
const saveMerchant = params => {
params.method = 'cn.com.glsx.merchants.merchant.saveMerchant'
params.method = 'merchants.api.merchant.saveMerchant'
return http({
url: '/rop-merchants/router',
method: 'POST',
......@@ -56,7 +56,7 @@ const saveMerchant = params => {
})
}
const updateMerchant = params => {
params.method = 'cn.com.glsx.merchants.merchant.updateMerchant'
params.method = 'merchants.api.merchant.updateMerchant'
return http({
url: '/rop-merchants/router',
method: 'POST',
......@@ -65,7 +65,7 @@ const updateMerchant = params => {
})
}
const accountTypeSearchRequest = params => {
params.method = 'cn.com.glsx.merchants.merchant.accountTypeSearchRequest'
params.method = 'merchants.api.merchant.accountTypeSearchRequest'
return http({
url: '/rop-merchants/router',
method: 'POST',
......@@ -75,7 +75,7 @@ const accountTypeSearchRequest = params => {
}
//功能权限
const findPermissionsByMerId = params => {
params.method = 'cn.com.glsx.merchants.merchant.findPermissionsByMerId'
params.method = 'merchants.api.merchant.findPermissionsByMerId'
return http({
url: '/rop-merchants/router',
method: 'POST',
......@@ -85,7 +85,7 @@ const findPermissionsByMerId = params => {
}
//功能权限
const findMenuFunTreeByMerId = params => {
params.method = 'cn.com.glsx.merchants.merchant.findMenuFunTreeByMerId'
params.method = 'merchants.api.merchant.findMenuFunTreeByMerId'
return http({
url: '/rop-merchants/router',
method: 'POST',
......@@ -95,7 +95,7 @@ const findMenuFunTreeByMerId = params => {
}
//草稿保存
const updatePermissions = params => {
params.method = 'cn.com.glsx.merchants.merchant.updatePermissions'
params.method = 'merchants.api.merchant.updatePermissions'
return http({
url: '/rop-merchants/router',
method: 'POST',
......
......@@ -131,7 +131,7 @@ img {
::-webkit-scrollbar {
/*滚动条整体样式*/
width: 6px;
height: 1px;
height: 4px;
}
::-webkit-scrollbar-thumb {
......
<template>
<div class="map-box" :style="{height: mapHeight+ 'px'}">
<div class="map-box" :style="{ height: mapHeight + 'px' }">
<div id="container" style="width: 100%; height: 100%"></div>
<div class="map-address">{{ address }}</div>
<div id="myPageTop" style="position: absolute; top: 10px; width: 50%; left: 25%">
......@@ -11,10 +11,9 @@
</template>
<script>
import AMap from "AMap";
let map, placeSearch;
let map, marker, placeSearch
export default {
name: "map",
name: 'map',
props: {
mapHeight: {
type: Number,
......@@ -24,76 +23,95 @@ export default {
data() {
return {
input: "",
address: "",
lnglat: [],
};
input: '',
address: '',
lnglat: []
}
},
methods: {
mapInit() {
map = new AMap.Map("container", {
map = new AMap.Map('container', {
resizeEnable: true,
zoom: 10,
});
AMap.plugin(["AMap.PlaceSearch"], function () {
zoom: 20
})
AMap.plugin(['AMap.PlaceSearch'], function () {
//构造地点查询类
placeSearch = new AMap.PlaceSearch({
pageSize: 8, // 单页显示结果条数
pageIndex: 1, // 页码
citylimit: false, //是否强制限制在设置的城市内搜索
map: map, // 展现结果的地图实例
// panel: "panel", // 结果列表将在此容器中进行展示。
autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
renderStyle: "default",
});
});
renderStyle: 'default'
})
})
// 添加列表点选监听事件
map.on("click", this.getAddress);
placeSearch.on("markerClick", this.getAddress);
map.on('click', this.getAddress)
},
searchAddress() {
let _this = this
placeSearch.search(this.input, function (status, result) {
console.log(result)
if (status === 'complete' && result.poiList.pois.length) {
let lnglat = result.poiList.pois[0].location
_this.getAddress(lnglat)
}
})
},
addMarker(lnglat) {
let position
if (lnglat.lng) {
position = [lnglat.lng, lnglat.lat]
} else {
position = lnglat
}
console.log(position)
marker = new AMap.Marker({
icon: new AMap.Icon({
image: '//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png',
size: new AMap.Size(27, 34), //图标大小
imageSize: new AMap.Size(27, 34)
}),
position: position,
offset: new AMap.Pixel(-10, -10)
})
map.add(marker);
map.setFitView();
},
// addMarker(lnglat) {
// let position = [lnglat.lng,lnglat.lat]
// const marker = new AMap.Marker({
// icon: "//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png",
// position,
// offset: new AMap.Pixel(-13, -30)
// });
// marker.setMap(map);
// },
getAddress(e) {
console.log(e)
let self = this;
let lnglat;
if (e.type == "click") {
let self = this
let lnglat
if (e.type == 'click') {
lnglat = e.lnglat
} else {
let { lng, lat } = e.data.entr_location?e.data.entr_location:e.data.location;
lnglat = [lng, lat];
let { lng, lat } = e
lnglat = [lng, lat]
}
if (marker) {
marker.setMap(null)
marker = null
}
self.addMarker(lnglat)
AMap.plugin("AMap.Geocoder", () => {
const geocoder = new AMap.Geocoder();
geocoder.getAddress(lnglat, (status, result) => {
self.lnglat = lnglat;
self.address = result.regeocode.formattedAddress;
});
});
},
searchAddress() {
placeSearch.search(this.input, function (status, result) {
if (status == "complete") {
// console.log(result.poiList.pois);
}
});
AMap.plugin('AMap.Geocoder', () => {
const geocoder = new AMap.Geocoder()
geocoder.getAddress(lnglat, (status, result) => {
self.lnglat = lnglat
self.address = result.regeocode.formattedAddress
})
})
},
selectAddress(e) {
//这里获得点选地点的经纬度
this.getAddress();
this.getAddress()
}
},
mounted() {
this.mapInit();
this.mapInit()
}
};
}
</script>
<style scoped lang="scss">
......
......@@ -12,16 +12,15 @@ import apis from './api'
import './public-path'
// import 'glsx-components/dist/glsx-components.css'
import { start } from '@/setup'
// import VueAMap from "vue-amap";
import VueAMap from "vue-amap";
import filters from './utils/filters' //新增过滤器
// Vue.use(VueAMap);
// // 初始化vue-amap
// VueAMap.initAMapApiLoader({
// key: "bd290dc27d0945959280753215ddda71", // 这里写你申请的高德地图的key
// plugin: ["AMap.Autocomplete", "AMap.Geocoder", "AMap.Geolocation"],
// v: "1.4.15",
// uiVersion: "1.1"
// });
Vue.use(VueAMap);
// 初始化vue-amap
VueAMap.initAMapApiLoader({
key: "bd290dc27d0945959280753215ddda71", // 这里写你申请的高德地图的key
plugin: ["AMap.PlaceSearch", "AMap.Geocoder", "AMap.Geolocation"],
v: "1.4.15"
});
Vue.config.productionTip = false
Vue.prototype.$apis = apis
start()
......
......@@ -25,9 +25,83 @@ util.checkPhone = function(mobile) {
/**
* 校验手机号码格式
*/
util.checkisCard = function(card) {
let myreg = /^(^\d{15}$)|(^\d{17}([0-9]|X)$)/;
return myreg.test(card);
util.checkIdCard = function(code) {
var city = {
11: '北京',
12: '天津',
13: '河北',
14: '山西',
15: '内蒙古',
21: '辽宁',
22: '吉林',
23: '黑龙江',
31: '上海',
32: '江苏',
33: '浙江',
34: '安徽',
35: '福建',
36: '江西',
37: '山东',
41: '河南',
42: '湖北',
43: '湖南',
44: '广东',
45: '广西',
46: '海南',
50: '重庆',
51: '四川',
52: '贵州',
53: '云南',
54: '西藏',
61: '陕西',
62: '甘肃',
63: '青海',
64: '宁夏',
65: '新疆',
71: '台湾',
81: '香港',
82: '澳门',
91: '国外 '
}
// var tip = ''
var pass = true
// 身份证位数为15或18位
// if (![15, 18].includes(code.length)) {
if (!((code.length == 15) || (code.length == 18))) {
pass = false
} else if (!code || (code.length === 18 && !/^\d{6}(18|19|20)\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(code))) {
// tip = '身份证号格式错误'
pass = false
} else if (code.length === 15 && !/^\d{6}\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}$/i.test(code)) {
pass = false
} else if (!city[code.substr(0, 2)]) {
// tip = '地址编码错误'
pass = false
} else {
// 18位身份证需要验证最后一位校验位
if (code.length === 18) {
code = code.split('')
// ∑(ai×Wi)(mod 11)
// 加权因子
var factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
// 校验位
var parity = [1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2]
var sum = 0
var ai = 0
var wi = 0
for (var i = 0; i < 17; i++) {
ai = code[i]
wi = factor[i]
sum += ai * wi
}
// var last = parity[sum % 11]
if (parity[sum % 11] != code[17]) {
// tip = '校验位错误'
pass = false
}
}
}
return pass
}
util.deepClone = function(obj) {
// Handle the 3 simple types, and null or undefined or function
......
......@@ -25,11 +25,14 @@
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="账户等级" class="level-row">
<el-select size="small" :disabled="nextStatus" v-model="accountDetail.merchantAccountLevel" placeholder="请选择">
<div class="el-form-item level-row is-required">
<label class="el-form-item__label" style="width: 120px">账户等级</label>
<div class="el-form-item__content" style="margin-left: 120px">
<el-select size="small" :disabled="nextStatus" v-model="accountDetail.merchantAccountLevel" placeholder="请选择">
<el-option v-for="item in accountLevel" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
</el-select>
</el-form-item>
</div>
</div>
</el-col>
</el-row>
<el-row>
......@@ -52,9 +55,7 @@
<div data-v-995a4ff0="" class="el-input el-input--small">
<auto-button v-for="(item, index) in accountDetail.accountTypes" :key="index" :btnLabel="item.accounttypeName" :btnValue="item.accounttypeId" :stopClick="nextStatus" @getBtnStatus="getBtnStatus"></auto-button>
</div>
<div class="el-form-item__error" v-if="accountTypesRule">
请选择账户类型
</div>
<div class="el-form-item__error" v-if="accountTypesRule">请选择账户类型</div>
</div>
</div>
</el-col>
......@@ -125,7 +126,7 @@ export default {
dialogMapVisible: false,
businessScopeCustomize: [{ name: '' }],
accountAddForm: {
status: 1,
status: '',
merchantFiles: [],
merchantType: 1,
businessScope: [],
......@@ -151,7 +152,7 @@ export default {
{ min: 3, max: 15, message: '长度在 3 到 15 个字符', trigger: 'blur' }
],
merchantLoginPassword: [
{ required: true, message: '请输入登录账户名', trigger: 'blur' },
{ required: true, message: '请输入登录密码', trigger: 'blur' },
{ min: 6, max: 15, message: '长度在 6 到 15 个字符', trigger: 'blur' }
]
}
......@@ -172,11 +173,12 @@ export default {
}
},
handleSave(status) {
if (this.$refs.productForm.getSelectInfo().length == 0) {
let product = this.$refs.productForm.getSelectInfo()
if (status == 2 && product && product.every(item => item.products.length == 0)) {
this.$message.error('请选择产品')
return
}
let accountTypes = JSON.stringify(this.$refs.productForm.getSelectInfo())
let accountTypes = JSON.stringify(product)
let params = {
accountTypes,
status,
......@@ -192,6 +194,7 @@ export default {
this.$router.push('/account/index')
},
handlePrev() {
document.querySelector('#app').scrollTop = 0
this.step = 1
},
//下一步
......@@ -199,19 +202,49 @@ export default {
const pm1 = new Promise((resolve, reject) => {
this.$refs.baseInfoForm.$refs.baseForm.validate(valid => {
if (valid) resolve()
else {
setTimeout(() => {
var isError = document.getElementsByClassName('is-error')
isError[0].querySelector('input').focus()
}, 100)
reject()
}
})
})
const pm2 = new Promise((resolve, reject) => {
this.$refs.accountInfoForm.validate(valid => {
if (valid) resolve()
else {
pm1.then(() => {
document.querySelector('#app').scrollTop = 1000
})
setTimeout(() => {
var isError = document.getElementsByClassName('is-error')
isError[0].querySelector('input').focus()
}, 100)
}
})
})
if (this.accounttypeId.length == 0) {
this.accountTypesRule = true
return
}
if (this.accountAddForm.merchantType == 1 && this.accountAddForm.merchantOrgcode && !util.checkisCard(this.accountAddForm.merchantOrgcode)) {
if (this.accountAddForm.merchantType == 1 && this.accountAddForm.merchantOrgcode && !util.checkIdCard(this.accountAddForm.merchantOrgcode)) {
this.$message.error('请输入正确的身份证号码')
document.querySelector('#app').scrollTop = 0
setTimeout(() => {
var isError = document.getElementsByClassName('card-input')
isError[0].querySelectorAll('.el-input__inner')[1].focus()
}, 100)
return
}
if (this.accountAddForm.residentPhone && !util.checkPhone(this.accountAddForm.residentPhone)) {
this.$message.error('请输入正确的驻店电话')
document.querySelector('#app').scrollTop = 0
setTimeout(() => {
var isError = document.getElementsByClassName('phone-input')
isError[0].querySelector('input').focus()
}, 100)
return
}
let params = Object.assign({}, this.accountAddForm, this.accountInfoForm)
......@@ -222,10 +255,11 @@ export default {
if (params.businessScope) {
params.businessScope = params.businessScope.join(',')
}
console.log(this.$refs.baseInfoForm)
params.merchantBrand = this.$refs.baseInfoForm.$refs.brandTree.getCheckedKeys().join(',')
params.isloginName ? (params.isloginName = 1) : (params.isloginName = 0)
params.merchantAccountLevel = this.accountDetail.merchantAccountLevel
params.status = 1
params.channelId = this.accountDetail.channelId
let businessScopeCustomize = this.businessScopeCustomize.map(item => item.name)
params.businessScopeCustomize = businessScopeCustomize.join(',')
params.accounttypeId = this.accounttypeId.join(',')
......@@ -238,6 +272,7 @@ export default {
} else {
merchant = 'saveMerchant'
}
document.querySelector('#app').scrollTop = 0
Promise.all([pm1, pm2]).then(() => {
this.$apis.store[merchant](params).then(res => {
if (res) {
......@@ -315,6 +350,7 @@ export default {
},
mounted() {
document.querySelector('#app').scrollTop = 0
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.accountAddForm.parentId = this.$route.params.id
......@@ -323,7 +359,7 @@ export default {
this.findAllDictData('business_scope')
}
}
</script>
</script>
<style scoped lang="scss">
.account-header {
......
......@@ -23,7 +23,9 @@
<div v-for="(itm, idx) in item.products" :key="idx">
<div class="nodata" v-if="item.productsArr.length == 0 || itm.merchantProTreeResponses.length == 0">
<img src="../../../assets/img/empty.png" alt="" />
<div>{{ item.productsArr.length == 0 ? '请先选择产品' : '暂无菜单权限' }}</div>
<div>
{{ item.productsArr.length == 0 ? '请先选择产品' : '暂无菜单权限' }}
</div>
</div>
<div v-else>
<el-tree v-show="productTab == itm.productId" :data="itm.merchantProTreeResponses" show-checkbox check-strictly check-on-click-node :expand-on-click-node="false" default-expand-all node-key="id" :class="'tree_' + item.accounttypeId + '_' + itm.productId" :ref="`tree_${item.accounttypeId}_${itm.productId}`" highlight-current :render-content="renderContent" :props="defaultProps" @check="clickDeal"></el-tree>
......@@ -72,7 +74,8 @@ export default {
handleClik(tab, event) {
console.log(tab, event)
const tabId = tab.name
this.productTab = this.tabMenu.find(i => i.accounttypeId == tabId).productsArr[0].productId
const productTab = this.tabMenu.find(i => i.accounttypeId == tabId)
this.productTab = productTab.productsArr[0] ? productTab.productsArr[0].productId : ''
},
selectPro(data) {
this.$parent.editStatus = true
......@@ -82,6 +85,12 @@ export default {
// 设置全选
var arr = tabMenu.find(i => i.accounttypeId == tabName).products.find(j => j.productId == productTab).merchantProTreeResponses
this.$refs[`tree_${tabName}_${productTab}`][0].setCheckedKeys(this.getAllId(arr))
<<<<<<< HEAD
=======
this.$nextTick(() => {
this.addStyle()
})
>>>>>>> 5976cb3d089419441f95a76aa2178b88c9859e2b
},
productClick(productId) {
this.productTab = productId
......@@ -121,31 +130,30 @@ export default {
} else {
account = 'accountTypeSearchRequest'
}
let tabMenu = await this.$apis.store[account](params)
this.accountList = tabMenu.map(item => {
return {
productsArr: [],
products: item.products,
accounttypeName: item.accounttypeName,
accounttypeId: item.accounttypeId
// merchantProTreeResponses: item.merchantProTreeResponses,
// productId: ''
}
})
this.$nextTick(() => {
this.addStyle()
})
console.log(this.accountList)
this.accountTypes = tabMenu.map(item => {
return {
products: null,
accounttypeId: item.accounttypeId
}
this.$apis.store[account](params).then(res => {
console.log(res)
let tabMenu = res
this.accountList = tabMenu.map(item => {
return {
productsArr: [],
products: item.products,
accounttypeName: item.accounttypeName,
accounttypeId: item.accounttypeId
// merchantProTreeResponses: item.merchantProTreeResponses,
// productId: ''
}
})
console.log(this.accountList)
this.accountTypes = tabMenu.map(item => {
return {
products: null,
accounttypeId: item.accounttypeId
}
})
this.tabMenu_s = util.deepClone(this.accountList)
this.findPermissionsByMerId(params.merchantId ? params.merchantId : params.id)
})
this.tabMenu_s = util.deepClone(this.accountList)
// this.tabName = this.tabMenu[0].accounttypeId
this.findPermissionsByMerId(params.merchantId ? params.merchantId : params.id)
return this.accountList
},
// 获取已选择的权限
findPermissionsByMerId(id) {
......@@ -153,7 +161,6 @@ export default {
id
}
this.$apis.store.findPermissionsByMerId(params).then(res => {
this.loading = false
this.tabMenu_x = util.deepClone(res)
res.forEach(item => {
console.log(item)
......@@ -167,6 +174,7 @@ export default {
itm.productsArr.push(j)
this.$nextTick(() => {
this.$refs[`tree_${itm.accounttypeId}_${j.productId}`][0].setCheckedKeys(i.menuIds)
this.addStyle()
})
}
})
......@@ -174,6 +182,7 @@ export default {
}
})
})
this.loading = false
this.tabName = this.tabMenu[0].accounttypeId
this.productTab = this.tabMenu[0].productsArr[0].productId
// const arr = res.map(i => i.accounttypeId)
......@@ -194,7 +203,7 @@ export default {
if (i.productId == j.productId) {
itm.productsArr.push(j)
this.$nextTick(() => {
this.$refs[`tree_${itm.accounttypeId}_${j.productId}`][0].setCheckedKeys(i.menuIds)
this.$refs[`tree_${itm.accounttypeId}_${j.productId}`] ? this.$refs[`tree_${itm.accounttypeId}_${j.productId}`][0].setCheckedKeys(i.menuIds) : ''
})
}
})
......@@ -222,7 +231,7 @@ export default {
addStyle() {
const nodes = document.getElementsByClassName('fun-tree-node')
for (let i = 0; i < nodes.length; i++) {
const parentNode = nodes[i].parentNode
const parentNode = nodes[i].parentNode.parentNode
parentNode.style.float = 'left'
}
},
......@@ -333,18 +342,26 @@ export default {
/** { menuId, id, functionValue} */
if (functionValueIdLists.length !== 0) {
functionValueIdLists.forEach((j, index) => {
if (list.map(item => item.id).includes(j.parentId)) {
const obj = list.find(k => k.id === j.parentId)
if (list.map(item => item.functionId).includes(j.parentId)) {
const obj = list.find(k => k.functionId === j.parentId)
obj.functionValue += ';' + j.id + ':' + j.label
} else {
list.push({
id: j.parentId,
functionId: j.parentId,
menuId: j.superParentId,
functionValue: j.id + ':' + j.label
})
}
})
}
if (functionIdList.length !== 0) {
functionIdList.forEach(i => {
list.push({
functionId: i.parentId,
menuId: i.superParentId
})
})
}
console.log(menuIdList, functionIdList, functionValueIdLists, list)
if (this.roleType) {
productList.push({
......@@ -356,8 +373,8 @@ export default {
} else {
products.push({
productId: itm.productId,
functionIds: functionIdList,
functionValue: list,
functionIds: list,
// functionValue: list,
menuIds: menuIdList
})
}
......@@ -374,6 +391,7 @@ export default {
}
}
})
console.log(this.accountTypes)
return this.accountTypes
}
},
......@@ -481,4 +499,4 @@ export default {
margin-bottom: 12px;
}
}
</style>
</style>
\ No newline at end of file
......@@ -241,7 +241,8 @@ export default {
{ required: true, message: "请输入登录账户名", trigger: "blur" },
],
merchantLoginPassword: [
{ required: true, message: "请输入登录账户名", trigger: "blur" },
{ required: true, message: "请输入登录密码", trigger: "blur" },
{ min: 6, max: 15, message: "长度在 6 到 15 个字符", trigger: "blur" },
],
},
};
......@@ -266,13 +267,13 @@ export default {
methods: {
hanleTab(status) {
if (this.editStatus) {
this.$confirm("离开将不保存本页修改", "提示", {
this.$confirm("是否保存修改信息?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.handleNext(status);
status == 1? this.handleNext(status):this.handleSave(status);
})
.catch(() => {
this.tabCancel(status);
......@@ -306,7 +307,8 @@ export default {
},
//保存
handleSave(status) {
if (this.$refs.productForm.getSelectInfo().length == 0) {
let product = this.$refs.productForm.getSelectInfo();
if (product && product.every((item) => item.products.length == 0)) {
this.$message.error("请选择产品");
return;
}
......@@ -317,9 +319,9 @@ export default {
merchantId: this.accountAddForm.id,
};
this.$apis.store.updatePermissions(params).then((res) => {
if (res) {
status ? this.handleTabs(status) : this.$router.push("/account/index");
}
if (res) {
status ? this.handleTabs(status) : this.$router.push("/account/index");
}
});
},
//下一步
......@@ -327,17 +329,53 @@ export default {
const pm1 = new Promise((resolve, reject) => {
this.$refs.baseInfoForm.$refs.baseForm.validate((valid) => {
if (valid) resolve();
setTimeout(() => {
var isError = document.getElementsByClassName("is-error");
isError[0].querySelector("input").focus();
}, 100);
});
});
const pm2 = new Promise((resolve, reject) => {
this.$refs.accountInfoForm.validate((valid) => {
if (valid) resolve();
setTimeout(() => {
var isError = document.getElementsByClassName("is-error");
isError[0].querySelector("input").focus();
}, 100);
});
});
if (
this.accountAddForm.merchantType == 1 &&
this.accountAddForm.merchantOrgcode &&
!util.checkIdCard(this.accountAddForm.merchantOrgcode)
) {
this.$message.error("请输入正确的身份证号码");
document.querySelector("#app").scrollTop = 0;
setTimeout(() => {
var isError = document.getElementsByClassName("card-input");
isError[0].querySelectorAll(".el-input__inner")[1].focus();
}, 100);
return;
}
if (
this.accountAddForm.residentPhone &&
!util.checkPhone(this.accountAddForm.residentPhone)
) {
this.$message.error("请输入正确的驻店电话");
document.querySelector("#app").scrollTop = 0;
setTimeout(() => {
var isError = document.getElementsByClassName("phone-input");
isError[0].querySelector("input").focus();
}, 100);
return;
}
let params = Object.assign({}, this.accountAddForm, this.accountInfoForm);
if (params.bussinessTime) {
params.bussinessBegintime = params.bussinessTime[0];
params.bussinessEndtime = params.bussinessTime[1];
} else {
params.bussinessBegintime = "";
params.bussinessEndtime = "";
}
if (params.businessScope) {
params.businessScope = params.businessScope.join(",");
......@@ -379,13 +417,13 @@ export default {
para = {
id: this.accountAddForm.id,
parentId: res.parentId,
accountLevel: res.merchantAccountLevel,
accountlevel: res.merchantAccountLevel,
};
} else {
para = {
ids: res.accountType,
merchantId: res.id,
accountLevel: res.merchantAccountLevel,
accountlevel: res.merchantAccountLevel,
};
}
this.$refs.productForm.accountTypeSearchRequest(para, res.parentMerchant);
......@@ -418,7 +456,11 @@ export default {
merchantFileResponses,
merchantModel,
accountTypes,
accountType,
accounttypeId,
channelId,
status,
parentId,
} = res;
this.accountInfoForm.merchantLoginAccount = merchantLoginAccount;
this.accountInfoForm.merchantLoginPassword = merchantLoginPassword;
......@@ -441,10 +483,12 @@ export default {
name: item,
};
});
}else {
this.businessScopeCustomize = [{name:''}];
}
accounttypeId = accounttypeId ? accounttypeId.split(",") : [];
if (accounttypeId.length > 0) {
this.accounttypeId = accounttypeId.map((item) => {
this.accounttypeId = accountType ? accountType.split(",") : [];
if (this.accounttypeId.length > 0) {
this.accounttypeId = this.accounttypeId.map((item) => {
return {
name: item,
};
......@@ -477,8 +521,14 @@ export default {
residentPhone,
merchantAccountLevel,
merchantModel,
parentId,
channelId,
status,
accounttypeId: accountType,
});
this.$nextTick(() => {
this.$refs.baseInfoForm.$refs.baseForm.validate();
this.editStatus = false;
});
},
......@@ -489,6 +539,7 @@ export default {
},
},
mounted() {
document.querySelector("#app").scrollTop = 0;
this.footerLeft = document.querySelector(".base-container-right").offsetLeft;
this.footerWidth = document.documentElement.clientWidth - this.footerLeft;
this.accountAddForm.id = this.$route.params.id;
......
<template>
<div class="scrm-main">
<div class="form-header" v-if="$globalState.session.accountLevel == 1">
<el-button type="primary" @click="handleContact" size="small" icon="el-icon-link">门店账户关联企微</el-button>
<div class="form-header" v-if="$globalState.session.accountLevel == 1 && $globalState.session.merchantModel == 1">
<el-button type="primary" @click="handleContact" size="small" icon="el-icon-link"
>门店账户关联企微</el-button
>
</div>
<div class="follow-form">
<el-form :inline="true" :model="searchForm" class="follow-form-item" label-width="80px">
......@@ -12,14 +14,36 @@
</el-select>
</el-form-item>
<el-form-item class="merchant-row" size="small">
<el-input size="small" v-model="searchForm.merchantLoginAccount" placeholder="请输入" v-if="searchForm.accountOrPhone == 1">
<el-select size="small" v-model="searchForm.accountOrPhone" slot="prepend" placeholder="请选择">
<el-input
size="small"
v-model="searchForm.merchantLoginAccount"
placeholder="请输入"
v-if="searchForm.accountOrPhone == 1"
>
<el-select
size="small"
v-model="searchForm.accountOrPhone"
@change="searchForm.merchantLoginAccount = '';searchForm.merchantLegalPersonPhone = ''"
slot="prepend"
placeholder="请选择"
>
<el-option label="登录账户名" :value="1"></el-option>
<el-option label="手机号" :value="2"></el-option>
</el-select>
</el-input>
<el-input size="small" v-model="searchForm.merchantLegalPersonPhone" placeholder="请输入" v-if="searchForm.accountOrPhone == 2">
<el-select size="small" v-model="searchForm.accountOrPhone" slot="prepend" placeholder="请选择">
<el-input
size="small"
v-model="searchForm.merchantLegalPersonPhone"
placeholder="请输入"
v-if="searchForm.accountOrPhone == 2"
>
<el-select
size="small"
v-model="searchForm.accountOrPhone"
slot="prepend"
@change="searchForm.merchantLoginAccount = '';searchForm.merchantLegalPersonPhone = ''"
placeholder="请选择"
>
<el-option label="登录账户名" :value="1"></el-option>
<el-option label="手机号" :value="2"></el-option>
</el-select>
......@@ -106,11 +130,11 @@ export default {
prop: 'merchantName'
},
{
label: '关联的企业微信',
prop: 'entmicroName',
formatter: cellValue => {
return cellValue.entmicroName ? cellValue.entmicroName : '--'
}
label: "关联的企业微信",
prop: "entmicroName",
formatter: (cellValue) => {
return cellValue.entmicroName ? cellValue.entmicroName : "-";
},
},
{
label: '账户类型',
......@@ -127,8 +151,11 @@ export default {
width: '80px'
},
{
label: '上级商户',
prop: 'parentMerchant'
label: "上级商户",
prop: "parentMerchant",
formatter: (cellValue) => {
return cellValue.parentMerchant ? cellValue.parentMerchant : "-";
},
},
{
label: '账户状态',
......@@ -136,11 +163,11 @@ export default {
width: '80px'
},
{
label: '联系人',
prop: 'merchantLegalPerson',
formatter: cellValue => {
return cellValue.merchantLegalPerson ? cellValue.merchantLegalPerson : '--'
}
label: "联系人",
prop: "merchantLegalPerson",
formatter: (cellValue) => {
return cellValue.merchantLegalPerson ? cellValue.merchantLegalPerson : "-";
},
},
{
label: '手机号',
......@@ -148,10 +175,10 @@ export default {
width: '120px'
},
{
label: '更新时间',
prop: 'updatedTime'
}
]
label: "更新时间",
prop: "updatedTime",
},
],
},
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableData: [],
......@@ -177,14 +204,14 @@ export default {
}
this.$apis.store.findAllDictData(params).then(res => {
if (res) {
if (dictType == 'account_level') {
this.accountLevel = res
if (dictType == "account_level") {
this.accountLevel = [{ dictValue: "", dictLabel: "全部" }].concat(res);
}
if (dictType == 'account_type') {
this.accountType = res
}
if (dictType == 'merchant_status') {
this.merchantStatus = res
if (dictType == "merchant_status") {
this.merchantStatus = [{ dictValue: "", dictLabel: "全部" }].concat(res);
}
}
})
......
......@@ -5,6 +5,58 @@
<span class="min-title">关联之后不允许修改,请谨慎操作!</span>
</div>
<div class="page-wrapper">
<div class="box_wrap">
<div class="title">
<span>选择你要绑定的商户账户</span>
<img @mouseenter="showTip1 = true" @mouseleave="showTip1 = false" src="../../assets/img/question.png" />
</div>
<div class="select_wrapper">
<div class="label">商户账户</div>
<el-cascader ref="cascaderRef1" placeholder="请选择商户/门店" @change="getCurMerchant" :show-all-levels="false" v-model="shopName" :props="mypropParam1" :options="shopList" size="small" style="width: 320px" separator=" " filterable>
<template slot-scope="{ data }">
<el-tooltip popper-class="myToolTipClass" style="border: none" :disabled="data.label.length > 18 ? false : true" class="item" effect="light" :content="data.label" placement="top-end">
<div class="limitText" style="width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis">{{ data.label }}</div>
</el-tooltip>
</template>
</el-cascader>
</div>
<div v-if="showTip1" class="tipContentClass">
<div class="title">说明</div>
<p class="h20_title">只有账户状态正常的门店和商户才允许关联,如未开通,请联系您的专属顾问</p>
<div class="single"></div>
<div class="single1"></div>
</div>
</div>
<div class="icon_wrap">
<img src="../../assets/scrm_jh_icon.png" />
</div>
<div class="box_wrap">
<div class="title">
<span>选择你要绑定的企微门店</span>
<img @mouseenter="showTip2 = true" @mouseleave="showTip2 = false" src="../../assets/img/question.png" />
</div>
<div class="select_wrapper">
<div class="label">企业微信</div>
<el-cascader ref="cascaderRef" @change="getCurDepartment" placeholder="请选择企微门店" :show-all-levels="false" v-model="selectedDepartment" :props="mypropsParam" :options="departmentList" size="small" style="width: 320px" separator=" " filterable>
<template slot-scope="{ data }">
<el-tooltip popper-class="myToolTipClass" style="border: none" :disabled="data.departmentName.length > 18 ? false : true" class="item" effect="light" :content="data.departmentName" placement="top-end">
<div class="limitText" style="width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis">{{ data.departmentName }}</div>
</el-tooltip>
</template>
</el-cascader>
</div>
<div v-if="showTip2" class="tipContentClass">
<div class="title">说明</div>
<p class="h20_title">企业微信授权成功后,企业微信相关内容才会显示</p>
<div class="single"></div>
<div class="single1"></div>
</div>
</div>
<div class="icon_wrap">
<el-button type="purple" size="small" icon="el-icon-link" @click="handlerGL">关联</el-button>
</div>
</div>
<!-- <div class="page-wrapper">
<div class="wrap-title">
<span>选择你要绑定的商户/门店</span>
<span class="wrap-min-title">(只有账户状态正常的门店和商户才允许关联,如未开通,请联系您的专属顾问)</span>
......@@ -25,7 +77,7 @@
<div class="btn-wrap">
<el-button type="purple" size="small" icon="el-icon-link" @click="handlerGL">关联</el-button>
</div>
</div>
</div> -->
<div class="tbale-wrapper">
<div class="wrap-title">
<span>绑定的商户/门店</span>
......@@ -40,10 +92,13 @@
</div>
</div>
<div style="height: 64px"></div>
<div class="fixed-footer" :style="{
<div
class="fixed-footer"
:style="{
left: footerLeft + 'px',
width: footerWidth + 'px',
}">
width: footerWidth + 'px'
}"
>
<div :style="{ width: customWidth + 'px' }" class="btn-custom" @click="closeCurRouter">取消</div>
<div style="width: 20px"></div>
<div :style="{ width: customWidth + 'px' }" ref="btnWidth" class="btn-custom pruple" @click="handleMutiGL">确定关联({{ dataList.length }})</div>
......@@ -90,7 +145,9 @@ export default {
dataList: [],
customWidth: 113,
shopName: '',
selectedDepartment: ''
selectedDepartment: '',
showTip1: false,
showTip2: false
}
},
......@@ -125,13 +182,13 @@ export default {
this.$refs.cascaderRef.dropDownVisible = false
},
getDepartmentList() {
this.$apis.baseInfo.getDepartment({ id: 1 }).then(res => {
this.departmentList = this.traverse(1,res, 'relevanceMerchant')
this.$apis.baseInfo.getDepartment({ id: 1, flag: true }).then(res => {
this.departmentList = this.traverse(1, res, 'relevanceMerchant')
})
},
getMerchantList() {
this.$apis.baseInfo.getMerchantTree({}).then(res => {
this.shopList = this.traverse(2,res, 'entmicroName', 'merchantAccountLevel')
this.$apis.baseInfo.getMerchantTree({}).then(res => {
this.shopList = this.traverse(2, res, 'entmicroName', 'merchantAccountLevel')
})
},
// 关联当前选择的
......@@ -216,7 +273,7 @@ export default {
})
let all = [...arrpara1, ...arrpara2, ...arrpara3]
let para = Object.assign({}, ...all)
this.$apis.baseInfo.toGL(para).then(res => {
this.$apis.baseInfo.toGL(para).then(res => {
if (res) {
this.$message({
message: '操作成功',
......@@ -254,20 +311,20 @@ export default {
})
},
// 递归:处理层级数组
traverse(type,arr, string1, string2, arr1 = []) {
traverse(type, arr, string1, string2, arr1 = []) {
arr.map(item => {
if (item[string1] || (item[string2] != 4&&type==2)) {
if (item[string1] || (item[string2] != 4 && type == 2)) {
item.disabled = true
} else {
item.disabled = false
}
if (item.children && item.children instanceof Array) {
this.traverse(type,item.children, string1, string2, (arr1 = []))
this.traverse(type, item.children, string1, string2, (arr1 = []))
}
return arr1.push(item)
return item
})
return arr1
return arr
}
},
......@@ -277,10 +334,10 @@ export default {
},
mounted() {
this.footerLeft = document.querySelector(".base-container-right").offsetLeft;
this.footerWidth = document.documentElement.clientWidth - this.footerLeft;
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
}
};
}
</script>
<style lang="scss" scoped>
......@@ -302,12 +359,110 @@ export default {
}
.page-wrapper {
width: 100%;
height: 320px;
// height: 320px;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
box-sizing: border-box;
padding: 32px 0 0 20px;
// padding: 32px 0 0 20px;
padding: 20px 0 40px 40px;
margin-top: 20px;
display: flex;
.box_wrap {
width: 35%;
height: 100%;
position: relative;
.title {
font-size: 16px;
font-weight: 400;
color: #666666;
margin-bottom: 16px;
display: flex;
align-items: center;
> img {
cursor: pointer;
width: 14px;
height: 14px;
margin-left: 4px;
}
}
.select_wrapper {
display: flex;
align-items: center;
.label {
box-sizing: border-box;
padding-right: 10px;
font-size: 14px;
font-weight: 400;
color: #333333;
text-align: right;
}
}
.tipContentClass {
position: absolute;
right: -50px;
top: -15px;
width: 236px;
// height: 94px;
background: #ffffff;
box-shadow: 0px 6px 16px 0px rgba(0, 0, 0, 0.08), 0px 3px 6px -4px rgba(0, 0, 0, 0.12);
border: 1px solid #e4e7ed;
z-index: 999;
box-sizing: border-box;
padding: 10px 9px;
.h20_title {
font-size: 12px;
font-weight: 400;
color: #666666;
}
.title {
font-size: 12px;
font-weight: bold;
color: #333333;
z-index: 999;
position: relative;
}
> p {
z-index: 999;
position: relative;
margin-top: 10px;
line-height: 18px;
}
.single {
position: absolute;
left: -5px;
top: 15px;
// transform: translate(0, -50%);
width: 10px;
height: 10px;
background: #ffffff;
transform: rotate(-60deg);
border: 1px solid #e4e7ed;
z-index: -1;
}
.single1 {
position: absolute;
left: 0px;
top: 50%;
transform: translate(0, -50%);
width: 20px;
height: 100%;
background: #ffffff;
z-index: 22;
}
}
}
.icon_wrap {
display: flex;
align-items: flex-end;
justify-content: center;
height: 65.09px;
padding: 0 52px;
> img {
width: 24px;
height: 24px;
margin-bottom: 6px;
}
}
.sel-wrap {
display: flex;
align-items: center;
......@@ -323,7 +478,7 @@ export default {
}
}
.sel-wrap /deep/ .el-cascader-node {
max-width: 250px!important;
max-width: 250px !important;
}
.btn-wrap {
padding-left: 20px;
......
......@@ -12,13 +12,13 @@
</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 class="info_text dr_top">短信总条数:--</div>
<div class="info_text dr_top">外呼电话总数:--</div>
</div>
</div>
<div class="element_btn dr_top">续费</div>
<div class="element_btn dr_top disableBtn">续费</div>
</div>
<div class="out_wrap dr_right">
<!-- <div class="out_wrap dr_right">
<div class="elment_widget dr_right">
<div class="top_bg_wrap">
<div class="title_text">智能语音电话套餐信息</div>
......@@ -57,7 +57,7 @@
</div>
</div>
<div class="element_btn dr_top disableBtn">续费</div>
</div>
</div> -->
</div>
</div>
</template>
......
......@@ -2,16 +2,16 @@
<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-input v-model="searchInput" :style="{ width: width - 32 + 'px', display: 'block' }" placeholder="输入搜索" @input="handleSearchInput"></el-input>
<el-radio-group class="select-tree" v-model="form[targetItem.name]" @change="handleChangeRadio">
<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>
<div class="btns" v-show="page.total > 20">
<div class="btns" v-show="page.total > 5">
<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="!targetItem.noClearable" :disabled="targetItem.isDisabled" :style="`width: ${width}px`" :class="{ rotate: popoverVisible }" suffix-icon="el-icon-arrow-down" :placeholder="'请选择' + targetItem.label" @change="handleClear"></el-input>
<el-input slot="reference" ref="input" v-model="form[targetItem.nameLabel]" :clearable="!targetItem.noClearable" :disabled="targetItem.isDisabled" :style="`width: ${width}px`" :class="{ rotate: popoverVisible }" suffix-icon="el-icon-arrow-down" :placeholder="'请选择' + targetItem.label" @clear="handleClear"></el-input>
</el-popover>
</div>
</template>
......@@ -23,13 +23,15 @@ export default {
return {
size: 'small',
isExpand: false,
searchInput: '',
timer: '',
// 树状菜单显示状态
popoverVisible: false,
// treeWidth: 'auto',
currList: [],
tempList: [],
allMerchantList: [],
page: {
pageSize: 20,
pageSize: 5,
pageNum: 1,
total: 0,
totalPage: 0
......@@ -57,35 +59,18 @@ export default {
}
},
// 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()
},
methods: {
getCurrList() {
this.currList = this.allMerchantList.slice((this.page.pageNum - 1) * this.page.pageSize, this.page.pageNum * this.page.pageSize)
this.currList = this.tempList.slice((this.page.pageNum - 1) * this.page.pageSize, this.page.pageNum * this.page.pageSize)
},
getAllMerchantList() {
this.$apis.employee.getAllMerchantListApi({}).then(res => {
this.allMerchantList = res
this.tempList = res
this.page.total = res.length
this.page.totalPage = Math.ceil(res.length / this.page.pageSize)
this.getCurrList()
......@@ -103,16 +88,29 @@ export default {
// 显示时触发
onShowPopover() {
this.popoverVisible = true
// this.$refs.tree.filter(false)
},
// 隐藏时触发
onHidePopover() {
this.searchInput = ''
this.handleSearchInput(this.searchInput)
this.popoverVisible = false
},
handleClear(val) {
this.form[this.targetItem.name] = ''
this.form[this.targetItem.nameLabel] = ''
this.$emit('handleChange')
},
handleSearchInput(val) {
if (this.timer) {
clearTimeout(this.timer)
}
this.timer = setTimeout(() => {
this.tempList = val ? this.allMerchantList.filter(item => new RegExp(['', ...val, ''].join('.*')).test(item.merchantName)) : this.allMerchantList
this.page.total = this.tempList.length
this.page.pageNum = 1
this.page.totalPage = Math.ceil(this.tempList.length / this.page.pageSize)
this.getCurrList()
}, 600)
}
}
}
......@@ -142,4 +140,10 @@ export default {
justify-content: space-between;
align-items: center;
}
.select-page .el-radio__input{
display: none;
}
.select-page .el-radio__label{
padding-left: 0;
}
</style>
......@@ -4,8 +4,8 @@
<div class="container">
<p class="edit-sub-title p-rl-20">员工基本信息</p>
<el-form label-width="140px" :inline="true">
<el-form-item style="margin-bottom: 0; width: 48%;" v-for="(item, index) in detailFormData" :key="index" :label="item.label + ':'">
<span class="txt-ellipsis" :title="info[item.name] || '无'">{{ info[item.name] || '无' }}</span>
<el-form-item class="basic-info" v-for="(item, index) in detailFormData" :key="index" :label="item.label + ':'">
<span class="txt-ellipsis" style="display: inline-block; width: 100%;" :title="info[item.name] || '-'">{{ info[item.name] || '-' }}</span>
</el-form-item>
</el-form>
</div>
......@@ -154,5 +154,13 @@ export default {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
word-wrap: break-word;
}
.config-employee .basic-info {
margin-bottom: 0;
width: 48%;
}
.config-employee .basic-info .el-form-item__content {
width: calc(100% - 140px);
}
</style>
......@@ -29,17 +29,26 @@ export default {
{
label: '登录账户',
prop: 'operator',
line: 2
line: 2,
formatter: cellValue => {
return cellValue.operator || '-'
}
},
{
label: '登录产品',
prop: 'productName',
line: 2
line: 2,
formatter: cellValue => {
return cellValue.productName || '-'
}
},
{
label: '登录IP',
prop: 'ip',
line: 2
line: 2,
formatter: cellValue => {
return cellValue.ip || '-'
}
},
{
label: '修改内容',
......@@ -51,12 +60,18 @@ export default {
{
label: '操作人',
prop: 'userName',
line: 2
line: 2,
formatter: cellValue => {
return cellValue.userName || '-'
}
},
{
label: '操作时间',
prop: 'createdTime',
width: '180px'
width: '180px',
formatter: cellValue => {
return cellValue.createdTime || '-'
}
}
]
}
......@@ -70,8 +85,7 @@ export default {
}
},
mounted() {
},
mounted() {},
methods: {
beforeSearchFn() {
......
<template>
<div class="config-employee">
<div class="container" style="margin-top: 0;">
<div class="container" style="margin-top: 0">
<p class="edit-title">{{ title }}</p>
</div>
<div class="container">
<p class="edit-sub-title p-rl-20">员工基本信息</p>
<glsx-combi-form class="p-tr-20" ref="editFormRef" labelWidth="160px" @handleImgDelete="handleImgDelete" :isBlock="isBlock" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<template slot="merchantId" slot-scope="item">
<span v-if="routeInfo.addOrEdit == 2">{{ editForm.merchantName + '(' + editForm.merchantId + ')' }}</span>
<select-page v-else :form="editForm" width="360" :targetItem="item.scope" @handleChange="handleChangeMerchant"></select-page>
<span class="txt-ellipsis" v-if="routeInfo.addOrEdit == 2 || (routeInfo.addOrEdit == 1 && userInfo.accountLevel == 4)" :title="editForm.merchantName + '(' + editForm.merchantId + ')'">{{ editForm.merchantName + '(' + editForm.merchantId + ')' }}</span>
<el-select v-else :style="{ width: item.scope.width }" v-model="editForm[item.scope.name]" :clearable="item.scope.isClear || false" :placeholder="'请选择' + item.scope.label" :filterable="!item.scope.noFilter" @change="handleChangeMerchant($event)">
<el-option v-for="subItem in baseData.allMerchantList" :key="subItem[item.scope.optionId]" :label="subItem[item.scope.optionLabel]" :value="subItem[item.scope.optionId]"></el-option>
</el-select>
<!-- <select-page v-else :form="editForm" width="360" :targetItem="item.scope" @handleChange="handleChangeMerchant"></select-page> -->
</template>
<template v-if="routeInfo.addOrEdit == 2" slot="passwordSlot">
<el-button class="m-l-10" type="primary" @click="handleResetPass">重置密码</el-button>
......@@ -32,14 +35,14 @@
<script>
import { utils } from 'glsx-common'
import selectPage from './components/selectPage'
// import selectPage from './components/selectPage'
import glsxCombiForm from './glsx-combi-form'
export default {
name: 'editEmployee',
components: {
glsxCombiForm,
selectPage
glsxCombiForm
// selectPage
},
data() {
......@@ -108,8 +111,9 @@ export default {
{
label: '所属商户',
name: 'merchantId',
nameLabel: 'merchantName',
// nameLabel: 'merchantName',
noClearable: true,
width: '360px',
optionList: [],
optionId: 'id',
optionLabel: 'merchantName',
......@@ -163,16 +167,14 @@ export default {
maxPhotoNum: 1,
// wdithLt: 800,
// heightLt: 640,
noPixel: true,
hasPixel: false,
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
console.log(res)
this.editForm[targetItem.name] = res
this.editForm.fileName = file.name
console.log(this.editForm)
this.$refs.editFormRef.$refs[this.editChildRef].validateField(targetItem.name)
}
})
......@@ -215,8 +217,17 @@ export default {
getAllMerchantList() {
this.$apis.employee.getAllMerchantListApi({}).then(res => {
this.baseData.allMerchantList = res
// this.getOptionsList('editFormData', false, 'merchantId')
this.setMerchantMd()
})
},
setMerchantMd() {
if (this.userInfo.accountLevel == 4 && this.routeInfo.addOrEdit == 1) {
this.editForm.merchantId = this.baseData.allMerchantList[0].id
this.editForm.merchantName = this.baseData.allMerchantList[0].merchantName
this.handleChangeMerchant(this.editForm.merchantId)
}
},
getInfo() {
this.$apis.employee.getDetailInfoApi({ id: this.routeInfo.id }).then(res => {
this.editForm = {
......@@ -237,7 +248,6 @@ export default {
})
},
handleChangeMerchant(e, editRecovery = false) {
// console.log(e)
if (!editRecovery) {
this.editForm.roleIds = ''
this.editForm.visibleInferiorMer = String(e)
......@@ -297,7 +307,6 @@ export default {
}
},
handleClickNode(data, node) {
// console.log(node.checkedNodes)
this.editForm.visibleInferiorMer = node.checkedNodes.map(item => item.id).join(',')
this.$refs.editFormRef.$refs[this.editChildRef].validateField('visibleInferiorMer')
},
......@@ -305,7 +314,8 @@ export default {
this.editForm.password = ''
},
handleJumpRole() {
this.$history.push('/role/create/' + 0)
let path = document.location.pathname.split('/')[1]
this.$history.push('/' + path+ '/role/create')
},
handleRefresh() {
this.editForm.merchantId
......@@ -316,7 +326,6 @@ export default {
})
},
handleConfirm() {
// console.log(this.$refs.tree.getCheckedNodes())
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = this.$common.utils.deepClone(this.editForm)
......@@ -333,7 +342,7 @@ export default {
fileUrl: ''
})
}
console.log(params)
// console.log(params)
var apiName = this.routeInfo.addOrEdit == 1 ? 'addEmployeeApi' : 'updateEmployeeApi'
this.$apis.employee[apiName](params).then(res => {
this.$message({
......@@ -366,7 +375,7 @@ export default {
this.getAllMerchantList()
this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
}
};
}
</script>
<style>
......@@ -442,4 +451,12 @@ export default {
.config-employee .m-l-10 {
margin-left: 10px;
}
</style>
\ No newline at end of file
.config-employee .txt-ellipsis {
display: inline-block;
width: 320px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
word-wrap: break-word;
}
</style>
......@@ -57,7 +57,7 @@
<div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length < item.maxPhotoNum : !formObj[item.name]" class="activity-img img-w-h">
<div class="add">+</div>
<span class="number">{{ formObj[item.name].length }} / {{ item.maxPhotoNum }}</span>
<input type="file" style="opacity: 0;" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleImgChange(e, item)" />
<input type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleImgChange(e, item)" />
</div>
</div>
<template>
......@@ -189,7 +189,7 @@ export default {
image.onload = () => {
var imgWidth = image.width
var imgHeight = image.height
if (!targetItem.noPixel && ( imgWidth > wdithLt || imgHeight > heightLt)) {
if (targetItem.hasPixel && (imgWidth > wdithLt || imgHeight > heightLt)) {
this.$message.error('图片尺寸最大为' + wdithLt + '像素*' + heightLt + '像素')
} else {
targetItem.handleUpload(e, file, targetItem)
......
......@@ -3,18 +3,13 @@
<div class="config-employee employee-list">
<div style="margin-bottom: 20px;">
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">创建员工</el-button>
<!-- <glsx-combi-form v-if="userInfo.accountLevel != 4" style="float: right;" ref="showSearch" labelWidth="90px" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="topSearchFormData">
<template slot="merchantId" slot-scope="item">
<select-page :form="searchForm" width="200" :targetItem="item.scope" @handleChange="handleChangeMerchant"></select-page>
</template>
</glsx-combi-form> -->
</div>
<div class="container">
<div>
<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="200" :targetItem="item.scope" @handleChange="handleChangeMerchant"></select-page>
</template>
</template> -->
<span slot="footer" class="footer-btns">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" type="primary" @click="handleExport">导出</el-button>
......@@ -23,7 +18,7 @@
</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" @setTableFinishFun="setTableFinishFun">
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" @click="handleDetail(scope.scope)">查看</el-button>
<el-button type="text" @click="handleEdit(2, scope.scope)">修改</el-button>
......@@ -46,8 +41,7 @@
<script>
import { utils } from 'glsx-common'
import glsxCombiForm from './glsx-combi-form'
// import glsxTable from '@/components/glsx-table'
import selectPage from './components/selectPage'
// import selectPage from './components/selectPage'
export default {
name: 'index',
data() {
......@@ -69,29 +63,18 @@ export default {
value: ''
}
},
// topSearchFormData: [
// {
// label: '商户名称',
// name: 'merchantId',
// nameLabel: 'merchantName',
// optionList: [],
// optionId: 'id',
// optionLabel: 'merchantName',
// optionsName: 'allMerchantList',
// addHtml: 'merchantId'
// }
// ],
// 搜索
searchFormData: [
{
label: '商户名称',
name: 'merchantId',
nameLabel: 'merchantName',
type: 'select',
optionList: [],
optionId: 'id',
optionLabel: 'merchantName',
optionsName: 'allMerchantList',
addHtml: 'merchantId'
optionsName: 'allMerchantList'
// addHtml: 'merchantId'
},
{
label: '角色',
......@@ -152,12 +135,18 @@ export default {
label: '员工企微号',
prop: 'entmicroName',
line: 2,
minWidth: '100px'
minWidth: '100px',
formatter: cellValue => {
return cellValue.entmicroName || '-'
}
},
{
label: '角色',
prop: 'roleName',
line: 2
line: 2,
formatter: cellValue => {
return cellValue.roleName || '-'
}
},
{
label: '登录手机号',
......@@ -211,8 +200,8 @@ export default {
},
components: {
glsxCombiForm,
selectPage
glsxCombiForm
// selectPage
// glsxTable
},
......@@ -300,6 +289,11 @@ export default {
resolve()
})
},
setTableFinishFun() {
if (this.$refs.employeeRef.data && !this.$refs.employeeRef.data.length) {
this.$refs.employeeRef.setTableHeightFun()
}
},
handleDetail(row) {
this.$router.push('/employee/detailEmployee/' + row.id)
},
......@@ -310,8 +304,9 @@ export default {
handleSwitchChange(val, row) {
if (!row.roleName) {
const h = this.$createElement
this.$message({
message: '您还未给该员工设置“角色”!设置角色:员工账户管理-修改-角色权限',
message: h('p', null, [h('p', { style: 'text-align: center; line-height: 20px; color: #F56C6C;' }, '您还未给该员工设置“角色”! '), h('p', { style: 'text-align: center; line-height: 20px; color: #F56C6C;' }, '设置角色:员工账户管理-修改-角色权限')]),
type: 'error'
})
this.handleSearch()
......
<template>
<div class="account-body scrm-box-f" v-loading="loading" v-if="tabMenu.length > 0">
<div class="account-body scrm-box-f" v-loading="loading" v-if="tabMenuStatus">
<div class="account-title">{{ title }}</div>
<el-tabs v-if="tabMenu.length != 0" v-model="tabName" type="card" @tab-click="handleClik">
<el-tab-pane :label="item.accounttypeName" :name="item.accounttypeId" v-for="(item, index) in tabMenu" :key="index"></el-tab-pane>
<template v-for="(item, index) in tabMenu">
<el-tab-pane v-show="item && item.accounttypeId" :label="item.accounttypeName" :name="item.accounttypeId" v-if="item" :key="index"></el-tab-pane>
</template>
</el-tabs>
<div class="account-select-pro" v-for="(item, index) in tabMenu" :key="index" v-show="tabName == item.accounttypeId">
<label>选择产品</label>
......@@ -23,7 +25,9 @@
<div v-for="(itm, idx) in item.products" :key="idx">
<div class="nodata" v-if="item.productsArr.length == 0 || itm.merchantProTreeResponses.length == 0">
<img src="../../../assets/img/empty.png" alt="" />
<div>{{ item.productsArr.length == 0 ? '请先选择产品' : '暂无菜单权限' }}</div>
<div>
{{ item.productsArr.length == 0 ? '请先选择产品' : '暂无菜单权限' }}
</div>
</div>
<div v-else>
<el-tree v-show="productTab == itm.productId" :data="itm.merchantProTreeResponses" show-checkbox check-strictly check-on-click-node :expand-on-click-node="false" default-expand-all node-key="id" :class="'tree_' + item.accounttypeId + '_' + itm.productId" :ref="`tree_${item.accounttypeId}_${itm.productId}`" highlight-current :render-content="renderContent" :props="defaultProps" @check="clickDeal"></el-tree>
......@@ -50,6 +54,7 @@ export default {
data() {
return {
loading: false,
tabMenuStatus: false,
treeHeight: 450,
tabMenu: [],
tabMenu_r: [],
......@@ -69,11 +74,20 @@ export default {
accountTypes: []
}
},
watch: {
tabMenu: {
handler() {
this.tabMenuStatus = this.tabMenu.some(item => item)
},
deep: true
}
},
methods: {
handleClik(tab, event) {
console.log(tab, event)
const tabId = tab.name
this.productTab = this.tabMenu.find(i => i.accounttypeId == tabId).productsArr[0].productId
const productTab = this.tabMenu.find(i => i.accounttypeId == tabId)
this.productTab = productTab.productsArr[0] ? productTab.productsArr[0].productId : ''
},
selectPro(data) {
this.$parent.roleRootRules = false
......@@ -83,15 +97,31 @@ export default {
console.log(tabName, data, productTab, '选中')
// 设置全选
var arr = tabMenu.find(i => i.accounttypeId == tabName).products.find(j => j.productId == productTab).merchantProTreeResponses
this.$refs[`tree_${tabName}_${productTab}`][0].setCheckedKeys(this.getAllId(arr))
console.log(tabMenu)
this.$refs[`tree_${tabName}_${productTab}`] ? this.$refs[`tree_${tabName}_${productTab}`][0].setCheckedKeys(this.getAllId(arr)) : ''
this.$nextTick(() => {
this.addStyle()
})
},
productClick(productId) {
this.productTab = productId
},
findMenuFunTree(arr) {
findMenuFunTree(id, status) {
let tabMenu = util.deepClone(this.tabMenu_r)
this.tabMenu = tabMenu.filter(item => arr.includes(item.accounttypeId))
let menu = tabMenu.filter(item => item.accounttypeId == id)
let index = tabMenu.findIndex(item => item.accounttypeId == id)
this.tabMenu_r.forEach((item, index) => {
if (!this.tabMenu[index]) {
this.$set(this.tabMenu, index, '')
}
})
if (status) {
this.$set(this.tabMenu, index, menu[0])
this.tabName = this.tabMenu[index].accounttypeId
} else {
this.$set(this.tabMenu, index, '')
let accounttypeId = this.tabMenu.find(item => item)
this.tabName = accounttypeId && accounttypeId.length > 0 ? accounttypeId[0].accounttypeId : ''
}
},
// 获取当前的所有权限
async findMenuFunTreeByMerId(params) {
......@@ -105,9 +135,6 @@ export default {
}
})
this.tabMenu_r = util.deepClone(tabMenu)
this.$nextTick(() => {
this.addStyle()
})
this.accountTypes = tabMenu.map(item => {
return {
products: null,
......@@ -134,7 +161,6 @@ export default {
this.$nextTick(() => {
this.addStyle()
})
console.log(this.accountList)
this.accountTypes = tabMenu.map(item => {
return {
products: null,
......@@ -153,11 +179,15 @@ export default {
this.accountList.forEach(itm => {
if (item.accounttypeId == itm.accounttypeId) {
this.tabMenu.push(itm)
if (!item.productList) {
return
}
item.productList.forEach(i => {
itm.products.forEach(j => {
if (i.productId == j.productId) {
itm.productsArr.push(j)
this.$nextTick(() => {
this.addStyle()
this.$refs[`tree_${itm.accounttypeId}_${j.productId}`][0].setCheckedKeys(i.idList)
})
}
......@@ -174,7 +204,6 @@ export default {
this.accountList = util.deepClone(this.tabMenu_s)
this.tabMenu_x.forEach(item => {
this.accountList.forEach(itm => {
console.log(itm)
if (item.accounttypeId == itm.accounttypeId) {
this.tabMenu.push(itm)
item.products.forEach(i => {
......@@ -182,7 +211,8 @@ export default {
if (i.productId == j.productId) {
itm.productsArr.push(j)
this.$nextTick(() => {
this.$refs[`tree_${itm.accounttypeId}_${j.productId}`][0].setCheckedKeys(i.menuIds)
this.addStyle()
this.$refs[`tree_${itm.accounttypeId}_${j.productId}`] ? this.$refs[`tree_${itm.accounttypeId}_${j.productId}`][0].setCheckedKeys(i.menuIds) : ''
})
}
})
......@@ -304,6 +334,7 @@ export default {
return arr
},
getSelectInfo() {
this.tabMenu = this.tabMenu.filter(item => item)
this.accountTypes = this.tabMenu.map(item => {
let products = []
let productList = []
......@@ -333,19 +364,27 @@ export default {
}
})
}
if (functionIdList.length !== 0) {
functionIdList.forEach(i => {
list.push({
id: i.parentId,
menuId: i.superParentId
})
})
}
console.log(menuIdList, functionIdList, functionValueIdLists, list)
if (this.roleType) {
productList.push({
productId: itm.productId,
functionIdList: functionIdList,
functionIdList: list,
// functionValue: list,
menuIdList: menuIdList
})
} else {
products.push({
productId: itm.productId,
functionIds: functionIdList,
functionValue: list,
functionIds: list,
// functionValue: list,
menuIds: menuIdList
})
}
......@@ -362,6 +401,7 @@ export default {
}
}
})
console.log(this.accountTypes, ' =-=-=-=-==')
return this.accountTypes
}
},
......@@ -370,7 +410,7 @@ export default {
// this.findPermissionsByMerId()
}
}
</script>
</script>
<style scoped lang="scss">
.account-body {
......@@ -469,4 +509,4 @@ export default {
margin-bottom: 12px;
}
}
</style>
</style>
\ No newline at end of file
......@@ -8,8 +8,8 @@
<div class="left_wrap">
<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 size="small" clearable filterable v-model="searchForm.merchantId" placeholder="请选择">
<el-option v-for="item in merchantList" :key="item.id" :label="item.merchantName" :value="item.id"></el-option>
</el-select>
</div>
<div class="top_select">
......@@ -139,28 +139,32 @@ export default {
},
getMerchantName() {
this.$apis.role.merchantDataList({ source: 'glsx' }).then(res => {
this.merchantList = res
this.filterList()
this.merchantList = res || []
this.merchantList.unshift({
merchantName:'全部',
id:0
})
// 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
}
},
// 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('/role/create/' + 0)
this.$router.push('/role/create')
},
// 去查看角色页面
toLookPage(row) {
......
......@@ -15,7 +15,7 @@
</div>
<div class="info_line_wrap">
<div class="info_line_label">角色说明:</div>
<div class="infl_line_con">{{ roleInfo.roleDescription || '无' }}</div>
<div class="infl_line_con">{{ roleInfo.roleDescription || '-' }}</div>
</div>
</div>
<div class="main_widget">
......@@ -31,7 +31,7 @@
<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" default-expand-all :data="productList[curProductIndex].merchantProTreeResponses" :props="defaultProps"></el-tree>
<el-tree :render-content="renderContent" v-if="productList.length" default-expand-all :data="newTreeList" :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" />
......@@ -73,7 +73,8 @@ export default {
defaultProps: {
children: 'children',
label: 'label'
}
},
newTreeList: []
}
},
created() {
......@@ -97,17 +98,100 @@ export default {
this.$apis.role.roleTreeDataById({ id }).then(res => {
this.rootList = res
this.productList = this.rootList[0].products || []
if (this.productList.length) {
this.newTreeList = this.productList[0].merchantProTreeResponses || []
this.handlerTreeDom()
}
})
},
selectRootItem(index) {
this.curRootIndex = index
this.productList = this.rootList[index].products || []
this.curProductIndex = 0
if (this.productList.length) {
this.newTreeList = this.productList[0].merchantProTreeResponses || []
this.handlerTreeDom()
}
},
selectProductItem(index) {
this.curProductIndex = index
let productList = this.productList
this.newTreeList = productList[index].merchantProTreeResponses || []
this.handlerTreeDom()
},
toBack() {
history.go(-1)
},
// 递归:处理某个值
traverse(arr = [], count = 0) {
count++
arr.map(item => {
if (item.children && item.children instanceof Array) {
item.perms = false
this.traverse(item.children, count)
} else if (!item.children && count > 2) {
item.perms = true
}
item.count = count
return item
})
return arr
},
// 继续处理已经处理完的树
toContiuneTree(arr = [], count = 0, maxLevel = 0) {
count++
arr.map(item => {
if (item.children && item.children instanceof Array) {
item.perms = false
this.toContiuneTree(item.children, count, maxLevel)
} else if (!item.children && count > maxLevel - 1) {
item.perms = true
}
item.count = count
return item
})
return arr
},
// 调用此方法去重构树节点
handlerTreeDom() {
this.newTreeList = this.traverse(this.newTreeList)
let temp = this.flattenDeep(this.newTreeList)
let maxval = Math.max.apply(
Math,
temp.map(item => {
return item.count
})
)
this.newTreeList = this.toContiuneTree(this.newTreeList, 0, maxval)
console.log(this.newTreeList);
this.maxval = maxval-1
this.$nextTick(() => {
this.changeTreeClass(maxval)
})
},
// 处理树横向
renderContent(h, { node, data }) {
let className = ''
if (data.perms&&data.count>this.maxval) {
className = 'especially'
}
return <div class={className}>{data.label}</div>
},
// 改变tree节点样式
changeTreeClass(maxval) {
let piefix = (maxval-1)*20
var classDomList = document.getElementsByClassName('especially')
for (var i = 0; i < classDomList.length; i++) {
classDomList[i].parentNode.style.cssText = 'float:left'
// classDomList[i].parentNode.className = 'el-tree-node__content option-wrapper'
classDomList[i].parentNode.parentNode.parentNode.style.marginLeft = `${piefix}px`
}
},
flattenDeep(arr = [], childs = 'children', pid = 0) {
return arr.reduce((flat, item) => {
item.pid = pid
return flat.concat(item, item[childs] ? this.flattenDeep(item[childs], childs, item.id) : [])
}, [])
}
}
}
......
......@@ -14,7 +14,7 @@ const cdn = {
`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`,
`${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`,
`${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`,
'https://webapi.amap.com/maps?v=2.0&key=bd290dc27d0945959280753215ddda71&plugin=AMap.Geocoder'
// 'https://webapi.amap.com/maps?v=1.3&key=bd290dc27d0945959280753215ddda71&plugin=AMap.Geocoder'
]
}
module.exports = {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!