This commit is contained in:
gyq 2024-07-12 16:36:28 +08:00
parent bb554a28d2
commit 8c1e1d3fbc
12 changed files with 304 additions and 342 deletions

View File

@ -3,10 +3,10 @@ ENV = development
# 正式ws
VITE_API_WSS = 'wss://cashier.sxczgkj.cn/client'
# VITE_API_WSS = 'wss://cashier.sxczgkj.cn/client'
#测试ws
# VITE_API_WSS = 'wss://wxcashiertest.sxczgkj.cn/client'
VITE_API_WSS = 'wss://wxcashiertest.sxczgkj.cn/client'
# 阿伟本地ws
# VITE_API_WSS = 'ws://192.168.2.17:9998/client'

View File

@ -2,16 +2,16 @@
ENV = production
# 正式ws
VITE_API_WSS = 'wss://cashier.sxczgkj.cn/client'
# VITE_API_WSS = 'wss://cashier.sxczgkj.cn/client'
#测试ws
# VITE_API_WSS = 'wss://wxcashiertest.sxczgkj.cn/client'
VITE_API_WSS = 'wss://wxcashiertest.sxczgkj.cn/client'
# 测试 php
VITE_API_PHP_URL = 'http://192.168.2.33:1666/index.php/api'
# 测试
# VITE_API_URL = 'https://cashier-client.sxczgkj.cn/cashier-client'
VITE_API_URL = 'https://cashier-client.sxczgkj.cn/cashier-client'
# 线上环境接口地址
VITE_API_URL = 'https://cashierclient.sxczgkj.cn/cashier-client/'
# VITE_API_URL = 'https://cashierclient.sxczgkj.cn/cashier-client/'

View File

