oil-station/fuintCashierWeb/src/views/cashier/orderComponents/order_Goods.vue

943 lines
28 KiB
Vue
Raw Normal View History

2024-08-16 18:26:19 +08:00
<!--商品交易列表-->
<template>
<div>
2024-09-27 09:23:47 +08:00
<div class="top_new">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
<el-form-item label="" prop="staffId">
<el-select
v-model="queryParams.staffId"
clearable
placeholder="请选择关联员工"
>
<el-option v-for="item in staffList" :key="item.id" :label="item.realName" :value="item.id">
<span style="float: left">{{ item.realName }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.mobile }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="" prop="orderNo">
<el-input
v-model="queryParams.orderNo"
placeholder="请输入订单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="" prop="payType">
<el-select
v-model="queryParams.payType"
placeholder="请选择订单类型"
clearable
style="width: 240px"
>
<el-option
v-for="item in payList"
:key="item.id"
:label="item.dictLabel"
:value="item.dictValue"
2024-09-06 13:40:02 +08:00
/>
2024-09-27 09:23:47 +08:00
</el-select>
</el-form-item>
<el-form-item label="" prop="payUser">
<el-input
v-model="queryParams.payUser"
placeholder="请输入付款用户"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="">
<el-date-picker
v-model="beginTime"
style="width: 160px"
type="date"
placeholder="交易开始日期">
</el-date-picker>
<el-date-picker
v-model="endTime"
style="width: 160px"
type="date"
placeholder="交易结束日期">
</el-date-picker>
</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-button type="primary" @click="exportExcelGoodsOrder()">导出</el-button>
</el-form-item>
</el-form>
</div>
<div class="cot-box">
2024-09-06 13:40:02 +08:00
<div>
<div class="box-gang">
<div class="box2">
<div style="font-size: 26px;color: #0DC291;font-weight: bold;margin-top: 5px">
{{ orderStatistics.theTotalAmount || 0 }}/
{{ orderStatistics.numberOfProducts || 0 }}
2024-08-16 18:26:19 +08:00
</div>
2024-09-06 13:40:02 +08:00
<div class="size-hui">
<div style="width: 8px;height: 8px;border-radius: 4px;background: #0DC291"></div>
<div style="font-weight: bold;font-size: 13px;margin-left: 5px">商品订单总金额/笔数</div>
2024-08-16 18:26:19 +08:00
</div>
</div>
2024-09-06 13:40:02 +08:00
<div class="box2">
<div style="font-size: 26px;color: #00CAFF;font-weight: bold;margin-top: 5px">
{{ orderStatistics.theTotalAmount || 0 }}
</div>
<div class="size-hui">
<div style="width: 8px;height: 8px;border-radius: 4px;background: #00CAFF"></div>
<div style="font-weight: bold;font-size: 13px;margin-left: 5px">实付总金额</div>
2024-08-16 18:26:19 +08:00
</div>
</div>
2024-09-06 13:40:02 +08:00
<div class="box2">
<div style="font-size: 26px;color: #F44522;font-weight: bold;margin-top: 5px">
{{ orderStatistics.discountAmount || 0 }}
</div>
<div class="size-hui">
<div style="width: 8px;height: 8px;border-radius: 4px;background: #F44522"></div>
<div style="font-weight: bold;font-size: 13px;margin-left: 5px">优惠总金额</div>
2024-08-16 18:26:19 +08:00
</div>
</div>
2024-09-06 13:40:02 +08:00
<div class="box2">
<div style="font-size: 26px;color: #FA6400;font-weight: bold;margin-top: 5px">
{{ orderStatistics.wechat || 0 }}/
{{ orderStatistics.alipay || 0 }}
</div>
<div class="size-hui">
<div style="width: 8px;height: 8px;border-radius: 4px;background: #FA6400"></div>
<div style="font-weight: bold;font-size: 13px;margin-left: 5px">微信/支付宝</div>
2024-08-16 18:26:19 +08:00
</div>
</div>
2024-09-06 13:40:02 +08:00
<div class="box2">
<div style="font-size: 26px;color: #2B63F4;font-weight: bold;margin-top: 5px">
{{ orderStatistics.wechat || 0 }}/
{{ orderStatistics.alipay || 0 }}
</div>
<div class="size-hui">
<div style="width: 8px;height: 8px;border-radius: 4px;background: #2B63F4"></div>
<div style="font-weight: bold;font-size: 13px;margin-left: 5px">云闪付/pos刷卡</div>
2024-08-16 18:26:19 +08:00
</div>
</div>
2024-09-06 13:40:02 +08:00
<div class="box2">
<div style="font-size: 26px;color: #F7B500;font-weight: bold;margin-top: 5px">
{{ orderStatistics.cash || 0 }}
</div>
<div class="size-hui">
<div style="width: 8px;height: 8px;border-radius: 4px;background: #F7B500"></div>
<div style="font-weight: bold;font-size: 13px;margin-left: 5px">现金</div>
2024-08-16 18:26:19 +08:00
</div>
</div>
</div>
</div>
2024-09-06 13:40:02 +08:00
<div>
2024-09-27 09:23:47 +08:00
2024-09-06 13:40:02 +08:00
<div class="table-box">
<el-table
:data="list"
style="width: 100%">
2024-09-27 09:23:47 +08:00
2024-09-06 13:40:02 +08:00
<el-table-column type="index" width="50" align="center" label="序号"/>
<el-table-column label="订单号" align="center" prop="orderNo" width="220"/>
<el-table-column label="订单类型" align="center" prop="terminal"/>
<el-table-column label="商品数量" align="center" prop="goodsNum">
<template slot-scope="scope">
<el-tag @click="getGoods(scope.row.id)">{{ scope.row.goodsNum }}</el-tag>
</template>
</el-table-column>
<el-table-column label="订单金额(元)" align="center" prop="amount"/>
<el-table-column label="优惠金额(元)" align="center" prop="discount"/>
<el-table-column label="实付金额(元)" align="center" prop="payAmount"/>
<el-table-column label="付款用户" align="center" prop="payUser"/>
<el-table-column label="支付方式" align="center" prop="payType">
<template slot-scope="scope">
<span v-if="scope.row.payType=='credit'">挂账</span>
<span v-else-if="scope.row.payType == 'CASH'">现金</span>
<span v-else-if="scope.row.payType == 'WECHAT'">微信</span>
<span v-else-if="scope.row.payType == 'ALIPAY'">支付宝</span>
<span v-else-if="scope.row.payType == 'UNIONPAY'">银联二维码</span>
<span v-else-if="scope.row.payType == '0'">兑换券核销</span>
</template>
</el-table-column>
<el-table-column label="订单状态" align="center" prop="payType">
<template slot-scope="scope">
<el-tag v-if="scope.row.status == 'unpaid'">未支付</el-tag>
<el-tag type="success" v-else-if="scope.row.status == 'paid'">已支付</el-tag>
<el-tag type="danger" v-else-if="scope.row.status === 'refund'">已退款</el-tag>
<el-tag type="danger" v-else>支付失败</el-tag>
</template>
</el-table-column>
<!-- <el-table-column label="订单类型" align="center" prop="type"/>-->
<el-table-column label="关联员工" align="center" prop="staffId">
<template slot-scope="scope">
<span>{{ getRealName(staffList, scope.row.staffId) }}</span>
</template>
</el-table-column>
<el-table-column label="操作人" align="center" width="150" prop="payTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.payTime) }}</span>
</template>
</el-table-column>
<el-table-column label="订单完成时间" align="center" width="150" prop="payTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.payTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width">
<template slot-scope="scope">
2024-09-08 17:38:26 +08:00
<el-button style="color: #fe8c4a" @click="patchwork(scope.row)"
2024-09-06 13:40:02 +08:00
type="text" >补打
</el-button>
2024-09-08 17:38:26 +08:00
<el-button style="color: #fe8c4a"
2024-09-06 13:40:02 +08:00
v-if="scope.row.status === 'paid'"
@click="refHandleRefund(scope.row.id)"
type="text">退款
</el-button>
</template>
</el-table-column>
</el-table>
2024-08-16 18:26:19 +08:00
</div>
2024-09-06 13:40:02 +08:00
<div class="pagination-box">
<el-pagination
background
layout="prev, pager, next"
v-show="total>0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.pageSize"
@current-change="getList">
</el-pagination>
2024-08-16 18:26:19 +08:00
</div>
2024-09-06 13:40:02 +08:00
<!-- 订单退款-->
<el-dialog
:close-on-click-modal="false"
title="订单退款"
width="25%"
:visible.sync="refDialogRefund">
<div style="margin: 10px 0">
退款密码<br/>
</div>
<div>
<el-input placeholder="请输入退款密码" v-model="refPass" show-password></el-input>
<br/>
</div>
2024-08-16 18:26:19 +08:00
2024-09-06 13:40:02 +08:00
<span slot="footer" class="dialog-footer">
2024-08-16 18:26:19 +08:00
<el-button @click="refDialogRefund = false"> </el-button>
<el-button type="primary" @click="refHandleRefundByif()"> </el-button>
</span>
2024-09-06 13:40:02 +08:00
</el-dialog>
<!-- 订单退款-->
<el-dialog
:close-on-click-modal="false"
title="订单退款"
width="25%"
:visible.sync="dialogRefund">
<div style="text-align: center;font-weight: bold">
<span style="font-size: 35px">{{ goods.payAmount }}</span>
</div>
<div class="tk">退款金额</div>
<div class="tk">退款单号{{ goods.orderNo }}</div>
<el-input placeholder="请输入退款金额" v-model="refundRemark"></el-input>
<br>
<div>使用的优惠项</div>
<el-checkbox>备选项</el-checkbox>
<el-checkbox>备选项</el-checkbox>
<div style="margin: 10px 0">
退款原因<br/>
<el-radio-group v-model="radio1" style="margin: 10px 0">
<el-radio-button label="油号选错"></el-radio-button>
<el-radio-button label="金额错误"></el-radio-button>
<el-radio-button label="其他原因"></el-radio-button>
</el-radio-group>
</div>
<div>
<el-input placeholder="请输入退款原因" v-model="refundRemark"></el-input>
<br/>
<span
style="color: grey;font-size: 12px">退款仅支持全额退款,退款金额将按照支付信息原路退回优惠券电子储值卡等原路退回处理</span>
</div>
<span slot="footer" class="dialog-footer">
2024-08-16 18:26:19 +08:00
<el-button @click="dialogRefund = false"> </el-button>
<el-button type="primary" @click="refundConfirmed()"> </el-button>
</span>
2024-09-06 13:40:02 +08:00
</el-dialog>
<!-- 商品购买详情 -->
<el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
<el-table ref="tables" v-loading="loading" :data="goodsList" :default-sort="defaultSort">
<el-table-column label="商品名称" align="center" prop="name"/>
<el-table-column label="商品数量" align="center" prop="num"/>
<el-table-column label="商品单价" align="center" prop="retailPrice"/>
<el-table-column label="会员价" align="center" prop="memberPrice"/>
</el-table>
<div style="height: 20px"></div>
</el-dialog>
2024-08-16 18:26:19 +08:00
2024-09-06 13:40:02 +08:00
</div>
</div>
2024-08-16 18:26:19 +08:00
<!-- 支付成功后小票打印内容-->
<div id="reportSuccess" ref="report" class="box-center" v-show="false">
<div class="box-title">订单统计</div>
<div class="box-ge">
<div v-for="item in goodsList" :key="item.id">
<div class="input-box">
<div>商品名称</div>
<div>{{ item.name }}</div>
</div>
<div class="input-box">
<div>商品数量</div>
<div>{{ item.num }}{{ item.unit }}</div>
</div>
<div class="input-box" v-if="!goods.userId">
<div>商品单价</div>
<div>{{ item.retailPrice }}</div>
</div>
<div class="input-box" v-else>
<div>商品单价</div>
<div>{{ item.memberPrice }}</div>
</div>
</div>
<div class="input-box">
<div>支付方式</div>
<div v-if="goods.payType == 'CASH'">现金</div>
<div v-else-if="goods.payType == 'WECHAT'">微信</div>
<div v-else-if="goods.payType == 'ALIPAY'">支付宝</div>
<div v-else-if="goods.payType == 'UNIONPAY'">银联二维码</div>
</div>
<div class="input-box">
<div>合计</div>
<div>{{ goods.amount }}</div>
</div>
<div class="input-box" v-if="goods.discount>0">
<div>优惠合计</div>
<div>{{ goods.discount }}</div>
</div>
<div class="input-box">
<div>实付款</div>
<div>{{ goods.payAmount }}</div>
</div>
</div>
</div>
</div>
</template>
<script>
import {getGoodsOrder, getOrderGoods, listOrder, orderStatisticsApi} from "@/api/cashier/goodsorder";
import {queryStaffs} from "@/api/cashier/staff";
import {getDicts} from "@/api/dict/data";
2024-09-06 13:40:02 +08:00
import {exportExcelGoodsOrderApi} from "@/api/order/exportExcel";
2024-08-16 18:26:19 +08:00
import {cashierOrder} from "@/api/cashier/cashierorder";
import {refundApi, getOrderInfoApi} from "@/api/cashier/refund";
import {connectFlag, getLodop} from "@/api/LodopFuncs";
import {rePrintOilOrderReport} from "@/api/print";
import {ifRefPassApi} from "@/api/staff/store";
export default {
2024-09-06 13:40:02 +08:00
name: "order_Goods",
data() {
return {
2024-08-16 18:26:19 +08:00
// 终端列表
2024-09-06 13:40:02 +08:00
terminalList: [],
2024-08-16 18:26:19 +08:00
// 员工列表
2024-09-06 13:40:02 +08:00
staffList: [],
2024-08-16 18:26:19 +08:00
// 日期范围
dateRange: [],
2024-09-06 13:40:02 +08:00
beginTime: "",
endTime: "",
2024-08-16 18:26:19 +08:00
// 遮罩层
loading: false,
loadingRes: true,
// 标题
title: "",
// 选中数组
ids: [],
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 表格数据
list: [],
2024-09-06 13:40:02 +08:00
goodsList: [],
2024-08-16 18:26:19 +08:00
// 是否显示弹出层
open: false,
// 默认排序
defaultSort: {prop: 'createTime', order: 'descending'},
// 查询参数
queryParams: {
page: 1,
pageSize: 10,
},
2024-09-06 13:40:02 +08:00
orderGoods: '',
2024-08-16 18:26:19 +08:00
// 支付列表
2024-09-06 13:40:02 +08:00
payList: [],
2024-08-16 18:26:19 +08:00
dialogRefund: false,
refDialogRefund: false,
2024-09-06 13:40:02 +08:00
radio1: "油号选错",
goods: {},
refundRemark: "",
2024-08-16 18:26:19 +08:00
orderStatistics: {
2024-09-06 13:40:02 +08:00
numberOfProducts: '0',
theTotalAmount: '0',
theTotalNumberOfUnits: '0',
discountAmount: '0',
wechat: '0',
alipay: '0',
cash: '0',
2024-08-16 18:26:19 +08:00
},
// 是否为当天时间
2024-09-06 13:40:02 +08:00
isSysDate: false,
refPass: "",
getId: "",
2024-08-16 18:26:19 +08:00
}
},
created() {
let start = new Date();
start.setHours(0)
start.setMinutes(0)
start.setSeconds(0)
start.setMilliseconds(0)
2024-09-06 13:40:02 +08:00
this.dateRange = [start, new Date()];
2024-08-16 18:26:19 +08:00
this.beginTime = start
this.endTime = new Date()
this.isSysDate = true
this.getList();
this.getOrderStatistics();
this.getStaffList();
this.getPayList();
},
2024-09-06 13:40:02 +08:00
methods: {
2024-08-16 18:26:19 +08:00
exportExcelGoodsOrder() {
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
2024-09-06 13:40:02 +08:00
exportExcelGoodsOrderApi(this.addDateRange(this.queryParams, dateRange)).then(res => {
const blob = new Blob([res], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});
this.$download.saveAs(blob, '商品订单统计.xLsx')
2024-08-16 18:26:19 +08:00
})
},
// 订单统计
2024-09-06 13:40:02 +08:00
getOrderStatistics() {
2024-08-16 18:26:19 +08:00
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
2024-09-06 13:40:02 +08:00
orderStatisticsApi(this.addDateRange(this.queryParams, dateRange)).then(res => {
2024-08-16 18:26:19 +08:00
this.orderStatistics = res.data;
})
},
async printLocally() {
2024-09-06 13:40:02 +08:00
if (!connectFlag) {
2024-08-16 18:26:19 +08:00
return
}
//初始化打印函数
let LODOP = getLodop(); // 初始化打印
LODOP.PRINT_INIT();
var bodyStyle = `<style>
.input-box{
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
margin: 5px 0px;
}
.box-ge{
border-bottom: 1px solid #000000 ;
box-sizing: border-box;
padding: 10px;
}
.box-title{
font-size: 18px;
text-align: center;
align-items: center;
margin-top: 15px;
}
.input-hui{
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
margin: 15px 0px;
background: #b2b2b2;
box-sizing: border-box;
padding: 5px 0px;
}
.input-hui-frou{
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
margin: 15px 0px;
background: #b2b2b2;
box-sizing: border-box;
padding: 5px 0px;
div{
width: 25%;
text-align: left;
}
}
.input-box-frou{
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
margin: 5px 0px;
div{
width: 25%;
text-align: left;
}
}
.box-center{
height: 500px;
}
</style>
`
2024-09-06 13:40:02 +08:00
var fromHtml = bodyStyle + this.$refs.report.innerHTML
2024-08-16 18:26:19 +08:00
LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", fromHtml);
2024-09-06 13:40:02 +08:00
LODOP.SET_PRINT_MODE("FULL_WIDTH_FOR_OVERFLOW", true);
2024-08-16 18:26:19 +08:00
// LODOP.ADD_PRINT_BARCODE(10,40,100,100,'QRCode','123456789');
// let preview = LODOP.PREVIEW();
// console.log("preview",preview);
LODOP.PRINT();
},
// 打印商品支付后的订单
2024-09-06 13:40:02 +08:00
oilOrderReport() {
2024-08-16 18:26:19 +08:00
let oilOrderR = []
let goodsOrderR = []
if (this.goodsList) {
2024-09-06 13:40:02 +08:00
this.goodsList.forEach(order => {
2024-08-16 18:26:19 +08:00
let o = {
2024-09-06 13:40:02 +08:00
oilName: order.name,
unit: order.num + "" + order.unit,
2024-08-16 18:26:19 +08:00
// amount : order.memberPrice.toString()
2024-09-06 13:40:02 +08:00
amount: order.retailPrice.toString()
2024-08-16 18:26:19 +08:00
}
goodsOrderR.push(o)
})
}
// 支付方式
const payTypeMap = {
'CASH': '现金',
'WECHAT': '微信',
'ALIPAY': '支付宝',
'UNIONPAY': '银联二维码',
'credit': '挂账',
'oilCard': '囤油卡',
'balance': '电子储值卡',
'0': '兑换卷核销'
};
let payTypeText = payTypeMap[this.goods.payType] || '小程序码';
2024-09-06 13:40:02 +08:00
let f = {
oilOrder: oilOrderR,
goodsOrder: goodsOrderR,
payType: payTypeText,
amount: this.goods.amount,
discount: this.goods.discount,
2024-08-16 18:26:19 +08:00
// seekZero:""
}
2024-09-06 13:40:02 +08:00
rePrintOilOrderReport(f).then(res => {
2024-08-16 18:26:19 +08:00
})
},
// 补打
2024-09-06 13:40:02 +08:00
patchwork(data) {
2024-08-16 18:26:19 +08:00
const orderNo = data.orderNo
2024-09-06 13:40:02 +08:00
this.$modal.confirm('确定您要补打当前订单吗?当前订单号[' + orderNo + '],请确保云打印机正在运行中').then(function () {
2024-08-16 18:26:19 +08:00
// return delUser(row.id);
}).then(async () => {
2024-09-06 13:40:02 +08:00
await getGoodsOrder({"id": data.id}).then(response => {
2024-08-16 18:26:19 +08:00
this.goods = response.data
})
2024-09-06 13:40:02 +08:00
await getOrderGoods({orderId: data.id}).then(response => {
2024-08-16 18:26:19 +08:00
this.goodsList = response.data
this.$modal.msgSuccess("打印指令已发送打印机,请查看打印结果");
})
// this.printLocally()
this.oilOrderReport()
2024-09-06 13:40:02 +08:00
}).catch(() => {
});
2024-08-16 18:26:19 +08:00
},
2024-09-06 13:40:02 +08:00
async refHandleRefundByif(id) {
2024-08-16 18:26:19 +08:00
this.refDialogRefund = true;
2024-09-06 13:40:02 +08:00
await ifRefPassApi({refPass: this.refPass}).then(res => {
2024-08-16 18:26:19 +08:00
if (res.data) {
this.handleRefund(this.getId)
this.refDialogRefund = false;
} else {
this.$message({
type: 'info',
message: '密码错误'
});
}
})
},
2024-09-06 13:40:02 +08:00
async refHandleRefund(id) {
2024-08-16 18:26:19 +08:00
this.getId = id,
this.refPass = ""
this.refDialogRefund = true;
},
// 退款
2024-09-06 13:40:02 +08:00
async handleRefund(id) {
2024-08-16 18:26:19 +08:00
2024-09-06 13:40:02 +08:00
await getGoodsOrder({"id": id}).then(response => {
2024-08-16 18:26:19 +08:00
this.goods = response.data
if (response.data.status === "refund") {
this.$message({
type: 'info',
message: '该订单已经退款'
});
this.dialogRefund = false;
}
})
let title = '是否将该收银台下的订单全部退款'
2024-09-06 13:40:02 +08:00
await getOrderInfoApi({
orderNo: this.goods.orderNo,
type: 'goods'
}).then(res => {
2024-08-16 18:26:19 +08:00
if (res.code === 200) {
if (res.data.type === "1") {
title = '该订单下有其它商品订单,是否一并退款'
this.goods.payAmount = res.data.money
}
}
});
this.dialogRefund = true;
// this.$confirm(title+', 是否继续?', '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning'
// }).then(() => {
// this.dialogRefund = true;
// }).catch(() => {
// this.$message({
// type: 'info',
// message: '已取消退款'
// });
// this.dialogRefund = false;
// });
},
// 退款接口
async refundConfirmed() {
this.dialogRefund = false;
this.loadingRes = true;
2024-09-06 13:40:02 +08:00
console.log("cashierOrder", this.goods)
let map = {
2024-08-16 18:26:19 +08:00
orderNo: this.goods.orderNo,
storeId: this.goods.storeId,
2024-09-06 13:40:02 +08:00
refundRemark: this.radio1 + "-" + this.refundRemark,
2024-08-16 18:26:19 +08:00
// refAmount: this.
type: "canRefund",
refType: "goodsRef"
}
2024-09-06 13:40:02 +08:00
await refundApi(map).then(res => {
if (res.code === 200) {
2024-08-16 18:26:19 +08:00
this.$message({
type: 'info',
message: '退款成功'
});
}
})
this.loadingRes = false;
this.created()
},
// 根据员工id查询员工信息
2024-09-06 13:40:02 +08:00
queryStaf(list, id) {
2024-08-16 18:26:19 +08:00
let name = "";
list.forEach(item => {
2024-09-06 13:40:02 +08:00
if (item.id == id) {
2024-08-16 18:26:19 +08:00
name = `${item.realName}(${item.mobile})`
}
})
return name;
},
2024-09-06 13:40:02 +08:00
getVal(list, val) {
2024-08-16 18:26:19 +08:00
let name = "";
list.forEach(item => {
2024-09-06 13:40:02 +08:00
if (item.dictValue == val) {
2024-08-16 18:26:19 +08:00
name = item.dictLabel
}
})
return name;
},
// 获取付款类型列表
2024-09-06 13:40:02 +08:00
getPayList() {
getDicts("payment_type").then(response => {
2024-08-16 18:26:19 +08:00
this.payList = response.data;
})
2024-09-06 13:40:02 +08:00
getDicts("terminal").then(response => {
2024-08-16 18:26:19 +08:00
this.terminalList = response.data;
})
},
// 获取商品详情
2024-09-06 13:40:02 +08:00
getGoods(id) {
getOrderGoods({orderId: id}).then(response => {
2024-08-16 18:26:19 +08:00
this.goodsList = response.data
this.open = true;
this.title = "商品详情"
})
},
// 获取员工姓名
2024-09-06 13:40:02 +08:00
getRealName(list, id) {
2024-08-16 18:26:19 +08:00
var name = "";
list.forEach(item => {
2024-09-06 13:40:02 +08:00
if (item.id == id) {
2024-08-16 18:26:19 +08:00
name = item.realName;
}
})
return name;
},
// 获取员工列表
2024-09-06 13:40:02 +08:00
getStaffList() {
queryStaffs().then(response => {
2024-08-16 18:26:19 +08:00
this.staffList = response.data;
})
},
// 查询订单
2024-09-06 13:40:02 +08:00
getList(val) {
if (val != undefined) {
2024-08-16 18:26:19 +08:00
this.queryParams.page = val
}
let dateRange1 = this.dateRange
// let dateRange = []
// if (this.isSysDate){
// dateRange.push(dateRange1[0].toLocaleDateString())
// dateRange.push(dateRange1[1].toLocaleDateString())
// }else {
// dateRange = this.dateRange
// }
let dateRange = []
if (this.beginTime && this.endTime) {
dateRange.push(this.beginTime.toLocaleDateString())
dateRange.push(this.endTime.toLocaleDateString())
}
this.loadingRes = true;
2024-09-06 13:40:02 +08:00
listOrder(this.addDateRange(this.queryParams, dateRange)).then(response => {
2024-08-16 18:26:19 +08:00
this.list = response.data.records;
this.total = response.data.total;
this.loadingRes = false;
this.isSysDate = false
})
},
// 搜索按钮操作
handleQuery() {
this.queryParams.page = 1;
this.getList();
this.getOrderStatistics();
},
// 重置按钮操作
resetQuery() {
this.dateRange = [];
this.queryParams.status = '';
this.queryParams.mobile = '';
this.queryParams.orderMode = '';
this.queryParams.orderSn = '';
this.queryParams.storeIds = '';
this.storeIds = [];
this.beginTime = ""
this.endTime = ""
this.resetForm("queryForm");
this.handleQuery();
},
}
}
</script>
<style scoped>
2024-09-06 13:40:02 +08:00
.app-top {
2024-08-16 18:26:19 +08:00
width: 100%;
height: 60px;
box-sizing: border-box;
padding: 10px;
}
2024-09-06 13:40:02 +08:00
.clearfix {
2024-08-16 18:26:19 +08:00
width: 100%;
}
2024-09-06 13:40:02 +08:00
.box-card {
2024-08-16 18:26:19 +08:00
width: 100%;
margin-bottom: 15px;
}
2024-09-06 13:40:02 +08:00
.box-gang {
2024-08-16 18:26:19 +08:00
width: 100%;
display: flex;
align-items: center;
flex-wrap: wrap;
}
2024-09-06 13:40:02 +08:00
.box {
2024-08-16 18:26:19 +08:00
//box-sizing: border-box;
padding: 5px;
//background: #f9f9f9;
margin-right: 20px;
margin-bottom: 20px;
padding-left: 20px;
margin-bottom: 20px;
width: 211px;
height: 60px;
2024-09-06 13:40:02 +08:00
background: rgba(64, 158, 255, 0.05);
2024-08-16 18:26:19 +08:00
border-radius: 6px 6px 6px 6px;
2024-09-08 17:38:26 +08:00
border: 1px solid #fe8c4a;
2024-08-16 18:26:19 +08:00
}
2024-09-06 13:40:02 +08:00
.size-hui {
2024-08-16 18:26:19 +08:00
display: flex;
align-items: center;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 13px;
color: #888888;
text-align: left;
font-style: normal;
text-transform: none;
2024-09-06 13:40:02 +08:00
2024-08-16 18:26:19 +08:00
.nei {
width: 150px;
}
}
2024-09-06 13:40:02 +08:00
.size-bole {
2024-08-16 18:26:19 +08:00
height: 31px;
font-family: YouSheBiaoTiHei;
font-weight: 400;
font-size: 24px;
color: #555555;
text-align: left;
font-style: normal;
text-transform: none;
}
2024-09-06 13:40:02 +08:00
.icon-img {
2024-08-16 18:26:19 +08:00
width: 20px;
height: 20px;
margin-right: 5px;
2024-09-06 13:40:02 +08:00
img {
2024-08-16 18:26:19 +08:00
float: right;
width: 20px;
2024-09-06 13:40:02 +08:00
height: 20px;
2024-08-16 18:26:19 +08:00
}
}
2024-09-06 13:40:02 +08:00
.wgang {
2024-08-16 18:26:19 +08:00
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20px;
}
2024-09-06 13:40:02 +08:00
.table-box {
2024-08-16 18:26:19 +08:00
width: 100%;
2024-09-27 09:23:47 +08:00
min-height: 80px;
2024-08-16 18:26:19 +08:00
}
2024-09-06 13:40:02 +08:00
.pagination-box {
2024-08-16 18:26:19 +08:00
width: 100%;
margin: 10px auto;
display: flex;
align-items: center;
justify-content: center;
}
2024-09-06 13:40:02 +08:00
.top-app-sou {
2024-08-16 18:26:19 +08:00
width: 20%;
}
2024-09-06 13:40:02 +08:00
.tk {
2024-08-16 18:26:19 +08:00
text-align: center;
color: grey;
margin: 10px 0;
}
2024-09-06 13:40:02 +08:00
.box1 {
2024-08-16 18:26:19 +08:00
padding: 5px;
margin-right: 20px;
margin-bottom: 20px;
padding-left: 20px;
width: 211px;
height: 60px;
2024-09-06 13:40:02 +08:00
background: rgba(255, 150, 85, 0.05);
border-radius: 6px 6px 6px 6px;
border: 1px solid #FF9655;
}
.box2 {
padding: 5px;
margin-right: 20px;
margin-bottom: 20px;
padding-left: 20px;
width: 211px;
height: 70px;
2024-08-16 18:26:19 +08:00
border-radius: 6px 6px 6px 6px;
border: 1px solid #FF9655;
}
2024-09-06 13:40:02 +08:00
.cot-box {
width: 98%;
border-radius: 8px;
background: #fff;
box-sizing: border-box;
padding: 20px;
margin: 0 auto;
}
2024-09-27 09:23:47 +08:00
.el-form--inline .el-form-item {
margin-right: 30px;
}
.top_new{
display: flex;
justify-content: space-between;
background: #fff;
width: 98%;
margin: 10px auto;
border-radius: 8px;
box-sizing: border-box;
padding: 15px
}
2024-08-16 18:26:19 +08:00
</style>