积分超市
This commit is contained in:
133
project/fengdu/app/AppIntegratingOrder/components/GirdDetail.vue
Normal file
133
project/fengdu/app/AppIntegratingOrder/components/GirdDetail.vue
Normal file
@@ -0,0 +1,133 @@
|
||||
<template>
|
||||
<ai-detail class="AppDynamicDetail">
|
||||
<template slot="title">
|
||||
<ai-title title="详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
|
||||
</ai-title>
|
||||
</template>
|
||||
<template slot="content">
|
||||
<ai-card title="基本信息">
|
||||
<template #content>
|
||||
<ai-wrapper
|
||||
label-width="120px">
|
||||
<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="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>
|
||||
</template>
|
||||
</ai-detail>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'GirdDetail',
|
||||
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
params: Object
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
info: {},
|
||||
id: '',
|
||||
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' }
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
created () {
|
||||
if (this.params && this.params.id) {
|
||||
this.id = this.params.id
|
||||
this.getInfo(this.params.id)
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
getInfo (id) {
|
||||
this.instance.post(`/app/appintegralsupermarketorder/queryDetailById?id=${id}`).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.info = {
|
||||
...res.data
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
cancel (isRefresh) {
|
||||
this.$emit('change', {
|
||||
type: 'GirdList',
|
||||
isRefresh: !!isRefresh
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.AppDynamicDetail {
|
||||
.files {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
.file-item {
|
||||
width: 240px;
|
||||
height: 240px;
|
||||
margin: 0 20px 20px 0;
|
||||
|
||||
img, video {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
178
project/fengdu/app/AppIntegratingOrder/components/GirdList.vue
Normal file
178
project/fengdu/app/AppIntegratingOrder/components/GirdList.vue
Normal file
@@ -0,0 +1,178 @@
|
||||
<template>
|
||||
<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('integralSGType')">
|
||||
</ai-select>
|
||||
<ai-select
|
||||
v-model="search.status"
|
||||
@change="(search.current = 1), getList()"
|
||||
placeholder="请选择订单状态"
|
||||
:selectList="dict.getDict('integralSGOStatus')">
|
||||
</ai-select>
|
||||
<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
|
||||
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"
|
||||
@getList="getList">
|
||||
<el-table-column
|
||||
label="商品"
|
||||
slot="goods"
|
||||
align="left"
|
||||
width="450">
|
||||
<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>
|
||||
<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="取消订单" 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="remove(row.id)">订单核销</el-button>
|
||||
<el-button type="text" title="详情" @click="toDetail(row.id)">详情</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
</template>
|
||||
</ai-list>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'GirdList',
|
||||
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
permissions: Function,
|
||||
areaId: String,
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
search: {
|
||||
type: '',
|
||||
title: '',
|
||||
current: 1,
|
||||
status: '',
|
||||
size: 10,
|
||||
startTime: '',
|
||||
endTime: ''
|
||||
},
|
||||
total: 0,
|
||||
tableData: [],
|
||||
colConfigs: [
|
||||
{ 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', label: '创建时间', align: 'center' },
|
||||
{ prop: 'status', label: '状态', align: 'center', format: v => this.dict.getLabel('integralSGOStatus', v) }
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
},
|
||||
|
||||
created () {
|
||||
this.dict.load('integralSGType', 'integralSGOStatus').then(() => {
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList () {
|
||||
this.instance.post(`/app/appintegralsupermarketorder/list`, null, {
|
||||
params: {
|
||||
...this.search
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.tableData = res.data.records
|
||||
this.total = res.data.total
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
toDetail (id) {
|
||||
this.$emit('change', {
|
||||
type: 'GirdDetail',
|
||||
params: {
|
||||
id
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
cancel (id) {
|
||||
this.$confirm('确定取消该订单吗?').then(() => {
|
||||
this.instance.post(`/app/appintegralsupermarketorder/cancel?id=${id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('取消成功!')
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.GoodsList {
|
||||
.goods {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,143 +0,0 @@
|
||||
<template>
|
||||
<ai-list class="notice" isTabs>
|
||||
<template slot="content">
|
||||
<ai-search-bar class="search-bar">
|
||||
<template #left>
|
||||
</template>
|
||||
<template #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
|
||||
:tableData="tableData"
|
||||
:col-configs="colConfigs"
|
||||
:total="total"
|
||||
style="margin-top: 6px;"
|
||||
:current.sync="search.current"
|
||||
:size.sync="search.size"
|
||||
@getList="getList">
|
||||
<el-table-column slot="options" width="120px" fixed="right" label="操作" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<div class="table-options">
|
||||
<el-button type="text" @click="remove(row.id)">下架</el-button>
|
||||
<el-button type="text" @click="toDetail(row.id)">详情</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
</template>
|
||||
</ai-list>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
export default {
|
||||
name: 'GirdOrderList',
|
||||
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
search: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
title: '',
|
||||
areaId: ''
|
||||
},
|
||||
total: 0,
|
||||
colConfigs: [
|
||||
{ prop: 'title', label: '标题', align: 'left', width: '200px' },
|
||||
{ prop: 'createUserName', label: '姓名', align: 'center' },
|
||||
{ prop: 'areaName', label: '所属地区', align: 'center' },
|
||||
{ prop: 'examineUserName', label: '推送人', align: 'center' },
|
||||
{ prop: 'createTime', label: '推送时间', align: 'center' }
|
||||
],
|
||||
tableData: [],
|
||||
moduleId: ''
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
|
||||
hideLevel () {
|
||||
return this.user.info.areaList.length || 0
|
||||
},
|
||||
|
||||
params () {
|
||||
return {
|
||||
...this.search
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.search.areaId = this.user.info.areaId
|
||||
this.getInfo()
|
||||
},
|
||||
|
||||
methods: {
|
||||
getInfo () {
|
||||
this.instance.post(`/app/appintegraluserapply/queryModuleByName`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.moduleId = res.data
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
getList () {
|
||||
this.instance.post(`/app/appcontentinfo/list-web`, null, {
|
||||
params: {
|
||||
moduleId: this.moduleId,
|
||||
...this.search,
|
||||
areaId: this.search.areaId
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.tableData = res.data.records
|
||||
this.total = res.data.total
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
remove(id) {
|
||||
this.$confirm('确定删除该数据?').then(() => {
|
||||
this.instance.post(`/app/appcontentinfo/deleteIntegralApply?ids=${id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('下架成功!')
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
toDetail(id) {
|
||||
this.$emit('change', {
|
||||
type: 'Detail',
|
||||
params: {
|
||||
id: id || ''
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
@@ -0,0 +1,110 @@
|
||||
<template>
|
||||
<ai-detail class="AppDynamicDetail">
|
||||
<template slot="title">
|
||||
<ai-title title="详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
|
||||
</ai-title>
|
||||
</template>
|
||||
<template slot="content">
|
||||
<ai-card title="基本信息">
|
||||
<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-wrapper>
|
||||
</template>
|
||||
</ai-card>
|
||||
</template>
|
||||
</ai-detail>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ResidentDetail',
|
||||
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
params: Object,
|
||||
moduleId: String
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
info: {},
|
||||
id: ''
|
||||
}
|
||||
},
|
||||
|
||||
created () {
|
||||
if (this.params && this.params.id) {
|
||||
this.id = this.params.id
|
||||
this.getInfo(this.params.id)
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
getInfo (id) {
|
||||
this.instance.post(`/app/appcontentinfo/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()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
cancel (isRefresh) {
|
||||
this.$emit('change', {
|
||||
type: 'List',
|
||||
isRefresh: !!isRefresh
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.AppDynamicDetail {
|
||||
.files {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
.file-item {
|
||||
width: 240px;
|
||||
height: 240px;
|
||||
margin: 0 20px 20px 0;
|
||||
|
||||
img, video {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,161 @@
|
||||
<template>
|
||||
<ai-list isTabs class="order_management">
|
||||
<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')">
|
||||
</ai-select>
|
||||
<ai-select
|
||||
v-model="search.status"
|
||||
@change="(search.current = 1), getList()"
|
||||
placeholder="请选择类型"
|
||||
:selectList="dict.getDict('integralSGStatus')">
|
||||
</ai-select>
|
||||
<el-button type="primary" icon="iconfont iconAdd" @click="toAdd('')">添加</el-button>
|
||||
</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"
|
||||
@getList="getList">
|
||||
<el-table-column label="网格店铺服务网格" slot="grid" align="center">
|
||||
<template v-slot="{ row }">
|
||||
<span>{{ row.serviceType === '1' ? row.visibleNames || '-' : '-' }}</span>
|
||||
</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">
|
||||
<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>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
</template>
|
||||
</ai-list>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ResidentList',
|
||||
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
permissions: Function,
|
||||
areaId: String,
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
search: {
|
||||
type: '',
|
||||
title: '',
|
||||
current: 1,
|
||||
status: '',
|
||||
size: 10
|
||||
},
|
||||
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) }
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
},
|
||||
|
||||
created () {
|
||||
this.dict.load('integralSSType', 'integralSSStatus', 'integralSSSType').then(() => {
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList () {
|
||||
this.instance.post(`/app/appintegralsupermarketshop/list`, null, {
|
||||
params: {
|
||||
...this.search,
|
||||
areaId: this.areaId,
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.tableData = res.data.records
|
||||
this.total = res.data.total
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
toAdd (id) {
|
||||
this.$emit('change', {
|
||||
type: 'AddStore',
|
||||
params: {
|
||||
id: id || ''
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
remove (id) {
|
||||
this.$confirm('确定删除该商品吗?').then(() => {
|
||||
this.instance.post(`/app/appintegralsupermarketgoods/delete?id=${id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('删除成功!')
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
changeStatus (row) {
|
||||
this.$confirm(`确定${row.status === '0' ? '上架' : '下架'}该商品?`).then(() => {
|
||||
this.instance.post(`/app/appintegralsupermarketgoods/online?id=${id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success(`${row.status === '0' ? '上架' : '下架'}成功`)
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.order_management {
|
||||
}
|
||||
</style>
|
||||
@@ -1,143 +0,0 @@
|
||||
<template>
|
||||
<ai-list class="notice" isTabs>
|
||||
<template slot="content">
|
||||
<ai-search-bar class="search-bar">
|
||||
<template #left>
|
||||
</template>
|
||||
<template #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
|
||||
:tableData="tableData"
|
||||
:col-configs="colConfigs"
|
||||
:total="total"
|
||||
style="margin-top: 6px;"
|
||||
:current.sync="search.current"
|
||||
:size.sync="search.size"
|
||||
@getList="getList">
|
||||
<el-table-column slot="options" width="120px" fixed="right" label="操作" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<div class="table-options">
|
||||
<el-button type="text" @click="remove(row.id)">下架</el-button>
|
||||
<el-button type="text" @click="toDetail(row.id)">详情</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
</template>
|
||||
</ai-list>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
export default {
|
||||
name: 'ResidentOrderList',
|
||||
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
search: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
title: '',
|
||||
areaId: ''
|
||||
},
|
||||
total: 0,
|
||||
colConfigs: [
|
||||
{ prop: 'title', label: '标题', align: 'left', width: '200px' },
|
||||
{ prop: 'createUserName', label: '姓名', align: 'center' },
|
||||
{ prop: 'areaName', label: '所属地区', align: 'center' },
|
||||
{ prop: 'examineUserName', label: '推送人', align: 'center' },
|
||||
{ prop: 'createTime', label: '推送时间', align: 'center' }
|
||||
],
|
||||
tableData: [],
|
||||
moduleId: ''
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
|
||||
hideLevel () {
|
||||
return this.user.info.areaList.length || 0
|
||||
},
|
||||
|
||||
params () {
|
||||
return {
|
||||
...this.search
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.search.areaId = this.user.info.areaId
|
||||
this.getInfo()
|
||||
},
|
||||
|
||||
methods: {
|
||||
getInfo () {
|
||||
this.instance.post(`/app/appintegraluserapply/queryModuleByName`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.moduleId = res.data
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
getList () {
|
||||
this.instance.post(`/app/appcontentinfo/list-web`, null, {
|
||||
params: {
|
||||
moduleId: this.moduleId,
|
||||
...this.search,
|
||||
areaId: this.search.areaId
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.tableData = res.data.records
|
||||
this.total = res.data.total
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
remove(id) {
|
||||
this.$confirm('确定删除该数据?').then(() => {
|
||||
this.instance.post(`/app/appcontentinfo/deleteIntegralApply?ids=${id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('下架成功!')
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
toDetail(id) {
|
||||
this.$emit('change', {
|
||||
type: 'Detail',
|
||||
params: {
|
||||
id: id || ''
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
@@ -1,357 +0,0 @@
|
||||
<template>
|
||||
<section class="add_order">
|
||||
<ai-detail>
|
||||
<template slot="title">
|
||||
<ai-title :title="title" isShowBack :isShowBottomBorder="true" @onBackClick="$emit('goBack')"></ai-title>
|
||||
</template>
|
||||
<template slot="content" v-if="!isEdit">
|
||||
<ai-card title="商品信息">
|
||||
<template #content>
|
||||
<div class="form_div">
|
||||
<el-form
|
||||
ref="rules"
|
||||
:model="forms"
|
||||
:rules="formRules"
|
||||
size="small"
|
||||
label-suffix=":"
|
||||
label-width="100px">
|
||||
<el-form-item label="店铺名称" prop="shopId">
|
||||
<el-select
|
||||
v-model="forms.shopId"
|
||||
placeholder="请选择..."
|
||||
clearable>
|
||||
<el-option
|
||||
v-for="(item, i) in shopList"
|
||||
:key="i"
|
||||
:label="item.shopName"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品类型" prop="merchandiseType">
|
||||
<el-select
|
||||
v-model="forms.merchandiseType"
|
||||
placeholder="请选择..."
|
||||
clearable>
|
||||
<el-option
|
||||
v-for="(item, i) in dict.getDict('integralMerchandiseType')"
|
||||
:key="i"
|
||||
:label="item.dictName"
|
||||
:value="item.dictValue">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品名称" prop="merchandiseName">
|
||||
<el-input
|
||||
v-model="forms.merchandiseName"
|
||||
placeholder="请输入..."
|
||||
maxlength="100"
|
||||
show-word-limit>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<div class="above">
|
||||
<div class="left">
|
||||
<el-form-item label="单价" prop="costIntegral">
|
||||
<el-input v-model="forms.costIntegral" placeholder="请输入..."/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="right">
|
||||
<el-form-item label="库存" prop="inventoryNumber">
|
||||
<el-input
|
||||
v-model="forms.inventoryNumber"
|
||||
placeholder="请输入...">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="forms.status">
|
||||
<el-radio label="1">上架中</el-radio>
|
||||
<el-radio label="0">已下架</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品图片" prop="fileList" ref="fileList">
|
||||
<div class="upload">
|
||||
<ai-uploader
|
||||
:instance="instance"
|
||||
@change="changeFile"
|
||||
v-model="forms.fileList"
|
||||
:limit="9">
|
||||
</ai-uploader>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品详情" prop="description">
|
||||
<el-input
|
||||
v-model="forms.description"
|
||||
type="textarea"
|
||||
:rows="5"
|
||||
maxlength="100"
|
||||
show-word-limit
|
||||
placeholder="请输入...">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
</ai-card>
|
||||
</template>
|
||||
<template slot="content" v-if="isEdit">
|
||||
<ai-card title="商品信息">
|
||||
<template #content>
|
||||
<div class="info">
|
||||
<ai-wrapper label-width="70px" :columnsNumber="1">
|
||||
<ai-info-item label="店铺名称"><span>{{ forms.shopName }}</span></ai-info-item>
|
||||
<ai-info-item label="商品类型"
|
||||
><span>{{
|
||||
dict.getLabel("integralMerchandiseType", forms.merchandiseType)
|
||||
}}</span></ai-info-item
|
||||
>
|
||||
<ai-info-item label="商品名称"
|
||||
><span>{{ forms.merchandiseName }}</span></ai-info-item
|
||||
>
|
||||
</ai-wrapper>
|
||||
<ai-wrapper label-width="70px" :columnsNumber="2">
|
||||
<ai-info-item label="单价"><span>{{ forms.costIntegral + "积分" }}</span></ai-info-item>
|
||||
<ai-info-item label="库存"
|
||||
><span>{{ forms.inventoryNumber }}</span></ai-info-item
|
||||
>
|
||||
<ai-info-item label="销量"
|
||||
><span>{{ forms.saleNumber || "0" }}</span></ai-info-item
|
||||
>
|
||||
</ai-wrapper>
|
||||
<ai-wrapper label-width="70px" :columnsNumber="1">
|
||||
<ai-info-item label="状态"
|
||||
><span
|
||||
:style="{
|
||||
color: dict.getColor(
|
||||
'integralMerchandiseStatus',
|
||||
forms.status
|
||||
),
|
||||
}"
|
||||
>{{
|
||||
dict.getLabel("integralMerchandiseStatus", forms.status)
|
||||
}}</span
|
||||
></ai-info-item
|
||||
>
|
||||
<ai-info-item label="商品图片">
|
||||
<ai-uploader
|
||||
:disabled="true"
|
||||
:instance="instance"
|
||||
v-model="forms.fileList"
|
||||
:limit="9"
|
||||
></ai-uploader>
|
||||
</ai-info-item>
|
||||
<ai-info-item label="商品详情"
|
||||
><span>{{ forms.description }}</span></ai-info-item
|
||||
>
|
||||
</ai-wrapper>
|
||||
</div>
|
||||
</template>
|
||||
</ai-card>
|
||||
</template>
|
||||
<template slot="footer" v-if="!isEdit">
|
||||
<el-button @click="$emit('goBack')" style="width: 120px">取消</el-button>
|
||||
<el-button type="primary" @click="save('rules')" style="width: 120px">提 交</el-button>
|
||||
</template>
|
||||
</ai-detail>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from "vuex";
|
||||
|
||||
export default {
|
||||
name: "addGoods",
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
permissions: Function,
|
||||
info: Object,
|
||||
areaId: String,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
forms: {
|
||||
shopId: "",
|
||||
merchandiseType: "",
|
||||
merchandiseName: "",
|
||||
costIntegral: "",
|
||||
inventoryNumber: "",
|
||||
status: "",
|
||||
fileList: [],
|
||||
description: "",
|
||||
},
|
||||
shopList: [],
|
||||
title: "添加商品",
|
||||
showEdit: false,
|
||||
isEdit: false,
|
||||
detailInfo: {},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState(["user"]),
|
||||
formRules() {
|
||||
var integral = (rule, value, callback) => {
|
||||
if (value) {
|
||||
if (/^[1-9]\d*$/.test(value)) {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error("请输入正整数"));
|
||||
}
|
||||
} else {
|
||||
callback(new Error("请输入单价"));
|
||||
}
|
||||
};
|
||||
return {
|
||||
shopId: [{required: true, message: "请选择店铺", trigger: "change"}],
|
||||
merchandiseType: [
|
||||
{required: true, message: "请选择商品类型", trigger: "change"},
|
||||
],
|
||||
merchandiseName: [
|
||||
{required: true, message: "请输入商品名称", trigger: "blur"},
|
||||
],
|
||||
inventoryNumber: [
|
||||
{required: true, validator: integral, trigger: "blur"},
|
||||
],
|
||||
costIntegral: [
|
||||
{required: true, pattern: /^\d*[.\d]\d?$/, message: "请输入正数,最多保留一位小数", trigger: "blur"},
|
||||
],
|
||||
status: [{required: true, message: "请选择状态", trigger: "change"}],
|
||||
fileList: [
|
||||
{required: true, message: "请上传商品图片", trigger: "change"},
|
||||
],
|
||||
};
|
||||
},
|
||||
},
|
||||
created() {
|
||||
let l = Object.keys(this.info).length;
|
||||
if (this.info.isAdd) {
|
||||
this.showEdit = false;
|
||||
if (l > 1) {
|
||||
this.title = "修改商品";
|
||||
this.getShopList().then(() => {
|
||||
this.searchDetail(this.info.id);
|
||||
});
|
||||
} else {
|
||||
this.title = "添加商品";
|
||||
this.getShopList();
|
||||
}
|
||||
} else {
|
||||
this.title = "商品详情";
|
||||
this.isEdit = true;
|
||||
this.showEdit = true;
|
||||
this.getShopList().then(() => {
|
||||
this.searchDetail(this.info.id);
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getShopList() {
|
||||
return new Promise((reslove) => {
|
||||
this.instance
|
||||
.post(`/app/appvillagerintegralshop/listForOperator`, null, {
|
||||
params: {
|
||||
size: 100000,
|
||||
areaId: this.areaId,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.shopList = res.data.records;
|
||||
reslove();
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
changeFile() {
|
||||
this.$refs.fileList.$emit("el.form.change");
|
||||
},
|
||||
searchDetail(id) {
|
||||
this.instance
|
||||
.post(`/app/appvillagerintegralmerchandise/queryDetailById`, null, {
|
||||
params: {
|
||||
id,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.forms = {...res.data};
|
||||
let i = this.shopList.findIndex(
|
||||
(item) => item.id == this.forms.shopId
|
||||
);
|
||||
if (i > -1) {
|
||||
this.forms.shopName = this.shopList[i].shopName;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
edit() {
|
||||
this.isEdit = false;
|
||||
},
|
||||
save(formName, type) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.instance
|
||||
.post(
|
||||
`/app/appvillagerintegralmerchandise/addOrUpdate`,
|
||||
{
|
||||
...this.forms,
|
||||
areaId: this.user.info.areaId,
|
||||
},
|
||||
null
|
||||
)
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success("提交成功");
|
||||
if (type == "detail") {
|
||||
this.isEdit = true;
|
||||
} else {
|
||||
this.$emit("goBack");
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.add_order {
|
||||
height: 100%;
|
||||
|
||||
.form_div {
|
||||
padding: 16px 0;
|
||||
}
|
||||
|
||||
.above {
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
|
||||
.left {
|
||||
width: 50%;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 50%;
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
|
||||
.iconEdit,
|
||||
.Edit {
|
||||
color: #5088ff;
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
padding-left: 8px;
|
||||
}
|
||||
|
||||
.info {
|
||||
padding: 16px 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,625 +0,0 @@
|
||||
<template>
|
||||
<section class="add_order">
|
||||
<ai-detail>
|
||||
<template slot="title">
|
||||
<ai-title :title="title" :isShowBack="true" :isShowBottomBorder="true" @onBackClick="$emit('goBack')"></ai-title>
|
||||
</template>
|
||||
<template slot="content" v-if="info.isAdd">
|
||||
<ai-card title="订单信息">
|
||||
<template #content>
|
||||
<div class="form_div">
|
||||
<el-form
|
||||
ref="rules"
|
||||
:model="forms"
|
||||
:rules="formRules"
|
||||
size="small"
|
||||
label-suffix=":"
|
||||
label-width="100px">
|
||||
<el-form-item label="店铺名称" prop="shopId">
|
||||
<el-select
|
||||
v-model="forms.shopId"
|
||||
placeholder="请选择..."
|
||||
@change="(forms.merchandiseList = []), (goodIntegral = {})"
|
||||
clearable>
|
||||
<el-option
|
||||
v-for="(item, i) in shopList"
|
||||
:key="i"
|
||||
:label="item.shopName"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="兑换家庭" prop="name">
|
||||
<el-row type="flex" :gutter="8">
|
||||
<el-col
|
||||
>
|
||||
<el-input v-model="forms.name" disabled clearable
|
||||
/>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<ai-person-select
|
||||
:instance="instance"
|
||||
url="/app/appvillagerintegralfamilymember/list"
|
||||
headerTitle="家庭列表"
|
||||
dialogTitle="选择家庭"
|
||||
@selectPerson="getSelect"
|
||||
>
|
||||
<template name="option" v-slot:option="{ item }">
|
||||
<span class="iconfont iconProlife">{{ item.name }}</span>
|
||||
<ai-id
|
||||
mode="show"
|
||||
:show-eyes="false"
|
||||
:value="item.idNumber"
|
||||
/>
|
||||
<span>{{ item.phone }}</span>
|
||||
</template>
|
||||
</ai-person-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
<el-form-item label="积分余额">
|
||||
<p>
|
||||
<span style="color: #2266ff">{{ integral || "0" }}</span
|
||||
>分
|
||||
</p>
|
||||
</el-form-item>
|
||||
<el-form-item label="兑换商品" prop="merchandiseList">
|
||||
<el-button @click="showGoodsList()" :disabled="!forms.shopId || !forms.name">选择商品</el-button>
|
||||
</el-form-item>
|
||||
<ai-table
|
||||
:tableData="forms.merchandiseList"
|
||||
:col-configs="colConfigs"
|
||||
:isShowPagination="false">
|
||||
<el-table-column
|
||||
label="商品图"
|
||||
slot="photo"
|
||||
align="center"
|
||||
width="150">
|
||||
<template v-slot="{ row }">
|
||||
<ai-uploader
|
||||
:disabled="true"
|
||||
:instance="instance"
|
||||
v-model="row.photo"
|
||||
:limit="9">
|
||||
</ai-uploader>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="兑换数量"
|
||||
width="180"
|
||||
slot="merchandiseNumber"
|
||||
align="center">
|
||||
<template v-slot="{ row }">
|
||||
<el-input-number
|
||||
:min="1"
|
||||
:max="row.inventoryNumber"
|
||||
size="mini"
|
||||
v-model="merchandiseNumbers[row.id]"
|
||||
@change="
|
||||
(currentValue, oldValue) =>
|
||||
changeNumber(currentValue, oldValue, row)
|
||||
"
|
||||
:step="1"
|
||||
step-strictly
|
||||
></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="消耗积分" slot="integral" align="center">
|
||||
<template v-slot="{ row }">
|
||||
<span>{{ goodIntegral[row.id] }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
slot="options"
|
||||
label="操作"
|
||||
align="center"
|
||||
width="60"
|
||||
>
|
||||
<template slot-scope="row">
|
||||
<el-button
|
||||
type="text"
|
||||
class="icon-color89B"
|
||||
icon="iconfont iconDelete"
|
||||
title="删除"
|
||||
@click="deleteGood(row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
<div class="total">
|
||||
<p class="num">
|
||||
<span>合计积分:</span>
|
||||
<span>{{ allIntegral }}</span>
|
||||
<span>分</span>
|
||||
</p>
|
||||
<p class="tip" v-if="allIntegral > Number(integral)">
|
||||
(积分不足,请删减商品)
|
||||
</p>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
</ai-card>
|
||||
</template>
|
||||
<template slot="content" v-if="!info.isAdd">
|
||||
<ai-card title="订单信息">
|
||||
<template #content>
|
||||
<div class="info">
|
||||
<ai-wrapper label-width="70px" :columnsNumber="1">
|
||||
<ai-info-item label="订单号"><span>{{ detailInfo.orderCode }}</span></ai-info-item>
|
||||
<ai-info-item label="创建时间"><span>{{ detailInfo.createTime }}</span></ai-info-item>
|
||||
<ai-info-item label="店铺名"><span>{{ detailInfo.shopName }}</span></ai-info-item>
|
||||
<ai-info-item label="状态">
|
||||
<span :style="{ color: dict.getColor('integralOrderStatus', detailInfo.orderStatus)}">
|
||||
{{ dict.getLabel("integralOrderStatus", detailInfo.orderStatus) }}
|
||||
</span>
|
||||
</ai-info-item>
|
||||
</ai-wrapper>
|
||||
<ai-table
|
||||
:tableData="detailInfo.merchandiseList"
|
||||
:col-configs="colConfigs"
|
||||
:isShowPagination="false">
|
||||
<el-table-column
|
||||
label="商品图"
|
||||
slot="photo"
|
||||
align="center"
|
||||
width="150">
|
||||
<template v-slot="{ row }">
|
||||
<ai-uploader
|
||||
:disabled="true"
|
||||
:instance="instance"
|
||||
v-model="row.merchandisePhoto"
|
||||
:limit="9">
|
||||
</ai-uploader>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="兑换数量"
|
||||
width="200"
|
||||
slot="merchandiseNumber"
|
||||
align="center">
|
||||
<template v-slot="{ row }">
|
||||
{{ row.merchandiseNumber }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="消耗积分" slot="integral" align="center">
|
||||
<template v-slot="{ row }">
|
||||
<span>{{ Number(row.merchandiseNumber) * Number(row.costIntegral) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
<div class="total">
|
||||
<p class="num">
|
||||
<span>合计积分:</span>
|
||||
<span>{{ detailInfo.orderIntegral }}</span>
|
||||
<span>分</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</ai-card>
|
||||
<ai-card title="兑换家庭信息">
|
||||
<template #content>
|
||||
<div class="info">
|
||||
<ai-wrapper label-width="70px" :columnsNumber="2">
|
||||
<ai-info-item label="户主"><span>{{ detailInfo.familyName }}</span></ai-info-item>
|
||||
<ai-info-item label="联系方式"><span>{{ detailInfo.familyPhone || "-" }}</span></ai-info-item>
|
||||
</ai-wrapper>
|
||||
<ai-wrapper label-width="70px" :columnsNumber="1">
|
||||
<ai-info-item label="备注"><span>{{ detailInfo.remark || "-" }}</span></ai-info-item>
|
||||
</ai-wrapper>
|
||||
</div>
|
||||
</template>
|
||||
</ai-card>
|
||||
<ai-card title="操作人信息">
|
||||
<template #content>
|
||||
<div class="info">
|
||||
<ai-wrapper label-width="70px">
|
||||
<ai-info-item label="操作人"><span>{{ detailInfo.createUserName || "-" }}</span></ai-info-item>
|
||||
<ai-info-item label="联系方式"><span>{{ detailInfo.createUserPhone || "-" }}</span></ai-info-item>
|
||||
<ai-info-item label="完成时间"><span>{{ detailInfo.finishTime || "-" }}</span></ai-info-item>
|
||||
</ai-wrapper>
|
||||
</div>
|
||||
</template>
|
||||
</ai-card>
|
||||
</template>
|
||||
<template slot="footer" v-if="info.isAdd">
|
||||
<el-button @click="$emit('goBack')" style="width: 120px">取消</el-button>
|
||||
<el-button type="primary" @click="save('rules')" style="width: 120px" :disabled="allIntegral > Number(integral)">确认兑换</el-button>
|
||||
</template>
|
||||
</ai-detail>
|
||||
<ai-dialog
|
||||
title="选择商品"
|
||||
:visible.sync="showGoods"
|
||||
:customFooter="true"
|
||||
:destroyOnClose="true"
|
||||
class="goods"
|
||||
@close="init"
|
||||
border
|
||||
width="780px">
|
||||
<div class="border_div">
|
||||
<header>
|
||||
<span>商品列表</span>
|
||||
<el-input
|
||||
v-model="keyWord"
|
||||
size="mini"
|
||||
placeholder="商品关键字"
|
||||
@keyup.enter.native="showGoodsList()"
|
||||
clearable
|
||||
style="width: 220px"
|
||||
suffix-icon="iconfont iconSearch"
|
||||
/>
|
||||
</header>
|
||||
<ai-table
|
||||
:tableData="goodList"
|
||||
:col-configs="goodsConfig"
|
||||
:isShowPagination="false"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column slot="selection" type="selection" width="55" :selectable="(row)=>Number(row.inventoryNumber)>0"/>
|
||||
</ai-table>
|
||||
</div>
|
||||
<div class="dialog-footer" slot="footer">
|
||||
<el-button @click="showGoods = false" size="medium">取消</el-button>
|
||||
<el-button @click="onConfirm()" type="primary" size="medium">确认</el-button>
|
||||
</div>
|
||||
</ai-dialog>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from "vuex";
|
||||
|
||||
export default {
|
||||
name: "addOrder",
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
permissions: Function,
|
||||
info: Object,
|
||||
areaId: String,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
forms: {
|
||||
shopId: "",
|
||||
familyId: "",
|
||||
familyName: "",
|
||||
name: "",
|
||||
memberId: "",
|
||||
merchandiseList: [],
|
||||
phone: "",
|
||||
},
|
||||
integral: "",
|
||||
shopList: [],
|
||||
goodList: [],
|
||||
goodIntegral: {},
|
||||
merchandiseNumbers: {},
|
||||
showGoods: false,
|
||||
selectGoodList: [],
|
||||
keyWord: "",
|
||||
title: "",
|
||||
detailInfo: {},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState(["user"]),
|
||||
formRules() {
|
||||
return {
|
||||
shopId: [{required: true, message: "请选择店铺", trigger: "change"}],
|
||||
name: [
|
||||
{required: true, message: "请选择兑换家庭", trigger: "change"},
|
||||
],
|
||||
merchandiseList: [
|
||||
{required: true, message: "请选择商品", trigger: "change"},
|
||||
],
|
||||
};
|
||||
},
|
||||
colConfigs() {
|
||||
return [
|
||||
{slot: "photo", prop: "photo", label: "商品图", align: "center"},
|
||||
{
|
||||
prop: "merchandiseName",
|
||||
label: "商品名",
|
||||
align: "left",
|
||||
width: 160,
|
||||
"show-overflow-tooltip": false,
|
||||
},
|
||||
{
|
||||
prop: "costIntegral",
|
||||
label: "单价",
|
||||
align: "center",
|
||||
width: 60,
|
||||
},
|
||||
{
|
||||
slot: "merchandiseNumber",
|
||||
prop: "merchandiseNumber",
|
||||
label: "兑换数量",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
prop: "inventoryNumber",
|
||||
label: "库存",
|
||||
align: "center",
|
||||
width: 60,
|
||||
hide: this.title == "兑换订单详情",
|
||||
},
|
||||
{
|
||||
slot: "integral",
|
||||
prop: "integral",
|
||||
label: "消耗积分",
|
||||
align: "center",
|
||||
},
|
||||
{slot: "options", label: "操作", align: "center"},
|
||||
];
|
||||
},
|
||||
goodsConfig() {
|
||||
return [
|
||||
{slot: "selection", label: "", align: "center"},
|
||||
{prop: "merchandiseName", label: "商品名", align: "left", width: 350},
|
||||
{prop: "costIntegral", label: "单价", align: "left"},
|
||||
{prop: "inventoryNumber", align: "center", label: "库存"},
|
||||
];
|
||||
},
|
||||
allIntegral() {
|
||||
let arr = Object.keys(this.goodIntegral);
|
||||
let all = 0;
|
||||
arr.forEach((e) => {
|
||||
all += this.goodIntegral[e];
|
||||
});
|
||||
return all;
|
||||
},
|
||||
},
|
||||
created() {
|
||||
if (this.info.isAdd) {
|
||||
this.title = "添加兑换订单";
|
||||
} else {
|
||||
this.title = "兑换订单详情";
|
||||
this.searchDetail(this.info.id);
|
||||
}
|
||||
this.getShopList();
|
||||
},
|
||||
methods: {
|
||||
getSelect(val) {
|
||||
if (val) {
|
||||
this.forms.familyName = val.familyName;
|
||||
this.forms.familyId = val.familyId;
|
||||
this.forms.name = val.name;
|
||||
this.forms.memberId = val.id;
|
||||
this.forms.phone = val.phone;
|
||||
this.integral = val.integral;
|
||||
} else {
|
||||
this.forms.familyName = "";
|
||||
this.forms.familyId = "";
|
||||
this.forms.name = "";
|
||||
this.forms.memberId = "";
|
||||
this.forms.phone = "";
|
||||
this.integral = 0;
|
||||
}
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.selectGoodList = [...val];
|
||||
},
|
||||
onConfirm() {
|
||||
this.selectGoodsInit(this.selectGoodList).then(() => {
|
||||
this.showGoods = false;
|
||||
});
|
||||
},
|
||||
init() {
|
||||
this.selectGoodList = [];
|
||||
this.goodList = [];
|
||||
},
|
||||
deleteGood(row) {
|
||||
console.log(row);
|
||||
this.$confirm("是否删除该商品?", {
|
||||
type: "error",
|
||||
})
|
||||
.then(() => {
|
||||
this.forms.merchandiseList.splice(row.$index, 1);
|
||||
this.$delete(this.goodIntegral, row.row.id);
|
||||
this.$delete(this.merchandiseNumbers, row.row.id);
|
||||
return this.$message.success("删除成功");
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
},
|
||||
selectGoodsInit(val) {
|
||||
return new Promise((reslove) => {
|
||||
val.map((e, index) => {
|
||||
e.merchandiseNumber = 1;
|
||||
e.merchandiseId = e.id;
|
||||
this.$set(this.merchandiseNumbers, e.id, 1);
|
||||
this.$set(this.goodIntegral, e.id, Number(e.costIntegral));
|
||||
if (e.photo) {
|
||||
e.merchandisePhoto = e.photo;
|
||||
e.photo = [{...JSON.parse(e.photo)[0]}];
|
||||
} else {
|
||||
e.photo = [];
|
||||
}
|
||||
});
|
||||
this.forms.merchandiseList = this.forms.merchandiseList.concat([
|
||||
...val,
|
||||
]);
|
||||
reslove();
|
||||
});
|
||||
},
|
||||
showGoodsList() {
|
||||
this.instance
|
||||
.post(`/app/appvillagerintegralmerchandise/list`, null, {
|
||||
params: {
|
||||
size: 100000,
|
||||
shopId: this.forms.shopId,
|
||||
merchandiseName: this.keyWord,
|
||||
status: "1",
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
if (this.forms.merchandiseList.length > 0) {
|
||||
this.forms.merchandiseList.forEach((e1, index1) => {
|
||||
res.data.records.forEach((e2, index2) => {
|
||||
if (e1.id == e2.id) {
|
||||
res.data.records.splice(index2, 1);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
this.goodList = res.data.records;
|
||||
this.showGoods = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
changeNumber(currentValue, oldValue, row) {
|
||||
console.log(currentValue, oldValue, row);
|
||||
this.$set(
|
||||
this.goodIntegral,
|
||||
row.id,
|
||||
Number(currentValue) * Number(row.costIntegral)
|
||||
);
|
||||
},
|
||||
getShopList() {
|
||||
this.instance
|
||||
.post(`/app/appvillagerintegralshop/listForOperator`, null, {
|
||||
params: {
|
||||
size: 100000,
|
||||
areaId: this.areaId,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.shopList = res.data.records;
|
||||
}
|
||||
});
|
||||
},
|
||||
save(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.forms.merchandiseList.forEach((e1, index1) => {
|
||||
Object.keys(this.merchandiseNumbers).forEach((e2, index2) => {
|
||||
if (e1.id == e2) {
|
||||
this.forms.merchandiseList[
|
||||
index1
|
||||
].merchandiseNumber = this.merchandiseNumbers[e2];
|
||||
}
|
||||
});
|
||||
});
|
||||
this.instance
|
||||
.post(
|
||||
`/app/appvillagerintegralshoporder/addOrder`,
|
||||
{
|
||||
...this.forms,
|
||||
areaId: this.user.info.areaId,
|
||||
orderIntegral: this.allIntegral,
|
||||
},
|
||||
null
|
||||
)
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success("提交成功");
|
||||
this.$emit("goBack");
|
||||
} else {
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
searchDetail(id) {
|
||||
this.instance
|
||||
.post(`/app/appvillagerintegralshoporder/queryDetailById`, null, {
|
||||
params: {
|
||||
id,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.detailInfo = {...res.data};
|
||||
this.detailInfo.merchandiseList.map((e) => {
|
||||
let arr = JSON.parse(e.merchandisePhoto);
|
||||
e.merchandisePhoto = [{...arr[0]}];
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.add_order {
|
||||
height: 100%;
|
||||
|
||||
.form_div {
|
||||
padding: 16px 0;
|
||||
}
|
||||
|
||||
.goods {
|
||||
:deep( .el-table td ){
|
||||
border-bottom: none;
|
||||
padding: 2px 0;
|
||||
}
|
||||
|
||||
:deep( .el-table th ){
|
||||
padding: 2px 0;
|
||||
}
|
||||
}
|
||||
|
||||
.total {
|
||||
width: 100%;
|
||||
padding: 32px 0;
|
||||
|
||||
p {
|
||||
text-align: right;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.num {
|
||||
font-size: 14px;
|
||||
color: #333333;
|
||||
|
||||
span:nth-child(1) {
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
span:nth-child(2) {
|
||||
color: #999999;
|
||||
color: #2266ff;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.tip {
|
||||
color: #ff4466;
|
||||
}
|
||||
}
|
||||
|
||||
.border_div {
|
||||
overflow: hidden;
|
||||
border-radius: 2px;
|
||||
border: 1px solid #d0d4dc;
|
||||
|
||||
header {
|
||||
height: 40px;
|
||||
background: #f5f5f5;
|
||||
padding: 0 8px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid #d0d4dc;
|
||||
|
||||
span {
|
||||
color: #333333;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.info {
|
||||
padding: 16px 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user