Commit 3a82a1e8 by wangql

修改样式

1 parent c6a368d3
<!-- 选择商品弹窗 -->
<template>
<glsx-dialog class="muti-pro" title="选择商品" :isVisible.sync="isMutiSelectVisible" :height="height" width="70%" @confirmDialog="handleMutiSelectConfirm" @closeDialog="handleMutiSelectClose" :noClose="false" :noCancel="true">
<glsx-dialog class="muti-pro" title="选择商品" :isVisible.sync="isMutiSelectVisible" width="70%" @confirmDialog="handleMutiSelectConfirm" @closeDialog="handleMutiSelectClose" :noClose="false" :noCancel="true">
<div style="max-height:60vh">
<el-form :inline="true" :model="searchProForm">
<el-form-item label="商品名称:">
<el-input :size="size" v-model="searchProForm.name" placeholder="请输入商品名称" maxlength="20" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button :size="size" type="primary" @click="handleConfigSearch">查询</el-button>
<el-button :size="size" @click="handleConfigReset">重置</el-button>
</el-form-item>
</el-form>
<GLTable ref="mutiProRef" :tableData="productList" :hasPage="false" :tableParams="tableParams" @refreshTable="getList">
<span slot="goodsImage" slot-scope="scope">
<img class="m-t-10 img-60" :src="scope.scope.goodsImage" />
</span>
</GLTable>
<div class="noproDiv" v-if="!productList.length && fnCallBack">
<img src="@/assets/noPro.png" />
<p class="noproP">系统暂无已创建的商品</p>
</div>
<div v-if="productList.length">
<el-form :inline="true" :model="searchProForm">
<el-form-item label="商品名称:">
<el-input :size="size" v-model="searchProForm.name" placeholder="请输入商品名称" maxlength="20" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button :size="size" type="primary" @click="handleConfigSearch">查询</el-button>
<el-button :size="size" @click="handleConfigReset">重置</el-button>
</el-form-item>
</el-form>
<GLTable ref="mutiProRef" :tableData="productList" :hasPage="false" :tableParams="tableParams" @refreshTable="getList">
<span slot="goodsImage" slot-scope="scope">
<img class="m-t-10 img-60" :src="scope.scope.goodsImage" />
</span>
</GLTable>
</div>
</div>
</glsx-dialog>
</template>
......@@ -60,7 +66,8 @@ export default {
prop: 'merchantName'
}
]
}
},
fnCallBack: false
}
},
......@@ -98,6 +105,7 @@ export default {
}
var that = this
this.$apis.couponManage.getAllGoodsApi(params).then(res => {
this.fnCallBack = true
// console.log(res)
// this.productList = res
this.productList = res.list
......
<!-- 选择商品 - 单选 -->
<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>
<div style="max-height:60vh">
<div class="noproDiv" v-if="!productList.length && fnCallBack">
<img src="@/assets/noPro.png" />
<p class="noproP">系统暂无已创建的商品</p>
</div>
<el-radio-group v-model="infoId" v-if="productList.length">
<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>
</div>
</glsx-dialog>
</template>
......@@ -25,7 +31,8 @@ export default {
return {
infoId: '',
minRatilPrice: '',
productList: []
productList: [],
fnCallBack: false
}
},
......@@ -62,6 +69,7 @@ export default {
var that = this
this.$apis.common.getMerchantGoodsListApi(params).then(res => {
// console.log(res)
this.fnCallBack = true
this.productList = res.list
this.productList.forEach(function(item) {
item.saleAmount = item.goodsStatistics.saleAmount
......@@ -137,4 +145,20 @@ export default {
overflow: hidden;
text-overflow: ellipsis;
}
.noproP {
width: 100%;
height: 20px;
font-family: PingFangSC-Medium;
font-size: 16px;
color: #666666;
line-height: 20px;
font-weight: 500;
text-align: center;
}
.noproDiv {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
}
</style>
......@@ -18,7 +18,7 @@
</div>
<!-- 表格区域 开始 -->
<GLTable ref="coupon" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<GLTable ref="coupon" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button v-if="scope.scope.status == '1'" type="text" @click="start(scope.scope)">生效</el-button>
<el-button v-if="scope.scope.status == '2'" type="text" @click="end(scope.scope)">失效</el-button>
......@@ -345,6 +345,11 @@ export default {
status: ''
}
this.handleSearch()
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.coupon.data.length ? (this.$refs.coupon.tableHeightValues = '') : this.$refs.coupon.setTableHeightFun()
}
}
}
......
......@@ -23,49 +23,47 @@
<el-input v-model="editForm.goodsStock" style="width: 150px" :disabled="isDisabled"><span slot="append">件</span></el-input>
</el-form-item>
</div>
<div v-if="specificationDetailList.length" class="flex" style="margin-top: 20px;" id="specificationDetailList">
<span class="spesc-label" :style="{ width: labelWidth }">规格明细:</span>
<div style="width: calc(100% - 100px);">
<table class="table-spesc">
<tbody>
<tr>
<td :style="{ width: specsWidth }" v-for="(subItem, subIndex) in specificationDetailList" :key="subIndex">{{ subItem.specificationName }}</td>
<td :style="{ width: specsWidth }">零售价(元)</td>
<td :style="{ width: specsWidth }">库存</td>
<td :style="{ width: specsWidth }">设置秒杀价</td>
<td :style="{ width: specsWidth }">活动库存</td>
</tr>
</tbody>
</table>
<table class="table-spesc" style="max-height: 400px;">
<tbody>
<tr style="border-bottom: 1px solid rgb(235, 235, 235);" v-for="(item, index) in nameToValSpecsList" :key="index">
<td :style="{ width: specsWidth }" v-for="(n, idx) in item.specsValueList" :key="idx">{{ n }}</td>
<td :style="{ width: specsWidth }">{{ item.retailPrice }}元</td>
<td :style="{ width: specsWidth }">{{ item.stock }}件</td>
<!-- <td :style="{ width: specsWidth }">
</div>
<div slot="specificationsHtml" v-if="specificationDetailList.length" class="flex" style="min-width: 600px" id="specificationDetailList">
<div style="width: calc(100%);">
<table class="table-spesc" style="width: calc(100%);">
<tbody>
<tr>
<td :style="{ width: specsWidth }" v-for="(subItem, subIndex) in specificationDetailList" :key="subIndex">{{ subItem.specificationName }}</td>
<td :style="{ width: specsWidth }">零售价(元)</td>
<td :style="{ width: specsWidth }">库存</td>
<td :style="{ width: specsWidth }">设置秒杀价</td>
<td :style="{ width: specsWidth }">活动库存</td>
</tr>
</tbody>
</table>
<table class="table-spesc" style="max-height: 400px;">
<tbody>
<tr style="border-bottom: 1px solid rgb(235, 235, 235);" v-for="(item, index) in nameToValSpecsList" :key="index">
<td :style="{ width: specsWidth }" v-for="(n, idx) in item.specsValueList" :key="idx">{{ n }}</td>
<td :style="{ width: specsWidth }">{{ item.retailPrice }}元</td>
<td :style="{ width: specsWidth }">{{ item.stock }}件</td>
<!-- <td :style="{ width: specsWidth }">
<el-input :disabled="isDisabled" :class="{ 'border-red': (!(item.retailPrice + '') || +item.supplyPrice > +item.retailPrice) && submitted }" placeholder="零售价" v-model="item.retailPrice" @input.native="e => handleInput(e, index)">
<el-popover v-show="(!(item.retailPrice + '') || +item.supplyPrice > +item.retailPrice) && submitted" slot="suffix" placement="top" title="" width="90" trigger="hover" :content="!(item.retailPrice + '') ? '零售价是必填项' : '零售价要大于供货价'">
<i class="el-icon-warning color-red" slot="reference"></i>
</el-popover>
</el-input>
</td> -->
<td :style="{ width: specsWidth }">
<el-input :disabled="isDisabled" placeholder="秒杀价" v-model="item.activityPrice" @input="item.activityPrice = activityPrice_input($event, item.retailPrice)">
<!-- <span slot="append">元</span> -->
</el-input>
</td>
<td :style="{ width: specsWidth }">
<el-input :disabled="isDisabled" placeholder="活动库存" v-model="item.goodsStock" @input="item.goodsStock = goodsStock_input($event, item.stock)">
<!-- <span slot="append">件</span> -->
</el-input>
</td>
</tr>
</tbody>
</table>
</div>
<td :style="{ width: specsWidth }">
<el-input :disabled="isDisabled" placeholder="秒杀价" style="width:90%" v-model="item.activityPrice" @input="item.activityPrice = activityPrice_input($event, item.retailPrice)">
<!-- <span slot="append">元</span> -->
</el-input>
</td>
<td :style="{ width: specsWidth }">
<el-input :disabled="isDisabled" placeholder="活动库存" style="width:90%" v-model="item.goodsStock" @input="item.goodsStock = goodsStock_input($event, item.stock)">
<!-- <span slot="append">件</span> -->
</el-input>
</td>
</tr>
</tbody>
</table>
</div>
<!-- <glsx-combi-form v-if="!specificationDetailList.length" class="edit-form-container" ref="editFormRef" labelWidth="140px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"></glsx-combi-form> -->
</div>
</glsx-combi-form>
</div>
......@@ -201,6 +199,11 @@ export default {
label: '商品',
name: 'goodsId',
addHtml: 'goodsHtml'
},
{
label: '规格明细',
name: '',
addHtml: 'specificationsHtml'
}
]
}
......
......@@ -15,15 +15,15 @@
</div>
<!-- 表格区域 开始 -->
<GLTable ref="coupon" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<GLTable ref="activity" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<template slot="activityImg" slot-scope="scope">
<img class="img-60" :src="scope.scope.activityImg"/>
<img class="img-60" :src="scope.scope.activityImg" />
</template>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button v-if="scope.scope.activityStatus == '1'" type="text" @click="start(scope.scope)">开始</el-button>
<el-button v-if="scope.scope.activityStatus == '2'" type="text" @click="end(scope.scope)">结束</el-button>
<el-button v-if="scope.scope.activityStatus == '1'" type="text" @click="handleEdit(2,scope.scope)">编辑</el-button>
<el-button v-if="scope.scope.activityStatus == '2' || scope.scope.activityStatus == '3'" type="text" @click="handleEdit(3,scope.scope)">查看</el-button>
<el-button v-if="scope.scope.activityStatus == '1'" type="text" @click="handleEdit(2, scope.scope)">编辑</el-button>
<el-button v-if="scope.scope.activityStatus == '2' || scope.scope.activityStatus == '3'" type="text" @click="handleEdit(3, scope.scope)">查看</el-button>
<el-button v-if="scope.scope.activityStatus == '3'" type="text" @click="del(scope.scope)">删除</el-button>
<el-button type="text" @click="topping(scope.scope)">置顶</el-button>
<el-button v-if="scope.scope.activityStatus == '1' || scope.scope.activityStatus == '2'" type="text" @click="handleShare(scope.scope)">分享</el-button>
......@@ -40,7 +40,7 @@
import shareDialog from '../productGroup/components/shareDialog'
import * as dayjs from 'dayjs'
export default {
name: 'coupon',
name: 'activity',
data() {
return {
size: 'small',
......@@ -105,10 +105,10 @@ export default {
label: '秒杀价(元)',
name: 'activityPrice',
formatter: cellValue => {
if(cellValue.activityPrice){
return (cellValue.activityPrice/100).toFixed(2);
if (cellValue.activityPrice) {
return (cellValue.activityPrice / 100).toFixed(2)
}
return '';
return ''
}
},
{
......@@ -131,18 +131,22 @@ export default {
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total'},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
baseData: {
statusList: [{
confId: '1',
confName: '未开始 '
}, {
confId: '2',
confName: '进行中'
}, {
confId: '3',
confName: '已结束'
}],
statusList: [
{
confId: '1',
confName: '未开始 '
},
{
confId: '2',
confName: '进行中'
},
{
confId: '3',
confName: '已结束'
}
]
}
}
},
......@@ -191,36 +195,36 @@ export default {
},
//开始
start(item){
this.startOrEndConfirm('开始',item)
start(item) {
this.startOrEndConfirm('开始', item)
},
//结束
end(item){
this.startOrEndConfirm('结束',item)
end(item) {
this.startOrEndConfirm('结束', item)
},
startOrEndConfirm(txt,row) {
startOrEndConfirm(txt, row) {
var title = txt
var params = {}
params.id = row.id
if(txt == '开始'){
if (txt == '开始') {
params.activityStatus = '2' //活动状态(1:未开始,2:开始,3:结束)
}else if(txt == '结束'){
} else if (txt == '结束') {
params.activityStatus = '3' //活动状态(1:未开始,2:开始,3:结束)
}
this.secondConfirm(title, '确定要' + txt + '此活动?', 'seckillActivity', 'toggleStatusApi', params)
},
//置顶
topping(row){
topping(row) {
var params = {}
params.id = row.id
this.secondConfirm('删除', '确定置顶此活动?', 'seckillActivity', 'topActivityApi', params)
},
//删除
del(row){
del(row) {
var params = {}
params.id = row.id
this.secondConfirm('删除', '确定删除此活动?', 'seckillActivity', 'deleteActivityApi', params)
......@@ -233,7 +237,7 @@ export default {
// addOrEdit:1-新增;2-编辑;3-查看
handleEdit(addOrEdit, row) {
this.$router.push('/seckillActivity/editActivity/' + addOrEdit + '/' + row.id)
this.$router.push('/seckillActivity/editActivity/' + addOrEdit + '/' + row.id)
},
handleShare(row) {
......@@ -274,7 +278,7 @@ export default {
},
handleSearch() {
this.$refs.coupon.refreshTable()
this.$refs.activity.refreshTable()
},
handleReset() {
......@@ -283,6 +287,11 @@ export default {
activityStatus: ''
}
this.handleSearch()
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.activity.data.length ? (this.$refs.activity.tableHeightValues = '') : this.$refs.activity.setTableHeightFun()
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!