This commit is contained in:
gyq 2024-05-28 11:05:50 +08:00
parent c54304f3d6
commit 6d7db2d743
4 changed files with 24 additions and 63 deletions

View File

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

View File

@ -73,7 +73,7 @@ function refundConfirm() {
// 退
function refundNumChange(e) {
refundForm.refundAmount = Math.floor(newRow.value.orderAmount / e * 100) / 100
refundForm.refundAmount = Math.floor(newRow.value.orderAmount / newRow.value.number * e * 100) / 100
}
//

View File

@ -128,7 +128,7 @@ function getPrintList() {
ipcRenderer.send("getPrintList");
ipcRenderer.on("printList", (event, arg) => {
localPrintList.value = arg;
console.log(localPrintList.value);
// console.log(localPrintList.value);
});
}

View File

@ -32,13 +32,8 @@
</div>
<div class="shop_operation" v-loading="cartLoading">
<div class="shop_list">
<div
class="item"
:class="{ active: cartListActive == index }"
v-for="(item, index) in cartList"
:key="item.id"
@click="selectCartItemHandle(item, index)"
>
<div class="item" :class="{ active: cartListActive == index }" v-for="(item, index) in cartList"
:key="item.id" @click="selectCartItemHandle(item, index)">
<div class="name_wrap">
<span>{{ item.name }}</span>
<span>{{ item.salePrice }}</span>
@ -50,20 +45,12 @@
</div>
<div class="num">
<div class="left">
<div
class="icon_item"
v-if="item.isGift == 'true'"
@click="giftPackHandle('isGift', item)"
>
<div class="icon_item" v-if="item.isGift == 'true'" @click="giftPackHandle('isGift', item)">
<el-icon class="icon">
<ShoppingBag />
</el-icon>
</div>
<div
class="icon_item"
v-if="item.isPack == 'true'"
@click="giftPackHandle('isPack', item)"
>
<div class="icon_item" v-if="item.isPack == 'true'" @click="giftPackHandle('isPack', item)">
<el-icon class="icon" style="color: var(--primary-color)">
<Box />
</el-icon>
@ -77,13 +64,8 @@
</div>
</div>
<!-- 购物车操作栏 -->
<cartOperation
:item="cartList[cartListActive]"
@confirm="(res) => addCart(res, 'edit')"
@delete="delCartHandle"
@pending="pendingCart"
@clearCart="clearCartHandle"
/>
<cartOperation :item="cartList[cartListActive]" @confirm="(res) => addCart(res, 'edit')" @delete="delCartHandle"
@pending="pendingCart" @clearCart="clearCartHandle" />
</div>
<div class="footer">
<div class="top">
@ -97,26 +79,17 @@
<el-text class="t">打包({{ cartInfo.packAmount || 0 }})</el-text>
</div>
<div class="num-wrap">
<el-text
>{{ cartInfo.productNum || 0 }}种商品{{
cartInfo.productSum || 0
}}</el-text
>
<el-text>{{ cartInfo.productNum || 0 }}种商品{{
cartInfo.productSum || 0
}}</el-text>
</div>
</div>
<div class="btm">
<el-button icon="Edit" @click="remarkRef.show()"></el-button>
<div class="button">
<el-button
type="primary"
style="width: 100%"
:disabled="!cartList.length"
v-loading="createOrderLoading"
@click="createOrderHandle"
>
<span v-if="!createOrderLoading"
>结算({{ cartInfo.totalAmount || 0 }})</span
>
<el-button type="primary" style="width: 100%" :disabled="!cartList.length" v-loading="createOrderLoading"
@click="createOrderHandle">
<span v-if="!createOrderLoading">结算({{ cartInfo.totalAmount || 0 }})</span>
<span v-else>下单中...</span>
</el-button>
</div>
@ -133,30 +106,13 @@
<remarkModal ref="remarkRef" @success="(e) => (remark = e)" />
<!-- 修改取餐号 -->
<takeFoodCode />
<el-drawer
v-model="membershow"
:with-header="true"
size="90%"
title="选择会员"
>
<el-drawer v-model="membershow" :with-header="true" size="90%" title="选择会员">
<member :membershow="'1'"></member>
</el-drawer>
<takeFoodCode
ref="takeFoodCodeRef"
title="修改取餐号"
placeholder="请输入取餐号"
@success="takeFoodCodeSuccess"
/>
<takeFoodCode ref="takeFoodCodeRef" title="修改取餐号" placeholder="请输入取餐号" @success="takeFoodCodeSuccess" />
<!-- 结算订单 -->
<settleAccount
ref="settleAccountRef"
:cart="cartList"
:amount="cartInfo.totalAmount"
:remark="remark"
:masterId="masterId"
:orderInfo="orderInfo"
@paySuccess="createCodeAjax(1)"
/>
<settleAccount ref="settleAccountRef" :cart="cartList" :amount="cartInfo.totalAmount" :remark="remark"
:masterId="masterId" :orderInfo="orderInfo" @paySuccess="createCodeAjax(1)" />
<!-- 快捷收银 -->
<fastCashier ref="fastCashierRef" />
<!-- 挂起订单 -->
@ -170,6 +126,7 @@ export default {
</script>
<script setup>
import { onMounted, ref } from "vue";
import { useRoute } from 'vue-router'
import { useUser } from "@/store/user.js";
import remarkModal from "@/components/remarkModal.vue";
import takeFoodCode from "@/components/takeFoodCode.vue";
@ -193,6 +150,8 @@ import {
import goods from "@/views/home/components/goods.vue";
import member from "@/views/member/index.vue";
const route = useRoute()
const membershow = ref(false);
const store = useUser();
const remarkRef = ref(null);
@ -412,6 +371,8 @@ async function createCodeAjax(type = "0") {
onMounted(() => {
createCodeAjax();
console.log('route', JSON.parse(route.query.user));
});
</script>