Commit 80df3888 by cwq0219

商品

1 parent 67a0339f
import { http } from '@/main' import { http } from '@/main'
const defaultPath = 'scrm.api.live.'
const getWarehousListApi = params => { const getWarehousListApi = params => {
params.method = 'scrm.api.live.goods.list' params.method = `${defaultPath}goods.list`
return http({ return http({
url: '', url: 'rop-scrm-live/router',
method: 'GET', method: 'GET',
data: params, data: params,
sign: true sign: true
}) })
} }
const uploadImg = params => { const getGoodInfoApi = params => {
params.method = 'scrm.api.live.wechat.upload.image' params.method = `${defaultPath}get.good.by.id`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true
})
}
const insertGoodApi = params => {
params.method = `${defaultPath}insert.good`
return http({ return http({
url: '', url: 'rop-scrm-live/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true, sign: true,
noSignAttr: ['file'] returnAll: true
}) })
} }
export { getWarehousListApi, uploadImg } export { getWarehousListApi, getGoodInfoApi, insertGoodApi }
import { http } from '@/main'
const defaultPath = 'scrm.api.live.'
const getGoodsList = params => {
params.method = 'scrm.api.shopmall.goods.page.curMerchant'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
const uploadImg = params => {
params.method = `${defaultPath}wechat.upload.image`
return http({
url: 'rop-scrm-live/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
export { getGoodsList, uploadImg }
...@@ -3,7 +3,7 @@ import { http } from '@/main' ...@@ -3,7 +3,7 @@ import { http } from '@/main'
const getLiveRoomListApi = params => { const getLiveRoomListApi = params => {
params.method = 'scrm.api.live.live.room.list' params.method = 'scrm.api.live.live.room.list'
return http({ return http({
url: '', url: 'rop-scrm-live/router',
method: 'GET', method: 'GET',
data: params, data: params,
sign: true sign: true
......
...@@ -5,6 +5,11 @@ ...@@ -5,6 +5,11 @@
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 {
width: 60px;
height: 60px;
}
.edit-container { .edit-container {
margin: 20px 40px 84px; margin: 20px 40px 84px;
} }
...@@ -19,6 +24,11 @@ ...@@ -19,6 +24,11 @@
background: #FFFFFF; background: #FFFFFF;
} }
.flex {
display: flex;
justify-content: space-between;
}
.edit-title { .edit-title {
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
...@@ -59,7 +69,7 @@ table { ...@@ -59,7 +69,7 @@ table {
table tr { table tr {
height: 30px; height: 30px;
line-height: 30px; // line-height: 30px;
} }
table th, table th,
...@@ -71,4 +81,9 @@ table td { ...@@ -71,4 +81,9 @@ table td {
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;
}
table td {
min-width: 50px;
} }
\ No newline at end of file \ No newline at end of file
// 新值,旧值,整数部分位数,小数部分位数,最小值,最大值,规则 // 新值,旧值,整数部分位数,小数部分位数,最小值,最大值,规则
export function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, maxValue, regRule) { function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, maxValue, regRule) {
/* eslint-disable */
var reg = { var reg = {
priceReg: /^\d[\d\.]*$/, priceReg: /^\d[\d\.]*$/,
numReg: /^[1-9]\d*$/ numReg: /^[1-9]\d*$/
} }
/* eslint-enable */
regRule = regRule || 'priceReg' regRule = regRule || 'priceReg'
if (newValue && ((minValue && (newValue < minValue)) || (maxValue && (newValue > maxValue)))) { if (newValue && ((minValue && newValue < minValue) || (maxValue && newValue > maxValue))) {
return oldValue || '' return oldValue || ''
} }
if (newValue && reg[regRule].test(newValue + '')) { if (newValue && reg[regRule].test(newValue + '')) {
if ((/\./).test(newValue)) { if (/\./.test(newValue)) {
newValue = newValue + '' newValue = newValue + ''
var interger = newValue.split('.')[0] var interger = newValue.split('.')[0]
var point = newValue.split('.')[1] var point = newValue.split('.')[1]
...@@ -24,3 +26,36 @@ export function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minVal ...@@ -24,3 +26,36 @@ export function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minVal
return newValue ? oldValue : '' return newValue ? oldValue : ''
} }
} }
const liveStatusList = [
{
confId: '101',
confName: '直播中'
},
{
confId: '102',
confName: '未开始'
},
{
confId: '103',
confName: '已结束'
},
{
confId: '104',
confName: '禁播'
},
{
confId: '105',
confName: '暂停'
},
{
confId: '106',
confName: '异常'
},
{
confId: '107',
confName: '已过期'
}
]
export { limitPrice, liveStatusList }
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
<span class="tips-label">{{ item.label }}</span> <span class="tips-label">{{ item.label }}</span>
<el-tooltip popper-class="tooltip-class" effect="dark" :content="item.tips" :placement="item.placement || 'top'"> <el-tooltip popper-class="tooltip-class" effect="dark" :content="item.tips" :placement="item.placement || 'top'">
<span class="tips-icon"></span> <span class="tips-icon"></span>
</el-tooltip>{{ item.label ? ':' : '' }} </el-tooltip>
{{ item.label ? ':' : '' }}
</span> </span>
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot> <slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
<el-input v-else-if="item.type === 'input'" :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :style="{ width: item.width || 'auto' }" :show-word-limit="item.showLimit || false" @keydown.native="e => handleInputDown(e, item)"></el-input> <el-input v-else-if="item.type === 'input'" :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :style="{ width: item.width || 'auto' }" :show-word-limit="item.showLimit || false" @keydown.native="e => handleInputDown(e, item)"></el-input>
...@@ -226,12 +227,12 @@ export default { ...@@ -226,12 +227,12 @@ export default {
border: 1px solid #7f7f7f; border: 1px solid #7f7f7f;
border-radius: 50%; border-radius: 50%;
} }
.glsx-combi-form .tips-icon::before{ .glsx-combi-form .tips-icon::before {
content: '?'; content: '?';
position: absolute; position: absolute;
width: 8px; width: 8px;
height: 8px; height: 8px;
top: -9px; top: -8px;
left: 1px; left: 1px;
font-size: 10px; font-size: 10px;
} }
......
...@@ -14,11 +14,12 @@ module.exports = { ...@@ -14,11 +14,12 @@ module.exports = {
message_key: 'message', message_key: 'message',
code_key: 'code', code_key: 'code',
code_success_value: '0', code_success_value: '0',
errId_logout_value: '21',
code_message_map: {} code_message_map: {}
}, },
request: { request: {
// baseURL: 'http://192.168.3.171:7300/mock/6136bea6ceeb5a5c2bec6950/', // baseURL: 'http://192.168.3.171:7300/mock/6136bea6ceeb5a5c2bec6950/',
baseURL: 'http://scrm.test.glsx.com.cn/rop-scrm-live/router', baseURL: 'http://scrm.test.glsx.com.cn/',
// baseURL: 'http://192.168.2.94:8115/rop-scrm-live/router', // baseURL: 'http://192.168.2.94:8115/rop-scrm-live/router',
// 设置超时时间 // 设置超时时间
timeout: 180000, timeout: 180000,
...@@ -34,6 +35,6 @@ module.exports = { ...@@ -34,6 +35,6 @@ module.exports = {
source: '' source: ''
}, },
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b', secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
errId_logout_value: '21',
cdn: 'https://www.xxx.cn/static' cdn: 'https://www.xxx.cn/static'
} }
...@@ -5,6 +5,7 @@ module.exports = { ...@@ -5,6 +5,7 @@ module.exports = {
message_key: 'message', message_key: 'message',
code_key: 'code', code_key: 'code',
code_success_value: '0', code_success_value: '0',
errId_logout_value: '21',
code_message_map: {} code_message_map: {}
}, },
request: { request: {
...@@ -23,6 +24,6 @@ module.exports = { ...@@ -23,6 +24,6 @@ module.exports = {
source: '' source: ''
}, },
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b', secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
errId_logout_value: '21',
cdn: 'https://www.xxx.cn/static' cdn: 'https://www.xxx.cn/static'
} }
<!-- 商品库 --> <!-- 商品库 -->
<template> <template>
<div> <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">
<warehous-list></warehous-list> <warehous-list></warehous-list>
......
<!-- 添加商品 --> <!-- 添加商品 -->
<template> <template>
<div class="edit-pro"> <div class="edit-pro">
<p class="edit-title">{{ title }}</p> <div class="container edit-container">
<p class="edit-title">{{ routeInfo.addOrEdit == 1 ? '添加商品' : '编辑商品' }}</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)">请选择</el-button> <el-button type="text" @click="handleSinglePro(item)">{{ selectedProInfo.id ? '更换' : '请选择' }}</el-button>
<table v-show="Object.keys(editForm.selectedProInfo).length" cellpadding="0" cellspacing="0" class="table-block"> </div>
<div slot="proTable" class="select-pro">
<GLTable v-show="selectedProInfoList.length" ref="warehousListRef" :hasPage="hasPage" :searchForm="searchForm" :tableParams="tableParams" :tableData="selectedProInfoList">
<span slot="coverImgUrl" slot-scope="scope">
<img :src="scope.scope.goodsImage" />
</span>
<span slot="price">
<el-input 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>
<!-- <table v-show="Object.keys(selectedProInfoList).length" cellpadding="0" cellspacing="0" class="table-block">
<tr> <tr>
<td>商品图片</td> <td>商品图片</td>
<td>商品名称</td> <td>商品名称</td>
...@@ -13,19 +27,21 @@ ...@@ -13,19 +27,21 @@
<td>来源门店</td> <td>来源门店</td>
</tr> </tr>
<tr> <tr>
<td><img :src="editForm.selectedProInfo.goodsImage" /></td> <td><img :src="selectedProInfoList.goodsImage" /></td>
<td>{{ editForm.selectedProInfo.goodsName }}</td> <td>{{ selectedProInfoList.goodsName }}</td>
<td>{{ editForm.selectedProInfo.goodsCode }}</td> <td>{{ selectedProInfoList.retailPrice }}</td>
<td>{{ editForm.selectedProInfo.goodsCode }}</td> <td>{{ selectedProInfoList.merchantName }}</td>
</tr> </tr>
</table> </table> -->
</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>
<div slot="footer"> <div class="footer">
<el-button type="primary" @click="handleConfirm">确定</el-button> <el-button type="primary" @click="handleConfirm">确定</el-button>
<el-button type="default" @click="handleCancel">取消</el-button> <el-button type="default" @click="handleCancel">取消</el-button>
</div> </div>
</glsx-combi-form>
<select-single-pro-dialog :isSingleSelectVisible="isSingleSelectVisible" :selectedProInfo="selectedProInfo" @handleSingleSelectConfirm="handleSingleSelectConfirm" @handleSingleSelectClose="handleSingleSelectClose"></select-single-pro-dialog>
</div> </div>
</template> </template>
...@@ -34,7 +50,8 @@ import _ from 'lodash' ...@@ -34,7 +50,8 @@ import _ from 'lodash'
// import '@/assets/css/public.scss' // import '@/assets/css/public.scss'
import glsxCombiForm from '@/components/glsx-combi-form' import glsxCombiForm from '@/components/glsx-combi-form'
import selectSingleProDialog from './selectSingleProDialog' import selectSingleProDialog from './selectSingleProDialog'
import { uploadImg } from '@/api/modules/cmmodityLibrary' import { uploadImg } from '@/api/modules/common'
import { getGoodInfoApi, insertGoodApi } from '@/api/modules/cmmodityLibrary'
export default { export default {
name: 'editProduct', name: 'editProduct',
data() { data() {
...@@ -42,13 +59,21 @@ export default { ...@@ -42,13 +59,21 @@ export default {
title: '添加商品', title: '添加商品',
isBlock: true, isBlock: true,
editChildRef: 'editChildRef', editChildRef: 'editChildRef',
routeInfo: {
// 1-新增;2-编辑
addOrEdit: 1,
id: ''
},
editForm: { editForm: {
selectedProInfo: {}, name: '',
price: '',
coverImgUrl: [] coverImgUrl: []
}, },
selectedProInfoList: [],
editRule: { editRule: {
title: [{ required: true, message: '请输入商品名称', trigger: 'change' }], coverImgUrl: [{ required: true, message: '请上传商品缩略图', trigger: 'change' }],
price: [{ required: true, message: '请输入直播价', trigger: 'change' }] name: [{ required: true, message: '请输入商品名称', trigger: 'change' }]
// price: [{ required: true, message: '请输入直播价', trigger: 'change' }]
}, },
// 商品选择 // 商品选择
isSingleSelectVisible: false, isSingleSelectVisible: false,
...@@ -71,13 +96,14 @@ export default { ...@@ -71,13 +96,14 @@ export default {
const base64 = fileInfo.name.split('.')[1] + '@' + imgFile.split(',')[1] const base64 = fileInfo.name.split('.')[1] + '@' + imgFile.split(',')[1]
uploadImg({ file: base64, fileType: 'image' }).then(res => { uploadImg({ file: base64, fileType: 'image' }).then(res => {
this.editForm[targetItem.name] = [{ url: res, uid: file.uid }] this.editForm[targetItem.name] = [{ url: res, uid: file.uid }]
this.$refs.editFormRef.$refs[this.editChildRef].validateField(targetItem.name)
}) })
} }
} }
}, },
{ {
label: '商品名称', label: '商品名称',
name: 'title', name: 'name',
width: '480px', width: '480px',
type: 'input', type: 'input',
maxlength: 20 maxlength: 20
...@@ -88,14 +114,49 @@ export default { ...@@ -88,14 +114,49 @@ export default {
addHtml: 'selectSinglePro' addHtml: 'selectSinglePro'
}, },
{ {
label: '设置直播价', // label: '商品选择',
name: 'price', name: '',
width: '480px', addHtml: 'proTable'
type: 'input', }
tips: '直播价表示直播开始时,用户购买的实际支付价格,直播结束时恢复原价' // {
// label: '设置直播价',
// name: 'price',
// width: '480px',
// type: 'input',
// tips: '直播价表示直播开始时,用户购买的实际支付价格,直播结束时恢复原价'
// }
],
// 表格
hasPage: false,
tableParams: {
tableOption: true,
tableColumns: [
{
label: '商品图片',
prop: 'goodsImage',
addHtml: 'coverImgUrl'
},
{
label: '商品名称',
prop: 'goodsName'
},
{
label: '商品价格',
prop: 'retailPrice'
},
{
label: '设置直播价格(元)',
prop: '',
width: '180px',
addHtml: 'price'
},
{
label: '来源门店',
prop: 'merchantName'
} }
] ]
} }
}
}, },
components: { components: {
...@@ -105,39 +166,84 @@ export default { ...@@ -105,39 +166,84 @@ export default {
computed: {}, computed: {},
mounted() {}, mounted() {
this.routeInfo = this.$route.query
this.routeInfo.addOrEdit == 2 ? this.getInfo() : ''
},
methods: { methods: {
getInfo() {
getGoodInfoApi({ id: this.routeInfo.id }).then(res => {
console.log(res)
this.editForm.id = res.id
this.editForm.name = res.name
this.editForm.price = res.price
})
},
handleProDelete() {
this.$messageBox.alert('是否删除该商品?', '删除', {
confirmButtonText: '确定',
type: 'error',
callback: action => {
this.selectedProInfo = {}
this.selectedProInfoList = []
}
})
},
handleSinglePro(targetItem) { handleSinglePro(targetItem) {
this.isSingleSelectVisible = !this.isSingleSelectVisible this.isSingleSelectVisible = !this.isSingleSelectVisible
}, },
handleSingleSelectConfirm(selectedProInfo) { handleSingleSelectConfirm(selectedProInfo) {
console.log(selectedProInfo)
this.selectedProInfo = selectedProInfo this.selectedProInfo = selectedProInfo
this.editForm.selectedProInfo = selectedProInfo this.selectedProInfoList = [selectedProInfo]
this.handleSinglePro() this.handleSinglePro()
}, },
handleSingleSelectClose() { handleSingleSelectClose() {
this.handleSinglePro() this.handleSinglePro()
}, },
handleConfirm() { handleConfirm() {
console.log(this.editForm)
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => { this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) { if (valid) {
console.log('-----------') var params = JSON.parse(JSON.stringify(this.editForm))
params.coverImgUrl = this.editForm.coverImgUrl[0].url
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
}
console.log(params)
insertGoodApi(params).then(res => {
console.log(res)
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.$router.push({
path: '/cmmodityLibrary/commodityList'
})
}
})
} }
}) })
}, },
handleCancel() {} handleCancel() {
this.$router.push({
path: '/cmmodityLibrary/commodityList'
})
}
} }
} }
</script> </script>
<style> <style>
.edit-pro .select-pro { .edit-pro .select-pro {
width: 480px; /* width: calc(98% - 140px); */
width: 98%;
} }
.edit-pro .select-pro img { .edit-pro img {
width: 100px; margin-top: 10px;
height: 100px;
} }
</style> </style>
<!-- 选择商品 - 单选 --> <!-- 选择商品 - 单选 -->
<template> <template>
<glsx-dialog <glsx-dialog class="single-pro" title="选择商品" :isVisible.sync="isSingleSelectVisible" width="900px" @confirmDialog="handleSingleSelectConfirm" @closeDialog="handleSingleSelectClose">
class="single-pro"
title="选择商品"
:isVisible.sync="isSingleSelectVisible"
width="70%"
@confirmDialog="handleSingleSelectConfirm"
@closeDialog="handleSingleSelectClose"
>
<el-radio-group v-model="infoId"> <el-radio-group v-model="infoId">
<el-radio <el-radio class="pro-box" v-for="item in productList" :key="item.id" :label="item.id">
class="pro-box"
v-for="item in productList"
:key="item.id"
:label="item.id"
>
<img :src="item.goodsImage" /> <img :src="item.goodsImage" />
<div class="txt-box"> <div class="txt-box">
<p class="ellipsis">{{item.goodsName}}</p> <p :title="item.goodsName" class="ellipsis">{{ item.goodsName }}</p>
<p>销量:{{item.goodsCode}}</p> <p class="f-s-12">销量:{{ item.saleAmount }}</p>
<p>库存:{{item.goodsCode}}</p> <p class="f-s-12">库存:{{ item.goodsStock }}</p>
<p>零售价:{{item.goodsCode}}</p> <p class="f-s-12">零售价:{{ item.retailPrice }}</p>
<p :title="item.merchantName" class="ellipsis f-s-12">门店名称:{{ item.merchantName }}</p>
</div> </div>
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
...@@ -28,28 +17,15 @@ ...@@ -28,28 +17,15 @@
</template> </template>
<script> <script>
import { uploadImg, 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',
data() { data() {
return { return {
infoId: '', infoId: '',
productList: [{ minRatilPrice: '',
id: '1', productList: []
goodsName: '商品名称11111111111111',
goodsImage: 'https://img0.baidu.com/it/u=4276914015,335466661&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
goodsCode: '111'
}, {
id: '2',
goodsName: '商品名称2',
goodsImage: 'https://img0.baidu.com/it/u=4276914015,335466661&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
goodsCode: '111'
}, {
id: '3',
goodsName: '商品名称3',
goodsImage: 'https://img0.baidu.com/it/u=4276914015,335466661&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
goodsCode: '111'
}]
} }
}, },
...@@ -60,7 +36,7 @@ export default { ...@@ -60,7 +36,7 @@ export default {
}, },
selectedProInfo: { selectedProInfo: {
type: Object, type: Object,
default: () => { } default: () => {}
} }
}, },
...@@ -72,9 +48,48 @@ export default { ...@@ -72,9 +48,48 @@ export default {
mounted() { mounted() {
this.infoId = this.selectedProInfo.id this.infoId = this.selectedProInfo.id
this.getList()
}, },
methods: { 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() { handleSingleSelectConfirm() {
if (!this.infoId) { if (!this.infoId) {
this.$message.error('请选择商品') this.$message.error('请选择商品')
...@@ -91,16 +106,19 @@ export default { ...@@ -91,16 +106,19 @@ export default {
</script> </script>
<style> <style>
.single-pro .pro-box { .single-pro .pro-box {
width: 150px; width: 202px;
border: 1px solid #cccccc; border: 1px solid #cccccc;
margin-right: 10px; margin: 0 10px 10px 0;
} }
.single-pro p { .single-pro p {
margin: 0 0 8px 0; margin: 0 0 8px 0;
} }
.single-pro .f-s-12 {
font-size: 12px;
}
.single-pro .pro-box img { .single-pro .pro-box img {
width: 150px; width: 202px;
height: 150px; height: 202px;
} }
.single-pro .el-radio__input { .single-pro .el-radio__input {
position: absolute; position: absolute;
......
<!-- 未入库 --> <!-- 未入库 -->
<template> <template>
<div class="warehous-list"> <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 :inline="true" :model="searchForm">
<el-form-item label="商品搜索:"> <el-form-item label="商品搜索:">
<el-input :size="size" v-model="searchForm.name" placeholder="请输入商品名称" clearable></el-input> <el-input :size="size" v-model="searchForm.name" placeholder="请输入商品名称" clearable></el-input>
...@@ -10,13 +17,11 @@ ...@@ -10,13 +17,11 @@
<el-button :size="size" @click="handleReset">重置</el-button> <el-button :size="size" @click="handleReset">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div>
<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>
</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: 100px; height: 100px;" :src="scope.scope.img" /> <img style="width: 60px; height: 60px;" :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">
<el-button type="text" @click="handleExamine(scope.scope)">提交审核</el-button> <el-button type="text" @click="handleExamine(scope.scope)">提交审核</el-button>
...@@ -33,7 +38,7 @@ export default { ...@@ -33,7 +38,7 @@ export default {
name: 'warehousList', name: 'warehousList',
data() { data() {
return { return {
size: 'mini', size: 'small',
searchForm: { searchForm: {
name: '' name: ''
}, },
...@@ -56,7 +61,10 @@ export default { ...@@ -56,7 +61,10 @@ export default {
}, },
{ {
label: '价格(元)', label: '价格(元)',
prop: 'price' prop: 'price',
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: '来源门店', label: '来源门店',
...@@ -81,19 +89,22 @@ export default { ...@@ -81,19 +89,22 @@ export default {
}, },
// 1-新增;2-编辑 // 1-新增;2-编辑
handleEdit(addOrEdit, row) { handleEdit(addOrEdit, row) {
console.log(row)
this.$router.push({ this.$router.push({
name: 'editProduct', // name: 'editProduct',
params: { path: '/cmmodityLibrary/editProduct',
query: {
addOrEdit: addOrEdit, addOrEdit: addOrEdit,
row: row || {} id: row ? row.id : ''
} }
}) })
}, },
// 1-新增;2-编辑 // 1-新增;2-编辑
handleEditGroup(addOrEdit, row) { handleEditGroup(addOrEdit, row) {
this.$router.push({ this.$router.push({
name: 'editProductGroup', // name: 'editProductGroup',
params: { path: '/cmmodityLibrary/editProductGroup',
query: {
addOrEdit: addOrEdit, addOrEdit: addOrEdit,
row: row || {} row: row || {}
} }
...@@ -127,6 +138,7 @@ export default { ...@@ -127,6 +138,7 @@ export default {
this.searchForm = { this.searchForm = {
name: '' name: ''
} }
this.handleSearch()
}, },
handleSearch() { handleSearch() {
this.$refs.warehousListRef.refreshTable() this.$refs.warehousListRef.refreshTable()
......
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
<script> <script>
import glsxDialog from '@/components/glsx-dialog' import glsxDialog from '@/components/glsx-dialog'
import { getLiveRoomListApi } from '@/api/modules/liveRoom' import { getLiveRoomListApi } from '@/api/modules/liveRoom'
import { liveStatusList } from '@/common/constant'
export default { export default {
name: 'liveRoom', name: 'liveRoom',
data() { data() {
...@@ -112,42 +113,13 @@ export default { ...@@ -112,42 +113,13 @@ export default {
label: '直播状态', label: '直播状态',
prop: 'liveStatus', prop: 'liveStatus',
formatter: cellValue => { formatter: cellValue => {
return this.baseDataList.liveStatus.find(item => item.confId == cellValue.liveStatus).confName return this.baseDataList.liveStatusList.find(item => item.confId == cellValue.liveStatus).confName
} }
} }
] ]
}, },
baseDataList: { baseDataList: {
liveStatus: [ liveStatusList: liveStatusList
{
confId: '101',
confName: '直播中'
},
{
confId: '102',
confName: '未开始'
},
{
confId: '103',
confName: '直播中'
},
{
confId: '104',
confName: '直播中'
},
{
confId: '105',
confName: '直播中'
},
{
confId: '106',
confName: '直播中'
},
{
confId: '107',
confName: '直播中'
}
]
} }
} }
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!