diff --git a/api/buyer.js b/api/buyer.js
new file mode 100644
index 0000000..089d2e2
--- /dev/null
+++ b/api/buyer.js
@@ -0,0 +1,136 @@
+import http from '@/http/http.js'
+const request = http.request
+
+/**
+ * 获取挂账人分页
+ * @returns
+ */
+export function getCreditBuyerPage(data, urlType = 'order') {
+ return request({
+ url: `${urlType}/admin/order/credit/buyer/page`,
+ method: "GET",
+ data: {
+ ...data
+ }
+ })
+}
+
+/**
+ * 获取挂账人详情
+ * @returns
+ */
+export function getCreditBuyerDetail(id, urlType = 'order') {
+ return request({
+ url: `${urlType}/admin/order/credit/buyer/${id}`,
+ method: "GET",
+ })
+}
+
+/**
+ * 添加挂账人
+ * @returns
+ */
+export function addCreditBuyer(data, urlType = 'order') {
+ return request({
+ url: `${urlType}/admin/order/credit/buyer`,
+ method: "POST",
+ data: {
+ ...data
+ }
+ })
+}
+
+/**
+ * 编辑挂账人
+ * @returns
+ */
+export function editCreditBuyer(data, urlType = 'order') {
+ return request({
+ url: `${urlType}/admin/order/credit/buyer`,
+ method: "PUT",
+ data: {
+ ...data
+ }
+ })
+}
+
+/**
+ * 删除挂账人
+ * @returns
+ */
+export function delCreditBuyer(id, urlType = 'order') {
+ return request({
+ url: `${urlType}/admin/order/credit/buyer/${id}`,
+ method: "DELETE",
+ })
+}
+
+/**
+ * 还款
+ * @returns
+ */
+export function creditBuyerRepayment(data, urlType = 'order') {
+ return request({
+ url: `${urlType}/admin/order/credit/buyer/repayment`,
+ method: "POST",
+ data: {
+ ...data
+ }
+ })
+}
+
+/**
+ * 付款
+ * @returns
+ */
+export function creditBuyerOrderPay(data, urlType = 'order') {
+ return request({
+ url: `${urlType}/admin/order/credit/buyerOrder/pay`,
+ method: "POST",
+ data: {
+ ...data
+ }
+ })
+}
+
+/**
+ * 还款记录
+ * @returns
+ */
+export function creditRePaymentRecord(data, urlType = 'order') {
+ return request({
+ url: `${urlType}/admin/order/credit/paymentRecord/page`,
+ method: "GET",
+ data: {
+ ...data
+ }
+ })
+}
+
+/**
+ * 明细分页
+ * @returns
+ */
+export function creditBuyerOrderList(data, urlType = 'order') {
+ return request({
+ url: `${urlType}/admin/order/credit/buyerOrder/page`,
+ method: "GET",
+ data: {
+ ...data
+ }
+ })
+}
+
+/**
+ * 明细统计
+ * @returns
+ */
+export function creditBuyerOrderSummary(data, urlType = 'order') {
+ return request({
+ url: `${urlType}/admin/order/credit/buyerOrder/summary`,
+ method: "GET",
+ data: {
+ ...data
+ }
+ })
+}
\ No newline at end of file
diff --git a/api/cons.js b/api/cons.js
index 8667c70..c3e1a1f 100644
--- a/api/cons.js
+++ b/api/cons.js
@@ -178,3 +178,17 @@ export function stockCheck(data, urlType = 'product') {
}
})
}
+
+/**
+ * 耗材报损
+ * @returns
+ */
+export function stockReportDamage(data, urlType = 'product') {
+ return request({
+ url: `${urlType}/admin/product/stock/reportDamage`,
+ method: "POST",
+ data: {
+ ...data
+ }
+ })
+}
diff --git a/api/order.js b/api/order.js
index ed3a537..6adb7b5 100644
--- a/api/order.js
+++ b/api/order.js
@@ -71,4 +71,19 @@ export function refundOrder(data, urlType = 'order') {
})
}
+/**
+ * 订单打印
+ * @returns
+ */
+export function printOrder(data, urlType = 'order') {
+ return request({
+ url: `${urlType}/admin/order/print`,
+ method: "POST",
+ data: {
+ ...data
+ }
+ })
+}
+
+
diff --git a/api/pay.js b/api/pay.js
index 083b5d0..1f4b8dc 100644
--- a/api/pay.js
+++ b/api/pay.js
@@ -57,6 +57,20 @@ export function microPay(data, urlType = 'order') {
})
}
+/**
+ * 挂账支付
+ * @returns
+ */
+export function creditPay(data, urlType = 'order') {
+ return request({
+ url: `${urlType}/pay/creditPay`,
+ method: "POST",
+ data: {
+ ...data
+ }
+ })
+}
+
/**
* 会员支付
* @returns
diff --git a/api/points.js b/api/points.js
new file mode 100644
index 0000000..50ad4a9
--- /dev/null
+++ b/api/points.js
@@ -0,0 +1,59 @@
+import http from '@/http/http.js'
+const request = http.request
+
+/**
+ * 获取订单可用积分及抵扣金额(支付页面使用)
+ * @returns
+ */
+export function calcUsablePoints(data, urlType = 'account') {
+ return request({
+ url: `${urlType}/admin/points/memberPoints/calcUsablePoints`,
+ method: "GET",
+ data: {
+ ...data
+ }
+ })
+}
+
+/**
+ * 根据积分计算可抵扣金额
+ * @returns
+ */
+export function calcDeductionAmount(data, urlType = 'account') {
+ return request({
+ url: `${urlType}/admin/points/memberPoints/calcDeductionAmount`,
+ method: "GET",
+ data: {
+ ...data
+ }
+ })
+}
+
+/**
+ * 支付完成扣减积分
+ * @returns
+ */
+export function payedDeductPoints(data, urlType = 'account') {
+ return request({
+ url: `${urlType}/admin/points/memberPoints/payedDeductPoints`,
+ method: "POST",
+ data: {
+ ...data
+ }
+ })
+}
+
+
+/**
+ * 消费赠送积分
+ * @returns
+ */
+export function consumeAwardPoints(data, urlType = 'account') {
+ return request({
+ url: `${urlType}/admin/points/memberPoints/consumeAwardPoints`,
+ method: "POST",
+ data: {
+ ...data
+ }
+ })
+}
diff --git a/api/product.js b/api/product.js
index 2ad3404..8fc85c2 100644
--- a/api/product.js
+++ b/api/product.js
@@ -108,6 +108,22 @@ export function productBindCons(data, urlType = 'product') {
}
})
}
+
+/**
+ * 商品报损
+ * @returns
+ */
+export function productReportDamage(data, urlType = 'product') {
+ return request({
+ url: `${urlType}/admin/product/reportDamage`,
+ method: "POST",
+ data: {
+ ...data
+ }
+ })
+}
+
+
// 商品分类----------------------------------------------------------------------------------------------------
/**
* 获取商品分类列表
diff --git a/api/summary.js b/api/summary.js
new file mode 100644
index 0000000..c849489
--- /dev/null
+++ b/api/summary.js
@@ -0,0 +1,16 @@
+import http from '@/http/http.js'
+const request = http.request
+
+/**
+ * 商品销售汇总
+ * @returns
+ */
+export function productSaleDate(data, urlType = 'order') {
+ return request({
+ url: `${urlType}/admin/data/summary/productSaleDate`,
+ method: "GET",
+ data: {
+ ...data
+ }
+ })
+}
diff --git a/api/table.js b/api/table.js
index 0c1138d..fcbc313 100644
--- a/api/table.js
+++ b/api/table.js
@@ -29,6 +29,20 @@ export function getShopTableDetail(data, urlType = 'account') {
})
}
+/**
+ * 台桌清台
+ * @returns
+ */
+export function shopTableClear(data, urlType = 'account') {
+ return request({
+ url: `${urlType}/admin/shopTable/clear`,
+ method: "PUT",
+ data: {
+ ...data
+ }
+ })
+}
+
/**
* 台桌绑定
* @returns
diff --git a/commons/utils/goodsUtil.js b/commons/utils/goodsUtil.js
index 5ffb317..c664c34 100644
--- a/commons/utils/goodsUtil.js
+++ b/commons/utils/goodsUtil.js
@@ -17,15 +17,34 @@ export function canTuicai(orderInfo, item) {
return orderInfo.status == 'unpaid' && orderInfo.useType != 'dine-in-before' && item.status != 'return'
}
export function canTuiKuan(orderInfo, item) {
- return orderInfo.status == 'done' && item.status != 'return' && item.status != 'refund' && item.status !=
- 'refunding'
+ if( item ){
+ return orderInfo.status == 'done' && item.status != 'return' && item.status != 'refund' && item.status != 'refunding'
+ } else {
+ let goodsList = []
+ let data = false;
+ Object.entries(orderInfo.detailMap).map(([key, value]) => (
+ goodsList = [...goodsList,...value]
+ ))
+ console.log("orderInfo===",orderInfo)
+ console.log("goodsList===",goodsList)
+ goodsList.some((v,i)=>{
+ console.log(v)
+ if( orderInfo.status == 'done' && v.status != 'return' && v.status != 'refund' && v.status != 'refunding' ){
+ data = true
+ console.log(data)
+ return data
+ }
+ })
+ console.log(data)
+ return data
+ }
+
}
export function isTuiCai(item) {
- return item.status == 'return'
+ return item.status == 'return' || item.status == 'part_refund'
}
export function isTui(item) {
- console.log(item)
- return item.status == 'return' || item.status == 'refund' || item.status == 'refunding' || item.status == 'part_refund'
+ return item.status == 'return' || item.status == 'refund' || item.status == 'refunding'
}
export function isGift(item) {
return !isTui(item) && item.isGift == 1
diff --git a/commons/utils/websocket.js b/commons/utils/websocket.js
index 2b96b5f..19b0663 100644
--- a/commons/utils/websocket.js
+++ b/commons/utils/websocket.js
@@ -58,7 +58,7 @@ class WebsocketUtil {
}
this.heartbeatInterval = setInterval(() => {
if (this.isOpen) {
- this.send('心跳检测','heartbeat');
+ this.send(JSON.stringify({"type": "ping_interval"}));
}
}, this.time);
}
@@ -68,7 +68,6 @@ class WebsocketUtil {
if (this.socketTask && this.isOpen) {
this.socketTask.send({
data: data,
- type: type||'heartbeat',
success: (res) => {
// console.log('消息发送成功', res);
},
diff --git a/components/my-components/edit-discount.vue b/components/my-components/edit-discount.vue
index ae05ada..cbb9f2e 100644
--- a/components/my-components/edit-discount.vue
+++ b/components/my-components/edit-discount.vue
@@ -102,6 +102,7 @@
const form = reactive({
...$form
})
+ console.log(form)
watch(()=>props.price,(newval)=>{
console.log(newval);
form.price=newval
diff --git a/components/my-components/my-up-upload.vue b/components/my-components/my-up-upload.vue
index bfbba13..adb8b12 100644
--- a/components/my-components/my-up-upload.vue
+++ b/components/my-components/my-up-upload.vue
@@ -4,13 +4,8 @@
diff --git a/pageGoodsGroup/edit-group-goods/edit-group-goods.vue b/pageGoodsGroup/edit-group-goods/edit-group-goods.vue
index c58e9a4..7127530 100644
--- a/pageGoodsGroup/edit-group-goods/edit-group-goods.vue
+++ b/pageGoodsGroup/edit-group-goods/edit-group-goods.vue
@@ -93,7 +93,7 @@
bindGoodsList: [],
goodsList: [],
query: {
- page: 0,
+ page: 1,
size: 999,
categoryId: '',
name: '',
diff --git a/pageGoodsGroup/index/index.vue b/pageGoodsGroup/index/index.vue
index f897ec7..96c9d5c 100644
--- a/pageGoodsGroup/index/index.vue
+++ b/pageGoodsGroup/index/index.vue
@@ -107,6 +107,10 @@
const res = await getProdGroupPage(pageData.query)
pageData.list = res.records
pageData.totalElements = res.totalRow
+ if(res.records.length <= 0&&res.totalPage>1) {
+ pageData.query.page = res.totalPage
+ getList()
+ }
}
/**
@@ -231,7 +235,9 @@
if (res.confirm) {
delProdGroup(pageData.list[index].id).then(res => {
infoBox.showToast('删除成功')
- getList()
+ setTimeout(()=>{
+ getList()
+ },1500)
})
}
},
diff --git a/pagePrinter/add-printer/add-printer.vue b/pagePrinter/add-printer/add-printer.vue
index 5ab8d61..4eed9a1 100644
--- a/pagePrinter/add-printer/add-printer.vue
+++ b/pagePrinter/add-printer/add-printer.vue
@@ -6,6 +6,8 @@
:list="pageData.brandList">
+
*打印机名称
@@ -122,18 +124,18 @@
import go from '@/commons/utils/go.js';
import pickerItem from './components/picker-item.vue';
import myRadioGroup from './components/my-radio-group.vue';
- import * as Api from '@/http/yskApi/devices.js'
- import { devices, models, subTypes, brand, receipts } from '@/pagePrinter/devices.js'
+ import { devices, subTypes, brand, receipts,connectionType } from '@/pagePrinter/devices.js'
import { getPrinterDetail, addPrinter, updatePrinter } from '@/api/printer.js'
import { categoryPage } from '@/api/cateGory.js'
const pageData = reactive({
brandList: brand, // 打印机品牌列表
receiptsList: receipts, // 小票
+ connectionTypeList: connectionType, // 类型
deciveSizeList: [ // 小票尺寸
{ label: '58mm', value: '58mm' },
- { label: '80mm', value: '58mm' },
+ { label: '80mm', value: '80mm' },
],
classifyPrintList: [ // 分类打印
{ label: '打印所有', value: '0' },
diff --git a/pagePrinter/add-printer/components/picker-item.vue b/pagePrinter/add-printer/components/picker-item.vue
index f6a4511..77e8f81 100644
--- a/pagePrinter/add-printer/components/picker-item.vue
+++ b/pagePrinter/add-printer/components/picker-item.vue
@@ -1,13 +1,6 @@
*{{title}}
-
{{selText}}
@@ -19,11 +12,7 @@
+
+
\ No newline at end of file
diff --git a/pagesOrder/detail/components/list.vue b/pagesOrder/detail/components/list.vue
index cedb012..b75cf2f 100644
--- a/pagesOrder/detail/components/list.vue
+++ b/pagesOrder/detail/components/list.vue
@@ -4,13 +4,13 @@
桌号:
{{orderInfo.tableName||""}}
-
+
共
{{goodsNumber}}
@@ -55,7 +55,7 @@
退款金额:
- {{item.returnAmount}}
+ {{item.returnAmount*item.returnNum}}
退菜数量:
@@ -70,7 +70,6 @@
- {{isTui(item)}}
¥0.00
¥{{returnTotalMoney(item)}}
@@ -79,6 +78,10 @@
¥0.00
¥{{returnTotalMoney(item)}}
+
+ ¥{{item.num*item.memberPrice}}
+ ¥{{item.num*item.price}}
+
¥{{returnTotalMoney(item)}}
@@ -96,7 +99,7 @@
-
+
退菜
@@ -134,10 +137,10 @@
已优惠¥{{youhuiAllPrice}}
-
+
@@ -162,18 +165,25 @@
+
+
+ 全部退款
+
+
+
总计¥
- {{orderInfo.orderAmount }}
+ {{orderInfo.orderAmount.toFixed(2)}}
总计¥
- {{orderInfo.payAmount}}
+ {{orderInfo.payAmount.toFixed(2)}}
@@ -358,7 +368,20 @@
function returnTotalMoney(item) {
return (item.payAmount).toFixed(2)
}
-
+ function returnCanTuiMoney(item) {
+ // if (props.orderInfo.status == 'unpaid') {
+ // return returnTotalMoney(item)
+ // } else {
+ if (props.orderInfo.pointsDiscountAmount > 0 || props.orderInfo.fullCouponDiscountAmount > 0) {
+ return item.canReturnAmount
+ } else if (item.price != item.unitPrice) {
+ return item.price*item.num
+ } else {
+ return item.payAmount
+ }
+
+ // }
+ }
const canTuiKuanPrice = computed(() => {
const goodsTotal = props.data.reduce((prve, cur) => {
const curTotal = cur.info.filter(v => !isTui(v) && !v.userCouponId)
@@ -396,19 +419,7 @@
return seatFee
})
- function returnCanTuiMoney(item) {
- if (props.orderInfo.status == 'unpaid') {
- return returnTotalMoney(item)
- } else {
- if (props.orderInfo.pointsDiscountAmount > 0 || props.orderInfo.fullCouponDiscountAmount > 0) {
- return item.canReturnAmount
- } else if (item.price != item.unitPrice) {
- return item.price*item.num
- } else {
- return item.payAmount
- }
- }
- }
+
function to2(n) {
if (!n) {
@@ -424,10 +435,27 @@
function tuikuan(item, index) {
hasPermission('允许退款').then(res => {
if (res) {
- emits('tuikuan', {
- ...item,
- payAmount: item.payAmount
- }, index)
+ if (Array.isArray(item)) {
+ let arr = [];
+ console.log(item)
+ item.map(v=>{
+ v.info.map(obj=>{
+ obj.number = 0
+ obj.skuName = obj.skuName || ''
+ obj.priceAmount = obj.priceAmount ? obj.priceAmount : (obj.num*obj.unitPrice).toFixed(2)
+ obj.unitPrice = obj.unitPrice
+ })
+
+ arr = [...arr,...v.info]
+ })
+ emits('tuikuan', arr)
+ } else {
+ emits('tuikuan', {
+ ...item,
+ payAmount: item.payAmount
+ }, index)
+ }
+
}
})
}
@@ -448,7 +476,6 @@
if (props.orderInfo.discountAmount) {
return props.orderInfo.discountAmount
}
- console.log(props.orderInfo.originAmount * (1 - props.orderInfo.discountRatio));
return (props.orderInfo.originAmount * (1 - props.orderInfo.discountRatio))
})
const goodsOriginAllPrice = computed(() => {
@@ -513,7 +540,7 @@
* 已优惠金额
*/
const youhuiAllPrice = computed(() => {
- const n = props.orderInfo.orderAmount - props.orderInfo.payAmount + vipDiscountPrice.value * 1
+ const n = props.orderInfo.originAmount - props.orderInfo.orderAmount + vipDiscountPrice.value * 1
return (n < 0 ? 0 : n).toFixed(2)
})
@@ -531,7 +558,6 @@
})
const allPrice = computed(() => {
-
const goodsPrice = props.data.reduce((prve, cur) => {
const curTotal = cur.info.reduce((a,
b) => {
diff --git a/pagesOrder/detail/components/user.vue b/pagesOrder/detail/components/user.vue
index 241ce86..4de69a0 100644
--- a/pagesOrder/detail/components/user.vue
+++ b/pagesOrder/detail/components/user.vue
@@ -29,11 +29,11 @@
- {{user.amount}}
+ {{user.amount||0}}
余额
- {{user.accountPoints}}
+ {{user.accountPoints||0}}
积分
diff --git a/pagesOrder/detail/detail.vue b/pagesOrder/detail/detail.vue
index 0cbed34..02c1538 100644
--- a/pagesOrder/detail/detail.vue
+++ b/pagesOrder/detail/detail.vue
@@ -15,7 +15,7 @@
-
+
结账
@@ -41,6 +41,8 @@