积分超市

This commit is contained in:
yanran200730
2023-04-12 17:49:29 +08:00
parent 9084c6fd1b
commit 1971f36547
3 changed files with 181 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
<template>
<ai-detail class="appgoods">
<template slot="title">
<ai-title title="添加店铺" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
<ai-title :title="id ? '编辑店铺' : '添加店铺'" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
</ai-title>
</template>
<template slot="content">
@@ -51,6 +51,127 @@
</el-form>
</template>
</ai-card>
<ai-card title="商品列表">
<template #right>
<el-button type="primary" icon="iconfont iconAdd" @click="isShow = true">选择商品</el-button>
</template>
<template #content>
<ai-table
:tableData="tableData"
:col-configs="chooseColConfigs"
:total="total"
:current.sync="search.current"
:size.sync="search.size"
@getList="getList">
<el-table-column
label="商品"
slot="goods"
align="left"
width="250">
<template v-slot="{ row }">
<div class="goods">
<ai-uploader
:disabled="true"
:instance="instance"
:value="[{url: row.picUrl}]"
:limit="1">
</ai-uploader>
<p>{{ row.title }}</p>
</div>
</template>
</el-table-column>
<el-table-column
label="兑换所需积分"
slot="integralPrice"
align="center"
width="180">
<template v-slot="{ row }">
<el-input-number style="width: 140px;" size="small" type="input" v-model="row.integralPrice" placeholder="请输入" :min="1"></el-input-number>
</template>
</el-table-column>
<el-table-column
label="兑换后补差价金额"
slot="payMoney"
align="center"
width="180">
<template v-slot="{ row }">
<!-- <el-input v-model="row.payMoney" size="small" placeholder="请输入兑换后补差价金额"></el-input> -->
<el-input-number style="width: 140px;" size="small" type="input" v-model="row.payMoney" clearable placeholder="请输入" :min="1"></el-input-number>
</template>
</el-table-column>
<el-table-column
label="库存"
slot="stock"
align="center"
width="180">
<template v-slot="{ row }">
<el-input-number style="width: 140px;" size="small" type="input" v-model="row.stock" clearable placeholder="请输入" :min="1"></el-input-number>
</template>
</el-table-column>
</ai-table>
</template>
</ai-card>
<ai-dialog
title="选择商品"
:visible.sync="isShow"
:destroyOnClose="true"
width="1080px">
<ai-search-bar>
<template slot="left">
<ai-select
v-model="search.type"
@change="(search.current = 1), getList()"
placeholder="请选择商品类型"
:selectList="dict.getDict('integralSGType')">
</ai-select>
<ai-select
v-model="search.status"
@change="(search.current = 1), getList()"
placeholder="请选择类型"
:selectList="dict.getDict('integralSGStatus')">
</ai-select>
</template>
<template slot="right">
<el-input
v-model="search.title"
class="search-input"
size="small"
v-throttle="() => {search.current = 1, getList()}"
placeholder="请输入商品名称"
clearable
@clear="search.current = 1, search.title = '', getList()"
suffix-icon="iconfont iconSearch">
</el-input>
</template>
</ai-search-bar>
<ai-table
style="margin-top: 8px;"
:tableData="tableData"
:col-configs="colConfigs"
:total="total"
:current.sync="search.current"
:size.sync="search.size"
@selection-change="handleSelectionChange"
@getList="getList">
<el-table-column
label="商品"
slot="goods"
align="left"
width="250">
<template v-slot="{ row }">
<div class="goods">
<ai-uploader
:disabled="true"
:instance="instance"
:value="[{url: row.picUrl}]"
:limit="1">
</ai-uploader>
<p>{{ row.title }}</p>
</div>
</template>
</el-table-column>
</ai-table>
</ai-dialog>
</template>
<template #footer>
<el-button @click="cancel">取消</el-button>
@@ -71,6 +192,7 @@
data () {
return {
isShow: false,
form: {
title: '',
type: '',
@@ -78,11 +200,43 @@
girdList: []
},
girdList: [],
id: ''
id: '',
search: {
type: '',
title: '',
current: 1,
status: '',
size: 10
},
total: 0,
tableData: [],
chooseColConfigs: [
{ slot: 'goods' },
{ prop: 'type', label: '商品类型', align: 'center', format: v => this.dict.getLabel('integralSGType', v) },
{ slot: 'integralPrice' },
{ slot: 'payMoney' },
{ prop: 'onlineTime', label: '商品链接', align: 'center' },
{ slot: 'stock' },
{ prop: 'jdUrl', label: '申请时间', align: 'center' },
{ prop: 'status', width: 90, label: '状态', align: 'center', format: v => this.dict.getLabel('integralSGStatus', v) }
],
colConfigs: [
{ type: 'selection', label: '', align: 'left' },
{ prop: 'serialNumber', label: '商品ID', align: 'center' },
{ slot: 'goods', align: 'center' },
{ prop: 'type', label: '商品类型', align: 'center', format: v => this.dict.getLabel('integralSGType', v) },
{ prop: 'onlineTime', label: '上架时间', align: 'center' },
{ prop: 'createTime', label: '申请时间', align: 'center' },
{ prop: 'status', width: 90, label: '状态', align: 'center', format: v => this.dict.getLabel('integralSGStatus', v) }
]
}
},
created () {
this.dict.load('integralSGType', 'integralSGStatus').then(() => {
this.getList()
})
if (this.params && this.params.id) {
this.id = this.params.id
this.getInfo(this.params.id)
@@ -90,6 +244,24 @@
},
methods: {
getList () {
this.instance.post(`/app/appintegralsupermarketgoods/list`, null, {
params: {
...this.search,
areaId: this.areaId,
}
}).then((res) => {
if (res.code == 0) {
this.tableData = res.data.records
this.total = res.data.total
}
})
},
handleSelectionChange (e) {
console.log(e)
},
getInfo (id) {
this.instance.post(`/app/appintegralmerchandise/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
@@ -145,6 +317,12 @@
<style scoped lang="scss">
.appgoods {
.goods {
display: flex;
align-items: center;
width: 250px;
height: 120px;
}
.AppAnnounceDetail-select {
display: flex;
align-items: center;

View File

@@ -92,7 +92,6 @@
},
total: 0,
tableData: [],
shopList: [],
colConfigs: [
{ prop: 'serialNumber', label: '商品ID', align: 'left' },
{ slot: 'goods', align: 'center' },
@@ -180,9 +179,6 @@
.goods {
display: flex;
align-items: center;
p {
}
}
}
</style>

View File

@@ -1,7 +1,7 @@
<template>
<ai-detail class="appgoods">
<template slot="title">
<ai-title title="添加商品" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
<ai-title :title="id ? '编辑商品' : '添加商品'" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
</ai-title>
</template>
<template slot="content">