Commit 7eb16e57 by cwq0219

商品组,直播成员

1 parent deabf2f5
...@@ -12,6 +12,17 @@ const getWarehousListApi = params => { ...@@ -12,6 +12,17 @@ const getWarehousListApi = params => {
}) })
} }
const auditGoodApi = params => {
params.method = `${defaultPath}audit.goods`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const getGoodInfoApi = params => { const getGoodInfoApi = params => {
params.method = `${defaultPath}get.good.by.id` params.method = `${defaultPath}get.good.by.id`
return http({ return http({
...@@ -22,6 +33,16 @@ const getGoodInfoApi = params => { ...@@ -22,6 +33,16 @@ const getGoodInfoApi = params => {
}) })
} }
const getGoodGroupInfoApi = params => {
params.method = `${defaultPath}get.good.group.by.id`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true
})
}
const insertGoodApi = params => { const insertGoodApi = params => {
params.method = `${defaultPath}insert.good` params.method = `${defaultPath}insert.good`
return http({ return http({
...@@ -33,4 +54,15 @@ const insertGoodApi = params => { ...@@ -33,4 +54,15 @@ const insertGoodApi = params => {
}) })
} }
export { getWarehousListApi, getGoodInfoApi, insertGoodApi } const insertGoodGroupApi = params => {
params.method = `${defaultPath}insert.good.group`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export { getWarehousListApi, auditGoodApi, getGoodInfoApi, getGoodGroupInfoApi, insertGoodApi, insertGoodGroupApi }
import { http } from '@/main'
const defaultPath = 'scrm.api.live.'
const getMerberList = params => {
params.method = `${defaultPath}get.member.list`
return http({
url: 'rop-scrm-live/router',
method: 'GET',
data: params,
sign: true
})
}
export { getMerberList }
.container { .live-room .container {
background: #FFFFFF; background: #FFFFFF;
margin: 20px 40px; margin: 20px 40px;
padding: 15px 20px; padding: 15px 20px;
box-shadow: 0 1px 5px 0 rgba(38, 38, 38, 0.10); box-shadow: 0 1px 5px 0 rgba(38, 38, 38, 0.10);
} }
img { .live-room .img-60 {
width: 60px; width: 60px;
height: 60px; height: 60px;
} }
.edit-container { .live-room .edit-container {
margin: 20px 40px 84px; margin: 20px 40px 84px;
} }
.footer { .live-room .footer {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
width: 100%; width: 100%;
...@@ -22,14 +22,15 @@ img { ...@@ -22,14 +22,15 @@ img {
text-align: center; text-align: center;
line-height: 64px; line-height: 64px;
background: #FFFFFF; background: #FFFFFF;
z-index: 999;
} }
.flex { .live-room .flex {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
.edit-title { .live-room .edit-title {
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
height: 48px; height: 48px;
...@@ -40,7 +41,7 @@ img { ...@@ -40,7 +41,7 @@ img {
margin: 0 0; margin: 0 0;
} }
.edit-sub-title::before { .live-room .edit-sub-title::before {
position: absolute; position: absolute;
display: inline-block; display: inline-block;
content: ''; content: '';
...@@ -51,7 +52,7 @@ img { ...@@ -51,7 +52,7 @@ img {
background-color: #0947C6; background-color: #0947C6;
} }
.edit-sub-title { .live-room .edit-sub-title {
position: relative; position: relative;
font-size: 16px; font-size: 16px;
font-weight: 700; font-weight: 700;
...@@ -60,30 +61,30 @@ img { ...@@ -60,30 +61,30 @@ img {
padding-left: 8px; padding-left: 8px;
} }
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;
} // }
table tr { // .live-room table tr {
height: 30px; // height: 30px;
// line-height: 30px; // // line-height: 30px;
} // }
table th, // .live-room table th,
table td { // .live-room table td {
font-size: 12px; // font-size: 12px;
font-weight: normal; // font-weight: normal;
padding: 0px 10px; // padding: 0px 10px;
border: 1px solid #e5e6e7; // border: 1px solid #e5e6e7;
border-width: 0px 1px 1px 0px; // border-width: 0px 1px 1px 0px;
border-spacing: 0; // border-spacing: 0;
text-align: center; // text-align: center;
vertical-align: middle; // vertical-align: middle;
} // }
table td {
min-width: 50px;
}
\ No newline at end of file \ No newline at end of file
// .live-room table td {
// min-width: 50px;
// }
\ No newline at end of file \ No newline at end of file
...@@ -27,8 +27,7 @@ function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, max ...@@ -27,8 +27,7 @@ function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, max
} }
} }
const liveStatusList = [ const liveStatusList = [{
{
confId: '101', confId: '101',
confName: '直播中' confName: '直播中'
}, },
...@@ -58,4 +57,22 @@ const liveStatusList = [ ...@@ -58,4 +57,22 @@ const liveStatusList = [
} }
] ]
export { limitPrice, liveStatusList } const auditStatusList = [{
confId: 0,
confName: '未审核'
},
{
confId: 1,
confName: '审核中'
},
{
confId: 2,
confName: '审核通过'
},
{
confId: 3,
confName: '审核失败'
}
]
export { limitPrice, liveStatusList, auditStatusList }
\ No newline at end of file \ No newline at end of file
...@@ -62,11 +62,13 @@ ...@@ -62,11 +62,13 @@
</el-upload> --> </el-upload> -->
<template v-else-if="item.type === 'upload'"> <template v-else-if="item.type === 'upload'">
<p class="photo-top-tips">{{ item.topTips }}</p> <p class="photo-top-tips">{{ item.topTips }}</p>
<div v-if="Array.isArray(formObj[item.name]) ? (formObj[item.name].length < item.maxPhotoNum) : !formObj[item.name]" class="activity-img"> <div v-if="!item.isDisabled">
<div v-if="Array.isArray(formObj[item.name]) ? (formObj[item.name].length < item.maxPhotoNum) : !formObj[item.name]" class="activity-img img-w-h">
<div class="add">+</div> <div class="add">+</div>
<span class="number">{{ formObj[item.name].length }} / {{ item.maxPhotoNum }}</span> <span class="number">{{ formObj[item.name].length }} / {{ item.maxPhotoNum }}</span>
<input type="file" style="opacity: 0;" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleImgChange(e, item)"> <input type="file" style="opacity: 0;" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleImgChange(e, item)">
</div> </div>
</div>
<template> <template>
<div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length : formObj[item.name]"> <div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length : formObj[item.name]">
<span v-if="Array.isArray(formObj[item.name])"> <span v-if="Array.isArray(formObj[item.name])">
...@@ -74,7 +76,7 @@ ...@@ -74,7 +76,7 @@
<img class="img-w-h" :src="subItem.content" /> <img class="img-w-h" :src="subItem.content" />
<span class="img-btns"> <span class="img-btns">
<span class="btn-item"> <span class="btn-item">
<i class="el-icon-delete" @click="handleImgDelete(item, subIndex)"></i> <i v-show="!item.isDisabled" class="el-icon-delete" @click="handleImgDelete(item, subIndex)"></i>
<i class="el-icon-zoom-in" @click="handleImgLook(subItem.content)"></i> <i class="el-icon-zoom-in" @click="handleImgLook(subItem.content)"></i>
</span> </span>
</span> </span>
...@@ -84,7 +86,7 @@ ...@@ -84,7 +86,7 @@
<img class="img-w-h" :src="formObj[item.name]" /> <img class="img-w-h" :src="formObj[item.name]" />
<span class="img-btns"> <span class="img-btns">
<span class="btn-item"> <span class="btn-item">
<i class="el-icon-delete" @click="handleImgDelete(item)"></i> <i v-show="!item.isDisabled" class="el-icon-delete" @click="handleImgDelete(item)"></i>
<i class="el-icon-zoom-in" @click="handleImgLook(formObj[item.name])"></i> <i class="el-icon-zoom-in" @click="handleImgLook(formObj[item.name])"></i>
</span> </span>
</span> </span>
...@@ -169,10 +171,14 @@ export default { ...@@ -169,10 +171,14 @@ export default {
handleImgChange(e, targetItem) { handleImgChange(e, targetItem) {
var reader = new FileReader() var reader = new FileReader()
var file = e.srcElement.files[0] var file = e.srcElement.files[0]
const limitSize = targetItem.limitSize || 10 // console.log(file)
const isType = ['image/jpeg', 'image/png', 'image/jpg'].includes(file.type) // 默认1MB
const limitSize = targetItem.limitSize || 1
const isLt = file.size / 1024 / 1024 < limitSize const isLt = file.size / 1024 / 1024 < limitSize
const isType = ['image/jpeg', 'image/png', 'image/jpg'].includes(file.type)
const maxPhotoNum = targetItem.maxPhotoNum || 1 const maxPhotoNum = targetItem.maxPhotoNum || 1
const wdithLt = targetItem.wdithLt || 300
const heightLt = targetItem.heightLt || 300
if (maxPhotoNum == this.formObj[targetItem.name].length) { if (maxPhotoNum == this.formObj[targetItem.name].length) {
this.$message.error('只能上传' + maxPhotoNum + '张图片') this.$message.error('只能上传' + maxPhotoNum + '张图片')
return true return true
...@@ -187,8 +193,18 @@ export default { ...@@ -187,8 +193,18 @@ export default {
} }
reader.readAsDataURL(file) reader.readAsDataURL(file)
reader.onload = e => { reader.onload = e => {
var image = new Image()
image.src = e.target.result
image.onload = () => {
var imgWidth = image.width
var imgHeight = image.height
if (imgWidth > wdithLt || imgHeight > heightLt) {
this.$message.error('图片尺寸最大为'+ wdithLt +'像素*' + heightLt + '像素')
} else {
targetItem.handleUpload(e, file, targetItem) targetItem.handleUpload(e, file, targetItem)
} }
}
}
}, },
// 图片删除 // 图片删除
handleImgDelete(targetItem, subIndex = -1) { handleImgDelete(targetItem, subIndex = -1) {
......
<!-- 商品库 --> <!-- 商品库 -->
<template> <template>
<div class="live-room">
<div class="container"> <div class="container">
<el-tabs v-model="activeName" type="card" @tab-click="handleTabClick"> <el-tabs v-model="activeName" type="card" @tab-click="handleTabClick">
<el-tab-pane label="未入库" name="noWarehous"> <el-tab-pane label="未入库" name="noWarehous">
...@@ -10,6 +11,7 @@ ...@@ -10,6 +11,7 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
</div>
</template> </template>
<script> <script>
......
<!-- 添加商品 --> <!-- 添加商品 -->
<template> <template>
<div class="edit-pro"> <div class="edit-pro live-room">
<div class="container edit-container"> <div class="container edit-container">
<p class="edit-title">{{ routeInfo.addOrEdit == 1 ? '添加商品' : '编辑商品' }}</p> <p class="edit-title">{{ title }}</p>
<glsx-combi-form ref="editFormRef" labelWidth="140px" :isBlock="isBlock" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"> <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"> <div slot="selectSinglePro" slot-scope="item" class="select-pro">
<el-button type="text" @click="handleSinglePro(item)">{{ selectedProInfo.id ? '更换' : '请选择' }}</el-button> <el-button v-show="routeInfo.addOrEdit != 3" type="text" @click="handleSinglePro(item)">{{ selectedProInfo.id ? '更换' : '请选择' }}</el-button>
</div> </div>
<div slot="proTable" class="select-pro"> <div slot="proTable" class="select-pro">
<GLTable v-show="selectedProInfoList.length" ref="warehousListRef" :hasPage="hasPage" :searchForm="searchForm" :tableParams="tableParams" :tableData="selectedProInfoList"> <GLTable v-show="selectedProInfoList.length" ref="warehousListRef" :hasPage="hasPage" :searchForm="searchForm" :tableParams="tableParams" :tableData="selectedProInfoList">
<span slot="goodsImage" slot-scope="scope"> <span slot="goodsImage" slot-scope="scope">
<img class="m-t-10" :src="scope.scope.goodsImage" /> <img class="m-t-10 img-60" :src="scope.scope.goodsImage" />
</span> </span>
<span slot="price"> <span slot="price">
<el-input placeholder="请输入" v-model="editForm.price"><template slot="append">元</template></el-input> <el-input :disabled="routeInfo.addOrEdit == 3" placeholder="请输入" v-model="editForm.price"><template slot="append">元</template></el-input>
</span> </span>
<span slot="auth-button"> <span slot="auth-button">
<el-button type="text" @click="handleProDelete()">删除</el-button> <el-button type="text" @click="handleProDelete()">删除</el-button>
</span> </span>
</GLTable> </GLTable>
<!-- <table v-show="Object.keys(selectedProInfoList).length" cellpadding="0" cellspacing="0" class="table-block">
<tr>
<td>商品图片</td>
<td>商品名称</td>
<td>商品价格</td>
<td>来源门店</td>
</tr>
<tr>
<td><img :src="selectedProInfoList.goodsImage" /></td>
<td>{{ selectedProInfoList.goodsName }}</td>
<td>{{ selectedProInfoList.retailPrice }}</td>
<td>{{ selectedProInfoList.merchantName }}</td>
</tr>
</table> -->
</div> </div>
</glsx-combi-form> </glsx-combi-form>
<p>直播价表示直播开始时,用户购买的实际支付价格,直播结束时恢复原价</p> <p>直播价表示直播开始时,用户购买的实际支付价格,直播结束时恢复原价</p>
<select-single-pro-dialog v-if="isSingleSelectVisible" :isSingleSelectVisible="isSingleSelectVisible" :selectedProInfo="selectedProInfo" @handleSingleSelectConfirm="handleSingleSelectConfirm" @handleSingleSelectClose="handleSingleSelectClose"></select-single-pro-dialog> <select-single-pro-dialog v-if="isSingleSelectVisible" :isSingleSelectVisible="isSingleSelectVisible" :selectedProInfo="selectedProInfo" @handleSingleSelectConfirm="handleSingleSelectConfirm" @handleSingleSelectClose="handleSingleSelectClose"></select-single-pro-dialog>
</div> </div>
<div class="footer"> <div class="footer">
<el-button type="primary" @click="handleConfirm">确定</el-button> <el-button v-show="routeInfo.addOrEdit != 3" type="primary" @click="handleConfirm">确定</el-button>
<el-button type="default" @click="handleCancel">取消</el-button> <el-button type="default" @click="handleCancel">取消</el-button>
</div> </div>
</div> </div>
...@@ -57,10 +43,15 @@ export default { ...@@ -57,10 +43,15 @@ export default {
data() { data() {
return { return {
title: '添加商品', title: '添加商品',
titleObj: {
1: '新增商品',
2: '编辑商品',
3: '查看商品'
},
isBlock: true, isBlock: true,
editChildRef: 'editChildRef', editChildRef: 'editChildRef',
routeInfo: { routeInfo: {
// 1-新增;2-编辑 // 1-新增;2-编辑;3-查看
addOrEdit: 1, addOrEdit: 1,
id: '' id: ''
}, },
...@@ -84,6 +75,7 @@ export default { ...@@ -84,6 +75,7 @@ export default {
name: 'coverImgUrl', name: 'coverImgUrl',
type: 'upload', type: 'upload',
// limitSize: 1, // limitSize: 1,
isDisabled: false,
maxPhotoNum: 1, maxPhotoNum: 1,
tips: '建议尺寸:300像素 * 300像素,图片大小不得超过1M', tips: '建议尺寸:300像素 * 300像素,图片大小不得超过1M',
handleUpload: (e, file, targetItem) => { handleUpload: (e, file, targetItem) => {
...@@ -100,6 +92,7 @@ export default { ...@@ -100,6 +92,7 @@ export default {
name: 'name', name: 'name',
width: '480px', width: '480px',
type: 'input', type: 'input',
isDisabled: false,
maxlength: 20 maxlength: 20
}, },
{ {
...@@ -162,7 +155,11 @@ export default { ...@@ -162,7 +155,11 @@ export default {
mounted() { mounted() {
this.routeInfo = this.$route.query this.routeInfo = this.$route.query
this.routeInfo.addOrEdit == 2 ? this.getInfo() : '' 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: { methods: {
...@@ -174,6 +171,7 @@ export default { ...@@ -174,6 +171,7 @@ export default {
if (res.goodsInfo) { if (res.goodsInfo) {
this.selectedProInfo = { this.selectedProInfo = {
id: res.goodsInfo.goodsId, 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, goodsName: res.goodsInfo.name,
merchantId: res.goodsInfo.merchantId, merchantId: res.goodsInfo.merchantId,
merchantName: res.goodsInfo.merchantName, merchantName: res.goodsInfo.merchantName,
......
<!-- 选择商品弹窗 --> <!-- 选择商品弹窗 -->
<template> <template>
<glsx-dialog class="muti-pro" title="选择商品" :isVisible.sync="isMutiSelectVisible" width="70%" @confirmDialog="handleMutiSelectConfirm" @closeDialog="handleMutiSelectClose"> <glsx-dialog class="muti-pro" title="选择商品" :isVisible.sync="isMutiSelectVisible" width="70%" @confirmDialog="handleMutiSelectConfirm" @closeDialog="handleMutiSelectClose">
<GLTable ref="mutiProRef" :tableParams="tableParams" :tableData="tableData" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"></GLTable> <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> </glsx-dialog>
</template> </template>
<script> <script>
import { getGoodsList } from '@/api/modules/common'
import glsxDialog from '@/components/glsx-dialog' import glsxDialog from '@/components/glsx-dialog'
export default { export default {
name: 'selectMutiProDialog', name: 'selectMutiProDialog',
data() { data() {
return { return {
// 表格组件 // 表格组件
getListApi: '', getListApi: getGoodsList,
tableData: [ productList: [],
{ // pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
id: 1,
name: '商品名称1'
},
{
id: 2,
name: '商品名称2'
}
],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数 // 表格参数
tableParams: { tableParams: {
listName: 'list', listName: 'list',
...@@ -31,23 +27,23 @@ export default { ...@@ -31,23 +27,23 @@ export default {
mutiSelectUniqueKey: 'id', mutiSelectUniqueKey: 'id',
// 多选ref的名称 // 多选ref的名称
mutiSelectName: 'list', mutiSelectName: 'list',
tableOption: true,
tableColumns: [ tableColumns: [
{ {
label: '商品名称', label: '商品名称',
prop: 'name' prop: 'goodsName'
}, },
{ {
label: '缩略图', label: '缩略图',
prop: 'title' prop: 'goodsImage',
addHtml: 'goodsImage'
}, },
{ {
label: '价格(元)', label: '价格(元)',
prop: 'status' prop: 'retailPrice'
}, },
{ {
label: '来源门店', label: '来源门店',
prop: '' prop: 'merchantName'
} }
] ]
} }
...@@ -58,6 +54,10 @@ export default { ...@@ -58,6 +54,10 @@ export default {
isMutiSelectVisible: { isMutiSelectVisible: {
type: Boolean, type: Boolean,
default: false default: false
},
selectedProList: {
type: Array,
default: () => []
} }
}, },
...@@ -65,9 +65,58 @@ export default { ...@@ -65,9 +65,58 @@ export default {
glsxDialog glsxDialog
}, },
mounted() {}, mounted() {
this.getList(true)
},
methods: { 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() { handleMutiSelectConfirm() {
var selectedData = this.$refs.mutiProRef.mutiSelectArr[this.tableParams.mutiSelectName] var selectedData = this.$refs.mutiProRef.mutiSelectArr[this.tableParams.mutiSelectName]
console.log(selectedData) console.log(selectedData)
...@@ -79,4 +128,8 @@ export default { ...@@ -79,4 +128,8 @@ export default {
} }
} }
</script> </script>
<style></style> <style>
.muti-pro .m-t-10 {
margin-top: 10px;
}
</style>
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</template> </template>
<script> <script>
import { uploadImg, getGoodsList } from '@/api/modules/common' import { getGoodsList } from '@/api/modules/common'
import glsxDialog from '@/components/glsx-dialog' import glsxDialog from '@/components/glsx-dialog'
export default { export default {
name: 'selectSingleProDialog', name: 'selectSingleProDialog',
......
...@@ -21,26 +21,31 @@ ...@@ -21,26 +21,31 @@
<div></div> <div></div>
<GLTable ref="warehousListRef" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"> <GLTable ref="warehousListRef" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<span slot="coverImgUrl" slot-scope="scope"> <span slot="coverImgUrl" slot-scope="scope">
<img style="width: 60px; height: 60px;" :src="scope.scope.coverImgUrl" /> <img class="img-60" :src="scope.scope.coverImgUrl" />
</span> </span>
<span slot="auth-button" slot-scope="scope" :data="scope.scope"> <span 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="handleExamine(scope.scope)">提交审核</el-button>
<el-button type="text" @click="handleEdit(2, 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> <el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
</span> </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> </GLTable>
</div> </div>
</template> </template>
<script> <script>
import { getWarehousListApi } from '@/api/modules/cmmodityLibrary' import { getWarehousListApi, auditGoodApi } from '@/api/modules/cmmodityLibrary'
import { auditStatusList } from '@/common/constant'
export default { export default {
name: 'warehousList', name: 'warehousList',
data() { data() {
return { return {
size: 'small', size: 'small',
searchForm: { searchForm: {
name: '' name: '',
status: '-1'
}, },
// 表格组件 // 表格组件
getListApi: getWarehousListApi, getListApi: getWarehousListApi,
...@@ -67,10 +72,20 @@ export default { ...@@ -67,10 +72,20 @@ export default {
} }
}, },
{ {
label: '审核状态',
prop: 'auditStatus',
formatter: cellValue => {
return this.baseDataList.auditStatusList.find(item => item.confId == cellValue.auditStatus).confName
}
},
{
label: '来源门店', label: '来源门店',
prop: 'merchantName' prop: 'merchantName'
} }
] ]
},
baseDataList: {
auditStatusList: auditStatusList
} }
} }
}, },
...@@ -87,9 +102,8 @@ export default { ...@@ -87,9 +102,8 @@ export default {
resolve() resolve()
}) })
}, },
// 1-新增;2-编辑 // 1-新增;2-编辑;3-查看
handleEdit(addOrEdit, row) { handleEdit(addOrEdit, row) {
console.log(row)
this.$router.push({ this.$router.push({
// name: 'editProduct', // name: 'editProduct',
path: '/cmmodityLibrary/editProduct', path: '/cmmodityLibrary/editProduct',
...@@ -99,14 +113,14 @@ export default { ...@@ -99,14 +113,14 @@ export default {
} }
}) })
}, },
// 1-新增;2-编辑 // 1-新增;2-编辑;3-查看
handleEditGroup(addOrEdit, row) { handleEditGroup(addOrEdit, row) {
this.$router.push({ this.$router.push({
// name: 'editProductGroup', // name: 'editProductGroup',
path: '/cmmodityLibrary/editProductGroup', path: '/cmmodityLibrary/editProductGroup',
query: { query: {
addOrEdit: addOrEdit, addOrEdit: addOrEdit,
row: row || {} id: row ? row.id : ''
} }
}) })
}, },
...@@ -115,9 +129,14 @@ export default { ...@@ -115,9 +129,14 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
type: 'warning', type: 'warning',
callback: action => { callback: action => {
auditGoodApi({ id: row.id }).then(res => {
this.$message({ this.$message({
type: 'success', message: res.code == '0' ? '操作成功' : '操作失败',
message: '操作成功' type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleSearch()
}
}) })
} }
}) })
...@@ -136,7 +155,8 @@ export default { ...@@ -136,7 +155,8 @@ export default {
}, },
handleReset() { handleReset() {
this.searchForm = { this.searchForm = {
name: '' name: '',
status: '-1'
} }
this.handleSearch() this.handleSearch()
}, },
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="wareRef" :searchForm="searchForm" :tableParams="tableParams" :tableData="tableData" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"> <GLTable ref="wareRef" :searchForm="searchForm" :tableParams="tableParams" :tableData="tableData" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<span slot="showImg" slot-scope="scope"> <span slot="showImg" slot-scope="scope">
<img style="width: 50px; height: 50px;" :src="scope.scope.pic" /> <img class="img-60" :src="scope.scope.pic" />
{{ scope.scope.title }} {{ scope.scope.title }}
</span> </span>
<span slot="auth-button" slot-scope="scope" :data="scope.scope"> <span slot="auth-button" slot-scope="scope" :data="scope.scope">
......
<template> <template>
<div> <div class="live-room">
<el-card shadow="never" slot="header"> <div class="container">
<el-form :inline="true" :model="searchForm" class="demo-form-inline" size="small"> <div class="flex">
<el-form-item label="成员搜索:"> <el-form :inline="true" :model="searchForm">
<el-input v-model="searchForm.userName" placeholder="请输入微信号或者昵称" clearable /> <el-form-item label="成员搜索:">
<el-input :size="size" v-model="searchForm.name" placeholder="请输入微信号或者昵称" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" :loading="tableLoading" @click="getList()">搜索</el-button> <el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
</el-form-item> <el-button :size="size" @click="handleReset">重置</el-button>
<el-form-item>
<el-button :loading="tableLoading" @click="reset()">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="memberRef" :searchForm="searchForm" :tableParams="tableParams" :tableData="tableData" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"> <GLTable ref="memberRef" :getListApi="getListApi" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf">
<span slot="showImg" slot-scope="scope"> <span slot="headingImg" slot-scope="scope">
<img style="width: 50px; height: 50px;" :src="scope.scope.pic" /> <img class="img-60" :src="scope.scope.headingImg" />
</span> </span>
</GLTable> </GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
</div> </div>
</div>
</template> </template>
<script> <script>
// import { import { getMerberList } from '@/api/modules/liveMember'
// GETLISTUSERINFO,
// UPDATEPASSWORD
// } from '@/http/interface'
export default { export default {
name: 'memberList', name: 'memberList',
components: {
// 'glsx-dialog': GlsxDialog,
// 'add-cus': AddCus,
},
data() { data() {
return { return {
size: 'small',
searchForm: { searchForm: {
userName: '' name: ''
}, },
getListApi: getMerberList,
tableParams: { tableParams: {
listName: 'list', listName: 'list',
tableOption: true,
tableColumns: [ tableColumns: [
{ {
label: '头像', label: '头像',
prop: 'pic', prop: 'headingImg',
line: 1, addHtml: 'headingImg'
addHtml: 'showImg'
}, },
{ {
label: '昵称', label: '昵称',
prop: 'userName' prop: 'nickName'
}, },
{ {
label: '微信号', label: '微信号',
prop: 'userCode' prop: 'userName'
}, },
{ {
label: '所属角色', label: '所属角色',
prop: 'roleName' prop: 'roleList',
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' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
tableData: [ baseDataList: {
{ roleList: [{
id: 1, confId: 0,
pic: 'https://t7.baidu.com/it/u=4162611394,4275913936&fm=193&f=GIF', confName: '超级管理员'
userName: '昵称', }, {
userCode: '微信号', confId: 1,
roleName: '所属角色' confName: '管理员'
}, {
confId: 2,
confName: '主播'
}, {
confId: 3,
confName: '运营者'
}]
} }
],
tableLoading: false
} }
}, },
created() {}, created() {},
mounted: function() { mounted: function() {},
// this.getList()
},
methods: { methods: {
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
...@@ -89,56 +93,14 @@ export default { ...@@ -89,56 +93,14 @@ export default {
}) })
}, },
/** handleReset() {
* 查询列表 this.searchForm = {
*/ name: ''
getList: function(current) {
const _this = this
const oParams = _this.getParams()
// oParams.pageNum = current || _this.currentPage
_this.tableLoading = true
let list = [
{
id: 1,
pic: 'https://t7.baidu.com/it/u=4162611394,4275913936&fm=193&f=GIF',
userName: '昵称',
userCode: '微信号',
roleName: '所属角色'
} }
] this.handleSearch()
// GETLISTUSERINFO(oParams).then(res => {
// console.log(res)
_this.tableLoading = false
// if (res.returnCode == 0) {
// const { data } = res
// const { total, list } = data
_this.tableData = list || []
// _this.pageTotal = total
// }
// })
},
/**
* 获取查询参数
*/
getParams: function() {
const oParams = this.formInline
oParams.pageSize = this.pageSize
return oParams
},
/**
* 每页展示
*/
changePageSize: function(e) {
this.pageSize = e
this.getList()
}, },
/** handleSearch() {
* 重置
*/
reset() {
this.$refs.memberRef.refreshTable() this.$refs.memberRef.refreshTable()
} }
} }
......
<!-- 编辑直播间 --> <!-- 编辑直播间 -->
<template> <template>
<div> <div class="live-room">
<div class="container edit-container"> <div class="container edit-container">
<p class="edit-title">{{ title }}</p> <p class="edit-title">{{ title }}</p>
<!-- <p class="edit-sub-title" style="margin-top: 10px;">关联门店信息</p> --> <!-- <p class="edit-sub-title" style="margin-top: 10px;">关联门店信息</p> -->
......
<!-- 直播间列表 --> <!-- 直播间列表 -->
<template> <template>
<div class="live-room">
<div class="container live-room"> <div class="container live-room">
<div class="flex"> <div class="flex">
<el-form> <el-form>
...@@ -19,7 +20,7 @@ ...@@ -19,7 +20,7 @@
</div> </div>
<GLTable ref="liveRoomRef" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"> <GLTable ref="liveRoomRef" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<span slot="shareImgUrl" slot-scope="scope"> <span slot="shareImgUrl" slot-scope="scope">
<img style="width: 60px; height: 60px;" :src="scope.scope.shareImgUrl" /> <img class="img-60" :src="scope.scope.shareImgUrl" />
</span> </span>
<span slot="auth-button" slot-scope="scope" :data="scope.scope"> <span slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="handleDetail(scope.scope)">控制台</el-button> <el-button type="text" @click="handleDetail(scope.scope)">控制台</el-button>
...@@ -59,6 +60,7 @@ ...@@ -59,6 +60,7 @@
</div> </div>
</glsx-dialog> </glsx-dialog>
</div> </div>
</div>
</template> </template>
<script> <script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!