diff --git a/src/api/table.js b/src/api/table.js index 34af13a..57bf688 100644 --- a/src/api/table.js +++ b/src/api/table.js @@ -439,3 +439,14 @@ export function $getOrderPayUrl(data) { } }); } +//退款 +export function $returnOrder(data) { + return request({ + url: '/api/place/returnOrder', + method: "post", + data:{ + shopId: localStorage.getItem("shopId"), + ...data + } + }); +} diff --git a/src/utils/limits.js b/src/utils/limits.js index ab82fc4..773d8d5 100644 --- a/src/utils/limits.js +++ b/src/utils/limits.js @@ -102,7 +102,7 @@ export async function hasPermission (params) { } params = returnFormatParams(params) if (!params) { - return infoBox.showToast('未找到相关权限,请检查代码或在权限配置文件commons/utils/hasPermission.js文件进行修改或增加') + return Notification.error('未找到相关权限,请检查代码或在权限配置文件commons/utils/hasPermission.js文件进行修改或增加') } const option = Object.assign({ tips: true, diff --git a/src/views/devices/details.vue b/src/views/devices/details.vue index 478a4bb..4cd8639 100644 --- a/src/views/devices/details.vue +++ b/src/views/devices/details.vue @@ -36,7 +36,7 @@
* 可在打印机设备底部查看打印机编号和秘钥(key)
--> - + @@ -49,6 +49,7 @@ 部分分类 +
仅打印制作单[厨房]
@@ -193,6 +199,19 @@ -->
+ + @@ -200,7 +219,14 @@ import orderEnum from "../orderEnum"; import dayjs from "dayjs"; import { tbOrderInfoDetail, tbOrderInfoData } from "@/api/order"; +import returnCart from "@/views/tool/Instead/components/return-cart.vue"; +import returnMoney from "@/views/tool/Instead/components/return-money.vue"; +import { + $returnCart,$returnOrder +} from "@/api/table"; export default { + components: { returnCart,returnMoney }, + data() { return { orderEnum, @@ -208,7 +234,8 @@ export default { type: "1", detail: "", loading: false, - refoundList: [] + refoundList: [], + selGoods:{num:1} }; }, filters: { @@ -242,6 +269,38 @@ export default { } }, methods: { + async refReturnMoneyConfirm(e){ + const res = await $returnOrder({ + ...e, + orderId:this.detail.id, + orderDetails:[{ + id:this.selGoods.id, + num:e.num + }] + }); + this.update(); + }, + update(){ + this.tbOrderInfoDetail(this.detail.id); + }, + async refReturnCartConfirm(e){ + const res = await $returnCart({ + ...e, + cartId: this.selGoods.id, + tableId: this.detail.tableId, + }); + this.update(); + }, + tuikuan(item){ + this.selGoods=item; + console.log(item); + this.$refs.refReturnMoney.open(item); + }, + tuiCai(item){ + this.selGoods=item; + console.log(item); + this.$refs.refReturnCart.open(item); + }, // 切换类型 getTableData() { if (this.type == "3") { diff --git a/src/views/product/category.vue b/src/views/product/category.vue index 50f658e..650c31f 100644 --- a/src/views/product/category.vue +++ b/src/views/product/category.vue @@ -64,6 +64,8 @@ // import Sortable from 'sortablejs' import addClassify from './components/addClassify' import { tbShopCategoryGet, tbShopCategoryDelete, tbShopCategoryPost, upCategorySort } from '@/api/shop' +import { hasPermission } from '@/utils/limits.js' + export default { components: { addClassify @@ -114,6 +116,9 @@ export default { // }, // 状态切换 async showChange(e, row) { + let res = await hasPermission('允许修改分类'); + if ( !res) { row.isShow = (e == 0 ? 1 : 0);return; } + try { await tbShopCategoryPost(row, 'put') this.getTableData() @@ -141,6 +146,8 @@ export default { }, // 删除 async delHandle(ids) { + let res = await hasPermission('允许修改分类'); + if ( !res) { return; } try { await tbShopCategoryDelete(ids) this.$notify({ diff --git a/src/views/product/group/index.vue b/src/views/product/group/index.vue index d887081..e6eb188 100644 --- a/src/views/product/group/index.vue +++ b/src/views/product/group/index.vue @@ -48,6 +48,7 @@ + + \ No newline at end of file diff --git a/src/views/tool/Instead/components/return-cart.vue b/src/views/tool/Instead/components/return-cart.vue index 61678f2..c99550d 100644 --- a/src/views/tool/Instead/components/return-cart.vue +++ b/src/views/tool/Instead/components/return-cart.vue @@ -1,10 +1,19 @@ + + \ No newline at end of file diff --git a/src/views/tool/Instead/index.vue b/src/views/tool/Instead/index.vue index a2c6ab6..8a9aa4a 100644 --- a/src/views/tool/Instead/index.vue +++ b/src/views/tool/Instead/index.vue @@ -1,12 +1,76 @@ -
-
以下是优惠菜品
-
-
+ +
+
以下是优惠菜品
+ +
+ + +
订单备注: {{ note.content }}
@@ -329,7 +374,7 @@
- 已优惠¥{{ allGiftMoney | to2 }} + 已优惠¥{{ allGiftMoney }}
@@ -551,17 +596,17 @@