Commit 3bca3c33 by 李长胜

合并

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