新增快捷收银
This commit is contained in:
55
src/views/home/components/fastCashier.vue
Normal file
55
src/views/home/components/fastCashier.vue
Normal file
@@ -0,0 +1,55 @@
|
||||
<template>
|
||||
<el-drawer
|
||||
size="100%"
|
||||
:with-header="false"
|
||||
direction="btt"
|
||||
v-model="dialogVisible"
|
||||
>
|
||||
<div class="drawer_wrap">
|
||||
<div class="pay_wrap">
|
||||
<fastPayCard
|
||||
ref="fastPayCardRef"
|
||||
@paySuccess="paySuccess"
|
||||
@close="dialogVisible = false"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
import fastPayCard from "@/components/fastPayCard.vue";
|
||||
|
||||
const emit = defineEmits(["paySuccess"]);
|
||||
|
||||
const dialogVisible = ref(false);
|
||||
const fastPayCardRef = ref(null);
|
||||
|
||||
// 订单已支付
|
||||
function paySuccess() {
|
||||
dialogVisible.value = false;
|
||||
emit("paySuccess");
|
||||
}
|
||||
|
||||
function show() {
|
||||
dialogVisible.value = true;
|
||||
fastPayCardRef.value.reset();
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
show,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.drawer_wrap {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
padding: var(--el-font-size-base) 0;
|
||||
.pay_wrap {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -151,41 +151,41 @@ async function bySubTypeAjax() {
|
||||
}
|
||||
|
||||
async function printHandle() {
|
||||
try {
|
||||
if (!isPrint.value) return;
|
||||
if (printList.value.length) {
|
||||
const data = {
|
||||
shop_name: store.userInfo.merchantName,
|
||||
carts: props.cart,
|
||||
amount: props.amount,
|
||||
remark: props.remark,
|
||||
orderInfo: props.orderInfo,
|
||||
deviceName: printList.value[0].config.deviceName,
|
||||
createdAt: dayjs(props.orderInfo.createdAt).format(
|
||||
"YYYY-MM-DD HH:mm:ss"
|
||||
),
|
||||
printTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
|
||||
};
|
||||
ipcRenderer.send("printerInfoSync", JSON.stringify(data));
|
||||
} else {
|
||||
ElMessage.error("您还没有添加打印设备");
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
// try {
|
||||
// printLoading.value = true;
|
||||
// await print({
|
||||
// type: "normal",
|
||||
// ispre: true,
|
||||
// orderId: props.orderInfo.id,
|
||||
// });
|
||||
// printLoading.value = false;
|
||||
// ElMessage.success("打印成功");
|
||||
// if (!isPrint.value) return;
|
||||
// if (printList.value.length) {
|
||||
// const data = {
|
||||
// shop_name: store.userInfo.merchantName,
|
||||
// carts: props.cart,
|
||||
// amount: props.amount,
|
||||
// remark: props.remark,
|
||||
// orderInfo: props.orderInfo,
|
||||
// deviceName: printList.value[0].config.deviceName,
|
||||
// createdAt: dayjs(props.orderInfo.createdAt).format(
|
||||
// "YYYY-MM-DD HH:mm:ss"
|
||||
// ),
|
||||
// printTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
|
||||
// };
|
||||
// ipcRenderer.send("printerInfoSync", JSON.stringify(data));
|
||||
// } else {
|
||||
// ElMessage.error("您还没有添加打印设备");
|
||||
// }
|
||||
// } catch (error) {
|
||||
// printLoading.value = false;
|
||||
// console.log(error);
|
||||
// }
|
||||
try {
|
||||
printLoading.value = true;
|
||||
await print({
|
||||
type: "normal",
|
||||
ispre: true,
|
||||
orderId: props.orderInfo.id,
|
||||
});
|
||||
printLoading.value = false;
|
||||
ElMessage.success("打印成功");
|
||||
} catch (error) {
|
||||
printLoading.value = false;
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
// 订单已支付
|
||||
|
||||
@@ -11,6 +11,15 @@
|
||||
<div class="number" @click="takeFoodCodeRef.show()">
|
||||
<el-text class="t">{{ masterId }}</el-text>
|
||||
</div>
|
||||
<div class="select_user" @click="fastCashierRef.show()">
|
||||
<el-icon class="icon">
|
||||
<WalletFilled />
|
||||
</el-icon>
|
||||
<el-text class="t">快捷收银</el-text>
|
||||
<el-icon class="arrow">
|
||||
<ArrowRight />
|
||||
</el-icon>
|
||||
</div>
|
||||
<!-- <div class="select_user" @click="membershow = true">
|
||||
<el-icon class="icon">
|
||||
<UserFilled />
|
||||
@@ -148,6 +157,8 @@
|
||||
:orderInfo="orderInfo"
|
||||
@paySuccess="createCodeAjax(1)"
|
||||
/>
|
||||
<!-- 快捷收银 -->
|
||||
<fastCashier ref="fastCashierRef" />
|
||||
<!-- 挂起订单 -->
|
||||
<pendingCartModal ref="pendingCartModalRef" @select="pendingCartHandle" />
|
||||
</template>
|
||||
@@ -164,6 +175,7 @@ import remarkModal from "@/components/remarkModal.vue";
|
||||
import takeFoodCode from "@/components/takeFoodCode.vue";
|
||||
import cartOperation from "@/views/home/components/cartOperation.vue";
|
||||
import settleAccount from "@/views/home/components/settleAccount.vue";
|
||||
import fastCashier from "@/views/home/components/fastCashier.vue";
|
||||
import pendingCartModal from "@/views/home/components/pendingCartModal.vue";
|
||||
|
||||
import {
|
||||
@@ -188,6 +200,7 @@ const takeFoodCodeRef = ref(null);
|
||||
const goodsRef = ref(null);
|
||||
const pendingCartModalRef = ref(null);
|
||||
const settleAccountRef = ref(null);
|
||||
const fastCashierRef = ref(null);
|
||||
|
||||
const allSelected = ref(false);
|
||||
|
||||
@@ -332,7 +345,7 @@ async function addCart(params, type = "add") {
|
||||
skuId: type == "add" ? params.id : params.skuId,
|
||||
number: params.number || 1,
|
||||
isPack: params.isPack || "false",
|
||||
isGift: params.isGift || 'false',
|
||||
isGift: params.isGift || "false",
|
||||
cartId: type == "add" ? "" : params.id,
|
||||
uuid: params.uuid || store.userInfo.uuid,
|
||||
type: type,
|
||||
@@ -455,7 +468,7 @@ onMounted(() => {
|
||||
|
||||
.icon {
|
||||
color: var(--el-color-primary);
|
||||
font-size: 24px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.t {
|
||||
|
||||
Reference in New Issue
Block a user