fix: 挂账管理更新,耗材盘点更新,代客下单更新

This commit is contained in:
2025-03-11 16:13:22 +08:00
parent 0fa409ecc5
commit 14af62538f
17 changed files with 164 additions and 95 deletions

View File

@@ -354,6 +354,7 @@ onMounted(() => {
}
}
.tui {
position: relative;
.number {
background: #f56c6c;
color: #fff;

View File

@@ -75,6 +75,10 @@
<span class="font-bold">会员优惠</span>
<span class="u-m-l-30">{{ carts.vipDiscount }}</span>
</div>
<div class="u-flex color-000 u-font-14 u-row-between">
<span class="font-bold">赠送</span>
<span class="u-m-l-30">{{ carts.giftMoney }}</span>
</div>
<div class="u-flex color-000 u-font-14 u-row-between">
<span class="font-bold">单品改价优惠</span>
<span class="u-m-l-30">{{ carts.singleDiscount }}</span>

View File

@@ -13,6 +13,7 @@
<el-button
v-for="(item, index) in controls"
:key="index"
size="large"
:disabled="btnDisabled(item)"
@click="controlsClick(item)"
>
@@ -27,8 +28,8 @@ import { useCartsStore } from "@/store/modules/carts";
const carts = useCartsStore();
const controls = ref([
{ label: "规格", key: "", disabled: false, per: "sku" },
{ label: "赠送", key: "is_gift", disabled: false, per: "cart" },
// { label: "规格", key: "", disabled: false, per: "sku" },
{ label: "赠送", key: "is_gift", disabled: false, per: "gift" },
{ label: "打包", key: "is_pack", disabled: false, per: "pack" },
{ label: "删除", key: "del", disabled: false, per: "del" },
{ label: "存单", key: "", disabled: false, per: "save" },
@@ -36,10 +37,10 @@ const controls = ref([
{ label: "单品备注", key: "one-note", disabled: false, per: "one-note" },
{ label: "整单备注", key: "all-note", disabled: false, per: "all-note" },
{ label: "退菜", key: "return", disabled: false, per: "return" },
{ label: "免厨打", key: "is_print", disabled: false, per: "cart" },
{ label: "免厨打", key: "is_print", disabled: false, per: "print" },
{ label: "单品改价", key: "changePriceClick", disabled: false, per: "cart" },
{ label: "等叫", key: "is_wait_call", disabled: false, per: "cart" },
{ label: "整单等叫", key: "", disabled: false, per: "all-wating" },
// { label: "整单等叫", key: "", disabled: false, per: "all-wating" },
]);
const emits = defineEmits(["noteClick", "changePriceClick", "packClick", "return"]);
@@ -85,13 +86,13 @@ const perList = computed(() => {
return ["all-wating", "all-note"];
}
if (carts.isCanSelectGroup) {
return ["all-wating", "all-note", "del", "pack"];
return ["all-wating", "all-note", "del", "pack", "gift", "print", "one-note"];
}
if (carts.selCart.id) {
if (carts.isOldOrder) {
return ["return"];
}
return ["cart", "del", "pack", "save", "one-note", "all-note", "all-wating"];
return ["cart", "del", "pack", "gift", "save", "one-note", "print", "all-note", "all-wating"];
}
});
const canEdit = computed(() => {

View File

@@ -5,7 +5,6 @@
<el-tag
v-for="(tag, index) in tags"
@click="addNote(tag)"
size="medium"
:key="index"
closable
@close="delTag(index)"
@@ -15,8 +14,8 @@
</el-tag>
</div>
<template #footer>
<el-button size="medium" @click="close">取消</el-button>
<el-button size="medium" type="primary" @click="confirm">确定</el-button>
<el-button @click="close">取消</el-button>
<el-button type="primary" @click="confirm">确定</el-button>
</template>
</el-dialog>
</template>

View File

@@ -90,7 +90,7 @@
{{ scope.row.type == 1 ? "优惠券" : "商品券" }}
</template>
</el-table-column>
<el-table-column label="商品信息" width="120">
<el-table-column label="商品信息">
<template v-slot="scope">
<div class="u-flex" v-if="scope.row.type == 2">
<div class="u-flex">
@@ -118,7 +118,7 @@
</span>
</template>
</el-table-column>
<el-table-column prop="useRestrictions" label="">
<el-table-column prop="useRestrictions" label="操作">
<template v-slot="scope">
<el-button type="danger" size="small" @click="delQuan(scope.row)">删除</el-button>
</template>
@@ -464,7 +464,7 @@ function returnPayParams() {
// discountRatio: (checkOrderPay.discount / 100).toFixed(2),
discountRatio: 0,
seatNum: props.perpole * 1,
originAmount: carts.payMoney * 1 - productCouponDiscountAmount.value + seatAmount.value * 1,
originAmount: carts.payMoney * 1 + seatAmount.value * 1,
discountAmount: discountAmount.value,
productCouponDiscountAmount: productCouponDiscountAmount.value * 1,
orderAmount: currentpayMoney.value * 1,

View File

@@ -2,15 +2,15 @@
<el-dialog title="单品改价" width="410px" v-model="show" @close="reset" :modal="modal">
<div class="u-m-t-30 u-flex">
<div class="no-wrap u-m-r-20">价格更改为</div>
<el-input
<el-input-number
:min="min"
:max="max"
placeholder="请输入更改后的价格"
v-model="price"
@blur="checkPrice"
type="number"
>
<template #append></template>
</el-input>
></el-input-number>
<span class="u-m-l-10 u-font-14"></span>
</div>
<div class="u-m-t-16">
<span class="color-red">*</span>
@@ -33,6 +33,10 @@ export default {
type: Boolean,
default: true,
},
useVipPrice: {
type: Boolean,
default: false,
},
vipUser: {
type: Object,
default: () => {
@@ -44,6 +48,7 @@ export default {
},
data() {
return {
max: 0,
min: 0,
originPrice: "",
price: "",
@@ -72,8 +77,11 @@ export default {
},
open(item) {
console.log(item);
const memberPrice = item.memberPrice || item.salePrice;
this.max = this.useVipPrice ? memberPrice : item.salePrice;
this.show = true;
const price = item.discount_sale_amount * 1 || item.salePrice * 1;
const price =
item.discount_sale_amount * 1 || (this.useVipPrice ? memberPrice : item.salePrice);
this.price = price;
this.originPrice = price;
},

View File

@@ -5,7 +5,7 @@
<el-tabs v-model="activeName" @tab-click="tabClick">
<el-tab-pane label="优惠券(单选)" name="youhui">
<el-table
ref="table"
ref="refTable"
empty-text="无可用优惠券"
:data="quans.fullReductionCoupon"
@cell-click="fullReductionCouponClick"
@@ -46,8 +46,7 @@
</el-tab-pane>
<el-tab-pane label="商品券(多选)" name="goods">
<el-table
ref="table1"
@cell-click="productCouponClick"
ref="refTable1"
empty-text="无可用商品券"
:data="quans.productCoupon"
style="width: 100%"
@@ -55,8 +54,8 @@
<el-table-column width="80">
<template v-slot="scope">
<el-checkbox
@change="productCouponClick(scope.row)"
:model-value="scope.row.checked"
@change="productCouponClick($event, scope.row)"
v-model="scope.row.checked"
></el-checkbox>
</template>
</el-table-column>
@@ -120,7 +119,6 @@
:src="scope.row.productImg"
fit="cover"
style="width: 40px; height: 40px"
:preview-src-list="[scope.row.productImg]"
></el-image>
</div>
<div class="u-p-l-10">
@@ -229,6 +227,9 @@ const {
isSetProductCoup,
} = toRefs(state);
const refTable = ref();
const refTable1 = ref();
let orderPrice = ref(0);
let $originFullReductionCoupon = [];
//可以抵扣的商品列表
@@ -291,7 +292,8 @@ const AllCouponPrice = computed(() => {
const payPrice = computed(() => {
return (orderPrice.value - AllCouponPrice.value).toFixed(2);
});
function productCouponClick(item) {
function productCouponClick(checked, item) {
console.log(checked);
if (!item.use) {
return;
}
@@ -307,8 +309,12 @@ function productCouponClick(item) {
console.log("maxSelNum", maxSelNum);
console.log("coupMaxUseNum", coupMaxUseNum);
console.log("canUseNum", canUseNum);
if (!item.checked && canUseNum <= 0) {
return ElMessage.error("购物车该商品券可使用最大数量为" + maxSelNum);
if (checked && canUseNum <= 0) {
ElMessage.error("购物车该商品券可使用最大数量为" + maxSelNum);
setTimeout(() => {
item.checked = !checked;
}, 100);
return;
}
if (fullReductionCouponSel.value.id && !item.checked) {
@@ -361,7 +367,7 @@ function productCouponClick(item) {
});
}
}
item.checked = !item.checked;
item.checked = checked;
if (!item.checked) {
const index = quansSelArr.value.findIndex((v) => v.id == item.id);
quansSelArr.value.splice(index, 1);
@@ -417,6 +423,7 @@ const emits = defineEmits(["confirm"]);
function reset() {
quansSelArr.value = [];
fullReductionCouponSel.value = { id: "" };
quans.value.productCoupon = [];
}
function confirm() {
emits("confirm", [...quansSelArr.value], $goodsPayPriceMap, goodsArr);

View File

@@ -195,7 +195,11 @@
<!-- 临时菜 -->
<addLingShiCai ref="refAddLingShiCai" @confirm="addLingShiCaiConfirm"></addLingShiCai>
<!-- 改价 -->
<changePrice ref="refChangePrice" @confirm="changePriceConfirm"></changePrice>
<changePrice
ref="refChangePrice"
:useVipPrice="carts.useVipPrice"
@confirm="changePriceConfirm"
></changePrice>
<!-- 称重商品 -->
<changeWeight ref="refChangeWeight" @confirm="changeWeightConfirm"></changeWeight>
<!-- 可选套餐 -->
@@ -704,6 +708,7 @@ onMounted(async () => {
oldOrder.value = res;
orderInfo.value = res;
showOrder.value = true;
perpole.value = res.seatNum || 0;
}
}
if (tableCode) {
@@ -764,6 +769,7 @@ $pl: 30px;
.diancan {
padding-top: 10px;
display: flex;
height: 100%;
max-height: calc(100vh - 256px);
.left {
flex: 1;

View File

@@ -31,7 +31,8 @@ export function returnCoupCanUse(goodsArr = [], coup, selCoupArr = []) {
return false;
}
const findGoodsTotalNumber = findGoods.reduce((prve, cur) => {
return prve + cur.num * 1;
const num = cur.num - cur.refundNum;
return prve + (num <= 0 ? 0 : num);
}, 0);
const selCoupNumber = selCoupArr
.filter((v) => v.proId == coup.proId)
@@ -126,7 +127,8 @@ export function returnGoodsPayPriceMap(goodsArr) {
if (!prve.hasOwnProperty(cur.productId)) {
prve[cur.productId] = [];
}
const arr = new Array(cur.num).fill(cur).map((v) => {
const n = cur.num - cur.returnNum;
const arr = new Array(n <= 0 ? 0 : n).fill(cur).map((v) => {
return {
memberPrice: v.memberPrice ? v.memberPrice : v.price,
price: v.price,