更新了商户批发价功能
This commit is contained in:
parent
2662e98a96
commit
182f8f8507
@ -1,34 +1,76 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-row >
|
||||
<el-row>
|
||||
<el-col v-bind="grid">
|
||||
<div class="Nav">
|
||||
<div class="input">
|
||||
<el-input v-model="filterText" placeholder="选择分类" prefix-icon="el-icon-search" style="width: 100%;" clearable />
|
||||
<el-input
|
||||
v-model="filterText"
|
||||
placeholder="选择分类"
|
||||
prefix-icon="el-icon-search"
|
||||
style="width: 100%"
|
||||
clearable
|
||||
/>
|
||||
</div>
|
||||
<div class="trees-coadd">
|
||||
<div class="scollhide">
|
||||
<div class="trees">
|
||||
<el-tree ref="tree" :data="treeData2" :filter-node-method="filterNode" :props="defaultProps">
|
||||
<div slot-scope="{ node, data}" class="custom-tree-node" @click.stop="handleNodeClick(data)">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
:data="treeData2"
|
||||
:filter-node-method="filterNode"
|
||||
:props="defaultProps"
|
||||
>
|
||||
<div
|
||||
slot-scope="{ node, data }"
|
||||
class="custom-tree-node"
|
||||
@click.stop="handleNodeClick(data)"
|
||||
>
|
||||
<div>
|
||||
<span>{{ node.label }}</span>
|
||||
<span v-if="data.space_property_name" style="font-size: 11px;color: #3889b1">({{ data.attachment_category_name }})</span>
|
||||
<span
|
||||
v-if="data.space_property_name"
|
||||
style="font-size: 11px; color: #3889b1"
|
||||
>({{ data.attachment_category_name }})</span
|
||||
>
|
||||
</div>
|
||||
<span class="el-ic">
|
||||
<i class="el-icon-circle-plus-outline" @click.stop="onAdd(data.attachment_category_id)" />
|
||||
<i
|
||||
class="el-icon-circle-plus-outline"
|
||||
@click.stop="onAdd(data.attachment_category_id)"
|
||||
/>
|
||||
<!-- <svg-icon-->
|
||||
<!-- icon-class="danyuan"-->
|
||||
<!-- title="添加管理单元"-->
|
||||
<!-- class="icon-space"-->
|
||||
<!-- />-->
|
||||
<i v-if="data.space_id!='0' && (!data.children || data.children == 'undefined') && data.attachment_category_id" class="el-icon-edit" title="修改" @click.stop="onEdit(data.attachment_category_id)" />
|
||||
<i
|
||||
v-if="
|
||||
data.space_id != '0' &&
|
||||
(!data.children || data.children == 'undefined') &&
|
||||
data.attachment_category_id
|
||||
"
|
||||
class="el-icon-edit"
|
||||
title="修改"
|
||||
@click.stop="onEdit(data.attachment_category_id)"
|
||||
/>
|
||||
<!-- <svg-icon-->
|
||||
<!-- icon-class="detail"-->
|
||||
<!-- title="查看该空间详情"-->
|
||||
<!-- class="icon-space"-->
|
||||
<!-- />-->
|
||||
<i v-if="data.space_id!='0' && (!data.children || data.children == 'undefined') && data.attachment_category_id" class="el-icon-delete" title="删除分类" @click.stop="() => handleDelete(data.attachment_category_id)" />
|
||||
<i
|
||||
v-if="
|
||||
data.space_id != '0' &&
|
||||
(!data.children || data.children == 'undefined') &&
|
||||
data.attachment_category_id
|
||||
"
|
||||
class="el-icon-delete"
|
||||
title="删除分类"
|
||||
@click.stop="
|
||||
() => handleDelete(data.attachment_category_id)
|
||||
"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
</el-tree>
|
||||
@ -40,15 +82,49 @@
|
||||
<el-col v-bind="grid2" class="colLeft">
|
||||
<div v-loading="loading" class="conter">
|
||||
<div class="bnt">
|
||||
<el-button v-if="params !== '/merchant/config/picture'" size="small" type="primary" class="mb10 mr10" @click="checkPics">使用选中图片</el-button>
|
||||
<el-upload class="upload-demo mr10 mb15" :action="fileUrl" :on-success="handleSuccess" :headers="myHeaders" :show-file-list="false" multiple>
|
||||
<el-button
|
||||
v-if="params !== '/merchant/config/picture'"
|
||||
size="small"
|
||||
type="primary"
|
||||
class="mb10 mr10"
|
||||
@click="checkPics"
|
||||
>使用选中图片</el-button
|
||||
>
|
||||
<el-upload
|
||||
class="upload-demo mr10 mb15"
|
||||
:action="fileUrl"
|
||||
:on-success="handleSuccess"
|
||||
:headers="myHeaders"
|
||||
:show-file-list="false"
|
||||
multiple
|
||||
>
|
||||
<el-button size="small" type="primary">点击上传</el-button>
|
||||
</el-upload>
|
||||
|
||||
<el-button type="success" size="small" @click.stop="onAdd(0)">添加分类</el-button>
|
||||
<el-button type="error" size="small" class="mr10" :disabled="checkPicList.length===0" @click.stop="editPicList('图片')">删除图片</el-button>
|
||||
<el-input v-model="tableData.attachment_name" placeholder="请输入图片名称搜索" style="width: 230px;" @keyup.enter.native="getFileList(1)" size="small">
|
||||
<el-button slot="append" icon="el-icon-search" class="el-button-solt" @click="getFileList(1)" />
|
||||
<el-button type="success" size="small" @click.stop="onAdd(0)"
|
||||
>添加分类</el-button
|
||||
>
|
||||
<el-button
|
||||
type="error"
|
||||
size="small"
|
||||
class="mr10"
|
||||
:disabled="checkPicList.length === 0"
|
||||
@click.stop="editPicList('图片')"
|
||||
>删除图片</el-button
|
||||
>
|
||||
<el-input
|
||||
v-model="tableData.attachment_name"
|
||||
placeholder="请输入图片名称搜索"
|
||||
style="width: 230px"
|
||||
@keyup.enter.native="getFileList(1)"
|
||||
size="small"
|
||||
>
|
||||
<el-button
|
||||
slot="append"
|
||||
icon="el-icon-search"
|
||||
class="el-button-solt"
|
||||
@click="getFileList(1)"
|
||||
/>
|
||||
</el-input>
|
||||
<!--<el-select
|
||||
v-model="tableData.order"
|
||||
@ -66,35 +142,90 @@
|
||||
value="1"
|
||||
/>
|
||||
</el-select>-->
|
||||
<el-select v-model="sleOptions.attachment_category_name" placeholder="图片移动至" class="mb15" size="small">
|
||||
<el-option :label="sleOptions.attachment_category_name" :value="sleOptions.attachment_category_id" style="max-width: 560px;height:200px;overflow: auto;background-color:#fff">
|
||||
<el-tree ref="tree2" :data="treeData2" :filter-node-method="filterNode" :props="defaultProps" @node-click="handleSelClick" />
|
||||
<el-select
|
||||
v-model="sleOptions.attachment_category_name"
|
||||
placeholder="图片移动至"
|
||||
class="mb15"
|
||||
size="small"
|
||||
>
|
||||
<el-option
|
||||
:label="sleOptions.attachment_category_name"
|
||||
:value="sleOptions.attachment_category_id"
|
||||
style="
|
||||
max-width: 560px;
|
||||
height: 200px;
|
||||
overflow: auto;
|
||||
background-color: #fff;
|
||||
"
|
||||
>
|
||||
<el-tree
|
||||
ref="tree2"
|
||||
:data="treeData2"
|
||||
:filter-node-method="filterNode"
|
||||
:props="defaultProps"
|
||||
@node-click="handleSelClick"
|
||||
/>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="pictrueList acea-row mb15">
|
||||
<div v-show="isShowPic" class="imagesNo">
|
||||
<i class="el-icon-picture" style="font-size: 60px;color: rgb(219, 219, 219);" />
|
||||
<i
|
||||
class="el-icon-picture"
|
||||
style="font-size: 60px; color: rgb(219, 219, 219)"
|
||||
/>
|
||||
<span class="imagesNo_sp">图片库为空</span>
|
||||
</div>
|
||||
<div class="conters">
|
||||
<div v-for="(item, index) in pictrueList.list" :key="index" class="gridPic">
|
||||
<p class="number" v-if="item.num>0">
|
||||
<div
|
||||
v-for="(item, index) in pictrueList.list"
|
||||
:key="index"
|
||||
class="gridPic"
|
||||
>
|
||||
<p class="number" v-if="item.num > 0">
|
||||
<el-badge class="item" :value="item.num">
|
||||
<a href="#" class="demo-badge"></a>
|
||||
</el-badge>
|
||||
</p>
|
||||
<img v-lazy="item.attachment_src" :class="item.isSelect ? 'on': '' " @click="changImage(item, index, pictrueList.list)" />
|
||||
<div style="display: flex;align-items: center;justify-content: space-between">
|
||||
<el-input v-model="item.attachment_name" v-if="editId === item.attachment_id"></el-input>
|
||||
<p class="name" style="width: 80%" v-else>{{item.attachment_name}}</p>
|
||||
<i class="el-icon-edit" @click="handleEdit(item.attachment_id,item.attachment_name)" />
|
||||
<img
|
||||
v-lazy="item.attachment_src"
|
||||
:class="item.isSelect ? 'on' : ''"
|
||||
@click="changImage(item, index, pictrueList.list)"
|
||||
/>
|
||||
<div
|
||||
style="
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
"
|
||||
>
|
||||
<el-input
|
||||
v-model="item.attachment_name"
|
||||
v-if="editId === item.attachment_id"
|
||||
></el-input>
|
||||
<p class="name" style="width: 80%" v-else>
|
||||
{{ item.attachment_name }}
|
||||
</p>
|
||||
<i
|
||||
class="el-icon-edit"
|
||||
@click="
|
||||
handleEdit(item.attachment_id, item.attachment_name)
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="block">
|
||||
<el-pagination :page-sizes="[12, 20, 40, 60]" :page-size="tableData.limit" :current-page="tableData.page" layout="total, sizes, prev, pager, next, jumper" :total="pictrueList.total" @size-change="handleSizeChange" @current-change="pageChange" />
|
||||
<el-pagination
|
||||
:page-sizes="[12, 20, 40, 60]"
|
||||
:page-size="tableData.limit"
|
||||
:current-page="tableData.page"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="pictrueList.total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
@ -136,7 +267,7 @@ export default {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
data() {
|
||||
data () {
|
||||
return {
|
||||
loading: false,
|
||||
params: "",
|
||||
@ -190,7 +321,7 @@ export default {
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
fileUrl() {
|
||||
fileUrl () {
|
||||
return (
|
||||
SettingMer.https +
|
||||
`/upload/image/${this.tableData.attachment_category_id}/file`
|
||||
@ -198,25 +329,25 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
filterText(val) {
|
||||
filterText (val) {
|
||||
this.$refs.tree.filter(val);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
mounted () {
|
||||
this.params = this.$route && this.$route.path ? this.$route.path : "";
|
||||
if(this.$route && this.$route.query.field === "dialog")
|
||||
if (this.$route && this.$route.query.field === "dialog")
|
||||
import("../../../public/UEditor/dialogs/internal");
|
||||
this.getList();
|
||||
this.getFileList("");
|
||||
},
|
||||
methods: {
|
||||
// 搜索分类
|
||||
filterNode(value, data) {
|
||||
if(!value) return true;
|
||||
filterNode (value, data) {
|
||||
if (!value) return true;
|
||||
return data.attachment_category_name.indexOf(value) !== -1;
|
||||
},
|
||||
// 所有分类
|
||||
getList() {
|
||||
getList () {
|
||||
const data = {
|
||||
attachment_category_name: "全部图片",
|
||||
attachment_category_id: 0
|
||||
@ -232,10 +363,10 @@ export default {
|
||||
});
|
||||
},
|
||||
// 编辑图片名称
|
||||
handleEdit(id, name) {
|
||||
if(id === this.editId) {
|
||||
if(this.editName !== name) {
|
||||
if(!name.trim()) {
|
||||
handleEdit (id, name) {
|
||||
if (id === this.editId) {
|
||||
if (this.editName !== name) {
|
||||
if (!name.trim()) {
|
||||
this.$message.warning("请先输入图片名称");
|
||||
return;
|
||||
}
|
||||
@ -253,20 +384,20 @@ export default {
|
||||
}
|
||||
},
|
||||
// 添加分类
|
||||
onAdd(id) {
|
||||
onAdd (id) {
|
||||
const config = {};
|
||||
if(Number(id) > 0) config.formData = { pid: id };
|
||||
if (Number(id) > 0) config.formData = { pid: id };
|
||||
this.$modalForm(attachmentCreateApi(), config).then(({ message }) => {
|
||||
// this.$message.success(message)
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
// 编辑
|
||||
onEdit(id) {
|
||||
onEdit (id) {
|
||||
this.$modalForm(attachmentUpdateApi(id)).then(() => this.getList());
|
||||
},
|
||||
// 删除
|
||||
handleDelete(id) {
|
||||
handleDelete (id) {
|
||||
this.$modalSure().then(() => {
|
||||
attachmentDeleteApi(id)
|
||||
.then(({ message }) => {
|
||||
@ -278,15 +409,15 @@ export default {
|
||||
});
|
||||
});
|
||||
},
|
||||
handleNodeClick(data) {
|
||||
handleNodeClick (data) {
|
||||
this.tableData.attachment_category_id = data.attachment_category_id;
|
||||
this.selectItem = [];
|
||||
this.checkPicList = [];
|
||||
this.getFileList("");
|
||||
},
|
||||
// 上传成功
|
||||
handleSuccess(response) {
|
||||
if(response.status === 200) {
|
||||
handleSuccess (response) {
|
||||
if (response.status === 200) {
|
||||
this.$message.success("上传成功");
|
||||
this.getFileList("");
|
||||
} else {
|
||||
@ -294,19 +425,19 @@ export default {
|
||||
}
|
||||
},
|
||||
// 文件列表
|
||||
getFileList(num) {
|
||||
getFileList (num) {
|
||||
this.loading = true;
|
||||
this.tableData.page = num ? num : this.tableData.page;
|
||||
attachmentListApi(this.tableData)
|
||||
.then(async res => {
|
||||
this.pictrueList.list = res.data.list;
|
||||
console.log(this.pictrueList.list);
|
||||
if(this.pictrueList.list.length) {
|
||||
if (this.pictrueList.list.length) {
|
||||
this.isShowPic = false;
|
||||
} else {
|
||||
this.isShowPic = true;
|
||||
}
|
||||
if(
|
||||
if (
|
||||
this.$route &&
|
||||
this.$route.query.field &&
|
||||
this.$route.query.field !== "dialog"
|
||||
@ -321,18 +452,18 @@ export default {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
pageChange(page) {
|
||||
pageChange (page) {
|
||||
this.tableData.page = page;
|
||||
this.selectItem = [];
|
||||
this.checkPicList = [];
|
||||
this.getFileList("");
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
handleSizeChange (val) {
|
||||
this.tableData.limit = val;
|
||||
this.getFileList("");
|
||||
},
|
||||
// 选中图片
|
||||
changImage(item, index, row) {
|
||||
changImage (item, index, row) {
|
||||
// this.$set(item, 'isSelect', item.isSelect === undefined ? true : !item.isSelect)
|
||||
// selectItem = this.pictrueList.list.filter((item) => {
|
||||
// return item.isSelect === true
|
||||
@ -344,7 +475,7 @@ export default {
|
||||
// pic.push(item.attachment_src)
|
||||
// })
|
||||
// this.checkPicList = pic
|
||||
if(!item.isSelect) {
|
||||
if (!item.isSelect) {
|
||||
item.isSelect = true;
|
||||
this.selectItem.push(item);
|
||||
this.checkPicList.push(item.attachment_src);
|
||||
@ -353,28 +484,28 @@ export default {
|
||||
// this.checkPicList.push(item.attachment_src)
|
||||
item.isSelect = false;
|
||||
var index = this.ids.indexOf(item.attachment_id);
|
||||
if(index > -1) this.ids.splice(index, 1);
|
||||
if (index > -1) this.ids.splice(index, 1);
|
||||
// this.ids = []
|
||||
this.selectItem.forEach((o, i) => {
|
||||
if(o.attachment_id == item.attachment_id) {
|
||||
if (o.attachment_id == item.attachment_id) {
|
||||
this.selectItem.splice(i, 1);
|
||||
}
|
||||
});
|
||||
this.checkPicList.map((el, index) => {
|
||||
if(el == item.attachment_src) {
|
||||
if (el == item.attachment_src) {
|
||||
this.checkPicList.splice(index, 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
if(
|
||||
if (
|
||||
!this.$route ||
|
||||
this.$route.fullPath !== "/merchant/config/picture" ||
|
||||
this.$route.query.field === "dialog"
|
||||
) {
|
||||
this.pictrueList.list.map((el, i) => {
|
||||
if(el.isSelect) {
|
||||
if (el.isSelect) {
|
||||
this.selectItem.filter((el2, j) => {
|
||||
if(el.attachment_id == el2.attachment_id) {
|
||||
if (el.attachment_id == el2.attachment_id) {
|
||||
el.num = j + 1;
|
||||
}
|
||||
});
|
||||
@ -386,12 +517,12 @@ export default {
|
||||
console.log(this.pictrueList.list);
|
||||
},
|
||||
// 点击使用选中图片
|
||||
checkPics() {
|
||||
if(this.checkPicList.length) {
|
||||
console.log(this.$route);
|
||||
if(this.$route) {
|
||||
if(this.$route.query.type === "1") {
|
||||
if(this.checkPicList.length > 1)
|
||||
checkPics () {
|
||||
if (this.checkPicList.length) {
|
||||
// console.log(this.$route);
|
||||
if (this.$route) {
|
||||
if (this.$route.query.type === "1") {
|
||||
if (this.checkPicList.length > 1)
|
||||
return this.$message.warning("最多只能选一张图片");
|
||||
/* eslint-disable */
|
||||
form_create_helper.set(
|
||||
@ -400,7 +531,7 @@ export default {
|
||||
);
|
||||
form_create_helper.close(this.$route.query.field);
|
||||
}
|
||||
if(this.$route.query.type === "2") {
|
||||
if (this.$route.query.type === "2") {
|
||||
this.checkedAll = [...this.checkedMore, ...this.checkPicList];
|
||||
form_create_helper.set(
|
||||
this.$route.query.field,
|
||||
@ -408,9 +539,9 @@ export default {
|
||||
);
|
||||
form_create_helper.close(this.$route.query.field);
|
||||
}
|
||||
if(this.$route.query.field === "dialog") {
|
||||
if (this.$route.query.field === "dialog") {
|
||||
let str = "";
|
||||
for(let i = 0; i < this.checkPicList.length; i++) {
|
||||
for (let i = 0; i < this.checkPicList.length; i++) {
|
||||
str += '<img src="' + this.checkPicList[i] + '">';
|
||||
}
|
||||
/* eslint-disable */
|
||||
@ -419,7 +550,7 @@ export default {
|
||||
}
|
||||
} else {
|
||||
console.log(this.isMore, this.checkPicList.length);
|
||||
if(this.isMore === "1" && this.checkPicList.length > 1) {
|
||||
if (this.isMore === "1" && this.checkPicList.length > 1) {
|
||||
return this.$message.warning("最多只能选一张图片");
|
||||
}
|
||||
console.log(this.checkPicList);
|
||||
@ -430,7 +561,7 @@ export default {
|
||||
}
|
||||
},
|
||||
// 删除图片
|
||||
editPicList(tit) {
|
||||
editPicList (tit) {
|
||||
const ids = {
|
||||
ids: this.ids
|
||||
};
|
||||
@ -447,8 +578,8 @@ export default {
|
||||
});
|
||||
},
|
||||
// 移动分类点击
|
||||
handleSelClick(node) {
|
||||
if(this.ids.length) {
|
||||
handleSelClick (node) {
|
||||
if (this.ids.length) {
|
||||
this.sleOptions = {
|
||||
attachment_category_name: node.attachment_category_name,
|
||||
attachment_category_id: node.attachment_category_id
|
||||
@ -458,7 +589,7 @@ export default {
|
||||
this.$message.warning("请先选择图片");
|
||||
}
|
||||
},
|
||||
getMove() {
|
||||
getMove () {
|
||||
categoryApi(this.ids, this.sleOptions.attachment_category_id)
|
||||
.then(async res => {
|
||||
this.$message.success(res.message);
|
||||
@ -470,7 +601,7 @@ export default {
|
||||
this.$message.error(res.message);
|
||||
});
|
||||
},
|
||||
clearBoth() {
|
||||
clearBoth () {
|
||||
this.sleOptions = {
|
||||
attachment_category_name: "",
|
||||
attachment_category_id: ""
|
||||
@ -558,8 +689,8 @@ export default {
|
||||
.el-tree-node__content:hover {
|
||||
font-weight: bold;
|
||||
}
|
||||
/deep/ .el-tree-node:focus > .el-tree-node__content {
|
||||
background-color: #F5F7FA!important;
|
||||
/deep/ .el-tree-node:focus > .el-tree-node__content {
|
||||
background-color: #f5f7fa !important;
|
||||
}
|
||||
.el-tree--highlight-current
|
||||
.el-tree-node.is-current
|
||||
|
@ -10,23 +10,27 @@
|
||||
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
|
||||
|
||||
<div class="right-menu">
|
||||
<template v-if="device!=='mobile'">
|
||||
<header-notice/>
|
||||
<template v-if="device !== 'mobile'">
|
||||
<header-notice />
|
||||
<search id="header-search" class="right-menu-item" />
|
||||
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
||||
</template>
|
||||
<div class="platformLabel">{{ label.mer_name }}</div>
|
||||
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click" :hide-on-click="false">
|
||||
<el-dropdown
|
||||
class="avatar-container right-menu-item hover-effect"
|
||||
trigger="click"
|
||||
:hide-on-click="false"
|
||||
>
|
||||
<span class="el-dropdown-link fontSize">
|
||||
{{ adminInfo }}
|
||||
<i class="el-icon-arrow-down el-icon--right" />
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="goUser">
|
||||
<span style="display:block;">个人中心</span>
|
||||
<span style="display: block">个人中心</span>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item divided @click.native="goPassword">
|
||||
<span style="display:block;">修改密码</span>
|
||||
<span style="display: block">修改密码</span>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item divided>
|
||||
<el-dropdown placement="right-start" @command="handleCommand">
|
||||
@ -38,11 +42,10 @@
|
||||
</el-dropdown>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item divided @click.native="logout">
|
||||
<span style="display:block;">退出</span>
|
||||
<span style="display: block">退出</span>
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -67,11 +70,11 @@ export default {
|
||||
Search
|
||||
},
|
||||
watch: {
|
||||
sidebarStyle(newValue) {
|
||||
sidebarStyle (newValue) {
|
||||
this.sidebarStyle = newValue
|
||||
}
|
||||
},
|
||||
data() {
|
||||
data () {
|
||||
return {
|
||||
roterPre: roterPre,
|
||||
sideBar1:
|
||||
@ -88,10 +91,11 @@ export default {
|
||||
}),
|
||||
},
|
||||
|
||||
mounted() {
|
||||
mounted () {
|
||||
getBaseInfo()
|
||||
.then(res => {
|
||||
this.label = res.data
|
||||
this.label = res.data;
|
||||
this.$store.commit('user/SET_MERCHANT_TYPE', res.data.merchantType || {})
|
||||
})
|
||||
.catch(({ message }) => {
|
||||
this.$message.error(message);
|
||||
@ -99,7 +103,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
//切换菜单样式
|
||||
handleCommand(command) {
|
||||
handleCommand (command) {
|
||||
this.$store.commit('user/SET_SIDEBAR_STYLE', command);
|
||||
window.localStorage.setItem('sidebarStyle', command);
|
||||
if (this.sideBar1) {
|
||||
@ -113,16 +117,16 @@ export default {
|
||||
}
|
||||
// location.reload();
|
||||
},
|
||||
toggleSideBar() {
|
||||
toggleSideBar () {
|
||||
this.$store.dispatch("app/toggleSideBar");
|
||||
},
|
||||
goUser() {
|
||||
goUser () {
|
||||
this.$modalForm(editFormApi());
|
||||
},
|
||||
goPassword() {
|
||||
goPassword () {
|
||||
this.$modalForm(passwordFormApi());
|
||||
},
|
||||
async logout() {
|
||||
async logout () {
|
||||
await this.$store.dispatch("user/logout");
|
||||
this.$router.push(`${roterPre}/login?redirect=${this.$route.fullPath}`);
|
||||
}
|
||||
@ -217,7 +221,7 @@ export default {
|
||||
}
|
||||
.platformLabel {
|
||||
display: inline-block;
|
||||
background: #F0AA0B;
|
||||
background: #f0aa0b;
|
||||
color: #fff;
|
||||
vertical-align: text-bottom;
|
||||
font-size: 12px;
|
||||
@ -227,7 +231,6 @@ export default {
|
||||
border-radius: 10px;
|
||||
position: relative;
|
||||
top: -11px;
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
@ -25,7 +25,20 @@
|
||||
</el-menu>
|
||||
<template v-else>
|
||||
<template v-if="!isCollapse">
|
||||
<ul v-for="item in menuList" :key="item.route" style="padding: 0;"><li><div class="menu menu-one"><div class="menu-item" :class="{ active: pathCompute(item) }" @click="goPath(item)"><i :class="'menu-icon el-icon-' + item.icon"></i><span>{{ item.menu_name }}</span></div></div></li></ul>
|
||||
<ul v-for="item in menuList" :key="item.route" style="padding: 0">
|
||||
<li>
|
||||
<div class="menu menu-one">
|
||||
<div
|
||||
class="menu-item"
|
||||
:class="{ active: pathCompute(item) }"
|
||||
@click="goPath(item)"
|
||||
>
|
||||
<i :class="'menu-icon el-icon-' + item.icon"></i
|
||||
><span>{{ item.menu_name }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
<!--一级菜单点击后二级菜单展开样式-->
|
||||
<el-menu
|
||||
@ -38,7 +51,7 @@
|
||||
active-text-color="#303133"
|
||||
mode="vertical"
|
||||
>
|
||||
<div style="height: 100%;">
|
||||
<div style="height: 100%">
|
||||
<div class="sub-title">{{ menu_name }}</div>
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<div v-for="(itm, idx) in subMenuList" :key="idx">
|
||||
@ -55,7 +68,10 @@
|
||||
:to="resolvePath(onlyOneChild.route)"
|
||||
>
|
||||
<el-menu-item :index="resolvePath(onlyOneChild.route)">
|
||||
<item :icon="onlyOneChild.icon || (itm && itm.icon)":title="onlyOneChild.menu_name"/>
|
||||
<item
|
||||
:icon="onlyOneChild.icon || (itm && itm.icon)"
|
||||
:title="onlyOneChild.menu_name"
|
||||
/>
|
||||
</el-menu-item>
|
||||
</app-link>
|
||||
</template>
|
||||
@ -140,7 +156,7 @@ import variables from "@/styles/variables.scss";
|
||||
export default {
|
||||
components: { SidebarItem, Logo, AppLink, Item },
|
||||
mixins: [FixiOSBug],
|
||||
data() {
|
||||
data () {
|
||||
this.onlyOneChild = null;
|
||||
return {
|
||||
sideBar1:
|
||||
@ -159,14 +175,14 @@ export default {
|
||||
sidebarRouters: state => state.user.sidebarRouters,
|
||||
sidebarStyle: state => state.user.sidebarStyle,
|
||||
// 所有的路由信息
|
||||
routers() {
|
||||
routers () {
|
||||
let routers = this.$store.state.user.menuList
|
||||
? this.$store.state.user.menuList
|
||||
: [];
|
||||
return routers;
|
||||
}
|
||||
}),
|
||||
activeMenu() {
|
||||
activeMenu () {
|
||||
const route = this.$route;
|
||||
const { meta, path } = route;
|
||||
// if set path, the sidebar will highlight the path you set
|
||||
@ -175,49 +191,49 @@ export default {
|
||||
}
|
||||
return path;
|
||||
},
|
||||
showLogo() {
|
||||
showLogo () {
|
||||
return this.$store.state.settings.sidebarLogo;
|
||||
},
|
||||
variables() {
|
||||
variables () {
|
||||
return variables;
|
||||
},
|
||||
isCollapse() {
|
||||
isCollapse () {
|
||||
return !this.sidebar.opened;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
sidebarStyle(newValue, oldValue) {
|
||||
sidebarStyle (newValue, oldValue) {
|
||||
this.sideBar1 = newValue == "a" && oldValue != "a" ? false : true;
|
||||
this.setMenuWidth();
|
||||
},
|
||||
sidebar: {
|
||||
handler(newVal, oldVal) {
|
||||
if(this.sideBar1){
|
||||
handler (newVal, oldVal) {
|
||||
if (this.sideBar1) {
|
||||
this.getSubMenu();
|
||||
}
|
||||
},
|
||||
deep: true // 对象内部属性的监听,关键。
|
||||
},
|
||||
$route:{
|
||||
handler(newVal, oldVal) {
|
||||
if(this.sideBar1){
|
||||
$route: {
|
||||
handler (newVal, oldVal) {
|
||||
if (this.sideBar1) {
|
||||
this.getSubMenu();
|
||||
}
|
||||
},
|
||||
deep: true // 对象内部属性的监听,关键。
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
mounted () {
|
||||
this.getMenus();
|
||||
if(this.sideBar1){
|
||||
if (this.sideBar1) {
|
||||
this.getSubMenu();
|
||||
}else{
|
||||
} else {
|
||||
this.setMenuWidth();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 菜单选中后左侧宽度数值存储
|
||||
setMenuWidth() {
|
||||
setMenuWidth () {
|
||||
if (this.sideBar1) {
|
||||
if (this.subMenuList && this.subMenuList.length > 0 && !this.isCollapse) {
|
||||
this.$store.commit("user/SET_SIDEBAR_WIDTH", 270);
|
||||
@ -228,15 +244,15 @@ export default {
|
||||
this.$store.commit("user/SET_SIDEBAR_WIDTH", 180);
|
||||
}
|
||||
},
|
||||
ishttp(url) {
|
||||
ishttp (url) {
|
||||
return url.indexOf("http://") !== -1 || url.indexOf("https://") !== -1;
|
||||
},
|
||||
getMenus() {
|
||||
getMenus () {
|
||||
this.$store.dispatch("user/getMenus", {
|
||||
that: this
|
||||
});
|
||||
},
|
||||
hasOneShowingChild(children = [], parent) {
|
||||
hasOneShowingChild (children = [], parent) {
|
||||
const showingChildren = children.filter(item => {
|
||||
if (item.hidden) {
|
||||
return false;
|
||||
@ -257,7 +273,7 @@ export default {
|
||||
}
|
||||
return false;
|
||||
},
|
||||
resolvePath(routePath) {
|
||||
resolvePath (routePath) {
|
||||
if (isExternal(routePath)) {
|
||||
return routePath;
|
||||
}
|
||||
@ -266,13 +282,13 @@ export default {
|
||||
}
|
||||
return path.resolve(routePath, routePath);
|
||||
},
|
||||
goPath(item) {
|
||||
goPath (item) {
|
||||
this.menu_name = item.menu_name;
|
||||
if (item.children) {
|
||||
this.$store.commit("user/SET_SIDEBAR_WIDTH", 270);
|
||||
// console.log(this.pathCompute(item.children)+ 'sdxsds');
|
||||
this.subMenuList = item.children;
|
||||
window.localStorage.setItem("subMenuList",this.subMenuList);
|
||||
window.localStorage.setItem("subMenuList", this.subMenuList);
|
||||
let goUrl = this.resolvePath(this.getChild(item.children)[0].route);
|
||||
item.route = goUrl;
|
||||
this.$router.push({
|
||||
@ -281,14 +297,14 @@ export default {
|
||||
} else {
|
||||
this.$store.commit("user/SET_SIDEBAR_WIDTH", 130);
|
||||
this.subMenuList = [];
|
||||
window.localStorage.setItem("subMenuList",[]);
|
||||
window.localStorage.setItem("subMenuList", []);
|
||||
let goUrl = this.resolvePath(item.route);
|
||||
this.$router.push({
|
||||
path: goUrl
|
||||
});
|
||||
}
|
||||
},
|
||||
getChild(data) {
|
||||
getChild (data) {
|
||||
const result = [];
|
||||
data.forEach(item => {
|
||||
// 遍历树
|
||||
@ -308,32 +324,32 @@ export default {
|
||||
return result;
|
||||
},
|
||||
//判断当前页面父级菜单
|
||||
pathCompute(data) {
|
||||
console.log(this.$route)
|
||||
pathCompute (data) {
|
||||
// console.log(this.$route)
|
||||
const loop = child => {
|
||||
// 是否有子节点,有则继续遍历下一级,无则是叶子节点
|
||||
for (let i = 0; i < child.length; i++) {
|
||||
if(this.$route.path == child[i]['route'] || this.$route.meta.activeMenu == child[i]['route']){
|
||||
if (this.$route.path == child[i]['route'] || this.$route.meta.activeMenu == child[i]['route']) {
|
||||
return true;
|
||||
}
|
||||
if(loop(child[i].children || [])){
|
||||
if (loop(child[i].children || [])) {
|
||||
return true;
|
||||
};
|
||||
}
|
||||
return false;
|
||||
};
|
||||
if(!loop(data.children || [])){
|
||||
if (!loop(data.children || [])) {
|
||||
return this.$route.path == data.route;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
// 获取当前一级菜单的二级菜单
|
||||
getSubMenu(){
|
||||
getSubMenu () {
|
||||
for (let i = 0; i < this.menuList.length; i++) {
|
||||
if(this.pathCompute(this.menuList[i])){
|
||||
if (this.pathCompute(this.menuList[i])) {
|
||||
this.subMenuList = this.menuList[i].children;
|
||||
this.menu_name = this.menuList[i].menu_name;
|
||||
window.localStorage.setItem("subMenuList",this.menuList[i].children);
|
||||
window.localStorage.setItem("subMenuList", this.menuList[i].children);
|
||||
this.setMenuWidth();
|
||||
return;
|
||||
}
|
||||
@ -366,7 +382,7 @@ export default {
|
||||
color: #909399;
|
||||
width: 24px;
|
||||
}
|
||||
span{
|
||||
span {
|
||||
display: inline-block;
|
||||
color: #bfcbd9;
|
||||
}
|
||||
@ -375,7 +391,6 @@ export default {
|
||||
}
|
||||
&:hover {
|
||||
background: rgba(67, 127, 253, 0.2);
|
||||
|
||||
}
|
||||
}
|
||||
.menu-two {
|
||||
@ -405,8 +420,8 @@ export default {
|
||||
top: 0;
|
||||
left: 130px;
|
||||
box-shadow: 2px 0px 4px 0px rgba(0, 0, 0, 0.06);
|
||||
.subMenu2{
|
||||
background: #ffffff!important;
|
||||
.subMenu2 {
|
||||
background: #ffffff !important;
|
||||
}
|
||||
.sub-title {
|
||||
font-weight: 600;
|
||||
@ -414,7 +429,8 @@ export default {
|
||||
font-size: 18px;
|
||||
padding: 20px;
|
||||
}
|
||||
/deep/.el-menu-item,/deep/.el-submenu__title {
|
||||
/deep/.el-menu-item,
|
||||
/deep/.el-submenu__title {
|
||||
height: 46px;
|
||||
line-height: 46px;
|
||||
// background: #ffffff !important;
|
||||
@ -422,19 +438,21 @@ export default {
|
||||
font-size: 13px;
|
||||
|
||||
&:hover {
|
||||
background: #ECF2FE !important;
|
||||
background: #ecf2fe !important;
|
||||
color: #303133 !important;
|
||||
.el-submenu__title{
|
||||
background: #ECF2FE !important;
|
||||
.el-submenu__title {
|
||||
background: #ecf2fe !important;
|
||||
color: #303133 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
/deep/.subMenu2 .el-submenu__title{
|
||||
padding-left: 15px!important;
|
||||
/deep/.subMenu2 .el-submenu__title {
|
||||
padding-left: 15px !important;
|
||||
}
|
||||
/deep/.router-link-active .el-menu-item, /deep/.el-menu-item.is-active,/deep/ .router-link-active .el-submenu__title{
|
||||
background: #ECF2FE !important;
|
||||
/deep/.router-link-active .el-menu-item,
|
||||
/deep/.el-menu-item.is-active,
|
||||
/deep/ .router-link-active .el-submenu__title {
|
||||
background: #ecf2fe !important;
|
||||
}
|
||||
}
|
||||
/deep/.menus-new .el-icon-arrow-down {
|
||||
@ -444,43 +462,48 @@ export default {
|
||||
min-width: 140px !important;
|
||||
font-size: 13px;
|
||||
}
|
||||
/deep/.menuOpen .el-menu-item,/deep/.menuOpen .el-menu-item,/deep/.menuOpen .el-submenu__title{
|
||||
padding-left: 15px!important;
|
||||
/deep/.menuOpen .el-menu-item,
|
||||
/deep/.menuOpen .el-menu-item,
|
||||
/deep/.menuOpen .el-submenu__title {
|
||||
padding-left: 15px !important;
|
||||
}
|
||||
/deep/.menuOpen .subMenu2 .el-submenu__title{
|
||||
padding-left: 30px!important;
|
||||
/deep/.menuOpen .subMenu2 .el-submenu__title {
|
||||
padding-left: 30px !important;
|
||||
}
|
||||
/deep/.style2 .is-active,/deep/.style2>.el-submenu:hover{
|
||||
background: #182848!important;
|
||||
/deep/.style2 .is-active,
|
||||
/deep/.style2 > .el-submenu:hover {
|
||||
background: #182848 !important;
|
||||
}
|
||||
/deep/.style2.menuTwo .el-submenu__title{
|
||||
/deep/.style2.menuTwo .el-submenu__title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
/deep/.subMenu1 .menuTwo .el-submenu__title:hover,/deep/.subMenu1 .menuTwo .el-menu-item:hover{
|
||||
background: #182848!important;
|
||||
/deep/.subMenu1 .menuTwo .el-submenu__title:hover,
|
||||
/deep/.subMenu1 .menuTwo .el-menu-item:hover {
|
||||
background: #182848 !important;
|
||||
}
|
||||
.menu-link{
|
||||
display: flex!important;
|
||||
.menu-link {
|
||||
display: flex !important;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
/deep/.menuStyle2 .el-submenu>.el-submenu__title>span{
|
||||
display: inline-block!important;
|
||||
visibility: visible!important;
|
||||
width: auto!important;
|
||||
height: auto!important;
|
||||
/deep/.menuStyle2 .el-submenu > .el-submenu__title > span {
|
||||
display: inline-block !important;
|
||||
visibility: visible !important;
|
||||
width: auto !important;
|
||||
height: auto !important;
|
||||
}
|
||||
/deep/.menuStyle2 .el-submenu{
|
||||
/deep/.menuStyle2 .el-submenu {
|
||||
padding: 0 20px;
|
||||
}
|
||||
/deep/.menuStyle2 .el-submenu .el-submenu__title{
|
||||
background: transparent!important;
|
||||
/deep/.menuStyle2 .el-submenu .el-submenu__title {
|
||||
background: transparent !important;
|
||||
}
|
||||
/deep/.subMenu1 .menuTwo .el-menu{
|
||||
background: #030C17!important;
|
||||
/deep/.subMenu1 .menuTwo .el-menu {
|
||||
background: #030c17 !important;
|
||||
}
|
||||
/deep/.subMenu1 .menuTwo .nest-menu .el-submenu>.el-submenu__title,/deep/.subMenu1 .menuTwo .el-submenu .el-menu-item{
|
||||
background: #030c17!important;
|
||||
/deep/.subMenu1 .menuTwo .nest-menu .el-submenu > .el-submenu__title,
|
||||
/deep/.subMenu1 .menuTwo .el-submenu .el-menu-item {
|
||||
background: #030c17 !important;
|
||||
}
|
||||
</style>
|
||||
|
@ -19,7 +19,8 @@ const state = {
|
||||
roles: [],
|
||||
menuList: JSON.parse(localStorage.getItem('MenuList')),
|
||||
sidebarWidth: window.localStorage.getItem('sidebarWidth'),
|
||||
sidebarStyle: window.localStorage.getItem('sidebarStyle')
|
||||
sidebarStyle: window.localStorage.getItem('sidebarStyle'),
|
||||
merchantType: JSON.parse(window.localStorage.getItem('merchantType') || '{}')
|
||||
}
|
||||
|
||||
const mutations = {
|
||||
@ -47,12 +48,16 @@ const mutations = {
|
||||
SET_SIDEBAR_STYLE: (state, style) => {
|
||||
state.sidebarStyle = style;
|
||||
window.localStorage.setItem('sidebarStyle', style);
|
||||
}
|
||||
},
|
||||
SET_MERCHANT_TYPE: (state, merchantType) => {
|
||||
state.merchantType = merchantType;
|
||||
window.localStorage.setItem('merchantType', JSON.stringify(merchantType));
|
||||
},
|
||||
}
|
||||
|
||||
const actions = {
|
||||
// user login
|
||||
login({ commit }, userInfo) {
|
||||
login ({ commit }, userInfo) {
|
||||
// const { username, password } = userInfo
|
||||
return new Promise((resolve, reject) => {
|
||||
login(userInfo).then(response => {
|
||||
@ -66,7 +71,7 @@ const actions = {
|
||||
})
|
||||
})
|
||||
},
|
||||
getMenus({ commit }) {
|
||||
getMenus ({ commit }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
getMenusApi().then(response => {
|
||||
commit('SET_MENU_LIST', response.data)
|
||||
@ -79,7 +84,7 @@ const actions = {
|
||||
})
|
||||
},
|
||||
// get user info
|
||||
getInfo({ commit, state }) {
|
||||
getInfo ({ commit, state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
getInfo(state.token).then(response => {
|
||||
const { data } = response
|
||||
@ -107,7 +112,7 @@ const actions = {
|
||||
},
|
||||
|
||||
// user logout
|
||||
logout({ commit, state, dispatch }) {
|
||||
logout ({ commit, state, dispatch }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
logout(state.token).then(() => {
|
||||
commit('SET_TOKEN', '')
|
||||
@ -127,7 +132,7 @@ const actions = {
|
||||
},
|
||||
|
||||
// remove token
|
||||
resetToken({ commit }) {
|
||||
resetToken ({ commit }) {
|
||||
return new Promise(resolve => {
|
||||
commit('SET_TOKEN', '')
|
||||
commit('SET_ROLES', [])
|
||||
@ -137,7 +142,7 @@ const actions = {
|
||||
},
|
||||
|
||||
// dynamically modify permissions
|
||||
changeRoles({ commit, dispatch }, role) {
|
||||
changeRoles ({ commit, dispatch }, role) {
|
||||
return new Promise(async resolve => {
|
||||
const token = role + '-token'
|
||||
|
||||
|
@ -448,7 +448,6 @@
|
||||
align="center"
|
||||
min-width="120"
|
||||
>
|
||||
|
||||
<template slot-scope="scope">
|
||||
<div v-if="formValidate.svip_price_type != 0">
|
||||
<el-input
|
||||
@ -893,12 +892,14 @@
|
||||
<el-col v-if="deliveryList.length > 0" :span="24">
|
||||
<el-form-item label="送货方式:" prop="delivery_way">
|
||||
<div class="acea-row">
|
||||
<el-checkbox-group style="pointer-events: none" v-model="formValidate.delivery_way">
|
||||
<el-checkbox-group
|
||||
style="pointer-events: none"
|
||||
v-model="formValidate.delivery_way"
|
||||
>
|
||||
<el-checkbox
|
||||
v-for="item in deliveryList"
|
||||
:key="item.value"
|
||||
:label="item.value"
|
||||
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-checkbox>
|
||||
@ -1290,7 +1291,7 @@ const defaultObj = {
|
||||
price: null,
|
||||
cost: null,
|
||||
ot_price: null,
|
||||
procure_price:null,
|
||||
procure_price: null,
|
||||
svip_price: null,
|
||||
stock: null,
|
||||
bar_code: '',
|
||||
@ -1315,7 +1316,7 @@ const defaultObj = {
|
||||
}
|
||||
const objTitle = {
|
||||
price: {
|
||||
title: '售价'
|
||||
title: '零售价'
|
||||
},
|
||||
cost: {
|
||||
title: '成本价'
|
||||
@ -1544,11 +1545,12 @@ export default {
|
||||
],
|
||||
type: 0,
|
||||
modals: false,
|
||||
// attrVal 商品规格内的字段设置
|
||||
attrVal: {
|
||||
price: null,
|
||||
cost: null,
|
||||
ot_price: null,
|
||||
procure_price:null,
|
||||
procure_price: null,
|
||||
stock: null,
|
||||
bar_code: '',
|
||||
weight: null,
|
||||
@ -1597,6 +1599,10 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
// console.log(this.$store.state.user.merchantType.type_code); // 店铺类型, 非市级供应链不显示批发价
|
||||
if (this.$store.state.user.merchantType.type_code != 'TypeSupplyChain') {
|
||||
delete this.attrVal.procure_price
|
||||
}
|
||||
this.formValidate.slider_image = []
|
||||
if (this.$route.params.id) {
|
||||
this.setTagsViewTitle()
|
||||
@ -1622,7 +1628,7 @@ export default {
|
||||
this.productCon()
|
||||
this.productGetRule()
|
||||
this.getLabelLst()
|
||||
this.$store.dispatch('settings/setEdit', true)
|
||||
this.$store.dispatch('settings/setEdit', true);
|
||||
},
|
||||
destroyed () {
|
||||
window.removeEventListener('popstate', this.goBack, false)
|
||||
@ -2787,7 +2793,4 @@ export default {
|
||||
width: auto !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
|
Loading…
x
Reference in New Issue
Block a user