积分订单

This commit is contained in:
yanran200730
2023-04-14 14:04:32 +08:00
parent c72eb9c40e
commit 7d72023ad7
4 changed files with 219 additions and 85 deletions

View File

@@ -1,7 +1,7 @@
<template>
<ai-list v-if="!isShowDetail">
<template slot="title">
<ai-title title="订单管理" :isShowBottomBorder="false">
<ai-title title="订单管理" :isShowBottomBorder="false" v-model="areaId" :isShowArea="currIndex === '1'" :hideLevel="hideLevel - 1" @change="onAreaChange">
</ai-title>
</template>
<template slot="tabs">
@@ -43,6 +43,10 @@
computed: {
...mapState(['user']),
hideLevel () {
return this.user.info.areaList?.length || 0
},
tabs () {
const tabList = [
{label: '网格积分订单', name: 'GirdList', comp: GirdList, permission: ''},
@@ -73,7 +77,7 @@
methods: {
onAreaChange () {
if (this.currIndex === '0') {
if (this.currIndex === '1') {
this.$nextTick(() => {
this.$refs[this.currIndex][0].getList()
})

View File

@@ -104,8 +104,7 @@
props: {
instance: Function,
dict: Object,
permissions: Function,
areaId: String,
permissions: Function
},
data() {
@@ -153,7 +152,8 @@
getList () {
this.instance.post(`/app/appintegralsupermarketorder/list`, null, {
params: {
...this.search
...this.search,
type: 0
}
}).then((res) => {
if (res.code == 0) {

View File

@@ -6,27 +6,70 @@
</template>
<template slot="content">
<ai-card title="基本信息">
<template #right>
<el-button type="primary" v-if="info.status === '0'" @click="isShow = true">订单核销</el-button>
<el-button type="danger" v-if="info.status === '0' || info.status === '1'" @click="cancelOrder">取消订单</el-button>
</template>
<template #content>
<ai-wrapper
label-width="120px">
<ai-info-item label="标题" isLine :value="info.title"></ai-info-item>
<ai-info-item label="发布地区" isLine :value="info.areaName"></ai-info-item>
<ai-info-item label="文章类型" isLine :value="info.contentType === '0' ? '文章' : '视频'"></ai-info-item>
<ai-info-item label="分类" v-if="info.categoryName" isLine :value="info.categoryName"></ai-info-item>
<ai-info-item label="正文" v-if="info.contentType === '0'" isLine>
<AiArticle :value="info.content"></AiArticle>
</ai-info-item>
<ai-info-item label="附件" isLine>
<div class="files">
<div class="file-item" v-for="(item, index) in info.files" :key="index">
<img :src="item.url" v-if="item.postfix !== '.mp4'">
<video controls v-else :src="item.url"></video>
</div>
</div>
</ai-info-item>
<ai-info-item label="订单编号" :value="info.serialNumber"></ai-info-item>
<ai-info-item label="订单状态" :value="dict.getLabel('integralSGOStatus', info.status)"></ai-info-item>
<ai-info-item label="兑换人" :value="info.integralUserName"></ai-info-item>
<ai-info-item label="创建时间" :value="info.createTime"></ai-info-item>
<ai-info-item label="备注" :value="info.remarks" isLine></ai-info-item>
</ai-wrapper>
</template>
</ai-card>
<ai-card title="操作信息" v-if="info.status === '1'">
<template #content>
<ai-wrapper
label-width="120px">
<ai-info-item label="核销人" :value="info.examineUserName"></ai-info-item>
<ai-info-item label="时间" :value="info.examineTime"></ai-info-item>
</ai-wrapper>
</template>
</ai-card>
<ai-card title="商品信息">
<template #content>
<ai-table
:isShowPagination="false"
:tableData="[info]"
:col-configs="colConfigs"
@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.goodsPicUrl}]"
:limit="1">
</ai-uploader>
<p>{{ row.goodsTitle }}</p>
</div>
</template>
</el-table-column>
</ai-table>
</template>
</ai-card>
<ai-dialog
title="订单核销"
:visible.sync="isShow"
:destroyOnClose="true"
width="650px"
@onConfirm="onConfirm"
@close="form.verificationCode = '', id = ''">
<el-form style="height: 200px" class="ai-form" ref="form" :model="form" label-width="120px">
<el-form-item label="核销码" style="width: 100%" prop="verificationCode" :rules="[{required: true, message: '请输入核销码', trigger: 'blur'}]">
<el-input v-model="form.verificationCode" placeholder="请输入核销码" size="small"></el-input>
</el-form-item>
</el-form>
</ai-dialog>
</template>
</ai-detail>
</template>
@@ -38,14 +81,26 @@
props: {
instance: Function,
dict: Object,
params: Object,
moduleId: String
params: Object
},
data () {
return {
info: {},
id: ''
isShow: false,
id: '',
form: {
verificationCode: ''
},
colConfigs: [
{ prop: 'goodsSerialNumber', label: '商品ID', align: 'left' },
{ slot: 'goods' },
{ prop: 'goodsType', label: '商品类型', align: 'center', format: v => this.dict.getLabel('integralSGType', v) },
{ prop: 'integralPrice', label: '兑换所需积分', align: 'center' },
{ prop: 'payMoney', label: '兑换后补差价金额', align: 'center' },
{ prop: 'quantity', label: '数量', align: 'center' },
{ prop: 'usedIntegral', label: '消耗积分', align: 'center' }
]
}
},
@@ -58,29 +113,48 @@
methods: {
getInfo (id) {
this.instance.post(`/app/appcontentinfo/queryDetailById?id=${id}`).then(res => {
this.instance.post(`/app/appintegralsupermarketorder/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.info = res.data
this
this.info = {
...res.data,
pictureUrl: res.data.pictureUrl ? [{
url: res.data.pictureUrl
}] : [],
files: res.data.files.map(v => {
return {
...v,
postfix: v.postfix.toLowerCase()
}
})
...res.data
}
}
})
},
cancelOrder () {
this.$confirm('确定取消该订单吗?').then(() => {
this.instance.post(`/app/appintegralsupermarketorder/cancel?id=${this.params.id}`).then(res => {
if (res.code == 0) {
this.$message.success('取消成功!')
this.getInfo(this.params.id)
}
})
})
},
onConfirm () {
this.$refs.form.validate((valid)=> {
if(valid) {
this.instance.post(`/app/appintegralsupermarketorder/examine`, null, {
params: {
...this.form,
id: this.params.id
}
}).then(res => {
if(res.code == 0) {
this.isShow = false
this.getInfo(this.params.id)
this.$message.success('核销成功')
}
})
}
})
},
cancel (isRefresh) {
this.$emit('change', {
type: 'List',
type: 'ResidentList',
isRefresh: !!isRefresh
})
}

View File

@@ -1,21 +1,36 @@
<template>
<ai-list isTabs class="order_management">
<ai-list isTabs class="GoodsList">
<template slot="content">
<ai-search-bar>
<template slot="left">
<ai-select
v-model="search.type"
@change="(search.current = 1), getList()"
placeholder="请选择店铺类型"
:selectList="dict.getDict('integralSSType')">
placeholder="请选择商品类型"
:selectList="dict.getDict('integralSGType')">
</ai-select>
<ai-select
v-model="search.status"
@change="(search.current = 1), getList()"
placeholder="请选择类型"
:selectList="dict.getDict('integralSGStatus')">
placeholder="请选择订单状态"
:selectList="dict.getDict('integralSGOStatus')">
</ai-select>
<el-button type="primary" icon="iconfont iconAdd" @click="toAdd('')">添加</el-button>
<el-date-picker
v-model="search.startTime"
type="date"
size="small"
value-format="yyyy-MM-dd"
placeholder="选择订单开始日期"
@change="search.current = 1, getList()">
</el-date-picker>
<el-date-picker
v-model="search.endTime"
type="date"
size="small"
value-format="yyyy-MM-dd"
placeholder="选择订单结束日期"
@change="search.current = 1, getList()">
</el-date-picker>
</template>
<template slot="right">
<el-input
@@ -23,7 +38,7 @@
class="search-input"
size="small"
v-throttle="() => {search.current = 1, getList()}"
placeholder="请输入店铺名称"
placeholder="请输入商品名称"
clearable
@clear="search.current = 1, search.title = '', getList()"
suffix-icon="iconfont iconSearch">
@@ -38,26 +53,46 @@
:current.sync="search.current"
:size.sync="search.size"
@getList="getList">
<el-table-column label="网格店铺服务网格" slot="grid" align="center">
<el-table-column
label="商品"
slot="goods"
align="left"
width="350">
<template v-slot="{ row }">
<span>{{ row.serviceType === '1' ? row.visibleNames || '-' : '-' }}</span>
<div class="goods">
<ai-uploader
:disabled="true"
:instance="instance"
:value="[{url: row.goodsPicUrl}]"
:limit="1">
</ai-uploader>
<p>{{ row.goodsTitle }}</p>
</div>
</template>
</el-table-column>
<el-table-column label="居民店铺服务地区" slot="area" align="center">
<template v-slot="{ row }">
<span>{{ row.serviceType === '0' ? row.visibleNames || '-' : '-' }}</span>
</template>
</el-table-column>
<el-table-column label="操作" slot="options" align="center" width="160" fixed="right">
<el-table-column label="操作" slot="options" align="center" width="210" fixed="right">
<template v-slot="{ row }">
<div class="table-options">
<el-button type="text" title="编辑" @click="toAdd(row.id)">编辑</el-button>
<el-button type="text" :title="row.status === '0' ? '上架' : '下架'" @click="changeStatus(row)">{{ row.status === '0' ? '上架' : '下架' }}</el-button>
<el-button type="text" title="删除" @click="remove(row.id)">删除</el-button>
<el-button type="text" title="取消订单" v-if="row.status === '0' || row.status === '1'" @click="cancel(row.id)">取消订单</el-button>
<el-button type="text" title="订单核销" v-if="row.status === '0'" @click="id = row.id, isShow = true">订单核销</el-button>
<el-button type="text" title="详情" @click="toDetail(row.id)">详情</el-button>
</div>
</template>
</el-table-column>
</ai-table>
<ai-dialog
title="订单核销"
:visible.sync="isShow"
:destroyOnClose="true"
width="650px"
@onConfirm="onConfirm"
@close="form.verificationCode = '', id = ''">
<el-form style="height: 200px" class="ai-form" ref="form" :model="form" label-width="120px">
<el-form-item label="核销码" style="width: 100%" prop="verificationCode" :rules="[{required: true, message: '请输入核销码', trigger: 'blur'}]">
<el-input v-model="form.verificationCode" placeholder="请输入核销码" size="small"></el-input>
</el-form-item>
</el-form>
</ai-dialog>
</template>
</ai-list>
</template>
@@ -80,19 +115,27 @@
title: '',
current: 1,
status: '',
size: 10
size: 10,
startTime: '',
endTime: ''
},
isShow: false,
form: {
verificationCode: ''
},
id: '',
total: 0,
tableData: [],
shopList: [],
colConfigs: [
{ prop: 'serialNumber', label: '店铺ID', align: 'left' },
{ prop: 'title', label: '店铺名称', align: 'center' },
{ prop: 'type', label: '店铺类型', align: 'center', format: v => this.dict.getLabel('integralSSType', v) },
{ slot: 'grid', label: '网格店铺服务网格', align: 'center' },
{ slot: 'area', label: '居民店铺服务地区', align: 'center' },
{ prop: 'goodsCount', label: '店铺商品数', align: 'center' },
{ prop: 'status', label: '状态', align: 'center', format: v => this.dict.getLabel('integralSSStatus', v) }
{ prop: 'goodsSerialNumber', label: '商品ID', align: 'left' },
{ slot: 'goods', align: 'center' },
{ prop: 'type', label: '商品类型', align: 'center', format: v => this.dict.getLabel('integralSGType', v) },
{ prop: 'quantity', label: '数量', align: 'center', format: v => `x${v}` },
{ prop: 'usedIntegral', label: '消耗积分', align: 'center' },
{ prop: 'payMoney', label: '兑换后再付', align: 'center' },
{ prop: 'integralUserName', label: '兑换人', align: 'center' },
{ prop: 'createTime', width: 150, label: '创建时间', align: 'center' },
{ prop: 'status', label: '状态', align: 'center', format: v => this.dict.getLabel('integralSGOStatus', v) }
]
}
},
@@ -101,17 +144,18 @@
},
created () {
this.dict.load('integralSSType', 'integralSSStatus', 'integralSSSType').then(() => {
this.dict.load('integralSGType', 'integralSGOStatus').then(() => {
this.getList()
})
},
methods: {
getList () {
this.instance.post(`/app/appintegralsupermarketshop/list`, null, {
this.instance.post(`/app/appintegralsupermarketorder/list`, null, {
params: {
...this.search,
areaId: this.areaId,
type: 1,
areaId: this.areaId
}
}).then((res) => {
if (res.code == 0) {
@@ -121,31 +165,39 @@
})
},
toAdd (id) {
this.$emit('change', {
type: 'AddStore',
params: {
id: id || ''
onConfirm () {
this.$refs.form.validate((valid)=> {
if(valid) {
this.instance.post(`/app/appintegralsupermarketorder/examine`, null, {
params: {
...this.form,
id: this.id
}
}).then(res => {
if(res.code == 0) {
this.isShow = false
this.getList()
this.$message.success('核销成功')
}
})
}
})
},
remove (id) {
this.$confirm('确定删除该商品吗?').then(() => {
this.instance.post(`/app/appintegralsupermarketgoods/delete?id=${id}`).then(res => {
if (res.code == 0) {
this.$message.success('删除成功!')
this.getList()
}
})
toDetail (id) {
this.$emit('change', {
type: 'ResidentDetail',
params: {
id
}
})
},
changeStatus (row) {
this.$confirm(`确定${row.status === '0' ? '上架' : '下架'}该商品?`).then(() => {
this.instance.post(`/app/appintegralsupermarketgoods/online?id=${id}`).then(res => {
cancel (id) {
this.$confirm('确定取消该订单吗?').then(() => {
this.instance.post(`/app/appintegralsupermarketorder/cancel?id=${id}`).then(res => {
if (res.code == 0) {
this.$message.success(`${row.status === '0' ? '上架' : '下架'}成功`)
this.$message.success('取消成功!')
this.getList()
}
})
@@ -156,6 +208,10 @@
</script>
<style lang="scss" scoped>
.order_management {
.GoodsList {
.goods {
display: flex;
align-items: center;
}
}
</style>