Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
4d28a69c94
@ -55,6 +55,7 @@
|
||||
"jsencrypt": "3.0.0-rc.1",
|
||||
"nprogress": "0.2.0",
|
||||
"qrcode": "^1.5.3",
|
||||
"qrcodejs2": "0.0.2",
|
||||
"quill": "1.3.7",
|
||||
"save": "^2.9.0",
|
||||
"screenfull": "5.0.2",
|
||||
|
44
fuintAdmin/src/api/EventMarketing/Writeoffrecords.js
Normal file
44
fuintAdmin/src/api/EventMarketing/Writeoffrecords.js
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 核销记录列表
|
||||
export function listRecord(query) {
|
||||
return request({
|
||||
url: 'business/marketingActivity/cardExchangeRecord/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询兑换券领取记录详细
|
||||
export function getRecord(id) {
|
||||
return request({
|
||||
url: '/system/record/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增兑换券领取记录
|
||||
export function addRecord(data) {
|
||||
return request({
|
||||
url: 'business/marketingActivity/cardExchangeRecord',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改兑换券领取记录
|
||||
export function updateRecord(data) {
|
||||
return request({
|
||||
url: 'business/marketingActivity/cardExchangeRecord',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除兑换券领取记录
|
||||
export function delRecord(id) {
|
||||
return request({
|
||||
url: '/system/record/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
@ -29,7 +29,7 @@ export function addExchange(data) {
|
||||
// 修改兑换券
|
||||
export function updateExchange(data) {
|
||||
return request({
|
||||
url: '/system/exchange',
|
||||
url: 'business/marketingActivity/cardExchange',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
|
@ -1,9 +1,9 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询兑换券领取记录列表
|
||||
// 领取记录列表
|
||||
export function listRecord(query) {
|
||||
return request({
|
||||
url: '/system/record/list',
|
||||
url: 'business/marketingActivity/cardExchangeRecord',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
@ -20,7 +20,7 @@ export function getRecord(id) {
|
||||
// 新增兑换券领取记录
|
||||
export function addRecord(data) {
|
||||
return request({
|
||||
url: '/system/record',
|
||||
url: 'business/marketingActivity/cardExchangeRecord',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
@ -29,7 +29,7 @@ export function addRecord(data) {
|
||||
// 修改兑换券领取记录
|
||||
export function updateRecord(data) {
|
||||
return request({
|
||||
url: '/system/record',
|
||||
url: 'business/marketingActivity/cardExchangeRecord',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
|
@ -25,4 +25,14 @@ export function getGiftApi(data) {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 修改库存
|
||||
export function updateGiftInventoryApi(data) {
|
||||
return request({
|
||||
url: 'business/integral/integralGift/updateInventory',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
|
37
fuintAdmin/src/api/integral/order.js
Normal file
37
fuintAdmin/src/api/integral/order.js
Normal file
@ -0,0 +1,37 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 查询列表
|
||||
export function getOrderApi(data) {
|
||||
return request({
|
||||
url: 'business/integral/integralOrders/queryByPage',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 新增有关信息
|
||||
export function insertOrderApi(data) {
|
||||
return request({
|
||||
url: 'business/integral/integralOrders',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 修改有关信息
|
||||
export function updateOrderApi(data) {
|
||||
return request({
|
||||
url: 'business/integral/integralOrders',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function getStatisticsApi(data) {
|
||||
return request({
|
||||
url: 'business/integral/integralOrders/statistics',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
|
375
fuintAdmin/src/views/EventMarketing/Writeoffrecords/index.vue
Normal file
375
fuintAdmin/src/views/EventMarketing/Writeoffrecords/index.vue
Normal file
@ -0,0 +1,375 @@
|
||||
<template>
|
||||
<!-- 核销记录-->
|
||||
<div class="">
|
||||
<el-card style="margin-bottom: 20px">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.mobile"
|
||||
placeholder="请输入会员手机号"
|
||||
clearable
|
||||
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.staffMobile"
|
||||
placeholder="请输入员工手机号"
|
||||
clearable
|
||||
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.exchangeName"
|
||||
placeholder="券名称"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="" prop="isonline">
|
||||
<el-select v-model="queryParams.status" placeholder="是否使用">
|
||||
<el-option label="已使用" value="0"></el-option>
|
||||
<el-option label="未使用" value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card style="margin-bottom: 20px">
|
||||
<!-- <el-row :gutter="10" class="mb8">-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="primary"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-plus"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="handleAdd"-->
|
||||
|
||||
<!-- >新增</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-row>-->
|
||||
|
||||
<el-table v-loading="loading" :data="recordList" @selection-change="handleSelectionChange">
|
||||
<!-- <el-table-column type="selection" width="55" align="center" />-->
|
||||
<!-- <el-table-column label="主键id" align="center" prop="id" />-->
|
||||
<!-- <el-table-column label="员工id" align="center" prop="mtStaffId" />-->
|
||||
<!-- <el-table-column label="兑换券id" align="center" prop="cardExchangeId" />-->
|
||||
|
||||
<el-table-column label="id" align="center" prop="mtUserId" />
|
||||
<el-table-column label="手机号码" align="center" prop="mobile" />
|
||||
<el-table-column label="名字" align="center" prop="name" />
|
||||
<el-table-column label="头像" align="center" prop="photo" />
|
||||
<el-table-column label="核销人手机号" align="center" prop="staffMobile" />
|
||||
<el-table-column label="核销人姓名" align="center" prop="realName" />
|
||||
<el-table-column label="开始时间" align="center" prop="startTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="券名称" align="center" prop="exchangeName" />
|
||||
<!-- <el-table-column label="券码" align="center" prop="ticketCode" />-->
|
||||
<el-table-column label="券来源" align="center" prop="exchangeFrom" />
|
||||
|
||||
<el-table-column label="到期时间" align="center" prop="outTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.outTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="使用状态" align="center" prop="status" >
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.status == 0">未使用</span>
|
||||
<span v-if="scope.row.status == 1">已使用</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="核销时间" align="center" prop="cancelTime" width="180">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <span>{{ parseTime(scope.row.cancelTime, '{y}-{m}-{d}') }}</span>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
|
||||
<!-- <el-table-column label="结束时间" align="center " prop="endTime" width="180">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <el-button-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-edit"-->
|
||||
<!-- @click="handleUpdate(scope.row)"-->
|
||||
<!-- v-hasPermi="['system:record:edit']"-->
|
||||
<!-- >修改</el-button>-->
|
||||
<!-- <el-button-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- @click="handleDelete(scope.row)"-->
|
||||
<!-- v-hasPermi="['system:record:remove']"-->
|
||||
<!-- >删除</el-button>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
<!-- 添加或修改兑换券领取记录对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="兑换券id" prop="cardExchangeId">
|
||||
<el-input v-model="form.cardExchangeId" placeholder="请输入兑换券id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="员工id" prop="mtStaffId">
|
||||
<el-input v-model="form.mtStaffId" placeholder="请输入员工id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="员工姓名" prop="realName">
|
||||
<el-input v-model="form.realName" placeholder="请输入员工姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="员工手机号码" prop="staffMobile">
|
||||
<el-input v-model="form.staffMobile" placeholder="请输入员工手机号码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="会员id" prop="mtUserId">
|
||||
<el-input v-model="form.mtUserId" placeholder="请输入会员id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="会员名字" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入会员名字" />
|
||||
</el-form-item>
|
||||
<el-form-item label="会员手机号码" prop="mobile">
|
||||
<el-input v-model="form.mobile" placeholder="请输入会员手机号码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="会员头像" prop="photo">
|
||||
<el-input v-model="form.photo" placeholder="请输入会员头像" />
|
||||
</el-form-item>
|
||||
<el-form-item label="券名称" prop="exchangeName">
|
||||
<el-input v-model="form.exchangeName" placeholder="请输入券名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="券码" prop="ticketCode">
|
||||
<el-input v-model="form.ticketCode" placeholder="请输入券码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="券来源" prop="exchangeFrom">
|
||||
<el-input v-model="form.exchangeFrom" placeholder="请输入券来源" />
|
||||
</el-form-item>
|
||||
<el-form-item label="到期时间" prop="outTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.outTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择到期时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="核销时间" prop="cancelTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.cancelTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择核销时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="开始时间" prop="startTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.startTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择开始时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束时间" prop="endTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.endTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择结束时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { listRecord, getRecord, delRecord, addRecord, updateRecord } from "@/api/EventMarketing/Writeoffrecords";
|
||||
export default {
|
||||
name: "Record",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 兑换券领取记录表格数据
|
||||
recordList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
cardExchangeId: null,
|
||||
mtStaffId: null,
|
||||
realName: null,
|
||||
staffMobile: null,
|
||||
mtUserId: null,
|
||||
name: null,
|
||||
mobile: null,
|
||||
photo: null,
|
||||
exchangeName: null,
|
||||
ticketCode: null,
|
||||
exchangeFrom: null,
|
||||
status: null,
|
||||
outTime: null,
|
||||
cancelTime: null,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询兑换券领取记录列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listRecord(this.queryParams).then(response => {
|
||||
this.recordList = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
cardExchangeId: null,
|
||||
mtStaffId: null,
|
||||
realName: null,
|
||||
staffMobile: null,
|
||||
mtUserId: null,
|
||||
name: null,
|
||||
mobile: null,
|
||||
photo: null,
|
||||
exchangeName: null,
|
||||
ticketCode: null,
|
||||
exchangeFrom: null,
|
||||
status: null,
|
||||
outTime: null,
|
||||
cancelTime: null,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加兑换券领取记录";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getRecord(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改兑换券领取记录";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateRecord(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addRecord(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除兑换券领取记录编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delRecord(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/record/export', {
|
||||
...this.queryParams
|
||||
}, `record_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,222 +1,190 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="所属连锁店id" prop="chainStorId">
|
||||
<el-input
|
||||
v-model="queryParams.chainStorId"
|
||||
placeholder="请输入所属连锁店id"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属店铺id" prop="storeId">
|
||||
<el-input
|
||||
v-model="queryParams.storeId"
|
||||
placeholder="请输入所属店铺id"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否在线 0:在线 1: 下线" prop="isonline">
|
||||
<el-input
|
||||
v-model="queryParams.isonline"
|
||||
placeholder="请输入是否在线 0:在线 1: 下线"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="兑换券名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入兑换券名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="兑换礼品名" prop="giftName">
|
||||
<el-input
|
||||
v-model="queryParams.giftName"
|
||||
placeholder="请输入兑换礼品名"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="卡券有效期" prop="validity">
|
||||
<el-input
|
||||
v-model="queryParams.validity"
|
||||
placeholder="请输入卡券有效期"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="使用说明" prop="useInstructions">
|
||||
<el-input
|
||||
v-model="queryParams.useInstructions"
|
||||
placeholder="请输入使用说明"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="二维码链接" prop="qrCodeLink">
|
||||
<el-input
|
||||
v-model="queryParams.qrCodeLink"
|
||||
placeholder="请输入二维码链接"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="参与次数" prop="count">
|
||||
<el-input
|
||||
v-model="queryParams.count"
|
||||
placeholder="请输入参与次数"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="到期时间" prop="outTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.outTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择到期时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="">
|
||||
<el-card style="margin-bottom: 20px">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="兑换券名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:exchange:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:exchange:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:exchange:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:exchange:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
<el-form-item label="" prop="isonline">
|
||||
<el-select v-model="queryParams.isonline" placeholder="是否在线">
|
||||
<el-option label="在线" value="0"></el-option>
|
||||
<el-option label="下线" value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="兑换券状态">
|
||||
<el-option label="启用" value="0"></el-option>
|
||||
<el-option label="禁用" value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="type">
|
||||
<el-select v-model="queryParams.type" placeholder="兑换券类型">
|
||||
<el-option label="兑换券" value="0"></el-option>
|
||||
<el-option label="洗车券" value="1"></el-option>
|
||||
<el-option label="洗车卡" value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
|
||||
<el-table v-loading="loading" :data="exchangeList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键id" align="center" prop="id" />
|
||||
<el-table-column label="所属连锁店id" align="center" prop="chainStorId" />
|
||||
<el-table-column label="所属店铺id" align="center" prop="storeId" />
|
||||
<el-table-column label="是否在线 0:在线 1: 下线" align="center" prop="isonline" />
|
||||
<el-table-column label="兑换券状态 0:启用 1: 禁用" align="center" prop="status" />
|
||||
<el-table-column label="兑换券名称" align="center" prop="name" />
|
||||
<el-table-column label="兑换券类型 0:兑换券 1:洗车券 2:洗车卡" align="center" prop="type" />
|
||||
<el-table-column label="兑换礼品名" align="center" prop="giftName" />
|
||||
<el-table-column label="卡券有效期" align="center" prop="validity" />
|
||||
<el-table-column label="使用说明" align="center" prop="useInstructions" />
|
||||
<el-table-column label="二维码链接" align="center" prop="qrCodeLink" />
|
||||
<el-table-column label="参与次数" align="center" prop="count" />
|
||||
<el-table-column label="到期时间" align="center" prop="outTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.outTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card style="margin-bottom: 20px">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleAdd"
|
||||
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:exchange:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:exchange:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:exchange:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<el-table v-loading="loading" :data="exchangeList" @selection-change="handleSelectionChange">
|
||||
|
||||
<!-- <el-table-column label="主键id" align="center" prop="id" />-->
|
||||
<!-- <el-table-column label="所属连锁店id" align="center" prop="chainStorId" />-->
|
||||
<!-- <el-table-column label="所属店铺id" align="center" prop="storeId" />-->
|
||||
<el-table-column label="是否在线" align="center" prop="isonline">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.isonline == 0">在线</span>
|
||||
<span v-if="scope.row.isonline == 1">下线</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="兑换券状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.status == 0"> <el-tag>启用</el-tag> </span>
|
||||
<span v-if="scope.row.status == 1"> <el-tag type="danger">禁用</el-tag> </span>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="兑换券名称" align="center" prop="name"/>
|
||||
<el-table-column label="兑换券类型 " align="center" prop="type">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.type == 0"> <el-tag>兑换券</el-tag> </span>
|
||||
<span v-if="scope.row.type == 1"> <el-tag type="success">洗车券</el-tag> </span>
|
||||
<span v-if="scope.row.type == 2"> <el-tag type="warning">洗车卡</el-tag> </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="兑换礼品名" align="center" prop="giftName"/>
|
||||
<el-table-column label="卡券有效期" align="center" prop="validity">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.validity}}天</span>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="使用说明" align="center" prop="useInstructions"/>
|
||||
<el-table-column label="二维码链接" align="center" prop="qrCodeLink">
|
||||
<template slot-scope="scope">
|
||||
<i class="el-icon-picture" style="size: 20px;cursor: pointer" @click="qrcodelook(scope.row.qrCodeLink)"></i>
|
||||
<!-- <span>{{ scope.row.qrCodeLink }}</span>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="参与次数" align="center" prop="count"/>
|
||||
<el-table-column label="到期时间" align="center" prop="outTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.outTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
v-if="scope.row.isonline == 0"
|
||||
@click="handleXia(scope.row)"
|
||||
>下线
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
v-if="scope.row.isonline == 1"
|
||||
@click="handleShang(scope.row)"
|
||||
>上线
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
<!-- 添加或修改兑换券对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="所属连锁店id" prop="chainStorId">
|
||||
<el-input v-model="form.chainStorId" placeholder="请输入所属连锁店id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属店铺id" prop="storeId">
|
||||
<el-input v-model="form.storeId" placeholder="请输入所属店铺id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否在线 0:在线 1: 下线" prop="isonline">
|
||||
<el-input v-model="form.isonline" placeholder="请输入是否在线 0:在线 1: 下线" />
|
||||
</el-form-item>
|
||||
<el-dialog :title="title" :visible.sync="open" width="40%" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<!-- <el-form-item label="所属连锁店id" prop="chainStorId">-->
|
||||
<!-- <el-input v-model="form.chainStorId" placeholder="请输入所属连锁店id" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="所属店铺id" prop="storeId">-->
|
||||
<!-- <el-input v-model="form.storeId" placeholder="请输入所属店铺id" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="兑换券名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入兑换券名称" />
|
||||
<el-input v-model="form.name" placeholder="请输入兑换券名称"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="兑换券类型" prop="type">
|
||||
<el-radio-group v-model="form.type">
|
||||
<el-radio label="0">兑换券</el-radio>
|
||||
<el-radio label="1">洗车券</el-radio>
|
||||
<el-radio label="2">洗车卡</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="兑换礼品名" prop="giftName">
|
||||
<el-input v-model="form.giftName" placeholder="请输入兑换礼品名" />
|
||||
<el-input type="textarea" v-model="form.giftName" placeholder="请输入兑换礼品名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="卡券有效期" prop="validity">
|
||||
<el-input v-model="form.validity" placeholder="请输入卡券有效期" />
|
||||
<el-input placeholder="请输入卡券有效期" v-model="form.validity">
|
||||
<template slot="append">天</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="使用说明" prop="useInstructions">
|
||||
<el-input v-model="form.useInstructions" placeholder="请输入使用说明" />
|
||||
</el-form-item>
|
||||
<el-form-item label="二维码链接" prop="qrCodeLink">
|
||||
<el-input v-model="form.qrCodeLink" placeholder="请输入二维码链接" />
|
||||
<el-input type="textarea" v-model="form.useInstructions" placeholder="请输入使用说明"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="参与次数" prop="count">
|
||||
<el-input v-model="form.count" placeholder="请输入参与次数" />
|
||||
<el-input-number v-model="form.count" controls-position="right" :min="1" :max="999"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="到期时间" prop="outTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.outTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择到期时间">
|
||||
</el-date-picker>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio label="0">启用</el-radio>
|
||||
<el-radio label="1">禁用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@ -224,167 +192,251 @@
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
title="二维码"
|
||||
v-loading="loadingdialog"
|
||||
:visible.sync="centerDialogVisible"
|
||||
width="30%"
|
||||
center>
|
||||
<div style="display: flex;align-items: center">
|
||||
<div class="qr-code" id="qrCode" ref="qrCodeUrl"></div>
|
||||
</div>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="centerDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="centerDialogVisible = false">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import { listExchange, getExchange, delExchange, addExchange, updateExchange } from "@/api/system/exchange";
|
||||
import QRCode from 'qrcodejs2'
|
||||
import {
|
||||
listExchange,
|
||||
getExchange,
|
||||
delExchange,
|
||||
addExchange,
|
||||
updateExchange
|
||||
} from '@/api/EventMarketing/cardExchange'
|
||||
|
||||
export default {
|
||||
name: 'Exchange',
|
||||
data() {
|
||||
return {
|
||||
centerDialogVisible: false,
|
||||
loadingdialog:true,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 兑换券表格数据
|
||||
exchangeList: [],
|
||||
// 弹出层标题
|
||||
title: '',
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
chainStorId: null,
|
||||
storeId: null,
|
||||
isonline: null,
|
||||
status: null,
|
||||
name: null,
|
||||
type: null,
|
||||
giftName: null,
|
||||
validity: null,
|
||||
useInstructions: null,
|
||||
qrCodeLink: null,
|
||||
count: null,
|
||||
outTime: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '请输入兑换券名称', trigger: 'change' }
|
||||
],
|
||||
type: [
|
||||
{ required: true, message: '请输入兑换券类型', trigger: 'change' }
|
||||
],
|
||||
giftName: [
|
||||
{ required: true, message: '请输入兑换礼品名', trigger: 'change' }
|
||||
],
|
||||
validity: [
|
||||
{ required: true, message: '请输入卡券有效期', trigger: 'change' }
|
||||
],
|
||||
useInstructions: [
|
||||
{ required: true, message: '请输入使用说明', trigger: 'change' }
|
||||
],
|
||||
count: [
|
||||
{ required: true, message: '请输入参与次数', trigger: 'change' }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: '请选择状态', trigger: 'change' }
|
||||
]
|
||||
|
||||
export default {
|
||||
name: "Exchange",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 兑换券表格数据
|
||||
exchangeList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
chainStorId: null,
|
||||
storeId: null,
|
||||
isonline: null,
|
||||
status: null,
|
||||
name: null,
|
||||
type: null,
|
||||
giftName: null,
|
||||
validity: null,
|
||||
useInstructions: null,
|
||||
qrCodeLink: null,
|
||||
count: null,
|
||||
outTime: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询兑换券列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listExchange(this.queryParams).then(response => {
|
||||
this.exchangeList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
chainStorId: null,
|
||||
storeId: null,
|
||||
isonline: null,
|
||||
status: null,
|
||||
name: null,
|
||||
type: null,
|
||||
giftName: null,
|
||||
validity: null,
|
||||
useInstructions: null,
|
||||
qrCodeLink: null,
|
||||
count: null,
|
||||
outTime: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加兑换券";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getExchange(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改兑换券";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateExchange(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addExchange(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除兑换券编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delExchange(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
created() {
|
||||
this.getList()
|
||||
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/exchange/export', {
|
||||
...this.queryParams
|
||||
}, `exchange_${new Date().getTime()}.xlsx`)
|
||||
methods: {
|
||||
qrcodelook(url) {
|
||||
this.loadingdialog = true
|
||||
this.centerDialogVisible = true
|
||||
setTimeout(() => {
|
||||
this.creatQrCode(url)
|
||||
this.loadingdialog = false
|
||||
}, 1000);
|
||||
|
||||
},
|
||||
creatQrCode(url) {
|
||||
|
||||
document.getElementById("qrCode").innerHTML = ""
|
||||
|
||||
new QRCode(this.$refs.qrCodeUrl, {
|
||||
text: url, // 二维码的内容
|
||||
width: 300,
|
||||
height: 300,
|
||||
colorDark: '#000',
|
||||
colorLight: '#fff',
|
||||
correctLevel: QRCode.CorrectLevel.H
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
|
||||
/** 查询兑换券列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listExchange(this.queryParams).then(response => {
|
||||
this.exchangeList = response.data.records
|
||||
this.total = response.data.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
chainStorId: null,
|
||||
storeId: null,
|
||||
isonline: null,
|
||||
status: null,
|
||||
name: null,
|
||||
type: null,
|
||||
giftName: null,
|
||||
validity: null,
|
||||
useInstructions: null,
|
||||
qrCodeLink: null,
|
||||
count: null,
|
||||
outTime: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
}
|
||||
this.resetForm('form')
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = '添加兑换券'
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
this.form = row
|
||||
this.open = true
|
||||
this.title = '修改兑换券'
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateExchange(this.form).then(response => {
|
||||
this.$modal.msgSuccess('修改成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addExchange(this.form).then(response => {
|
||||
this.$modal.msgSuccess('新增成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 下线操作 */
|
||||
handleXia(row) {
|
||||
let data = row
|
||||
data.isonline = 1
|
||||
updateExchange(data).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.$message.success('下线成功')
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 上线操作 */
|
||||
handleShang(row) {
|
||||
let data = row
|
||||
data.isonline = 0
|
||||
updateExchange(data).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.$message.success('上线成功')
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/exchange/export', {
|
||||
...this.queryParams
|
||||
}, `exchange_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.qr-code{
|
||||
margin: 0px auto;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,231 +1,113 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 领取记录-->
|
||||
<div class="">
|
||||
<el-card style="margin-bottom: 20px">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="兑换券id" prop="cardExchangeId">
|
||||
<el-input
|
||||
v-model="queryParams.cardExchangeId"
|
||||
placeholder="请输入兑换券id"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="员工id" prop="mtStaffId">
|
||||
<el-input
|
||||
v-model="queryParams.mtStaffId"
|
||||
placeholder="请输入员工id"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="员工姓名" prop="realName">
|
||||
<el-input
|
||||
v-model="queryParams.realName"
|
||||
placeholder="请输入员工姓名"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="员工手机号码" prop="staffMobile">
|
||||
<el-input
|
||||
v-model="queryParams.staffMobile"
|
||||
placeholder="请输入员工手机号码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="会员id" prop="mtUserId">
|
||||
<el-input
|
||||
v-model="queryParams.mtUserId"
|
||||
placeholder="请输入会员id"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="会员名字" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入会员名字"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="会员手机号码" prop="mobile">
|
||||
<el-form-item label="" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.mobile"
|
||||
placeholder="请输入会员手机号码"
|
||||
placeholder="请输入会员手机号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="会员头像" prop="photo">
|
||||
<el-input
|
||||
v-model="queryParams.photo"
|
||||
placeholder="请输入会员头像"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="券名称" prop="exchangeName">
|
||||
<el-form-item label="" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.exchangeName"
|
||||
placeholder="请输入券名称"
|
||||
placeholder="券名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="券码" prop="ticketCode">
|
||||
<el-input
|
||||
v-model="queryParams.ticketCode"
|
||||
placeholder="请输入券码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="券来源" prop="exchangeFrom">
|
||||
<el-input
|
||||
v-model="queryParams.exchangeFrom"
|
||||
placeholder="请输入券来源"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="到期时间" prop="outTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.outTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择到期时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="核销时间" prop="cancelTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.cancelTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择核销时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="开始时间" prop="startTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.startTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择开始时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束时间" prop="endTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.endTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择结束时间">
|
||||
</el-date-picker>
|
||||
|
||||
<el-form-item label="" prop="isonline">
|
||||
<el-select v-model="queryParams.status" placeholder="是否使用">
|
||||
<el-option label="已使用" value="0"></el-option>
|
||||
<el-option label="未使用" value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:record:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:record:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:record:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:record:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
<el-card style="margin-bottom: 20px">
|
||||
<!-- <el-row :gutter="10" class="mb8">-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="primary"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-plus"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="handleAdd"-->
|
||||
|
||||
<!-- >新增</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-row>-->
|
||||
|
||||
<el-table v-loading="loading" :data="recordList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键id" align="center" prop="id" />
|
||||
<el-table-column label="兑换券id" align="center" prop="cardExchangeId" />
|
||||
<el-table-column label="员工id" align="center" prop="mtStaffId" />
|
||||
<el-table-column label="员工姓名" align="center" prop="realName" />
|
||||
<el-table-column label="员工手机号码" align="center" prop="staffMobile" />
|
||||
<el-table-column label="会员id" align="center" prop="mtUserId" />
|
||||
<el-table-column label="会员名字" align="center" prop="name" />
|
||||
<el-table-column label="会员手机号码" align="center" prop="mobile" />
|
||||
<el-table-column label="会员头像" align="center" prop="photo" />
|
||||
<el-table-column label="券名称" align="center" prop="exchangeName" />
|
||||
<el-table-column label="券码" align="center" prop="ticketCode" />
|
||||
<el-table-column label="券来源" align="center" prop="exchangeFrom" />
|
||||
<el-table-column label="使用状态 :0 :未使用 1:已使用 " align="center" prop="status" />
|
||||
<el-table-column label="到期时间" align="center" prop="outTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.outTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="核销时间" align="center" prop="cancelTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.cancelTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column type="selection" width="55" align="center" />-->
|
||||
<!-- <el-table-column label="主键id" align="center" prop="id" />-->
|
||||
<!-- <el-table-column label="员工id" align="center" prop="mtStaffId" />-->
|
||||
<!-- <el-table-column label="兑换券id" align="center" prop="cardExchangeId" />-->
|
||||
<!-- <el-table-column label="员工手机号码" align="center" prop="staffMobile" />-->
|
||||
<!-- <el-table-column label="员工姓名" align="center" prop="realName" />-->
|
||||
<el-table-column label="id" align="center" prop="mtUserId" />
|
||||
<el-table-column label="手机号码" align="center" prop="mobile" />
|
||||
<el-table-column label="名字" align="center" prop="name" />
|
||||
<el-table-column label="头像" align="center" prop="photo" />
|
||||
<el-table-column label="开始时间" align="center" prop="startTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结束时间" align="center" prop="endTime" width="180">
|
||||
<el-table-column label="券名称" align="center" prop="exchangeName" />
|
||||
<!-- <el-table-column label="券码" align="center" prop="ticketCode" />-->
|
||||
<el-table-column label="券来源" align="center" prop="exchangeFrom" />
|
||||
|
||||
<el-table-column label="到期时间" align="center" prop="outTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
|
||||
<span>{{ parseTime(scope.row.outTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:record:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:record:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
<el-table-column label="使用状态" align="center" prop="status" >
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.status == 0">未使用</span>
|
||||
<span v-if="scope.row.status == 1">已使用</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="核销时间" align="center" prop="cancelTime" width="180">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <span>{{ parseTime(scope.row.cancelTime, '{y}-{m}-{d}') }}</span>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
|
||||
<!-- <el-table-column label="结束时间" align="center " prop="endTime" width="180">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <el-button-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-edit"-->
|
||||
<!-- @click="handleUpdate(scope.row)"-->
|
||||
<!-- v-hasPermi="['system:record:edit']"-->
|
||||
<!-- >修改</el-button>-->
|
||||
<!-- <el-button-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- @click="handleDelete(scope.row)"-->
|
||||
<!-- v-hasPermi="['system:record:remove']"-->
|
||||
<!-- >删除</el-button>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
@ -235,7 +117,7 @@
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
</el-card>
|
||||
<!-- 添加或修改兑换券领取记录对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
@ -315,7 +197,7 @@
|
||||
|
||||
<script>
|
||||
|
||||
import { listRecord, getRecord, delRecord, addRecord, updateRecord } from "@/api/EventMarketing/cardExchange";
|
||||
import { listRecord, getRecord, delRecord, addRecord, updateRecord } from "@/api/EventMarketing/cardExchangeRecord";
|
||||
export default {
|
||||
name: "Record",
|
||||
data() {
|
||||
@ -339,7 +221,7 @@ export default {
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
queryParams : {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
cardExchangeId: null,
|
||||
@ -374,8 +256,8 @@ export default {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listRecord(this.queryParams).then(response => {
|
||||
this.recordList = response.rows;
|
||||
this.total = response.total;
|
||||
this.recordList = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
@ -1,268 +1,89 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="兑换券名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="" prop="isonline">
|
||||
<el-select v-model="queryParams.isonline" placeholder="是否在线">
|
||||
<el-option label="在线" value="0"></el-option>
|
||||
<el-option label="下线" value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="兑换券状态">
|
||||
<el-option label="启用" value="0"></el-option>
|
||||
<el-option label="禁用" value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="" prop="type">
|
||||
<el-select v-model="queryParams.type" placeholder="兑换券类型">
|
||||
<el-option label="兑换券" value="0"></el-option>
|
||||
<el-option label="洗车券" value="1"></el-option>
|
||||
<el-option label="洗车卡" value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:exchange:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:exchange:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:exchange:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="exchangeList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键id" align="center" prop="id" />
|
||||
<el-table-column label="所属连锁店id" align="center" prop="chainStorId" />
|
||||
<el-table-column label="所属店铺id" align="center" prop="storeId" />
|
||||
<el-table-column label="是否在线 0:在线 1: 下线" align="center" prop="isonline" />
|
||||
<el-table-column label="兑换券状态 0:启用 1: 禁用" align="center" prop="status" />
|
||||
<el-table-column label="兑换券名称" align="center" prop="name" />
|
||||
<el-table-column label="兑换券类型 0:兑换券 1:洗车券 2:洗车卡" align="center" prop="type" />
|
||||
<el-table-column label="兑换礼品名" align="center" prop="giftName" />
|
||||
<el-table-column label="卡券有效期" align="center" prop="validity" />
|
||||
<el-table-column label="使用说明" align="center" prop="useInstructions" />
|
||||
<el-table-column label="二维码链接" align="center" prop="qrCodeLink" />
|
||||
<el-table-column label="参与次数" align="center" prop="count" />
|
||||
<el-table-column label="到期时间" align="center" prop="outTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.outTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<el-card style="margin-bottom: 20px">
|
||||
<el-radio-group v-model="value">
|
||||
<el-radio-button label="1">兑换券</el-radio-button>
|
||||
<el-radio-button label="2">领取记录</el-radio-button>
|
||||
<el-radio-button label="3">核销记录</el-radio-button>
|
||||
<el-radio-button label="4">在线核销</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-card>
|
||||
<cardExchange v-if="value == 1"></cardExchange>
|
||||
<cardExchangeRecord v-if="value == 2"></cardExchangeRecord>
|
||||
<Writeoffrecords v-if="value == 3"></Writeoffrecords>
|
||||
<online v-if="value == 4"></online>
|
||||
<!-- 添加或修改兑换券对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="40%" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<!-- <el-form-item label="所属连锁店id" prop="chainStorId">-->
|
||||
<!-- <el-input v-model="form.chainStorId" placeholder="请输入所属连锁店id" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="所属店铺id" prop="storeId">-->
|
||||
<!-- <el-input v-model="form.storeId" placeholder="请输入所属店铺id" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="兑换券名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入兑换券名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="兑换券类型" prop="type">
|
||||
<el-radio-group v-model="form.type">
|
||||
<el-radio label="0">兑换券</el-radio>
|
||||
<el-radio label="1">洗车券</el-radio>
|
||||
<el-radio label="2">洗车卡</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="兑换礼品名" prop="giftName">
|
||||
<el-input type="textarea" v-model="form.giftName" placeholder="请输入兑换礼品名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="卡券有效期" prop="validity">
|
||||
<el-input placeholder="请输入卡券有效期" v-model="form.validity">
|
||||
<template slot="append">天</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="使用说明" prop="useInstructions">
|
||||
<el-input type="textarea" v-model="form.useInstructions" placeholder="请输入使用说明"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="参与次数" prop="count">
|
||||
<el-input-number v-model="form.count" controls-position="right" :min="1" :max="999"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio label="0">启用</el-radio>
|
||||
<el-radio label="1">禁用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { listExchange, getExchange, delExchange, addExchange, updateExchange } from "@/api/EventMarketing/cardExchange";
|
||||
import QRCode from 'qrcodejs2'
|
||||
import {
|
||||
listExchange,
|
||||
getExchange,
|
||||
delExchange,
|
||||
addExchange,
|
||||
updateExchange
|
||||
} from '@/api/EventMarketing/cardExchange'
|
||||
import cardExchange from '../cardExchange/index'
|
||||
import cardExchangeRecord from '../cardExchangeRecord/index'
|
||||
import Writeoffrecords from '../Writeoffrecords/index'
|
||||
import online from '../online/index'
|
||||
export default {
|
||||
name: "Exchange",
|
||||
name: 'Exchange',
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 兑换券表格数据
|
||||
exchangeList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
chainStorId: null,
|
||||
storeId: null,
|
||||
isonline: null,
|
||||
status: null,
|
||||
name: null,
|
||||
type: null,
|
||||
giftName: null,
|
||||
validity: null,
|
||||
useInstructions: null,
|
||||
qrCodeLink: null,
|
||||
count: null,
|
||||
outTime: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '请输入兑换券名称', trigger: 'change' }
|
||||
],
|
||||
type: [
|
||||
{ required: true, message: '请输入兑换券类型', trigger: 'change' }
|
||||
],
|
||||
giftName: [
|
||||
{ required: true, message: '请输入兑换礼品名', trigger: 'change' }
|
||||
],
|
||||
validity: [
|
||||
{ required: true, message: '请输入卡券有效期', trigger: 'change' }
|
||||
],
|
||||
useInstructions: [
|
||||
{ required: true, message: '请输入使用说明', trigger: 'change' }
|
||||
],
|
||||
count: [
|
||||
{ required: true, message: '请输入参与次数', trigger: 'change' }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: '请选择状态', trigger: 'change' }
|
||||
],
|
||||
|
||||
}
|
||||
};
|
||||
return{
|
||||
value:1
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
|
||||
|
||||
},
|
||||
components:{
|
||||
cardExchange,cardExchangeRecord,Writeoffrecords,online
|
||||
},
|
||||
methods: {
|
||||
qrcodelook(url) {
|
||||
this.loadingdialog = true
|
||||
this.centerDialogVisible = true
|
||||
setTimeout(() => {
|
||||
this.creatQrCode(url)
|
||||
this.loadingdialog = false
|
||||
}, 1000);
|
||||
|
||||
},
|
||||
creatQrCode(url) {
|
||||
|
||||
document.getElementById("qrCode").innerHTML = ""
|
||||
|
||||
new QRCode(this.$refs.qrCodeUrl, {
|
||||
text: url, // 二维码的内容
|
||||
width: 300,
|
||||
height: 300,
|
||||
colorDark: '#000',
|
||||
colorLight: '#fff',
|
||||
correctLevel: QRCode.CorrectLevel.H
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
|
||||
/** 查询兑换券列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.loading = true
|
||||
listExchange(this.queryParams).then(response => {
|
||||
this.exchangeList = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
this.exchangeList = response.data.records
|
||||
this.total = response.data.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
@ -284,67 +105,77 @@
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
}
|
||||
this.resetForm('form')
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加兑换券";
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = '添加兑换券'
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.form = row;
|
||||
this.open = true;
|
||||
this.title = "修改兑换券";
|
||||
this.reset()
|
||||
this.form = row
|
||||
this.open = true
|
||||
this.title = '修改兑换券'
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateExchange(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
this.$modal.msgSuccess('修改成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addExchange(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
this.$modal.msgSuccess('新增成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除兑换券编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delExchange(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
/** 下线操作 */
|
||||
handleXia(row) {
|
||||
let data = row
|
||||
data.isonline = 1
|
||||
updateExchange(data).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.$message.success('下线成功')
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 上线操作 */
|
||||
handleShang(row) {
|
||||
let data = row
|
||||
data.isonline = 0
|
||||
updateExchange(data).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.$message.success('上线成功')
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
@ -353,5 +184,10 @@
|
||||
}, `exchange_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.qr-code{
|
||||
margin: 0px auto;
|
||||
}
|
||||
</style>
|
||||
|
@ -3,8 +3,6 @@
|
||||
<!-- 礼品卡-->
|
||||
<el-card style="margin-bottom: 20px">
|
||||
<div class="top-hang">
|
||||
|
||||
|
||||
<el-input v-model="queryParams.number" style="width: 20%;margin-right: 10px" placeholder="礼品卡号 "></el-input>
|
||||
<el-input v-model="queryParams.remark" style="width: 20%;margin-right: 10px" placeholder="备注信息"></el-input>
|
||||
<el-select v-model="queryParams.activateStatus" style="margin-right: 10px" placeholder="请选择">
|
||||
|
74
fuintAdmin/src/views/EventMarketing/online/index.vue
Normal file
74
fuintAdmin/src/views/EventMarketing/online/index.vue
Normal file
@ -0,0 +1,74 @@
|
||||
<template>
|
||||
<div class="center">
|
||||
<el-card style="margin-bottom: 20px">
|
||||
<div style="display: flex;align-items: center">
|
||||
<div style="width: 5%;margin-right: 10px">卡券核销:</div>
|
||||
<div style="width: 80%;">
|
||||
<el-input v-model="queryParams.mobile" placeholder="请输入会员手机号码"></el-input>
|
||||
</div>
|
||||
<div style="width: 10%;margin-left: 20px">
|
||||
<el-button type="primary" icon="el-icon-search" @click="getList">搜索</el-button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<el-empty :image-size="200"></el-empty>
|
||||
|
||||
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listRecord, getRecord, delRecord, addRecord, updateRecord } from "@/api/EventMarketing/cardExchangeRecord";
|
||||
export default {
|
||||
name: 'index',
|
||||
data(){
|
||||
return{
|
||||
queryParams : {
|
||||
pageNum: 1,
|
||||
pageSize: 999,
|
||||
cardExchangeId: null,
|
||||
mtStaffId: null,
|
||||
realName: null,
|
||||
staffMobile: null,
|
||||
mtUserId: null,
|
||||
name: null,
|
||||
mobile: null,
|
||||
photo: null,
|
||||
exchangeName: null,
|
||||
ticketCode: null,
|
||||
exchangeFrom: null,
|
||||
status: null,
|
||||
outTime: null,
|
||||
cancelTime: null,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
},
|
||||
recordList:[],
|
||||
total:0,
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
getList() {
|
||||
if(!this.queryParams.mobile ){
|
||||
this.$message.error("输入框不能为空")
|
||||
return
|
||||
}
|
||||
this.loading = true;
|
||||
listRecord(this.queryParams).then(response => {
|
||||
this.recordList = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.center{
|
||||
width: 100%;
|
||||
|
||||
}
|
||||
</style>
|
@ -44,7 +44,11 @@
|
||||
v-loading="loading"
|
||||
:data="dataList"
|
||||
:default-sort="defaultSort">
|
||||
<el-table-column label="分类" align="center" prop="categoryName" width="50px"/>
|
||||
<el-table-column label="分类" align="center" prop="categoryName" width="50px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.categoryName==null? '不分类': scope.row.categoryName}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="礼品信息" align="center">
|
||||
<el-table-column label="名称" align="center" prop="giftName"/>
|
||||
<el-table-column label="封面图" align="center" prop="coverImage">
|
||||
@ -80,7 +84,13 @@
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="配送类型" align="center">
|
||||
<el-table-column label="配送方式" align="center" prop="deliveryMethod"/>
|
||||
<el-table-column label="配送方式" align="center" prop="deliveryMethod">
|
||||
<template slot-scope="scope">
|
||||
<span v-for="(row, index) in JSON.parse(scope.row.deliveryMethod)" :key="index">
|
||||
{{row}}<br>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="快递费用" align="center" prop="shippingFeeAmount">
|
||||
<template slot-scope="scope">
|
||||
<span v-if ="scope.row.exchangeMethod!= null && !scope.row.exchangeMethod.includes('物流配送')">--</span>
|
||||
@ -92,15 +102,17 @@
|
||||
<el-table-column label="礼品库存信息" align="center">
|
||||
<el-table-column label="总库存" align="center" prop="totalInventory" >
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="clickInventory(scope.row)">{{ scope.row.totalInventory }}</el-button>
|
||||
<el-button type="text" @click="clickInventory(scope.row)">{{ scope.row.totalInventory===-1?'无限制': scope.row.totalInventory}}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="已用" align="center" prop="">
|
||||
<el-table-column label="已用" align="center" prop="usedInventory">
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column label="可用" align="center" prop="remainingInventory">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.totalInventory-scope.row.remainingInventory }}</span>
|
||||
<span>{{ scope.row.totalInventory===-1?scope.row.totalInventory-scope.row.usedInventory+1: scope.row.totalInventory-scope.row.usedInventory}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="可用" align="center" prop="remainingInventory"/>
|
||||
</el-table-column>
|
||||
<el-table-column label="排序" align="center" prop="sort" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
@ -144,10 +156,12 @@
|
||||
</el-col>
|
||||
<el-col :span="9">
|
||||
<el-form-item label="分类" prop="categoryId">
|
||||
<el-select v-model="dataForm.categoryId" placeholder="请选择礼品分类" style="width:100%">
|
||||
<el-select clearable v-model="dataForm.categoryId" placeholder="请选择礼品分类" style="width:100%">
|
||||
<el-option label="-不分类-" value=""></el-option>
|
||||
<el-option
|
||||
v-for="option in giftCategoryList"
|
||||
:key="option.id"
|
||||
|
||||
:label="option.categoryName"
|
||||
:value="option.id"
|
||||
></el-option>
|
||||
@ -257,7 +271,7 @@
|
||||
|
||||
<el-form-item v-if="showList.goods" label="关联商品" prop="goodsId">
|
||||
<el-input v-model="dataForm.goodsName" placeholder="" maxlength="30" style="width: 202px;" @focus="getCommodity"/>
|
||||
</el-select>
|
||||
<!-- </el-select> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
@ -275,7 +289,7 @@
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item label="礼品库存" prop="totalInventory">
|
||||
<el-input v-model="dataForm.totalInventory" placeholder="礼品库存" maxlength="30" style="width: 202px;"/>
|
||||
<el-input v-model.number="dataForm.totalInventory" placeholder="礼品库存" maxlength="30" style="width: 202px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -363,7 +377,7 @@
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="兑换次数" prop="exchangeTimes">
|
||||
<el-input v-model="dataForm.exchangeTimes" placeholder="" maxlength="30" style="width: 202px;">
|
||||
<el-input v-model.number="dataForm.exchangeTimes" placeholder="" maxlength="30" style="width: 202px;">
|
||||
<template slot="append">个</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
@ -489,13 +503,49 @@
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<el-dialog title="库存变更" :visible.sync="openInventory" width="1000px" append-to-body :close-on-click-modal="false">
|
||||
<el-dialog title="库存变更" :visible.sync="openInventory" width="500px" append-to-body :close-on-click-modal="false">
|
||||
<el-form ref="form" :model="inventoryForm" :rules="rulesInventory" label-width="100px">
|
||||
<el-form-item label="当前总库存" prop="totalInventory" >
|
||||
<el-input disabled v-model="inventoryForm.totalInventory" placeholder="" maxlength="30" style="width: 270px;">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="已用库存" prop="usedInventory" >
|
||||
<el-input disabled v-model="inventoryForm.usedInventory" placeholder="" maxlength="30" style="width: 270px;">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="可用库存" prop="remainingInventory" >
|
||||
<el-input disabled v-model="inventoryForm.remainingInventory" placeholder="" maxlength="30" style="width: 270px;">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="变更类型" prop="moneyRatio" >
|
||||
<el-radio-group :disabled="inventoryForm.flag" v-model="inventoryForm.inventoryFlag">
|
||||
<el-radio :label="0">增加库存</el-radio>
|
||||
<el-radio :label="1">减少库存</el-radio>
|
||||
<el-radio :label="2">不限库存</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="库存数量" prop="editInventory" >
|
||||
<el-input v-if="inventoryForm.inventoryFlag == 0" v-model.number="inventoryForm.editInventory" placeholder="" maxlength="30" style="width: 270px;">
|
||||
<template slot="prepend">+</template>
|
||||
</el-input>
|
||||
<el-input v-else-if="inventoryForm.inventoryFlag == 1" v-model.number="inventoryForm.editInventory" placeholder="" maxlength="30" style="width: 270px;">
|
||||
<template slot="prepend">-</template>
|
||||
</el-input>
|
||||
<el-input v-else="" disabled placeholder="变更为不限制库存" maxlength="30" style="width: 270px;"/>
|
||||
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitInventory">确 定</el-button>
|
||||
<el-button @click="cancelInventory">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {getGiftCategoryApi} from "@/api/integral/category";
|
||||
import {getGiftApi,insertGiftApi,updateGiftApi } from "@/api/integral/gift";
|
||||
import {getGiftApi,insertGiftApi,updateGiftApi ,updateGiftInventoryApi} from "@/api/integral/gift";
|
||||
import { editor } from '@/components/Editor/index'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import {listLJGoods} from "@/api/convenienceStore/ljgoods";
|
||||
@ -506,6 +556,16 @@ export default {
|
||||
dicts: ['zhzt','lplx','redemptionMethod','expressShippingCosts','shippingMethod'],
|
||||
|
||||
data() {
|
||||
var valiNumberPass = (rule, value, callback) => {//包含小数的数字
|
||||
let reg = /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g;
|
||||
if (value === '') {
|
||||
callback(new Error('请输入内容'));
|
||||
} else if (!reg.test(value)) {
|
||||
callback(new Error('请输入数字'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
dataList: [],
|
||||
|
||||
@ -537,6 +597,18 @@ export default {
|
||||
market:null
|
||||
},
|
||||
|
||||
inventoryForm: {
|
||||
inventoryFlag: 0,
|
||||
remainingInventory: null, // 剩余库存
|
||||
totalInventory: null, //总库存
|
||||
usedInventory: null, // 已用库存
|
||||
editInventory: null,
|
||||
flag: false,
|
||||
id:''
|
||||
},
|
||||
|
||||
|
||||
|
||||
showList: {
|
||||
// 优惠类型展示
|
||||
coupon: true,
|
||||
@ -563,6 +635,7 @@ export default {
|
||||
// 总条数
|
||||
open: false,
|
||||
openCommodity: false,
|
||||
openInventory: false,
|
||||
total: 0,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
@ -598,7 +671,7 @@ export default {
|
||||
|
||||
dialogImageUrl: "",
|
||||
dialogVisible: false,
|
||||
|
||||
rulesInventory: {},
|
||||
rules: {
|
||||
giftName: [
|
||||
{ required: true, message: "礼品名称不能为空", trigger: "blur" },
|
||||
@ -628,19 +701,22 @@ export default {
|
||||
{ required: true, message: "兑换方式不能为空", trigger: "blur" },
|
||||
],
|
||||
exchangePoints: [
|
||||
{ required: true, message: "兑换积分不能为空", trigger: "blur" },
|
||||
{ required: true, validator:valiNumberPass, trigger: "blur" },
|
||||
],
|
||||
exchangeAmount: [
|
||||
{ required: true, message: "兑换金额不能为空", trigger: "blur" },
|
||||
{ required: true, validator:valiNumberPass, trigger: "blur" },
|
||||
],
|
||||
moneyRatio: [
|
||||
{ required: true, message: "加钱比例不能为空", trigger: "blur" },
|
||||
{ required: true, validator:valiNumberPass, trigger: "blur" },
|
||||
],
|
||||
expressShippingFee: [
|
||||
{ required: true, message: "快递运费不能为空", trigger: "change" },
|
||||
],
|
||||
shippingFeeAmount: [
|
||||
{ required: true, message: "运费金额不能为空", trigger: "blur" },
|
||||
{ required: true, validator:valiNumberPass, trigger: "blur" },
|
||||
],
|
||||
market: [
|
||||
{ required: true, validator:valiNumberPass, trigger: "blur" },
|
||||
],
|
||||
exchangeTimes: [
|
||||
{ required: true, message: "兑换次数不能为空", trigger: "change" },
|
||||
@ -698,7 +774,7 @@ export default {
|
||||
this_.dataForm.giftImages = JSON.stringify(this_.giftImages);
|
||||
}
|
||||
if (this_.dataForm.deliveryMethod != null && Array.isArray(this_.dataForm.deliveryMethod)) {
|
||||
this_.dataForm.deliveryMethod = JSON.stringify(thithis_s.dataForm.deliveryMethod);
|
||||
this_.dataForm.deliveryMethod = JSON.stringify(this.dataForm.deliveryMethod);
|
||||
}
|
||||
this_.dataForm.remainingInventory = this_.dataForm.totalInventory
|
||||
|
||||
@ -720,6 +796,38 @@ export default {
|
||||
}})
|
||||
},
|
||||
|
||||
submitInventory: function(){
|
||||
if (this.inventoryForm.inventoryFlag === 1) {
|
||||
this.inventoryForm.editInventory = - this.inventoryForm.editInventory
|
||||
} else if(this.inventoryForm.inventoryFlag === 2) {
|
||||
this.inventoryForm.editInventory = -this.inventoryForm.totalInventory - 1
|
||||
}
|
||||
if (this.inventoryForm.totalInventory == '无限制') {
|
||||
this.inventoryForm.editInventory = this.inventoryForm.editInventory+1
|
||||
}
|
||||
updateGiftInventoryApi(this.inventoryForm).then(res=>{
|
||||
|
||||
this.getList();
|
||||
})
|
||||
|
||||
this.openInventory = false
|
||||
|
||||
this.resInventoryForm()
|
||||
|
||||
},
|
||||
|
||||
resInventoryForm() {
|
||||
this.inventoryForm = {
|
||||
inventoryFlag: 0,
|
||||
remainingInventory: null, // 剩余库存
|
||||
totalInventory: null, //总库存
|
||||
usedInventory: null, // 已用库存
|
||||
editInventory: null,
|
||||
flag: false,
|
||||
id:''
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// 新增
|
||||
giftAdd() {
|
||||
@ -734,6 +842,14 @@ export default {
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
|
||||
// 取消按钮
|
||||
cancelInventory() {
|
||||
this.openInventory = false;
|
||||
this.resInventoryForm()
|
||||
|
||||
|
||||
},
|
||||
// 搜索按钮操作
|
||||
handleQuery() {
|
||||
@ -742,12 +858,10 @@ export default {
|
||||
},
|
||||
// 修改按钮
|
||||
handleUpdate(data) {
|
||||
console.log("1111111111111")
|
||||
let fileList = JSON.parse(data.giftImages);
|
||||
this.giftImages = [],
|
||||
|
||||
this.giftImages = fileList;
|
||||
console.log("22222222222222")
|
||||
|
||||
console.log( this.giftImages);
|
||||
|
||||
@ -800,11 +914,47 @@ export default {
|
||||
status: '启用',
|
||||
market:null
|
||||
}
|
||||
this.giftImages=[]
|
||||
|
||||
},
|
||||
|
||||
clickInventory(data) {
|
||||
alert("hello world")
|
||||
this.resInventoryForm()
|
||||
|
||||
this.openInventory = true
|
||||
this.inventoryForm.id = data.id
|
||||
|
||||
console.log("data.usedInventory",data.usedInventory)
|
||||
if (data.usedInventory == null || data.usedInventory == undefined) {
|
||||
this.inventoryForm.usedInventory = 0
|
||||
}else {
|
||||
this.inventoryForm.usedInventory = data.usedInventory
|
||||
}
|
||||
if (data.totalInventory == 0) {
|
||||
this.inventoryForm.totalInventory = 0
|
||||
this.inventoryForm.remainingInventory = 0
|
||||
}else if (data.totalInventory === -1) {
|
||||
this.inventoryForm.flag = true
|
||||
this.inventoryForm.totalInventory = '无限制'
|
||||
this.inventoryForm.remainingInventory = '无限制'
|
||||
} else {
|
||||
this.inventoryForm.totalInventory = data.totalInventory
|
||||
this.inventoryForm.remainingInventory = data.totalInventory - data.usedInventory
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// inventoryForm: {
|
||||
// inventoryFlag: 0,
|
||||
// remainingInventory: null, // 剩余库存
|
||||
// totalInventory: null, //总库存
|
||||
// usedInventory: null, // 已用库存
|
||||
// editInventory: null,
|
||||
|
||||
// id:''
|
||||
// },
|
||||
},
|
||||
|
||||
|
||||
@ -923,12 +1073,13 @@ export default {
|
||||
},
|
||||
// 上传详情图
|
||||
handleUploadSuccessGift(file) {
|
||||
|
||||
console.log("aaa",file)
|
||||
let newImage = {
|
||||
name: file.data.original,
|
||||
url: process.env.VUE_APP_SERVER_URL + file.data.fileName,
|
||||
type: file.data.type
|
||||
};
|
||||
type: file.data.type,
|
||||
fileName: file.data.fileName
|
||||
}
|
||||
console.log("giftImages",this.giftImages)
|
||||
if (this.giftImages == undefined) {
|
||||
this.giftImages = [];
|
||||
@ -988,13 +1139,13 @@ export default {
|
||||
this.$refs.tables.toggleRowSelection(row); // 选中当前点击的行
|
||||
// 处理选中的行数据
|
||||
console.log("row",row)
|
||||
console.log()
|
||||
this.dataForm.goodsName = row.name
|
||||
this.dataForm.goodsId = row.id
|
||||
|
||||
},
|
||||
getCommodity() {
|
||||
this.openCommodity = true
|
||||
|
||||
},
|
||||
// 查询搜索列表信息
|
||||
getQueryList(){
|
||||
|
58
fuintAdmin/src/views/integral/order/detail.vue
Normal file
58
fuintAdmin/src/views/integral/order/detail.vue
Normal file
@ -0,0 +1,58 @@
|
||||
<template>
|
||||
<div class="">
|
||||
<el-descriptions class="margin-top" title="带边框列表" :column="3" border>
|
||||
<template slot="extra">
|
||||
<el-button type="primary" size="small">操作</el-button>
|
||||
</template>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-user"></i>
|
||||
用户名
|
||||
</template>
|
||||
kooriookami
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-mobile-phone"></i>
|
||||
手机号
|
||||
</template>
|
||||
18100000000
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-location-outline"></i>
|
||||
居住地
|
||||
</template>
|
||||
苏州市
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-tickets"></i>
|
||||
备注
|
||||
</template>
|
||||
<el-tag size="small">学校</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-office-building"></i>
|
||||
联系地址
|
||||
</template>
|
||||
江苏省苏州市吴中区吴中大道 1188 号
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "detail",
|
||||
props: {
|
||||
dataForm:{},
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
69
fuintAdmin/src/views/integral/order/index.vue
Normal file
69
fuintAdmin/src/views/integral/order/index.vue
Normal file
@ -0,0 +1,69 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<el-tabs class="st-tab" v-model="activeName" type="card" @tab-click="handleClick">
|
||||
<el-tab-pane class="st-tab2" label="积分商城订单" name="first">
|
||||
<el-alert
|
||||
title="当前页面订单为油站小程序端用户在积分商城兑换的订单记录,如有付款金额,付款订单请在增值性订单列表中查看,类型为:积分商城"
|
||||
:closable="false"
|
||||
type="error">
|
||||
</el-alert>
|
||||
<points-mall></points-mall>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="积分收银台订单" name="second">
|
||||
<el-alert
|
||||
title="PC积分收银台在线兑换订单记录,收银台订单无需确认操作,如有付款金额,付款订单请在增值性订单列表中查看,类型为:积分收银"
|
||||
:closable="false"
|
||||
type="error">
|
||||
</el-alert>
|
||||
<points-cashier></points-cashier>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import PointsMall from '@/views/integral/order/pointsMall'
|
||||
import PointsCashier from "@/views/integral/order/pointsCashier";
|
||||
|
||||
export default {
|
||||
name: "index",
|
||||
components: {PointsCashier, PointsMall},
|
||||
data() {
|
||||
return {
|
||||
activeName:'first',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClick(tab, event) {
|
||||
console.log(tab, event);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.st-tab {
|
||||
padding: 0px;
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
.st-tab2 {
|
||||
/* background-color: #00aaff */
|
||||
}
|
||||
/deep/ .el-tabs__header {
|
||||
padding: 0;
|
||||
position: relative;
|
||||
margin: 0 0 0px !important;
|
||||
}
|
||||
/deep/ .el-tabs--card>.el-tabs__header .el-tabs__nav {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
/deep/ .el-tabs--card>.el-tabs__header .el-tabs__item {
|
||||
border-bottom-color: #E4E7ED;
|
||||
}
|
||||
/* .is-active */
|
||||
</style>
|
||||
|
184
fuintAdmin/src/views/integral/order/pointsCashier.vue
Normal file
184
fuintAdmin/src/views/integral/order/pointsCashier.vue
Normal file
@ -0,0 +1,184 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card >
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px">
|
||||
<el-form-item label="礼品名称" prop="giftName">
|
||||
<el-input
|
||||
v-model="queryParams.giftName"
|
||||
placeholder="请输入供应商名称"
|
||||
clearable
|
||||
style="width: 240px;"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="queryParams.status" style="width: 217px" placeholder="全部" clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.zhzt"
|
||||
:key="dict.label"
|
||||
:label="dict.label"
|
||||
:value="dict.label"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
|
||||
<el-card style="margin-top: 20px;" >
|
||||
<div style="margin-bottom : 10px">
|
||||
<span class="font-number">统计</span>
|
||||
</div>
|
||||
<el-row :gutter="10" class="mb8" >
|
||||
<el-col :span="2.5">
|
||||
<div class="box">
|
||||
<span class="font-chinese">笔数</span>
|
||||
<span class="font-number">1234</span>
|
||||
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="2.5">
|
||||
<div class="box">
|
||||
<span class="font-chinese">商品数量</span>
|
||||
<span class="font-number">12334</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="2.5">
|
||||
<div class="box">
|
||||
<span class="font-chinese">积分</span>
|
||||
<span class="font-number">0</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<div class="box">
|
||||
<span class="font-chinese">支付总额</span>
|
||||
<span class="font-number">0</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<el-card style="margin-top: 20px" >
|
||||
<el-table ref="tables"
|
||||
v-loading="loading"
|
||||
:data="dataList"
|
||||
:default-sort="defaultSort">
|
||||
<el-table-column label="用户手机号" align="center" prop="mobile"/>
|
||||
<el-table-column label="订单号" align="center" prop="orderNumber"/>
|
||||
<el-table-column label="商品信息" align="center" prop="" >
|
||||
<el-table-column label="简述" align="center" prop="categoryName" />
|
||||
<el-table-column label="商品" align="center" prop="giftName" />
|
||||
</el-table-column>
|
||||
<el-table-column label="实付信息" align="center" >
|
||||
<el-table-column label="积分" align="center" prop="integral" width=""/>
|
||||
<el-table-column label="支付金额" align="center" prop="amount" width=""/>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status" width=""/>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width=""/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>订单详情</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>处理订单</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.page"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getOrderApi} from "@/api/integral/order";
|
||||
|
||||
export default {
|
||||
name: "pointsCashier",
|
||||
dicts: ['zhzt','lplx','redemptionMethod','expressShippingCosts','shippingMethod'],
|
||||
|
||||
data() {
|
||||
return {
|
||||
dataList:[],
|
||||
queryParams: {
|
||||
giftName: '',
|
||||
status: '',
|
||||
page:null,
|
||||
pageSize:null
|
||||
},
|
||||
loading: false,
|
||||
defaultSort: {prop: 'createTime', order: 'descending'},
|
||||
|
||||
total: 0,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList(){
|
||||
getOrderApi().then(res=>{
|
||||
this.dataList = res.data.records
|
||||
})
|
||||
},
|
||||
|
||||
handleUpdate(){},
|
||||
handleQuery(){},
|
||||
resetQuery(){},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.app-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f6f8f9;
|
||||
padding-top: 0px;
|
||||
padding: 0px
|
||||
}
|
||||
.box {
|
||||
padding: 10px;
|
||||
height: 80px;
|
||||
width: 150px;
|
||||
margin-right: 0px;
|
||||
background-color: rgba(204, 204, 204, 0.3);
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: left;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.font-chinese {
|
||||
font-size: 15px;
|
||||
font-family:Microsoft YaHei;
|
||||
font-weight: bold;
|
||||
line-height:1.5
|
||||
}
|
||||
.font-number {
|
||||
font-size: 20px;
|
||||
font-family: PingFang SC,sans-serif;
|
||||
font-weight: bold;
|
||||
line-height:1.3
|
||||
}
|
||||
</style>
|
201
fuintAdmin/src/views/integral/order/pointsMall.vue
Normal file
201
fuintAdmin/src/views/integral/order/pointsMall.vue
Normal file
@ -0,0 +1,201 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card >
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px">
|
||||
<el-form-item label="礼品名称" prop="giftName">
|
||||
<el-input
|
||||
v-model="queryParams.giftName"
|
||||
placeholder="请输入供应商名称"
|
||||
clearable
|
||||
style="width: 240px;"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="queryParams.status" style="width: 217px" placeholder="全部" clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.zhzt"
|
||||
:key="dict.label"
|
||||
:label="dict.label"
|
||||
:value="dict.label"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
|
||||
<el-card style="margin-top: 20px" >
|
||||
|
||||
|
||||
<el-tabs v-model="activeName" @tab-click="handleClick">
|
||||
|
||||
|
||||
<el-tab-pane label="全部订单" name="first">
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="待处理/待发货" name="second">
|
||||
<span slot="label">待处理/待发货<el-badge class="mark" :value="12" /></span>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="已完成/已发货" name="third">
|
||||
<span slot="label">已完成/已发货<el-badge class="mark" :value="12" /></span>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="已拒绝/已退款" name="fourth">
|
||||
<span slot="label">已拒绝/已退款<el-badge class="mark" :value="12" /></span>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="未付款订单" name="five">
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
|
||||
<el-table ref="tables"
|
||||
style="margin-top: 15px"
|
||||
v-loading="loading"
|
||||
:data="dataList"
|
||||
:default-sort="defaultSort">
|
||||
<el-table-column type="expand">
|
||||
<template slot-scope="props">
|
||||
<el-form style="margin-left : 20px" label-position="left" inline class="demo-table-expand">
|
||||
<el-form-item label="订单号">
|
||||
<span>{{ props.row.orderNumber }}</span>
|
||||
</el-form-item>
|
||||
<br>
|
||||
<el-form-item label="用户编号">
|
||||
<span>{{ props.row.userNo }}</span>
|
||||
</el-form-item>
|
||||
<br>
|
||||
|
||||
<el-form-item label="用户名称">
|
||||
<span>{{ props.row.name }}</span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="用户手机号" align="center" prop="mobile"/>
|
||||
<el-table-column label="商品信息" align="center" prop="categoryName" >
|
||||
<el-table-column label="名称" align="center" prop="giftName" />
|
||||
<el-table-column label="图片" align="center" prop="coverImage">
|
||||
<template slot-scope="scope">
|
||||
<el-image
|
||||
style="width: 50px; height: 50px"
|
||||
:src="imagePath+scope.row.coverImage"
|
||||
:preview-src-list="[imagePath + scope.row.coverImage]"
|
||||
fit="cover">
|
||||
</el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="配送类型" align="center" prop="shippingType"/>
|
||||
<el-table-column label="实付信息" align="center" prop="categoryName" >
|
||||
<el-table-column label="积分" align="center" prop="integral" width=""/>
|
||||
<el-table-column label="金额" align="center" prop="amount" width=""/>
|
||||
</el-table-column>
|
||||
<el-table-column label="兑换数量" align="center" prop="exchangeQuantity" width=""/>
|
||||
<el-table-column label="订单状态" align="center" prop="orderStatus" width=""/>
|
||||
<el-table-column label="订单时间信息" align="center" prop="categoryName" width="">
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width=""/>
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" width=""/>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleDetail(scope.row)"
|
||||
>订单详情</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>处理订单</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.page"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
<el-dialog title="订单详情" :visible.sync="openDetail" width="500px" append-to-body :close-on-click-modal="false">
|
||||
<detail></detail>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getOrderApi,getStatisticsApi} from "@/api/integral/order";
|
||||
import Detail from '@/views/integral/order/detail'
|
||||
|
||||
export default {
|
||||
name: "pointsMall",
|
||||
components: {Detail},
|
||||
dicts: ['zhzt','lplx','redemptionMethod','expressShippingCosts','shippingMethod'],
|
||||
|
||||
data() {
|
||||
return {
|
||||
dataList:[],
|
||||
dataFrom:{},
|
||||
// 图片根目录
|
||||
imagePath: process.env.VUE_APP_SERVER_URL,
|
||||
queryParams: {
|
||||
giftName: '',
|
||||
status: '',
|
||||
page:null,
|
||||
pageSize:null
|
||||
},
|
||||
total: 0,
|
||||
loading: false,
|
||||
openDetail: false, // 订单详情
|
||||
defaultSort: {prop: 'createTime', order: 'descending'},
|
||||
|
||||
activeName: 'first',
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList(){
|
||||
getOrderApi().then(res=>{
|
||||
this.dataList = res.data.records
|
||||
})
|
||||
|
||||
getStatisticsApi().then(res=>{
|
||||
|
||||
})
|
||||
},
|
||||
handleUpdate(){},
|
||||
handleDetail(data){
|
||||
this.openDetail = true
|
||||
},
|
||||
handleQuery(){},
|
||||
resetQuery(){},
|
||||
|
||||
handleClick(tab, event) {
|
||||
console.log(tab, event);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.app-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f6f8f9;
|
||||
padding-top: 0px;
|
||||
padding: 0px
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
@ -38,7 +38,7 @@ images.root=C:/fuintV3.0.1/fuintBackend/fuint-application/target/classes
|
||||
images.path=/static/uploadImages/
|
||||
|
||||
# 上传图片服务器域名
|
||||
images.upload.url=http://localhost:8080
|
||||
images.upload.url=http://localhost:8008
|
||||
|
||||
# 上传图片允许的大小(单位:MB)
|
||||
images.upload.maxSize=5
|
||||
|
@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@ -38,6 +39,12 @@ public class LJGoodsController extends BaseController {
|
||||
return getSuccessResult(list);
|
||||
}
|
||||
|
||||
@GetMapping("/queryList")
|
||||
public ResponseObject queryList(){
|
||||
List<LJGoods> goods = goodsService.selectGoodsList();
|
||||
return getSuccessResult(goods);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品信息
|
||||
* @param id
|
||||
|
@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fuint.business.convenienceSore.entity.LJGoods;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品信息 业务层
|
||||
*/
|
||||
@ -17,6 +19,12 @@ public interface LJGoodsService extends IService<LJGoods> {
|
||||
*/
|
||||
public IPage<LJGoods> selectLJGoodsList(Page page, LJGoods goods);
|
||||
|
||||
/**
|
||||
* 查询所有商品列表信息
|
||||
* @return
|
||||
*/
|
||||
public List<LJGoods> selectGoodsList();
|
||||
|
||||
/**
|
||||
* 根据id查询商品信息
|
||||
* @param id
|
||||
|
@ -18,6 +18,7 @@ import com.fuint.common.util.TokenUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
@ -44,6 +45,17 @@ public class LJGoodsServiceImpl extends ServiceImpl<LJGoodsMapper, LJGoods> impl
|
||||
return goodsIPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LJGoods> selectGoodsList() {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
Integer storeId = nowAccountInfo.getStoreId();
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("is_recovery",0);
|
||||
queryWrapper.eq("store_id",storeId);
|
||||
List list = baseMapper.selectList(queryWrapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品信息
|
||||
* @param id
|
||||
|
@ -88,5 +88,17 @@ public class IntegralGiftController extends BaseController {
|
||||
return getSuccessResult(this.integralGiftService.deleteById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 单独修改商品的库存
|
||||
* @param id
|
||||
* @param editInventory
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("updateInventory")
|
||||
public ResponseObject updateInventory(@Param("id") Integer id,@Param("editInventory") Integer editInventory) {
|
||||
return getSuccessResult(this.integralGiftService.updateInventory(id,editInventory));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,99 @@
|
||||
package com.fuint.business.integral.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.integral.entity.IntegralOrders;
|
||||
import com.fuint.business.integral.service.IntegralOrdersService;
|
||||
import com.fuint.business.integral.vo.IntegralOrdersVO;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 存储兑换订单信息(IntegralOrders)表控制层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-07 13:59:23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("business/integral/integralOrders")
|
||||
public class IntegralOrdersController extends BaseController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Resource
|
||||
private IntegralOrdersService integralOrdersService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param integralOrders 筛选条件
|
||||
* @param pageNo 分页对象
|
||||
* @return 查询结果
|
||||
*/
|
||||
@GetMapping("queryByPage")
|
||||
public ResponseObject queryByPage(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
|
||||
@Param("integralOrders") IntegralOrders integralOrders) {
|
||||
Page page = new Page(pageNo, pageSize);
|
||||
IPage<IntegralOrdersVO> integralOrdersIPage = this.integralOrdersService.queryByPage(page, integralOrders);
|
||||
return getSuccessResult(integralOrdersIPage);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 单条数据
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
public ResponseObject queryById(@PathVariable("id") Integer id) {
|
||||
return getSuccessResult(this.integralOrdersService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param integralOrders 实体
|
||||
* @return 新增结果
|
||||
*/
|
||||
@PostMapping
|
||||
public ResponseObject add(IntegralOrders integralOrders) {
|
||||
return getSuccessResult(this.integralOrdersService.insert(integralOrders));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑数据
|
||||
*
|
||||
* @param integralOrders 实体
|
||||
* @return 编辑结果
|
||||
*/
|
||||
@PutMapping
|
||||
public ResponseObject edit(IntegralOrders integralOrders) {
|
||||
return getSuccessResult(this.integralOrdersService.update(integralOrders));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 删除是否成功
|
||||
*/
|
||||
@DeleteMapping
|
||||
public ResponseObject deleteById(Integer id) {
|
||||
return getSuccessResult(this.integralOrdersService.deleteById(id));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/statistics")
|
||||
public ResponseObject statistics() {
|
||||
return getSuccessResult(this.integralOrdersService.statistics());
|
||||
}
|
||||
}
|
||||
|
@ -63,6 +63,8 @@ public class IntegralGift extends BaseEntity {
|
||||
* 礼品剩余库存
|
||||
*/
|
||||
private Integer remainingInventory;
|
||||
|
||||
private Integer usedInventory;
|
||||
/**
|
||||
* 商家卡券
|
||||
*/
|
||||
@ -79,6 +81,10 @@ public class IntegralGift extends BaseEntity {
|
||||
* 加钱比例
|
||||
*/
|
||||
private Double moneyRatio;
|
||||
/**
|
||||
* 市场价格
|
||||
*/
|
||||
private Double market;
|
||||
/**
|
||||
* 兑换金额
|
||||
*/
|
||||
@ -94,7 +100,7 @@ public class IntegralGift extends BaseEntity {
|
||||
/**
|
||||
* 快递运费
|
||||
*/
|
||||
private Double expressShippingFee;
|
||||
private String expressShippingFee;
|
||||
/**
|
||||
* 运费金额
|
||||
*/
|
||||
|
@ -0,0 +1,84 @@
|
||||
package com.fuint.business.integral.entity;
|
||||
|
||||
import com.fuint.framework.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 存储兑换订单信息(IntegralOrders)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-07 13:59:23
|
||||
*/
|
||||
@Data
|
||||
public class IntegralOrders extends BaseEntity {
|
||||
private static final long serialVersionUID = 181605029480746026L;
|
||||
/**
|
||||
* 兑换订单id(主键)
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 关联用户id
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
private String orderNumber;
|
||||
/**
|
||||
* 关联商品id
|
||||
*/
|
||||
private Integer giftId;
|
||||
/**
|
||||
* 配送类型
|
||||
*/
|
||||
private String shippingType;
|
||||
/**
|
||||
* 实付信息
|
||||
*/
|
||||
private Double paidInfo;
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
private Double amount;
|
||||
/**
|
||||
* 积分
|
||||
*/
|
||||
private Double integral;
|
||||
/**
|
||||
* 加油金
|
||||
*/
|
||||
private Double comeOn;
|
||||
/**
|
||||
* 兑换数量
|
||||
*/
|
||||
private Integer exchangeQuantity;
|
||||
/**
|
||||
* 订单状态
|
||||
*/
|
||||
private String orderStatus;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 订单类型
|
||||
*/
|
||||
private String orderType;
|
||||
/**
|
||||
* 处理结果
|
||||
*/
|
||||
private String processingResult;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String notes;
|
||||
/**
|
||||
* 店铺ID
|
||||
*/
|
||||
private Integer storeId;
|
||||
|
||||
}
|
||||
|
@ -83,5 +83,8 @@ public interface IntegralGiftMapper {
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
|
||||
int updateInventory(@Param("id") Integer id,@Param("editInventory") Integer editInventory,@Param("updateBy") Integer updateBy);
|
||||
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,95 @@
|
||||
package com.fuint.business.integral.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.integral.entity.IntegralGift;
|
||||
import com.fuint.business.integral.entity.IntegralOrders;
|
||||
import com.fuint.business.integral.vo.IntegralGiftVO;
|
||||
import com.fuint.business.integral.vo.IntegralOrdersVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 存储兑换订单信息(IntegralOrders)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-07 13:59:23
|
||||
*/
|
||||
public interface IntegralOrdersMapper {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
IntegralOrders queryById(Integer id);
|
||||
|
||||
/**
|
||||
* 查询指定行数据
|
||||
*
|
||||
* @param integralOrders 查询条件
|
||||
* @param page 分页对象
|
||||
* @return 对象列表
|
||||
*/
|
||||
IPage<IntegralOrdersVO> queryAllByLimit(@Param("page") Page page, @Param("integralOrders") IntegralOrders integralOrders);
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
*
|
||||
* @param integralOrders 查询条件
|
||||
* @return 总行数
|
||||
*/
|
||||
long count(IntegralOrders integralOrders);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param integralOrders 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(IntegralOrders integralOrders);
|
||||
|
||||
/**
|
||||
* 批量新增数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<IntegralOrders> 实例对象列表
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insertBatch(@Param("entities") List<IntegralOrders> entities);
|
||||
|
||||
/**
|
||||
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<IntegralOrders> 实例对象列表
|
||||
* @return 影响行数
|
||||
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
|
||||
*/
|
||||
int insertOrUpdateBatch(@Param("entities") List<IntegralOrders> entities);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param integralOrders 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(IntegralOrders integralOrders);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Integer id);
|
||||
|
||||
/**
|
||||
* 统计数据
|
||||
* @return
|
||||
*/
|
||||
Map<String, String> statistics();
|
||||
|
||||
}
|
||||
|
@ -33,6 +33,8 @@
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="createBy" column="create_by" jdbcType="INTEGER"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="INTEGER"/>
|
||||
<result property="usedInventory" column="used_inventory" jdbcType="INTEGER"/>
|
||||
<result property="market" column="market" jdbcType="NUMERIC"/>
|
||||
|
||||
<!-- outher-->
|
||||
<result property="categoryName" column="category_name" jdbcType="VARCHAR"/>
|
||||
@ -84,6 +86,7 @@
|
||||
ig.update_time,
|
||||
ig.create_by,
|
||||
ig.update_by,
|
||||
ig.used_inventory,
|
||||
igc.category_name
|
||||
from integral_gift ig
|
||||
left join integral_gift_category igc ON ig.category_id = igc.id
|
||||
@ -239,8 +242,8 @@
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into integral_gift(gift_name, category_id, cover_image, gift_images, gift_type, coupon_id, voucher_id, goods_id, gift_quantity, total_inventory, remaining_inventory, merchant_coupon_id, exchange_method, exchange_points, money_ratio, exchange_amount, exchange_fuel_amount, delivery_method, express_shipping_fee, shipping_fee_amount, exchange_times, sort, status, detailed_description, store_id, create_time, update_time, create_by, update_by)
|
||||
values (#{giftName}, #{categoryId}, #{coverImage}, #{giftImages}, #{giftType}, #{couponId}, #{voucherId}, #{goodsId}, #{giftQuantity}, #{totalInventory}, #{remainingInventory}, #{merchantCouponId}, #{exchangeMethod}, #{exchangePoints}, #{moneyRatio}, #{exchangeAmount}, #{exchangeFuelAmount}, #{deliveryMethod}, #{expressShippingFee}, #{shippingFeeAmount}, #{exchangeTimes}, #{sort}, #{status}, #{detailedDescription}, #{storeId}, #{createTime}, #{createTime}, #{createBy}, #{updateBy})
|
||||
insert into integral_gift(gift_name, category_id, cover_image, gift_images, gift_type, coupon_id, voucher_id, goods_id, gift_quantity, total_inventory, remaining_inventory, merchant_coupon_id, exchange_method, exchange_points, money_ratio, exchange_amount, exchange_fuel_amount, delivery_method, express_shipping_fee, shipping_fee_amount, exchange_times, sort, status, detailed_description, store_id, create_time, update_time, create_by, update_by,market)
|
||||
values (#{giftName}, #{categoryId}, #{coverImage}, #{giftImages}, #{giftType}, #{couponId}, #{voucherId}, #{goodsId}, #{giftQuantity}, #{totalInventory}, #{remainingInventory}, #{merchantCouponId}, #{exchangeMethod}, #{exchangePoints}, #{moneyRatio}, #{exchangeAmount}, #{exchangeFuelAmount}, #{deliveryMethod}, #{expressShippingFee}, #{shippingFeeAmount}, #{exchangeTimes}, #{sort}, #{status}, #{detailedDescription}, #{storeId}, #{createTime}, #{createTime}, #{createBy}, #{updateBy},#{market})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
@ -380,6 +383,9 @@
|
||||
<if test="updateBy != null">
|
||||
update_by = #{updateBy},
|
||||
</if>
|
||||
<if test="market != null">
|
||||
market = #{market},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
@ -389,5 +395,14 @@
|
||||
delete from integral_gift where id = #{id}
|
||||
</delete>
|
||||
|
||||
<update id="updateInventory">
|
||||
update integral_gift
|
||||
set
|
||||
total_inventory = total_inventory + #{editInventory},
|
||||
update_by = #{updateBy},
|
||||
update_time = NOW()
|
||||
where id =#{id}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
@ -0,0 +1,301 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fuint.business.integral.mapper.IntegralOrdersMapper">
|
||||
|
||||
<resultMap type="com.fuint.business.integral.vo.IntegralOrdersVO" id="IntegralOrdersMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="userId" column="user_id" jdbcType="INTEGER"/>
|
||||
<result property="orderNumber" column="order_number" jdbcType="VARCHAR"/>
|
||||
<result property="giftId" column="gift_id" jdbcType="INTEGER"/>
|
||||
<result property="shippingType" column="shipping_type" jdbcType="VARCHAR"/>
|
||||
<result property="paidInfo" column="paid_info" jdbcType="NUMERIC"/>
|
||||
<result property="amount" column="amount" jdbcType="NUMERIC"/>
|
||||
<result property="integral" column="integral" jdbcType="NUMERIC"/>
|
||||
<result property="comeOn" column="come_on" jdbcType="NUMERIC"/>
|
||||
<result property="exchangeQuantity" column="exchange_quantity" jdbcType="INTEGER"/>
|
||||
<result property="orderStatus" column="order_status" jdbcType="VARCHAR"/>
|
||||
<result property="status" column="status" jdbcType="VARCHAR"/>
|
||||
<result property="orderType" column="order_type" jdbcType="VARCHAR"/>
|
||||
<result property="processingResult" column="processing_result" jdbcType="VARCHAR"/>
|
||||
<result property="notes" column="notes" jdbcType="VARCHAR"/>
|
||||
<result property="storeId" column="store_id" jdbcType="INTEGER"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="createBy" column="create_by" jdbcType="INTEGER"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="INTEGER"/>
|
||||
|
||||
<!-- outher-->
|
||||
<result property="mobile" column="mobile" jdbcType="VARCHAR"/>
|
||||
<result property="userNo" column="user_no" jdbcType="VARCHAR"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||
<result property="giftName" column="gift_name" jdbcType="VARCHAR"/>
|
||||
<result property="coverImage" column="cover_image" jdbcType="VARCHAR"/>
|
||||
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="IntegralOrdersMap">
|
||||
select
|
||||
id, user_id, order_number, gift_id, shipping_type, paid_info, amount, integral, come_on, exchange_quantity, order_status, status, order_type, processing_result, notes, store_id, create_time, update_time, create_by, update_by
|
||||
from integral_orders
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="IntegralOrdersMap">
|
||||
select
|
||||
io.id,
|
||||
io.user_id,
|
||||
io.order_number,
|
||||
io.gift_id,
|
||||
io.shipping_type,
|
||||
io.amount,
|
||||
io.integral,
|
||||
io.come_on,
|
||||
io.exchange_quantity,
|
||||
io.order_status,
|
||||
io.status,
|
||||
io.order_type,
|
||||
io.processing_result,
|
||||
io.notes,
|
||||
io.store_id,
|
||||
io.create_time,
|
||||
io.update_time,
|
||||
mu.mobile,
|
||||
mu.user_no,
|
||||
mu.name,
|
||||
ig.gift_name,
|
||||
ig.cover_image
|
||||
from integral_orders io
|
||||
left join mt_user mu ON io.user_id = mu.id
|
||||
left join integral_gift ig ON io.gift_id = ig.id
|
||||
<where>
|
||||
<if test="integralOrders.id != null">
|
||||
and io.id = #{integralOrders.id}
|
||||
</if>
|
||||
<if test="integralOrders.userId != null">
|
||||
and io.user_id = #{integralOrders.userId}
|
||||
</if>
|
||||
<if test="integralOrders.orderNumber != null and integralOrders.orderNumber != ''">
|
||||
and io.order_number = #{integralOrders.orderNumber}
|
||||
</if>
|
||||
<if test="integralOrders.giftId != null">
|
||||
and io.gift_id = #{integralOrders.giftId}
|
||||
</if>
|
||||
<if test="integralOrders.shippingType != null and integralOrders.shippingType != ''">
|
||||
and io.shipping_type = #{integralOrders.shippingType}
|
||||
</if>
|
||||
<if test="integralOrders.exchangeQuantity != null">
|
||||
and io.exchange_quantity = #{integralOrders.exchangeQuantity}
|
||||
</if>
|
||||
<if test="integralOrders.orderStatus != null and integralOrders.orderStatus != ''">
|
||||
and io.order_status = #{integralOrders.orderStatus}
|
||||
</if>
|
||||
<if test="integralOrders.status != null and integralOrders.status != ''">
|
||||
and io.status = #{integralOrders.status}
|
||||
</if>
|
||||
<if test="integralOrders.orderType != null and integralOrders.orderType != ''">
|
||||
and io.order_type = #{integralOrders.orderType}
|
||||
</if>
|
||||
<if test="integralOrders.processingResult != null and integralOrders.processingResult != ''">
|
||||
and io.processing_result = #{integralOrders.processingResult}
|
||||
</if>
|
||||
<if test="integralOrders.storeId != null">
|
||||
and io.store_id = #{integralOrders.storeId}
|
||||
</if>
|
||||
<if test="integralOrders.createTime != null">
|
||||
and io.create_time = #{integralOrders.createTime}
|
||||
</if>
|
||||
<if test="integralOrders.updateTime != null">
|
||||
and io.update_time = #{integralOrders.updateTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from integral_orders
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
and user_id = #{userId}
|
||||
</if>
|
||||
<if test="orderNumber != null and orderNumber != ''">
|
||||
and order_number = #{orderNumber}
|
||||
</if>
|
||||
<if test="giftId != null">
|
||||
and gift_id = #{giftId}
|
||||
</if>
|
||||
<if test="shippingType != null and shippingType != ''">
|
||||
and shipping_type = #{shippingType}
|
||||
</if>
|
||||
<if test="paidInfo != null">
|
||||
and paid_info = #{paidInfo}
|
||||
</if>
|
||||
<if test="amount != null">
|
||||
and amount = #{amount}
|
||||
</if>
|
||||
<if test="integral != null">
|
||||
and integral = #{integral}
|
||||
</if>
|
||||
<if test="comeOn != null">
|
||||
and come_on = #{comeOn}
|
||||
</if>
|
||||
<if test="exchangeQuantity != null">
|
||||
and exchange_quantity = #{exchangeQuantity}
|
||||
</if>
|
||||
<if test="orderStatus != null and orderStatus != ''">
|
||||
and order_status = #{orderStatus}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
and status = #{status}
|
||||
</if>
|
||||
<if test="orderType != null and orderType != ''">
|
||||
and order_type = #{orderType}
|
||||
</if>
|
||||
<if test="processingResult != null and processingResult != ''">
|
||||
and processing_result = #{processingResult}
|
||||
</if>
|
||||
<if test="notes != null and notes != ''">
|
||||
and notes = #{notes}
|
||||
</if>
|
||||
<if test="storeId != null">
|
||||
and store_id = #{storeId}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
and create_time = #{createTime}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
and create_by = #{createBy}
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="statistics" resultType="java.util.Map">
|
||||
select count(0) a,
|
||||
count(*) b
|
||||
from integral_orders
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into integral_orders(user_id, order_number, gift_id, shipping_type, paid_info, amount, integral, come_on, exchange_quantity, order_status, status, order_type, processing_result, notes, store_id, create_time, update_time, create_by, update_by)
|
||||
values (#{userId}, #{orderNumber}, #{giftId}, #{shippingType}, #{paidInfo}, #{amount}, #{integral}, #{comeOn}, #{exchangeQuantity}, #{orderStatus}, #{status}, #{orderType}, #{processingResult}, #{notes}, #{storeId}, #{createTime}, #{updateTime}, #{createBy}, #{updateBy})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into integral_orders(user_id, order_number, gift_id, shipping_type, paid_info, amount, integral, come_on, exchange_quantity, order_status, status, order_type, processing_result, notes, store_id, create_time, update_time, create_by, update_by)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.userId}, #{entity.orderNumber}, #{entity.giftId}, #{entity.shippingType}, #{entity.paidInfo}, #{entity.amount}, #{entity.integral}, #{entity.comeOn}, #{entity.exchangeQuantity}, #{entity.orderStatus}, #{entity.status}, #{entity.orderType}, #{entity.processingResult}, #{entity.notes}, #{entity.storeId}, #{entity.createTime}, #{entity.updateTime}, #{entity.createBy}, #{entity.updateBy})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into integral_orders(user_id, order_number, gift_id, shipping_type, paid_info, amount, integral, come_on, exchange_quantity, order_status, status, order_type, processing_result, notes, store_id, create_time, update_time, create_by, update_by)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.userId}, #{entity.orderNumber}, #{entity.giftId}, #{entity.shippingType}, #{entity.paidInfo}, #{entity.amount}, #{entity.integral}, #{entity.comeOn}, #{entity.exchangeQuantity}, #{entity.orderStatus}, #{entity.status}, #{entity.orderType}, #{entity.processingResult}, #{entity.notes}, #{entity.storeId}, #{entity.createTime}, #{entity.updateTime}, #{entity.createBy}, #{entity.updateBy})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
user_id = values(user_id),
|
||||
order_number = values(order_number),
|
||||
gift_id = values(gift_id),
|
||||
shipping_type = values(shipping_type),
|
||||
paid_info = values(paid_info),
|
||||
amount = values(amount),
|
||||
integral = values(integral),
|
||||
come_on = values(come_on),
|
||||
exchange_quantity = values(exchange_quantity),
|
||||
order_status = values(order_status),
|
||||
status = values(status),
|
||||
order_type = values(order_type),
|
||||
processing_result = values(processing_result),
|
||||
notes = values(notes),
|
||||
store_id = values(store_id),
|
||||
create_time = values(create_time),
|
||||
update_time = values(update_time),
|
||||
create_by = values(create_by),
|
||||
update_by = values(update_by)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update integral_orders
|
||||
<set>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId},
|
||||
</if>
|
||||
<if test="orderNumber != null and orderNumber != ''">
|
||||
order_number = #{orderNumber},
|
||||
</if>
|
||||
<if test="giftId != null">
|
||||
gift_id = #{giftId},
|
||||
</if>
|
||||
<if test="shippingType != null and shippingType != ''">
|
||||
shipping_type = #{shippingType},
|
||||
</if>
|
||||
<if test="paidInfo != null">
|
||||
paid_info = #{paidInfo},
|
||||
</if>
|
||||
<if test="amount != null">
|
||||
amount = #{amount},
|
||||
</if>
|
||||
<if test="integral != null">
|
||||
integral = #{integral},
|
||||
</if>
|
||||
<if test="comeOn != null">
|
||||
come_on = #{comeOn},
|
||||
</if>
|
||||
<if test="exchangeQuantity != null">
|
||||
exchange_quantity = #{exchangeQuantity},
|
||||
</if>
|
||||
<if test="orderStatus != null and orderStatus != ''">
|
||||
order_status = #{orderStatus},
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
status = #{status},
|
||||
</if>
|
||||
<if test="orderType != null and orderType != ''">
|
||||
order_type = #{orderType},
|
||||
</if>
|
||||
<if test="processingResult != null and processingResult != ''">
|
||||
processing_result = #{processingResult},
|
||||
</if>
|
||||
<if test="notes != null and notes != ''">
|
||||
notes = #{notes},
|
||||
</if>
|
||||
<if test="storeId != null">
|
||||
store_id = #{storeId},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
create_by = #{createBy},
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
update_by = #{updateBy},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete from integral_orders where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
@ -57,4 +57,12 @@ public interface IntegralGiftService {
|
||||
*/
|
||||
boolean deleteById(Integer id);
|
||||
|
||||
/**
|
||||
* 单独修改商品的库存
|
||||
* @param id
|
||||
* @param editInventory
|
||||
* @return
|
||||
*/
|
||||
boolean updateInventory(@Param("id") Integer id,@Param("editInventory") Integer editInventory);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,61 @@
|
||||
package com.fuint.business.integral.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.integral.entity.IntegralOrders;
|
||||
import com.fuint.business.integral.vo.IntegralOrdersVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 存储兑换订单信息(IntegralOrders)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-07 13:59:23
|
||||
*/
|
||||
public interface IntegralOrdersService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
IntegralOrders queryById(Integer id);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param integralOrders 筛选条件
|
||||
* @param page 分页对象
|
||||
* @return 查询结果
|
||||
*/
|
||||
IPage<IntegralOrdersVO> queryByPage(@Param("page") Page page, @Param("integralGift") IntegralOrders integralOrders);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param integralOrders 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
IntegralOrders insert(IntegralOrders integralOrders);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param integralOrders 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
IntegralOrders update(IntegralOrders integralOrders);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Integer id);
|
||||
Map<String, String> statistics();
|
||||
|
||||
}
|
@ -89,4 +89,17 @@ public class IntegralGiftServiceImpl implements IntegralGiftService {
|
||||
public boolean deleteById(Integer id) {
|
||||
return this.integralGiftDao.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 单独修改商品的库存
|
||||
* @param id
|
||||
* @param editInventory
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean updateInventory(@Param("id") Integer id,@Param("editInventory") Integer editInventory) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
return this.integralGiftDao.updateInventory(id,editInventory,nowAccountInfo.getStaffId()) > 0;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,96 @@
|
||||
package com.fuint.business.integral.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.fuint.business.integral.entity.IntegralGift;
|
||||
import com.fuint.business.integral.entity.IntegralOrders;
|
||||
import com.fuint.business.integral.mapper.IntegralOrdersMapper;
|
||||
import com.fuint.business.integral.service.IntegralOrdersService;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import com.fuint.business.integral.vo.IntegralGiftVO;
|
||||
import com.fuint.business.integral.vo.IntegralOrdersVO;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 存储兑换订单信息(IntegralOrders)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-07 13:59:23
|
||||
*/
|
||||
@Service("integralOrdersService")
|
||||
public class IntegralOrdersServiceImpl implements IntegralOrdersService {
|
||||
@Resource
|
||||
private IntegralOrdersMapper integralOrdersDao;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public IntegralOrders queryById(Integer id) {
|
||||
return this.integralOrdersDao.queryById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param integralOrders 筛选条件
|
||||
* @param page 分页对象
|
||||
* @return 查询结果
|
||||
*/
|
||||
@Override
|
||||
public IPage<IntegralOrdersVO> queryByPage(@Param("page") Page page, @Param("integralOrders") IntegralOrders integralOrders) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
integralOrders.setStoreId(nowAccountInfo.getStoreId());
|
||||
return integralOrdersDao.queryAllByLimit(page, integralOrders);
|
||||
}
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param integralOrders 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public IntegralOrders insert(IntegralOrders integralOrders) {
|
||||
this.integralOrdersDao.insert(integralOrders);
|
||||
return integralOrders;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param integralOrders 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public IntegralOrders update(IntegralOrders integralOrders) {
|
||||
this.integralOrdersDao.update(integralOrders);
|
||||
return this.queryById(integralOrders.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Integer id) {
|
||||
return this.integralOrdersDao.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> statistics() {
|
||||
return this.integralOrdersDao.statistics();
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.fuint.business.integral.vo;
|
||||
|
||||
|
||||
import com.fuint.business.integral.entity.IntegralOrders;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class IntegralOrdersVO extends IntegralOrders {
|
||||
private String mobile;
|
||||
private String userNo;
|
||||
private String name;
|
||||
private String giftName;
|
||||
private String coverImage;
|
||||
}
|
@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.member.entity.LJStaff;
|
||||
import com.fuint.business.member.service.ILJStaffService;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -56,6 +58,18 @@ public class LJStaffController extends BaseController {
|
||||
return getSuccessResult(staff);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据登录账户名查询员工信息
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/name")
|
||||
public ResponseObject staff(){
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
Integer staffId = nowAccountInfo.getStaffId();
|
||||
LJStaff staff = mtStaffService.selectStaffById(staffId);
|
||||
return getSuccessResult(staff);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询员工信息
|
||||
* @param map
|
||||
|
@ -0,0 +1,47 @@
|
||||
package com.fuint.business.order.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.order.entity.OilOrder;
|
||||
import com.fuint.business.order.service.OilOrderService;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/business/oilOrder")
|
||||
public class OilOrderController extends BaseController {
|
||||
@Autowired
|
||||
private OilOrderService orderService;
|
||||
|
||||
/**
|
||||
* 根据条件分页查询会员信息
|
||||
* @param order
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public ResponseObject list(OilOrder order,
|
||||
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
|
||||
Page page =new Page(pageNo,pageSize);
|
||||
IPage<OilOrder> list = orderService.selectOilOrderList(page,order);
|
||||
return getSuccessResult(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加订单信息
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping
|
||||
public ResponseObject add(@Validated @RequestBody Map<String,String> map){
|
||||
int row = orderService.insertOilOrder(map);
|
||||
return getSuccessResult(row);
|
||||
}
|
||||
}
|
@ -12,11 +12,14 @@ import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 订单表(MtOrder)实体类
|
||||
* 商品订单表(Order)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-07 15:04:17
|
||||
*/
|
||||
@Data
|
||||
@TableName("mt_order")
|
||||
@ApiModel(value = "LJOrder对象", description = "订单表")
|
||||
@ApiModel(value = "LJOrder对象", description = "商品订单表")
|
||||
public class LJOrder extends BaseEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ -26,14 +29,14 @@ public class LJOrder extends BaseEntity implements Serializable {
|
||||
@ApiModelProperty("自增ID")
|
||||
@TableId(value = "ID", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 订单类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 终端
|
||||
*/
|
||||
private String terminal;
|
||||
/**
|
||||
* 订单类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 付款用户
|
||||
*/
|
||||
@ -50,14 +53,14 @@ public class LJOrder extends BaseEntity implements Serializable {
|
||||
* 所属店铺ID
|
||||
*/
|
||||
private Integer storeId;
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
private Integer goodId;
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 商品数量
|
||||
*/
|
||||
private Double goodsNum;
|
||||
/**
|
||||
* 订单金额
|
||||
*/
|
||||
@ -66,6 +69,10 @@ public class LJOrder extends BaseEntity implements Serializable {
|
||||
* 支付金额
|
||||
*/
|
||||
private Double payAmount;
|
||||
/**
|
||||
* 商品数量
|
||||
*/
|
||||
private Integer goodsNum;
|
||||
/**
|
||||
* 使用积分数量
|
||||
*/
|
||||
@ -75,7 +82,7 @@ public class LJOrder extends BaseEntity implements Serializable {
|
||||
*/
|
||||
private Double pointAmount;
|
||||
/**
|
||||
* 折扣金额
|
||||
* 优惠金额
|
||||
*/
|
||||
private Double discount;
|
||||
/**
|
||||
@ -94,6 +101,5 @@ public class LJOrder extends BaseEntity implements Serializable {
|
||||
* 操作员工
|
||||
*/
|
||||
private Integer staffId;
|
||||
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,118 @@
|
||||
package com.fuint.business.order.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fuint.framework.entity.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 油品订单表(OilOrder)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-11-07 15:10:07
|
||||
*/
|
||||
@Data
|
||||
@TableName("oil_order")
|
||||
@ApiModel(value = "OilOrder对象", description = "油品订单表")
|
||||
public class OilOrder extends BaseEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 自增ID
|
||||
*/
|
||||
@ApiModelProperty("自增ID")
|
||||
@TableId(value = "ID", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Integer storeId;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 优惠券id
|
||||
*/
|
||||
private Integer couponId;
|
||||
/**
|
||||
* 提成金额
|
||||
*/
|
||||
private Double commissionAmount;
|
||||
/**
|
||||
* 员工id
|
||||
*/
|
||||
private Integer staffId;
|
||||
/**
|
||||
* 终端
|
||||
*/
|
||||
private String terminal;
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
private String orderNo;
|
||||
/**
|
||||
* 油品
|
||||
*/
|
||||
private String oils;
|
||||
/**
|
||||
* 油枪号
|
||||
*/
|
||||
private Integer oilGunNum;
|
||||
/**
|
||||
* 油品数量
|
||||
*/
|
||||
private Double oilNum;
|
||||
/**
|
||||
* 订单金额
|
||||
*/
|
||||
private Double orderAmount;
|
||||
/**
|
||||
* 优惠金额
|
||||
*/
|
||||
private Double discountAmount;
|
||||
/**
|
||||
* 实付金额
|
||||
*/
|
||||
private Double payAmount;
|
||||
/**
|
||||
* 付款用户
|
||||
*/
|
||||
private String payUser;
|
||||
/**
|
||||
* 付款类型:微信、支付宝等、赊账
|
||||
*/
|
||||
private String payType;
|
||||
/**
|
||||
* 开票标识:已开票、未开票
|
||||
*/
|
||||
private String invoicing;
|
||||
/**
|
||||
* 订单状态:已支付、未支付
|
||||
*/
|
||||
private String orderStatus;
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
private Date payTime;
|
||||
/**
|
||||
* 富友订单号
|
||||
*/
|
||||
private Integer reservedFyOrderNo;
|
||||
/**
|
||||
* 富友渠道交易流水号
|
||||
*/
|
||||
private Integer reservedTransactionId;
|
||||
/**
|
||||
* 订单备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,20 @@
|
||||
package com.fuint.business.order.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.order.entity.OilOrder;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 油品订单表 Mapper层
|
||||
*/
|
||||
public interface OilOrderMapper extends BaseMapper<OilOrder> {
|
||||
/**
|
||||
* 根据条件分页查询油品订单信息
|
||||
* @param page
|
||||
* @param order
|
||||
* @return
|
||||
*/
|
||||
public IPage<OilOrder> selectOilOrderList(Page page, @Param("order") OilOrder order);
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fuint.business.order.mapper.OilOrderMapper">
|
||||
<sql id="selectOrders">
|
||||
select * from oil_order
|
||||
</sql>
|
||||
|
||||
<select id="selectOilOrderList" resultType="com.fuint.business.order.entity.OilOrder">
|
||||
<include refid="selectOrders"></include>
|
||||
<where>
|
||||
store_id = #{order.storeId}
|
||||
<!-- <if test="order.staffId != null and order.staffId != ''">-->
|
||||
<!-- and staff_id = #{order.staffId}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="order.type != null and order.type != ''">-->
|
||||
<!-- and type = #{order.type}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="order.payType != null and order.payType != ''">-->
|
||||
<!-- and pay_type = #{order.payType}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="order.orderNo != null and order.orderNo != ''">-->
|
||||
<!-- and order_no like concat('%', #{order.orderNo}, '%')-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="order.payUser != null and order.payUser != ''">-->
|
||||
<!-- and pay_user like concat('%', #{order.payUser}, '%')-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="order.params.beginTime != null and order.params.beginTime != ''"><!– 开始时间检索 –>-->
|
||||
<!-- and date_format(create_time,'%y%m%d') >= date_format(#{order.params.beginTime},'%y%m%d')-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="order.params.endTime != null and order.params.endTime != ''"><!– 结束时间检索 –>-->
|
||||
<!-- and date_format(create_time,'%y%m%d') <= date_format(#{order.params.endTime},'%y%m%d')-->
|
||||
<!-- </if>-->
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,28 @@
|
||||
package com.fuint.business.order.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fuint.business.order.entity.OilOrder;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 油品订单信息 业务层
|
||||
*/
|
||||
public interface OilOrderService extends IService<OilOrder> {
|
||||
/**
|
||||
* 根据条件分页查询油品订单信息
|
||||
* @param page
|
||||
* @param order
|
||||
* @return
|
||||
*/
|
||||
public IPage<OilOrder> selectOilOrderList(Page page, OilOrder order);
|
||||
|
||||
/**
|
||||
* 添加油品订单信息
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
public int insertOilOrder(Map<String ,String> map);
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package com.fuint.business.order.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.order.entity.OilOrder;
|
||||
import com.fuint.business.order.mapper.OilOrderMapper;
|
||||
import com.fuint.business.order.service.OilOrderService;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
@Service
|
||||
public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> implements OilOrderService {
|
||||
@Override
|
||||
public IPage<OilOrder> selectOilOrderList(Page page, OilOrder order) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
Integer storeId = nowAccountInfo.getStoreId();
|
||||
order.setStoreId(storeId);
|
||||
IPage<OilOrder> oilOrderIPage = baseMapper.selectOilOrderList(page, order);
|
||||
return oilOrderIPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertOilOrder(Map<String ,String> map) {
|
||||
String oilOrder = map.get("oilOrder");
|
||||
String goodsOrder = map.get("goodsOrder");
|
||||
String payType = map.get("payType");
|
||||
List<JSONObject> jsonObjects = JSONArray.parseArray(oilOrder, JSONObject.class);
|
||||
OilOrder order = new OilOrder();
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
String timestamp = dateFormat.format(new Date());
|
||||
String randomString = UUID.randomUUID().toString().replace("-","").substring(0,6);
|
||||
// 添加油品订单信息
|
||||
for (JSONObject object : jsonObjects) {
|
||||
order.setOrderNo(timestamp+randomString);
|
||||
double amount = (double) object.get("amount");
|
||||
double oilPrice = (double) object.get("oilPrice");
|
||||
double oilNum = amount/oilPrice;
|
||||
order.setOilNum(oilNum);
|
||||
order.setPayType(payType);
|
||||
order.setOils((String) object.get("oilName"));
|
||||
order.setOilGunNum((Integer) object.get("oilGunNum"));
|
||||
order.setOrderAmount((Double) object.get("amount"));
|
||||
System.out.println(object.get("oilGunNum"));
|
||||
System.out.println(object.get("numberId"));
|
||||
System.out.println(object.get("oilName"));
|
||||
System.out.println(object.get("oilPrice"));
|
||||
System.out.println(object.get("amount"));
|
||||
}
|
||||
|
||||
// int row = baseMapper.insert(order);
|
||||
return 0;
|
||||
}
|
||||
}
|
@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@ -87,6 +88,18 @@ public class LJUserController extends BaseController {
|
||||
return getSuccessResult(userVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据手机号查询会员信息
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/name")
|
||||
public ResponseObject userVoByName(@Validated @RequestBody Map<String ,String > map){
|
||||
String name = map.get("name");
|
||||
List<LJUserVo> list = userService.queryUserByName(name);
|
||||
return getSuccessResult(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除会员信息
|
||||
* @return
|
||||
|
@ -7,6 +7,8 @@ import com.fuint.business.userManager.entity.LJUser;
|
||||
import com.fuint.business.userManager.vo.LJUserVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员信息 mapper层
|
||||
*/
|
||||
@ -26,6 +28,13 @@ public interface LJUserMapper extends BaseMapper<LJUser> {
|
||||
*/
|
||||
public LJUserVo selectUserByMobile(@Param("mobile") String mobile);
|
||||
|
||||
/**
|
||||
* 根据会员昵称模糊查询会员信息
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
public List<LJUserVo> selectUserByName(@Param("name") String name);
|
||||
|
||||
/**
|
||||
* 统计信息
|
||||
* @param storeId
|
||||
@ -33,4 +42,5 @@ public interface LJUserMapper extends BaseMapper<LJUser> {
|
||||
* @return
|
||||
*/
|
||||
public Double selectSumByStore(@Param("storeId") int storeId,@Param("sumValue") String sumValue);
|
||||
|
||||
}
|
||||
|
@ -51,4 +51,11 @@
|
||||
mu.mobile = #{mobile}
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectUserByName" resultType="com.fuint.business.userManager.vo.LJUserVo"
|
||||
parameterType="java.lang.String">
|
||||
<include refid="selectUser"></include>
|
||||
<where>
|
||||
mu.name like concat('%', #{name}, '%')
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
@ -47,6 +47,13 @@ public interface LJUserService extends IService<LJUser> {
|
||||
*/
|
||||
public LJUserVo queryUserByMobile(String mobile);
|
||||
|
||||
/**
|
||||
* 根据会员昵称模糊查询会员信息
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
public List<LJUserVo> queryUserByName(String name);
|
||||
|
||||
/**
|
||||
* 根据id删除会员信息
|
||||
* @param id
|
||||
|
@ -109,6 +109,17 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
|
||||
return userVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据会员昵称模糊查询会员信息
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<LJUserVo> queryUserByName(String name) {
|
||||
List<LJUserVo> list = baseMapper.selectUserByName(name);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id删除会员信息
|
||||
* @param id
|
||||
|
@ -9,6 +9,14 @@ export function listLJGoods(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 查询商品列表
|
||||
export function listgoods() {
|
||||
return request({
|
||||
url: '/business/convenience/goods/queryList',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
// 查询商品详细
|
||||
export function getLJGoods(id) {
|
||||
return request({
|
||||
|
19
fuintCashierWeb/src/api/cashier/oilorder.js
Normal file
19
fuintCashierWeb/src/api/cashier/oilorder.js
Normal file
@ -0,0 +1,19 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询油品订单列表
|
||||
export function listOilOrder(query) {
|
||||
return request({
|
||||
url: '/business/oilOrder/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 新增油品订单信息
|
||||
export function addLJGoods(data) {
|
||||
return request({
|
||||
url: '/business/oilOrder',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
@ -25,6 +25,14 @@ export function getStaff(id) {
|
||||
})
|
||||
}
|
||||
|
||||
// 查询当前登录账号信息
|
||||
export function staffInfo() {
|
||||
return request({
|
||||
url: '/business/member/staff/name',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据手机号查询员工详情
|
||||
export function queryStaff(data) {
|
||||
return request({
|
||||
|
@ -9,24 +9,6 @@ export function listUser(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 查询会员列表
|
||||
export function listStatistic(query) {
|
||||
return request({
|
||||
url: '/business/userManager/user/statistic',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 根据手机号查询会员详细
|
||||
export function getUserMobile(data) {
|
||||
return request({
|
||||
url: '/business/userManager/user/mobile' ,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 根据手机号查询会员详细
|
||||
export function getUserVoMobile(data) {
|
||||
return request({
|
||||
@ -36,4 +18,13 @@ export function getUserVoMobile(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 根据手机号查询会员详细
|
||||
export function getUserVoName(data) {
|
||||
return request({
|
||||
url: '/business/userManager/user/name',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
53
fuintCashierWeb/src/api/cashier/usergrade.js
Normal file
53
fuintCashierWeb/src/api/cashier/usergrade.js
Normal file
@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询会员等级列表
|
||||
export function listUserGrade(query) {
|
||||
return request({
|
||||
url: '/business/userManager/userGrade/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询会员等级详细
|
||||
export function getUserGrade(id) {
|
||||
return request({
|
||||
url: '/business/userManager/userGrade/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据会员等级名称查询会员等级信息
|
||||
export function queryUserGrade(data) {
|
||||
return request({
|
||||
url: '/business/userManager/userGrade/getName',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 新增会员等级
|
||||
export function addUserGrade(data) {
|
||||
return request({
|
||||
url: '/business/userManager/userGrade',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改会员等级
|
||||
export function updateUserGrade(data) {
|
||||
return request({
|
||||
url: '/business/userManager/userGrade',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除会员等级
|
||||
export function delUserGrade(id) {
|
||||
return request({
|
||||
url: '/business/userManager/userGrade/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
@ -3,14 +3,54 @@
|
||||
<div class="center-left">
|
||||
<div class="center-vh">
|
||||
<div class="center-left-top">
|
||||
<div class="vip-bottom" @click="dialogVisiblevip = true">
|
||||
<div class="vip-bottom" v-if="isMember == false" @click="dialogVisiblevip = true">
|
||||
<div>会员登录</div>
|
||||
</div>
|
||||
<div v-else style="width: 96%;margin: 0 auto;display: flex;justify-content: space-between">
|
||||
<div
|
||||
style="display: flex;color: white;justify-content: space-around;width: 55%;
|
||||
height: 90%;border-radius: 10px;
|
||||
padding-top: 10px;
|
||||
background-color: rgb(67,119,204)">
|
||||
<div>
|
||||
<template>
|
||||
<img v-if="member.avatar" class="list-avatar" :src="member.avatar">
|
||||
<img v-else class="list-avatar" src="@/assets/images/avatar.png">
|
||||
</template>
|
||||
</div>
|
||||
<div style="text-align: center">
|
||||
<span style="margin-bottom: 10px">{{ member.name }}</span><br/>
|
||||
<span>{{ member.mobile }}</span>
|
||||
</div>
|
||||
<div style="background-color: rgba(46,82,142,0.65);width: 50px;height: 45px;padding-top: 5px;
|
||||
border-radius: 5px;text-align: center">
|
||||
<el-tooltip placement="top">
|
||||
<div slot="content">
|
||||
<p>会员储值账户余额:{{ member.cardBalance }}</p>
|
||||
<p>积分余额:{{ member.points }}</p>
|
||||
</div>
|
||||
<i class="el-icon-bank-card" style="font-size: 35px"></i>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div style="background-color: rgba(46,82,142,0.65);width: 50px;height: 45px;padding-top: 5px;
|
||||
border-radius: 5px;text-align: center">
|
||||
<el-tooltip placement="top">
|
||||
<div slot="content">
|
||||
会员等级:{{ getGrade(member.gradeId) }}
|
||||
</div>
|
||||
<i class="el-icon-medal" style="font-size: 35px"></i>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
<div class="vip-bottom" style="height: 40px;margin-top: 10px" @click="resetMember">
|
||||
<div>重置会员</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="center-left-hj">
|
||||
<div class="hj-box" style="justify-content: left">油品:¥200.00</div>
|
||||
<div class="hj-box" style="border-left: 1px solid #d1d1d4; border-right: 1px solid #d1d1d4;">商品:¥0.52</div>
|
||||
<div class="hj-box" style="justify-content: flex-end">合计: ¥200.52</div>
|
||||
<div class="hj-box" style="justify-content: left">油品:¥{{ oilAmount }}</div>
|
||||
<div class="hj-box" style="border-left: 1px solid #d1d1d4; border-right: 1px solid #d1d1d4;">商品:¥{{ goodsAmount }}</div>
|
||||
<div class="hj-box" style="justify-content: flex-end">合计: ¥{{ oilAmount + goodsAmount }}</div>
|
||||
</div>
|
||||
<div class="center-left-hj">
|
||||
<div>满减活动</div>
|
||||
@ -19,15 +59,15 @@
|
||||
<div class="center-left-th">
|
||||
<div class="th-box">
|
||||
<div>扫码支付</div>
|
||||
<div class="bule">394.7</div>
|
||||
<div class="bule">{{ oilAmount + goodsAmount }}</div>
|
||||
</div>
|
||||
<div class="th-box">
|
||||
<div>找零</div>
|
||||
<div class="bule">394.7</div>
|
||||
<div class="bule">0</div>
|
||||
</div>
|
||||
<div class="th-box">
|
||||
<div>加油员</div>
|
||||
<div style="cursor: pointer;color: crimson" @click="dialogVisible = true" >加油员名称</div>
|
||||
<div @click="dialogVisible = true">加油员</div>
|
||||
<div style="cursor: pointer;color: crimson" @click="dialogVisible = true" >{{ staff.realName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -41,10 +81,10 @@
|
||||
</div>
|
||||
<div class="center-left-bottom">
|
||||
<div>
|
||||
<div class="bottom-price">¥349.78</div>
|
||||
<div class="bottom-price">¥{{ oilAmount + goodsAmount }}</div>
|
||||
<div class="price-red">优惠合计:5.74元</div>
|
||||
</div>
|
||||
<div class="center-left-lv" @click="dialogVisiblej = true ">立即结算</div>
|
||||
<div class="center-left-lv" @click="settlement">立即结算</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -94,13 +134,13 @@
|
||||
|
||||
<!-- -->
|
||||
<div class="content-top-bottom">
|
||||
<div>订单笔数 <span class="bule">3件</span> </div>
|
||||
<div>订单金额 <span class="bule">¥2.03</span> </div>
|
||||
<div>订单笔数 <span class="bule">{{ oilTotal }}件</span> </div>
|
||||
<div>订单金额 <span class="bule">¥{{ oilAmount }}</span> </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="center-left-bottom">
|
||||
<div class="bottom-gd">新增订单</div>
|
||||
<div class="bottom-gd" @click="resetting">新增订单</div>
|
||||
<div class="bottom-qk">解锁</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -109,16 +149,26 @@
|
||||
<div class="center-top">
|
||||
<div class="center-top-title">非油商品</div>
|
||||
<div class="center-top-input">
|
||||
<input v-model="goods" type="text"
|
||||
@input="queryGoods"
|
||||
placeholder="请输入商品名称,条码,商品关键词">
|
||||
<!-- <input v-model="goods" type="text"-->
|
||||
<!-- clearable-->
|
||||
<!-- placeholder="请输入商品名称,商品关键词">-->
|
||||
<template>
|
||||
<el-select v-model="goods" filterable
|
||||
style="width: 95%;font-size: 20px;"
|
||||
@change="changeGoods"
|
||||
clearable
|
||||
placeholder="请输入商品名称,商品关键词">
|
||||
<el-option
|
||||
v-for="item in goodsList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
<span style="float: left">{{ item.name }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.retailPrice }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</div>
|
||||
<el-autocomplete
|
||||
v-model="goods"
|
||||
:fetch-suggestions="querySearchAsync"
|
||||
placeholder="请输入内容"
|
||||
@select="handleSelect"
|
||||
></el-autocomplete>
|
||||
<div class="center-top-data">
|
||||
<div class="data-top">
|
||||
<div class="data-top-title">商品</div>
|
||||
@ -128,23 +178,37 @@
|
||||
<div>操作</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="data-top-box">
|
||||
<div class="data-top-title">商品名称</div>
|
||||
<div class="data-top-box" v-for="(item,index) in goodsOrder" :key="index">
|
||||
<div class="data-top-title">{{ item.name }}</div>
|
||||
<div class="data-top-three">
|
||||
<div>0.01</div>
|
||||
<div> <el-input-number v-model="num" size="small" controls-position="right" @change="handleChange" :min="1" :max="10"></el-input-number> </div>
|
||||
<div><i class="el-icon-circle-close" style="font-size: 22px"></i></div>
|
||||
<div>{{ item.retailPrice }}</div>
|
||||
<div>
|
||||
<el-input-number v-model="item.num" size="small" controls-position="right"
|
||||
@change="handleChange" :min="1" :max="10"></el-input-number>
|
||||
</div>
|
||||
<div @click="delGoods(index)"><i class="el-icon-circle-close" style="font-size: 22px"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="data-top-box">-->
|
||||
<!-- <div class="data-top-title">商品名称</div>-->
|
||||
<!-- <div class="data-top-three">-->
|
||||
<!-- <div>0.01</div>-->
|
||||
<!-- <div>-->
|
||||
<!-- <el-input-number v-model="num" size="small" controls-position="right"-->
|
||||
<!-- @change="handleChange" :min="1" :max="10"></el-input-number>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div><i class="el-icon-circle-close" style="font-size: 22px"></i></div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- -->
|
||||
<div class="content-top-bottom">
|
||||
<div>商品数量 <span class="bule">3件</span> </div>
|
||||
<div>商品总额 <span class="bule">¥2.03</span> </div>
|
||||
<div>商品数量 <span class="bule">{{ goodsTotal }}件</span> </div>
|
||||
<div>商品总额 <span class="bule">¥{{ goodsAmount }}</span> </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="center-left-bottom">
|
||||
<div class="bottom-qk">清空</div>
|
||||
<div class="bottom-qk" @click="empty">清空</div>
|
||||
<div style="display: flex">
|
||||
<div class="bottom-qd">取单</div>
|
||||
<div class="bottom-gd">挂单</div>
|
||||
@ -160,38 +224,30 @@
|
||||
:close-on-click-modal="false">
|
||||
<div class="wrap-wrap">
|
||||
<div class="of-box" v-for="(item,index) in staffList" :key="index"
|
||||
@click="chooseStaff(item)"
|
||||
:style="{'background-color': item.color}">
|
||||
<div>{{ item.name }}</div>
|
||||
<div class="of-title" >{{ item.mobile }}</div>
|
||||
<div class="of-title">{{ item.realName }}</div>
|
||||
<div style="text-align: center;font-size: 17px">{{ item.mobile }}</div>
|
||||
</div>
|
||||
<!-- <div class="of-box" v-for="(item,index) in 7" :key="index" :style="{'background-color': item.color}">-->
|
||||
<!-- <div>92#</div>-->
|
||||
<!-- <div class="of-title" >加油员姓名</div>-->
|
||||
<!-- <div>-->
|
||||
<!-- <img src="../../../assets/images/jya.png" style="width: 18px;height: 18px;">-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button @click="dialogVisible = false">关 闭</el-button>
|
||||
<!-- <el-button type="primary" @click="dialogVisible = false">确 定</el-button>-->
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!-- 立即结算-->
|
||||
<el-dialog
|
||||
title="提示"
|
||||
title="扫码支付"
|
||||
:visible.sync="dialogVisiblej"
|
||||
width="30%"
|
||||
:close-on-click-modal="false">
|
||||
<div style="text-align: center;font-size: 15px;font-weight: bold">付款金额</div>
|
||||
<div style="text-align: center;font-size: 15px;font-weight: bold">应收金额</div>
|
||||
<div style="text-align: center;font-size: 30px;font-weight: bold;color: red;margin: 10px 0">
|
||||
¥300.00
|
||||
<el-tag
|
||||
effect="dark">
|
||||
汽油
|
||||
</el-tag>
|
||||
¥{{ oilAmount + goodsAmount }}
|
||||
</div>
|
||||
<div style="text-align: center;margin-bottom: 10px">
|
||||
合计金额:{{ oilAmount + goodsAmount }}元、优惠合计13.02元
|
||||
</div>
|
||||
<div style="text-align: center;margin-bottom: 10px">赠送金额</div>
|
||||
<div>
|
||||
<el-input v-model="authCode"
|
||||
autofocus="autofocus"
|
||||
@ -224,7 +280,9 @@
|
||||
width="30%"
|
||||
:close-on-click-modal="false">
|
||||
<div >
|
||||
<el-input placeholder="会员手机号、用户昵称、实体卡号" v-model="userNo"
|
||||
<el-input placeholder="会员手机号、用户昵称" v-model="userNo"
|
||||
clearable
|
||||
@keyup.enter.native="getUser"
|
||||
class="input-with-select" style="text-align: center;">
|
||||
<el-select v-model="select1" slot="prepend" placeholder="请选择" style="width: 120px">
|
||||
<el-option label="会员手机号" value="会员手机号"></el-option>
|
||||
@ -255,7 +313,7 @@
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisiblevip = false">取 消</el-button>
|
||||
<el-button type="primary" @click="dialogVisiblevip = false">确 定</el-button>
|
||||
<el-button type="primary" @click="chooseUser">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!-- 油号选择-->
|
||||
@ -298,7 +356,38 @@
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<!-- 模糊查询会员列表信息-->
|
||||
<el-dialog
|
||||
title="请选择会员"
|
||||
:visible.sync="dialogVisibleMember"
|
||||
:close-on-click-modal="false">
|
||||
<div class="wrap-wrap">
|
||||
<el-table ref="tables" :data="memberList">
|
||||
<el-table-column label="ID" align="center" prop="id" width="80" />
|
||||
<el-table-column label="头像" align="center" width="70">
|
||||
<template slot-scope="scope">
|
||||
<img v-if="scope.row.avatar" class="list-avatar" :src="scope.row.avatar">
|
||||
<img v-else class="list-avatar" src="@/assets/images/avatar.png">
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="姓名" align="center" prop="name" />
|
||||
<el-table-column label="手机号" align="center" prop="mobile"/>
|
||||
<el-table-column label="注册时间" align="center" prop="createTime">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="primary" round
|
||||
@click="handleChoose(scope.row)"
|
||||
>选择</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -306,9 +395,11 @@
|
||||
import {getDicts} from "@/api/dict/data";
|
||||
import {getOilNameList, getOilNumGun, getOilNumGunById, listOilNumGun} from "@/api/cashier/oilnumgun";
|
||||
import {fyPay} from "@/api/cashier/pay";
|
||||
import {listLJGoods} from "@/api/cashier/ljgoods";
|
||||
import {getUserVoMobile} from "@/api/cashier/user";
|
||||
import {queryStaffs} from "@/api/cashier/staff";
|
||||
import {getLJGoods, listgoods} from "@/api/cashier/ljgoods";
|
||||
import {getUserVoMobile, getUserVoName} from "@/api/cashier/user";
|
||||
import {queryStaffs, staffInfo} from "@/api/cashier/staff";
|
||||
import {addLJGoods} from "@/api/cashier/oilorder";
|
||||
import {getUserGrade} from "@/api/cashier/usergrade";
|
||||
|
||||
export default {
|
||||
name: "homeindex",
|
||||
@ -316,8 +407,16 @@
|
||||
return{
|
||||
// 油品订单
|
||||
oilOrder:[],
|
||||
// 油品金额
|
||||
oilAmount:0,
|
||||
// 油品订单数
|
||||
oilTotal:0,
|
||||
// 商品订单
|
||||
goodsOrder:[],
|
||||
// 商品金额
|
||||
goodsAmount:0,
|
||||
// 商品订单数
|
||||
goodsTotal:0,
|
||||
// 加油金额
|
||||
rise:[
|
||||
{value:"¥100"},
|
||||
@ -327,6 +426,8 @@
|
||||
],
|
||||
// 会员信息
|
||||
member:{},
|
||||
// 会员列表信息
|
||||
memberList:[],
|
||||
select1:'会员手机号',
|
||||
// 会员信息
|
||||
userNo:"",
|
||||
@ -350,6 +451,7 @@
|
||||
dialogVisiblej: false,
|
||||
dialogVisiblevip:false,
|
||||
dialogVisibleamount:false,
|
||||
dialogVisibleMember:false,
|
||||
activeName: '1',
|
||||
tabarr:[
|
||||
{name:'收银台',icon:'el-icon-s-platform'},
|
||||
@ -371,28 +473,146 @@
|
||||
{color:'#ecfae5'},
|
||||
{color:'#fafafa'}
|
||||
],
|
||||
restaurants:'',
|
||||
num: 1,
|
||||
// 油号名称
|
||||
oilNameList:'',
|
||||
// 员工列表
|
||||
staffList:[],
|
||||
isMember: false,
|
||||
// 员工信息
|
||||
staff:"",
|
||||
map:{
|
||||
// 油品订单
|
||||
oilOrder:"",
|
||||
// 商品订单
|
||||
goodsOrder:"",
|
||||
// 支付方式
|
||||
payType:"",
|
||||
// 油品订单金额
|
||||
oilAmount:"",
|
||||
// 商品订单金额
|
||||
goodsAmount:"",
|
||||
// 油品实付金额
|
||||
oilActualPay:"",
|
||||
// 商品实付金额
|
||||
goodsActualPay:"",
|
||||
// 付款用户
|
||||
payUser:"",
|
||||
// 油品优惠金额
|
||||
oilDiscount:"",
|
||||
// 商品优惠金额
|
||||
goodsDiscount:"",
|
||||
},
|
||||
gradeName:"",
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getPayList();
|
||||
this.queryGoods();
|
||||
this.getOilName();
|
||||
this.getGoods();
|
||||
this.getStaffList();
|
||||
this.getStaff();
|
||||
},
|
||||
methods:{
|
||||
// 重置会员
|
||||
resetMember(){
|
||||
this.member = {};
|
||||
this.isMember = false;
|
||||
},
|
||||
// 获取会员等级信息
|
||||
getGrade(id){
|
||||
getUserGrade(id).then( response => {
|
||||
this.gradeName = response.data.name;
|
||||
})
|
||||
return this.gradeName;
|
||||
},
|
||||
// 选择会员
|
||||
chooseUser(){
|
||||
this.dialogVisiblevip = false
|
||||
this.isMember = true;
|
||||
},
|
||||
// 选择会员信息
|
||||
handleChoose(data){
|
||||
this.member = data;
|
||||
this.dialogVisibleMember = false;
|
||||
},
|
||||
// 清空商品订单列表
|
||||
empty(){
|
||||
this.goodsOrder = [];
|
||||
this.goodsTotal = 0;
|
||||
this.goodsAmount = 0;
|
||||
},
|
||||
// 获取当前账户信息
|
||||
getStaff(){
|
||||
staffInfo().then( response => {
|
||||
this.staff = response.data
|
||||
})
|
||||
},
|
||||
// 选择员工信息
|
||||
chooseStaff(data){
|
||||
this.staff = data;
|
||||
},
|
||||
// 删除商品列表信息
|
||||
delGoods(index){
|
||||
this.goodsOrder.splice(index,1)
|
||||
},
|
||||
// 添加商品列表信息
|
||||
changeGoods(val){
|
||||
let result = true;
|
||||
let goods = this.goodsOrder
|
||||
if (this.goodsOrder.length>0){
|
||||
let amount = 0;
|
||||
for (let i = 0; i<goods.length; i++){
|
||||
amount += goods[i].retailPrice * goods[i].num
|
||||
if (goods[i].id == val){
|
||||
goods[i].num = goods[i].num + 1;
|
||||
this.goodsTotal += 1;
|
||||
result = false;
|
||||
break;
|
||||
}else {
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
this.goodsAmount = amount;
|
||||
}else {
|
||||
result = true;
|
||||
}
|
||||
if (result){
|
||||
getLJGoods(val).then( response => {
|
||||
response.data.num = 1
|
||||
this.goodsAmount += response.data.retailPrice
|
||||
this.goodsOrder.push(response.data);
|
||||
this.goodsTotal += 1;
|
||||
})
|
||||
}
|
||||
this.goods = ""
|
||||
},
|
||||
// 立即结算
|
||||
settlement(){
|
||||
this.dialogVisiblej = true
|
||||
},
|
||||
// 新增订单(重置)
|
||||
resetting(){
|
||||
this.oilOrder = [];
|
||||
this.oilTotal = 0;
|
||||
this.oilAmount = 0;
|
||||
},
|
||||
// 获取员工列表
|
||||
getStaffList(){
|
||||
queryStaffs().then( response => {
|
||||
this.staffList = response.data
|
||||
})
|
||||
},
|
||||
// 订单信息
|
||||
// 油品订单信息
|
||||
getOilOrder(){
|
||||
this.dialogVisibleamount = false
|
||||
this.oilOrder.push(this.form)
|
||||
if (this.select == "元"){
|
||||
this.oilAmount = +this.form.amount + this.oilAmount;
|
||||
}else {
|
||||
this.oilAmount = +(this.form.oilPrice * this.form.amount) + this.oilAmount;
|
||||
}
|
||||
this.oilTotal += 1;
|
||||
},
|
||||
// 选择“元”或“L”
|
||||
@ -439,48 +659,24 @@
|
||||
this.oilNameList = response.data;
|
||||
})
|
||||
},
|
||||
// 根据手机号查询会员信息
|
||||
getUser(){
|
||||
getUserVoMobile({mobile:this.userNo}).then( response => {
|
||||
this.member = response.data
|
||||
// console.log(this.member)
|
||||
})
|
||||
},
|
||||
querySearchAsync(queryString, cb) {
|
||||
var restaurants = this.goodsList;
|
||||
// console.log(queryString)
|
||||
this.goodsList.forEach(item => {
|
||||
item.indexOf(queryString)
|
||||
})
|
||||
},
|
||||
handleSelect(item) {
|
||||
// console.log(item);
|
||||
},
|
||||
// 查询商品信息
|
||||
queryGoods(val){
|
||||
// console.log(this.goods)
|
||||
let map = {
|
||||
page:1,
|
||||
pageSize:40,
|
||||
name:this.goods,
|
||||
isRecovery:0,
|
||||
if(this.select1=="会员手机号"){
|
||||
getUserVoMobile({mobile:this.userNo}).then( response => {
|
||||
this.member = response.data
|
||||
})
|
||||
}else {
|
||||
getUserVoName({name:this.userNo}).then( response => {
|
||||
this.memberList = response.data
|
||||
})
|
||||
this.dialogVisibleMember = true;
|
||||
}
|
||||
let map1 = {
|
||||
page:1,
|
||||
pageSize:40,
|
||||
goodsNo:this.goods,
|
||||
isRecovery:0,
|
||||
}
|
||||
listLJGoods(map).then( response => {
|
||||
if(response.data.records!=null){
|
||||
this.goodsList = response.data.records
|
||||
}
|
||||
},
|
||||
// 查询所有商品信息
|
||||
getGoods(){
|
||||
listgoods().then( response => {
|
||||
this.goodsList = response.data
|
||||
})
|
||||
listLJGoods(map1).then( response => {
|
||||
if(response.data.records!=null){
|
||||
this.goodsList = response.data.records
|
||||
}
|
||||
})
|
||||
// console.log(this.goodsList)
|
||||
},
|
||||
// 加油金额
|
||||
refuel(id){
|
||||
@ -492,17 +688,24 @@
|
||||
},
|
||||
// 确定收款
|
||||
collection(){
|
||||
let map = {
|
||||
authCode : this.authCode,
|
||||
orderNo : "0000055"
|
||||
}
|
||||
// console.log(map)
|
||||
fyPay(map).then( response => {
|
||||
// console.log(response)
|
||||
// JSON.parse()
|
||||
this.map.oilOrder = JSON.stringify(this.oilOrder);
|
||||
this.map.goodsOrder = JSON.stringify(this.goodsOrder);
|
||||
addLJGoods(this.map).then( response => {
|
||||
console.log(response)
|
||||
})
|
||||
// let map = {
|
||||
// authCode : this.authCode,
|
||||
// orderNo : "0000055"
|
||||
// }
|
||||
// // console.log(map)
|
||||
// fyPay(map).then( response => {
|
||||
// // console.log(response)
|
||||
// })
|
||||
},
|
||||
// 支付方式
|
||||
payMethod(payType){
|
||||
// console.log(payType)
|
||||
this.map.payType = payType;
|
||||
},
|
||||
// 获取支付方式
|
||||
getPayList(){
|
||||
@ -526,7 +729,15 @@
|
||||
.catch(_ => {});
|
||||
},
|
||||
handleChange(value) {
|
||||
// console.log(value);
|
||||
let goods = this.goodsOrder;
|
||||
let num = 0;
|
||||
let amount = 0;
|
||||
goods.forEach(item => {
|
||||
num += item.num
|
||||
amount += item.retailPrice*item.num
|
||||
})
|
||||
this.goodsTotal = num;
|
||||
this.goodsAmount = amount;
|
||||
},
|
||||
handleClick(tab, event) {
|
||||
let oilNum = ""
|
||||
@ -545,7 +756,7 @@
|
||||
gocomponents(index){
|
||||
this.leftindex = index
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user