Commit 503b59cd by 杨北旺

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

2 parents 82baf40a 18ec2e71
...@@ -62,6 +62,16 @@ const getSecondInfo = params => { ...@@ -62,6 +62,16 @@ const getSecondInfo = params => {
sign: true sign: true
}) })
} }
const getSecondTree = params => {
params.method = 'cn.com.glsx.merchants.merchant.findMerchantTree'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const getSecondTable = params => { const getSecondTable = params => {
params.method = 'cn.com.glsx.merchants.staff.findMerchantStaffList' params.method = 'cn.com.glsx.merchants.staff.findMerchantStaffList'
...@@ -76,7 +86,9 @@ const getSecondTable = params => { ...@@ -76,7 +86,9 @@ const getSecondTable = params => {
export default { export default {
// getThirdTable, // getThirdTable,
getFirstInfo, getFirstInfo,
findMenuFunTreeByMerId,
getSecondInfo, getSecondInfo,
getSecondTree,
getSecondTable getSecondTable
} }
...@@ -25,6 +25,7 @@ export default { ...@@ -25,6 +25,7 @@ export default {
return { return {
input: "", input: "",
address: "", address: "",
lnglat: [],
}; };
}, },
...@@ -60,6 +61,7 @@ export default { ...@@ -60,6 +61,7 @@ export default {
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.address = result.regeocode.formattedAddress; self.address = result.regeocode.formattedAddress;
}); });
}); });
...@@ -74,7 +76,7 @@ export default { ...@@ -74,7 +76,7 @@ export default {
selectAddress(e) { selectAddress(e) {
//这里获得点选地点的经纬度 //这里获得点选地点的经纬度
this.getAddress(); this.getAddress();
}, }
}, },
mounted() { mounted() {
......
...@@ -54,11 +54,29 @@ ...@@ -54,11 +54,29 @@
<span class="content-title">功能权限</span> <span class="content-title">功能权限</span>
<div class="powerTreeWrap"> <div class="powerTreeWrap">
<div class="manTitleWrap"> <div class="mainTitleWrap">
<div class="mainTitle" :class="{ activeMainTitle: currentIndex == index }" v-for="(item, index) in firstPageObj.accountTypes" :key="index" @click="powerTabClick(index)"> <div class="mainTitle" :class="{ activeMainTitle: currentIndex == index }" v-for="(item, index) in powerDataArray" :key="index" @click="powerTabClick(index)">
{{ item.accounttypeName || 'null' }} {{ item.accounttypeName || 'null' }}
</div> </div>
</div> </div>
<div class="content">
<div class="subTitleWrap">
<div class="subTitle" :class="{ acitveSubTitle: subCurrentIndex == sindex }" v-for="(ele, sindex) in products" :key="sindex" @click="powerSubTabClick(sindex)">
{{ ele.productName }}
</div>
</div>
<div class="contentTree">
<!-- powerDataArray.length > 0 && powerDataArray[currentIndex].products[subCurrentIndex]. -->
<!-- powerDataArray[currentIndex].products[subCurrentIndex].merchantProTreeResponses这是树的数据 -->
<template v-if="merchantProTreeResponses.length > 0">
<el-tree default-expand-all :data="merchantProTreeResponses" :props="defaultProps"></el-tree>
</template>
<div v-else class="noDataContent">
<img src="../../assets/img/empty.png" alt="" />
<div>暂无数据</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
<div class="MsgWrap companyMsg"> <div class="MsgWrap companyMsg">
...@@ -143,7 +161,10 @@ ...@@ -143,7 +161,10 @@
</div> </div>
<div class="searchTreeInputWrap"> <div class="searchTreeInputWrap">
<el-input v-model="treeInputName" placeholder="请输入" size="small"></el-input> <el-input v-model="treeInputName" placeholder="请输入" size="small"></el-input>
<el-button type="primary" size="small">查询</el-button> <el-button type="primary" size="small" @click="filterTreeListFun">查询</el-button>
</div>
<div class="secondTreeWrap">
<el-tree ref="tree" :default-expanded-keys="expandedIds" :data="secondTreeList" node-key="id" :filter-node-method="filterNode"></el-tree>
</div> </div>
<!-- <form class="layui-form" action=""> <!-- <form class="layui-form" action="">
<div class="layui-inline"> <div class="layui-inline">
...@@ -191,10 +212,19 @@ export default { ...@@ -191,10 +212,19 @@ export default {
titles: ['商户信息', '上级/下级商户', '修改记录'], titles: ['商户信息', '上级/下级商户', '修改记录'],
curIndex: 0, curIndex: 0,
currentIndex: 0, //功能权限主标题的索引 currentIndex: 0, //功能权限主标题的索引
subCurrentIndex: 0,
firstPageObj: {}, firstPageObj: {},
powerDataArray: [],
defaultProps: {
children: 'children',
label: 'label'
},
//第二页表 //第二页表
secondPageObj: {}, secondPageObj: {},
secondTreeList: [],
expandedIds: [],
treeInputName: '', treeInputName: '',
secondInputName: '', secondInputName: '',
subMerchantTableList: [], //第二页的后台给表数据 subMerchantTableList: [], //第二页的后台给表数据
...@@ -262,9 +292,32 @@ export default { ...@@ -262,9 +292,32 @@ export default {
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
// layout: 'sizes, prev, pager, next, jumper, ->, total', // layout: 'sizes, prev, pager, next, jumper, ->, total',
tableTotal: 0, tableTotal: 0,
merchantId: this.$route.params.id //需要从外面传进来 merchantId: 58 //this.$route.params.id //需要从外面传进来
}
},
computed: {
products() {
if (!this.powerDataArray.length) {
return []
}
return this.powerDataArray[this.currentIndex].products
},
//功能树的数据
merchantProTreeResponses() {
if (!this.powerDataArray.length) {
return []
} else if (this.powerDataArray.length > 0 && this.powerDataArray[this.currentIndex].products.length == 0) {
return []
}
return this.powerDataArray[this.currentIndex].products[this.subCurrentIndex].merchantProTreeResponses
} }
}, },
// watch: {
// treeInputName(val) {
// this.$refs.tree.filter(val)
// }
// },
methods: { methods: {
tabClick(index) { tabClick(index) {
...@@ -283,6 +336,11 @@ export default { ...@@ -283,6 +336,11 @@ export default {
}, },
powerTabClick(index) { powerTabClick(index) {
this.currentIndex = index this.currentIndex = index
//每次切换将subCurrentIndex置为0
this.subCurrentIndex = 0
},
powerSubTabClick(index) {
this.subCurrentIndex = index
}, },
getFirstInfo() { getFirstInfo() {
this.$apis.merchant.getFirstInfo({ id: this.merchantId }).then(res => { this.$apis.merchant.getFirstInfo({ id: this.merchantId }).then(res => {
...@@ -291,14 +349,30 @@ export default { ...@@ -291,14 +349,30 @@ export default {
} }
}) })
}, },
findMenuFunTreeByMerId() {
this.$apis.merchant.findMenuFunTreeByMerId({ id: this.merchantId }).then(res => {
if (res) {
console.log(res, '功能树的信息')
this.powerDataArray = res
}
})
},
getSecondInfo() { getSecondInfo() {
this.$apis.merchant.getSecondInfo({ id: this.merchantId }).then(res => { this.$apis.merchant.getSecondInfo({ id: this.merchantId }).then(res => {
if (res) { if (res) {
console.log('二页', res)
this.secondPageObj = res this.secondPageObj = res
} }
}) })
}, },
getSecondTree() {
this.$apis.merchant.getSecondTree({ id: this.merchantId }).then(res => {
if (res) {
console.log('二页的树', res)
this.secondTreeList = res
this.expandedIds = res.map(item => item.id)
}
})
},
getSecondTable() { getSecondTable() {
var param = {} var param = {}
param.keyword = this.secondInputName param.keyword = this.secondInputName
...@@ -335,6 +409,13 @@ export default { ...@@ -335,6 +409,13 @@ export default {
this.$refs.updateRecord.setTableHeightFun() this.$refs.updateRecord.setTableHeightFun()
} }
}) })
},
filterNode(value, data) {
if (!value) return true
return data.label.indexOf(value) !== -1
},
filterTreeListFun() {
this.$refs.tree.filter(this.treeInputName)
} }
}, },
...@@ -345,9 +426,10 @@ export default { ...@@ -345,9 +426,10 @@ export default {
moduleName: '商户模块' moduleName: '商户模块'
} }
this.getFirstInfo() this.getFirstInfo()
// this.findMenuFunTreeByMerId() this.findMenuFunTreeByMerId()
this.getSecondInfo() this.getSecondInfo()
// this.getSecondTree()
this.getSecondTree()
}, },
mounted() { mounted() {
...@@ -454,7 +536,8 @@ export default { ...@@ -454,7 +536,8 @@ export default {
min-height: 300px; min-height: 300px;
padding-top: 2px; padding-top: 2px;
padding-left: 2px; padding-left: 2px;
.manTitleWrap { padding-bottom: 10px;
.mainTitleWrap {
height: 32px; height: 32px;
display: flex; display: flex;
...@@ -471,6 +554,45 @@ export default { ...@@ -471,6 +554,45 @@ export default {
color: #5850ff; color: #5850ff;
} }
} }
.content {
background-color: #fff;
margin: 20px 10px 0;
.subTitleWrap {
height: 40px;
display: flex;
background-color: #f4f6fc;
.subTitle {
background-color: #f4f6fc;
height: 40px;
width: 180px;
line-height: 40px;
text-align: center;
border-radius: 2px;
}
.acitveSubTitle {
background-color: #fff !important;
color: #5850ff;
}
}
.contentTree {
padding: 20px;
min-height: 250px;
position: relative;
.noDataContent {
width: 64px;
height: 64px;
position: absolute;
left: 50%;
top: 50%;
margin-top: -32px;
margin-left: -32px;
div {
margin-top: 12px;
}
}
}
}
} }
} }
} }
...@@ -483,7 +605,7 @@ export default { ...@@ -483,7 +605,7 @@ export default {
padding-left: 20px; padding-left: 20px;
min-height: calc(100vh - 200px); min-height: calc(100vh - 200px);
background-color: #fff; background-color: #fff;
width: 340px; width: 360px;
margin-right: 20px; margin-right: 20px;
box-sizing: border-box; box-sizing: border-box;
overflow: auto; overflow: auto;
...@@ -531,6 +653,9 @@ export default { ...@@ -531,6 +653,9 @@ export default {
margin-left: 10px; margin-left: 10px;
} }
} }
.secondTreeWrap {
margin-top: 20px;
}
} }
// .ztree .wrapper-tree { // .ztree .wrapper-tree {
// overflow-y: auto; // overflow-y: auto;
...@@ -552,7 +677,7 @@ export default { ...@@ -552,7 +677,7 @@ export default {
.merchant-right { .merchant-right {
padding-top: 15px; padding-top: 15px;
padding-bottom: 20px; padding-bottom: 20px;
width: calc(100vw - 340px - 20px); width: calc(100vw - 360px - 20px);
overflow-x: auto; overflow-x: auto;
background-color: #fff; background-color: #fff;
padding-left: 20px; padding-left: 20px;
......
<template> <template>
<div class="scrm-main"> <div class="scrm-main">
<el-tabs v-model="step" @tab-click="handleClick" class="tab-edit-status"> <el-tabs v-model="step" class="tab-edit-status">
<el-tab-pane label="修改功能权限" name="first"></el-tab-pane> <el-tab-pane label="修改功能权限" name="first"></el-tab-pane>
<el-tab-pane label="修改基本信息" name="second"></el-tab-pane> <el-tab-pane label="修改基本信息" name="second"></el-tab-pane>
</el-tabs> </el-tabs>
...@@ -61,12 +61,12 @@ ...@@ -61,12 +61,12 @@
:key="index" :key="index"
:btnLabel="item.accounttypeName" :btnLabel="item.accounttypeName"
:btnValue="item.accounttypeId" :btnValue="item.accounttypeId"
stopClick="true"
:typeStatus=" :typeStatus="
accountAddForm.accountTypeNames.search(item.accounttypeName) == -1 accounttypeId.indexOf(item.accounttypeId) == -1
? false ? true
: true : false
" "
stopClick="true"
></auto-button> ></auto-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -75,7 +75,13 @@ ...@@ -75,7 +75,13 @@
</div> </div>
<div class="account-body scrm-box-f"> <div class="account-body scrm-box-f">
<div class="form-title">修改企业信息</div> <div class="form-title">修改企业信息</div>
<base-info ref="baseInfoForm" :brandData="brandData" :accountAddForm="accountAddForm" :businessScopeCustomize="businessScopeCustomize" :businessOption="businessOption"></base-info> <base-info
ref="baseInfoForm"
:brandData="brandData"
:accountAddForm="accountAddForm"
:businessScopeCustomize="businessScopeCustomize"
:businessOption="businessOption"
></base-info>
<!-- <el-form <!-- <el-form
ref="baseForm" ref="baseForm"
:model="accountAddForm" :model="accountAddForm"
...@@ -306,11 +312,15 @@ ...@@ -306,11 +312,15 @@
<div v-show="step == 'first'"> <div v-show="step == 'first'">
<select-product></select-product> <select-product></select-product>
</div> </div>
<div class="footer-panel" :style="{ <div
class="footer-panel"
:style="{
left: footerLeft + 'px', left: footerLeft + 'px',
width: footerWidth+ 'px' width: footerWidth + 'px',
}"> }"
<el-button type="primary" @click="handleNext">确定</el-button> >
<el-button type="primary" @click="handleSave" v-show="step == 'first'">确定</el-button>
<el-button type="primary" @click="handleNext" v-show="step == 'second'">确定</el-button>
<el-button type="primary" @click="handleCancel">取消</el-button> <el-button type="primary" @click="handleCancel">取消</el-button>
</div> </div>
<el-dialog :visible.sync="dialogMapVisible" width="60%"> <el-dialog :visible.sync="dialogMapVisible" width="60%">
...@@ -334,7 +344,7 @@ export default { ...@@ -334,7 +344,7 @@ export default {
mapView, mapView,
autoButton, autoButton,
selectProduct, selectProduct,
baseInfo baseInfo,
}, },
data() { data() {
return { return {
...@@ -353,17 +363,32 @@ export default { ...@@ -353,17 +363,32 @@ export default {
dialogMapVisible: false, dialogMapVisible: false,
businessScopeCustomize: [{ name: "" }], businessScopeCustomize: [{ name: "" }],
accountAddForm: { accountAddForm: {
merchantType: 1, id: null,
isloginName: null,
lat: null,
lng: null,
merchantAddress: null,
merchantName: null,
merchantAbbreviation: null,
merchantType: null,
merchantOrgcode: null,
merchantLegalPerson: null,
merchantLegalPersonPhone: null,
residentContact: null,
residentPhone: null,
merchantAccountLevel: null,
parentId: null,
merchantModel: null,
businessScope: [], businessScope: [],
parentId: "", bussinessTime: [],
isloginName: false, merchantFiles: [],
}, },
accounttypeId: [], accounttypeId: [],
accountInfoForm: { accountInfoForm: {
merchantLoginAccount: "", merchantLoginAccount: "",
merchantLoginPassword: "", merchantLoginPassword: "",
}, },
accountTypes: {}, accountTypes: [],
accountLevel: [], accountLevel: [],
accountType: [], accountType: [],
businessOption: [], businessOption: [],
...@@ -399,14 +424,6 @@ export default { ...@@ -399,14 +424,6 @@ export default {
this.accountAddForm.merchantAddress = this.$refs.mapForm.address; this.accountAddForm.merchantAddress = this.$refs.mapForm.address;
console.log(this.accountAddForm.merchantAddress); console.log(this.accountAddForm.merchantAddress);
}, },
getBtnStatus(status, value) {
if (status) {
this.accounttypeId.push(value);
} else {
let idx = this.accounttypeId.findIndex((item) => item == value);
this.accounttypeId.splice(idx, 1);
}
},
delImg(index) { delImg(index) {
this.accountAddForm.merchantFiles.splice(index, 1); this.accountAddForm.merchantFiles.splice(index, 1);
}, },
...@@ -449,6 +466,23 @@ export default { ...@@ -449,6 +466,23 @@ export default {
handleCancel() { handleCancel() {
this.$router.push("/account/index"); this.$router.push("/account/index");
}, },
handleSave() {
if (this.$refs.productForm.getSelectInfo().length == 0) {
this.$message.error("请选择产品");
return;
}
let accountTypes = JSON.stringify(this.$refs.productForm.getSelectInfo());
let params = {
accountTypes,
status: 2,
merchantId: this.parentId,
};
this.$apis.store.updatePermissions(params).then((res) => {
if (res) {
this.$router.push("/account/index");
}
});
},
//下一步 //下一步
handleNext() { handleNext() {
const pm1 = new Promise((resolve, reject) => { const pm1 = new Promise((resolve, reject) => {
...@@ -469,15 +503,16 @@ export default { ...@@ -469,15 +503,16 @@ export default {
if (params.businessScope) { if (params.businessScope) {
params.businessScope = params.businessScope.join(","); params.businessScope = params.businessScope.join(",");
} }
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);
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(",");
Promise.all([pm1, pm2]).then(() => { Promise.all([pm1, pm2]).then(() => {
this.$apis.store.saveMerchant(params).then((res) => { this.$apis.store.updateMerchant(params).then((res) => {
if (res) { if (res) {
this.parentId = res; this.$router.push("/account/index");
} }
}); });
}); });
...@@ -502,48 +537,93 @@ export default { ...@@ -502,48 +537,93 @@ export default {
async findMerchantDetail() { async findMerchantDetail() {
this.$apis.store this.$apis.store
.findMerchantDetail({ .findMerchantDetail({
id: this.accountAddForm.parentId, id: this.accountAddForm.id,
}) })
.then((res) => { .then((res) => {
this.accountAddForm = res; let {
this.accountInfoForm.merchantLoginAccount = this.accountAddForm.merchantLoginAccount; isloginName,
this.accountInfoForm.merchantLoginPassword = this.accountAddForm.merchantLoginPassword; bussinessBegintime,
this.accountTypes = this.accountAddForm.accountTypes; bussinessEndtime,
this.accountAddForm.businessScope = this.accountAddForm.businessScope lat,
? this.accountAddForm.businessScope.split(",") lng,
: []; merchantAddress,
merchantName,
merchantAbbreviation,
merchantType,
merchantOrgcode,
merchantLegalPerson,
merchantLegalPersonPhone,
residentContact,
residentPhone,
merchantLoginAccount,
merchantLoginPassword,
merchantAccountLevel,
businessScope,
businessScopeCustomize,
merchantBrand,
merchantFileResponses,
merchantModel,
accountTypes,
accounttypeId
} = res;
this.accountInfoForm.merchantLoginAccount = merchantLoginAccount;
this.accountInfoForm.merchantLoginPassword = merchantLoginPassword;
this.accountTypes = accountTypes;
businessScope = businessScope?businessScope.split(','): []
if (businessScope.length > 0) {
for (let i in this.accountAddForm.businessScope) { for (let i in this.accountAddForm.businessScope) {
this.accountAddForm.businessScope[i] = parseInt( this.accountAddForm.businessScope[i] = parseInt(
this.accountAddForm.businessScope[i] this.accountAddForm.businessScope[i]
); );
} }
this.accountAddForm.bussinessTime = [ }
this.accountAddForm.bussinessBegintime, this.accountAddForm.bussinessTime = [bussinessBegintime, bussinessEndtime];
this.accountAddForm.bussinessEndtime, businessScopeCustomize = businessScopeCustomize?businessScopeCustomize.split(','): []
]; if (businessScopeCustomize.length > 0) {
let businessScopeCustomize = this.accountAddForm.businessScopeCustomize
? this.accountAddForm.businessScopeCustomize.split(",")
: [""];
this.businessScopeCustomize = businessScopeCustomize.map((item) => { this.businessScopeCustomize = businessScopeCustomize.map((item) => {
return { return {
name: item, name: item,
}; };
}); });
this.accountAddForm.merchantFiles = this.accountAddForm.merchantFileResponses.map( }
(item) => { accounttypeId = accounttypeId?accounttypeId.split(','): []
if (accounttypeId.length > 0) {
this.accounttypeId = accounttypeId.map((item) => {
return {
name: item,
};
});
}
if (merchantFileResponses.length > 0) {
this.accountAddForm.merchantFiles = merchantFileResponses.map((item) => {
return { return {
fileUrl: item.fileUrl, fileUrl: item.fileUrl,
}; };
});
} }
); merchantBrand = merchantBrand?merchantBrand.split(','): []
let merchantBrand = this.accountAddForm.merchantBrand if (merchantBrand && merchantBrand.length > 0) {
? this.accountAddForm.merchantBrand.split(",")
: [];
for (let i in merchantBrand) { for (let i in merchantBrand) {
merchantBrand[i] = parseInt(merchantBrand[i]); merchantBrand[i] = parseInt(merchantBrand[i]);
} }
this.$refs.baseInfoForm.$refs.brandTree.setCheckedKeys(merchantBrand); this.$refs.baseInfoForm.$refs.brandTree.setCheckedKeys(merchantBrand);
}
this.accountAddForm = Object.assign(this.accountAddForm, {
isloginName: isloginName ? true : false,
lat,
lng,
merchantAddress,
merchantName,
merchantAbbreviation,
merchantType,
merchantOrgcode,
merchantLegalPerson,
merchantLegalPersonPhone,
residentContact,
residentPhone,
merchantAccountLevel,
merchantModel,
});
}); });
}, },
getCarbrandTree() { getCarbrandTree() {
...@@ -556,7 +636,7 @@ export default { ...@@ -556,7 +636,7 @@ 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;
this.accountAddForm.parentId = this.$route.params.id; this.accountAddForm.id = this.$route.params.id;
this.getCarbrandTree(); this.getCarbrandTree();
this.findAllDictData(); this.findAllDictData();
}, },
...@@ -591,7 +671,7 @@ export default { ...@@ -591,7 +671,7 @@ export default {
} }
} }
.account-body { .account-body {
&:nth-of-type(3) { &:nth-of-type(2) {
margin-top: 20px; margin-top: 20px;
margin-bottom: 70px; margin-bottom: 70px;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!