Compare commits
4 Commits
9a1654e728
...
33be9f2cef
| Author | SHA1 | Date | |
|---|---|---|---|
| 33be9f2cef | |||
| de84d30793 | |||
| adbecd1b5e | |||
| 26f298cb2d |
@@ -17,13 +17,13 @@ VITE_API_PHP_URL = 'https://newblockwlx.sxczgkj.cn/index.php/api'
|
||||
# VITE_API_KP_URL = 'http://192.168.1.13:8888/api'
|
||||
|
||||
# 正式 php 开票
|
||||
VITE_API_KP_URL = 'https://invoice.sxczgkj.cn/api'
|
||||
|
||||
# 本地调试连接
|
||||
VITE_API_URL = 'http://192.168.1.42/'
|
||||
# VITE_API_KP_URL = 'https://invoice.sxczgkj.cn/api'
|
||||
|
||||
# 线上测试
|
||||
# VITE_API_URL = 'https://tapi.cashier.sxczgkj.cn'
|
||||
|
||||
# 线上正式
|
||||
# VITE_API_URL = 'https://cashier.sxczgkj.com'
|
||||
# VITE_API_URL = 'https://cashier.sxczgkj.com'
|
||||
|
||||
# 本地调试连接
|
||||
VITE_API_URL = 'http://192.168.1.42/'
|
||||
17057
dist-electron/main.js
17057
dist-electron/main.js
File diff suppressed because one or more lines are too long
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "vite-electron",
|
||||
"private": true,
|
||||
"version": "2.0.11",
|
||||
"version": "2.0.15",
|
||||
"main": "dist-electron/main.js",
|
||||
"scripts": {
|
||||
"dev": "chcp 65001 && vite",
|
||||
|
||||
@@ -215,10 +215,13 @@
|
||||
<el-button type="danger" @click="clearPoint">清除</el-button>
|
||||
</div>
|
||||
<div class="point_tips err" v-if="couponFormUser.id && !pointOptions.usable">
|
||||
注意:{{ pointOptions.unusableReason || (`订单金额不足¥${formatDecimal(+pointOptions.minPaymentAmount)},无法使用积分抵扣`) }}
|
||||
注意:{{ pointOptions.unusableReason ||
|
||||
(`订单金额不足¥${formatDecimal(+pointOptions.minPaymentAmount)},无法使用积分抵扣`) }}
|
||||
</div>
|
||||
<div class="point_tips" v-if="couponFormUser.id && pointOptions.usable">
|
||||
说明:订单已满足使用门槛,当前积分可抵扣最多¥{{ pointOptions.potentialAmount }}(当前积分 {{ couponFormUser.accountPoints || 0 }})
|
||||
说明:订单已满足使用门槛,当前积分可抵扣最多¥{{ pointOptions.potentialAmount }}(当前积分 {{ couponFormUser.accountPoints
|
||||
|| 0
|
||||
}})
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -250,7 +253,7 @@ import { getPayType } from "@/api/account.js";
|
||||
import scanModal from "@/components/payCard/scanModal.vue";
|
||||
import SelectVipUser from '@/components/selectVipUser.vue'
|
||||
import CouponModal from '@/components/payCard/couponModal.vue'
|
||||
import { ElMessage } from "element-plus";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { staffPermission } from "@/api/user.js";
|
||||
import { cashPay, buyerPage, creditPay, vipPay } from "@/api/order.js";
|
||||
import { calcUsablePoints } from '@/api/account.js'
|
||||
@@ -467,6 +470,7 @@ function upadatePayData() {
|
||||
newCustomerDiscountId: goodsStore.newUserDiscount !== null ? goodsStore.newUserDiscount.id : goodsStore.newUserDiscount !== null ? goodsStore.newUserDiscount.id : '', // 新客立减Id
|
||||
newCustomerDiscountAmount: goodsStore.newUserDiscount !== null ? goodsStore.newUserDiscount.amount : 0, // 新客立减金额
|
||||
vipDiscountAmount: goodsStore.cartInfo.costSummary.vipDiscountAmount, // 超级会员折扣
|
||||
remark: '', // 现金支付备注
|
||||
}
|
||||
}
|
||||
|
||||
@@ -501,10 +505,22 @@ async function confirmOrder() {
|
||||
return;
|
||||
case "cash":
|
||||
//现金
|
||||
if (props.selecttype == 0) {
|
||||
payLoading.loading = true
|
||||
await cashPay(payData.value);
|
||||
}
|
||||
ElMessageBox.prompt('确定现金支付?', '注意', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
inputPlaceholder: '请输入备注(选填)',
|
||||
}).then(async ({ value }) => {
|
||||
payData.value.checkOrderPay.remark = value;
|
||||
if (props.selecttype == 0) {
|
||||
payLoading.loading = true
|
||||
await cashPay(payData.value);
|
||||
payLoading.value = false;
|
||||
emit("paySuccess");
|
||||
}
|
||||
}).catch(() => {
|
||||
payLoading.value = false;
|
||||
})
|
||||
return;
|
||||
break
|
||||
case "member-account":
|
||||
// 会员支付
|
||||
|
||||
@@ -119,6 +119,10 @@ export const useGlobal = defineStore("global", {
|
||||
},
|
||||
],
|
||||
bizCodes: [
|
||||
{
|
||||
type: "freeln",
|
||||
label: "霸王餐",
|
||||
},
|
||||
{
|
||||
type: "cashIn",
|
||||
label: "现金充值",
|
||||
|
||||
@@ -39,14 +39,7 @@ export const useGoods = defineStore("goods", {
|
||||
showVipPrice: 0,
|
||||
allSelected: 0, // 是否整单打包
|
||||
vipUserInfo: {}, // 会员信息
|
||||
// tableInfo: {
|
||||
// name: "测试A1",
|
||||
// id: 185,
|
||||
// num: 1,
|
||||
// tableCode: "3000101010",
|
||||
// }, // 台桌信息
|
||||
tableInfo: {
|
||||
id: "",
|
||||
name: "",
|
||||
num: "",
|
||||
tableCode: "",
|
||||
@@ -54,15 +47,6 @@ export const useGoods = defineStore("goods", {
|
||||
cartActiveIndex: 0, // 购物车激活索引,
|
||||
isCartInit: false,
|
||||
cartList: [], // 购物车列表
|
||||
// cartInfo: {
|
||||
// total: 0,
|
||||
// totalAmount: 0,
|
||||
// gifNumber: 0,
|
||||
// gifNumberAmount: 0,
|
||||
// saleNumber: 0,
|
||||
// saleNumberAmount: 0,
|
||||
// tableFee: 0,
|
||||
// },
|
||||
// 购物车信息,
|
||||
cartInfo: {
|
||||
costSummary: {
|
||||
@@ -301,6 +285,14 @@ export const useGoods = defineStore("goods", {
|
||||
}
|
||||
this.orderList = arr;
|
||||
// console.log("this.orderList===2222", this.orderList);
|
||||
|
||||
if (this.orderListInfo.tableCode && this.orderListInfo.tableName) {
|
||||
this.tableInfo = {
|
||||
tableCode: this.orderListInfo.tableCode,
|
||||
name: this.orderListInfo.tableName,
|
||||
num: this.orderListInfo.seatNum
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.orderList = [];
|
||||
this.orderListInfo = "";
|
||||
@@ -833,7 +825,7 @@ export const useGoods = defineStore("goods", {
|
||||
this.orderListInfo = "";
|
||||
|
||||
// 存在真实台桌,需要拉取历史订单
|
||||
if (this.tableInfo.id) {
|
||||
if (this.tableInfo.name) {
|
||||
await this.historyOrderAjax(this.tableInfo.tableCode);
|
||||
} else {
|
||||
this.calcCartInfo();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<el-dialog title="转桌/并桌" width="700px" v-model="visible" @closed="onClose" top="3vh">
|
||||
<div class="scroll_y">
|
||||
<el-form :model="form" ref="formRef" :rules="rules" label-position="top">
|
||||
<el-form-item label="当前台桌" v-if="goodsStore.tableInfo.id">
|
||||
<el-form-item label="当前台桌" v-if="goodsStore.tableInfo.name">
|
||||
{{ goodsStore.tableInfo.name }}
|
||||
</el-form-item>
|
||||
<el-form-item label="转入台桌" prop="targetTableId">
|
||||
@@ -120,9 +120,14 @@ async function queryShopTableAjax() {
|
||||
try {
|
||||
const res = await shopTable({
|
||||
// status: 'using',
|
||||
// isBind: true
|
||||
// isBind: true,
|
||||
page: 1,
|
||||
size: 999
|
||||
})
|
||||
tableList.value = res.records
|
||||
tableList.value = res.records.filter(item => item.tableCode != goodsStore.tableInfo.tableCode && item.tableCode)
|
||||
|
||||
console.log('tableList.value', tableList.value);
|
||||
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
@@ -141,6 +146,10 @@ function confirmHandle() {
|
||||
let targetOrderId = targetTable.orderId
|
||||
let targetTableCode = targetTable.tableCode
|
||||
let detailIds = []
|
||||
let allMerge = 0 // 是否全转
|
||||
|
||||
console.log('targetTable===', targetTable);
|
||||
|
||||
|
||||
if (form.value.isFull) {
|
||||
goodsStore.orderList.map((item, index) => {
|
||||
@@ -148,22 +157,29 @@ function confirmHandle() {
|
||||
detailIds.push(val.id)
|
||||
})
|
||||
})
|
||||
allMerge = 1
|
||||
} else {
|
||||
goodsStore.orderList.map((item, index) => {
|
||||
detailIds.push(...orderTableRefs.value[index].getSelectionRows().map(item => item.id))
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
if (detailIds.length) {
|
||||
const orderCount = goodsStore.orderList.reduce((total, item) => total + item.goods.length, 0)
|
||||
allMerge = orderCount == detailIds.length ? 1 : 0
|
||||
await mergeOrder({
|
||||
sourceOrderId: sourceOrderId, // 来源订单id
|
||||
targetOrderId: targetOrderId, // 目标台桌订单id
|
||||
targetTableCode: targetTableCode, // 目标台桌码
|
||||
detailIds: detailIds // 转台详情
|
||||
detailIds: detailIds, // 转台详情
|
||||
allMerge: allMerge // 是否全部转台
|
||||
})
|
||||
if (!goodsStore.cartList.length) {
|
||||
useStorage.set('tableCode', targetTableCode)
|
||||
goodsStore.tableInfo = {
|
||||
name: targetTable.name,
|
||||
tableCode: targetTable.tableCode,
|
||||
num: 1
|
||||
}
|
||||
|
||||
goodsStore.successClearCart();
|
||||
goodsStore.historyOrderAjax(targetTableCode);
|
||||
@@ -174,20 +190,36 @@ function confirmHandle() {
|
||||
if (goodsStore.cartList.length) {
|
||||
let table_code = goodsStore.cartList[0].table_code
|
||||
let new_table_code = targetTable.tableCode
|
||||
let cart_id = []
|
||||
let cart_ids = []
|
||||
|
||||
if (form.value.isFull) {
|
||||
cart_id = goodsStore.cartList.map(item => item.id)
|
||||
cart_ids = goodsStore.cartList.map(item => item.id)
|
||||
} else {
|
||||
cart_id = cartTableRefs.value.getSelectionRows().map(item => item.id)
|
||||
cart_ids = cartTableRefs.value.getSelectionRows().map(item => item.id)
|
||||
}
|
||||
|
||||
goodsStore.operateCart({
|
||||
table_code: table_code,
|
||||
new_table_code: new_table_code,
|
||||
cart_id: cart_id
|
||||
}, 'rottable')
|
||||
console.log('cart_ids===', cart_ids);
|
||||
|
||||
if (cart_ids.length) {
|
||||
goodsStore.operateCart({
|
||||
table_code: table_code,
|
||||
new_table_code: new_table_code,
|
||||
cart_ids: cart_ids
|
||||
}, 'rottable')
|
||||
}
|
||||
|
||||
goodsStore.tableInfo = {
|
||||
name: targetTable.name,
|
||||
tableCode: targetTable.tableCode,
|
||||
num: 1
|
||||
}
|
||||
|
||||
socket.cartInit();
|
||||
}
|
||||
|
||||
console.log('targetTable===', targetTable);
|
||||
|
||||
goodsStore.calcCartInfo()
|
||||
visible.value = false
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
@@ -69,7 +69,12 @@
|
||||
<div class="table_info" v-if="goodsStore.tableInfo.name">
|
||||
<div class="left">
|
||||
<span>台桌:{{ goodsStore.tableInfo.name }}</span>
|
||||
<span>{{ goodsStore.tableInfo.num || 1 }}人</span>
|
||||
<div class="n" @click="takeFoodCodeRef.show()">
|
||||
{{ goodsStore.tableInfo.num || 1 }}人
|
||||
<el-icon>
|
||||
<EditPen />
|
||||
</el-icon>
|
||||
</div>
|
||||
</div>
|
||||
<div class="close" @click="goodsStore.selectTable()">
|
||||
<el-icon class="icon">
|
||||
@@ -96,7 +101,7 @@
|
||||
</div>
|
||||
<CartItem
|
||||
:item="{ product_name: '客座费', number: goodsStore.tableInfo.num, salePrice: store.shopInfo.tableFee, memberPrice: store.shopInfo.tableFee }"
|
||||
v-if="!store.shopInfo.isTableFee && goodsStore.tableInfo.id && !goodsStore.allSelected" />
|
||||
v-if="!store.shopInfo.isTableFee && goodsStore.tableInfo.name && !goodsStore.allSelected" />
|
||||
<div class="order_list_item" v-for="(arr, index) in goodsStore.orderList" :key="index">
|
||||
<div class="order_num">
|
||||
<span class="l">{{ `第${arr.orderNum}次下单` }}</span>
|
||||
@@ -202,6 +207,8 @@
|
||||
<updateDialog />
|
||||
<!-- 选择会员 -->
|
||||
<SelectVipUser ref="SelectVipUserRef" @success="selectUser" />
|
||||
<!-- 修改就餐人数 -->
|
||||
<takeFoodCode ref="takeFoodCodeRef" title="修改就餐人数" placeholder="请输入就餐人数" @success="updateSeatNum" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -259,6 +266,12 @@ function quitAPPhandle(params) {
|
||||
ipcRenderer.send("quitHandler", "退出吧");
|
||||
}
|
||||
|
||||
function updateSeatNum(num) {
|
||||
goodsStore.tableInfo.num = num
|
||||
goodsStore.calcCartInfo()
|
||||
// goodsStore.operateCart({ table_code: goodsStore.tableInfo.tableCode, seat_num: num }, 'batch')
|
||||
}
|
||||
|
||||
// 重启刷新软件
|
||||
function printReloadHandle() {
|
||||
location.reload()
|
||||
@@ -661,6 +674,12 @@ function showTableMerging() {
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 var(--el-font-size-base);
|
||||
|
||||
.n {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
.close {
|
||||
|
||||
@@ -39,4 +39,9 @@ export default [
|
||||
type: "subscribe",
|
||||
color: "#58B22C",
|
||||
},
|
||||
{
|
||||
label: "未结账",
|
||||
type: "unpaid",
|
||||
color: "#DD3F41",
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user