订单消费记录线上线下
This commit is contained in:
parent
c76fb1a5ce
commit
f7fcdb6453
|
|
@ -152,3 +152,24 @@ export function writeOffOrderApi(data) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 订单-同步订单状态
|
||||||
|
export function syncOrderPayStateApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/smart-canteen/api/v2/web/order/sync-pay-state',
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
"merchant-id":"378915229716713472",
|
||||||
|
},
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,195 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 系统区域权限树
|
||||||
|
export function systemAreaTreeApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/smart-canteen/api/v2/alloc/area/system-auth/tree',
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
"merchant-id":"378915229716713472",
|
||||||
|
},
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 通过区域Id查询食堂
|
||||||
|
export function getCanteenByAreaApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/smart-canteen/api/v2/alloc/canteen/list-all-auth-canteen',
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
"merchant-id":"378915229716713472",
|
||||||
|
},
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 通过食堂Id查询档口
|
||||||
|
export function getStallByCanteenApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/smart-canteen/api/v2/alloc/canteen/list-multiple-auth-stall',
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
"merchant-id":"378915229716713472",
|
||||||
|
},
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 订单类型
|
||||||
|
export function orderTypeListApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/smart-canteen/api/v2/order/enums/type-list',
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
"merchant-id":"378915229716713472",
|
||||||
|
},
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 配送方式
|
||||||
|
export function deliveryTypeListApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/smart-canteen/api/v2/alloc/canteen/list-delivery-type-enum',
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
"merchant-id":"378915229716713472",
|
||||||
|
},
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 订单状态
|
||||||
|
export function orderStateListApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/smart-canteen/api/v2/order/enums/state-mix-list',
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
"merchant-id":"378915229716713472",
|
||||||
|
},
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 订单支付状态
|
||||||
|
export function orderPayAllTypeApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/smart-canteen/api/v2/pay/all/type',
|
||||||
|
method: 'get',
|
||||||
|
headers: {
|
||||||
|
"merchant-id":"378915229716713472",
|
||||||
|
},
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 核身方式
|
||||||
|
export function orderNuclearModeListApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/smart-canteen/api/v2/order/enums/nuclear/mode-list',
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
"merchant-id":"378915229716713472",
|
||||||
|
},
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 用户类型
|
||||||
|
export function queryPsnTypeByPageApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/smart-canteen/api/v1/cust/psntype/queryPsnTypeByPage',
|
||||||
|
method: 'get',
|
||||||
|
headers: {
|
||||||
|
"merchant-id":"378915229716713472",
|
||||||
|
},
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 组织
|
||||||
|
export function custOrgTreeApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/smart-canteen/custOrg/tenant/tree',
|
||||||
|
method: 'get',
|
||||||
|
headers: {
|
||||||
|
"merchant-id":"378915229716713472",
|
||||||
|
},
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 订单列表-分页
|
||||||
|
export function orderPageListApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/smart-canteen/api/v2/web/order/page/detail',
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
"merchant-id":"378915229716713472",
|
||||||
|
},
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 订单详情
|
||||||
|
export function orderDetailInfoApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/smart-canteen/api/v2/web/order/info',
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
"merchant-id":"378915229716713472",
|
||||||
|
},
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 订单-部分退款
|
||||||
|
export function refundOrderPartApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/smart-canteen/api/v2/web/order/part/refund',
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
"merchant-id":"378915229716713472",
|
||||||
|
},
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 订单-退单
|
||||||
|
export function refundOrderApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/smart-canteen/api/v2/web/order/refund',
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
"merchant-id":"378915229716713472",
|
||||||
|
},
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 订单-核销
|
||||||
|
export function writeOffOrderApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/smart-canteen/api/v2/web/order/write/off',
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
"merchant-id":"378915229716713472",
|
||||||
|
},
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 订单-同步订单状态
|
||||||
|
export function syncOrderPayStateApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/smart-canteen/api/v2/web/order/sync-pay-state',
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
"merchant-id":"378915229716713472",
|
||||||
|
},
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -143,19 +143,32 @@
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<!-- <el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
size="mini" :disabled="multiple"
|
||||||
|
@click="handleBatchRefund"
|
||||||
|
>批量退单</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
size="mini" :disabled="multiple"
|
||||||
|
@click="handleBatchWriteOff"
|
||||||
|
>批量核销</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
plain
|
size="mini" :disabled="multiple"
|
||||||
icon="el-icon-plus"
|
@click="handleSyncPayState"
|
||||||
size="mini"
|
>同步订单状态</el-button>
|
||||||
@click="handleAdd"
|
</el-col>
|
||||||
>新增</el-button>
|
|
||||||
</el-col> -->
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="tableListData" height="800">
|
<el-table v-loading="loading" :data="tableListData" height="800" ref="multipleTable" :row-key="(row)=>{return row.orderId}" @selection-change="handleOrderSelectionChange">
|
||||||
|
<el-table-column type="selection" width="50" align="center" :reserve-selection="true"/>
|
||||||
<el-table-column label="序号" align="center" width="80" type="index" fixed="left">
|
<el-table-column label="序号" align="center" width="80" type="index" fixed="left">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{(queryParams.pageNum - 1) * 10 + scope.$index + 1}}</span>
|
<span>{{(queryParams.pageNum - 1) * 10 + scope.$index + 1}}</span>
|
||||||
|
|
@ -216,12 +229,12 @@
|
||||||
>详情</el-button>
|
>详情</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text" v-if="scope.row.orderStateMix==11"
|
type="text" v-if="scope.row.orderStateMix==1||scope.row.orderStateMix==11"
|
||||||
@click="handleRefundPart(scope.row)"
|
@click="handleRefundPart(scope.row)"
|
||||||
>部分退款</el-button>
|
>部分退款</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text" v-if="scope.row.orderStateMix==11"
|
type="text" v-if="scope.row.orderStateMix==1||scope.row.orderStateMix==11"
|
||||||
@click="handleRefund(scope.row)"
|
@click="handleRefund(scope.row)"
|
||||||
>退单</el-button>
|
>退单</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
|
|
@ -492,12 +505,30 @@
|
||||||
<el-button @click="openPart=false">取 消</el-button>
|
<el-button @click="openPart=false">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 提醒对话框 -->
|
||||||
|
<el-dialog :title="handleType+'提醒'" :visible.sync="openRemind" width="40%" append-to-body>
|
||||||
|
<div class="remind-question">请问是否对以下可{{handleType}}订单进行{{handleType}}操作?</div>
|
||||||
|
<div class="remind-title">可{{handleType}}订单 {{ableList.length}} 笔</div>
|
||||||
|
<div v-for="(item,index) in ableList" :key="item.orderId">{{ (index+1) }}. 订单编号:{{item.orderId}},用户姓名:{{item.custName}},用户编号:{{item.custNum}},订单金额:{{(item.payableAmount/100).toFixed(2)}}</div>
|
||||||
|
|
||||||
|
<div class="remind-title">不可{{handleType}}订单 {{unableList.length}} 笔</div>
|
||||||
|
<div v-for="(item,index) in unableList" :key="item.orderId">{{ (index+1) }}. 订单编号:{{item.orderId}},用户姓名:{{item.custName}}:{{item.custNum}},订单金额:{{(item.payableAmount/100).toFixed(2)}}</div>
|
||||||
|
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="confirmRemind" :disabled="ableList.length==0">确 定</el-button>
|
||||||
|
<el-button @click="openRemind=false">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi,orderStateListApi,orderPayAllTypeApi,queryPsnTypeByPageApi,orderNuclearModeListApi,custOrgTreeApi} from "@/api/order/offline";
|
import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi,orderStateListApi,orderPayAllTypeApi,queryPsnTypeByPageApi,orderNuclearModeListApi,custOrgTreeApi} from "@/api/order/offline";
|
||||||
import { orderPageListApi,orderDetailInfoApi,refundOrderPartApi,refundOrderApi,writeOffOrderApi } from "@/api/order/offline";
|
import { orderPageListApi,orderDetailInfoApi,refundOrderPartApi,refundOrderApi,writeOffOrderApi,syncOrderPayStateApi } from "@/api/order/offline";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "",
|
name: "",
|
||||||
|
|
@ -551,10 +582,12 @@
|
||||||
treeAreaOptions:[],//区域树
|
treeAreaOptions:[],//区域树
|
||||||
canteenOptions:[],//查询-食堂下拉选
|
canteenOptions:[],//查询-食堂下拉选
|
||||||
stallOptions:[],//查询-档口下拉选
|
stallOptions:[],//查询-档口下拉选
|
||||||
|
//下拉选数据
|
||||||
orderStateOptions:[],
|
orderStateOptions:[],
|
||||||
orderPayOptions:[],
|
orderPayOptions:[],
|
||||||
nuclearModeOptions:[],
|
nuclearModeOptions:[],
|
||||||
psnTypeOptions:[],
|
psnTypeOptions:[],
|
||||||
|
//组织树
|
||||||
treeOrgOptions:[],
|
treeOrgOptions:[],
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
|
|
@ -579,6 +612,7 @@
|
||||||
},
|
},
|
||||||
//订单详情
|
//订单详情
|
||||||
orderInfoData: {},
|
orderInfoData: {},
|
||||||
|
//部分退款
|
||||||
openPart:false,
|
openPart:false,
|
||||||
orderDetailList:[],
|
orderDetailList:[],
|
||||||
refundType:'1',
|
refundType:'1',
|
||||||
|
|
@ -593,6 +627,14 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
//批量操作
|
||||||
|
batchIds:[],
|
||||||
|
batchList:[],//批量数据数组
|
||||||
|
//批量核销批量退单提醒对话框
|
||||||
|
handleType:"退单",
|
||||||
|
ableList:[],
|
||||||
|
unableList:[],
|
||||||
|
openRemind:false,
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
@ -795,6 +837,96 @@
|
||||||
this.$modal.msgSuccess("核销成功");
|
this.$modal.msgSuccess("核销成功");
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
},
|
},
|
||||||
|
// ----订单批量操作------
|
||||||
|
handleOrderSelectionChange(selection){
|
||||||
|
this.batchIds = selection.map((item) => item.orderId)
|
||||||
|
this.batchList = selection;
|
||||||
|
this.single = selection.length !== 1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
//批量退单
|
||||||
|
handleBatchRefund(){
|
||||||
|
this.handleType="退单"
|
||||||
|
this.ableList = []
|
||||||
|
this.unableList = []
|
||||||
|
this.batchList.forEach(item=>{
|
||||||
|
if(item.orderStateMix==1||item.orderStateMix==11){
|
||||||
|
this.ableList.push(item)
|
||||||
|
}else{
|
||||||
|
this.unableList.push(item)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.openRemind = true
|
||||||
|
},
|
||||||
|
//批量核销
|
||||||
|
handleBatchWriteOff(){
|
||||||
|
this.handleType="核销"
|
||||||
|
this.ableList = []
|
||||||
|
this.unableList = []
|
||||||
|
this.batchList.forEach(item=>{
|
||||||
|
if(item.orderStateMix==1){
|
||||||
|
this.ableList.push(item)
|
||||||
|
}else{
|
||||||
|
this.unableList.push(item)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.openRemind = true
|
||||||
|
},
|
||||||
|
confirmRemind(){
|
||||||
|
console.log(this.ableList.length)
|
||||||
|
if(this.ableList.length>0){
|
||||||
|
if(this.handleType=="退单"){
|
||||||
|
this.ableList.forEach(item=>{
|
||||||
|
let param = {
|
||||||
|
backType: 1,
|
||||||
|
macOrderId:item.macOrderId,
|
||||||
|
orderId:item.orderId
|
||||||
|
}
|
||||||
|
refundOrderApi(param).then(response => {
|
||||||
|
if(response.code!=200){
|
||||||
|
this.$modal.msgError(response.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
this.$modal.msgSuccess("退单成功");
|
||||||
|
}
|
||||||
|
if(this.handleType=="核销"){
|
||||||
|
this.ableList.forEach(item=>{
|
||||||
|
let param = {
|
||||||
|
orderId:item.orderId
|
||||||
|
}
|
||||||
|
writeOffOrderApi(param).then(response => {
|
||||||
|
if(response.code!=200){
|
||||||
|
this.$modal.msgError(response.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
this.$modal.msgSuccess("核销成功");
|
||||||
|
}
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.getList()
|
||||||
|
this.$refs.multipleTable.clearSelection()
|
||||||
|
},1000)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//同步订单状态
|
||||||
|
handleSyncPayState(){
|
||||||
|
if(this.batchIds.length>0){
|
||||||
|
this.batchIds.forEach(item=>{
|
||||||
|
syncOrderPayStateApi({orderId:item}).then(response => {
|
||||||
|
if(response.code!=200){
|
||||||
|
this.$modal.msgError(response.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
this.$modal.msgSuccess("同步已完成");
|
||||||
|
this.getList()
|
||||||
|
this.$refs.multipleTable.clearSelection()
|
||||||
|
}else{
|
||||||
|
this.$modal.msgError("请先勾选订单数据!");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
//日期
|
//日期
|
||||||
formatDate(date) {
|
formatDate(date) {
|
||||||
// 格式化为 YYYY-MM-DD
|
// 格式化为 YYYY-MM-DD
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue