Commit 40b3b076 by 杨北旺

售中转化

1 parent 13091cff
<template> <template>
<div id="app"> <div id="app">
<!-- <h2>
报表子应用
<span class="right">{{ gs }}</span>
</h2>
<div id="nav">
<span>切换路由:</span>
<el-button-group class="right">
<el-button type="primary" size="medium" @click="routerChange('/')">报表</el-button>
<el-button type="primary" size="medium" @click="routerChange('/about')">穿梭框</el-button>
<el-button type="primary" size="medium" @click="toAppReport('1-1')">表格</el-button>
<el-button type="primary" size="medium" @click="toAppReport('1-2')">日历</el-button>
<el-button type="primary" size="medium" @click="toAppReport('3-1')">aaaa</el-button>
</el-button-group>
</div>
<div class="parent-child-communication">
<h3>父子应用通信:</h3>
<div style="margin-bottom: 20px;">
<span>rxjs通信方案:{{ myMsg }}</span>
<el-button class="right" type="primary" size="medium" @click="callParentChange('rxjs')">通知父应用变天了</el-button>
</div>
<div>
<span>官方通信方案:{{ myMessage }}</span>
<el-button class="right" type="primary" size="medium" @click="callParentChange('default')">通知父应用收到</el-button>
</div>
<img src="./assets/logo.png" alt="" srcset="" />
</div> -->
<router-view /> <router-view />
</div> </div>
</template> </template>
...@@ -56,5 +29,15 @@ export default { ...@@ -56,5 +29,15 @@ export default {
padding: 20px 0; padding: 20px 0;
line-height: 36px; line-height: 36px;
} }
#app {
background: #F4F5FA;
padding: 0px 20px 20px 40px;
position: absolute;
box-sizing: border-box;
width: 100%;
top: 0px;
left: 0px;
overflow-y: auto;
height: 100%;
}
</style> </style>
>
.live-room .container { ::-webkit-scrollbar {
background: #FFFFFF; /*滚动条整体样式*/
margin: 20px 40px; width: 6px;
padding: 15px 20px; height: 4px;
box-shadow: 0 1px 5px 0 rgba(38, 38, 38, 0.10);
} }
.el-scrollbar__bar.is-horizontal{ ::-webkit-scrollbar-thumb {
height: 10px !important; /*滚动条里面小方块*/
left: 10px; border-radius: 4px;
background-color: rgba(144, 147, 153, .3);
} }
.base-container-right .el-main-scroll .el-scrollbar__thumb { .h1_title {
background-color: rgba(144, 147, 153, 0.5) !important; font-size: 42px;
font-weight: 500;
color: #000000;
} }
.live-room .el-table .cell { .h2_title {
line-height: 16px; font-size: 24px;
font-weight: 500;
color: #000000;
} }
.live-room .table-btns .el-button { .h3_title {
padding: 0 0 0 5px; font-size: 18px;
margin-left: 5px; font-weight: 600;
border-left: 1px solid #DCDFE6; color: #333333;
border-radius: 0; height: 18px;
} }
.live-room .table-btns .el-button:first-child { .h4_title {
padding: 0; font-size: 16px;
border: 0; font-weight: 400;
color: #666666;
} }
.live-room .img-60 { .h5_title {
width: 60px; font-size: 14px;
height: 60px; font-weight: 400;
color: #3a3a3a;
} }
.live-room .edit-container { .h6_title {
margin: 20px 40px 84px; font-size: 16px;
font-weight: 500;
color: #3A3A3A;
} }
.live-room .footer { .h7_title {
position: absolute; font-size: 14px;
bottom: 0; font-weight: 500;
width: 100%; color: #333333;
height: 64px;
text-align: center;
line-height: 64px;
background: #FFFFFF;
z-index: 999;
} }
.live-room .flex { .h8_title {
display: flex; font-size: 24px;
justify-content: space-between; font-weight: 600;
color: #3A3A3A;
} }
.live-room .edit-title { .h9_title {
font-size: 16px; font-size: 14px;
font-weight: bold; font-weight: 400;
height: 48px; color: #666666;
line-height: 48px;
// color: #0947C6;
border-bottom: 1px solid #E7EAEC;
// padding-left: 20px;
margin: 0 0;
}
.live-room .edit-sub-title::before {
position: absolute;
display: inline-block;
content: '';
height: 18px;
width: 4px;
top: 2px;
left: 0;
background-color: #0947C6;
} }
.live-room .edit-sub-title { .h10_title {
position: relative; font-size: 12px;
font-size: 16px; font-weight: 400;
font-weight: 700; color: #3A3A3A;
}
.h11_title {
font-size: 14px;
font-weight: 500;
color: #000000;
}
.h12_title {
font-size: 14px;
font-weight: 400;
color: #888888;
}
.h13_title {
font-size: 14px;
font-weight: 400;
color: #333333; color: #333333;
margin: 0 0 30px 0;
padding-left: 8px;
} }
.h14_title {
font-size: 14px;
font-weight: 400;
color: #37383A;
}
.flex_scb {
display: flex;
align-items: center;
justify-content: space-between;
}
.flex_cc {
display: flex;
align-items: center;
justify-content: center;
}
// .live-room .container {
// background: #FFFFFF;
// margin: 20px 40px;
// padding: 15px 20px;
// box-shadow: 0 1px 5px 0 rgba(38, 38, 38, 0.10);
// }
// .el-scrollbar__bar.is-horizontal{
// height: 10px !important;
// left: 10px;
// }
// .base-container-right .el-main-scroll .el-scrollbar__thumb {
// background-color: rgba(144, 147, 153, 0.5) !important;
// }
// .live-room .el-table .cell {
// line-height: 16px;
// }
// .live-room .table-btns .el-button {
// padding: 0 0 0 5px;
// margin-left: 5px;
// border-left: 1px solid #DCDFE6;
// border-radius: 0;
// }
// .live-room .table-btns .el-button:first-child {
// padding: 0;
// border: 0;
// }
// .live-room .img-60 {
// width: 60px;
// height: 60px;
// }
// .live-room .edit-container {
// margin: 20px 40px 84px;
// }
// .live-room .footer {
// position: absolute;
// bottom: 0;
// width: 100%;
// height: 64px;
// text-align: center;
// line-height: 64px;
// background: #FFFFFF;
// z-index: 999;
// }
// .live-room .flex {
// display: flex;
// justify-content: space-between;
// }
// .live-room .edit-title {
// font-size: 16px;
// font-weight: bold;
// height: 48px;
// line-height: 48px;
// // color: #0947C6;
// border-bottom: 1px solid #E7EAEC;
// // padding-left: 20px;
// margin: 0 0;
// }
// .live-room .edit-sub-title::before {
// position: absolute;
// display: inline-block;
// content: '';
// height: 18px;
// width: 4px;
// top: 2px;
// left: 0;
// background-color: #0947C6;
// }
// .live-room .edit-sub-title {
// position: relative;
// font-size: 16px;
// font-weight: 700;
// color: #333333;
// margin: 0 0 30px 0;
// padding-left: 8px;
// }
// .live-room table { // .live-room table {
// width: 98%; // width: 98%;
// color: #666666; // color: #666666;
// border: 1px solid #e5e6e7; // border: 1px solid #e5e6e7;
// border-width: 1px 0 0 1px; // border-width: 1px 0 0 1px;
// } // }
// .live-room table tr { // .live-room table tr {
// height: 30px; // height: 30px;
// // line-height: 30px; // // line-height: 30px;
// } // }
// .live-room table th, // .live-room table th,
// .live-room table td { // .live-room table td {
// font-size: 12px; // font-size: 12px;
...@@ -109,7 +203,6 @@ ...@@ -109,7 +203,6 @@
// text-align: center; // text-align: center;
// vertical-align: middle; // vertical-align: middle;
// } // }
// .live-room table td { // .live-room table td {
// min-width: 50px; // min-width: 50px;
// } // }
\ No newline at end of file \ No newline at end of file
<template>
<div class="my-drop-menu">
<div class="left_widget label flex_cc">
<el-dropdown trigger="click">
<div class="h13_title">
{{ leftName }}
<i class="el-icon-caret-bottom el-icon-caret-top"></i>
</div>
<el-dropdown-menu slot="dropdown" class="drop_item">
<el-dropdown-item>黄金糕</el-dropdown-item>
<el-dropdown-item>狮子头</el-dropdown-item>
<el-dropdown-item>螺蛳粉</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<div class="right_widget">
<slot name="right_con"></slot>
</div>
</div>
</template>
<script>
export default {
name: '',
data() {
return {}
},
props: {
leftName: {
type: String,
default: '下拉菜单'
}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.my-drop-menu {
display: flex;
align-items: center;
.left_widget {
box-sizing: border-box;
padding: 0 17px;
height: 28px;
border-radius: 4px 0px 0px 4px;
border: 1px solid #e8e8ea;
border-right: none;
cursor: pointer;
}
.right_widget {
border-radius: 0px 4px 4px 0px;
// border: 1px solid #e8e8ea;
}
.el-icon-caret-bottom {
color: #999;
}
.label {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
</style>
<template>
<div :id="echartId" class="chart-container"></div>
</template>
<script>
import * as echarts from 'echarts'
export default {
name: '',
data() {
return {}
},
props: {
echartId: {
type: String,
default: ''
}
},
mounted() {
this.getOptions()
},
methods: {
getOptions() {
var chartDom = document.getElementById(this.echartId)
var myChart = echarts.init(chartDom)
var option = {
title:{
show:true,
text:'数量'
},
legend: {},
tooltip: {},
dataset: {
source: [
['product', '领券数', '核销数', '精品是升级订单'],
['Matcha Latte', 43.3, 85.8, 93.7],
['Milk Tea', 83.1, 73.4, 55.1],
['Cheese Cocoa', 86.4, 65.2, 82.5],
['Walnut Brownie', 72.4, 53.9, 39.1]
]
},
xAxis: { type: 'category' },
yAxis: {
axisLine: {
show: true,
lineStyle: {
color: '#E8E8EA'
}
}
},
series: [{ type: 'bar' }, { type: 'bar' }, { type: 'bar' }]
}
option && myChart.setOption(option)
}
}
}
</script>
<style>
.chart-container {
height: 250px;
}
</style>
<!-- 选择商品弹窗 -->
<template>
<div :id="echartId" class="chart-container"></div>
</template>
<script>
import * as echarts from 'echarts'
export default {
name: '',
data() {
return {}
},
props: {
echartId: {
type: String,
default: ''
},
},
mounted() {
this.getOptions()
},
methods: {
getOptions() {
var chartDom = document.getElementById(this.echartId)
var myChart = echarts.init(chartDom)
var option = {
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b} : {c}%'
},
series: [
{
name: 'Funnel',
type: 'funnel',
left: '10%',
top: 60,
bottom: 60,
width: '80%',
min: 0,
max: 100,
minSize: '50%',
maxSize: '100%',
sort: 'descending',
gap: 2,
orient:"vertical",
label: {
show: true,
position: 'left'
},
labelLine: {
length: 20,
lineStyle: {
width: 1,
type: 'solid'
}
},
itemStyle: {
borderColor: '#fff',
borderWidth: 1
},
emphasis: {
label: {
fontSize: 20
}
},
data: [
{ value: 60, name: 'Visit' },
{ value: 40, name: 'Inquiry' },
{ value: 20, name: 'Order' },
]
}
]
}
console.log(option);
option && myChart.setOption(option)
}
}
}
</script>
<style>
.chart-container {
height: 258px;
}
</style>
<!-- 选择商品弹窗 -->
<template>
<div :id="echartId" class="pie-line"></div>
</template>
<script>
import * as echarts from 'echarts'
export default {
name: 'piechart',
data() {
return {}
},
props: {
echartId: {
type: String,
default: ''
}
},
mounted() {
this.getOptions()
},
methods: {
getOptions() {
var chartDom = document.getElementById(this.echartId)
var myChart = echarts.init(chartDom)
var option
option = {
series: {
type: 'pie',
radius: [20, 60],
height: '33.33%',
top:'center',
left: 'center',
width: 400,
itemStyle: {
borderColor: '#fff',
borderWidth: 1
},
label: {
alignTo: 'edge',
formatter: '{name|{b}}\n{time|{c} 小时}',
minMargin: 5,
edgeDistance: 10,
lineHeight: 15,
rich: {
time: {
fontSize: 10,
color: '#999'
}
}
},
labelLine: {
length: 15,
length2: 0,
maxSurfaceAngle: 80
},
labelLayout: function (params) {
const isLeft = params.labelRect.x < myChart.getWidth() / 2
const points = params.labelLinePoints
// Update the end point.
points[2][0] = isLeft ? params.labelRect.x : params.labelRect.x + params.labelRect.width
return {
labelLinePoints: points
}
},
data: [
{ name: '圣彼得堡来客', value: 5.6 },
{ name: '陀思妥耶夫斯基全集', value: 1 },
{ name: '史记精注全译(全6册)', value: 0.8 },
{ name: '加德纳艺术通史', value: 0.5 },
{ name: '表象与本质', value: 0.5 },
{ name: '其它', value: 3.8 }
]
}
}
option && myChart.setOption(option)
}
}
}
</script>
<style>
.pie-line{
height: 400px;
}
</style>
import Vue from 'vue' import Vue from 'vue'
import { Message, Button, ButtonGroup, Form, FormItem, Input, Radio, RadioGroup, Checkbox, CheckboxGroup, Switch, Select, Option, TimePicker, Col, DatePicker, Tree, Card, Table, TableColumn, Pagination, Loading, Dialog, MessageBox, Upload, Tooltip, Tabs, TabPane, Container } from 'element-ui' import { Message, Button, ButtonGroup, Form, FormItem, Input, Radio, RadioGroup, Checkbox, CheckboxGroup, Switch, Select, Option, TimePicker, Col, DatePicker, Tree, Card, Table, TableColumn, Pagination, Loading, Dialog, MessageBox, Upload, Tooltip, Tabs, TabPane, Container, Progress, Timeline, TimelineItem, Dropdown, DropdownMenu } from 'element-ui'
Vue.use(Button) Vue.use(Button)
Vue.use(ButtonGroup) Vue.use(ButtonGroup)
Vue.use(Form) Vue.use(Form)
...@@ -26,5 +26,10 @@ Vue.use(Upload) ...@@ -26,5 +26,10 @@ Vue.use(Upload)
Vue.use(Tooltip) Vue.use(Tooltip)
Vue.use(Tabs) Vue.use(Tabs)
Vue.use(TabPane) Vue.use(TabPane)
Vue.use(Progress)
Vue.use(Timeline)
Vue.use(TimelineItem)
Vue.use(Dropdown)
Vue.use(DropdownMenu)
export const message = Message export const message = Message
export const messageBox = MessageBox export const messageBox = MessageBox
\ No newline at end of file \ No newline at end of file
const staticRoutes = Object.freeze([ const staticRoutes = Object.freeze([{
{ name: 'InSale',
name: 'default', path: '/inSale/index',
path: '/', component: resolve => require([`@/views/inSale/index.vue`], resolve),
redirect: { name: 'liveRoom' }
},
{
name: 'MemberList',
path: '/liveMember/memberList',
component: resolve => require([`@/views/liveMember/memberList.vue`], resolve),
meta: {} meta: {}
}, }, {
{ name: 'InSale',
name: 'commodityList', path: '/inSale/upgrade',
path: '/cmmodityLibrary/commodityList', component: resolve => require([`@/views/inSale/upgrade.vue`], resolve),
component: resolve => require([`@/views/cmmodityLibrary/commodityList.vue`], resolve),
meta: {} meta: {}
}, }, {
// { name: 'InSale',
// name: 'WarehousingList', path: '/inSale/guestComments',
// path: '/cmmodityLibrary/warehousingList', component: resolve => require([`@/views/inSale/guestComments.vue`], resolve),
// component: resolve => require([`@/views/cmmodityLibrary/warehousingList.vue`], resolve),
// meta: {}
// },
{
name: 'editProduct',
path: '/cmmodityLibrary/editProduct',
component: resolve => require([`@/views/cmmodityLibrary/editProduct.vue`], resolve),
meta: {} meta: {}
}, }, {
{ name: 'InSale',
name: 'editProductGroup', path: '/inSale/accountRules',
path: '/cmmodityLibrary/editProductGroup', component: resolve => require([`@/views/inSale/accountRules.vue`], resolve),
component: resolve => require([`@/views/cmmodityLibrary/editProductGroup.vue`], resolve),
meta: {} meta: {}
}, }, ])
{
name: 'liveRoom',
path: '/liveRoom/liveRoomList',
component: resolve => require([`@/views/liveRoom/liveRoomList.vue`], resolve),
meta: {}
},
{
name: 'editLiveRoom',
path: '/liveRoom/editLiveRoom/:addOrEdit/:id',
// component: () => import('@/views/liveRoom/editLiveRoom.vue'),
component: resolve => require([`@/views/liveRoom/editLiveRoom.vue`], resolve),
meta: {}
},
{
name: 'liveControl',
path: '/liveRoom/liveControl/:id',
component: resolve => require([`@/views/liveRoom/liveControl.vue`], resolve),
meta: {}
}
])
export default staticRoutes export default staticRoutes
\ No newline at end of file \ No newline at end of file
<template>
<div class="report-home">
HOME
<GLButton type="danger" @click="test()" class="test555" id="1-1-1-1" mode="link">权限按钮测试</GLButton>
<GLButton type="success" size="small" @click="test()" id="1-1-1-1" class="test">权限按钮测试2</GLButton>
<el-button class="test" @click="test()">东方网分</el-button>
</div>
</template>
<script>
export default {
name: 'home',
methods: {
test() {
console.log('点击了按钮')
this.$messenger.send({ message: { from: 11, message: '11111' } })
}
}
}
</script>
<template>
<div class="report-about">
<h4>穿梭框1</h4>
<h4 class="align-center">
<label>请打开f12查看移动数据</label>
<el-button size="medium" type="info" @click="changeMode">当前模式:{{ mode }}</el-button>
<el-button size="medium" @click="clearChecked()">清除选中</el-button>
<el-button size="medium" @click="toHidden()">去=隐藏的路由</el-button>
</h4>
<div class="box">
<!-- lazy -->
<!-- :lazyFn="lazyFn" -->
<tree-transfer ref="wl-tree-transfer" filter high-light default-transfer :mode="mode" :title="title" :to_data="toData" :from_data="fromData" :filterNode="filterNode" :defaultProps="defaultProps" :defaultCheckedKeys="defaultCheckedKeys" :defaultExpandedKeys="[2, 3]" @right-check-change="rightCheckChange" @left-check-change="leftCheckChange" @removeBtn="remove" @addBtn="add" height="540px" node_key="id">
<span slot="title-right" class="my-title-right" @click="handleTitleRight">自定义内容</span>
</tree-transfer>
</div>
</div>
</template>
<script>
import treeTransfer from 'el-tree-transfer'
export default {
name: 'App',
components: { treeTransfer },
data() {
return {
mode: 'transfer', // transfer addressList
defaultProps: { label: 'name', children: 'children' },
fromData: [
{
id: 1,
pid: 0,
name: '测试左侧',
children: [
{
id: 2,
pid: 1,
name: '水电费是打发斯蒂芬斯蒂芬gas噶水电费噶地方死光光',
disabled: true,
children: []
},
{
id: 3,
pid: 1,
name: '11-3',
children: []
},
{
id: 4,
pid: 1,
name: '11-4',
children: [
{
id: 5,
pid: 4,
name: '11-5',
children: [
{
id: 111,
pid: 5,
name: '11-111'
}
]
},
{
id: 6,
pid: 4,
name: '11-6',
children: []
}
]
}
]
},
{
id: 7127,
pid: 0,
name: 'debug',
children: [
{
id: 71272,
pid: 7127,
name: 'debug22',
// disabled: true,
children: []
},
{
id: 71273,
pid: 7127,
name: 'debug11',
children: []
}
]
}
], // 穿梭框 - 源数据 - 树形
toData: [],
fromArray: [
{
id: '1',
name: '1',
pid: '0'
},
{
id: '2',
name: '2',
pid: '0'
},
{
id: '1-1',
name: '1-1',
pid: '1'
},
{
id: '1-2',
name: '1-2',
pid: '1'
},
{
id: '1-1-1',
name: '1-1-1',
pid: '1-1'
},
{
id: '1-1-1-1',
name: '1-1-1-1',
pid: '1-1-1'
},
{
id: '2-1',
name: '2-1',
pid: '2'
},
{
id: '2-2',
name: '2-2',
pid: '2'
}
],
toArray: [],
defaultCheckedKeys: [] // 左侧默认选中数据
}
},
created() {},
mounted() {
this.$apis.demo.GETLISTDEVICEFILEUNSTOCK({ k: 2, kdj: 5 }).then(res => {})
// 测试延迟默认选中
setTimeout(() => {
this.defaultCheckedKeys = [1]
}, 1000)
},
methods: {
toHidden() {
this.$router.push('/about/hidden')
},
// 清除选中
clearChecked() {
this.$refs['wl-tree-transfer'].clearChecked()
},
// 自定义筛选函数
filterNode(value, data, where) {
console.log(value, data, where)
if (!value) return true
return data[this.defaultProps.label].indexOf(value) !== -1
},
// 懒加载回调
lazyFn(node, resolve) {
setTimeout(() => {
resolve([
{
id: 71272,
pid: 7127,
name: 'debug22',
// disabled: true,
children: []
},
{
id: 71273,
pid: 7127,
name: 'debug11',
children: []
}
])
}, 500)
},
// 切换模式 现有树形穿梭框模式transfer 和通讯录模式addressList
changeMode() {
if (this.mode == 'transfer') {
this.mode = 'addressList'
} else {
this.mode = 'transfer'
}
},
// 添加按钮
add(fromData, toData, obj) {
// 树形穿梭框模式transfer时,返回参数为左侧树移动后数据、右侧树移动后数据、移动的{keys,nodes,halfKeys,halfNodes}对象
// 通讯录模式addressList时,返回参数为右侧收件人列表、右侧抄送人列表、右侧密送人列表
console.log('fromData:', fromData)
console.log('toData:', toData)
console.log('obj:', obj)
},
// 移除按钮
remove(fromData, toData, obj) {
// 树形穿梭框模式transfer时,返回参数为左侧树移动后数据、右侧树移动后数据、移动的{keys,nodes,halfKeys,halfNodes}对象
// 通讯录模式addressList时,返回参数为右侧收件人列表、右侧抄送人列表、右侧密送人列表
console.log('fromData:', fromData)
console.log('toData:', toData)
console.log('obj:', obj)
},
// 左侧源数据选中事件
leftCheckChange(nodeObj, treeObj, checkAll) {
console.log(nodeObj)
console.log(treeObj)
console.log(checkAll)
},
// 右侧目标数据选中事件
rightCheckChange(nodeObj, treeObj, checkAll) {
console.log(nodeObj)
console.log(treeObj)
console.log(checkAll)
},
// 自定义节点 仅树形结构支持
renderContent(h, { node, data }) {
return (
<span class="custom-tree-node">
<span>{node.label}</span>
<span>
<el-button size="mini" type="text" on-click={() => this.append(data)}>
Append
</el-button>
<el-button size="mini" type="text" on-click={() => this.remove(node, data)}>
Delete
</el-button>
</span>
</span>
)
},
// 标题自定义区点击事件
handleTitleRight() {
alert('标题自定义区点击事件')
}
},
computed: {
title() {
if (this.mode == 'transfer') {
return ['源列表', '目标列表']
} else {
return ['通讯录', '收件人', '抄送人', '密送人']
}
}
}
}
</script>
<style>
.align-center {
text-align: center;
}
.box {
width: 600px;
margin: 0 auto;
text-align: left;
}
.btn {
border: 1px solid #ebeef5;
padding: 5px 10px;
background-color: #f5f7fa;
outline: none;
}
.my-title-right {
float: right;
font-size: 12px;
cursor: pointer;
}
</style>
<!-- 商品库 -->
<template>
<div class="live-room">
<div class="container">
<el-tabs v-model="activeName" type="card" @tab-click="handleTabClick">
<el-tab-pane label="未入库" name="noWarehous">
<warehous-list></warehous-list>
</el-tab-pane>
<el-tab-pane label="已入库" name="warehousing">
<warehousing-list></warehousing-list>
</el-tab-pane>
</el-tabs>
</div>
</div>
</template>
<script>
import warehousingList from './warehousingList'
import warehousList from './warehousList'
export default {
name: 'commodityList',
data() {
return {
activeName: 'noWarehous'
}
},
components: {
warehousingList,
warehousList
},
computed: {},
mounted() {},
methods: {
handleTabClick() {}
}
}
</script>
<style scoped></style>
<!-- 添加商品 -->
<template>
<div class="edit-pro live-room">
<div class="container edit-container">
<p class="edit-title">{{ title }}</p>
<glsx-combi-form ref="editFormRef" labelWidth="140px" :isBlock="isBlock" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="selectSinglePro" slot-scope="item" class="select-pro">
<el-button v-show="routeInfo.addOrEdit != 3" type="text" @click="handleSinglePro(item)">{{ selectedProInfo.id ? '更换' : '请选择' }}</el-button>
</div>
<div slot="proTable" class="select-pro">
<GLTable v-show="selectedProInfoList.length" ref="warehousListRef" :hasPage="hasPage" :searchForm="searchForm" :tableParams="tableParams" :tableData="selectedProInfoList">
<span slot="goodsImage" slot-scope="scope">
<img class="m-t-10 img-60" :src="scope.scope.goodsImage" />
</span>
<span slot="price">
<el-input :disabled="routeInfo.addOrEdit == 3" placeholder="请输入" v-model="editForm.price"><template slot="append">元</template></el-input>
</span>
<span slot="auth-button">
<el-button type="text" @click="handleProDelete()">删除</el-button>
</span>
</GLTable>
</div>
</glsx-combi-form>
<p>直播价表示直播开始时,用户购买的实际支付价格,直播结束时恢复原价</p>
<select-single-pro-dialog v-if="isSingleSelectVisible" :isSingleSelectVisible="isSingleSelectVisible" :selectedProInfo="selectedProInfo" @handleSingleSelectConfirm="handleSingleSelectConfirm" @handleSingleSelectClose="handleSingleSelectClose"></select-single-pro-dialog>
</div>
<div class="footer">
<el-button v-show="routeInfo.addOrEdit != 3" type="primary" @click="handleConfirm">确定</el-button>
<el-button type="default" @click="handleCancel">取消</el-button>
</div>
</div>
</template>
<script>
import _ from 'lodash'
import glsxCombiForm from '@/components/glsx-combi-form'
import selectSingleProDialog from './selectSingleProDialog'
import { uploadImg } from '@/api/modules/common'
import { getGoodInfoApi, insertGoodApi } from '@/api/modules/cmmodityLibrary'
export default {
name: 'editProduct',
data() {
return {
title: '添加商品',
titleObj: {
1: '新增商品',
2: '编辑商品',
3: '查看商品'
},
isBlock: true,
editChildRef: 'editChildRef',
routeInfo: {
// 1-新增;2-编辑;3-查看
addOrEdit: 1,
id: ''
},
editForm: {
name: '',
price: '',
coverImgUrl: ''
},
selectedProInfoList: [],
editRule: {
coverImgUrl: [{ required: true, message: '请上传商品缩略图', trigger: 'change' }],
name: [{ required: true, message: '请输入商品名称', trigger: 'change' }]
// price: [{ required: true, message: '请输入直播价', trigger: 'change' }]
},
// 商品选择
isSingleSelectVisible: false,
selectedProInfo: {},
editFormData: [
{
label: '商品缩略图',
name: 'coverImgUrl',
type: 'upload',
// limitSize: 1,
isDisabled: false,
maxPhotoNum: 1,
tips: '建议尺寸:300像素 * 300像素,图片大小不得超过1M',
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
uploadImg({ file: base64, fileType: 'image' }).then(res => {
this.editForm[targetItem.name] = res
this.$refs.editFormRef.$refs[this.editChildRef].validateField(targetItem.name)
})
}
},
{
label: '商品名称',
name: 'name',
width: '480px',
type: 'input',
isDisabled: false,
maxlength: 20
},
{
label: '商品选择',
name: '',
addHtml: 'selectSinglePro'
},
{
// label: '商品选择',
name: '',
addHtml: 'proTable'
}
// {
// label: '设置直播价',
// name: 'price',
// width: '480px',
// type: 'input',
// tips: '直播价表示直播开始时,用户购买的实际支付价格,直播结束时恢复原价'
// }
],
// 表格
hasPage: false,
tableParams: {
tableOption: true,
tableColumns: [
{
label: '商品图片',
prop: 'goodsImage',
addHtml: 'goodsImage'
},
{
label: '商品名称',
prop: 'goodsName'
},
{
label: '商品价格',
prop: 'retailPrice'
},
{
label: '设置直播价格(元)',
prop: '',
width: '180px',
addHtml: 'price'
},
{
label: '来源门店',
prop: 'merchantName'
}
]
}
}
},
components: {
glsxCombiForm,
selectSingleProDialog
},
computed: {},
mounted() {
this.routeInfo = this.$route.params
this.title = this.titleObj[this.routeInfo.addOrEdit]
this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
this.editFormData[0].isDisabled = this.routeInfo.addOrEdit == 3
this.editFormData[1].isDisabled = this.routeInfo.addOrEdit == 3
this.tableParams.tableOption = this.routeInfo.addOrEdit != 3
},
methods: {
getInfo() {
getGoodInfoApi({ id: this.routeInfo.id }).then(res => {
console.log(res)
this.editForm = res
this.editForm.price = res.price ? (res.price / 100).toFixed(2) : ''
if (res.goodsInfo) {
this.selectedProInfo = {
id: res.goodsInfo.goodsId,
retailPrice: res.goodsInfo.price2 && res.goodsInfo.price1 != res.goodsInfo.price2 ? (res.goodsInfo.price1 / 100).toFixed(2) + '-' + (res.goodsInfo.price2 / 100).toFixed(2) : (res.goodsInfo.price1 / 100).toFixed(2),
goodsName: res.goodsInfo.name,
merchantId: res.goodsInfo.merchantId,
merchantName: res.goodsInfo.merchantName,
goodsImage: res.goodsInfo.selfGoodsImageUrl
}
this.selectedProInfoList = [this.selectedProInfo]
}
})
},
handleProDelete() {
this.$messageBox.confirm('是否删除该商品?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'error',
callback: action => {
if (action == 'confirm') {
this.selectedProInfo = {}
this.selectedProInfoList = []
}
}
})
},
handleSinglePro(targetItem) {
this.isSingleSelectVisible = !this.isSingleSelectVisible
},
handleSingleSelectConfirm(selectedProInfo) {
this.selectedProInfo = selectedProInfo
this.selectedProInfoList = [selectedProInfo]
this.handleSinglePro()
},
handleSingleSelectClose() {
this.handleSinglePro()
},
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = JSON.parse(JSON.stringify(this.editForm))
params.price = this.editForm.price * 100
params.shopMallGoodsInfo = {
goodsId: this.selectedProInfo.id,
// name: this.selectedProInfo.goodsName,
merchantId: this.selectedProInfo.merchantId,
merchantName: this.selectedProInfo.merchantName,
// selfGoodsImageUrl: this.selectedProInfo.goodsImage
}
insertGoodApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.$router.push({
path: '/cmmodityLibrary/commodityList'
})
}
})
}
})
},
handleCancel() {
this.$router.push({
path: '/cmmodityLibrary/commodityList'
})
}
}
}
</script>
<style>
.edit-pro .select-pro {
/* width: calc(98% - 140px); */
width: 98%;
}
.edit-pro .m-t-10 {
margin-top: 10px;
}
</style>
<!-- 添加商品组 -->
<template>
<div class="edit-pro-group live-room">
<div class="container edit-container">
<p class="edit-title">{{ title }}</p>
<glsx-combi-form ref="editFormRef" labelWidth="150px" :isBlock="isBlock" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="selectMutiPro" slot-scope="item" class="select-pro">
<el-button v-show="routeInfo.addOrEdit != 3" type="text" @click="handleMutiPro(item)">{{ editForm.shopMallGoodsInfoList.length ? '更换' : '请选择' }}</el-button>
</div>
<div slot="proTable" class="select-pro">
<GLTable v-show="editForm.shopMallGoodsInfoList.length" ref="warehousListRef" :hasPage="hasPage" :searchForm="searchForm" :tableParams="tableParams" :tableData="editForm.shopMallGoodsInfoList">
<span slot="goodsImage" slot-scope="scope">
<img class="m-t-10 img-60" :src="scope.scope.goodsImage" />
</span>
<span slot="price" slot-scope="scope">
<el-input :disabled="routeInfo.addOrEdit == 3" placeholder="请输入" v-model="scope.scope.livePrice"><template slot="append">元</template></el-input>
</span>
<span slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleProDelete(scope.scope)">删除</el-button>
</span>
</GLTable>
</div>
</glsx-combi-form>
<select-muti-pro-dialog v-if="isMutiSelectVisible" :isMutiSelectVisible="isMutiSelectVisible" :selectedProList="editForm.shopMallGoodsInfoList" @handleMutiSelectConfirm="handleMutiSelectConfirm" @handleMutiSelectClose="handleMutiSelectClose"></select-muti-pro-dialog>
</div>
<div class="footer">
<el-button v-show="routeInfo.addOrEdit != 3" type="primary" @click="handleConfirm">确定</el-button>
<el-button type="default" @click="handleCancel">取消</el-button>
</div>
</div>
</template>
<script>
import _ from 'lodash'
import '@/assets/css/public.scss'
import glsxCombiForm from '@/components/glsx-combi-form'
import { uploadImg } from '@/api/modules/common'
import { getGoodInfoApi, getGoodGroupInfoApi, insertGoodGroupApi } from '@/api/modules/cmmodityLibrary'
import selectMutiProDialog from './selectMutiProDialog'
export default {
name: 'editProductGroup',
data() {
return {
title: '添加商品组',
titleObj: {
1: '新增商品组',
2: '编辑商品组',
3: '查看商品组'
},
isBlock: true,
editChildRef: 'editChildRef',
routeInfo: {
// 1-新增;2-编辑
addOrEdit: 1,
id: ''
},
editForm: {
coverImgUrl: '',
shopMallGoodsInfoList: []
},
editRule: {
coverImgUrl: [{ required: true, message: '请上传商品缩略图', trigger: 'change' }],
name: [{ required: true, message: '请输入商品名称', trigger: 'change' }]
},
// 商品选择
isMutiSelectVisible: false,
editFormData: [
{
label: '商品组缩略图',
name: 'coverImgUrl',
type: 'upload',
isDisabled: false,
maxPhotoNum: 1,
tips: '建议尺寸:300像素 * 300像素,图片大小不得超过1M',
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
uploadImg({ file: base64, fileType: 'image' }).then(res => {
this.editForm[targetItem.name] = res
this.$refs.editFormRef.$refs[this.editChildRef].validateField(targetItem.name)
})
}
},
{
label: '商品组名称',
name: 'name',
width: '480px',
type: 'input',
isDisabled: false,
maxlength: 20
},
{
label: '商品选择',
name: '',
addHtml: 'selectMutiPro'
},
{
name: '',
addHtml: 'proTable'
}
],
// 表格
hasPage: false,
tableParams: {
tableOption: true,
tableColumns: [
{
label: '商品图片',
prop: 'goodsImage',
addHtml: 'goodsImage'
},
{
label: '商品名称',
prop: 'goodsName'
},
{
label: '商品价格',
prop: 'retailPrice'
},
{
label: '设置直播价格(元)',
prop: '',
width: '180px',
addHtml: 'price'
},
{
label: '来源门店',
prop: 'merchantName'
}
]
}
}
},
components: {
glsxCombiForm,
selectMutiProDialog
},
computed: {},
mounted() {
this.routeInfo = this.$route.params
this.title = this.titleObj[this.routeInfo.addOrEdit]
this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
this.editFormData[0].isDisabled = this.routeInfo.addOrEdit == 3
this.editFormData[1].isDisabled = this.routeInfo.addOrEdit == 3
this.tableParams.tableOption = this.routeInfo.addOrEdit != 3
},
methods: {
getInfo() {
getGoodGroupInfoApi({ id: this.routeInfo.id }).then(res => {
console.log(res)
this.editForm = res
this.editForm.shopMallGoodsInfoList = []
if (res.goodsInfoList.length) {
res.goodsInfoList.forEach(item => {
this.editForm.shopMallGoodsInfoList.push({
id: item.goodsId,
retailPrice: item.price2 && item.price1 != item.price2 ? (item.price1 / 100).toFixed(2) + '-' + (item.price2 / 100).toFixed(2) : (item.price1 / 100).toFixed(2),
livePrice: (item.livePrice / 100).toFixed(2),
goodsName: item.name,
merchantId: item.merchantId,
merchantName: item.merchantName,
goodsImage: item.selfGoodsImageUrl
})
})
}
delete this.editForm.goodsInfoList
})
},
handleMutiPro(targetItem) {
this.isMutiSelectVisible = !this.isMutiSelectVisible
},
handleProDelete(obj) {
this.$messageBox.confirm('是否删除该商品?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'error',
callback: action => {
if (action == 'confirm') {
var idx = this.editForm.shopMallGoodsInfoList.findIndex(item => item.id == obj.id)
this.editForm.shopMallGoodsInfoList.splice(idx, 1)
}
}
})
},
handleMutiSelectConfirm(selectedProInfo) {
console.log(selectedProInfo)
var idExitList = this.editForm.shopMallGoodsInfoList.map(item => item.id)
var tempList = []
selectedProInfo.forEach(item => {
if (idExitList.includes(item.id)) {
tempList.push(this.editForm.shopMallGoodsInfoList.find(k => k.id == item.id))
} else {
tempList.push({
...item,
livePrice: ''
})
}
})
this.editForm.shopMallGoodsInfoList = tempList
this.handleMutiPro()
},
handleMutiSelectClose() {
this.handleMutiPro()
},
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = JSON.parse(JSON.stringify(this.editForm))
params.shopMallGoodsInfoList = []
this.editForm.shopMallGoodsInfoList.forEach(item => {
params.shopMallGoodsInfoList.push({
goodsId: item.id,
merchantId: item.merchantId,
merchantName: item.merchantName,
livePrice: (item.livePrice * 100).toFixed(0)
})
})
console.log(params)
insertGoodGroupApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.$router.push({
path: '/cmmodityLibrary/commodityList'
})
}
})
}
})
},
handleCancel() {
this.$router.push({
path: '/cmmodityLibrary/commodityList'
})
}
}
}
</script>
<style>
.edit-pro-group .select-pro {
width: 98%;
}
.edit-pro-group .m-t-10 {
margin-top: 10px;
}
.edit-pro-group .border-red {
border: 1px solid red;
}
</style>
<!-- 选择商品弹窗 -->
<template>
<glsx-dialog class="muti-pro" title="选择商品" :isVisible.sync="isMutiSelectVisible" width="70%" @confirmDialog="handleMutiSelectConfirm" @closeDialog="handleMutiSelectClose">
<GLTable ref="mutiProRef" :tableData="productList" :tableParams="tableParams" @refreshTable="getList">
<span slot="goodsImage" slot-scope="scope">
<img class="m-t-10 img-60" :src="scope.scope.goodsImage" />
</span>
</GLTable>
</glsx-dialog>
</template>
<script>
import { getGoodsList } from '@/api/modules/common'
import glsxDialog from '@/components/glsx-dialog'
export default {
name: 'selectMutiProDialog',
data() {
return {
// 表格组件
getListApi: getGoodsList,
productList: [],
// pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'list',
tableColumns: [
{
label: '商品名称',
prop: 'goodsName'
},
{
label: '缩略图',
prop: 'goodsImage',
addHtml: 'goodsImage'
},
{
label: '价格(元)',
prop: 'retailPrice'
},
{
label: '来源门店',
prop: 'merchantName'
}
]
}
}
},
props: {
isMutiSelectVisible: {
type: Boolean,
default: false
},
selectedProList: {
type: Array,
default: () => []
}
},
components: {
glsxDialog
},
mounted() {
this.getList(true)
},
methods: {
getList(isMounted = false) {
var params = {
goodsStatus: 1,
goodsSource: 1,
pageNum: isMounted ? 1 : this.$refs.mutiProRef.page.pageNum,
pageSize: isMounted ? 10 : this.$refs.mutiProRef.page.pageSize
}
var that = this
getGoodsList(params).then(res => {
// console.log(res)
this.productList = res.list
this.$refs.mutiProRef.tableTotal = res.total
this.productList.forEach(function(item) {
item.saleAmount = item.goodsStatistics.saleAmount
if (item.specificationDetailList.length > 1) {
let retailPriceList = item.specificationDetailList.sort(function(a, b) {
return a.retailPrice - b.retailPrice
})
let stockeList = item.specificationDetailList.sort(function(a, b) {
return a.stock - b.stock
})
let minRatilPrice = retailPriceList[0].retailPrice / 100
let maxRatilPrice = retailPriceList[retailPriceList.length - 1].retailPrice / 100
let minStock = stockeList[0].stock
let maxStock = stockeList[stockeList.length - 1].stock
item.retailPrice = minRatilPrice == maxRatilPrice ? minRatilPrice.toFixed(2) : minRatilPrice.toFixed(2) + '-' + maxRatilPrice.toFixed(2)
item.minRatilPrice = minRatilPrice.toFixed(2)
item.goodsStock = minStock == maxStock ? minStock : minStock + '-' + maxStock
} else if (item.specificationDetailList.length == 1) {
item.retailPrice = (item.specificationDetailList[0].retailPrice / 100).toFixed(2)
item.minRatilPrice = item.retailPrice
item.goodsStock = item.specificationDetailList[0].stock
} else {
item.retailPrice = (item.retailPrice / 100).toFixed(2)
item.minRatilPrice = item.retailPrice
}
})
this.recoverySelected()
})
},
recoverySelected() {
if (this.selectedProList.length) {
this.selectedProList.forEach(row => {
this.$refs.mutiProRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(row)
})
}
},
handleMutiSelectConfirm() {
var selectedData = this.$refs.mutiProRef.mutiSelectArr[this.tableParams.mutiSelectName]
console.log(selectedData)
this.$emit('handleMutiSelectConfirm', selectedData)
},
handleMutiSelectClose() {
this.$emit('handleMutiSelectClose')
}
}
}
</script>
<style>
.muti-pro .m-t-10 {
margin-top: 10px;
}
</style>
<!-- 选择商品 - 单选 -->
<template>
<glsx-dialog class="single-pro" title="选择商品" :isVisible.sync="isSingleSelectVisible" width="900px" @confirmDialog="handleSingleSelectConfirm" @closeDialog="handleSingleSelectClose">
<el-radio-group v-model="infoId">
<el-radio class="pro-box" v-for="item in productList" :key="item.id" :label="item.id">
<img :src="item.goodsImage" />
<div class="txt-box">
<p :title="item.goodsName" class="ellipsis">{{ item.goodsName }}</p>
<p class="f-s-12">销量:{{ item.saleAmount }}</p>
<p class="f-s-12">库存:{{ item.goodsStock }}</p>
<p class="f-s-12">零售价:{{ item.retailPrice }}</p>
<p :title="item.merchantName" class="ellipsis f-s-12">门店名称:{{ item.merchantName }}</p>
</div>
</el-radio>
</el-radio-group>
</glsx-dialog>
</template>
<script>
import { getGoodsList } from '@/api/modules/common'
import glsxDialog from '@/components/glsx-dialog'
export default {
name: 'selectSingleProDialog',
data() {
return {
infoId: '',
minRatilPrice: '',
productList: []
}
},
props: {
isSingleSelectVisible: {
type: Boolean,
default: false
},
selectedProInfo: {
type: Object,
default: () => {}
}
},
components: {
glsxDialog
},
computed: {},
mounted() {
this.infoId = this.selectedProInfo.id
this.getList()
},
methods: {
getList() {
var params = {
goodsStatus: 1,
goodsSource: 1,
pageNum: 1,
pageSize: 100000
}
var that = this
getGoodsList(params).then(res => {
// console.log(res)
this.productList = res.list
this.productList.forEach(function(item) {
item.saleAmount = item.goodsStatistics.saleAmount
if (item.specificationDetailList.length > 1) {
let retailPriceList = item.specificationDetailList.sort(function(a, b) {
return a.retailPrice - b.retailPrice
})
let stockeList = item.specificationDetailList.sort(function(a, b) {
return a.stock - b.stock
})
let minRatilPrice = retailPriceList[0].retailPrice / 100
let maxRatilPrice = retailPriceList[retailPriceList.length - 1].retailPrice / 100
let minStock = stockeList[0].stock
let maxStock = stockeList[stockeList.length - 1].stock
item.retailPrice = minRatilPrice == maxRatilPrice ? minRatilPrice.toFixed(2) : minRatilPrice.toFixed(2) + '-' + maxRatilPrice.toFixed(2)
item.minRatilPrice = minRatilPrice.toFixed(2)
item.goodsStock = minStock == maxStock ? minStock : minStock + '-' + maxStock
} else if (item.specificationDetailList.length == 1) {
item.retailPrice = (item.specificationDetailList[0].retailPrice / 100).toFixed(2)
item.minRatilPrice = item.retailPrice
item.goodsStock = item.specificationDetailList[0].stock
} else {
item.retailPrice = (item.retailPrice / 100).toFixed(2)
item.minRatilPrice = item.retailPrice
}
})
})
},
handleSingleSelectConfirm() {
if (!this.infoId) {
this.$message.error('请选择商品')
return true
}
var selectInfo = this.productList.find(item => item.id === this.infoId)
this.$emit('handleSingleSelectConfirm', selectInfo)
},
handleSingleSelectClose() {
this.$emit('handleSingleSelectClose')
}
}
}
</script>
<style>
.single-pro .pro-box {
width: 202px;
border: 1px solid #cccccc;
margin: 0 10px 10px 0;
}
.single-pro p {
margin: 0 0 8px 0;
}
.single-pro .f-s-12 {
font-size: 12px;
}
.single-pro .pro-box img {
width: 202px;
height: 202px;
}
.single-pro .el-radio__input {
position: absolute;
top: 8px;
left: 8px;
}
.single-pro .el-radio__label {
padding: 0;
}
.single-pro .txt-box {
padding: 10px 10px 0;
color: #666666;
}
.single-pro .ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
<!-- 未入库 -->
<template>
<div class="warehous-list">
<div class="flex">
<el-form>
<el-form-item>
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">添加商品</el-button>
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEditGroup(1)">添加商品组</el-button>
</el-form-item>
</el-form>
<el-form :inline="true" :model="searchForm">
<el-form-item label="商品搜索:">
<el-input :size="size" v-model="searchForm.name" placeholder="请输入商品名称" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
</div>
<GLTable ref="warehousListRef" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<span slot="coverImgUrl" slot-scope="scope">
<img class="img-60" :src="scope.scope.coverImgUrl" />
</span>
<span class="table-btns" slot="auth-button" slot-scope="scope" :data="scope.scope">
<span v-show="scope.scope.auditStatus != 1" >
<el-button type="text" @click="handleExamine(scope.scope)">提交审核</el-button>
<el-button type="text" @click="scope.scope.goodsGroupFlag == 'N' ? handleEdit(2, scope.scope) : handleEditGroup(2, scope.scope)">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
</span>
<el-button v-show="scope.scope.auditStatus == 1" type="text" @click="scope.scope.goodsGroupFlag == 'N' ? handleEdit(3, scope.scope) : handleEditGroup(3, scope.scope)">查看</el-button>
</span>
</GLTable>
</div>
</template>
<script>
import { getWarehousListApi, auditGoodApi, deleteGoodApi } from '@/api/modules/cmmodityLibrary'
import { auditStatusList } from '@/common/constant'
export default {
name: 'warehousList',
data() {
return {
size: 'small',
searchForm: {
name: '',
status: '-1'
},
// 表格组件
getListApi: getWarehousListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '商品标题',
prop: 'name',
line: 2
},
{
label: '直播间图片',
prop: 'coverImgUrl',
addHtml: 'coverImgUrl'
},
{
label: '价格(元)',
prop: 'price',
line: 1,
formatter: cellValue => {
return cellValue.price2 && cellValue.price1 != cellValue.price2 ? (cellValue.price1 / 100).toFixed(2) + '-' + (cellValue.price2 / 100).toFixed(2) : (cellValue.price1 / 100).toFixed(2)
}
},
{
label: '审核状态',
prop: 'auditStatus',
width: '80',
formatter: cellValue => {
return this.baseDataList.auditStatusList.find(item => item.confId == cellValue.auditStatus).confName
}
},
{
label: '来源门店',
prop: 'merchantName',
line: 2
}
]
},
baseDataList: {
auditStatusList: auditStatusList
}
}
},
components: {},
computed: {},
mounted() {},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
resolve()
})
},
// 1-新增;2-编辑;3-查看
handleEdit(addOrEdit, row) {
this.$router.push({
// name: 'editProduct',
// path: '/cmmodityLibrary/editProduct',
name: 'ServicesCmmodityLibraryEditProduct',
params: {
addOrEdit: addOrEdit,
id: row ? row.id : -1
}
})
},
// 1-新增;2-编辑;3-查看;4-修改价格
handleEditGroup(addOrEdit, row) {
this.$router.push({
// name: 'editProductGroup',
// path: '/cmmodityLibrary/editProductGroup',
name: 'ServicesCmmodityLibraryEditProductGroup',
params: {
addOrEdit: addOrEdit,
id: row ? row.id : -1
}
})
},
handleExamine(row) {
this.$messageBox.confirm('审核大概需要1-7天', '提交审核', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
auditGoodApi({ id: row.id }).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleSearch()
}
})
}
}
})
},
handleDelete(row) {
this.$messageBox.confirm('是否删除该商品?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'error',
callback: action => {
if (action == 'confirm') {
deleteGoodApi({ id: row.id }).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleSearch()
}
})
}
}
})
},
handleReset() {
this.searchForm = {
name: '',
status: '-1'
}
this.handleSearch()
},
handleSearch() {
this.$refs.warehousListRef.refreshTable()
}
}
}
</script>
<style scoped></style>
<template>
<div>
<div class="flex">
<el-form :inline="true" :model="searchForm">
<el-form-item label="商品搜索:">
<el-input :size="size" v-model="searchForm.name" placeholder="请输入商品名称" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="wareRef" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf">
<span slot="coverImgUrl" slot-scope="scope">
<img class="img-60" :src="scope.scope.coverImgUrl" />
</span>
<span class="table-btns" slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="handleEdit(scope.scope)">修改价格</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
</span>
</GLTable>
<!-- 表格区域 end -->
<!-- 修改价格弹框 开始 -->
<!-- <glsx-dialog title="修改价格" width="620px" :isVisible="showPriceDialog" @closeDialog="closePriceDialog" @confirmDialog="closePriceDialog">
<el-form ref="priceForm" :rules="formRules" :model="form" label-width="120px">
<el-form-item label="商品价格:" prop="price">
<el-input v-model="form.price" maxlength="8" style="width:400px" />
</el-form-item>
</el-form>
<div slot="footer">
<el-button type="primary" @click="resetPrice()">提交</el-button>
<el-button @click="showPriceDialog = false">取消</el-button>
</div>
</glsx-dialog> -->
<!-- 修改价格弹框 end -->
</div>
</template>
<script>
import { getWarehousListApi, deleteGoodApi } from '@/api/modules/cmmodityLibrary'
// import glsxDialog from '@/components/glsx-dialog'
export default {
// components: {
// glsxDialog
// },
data() {
return {
size: 'small',
searchForm: {
name: '',
status: '2'
},
// 表格组件
getListApi: getWarehousListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '商品标题',
prop: 'name',
line: 2
},
{
label: '直播间图片',
prop: 'coverImgUrl',
addHtml: 'coverImgUrl'
},
{
label: '价格(元)',
prop: 'price',
line: 1,
formatter: cellValue => {
return cellValue.price2 && cellValue.price1 != cellValue.price2 ? (cellValue.price1 / 100).toFixed(2) + '-' + (cellValue.price2 / 100).toFixed(2) : (cellValue.price1 / 100).toFixed(2)
}
},
{
label: '来源门店',
prop: 'merchantName',
line: 2
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// tableData: [
// {
// id: 1,
// pic: 'https://t7.baidu.com/it/u=4162611394,4275913936&fm=193&f=GIF',
// title: '商品标题',
// price: 999,
// merchant: 'xxx'
// }
// ],
// pageTotal: 0,
// userInfo: {},
// currentPage: 1,
// pageSizes: [10, 20, 30, 40],
// pageSize: 10,
// tdWidth: 170,
// DATEFORMATE: (str, type) => {
// return this.$Util.dateFormate(str, type)
// }
// showPriceDialog: false,
// form: {},
// formRules: {
// price: [{ required: true, message: '请输入价格', trigger: 'blur' }]
// }
}
},
created() {},
mounted: function() {},
methods: {
handleReset() {
this.searchForm = {
name: '',
status: '2'
}
this.handleSearch()
},
handleSearch() {
this.$refs.wareRef.refreshTable()
},
handleDelete(row) {
this.$messageBox.confirm('是否删除该商品?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'error',
callback: action => {
if (action == 'confirm') {
deleteGoodApi({ id: row.id }).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleSearch()
}
})
}
}
})
},
// 1-新增;2-编辑;3-查看;4-修改价格
handleEdit: function(row) {
// this.showPriceDialog = true
this.$router.push({
// name: 'editProductGroup',
// path: '/cmmodityLibrary/editProductGroup',
name: 'ServicesCmmodityLibraryEditProductGroup',
params: {
addOrEdit: 4,
id: row ? row.id : -1
}
})
},
// closePriceDialog: function() {
// this.showPriceDialog = false
// }
}
}
</script>
<style lang="scss">
.table_box {
margin: 20px 0;
}
</style>
<template> <template>
<div class="report-home"> <div class="service-home">
HOME <div class="header_widget">
<GLButton type="danger" @click="test()" class="test555" id="1-1-1-1" mode="link">权限按钮测试</GLButton> <span class="title">【嘀加企微管家】</span>
<GLButton type="success" size="small" @click="test()" id="1-1-1-1" class="test">权限按钮测试2</GLButton> <div class="tip">给您一套帮您变现的服务系统</div>
<el-button class="test" @click="test()">东方网分</el-button> </div>
<div class="fc_widget">
<div v-for="(item, index) in localList" :key="index" class="fc_wrapper flex-fac">
<div class="title">{{ item.title }}</div>
<span>{{ item.message }}</span>
<div class="btn">
<span>{{ item.tip }}</span>
<span class="btn_go" @click="toShowCase(index)">查看案例</span>
</div>
</div>
<div ref="animation1" class="animation_one flex-fsc">
<div class="close_icon" @click="closeAnimation"><i class="el-icon-circle-close"></i></div>
<div class="content_wrap flex-fac">
<div class="title">案例一:无情岁月催人老</div>
<p>床前明月光,疑似地上霜床前明月光,疑似地上霜床前明月光,疑似地上霜</p>
<img class="bg" src="../../assets/logo.png" />
</div>
<div class="content_wrap">2</div>
<div class="content_wrap">3</div>
</div>
<div ref="animation2" class="animation_one flex-fsc">
<div class="content_two_wrap"></div>
<div class="content_two_wrap bg2"></div>
<div class="close_icon" @click="closeAnimation"><i class="el-icon-circle-close"></i></div>
</div>
<div ref="animation3" class="animation_one flex-fsc">
<div class="content_two_wrap"></div>
<div class="content_two_wrap bg2"></div>
<div class="close_icon" @click="closeAnimation"><i class="el-icon-circle-close"></i></div>
</div>
</div>
<div class="line_widget">服务收益在线预估</div>
<div class="echart_wrapper">
<PieChart echartId="introduce"></PieChart>
</div>
</div> </div>
</template> </template>
<script> <script>
import PieChart from '../../components/service-echart/pie.vue'
export default { export default {
name: 'home', name: 'home',
methods: { components: {
test() { PieChart
console.log('点击了按钮') },
this.$messenger.send({ message: { from: 11, message: '11111' } }) data() {
return {
currentClickIndex: -1,
localList: [
{
title: '新车售前打包增值方案',
message: '4S店会员权益服务——赚钱、锁客两不误',
tip: '帮您年增值50万'
},
{
title: '精品售中升级',
message: '驻店升级转化精品——帮助门店新车流量托管式增值变现',
tip: '帮门店年度产值增加70W+'
},
{
title: '售后代运营服务',
message: '企微魔方帮用户沉淀企微——精准推荐、直播实现复购变现',
tip: '帮您售后产值增加20W/年'
} }
]
}
},
methods: {
toShowCase(index) {
this.currentClickIndex = index
this.$refs[`animation${index + 1}`].style.opacity = 1
this.$refs[`animation${index + 1}`].style['z-index'] = 20
},
closeAnimation() {
let index = this.currentClickIndex
this.$refs[`animation${index + 1}`].style.opacity = 0
this.$refs[`animation${index + 1}`].style['z-index'] = -999
},
computed() {}
} }
} }
</script> </script>
<style lang="scss" scoped>
.flex-fac {
display: flex;
flex-direction: column;
align-items: center;
}
.flex-fsc {
display: flex;
}
.header_widget {
.title {
font-size: 20px;
color: blue;
}
}
.fc_widget {
margin-top: 16px;
display: flex;
justify-content: space-between;
position: relative;
.fc_wrapper {
flex: 1;
height: 200px;
background: #fff;
border-radius: 16px;
margin: 0 16px;
position: relative;
padding: 20px 0;
.title {
font-size: 20px;
color: #333;
}
.btn {
width: 60%;
position: absolute;
bottom: 20px;
left: 50%;
transform: translate(-50%, 0);
padding: 8px 11px;
background: rgb(148, 142, 142);
border-radius: 12px;
font-size: 15px;
cursor: pointer;
display: flex;
justify-content: space-around;
.btn_go {
margin-left: 10px;
}
}
}
.animation_one {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
opacity: 0;
z-index: -999;
.close_icon {
position: absolute;
right: 10px;
top: 10px;
cursor: pointer;
color: #999;
z-index: 999;
}
.content_wrap {
flex: 1;
background: #fff;
.bg {
width: 110px;
height: 100px;
}
}
.content_two_wrap {
flex: 1;
background: rgb(204, 197, 102);
}
.bg2 {
background: greenyellow;
}
}
}
.line_widget {
width: 100%;
text-align: center;
font-size: 20px;
margin-top: 20px;
}
.echart_wrapper{
height: 250px;
padding: 20px;
}
</style>
<template>
<div class="rule-container">
<div class="top_wrapper">
<div class="tip_line">
<img class="icon" src="../../assets/notice.png" />
<span class="h10_title">尊敬的客户,您的分账规则于 #2021年10月1日 10:20#已经变更,新的规则将于 #2021年10月2日 00:00# 生效,修改人:管理员。</span>
</div>
<div class="drive_line"></div>
<div class="content_wrap">
<div class="time_widget">
<span class="h11_title">生效时间:2021年10月2日 00:00</span>
<div class="time_status">生效中</div>
</div>
<rule-table></rule-table>
</div>
</div>
<div class="list_wrapper">
<div class="find_wrap">
<div class="date_wrap">
<el-date-picker style="width: 160px" size="mini" v-model="startDate" type="date" placeholder="选择日期"></el-date-picker>
</div>
<div style="width: 10px; height: 1px"></div>
<div class="date_wrap">
<el-date-picker style="width: 160px" size="mini" v-model="endDate" type="date" placeholder="选择日期"></el-date-picker>
</div>
<el-button size="mini" type="primary">查询</el-button>
<span class="tip_text">查看分润计算说明</span>
</div>
<div class="timeLine_wrap">
<el-timeline>
<template v-for="count in 5">
<el-timeline-item :key="count" placement="top">
<div slot="dot" class="dot_line">
<div class="icon"></div>
<span class="text">生效时间:2021年01月01日 00:00-至今</span>
<div class="btn">生效中</div>
<span v-if="count % 2 != 0" class="tip_text">点击查看详情</span>
</div>
<div v-if="count % 2 == 0" class="table_con">
<rule-table></rule-table>
</div>
</el-timeline-item>
</template>
</el-timeline>
<div class="showMoreBtn h7_title flex_cc">
<span>查看更多</span>
<img class="icon" src="../../assets/down_icon.png" />
</div>
</div>
</div>
</div>
</template>
<script>
import ruleTable from './ruleTable.vue'
export default {
name: '',
components: {
'rule-table': ruleTable
},
data() {
return {
startDate: ''
}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
// .rule-container{
// margin-top: 17px;
// }
.top_wrapper {
width: 100%;
height: 520px;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
margin-top: 17px;
.tip_line {
box-sizing: border-box;
padding: 22px 20px 25px 20px;
display: flex;
align-items: center;
.icon {
width: 18px;
height: 18px;
margin-right: 6px;
}
}
.drive_line {
margin: 0 23px 0 36px;
height: 1px;
background: #e8e8ea;
}
.content_wrap {
box-sizing: border-box;
padding: 0px 19px 0 36px;
.time_widget {
box-sizing: border-box;
padding: 15px 0 10px 0;
display: flex;
align-items: center;
.time_status {
width: 48px;
height: 18px;
background: #eaeaea;
border-radius: 2px;
text-align: center;
line-height: 18px;
font-size: 10px;
font-weight: 400;
color: #5850ff;
margin-left: 10px;
}
}
}
}
.list_wrapper {
margin-top: 26px;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
box-sizing: border-box;
padding: 20px 19px 17px 20px;
.find_wrap {
display: flex;
align-items: center;
.date_wrap {
width: 160px;
}
.tip_text {
margin-left: 20px;
font-size: 14px;
font-weight: 500;
color: #5850ff;
cursor: pointer;
}
}
.timeLine_wrap {
margin-top: 19px;
position: relative;
.dot_line {
display: flex;
align-items: center;
box-sizing: border-box;
padding-left: 1.48px;
.icon {
width: 7px;
height: 7px;
background: #bebde5;
border-radius: 50%;
}
.text {
font-size: 14px;
font-weight: 500;
color: #000000;
margin-left: 9px;
margin-right: 10px;
}
.btn {
width: 48px;
height: 18px;
background: #5850ff;
border-radius: 2px;
text-align: center;
line-height: 18px;
font-size: 10px;
font-weight: 400;
color: #ffffff;
}
}
.table_con {
margin-top: 30px;
}
.tip_text {
font-size: 14px;
font-weight: 500;
color: #5850ff;
margin-left: 10px;
cursor: pointer;
}
.showMoreBtn {
position: absolute;
left: 50%;
bottom: 58px;
transform: translate(-50%, 0);
width: 105px;
height: 30px;
background: #e8e8ea;
border-radius: 2px;
cursor: pointer;
> img {
margin-left: 5px;
width: 10px;
height: 9px;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="bloc-container">集团端已开通</div>
</template>
<script>
export default {
name: 'bloc',
data() {
return {}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="open-container">
<!-- <div class="video_wrapper">
<el-button size="small" type="primary" @click="jumpToVideoPage">接入演示</el-button>
</div> -->
</div>
</template>
<script>
export default {
name: '',
data() {
return {}
},
mounted() {},
methods: {
jumpToVideoPage() {
this.$router.push('/inSale/playVideo')
}
}
}
</script>
<style lang="scss" scoped>
.video_wrapper {
background: white;
padding: 15px;
width: 100%;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="guest-container">
<div class="top_tip_title">
<span class="h6_title">客户评价使用场景</span>
<div class="toNext_widget">
<span class="h7_title">查看效果演示</span>
<i class="el-icon-d-arrow-right"></i>
</div>
</div>
<div class="tip_wrap">
<span class="h5_title">车主精品升级服务施工完成后,系统会通过微信小程序通知自动提醒客户取车,并且邀请客户好评,客户完成评价后,门店可以在对应的“订单-查看明细”中查看评价。</span>
</div>
<div class="box_wrapper">
<div class="box_1 flex-cc">
<span class="h7_title">(累计)评价客户数</span>
<div class="h8_title">
<span>7878</span>
<span style="margin-left: 5px" class="h7_title">人</span>
</div>
<span class="h9_title">(累计)施工完成客户数:10000</span>
</div>
<div class="box_1 flex-cc">
<span class="h7_title">(累计)好评客户数</span>
<div class="h8_title">
<span>7878</span>
<span style="margin-left: 5px" class="h7_title">人</span>
</div>
<span style="height: 20px" class="h9_title"></span>
</div>
<div class="box_1 box_2 flex-ca">
<div class="box_con">
<div class="circle_wrap">
<el-progress width="60" color="#5850FF" type="circle" :percentage="25"></el-progress>
</div>
<span class="h7_title">客户评价率</span>
</div>
<div class="box_con">
<div class="circle_wrap">
<el-progress width="60" color="#5850FF" type="circle" :percentage="50"></el-progress>
</div>
<span class="h7_title">客户好评率</span>
</div>
</div>
</div>
<div class="tip_title">
<span class="h6_title">客评</span>
</div>
<div class="image_show">
<div class="image_wrap">
<span class="h9_title">小程序通知</span>
<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/mini_message.png" />
</div>
<div class="image_wrap">
<span class="h9_title">客评内容</span>
<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/guest_content.png" />
</div>
</div>
<div style="height:20px"></div>
</div>
</template>
<script>
export default {
name: '',
data() {
return {}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.guest-container {
width: 100%;
// height: calc(100% - 17px);
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
margin-top: 17px;
}
.top_tip_title {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
padding: 20px 19px 15px 21px;
.toNext_widget {
cursor: pointer;
display: flex;
align-items: center;
> i {
color: #5850ff;
font-size: 10px;
margin-left: 6px;
}
}
}
.tip_wrap {
box-sizing: border-box;
padding-left: 21px;
> span {
font-weight: 500;
}
}
.box_wrapper {
display: flex;
align-items: center;
justify-content: space-between;
padding: 17px 19px 19px 21px;
.box_1 {
width: calc(30% - 10px);
height: 120px;
border-radius: 4px;
border: 1px solid #d8d8d8;
}
.box_2 {
width: calc(40% - 10px);
.box_con {
display: flex;
flex-direction: column;
}
.circle_wrap {
width: 60px;
height: 60px;
margin-bottom: 10px;
}
}
.flex-cc {
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-evenly;
}
.flex-ca {
display: flex;
align-items: center;
justify-content: space-around;
}
}
.tip_title {
box-sizing: border-box;
padding-left: 21px;
}
.image_show {
display: flex;
align-items: center;
justify-content: space-around;
margin-top: 10px;
.image_wrap {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
>span{
margin-bottom: 10px;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="not-open-container">
<div v-if="accountLevel == 4" class="store-tab-con">
<el-tabs v-model="activeName" @tab-click="handleClick">
<template v-for="(item, index) in tabList">
<el-tab-pane :key="index" :label="item.label" :name="item.name">
<!-- <custom v-if="activeName == 'custom'"></custom>
<rule v-if="activeName == 'rule'"></rule>
<Demo v-if="activeName == 'upgrade'"></Demo> -->
</el-tab-pane>
</template>
</el-tabs>
</div>
<div v-if="accountLevel!=4" class="bloc-page">
<!-- <Demo></Demo> -->
</div>
</div>
</template>
<script>
// import custom from './guestComments.vue'
// import rule from './accountRules.vue'
// import Demo from './demo.vue'
export default {
name: 'bloc',
// components: {
// custom,
// rule,
// Demo
// },
data() {
return {
accountLevel: 4,
activeName: 'upgrade',
tabList: [
{
name: 'upgrade',
label: '精品升级'
},
{
name: 'custom',
label: '客户评价'
},
{
name: 'rule',
label: '分账规则'
}
]
}
},
mounted() {
// const { session } = this.$globalState
// this.accountLevel = session.accountLevel
},
methods: {
handleClick(tab) {
console.log(tab.name)
}
}
}
</script>
<style lang="scss" scoped>
.store-tab-con {
width: 100%;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="in-sale-index"></div>
</template>
<script>
export default {
name: 'index',
data() {
return {
}
},
created() {
// 默认进入精品升级页面
this.$router.push('/inSale/upgrade')
},
mounted() {
// const { session } = this.$globalState
// console.log(session, '**********')
// this.accountLevel = session.accountLevel
},
methods: {}
}
</script>
<template>
<div class="not-open-container">
<div class="header_widget">
<div class="posi_wrap_one">
<div class="h2_title">精品升级</div>
<div class="h1_title title_margin">帮您创造新的业绩增长点</div>
<div class="h4_title">专注经销商精品礼券转化升级服务,为经销商提供增值服务。</div>
<div class="video_wrapper">
<el-button size="small" type="primary" @click="openVideoWindow">接入演示</el-button>
</div>
</div>
<div class="posi_wrap_two"></div>
</div>
<div class="mini_main_widget">
<div class="box_wrap margin_1">
<div class="h3_title">您提供的</div>
<div class="line_icon_text">
<div class="icon_num">1</div>
<div class="text">一键转发您门店的精品礼券</div>
<img class="icon" src="../../assets/go_icon.png">
</div>
</div>
<div class="box_wrap margin_2">
<div class="h3_title">您将获得的</div>
<div class="line_icon_text">
<div class="icon_num">1</div>
<div class="text">获得转化的精品收益</div>
</div>
</div>
<div class="box_wrap">
<div class="h3_title"></div>
<div class="line_icon_text">
<div class="icon_num">2</div>
<div class="text">收款后实时分账,提供精品订单明细,保障合作财务透明</div>
</div>
</div>
</div>
<div class="main_con_widget">
<template v-for="count in 2">
<div :key="count" class="left_widget">
<div class="wrapper">
<div class="h3_title">案例1-广州某合资品牌丰田4S店</div>
<div class="h3_title margin_3">合作之前</div>
<div class="con2_widget margin_4">
<div v-if="count == 1" class="text_label h5_title">太阳膜赠送成本:300元/车</div>
<template v-if="count == 2">
<div class="text_label h5_title">旗下门店数:28家</div>
<div class="text_label h5_title">太阳膜赠送成本:300元/车</div>
<div class="text_label h5_title">集团年度新车销量:26880</div>
<div class="text_label h5_title">单店年度新车销量:960</div>
</template>
</div>
</div>
<div class="drive_line"></div>
<div class="wrapper_2">
<div class="h3_title">合作之后</div>
<div v-if="count == 1" class="text_line_widget margin_4">
<div class="h5_title">
2020年6月份累计收益:
<span class="price">5344</span>
元
</div>
<div class="h5_title">
2020年度累计收益约:
<span class="price">10万</span>
元
</div>
</div>
<div v-if="count == 2" class="text_line_widget margin_4">
<div class="h5_title">
2020年集团累计收益约:
<span class="price">5344</span>
元
</div>
<div class="h5_title">
平均单店收益约:
<span class="price">10万</span>
元
</div>
</div>
<div v-if="count == 1" class="h5_title margin_5">太阳膜新增升级收益23400元,节省赠送膜成本100*300=300000元</div>
<div v-if="count == 2" style="height: 16px" class="margin_5"></div>
<div class="table_widget margin_4">
<table>
<tr v-if="count == 1">
<th v-for="(item, index) in tableHeader1" :key="index">{{ item }}</th>
</tr>
<tr v-if="count == 2">
<th v-for="(item, index) in tableHeader2" :key="index">{{ item }}</th>
</tr>
<tr v-if="count == 1">
<td v-for="(item, index) in tableTD1" :key="index">{{ item }}</td>
</tr>
<tr v-if="count == 2">
<td v-for="(item, index) in tableTD2" :key="index">{{ item }}</td>
</tr>
</table>
</div>
</div>
</div>
</template>
</div>
<el-dialog :visible.sync="videoShow" width="50%" :before-close="handleClose">
<video v-if="videoShow" width="100%" height="100%" controls src="https://img02.glsx.com.cn/scrm/video/pre_video.mp4"></video>
</el-dialog>
<!-- <div class="qrcode_wrap"></div> -->
</div>
</template>
<script>
export default {
name: '',
data() {
return {
tableHeader1: ['6月新增销量', '转化率', '转化量', '平均客单价', '增值产值', '分店分润'],
tableHeader2: ['门店年度新车销量', '年度转化率', '平均客单价', '门店年度产值', '集团年度产值'],
tableTD1: [100, 50, 20, 30, 40, 60],
tableTD2: [100, 50, 20, 30, 40],
videoShow: false
}
},
mounted() {},
methods: {
openVideoWindow() {
this.videoShow = true
},
handleClose() {
this.videoShow = false
}
}
}
</script>
<style lang="scss" scoped>
.not-open-container {
position: relative;
}
.header_widget {
width: 100%;
height: 360px;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
margin-top: 17px;
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 0 80px;
.posi_wrap_one {
height: 100%;
box-sizing: border-box;
padding-top: 77px;
overflow: hidden;
.title_margin {
margin: 5px 0 10px 0;
}
.video_wrapper {
margin-top: 25px;
}
}
.posi_wrap_two {
width: 451px;
height: 276px;
background: #d8d8d8;
}
}
.mini_main_widget {
width: 100%;
height: 100px;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
box-sizing: border-box;
margin: 10px 0;
padding: 0 20px;
display: flex;
align-items: center;
.box_wrap {
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
overflow: hidden;
.line_icon_text {
display: flex;
align-items: center;
margin-top: 15px;
.icon_num {
width: 16px;
height: 16px;
display: flex;
flex-direction: center;
justify-content: center;
background: #5850ff;
border-radius: 50%;
color: white;
font-size: 14px;
font-weight: 400;
}
.text {
font-size: 14px;
font-weight: 400;
color: #3a3a3a;
margin: 0 5px;
}
.icon{
width: 16px;
height: 16px;
cursor: pointer;
}
}
}
.margin_1 {
margin-right: 200px;
}
.margin_2 {
margin-right: 100px;
}
}
.main_con_widget {
display: flex;
justify-content: space-between;
.left_widget,
.right_widget {
width: calc(50% - 5px);
min-height: 404px;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
}
.wrapper {
box-sizing: border-box;
padding: 25px 0 0 19px;
}
.con2_widget {
display: flex;
flex-wrap: wrap;
height: 64px;
.text_label {
width: 50%;
margin-bottom: 5px;
}
}
.drive_line {
margin: 0 auto;
width: calc(100% - 40px);
height: 1px;
background: #e8e8ea;
margin-bottom: 19px;
}
.wrapper_2 {
padding: 0 20px;
.text_line_widget {
display: flex;
align-items: center;
justify-content: space-between;
.price {
font-size: 18px;
}
}
.table_widget {
width: 100%;
height: 94px;
background: #f6f6f7;
overflow: hidden;
td,
th {
border: 1px solid #e0e0e4;
font-size: 14px;
font-weight: 400;
color: #3a3a3a;
}
th,
td {
height: 45px;
text-align: center;
line-height: 45px;
}
table {
width: 100%;
border-collapse: collapse;
}
}
}
.margin_3 {
margin-top: 30px;
}
.margin_4 {
margin-top: 10px;
}
.margin_5 {
margin-top: 25px;
}
}
.qrcode_wrap {
position: fixed;
right: 0;
bottom: 182px;
width: 201px;
height: 201px;
background: #ffffff;
}
</style>
<template>
<div class="video-container">
<video width="100%" height="100%" controls autoplay src="http://static.video.qq.com/TPout.swf?vid=n01393q6qvo&auto=0"></video>
<i class="el-icon-circle-close" @click="toBackPage"></i>
</div>
</template>
<script>
export default {
name: '',
data() {
return {}
},
mounted() {},
methods: {
toBackPage() {
history.go(-1)
}
}
}
</script>
<style lang="scss" scoped>
.video-container {
width: 100%;
height: 100%;
position: relative;
> i {
position: absolute;
right: 20px;
top: 20px;
cursor: pointer;
font-size: 28px;
color: white;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="content_body">
<div class="max_widget">
<div class="table_one">
<p class="h7_title">商户名:深圳XXXX公司</p>
<div class="title_text">
<p class="h7_title">分润计算:扣除手续费(按0.6%的标准)</p>
<p class="min_text">仅针对POS机收款订单</p>
</div>
</div>
<div class="table_two">
<div class="table_th h7_title">分账品类</div>
<div class="table_th h7_title">分账模式</div>
<div class="table_th h7_title">分润比例</div>
</div>
<div class="table_three">
<div class="table_th h7_title">全部(除特殊分账品类)</div>
<div class="table_th h7_title">收入分润</div>
<div class="table_th h7_title">30%</div>
</div>
<div class="table_three">
<div class="table_th h7_title">
<span>特殊分账品类:</span>
太阳膜
</div>
<div class="table_th h7_title">毛利分润</div>
<div class="table_th h7_title">30%</div>
</div>
<div class="table_four flex_scb">
<div class="h9_title">
<span>是否自动打款:</span>
<span>是</span>
</div>
<div class="h9_title">
<span>分账周期:T+1</span>
<span class="min_text">(分账后第2天到对公账户)</span>
</div>
</div>
<div class="table_four flex_scb">
<div class="h9_title">
<span>您的分账金额包含:导流方分账金额,服务商分账金额</span>
</div>
</div>
<div class="table_four flex_scb border_all">
<div class="h9_title">
<span>收款账户: XXXX商户有限公司</span>
</div>
</div>
</div>
<div class="min_widget">
<div class="title h7_title">对公账户信息</div>
<div class="info_widget">
<span class="h9_title">开户账户户行:招商银行</span>
<span class="h9_title">开户支行:招商银行深圳泰然支行</span>
<span class="h9_title">账户号:755918931710302</span>
<span class="h9_title">账户名称:深圳广联赛讯股份有限公司</span>
</div>
</div>
</div>
</template>
<script>
export default {
name: '',
data() {
return {}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.content_body {
display: flex;
justify-content: space-between;
.max_widget {
width: calc(100% - 270px);
height: 389px;
.table_one {
width: 100%;
height: 54px;
background: #f4f6fc;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 0 34px 0 15px;
.title_text {
display: flex;
flex-direction: column;
align-items: center;
.min_text {
font-size: 12px;
color: #999;
margin-top: 10px;
}
}
}
.table_two,
.table_three {
width: 100%;
height: 54px;
background: #f4f6fc;
display: flex;
.table_th {
width: 33.33%;
text-align: center;
line-height: 54px;
border-right: 1px solid #e8e8ea;
border-top: 1px solid #e8e8ea;
border-left: 1px solid #e8e8ea;
> span {
font-size: 12px;
}
}
}
.table_three {
background: #ffffff;
height: 58px;
.table_th {
line-height: 58px;
}
}
.table_four {
height: 58px;
width: 100%;
box-sizing: border-box;
padding: 0 20px;
border-right: 1px solid #e8e8ea;
border-top: 1px solid #e8e8ea;
border-left: 1px solid #e8e8ea;
.min_text {
color: #999999;
font-size: 12px;
margin-left: 10px;
}
}
.border_all {
border: 1px solid #e8e8ea;
}
}
.min_widget {
width: 260px;
height: 393px;
border: 2px solid #e8e8ea;
.title {
width: 100%;
text-align: center;
height: 54px;
line-height: 54px;
background: #f4f6fc;
}
.info_widget {
box-sizing: border-box;
padding: 21px 11px;
display: flex;
flex-direction: column;
> span {
margin-bottom: 20px;
word-wrap: break-word;
word-break: break-all;
white-space: pre-wrap !important;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="store-container">门店端</div>
</template>
<script>
export default {
name: 'index',
data() {
return {
}
},
mounted() {
},
methods: {}
}
</script>
<template>
<div class="store-container">
<not-open-con v-if="openType == 0"></not-open-con>
<open-con v-if="openType == 1"></open-con>
</div>
</template>
<script>
import notOpenCon from './notOpenCon.vue'
import openCon from './open.vue'
export default {
name: 'index',
components: {
'not-open-con': notOpenCon,
'open-con': openCon
},
data() {
return {
openType: 1 // 0未开通 1已开通
}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
</style>
<template>
<div class="report-home">
<h2>
子应用2
</h2>
<div id="nav">
<el-button-group class="right">
<el-button type="primary" size="medium" @click="routerChange('/about/index')">应用内跳转</el-button>
<el-button type="primary" size="medium" @click="toAppReport('1-1-1')">子应用1-ui测试-组件测试</el-button>
<el-button type="primary" size="medium" @click="toAppReport('1-2')">子应用1-关于子应用</el-button>
<el-button type="primary" size="medium" @click="toAppReport({ path: 'sub01/changeData' })">不存在的路由</el-button>
</el-button-group>
</div>
<div class="parent-child-communication">
<h3>父子应用通信:</h3>
<div style="margin-bottom: 20px;">
<el-button class="right" type="primary" size="medium" @click="callParentChange()">给登录用户改个名</el-button>
</div>
<img src="../assets/logo.png" alt="" srcset="" />
</div>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
<div>11</div>
<div>12</div>
<div>13</div>
<div>14</div>
<div>15</div>
<div>16</div>
<div>17</div>
<div>18</div>
<div>19</div>
<div>20</div>
<div>21</div>
<div>22</div>
<div>23</div>
<div>24</div>
<div>25</div>
<div>26</div>
<div>27</div>
<div>28</div>
<div>29</div>
<div>30</div>
<div>31</div>
<div>32</div>
<div>33</div>
<div>34</div>
<div>35</div>
<div>36</div>
<div>37</div>
<div>38</div>
<div>39</div>
<div>40</div>
<div>41</div>
<div>42</div>
<div>43</div>
<div>44</div>
<div>45</div>
<div>46</div>
<div>47</div>
<div>48</div>
<div>49</div>
<div>50</div>
<div>51</div>
<div>52</div>
<div>53</div>
<div>54</div>
<div>55</div>
<div>56</div>
<div>57</div>
<div>58</div>
<div>59</div>
<div>60</div>
<div>61</div>
<div>62</div>
<div>63</div>
<div>64</div>
<div>65</div>
<div>66</div>
<div>67</div>
<div>68</div>
<div>69</div>
<div>70</div>
<div>71</div>
<div>72</div>
<div>73</div>
<div>74</div>
<div>75</div>
<div>76</div>
<div>77</div>
<div>78</div>
<div>79</div>
<div>80</div>
<div>81</div>
<div>82</div>
<div>83</div>
<div>84</div>
<div>85</div>
<div>86</div>
<div>87</div>
<div>88</div>
<div>89</div>
<div>90</div>
<div>91</div>
<div>92</div>
<div>93</div>
<div>94</div>
<div>95</div>
<div>96</div>
<div>97</div>
<div>98</div>
<div>99</div>
<div>100</div>
</div>
</template>
<script>
export default {
name: 'report-home',
data() {
return {}
},
methods: {
/**
* 路由切换
* url 路由地址
*/
routerChange(url) {
this.$router.push(url).catch(err => {
console.log(err)
})
},
/**
* 外部路由跳转
* this.$history.push(menu)
* menu 支持:1.string 视为id (每一个路由都有一个唯一id)
* 2.对象 {path:'sub1/home',id:'1-1-1'} 以id为准 跳转对应模块
* 3.对象 {path:'sub1/home'} 以path为准 跳转对应模块
* 以上三种情况都跳转到对应的模块
*/
toAppReport(menu) {
this.$history.push(menu)
},
callParentChange() {
this.$messenger.send({
userInfo: { name: '张三,来自子系统2' }
})
}
}
}
</script>
<style lang="scss">
.parent-child-communication {
padding: 20px 0;
line-height: 36px;
}
</style>
<template>
<div class="live-room">
<div class="container">
<div class="flex">
<el-form :inline="true" :model="searchForm">
<el-form-item label="成员搜索:">
<el-input :size="size" v-model="searchForm.name" placeholder="请输入微信号或者昵称" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="memberRef" :getListApi="getListApi" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf">
<span slot="headingImg" slot-scope="scope">
<img class="img-60" :src="scope.scope.headingImg" />
</span>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
</template>
<script>
import { getMerberList } from '@/api/modules/liveMember'
export default {
name: 'memberList',
data() {
return {
size: 'small',
searchForm: {
name: ''
},
getListApi: getMerberList,
tableParams: {
listName: 'list',
tableColumns: [
{
label: '头像',
prop: 'headingImg',
addHtml: 'headingImg'
},
{
label: '昵称',
prop: 'nickName',
line: 2
},
{
label: '微信号',
prop: 'userName',
line: 2
},
{
label: '所属角色',
prop: 'roleList',
line: 2,
formatter: cellValue => {
var txt = ''
cellValue.roleList.forEach((item, index) => {
let tempTxt = this.baseDataList.roleList.find(k => k.confId == item).confName
txt = index ? (txt + ',' + tempTxt) : tempTxt
})
return txt
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
baseDataList: {
roleList: [{
confId: 0,
confName: '超级管理员'
}, {
confId: 1,
confName: '管理员'
}, {
confId: 2,
confName: '主播'
}, {
confId: 3,
confName: '运营者'
}]
}
}
},
created() {},
mounted: function() {},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
resolve()
})
},
handleReset() {
this.searchForm = {
name: ''
}
this.handleSearch()
},
handleSearch() {
this.$refs.memberRef.refreshTable()
}
}
}
</script>
<style lang="scss">
.table_box {
margin: 20px 0;
}
</style>
<!-- 直播间列表 -->
<template>
<div class="live-room">
<div class="container live-room">
<div class="flex">
<el-form>
<el-form-item>
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">新增直播</el-button>
</el-form-item>
</el-form>
<el-form :inline="true" :model="searchForm">
<el-form-item label="直播间搜索:">
<el-input :size="size" v-model="searchForm.name" placeholder="请输入直播间名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
</div>
<GLTable ref="liveRoomRef" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<span slot="shareImgUrl" slot-scope="scope">
<img class="img-60" :src="scope.scope.shareImgUrl" />
</span>
<span class="table-btns" slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="handleDetail(scope.scope)">控制台</el-button>
<el-button type="text" @click="handleShare(scope.scope)">分享</el-button>
<el-button v-if="scope.scope.liveStatus == '102'" type="text" @click="handleEdit(2, scope.scope)">编辑</el-button>
<el-button v-if="scope.scope.liveStatus != '101'" type="text" @click="handleDelete(scope.scope)">删除</el-button>
</span>
</GLTable>
<glsx-dialog title="分享" width="730px" :isVisible="isShareVisible" :noCancel="noCancel" @closeDialog="handleShareClose" @confirmDialog="handleShareClose">
<div class="share-dialog">
<div class="flex">
<div class="flex box poster">
<div>
<p class="share-txt">海报</p>
<!-- <p>小程序码不带参数</p> -->
<el-button :size="size" type="primary">保存图片</el-button>
</div>
<img :src="shareForm.posterUrl" />
</div>
<div class="flex box poster">
<div>
<p class="share-txt">小程序码</p>
<!-- <p>小程序码不带参数</p> -->
<el-button :size="size" type="primary">保存图片</el-button>
</div>
<img :src="shareForm.cdnUrl" />
</div>
</div>
<div class="box page-route">
<div>
<p class="route-txt">短链</p>
<div class="flex">
<p style="width: 426px;">{{shareForm.pagePath}}</p>
<el-button :size="size" type="primary" @click="handleSaveTxt(shareForm.pagePath)">复制链接</el-button>
<!-- <p>链接是直播间原始页面路径,如需加入参数,详见使用方法</p> -->
</div>
</div>
</div>
</div>
</glsx-dialog>
</div>
</div>
</template>
<script>
import glsxDialog from '@/components/glsx-dialog'
// import glsxTable from '@/components/glsx-table'
import { getLiveRoomListApi, getLiveShareApi, deleteLiveRoomApi } from '@/api/modules/liveRoom'
import { liveStatusList } from '@/common/constant'
export default {
name: 'liveRoom',
data() {
return {
size: 'small',
searchForm: {
name: ''
},
// 分享 - 弹窗
shareForm: {},
isShareVisible: false,
noCancel: true,
// 表格组件
getListApi: getLiveRoomListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '最近开播',
prop: 'time',
width: '180',
formatter: cellValue => {
return cellValue.startTime + '-' + cellValue.endTime
}
},
{
label: '直播间名称',
prop: 'name',
line: 1
},
{
label: '房间号',
prop: 'roomId'
},
{
label: '主播',
prop: 'anchorName',
line: 1
},
{
label: '直播间图片',
prop: 'shareImgUrl',
line: 1,
addHtml: 'shareImgUrl'
},
{
label: '直播状态',
prop: 'liveStatus',
width: '80',
formatter: cellValue => {
return this.baseDataList.liveStatusList.find(item => item.confId == cellValue.liveStatus).confName
}
}
]
},
baseDataList: {
liveStatusList: liveStatusList
}
}
},
components: {
glsxDialog
// glsxTable
},
mounted() {
console.log(this.$common.utils)
},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
resolve()
})
},
handleShare(row) {
getLiveShareApi({ id: row.id }).then(res => {
console.log(res)
this.isShareVisible = !this.isShareVisible
this.shareForm = res
})
},
handleShareClose() {
// this.handleShare()
this.isShareVisible = !this.isShareVisible
},
handleSaveTxt(txt) {
const input = document.createElement('input')
document.body.appendChild(input)
input.setAttribute('value', txt)
input.select()
document.execCommand('Copy')
document.body.removeChild(input)
this.$message({
message: '复制成功',
type: 'success'
})
},
handleDetail(row) {
this.$router.push({
// name: 'liveControl',
// path: '/liveRoom/liveControl',
name: 'ServicesLiveRoomLiveControl',
params: {
id: row.id
}
})
},
handleDelete(row) {
this.$messageBox.confirm('是否删除该直播间?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'error',
callback: action => {
if (action == 'confirm') {
deleteLiveRoomApi({ id: row.id }).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleSearch()
}
})
}
}
})
},
// 1-新增;2-编辑
handleEdit(addOrEdit, row) {
// console.log(row)
// this.$history.push('services/liveRoom/editLiveRoom', { addOrEdit: addOrEdit, row: row || {} })
// this.eventBus.$emit('editRoom', {
// addOrEdit: addOrEdit,
// id: row ? row.id : ''
// })
this.$router.push({
name: 'ServicesLiveRoomEditLiveRoom',
params: {
addOrEdit: addOrEdit,
id: row ? row.id : '-1'
}
// name: 'editLiveRoom',
// path: '/liveRoom/editLiveRoom'
})
},
handleSearch() {
this.$refs.liveRoomRef.refreshTable()
}
}
}
</script>
<style>
.live-room .flex {
display: flex;
justify-content: space-between;
}
.live-room .share-dialog .box {
background: #f7f7f7;
border-radius: 6px;
padding: 30px;
}
.live-room .share-dialog .poster img {
width: 150px;
height: 240px;
margin-left: 45px;
}
.live-room .share-dialog .page-route {
margin-top: 16px;
}
.live-room .share-dialog .page-route .route-txt {
font-weight: bold;
padding-bottom: 10px;
}
.live-room .share-dialog .share-txt {
font-weight: bold;
margin-bottom: 50px;
}
</style>
<!-- 关联门店弹窗 -->
<template>
<glsx-dialog title="关联门店" :isVisible.sync="relateStoreVisible" width="70%" btnOkLabel="关联" @confirmDialog="handleRelateStoreConfirm" @closeDialog="handleRelateStoreClose" class="relateStore">
<slot></slot>
<el-row>
<el-col :span="12">
<el-table ref="seletingTable" :data="selectingData" height="464px" class="table" border @select="handleChange" @select-all="handleAll">
<el-table-column type="selection" width="55" align="center" :selectable="selectable"></el-table-column>
<el-table-column prop="merchantName" label="商户名称" align="center">
<!-- <template slot-scope="scope">
<span :class="{ red: !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage) }">{{ scope.row.yqMerchantName }}</span>
</template> -->
</el-table-column>
<!-- <el-table-column prop="merchantName" label="4S店名称" align="center">
<template slot-scope="scope">
<span :class="{ red: !scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage) }">{{ scope.row.merchantName }}</span>
<el-tooltip v-if="!scope.row.isSetUpgradeSettleRule" popper-class="tooltip-class" effect="dark" content="该门店无配置财务分润规则,无法关联!" placement="top">
<span v-if="!scope.row.isSetUpgradeSettleRule && needTip.includes(sourcePage)" class="tip-icon">?</span>
</el-tooltip>
</template>
</el-table-column> -->
</el-table>
<el-pagination small background @current-change="handleCurrentChange" :current-page.sync="pageNum" :page-size="pageSize" layout="total, prev, pager, next" :total="total"></el-pagination>
</el-col>
<el-col :span="12">
<el-table :data="selectedData" class="table" border height="464px">
<el-table-column prop="merchantName" label="商户名称" align="center"></el-table-column>
<!-- <el-table-column prop="merchantName" label="4S店名称" align="center"></el-table-column> -->
<el-table-column label="删除" align="center" width="50">
<template slot-scope="scope">
<el-button style="padding: 0;" class="el-icon-delete" @click="handleDelete(scope.row)" type="text"></el-button>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
</glsx-dialog>
</template>
<script>
import glsxDialog from '@/components/glsx-dialog'
export default {
name: 'relateStoreDialog',
data() {
return {
selectedData: [],
selectingData: [],
// needTip: ['editProduct'],
// 分页
total: 0,
pageNum: 1,
pageSize: 20
}
},
props: {
relateStoreVisible: {
type: Boolean,
default: false
},
// 页面来源
// sourcePage: {
// type: String,
// default: ''
// },
storeApi: {
type: Function,
default: () => {}
},
storeSelected: {
type: Array,
default: () => []
},
storeSearchForm: {
type: Object,
default: () => {}
}
// 去掉表格中某些字段
// noTableField: {
// type: Array,
// default: () => []
// }
},
components: {
glsxDialog
},
mounted() {
this.selectedData = this.storeSelected
this.getSelectingList()
},
methods: {
selectable(row, index) {
var isSelect = row.hasOwnProperty('beServed') ? !row.beServed : true
// if (this.sourcePage === 'editProduct') {
// isSelect = row.isSetUpgradeSettleRule
// }
return isSelect
},
recoverySelection() {
var exitIds = this.selectedData.map(item => item.merchantNo + '')
this.selectingData.forEach(item => {
if (exitIds.includes(item.merchantNo)) {
this.$refs.seletingTable.toggleRowSelection(item, true)
}
})
},
getSelectingList() {
this.storeApi({
...this.storeSearchForm,
pageNum: this.pageNum,
pageSize: this.pageSize
}).then(res => {
this.selectingData = res.list
this.total = res.total
this.$nextTick(() => {
this.recoverySelection()
})
})
},
handleChange(selection, row) {
var addOrDelete = !!selection.find(item => item.merchantNo === row.merchantNo)
addOrDelete ? this.selectedData.push(row) : (this.selectedData = this.selectedData.filter(item => item.merchantNo !== row.merchantNo))
},
handleAll(selection) {
this.selectingData.forEach(item => {
var isExit = this.selectedData.findIndex(subItem => subItem.merchantNo === item.merchantNo)
var isServed = item.hasOwnProperty('beServed') ? item.beServed : false
if (selection.length && isExit === -1 && !isServed) {
this.selectedData.push(item)
} else if (!selection.length && isExit !== -1) {
this.selectedData.splice(isExit, 1)
}
})
},
handleDelete(row) {
this.selectedData = this.selectedData.filter(item => item.merchantNo !== row.merchantNo)
this.$refs.seletingTable.toggleRowSelection(row)
},
handleCurrentChange(val) {
this.pageNum = val
this.getSelectingList()
},
handleRelateStoreConfirm() {
if (!this.selectedData.length) {
this.$message({
message: '请选择关联门店',
type: 'warning',
showClose: true
})
return true
}
this.$emit('handleRelateStoreConfirm', this.selectedData)
},
handleRelateStoreClose() {
this.$emit('handleRelateStoreClose')
}
}
}
</script>
<style>
.relateStore .table {
margin: 0 auto 20px !important;
width: 98%;
}
/* .service-store .relateStore .el-table .cell,
.d2-form .relateStore .el-table .cell {
line-height: 26px !important;
} */
.service-store .relateStore .el-table--medium td,
.d2-form .relateStore .el-table--medium td {
padding: 6px 8px !important;
}
.relateStore .red {
color: red;
}
.relateStore .tip-icon {
position: absolute;
display: inline-block;
height: 10px;
width: 10px;
line-height: 10px;
color: #ffffff;
background-color: red;
border: 1px solid red;
border-radius: 50%;
cursor: pointer;
font-size: 6px;
margin-left: 2px;
}
</style>
<!-- 选择商品弹窗 -->
<template>
<glsx-dialog class="muti-pro" title="选择商品" :isVisible.sync="isMutiSelectVisible" width="70%" @confirmDialog="handleMutiSelectConfirm" @closeDialog="handleMutiSelectClose">
<GLTable ref="mutiProRef" :searchForm="searchForm" :tableParams="tableParams" :tableData="tableData" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"></GLTable>
</glsx-dialog>
</template>
<script>
import glsxDialog from '@/components/glsx-dialog'
export default {
name: 'selectMutiProDialog',
data() {
return {
// 表格组件
getListApi: '',
tableData: [
{
id: 1,
name: '商品名称1'
},
{
id: 2,
name: '商品名称2'
}
],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'list',
tableOption: true,
tableColumns: [
{
label: '商品名称',
prop: 'name'
},
{
label: '缩略图',
prop: 'title'
},
{
label: '价格(元)',
prop: 'status'
},
{
label: '来源门店',
prop: ''
}
]
}
}
},
props: {
isMutiSelectVisible: {
type: Boolean,
default: false
}
},
components: {
glsxDialog
},
mounted() {},
methods: {
handleMutiSelectConfirm() {
var selectedData = this.$refs.mutiProRef.mutiSelectArr[this.tableParams.mutiSelectName]
console.log(selectedData)
this.$emit('handleMutiSelectConfirm', selectedData)
},
handleMutiSelectClose() {
this.$emit('handleMutiSelectClose')
}
}
}
</script>
<style></style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!