From 3df0cce9ecd1c3eda3d482bfe6cfe7eda821932b Mon Sep 17 00:00:00 2001 From: gyq <875626088@qq.com> Date: Tue, 11 Mar 2025 09:10:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E6=94=AF=E4=BB=98=E4=BC=98?= =?UTF-8?q?=E6=83=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 7 +- .env.production | 2 +- src/App.vue | 6 +- src/api/account.js | 150 +++++ src/api/order.js | 41 +- src/components/classify/index.vue | 75 ++- src/components/leftMenu.vue | 2 +- src/components/lodop/lodopPrintWork.js | 103 +-- src/components/more.vue | 12 +- src/components/payCard/couponModal.vue | 216 +++++++ src/components/payCard/payCard.vue | 620 +++++++++++++++---- src/components/payCard/scanModal.vue | 23 +- src/components/selectVipUser.vue | 26 +- src/store/goods.js | 17 +- src/store/print.js | 94 +-- src/store/socket.js | 11 +- src/store/user.js | 41 +- src/utils/index.js | 24 +- src/utils/request.js | 4 +- src/views/device/add.vue | 182 +++--- src/views/device/add_label.vue | 106 ++-- src/views/device/index.vue | 22 +- src/views/home/components/settleAccount.vue | 152 ++--- src/views/home/components/settleItem.vue | 5 - src/views/home/index.vue | 52 +- src/views/login.vue | 4 +- src/views/member/components/recordDialog.vue | 4 +- src/views/order/components/printDrawer.vue | 45 +- src/views/table/components/tableInfo.vue | 25 +- src/views/work/index.vue | 145 ++--- src/views/work/record.vue | 157 ++--- 31 files changed, 1527 insertions(+), 846 deletions(-) create mode 100644 src/components/payCard/couponModal.vue diff --git a/.env.development b/.env.development index 781df07..5edb718 100644 --- a/.env.development +++ b/.env.development @@ -11,7 +11,7 @@ VITE_API_WSS = 'wss://sockets.sxczgkj.com/wss' # VITE_API_WSS = 'ws://192.168.2.17:9998/client' # 正式 php -VITE_API_PHP_URL = 'https://czgdoumei.sxczgkj.com/index.php/api' +VITE_API_PHP_URL = 'https://newblockwlx.sxczgkj.cn/index.php/api' # 测试 php 开票 # VITE_API_KP_URL = 'http://192.168.1.13:8888/api' @@ -34,9 +34,12 @@ VITE_API_KP_URL = 'https://invoice.sxczgkj.cn/api' # 张松本地 # VITE_API_URL = 'https://36z1017t45.goho.co/cashier-client' +# 谭凯凯 +VITE_API_URL = 'http://192.168.1.35/' + # 正式 # VITE_API_URL = 'https://cashierclient.sxczgkj.cn/cashier-client' # 正式 -VITE_API_URL = 'https://tapi.cashier.sxczgkj.cn' +# VITE_API_URL = 'https://tapi.cashier.sxczgkj.cn' diff --git a/.env.production b/.env.production index 7aa9f5d..ec77084 100644 --- a/.env.production +++ b/.env.production @@ -5,7 +5,7 @@ ENV = production VITE_API_WSS = 'wss://cashier.sxczgkj.cn/client' # 正式 php -VITE_API_PHP_URL = 'https://czgdoumei.sxczgkj.com/index.php/api' +VITE_API_PHP_URL = 'https://newblockwlx.sxczgkj.cn/index.php/api' # 正式 php 开票 VITE_API_KP_URL = 'https://invoice.sxczgkj.cn/api' diff --git a/src/App.vue b/src/App.vue index c7b11da..fc1fb9e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -36,15 +36,10 @@ import { ipcRenderer } from 'electron'; import { useGoods } from '@/store/goods.js' const goodsStore = useGoods() - const socket = useSocket(); - const global = useGlobal(); - const leftMenuRef = ref(null); - const store = useUser(); - const route = useRoute(); const includeList = reactive([]); @@ -177,6 +172,7 @@ onMounted(() => { // 防止刷新页面长连接丢失 if (store.userInfo && store.userInfo.id) { goodsStore.initGoods() + store.getShopInfo() } ipcRenderer.on('showCloseDialog', (event, arg) => { diff --git a/src/api/account.js b/src/api/account.js index fc1ea75..236d938 100644 --- a/src/api/account.js +++ b/src/api/account.js @@ -13,6 +13,19 @@ export function login(data) { }); } +/** + * 退出登录 + * @param {*} data + * @returns + */ +export function logout(data) { + return request({ + method: "post", + url: "/account/admin/auth/logout", + data, + }); +} + /** * 验证码获取 * @param {*} params @@ -39,6 +52,19 @@ export function shopInfo_detail(params) { }); } +/** + * 获取当前店铺拓展通过key + * @param {*} params + * @returns + */ +export function shopExtendDetail(params) { + return request({ + method: "get", + url: "/account/admin/shopExtend/detail", + params, + }); +} + /** * 获取店铺用户列表 * @param {*} params @@ -232,3 +258,127 @@ export function callTableCallState(data) { data, }); } + +/** + * 收银机-交班数据统计 + */ +export function handoverTotal(params) { + return request({ + method: "get", + url: "/account/admin/handover-record/total", + params, + }); +} + +/** + * 收银机-交班 + */ +export function handover(isPrint) { + return request({ + method: "post", + url: "/account/admin/handover-record/handover?isPrint=" + isPrint, + }); +} + +/** + * 收银机-交班记录-详情 + */ +export function handoverData(id) { + return request({ + method: "get", + url: `/account/admin/handover-record/detail/${id}`, + }); +} + +/** + * 交班记录-分页 + */ +export function handoverRecordPage(params) { + return request({ + method: "get", + url: `/account/admin/handover-record/page`, + params, + }); +} + +/** + * 收银机-交班/关班-网络打印机打印交班小票 + */ +export function handoverNetworkPrint(id) { + return request({ + method: "post", + url: `/account/admin/handover-record/network/print/${id}`, + }); +} + +/** + * 打印机列表 + */ +export function printerList(subType = "") { + return request({ + method: "get", + url: "/account/admin/printer", + params: { + name: "", + subType: subType, + connectionType: "USB", + page: 1, + size: 100, + }, + }); +} + +/** + * 打印机详情 + */ +export function printerDetail(params) { + return request({ + method: "get", + url: "/account/admin/printer/detail", + params, + }); +} + +/** + * 新增打印机 + */ +export function printerAdd(data, method = "post") { + return request({ + method: method, + url: "/account/admin/printer", + data, + }); +} + +/** + * 查找优惠券 生成订单后使用 + */ +export function findCoupon(params) { + return request({ + method: "get", + url: "/account/admin/coupon/findCoupon", + params, + }); +} + +/** + * 002-获取订单可用积分及抵扣金额(支付页面使用) + */ +export function calcUsablePoints(params) { + return request({ + method: "get", + url: "/account/admin/points/memberPoints/calcUsablePoints", + params, + }); +} + +/** + * 003-根据积分计算可抵扣金额 + */ +export function calcDeductionAmount(params) { + return request({ + method: "get", + url: "/account/admin/points/memberPoints/calcDeductionAmount", + params, + }); +} diff --git a/src/api/order.js b/src/api/order.js index 8e895e1..3b14d71 100644 --- a/src/api/order.js +++ b/src/api/order.js @@ -99,7 +99,7 @@ export function refundOrder(data) { export function getOrderById(params) { return request({ method: "get", - url: "/order/admin/order/getOrderById", + url: "/order/admin/order/getOrderByIdPrint", params, }); } @@ -155,3 +155,42 @@ export function refundVip(data) { data, }); } + +/** + * 挂账人 - 分页 + * @param {*} data + * @returns + */ +export function buyerPage(params) { + return request({ + method: "get", + url: "/order/admin/order/credit/buyer/page", + params, + }); +} + +/** + * 挂账人 - 付款 + * @param {*} data + * @returns + */ +export function creditPay(data) { + return request({ + method: "post", + url: "/order/pay/creditPay", + data, + }); +} + +/** + * 挂账人 - 会员支付订单 + * @param {*} data + * @returns + */ +export function vipPay(data) { + return request({ + method: "post", + url: "/order/pay/vipPay", + data, + }); +} diff --git a/src/components/classify/index.vue b/src/components/classify/index.vue index 77984b9..88b051c 100644 --- a/src/components/classify/index.vue +++ b/src/components/classify/index.vue @@ -5,8 +5,8 @@
{{ item.name }}
全部 - {{ val.name }} +
@@ -18,9 +18,11 @@ + + \ No newline at end of file diff --git a/src/components/payCard/payCard.vue b/src/components/payCard/payCard.vue index c274d97..708c767 100644 --- a/src/components/payCard/payCard.vue +++ b/src/components/payCard/payCard.vue @@ -7,10 +7,11 @@ {{ money }}
- 原价:¥{{ formatDecimal(props.amount) }} + 原价:¥{{ formatDecimal(props.amount - goodsStore.tableInfo.tableFee) }} + 餐位费:¥{{ formatDecimal(goodsStore.tableInfo.tableFee) }} 优惠:¥{{ formatDecimal(props.amount - money) }} - 折扣:{{ - formatDecimal(props.discount * 10, 1, true) }}折 + + 折扣:{{ discountRateVlaue }}折 @@ -27,7 +28,7 @@
{{ item.payName }} - +
-
储值:¥{{ money }}
+
付款:¥{{ money }}
添加优惠
@@ -99,7 +100,7 @@ :total="Number(tableData.total)" v-model:current-page="tableData.page" @current-change="getMemberList" /> - + @@ -110,7 +111,7 @@ - + @@ -143,49 +144,128 @@ - - - - - - - - + +
+ + + + + + + +
+
+ + + +
+ 清除 +
+
+ +
+ 选择优惠券 +
+
优惠券
+ + + + + + + + + + + + + +
+
+
商品券
+ + + + + + + + + + + + +
+
+
+ + + + + +
注意:订单金额不足¥{{ + formatDecimal(+pointOptions.minPaymentAmount) }},无法使用积分抵扣 +
+
+ +
+ {{ formatDecimal(+couponForm.amount) }} +
+
+
+
+
+ + + + diff --git a/src/components/payCard/scanModal.vue b/src/components/payCard/scanModal.vue index a69fc95..285304e 100644 --- a/src/components/payCard/scanModal.vue +++ b/src/components/payCard/scanModal.vue @@ -58,7 +58,7 @@ import { scanpay, queryOrder, quickPay, queryQuickPayStatus, accountPay, querySc import { useUser } from "@/store/user.js"; import { useGlobal } from '@/store/global.js' import { formatDecimal } from '@/utils' -import { microPay, queryOrderStatus, microPayVip } from '@/api/order.js' +import { microPay, queryOrderStatus, microPayVip, vipPay } from '@/api/order.js' const store = useUser(); const global = useGlobal() @@ -89,6 +89,7 @@ const props = defineProps({ type: Boolean, default: false, }, + // 支付类型 payType: { type: [Number, String], default: "", @@ -119,11 +120,20 @@ async function submitHandle() { if (!scanCode.value) return; loading.value = true; if (props.selecttype == 0) { - // 正常下单扫码支付 - await microPay({ - ...props.payData, - authCode: scanCode.value - }); + // 下单扫码支付 + if (props.payType == 'payType') { + + await microPay({ + ...props.payData, + authCode: scanCode.value + }); + } else if (props.payType == 'deposit') { + await vipPay({ + ...props.payData, + payType: 'scanCode', + authCode: scanCode.value + }); + } } else if (props.selecttype == 1) { // 会员扫码充值 await microPayVip({ @@ -133,6 +143,7 @@ async function submitHandle() { authCode: scanCode.value }) } else { + // 快捷收银 if (props.fast) { await quickPay({ amount: props.amount, diff --git a/src/components/selectVipUser.vue b/src/components/selectVipUser.vue index 1b41c94..7dd6e12 100644 --- a/src/components/selectVipUser.vue +++ b/src/components/selectVipUser.vue @@ -1,9 +1,16 @@