@ -1,6 +1,7 @@
"use strict";
const path = require("path");
const electron = require("electron");
const os = require("os");
let win;
electron.app.whenReady().then(() => {
win = new electron.BrowserWindow({
@ -35,6 +36,17 @@ electron.app.whenReady().then(() => {
win.webContents.send("printList", res);
});
});
electron.ipcMain.on("getOSmacSync", () => {
let mac = "";
if (os.networkInterfaces().WLAN) {
mac = os.networkInterfaces().WLAN[0].mac;
console.log("wlan.mac===", mac);
} else {
mac = os.networkInterfaces()["以太网"][0].mac;
console.log("以太网.mac===", mac);
}
win.webContents.send("getOSmacRes", mac);
});
const printWin = new electron.BrowserWindow({
show: false,
width: 464,
@ -123,7 +135,7 @@ electron.app.whenReady().then(() => {
});
const tagPrintWin = new electron.BrowserWindow({
show: false,
width: 320,
width: 360,
height: 240,
webPreferences: {
nodeIntegration: true,
@ -146,7 +158,7 @@ electron.app.whenReady().then(() => {
silent: true,
deviceName: name,
pageSize: {
width: 4e4,
width: 45e3,
height: 3e4
},
scaleFactor: 80,
@ -164,6 +176,19 @@ electron.app.whenReady().then(() => {
}
});
});
const gotTheLock = electron.app.requestSingleInstanceLock();
if (!gotTheLock) {
electron.app.quit();
} else {
electron.app.on("second-instance", (event, commandLine, workingDirectory) => {
if (win) {
if (win.isMinimized())
win.restore();
win.focus();
win.show();
}
});
}
});
electron.app.on("window-all-closed", () => {
if (process.platform !== "darwin")

View File

@ -1,5 +1,6 @@
import path from "path";
import { app, BrowserWindow, ipcMain } from "electron";
import { app, BrowserWindow, ipcMain, net } from "electron";
import os from "os";
// const SerialPort = require("serialport");
let win;
@ -40,6 +41,16 @@ app.whenReady().then(() => {
app.quit();
});
// 监听网络在线事件
// net.on("online", () => {
// console.log("网络连接恢复");
// });
// // 监听网络离线事件
// net.on("offline", () => {
// console.log("网络连接断开");
// });
// 给渲染进程返回打印机列表
ipcMain.on("getPrintList", () => {
win.webContents.getPrintersAsync().then((res) => {
@ -47,6 +58,19 @@ app.whenReady().then(() => {
});
});
// 获取本机mac
ipcMain.on("getOSmacSync", () => {
let mac = "";
if (os.networkInterfaces().WLAN) {
mac = os.networkInterfaces().WLAN[0].mac;
console.log("wlan.mac===", mac);
} else {
mac = os.networkInterfaces()["以太网"][0].mac;
console.log("以太网.mac===", mac);
}
win.webContents.send("getOSmacRes", mac);
});
// ipcMain.on("getSerialPort", () => {
// SerialPort.SerialPort.list().then(
// (ports) => {
@ -165,7 +189,7 @@ app.whenReady().then(() => {
// 标签小票的窗口
const tagPrintWin = new BrowserWindow({
show: false,
width: 320,
width: 360,
height: 240,
webPreferences: {
nodeIntegration: true,
@ -196,7 +220,7 @@ app.whenReady().then(() => {
silent: true,
deviceName: name,
pageSize: {
width: 40000,
width: 45000,
height: 30000,
},
scaleFactor: 80,
@ -214,8 +238,21 @@ app.whenReady().then(() => {
},
});
});
});
const gotTheLock = app.requestSingleInstanceLock();
if (!gotTheLock) {
app.quit();
} else {
app.on("second-instance", (event, commandLine, workingDirectory) => {
// 当运行第二个实例时,将会聚焦到mainWindow这个窗口
if (win) {
if (win.isMinimized()) win.restore();
win.focus();
win.show();
}
});
}
});
app.on("window-all-closed", () => {
if (process.platform !== "darwin") app.quit();
});

View File

@ -1,7 +1,7 @@
{
"name": "vite-electron",
"private": true,
"version": "1.3.44",
"version": "1.3.52",
"main": "dist-electron/main.js",
"scripts": {
"dev": "chcp 65001 && vite",

View File

@ -9,24 +9,25 @@
html,
body {
width: 100%;
height: 100%;
width: 100vw;
height: 100vh;
}
body {
padding: 2mm;
padding: 10px;
}
#app {
width: 100%;
height: 100%;
overflow: hidden;
}
.print_view {
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
padding-left: 12px;
}
.print_view .ewm {
width: 50px;
@ -59,12 +60,12 @@ body {
align-items: flex-end;
}
.print_view .number_wrap .num {
font-size: 18px;
font-size: 14px;
font-weight: bold;
}
.print_view .number_wrap .info {
margin-left: 12px;
padding-bottom: 4px;
margin-left: 10px;
padding-bottom: 2px;
}
.print_view .time {
font-weight: bold;

View File

@ -7,21 +7,22 @@
}
html,
body {
width: 100%;
height: 100%;
width: 100vw;
height: 100vh;
}
body {
padding: 2mm;
padding: 10px;
}
#app{
#app {
width: 100%;
height: 100%;
overflow: hidden;
}
.print_view {
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
padding-left: 12px;
.ewm {
$size: 50px;
width: $size;
@ -46,12 +47,12 @@ body {
display: flex;
align-items: flex-end;
.num {
font-size: 18px;
font-size: 14px;
font-weight: bold;
}
.info {
margin-left: 12px;
padding-bottom: 4px;
margin-left: 10px;
padding-bottom: 2px;
}
}
.time {

View File

@ -22,6 +22,7 @@
</template>
<script setup>
import _ from 'lodash'
import { ref, reactive, watch, onMounted } from "vue";
import { useRouter, useRoute } from "vue-router";
import leftMenu from "@/components/leftMenu.vue";
@ -162,6 +163,20 @@ async function getBarCode(e) {
}
}
//
const updateInfo = _.throttle(function (isOnLine) {
console.log(isOnLine);
if (store.userInfo && store.userInfo.shopId) {
if (isOnLine) {
console.log('有网了重新连接ws~');
socket.init();
} else {
socket.close();
console.log('网络连接失败~');
}
}
}, 100, { leading: true, trailing: false })
onMounted(() => {
document.addEventListener("keydown", (e) => {
getBarCode(e);
@ -171,6 +186,11 @@ onMounted(() => {
if (store.userInfo && store.userInfo.shopId) {
socket.init();
}
// 线
window.addEventListener("onLine", updateInfo(true))
// 线
window.addEventListener("offLine", updateInfo(false))
});
</script>
@ -203,28 +223,20 @@ onMounted(() => {
--b-darker: calc(var(--b) * 0.8);
--primary-color: rgb(var(--r), var(--g), var(--b));
--primary-color-hover: rgb(
var(--r-lighter3),
--primary-color-hover: rgb(var(--r-lighter3),
var(--g-lighter3),
var(--b-lighter3)
);
var(--b-lighter3));
--el-color-primary: var(--primary-color) !important;
--el-button-hover-bg-color: var(--primary-color) !important;
--el-color-primary-light-3: rgb(
var(--r-lighter),
--el-color-primary-light-3: rgb(var(--r-lighter),
var(--g-lighter),
var(--b-lighter)
) !important;
--el-color-primary-dark-2: rgb(
var(--r-darker),
var(--b-lighter)) !important;
--el-color-primary-dark-2: rgb(var(--r-darker),
var(--g-darker),
var(--b-darker)
) !important;
--el-color-primary-light-5: rgb(
var(--r-lighter2),
var(--b-darker)) !important;
--el-color-primary-light-5: rgb(var(--r-lighter2),
var(--g-lighter2),
var(--b-lighter2)
) !important;
var(--b-lighter2)) !important;
--el-font-size-base: 16px !important;
--el-message-close-size: var(--el-font-size-base) !important;
@ -279,8 +291,7 @@ html {
background-color: #555;
margin-right: 0 !important;
padding-bottom: 20px !important;
border-radius: var(--el-dialog-border-radius) var(--el-dialog-border-radius) 0
0;
border-radius: var(--el-dialog-border-radius) var(--el-dialog-border-radius) 0 0;
}
.el-dialog__title {
@ -301,8 +312,7 @@ html {
}
.el-dialog__body {
padding: calc(var(--el-dialog-padding-primary) + 10px)
var(--el-dialog-padding-primary);
padding: calc(var(--el-dialog-padding-primary) + 10px) var(--el-dialog-padding-primary);
}
.el-dialog__header {
@ -390,7 +400,7 @@ html {
display: flex;
width: 200%;
& > div {
&>div {
width: 50%;
}

View File

@ -80,7 +80,8 @@
<takeFoodCode
ref="takeFoodCodeRef"
title="支付密码"
type="password"
:type="2"
input-type="password"
placeholder="请输入支付密码"
@success="passwordSuccess"
/>
@ -141,7 +142,7 @@ function payTypeChange(index, item) {
if (money.value > 0) {
scanModalRef.value.show();
} else {
ElMessage.error("请输入大于0的金额");
ElMessage.error("请输入金额");
return;
}
}
@ -173,13 +174,13 @@ async function confirmOrder() {
try {
if (payList.value[payActive.value].payType == "scanCode") {
if (money.value <= 0) {
ElMessage.error("请输入大于0的金额");
ElMessage.error("请输入金额");
return;
}
scanModalRef.value.show();
} else {
if (money.value <= 0) {
ElMessage.error("请输入大于0的金额");
ElMessage.error("请输入金额");
return;
}
switch (payList.value[payActive.value].payType) {

View File

@ -1,7 +1,7 @@
<!-- 取餐号组件 -->
<template>
<el-dialog :title="props.title" width="600" v-model="dialogVisible" @open="opne">
<el-input :type="props.type" v-model="number" :placeholder="props.placeholder" readonly></el-input>
<el-input :type="props.inputType" v-model="number" :placeholder="props.placeholder" readonly></el-input>
<div class="keybord_wrap">
<div v-for="item in 9" :key="item">
<el-button plain type="info" style="width: 100%" @click="inputHandle(item)">{{ item }}</el-button>
@ -24,11 +24,16 @@
<script setup>
import { ref } from "vue";
import { ElMessage } from "element-plus";
const props = defineProps({
type: {
type: [String, Number],
default: 1, // 1 2
},
inputType: {
type: String,
default: "text",
default: 'text'
},
title: {
type: String,
@ -66,8 +71,19 @@ function delHandle() {
//
function confirmHandle() {
if (!number.value) return
if (props.type == 2) {
if (number.value.length < 6) {
ElMessage.error('请输入正确的密码')
return
} else {
emit("success", number.value);
dialogVisible.value = false;
}
} else {
emit("success", number.value);
dialogVisible.value = false;
}
}
defineExpose({

View File

@ -4,6 +4,7 @@ import { usePrint } from "@/store/print.js";
import { v4 as uuidv4 } from "uuid";
import useStorage from "@/utils/useStorage";
import ReconnectingWebSocket from "reconnecting-websocket";
import { ipcRenderer } from "electron";
export const useSocket = defineStore({
id: "socket",
@ -17,8 +18,12 @@ export const useSocket = defineStore({
// 创建uuid
createUUID() {
if (!useStorage.get("uuid")) {
useStorage.set("uuid", uuidv4());
ipcRenderer.send("getOSmacSync");
// useStorage.set("uuid", uuidv4());
ipcRenderer.on("getOSmacRes", (event, arg) => {
useStorage.set("uuid", arg);
this.uuid = useStorage.get("uuid");
});
} else {
this.uuid = useStorage.get("uuid");
}
@ -46,11 +51,8 @@ export const useSocket = defineStore({
this.ws.addEventListener("open", (event) => {
console.log("wss连接成功");
this.online = true;
// 清除心跳
this.clearHeartBeat();
this.startheartbeat();
this.ws.send(
JSON.stringify({
type: "connect",
@ -58,6 +60,7 @@ export const useSocket = defineStore({
clientId: this.uuid,
})
);
this.startheartbeat();
});
this.ws.addEventListener("message", (e) => {
@ -72,9 +75,10 @@ export const useSocket = defineStore({
);
// 接收订单消息,打印小票
// printBill(data)
// 打印标签小票
printStore.labelPrint(data);
} else if (data.type == "heartbeat") {
console.log("接收心跳");
}
});

View File

@ -1,162 +1,91 @@
<template>
<div class="orderbox">
<div class="orderbox_left">
<el-tabs
v-model="ordereData.status"
class="demo-tabs"
@tab-click="handleClick"
>
<el-tabs v-model="ordereData.status" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane label="全部" name="">
<div class="demo_tabs_div">
<el-input
v-model="ordereData.orderNo"
placeholder="请输入订单号查询"
@input="inputChange"
clearable
@focus="global.updateData(false)"
@blur="global.updateData(true)"
/>
<el-input v-model="ordereData.orderNo" placeholder="请输入订单号查询" @input="inputChange" clearable
@focus="global.updateData(false)" @blur="global.updateData(true)" />
<!-- <el-button style="margin-left: 10px;" type="primary" @click="onSubmit">搜索</el-button> -->
</div>
<add
:loading="loadingboxshow"
:ordereData="ordereData"
@emititemboxshow="emititemboxshow"
v-if="ordereData.list.length"
>
<add :loading="loadingboxshow" :ordereData="ordereData" @emititemboxshow="emititemboxshow"
v-if="ordereData.list.length">
</add>
<div v-else style="width: 100%; text-align: center; margin: 30px 0">
暂无数据
</div>
<el-pagination
v-if="ordereData.list.length"
layout="prev, pager, next, jumper"
style="margin-top: 20px"
:total="Number(ordereData.total)"
@current-change="handleCurrentChange"
/>
<el-pagination v-if="ordereData.list.length" layout="prev, pager, next, jumper" style="margin-top: 20px"
:total="Number(ordereData.total)" @current-change="handleCurrentChange" />
</el-tab-pane>
<el-tab-pane label="销售" name="closed">
<add
:ordereData="ordereData"
@emititemboxshow="emititemboxshow"
v-if="ordereData.list.length"
>
<add :ordereData="ordereData" @emititemboxshow="emititemboxshow" v-if="ordereData.list.length">
</add>
<div v-else style="width: 100%; text-align: center; margin: 30px 0">
暂无数据
</div>
<el-pagination
v-if="ordereData.list.length"
layout="prev, pager, next, jumper"
style="margin-top: 20px"
:total="Number(ordereData.total)"
@current-change="handleCurrentChange"
/>
<el-pagination v-if="ordereData.list.length" layout="prev, pager, next, jumper" style="margin-top: 20px"
:total="Number(ordereData.total)" @current-change="handleCurrentChange" />
</el-tab-pane>
<el-tab-pane label="退单" name="refund">
<add
:ordereData="ordereData"
@emititemboxshow="emititemboxshow"
v-if="ordereData.list.length"
>
<add :ordereData="ordereData" @emititemboxshow="emititemboxshow" v-if="ordereData.list.length">
</add>
<div v-else style="width: 100%; text-align: center; margin: 30px 0">
暂无数据
</div>
<el-pagination
v-if="ordereData.list.length"
layout="prev, pager, next, jumper"
style="margin-top: 20px"
:total="Number(ordereData.total)"
@current-change="handleCurrentChange"
/>
<el-pagination v-if="ordereData.list.length" layout="prev, pager, next, jumper" style="margin-top: 20px"
:total="Number(ordereData.total)" @current-change="handleCurrentChange" />
</el-tab-pane>
<el-tab-pane label="快捷收银" name="cash">
<cashTable />
</el-tab-pane>
</el-tabs>
</div>
<div
class="orderbox_right"
v-if="itemboxshow"
v-loading="orderDetaildata.loading"
:loading="loadingboxshow"
>
<div class="orderbox_right" v-if="itemboxshow" v-loading="orderDetaildata.loading" :loading="loadingboxshow">
<div class="orderbox_right_top">
<span>堂食订单</span>
<el-icon
:size="32"
style="color: var(--primary-color)"
@click="itemboxshow = false"
>
<el-icon :size="32" style="color: var(--primary-color)" @click="itemboxshow = false">
<CircleCloseFilled />
</el-icon>
</div>
<div class="tableDataclass">
<div class="orderbox_right_item">
<span class="span">订单号</span
><span class="nunber">{{ orderDetaildata.orderNo }}</span>
<span class="span">订单号</span><span class="nunber">{{ orderDetaildata.orderNo }}</span>
</div>
<div class="orderbox_right_item">
<span class="span">收银员</span
><span class="nunber">{{ orderDetaildata.userName }}</span>
<span class="span">收银员</span><span class="nunber">{{ orderDetaildata.userName }}</span>
</div>
<div class="orderbox_right_item">
<span class="span">创建时间</span
><span class="nunber">{{
<span class="span">创建时间</span><span class="nunber">{{
dayjs(orderDetaildata.createdAt).format("YYYY-MM-DD HH:mm:ss")
}}</span>
</div>
<div class="orderbox_right_item">
<span class="span">终端</span
><span class="nunber">{{ orderDetaildata.zdNo }}</span>
<span class="span">终端</span><span class="nunber">{{ orderDetaildata.zdNo }}</span>
</div>
<div class="orderbox_right_item">
<span class="span">会员</span
><span class="nunber">{{ orderDetaildata.memberName }}</span>
<span class="span">会员</span><span class="nunber">{{ orderDetaildata.memberName }}</span>
</div>
<div class="orderbox_right_item">
<span class="span">台桌</span
><span class="nunber">{{ orderDetaildata.tableId }}</span>
<span class="span">台桌</span><span class="nunber">{{ orderDetaildata.tableId }}</span>
</div>
<div class="orderbox_right_item">
<span class="span">流水号</span
><span class="nunber">{{ orderDetaildata.masterId }}</span>
<span class="span">流水号</span><span class="nunber">{{ orderDetaildata.masterId }}</span>
</div>
<div
class="orderbox_right_top"
style="margin-top: 20px; border-bottom: 2px solid #ccc"
>
<div class="orderbox_right_top" style="margin-top: 20px; border-bottom: 2px solid #ccc">
<span>合计</span>
<span>{{ orderDetaildata.orderAmount }}</span>
</div>
<div
class="orderbox_right_top"
style="margin-top: 20px; border-bottom: 2px solid #ccc"
>
<span
style="font-size: 16px"
v-if="orderDetaildata.status == 'pending'"
>挂单</span
>
<span
style="font-size: 16px; color: red"
v-if="
<div class="orderbox_right_top" style="margin-top: 20px; border-bottom: 2px solid #ccc">
<span style="font-size: 16px" v-if="orderDetaildata.status == 'pending'">挂单</span>
<span style="font-size: 16px; color: red" v-if="
orderDetaildata.status == 'refund' &&
orderDetaildata.orderType == 'return'
"
>退单</span
>
<span
style="font-size: 16px; color: #21c36b"
v-if="
">退单</span>
<span style="font-size: 16px; color: #21c36b" v-if="
orderDetaildata.orderType != 'return' &&
(orderDetaildata.status == 'refund' ||
orderDetaildata.status == 'closed')
"
>订单完成</span
>
">订单完成</span>
</div>
<div class="orderbox_right_top" style="margin-top: 20px">
<span>商品明细</span>
@ -168,19 +97,13 @@
<div>单价</div>
<div>小计</div>
</div>
<div
class="orderbox_right_list_item"
style="margin-top: 20px"
v-for="(item, index) in orderDetaildata.detailList"
:key="index"
>
<div class="orderbox_right_list_item" style="margin-top: 20px"
v-for="(item, index) in orderDetaildata.detailList" :key="index">
<div>{{ item.productName }} {{ item.productSkuName }}</div>
<div style="text-align: center">{{ item.num }}</div>
<div style="text-align: center">{{ item.price }}</div>
<div v-if="item.status == 'refund'">
<span style="border: 2px solid red; color: red; padding: 4px 2px"
>已退</span
>
<span style="border: 2px solid red; color: red; padding: 4px 2px">已退</span>
</div>
<div v-else>{{ item.priceAmount }}</div>
</div>
@ -189,42 +112,26 @@
<div class="orderbox_right_button" ref="reforderboxrightbutton">
<div class="orderbox_right_buttonbutton">
<el-button
style="width: 100%"
type="warning"
:loading="callLoading"
@click="callNumberHandle"
>
<el-button style="width: 100%" type="warning" :loading="callLoading" @click="callNumberHandle">
叫号
</el-button>
</div>
<div class="orderbox_right_buttonbutton">
<el-button
style="width: 100%"
v-if="
<el-button style="width: 100%" v-if="
orderDetaildata.orderType != 'return' &&
(orderDetaildata.status == 'refund' ||
orderDetaildata.status == 'closed')
"
type="primary"
@click="recharge = true"
>退单</el-button
>
" type="primary" @click="recharge = true">退单</el-button>
</div>
<div class="orderbox_right_buttonbutton">
<el-button @click="print('normal')" style="flex: 1"
>重打收银打票</el-button
>
<el-button @click="print('label')" style="flex: 1"
>重打标签小票</el-button
>
<el-button @click="print('normal')" style="flex: 1">重打收银打票</el-button>
<el-button @click="print('label')" style="flex: 1">重打标签小票</el-button>
</div>
</div>
</div>
<div class="orderbox_rightbox" v-else>
<div class="orderbox_rightbox_top">
<div
style="
<div style="
padding: 6px;
background: #187ead;
border-radius: 50%;
@ -233,8 +140,7 @@
display: flex;
align-items: center;
justify-content: center;
"
>
">
<el-icon :size="30" color="#fff">
<Document />
</el-icon>
@ -269,23 +175,11 @@
</div>
</div> -->
</div>
<el-dialog
v-model="recharge"
title="退单"
width="800"
:before-close="handlerecharge"
>
<el-dialog v-model="recharge" title="退单" width="800" :before-close="handlerecharge">
<div class="recharge_footer">
<div class="recharge_footer_item">
<el-input
v-model="remark"
style="width: 100%"
:rows="2"
type="textarea"
placeholder="请输入退单原因"
@focus="global.updateData(false)"
@blur="global.updateData(true)"
/>
<el-input v-model="remark" style="width: 100%" :rows="2" type="textarea" placeholder="请输入退单原因"
@focus="global.updateData(false)" @blur="global.updateData(true)" />
<div class="recharge_footer_items" @click="remark = '顾客取消'">
<div>顾客取消</div>
</div>
@ -322,41 +216,22 @@
</div>
<div class="recharge_footer_itemright_botton">
<div class="recharge_footer_itemright_botton_top">
<el-checkbox
@change="changezong"
v-model="changechecked"
size="large"
/><span style="margin-left: 10px"></span>
<el-checkbox @change="changezong" v-model="changechecked" size="large" /><span
style="margin-left: 10px">全选共项目</span>
</div>
<div
class="recharge_footer_itemright_botton_item"
v-for="(item, index) in orderDetaildata.detailList"
:key="index"
>
<div class="recharge_footer_itemright_botton_item" v-for="(item, index) in orderDetaildata.detailList"
:key="index">
<div class="recharge_footer_itemright_botton_itemone">
<el-checkbox
@change="changezong(item, index, 1, 'quan')"
:disabled="item.status == 'refund' ? true : false"
v-model="item.checked"
size="large"
/>
<el-checkbox @change="changezong(item, index, 1, 'quan')"
:disabled="item.status == 'refund' ? true : false" v-model="item.checked" size="large" />
<span style="margin-left: 10px">{{ item.productName }}</span>
</div>
<div class="recharge_footer_itemright_botton_itemtow">
<!-- {{ item.num }} -->
<el-input-number
v-model="item.num"
:min="1"
size="small"
:disabled="item.status == 'refund' ? true : false"
:max="item.maxnum"
@change="
(currentValue, oldValue) =>
<el-input-number v-model="item.num" :min="1" size="small"
:disabled="item.status == 'refund' ? true : false" :max="item.maxnum" @change="(currentValue, oldValue) =>
changezong(item, index, 1, 'num', currentValue, oldValue)
"
@focus="global.updateData(false)"
@blur="global.updateData(true)"
/>
" @focus="global.updateData(false)" @blur="global.updateData(true)" />
<!-- @change="changezong(item, index, 1, 'num')" -->
</div>
<div class="recharge_footer_itemright_botton_itemthere">
@ -374,12 +249,8 @@
</div>
</div>
<div class="recharge_footer_itemright_botton_boxtow">
<el-button
type="primary"
style="width: 100%; height: 100%"
:loading="buttonloading"
@click="payreturnOrderclick"
>
<el-button type="primary" style="width: 100%; height: 100%" :loading="buttonloading"
@click="payreturnOrderclick">
<span v-if="!buttonloading">支付退回</span>
<span v-else>支付退回...</span>
</el-button>
@ -389,13 +260,7 @@
</div>
</el-dialog>
</div>
<takeFoodCode
ref="takeFoodCodeRef"
title="支付密码"
type="password"
placeholder="请输入支付密码"
@success="passwordSuccess"
/>
<takeFoodCode ref="takeFoodCodeRef" title="支付密码" type="password" placeholder="请输入支付密码" @success="passwordSuccess" />
</template>
<script setup>
@ -467,7 +332,8 @@ async function passwordSuccess(pwd) {
return item && item;
});
if (arr.length != 0) {
await payreturnOrder(arr, md5(pwd));
// await payreturnOrder(arr, md5(pwd));
await payreturnOrder(arr, '');
changechecked.value = false;
recharge.value = false;
itemboxshow.value = false;
@ -492,7 +358,8 @@ const payreturnOrderclick = lodash.debounce(
ElMessage.error("退款金额不能为0");
return false;
}
takeFoodCodeRef.value.show();
// takeFoodCodeRef.value.show();
passwordSuccess()
},
500,
{ leading: true, trailing: false }