更新了商户批发价功能

This commit is contained in:
weipengfei 2023-11-15 12:00:23 +08:00
parent 2662e98a96
commit 182f8f8507
5 changed files with 373 additions and 208 deletions

View File

@ -4,31 +4,73 @@
<el-col v-bind="grid"> <el-col v-bind="grid">
<div class="Nav"> <div class="Nav">
<div class="input"> <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>
<div class="trees-coadd"> <div class="trees-coadd">
<div class="scollhide"> <div class="scollhide">
<div class="trees"> <div class="trees">
<el-tree ref="tree" :data="treeData2" :filter-node-method="filterNode" :props="defaultProps"> <el-tree
<div slot-scope="{ node, data}" class="custom-tree-node" @click.stop="handleNodeClick(data)"> ref="tree"
:data="treeData2"
:filter-node-method="filterNode"
:props="defaultProps"
>
<div
slot-scope="{ node, data }"
class="custom-tree-node"
@click.stop="handleNodeClick(data)"
>
<div> <div>
<span>{{ node.label }}</span> <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> </div>
<span class="el-ic"> <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--> <!-- <svg-icon-->
<!-- icon-class="danyuan"--> <!-- icon-class="danyuan"-->
<!-- title="添加管理单元"--> <!-- title="添加管理单元"-->
<!-- class="icon-space"--> <!-- 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--> <!-- <svg-icon-->
<!-- icon-class="detail"--> <!-- icon-class="detail"-->
<!-- title="查看该空间详情"--> <!-- title="查看该空间详情"-->
<!-- class="icon-space"--> <!-- 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> </span>
</div> </div>
</el-tree> </el-tree>
@ -40,15 +82,49 @@
<el-col v-bind="grid2" class="colLeft"> <el-col v-bind="grid2" class="colLeft">
<div v-loading="loading" class="conter"> <div v-loading="loading" class="conter">
<div class="bnt"> <div class="bnt">
<el-button v-if="params !== '/merchant/config/picture'" size="small" type="primary" class="mb10 mr10" @click="checkPics">使用选中图片</el-button> <el-button
<el-upload class="upload-demo mr10 mb15" :action="fileUrl" :on-success="handleSuccess" :headers="myHeaders" :show-file-list="false" multiple> 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-button size="small" type="primary">点击上传</el-button>
</el-upload> </el-upload>
<el-button type="success" size="small" @click.stop="onAdd(0)">添加分类</el-button> <el-button type="success" size="small" @click.stop="onAdd(0)"
<el-button type="error" size="small" class="mr10" :disabled="checkPicList.length===0" @click.stop="editPicList('图片')">删除图片</el-button> >添加分类</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="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-input>
<!--<el-select <!--<el-select
v-model="tableData.order" v-model="tableData.order"
@ -66,35 +142,90 @@
value="1" value="1"
/> />
</el-select>--> </el-select>-->
<el-select v-model="sleOptions.attachment_category_name" placeholder="图片移动至" class="mb15" size="small"> <el-select
<el-option :label="sleOptions.attachment_category_name" :value="sleOptions.attachment_category_id" style="max-width: 560px;height:200px;overflow: auto;background-color:#fff"> v-model="sleOptions.attachment_category_name"
<el-tree ref="tree2" :data="treeData2" :filter-node-method="filterNode" :props="defaultProps" @node-click="handleSelClick" /> 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-option>
</el-select> </el-select>
</div> </div>
<div class="pictrueList acea-row mb15"> <div class="pictrueList acea-row mb15">
<div v-show="isShowPic" class="imagesNo"> <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> <span class="imagesNo_sp">图片库为空</span>
</div> </div>
<div class="conters"> <div class="conters">
<div v-for="(item, index) in pictrueList.list" :key="index" class="gridPic"> <div
v-for="(item, index) in pictrueList.list"
:key="index"
class="gridPic"
>
<p class="number" v-if="item.num > 0"> <p class="number" v-if="item.num > 0">
<el-badge class="item" :value="item.num"> <el-badge class="item" :value="item.num">
<a href="#" class="demo-badge"></a> <a href="#" class="demo-badge"></a>
</el-badge> </el-badge>
</p> </p>
<img v-lazy="item.attachment_src" :class="item.isSelect ? 'on': '' " @click="changImage(item, index, pictrueList.list)" /> <img
<div style="display: flex;align-items: center;justify-content: space-between"> v-lazy="item.attachment_src"
<el-input v-model="item.attachment_name" v-if="editId === item.attachment_id"></el-input> :class="item.isSelect ? 'on' : ''"
<p class="name" style="width: 80%" v-else>{{item.attachment_name}}</p> @click="changImage(item, index, pictrueList.list)"
<i class="el-icon-edit" @click="handleEdit(item.attachment_id,item.attachment_name)" /> />
<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> </div>
</div> </div>
<div class="block"> <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>
</div> </div>
</el-col> </el-col>
@ -388,7 +519,7 @@ export default {
// 使 // 使
checkPics () { checkPics () {
if (this.checkPicList.length) { if (this.checkPicList.length) {
console.log(this.$route); // console.log(this.$route);
if (this.$route) { if (this.$route) {
if (this.$route.query.type === "1") { if (this.$route.query.type === "1") {
if (this.checkPicList.length > 1) if (this.checkPicList.length > 1)
@ -559,7 +690,7 @@ export default {
font-weight: bold; font-weight: bold;
} }
/deep/ .el-tree-node:focus > .el-tree-node__content { /deep/ .el-tree-node:focus > .el-tree-node__content {
background-color: #F5F7FA!important; background-color: #f5f7fa !important;
} }
.el-tree--highlight-current .el-tree--highlight-current
.el-tree-node.is-current .el-tree-node.is-current

View File

@ -16,17 +16,21 @@
<screenfull id="screenfull" class="right-menu-item hover-effect" /> <screenfull id="screenfull" class="right-menu-item hover-effect" />
</template> </template>
<div class="platformLabel">{{ label.mer_name }}</div> <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"> <span class="el-dropdown-link fontSize">
{{ adminInfo }} {{ adminInfo }}
<i class="el-icon-arrow-down el-icon--right" /> <i class="el-icon-arrow-down el-icon--right" />
</span> </span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="goUser"> <el-dropdown-item @click.native="goUser">
<span style="display:block;">个人中心</span> <span style="display: block">个人中心</span>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item divided @click.native="goPassword"> <el-dropdown-item divided @click.native="goPassword">
<span style="display:block;">修改密码</span> <span style="display: block">修改密码</span>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item divided> <el-dropdown-item divided>
<el-dropdown placement="right-start" @command="handleCommand"> <el-dropdown placement="right-start" @command="handleCommand">
@ -38,11 +42,10 @@
</el-dropdown> </el-dropdown>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item divided @click.native="logout"> <el-dropdown-item divided @click.native="logout">
<span style="display:block;">退出</span> <span style="display: block">退出</span>
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</div> </div>
</div> </div>
</template> </template>
@ -91,7 +94,8 @@ export default {
mounted () { mounted () {
getBaseInfo() getBaseInfo()
.then(res => { .then(res => {
this.label = res.data this.label = res.data;
this.$store.commit('user/SET_MERCHANT_TYPE', res.data.merchantType || {})
}) })
.catch(({ message }) => { .catch(({ message }) => {
this.$message.error(message); this.$message.error(message);
@ -217,7 +221,7 @@ export default {
} }
.platformLabel { .platformLabel {
display: inline-block; display: inline-block;
background: #F0AA0B; background: #f0aa0b;
color: #fff; color: #fff;
vertical-align: text-bottom; vertical-align: text-bottom;
font-size: 12px; font-size: 12px;
@ -227,7 +231,6 @@ export default {
border-radius: 10px; border-radius: 10px;
position: relative; position: relative;
top: -11px; top: -11px;
} }
} }
</style> </style>

View File

@ -25,7 +25,20 @@
</el-menu> </el-menu>
<template v-else> <template v-else>
<template v-if="!isCollapse"> <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> </template>
<!--一级菜单点击后二级菜单展开样式--> <!--一级菜单点击后二级菜单展开样式-->
<el-menu <el-menu
@ -38,7 +51,7 @@
active-text-color="#303133" active-text-color="#303133"
mode="vertical" mode="vertical"
> >
<div style="height: 100%;"> <div style="height: 100%">
<div class="sub-title">{{ menu_name }}</div> <div class="sub-title">{{ menu_name }}</div>
<el-scrollbar wrap-class="scrollbar-wrapper"> <el-scrollbar wrap-class="scrollbar-wrapper">
<div v-for="(itm, idx) in subMenuList" :key="idx"> <div v-for="(itm, idx) in subMenuList" :key="idx">
@ -55,7 +68,10 @@
:to="resolvePath(onlyOneChild.route)" :to="resolvePath(onlyOneChild.route)"
> >
<el-menu-item :index="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> </el-menu-item>
</app-link> </app-link>
</template> </template>
@ -309,7 +325,7 @@ export default {
}, },
// //
pathCompute (data) { pathCompute (data) {
console.log(this.$route) // console.log(this.$route)
const loop = child => { const loop = child => {
// //
for (let i = 0; i < child.length; i++) { for (let i = 0; i < child.length; i++) {
@ -375,7 +391,6 @@ export default {
} }
&:hover { &:hover {
background: rgba(67, 127, 253, 0.2); background: rgba(67, 127, 253, 0.2);
} }
} }
.menu-two { .menu-two {
@ -414,7 +429,8 @@ export default {
font-size: 18px; font-size: 18px;
padding: 20px; padding: 20px;
} }
/deep/.el-menu-item,/deep/.el-submenu__title { /deep/.el-menu-item,
/deep/.el-submenu__title {
height: 46px; height: 46px;
line-height: 46px; line-height: 46px;
// background: #ffffff !important; // background: #ffffff !important;
@ -422,10 +438,10 @@ export default {
font-size: 13px; font-size: 13px;
&:hover { &:hover {
background: #ECF2FE !important; background: #ecf2fe !important;
color: #303133 !important; color: #303133 !important;
.el-submenu__title { .el-submenu__title {
background: #ECF2FE !important; background: #ecf2fe !important;
color: #303133 !important; color: #303133 !important;
} }
} }
@ -433,8 +449,10 @@ export default {
/deep/.subMenu2 .el-submenu__title { /deep/.subMenu2 .el-submenu__title {
padding-left: 15px !important; padding-left: 15px !important;
} }
/deep/.router-link-active .el-menu-item, /deep/.el-menu-item.is-active,/deep/ .router-link-active .el-submenu__title{ /deep/.router-link-active .el-menu-item,
background: #ECF2FE !important; /deep/.el-menu-item.is-active,
/deep/ .router-link-active .el-submenu__title {
background: #ecf2fe !important;
} }
} }
/deep/.menus-new .el-icon-arrow-down { /deep/.menus-new .el-icon-arrow-down {
@ -444,20 +462,24 @@ export default {
min-width: 140px !important; min-width: 140px !important;
font-size: 13px; font-size: 13px;
} }
/deep/.menuOpen .el-menu-item,/deep/.menuOpen .el-menu-item,/deep/.menuOpen .el-submenu__title{ /deep/.menuOpen .el-menu-item,
/deep/.menuOpen .el-menu-item,
/deep/.menuOpen .el-submenu__title {
padding-left: 15px !important; padding-left: 15px !important;
} }
/deep/.menuOpen .subMenu2 .el-submenu__title { /deep/.menuOpen .subMenu2 .el-submenu__title {
padding-left: 30px !important; padding-left: 30px !important;
} }
/deep/.style2 .is-active,/deep/.style2>.el-submenu:hover{ /deep/.style2 .is-active,
/deep/.style2 > .el-submenu:hover {
background: #182848 !important; background: #182848 !important;
} }
/deep/.style2.menuTwo .el-submenu__title { /deep/.style2.menuTwo .el-submenu__title {
display: flex; display: flex;
align-items: center; align-items: center;
} }
/deep/.subMenu1 .menuTwo .el-submenu__title:hover,/deep/.subMenu1 .menuTwo .el-menu-item:hover{ /deep/.subMenu1 .menuTwo .el-submenu__title:hover,
/deep/.subMenu1 .menuTwo .el-menu-item:hover {
background: #182848 !important; background: #182848 !important;
} }
.menu-link { .menu-link {
@ -478,9 +500,10 @@ export default {
background: transparent !important; background: transparent !important;
} }
/deep/.subMenu1 .menuTwo .el-menu { /deep/.subMenu1 .menuTwo .el-menu {
background: #030C17!important; background: #030c17 !important;
} }
/deep/.subMenu1 .menuTwo .nest-menu .el-submenu>.el-submenu__title,/deep/.subMenu1 .menuTwo .el-submenu .el-menu-item{ /deep/.subMenu1 .menuTwo .nest-menu .el-submenu > .el-submenu__title,
/deep/.subMenu1 .menuTwo .el-submenu .el-menu-item {
background: #030c17 !important; background: #030c17 !important;
} }
</style> </style>

View File

@ -19,7 +19,8 @@ const state = {
roles: [], roles: [],
menuList: JSON.parse(localStorage.getItem('MenuList')), menuList: JSON.parse(localStorage.getItem('MenuList')),
sidebarWidth: window.localStorage.getItem('sidebarWidth'), sidebarWidth: window.localStorage.getItem('sidebarWidth'),
sidebarStyle: window.localStorage.getItem('sidebarStyle') sidebarStyle: window.localStorage.getItem('sidebarStyle'),
merchantType: JSON.parse(window.localStorage.getItem('merchantType') || '{}')
} }
const mutations = { const mutations = {
@ -47,7 +48,11 @@ const mutations = {
SET_SIDEBAR_STYLE: (state, style) => { SET_SIDEBAR_STYLE: (state, style) => {
state.sidebarStyle = style; state.sidebarStyle = style;
window.localStorage.setItem('sidebarStyle', style); window.localStorage.setItem('sidebarStyle', style);
} },
SET_MERCHANT_TYPE: (state, merchantType) => {
state.merchantType = merchantType;
window.localStorage.setItem('merchantType', JSON.stringify(merchantType));
},
} }
const actions = { const actions = {

View File

@ -448,7 +448,6 @@
align="center" align="center"
min-width="120" min-width="120"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="formValidate.svip_price_type != 0"> <div v-if="formValidate.svip_price_type != 0">
<el-input <el-input
@ -893,12 +892,14 @@
<el-col v-if="deliveryList.length > 0" :span="24"> <el-col v-if="deliveryList.length > 0" :span="24">
<el-form-item label="送货方式:" prop="delivery_way"> <el-form-item label="送货方式:" prop="delivery_way">
<div class="acea-row"> <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 <el-checkbox
v-for="item in deliveryList" v-for="item in deliveryList"
:key="item.value" :key="item.value"
:label="item.value" :label="item.value"
> >
{{ item.name }} {{ item.name }}
</el-checkbox> </el-checkbox>
@ -1315,7 +1316,7 @@ const defaultObj = {
} }
const objTitle = { const objTitle = {
price: { price: {
title: '售价' title: '售价'
}, },
cost: { cost: {
title: '成本价' title: '成本价'
@ -1544,6 +1545,7 @@ export default {
], ],
type: 0, type: 0,
modals: false, modals: false,
// attrVal
attrVal: { attrVal: {
price: null, price: null,
cost: null, cost: null,
@ -1597,6 +1599,10 @@ export default {
} }
}, },
mounted () { 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 = [] this.formValidate.slider_image = []
if (this.$route.params.id) { if (this.$route.params.id) {
this.setTagsViewTitle() this.setTagsViewTitle()
@ -1622,7 +1628,7 @@ export default {
this.productCon() this.productCon()
this.productGetRule() this.productGetRule()
this.getLabelLst() this.getLabelLst()
this.$store.dispatch('settings/setEdit', true) this.$store.dispatch('settings/setEdit', true);
}, },
destroyed () { destroyed () {
window.removeEventListener('popstate', this.goBack, false) window.removeEventListener('popstate', this.goBack, false)
@ -2787,7 +2793,4 @@ export default {
width: auto !important; width: auto !important;
} }
} }
</style> </style>