From d1cbebefe924e0bf9dfc3694f3fdfd84416defe7 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Fri, 22 Nov 2024 15:45:33 +0800 Subject: [PATCH 01/19] =?UTF-8?q?=E4=BB=A3=E5=AE=A2=E4=B8=8B=E5=8D=95?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=B4=E6=97=B6=E8=8F=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/Instead.js | 21 ++++ .../Instead/components/popup-linshiCai.vue | 118 +++++++++++++----- src/views/tool/Instead/index.vue | 13 +- 3 files changed, 118 insertions(+), 34 deletions(-) create mode 100644 src/api/Instead.js diff --git a/src/api/Instead.js b/src/api/Instead.js new file mode 100644 index 0000000..5a8081b --- /dev/null +++ b/src/api/Instead.js @@ -0,0 +1,21 @@ +// 代客下单 +import request from "@/utils/request"; +//就餐形式,默认堂食后付费 +const useType='dine-in-after' +function getUseType(){ + const type=localStorage.getItem("useType") + return type?type:useType +} + +// 购物车-临时菜添加 +export function $temporaryDishes(data) { + return request({ + url: '/api/place/temporaryDishes', + method: "post", + data:{ + shopId: localStorage.getItem("shopId"), + useType:getUseType(), + ...data + } + }); +} \ No newline at end of file diff --git a/src/views/tool/Instead/components/popup-linshiCai.vue b/src/views/tool/Instead/components/popup-linshiCai.vue index 03879fb..7a692cd 100644 --- a/src/views/tool/Instead/components/popup-linshiCai.vue +++ b/src/views/tool/Instead/components/popup-linshiCai.vue @@ -8,12 +8,20 @@
将临时菜添加至购物车,不会影响总商品库
- - - + + + - - + + - - - + + + - - + + - - + + - - +
@@ -57,22 +77,32 @@ @@ -131,7 +189,7 @@ input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; } -::v-deep .el-input__inner::-webkit-inner-spin-button { +::v-deep .el-input__inner::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; } diff --git a/src/views/tool/Instead/index.vue b/src/views/tool/Instead/index.vue index eae9e76..d1294e7 100644 --- a/src/views/tool/Instead/index.vue +++ b/src/views/tool/Instead/index.vue @@ -713,7 +713,7 @@
@@ -1468,6 +1468,7 @@ import { $calcUsablePoints, $calcDeDuctionPoints, } from "@/api/table"; + import { tbShopCategoryGet } from "@/api/shop"; import { isCanBuy, @@ -2172,7 +2173,11 @@ export default { }, methods: { lingshicaiShow() { - this.$refs.refPopAddCai.open(); + this.$refs.refPopAddCai.open({ + masterId:this.masterId, + tableId:this.table.tableId, + vipUserId:this.vipUser.id, + }); }, delQuan(row) { const index = this.quansSelArr.findIndex((v) => v.id == row.id); From e0abb6a589d56fbf43e10be70622bde8685af68f Mon Sep 17 00:00:00 2001 From: duan <1004387497@qq.com> Date: Mon, 25 Nov 2024 13:59:53 +0800 Subject: [PATCH 02/19] =?UTF-8?q?=E5=BC=80=E7=A5=A8=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/application/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/application/index.vue b/src/views/application/index.vue index ebb48f2..5b268b2 100644 --- a/src/views/application/index.vue +++ b/src/views/application/index.vue @@ -2,7 +2,7 @@
应用中心
-
+
From d9f97b6ddbd313d032c87e95b2fd8b04e578ee0b Mon Sep 17 00:00:00 2001 From: duan <1004387497@qq.com> Date: Mon, 25 Nov 2024 14:25:18 +0800 Subject: [PATCH 03/19] =?UTF-8?q?=E5=BC=80=E7=A5=A8=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/application/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/application/index.vue b/src/views/application/index.vue index 5b268b2..34f2dae 100644 --- a/src/views/application/index.vue +++ b/src/views/application/index.vue @@ -67,7 +67,7 @@ export default { }, mounted() { this.appCenterGet() - this.getbinding() + // this.getbinding() }, methods: { upPop() { From ba5c3714cf0b4cbd87407c70c5914283b24ffaf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=95=BE?= <1144797966@qq.com> Date: Mon, 25 Nov 2024 14:41:04 +0800 Subject: [PATCH 04/19] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E8=AE=A2=E5=8D=95->?= =?UTF-8?q?=E9=9A=90=E8=97=8F=E6=80=BB=E9=87=91=E9=A2=9D=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/order_manage/order_list.vue | 35 ++++++++++++++------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/views/order_manage/order_list.vue b/src/views/order_manage/order_list.vue index b158085..9332d4d 100644 --- a/src/views/order_manage/order_list.vue +++ b/src/views/order_manage/order_list.vue @@ -57,9 +57,9 @@
-
+ -
+
+
@@ -76,9 +76,9 @@
¥{{ item.payAmount || 0 }}
{{ item.payType }}
-
+
-
+
-->
@@ -150,7 +150,8 @@ @@ -207,24 +208,24 @@ export default { filters: { orderTypeFilter(t) { if (t) { - const item= orderEnum.orderType.find(item => item.key == t); - return t && item?item.label:''; + const item = orderEnum.orderType.find(item => item.key == t); + return t && item ? item.label : ''; } else { return t; } }, sendTypeFilter(t) { if (t) { - const item= orderEnum.sendType.find(item => item.key == t); - return item?item.label:''; + const item = orderEnum.sendType.find(item => item.key == t); + return item ? item.label : ''; } else { return t; } }, statusFilter(t) { if (t) { - const item= orderEnum.status.find(item => item.key == t); - return t && item?item.label:''; + const item = orderEnum.status.find(item => item.key == t); + return t && item ? item.label : ''; } else { return t; } @@ -254,11 +255,11 @@ export default { this.getTableData(); }, 200); } - + }, methods: { //结账 - payOrder(order){ + payOrder(order) { console.log(order); this.$router.push({ path: "/tool/Instead/index", @@ -268,7 +269,7 @@ export default { useType: order.useType, masterId: order.masterId, orderId: order.id, - key:'isJieZhang' + key: 'isJieZhang' }, }); }, @@ -324,7 +325,7 @@ export default { async getTableData(switchs = false) { this.tableData.loading = true; try { - this.payCount(); + // this.payCount(); const productName = this.query.productName.replace(/\s+/g, '') const res = await tbOrderInfoData({ page: this.tableData.page, From 63349360fa669fe29dbd17dd372f99091be54c26 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Mon, 25 Nov 2024 16:31:36 +0800 Subject: [PATCH 05/19] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8D=95=E5=93=81?= =?UTF-8?q?=E6=94=B9=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/Instead.js | 11 + .../components/popup-cart-changePrice.vue | 205 ++++++++++++++++++ src/views/tool/Instead/index.vue | 86 ++++---- src/views/tool/Instead/util.js | 10 + 4 files changed, 270 insertions(+), 42 deletions(-) create mode 100644 src/views/tool/Instead/components/popup-cart-changePrice.vue diff --git a/src/api/Instead.js b/src/api/Instead.js index 5a8081b..af26134 100644 --- a/src/api/Instead.js +++ b/src/api/Instead.js @@ -18,4 +18,15 @@ export function $temporaryDishes(data) { ...data } }); +} +// 购物车-单品改价 +export function $updatePrice(data) { + return request({ + url: '/api/place/updatePrice', + method: "put", + data:{ + shopId: localStorage.getItem("shopId"), + ...data + } + }); } \ No newline at end of file diff --git a/src/views/tool/Instead/components/popup-cart-changePrice.vue b/src/views/tool/Instead/components/popup-cart-changePrice.vue new file mode 100644 index 0000000..9a619ba --- /dev/null +++ b/src/views/tool/Instead/components/popup-cart-changePrice.vue @@ -0,0 +1,205 @@ + + + + \ No newline at end of file diff --git a/src/views/tool/Instead/index.vue b/src/views/tool/Instead/index.vue index 3a61a84..ac3de58 100644 --- a/src/views/tool/Instead/index.vue +++ b/src/views/tool/Instead/index.vue @@ -639,21 +639,12 @@ > 退菜
- +
单品改价
+
等叫
+
取消全部等叫
+ + @@ -1431,6 +1428,7 @@ import chooseDinersNumber from "./components/choose-diners-number.vue"; import returnCart from "./components/return-cart.vue"; import moneyKeyboard from "./components/money-keyboard.vue"; import caiAdd from "./components/popup-linshiCai.vue"; +import cartChangePrice from "./components/popup-cart-changePrice.vue"; import dayjs from "dayjs"; import { tbShopInfo } from "@/api/user"; import { hasPermission } from "@/utils/limits.js"; @@ -1485,6 +1483,7 @@ import { $status } from "@/utils/table.js"; let $originTableList = []; export default { components: { + cartChangePrice, caiAdd, quansPop, returnCart, @@ -2195,6 +2194,17 @@ export default { this.open(this.$route.query); }, methods: { + //更新单品改价数据 + updateCartItem(res){ + if(res){ + this.order.list[this.order.selIndex]=res + } + }, + // 单品改价 + refPopChangePriceShow() { + const orderGoods = this.order.list[this.order.selIndex]; + this.$refs.refPopChangePrice.open(orderGoods); + }, returnProDiscount(row) { console.log(row); //相同商品抵扣券数组 @@ -2218,9 +2228,9 @@ export default { }, lingshicaiShow() { this.$refs.refPopAddCai.open({ - masterId:this.masterId, - tableId:this.table.tableId, - vipUserId:this.vipUser.id, + masterId: this.masterId, + tableId: this.table.tableId, + vipUserId: this.vipUser.id, }); }, delQuan(row) { @@ -2228,13 +2238,13 @@ export default { console.log(index); if (index != -1) { this.quansSelArr.splice(index, 1); - this.quansSelArr - .map((v, index) => { - return { - ...v, - discountAmount:v.type==2?this.returnProDiscount(v):v.discountAmount, - }; - }); + this.quansSelArr.map((v, index) => { + return { + ...v, + discountAmount: + v.type == 2 ? this.returnProDiscount(v) : v.discountAmount, + }; + }); } }, async getCalcUsablePoints() { @@ -2254,8 +2264,8 @@ export default { this.vipUser.accountPoints, this.points.res.maxUsablePoints || 0 ); - if(!pointsRes.usable){ - this.points.selected=false + if (!pointsRes.usable) { + this.points.selected = false; } } return pointsRes; @@ -2301,11 +2311,12 @@ export default { this.createOrder.discount = 1; this.points.selected = ""; e.map((v, index) => { - return { - ...v, - discountAmount:v.type==2? this.returnProDiscount(v):v.discountAmount, - }; - }); + return { + ...v, + discountAmount: + v.type == 2 ? this.returnProDiscount(v) : v.discountAmount, + }; + }); this.quansSelArr = [...e]; $goodsPayPriceMap = goodsPayPriceMap; }, @@ -4119,9 +4130,7 @@ input[type="number"]::-webkit-outer-spin-button { background-color: #fff; height: 100%; } -::v-deep .el-button--text { - // color: #000; -} + ::v-deep .meal_box .el-button-group { width: 100%; display: flex; @@ -4640,13 +4649,6 @@ input[type="number"]::-webkit-outer-spin-button { background-color: #fff; border: 1px solid #dcdfe6; } -::v-deep .el-checkbox__input.is-checked .el-checkbox__inner { - // background-color: #22bf64; - // border-color: #22bf64; -} -::v-deep .el-checkbox__input.is-checked + .el-checkbox__label { - // color: #22bf64; -} ::v-deep .tag-group .el-tag--dark { background: rgba(34, 191, 100, 0.1); diff --git a/src/views/tool/Instead/util.js b/src/views/tool/Instead/util.js index 7d61c8a..3c49399 100644 --- a/src/views/tool/Instead/util.js +++ b/src/views/tool/Instead/util.js @@ -218,4 +218,14 @@ export function returnCouponAllPrice(coupArr, goodsArr, vipUser) { const poductAllprice=returnProductCouponAllPrice(coupArr, goodsArr, vipUser) const pointAllPrice=returnFullReductionCouponAllPrice(coupArr) return (poductAllprice*1+pointAllPrice*1).toFixed(2); +} + +//返回购物车商品价格 +export function returnCartPrice(goods, vipUser) { + const price=goods.price||goods.salePrice + if(!vipUser||!vipUser.id ||!vipUser.isVip){ + return price + } + const memberPrice = goods.memberPrice ? goods.memberPrice :price; + return memberPrice } \ No newline at end of file From 8cf46745cd6a2a70dd7d290bbe72a997808b4c42 Mon Sep 17 00:00:00 2001 From: gyq <875626088@qq.com> Date: Mon, 25 Nov 2024 16:51:06 +0800 Subject: [PATCH 06/19] =?UTF-8?q?=E4=BC=98=E5=8C=96pad=E7=82=B9=E5=8D=95?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/shopList/index.vue | 2 +- src/views/shop/components/addPadPage.vue | 13 ++++++++- src/views/shop/pad_setting.vue | 35 ++++++++++++++++++++++-- 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/src/components/shopList/index.vue b/src/components/shopList/index.vue index c59d543..8de9ffd 100644 --- a/src/components/shopList/index.vue +++ b/src/components/shopList/index.vue @@ -54,7 +54,7 @@ - + diff --git a/src/views/shop/components/addPadPage.vue b/src/views/shop/components/addPadPage.vue index 981cd6b..c1439c6 100644 --- a/src/views/shop/components/addPadPage.vue +++ b/src/views/shop/components/addPadPage.vue @@ -192,7 +192,18 @@ export default { }, // 确认选择商品 selectConfirmGoods(res) { - this.$set(this.form.list, this.activeItem, { ...res[0] }) + // this.form.list = res + const flag = this.form.list.filter(item => item.id == res[0].id) + + if (flag.length) { + this.$notify({ + title: '注意', + message: '请勿重复添加', + type: 'error' + }) + } else { + this.$set(this.form.list, this.activeItem, { ...res[0] }) + } }, // 切换tab tabChange() { diff --git a/src/views/shop/pad_setting.vue b/src/views/shop/pad_setting.vue index df8d0ac..14fd611 100644 --- a/src/views/shop/pad_setting.vue +++ b/src/views/shop/pad_setting.vue @@ -7,8 +7,12 @@
- + +
+ {{ item.name }} +
@@ -62,6 +66,7 @@ export default { query: { name: '' }, + selectCatoryIndex: 0, selectCatory: '', treeDataOrgin: [], treeData: [], @@ -88,6 +93,12 @@ export default { this.treeData = this.treeDataOrgin.filter(item => { return item.name.includes(this.query.name) }) + + if (this.treeData.length) { + this.selectCatoryIndex = 0 + this.selectCatory = this.treeData[this.selectCatoryIndex] + this.getTableData() + } }, //表格拖拽 tableDrag() { @@ -147,7 +158,8 @@ export default { } }, // 分类被点击 - treeItemClick(data) { + treeItemClick(data, index) { + this.selectCatoryIndex = index this.selectCatory = data this.tableData.page = 1 this.getTableData() @@ -164,6 +176,7 @@ export default { }) this.treeDataOrgin = res.content this.treeData = res.content + this.selectCatory = res.content[this.selectCatoryIndex] this.getTableData() } catch (error) { console.log(error) @@ -235,6 +248,22 @@ export default { width: 100%; height: calc(100% - 70px); overflow-y: auto; + + .item { + padding: 10px 15px; + font-size: 14px; + display: flex; + align-items: center; + + &:hover { + cursor: pointer; + } + + &.active { + background-color: #1890ff; + color: #fff; + } + } } } From dc0b2f7605362a858eb4aab4b808feb6bc90e390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=95=BE?= <1144797966@qq.com> Date: Tue, 26 Nov 2024 10:05:34 +0800 Subject: [PATCH 07/19] =?UTF-8?q?=E8=80=97=E6=9D=90=E7=9B=98=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/invoicing/components/addConsTakin.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/views/invoicing/components/addConsTakin.vue b/src/views/invoicing/components/addConsTakin.vue index c848d00..349b22f 100644 --- a/src/views/invoicing/components/addConsTakin.vue +++ b/src/views/invoicing/components/addConsTakin.vue @@ -81,7 +81,8 @@ export default { stocktakinNum: '', // 必传 price: '', // 商品价格 非必传 为空盘点价格为商品价格 remark: "", // 盘点备注 非必传 - stockNumber: 0 + stockNumber: 0, + balance: '' }, rules: { stocktakinNum: [ @@ -155,6 +156,7 @@ export default { }) }, async show(obj) { + console.log(obj, 111) let res = await hasPermission('允许耗材盘点'); if (!res) { return; } this.form.remark = '' @@ -165,8 +167,9 @@ export default { this.form = Object.assign(this.form, obj) this.dialogVisible = true this.form.conInfoId = obj.consId - this.form.stockNumber = obj.stockNumber - this.form.balance = obj.stockNumber + this.form.stockNumber = obj.balance < 0 ? 0 : obj.balance + // this.form.balance = obj.stockNumber + this.form.balance = obj.balance this.form.price == null ? 0 : this.form.price this.searhForm.productId = obj.id this.getTableData() @@ -186,7 +189,7 @@ export default { try { this.tableData.loading = true const res = await tbConCheckGet({ - + page: this.tableData.page, size: this.tableData.size, conInfoId: this.searhForm.productId, From e62ff19b5fe2b591a7134843318a18a80624e52c Mon Sep 17 00:00:00 2001 From: GaoHao <1210693421@qq.com> Date: Wed, 27 Nov 2024 11:35:33 +0800 Subject: [PATCH 08/19] =?UTF-8?q?=E6=8C=82=E8=B4=A6=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E9=98=B2=E6=8A=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/credit.js | 4 ++-- src/views/home/components/credit_repayment.vue | 9 ++++++--- src/views/home/data_creditDetail.vue | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/api/credit.js b/src/api/credit.js index 0010803..f95b9d4 100644 --- a/src/api/credit.js +++ b/src/api/credit.js @@ -1,7 +1,7 @@ import request from '@/utils/request' /** - * 获取挂账列表 + * 获取挂账人列表 * @returns */ export function getCreditBuyerList(params) { @@ -15,7 +15,7 @@ export function getCreditBuyerList(params) { } /** - * 获取挂账详情 + * 获取挂账人详情 * @returns */ export function getCreditBuyerInfo(id) { diff --git a/src/views/home/components/credit_repayment.vue b/src/views/home/components/credit_repayment.vue index 24877b6..bff019e 100644 --- a/src/views/home/components/credit_repayment.vue +++ b/src/views/home/components/credit_repayment.vue @@ -90,11 +90,11 @@ export default { this.resetForm = { ...this.form } }, methods: { - /** * 确定 */ - async onSubmitHandle() { + // eslint-disable-next-line no-undef + onSubmitHandle: _.debounce(function async() { this.$refs.form.validate(async valid => { if (valid) { try { @@ -120,7 +120,7 @@ export default { } } }) - }, + }, 1000), /** * 打开 @@ -135,6 +135,9 @@ export default { this.form.id = row.id } this.form.repaymentMethod = row.repaymentMethod + this.form.debtor = row.debtor + this.form.owedAmount = row.owedAmount + this.form.accountBalance = row.accountBalance this.dialogVisible = true }, diff --git a/src/views/home/data_creditDetail.vue b/src/views/home/data_creditDetail.vue index 9bd7d62..496c012 100644 --- a/src/views/home/data_creditDetail.vue +++ b/src/views/home/data_creditDetail.vue @@ -222,7 +222,7 @@ export default { if (type === 'payment' && this.repaymentMethod === 'order') { this.$refs.creditRepayment.show({ creditBuyerId: this.query.creditBuyerId, repaymentMethod: this.repaymentMethod }, row) } else if (type === 'paymentRecord') { - this.$refs.creditRepaymentRecord.show({ creditBuyerId: this.query.creditBuyerId, repaymentMethod: this.repaymentMethod }, row.id) + this.$refs.creditRepaymentRecord.show({ id: this.query.creditBuyerId, repaymentMethod: this.repaymentMethod }, row.orderId) } }, From 9465d660ade174288966611701f364e85a1786fe Mon Sep 17 00:00:00 2001 From: GaoHao <1210693421@qq.com> Date: Wed, 27 Nov 2024 13:28:41 +0800 Subject: [PATCH 09/19] =?UTF-8?q?=E7=8E=AF=E5=A2=83=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.production | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.production b/.env.production index 7f079f7..2a4f841 100644 --- a/.env.production +++ b/.env.production @@ -3,10 +3,10 @@ ENV = 'production' # 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置 # 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http # 测试 -# VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn' +VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn' # 生产 -VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn' +# VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn' # 预发布接口 # VUE_APP_BASE_API = 'https://pre-cashieradmin.sxczgkj.cn' From 971cdd8f369c4b4db8a44f9e4159a1d6a3a87724 Mon Sep 17 00:00:00 2001 From: GaoHao <1210693421@qq.com> Date: Wed, 27 Nov 2024 14:01:58 +0800 Subject: [PATCH 10/19] =?UTF-8?q?=E6=8C=82=E8=B4=A6=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E9=87=8D=E7=BD=AE=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/credit.js | 12 ++++++++++++ src/views/home/components/credit_RePaymentRecord.vue | 2 +- src/views/home/components/credit_add.vue | 10 +++++++--- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/api/credit.js b/src/api/credit.js index f95b9d4..a9d4337 100644 --- a/src/api/credit.js +++ b/src/api/credit.js @@ -38,6 +38,18 @@ export function addCreditBuyer(data) { }) } +/** + * 编辑挂账人 + * @returns + */ +export function editCreditBuyer(data) { + return request({ + url: '/api/credit/buyer', + method: 'put', + data + }) +} + /** * 还款 * @returns diff --git a/src/views/home/components/credit_RePaymentRecord.vue b/src/views/home/components/credit_RePaymentRecord.vue index a5c667d..edfd6de 100644 --- a/src/views/home/components/credit_RePaymentRecord.vue +++ b/src/views/home/components/credit_RePaymentRecord.vue @@ -127,7 +127,7 @@ export default { * 重置 */ reset() { - this.query = { ...this.resetQuery } + this.query.paymentMethod = '' this.getTableData() } } diff --git a/src/views/home/components/credit_add.vue b/src/views/home/components/credit_add.vue index e12c4c0..89f9f40 100644 --- a/src/views/home/components/credit_add.vue +++ b/src/views/home/components/credit_add.vue @@ -50,7 +50,7 @@ + diff --git a/src/views/tool/Instead/components/keyboard.vue b/src/views/tool/Instead/components/keyboard.vue index 8436f1f..c316f80 100644 --- a/src/views/tool/Instead/components/keyboard.vue +++ b/src/views/tool/Instead/components/keyboard.vue @@ -6,6 +6,7 @@ {{ number }}
+
@@ -79,13 +80,18 @@ export default { default: false, }, max: { - type: Number, + type: [Number,String], default: Infinity, }, value: { type: [String, Number], default: 0, }, + // 是否启用小数 + isFloat: { + type: Boolean, + default: false, + } }, data() { return { @@ -102,14 +108,21 @@ export default { }, methods: { clearFunction() { + if(this.isFloat){ + return this.keyboradAdd('.') + } this.$emit("clear", this.number); }, keyboradAdd(n) { + if(n=='.'&& `${this.number}`.includes('.')){ + return + } if (Number(this.number) == 0) { return (this.number = n); } const newval = this.number + n; - if (newval > this.max) { + console.log(newval) + if (newval*1 > this.max*1) { return this.$message( this.maxTips); } this.number = newval; diff --git a/src/views/tool/Instead/components/popup-choose-guazhang.vue b/src/views/tool/Instead/components/popup-choose-guazhang.vue new file mode 100644 index 0000000..99e6720 --- /dev/null +++ b/src/views/tool/Instead/components/popup-choose-guazhang.vue @@ -0,0 +1,355 @@ + + + + + \ No newline at end of file diff --git a/src/views/tool/Instead/components/popup-tuan-quan.vue b/src/views/tool/Instead/components/popup-tuan-quan.vue new file mode 100644 index 0000000..ae67f2a --- /dev/null +++ b/src/views/tool/Instead/components/popup-tuan-quan.vue @@ -0,0 +1,165 @@ + + + + \ No newline at end of file diff --git a/src/views/tool/Instead/components/tuan-quan-table.vue b/src/views/tool/Instead/components/tuan-quan-table.vue new file mode 100644 index 0000000..29e5757 --- /dev/null +++ b/src/views/tool/Instead/components/tuan-quan-table.vue @@ -0,0 +1,61 @@ + + diff --git a/src/views/tool/Instead/index.vue b/src/views/tool/Instead/index.vue index ac3de58..cbd4f73 100644 --- a/src/views/tool/Instead/index.vue +++ b/src/views/tool/Instead/index.vue @@ -500,7 +500,7 @@ @@ -639,10 +639,13 @@ > 退菜
-
单品改价
+
+ 单品改价 +
等叫
取消全部等叫
@@ -924,8 +927,35 @@
-
+ 团购代金券 +
+ 代金券名称 + +
+ + +
+ +
优惠券
+ @@ -1010,6 +1041,7 @@ :disabledPayType="disabledPayType" > + 挂账
立即支付 @@ -1411,6 +1443,14 @@ :vipUser="vipUser" @updateCart="updateCartItem" > + + + +
@@ -1429,6 +1469,10 @@ import returnCart from "./components/return-cart.vue"; import moneyKeyboard from "./components/money-keyboard.vue"; import caiAdd from "./components/popup-linshiCai.vue"; import cartChangePrice from "./components/popup-cart-changePrice.vue"; +import popTuanQuan from "./components/popup-tuan-quan.vue"; +import tuanQuanTable from "./components/tuan-quan-table.vue"; +import popupChooseGuazhang from "./components/popup-choose-guazhang.vue"; + import dayjs from "dayjs"; import { tbShopInfo } from "@/api/user"; import { hasPermission } from "@/utils/limits.js"; @@ -1463,6 +1507,7 @@ import { } from "@/api/table"; import { tbShopCategoryGet } from "@/api/shop"; +import { $checkCoupon } from "@/api/Instead"; import { isCanBuy, arrayContainsAll, @@ -1479,11 +1524,15 @@ import { returnProductCoupAllPrice } from "./quan_util.js"; //商品数量从0到n每一个对应的价格 let $goodsPayPriceMap = {}; import { $status } from "@/utils/table.js"; +import PopupChooseGuazhang from './components/popup-choose-guazhang.vue'; let $originTableList = []; export default { components: { + popupChooseGuazhang, cartChangePrice, + popTuanQuan, + tuanQuanTable, caiAdd, quansPop, returnCart, @@ -1496,6 +1545,7 @@ export default { moneyDiscount, cartItem, chooseDinersNumber, + PopupChooseGuazhang, }, data() { return { @@ -1512,6 +1562,8 @@ export default { value: 0, toMoney: 0, }, + //团购券 + tuanQuan: "", //选中可用优惠券 quansSelArr: [], //台桌搜索文字 @@ -2194,10 +2246,22 @@ export default { this.open(this.$route.query); }, methods: { + //挂账 + guazhangShow(){ + this.$refs.refGuaZhang.open(); + }, + //团购券扫码弹窗 + shouwTuanQuan() { + this.$refs.refPopTuanQuan.open(); + }, + tuanQuanConfirm(e) { + console.log(e); + this.tuanQuan = e; + }, //更新单品改价数据 - updateCartItem(res){ - if(res){ - this.order.list[this.order.selIndex]=res + updateCartItem(res) { + if (res) { + this.order.list[this.order.selIndex] = res; } }, // 单品改价 @@ -2923,6 +2987,15 @@ export default { return prve; }, []); try { + // 核销团购券商品 + if (this.tuanQuan && this.tuanQuan.goods.length > 0) { + await $checkCoupon({ + code: this.tuanQuan.couponCode, + num: this.tuanQuan.number, + orderId: this.createOrder.data.id, + cartId: this.tuanQuan.goods.map((v) => v.cartId), + }); + } const res = await $payOrder({ tableId: this.table.tableId, masterId: this.masterId, From 985a3c6ad6d175c4a02b078594cf7bde61190e72 Mon Sep 17 00:00:00 2001 From: GaoHao <1210693421@qq.com> Date: Wed, 27 Nov 2024 15:38:30 +0800 Subject: [PATCH 13/19] =?UTF-8?q?=E5=88=86=E9=A1=B5=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home/data_creditDetail.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/views/home/data_creditDetail.vue b/src/views/home/data_creditDetail.vue index df68663..65f0e5d 100644 --- a/src/views/home/data_creditDetail.vue +++ b/src/views/home/data_creditDetail.vue @@ -202,6 +202,7 @@ export default { let params = { page: this.query.page, size: this.query.size, + status: this.query.status, creditBuyerId: this.query.creditBuyerId } if (this.query.createdAt.length > 0) { @@ -323,7 +324,8 @@ export default { * @param e */ sizeChange(e) { - this.tableData.size = e + console.log(e) + this.query.size = e this.getTableData() }, From beb9ac4d280a7e9c2b115a0fac7c817fc4907b0f Mon Sep 17 00:00:00 2001 From: GaoHao <1210693421@qq.com> Date: Wed, 27 Nov 2024 15:59:44 +0800 Subject: [PATCH 14/19] =?UTF-8?q?=E6=8C=82=E8=B4=A6=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E5=8F=B7=E9=99=90=E5=88=B6=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home/components/credit_add.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/home/components/credit_add.vue b/src/views/home/components/credit_add.vue index 89f9f40..689d9ae 100644 --- a/src/views/home/components/credit_add.vue +++ b/src/views/home/components/credit_add.vue @@ -21,7 +21,7 @@ - + From b5cd694baf1d004b5f8cd5756269f99fd4dd9ed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=95=BE?= <1144797966@qq.com> Date: Thu, 28 Nov 2024 14:04:43 +0800 Subject: [PATCH 15/19] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E8=AE=B0=E5=BD=95IP=E5=B1=95=E7=A4=BA=20=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86=E5=87=BA=E5=85=A5=E5=BA=93=E8=AE=B0=E5=BD=95=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/invoicing/operation_in.vue | 41 ++++++++----- .../supplier_manage/purchase_detail.vue | 59 ++++++++++++------- src/views/monitor/log/index.vue | 2 +- 3 files changed, 67 insertions(+), 35 deletions(-) diff --git a/src/views/invoicing/operation_in.vue b/src/views/invoicing/operation_in.vue index 416b867..0b5b09e 100644 --- a/src/views/invoicing/operation_in.vue +++ b/src/views/invoicing/operation_in.vue @@ -123,13 +123,14 @@
原价¥ - {{ !scope.row.unit ? - (scope.row.defaultUnit ? - scope.row.defaultUnit== scope.row.conUnitTwo? - ((scope.row.costPrice*scope.row.conUnitTwoConvert).toFixed(2)): scope.row.costPrice:scope.row.costPrice) - : scope.row.unit== scope.row.conUnitTwo? - ((scope.row.costPrice*scope.row.conUnitTwoConvert).toFixed(2)): scope.row.costPrice}} - / + {{ !scope.row.unit ? + (scope.row.defaultUnit ? + scope.row.defaultUnit == scope.row.conUnitTwo ? + ((scope.row.costPrice * scope.row.conUnitTwoConvert).toFixed(2)) : + scope.row.costPrice : scope.row.costPrice) + : scope.row.unit == scope.row.conUnitTwo ? + ((scope.row.costPrice * scope.row.conUnitTwoConvert).toFixed(2)) : scope.row.costPrice }} + / {{ !scope.row.unit ? (scope.row.defaultUnit ? scope.row.defaultUnit : scope.row.conUnit) : scope.row.unit }} @@ -154,13 +155,13 @@ controls-position="right" @change="consCountTotal($event, scope.row, 'stockNumber')">
入库前: - {{ !scope.row.unit ? - (scope.row.defaultUnit ? - scope.row.defaultUnit== scope.row.conUnitTwo? - (scope.row.number/scope.row.conUnitTwoConvert): scope.row.number:scope.row.number) - : scope.row.unit== scope.row.conUnitTwo? - (scope.row.number/scope.row.conUnitTwoConvert): scope.row.number}} - + {{ !scope.row.unit ? + (scope.row.defaultUnit ? + scope.row.defaultUnit == scope.row.conUnitTwo ? + (scope.row.number / scope.row.conUnitTwoConvert) : scope.row.number : scope.row.number) + : scope.row.unit == scope.row.conUnitTwo ? + (scope.row.number / scope.row.conUnitTwoConvert) : scope.row.number }} + {{ !scope.row.unit ? (scope.row.defaultUnit ? scope.row.defaultUnit : scope.row.conUnit) : scope.row.unit }}
@@ -343,6 +344,17 @@ export default { mounted() { this.resetForm = { ...this.queryForm } this.tbShopPurveyorGet() + console.log(this.$route.query.consdata) + if (this.$route.query.consdata) { + let arr = this.$route.query.consdata.map(item => { + item.number = formatDecimal(item.stockNumber - item.stockConsume, 2, true) + item.stockNumber = 0 + item.costPrice = item.price + item.conInfoId = item.id + return item + }) + this.tableData.list = [...this.tableData.list, ...arr] + } }, methods: { async querySearchAsync(queryString, cb) {//快捷搜索 @@ -556,6 +568,7 @@ export default { }, // 选择耗材 selectConsumable(res) { + console.log(res) let arr = res.map(item => { item.number = formatDecimal(item.stockNumber - item.stockConsume, 2, true) item.stockNumber = 0 diff --git a/src/views/invoicing/supplier_manage/purchase_detail.vue b/src/views/invoicing/supplier_manage/purchase_detail.vue index 1251f87..1711d61 100644 --- a/src/views/invoicing/supplier_manage/purchase_detail.vue +++ b/src/views/invoicing/supplier_manage/purchase_detail.vue @@ -126,8 +126,8 @@ 付款 账单付款记录 - 出入库记录 + 货单记录 @@ -175,10 +175,10 @@ - +
- + + + + + +
-
- + +
+
转出库单
@@ -315,6 +322,7 @@ export default { total: 0, id: '' }, + consdata: []//回填跳转到入库 } }, filters: { @@ -463,29 +471,40 @@ export default { this.stockData.page = e - 1; this.gettbConsInfoFlowstock(); }, + func() { + this.$router.push({ + name: 'operation_in', + query: { + consdata: this.consdata + } + }) + }, async gettbConsInfoFlowstock(item) { + console.log(item) if (item) { this.stockData.id = item.id + this.consdata = item.cons + this.stockData.data = item.conFlows } this.variabilityshow = true - this.stockData.loading = true; + // this.stockData.loading = true; let arr = [] // if (this.query.createdAt.length) { // arr = [this.query.createdAt[0] + ' 00:00:00', this.query.createdAt[1] + ' 23:59:59'] // } else { // arr = [] // } - let res = await tbProductStockOperatepage({ - page: this.stockData.page, - size: this.stockData.size, - shopId: localStorage.getItem("shopId"), - type: ["cons_in", "cons_out"],//预留耗材id - purveyorId: this.stockData.id,//列名 - createdAt: arr//耗材id - }) - this.stockData.loading = false; - this.stockData.data = res.content; - this.stockData.total = res.totalElements; + // let res = await tbProductStockOperatepage({ + // page: this.stockData.page, + // size: this.stockData.size, + // shopId: localStorage.getItem("shopId"), + // type: ["cons_in", "cons_out"],//预留耗材id + // purveyorId: this.stockData.id,//列名 + // createdAt: arr//耗材id + // }) + // this.stockData.loading = false; + // this.stockData.data = res.content; + // this.stockData.total = res.totalElements; }, } } diff --git a/src/views/monitor/log/index.vue b/src/views/monitor/log/index.vue index 41a00dc..230e256 100644 --- a/src/views/monitor/log/index.vue +++ b/src/views/monitor/log/index.vue @@ -31,7 +31,7 @@ - + From 45eaccb9ac796146d7e31fd4b44c216ea8f16212 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Thu, 28 Nov 2024 17:50:27 +0800 Subject: [PATCH 16/19] =?UTF-8?q?=E4=BB=A3=E5=AE=A2=E4=B8=8B=E5=8D=95?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8D=95=E5=93=81=E6=94=B9=E4=BB=B7=EF=BC=8C?= =?UTF-8?q?=E6=8C=82=E8=B4=A6=EF=BC=8C=E7=AD=89=E5=8F=AB=EF=BC=8C=E5=85=8D?= =?UTF-8?q?=E5=8E=A8=E6=89=93=E7=AD=89=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/Instead.js | 12 ++ .../tool/Instead/components/cart-item.vue | 77 ++++++--- .../components/popup-cart-changePrice.vue | 4 +- .../components/popup-choose-guazhang.vue | 6 +- src/views/tool/Instead/index.vue | 151 ++++++++++++++++-- 5 files changed, 210 insertions(+), 40 deletions(-) diff --git a/src/api/Instead.js b/src/api/Instead.js index 8be0623..296c793 100644 --- a/src/api/Instead.js +++ b/src/api/Instead.js @@ -53,4 +53,16 @@ export function $checkCoupon(data) { ...data } }); +} +//整体等叫/取消等叫 +export function $waitCall(data) { + return request({ + url: '/api/place/waitCall', + method: "put", + data:{ + useType:getUseType(), + shopId: localStorage.getItem("shopId"), + ...data + } + }); } \ No newline at end of file diff --git a/src/views/tool/Instead/components/cart-item.vue b/src/views/tool/Instead/components/cart-item.vue index 94cd126..d275783 100644 --- a/src/views/tool/Instead/components/cart-item.vue +++ b/src/views/tool/Instead/components/cart-item.vue @@ -4,8 +4,12 @@ :class="[isActive]" @click="itemClick" > - - 退 +
+ + + + 退 +
-
备注:{{ item.note || "" }}
+
备注:{{ item.note }}
备注: @@ -74,11 +78,23 @@ ¥{{ isShowVipPrice ? vipAllPrice : allPrice }}
+ @@ -1507,7 +1539,7 @@ import { } from "@/api/table"; import { tbShopCategoryGet } from "@/api/shop"; -import { $checkCoupon } from "@/api/Instead"; +import { $checkCoupon,$waitCall } from "@/api/Instead"; import { isCanBuy, arrayContainsAll, @@ -1524,7 +1556,7 @@ import { returnProductCoupAllPrice } from "./quan_util.js"; //商品数量从0到n每一个对应的价格 let $goodsPayPriceMap = {}; import { $status } from "@/utils/table.js"; -import PopupChooseGuazhang from './components/popup-choose-guazhang.vue'; +import PopupChooseGuazhang from "./components/popup-choose-guazhang.vue"; let $originTableList = []; export default { @@ -1549,6 +1581,8 @@ export default { }, data() { return { + //挂账人 + guazhangRen: "", disabledPayType: [], //积分抵扣 points: { @@ -1762,9 +1796,33 @@ export default { }, }, timer: null, + isAllWaitCall: false, }; }, computed: { + returnPrintText(){ + if (this.order.selIndex < 0) { + return "免厨打"; + } + return this.order.list[this.order.selIndex].isPrint + ? "免厨打" + : "打印"; + }, + returnWaingText() { + if (this.order.selIndex < 0) { + return "等叫"; + } + return this.order.list[this.order.selIndex].isWaitCall == 1 + ? "取消等叫" + : "等叫"; + }, + isHasWaiting() { + const waitingArr = this.order.list.filter((v) => v.isWaitCall == 1); + return waitingArr.length > 0 ? true : false; + }, + returnWaingAllText() { + return this.isAllWaitCall ? "取消全部等叫" : "整单等叫"; + }, pointsDiscountAmount() { if (this.points.selected) { return this.points.toMoney; @@ -1970,8 +2028,28 @@ export default { }, 0); return (oldMemberPrice + nowMemberprice).toFixed(2); }, + discountSaleAmount() { + const oldTotal = this.order.old.list.reduce((a, b) => { + const bTotal = b.info + .filter((v) => v.discountSaleAmount && v.discountSaleAmount > 0) + .reduce((prve, cur) => { + return prve + cur.number * cur.discountSaleAmount; + }, 0); + return a + bTotal; + }, 0); + const nowTotal = this.order.list + .filter((v) => v.discountSaleAmount && v.discountSaleAmount > 0) + .reduce((a, b) => { + return a + b.number * b.discountSaleAmount; + }, 0); + return (oldTotal + nowTotal).toFixed(2); + }, youhuiAllPrice() { - return (this.vipDiscountPrice * 1 + this.allGiftMoney * 1).toFixed(2); + return ( + this.vipDiscountPrice * 1 + + this.allGiftMoney * 1 + + this.discountSaleAmount * 1 + ).toFixed(2); }, allNumber() { const oldNumber = this.order.old.list.reduce((a, b) => { @@ -2246,8 +2324,16 @@ export default { this.open(this.$route.query); }, methods: { + //挂账人支付确认 + guazhangPayConfirm(guazhangren, price) { + this.guazhangRen = guazhangren; + this.pays({ + creditBuyerId: this.guazhangRen.id, + payType: "creditBuyer", + }); + }, //挂账 - guazhangShow(){ + guazhangShow() { this.$refs.refGuaZhang.open(); }, //团购券扫码弹窗 @@ -2261,7 +2347,8 @@ export default { //更新单品改价数据 updateCartItem(res) { if (res) { - this.order.list[this.order.selIndex] = res; + // this.order.list[this.order.selIndex] = res; + this.$set(this.order.list, this.order.selIndex, res) } }, // 单品改价 @@ -2972,7 +3059,7 @@ export default { this.pays(); }, // 支付订单 - async pays() { + async pays(par) { this.loading = true; const userCouponInfos = this.quansSelArr.reduce((prve, cur) => { const index = prve.findIndex((v) => v.userCouponId == cur.couponId); @@ -3004,8 +3091,9 @@ export default { vipUserId: this.createOrder.data.memberId || this.vipUser.id, discount: this.createOrder.discount, code: this.createOrder.code, - userCouponInfos, + userCouponInfos: userCouponInfos.length > 0 ? userCouponInfos : "", pointsNum: this.points.value, + ...par, }); this.loading = false; this.payOrderSuccess(); @@ -3133,7 +3221,16 @@ export default { updateOrder(par = {}) { let item = this.order.list[this.order.selIndex]; console.log(this.table); - const { productId, skuId, isPack, isGift, number, id } = item; + const { + productId, + skuId, + isPack, + isGift, + number, + id, + isPrint, + isWaitCall, + } = item; $updateCart({ cartId: id, masterId: this.masterId, @@ -3144,6 +3241,8 @@ export default { num: number, isPack: isPack === "true" ? true : false, isGift: isGift === "true" ? true : false, + isPrint, + isWaitCall, ...par, }).then((res) => { this.$set(this.order.list, this.order.selIndex, { @@ -3196,7 +3295,7 @@ export default { // }, //右侧控制按钮点击事件 - orderBtnsClick(key) { + async orderBtnsClick(key) { const orderGoods = this.order.list[this.order.selIndex]; if (this.key != "isJieZhang" && this.payAfter) { this.createOrderClose(); @@ -3221,6 +3320,27 @@ export default { if (key === "del") { return this.removeCart(); } + if (key === "print") { + const isPrint = orderGoods.isPrint; + this.updateOrder({ isPrint: !isPrint }); + return; + } + if (key === "isWaitCall") { + const isWaitCall = orderGoods.isWaitCall; + this.updateOrder({ isWaitCall: !isWaitCall }); + return; + } + if (key == "AllWaitCall") { + await $waitCall({ + orderId:this.createOrder.data.id, + masterId:this.masterId, + tableId:this.table.tableId, + isWaitCall: !this.isAllWaitCall?1:0 + }) + this.isAllWaitCall=!this.isAllWaitCall; + this.getCart() + return; + } if (key === "save") { this.prveOrder.list.push({ cart: this.order.list, @@ -3621,6 +3741,7 @@ export default { tableId: this.table.tableId, num: this.skuGoods.number, // 0会删除此商品 isPack: false, // 是否打包 + isWaitCall:this.isAllWaitCall //是否等叫 }); this.orderListPush({ ...res, specSnap: name }); // this.orderListPush({ @@ -3726,6 +3847,7 @@ export default { }, reset() { // this.goods.list = []; + this.guazhangRen = ""; this.order.status = ""; this.loading = false; this.table = ""; @@ -3922,6 +4044,7 @@ export default { tableId: this.table.tableId, num: item.specList[0].suit, // 0会删除此商品 isPack: false, // 是否打包 + isWaitCall:this.isAllWaitCall //是否等叫 }); this.orderListPush(res); } From f663db95f3723ef2ca3089525c41b938ae2e8955 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Thu, 28 Nov 2024 18:26:53 +0800 Subject: [PATCH 17/19] =?UTF-8?q?=E4=BB=A3=E5=AE=A2=E4=B8=8B=E5=8D=95?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=99=90=E5=88=B6=EF=BC=8C=E5=BD=93=E4=BB=B7?= =?UTF-8?q?=E6=A0=BC=E4=B8=BA0=E6=97=B6=E7=A6=81=E6=AD=A2=E6=8C=82?= =?UTF-8?q?=E8=B4=A6=EF=BC=8C=E5=A2=9E=E5=8A=A0=E4=B8=B4=E6=97=B6=E8=8F=9C?= =?UTF-8?q?=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tool/Instead/components/cart-item.vue | 6 ++++ src/views/tool/Instead/index.vue | 35 +++++++++++++++++-- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/src/views/tool/Instead/components/cart-item.vue b/src/views/tool/Instead/components/cart-item.vue index d275783..b472feb 100644 --- a/src/views/tool/Instead/components/cart-item.vue +++ b/src/views/tool/Instead/components/cart-item.vue @@ -18,6 +18,12 @@ > {{ item.name }}
+
+ 临时菜 +
diff --git a/src/views/tool/Instead/index.vue b/src/views/tool/Instead/index.vue index 59c1e8b..f19c65a 100644 --- a/src/views/tool/Instead/index.vue +++ b/src/views/tool/Instead/index.vue @@ -1069,7 +1069,9 @@ :disabledPayType="disabledPayType" > - 挂账 + 挂账
立即支付 @@ -2105,7 +2107,7 @@ export default { watch: { yinFuJinE: function (newval) { if (newval <= 0) { - this.disabledPayType = ["scanCode", "deposit"]; + this.disabledPayType = ["scanCode", "deposit","creditBuyer"]; } else { this.disabledPayType = []; } @@ -3882,7 +3884,8 @@ export default { //设置购物车数据 setCart(res) { console.log(res); - const { seatFee } = res; + try { + const { seatFee } = res; this.order.seatFee = seatFee ? { ...seatFee, @@ -3901,6 +3904,32 @@ export default { this.order.old.list = oldCart ? oldCart : []; // this.order.gift.list = returnGiftArr(res.records); console.log(this.order.old.list); + } catch (error) { + //当购物车数据发生错误时会导致页面报错购物车商品不展示 + this.$confirm('购物车数据结构错误,是否清空购物车商品?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + $clearCart({ + masterId: this.masterId, + tableId: this.table.tableId, + }).then((res) => { + this.order.list = []; + this.changeOrderSel(-1); + this.$message({ + type: "success", + message: "清除成功!", + }); + }); + }).catch(() => { + this.$message({ + type: 'info', + message: '已取消' + }); + }); + } + }, //获取购物车数据 async getCart() { From 0768355644a1432d94e8639b90b74364182d3767 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Fri, 29 Nov 2024 09:58:22 +0800 Subject: [PATCH 18/19] =?UTF-8?q?=E9=99=90=E5=88=B6=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=85=88=E4=BB=98=E8=B4=B9=E7=A6=81=E6=AD=A2=E9=80=80=E8=8F=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/tool/Instead/index.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/views/tool/Instead/index.vue b/src/views/tool/Instead/index.vue index f19c65a..a0c6186 100644 --- a/src/views/tool/Instead/index.vue +++ b/src/views/tool/Instead/index.vue @@ -1877,6 +1877,8 @@ export default { !this.order.selGoods || this.order.old.list.length <= 0 || this.order.selGoods.status == "return" + ||this.order.selGoods.useType=='dine-in' + ||this.order.selGoods.useType=='dine-in-before' ); }, title() { From 8baaf8ff943c0f0dae066dd20ee7719c50413b3e Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Fri, 29 Nov 2024 14:12:32 +0800 Subject: [PATCH 19/19] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=AB=E7=A0=81?= =?UTF-8?q?=E9=AA=8C=E5=88=B8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/coup/index.js | 199 +++++++++++++++++++++++++++++++++++++++ src/utils/request-php.js | 101 ++++++++++++++++++++ 2 files changed, 300 insertions(+) create mode 100644 src/api/coup/index.js create mode 100644 src/utils/request-php.js diff --git a/src/api/coup/index.js b/src/api/coup/index.js new file mode 100644 index 0000000..9ba574a --- /dev/null +++ b/src/api/coup/index.js @@ -0,0 +1,199 @@ +// 代客下单 +import request from "@/utils/request-php"; + +// 抖音团购核销准备 +export function $douyin_fulfilmentcertificateprepare(data) { + return request({ + url: 'douyin/fulfilmentcertificateprepare', + method: "post", + data: { + shopId: localStorage.getItem("shopId"), + ...data + } + }); +} +// 抖音团购核销 +export function $douyin_certificateprepare(data) { + return request({ + url: 'douyin/certificateprepare', + method: "post", + data: { + shopId: localStorage.getItem("shopId"), + ...data + } + }); +} + +// 抖音团购核销撤销 +export function $douyin_fulfilmentcertificatecancel(data) { + return request({ + url: 'douyin/fulfilmentcertificatecancel', + method: "post", + data: { + shopId: localStorage.getItem("shopId"), + ...data + } + }); +} +// 抖音团购核销记录 +export function $douyin_orderlist(data) { + return request({ + url: 'douyin/orderlist', + method: "post", + data: { + shopId: localStorage.getItem("shopId"), + ...data + } + }); +} + + +// 抖音门店列表 +export function $douyin_storelist(data) { + return request({ + url: 'douyin/storelist', + method: "post", + data: { + shopId: localStorage.getItem("shopId"), + ...data + } + }); +} + +// 抖音绑定门店 +export function $douyin_bindstore(data) { + return request({ + url: 'douyin/bindstore', + method: "post", + data: { + shopId: localStorage.getItem("shopId"), + ...data + } + }); +} +// 抖音订单查询 + +export function $douyin_orderquery(data) { + return request({ + url: 'douyin/orderquery', + method: "post", + data: { + shopId: localStorage.getItem("shopId"), + ...data + } + }); +} +//会员签入 +export function $douyin_checkIn(data) { + return request({ + url: 'douyin/checkIn', + method: "post", + data: { + shopId: localStorage.getItem("shopId"), + ...data + } + }); +} + +//美团 + +// 美团获取uisdk 绑定 链接 + +export function $meituan_getuisdkurl(data) { + return request({ + url: 'meituan/getuisdkurl', + method: "post", + data: { + shopId: localStorage.getItem("shopId"), + ...data + } + }); +} +// 美团获取uisdk 解绑 链接 + +export function $meituan_getuisdkuniurl(data) { + return request({ + url: 'meituan/getuisdkuniurl', + method: "post", + data: { + shopId: localStorage.getItem("shopId"), + ...data + } + }); +} +// 美团团购核销准备 + +export function $meituan_fulfilmentcertificateprepare(data) { + return request({ + url: 'meituan/fulfilmentcertificateprepare', + method: "post", + data: { + shopId: localStorage.getItem("shopId"), + ...data + } + }); +} +// 美团执行核销 + +export function $meituan_certificateprepare(data) { + return request({ + url: 'meituan/certificateprepare', + method: "post", + data: { + shopId: localStorage.getItem("shopId"), + ...data + } + }); +} +// 美团团购核销记录 + + +export function $meituan_orderlist(data) { + return request({ + url: 'meituan/orderlist', + method: "post", + data: { + shopId: localStorage.getItem("shopId"), + ...data + } + }); +} + +// 美团团购撤销 + + +export function $meituan_fulfilmentcertificatecancel(data) { + return request({ + url: 'meituan/fulfilmentcertificatecancel', + method: "post", + data: { + shopId: localStorage.getItem("shopId"), + ...data + } + }); +} + +// 美团查询绑定状态 +export function $meituan_searchstorestatus(data) { + return request({ + url: 'meituan/searchstorestatus', + method: "post", + data: { + shopId: localStorage.getItem("shopId"), + ...data + } + }); +} + +// 登出 +export function $logout(data) { + return request({ + url: 'user/logout', + method: "post", + data: { + shopId: localStorage.getItem("shopId"), + ...data + } + }); +} + diff --git a/src/utils/request-php.js b/src/utils/request-php.js new file mode 100644 index 0000000..a19cfbb --- /dev/null +++ b/src/utils/request-php.js @@ -0,0 +1,101 @@ +import axios from 'axios' +import router from '@/router/routers' +import { Notification } from 'element-ui' +import store from '../store' +import { getToken } from '@/utils/auth' +import Config from '@/settings' +import Cookies from 'js-cookie' +import { setToken } from '@/utils/globalCancelToken.js' +// 创建axios实例 +const service = axios.create({ + // baseURL: process.env.NODE_ENV === 'production' ? process.env.VUE_APP_BASE_API : '/', + baseURL: 'https://czgdoumei.sxczgkj.com/index.php/api/', // api 的 base_url + timeout: Config.timeout // 请求超时时间 +}) + +// request拦截器 +service.interceptors.request.use( + config => { + if (getToken()) { + config.headers['Authorization'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 + } + config.headers['Content-Type'] = 'application/json' + // 添加可取消请求配置 + config.cancelToken = new axios.CancelToken(c => setToken(c)) + return config + }, + error => { + Promise.reject(error) + } +) + +// response 拦截器 +service.interceptors.response.use( + response => { + return response.data + }, + error => { + console.log(error); + if (axios.isCancel(error)) { + console.log('请求已取消') + Notification.error({ + title: '请求已取消', + duration: 5000 + }) + return Promise.reject('请求已取消') + } + + // 兼容blob下载出错json提示 + if (error.response.data instanceof Blob && error.response.data.type.toLowerCase().indexOf('json') !== -1) { + const reader = new FileReader() + reader.readAsText(error.response.data, 'utf-8') + reader.onload = function (e) { + const errorMsg = JSON.parse(reader.result).message + Notification.error({ + title: errorMsg, + duration: 5000 + }) + } + } else { + let code = 0 + try { + code = error.response.data.status + } catch (e) { + if (error.toString().indexOf('Error: timeout') !== -1) { + Notification.error({ + title: '网络请求超时', + duration: 5000 + }) + return Promise.reject(error) + } + } + console.log(code) + if (code) { + if (code === 401) { + store.dispatch('LogOut').then(() => { + // 用户登录界面提示 + Cookies.set('point', 401) + location.reload() + }) + } else if (code === 403) { + router.push({ path: '/401' }) + } else { + const errorMsg = error.response.data.message + if (errorMsg !== undefined) { + Notification.error({ + title: errorMsg, + duration: 5000 + }) + } + } + } else { + Notification.error({ + title: '接口请求失败', + duration: 5000 + }) + } + } + return Promise.reject(error) + } +) +export default service