Commit afa43dde by cwq0219
2 parents 34c578c7 f69c5810
......@@ -124,6 +124,10 @@ img {
justify-content: space-between;
}
.el-checkbox:last-of-type {
margin-right: 8px;
}
::-webkit-scrollbar {
/*滚动条整体样式*/
width: 6px;
......
const staticRoutes = Object.freeze([{
name: 'account',
path: '/account/index',
meta: {},
component: resolve => require([`@/views/account/index.vue`], resolve)
},
{
name: 'addAccount',
path: '/account/addAccount/:id',
meta: {},
component: resolve => require([`@/views/account/addAccount.vue`], resolve)
},
{
name: 'editAccount',
path: '/account/editAccount/:id',
meta: {},
component: resolve => require([`@/views/account/editAccount.vue`], resolve)
},
{
name: 'detailAccount',
path: '/account/detailAccount/:id',
meta: {},
component: resolve => require([`@/views/account/detailAccount.vue`], resolve)
},
{
name: 'role',
path: '/role/index',
component: resolve => require([`@/views/role/index.vue`], resolve),
meta: {}
},
{
name: 'role',
path: '/role/create/:id',
component: resolve => require([`@/views/role/create.vue`], resolve),
meta: {}
},
{
name: 'role',
path: '/role/look:id',
component: resolve => require([`@/views/role/look.vue`], resolve),
meta: {}
},
{
name: 'Account2EmployeeIndex',
path: '/employee/index',
meta: {},
component: resolve => require([`@/views/employee/index.vue`], resolve)
},
{
name: 'Account2EmployeeEditEmployee',
path: '/employee/editEmployee',
meta: {},
component: resolve => require([`@/views/employee/editEmployee.vue`], resolve)
},
{
name: 'Account2EmployeeDetailEmployee',
path: '/employee/detailEmployee',
meta: {},
component: resolve => require([`@/views/employee/detailEmployee.vue`], resolve)
}
name: 'account',
path: '/account/index',
meta: {},
component: resolve => require([`@/views/account/index.vue`], resolve)
},
{
name: 'addAccount',
path: '/account/addAccount/:id',
meta: {},
component: resolve => require([`@/views/account/addAccount.vue`], resolve)
},
{
name: 'editAccount',
path: '/account/editAccount/:id',
meta: {},
component: resolve => require([`@/views/account/editAccount.vue`], resolve)
},
{
name: 'detailAccount',
path: '/account/detailAccount/:id',
meta: {},
component: resolve => require([`@/views/account/detailAccount.vue`], resolve)
},
{
name: 'role',
path: '/role/index',
component: resolve => require([`@/views/role/index.vue`], resolve),
meta: {}
},
{
name: 'role',
path: '/role/create/:id',
component: resolve => require([`@/views/role/create.vue`], resolve),
meta: {}
},
{
name: 'role',
path: '/role/look:id',
component: resolve => require([`@/views/role/look.vue`], resolve),
meta: {}
},
{
name: 'Account2EmployeeIndex',
path: '/employee/index',
meta: {},
component: resolve => require([`@/views/employee/index.vue`], resolve)
},
{
name: 'Account2EmployeeEditEmployee',
path: '/employee/editEmployee/:addOrEdit/:id',
meta: {},
component: resolve => require([`@/views/employee/editEmployee.vue`], resolve)
},
{
name: 'Account2EmployeeDetailEmployee',
path: '/employee/detailEmployee/:id',
meta: {},
component: resolve => require([`@/views/employee/detailEmployee.vue`], resolve)
}
])
export default staticRoutes
\ No newline at end of file
......@@ -13,237 +13,6 @@
:businessScopeCustomize="businessScopeCustomize"
:businessOption="businessOption"
></base-info>
<!-- <el-form
ref="baseForm"
:model="accountAddForm"
class="account-body-form"
label-width="120px"
:rules="baseRules"
>
<el-row>
<el-col :span="12">
<el-form-item label="商户名称" prop="merchantName">
<el-input
size="small"
v-model="accountAddForm.merchantName"
placeholder="请输入商户名称"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="商户简称">
<el-input
size="small"
v-model="accountAddForm.merchantAbbreviation"
placeholder="请输入商户简称"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item
size="small" label="商户类型" class="merchant-row">
<el-input
v-model="accountAddForm.merchantOrgcode"
placeholder="请输入组织机构号码"
v-if="accountAddForm.merchantType == 2"
>
<el-select
v-model="accountAddForm.merchantType"
slot="prepend"
placeholder="请选择"
>
<el-option label="个人" value="1"></el-option>
<el-option label="企业" value="2"></el-option>
</el-select>
</el-input>
<el-input
size="small"
maxlength="18"
v-model="accountAddForm.merchantOrgcode"
placeholder="请输入正确的身份证号"
v-if="accountAddForm.merchantType == 1"
>
<el-select
v-model="accountAddForm.merchantType"
slot="prepend"
placeholder="请选择"
>
<el-option label="个人" value="1"></el-option>
<el-option label="企业" value="2"></el-option>
</el-select>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item size="small" label="商户地址" class="form-row">
<el-input v-model="accountAddForm.merchantAddress"> </el-input>
<el-button
readonly
type="primary"
class="form-btn"
@click="dialogMapVisible = true"
>选择地址</el-button
>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="联系电话" prop="merchantLegalPersonPhone">
<el-input
maxlength="11"
size="small"
v-model="accountAddForm.merchantLegalPersonPhone"
placeholder="请输入联系电话"
></el-input>
<el-checkbox v-model="accountAddForm.isloginName"
>联系电话同时作为登录账户名</el-checkbox
>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系人">
<el-input
size="small"
v-model="accountAddForm.merchantLegalPerson"
placeholder="请输入联系人"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="驻店联系人">
<el-input
maxlength="11"
size="small"
v-model="accountAddForm.residentContact"
placeholder="请输入驻店联系人"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="驻店电话">
<el-input
maxlength="11"
size="small"
v-model="accountAddForm.residentPhone"
placeholder="请输入驻店电话"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="营业范围">
<el-checkbox-group v-model="accountAddForm.businessScope">
<el-checkbox
v-for="item in businessOption"
:label="item.dictValue"
:key="item"
>{{ item.dictLabel }}</el-checkbox
>
</el-checkbox-group>
<div
class="scrm-flex-center"
v-for="(item, index) in businessScopeCustomize"
:key="index"
>
<el-input
size="small"
v-model="businessScopeCustomize[index].name"
placeholder="请自定义营业范围,建议不超过10个"
></el-input>
<i
class="el-icon-circle-plus el-icon-btn"
@click="addBusinessScope"
v-if="index == businessScopeCustomize.length - 1"
></i>
<i
class="el-icon-remove el-icon-btn"
@click="removeBusinessScope"
v-else
></i>
</div>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="营业时间" class="open-time">
<el-time-picker
size="small"
value-format="HH:mm:ss"
is-range
v-model="accountAddForm.bussinessTime"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
placeholder="选择时间范围"
></el-time-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="主营品牌">
<el-input size="small" v-model="filterText"></el-input>
<div class="brand-tree">
<el-tree
:data="brandData"
show-checkbox
default-expand-all
node-key="id"
ref="brandTree"
highlight-current
:props="defaultProps"
:filter-node-method="filterNode"
>
</el-tree>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="门店照片">
<div class="store-upload-list">
<template
v-if="
accountAddForm.merchantFiles &&
accountAddForm.merchantFiles.length > 0
"
>
<div
:key="index"
v-for="(item, index) in accountAddForm.merchantFiles"
class="store-border"
>
<img :src="item.fileUrl" />
<div class="uploader-del-icon">
<i class="el-icon-delete-solid" @click.stop="delImg(index)"></i>
</div>
</div>
</template>
<el-upload
action=""
class="image-uploader"
:show-file-list="false"
list-type="picture-card"
v-loading="loadingImg"
:before-upload="upLoadImg"
>
<i class="el-icon-plus"></i>
</el-upload>
</div>
<div class="tips">图片格式仅支持JPG,PNG格式,大小1M</div>
</el-form-item>
</el-col>
</el-row>
</el-form> -->
</div>
<div class="account-body scrm-box-f">
<div class="form-title">账户信息</div>
......@@ -268,7 +37,7 @@
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="账户等级">
<el-form-item label="账户等级" class="level-row">
<el-select
size="small"
:disabled="nextStatus"
......@@ -441,16 +210,7 @@ export default {
},
};
},
watch: {
filterText(val) {
this.$refs.brandTree.filter(val);
},
},
methods: {
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
getAddress() {
this.dialogMapVisible = false;
this.accountAddForm.merchantAddress = this.$refs.mapForm.address;
......@@ -464,40 +224,6 @@ export default {
this.accounttypeId.splice(idx, 1);
}
},
upLoadImg(file) {
let fileName = file.name;
if (file.name.lastIndexOf(".") === -1) {
this.$message.info("路径不正确");
return false;
}
let AllImgExt = ".jpg|.jpeg|.gif|.bmp|.png|.swf";
let extName = file.name.substring(file.name.lastIndexOf(".")).toLowerCase();
if (AllImgExt.indexOf(extName + "|") === -1) {
this.$message.info("图片格式不正确");
return false;
}
// if (fileSize < 3145728) {
if (window.FileReader) {
let reader = new FileReader();
let self = this;
reader.readAsDataURL(file);
reader.onload = (img) => {
console.log(file);
let type = fileName.split(".")[1];
let imgUrl = img.target.result.split(",")[1];
self.loadingImg = true;
self.$apis.common
.pictureUpload({
file: `${type}@${imgUrl}`,
})
.then((res) => {
if (res) {
console.log(res);
}
});
};
}
},
handleSave(status) {
if (this.$refs.productForm.getSelectInfo().length == 0) {
this.$message.error("请选择产品");
......@@ -563,6 +289,7 @@ export default {
params.businessScopeCustomize = businessScopeCustomize.join(",");
params.accounttypeId = this.accounttypeId.join(",");
params.merchantFiles = JSON.stringify(params.merchantFiles)
params.merchantModel = this.accountDetail.merchantModel;
let merchant;
if (this.nextStatus) {
merchant = "updateMerchant";
......@@ -582,7 +309,7 @@ export default {
id: this.parentId,
parentId: this.accountAddForm.parentId,
};
this.$refs.productForm.findMenuFunTreeByMerId(para);
this.$refs.productForm.findMenuFunTreeByMerId(para,this.accounttypeId);
}
this.twoMerchantDetail(this.parentId);
}
......@@ -612,14 +339,22 @@ export default {
id: this.accountAddForm.parentId,
});
this.$apis.store.findAllDictData({ dictType: "account_level" }).then((res) => {
this.accountLevel = res
// if (this.accountDetail.merchantAccountLevel == 1) {
// this.accountLevel = res.filter((item) => {
// item.dictValue != 1 && item.dictValue != 3;
// });
// console.log
// this.accountDetail.merchantAccountLevel = 2;
// }
if (this.accountDetail.merchantAccountLevel == 1) {
this.accountLevel = res.filter((item) => {
return item.dictValue != 1 && item.dictValue != 3;
});
this.accountDetail.merchantAccountLevel = 2;
}else if (this.accountDetail.merchantAccountLevel == 2) {
this.accountLevel = res.filter((item) => {
return item.dictValue != 1 && item.dictValue != 2;
});
this.accountDetail.merchantAccountLevel = 3;
}else{
this.accountLevel = res.filter((item) => {
return item.dictValue == 4;
});
this.accountDetail.merchantAccountLevel = 4;
}
});
},
twoMerchantDetail(pid) {
......@@ -742,6 +477,11 @@ export default {
}
}
}
.level-row {
/deep/ .el-select {
width: 100%;
}
}
.el-icon-btn {
color: #5850ff;
font-size: 16px;
......
......@@ -40,8 +40,8 @@
slot="prepend"
placeholder="请选择"
>
<el-option label="个人" value="1"></el-option>
<el-option label="企业" value="2"></el-option>
<el-option label="个人" :value="1"></el-option>
<el-option label="企业" :value="2"></el-option>
</el-select>
</el-input>
<el-input
......@@ -67,10 +67,7 @@
<el-col :span="24">
<el-form-item size="small" label="商户地址" class="form-row">
<el-input readonly v-model="accountAddForm.merchantAddress"> </el-input>
<el-button
type="primary"
class="form-btn"
@click="dialogMapVisible = true"
<el-button type="primary" class="form-btn" @click="dialogMapVisible = true"
>选择地址</el-button
>
</el-form-item>
......@@ -258,7 +255,7 @@ export default {
},
businessScopeCustomize: {
type: Array,
}
},
},
data() {
const validatePhone = (rule, value, callback) => {
......@@ -285,18 +282,26 @@ export default {
},
};
},
watch: {
filterText(val) {
this.$refs.brandTree.filter(val);
},
},
methods: {
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
getAddress() {
if(!this.$refs.mapForm.address) {
if (!this.$refs.mapForm.address) {
this.$message.error("请选择地址");
return;
}
this.dialogMapVisible = false;
this.accountAddForm.merchantAddress = this.$refs.mapForm.address;
let lnglat = this.$refs.mapForm.lnglat
this.accountAddForm.lat = lnglat.lat
this.accountAddForm.lng = lnglat.lng
let lnglat = this.$refs.mapForm.lnglat;
this.accountAddForm.lat = lnglat.lat;
this.accountAddForm.lng = lnglat.lng;
},
delImg(index) {
this.accountAddForm.merchantFiles.splice(index, 1);
......@@ -337,9 +342,8 @@ export default {
if (res) {
self.accountAddForm.merchantFiles.push({
fileUrl: res,
fileName: ''
fileName: "",
});
console.log(self.accountAddForm.merchantFiles)
}
});
};
......
<template>
<div class="account-body scrm-box-f">
<div class="account-body scrm-box-f" v-loading="loading">
<div class="account-title">{{title}}</div>
<el-tabs v-model="tabName" type="card">
<el-tab-pane
......@@ -84,6 +84,7 @@ export default {
data() {
return {
loading: false,
treeHeight: 300,
tabMenu: [],
selectIndex: 0,
......@@ -102,6 +103,7 @@ export default {
methods: {
selectPro(data) {
this.$parent.editStatus = true;
this.productTab = data.length != 0 ? data[data.length - 1].productId : "";
const { tabName, tabMenu, productTab } = this;
console.log(tabName, data);
......@@ -143,6 +145,7 @@ export default {
},
// 获取当前的所有权限
async accountTypeSearchRequest(params,status) {
this.loading = true;
let account = ''
if(status) {
account = 'findMenuFunTreeByMerId'
......@@ -193,6 +196,7 @@ export default {
// products
// }
// })
this.loading = false;
res.forEach((item) => {
this.tabMenu.forEach((itm) => {
if (item.accounttypeId == itm.accounttypeId) {
......@@ -235,6 +239,7 @@ export default {
}
},
clickDeal(currentObj, treeStatus) {
this.$parent.editStatus = true;
// 用于:父子节点严格互不关联时,父节点勾选变化时通知子节点同步变化,实现单向关联。
let selected = treeStatus.checkedKeys.indexOf(currentObj.id); // -1未选中
// 选中
......
......@@ -206,6 +206,15 @@
<GLTable ref="updateRecord" :tableTotal="tableTotal" :tableData="updateRecordList" :hasNum="true" :pageConf="pageConf" :tableParams="thirdtableParams" @refreshTable="getThirdTable"></GLTable>
</div>
</div>
<div
class="footer-panel"
:style="{
left: footerLeft + 'px',
width: footerWidth + 'px'
}"
>
<el-button type="primary" @click="handleCancel">关闭</el-button>
</div>
</div>
</template>
<script>
......@@ -327,6 +336,9 @@ export default {
// },
methods: {
handleCancel() {
this.$router.push('/account/index')
},
tabClick(index) {
this.curIndex = index
switch (index) {
......@@ -440,6 +452,8 @@ export default {
},
mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.getThirdTable()
this.getSecondTable()
}
......@@ -448,6 +462,7 @@ export default {
<style lang="scss" scoped>
.merchantDetail {
padding-bottom: 60px;
.titles {
display: flex;
margin-bottom: 20px;
......@@ -584,7 +599,7 @@ export default {
}
.contentTree {
padding: 20px;
max-height: 250px;
height: 250px;
position: relative;
overflow: auto;
......@@ -732,5 +747,17 @@ export default {
padding: 20px;
}
}
.footer-panel {
display: flex;
align-items: center;
justify-content: center;
position: fixed;
width: 100%;
bottom: 0px;
height: 64px;
background: #ffffff;
z-index: 999;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
}
}
</style>
<template>
<div class="scrm-main">
<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>
<div data-v-db55ad92="" class="tab-edit-status el-tabs el-tabs--top">
<div class="el-tabs__header is-top">
<div class="el-tabs__nav-wrap is-top">
<div class="el-tabs__nav-scroll">
<div
role="tablist"
class="el-tabs__nav is-top"
style="transform: translateX(0px)"
>
<div
class="el-tabs__active-bar is-top"
:style="{ width: '84px', transform: 'translateX(' + tabWidth + 'px)' }"
></div>
<div
@click="hanleTab(1)"
id="tab-first"
aria-controls="pane-first"
role="tab"
aria-selected="true"
tabindex="0"
class="el-tabs__item is-top"
:class="{ 'is-active': step == 'first' }"
>
修改功能权限
</div>
<div
@click="hanleTab(2)"
id="tab-second"
aria-controls="pane-second"
role="tab"
tabindex="-1"
class="el-tabs__item is-top"
:class="{ 'is-active': step == 'second' }"
>
修改基本信息
</div>
</div>
</div>
</div>
</div>
<div class="el-tabs__content">
<div
data-v-db55ad92=""
role="tabpanel"
id="pane-first"
aria-labelledby="tab-first"
class="el-tab-pane"
></div>
<div
data-v-db55ad92=""
role="tabpanel"
aria-hidden="true"
id="pane-second"
aria-labelledby="tab-second"
class="el-tab-pane"
style="display: none"
></div>
</div>
</div>
<div v-show="step == 'second'">
<div class="account-body scrm-box-f">
<div class="form-title">修改账户信息</div>
......@@ -80,231 +135,6 @@
:businessScopeCustomize="businessScopeCustomize"
:businessOption="businessOption"
></base-info>
<!-- <el-form
ref="baseForm"
:model="accountAddForm"
class="account-body-form"
label-width="120px"
:rules="baseRules"
>
<el-row>
<el-col :span="12">
<el-form-item label="商户名称" prop="merchantName">
<el-input
size="small"
v-model="accountAddForm.merchantName"
placeholder="请输入商户名称"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="商户简称">
<el-input
size="small"
v-model="accountAddForm.merchantAbbreviation"
placeholder="请输入商户简称"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="商户类型" class="merchant-row">
<el-input
size="small"
v-model="accountAddForm.merchantOrgcode"
placeholder="请输入组织机构号码"
v-if="accountAddForm.merchantType == 2"
>
<el-select
v-model="accountAddForm.merchantType"
slot="prepend"
placeholder="请选择"
>
<el-option label="个人" :value="1"></el-option>
<el-option label="企业" :value="2"></el-option>
</el-select>
</el-input>
<el-input
size="small"
v-model="accountAddForm.merchantOrgcode"
placeholder="请输入正确的身份证号"
v-if="accountAddForm.merchantType == 1"
>
<el-select
v-model="accountAddForm.merchantType"
slot="prepend"
placeholder="请选择"
>
<el-option label="个人" :value="1"></el-option>
<el-option label="企业" :value="2"></el-option>
</el-select>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item size="small" label="商户地址" class="form-row">
<el-input readonly size="small" v-model="accountAddForm.merchantAddress"> </el-input>
<el-button type="primary" class="form-btn" @click="dialogMapVisible = true"
>选择地址</el-button
>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="联系电话" prop="merchantLegalPersonPhone">
<el-input
maxlength="11"
size="small"
v-model="accountAddForm.merchantLegalPersonPhone"
placeholder="请输入联系电话"
></el-input>
<el-checkbox v-model="accountAddForm.isloginName"
>联系电话同时作为登录账户名</el-checkbox
>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系人">
<el-input
size="small"
v-model="accountAddForm.merchantLegalPerson"
placeholder="请输入联系人"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="驻店联系人">
<el-input
maxlength="11"
size="small"
v-model="accountAddForm.residentContact"
placeholder="请输入驻店联系人"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="驻店电话">
<el-input
size="small"
v-model="accountAddForm.residentPhone"
placeholder="请输入驻店电话"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="营业范围">
<el-checkbox-group v-model="accountAddForm.businessScope">
<el-checkbox
v-for="item in businessOption"
:label="item.dictValue"
:key="item"
>{{ item.dictLabel }}</el-checkbox
>
</el-checkbox-group>
<div
class="scrm-flex-center"
v-for="(item, index) in businessScopeCustomize"
:key="index"
>
<el-input
size="small"
v-model="businessScopeCustomize[index].name"
placeholder="请自定义营业范围,建议不超过10个"
></el-input>
<i
class="el-icon-circle-plus el-icon-btn"
@click="addBusinessScope"
v-if="index == businessScopeCustomize.length - 1"
></i>
<i
class="el-icon-remove el-icon-btn"
@click="removeBusinessScope"
v-else
></i>
</div>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="营业时间">
<el-time-picker
size="small"
value-format="HH:mm:ss"
is-range
v-model="accountAddForm.bussinessTime"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
placeholder="选择时间范围"
></el-time-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="主营品牌">
<el-input size="small" v-model="filterText"></el-input>
<div class="brand-tree">
<el-tree
:data="brandData"
show-checkbox
default-expand-all
node-key="id"
ref="brandTree"
highlight-current
:props="defaultProps"
:filter-node-method="filterNode"
>
</el-tree>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="门店照片">
<div class="store-upload-list">
<template
v-if="
accountAddForm.merchantFiles &&
accountAddForm.merchantFiles.length > 0
"
>
<div
:key="index"
v-for="(item, index) in accountAddForm.merchantFiles"
class="store-border"
>
<img :src="item.fileUrl" />
<div class="uploader-del-icon">
<i class="el-icon-delete-solid" @click.stop="delImg(index)"></i>
</div>
</div>
</template>
<el-upload
action=""
class="image-uploader"
:show-file-list="false"
list-type="picture-card"
v-loading="loadingImg"
:before-upload="upLoadImg"
>
<i class="el-icon-plus"></i>
</el-upload>
</div>
<div class="tips">图片格式仅支持JPG,PNG格式,大小1M</div>
</el-form-item>
</el-col>
</el-row>
</el-form> -->
</div>
</div>
<div v-show="step == 'first'">
......@@ -317,10 +147,10 @@
width: footerWidth + 'px',
}"
>
<el-button type="primary" @click="handleSave" v-show="step == 'first'"
<el-button type="primary" @click="handleSave()" v-show="step == 'first'"
>确定</el-button
>
<el-button type="primary" @click="handleNext" v-show="step == 'second'"
<el-button type="primary" @click="handleNext()" v-show="step == 'second'"
>确定</el-button
>
<el-button type="primary" @click="handleCancel">取消</el-button>
......@@ -350,6 +180,8 @@ export default {
},
data() {
return {
editStatus: false,
tabWidth: 0,
editInfo: {},
pwdStatus: true,
step: "first",
......@@ -416,8 +248,42 @@ export default {
filterText(val) {
this.$refs.brandTree.filter(val);
},
accountAddForm: {
handler() {
this.editStatus = true;
},
deep: true,
},
},
methods: {
hanleTab(status) {
if (this.editStatus) {
this.$confirm("离开将不保存本页修改", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.handleNext(status);
})
.catch(() => {
this.handleTabs(status);
});
} else {
this.handleTabs(status);
}
},
handleTabs(status) {
this.editStatus = false;
if (status == 1 && this.step == "second") {
this.tabWidth = 0;
this.step = "first";
}
if (status == 2 && this.step == "first") {
this.step = "second";
this.tabWidth = 124;
}
},
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
......@@ -427,49 +293,10 @@ export default {
this.accountAddForm.merchantAddress = this.$refs.mapForm.address;
console.log(this.accountAddForm.merchantAddress);
},
delImg(index) {
this.accountAddForm.merchantFiles.splice(index, 1);
},
upLoadImg(file) {
let fileName = file.name;
if (file.name.lastIndexOf(".") === -1) {
this.$message.info("路径不正确");
return false;
}
let AllImgExt = ".jpg|.jpeg|.gif|.bmp|.png|.swf";
let extName = file.name.substring(file.name.lastIndexOf(".")).toLowerCase();
if (AllImgExt.indexOf(extName + "|") === -1) {
this.$message.info("图片格式不正确");
return false;
}
// if (fileSize < 3145728) {
if (window.FileReader) {
let reader = new FileReader();
let self = this;
reader.readAsDataURL(file);
reader.onload = (img) => {
console.log(file);
let type = fileName.split(".")[1];
let imgUrl = img.target.result.split(",")[1];
self.loadingImg = true;
self.$apis.common
.pictureUpload({
file: `${type}@${imgUrl}`,
})
.then((res) => {
if (res) {
self.accountAddForm.merchantFiles.push({
fileUrl: res,
});
}
});
};
}
},
handleCancel() {
this.$router.push("/account/index");
},
handleSave() {
handleSave(status) {
if (this.$refs.productForm.getSelectInfo().length == 0) {
this.$message.error("请选择产品");
return;
......@@ -482,12 +309,12 @@ export default {
};
this.$apis.store.updatePermissions(params).then((res) => {
if (res) {
this.$router.push("/account/index");
status ? this.handleTabs(status) : this.$router.push("/account/index");
}
});
},
//下一步
handleNext() {
handleNext(status) {
const pm1 = new Promise((resolve, reject) => {
this.$refs.baseInfoForm.$refs.baseForm.validate((valid) => {
if (valid) resolve();
......@@ -512,11 +339,11 @@ export default {
params.isloginName ? (params.isloginName = 1) : (params.isloginName = 0);
let businessScopeCustomize = this.businessScopeCustomize.map((item) => item.name);
params.businessScopeCustomize = businessScopeCustomize.join(",");
params.merchantFiles = JSON.stringify(params.merchantFiles)
params.merchantFiles = JSON.stringify(params.merchantFiles);
Promise.all([pm1, pm2]).then(() => {
this.$apis.store.updateMerchant(params).then((res) => {
if (res) {
this.$router.push("/account/index");
status ? this.handleTabs(status) : this.$router.push("/account/index");
}
});
});
......@@ -545,20 +372,20 @@ export default {
})
.then((res) => {
let para;
if(res.parentMerchant) {
if (res.parentMerchant) {
para = {
id: this.accountAddForm.id,
parentId: res.parentId,
accountLevel: res.merchantAccountLevel,
};
}else {
id: this.accountAddForm.id,
parentId: res.parentId,
accountLevel: res.merchantAccountLevel,
};
} else {
para = {
ids: res.accountType,
merchantId: res.id,
accountLevel: res.merchantAccountLevel,
};
ids: res.accountType,
merchantId: res.id,
accountLevel: res.merchantAccountLevel,
};
}
this.$refs.productForm.accountTypeSearchRequest(para,res.parentMerchant);
this.$refs.productForm.accountTypeSearchRequest(para, res.parentMerchant);
let {
isloginName,
bussinessBegintime,
......@@ -588,8 +415,10 @@ export default {
this.accountInfoForm.merchantLoginAccount = merchantLoginAccount;
this.accountInfoForm.merchantLoginPassword = merchantLoginPassword;
this.accountTypes = accountTypes;
businessScope = businessScope ? businessScope.split(",") : [];
if (businessScope.length > 0) {
this.accountAddForm.businessScope = businessScope
? businessScope.split(",")
: [];
if (this.accountAddForm.businessScope.length > 0) {
for (let i in this.accountAddForm.businessScope) {
this.accountAddForm.businessScope[i] = parseInt(
this.accountAddForm.businessScope[i]
......@@ -645,6 +474,9 @@ export default {
merchantAccountLevel,
merchantModel,
});
this.$nextTick(() => {
this.editStatus = false;
});
});
},
getCarbrandTree() {
......
<template>
<div class="scrm-main">
<div class="form-header">
<div class="form-header" v-if="$globalState.session.accountLevel == 1">
<el-button type="primary" @click="handleContact" size="small" icon="el-icon-link"
>门店账户关联企微</el-button
>
......@@ -124,7 +124,7 @@
<el-button
type="text"
@click="handleAdd(scope.scope)"
v-if="scope.scope.status == 2 && $globalState.session.accountLevel != 4"
v-if="scope.scope.status == 2 && scope.scope.merchantAccountLevel != 4"
>创建子商户/门店</el-button
>
</template>
......@@ -219,6 +219,10 @@ export default {
prop: "merchantLegalPersonPhone",
width: "120px",
},
{
label: "更新时间",
prop: "updatedTime"
},
],
},
layout: "sizes, prev, pager, next, jumper, ->, total",
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!