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 => {
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 => {
params.method = 'cn.com.glsx.merchants.staff.findMerchantStaffList'
......@@ -76,7 +86,9 @@ const getSecondTable = params => {
export default {
// getThirdTable,
getFirstInfo,
findMenuFunTreeByMerId,
getSecondInfo,
getSecondTree,
getSecondTable
}
......@@ -25,6 +25,7 @@ export default {
return {
input: "",
address: "",
lnglat: [],
};
},
......@@ -60,6 +61,7 @@ export default {
AMap.plugin("AMap.Geocoder", () => {
const geocoder = new AMap.Geocoder();
geocoder.getAddress(lnglat, (status, result) => {
self.lnglat = lnglat;
self.address = result.regeocode.formattedAddress;
});
});
......@@ -74,7 +76,7 @@ export default {
selectAddress(e) {
//这里获得点选地点的经纬度
this.getAddress();
},
}
},
mounted() {
......
......@@ -54,11 +54,29 @@
<span class="content-title">功能权限</span>
<div class="powerTreeWrap">
<div class="manTitleWrap">
<div class="mainTitle" :class="{ activeMainTitle: currentIndex == index }" v-for="(item, index) in firstPageObj.accountTypes" :key="index" @click="powerTabClick(index)">
<div class="mainTitleWrap">
<div class="mainTitle" :class="{ activeMainTitle: currentIndex == index }" v-for="(item, index) in powerDataArray" :key="index" @click="powerTabClick(index)">
{{ item.accounttypeName || 'null' }}
</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 class="MsgWrap companyMsg">
......@@ -143,7 +161,10 @@
</div>
<div class="searchTreeInputWrap">
<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>
<!-- <form class="layui-form" action="">
<div class="layui-inline">
......@@ -191,10 +212,19 @@ export default {
titles: ['商户信息', '上级/下级商户', '修改记录'],
curIndex: 0,
currentIndex: 0, //功能权限主标题的索引
subCurrentIndex: 0,
firstPageObj: {},
powerDataArray: [],
defaultProps: {
children: 'children',
label: 'label'
},
//第二页表
secondPageObj: {},
secondTreeList: [],
expandedIds: [],
treeInputName: '',
secondInputName: '',
subMerchantTableList: [], //第二页的后台给表数据
......@@ -262,9 +292,32 @@ export default {
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
// layout: 'sizes, prev, pager, next, jumper, ->, total',
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: {
tabClick(index) {
......@@ -283,6 +336,11 @@ export default {
},
powerTabClick(index) {
this.currentIndex = index
//每次切换将subCurrentIndex置为0
this.subCurrentIndex = 0
},
powerSubTabClick(index) {
this.subCurrentIndex = index
},
getFirstInfo() {
this.$apis.merchant.getFirstInfo({ id: this.merchantId }).then(res => {
......@@ -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() {
this.$apis.merchant.getSecondInfo({ id: this.merchantId }).then(res => {
if (res) {
console.log('二页', 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() {
var param = {}
param.keyword = this.secondInputName
......@@ -335,6 +409,13 @@ export default {
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 {
moduleName: '商户模块'
}
this.getFirstInfo()
// this.findMenuFunTreeByMerId()
this.findMenuFunTreeByMerId()
this.getSecondInfo()
// this.getSecondTree()
this.getSecondTree()
},
mounted() {
......@@ -454,7 +536,8 @@ export default {
min-height: 300px;
padding-top: 2px;
padding-left: 2px;
.manTitleWrap {
padding-bottom: 10px;
.mainTitleWrap {
height: 32px;
display: flex;
......@@ -471,6 +554,45 @@ export default {
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 {
padding-left: 20px;
min-height: calc(100vh - 200px);
background-color: #fff;
width: 340px;
width: 360px;
margin-right: 20px;
box-sizing: border-box;
overflow: auto;
......@@ -531,6 +653,9 @@ export default {
margin-left: 10px;
}
}
.secondTreeWrap {
margin-top: 20px;
}
}
// .ztree .wrapper-tree {
// overflow-y: auto;
......@@ -552,7 +677,7 @@ export default {
.merchant-right {
padding-top: 15px;
padding-bottom: 20px;
width: calc(100vw - 340px - 20px);
width: calc(100vw - 360px - 20px);
overflow-x: auto;
background-color: #fff;
padding-left: 20px;
......
<template>
<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="second"></el-tab-pane>
</el-tabs>
......@@ -61,12 +61,12 @@
:key="index"
:btnLabel="item.accounttypeName"
:btnValue="item.accounttypeId"
stopClick="true"
:typeStatus="
accountAddForm.accountTypeNames.search(item.accounttypeName) == -1
? false
: true
accounttypeId.indexOf(item.accounttypeId) == -1
? true
: false
"
stopClick="true"
></auto-button>
</el-form-item>
</el-col>
......@@ -75,7 +75,13 @@
</div>
<div class="account-body scrm-box-f">
<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
ref="baseForm"
:model="accountAddForm"
......@@ -306,11 +312,15 @@
<div v-show="step == 'first'">
<select-product></select-product>
</div>
<div class="footer-panel" :style="{
<div
class="footer-panel"
:style="{
left: footerLeft + 'px',
width: footerWidth+ 'px'
}">
<el-button type="primary" @click="handleNext">确定</el-button>
width: footerWidth + 'px',
}"
>
<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>
</div>
<el-dialog :visible.sync="dialogMapVisible" width="60%">
......@@ -334,7 +344,7 @@ export default {
mapView,
autoButton,
selectProduct,
baseInfo
baseInfo,
},
data() {
return {
......@@ -353,17 +363,32 @@ export default {
dialogMapVisible: false,
businessScopeCustomize: [{ name: "" }],
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: [],
parentId: "",
isloginName: false,
bussinessTime: [],
merchantFiles: [],
},
accounttypeId: [],
accountInfoForm: {
merchantLoginAccount: "",
merchantLoginPassword: "",
},
accountTypes: {},
accountTypes: [],
accountLevel: [],
accountType: [],
businessOption: [],
......@@ -399,14 +424,6 @@ export default {
this.accountAddForm.merchantAddress = this.$refs.mapForm.address;
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) {
this.accountAddForm.merchantFiles.splice(index, 1);
},
......@@ -449,6 +466,23 @@ export default {
handleCancel() {
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() {
const pm1 = new Promise((resolve, reject) => {
......@@ -469,15 +503,16 @@ export default {
if (params.businessScope) {
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);
let businessScopeCustomize = this.businessScopeCustomize.map((item) => item.name);
params.businessScopeCustomize = businessScopeCustomize.join(",");
params.accounttypeId = this.accounttypeId.join(",");
Promise.all([pm1, pm2]).then(() => {
this.$apis.store.saveMerchant(params).then((res) => {
this.$apis.store.updateMerchant(params).then((res) => {
if (res) {
this.parentId = res;
this.$router.push("/account/index");
}
});
});
......@@ -502,48 +537,93 @@ export default {
async findMerchantDetail() {
this.$apis.store
.findMerchantDetail({
id: this.accountAddForm.parentId,
id: this.accountAddForm.id,
})
.then((res) => {
this.accountAddForm = res;
this.accountInfoForm.merchantLoginAccount = this.accountAddForm.merchantLoginAccount;
this.accountInfoForm.merchantLoginPassword = this.accountAddForm.merchantLoginPassword;
this.accountTypes = this.accountAddForm.accountTypes;
this.accountAddForm.businessScope = this.accountAddForm.businessScope
? this.accountAddForm.businessScope.split(",")
: [];
let {
isloginName,
bussinessBegintime,
bussinessEndtime,
lat,
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) {
this.accountAddForm.businessScope[i] = parseInt(
this.accountAddForm.businessScope[i]
);
}
this.accountAddForm.bussinessTime = [
this.accountAddForm.bussinessBegintime,
this.accountAddForm.bussinessEndtime,
];
let businessScopeCustomize = this.accountAddForm.businessScopeCustomize
? this.accountAddForm.businessScopeCustomize.split(",")
: [""];
}
this.accountAddForm.bussinessTime = [bussinessBegintime, bussinessEndtime];
businessScopeCustomize = businessScopeCustomize?businessScopeCustomize.split(','): []
if (businessScopeCustomize.length > 0) {
this.businessScopeCustomize = businessScopeCustomize.map((item) => {
return {
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 {
fileUrl: item.fileUrl,
};
});
}
);
let merchantBrand = this.accountAddForm.merchantBrand
? this.accountAddForm.merchantBrand.split(",")
: [];
merchantBrand = merchantBrand?merchantBrand.split(','): []
if (merchantBrand && merchantBrand.length > 0) {
for (let i in merchantBrand) {
merchantBrand[i] = parseInt(merchantBrand[i]);
}
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() {
......@@ -556,7 +636,7 @@ export default {
mounted() {
this.footerLeft = document.querySelector(".base-container-right").offsetLeft;
this.footerWidth = document.documentElement.clientWidth - this.footerLeft;
this.accountAddForm.parentId = this.$route.params.id;
this.accountAddForm.id = this.$route.params.id;
this.getCarbrandTree();
this.findAllDictData();
},
......@@ -591,7 +671,7 @@ export default {
}
}
.account-body {
&:nth-of-type(3) {
&:nth-of-type(2) {
margin-top: 20px;
margin-bottom: 70px;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!