下单退款相关更新
This commit is contained in:
parent
c2135c6119
commit
994cf8bf2b
1
App.vue
1
App.vue
|
|
@ -9,6 +9,7 @@ App.vue本身不是页面,这里不能编写视图元素,也就是没有<tem
|
||||||
import { provide } from 'vue';
|
import { provide } from 'vue';
|
||||||
|
|
||||||
import WebsocketUtil from '@/commons/utils/websocket.js'
|
import WebsocketUtil from '@/commons/utils/websocket.js'
|
||||||
|
|
||||||
const websocketUtil = new WebsocketUtil(appConfig.wss, 5000); // 创建 WebSocket 工具类实例
|
const websocketUtil = new WebsocketUtil(appConfig.wss, 5000); // 创建 WebSocket 工具类实例
|
||||||
provide('websocketUtil', websocketUtil); // 提供给所有子组件
|
provide('websocketUtil', websocketUtil); // 提供给所有子组件
|
||||||
|
|
||||||
|
|
|
||||||
16
api/area.js
16
api/area.js
|
|
@ -1,16 +0,0 @@
|
||||||
import http from '@/http/http.js'
|
|
||||||
const request = http.request
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取区域列表
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getShopArea(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/shopArea`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
136
api/buyer.js
136
api/buyer.js
|
|
@ -1,136 +0,0 @@
|
||||||
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
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
@ -1,86 +0,0 @@
|
||||||
import http from '@/http/http.js'
|
|
||||||
const request = http.request
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取叫号队列
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getCallTableQueue(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/callTable/queue`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取叫号记录列表
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getCallRecord(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/callTable/callRecord`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取叫号桌型
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getCallTable(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/callTable`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取叫号号码
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function callTableTakeNumber(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/callTable/takeNumber`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 执行叫号
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function callTableCall(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/callTable/call`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改叫号状态
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function updateCallTableState(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/callTable/updateState`,
|
|
||||||
method: "PUT",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
@ -1,55 +0,0 @@
|
||||||
import http from '@/http/http.js'
|
|
||||||
const request = http.request
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取分类分页
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function categoryPage(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/prod/category/page`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分类添加
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function addCategory(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/prod/category`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分类修改
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function putCategory(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/prod/category`,
|
|
||||||
method: "PUT",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分类删除
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function delCategory(id, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/prod/category/${id}`,
|
|
||||||
method: "DELETE",
|
|
||||||
})
|
|
||||||
}
|
|
||||||
194
api/cons.js
194
api/cons.js
|
|
@ -1,194 +0,0 @@
|
||||||
import http from '@/http/http.js'
|
|
||||||
const request = http.request
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取耗材分页
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getConsPage(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product/cons/page`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取耗材列表
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getConsList(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product/cons/list`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 耗材添加
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function addCons(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product/cons`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 耗材修改
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function editCons(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product/cons`,
|
|
||||||
method: "PUT",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取耗材类别
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getConsGrpupPage(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product/consGroup/page`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取耗材类别
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getConsGrpupList(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product/consGroup/list`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增耗材类别
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function addConsGrpup(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product/consGroup`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改耗材类别
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function editConsGrpup(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product/consGroup`,
|
|
||||||
method: "PUT",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 启用耗材类别
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function consGrpupEnable(id, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product/consGroup/enable/${id}`,
|
|
||||||
method: "POST",
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 禁用耗材类别
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function consGrpupDisable(id, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product/consGroup/disable/${id}`,
|
|
||||||
method: "POST",
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 耗材入库
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function consStockIn(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product/stock/in`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 耗材出库
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function stockOut(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product/stock/out`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 库存盘点
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function stockCheck(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product/stock/check`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 耗材报损
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function stockReportDamage(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product/stock/reportDamage`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
@ -1,58 +0,0 @@
|
||||||
import http from '@/http/http.js'
|
|
||||||
const request = http.request
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 店铺优惠券列表
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getCouponList(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/coupon`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生成订单后使用
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getFindCoupon(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/coupon/findCoupon`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 店铺优惠券新增
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function addCoupon(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/coupon`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 店铺优惠券修改
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function updateCoupon(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/coupon`,
|
|
||||||
method: "PUT",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
import http from '@/http/http.js'
|
|
||||||
const request = http.request
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取当前店铺霸王餐配置信息列表
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getFreeDing(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/freeDing`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改霸王餐配置信息
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function updateFreeDing(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/freeDing`,
|
|
||||||
method: "PUT",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
||||||
import http from '@/http/http.js'
|
|
||||||
const request = http.request
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 交班记录-分页
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getHandoverRecord(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/handoverRecord/page`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 交班记录-查看
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getHandoverRecordView(id, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/handoverRecord/${id}`,
|
|
||||||
method: "GET",
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 交班记录-导出
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getHandoverRecordExport(id, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/handoverRecord/export/${id}`,
|
|
||||||
method: "GET",
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 收银机-交班数据统计
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getHandoverRecordTotal(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/handoverRecord/total`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 收银机-交班/关班
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getHandoverRecordHandover(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/handoverRecord/handover`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
24
api/index.js
24
api/index.js
|
|
@ -1,24 +0,0 @@
|
||||||
import http from '@/http/http.js'
|
|
||||||
const request = http.request
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件上传
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function uploadFile(file, data, urlType = 'account') {
|
|
||||||
return http.upload(`${urlType}/admin/common/upload`,data,file)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取店铺权限列表
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getShopPermission(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/shopPermission`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
30
api/login.js
30
api/login.js
|
|
@ -1,30 +0,0 @@
|
||||||
import http from '@/http/http.js'
|
|
||||||
const request = http.request
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取验证码
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function authCaptcha(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/auth/captcha`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 登录
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function login(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/auth/login`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
89
api/order.js
89
api/order.js
|
|
@ -1,89 +0,0 @@
|
||||||
import http from '@/http/http.js'
|
|
||||||
const request = http.request
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取订单列表
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getOrderList(data, urlType = 'order') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/order`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单详情
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getOrderById(data, urlType = 'order') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/order/getOrderById`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 历史订单(多次下单使用)
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getHistoryOrder(data, urlType = 'order') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/order/historyOrder`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生成订单
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function createOrder(data, urlType = 'order') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/order/createOrder`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单退款 只传订单id
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function refundOrder(data, urlType = 'order') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/order/refundOrder`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单打印
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function printOrder(data, urlType = 'order') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/order/print`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
86
api/pay.js
86
api/pay.js
|
|
@ -1,86 +0,0 @@
|
||||||
import http from '@/http/http.js'
|
|
||||||
const request = http.request
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取店铺订单支付URL
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getOrderPayUrl(data, urlType = 'order') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/pay/shopPayApi/orderPayUrl`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 扫码支付
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function scanPay(data, urlType = 'order') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/pay/scanPay`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 现金支付
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function cashPay(data, urlType = 'order') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/pay/cashPay`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 扫码/储值支付
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function microPay(data, urlType = 'order') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/pay/microPay`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 挂账支付
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function creditPay(data, urlType = 'order') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/pay/creditPay`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 会员支付
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function vipPay(data, urlType = 'order') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/pay/vipPay`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
import http from '@/http/http.js'
|
|
||||||
const request = http.request
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取支付方式列表
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getPayTypeList(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/payType`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
@ -1,59 +0,0 @@
|
||||||
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
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
@ -1,72 +0,0 @@
|
||||||
import http from '@/http/http.js'
|
|
||||||
const request = http.request
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取打印机列表
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getPrinter(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/printer`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取打印机详情
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getPrinterDetail(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/printer/detail`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加打印机
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function addPrinter(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/printer`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改打印机
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function updatePrinter(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/printer`,
|
|
||||||
method: "PUT",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除打印机
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function delPrinter(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/printer`,
|
|
||||||
method: "DELETE",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
305
api/product.js
305
api/product.js
|
|
@ -1,305 +0,0 @@
|
||||||
import http from '@/http/http.js'
|
|
||||||
const request = http.request
|
|
||||||
// 商品----------------------------------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* 获取商品分页
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getProductPage(data, urlType = 'product' ,showLoading) {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product/page`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
},
|
|
||||||
showLoading
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取商品列表
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getProductList(data, urlType = 'product' ,showLoading) {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product/list`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
},
|
|
||||||
showLoading
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取商品详情
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getProductDetail (id, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product/${id}`,
|
|
||||||
method: "GET",
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加商品
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function addProduct(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除商品
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function delProduct(id, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product/${id}`,
|
|
||||||
method: "DELETE",
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品上下架
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function productOnOff (data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product/onOff`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品售罄
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function productMarkIsSoldOut (data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product/markIsSoldOut`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改商品
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function updateProduct(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product`,
|
|
||||||
method: "PUT",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 绑定耗材
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function productBindCons(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product/bind`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品报损
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function productReportDamage(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product/reportDamage`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 商品分类----------------------------------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* 获取商品分类列表
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getCategoryList(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/prod/category/list`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 商品单位----------------------------------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* 获取商品单位列表
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getProdUnitList(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/prod/unit/list`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 商品规格----------------------------------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* 获取商品规格列表
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getSpecList(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/prod/spec/list`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加商品规格
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function addSpec(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/prod/spec`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改商品规格
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function updateSpec(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/prod/spec`,
|
|
||||||
method: "PUT",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 快捷添加商品规格
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function addSpecQuic(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/prod/spec/quickAdd`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除商品规格
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function delSpec(id, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/prod/spec/${id}`,
|
|
||||||
method: "DELETE",
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 商品分组----------------------------------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* 获取商品分组列表
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getProdGroupPage(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/prod/group/page`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取商品分组详情
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getProdGroupDetail(id, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/prod/group/${id}`,
|
|
||||||
method: "GET",
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品分组添加
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function addProdGroup(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/prod/group`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品分组修改
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function updateProdGroup(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/prod/group`,
|
|
||||||
method: "PUT",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品分组删除
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function delProdGroup(id, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/prod/group/${id}`,
|
|
||||||
method: "DELETE",
|
|
||||||
})
|
|
||||||
}
|
|
||||||
16
api/role.js
16
api/role.js
|
|
@ -1,16 +0,0 @@
|
||||||
import http from '@/http/http.js'
|
|
||||||
const request = http.request
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取角色列表
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getRoleList(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/role/list`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
58
api/shop.js
58
api/shop.js
|
|
@ -1,58 +0,0 @@
|
||||||
import http from '@/http/http.js'
|
|
||||||
const request = http.request
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取店铺详情
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getShopInfo(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/shopInfo/detail`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改店铺详情
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function editShopInfo(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/shopInfo`,
|
|
||||||
method: "PUT",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取当前店铺拓展参数
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getShopExtend(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/shopExtend`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取当前店铺拓展参数
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function editShopExtend(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/shopExtend`,
|
|
||||||
method: "PUT",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
@ -1,86 +0,0 @@
|
||||||
import http from '@/http/http.js'
|
|
||||||
const request = http.request
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取店铺用户概述信息
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function shopUserSummary(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/shopUser/summary`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取店铺用户列表
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function shopUserList(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/shopUser`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取店铺用户详情
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function shopUserDetail(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/shopUser/detail`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取店铺用户新增
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function shopUserAdd(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/shopUser`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 店铺用户修改
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function shopUserPut(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/shopUser`,
|
|
||||||
method: "PUT",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 店铺用户余额修改
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function shopUserMoney(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/shopUser/money`,
|
|
||||||
method: "PUT",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
86
api/staff.js
86
api/staff.js
|
|
@ -1,86 +0,0 @@
|
||||||
import http from '@/http/http.js'
|
|
||||||
const request = http.request
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 员工列表
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function shopStaffList(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/shopStaff`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取员工对应的权限idid
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getShopStaffPermission(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/shopStaff/permission`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 员工详情
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function shopStaffDetail(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/shopStaff/detail`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 员工添加
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function shopStaffAdd(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/shopStaff`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 员工修改
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function shopStaffPut(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/shopStaff`,
|
|
||||||
method: "PUT",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 员工删除
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function shopStaffDel(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/shopStaff`,
|
|
||||||
method: "DELETE",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
import http from '@/http/http.js'
|
|
||||||
const request = http.request
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 营业板块
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getTrade(data, urlType = 'order') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/data/summary/trade`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品销售汇总
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function productSaleDate(data, urlType = 'order') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/data/summary/productSaleDate`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
58
api/table.js
58
api/table.js
|
|
@ -1,58 +0,0 @@
|
||||||
import http from '@/http/http.js'
|
|
||||||
const request = http.request
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取台桌列表
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getShopTable(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/shopTable`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取台桌详情
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getShopTableDetail(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/shopTable/detail`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 台桌清台
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function shopTableClear(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/shopTable/clear`,
|
|
||||||
method: "PUT",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 台桌绑定
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function shopTableBind(data, urlType = 'account') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/shopTable/bind`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
@ -1,56 +0,0 @@
|
||||||
import http from '@/http/http.js'
|
|
||||||
const request = http.request
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取供应商列表
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function getVendorPage(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product/vendor/page`,
|
|
||||||
method: "GET",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加供应商
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function addVendor(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product/vendor`,
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑供应商
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function editVendor(data, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product/vendor`,
|
|
||||||
method: "PUT",
|
|
||||||
data: {
|
|
||||||
...data
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除供应商
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export function delVendor(id, urlType = 'product') {
|
|
||||||
return request({
|
|
||||||
url: `${urlType}/admin/product/vendor/${id}`,
|
|
||||||
method: "DELETE",
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -20,6 +20,7 @@ export function canTuiKuan(orderInfo, item) {
|
||||||
if( item ){
|
if( item ){
|
||||||
return (orderInfo.status == 'done' || orderInfo.status == 'part_refund')
|
return (orderInfo.status == 'done' || orderInfo.status == 'part_refund')
|
||||||
&& item.status != 'return' && item.status != 'refund' && item.status != 'refunding'
|
&& item.status != 'return' && item.status != 'refund' && item.status != 'refunding'
|
||||||
|
&& (item.returnAmount < item.num*item.unitPrice)
|
||||||
} else {
|
} else {
|
||||||
let goodsList = []
|
let goodsList = []
|
||||||
let data = false;
|
let data = false;
|
||||||
|
|
@ -27,7 +28,7 @@ export function canTuiKuan(orderInfo, item) {
|
||||||
goodsList = [...goodsList,...value]
|
goodsList = [...goodsList,...value]
|
||||||
))
|
))
|
||||||
goodsList.some((v,i)=>{
|
goodsList.some((v,i)=>{
|
||||||
if( (orderInfo.status == 'done' || orderInfo.status == 'part_refund') && v.status != 'return' && v.status != 'refund' && v.status != 'refunding' ){
|
if( orderInfo.refundAmount < orderInfo.payAmount || (orderInfo.status == 'done' || orderInfo.status == 'part_refund' ) && v.status != 'return' && v.status != 'refund' && v.status != 'refunding' && (v.returnNum+v.refundNum < v.num) ){
|
||||||
data = true
|
data = true
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
|
@ -51,3 +52,14 @@ export function numSum(arr) {
|
||||||
}, 0)
|
}, 0)
|
||||||
return (sum / 100).toFixed(2)
|
return (sum / 100).toFixed(2)
|
||||||
}
|
}
|
||||||
|
export function mathFloorPrice(price,item) {
|
||||||
|
if( item ){
|
||||||
|
if( item.productType == 'weight' || item.type == 'weight'){
|
||||||
|
return (Math.floor(price * 100)/100).toFixed(2)
|
||||||
|
} else {
|
||||||
|
return parseFloat(price).toFixed(2)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return parseFloat(price).toFixed(2)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -13,6 +13,7 @@ class WebsocketUtil {
|
||||||
this.reconnectTimeout = null; // 重连定时器
|
this.reconnectTimeout = null; // 重连定时器
|
||||||
this.heartbeatInterval = null; // 心跳定时器
|
this.heartbeatInterval = null; // 心跳定时器
|
||||||
this.messageCallbacks = []; // 存储外部注册的消息回调函数的数组
|
this.messageCallbacks = []; // 存储外部注册的消息回调函数的数组
|
||||||
|
this.messageCallbacks = []; // 存储外部注册的消息回调函数的数组
|
||||||
|
|
||||||
// 初始化 WebSocket 连接
|
// 初始化 WebSocket 连接
|
||||||
this.initializeWebSocket();
|
this.initializeWebSocket();
|
||||||
|
|
@ -27,7 +28,6 @@ class WebsocketUtil {
|
||||||
url: this.url,
|
url: this.url,
|
||||||
success: () => {
|
success: () => {
|
||||||
console.log('WebSocket连接成功');
|
console.log('WebSocket连接成功');
|
||||||
|
|
||||||
return this.socketTask;
|
return this.socketTask;
|
||||||
},
|
},
|
||||||
fail: (error) => {
|
fail: (error) => {
|
||||||
|
|
|
||||||
|
|
@ -102,9 +102,7 @@
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
...$form
|
...$form
|
||||||
})
|
})
|
||||||
console.log(form)
|
|
||||||
watch(()=>props.price,(newval)=>{
|
watch(()=>props.price,(newval)=>{
|
||||||
console.log(newval);
|
|
||||||
form.price=newval
|
form.price=newval
|
||||||
form.currentPrice=newval
|
form.currentPrice=newval
|
||||||
})
|
})
|
||||||
|
|
@ -129,7 +127,6 @@
|
||||||
const emits = defineEmits(['confirm'])
|
const emits = defineEmits(['confirm'])
|
||||||
|
|
||||||
function confirm() {
|
function confirm() {
|
||||||
console.log(form);
|
|
||||||
emits('confirm',{...form,currentPrice:Number(form.currentPrice).toFixed(2)})
|
emits('confirm',{...form,currentPrice:Number(form.currentPrice).toFixed(2)})
|
||||||
close()
|
close()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -192,3 +192,31 @@ export function stockReportDamage(data, urlType = 'product') {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 耗材库存变动记录
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function stockFlow(data, urlType = 'product') {
|
||||||
|
return request({
|
||||||
|
url: `${urlType}/admin/product/stock/flow`,
|
||||||
|
method: "GET",
|
||||||
|
data: {
|
||||||
|
...data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 耗材统计
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function consStatistics(data, urlType = 'product') {
|
||||||
|
return request({
|
||||||
|
url: `${urlType}/admin/product/cons/statistics`,
|
||||||
|
method: "GET",
|
||||||
|
data: {
|
||||||
|
...data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -84,3 +84,17 @@ export function vipPay(data, urlType = 'order') {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单状态
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function queryOrderStatus(data, urlType = 'order') {
|
||||||
|
return request({
|
||||||
|
url: `${urlType}/pay/queryOrderStatus`,
|
||||||
|
method: "GET",
|
||||||
|
data: {
|
||||||
|
...data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,6 @@
|
||||||
getConsGrpupList({
|
getConsGrpupList({
|
||||||
page: 1,
|
page: 1,
|
||||||
size: 30,
|
size: 30,
|
||||||
shopId: uni.getStorageSync("shopId"),
|
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
datas.typeList = res
|
datas.typeList = res
|
||||||
res.forEach(ele => {
|
res.forEach(ele => {
|
||||||
|
|
|
||||||
|
|
@ -1,72 +1,60 @@
|
||||||
<template>
|
<template>
|
||||||
<view style="position: fixed;right: 50rpx;top: 80vh;background-color: #fff;border-radius: 50%;width: 65rpx;height: 65rpx;display: flex;align-items: center;justify-content: center;">
|
<view class="viewrecordsTop" v-if="datas.countList">
|
||||||
<image src="./time.png" style="width: 50rpx;height: 50rpx;" @tap="popPu"
|
|
||||||
mode=""></image>
|
|
||||||
</view>
|
|
||||||
<view :style="{height:showStatus?statusHeight:0}" class="tranistion status overflow-hide">
|
|
||||||
<view @tap="changeNowStatusIndex(index)" class="u-flex u-p-l-30 lh30 u-p-r-30 u-row-between"
|
|
||||||
v-for="(item,index) in datas.status" :key="index">
|
|
||||||
<view :class="{'color-main':nowStatusIndex===index}">{{item.conTypeName}}</view>
|
|
||||||
<uni-icons v-if="nowStatusIndex===index" type="checkmarkempty" :color="color.ColorMain"></uni-icons>
|
|
||||||
</view>
|
|
||||||
<view :style="{height: '14px'}"></view>
|
|
||||||
</view>
|
|
||||||
<view class="viewrecordsTop">
|
|
||||||
<view style="padding:32rpx 16rpx;">
|
<view style="padding:32rpx 16rpx;">
|
||||||
<view @tap="getNewdata('addCountNumber')">
|
<view @tap="getInOutType('in')">
|
||||||
增加数量 <text
|
增加数量 <text
|
||||||
style="color: #76ACF0;font-weight: bold;">{{datas.countList.addCountNumber?datas.countList.addCountNumber:'0'}}</text>
|
style="color: #76ACF0;font-weight: bold;">{{datas.countList.inSumTotal?datas.countList.inSumTotal:'0'}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="df viewdf">
|
<view class="df viewdf">
|
||||||
<view @tap="getNewdata('stockInNumber')"
|
<view @tap="getNewdata('manual-in','in')"
|
||||||
style="font-size: 24rpx;border-right: 1px solid #999; width: 142rpx;text-align: center;">
|
style="font-size: 24rpx;border-right: 1px solid #999; width: 142rpx;text-align: center;">
|
||||||
<view style="color: #999999;">
|
<view style="color: #999999;">
|
||||||
入库
|
入库
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
{{datas.countList.stockInNumber?datas.countList.stockInNumber:0}}
|
{{datas.countList.stockInNum?datas.countList.stockInNum:0}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view @tap="getNewdata('addNumber')" style="font-size: 24rpx;width: 178rpx;text-align: center;">
|
<view @tap="getNewdata('win-in','in')" style="font-size: 24rpx;width: 178rpx;text-align: center;">
|
||||||
<view style="color: #999999;">
|
<view style="color: #999999;">
|
||||||
手动增加
|
手动增加
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
{{datas.countList.addNumber?datas.countList.addNumber:'0'}}
|
{{datas.countList.winInNum?datas.countList.winInNum:'0'}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="padding:32rpx 16rpx;">
|
<view style="padding:32rpx 16rpx;">
|
||||||
<view class="" @tap="getNewdata('subCountNumber')">
|
<view class="" @tap="getInOutType('out')">
|
||||||
减少数量 <text
|
减少数量 <text
|
||||||
style="color: #52BDA4;font-weight: bold;">{{datas.countList.subCountNumber?datas.countList.subCountNumber:0}}</text>
|
style="color: #52BDA4;font-weight: bold;">{{datas.countList.outSumTotal?datas.countList.outSumTotal:0}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="df viewdf">
|
<view class="df viewdf">
|
||||||
<view @tap="getNewdata('subNumber')"
|
<view @tap="getNewdata('loss-out','out')"
|
||||||
style="font-size: 24rpx;border-right: 1px solid #999; width: 112rpx;text-align: center;">
|
style="font-size: 24rpx;border-right: 1px solid #999; width: 112rpx;text-align: center;">
|
||||||
<view style="color: #999999;">
|
<view style="color: #999999;">
|
||||||
手动减少
|
手动减少
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
{{datas.countList.subNumber?datas.countList.subNumber:0}}
|
{{datas.countList.lossOutNum?datas.countList.lossOutNum:0}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view @tap="getNewdata('stockOutNumber')"
|
<view @tap="getNewdata('manual-out','out')"
|
||||||
style="font-size: 24rpx;border-right: 1px solid #999; width: 82rpx;text-align: center;">
|
style="font-size: 24rpx;border-right: 1px solid #999; width: 82rpx;text-align: center;">
|
||||||
<view style="color: #999999;">
|
<view style="color: #999999;">
|
||||||
出库
|
出库
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
{{datas.countList.stockOutNumber?datas.countList.stockOutNumber:0}}
|
{{datas.countList.stockOutNum?datas.countList.stockOutNum:0}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view @tap="getNewdata('saleNumber')" style="font-size: 24rpx;width: 112rpx;text-align: center;">
|
<view @tap="getNewdata('order-out','out')" style="font-size: 24rpx;width: 112rpx;text-align: center;">
|
||||||
<view style="color: #999999;">
|
<view style="color: #999999;">
|
||||||
商品消耗
|
商品消耗
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
{{datas.countList.saleNumber?datas.countList.saleNumber:0}}
|
{{datas.countList.consumeNum?datas.countList.consumeNum:0}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -75,26 +63,22 @@
|
||||||
<view class="viewrecords">
|
<view class="viewrecords">
|
||||||
<view v-for="item in datas.list" :key="item.id">
|
<view v-for="item in datas.list" :key="item.id">
|
||||||
<view class="">
|
<view class="">
|
||||||
<view class="">
|
<view class=""> {{item.createTime}} </view>
|
||||||
{{item.createTime}}
|
<view class=""> {{item.operator}} {{item.conName}} </view>
|
||||||
</view>
|
|
||||||
<view class="">
|
|
||||||
{{item.operator}} {{item.bizName}}
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
<view class="">
|
<view class="">
|
||||||
<view style="font-size: 24rpx;color: #666666;">
|
<view style="font-size: 24rpx;color: #666666;">
|
||||||
库存 {{ inventory(item.balance,item.bizType,item.amount)}} <text
|
库存 {{ item.beforeNumber }} <text
|
||||||
:style="{color:item.bizType=='+'?'#1bca72':'red'}"> → {{ item.amount|0 }}</text>
|
:style="{color:item.inOutType=='in'?'#1bca72':'red'}"> → {{ item.inOutNumber|0 }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view style="font-size: 24rpx;color: #666666;">
|
<view style="font-size: 24rpx;color: #666666;">
|
||||||
剩余库存 {{item.balance}}
|
剩余库存 {{item.afterNumber}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
<view :style="{color:item.bizType=='+'?'#1bca72':'red'}" style="font-weight: 400;">
|
<view :style="{color:item.inOutType=='in'?'#1bca72':'red'}" style="font-weight: 400;">
|
||||||
{{ item.bizType }}{{ item.amount|0 }}
|
{{ item.inOutType == 'in' ? '+' : '-' }}{{ item.inOutNumber|0 }}
|
||||||
</view>
|
</view>
|
||||||
<view style="font-size: 24rpx;color: #666666;">
|
<view style="font-size: 24rpx;color: #666666;">
|
||||||
变动库存
|
变动库存
|
||||||
|
|
@ -103,24 +87,13 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<datePickerview @confirm="datePickerConfirm" ref="datePicker"></datePickerview>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import { onMounted, reactive, ref, computed, getCurrentInstance } from 'vue';
|
||||||
onMounted,
|
|
||||||
reactive,
|
|
||||||
ref,
|
|
||||||
computed,
|
|
||||||
getCurrentInstance
|
|
||||||
} from 'vue';
|
|
||||||
import datePickerview from './components/my-date-pickerview.vue'
|
|
||||||
import color from '@/commons/color.js';
|
import color from '@/commons/color.js';
|
||||||
import {
|
import { stockFlow,consStatistics } from '@/http/api/cons.js';
|
||||||
tbConsInfoFlowstock,
|
|
||||||
tbConsInfoFlowcount,
|
|
||||||
tbConsTypes
|
|
||||||
} from '@/http/yskApi/requestAll.js';
|
|
||||||
let props = defineProps({
|
let props = defineProps({
|
||||||
item: {
|
item: {
|
||||||
type: String
|
type: String
|
||||||
|
|
@ -129,88 +102,55 @@
|
||||||
|
|
||||||
let datas = reactive({
|
let datas = reactive({
|
||||||
list: [],
|
list: [],
|
||||||
countList: null,
|
countList: {},
|
||||||
// 类型
|
inOutType: '',
|
||||||
status: [],
|
inOutItem: '',
|
||||||
statusTitle: "类型"
|
|
||||||
})
|
})
|
||||||
let showStatus = ref(false)
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
let items = JSON.parse(props.item)
|
let items = JSON.parse(props.item)
|
||||||
getlist()
|
getlist()
|
||||||
})
|
})
|
||||||
const refs = getCurrentInstance()
|
|
||||||
let popPu = () => {
|
|
||||||
refs.ctx.$refs.datePicker.toggle()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间筛选
|
||||||
|
* @param {Object} e
|
||||||
|
*/
|
||||||
function datePickerConfirm(e) {
|
function datePickerConfirm(e) {
|
||||||
getlist("", e.start, e.end)
|
getlist("", e.start, e.end)
|
||||||
}
|
}
|
||||||
|
|
||||||
function inventory(a, b, c) {
|
function getNewdata (d,e) {
|
||||||
let data = 0
|
datas.inOutType = e
|
||||||
if (b == '-') {
|
datas.inOutItem = d
|
||||||
data = a + c
|
|
||||||
} else {
|
|
||||||
data = a - c
|
|
||||||
}
|
|
||||||
return data
|
|
||||||
}
|
|
||||||
let nowStatusIndex = ref(0)
|
|
||||||
let columnName = ref('')
|
|
||||||
let getNewdata = (d) => {
|
|
||||||
columnName.value = d
|
|
||||||
getlist()
|
getlist()
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeNowStatusIndex(i) {
|
function getInOutType (e) {
|
||||||
nowStatusIndex.value = i
|
datas.inOutType = e
|
||||||
showStatus.value = false
|
getlist()
|
||||||
datas.statusTitle = datas.status[i].conTypeName
|
|
||||||
getlist(datas.status[i].id)
|
|
||||||
}
|
}
|
||||||
const statusHeight = computed(() => {
|
|
||||||
return 30 * datas.status.length + 14 + 'px'
|
/**
|
||||||
})
|
* 获取数据
|
||||||
let getlist = (conTypeId = "", start, end, ) => {
|
*/
|
||||||
|
function getlist (conTypeId = "", start, end, ) {
|
||||||
let ids = JSON.parse(props.item)
|
let ids = JSON.parse(props.item)
|
||||||
// 列表
|
// 列表
|
||||||
tbConsInfoFlowstock({
|
stockFlow({
|
||||||
page: 0,
|
conId: ids.id,
|
||||||
shopId: uni.getStorageSync("shopId"),
|
inOutType: datas.inOutType,
|
||||||
size: 30,
|
inOutItem: datas.inOutItem
|
||||||
consId: ids.id,
|
|
||||||
column: columnName.value,
|
|
||||||
conTypeId,
|
|
||||||
|
|
||||||
|
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
datas.list = res.content
|
datas.list = res.records
|
||||||
})
|
})
|
||||||
// 顶部数据
|
// 顶部数据
|
||||||
tbConsInfoFlowcount({
|
consStatistics({
|
||||||
page: 0,
|
conId: ids.id,
|
||||||
shopId: uni.getStorageSync("shopId"),
|
|
||||||
size: 30,
|
|
||||||
sort: "createTime,desc",
|
|
||||||
conTypeId,
|
|
||||||
startTime: start,
|
|
||||||
endTime: end,
|
|
||||||
consId: JSON.parse(props.item).id,
|
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
datas.countList = res
|
datas.countList = res
|
||||||
})
|
})
|
||||||
|
|
||||||
// 获取顶部类型/
|
|
||||||
tbConsTypes({
|
|
||||||
page: 0,
|
|
||||||
shopId: uni.getStorageSync("shopId"),
|
|
||||||
size: 100,
|
|
||||||
}).then(res => {
|
|
||||||
datas.status = res.content
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
|
|
|
||||||
|
|
@ -159,34 +159,14 @@
|
||||||
if ( !pageData.formData.orderId ) {
|
if ( !pageData.formData.orderId ) {
|
||||||
creditBuyerRepayment(params).then((res) => {
|
creditBuyerRepayment(params).then((res) => {
|
||||||
console.log(res.repaymentCount > 0)
|
console.log(res.repaymentCount > 0)
|
||||||
if (res.repaymentCount > 0) {
|
emits('affirm')
|
||||||
uni.$u.toast('还款成功')
|
close();
|
||||||
emits('affirm')
|
|
||||||
close();
|
|
||||||
|
|
||||||
} else {
|
|
||||||
uni.$u.toast(res.repaymentMsg)
|
|
||||||
setTimeout(()=>{
|
|
||||||
emits('affirm')
|
|
||||||
close();
|
|
||||||
},2000)
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
creditBuyerOrderPay(params).then((res) => {
|
creditBuyerOrderPay(params).then((res) => {
|
||||||
if (!res.repaymentMsg) {
|
emits('affirm')
|
||||||
uni.$u.toast('付款成功')
|
close();
|
||||||
emits('affirm')
|
|
||||||
close();
|
|
||||||
|
|
||||||
} else {
|
|
||||||
uni.$u.toast(res.repaymentMsg)
|
|
||||||
setTimeout(()=>{
|
|
||||||
emits('affirm')
|
|
||||||
close();
|
|
||||||
},2000)
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@
|
||||||
<view><text class="cell_label">付款时间</text><text class="cell_value">{{item.lastPaymentTime || '-'}}</text></view>
|
<view><text class="cell_label">付款时间</text><text class="cell_value">{{item.lastPaymentTime || '-'}}</text></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="bottomBox">
|
<view class="bottomBox">
|
||||||
<view class="btn record" @tap="toUrl('PAGES_CREDIT_BUYER_REPAYMENTRECORD',{id: pageData.query.creditBuyerId, orderId: item.id})">账单付款记录</view>
|
<view class="btn record" @tap="toUrl('PAGES_CREDIT_BUYER_REPAYMENTRECORD',{id: pageData.query.creditBuyerId, orderId: item.orderId})">账单付款记录</view>
|
||||||
<view class="btn payment" @tap="repaymentOpen(item)" :style="{ backgroundColor: pageData.repaymentMethod == 'total' ? '#999' :''}">付款</view>
|
<view class="btn payment" @tap="repaymentOpen(item)" :style="{ backgroundColor: pageData.repaymentMethod == 'total' ? '#999' :''}">付款</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
|
||||||
|
|
@ -11,35 +11,27 @@
|
||||||
<view class="pageSalesSummaryContent">
|
<view class="pageSalesSummaryContent">
|
||||||
<view class="">
|
<view class="">
|
||||||
<view class=""> 实收金额(元) </view>
|
<view class=""> 实收金额(元) </view>
|
||||||
<view class=""> {{list.sale?list.sale.incomeAmountAll:0}} </view>
|
<view class=""> {{list.saleAmount?list.saleAmount:0}} </view>
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
<view class=""> 优惠金额(元) </view>
|
<view class=""> 优惠金额(元) </view>
|
||||||
<view class=""> {{list.count?list.count.saveAmount:0}} </view>
|
<view class=""> {{list.discountAmount?list.discountAmount:0}} </view>
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
<view class=""> 客单价(元) </view>
|
<view class=""> 客单价(元) </view>
|
||||||
<view class=""> {{list.count?list.count.unitPrice:0}} </view>
|
<view class=""> {{list.customerUnitPrice?customerUnitPrice:0}} </view>
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
<view class=""> 会员消费(元) </view>
|
<view class=""> 会员消费(元) </view>
|
||||||
<view class=""> {{list.vip?list.vip.useAmount:0}} </view>
|
<view class=""> {{list.memberPayAmount?list.memberPayAmount:0}} </view>
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
<view class="">
|
<view class=""> 新增会员(人) </view>
|
||||||
新增会员(人)
|
<view class=""> {{list.newMemberCount?list.newMemberCount:0}} </view>
|
||||||
</view>
|
|
||||||
<view class="">
|
|
||||||
{{list.vip?list.vip.newFlow:0}}
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
<view class="">
|
<view class=""> 翻台率(%) </view>
|
||||||
翻台率(%)
|
<view class=""> {{list.tableTurnoverRate?list.tableTurnoverRate:0}} </view>
|
||||||
</view>
|
|
||||||
<view class="">
|
|
||||||
{{list.count?list.count.turnoverRate:0}}
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="table-scroll">
|
<view class="table-scroll">
|
||||||
|
|
@ -64,8 +56,8 @@
|
||||||
style="width: 22rpx;height: 30rpx;" mode=""></image>
|
style="width: 22rpx;height: 30rpx;" mode=""></image>
|
||||||
{{item.productName}}
|
{{item.productName}}
|
||||||
</view>
|
</view>
|
||||||
<view class="head">{{item.num}}</view>
|
<view class="head">{{item.number}}</view>
|
||||||
<view class="head">{{item.salesAmount || '无'}}</view>
|
<view class="head">{{item.amount || '无'}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -107,7 +99,7 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
let selected = ref('today')
|
let selected = ref('today')
|
||||||
let list = ref([])
|
let list = ref({})
|
||||||
const currentInstance = getCurrentInstance()
|
const currentInstance = getCurrentInstance()
|
||||||
let tableList = ref([])
|
let tableList = ref([])
|
||||||
let day = ref(1)
|
let day = ref(1)
|
||||||
|
|
@ -177,7 +169,7 @@
|
||||||
page: 1,
|
page: 1,
|
||||||
size: 5
|
size: 5
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
tableList.value = res.productList.records
|
tableList.value = res.records
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@
|
||||||
<view class="constantboxitem" v-for="(item,index) in tableList" :key="index"
|
<view class="constantboxitem" v-for="(item,index) in tableList" :key="index"
|
||||||
@click="toDetail(item)">
|
@click="toDetail(item)">
|
||||||
<view class="head">{{item.productName}}</view>
|
<view class="head">{{item.productName}}</view>
|
||||||
<view class="head">{{item.num}}</view>
|
<view class="head">{{item.number}}</view>
|
||||||
<view class="head">{{item.salesAmount || '无'}}</view>
|
<view class="head">{{item.amount || '无'}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -43,10 +43,10 @@
|
||||||
function gettableData() {
|
function gettableData() {
|
||||||
productSaleDate({
|
productSaleDate({
|
||||||
day: props.day,
|
day: props.day,
|
||||||
page: 0,
|
page: 1,
|
||||||
size: 50
|
size: 50
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
tableList.value = res.productList.records
|
tableList.value = res.records
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -35,11 +35,9 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { getCurrentInstance, ref } from 'vue';
|
import { getCurrentInstance, ref, reactive } from 'vue';
|
||||||
import { onShow } from '@dcloudio/uni-app';
|
import { onShow } from '@dcloudio/uni-app';
|
||||||
import {
|
|
||||||
summaryTrade,
|
|
||||||
} from '@/http/yskApi/requestAll.js';
|
|
||||||
import dayjs from 'dayjs' //时间格式库
|
import dayjs from 'dayjs' //时间格式库
|
||||||
import datePickerview from './my-date-pickerview.vue'
|
import datePickerview from './my-date-pickerview.vue'
|
||||||
|
|
||||||
|
|
@ -47,17 +45,25 @@
|
||||||
|
|
||||||
let selected = ref('today')
|
let selected = ref('today')
|
||||||
let showAll = ref(false);
|
let showAll = ref(false);
|
||||||
let $list = []
|
let list = ref()
|
||||||
|
const pageData = reactive({
|
||||||
|
list: [
|
||||||
|
{payType: '微信小程序', key:'wechatPayAmount', payAmount: 0},
|
||||||
|
{payType: '支付宝小程序', key:'aliPayAmount', payAmount: 0},
|
||||||
|
{payType: '主扫收款', key:'scanPayAmount', payAmount: 0},
|
||||||
|
{payType: '收款码收款', key:'', payAmount: 0},
|
||||||
|
{payType: '现金收款', key:'cashPayAmount', payAmount: 0},
|
||||||
|
{payType: '充值收款', key:'rechargeAmount', payAmount: 0},
|
||||||
|
],
|
||||||
|
})
|
||||||
function toggleShowAll() {
|
function toggleShowAll() {
|
||||||
showAll.value = !showAll.value
|
showAll.value = !showAll.value
|
||||||
setList()
|
setList()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setList() {
|
function setList() {
|
||||||
list.value = showAll.value ? $list : $list.slice(0, 4)
|
list.value = showAll.value ? pageData.list : pageData.list.slice(0, 4)
|
||||||
}
|
}
|
||||||
let list = ref()
|
|
||||||
const emit = defineEmits(['totalRevenue'])
|
const emit = defineEmits(['totalRevenue'])
|
||||||
const timeList = [{
|
const timeList = [{
|
||||||
label: '今天',
|
label: '今天',
|
||||||
|
|
@ -91,6 +97,11 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取统计数据
|
||||||
|
* @param {Object} start
|
||||||
|
* @param {Object} end
|
||||||
|
*/
|
||||||
function getlist(start, end) {
|
function getlist(start, end) {
|
||||||
let startTime, endTime;
|
let startTime, endTime;
|
||||||
if (selected.value == 'today') {
|
if (selected.value == 'today') {
|
||||||
|
|
@ -123,15 +134,30 @@
|
||||||
beginDate: startTime,
|
beginDate: startTime,
|
||||||
endDate: endTime,
|
endDate: endTime,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
$list = res.sale.payCount
|
for (var key in res) {
|
||||||
|
pageData.list.map(item=>{
|
||||||
|
if(item.key == key) {
|
||||||
|
item.payAmount = res[key]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
setList()
|
setList()
|
||||||
emit('totalRevenue', res.sale.incomeAmountAll)
|
let incomeAmountAll = 0;
|
||||||
|
pageData.list.map(item=>{
|
||||||
|
incomeAmountAll += (item.payAmount||0)
|
||||||
|
})
|
||||||
|
emit('totalRevenue', incomeAmountAll)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期筛选确认
|
||||||
|
* @param {Object} e
|
||||||
|
*/
|
||||||
function datePickerConfirm(e) {
|
function datePickerConfirm(e) {
|
||||||
getlist(e.start, e.end)
|
getlist(e.start, e.end)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取当前时间
|
// 获取当前时间
|
||||||
function getdate() {
|
function getdate() {
|
||||||
const dt = new Date();
|
const dt = new Date();
|
||||||
|
|
@ -143,6 +169,7 @@
|
||||||
const ss = (dt.getSeconds() + "").padStart(2, "0");
|
const ss = (dt.getSeconds() + "").padStart(2, "0");
|
||||||
return `${y}-${m}-${d}`;
|
return `${y}-${m}-${d}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取昨天时间
|
// 获取昨天时间
|
||||||
const formatTime = () => {
|
const formatTime = () => {
|
||||||
let strDate = getdate()
|
let strDate = getdate()
|
||||||
|
|
|
||||||
|
|
@ -272,7 +272,7 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
shopName.value = uni.getStorageSync('shopName');
|
shopName.value = uni.getStorageSync('shopInfo').shopName;
|
||||||
});
|
});
|
||||||
|
|
||||||
// 启动加载
|
// 启动加载
|
||||||
|
|
|
||||||
|
|
@ -85,14 +85,18 @@
|
||||||
>{{item.name}}</view>
|
>{{item.name}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="extend_content">
|
<view class="extend_content">
|
||||||
<view class="preview">
|
<view class="preview" v-if="vdata.extendInfo.autoKey != 'ticket_logo'">
|
||||||
<view class="index_bg"><up-image v-if="'index_bg' == vdata.extendInfo.autoKey" :src="vdata.extendInfo.value"></up-image></view>
|
<view class="index_bg"><up-image v-if="'index_bg' == vdata.extendInfo.autoKey" :src="vdata.extendInfo.value"></up-image></view>
|
||||||
<view class="my_bg"><up-image v-if="'my_bg' == vdata.extendInfo.autoKey" :src="vdata.extendInfo.value"></up-image></view>
|
<view class="my_bg"><up-image v-if="'my_bg' == vdata.extendInfo.autoKey" :src="vdata.extendInfo.value"></up-image></view>
|
||||||
<view class="bg"><up-image v-if="'member_bg' == vdata.extendInfo.autoKey" :src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/cashier_admin_app_shopSet/'+vdata.extendInfo.autoKey+'.png'" ></up-image></view>
|
<view class="bg"><up-image v-if="'member_bg' == vdata.extendInfo.autoKey" :src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/cashier_admin_app_shopSet/'+vdata.extendInfo.autoKey+'.png'" ></up-image></view>
|
||||||
<view class="member_bg"><up-image v-if="'member_bg' == vdata.extendInfo.autoKey" :src="vdata.extendInfo.value"></up-image></view>
|
<view class="member_bg"><up-image v-if="'member_bg' == vdata.extendInfo.autoKey" :src="vdata.extendInfo.value"></up-image></view>
|
||||||
<view class="shopinfo_bg"><up-image v-if="'shopinfo_bg' == vdata.extendInfo.autoKey" :src="vdata.extendInfo.value"></up-image></view>
|
<view class="shopinfo_bg"><up-image v-if="'shopinfo_bg' == vdata.extendInfo.autoKey" :src="vdata.extendInfo.value"></up-image></view>
|
||||||
<view class="shopinfo_bg_f" v-if="'shopinfo_bg' == vdata.extendInfo.autoKey"></view>
|
<view class="shopinfo_bg_f" v-if="'shopinfo_bg' == vdata.extendInfo.autoKey"></view>
|
||||||
<view class="bg"><up-image v-if="vdata.extendInfo.autoKey" :src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/cashier_admin_app_shopSet/'+vdata.extendInfo.autoKey+'.png'" ></up-image></view>
|
<view class="bg" v-if="vdata.extendInfo.autoKey" ><up-image :src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/cashier_admin_app_shopSet/'+vdata.extendInfo.autoKey+'.png'" ></up-image></view>
|
||||||
|
</view>
|
||||||
|
<view class="preview" v-else style="width: 359rpx;height: 232rpx">
|
||||||
|
<view class="bg ticket_logo" v-if="vdata.extendInfo.autoKey == 'ticket_logo'" ><up-image :src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/cashier_admin_app_shopSet/'+vdata.extendInfo.autoKey+'.png'" ></up-image></view>
|
||||||
|
<view class="ticket_logo img" ><up-image v-if="'ticket_logo' == vdata.extendInfo.autoKey" :src="vdata.extendInfo.value"></up-image></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="extend_img">
|
<view class="extend_img">
|
||||||
<view class="extend_title">{{vdata.extendInfo.name}}背景图片</view>
|
<view class="extend_title">{{vdata.extendInfo.name}}背景图片</view>
|
||||||
|
|
@ -418,7 +422,7 @@ let showMap = () => {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-top: 32rpx;
|
margin-top: 32rpx;
|
||||||
.preview{
|
.preview{
|
||||||
width: 146rpx;
|
min-width: 146rpx;
|
||||||
height: 342rpx;
|
height: 342rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-right: 32rpx;
|
margin-right: 32rpx;
|
||||||
|
|
@ -445,7 +449,7 @@ let showMap = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep .member_bg .u-image,::v-deep .member_bg .u-image__image{
|
::v-deep .member_bg .u-image,::v-deep .member_bg .u-image__image{
|
||||||
width: 134rpx!important;
|
width: 34rpx!important;
|
||||||
height: 63rpx!important;
|
height: 63rpx!important;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 22rpx;
|
top: 22rpx;
|
||||||
|
|
@ -461,6 +465,19 @@ let showMap = () => {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
|
::v-deep .bg.ticket_logo,::v-deep .bg.ticket_logo .u-image,::v-deep .bg.ticket_logo .u-image__image{
|
||||||
|
width: 359rpx!important;
|
||||||
|
height: 232rpx!important;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
::v-deep .ticket_logo.img .u-image,::v-deep .ticket_logo.img .u-image__image{
|
||||||
|
width: 96rpx!important;
|
||||||
|
height: 50rpx!important;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.shopinfo_bg_f{
|
.shopinfo_bg_f{
|
||||||
width: 146rpx;
|
width: 146rpx;
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,6 @@
|
||||||
v-model="searchValue">
|
v-model="searchValue">
|
||||||
</uni-search-bar>
|
</uni-search-bar>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="u-flex">
|
|
||||||
<image src="/pagesCreateOrder/static/images/icon-saoma.svg" class="icon-saoma" mode=""></image>
|
|
||||||
</view> -->
|
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<picker @change="areaChange" range-key="name" :value="area.defaultCateIndex" :range="area.list">
|
<picker @change="areaChange" range-key="name" :value="area.defaultCateIndex" :range="area.list">
|
||||||
|
|
@ -103,7 +100,6 @@
|
||||||
})
|
})
|
||||||
onLoad(opt => {
|
onLoad(opt => {
|
||||||
Object.assign(option, opt)
|
Object.assign(option, opt)
|
||||||
console.log(option);
|
|
||||||
getTable()
|
getTable()
|
||||||
getArea()
|
getArea()
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -44,11 +44,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import { reactive, nextTick, ref,watch } from 'vue';
|
||||||
reactive,
|
|
||||||
nextTick,
|
|
||||||
ref,watch
|
|
||||||
} from 'vue';
|
|
||||||
import myModel from '@/components/my-components/my-model.vue'
|
import myModel from '@/components/my-components/my-model.vue'
|
||||||
import myButton from '@/components/my-components/my-button.vue'
|
import myButton from '@/components/my-components/my-button.vue'
|
||||||
import myTabs from '@/components/my-components/my-tabs.vue'
|
import myTabs from '@/components/my-components/my-tabs.vue'
|
||||||
|
|
@ -111,7 +107,6 @@
|
||||||
...$form
|
...$form
|
||||||
})
|
})
|
||||||
watch(()=>props.price,(newval)=>{
|
watch(()=>props.price,(newval)=>{
|
||||||
console.log(newval);
|
|
||||||
form.price=newval
|
form.price=newval
|
||||||
form.currentPrice=newval
|
form.currentPrice=newval
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<my-model ref="model" :title="title" iconColor="#000" @close="resetForm">
|
<my-model ref="model" :title="title" iconColor="#000" @close="resetForm">
|
||||||
<template #desc>
|
<template #desc>
|
||||||
<!-- <view class="u-m-t-48 tab">
|
|
||||||
<my-tabs :list="tabs" @change="tabsChange"></my-tabs>
|
|
||||||
</view> -->
|
|
||||||
<view class="u-text-left u-p-30 ">
|
<view class="u-text-left u-p-30 ">
|
||||||
<template v-if="!current">
|
<template v-if="!current">
|
||||||
<view>
|
<view>
|
||||||
|
|
@ -80,12 +77,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import { reactive, nextTick, ref, watch } from 'vue';
|
||||||
reactive,
|
|
||||||
nextTick,
|
|
||||||
ref,
|
|
||||||
watch
|
|
||||||
} from 'vue';
|
|
||||||
import myModel from '@/components/my-components/my-model.vue'
|
import myModel from '@/components/my-components/my-model.vue'
|
||||||
import myButton from '@/components/my-components/my-button.vue'
|
import myButton from '@/components/my-components/my-button.vue'
|
||||||
import myTabs from '@/components/my-components/my-tabs.vue'
|
import myTabs from '@/components/my-components/my-tabs.vue'
|
||||||
|
|
@ -164,7 +156,6 @@
|
||||||
...$form
|
...$form
|
||||||
})
|
})
|
||||||
watch(() => props.price, (newval) => {
|
watch(() => props.price, (newval) => {
|
||||||
console.log(newval);
|
|
||||||
form.price = newval
|
form.price = newval
|
||||||
form.currentPrice = newval
|
form.currentPrice = newval
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@
|
||||||
<view class="block u-m-b-0">
|
<view class="block u-m-b-0">
|
||||||
<view class="u-flex">
|
<view class="u-flex">
|
||||||
<view>共</view>
|
<view>共</view>
|
||||||
<view class="fen font-bold">{{goodsNumber}}</view>
|
<view class="fen font-bold">{{goods.list.length}}</view>
|
||||||
<view>份菜品</view>
|
<view>份菜品</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
@ -231,7 +231,7 @@
|
||||||
<view>
|
<view>
|
||||||
<text>桌位费</text>
|
<text>桌位费</text>
|
||||||
</view>
|
</view>
|
||||||
<view>¥{{$seatFee.totalAmount||'0.00'}}</view>
|
<view>¥{{$seatFee.totalAmount.toFixed(2)||'0.00'}}</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="$packFee>0">
|
<template v-if="$packFee>0">
|
||||||
|
|
@ -256,7 +256,7 @@
|
||||||
|
|
||||||
<view class="u-flex price u-m-l-32">
|
<view class="u-flex price u-m-l-32">
|
||||||
<view class="">实收金额</view>
|
<view class="">实收金额</view>
|
||||||
<view class="font-bold u-font-32">¥{{formatPrice(allPrice) }}</view>
|
<view class="font-bold u-font-32">¥{{allPrice }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
@ -281,7 +281,7 @@
|
||||||
<give-food title="赠菜" :ref="setModel" name="giveFood"></give-food>
|
<give-food title="赠菜" :ref="setModel" name="giveFood"></give-food>
|
||||||
<one-remark @confirm="goodsOneRemarkConfirm" title="单品备注" :ref="setModel" name="remark"></one-remark>
|
<one-remark @confirm="goodsOneRemarkConfirm" title="单品备注" :ref="setModel" name="remark"></one-remark>
|
||||||
<pack-number @confirm="goodsOnePackNumberConfirm" title="打包" :ref="setModel" name="packNumber"></pack-number>
|
<pack-number @confirm="goodsOnePackNumberConfirm" title="打包" :ref="setModel" name="packNumber"></pack-number>
|
||||||
<edit-discount title="优惠金额" :ref="setModel" name="editMoney" :price="allPrice"></edit-discount>
|
<!-- <edit-discount title="优惠金额" :ref="setModel" name="editMoney" :price="allPrice"></edit-discount> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -290,21 +290,23 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onLoad, onReady, onShow } from '@dcloudio/uni-app'
|
import { onLoad, onReady, onShow } from '@dcloudio/uni-app'
|
||||||
import { ref, inject, onBeforeUnmount, reactive, computed, watch } from 'vue';
|
import { ref, inject, onBeforeUnmount, reactive, computed, watch } from 'vue';
|
||||||
import { getSafeBottomHeight } from '@/commons/utils/safe-bottom.js'
|
|
||||||
import modelDiscount from './components/discount'
|
import modelDiscount from './components/discount'
|
||||||
import giveFood from './components/give-food'
|
import giveFood from './components/give-food'
|
||||||
import packNumber from './components/pack-number'
|
import packNumber from './components/pack-number'
|
||||||
import oneRemark from './components/remark'
|
import oneRemark from './components/remark'
|
||||||
import editDiscount from '@/pagesCreateOrder/components/edit-discount.vue'
|
// import editDiscount from '@/pagesCreateOrder/components/edit-discount.vue'
|
||||||
|
|
||||||
|
import { getSafeBottomHeight } from '@/commons/utils/safe-bottom.js'
|
||||||
import go from '@/commons/utils/go.js';
|
import go from '@/commons/utils/go.js';
|
||||||
import $storageManage from '@/commons/utils/storageManage.js'
|
|
||||||
import { hasPermission } from '@/commons/utils/hasPermission.js'
|
import { hasPermission } from '@/commons/utils/hasPermission.js'
|
||||||
import { getNowCart } from '@/pagesCreateOrder/util.js'
|
import { getNowCart } from '@/pagesCreateOrder/util.js'
|
||||||
|
import { number } from 'uview-plus/libs/function/test';
|
||||||
|
|
||||||
import { getShopInfo } from '@/http/api/shop.js'
|
import { getShopInfo } from '@/http/api/shop.js'
|
||||||
import { getShopTableDetail } from '@/http/api/table.js'
|
import { getShopTableDetail } from '@/http/api/table.js'
|
||||||
import { getProductPage } from '@/http/api/product.js'
|
import { getProductList } from '@/http/api/product.js'
|
||||||
import { createOrder,getHistoryOrder } from '@/http/api/order.js'
|
import { createOrder,getHistoryOrder } from '@/http/api/order.js'
|
||||||
import { number } from 'uview-plus/libs/function/test';
|
|
||||||
|
|
||||||
const models = new Map();
|
const models = new Map();
|
||||||
const modelData = reactive({
|
const modelData = reactive({
|
||||||
|
|
@ -351,14 +353,15 @@
|
||||||
// value: "take-away",
|
// value: "take-away",
|
||||||
// }
|
// }
|
||||||
],
|
],
|
||||||
active: 'dine-in'
|
active: 'dine-in',
|
||||||
|
isShow: false,
|
||||||
},
|
},
|
||||||
form: {
|
form: {
|
||||||
note: ""
|
note: ""
|
||||||
},
|
},
|
||||||
orderInfo: {}
|
orderInfo: {}
|
||||||
})
|
})
|
||||||
|
const websocketUtil = inject('websocketUtil'); // 注入 WebSocket 工具类实例
|
||||||
onLoad((opt) => {
|
onLoad((opt) => {
|
||||||
Object.assign(option, opt)
|
Object.assign(option, opt)
|
||||||
console.log("opt====",opt);
|
console.log("opt====",opt);
|
||||||
|
|
@ -368,13 +371,11 @@
|
||||||
getTableInfo(opt)
|
getTableInfo(opt)
|
||||||
}
|
}
|
||||||
getTbShopInfo()
|
getTbShopInfo()
|
||||||
init()
|
|
||||||
|
|
||||||
})
|
})
|
||||||
let bottomHeight = ref(100)
|
let bottomHeight = ref(100)
|
||||||
onReady(() => {
|
onReady(() => {
|
||||||
getSafeBottomHeight('safe-bottom').then(res => {
|
getSafeBottomHeight('safe-bottom').then(res => {
|
||||||
console.log(res);
|
|
||||||
bottomHeight.value = res
|
bottomHeight.value = res
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
@ -383,12 +384,14 @@
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(() => pageData.eatTypes.active, (newval) => {
|
watch(() => pageData.eatTypes.active, (newval) => {
|
||||||
|
pageData.eatTypes.isShow = true
|
||||||
changeUseType()
|
changeUseType()
|
||||||
})
|
})
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
|
|
||||||
})
|
})
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
|
init()
|
||||||
watchChooseuser()
|
watchChooseuser()
|
||||||
watchChooseTable()
|
watchChooseTable()
|
||||||
})
|
})
|
||||||
|
|
@ -412,9 +415,9 @@
|
||||||
* 打包费
|
* 打包费
|
||||||
*/
|
*/
|
||||||
const $packFee = computed(() => {
|
const $packFee = computed(() => {
|
||||||
console.log("打包费===",goods.list)
|
let packAmount = 0;
|
||||||
return goods.list.reduce((prve, cur) => {
|
return goods.list.reduce((prve, cur) => {
|
||||||
return prve + ((cur.packFee||0)*parseFloat(cur.pack_number).toFixed(0))
|
return prve + (cur.packFee||0)*parseFloat(cur.pack_number).toFixed(2)
|
||||||
}, 0).toFixed(2)
|
}, 0).toFixed(2)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -447,11 +450,11 @@
|
||||||
const goodsPrice = computed(() => {
|
const goodsPrice = computed(() => {
|
||||||
const goodsTotalPrice = goods.list.reduce((prve, cur) => {
|
const goodsTotalPrice = goods.list.reduce((prve, cur) => {
|
||||||
const lowMemberPrice = cur.lowMemberPrice ? cur.lowMemberPrice : cur.lowPrice
|
const lowMemberPrice = cur.lowMemberPrice ? cur.lowMemberPrice : cur.lowPrice
|
||||||
const tPrice = (isVip.value ? lowMemberPrice : cur.lowPrice) * cur.number
|
const tPrice = Math.floor(((isVip.value ? lowMemberPrice : cur.lowPrice) * cur.number)*100)/100
|
||||||
const tpackFee = cur.is_temporary !=1&&parseFloat(cur.pack_number).toFixed(0) > 0 ? cur.packFee*parseFloat(cur.pack_number).toFixed(0) : 0
|
return prve + (cur.is_gift ? 0 : tPrice)
|
||||||
return prve + (cur.is_gift ? 0 : tPrice) + tpackFee
|
|
||||||
}, 0)
|
}, 0)
|
||||||
return ((goodsTotalPrice - discount_sale_amount.value) || 0).toFixed(2)
|
const tpackFee = $packFee.value > 0 ? $packFee.value*1 : 0
|
||||||
|
return ((goodsTotalPrice - discount_sale_amount.value + tpackFee) || 0).toFixed(2)
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -471,10 +474,8 @@
|
||||||
goodsTotalPrice = goods.list.reduce((prve, cur) => {
|
goodsTotalPrice = goods.list.reduce((prve, cur) => {
|
||||||
const tPrice = cur.lowPrice * cur.number
|
const tPrice = cur.lowPrice * cur.number
|
||||||
const tpackFee = (cur.pack_number*1) > 0 ? cur.packFee * (cur.pack_number*1) : 0
|
const tpackFee = (cur.pack_number*1) > 0 ? cur.packFee * (cur.pack_number*1) : 0
|
||||||
console.log(cur)
|
|
||||||
return prve + tPrice + tpackFee
|
return prve + tPrice + tpackFee
|
||||||
}, 0)
|
}, 0)
|
||||||
console.log(goodsTotalPrice)
|
|
||||||
return (goodsTotalPrice + $seatFee.totalAmount) - allPrice.value
|
return (goodsTotalPrice + $seatFee.totalAmount) - allPrice.value
|
||||||
} else {
|
} else {
|
||||||
return (discount_sale_amount.value)
|
return (discount_sale_amount.value)
|
||||||
|
|
@ -482,7 +483,19 @@
|
||||||
return (goodsTotalPrice + discount_sale_amount.value * 1).toFixed(2)
|
return (goodsTotalPrice + discount_sale_amount.value * 1).toFixed(2)
|
||||||
})
|
})
|
||||||
|
|
||||||
const websocketUtil = inject('websocketUtil'); // 注入 WebSocket 工具类实例
|
/**
|
||||||
|
* init
|
||||||
|
*/
|
||||||
|
async function init() {
|
||||||
|
// 获取商品列表
|
||||||
|
$goods = await getProductList({},'product', false)
|
||||||
|
console.log("商品列表===",$goods)
|
||||||
|
|
||||||
|
|
||||||
|
// 获取购物车数据
|
||||||
|
getCart()
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* socket消息监听
|
* socket消息监听
|
||||||
*/
|
*/
|
||||||
|
|
@ -511,7 +524,30 @@
|
||||||
} else {
|
} else {
|
||||||
delCart(cartItem.id)
|
delCart(cartItem.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
if( pageData.eatTypes.isShow ){
|
||||||
|
if( pageData.eatTypes.active == 'take-out') {
|
||||||
|
cartItem.pack_number = cartItem.number
|
||||||
|
} else {
|
||||||
|
cartItem.pack_number = 0
|
||||||
|
}
|
||||||
|
let par = {
|
||||||
|
type:'onboc',
|
||||||
|
account: uni.getStorageSync("iToken").loginId,
|
||||||
|
shop_id: uni.getStorageSync("shopInfo").id,
|
||||||
|
operate_type:'batch',
|
||||||
|
table_code: pageData.table.tableCode,
|
||||||
|
is_pack: pageData.eatTypes.active == 'take-out' ? 1 : 0,
|
||||||
|
}
|
||||||
|
updateCart(par)
|
||||||
|
}
|
||||||
|
// 是否更新就餐人数
|
||||||
|
if (!$seatFee.totalNumber) {
|
||||||
|
updateChoseCount()
|
||||||
|
}
|
||||||
|
|
||||||
|
pageData.eatTypes.isShow = false
|
||||||
break;
|
break;
|
||||||
case 'onboc_add':
|
case 'onboc_add':
|
||||||
case 'add':
|
case 'add':
|
||||||
|
|
@ -529,7 +565,10 @@
|
||||||
break;
|
break;
|
||||||
case 'onboc_cleanup':
|
case 'onboc_cleanup':
|
||||||
case 'cleanup':
|
case 'cleanup':
|
||||||
goods.lis = []
|
goods.list = []
|
||||||
|
$seatFee.totalNumber = 0
|
||||||
|
$seatFee.totalAmount = 0
|
||||||
|
userNumbers.defaultCateIndex = 0
|
||||||
break;
|
break;
|
||||||
case 'product_update':
|
case 'product_update':
|
||||||
init()
|
init()
|
||||||
|
|
@ -562,6 +601,11 @@
|
||||||
pageData.table.tableCode = cartItem.table_code
|
pageData.table.tableCode = cartItem.table_code
|
||||||
}
|
}
|
||||||
let cartIndex = 0;
|
let cartIndex = 0;
|
||||||
|
goods.list.map((item,index)=>{
|
||||||
|
if(item.id == cartItem.id) {
|
||||||
|
cartIndex = index;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
if( type == 'del' ) {
|
if( type == 'del' ) {
|
||||||
goods.list.splice(cartIndex, 1)
|
goods.list.splice(cartIndex, 1)
|
||||||
|
|
@ -575,27 +619,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function init() {
|
|
||||||
let goodsRes = await getGoods()
|
|
||||||
// await getCart()
|
|
||||||
$goods = goodsRes.records
|
|
||||||
if (!$seatFee.totalNumber) {
|
|
||||||
updateChoseCount()
|
|
||||||
}
|
|
||||||
getCart()
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取商品列表
|
|
||||||
*/
|
|
||||||
function getGoods() {
|
|
||||||
return getProductPage({
|
|
||||||
page: 1,
|
|
||||||
size: 300
|
|
||||||
},'product', false)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取购物车数据
|
* 获取购物车数据
|
||||||
|
|
@ -609,8 +632,6 @@
|
||||||
operate_type:'init',
|
operate_type:'init',
|
||||||
table_code: pageData.table.tableCode,
|
table_code: pageData.table.tableCode,
|
||||||
}))
|
}))
|
||||||
// pageData.eatTypes.active = useType == 'take-out' ? useType : useType.replace(
|
|
||||||
// /-after|-before/g, '');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -633,7 +654,6 @@
|
||||||
return (index + 1) + '人'
|
return (index + 1) + '人'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
getHistoryOrderDetail(opt.tableCode)
|
getHistoryOrderDetail(opt.tableCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -651,18 +671,6 @@
|
||||||
* 就餐类型切换监听
|
* 就餐类型切换监听
|
||||||
*/
|
*/
|
||||||
async function changeUseType() {
|
async function changeUseType() {
|
||||||
const { registerType } = pageData.shopInfo
|
|
||||||
//before 先付 after 后付
|
|
||||||
const isPayAfter = registerType == "before" ? false : true;
|
|
||||||
let useType = "take-out";
|
|
||||||
if (pageData.eatTypes.active == "take-out") {
|
|
||||||
uni.setStorageSync("useType", "take-out");
|
|
||||||
} else {
|
|
||||||
//堂食
|
|
||||||
useType = `dine-in-${isPayAfter? "after" : "before"}`;
|
|
||||||
uni.setStorageSync("useType", useType);
|
|
||||||
}
|
|
||||||
const tableId = useType == 'take-out' ? undefined : pageData.table.id;
|
|
||||||
if (!goods.list.length) {
|
if (!goods.list.length) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -674,7 +682,6 @@
|
||||||
* @param {Object} par
|
* @param {Object} par
|
||||||
*/
|
*/
|
||||||
function updateCart (par) {
|
function updateCart (par) {
|
||||||
// 初始化购物车
|
|
||||||
websocketUtil.send(JSON.stringify({
|
websocketUtil.send(JSON.stringify({
|
||||||
type:'onboc',
|
type:'onboc',
|
||||||
account: uni.getStorageSync("iToken").loginId,
|
account: uni.getStorageSync("iToken").loginId,
|
||||||
|
|
@ -700,19 +707,6 @@
|
||||||
updateCart(par)
|
updateCart(par)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 打包
|
|
||||||
*/
|
|
||||||
function toggleIsPack (item,key) {
|
|
||||||
let par = {
|
|
||||||
id: item.id,
|
|
||||||
product_id: item.product_id ,
|
|
||||||
sku_id: item.sku_id,
|
|
||||||
pack_num: 0
|
|
||||||
}
|
|
||||||
par['pack_number'] = item['pack_number'] == 0 ? 1 : 0
|
|
||||||
updateCart(par)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单品打折
|
* 单品打折
|
||||||
|
|
@ -790,10 +784,20 @@
|
||||||
const model = models.get(key)
|
const model = models.get(key)
|
||||||
console.log("弹窗数据===",modelData.data)
|
console.log("弹窗数据===",modelData.data)
|
||||||
if( key == 'packNumber'){
|
if( key == 'packNumber'){
|
||||||
|
if( modelData.data.type == 'weight' && item.pack_number <= 0){
|
||||||
|
let par = {
|
||||||
|
id: modelData.data.id,
|
||||||
|
product_id: modelData.data.product_id,
|
||||||
|
sku_id: modelData.data.sku_id,
|
||||||
|
pack_number: 1
|
||||||
|
}
|
||||||
|
updateCart(par)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if( item.pack_number > 0 ){
|
if( item.pack_number > 0 ){
|
||||||
let par = {
|
let par = {
|
||||||
id: modelData.data.id,
|
id: modelData.data.id,
|
||||||
product_id: modelData.data.product_id ,
|
product_id: modelData.data.product_id,
|
||||||
sku_id: modelData.data.sku_id,
|
sku_id: modelData.data.sku_id,
|
||||||
pack_number: 0
|
pack_number: 0
|
||||||
}
|
}
|
||||||
|
|
@ -812,7 +816,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatPrice(n) {
|
function formatPrice(n) {
|
||||||
return Number(n).toFixed(2)
|
return (Math.floor(n*100)/100).toFixed(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
function rotatingTables() {
|
function rotatingTables() {
|
||||||
|
|
@ -833,10 +837,9 @@
|
||||||
userNumbers.defaultCateIndex = maxCapacity - 1
|
userNumbers.defaultCateIndex = maxCapacity - 1
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
console.log(pageData.table)
|
|
||||||
if (!pageData.shopInfo.isTableFee && pageData.table && pageData.table.id) {
|
|
||||||
//不免餐位费
|
|
||||||
|
|
||||||
|
if (!pageData.shopInfo.isTableFee && pageData.table && pageData.table.id && goods.list.length > 0) {
|
||||||
|
//不免餐位费
|
||||||
let seatFee = {
|
let seatFee = {
|
||||||
totalNumber: userNumbers.defaultCateIndex * 1 + 1,
|
totalNumber: userNumbers.defaultCateIndex * 1 + 1,
|
||||||
totalAmount: (userNumbers.defaultCateIndex * 1 + 1) * pageData.shopInfo.tableFee,
|
totalAmount: (userNumbers.defaultCateIndex * 1 + 1) * pageData.shopInfo.tableFee,
|
||||||
|
|
@ -852,7 +855,6 @@
|
||||||
* @param {Object} e
|
* @param {Object} e
|
||||||
*/
|
*/
|
||||||
function userNumberChange(e) {
|
function userNumberChange(e) {
|
||||||
console.log(e);
|
|
||||||
userNumbers.defaultCateIndex = e.detail.value
|
userNumbers.defaultCateIndex = e.detail.value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -870,7 +872,7 @@
|
||||||
uni.$off('choose-table')
|
uni.$off('choose-table')
|
||||||
uni.$on('choose-table', (data) => {
|
uni.$on('choose-table', (data) => {
|
||||||
pageData.table = data
|
pageData.table = data
|
||||||
console.log(pageData.table);
|
console.log("台桌信息",pageData.table);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -931,14 +933,11 @@
|
||||||
}, 'redirect')
|
}, 'redirect')
|
||||||
} else {
|
} else {
|
||||||
//后付
|
//后付
|
||||||
console.log(option.isCreateOrderToDetail);
|
|
||||||
if (option.isCreateOrderToDetail != '0') {
|
if (option.isCreateOrderToDetail != '0') {
|
||||||
console.log('PAGES_ORDER_DETAIL');
|
|
||||||
go.to('PAGES_ORDER_DETAIL', {
|
go.to('PAGES_ORDER_DETAIL', {
|
||||||
id: res.id
|
id: res.id
|
||||||
}, 'redirect')
|
}, 'redirect')
|
||||||
} else {
|
} else {
|
||||||
console.log('back');
|
|
||||||
uni.navigateBack({
|
uni.navigateBack({
|
||||||
delta: 2
|
delta: 2
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -70,17 +70,12 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { computed, reactive, ref } from 'vue';
|
||||||
|
|
||||||
import go from '@/commons/utils/go.js';
|
import go from '@/commons/utils/go.js';
|
||||||
import infoBox from '@/commons/utils/infoBox.js';
|
import infoBox from '@/commons/utils/infoBox.js';
|
||||||
import {
|
import { formatPrice } from '@/commons/utils/format.js';
|
||||||
formatPrice
|
|
||||||
} from '@/commons/utils/format.js';
|
|
||||||
|
|
||||||
import {
|
|
||||||
computed,
|
|
||||||
reactive,
|
|
||||||
ref
|
|
||||||
} from 'vue';
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
type: Array,
|
type: Array,
|
||||||
|
|
@ -92,14 +87,6 @@
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
user: {
|
|
||||||
type: Object,
|
|
||||||
default: () => {
|
|
||||||
return {
|
|
||||||
id: ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
table: {
|
table: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {
|
default: () => {
|
||||||
|
|
@ -173,7 +160,8 @@
|
||||||
const allPrice = computed(() => {
|
const allPrice = computed(() => {
|
||||||
console.log("购物车数据==",props.data)
|
console.log("购物车数据==",props.data)
|
||||||
return props.data.reduce((prve, cur) => {
|
return props.data.reduce((prve, cur) => {
|
||||||
return prve + cur.lowPrice * cur.number
|
let price = Math.floor((cur.lowPrice * cur.number)*100)/100
|
||||||
|
return prve + price
|
||||||
}, 0).toFixed(2)
|
}, 0).toFixed(2)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -182,8 +170,9 @@
|
||||||
result = props.data.reduce((prve, cur) => {
|
result = props.data.reduce((prve, cur) => {
|
||||||
return prve + cur.number
|
return prve + cur.number
|
||||||
}, 0)
|
}, 0)
|
||||||
// console.log(result)
|
console.log(result)
|
||||||
return result >= 99 ? 99 : result
|
result = result > 0 ? result.toFixed(2) : 0
|
||||||
|
return result >= 99 ? 99 : parseFloat(result)
|
||||||
})
|
})
|
||||||
|
|
||||||
function updateNumber(isAdd, index, goods) {
|
function updateNumber(isAdd, index, goods) {
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,7 @@
|
||||||
// 将数据保存进对应的值
|
// 将数据保存进对应的值
|
||||||
let arr = []
|
let arr = []
|
||||||
let arrlength = 0
|
let arrlength = 0
|
||||||
|
datas.selectNumber = 0
|
||||||
datas.skus.map(ele => {
|
datas.skus.map(ele => {
|
||||||
let group = {
|
let group = {
|
||||||
...ele,
|
...ele,
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,7 @@
|
||||||
<view class="boxoverlay" v-if="form&&form.goods">
|
<view class="boxoverlay" v-if="form&&form.goods">
|
||||||
<view class="rect" @tap.stop>
|
<view class="rect" @tap.stop>
|
||||||
<view class="title">
|
<view class="title">
|
||||||
<view>
|
<view> 标题 </view>
|
||||||
标题
|
|
||||||
</view>
|
|
||||||
<view class="" @click="overlayshow = false">
|
<view class="" @click="overlayshow = false">
|
||||||
<up-icon name="close" color="#93969b" size="20"></up-icon>
|
<up-icon name="close" color="#93969b" size="20"></up-icon>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -31,11 +29,9 @@
|
||||||
<button @click="deleteLast">←</button>
|
<button @click="deleteLast">←</button>
|
||||||
</view>
|
</view>
|
||||||
<view class="classmoney">
|
<view class="classmoney">
|
||||||
¥ {{ (form.goods.lowPrice * currentInput).toFixed(2) }}
|
¥ {{ (Math.floor((form.goods.lowPrice * currentInput)*100)/100).toFixed(2) }}
|
||||||
</view>
|
|
||||||
<view class="classconfirm" @click="clickconfirm">
|
|
||||||
确认
|
|
||||||
</view>
|
</view>
|
||||||
|
<view class="classconfirm" @click="clickconfirm"> 确认 </view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</up-overlay>
|
</up-overlay>
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<view class="bottom w-full">
|
<view class="bottom w-full">
|
||||||
<my-car :isCreateOrderToDetail="isCreateOrderToDetail" @updateNumber="carsNumberChange" :user="data.vipUser"
|
<my-car :isCreateOrderToDetail="isCreateOrderToDetail" @updateNumber="carsNumberChange"
|
||||||
:table="data.table" :data="cars" @clear="cleaCart"></my-car>
|
:table="data.table" :data="cars" @clear="cleaCart"></my-car>
|
||||||
</view>
|
</view>
|
||||||
<!-- 套餐选择规格 -->
|
<!-- 套餐选择规格 -->
|
||||||
|
|
@ -105,8 +105,7 @@
|
||||||
<guige-model @update-sku="updateSkuSel" @confirm="guigeConfirm" ref="chooseGuigeModel" :goodsData="selGoods"
|
<guige-model @update-sku="updateSkuSel" @confirm="guigeConfirm" ref="chooseGuigeModel" :goodsData="selGoods"
|
||||||
:title="guigeModelData.title" :sku-map="guigeModelData.chooseGoods.skuMap"
|
:title="guigeModelData.title" :sku-map="guigeModelData.chooseGoods.skuMap"
|
||||||
:skus="guigeModelData.chooseGoods.skus"></guige-model>
|
:skus="guigeModelData.chooseGoods.skus"></guige-model>
|
||||||
<!-- 添加附加费 -->
|
|
||||||
<my-surcharge @confirm="surchargeConfirm" ref="surcharge" title="添加附加费"></my-surcharge>
|
|
||||||
<!-- 称重 -->
|
<!-- 称重 -->
|
||||||
<weigh-item ref="refweighitem" @weighgoodsUpdate='goodsUpdate'></weigh-item>
|
<weigh-item ref="refweighitem" @weighgoodsUpdate='goodsUpdate'></weigh-item>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -116,28 +115,21 @@
|
||||||
import { onLoad, onReady, onShow } from '@dcloudio/uni-app';
|
import { onLoad, onReady, onShow } from '@dcloudio/uni-app';
|
||||||
import { computed, reactive, ref, nextTick, watch, getCurrentInstance, onUnmounted, onBeforeUnmount } from 'vue';
|
import { computed, reactive, ref, nextTick, watch, getCurrentInstance, onUnmounted, onBeforeUnmount } from 'vue';
|
||||||
|
|
||||||
import util from './util.js';
|
|
||||||
import color from '@/commons/color.js';
|
|
||||||
import guigeModel from './components/guige'
|
import guigeModel from './components/guige'
|
||||||
import taocanModel from './components/taocanModel.vue'
|
import taocanModel from './components/taocanModel.vue'
|
||||||
import weighItem from './components/weigh.vue'
|
import weighItem from './components/weigh.vue'
|
||||||
import listGoodsItem from './components/list-goods-item.vue'
|
import listGoodsItem from './components/list-goods-item.vue'
|
||||||
import mySurcharge from './components/surcharge'
|
|
||||||
import myCar from './components/car'
|
import myCar from './components/car'
|
||||||
|
|
||||||
|
import util from './util.js';
|
||||||
|
import color from '@/commons/color.js';
|
||||||
import go from '@/commons/utils/go.js';
|
import go from '@/commons/utils/go.js';
|
||||||
import infoBox from '@/commons/utils/infoBox.js';
|
import infoBox from '@/commons/utils/infoBox.js';
|
||||||
import { getNowCart } from '@/pagesCreateOrder/util.js'
|
import { getNowCart } from '@/pagesCreateOrder/util.js'
|
||||||
import storageManage from '@/commons/utils/storageManage.js'
|
import storageManage from '@/commons/utils/storageManage.js'
|
||||||
import {
|
import { hasPermission } from '@/commons/utils/hasPermission.js'
|
||||||
$returnUseType
|
|
||||||
} from './util.js'
|
|
||||||
import {
|
|
||||||
hasPermission
|
|
||||||
} from '@/commons/utils/hasPermission.js'
|
|
||||||
|
|
||||||
import appConfig from '@/config/appConfig.js';
|
|
||||||
import WebsocketUtil from '@/commons/utils/websocket.js'
|
import WebsocketUtil from '@/commons/utils/websocket.js'
|
||||||
|
|
||||||
import { getShopTable,getShopTableDetail } from '@/http/api/table.js'
|
import { getShopTable,getShopTableDetail } from '@/http/api/table.js'
|
||||||
import { getProductList } from '@/http/api/product.js'
|
import { getProductList } from '@/http/api/product.js'
|
||||||
import { categoryPage } from '@/http/api/cateGory.js'
|
import { categoryPage } from '@/http/api/cateGory.js'
|
||||||
|
|
@ -209,9 +201,7 @@
|
||||||
option = opt
|
option = opt
|
||||||
console.log("opt===",opt)
|
console.log("opt===",opt)
|
||||||
Object.assign(data.table, opt)
|
Object.assign(data.table, opt)
|
||||||
if (opt.useType) {
|
|
||||||
uni.setStorageSync('useType', opt.useType)
|
|
||||||
}
|
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
title: (opt && opt.type == 'add') ? '顾客加菜' : '代客下单'
|
title: (opt && opt.type == 'add') ? '顾客加菜' : '代客下单'
|
||||||
})
|
})
|
||||||
|
|
@ -221,7 +211,7 @@
|
||||||
if(uni.getStorageSync("table_code")){
|
if(uni.getStorageSync("table_code")){
|
||||||
data.table.tableCode = uni.getStorageSync("table_code")
|
data.table.tableCode = uni.getStorageSync("table_code")
|
||||||
}
|
}
|
||||||
init()
|
// init()
|
||||||
xiadanClick()
|
xiadanClick()
|
||||||
})
|
})
|
||||||
watch(() => data.table.id, (newval, oldval) => {
|
watch(() => data.table.id, (newval, oldval) => {
|
||||||
|
|
@ -230,13 +220,13 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
// watchChooseuser()
|
|
||||||
watchChooseTable()
|
watchChooseTable()
|
||||||
watchUpdate()
|
watchUpdate()
|
||||||
data.isGoodsAdd = true;
|
data.isGoodsAdd = true;
|
||||||
nextTick(()=>{
|
nextTick(()=>{
|
||||||
onMessage()
|
onMessage()
|
||||||
})
|
})
|
||||||
|
init()
|
||||||
})
|
})
|
||||||
onReady(() => {
|
onReady(() => {
|
||||||
getElRect('list-tight-top').then(res => {
|
getElRect('list-tight-top').then(res => {
|
||||||
|
|
@ -264,16 +254,12 @@
|
||||||
let $category = []
|
let $category = []
|
||||||
|
|
||||||
async function init() {
|
async function init() {
|
||||||
// console.log(option.type)
|
|
||||||
if (option.type == 'add') {
|
if (option.type == 'add') {
|
||||||
setTabBar($category, $originGoods, [])
|
setTabBar($category, $originGoods, [])
|
||||||
}
|
}
|
||||||
let shopInfo = await getShopInfo({id:uni.getStorageSync('shopInfo').id})
|
let shopInfo = await getShopInfo({id:uni.getStorageSync('shopInfo').id})
|
||||||
const useType = data.table.status == 'using' ? data.table.useType : $returnUseType(shopInfo)
|
console.log(shopInfo)
|
||||||
uni.setStorageSync('useType', useType)
|
uni.setStorageSync("shopInfo",shopInfo)
|
||||||
|
|
||||||
// await getTableInfo()
|
|
||||||
|
|
||||||
// 获取分类数据
|
// 获取分类数据
|
||||||
let categoryRes = await categoryPage({ page: 1, size: 300 })
|
let categoryRes = await categoryPage({ page: 1, size: 300 })
|
||||||
$category = categoryRes.records
|
$category = categoryRes.records
|
||||||
|
|
@ -312,7 +298,8 @@
|
||||||
console.log("onMessage===",msg)
|
console.log("onMessage===",msg)
|
||||||
if( msg.msg == "收到了"){
|
if( msg.msg == "收到了"){
|
||||||
data.isCars = true;
|
data.isCars = true;
|
||||||
// initCart()
|
data.isGoodsAdd = true;
|
||||||
|
initCart()
|
||||||
}
|
}
|
||||||
if( msg.msg_id ){
|
if( msg.msg_id ){
|
||||||
websocketUtil.send(JSON.stringify({
|
websocketUtil.send(JSON.stringify({
|
||||||
|
|
@ -341,7 +328,7 @@
|
||||||
data.table.tableCode = msg.table_code
|
data.table.tableCode = msg.table_code
|
||||||
uni.setStorageSync("table_code",msg.table_code)
|
uni.setStorageSync("table_code",msg.table_code)
|
||||||
}
|
}
|
||||||
console.log("cartArr===",cartArr)
|
console.log("商品信息===",cartArr)
|
||||||
msg.data.map(item=>{
|
msg.data.map(item=>{
|
||||||
cartItem = getNowCart(item,cartArr)
|
cartItem = getNowCart(item,cartArr)
|
||||||
console.log("cartItem===",cartItem)
|
console.log("cartItem===",cartItem)
|
||||||
|
|
@ -398,8 +385,6 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化购物车
|
* 初始化购物车
|
||||||
*/
|
*/
|
||||||
|
|
@ -411,9 +396,6 @@
|
||||||
}
|
}
|
||||||
console.log("购物车初始化参数===",params)
|
console.log("购物车初始化参数===",params)
|
||||||
websocketUtil.send(JSON.stringify(params))
|
websocketUtil.send(JSON.stringify(params))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -426,9 +408,9 @@
|
||||||
operate_type: operate_type,
|
operate_type: operate_type,
|
||||||
table_code: data.table.tableCode,
|
table_code: data.table.tableCode,
|
||||||
product_id: '',
|
product_id: '',
|
||||||
|
is_print: 1,
|
||||||
sku_id: '', //
|
sku_id: '', //
|
||||||
number: 1, //数量
|
number: 1, //数量
|
||||||
is_temporary: 0, //是否是临时菜
|
|
||||||
}
|
}
|
||||||
Object.assign(params, par)
|
Object.assign(params, par)
|
||||||
console.log('购物车添加菜品参数===',params)
|
console.log('购物车添加菜品参数===',params)
|
||||||
|
|
@ -511,7 +493,6 @@
|
||||||
* @param {Object} item
|
* @param {Object} item
|
||||||
*/
|
*/
|
||||||
async function onChooseTable(item) {
|
async function onChooseTable(item) {
|
||||||
console.log('onChooseTable');
|
|
||||||
if (!item) {
|
if (!item) {
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
|
|
@ -533,8 +514,6 @@
|
||||||
table_code: data.table.tableCode,
|
table_code: data.table.tableCode,
|
||||||
new_table_code: item.tableCode,
|
new_table_code: item.tableCode,
|
||||||
}
|
}
|
||||||
console.log(cars)
|
|
||||||
|
|
||||||
if (data.table.id || cars.length <= 0) {
|
if (data.table.id || cars.length <= 0) {
|
||||||
data.table = {
|
data.table = {
|
||||||
...item
|
...item
|
||||||
|
|
@ -576,11 +555,10 @@
|
||||||
if( !data.isCars ){
|
if( !data.isCars ){
|
||||||
return infoBox.showToast('购物车加载失败请刷新重试...')
|
return infoBox.showToast('购物车加载失败请刷新重试...')
|
||||||
}
|
}
|
||||||
if( !data.isGoodsAdd ){ return; }
|
if( !data.isGoodsAdd ){ return;infoBox.showToast('isGoodsAdd...') }
|
||||||
let $goods = data.tabbar[index].foods[foodsindex]
|
let $goods = data.tabbar[index].foods[foodsindex]
|
||||||
if ($goods.type !== 'sku') {
|
if ($goods.type !== 'sku') {
|
||||||
//单规格
|
//单规格
|
||||||
console.log($goods)
|
|
||||||
let goodsInCarIndex = cars.findIndex((carsGoods) => {
|
let goodsInCarIndex = cars.findIndex((carsGoods) => {
|
||||||
return carsGoods.sku_id == $goods.skuList[0].id && carsGoods.product_id == $goods.id;
|
return carsGoods.sku_id == $goods.skuList[0].id && carsGoods.product_id == $goods.id;
|
||||||
});
|
});
|
||||||
|
|
@ -609,6 +587,7 @@
|
||||||
number: number,
|
number: number,
|
||||||
product_id: product_id,
|
product_id: product_id,
|
||||||
sku_id: sku_id,
|
sku_id: sku_id,
|
||||||
|
is_temporary: cartItem.is_temporary
|
||||||
},'edit')
|
},'edit')
|
||||||
data.isGoodsAdd = false;
|
data.isGoodsAdd = false;
|
||||||
setSearchGoods(searchGoodsIndex, number)
|
setSearchGoods(searchGoodsIndex, number)
|
||||||
|
|
@ -624,6 +603,7 @@
|
||||||
number: suitNum,
|
number: suitNum,
|
||||||
product_id: product_id,
|
product_id: product_id,
|
||||||
sku_id: sku_id,
|
sku_id: sku_id,
|
||||||
|
is_temporary: 0, //是否是临时菜
|
||||||
},'add')
|
},'add')
|
||||||
data.isGoodsAdd = false;
|
data.isGoodsAdd = false;
|
||||||
}
|
}
|
||||||
|
|
@ -680,7 +660,6 @@
|
||||||
* @param {Object} e
|
* @param {Object} e
|
||||||
*/
|
*/
|
||||||
async function carsNumberChange(e) {
|
async function carsNumberChange(e) {
|
||||||
console.log("carsNumberChange===",e)
|
|
||||||
if( !data.isGoodsAdd ){ return; }
|
if( !data.isGoodsAdd ){ return; }
|
||||||
let $sku;
|
let $sku;
|
||||||
let $goods;
|
let $goods;
|
||||||
|
|
@ -714,7 +693,8 @@
|
||||||
number: e.num,
|
number: e.num,
|
||||||
id: e.goods.id,
|
id: e.goods.id,
|
||||||
product_id: e.goods.product_id,
|
product_id: e.goods.product_id,
|
||||||
sku_id: e.goods.sku_id
|
sku_id: e.goods.sku_id,
|
||||||
|
is_temporary: e.goods.is_temporary
|
||||||
},'edit')
|
},'edit')
|
||||||
data.isGoodsAdd = false;
|
data.isGoodsAdd = false;
|
||||||
}
|
}
|
||||||
|
|
@ -725,51 +705,44 @@
|
||||||
* @param {Object} item
|
* @param {Object} item
|
||||||
*/
|
*/
|
||||||
async function taocanConfirm(d, item) {
|
async function taocanConfirm(d, item) {
|
||||||
console.log(d)
|
|
||||||
//添加
|
|
||||||
editCart({
|
editCart({
|
||||||
number: item.skuList[0].suitNum,
|
number: item.skuList[0].suitNum,
|
||||||
product_id: item.id,
|
product_id: item.id,
|
||||||
sku_id: item.skuList[0].id,
|
sku_id: item.skuList[0].id,
|
||||||
pro_group_info: JSON.stringify(d),
|
pro_group_info: JSON.stringify(d),
|
||||||
|
is_temporary: 0, //是否是临时菜
|
||||||
},'add')
|
},'add')
|
||||||
data.isGoodsAdd = false;
|
data.isGoodsAdd = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const instance = getCurrentInstance();
|
const instance = getCurrentInstance();
|
||||||
let selGoods = ref({});
|
let selGoods = ref({});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 打开规格弹窗
|
* 打开规格弹窗
|
||||||
* @param {Object} foodsindex
|
* @param {Object} foodsindex
|
||||||
* @param {Object} index
|
* @param {Object} index
|
||||||
*/
|
*/
|
||||||
function chooseGuige(foodsindex, index) {
|
function chooseGuige(foodsindex, index) {
|
||||||
// if (!data.table.id) {
|
|
||||||
// return infoBox.showToast('请先选择桌台', 0.5).then(res => {
|
|
||||||
// chooseTable()
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
if( !data.isCars ){
|
if( !data.isCars ){
|
||||||
return infoBox.showToast('购物车加载失败请刷新重试...')
|
return infoBox.showToast('购物车加载失败请刷新重试...')
|
||||||
}
|
}
|
||||||
const $goods = data.tabbar[index].foods[foodsindex]
|
const $goods = data.tabbar[index].foods[foodsindex]
|
||||||
console.log($goods)
|
|
||||||
selGoods.value = $goods
|
selGoods.value = $goods
|
||||||
if ($goods.groupType == 1) {
|
if ($goods.groupType == 1) {
|
||||||
data.goodsData = $goods
|
data.goodsData = $goods
|
||||||
instance.ctx.$refs.taocanModelRef.open()
|
instance.ctx.$refs.taocanModelRef.open()
|
||||||
} else {
|
} else {
|
||||||
console.log($goods)
|
|
||||||
guigeModelData.title = $goods.name
|
guigeModelData.title = $goods.name
|
||||||
const skuMap = returnSelGoodsSkuMap($goods.skuList)
|
const skuMap = returnSelGoodsSkuMap($goods.skuList)
|
||||||
console.log(skuMap)
|
|
||||||
// 多规格,和套餐规格区分.groupType=1 套餐多规格
|
// 多规格,和套餐规格区分.groupType=1 套餐多规格
|
||||||
const selectSpecInfo = returnSelGoodsSkuList($goods.selectSpecInfo)
|
const selectSpecInfo = returnSelGoodsSkuList($goods.selectSpecInfo)
|
||||||
setSkugoodsDefaultInit($goods, selectSpecInfo, skuMap, $goods.skuList)
|
setSkugoodsDefaultInit($goods, selectSpecInfo, skuMap, $goods.skuList)
|
||||||
chooseGuigeModel.value.open()
|
chooseGuigeModel.value.open()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//返回当前选中商品skuMap
|
//返回当前选中商品skuMap
|
||||||
function returnSelGoodsSkuMap(specList) {
|
function returnSelGoodsSkuMap(specList) {
|
||||||
const skuMap = {}
|
const skuMap = {}
|
||||||
|
|
@ -812,7 +785,6 @@
|
||||||
* @param {Object} num
|
* @param {Object} num
|
||||||
*/
|
*/
|
||||||
async function guigeConfirm(sku, suitNum) {
|
async function guigeConfirm(sku, suitNum) {
|
||||||
console.log(sku)
|
|
||||||
if( !data.isGoodsAdd ){ return; }
|
if( !data.isGoodsAdd ){ return; }
|
||||||
let goods = guigeModelData.chooseGoods.item
|
let goods = guigeModelData.chooseGoods.item
|
||||||
let sku_id = sku.id
|
let sku_id = sku.id
|
||||||
|
|
@ -830,6 +802,7 @@
|
||||||
number: newNumber,
|
number: newNumber,
|
||||||
product_id: product_id,
|
product_id: product_id,
|
||||||
sku_id: sku_id,
|
sku_id: sku_id,
|
||||||
|
is_temporary: carGoods.is_temporary, //是否是临时菜
|
||||||
},'edit')
|
},'edit')
|
||||||
data.isGoodsAdd = false;
|
data.isGoodsAdd = false;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -838,6 +811,7 @@
|
||||||
number: suitNum,
|
number: suitNum,
|
||||||
product_id: product_id,
|
product_id: product_id,
|
||||||
sku_id: sku_id,
|
sku_id: sku_id,
|
||||||
|
is_temporary: 0, //是否是临时菜
|
||||||
},'add')
|
},'add')
|
||||||
data.isGoodsAdd = false;
|
data.isGoodsAdd = false;
|
||||||
}
|
}
|
||||||
|
|
@ -860,8 +834,9 @@
|
||||||
} : false
|
} : false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
//多规格商品弹窗时,找到默认可以下单的规格商品
|
* 多规格商品弹窗时,找到默认可以下单的规格商品
|
||||||
|
*/
|
||||||
function findGoods(selectSpecInfo = [], goodsListMap = {}, skuList) {
|
function findGoods(selectSpecInfo = [], goodsListMap = {}, skuList) {
|
||||||
let skuMapNumber = selectSpecInfo.reduce((prve, cur) => {
|
let skuMapNumber = selectSpecInfo.reduce((prve, cur) => {
|
||||||
for (let i in cur.valueArr) {
|
for (let i in cur.valueArr) {
|
||||||
|
|
@ -869,10 +844,7 @@
|
||||||
}
|
}
|
||||||
return prve;
|
return prve;
|
||||||
}, {});
|
}, {});
|
||||||
console.log("selectSpecInfo",selectSpecInfo)
|
|
||||||
console.log("skuMapNumber",guigeModelData.chooseGoods.item)
|
|
||||||
let canBudyGoods = skuList.filter((v) => util.isCanBuy(v, guigeModelData.chooseGoods.item))
|
let canBudyGoods = skuList.filter((v) => util.isCanBuy(v, guigeModelData.chooseGoods.item))
|
||||||
console.log("canBudyGoods",canBudyGoods)
|
|
||||||
return canBudyGoods[0];
|
return canBudyGoods[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -894,7 +866,6 @@
|
||||||
guigeModelData.chooseGoods.skus[index].sel = v;
|
guigeModelData.chooseGoods.skus[index].sel = v;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
console.log("guigeModelData.chooseGoods.skus===",guigeModelData.chooseGoods.skus);
|
|
||||||
setTagDisabled();
|
setTagDisabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -910,7 +881,10 @@
|
||||||
setTagDisabled();
|
setTagDisabled();
|
||||||
|
|
||||||
}
|
}
|
||||||
//设置规格按钮的禁止状态
|
|
||||||
|
/**
|
||||||
|
* 设置规格按钮的禁止状态
|
||||||
|
*/
|
||||||
function setTagDisabled() {
|
function setTagDisabled() {
|
||||||
const skuList = guigeModelData.chooseGoods.skus
|
const skuList = guigeModelData.chooseGoods.skus
|
||||||
const skuMap = guigeModelData.chooseGoods.skuMap
|
const skuMap = guigeModelData.chooseGoods.skuMap
|
||||||
|
|
@ -925,7 +899,6 @@
|
||||||
const matchArr = [];
|
const matchArr = [];
|
||||||
for (let key in skuMap) {
|
for (let key in skuMap) {
|
||||||
let goods = skuMap[key];
|
let goods = skuMap[key];
|
||||||
console.log(key)
|
|
||||||
let keyArr = key.split(",");
|
let keyArr = key.split(",");
|
||||||
for (let spe of selArrAllGroup) {
|
for (let spe of selArrAllGroup) {
|
||||||
if (util.arrayContainsAll(keyArr, spe)) {
|
if (util.arrayContainsAll(keyArr, spe)) {
|
||||||
|
|
@ -934,7 +907,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(matchArr);
|
|
||||||
//全部规格都已下架
|
//全部规格都已下架
|
||||||
if (!matchArr.length) {
|
if (!matchArr.length) {
|
||||||
for (let k in skuList) {
|
for (let k in skuList) {
|
||||||
|
|
@ -975,8 +947,6 @@
|
||||||
* 扫桌台码
|
* 扫桌台码
|
||||||
*/
|
*/
|
||||||
function scanCode() {
|
function scanCode() {
|
||||||
// 只允许通过相机扫码
|
|
||||||
console.log('scanCode');
|
|
||||||
uni.scanCode({
|
uni.scanCode({
|
||||||
onlyFromCamera: true,
|
onlyFromCamera: true,
|
||||||
success: async function(res) {
|
success: async function(res) {
|
||||||
|
|
@ -993,13 +963,10 @@
|
||||||
title: '请扫描正确的桌台码'
|
title: '请扫描正确的桌台码'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// uni.showModal({
|
|
||||||
// title:'',
|
|
||||||
// content:res.result
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function returnUrlPar(str) {
|
function returnUrlPar(str) {
|
||||||
let arr = str.split("?")[1].split("&"); //先通过?分解得到?后面的所需字符串,再将其通过&分解开存放在数组里
|
let arr = str.split("?")[1].split("&"); //先通过?分解得到?后面的所需字符串,再将其通过&分解开存放在数组里
|
||||||
let obj = {};
|
let obj = {};
|
||||||
|
|
@ -1009,8 +976,12 @@
|
||||||
return obj
|
return obj
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品数据处理
|
||||||
|
* @param {Object} category
|
||||||
|
* @param {Object} goods
|
||||||
|
* @param {Object} cars
|
||||||
|
*/
|
||||||
function setTabBar(category, goods, cars) {
|
function setTabBar(category, goods, cars) {
|
||||||
const goodsCategoryMap = goods.reduce((prve, cur) => {
|
const goodsCategoryMap = goods.reduce((prve, cur) => {
|
||||||
if (!prve.hasOwnProperty(cur.categoryId)) {
|
if (!prve.hasOwnProperty(cur.categoryId)) {
|
||||||
|
|
@ -1049,27 +1020,22 @@
|
||||||
storageManage.cacheGoods(data.tabbar)
|
storageManage.cacheGoods(data.tabbar)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const surcharge = ref(null)
|
|
||||||
|
|
||||||
function surchargeConfirm(e) {
|
|
||||||
data.tabbar[data.tabbar.length - 1].foods.unshift({
|
|
||||||
...e,
|
|
||||||
chooseNumber: 0
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function surchargeShow() {
|
|
||||||
surcharge.value.open()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
let searchValue = ref('')
|
let searchValue = ref('')
|
||||||
let isSearch = ref(false)
|
let isSearch = ref(false)
|
||||||
let searchResult = ref([])
|
let searchResult = ref([])
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 搜索
|
||||||
|
*/
|
||||||
|
function search() {
|
||||||
|
if (searchValue.value === '') {
|
||||||
|
isSearch.value = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
isSearch.value = true
|
||||||
|
searchResult.value = returnSearchGoods()
|
||||||
|
}
|
||||||
|
|
||||||
function returnSearchGoods() {
|
function returnSearchGoods() {
|
||||||
const newval = searchValue.value
|
const newval = searchValue.value
|
||||||
let arr = []
|
let arr = []
|
||||||
|
|
@ -1094,16 +1060,6 @@
|
||||||
return arr
|
return arr
|
||||||
}
|
}
|
||||||
|
|
||||||
function search() {
|
|
||||||
if (searchValue.value === '') {
|
|
||||||
isSearch.value = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
isSearch.value = true
|
|
||||||
searchResult.value = returnSearchGoods()
|
|
||||||
console.log(searchResult.value);
|
|
||||||
}
|
|
||||||
|
|
||||||
function clearSearch() {
|
function clearSearch() {
|
||||||
isSearch.value = false
|
isSearch.value = false
|
||||||
}
|
}
|
||||||
|
|
@ -1122,12 +1078,6 @@
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 称重
|
* 称重
|
||||||
*/
|
*/
|
||||||
|
|
@ -1157,10 +1107,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let isTabClickOver = true
|
let isTabClickOver = true
|
||||||
/**
|
/**
|
||||||
* 点击左边的栏目切换
|
* 点击左边的栏目切换
|
||||||
|
|
@ -1286,24 +1232,10 @@
|
||||||
}, 100)
|
}, 100)
|
||||||
}
|
}
|
||||||
|
|
||||||
function watchChooseuser() {
|
/**
|
||||||
uni.$off('choose-user')
|
* 台桌切换
|
||||||
uni.$on('choose-user', (user) => {
|
*/
|
||||||
console.log(user);
|
|
||||||
data.vipUser = user ? user : {
|
|
||||||
id: ''
|
|
||||||
}
|
|
||||||
setUser()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
async function onSelTable() {
|
async function onSelTable() {
|
||||||
// const cartRes = await getCart()
|
|
||||||
// cars.length = 0
|
|
||||||
// const cartArr = getNowCart(cartRes.records)
|
|
||||||
// for (let i in cartArr) {
|
|
||||||
// cars.push(cartArr[i])
|
|
||||||
// }
|
|
||||||
setTabBar($category, $originGoods, cars)
|
setTabBar($category, $originGoods, cars)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ export function getNowCart(carItem,goodsList,user) {
|
||||||
carItem.lowPrice = item.salePrice
|
carItem.lowPrice = item.salePrice
|
||||||
carItem.lowMemberPrice = item.memberPrice
|
carItem.lowMemberPrice = item.memberPrice
|
||||||
carItem.specInfo = item.specInfo
|
carItem.specInfo = item.specInfo
|
||||||
|
|
||||||
if( uni.getStorageSync('shopInfo').isMemberPrice && user && user.id && user.isVip ){
|
if( uni.getStorageSync('shopInfo').isMemberPrice && user && user.id && user.isVip ){
|
||||||
carItem.salePrice = item.memberPrice
|
carItem.salePrice = item.memberPrice
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -25,6 +26,7 @@ export function getNowCart(carItem,goodsList,user) {
|
||||||
carItem.name = goodsItem.name
|
carItem.name = goodsItem.name
|
||||||
carItem.coverImg = goodsItem.coverImg
|
carItem.coverImg = goodsItem.coverImg
|
||||||
carItem.packFee = goodsItem.packFee
|
carItem.packFee = goodsItem.packFee
|
||||||
|
carItem.type = goodsItem.type
|
||||||
carItem.isGrounding = true;
|
carItem.isGrounding = true;
|
||||||
}
|
}
|
||||||
carItem.number = parseFloat(carItem.number)
|
carItem.number = parseFloat(carItem.number)
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,11 @@
|
||||||
<view class="item u-m-b-32" v-for="(item,index) in order.info" :key="index">
|
<view class="item u-m-b-32" v-for="(item,index) in order.info" :key="index">
|
||||||
<view class="u-flex u-col-top">
|
<view class="u-flex u-col-top">
|
||||||
<view class="u-flex">
|
<view class="u-flex">
|
||||||
<image class="img" :src="item.coverImg||item.productImg" mode=""></image>
|
|
||||||
|
<image v-if="item.isTemporary == 0" class="img" :src="item.coverImg||item.productImg" mode=""></image>
|
||||||
|
<view v-else style="background-color: #3f9eff; width: 152rpx;height: 152rpx;line-height: 152rpx;text-align: center;color: #fff;" >
|
||||||
|
临时菜
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-p-l-32 u-flex-1">
|
<view class="u-p-l-32 u-flex-1">
|
||||||
<view class="u-flex u-row-between u-col-top">
|
<view class="u-flex u-row-between u-col-top">
|
||||||
|
|
@ -37,30 +41,35 @@
|
||||||
{{item.name||item.productName}}
|
{{item.name||item.productName}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-m-t-8">
|
<view class="u-flex u-m-t-8" style="flex-direction: column;align-items: flex-start;">
|
||||||
<view class="u-m-r-20 u-flex" v-if="item.isGift">
|
<view class="u-flex u-m-b-8">
|
||||||
<uni-tag text="赠送"
|
<view class="u-m-r-20 u-flex" v-if="item.isGift">
|
||||||
custom-style="background-color: #FFF0DF; border-color: #FFF0DF; color: #FF9F2E;">
|
<uni-tag text="赠送"
|
||||||
</uni-tag>
|
custom-style="background-color: #FFF0DF; border-color: #FFF0DF; color: #FF9F2E;">
|
||||||
|
</uni-tag>
|
||||||
|
</view>
|
||||||
|
<view class="u-m-r-20 u-flex " v-if="item.userCouponId">
|
||||||
|
<uni-tag :text=" productCouponDikou(item)"
|
||||||
|
custom-style="background-color: #FFF0DF; border-color: #FFF0DF; color: #FF9F2E;">
|
||||||
|
</uni-tag>
|
||||||
|
</view>
|
||||||
|
<view class="u-m-r-20 u-flex" v-if="item.packNumber > 0">
|
||||||
|
<uni-tag
|
||||||
|
custom-style="background-color: #E6F0FF; border-color: #E6F0FF; color: #318AFE;"
|
||||||
|
size="small" text="打包" inverted type="success" />
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-m-r-20 u-flex " v-if="item.userCouponId">
|
<view class="u-flex u-m-t-8">
|
||||||
<uni-tag :text=" productCouponDikou(item)"
|
<view class="u-m-r-20 u-font-24 u-flex" v-if="item.refundNum>0">
|
||||||
custom-style="background-color: #FFF0DF; border-color: #FFF0DF; color: #FF9F2E;">
|
<view class="color-666">退款金额:</view>
|
||||||
</uni-tag>
|
<view class="color-999 u-m-l-6">{{item.refundNum*item.unitPrice}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-m-r-20 u-flex" v-if="item.packNumber > 0">
|
<view class="u-m-r-20 u-font-24 u-flex" v-if="item.returnNum">
|
||||||
<uni-tag
|
<view class="color-666">退菜数量:</view>
|
||||||
custom-style="background-color: #E6F0FF; border-color: #E6F0FF; color: #318AFE;"
|
<view class="color-999 u-m-l-6">{{item.returnNum}}</view>
|
||||||
size="small" text="打包" inverted type="success" />
|
</view>
|
||||||
</view>
|
|
||||||
<view class="u-m-r-20 u-font-24 u-flex" v-if="item.returnAmount">
|
|
||||||
<view class="color-666">退款金额:</view>
|
|
||||||
<view class="color-999 u-m-l-6">{{item.unitPrice*item.refundNum}}</view>
|
|
||||||
</view>
|
|
||||||
<view class="u-m-r-20 u-font-24 u-flex" v-if="item.returnNum">
|
|
||||||
<view class="color-666">退菜数量:</view>
|
|
||||||
<view class="color-999 u-m-l-6">{{item.returnNum}}</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="color-999 u-font-24 u-m-t-8">{{item.skuName||''}}</view>
|
<view class="color-999 u-font-24 u-m-t-8">{{item.skuName||''}}</view>
|
||||||
|
|
||||||
|
|
@ -70,8 +79,9 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-text-right u-m-t-28">
|
<view class="u-text-right u-m-t-28">
|
||||||
<template v-if="item.refundNum>0">
|
<template v-if="item.refundNum>0||item.returnNum>0">
|
||||||
<view>¥{{(returnTotalMoney(item)-item.refundNum*item.unitPrice).toFixed(2)}}</view>
|
<!-- <view>¥{{mathFloorPrice( - mathFloorPrice(parseFloat(item.returnNum*item.unitPrice),item) - mathFloorPrice(parseFloat(item.refundNum*item.unitPrice),item))}}</view> -->
|
||||||
|
<view>¥{{mathFloorPrice( parseFloat(mathFloorPrice(item.num*item.unitPrice),item) - (parseFloat(mathFloorPrice(item.returnNum*item.unitPrice,item)) + parseFloat(mathFloorPrice(item.refundNum*item.unitPrice,item))))}}</view>
|
||||||
<view class="line-th color-666 ">¥{{returnTotalMoney(item)}}</view>
|
<view class="line-th color-666 ">¥{{returnTotalMoney(item)}}</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="item.userCouponId">
|
<template v-else-if="item.userCouponId">
|
||||||
|
|
@ -99,24 +109,29 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<template v-if="canTuicai(orderInfo,item)">
|
<template v-if="canTuicai(orderInfo,item)">
|
||||||
<view class="u-flex u-row-right gap-20 u-m-t-24" v-if="item.returnNum*item.returnAmount<item.payAmount">
|
<view class="u-flex u-row-right gap-20 u-m-t-24" v-if="item.returnNum*item.unitPrice<item.num*item.unitPrice">
|
||||||
<!-- <my-button :height="60" color="#333" plain type="cancel" shape="circle">更多操作</my-button> -->
|
|
||||||
<my-button :width="128" :height="48" plain shape="circle" @tap="tuicai(item,index)"><text
|
<my-button :width="128" :height="48" plain shape="circle" @tap="tuicai(item,index)"><text
|
||||||
class="no-wrap">退菜</text></my-button>
|
class="no-wrap">退菜</text></my-button>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="canTuiKuan(orderInfo,item)">
|
|
||||||
<view class="u-flex u-row-right gap-20 u-m-t-20">
|
|
||||||
<my-button :width="128" :height="48" plain shape="circle" @tap="tuikuan(item,index)"><text
|
|
||||||
class="no-wrap">{{item.userCouponId?'退券':'退款' }}</text> </my-button>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="u-m-t-32">
|
<view class="u-m-t-32">
|
||||||
|
<template v-if="seatFeePrice&&seatFeePrice>0">
|
||||||
|
<view class="u-flex u-row-between border-top u-p-t-32 u-p-b-32 u-col-top">
|
||||||
|
<view class="no-wrap u-m-r-32">桌位费</view>
|
||||||
|
<view>{{seatFeePrice||'0.00'}}</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<template v-if="allPpackFee&&allPpackFee>0">
|
||||||
|
<view class="u-flex u-row-between border-top u-p-t-32 u-p-b-32 u-col-top">
|
||||||
|
<view class="no-wrap u-m-r-32">打包费</view>
|
||||||
|
<view>{{allPpackFee||'0.00'}}</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
<view class="u-flex u-row-between border-top u-p-t-32">
|
<view class="u-flex u-row-between border-top u-p-t-32">
|
||||||
<view>
|
<view>
|
||||||
<template v-if="orderInfo.status=='unpaid'">
|
<template v-if="orderInfo.status=='unpaid'">
|
||||||
|
|
@ -136,6 +151,8 @@
|
||||||
<view class="color-red u-m-r-6 ">
|
<view class="color-red u-m-r-6 ">
|
||||||
已优惠¥{{youhuiAllPrice}}
|
已优惠¥{{youhuiAllPrice}}
|
||||||
</view>
|
</view>
|
||||||
|
<!-- <up-icon name="info-circle" color="#999" :size="14" @click="youhuiDetailShow"></up-icon> -->
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<!-- <view>
|
<!-- <view>
|
||||||
<text>小计¥</text>
|
<text>小计¥</text>
|
||||||
|
|
@ -149,7 +166,7 @@
|
||||||
<view class="u-flex u-row-between u-m-t-32">
|
<view class="u-flex u-row-between u-m-t-32">
|
||||||
<view>退款金额</view>
|
<view>退款金额</view>
|
||||||
<view class="color-999">
|
<view class="color-999">
|
||||||
<text class="">{{(orderInfo.refundAmount).toFixed(2)}}</text>
|
<text class="">{{mathFloorPrice(orderInfo.refundAmount)}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-row-between u-m-t-32">
|
<view class="u-flex u-row-between u-m-t-32">
|
||||||
|
|
@ -177,13 +194,13 @@
|
||||||
<template v-if="orderInfo.status=='unpaid'">
|
<template v-if="orderInfo.status=='unpaid'">
|
||||||
<view>
|
<view>
|
||||||
<text>总计¥</text>
|
<text>总计¥</text>
|
||||||
<text class="font-bold u-font-32">{{orderInfo.originAmount.toFixed(2)}}</text>
|
<text class="font-bold u-font-32">{{allPrice}}</text>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<view>
|
<view>
|
||||||
<text>总计¥</text>
|
<text>总计¥</text>
|
||||||
<text class="font-bold u-font-32">{{orderInfo.payAmount.toFixed(2)}}</text>
|
<text class="font-bold u-font-32">{{mathFloorPrice(orderInfo.payAmount)}}</text>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -240,22 +257,11 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import { computed, reactive } from 'vue';
|
||||||
computed,
|
|
||||||
reactive
|
|
||||||
} from 'vue';
|
|
||||||
import color from '@/commons/color.js'
|
import color from '@/commons/color.js'
|
||||||
import {
|
import { hasPermission } from '@/commons/utils/hasPermission.js'
|
||||||
hasPermission
|
import { isTui, isTuiCai, isGift, canTuiKuan, canTuicai, mathFloorPrice } from '@/commons/utils/goodsUtil.js'
|
||||||
} from '@/commons/utils/hasPermission.js'
|
|
||||||
import {
|
|
||||||
isTui,
|
|
||||||
isTuiCai,
|
|
||||||
isGift,
|
|
||||||
canTuiKuan,
|
|
||||||
canTuicai,
|
|
||||||
numSum
|
|
||||||
} from '@/commons/utils/goodsUtil.js'
|
|
||||||
const pop = reactive({
|
const pop = reactive({
|
||||||
youhui: false
|
youhui: false
|
||||||
})
|
})
|
||||||
|
|
@ -313,6 +319,7 @@
|
||||||
res.useType = props.orderInfo.useType
|
res.useType = props.orderInfo.useType
|
||||||
res.tableId = props.orderInfo.tableId
|
res.tableId = props.orderInfo.tableId
|
||||||
arr.push(res)
|
arr.push(res)
|
||||||
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|
@ -326,12 +333,10 @@
|
||||||
const goodsNumber = computed(() => {
|
const goodsNumber = computed(() => {
|
||||||
let result = 0
|
let result = 0
|
||||||
result = props.data.reduce((a, b) => {
|
result = props.data.reduce((a, b) => {
|
||||||
const bTotal = b.info.reduce((prve, cur) => {
|
const bTotal = b.info.length
|
||||||
return prve + (cur.number || cur.num) * 1;
|
|
||||||
}, 0);
|
|
||||||
return a + bTotal
|
return a + bTotal
|
||||||
}, 0)
|
}, 0)
|
||||||
return result
|
return result.toFixed(0)
|
||||||
})
|
})
|
||||||
function returnProductCoupPrice(item) {
|
function returnProductCoupPrice(item) {
|
||||||
if (!item.isMember) {
|
if (!item.isMember) {
|
||||||
|
|
@ -353,7 +358,6 @@
|
||||||
}, 0)
|
}, 0)
|
||||||
return prve + curTotal
|
return prve + curTotal
|
||||||
}, 0)
|
}, 0)
|
||||||
console.log(n);
|
|
||||||
return n.toFixed(2)
|
return n.toFixed(2)
|
||||||
})
|
})
|
||||||
const emits = defineEmits(['tuicai', 'tuikuan', 'printOrder'])
|
const emits = defineEmits(['tuicai', 'tuikuan', 'printOrder'])
|
||||||
|
|
@ -366,7 +370,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function returnTotalMoney(item) {
|
function returnTotalMoney(item) {
|
||||||
return (item.payAmount).toFixed(2)
|
return (Math.floor(item.num*item.unitPrice*100)/100).toFixed(2)
|
||||||
}
|
}
|
||||||
function returnCanTuiMoney(item) {
|
function returnCanTuiMoney(item) {
|
||||||
// if (props.orderInfo.status == 'unpaid') {
|
// if (props.orderInfo.status == 'unpaid') {
|
||||||
|
|
@ -377,7 +381,7 @@
|
||||||
} else if (item.price != item.unitPrice) {
|
} else if (item.price != item.unitPrice) {
|
||||||
return item.price*item.num
|
return item.price*item.num
|
||||||
} else {
|
} else {
|
||||||
return item.payAmount
|
return (Math.floor(item.num*item.unitPrice*100)/100).toFixed(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
@ -390,8 +394,6 @@
|
||||||
}, 0)
|
}, 0)
|
||||||
return prve + curTotal
|
return prve + curTotal
|
||||||
}, 0)
|
}, 0)
|
||||||
console.log(goodsTotal);
|
|
||||||
console.log(seatFeePrice.value);
|
|
||||||
return (goodsTotal + seatFeePrice.value * 1).toFixed(2)
|
return (goodsTotal + seatFeePrice.value * 1).toFixed(2)
|
||||||
})
|
})
|
||||||
const TuiKuanPrice = computed(() => {
|
const TuiKuanPrice = computed(() => {
|
||||||
|
|
@ -412,12 +414,7 @@
|
||||||
return prve + curTotal
|
return prve + curTotal
|
||||||
}, 0)
|
}, 0)
|
||||||
})
|
})
|
||||||
const cantuiSeatFee = computed(() => {
|
|
||||||
let seatFee = props.orderInfo.seatInfo ? (props.orderInfo.seatInfo.seatAmount) : 0
|
|
||||||
const bili = Math.floor((seatFee / canTuiKuanPrice.value) * 100) / 100
|
|
||||||
seatFee = Math.floor((props.orderInfo.amount - props.orderInfo.refundAmount) * bili * 100) / 100
|
|
||||||
return seatFee
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -435,18 +432,24 @@
|
||||||
function tuikuan(item, index) {
|
function tuikuan(item, index) {
|
||||||
hasPermission('允许退款').then(res => {
|
hasPermission('允许退款').then(res => {
|
||||||
if (res) {
|
if (res) {
|
||||||
|
console.log(item)
|
||||||
if (Array.isArray(item)) {
|
if (Array.isArray(item)) {
|
||||||
let arr = [];
|
let arr = [];
|
||||||
console.log(item)
|
|
||||||
item.map(v=>{
|
item.map(v=>{
|
||||||
v.info.map(obj=>{
|
let infoLit = JSON.parse(JSON.stringify(v.info))
|
||||||
obj.number = 0
|
infoLit.map((obj,i)=>{
|
||||||
|
obj.number = '0.00'
|
||||||
obj.skuName = obj.skuName || ''
|
obj.skuName = obj.skuName || ''
|
||||||
obj.priceAmount = obj.priceAmount ? obj.priceAmount : (obj.num*obj.unitPrice).toFixed(2)
|
|
||||||
obj.unitPrice = obj.unitPrice
|
obj.unitPrice = obj.unitPrice
|
||||||
|
obj.num = obj.num - obj.returnNum - obj.refundNum
|
||||||
|
obj.priceAmount = mathFloorPrice(obj.num*obj.unitPrice ,obj)
|
||||||
})
|
})
|
||||||
|
arr = [...arr,...infoLit]
|
||||||
arr = [...arr,...v.info]
|
})
|
||||||
|
arr.map((v,e)=>{
|
||||||
|
if( v.num <= 0){
|
||||||
|
// arr.splice(e, 1)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
emits('tuikuan', arr)
|
emits('tuikuan', arr)
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -464,30 +467,21 @@
|
||||||
emits('printOrder')
|
emits('printOrder')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 桌位费
|
||||||
|
*/
|
||||||
const seatFeePrice = computed(() => {
|
const seatFeePrice = computed(() => {
|
||||||
if (!props.seatFee.seatAmount) {
|
const n = props.orderInfo.seatNum > 0 ? props.orderInfo.seatNum*props.orderInfo.seatAmount : 0
|
||||||
return 0
|
|
||||||
}
|
|
||||||
const n = props.seatFee.seatAmount * (isTui(props.seatFee) ? 0 : 1)
|
|
||||||
return n.toFixed(2)
|
return n.toFixed(2)
|
||||||
})
|
})
|
||||||
|
|
||||||
const discountAmount = computed(() => {
|
const discountAmount = computed(() => {
|
||||||
if (props.orderInfo.discountAmount) {
|
if (props.orderInfo.discountAmount) {
|
||||||
return props.orderInfo.discountAmount
|
return props.orderInfo.discountAmount
|
||||||
}
|
}
|
||||||
return (props.orderInfo.originAmount * (1 - props.orderInfo.discountRatio))
|
return (props.orderInfo.originAmount * (1 - props.orderInfo.discountRatio))
|
||||||
})
|
})
|
||||||
const goodsOriginAllPrice = computed(() => {
|
|
||||||
const goodsPrice = props.data.reduce((prve, cur) => {
|
|
||||||
const curTotal = cur.info.reduce((a,
|
|
||||||
b) => {
|
|
||||||
return a + (b.num * b.price)
|
|
||||||
}, 0)
|
|
||||||
return prve + curTotal
|
|
||||||
}, 0)
|
|
||||||
return goodsPrice.toFixed(2)
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -518,70 +512,68 @@
|
||||||
return goodsPrice.toFixed(2)
|
return goodsPrice.toFixed(2)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 菜品金额
|
||||||
const productCoupPrice = computed(() => {
|
const productCoupPrice = computed(() => {
|
||||||
if (props.orderInfo.status == 'done') {
|
if (props.orderInfo.status == 'done') {
|
||||||
return props.orderInfo.productCouponDiscountAmount
|
return props.orderInfo.productCouponDiscountAmount
|
||||||
}
|
}
|
||||||
const goodsPrice = props.data.reduce((a, b) => {
|
const goodsPrice = props.data.reduce((a, b) => {
|
||||||
const curTotal = b.info.filter(v => !v.isGift && v.userCouponId).reduce((prve,
|
const curTotal = b.info.filter(v => !v.isGift).reduce((prve,
|
||||||
cur) => {
|
cur) => {
|
||||||
const isVip = props.user.isVip && cur.isMember
|
console.log(cur)
|
||||||
const memberPrice = cur.memberPrice ? cur.memberPrice : cur.price
|
let Total = Math.floor(cur.unitPrice * cur.num * 100) / 100
|
||||||
const price = isVip ? memberPrice : cur.price
|
return prve + Total - (cur.returnNum*cur.unitPrice) - (cur.refundNum*cur.unitPrice)
|
||||||
const curTotal = price * cur.num
|
|
||||||
return prve + curTotal
|
|
||||||
}, 0)
|
}, 0)
|
||||||
|
console.log("菜品金额111==",curTotal)
|
||||||
return a + curTotal
|
return a + curTotal
|
||||||
}, 0)
|
}, 0)
|
||||||
|
console.log("菜品金额==",goodsPrice)
|
||||||
return goodsPrice.toFixed(2)
|
return goodsPrice.toFixed(2)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
const allPpackFee = computed(() => {
|
||||||
|
//不是退菜只要有打包费的都计算,包括赠送
|
||||||
|
const goodsPrice = props.data.reduce((prve, cur) => {
|
||||||
|
const curTotal = cur.info.filter(v => v.packNumber > 0).reduce((a,
|
||||||
|
b) => {
|
||||||
|
return a + parseFloat(b.packAmount*b.packNumber).toFixed(2)*1
|
||||||
|
}, 0)
|
||||||
|
return prve + curTotal
|
||||||
|
}, 0)
|
||||||
|
return goodsPrice.toFixed(2)
|
||||||
|
})
|
||||||
|
|
||||||
|
const packFee = computed(() => {
|
||||||
|
//不是退菜只要有打包费的都计算,包括赠送
|
||||||
|
const goodsPrice = props.data.reduce((prve, cur) => {
|
||||||
|
const curTotal = cur.info.filter(v => v.status !== "return" && (v.returnNum+v.refundNum < v.num)).reduce((a,
|
||||||
|
b) => {
|
||||||
|
return a + parseFloat((b.packAmount*(b.num-(b.returnNum+b.refundNum)>b.packNumber?b.packNumber:b.num-(b.returnNum+b.refundNum))).toFixed(2))
|
||||||
|
}, 0)
|
||||||
|
return prve + curTotal
|
||||||
|
}, 0)
|
||||||
|
return goodsPrice.toFixed(2)
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
const allPrice = computed(() => {
|
||||||
|
let seatAmount = (props.orderInfo.seatNum * props.orderInfo.seatAmount) || 0
|
||||||
|
const total = productCoupPrice.value*1 + seatAmount*1 + packFee.value*1
|
||||||
|
console.log(seatAmount*1)
|
||||||
|
console.log(packFee.value*1)
|
||||||
|
console.log(total)
|
||||||
|
return (total <= 0 ? 0 : total).toFixed(2)
|
||||||
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 已优惠金额
|
* 已优惠金额
|
||||||
*/
|
*/
|
||||||
const youhuiAllPrice = computed(() => {
|
const youhuiAllPrice = computed(() => {
|
||||||
console.log(productCoupPrice)
|
const n = vipDiscountPrice.value * 1
|
||||||
const n = props.orderInfo.originAmount - props.orderInfo.orderAmount + vipDiscountPrice.value * 1
|
|
||||||
return (n < 0 ? 0 : n).toFixed(2)
|
return (n < 0 ? 0 : n).toFixed(2)
|
||||||
})
|
})
|
||||||
|
|
||||||
const packFee = computed(() => {
|
|
||||||
//不是退菜只要有打包费的都计算,包括赠送
|
|
||||||
const goodsPrice = props.data.reduce((prve, cur) => {
|
|
||||||
const curTotal = cur.info.filter(v => v.status !== "return").reduce((a,
|
|
||||||
b) => {
|
|
||||||
return a + b.packAmount
|
|
||||||
}, 0)
|
|
||||||
return prve + curTotal
|
|
||||||
}, 0)
|
|
||||||
return goodsPrice.toFixed(2)
|
|
||||||
|
|
||||||
})
|
|
||||||
const allPrice = computed(() => {
|
|
||||||
|
|
||||||
const goodsPrice = props.data.reduce((prve, cur) => {
|
|
||||||
const curTotal = cur.info.reduce((a,
|
|
||||||
b) => {
|
|
||||||
return a + (b.status == 'unpaid' ? b.payAmount : b.status == 'return' ? 0 : b
|
|
||||||
.payAmount * 1)
|
|
||||||
}, 0)
|
|
||||||
return prve + curTotal
|
|
||||||
}, 0)
|
|
||||||
return goodsPrice.toFixed(2)
|
|
||||||
|
|
||||||
if (props.orderInfo.status == 'unpaid') {
|
|
||||||
const n = goodsOriginAllPrice.value - youhuiAllPrice.value
|
|
||||||
return (n < 0 ? 0 : n).toFixed(2)
|
|
||||||
}
|
|
||||||
const returnAmount = props.orderInfo.seatInfo && props.orderInfo.seatInfo.seatAmount ? props.orderInfo
|
|
||||||
.seatInfo.seatAmount : 0
|
|
||||||
const canReturnAmount = props.orderInfo.seatInfo && props.orderInfo.seatInfo.canReturnAmount ? props
|
|
||||||
.orderInfo.seatInfo.canReturnAmount : 0
|
|
||||||
const total = props.orderInfo.amount - (seatAmount ? seatAmount : canReturnAmount)
|
|
||||||
return (total <= 0 ? 0 : total).toFixed(2)
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
|
|
@ -6,17 +6,16 @@
|
||||||
{{data.productName}}
|
{{data.productName}}
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-m-t-32" :class="{'gray':data.productId=='-999'}">
|
<view class="u-flex u-m-t-32" :class="{'gray':data.productId=='-999'}">
|
||||||
<up-number-box :min="0" :max="data.num" :buttonSize="44" v-model="number" integer
|
<up-number-box :min="0" :max="maxNum" :buttonSize="44" v-model="number" integer
|
||||||
:disabled="data.productId=='-999'">
|
:disabled="data.productId=='-999'">
|
||||||
<template #minus>
|
<template #minus>
|
||||||
<view class="minus number-box-btn">
|
<view class="minus number-box-btn"></view>
|
||||||
</view>
|
|
||||||
</template>
|
</template>
|
||||||
<template #input>
|
<template #input>
|
||||||
<view class="u-flex-1 u-row-center u-text-center input">
|
<view class="u-flex-1 u-row-center u-text-center input">
|
||||||
<up-input :disabled="data.productId=='-999'" @change="parseIntNumber($event,false)"
|
<up-input :disabled="data.productId=='-999'" @change="parseIntNumber($event,false)"
|
||||||
@blur="parseIntNumber($event,true)" v-model="number" border="none"
|
@blur="parseIntNumber($event,true)" v-model="number" border="none"
|
||||||
type="number"></up-input>
|
type="digit"></up-input>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<template #plus>
|
<template #plus>
|
||||||
|
|
@ -83,6 +82,8 @@
|
||||||
let model = ref(null)
|
let model = ref(null)
|
||||||
let modelShow = ref(props.show)
|
let modelShow = ref(props.show)
|
||||||
let number = ref(0)
|
let number = ref(0)
|
||||||
|
let maxNum = ref(0)
|
||||||
|
|
||||||
const tags = ref([{
|
const tags = ref([{
|
||||||
label: "点错",
|
label: "点错",
|
||||||
checked: false
|
checked: false
|
||||||
|
|
@ -110,16 +111,12 @@
|
||||||
})
|
})
|
||||||
|
|
||||||
function parseIntNumber(val, isNow) {
|
function parseIntNumber(val, isNow) {
|
||||||
|
console.log(val)
|
||||||
let newval = val * 1
|
let newval = val * 1
|
||||||
if (newval > props.data.num) {
|
if (newval > props.data.num - props.data.returnNum) {
|
||||||
newval = props.data.num
|
newval = props.data.num - props.data.returnNum
|
||||||
}
|
|
||||||
// 判断是否是称重商品。如果是可以输入小数
|
|
||||||
if (props.data.isWeight != 1) {
|
|
||||||
if (newval < 1) {
|
|
||||||
newval = 1
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNow) {
|
if (isNow) {
|
||||||
number.value = newval * 1
|
number.value = newval * 1
|
||||||
return
|
return
|
||||||
|
|
@ -149,9 +146,8 @@
|
||||||
|
|
||||||
function open() {
|
function open() {
|
||||||
model.value.open()
|
model.value.open()
|
||||||
if (props.data.productId == '-999') {
|
number.value = props.data.num - props.data.returnNum
|
||||||
number.value = props.data.num
|
maxNum.value = props.data.num - props.data.returnNum
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function close() {
|
function close() {
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@
|
||||||
*/
|
*/
|
||||||
async function getOrderDetail () {
|
async function getOrderDetail () {
|
||||||
let res = await getHistoryOrder({orderId: options.id})
|
let res = await getHistoryOrder({orderId: options.id})
|
||||||
console.log(res)
|
console.log("订单详情===",res)
|
||||||
if(res.userId){
|
if(res.userId){
|
||||||
shopUserDetail({userId:res.userId}).then(res=>{
|
shopUserDetail({userId:res.userId}).then(res=>{
|
||||||
if(res){
|
if(res){
|
||||||
|
|
@ -125,13 +125,12 @@
|
||||||
info: value,
|
info: value,
|
||||||
placeNum: key
|
placeNum: key
|
||||||
}))
|
}))
|
||||||
console.log("goodsList===",orderDetail.goodsList);
|
|
||||||
orderDetail.info = res
|
orderDetail.info = res
|
||||||
|
console.log("orderDetail===",orderDetail);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSeatFeeTuicai(seatFee) {
|
function onSeatFeeTuicai(seatFee) {
|
||||||
seatFee={...seatFee,num:seatFee.num,productName:seatFee.productName}
|
seatFee={...seatFee,num:seatFee.num,productName:seatFee.productName}
|
||||||
console.log(seatFee);
|
|
||||||
tuicai.show = true
|
tuicai.show = true
|
||||||
tuicai.isSeatFee = seatFee
|
tuicai.isSeatFee = seatFee
|
||||||
tuicai.selGoods = seatFee
|
tuicai.selGoods = seatFee
|
||||||
|
|
@ -143,7 +142,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onSeatFeeTuiKuan(seatFee) {
|
async function onSeatFeeTuiKuan(seatFee) {
|
||||||
console.log(seatFee,'调试1');
|
|
||||||
const canTuikuan=await hasTuiKuan()
|
const canTuikuan=await hasTuiKuan()
|
||||||
if(!canTuikuan){
|
if(!canTuikuan){
|
||||||
return
|
return
|
||||||
|
|
@ -177,10 +175,8 @@
|
||||||
tuicai.selGoods = goods
|
tuicai.selGoods = goods
|
||||||
}
|
}
|
||||||
async function tuicaiConfirm(e) {
|
async function tuicaiConfirm(e) {
|
||||||
console.log(e)
|
|
||||||
const res = await refundOrder(e)
|
const res = await refundOrder(e)
|
||||||
tuicai.show = false
|
tuicai.show = false
|
||||||
console.log(res)
|
|
||||||
if(res){
|
if(res){
|
||||||
go.back()
|
go.back()
|
||||||
}else{
|
}else{
|
||||||
|
|
@ -216,9 +212,9 @@
|
||||||
if(!canTuikuan){
|
if(!canTuikuan){
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
console.log(goods,'debug');
|
|
||||||
if (Array.isArray(goods)) {
|
if (Array.isArray(goods)) {
|
||||||
go.to('PAGES_ORDER_TUIKUAN', {
|
go.to('PAGES_ORDER_TUIKUAN', {
|
||||||
|
orderInfo: JSON.stringify(orderDetail.info),
|
||||||
goodsList:JSON.stringify(goods)
|
goodsList:JSON.stringify(goods)
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
@ -229,11 +225,10 @@
|
||||||
goods.unitPrice = goods.unitPrice
|
goods.unitPrice = goods.unitPrice
|
||||||
goods.userCouponId = goods.userCouponId ? goods.userCouponId:''
|
goods.userCouponId = goods.userCouponId ? goods.userCouponId:''
|
||||||
go.to('PAGES_ORDER_TUIKUAN', {
|
go.to('PAGES_ORDER_TUIKUAN', {
|
||||||
|
orderInfo: JSON.stringify(orderDetail.info),
|
||||||
goodsList:JSON.stringify([goods])
|
goodsList:JSON.stringify([goods])
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -280,7 +275,6 @@
|
||||||
function watchEmit() {
|
function watchEmit() {
|
||||||
uni.$off('orderDetail:update')
|
uni.$off('orderDetail:update')
|
||||||
uni.$once('orderDetail:update', (newval) => {
|
uni.$once('orderDetail:update', (newval) => {
|
||||||
console.log(newval);
|
|
||||||
getOrderDetail()
|
getOrderDetail()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
<view class="u-m-l-16">{{formatTime(data.createTime)}}</view>
|
<view class="u-m-l-16">{{formatTime(data.createTime)}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-m-t-32">
|
<view class="u-m-t-32">
|
||||||
<view class="u-font-32">{{goosZhonglei}}种商品,共{{goodsNumber}}件</view>
|
<view class="u-font-32">共{{data.goods.length}}件商品</view>
|
||||||
<view class="border-bottom u-p-b-32">
|
<view class="border-bottom u-p-b-32">
|
||||||
<view class="" v-for="(item,index) in data.goods" :key="index">
|
<view class="" v-for="(item,index) in data.goods" :key="index">
|
||||||
<view class="u-flex u-row-between u-col-top u-m-t-32" v-if="item.productId!=-999">
|
<view class="u-flex u-row-between u-col-top u-m-t-32" v-if="item.productId!=-999">
|
||||||
|
|
@ -38,8 +38,8 @@
|
||||||
{{item.skuName}}
|
{{item.skuName}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-flex-1 u-row-right">
|
<view class="u-flex u-flex-1 u-row-right" style="align-items: center;">
|
||||||
<view>×{{item.num}}</view>
|
<view style="margin-right: 10rpx;">×{{item.num}}</view>
|
||||||
<template v-if="item.userCouponId">
|
<template v-if="item.userCouponId">
|
||||||
<view class="u-text-right u-relative" :style="computedPriceStyle()">
|
<view class="u-text-right u-relative" :style="computedPriceStyle()">
|
||||||
<text class="line-th">¥{{item.payAmount}}</text>
|
<text class="line-th">¥{{item.payAmount}}</text>
|
||||||
|
|
@ -109,10 +109,11 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { computed, reactive, ref, watch } from 'vue';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import orderEnum from '@/commons/orderEnum.js'
|
import orderEnum from '@/commons/orderEnum.js'
|
||||||
import go from '@/commons/utils/go.js'
|
import go from '@/commons/utils/go.js'
|
||||||
import { computed, reactive, ref, watch } from 'vue';
|
import { mathFloorPrice } from '@/commons/utils/goodsUtil.js'
|
||||||
const emits = defineEmits(['printOrder'])
|
const emits = defineEmits(['printOrder'])
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
|
|
@ -140,16 +141,6 @@
|
||||||
const priceSize = 9
|
const priceSize = 9
|
||||||
let minWidth=ref(36)
|
let minWidth=ref(36)
|
||||||
|
|
||||||
/**
|
|
||||||
* 计算菜品价格
|
|
||||||
* @param {Object} item
|
|
||||||
*/
|
|
||||||
function goodsPriceAmount(item) {
|
|
||||||
const total=(item.payAmount * item.num).toFixed(2)
|
|
||||||
const minW=total.length * priceSize + 15
|
|
||||||
minWidth.value=minW<minWidth.value?minWidth.value:minW
|
|
||||||
return total
|
|
||||||
}
|
|
||||||
|
|
||||||
function computedPriceStyle() {
|
function computedPriceStyle() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -166,7 +157,6 @@
|
||||||
} else {
|
} else {
|
||||||
$goodsMap[goods.productId] = goods.num * 1
|
$goodsMap[goods.productId] = goods.num * 1
|
||||||
goosZhonglei.value += 1
|
goosZhonglei.value += 1
|
||||||
goodsNumber.value += goods.num * 1
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -251,11 +251,12 @@
|
||||||
returnProductCoupAllPrice,
|
returnProductCoupAllPrice,
|
||||||
returnProductCanUseNum
|
returnProductCanUseNum
|
||||||
} from '../quan_util.js'
|
} from '../quan_util.js'
|
||||||
|
import { mathFloorPrice } from '@/commons/utils/goodsUtil.js'
|
||||||
|
|
||||||
import { getCouponList } from '@/http/api/coupon.js'
|
import { getCouponList } from '@/http/api/coupon.js'
|
||||||
import { getHistoryOrder } from '@/http/api/order.js'
|
import { getHistoryOrder } from '@/http/api/order.js'
|
||||||
import { getPayTypeList } from '@/http/api/payType.js'
|
import { getPayTypeList } from '@/http/api/payType.js'
|
||||||
import { scanPay,microPay,cashPay,vipPay,creditPay,getOrderPayUrl } from '@/http/api/pay.js'
|
import { scanPay,microPay,cashPay,vipPay,creditPay,getOrderPayUrl,queryOrderStatus } from '@/http/api/pay.js'
|
||||||
import { shopUserDetail } from '@/http/api/shopUser.js'
|
import { shopUserDetail } from '@/http/api/shopUser.js'
|
||||||
import { calcUsablePoints,calcDeductionAmount,payedDeductPoints,consumeAwardPoints } from '@/http/api/points.js'
|
import { calcUsablePoints,calcDeductionAmount,payedDeductPoints,consumeAwardPoints } from '@/http/api/points.js'
|
||||||
|
|
||||||
|
|
@ -390,22 +391,45 @@
|
||||||
const packAmount = computed(() => {
|
const packAmount = computed(() => {
|
||||||
if(pageData.goodsList){
|
if(pageData.goodsList){
|
||||||
let price = pageData.goodsList.filter(v => v.packNumber > 0 && v.status !== "return").reduce((a, b) => {
|
let price = pageData.goodsList.filter(v => v.packNumber > 0 && v.status !== "return").reduce((a, b) => {
|
||||||
return a + (b.packNumber * b.packAmount)
|
console.log(b)
|
||||||
|
return a + ((b.packAmount||0)*b.packNumber).toFixed(2)*1
|
||||||
}, 0)
|
}, 0)
|
||||||
|
console.log(price)
|
||||||
return price
|
return price
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单金额
|
* 桌位费
|
||||||
|
*/
|
||||||
|
const tableFee = computed(() => {
|
||||||
|
return order.seatNum > 0 ? order.seatNum*order.seatAmount : 0
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 菜品金额
|
||||||
*/
|
*/
|
||||||
const originPrice = computed(() => {
|
const originPrice = computed(() => {
|
||||||
console.log("order===",order)
|
|
||||||
if(pageData.goodsList){
|
if(pageData.goodsList){
|
||||||
let goodsPrice = pageData.goodsList.filter(v => v.price != 0 && v.status !== "return").reduce((a, b) => {
|
let goodsPrice = pageData.goodsList.filter(v => v.price != 0 && v.status !== "return").reduce((a, b) => {
|
||||||
return a + (b.num * b.price)
|
return a + parseFloat(mathFloorPrice(b.num * b.unitPrice,b))
|
||||||
}, 0)
|
}, 0)
|
||||||
return (goodsPrice + (pageData.seatNum*uni.getStorageSync("shopInfo").tableFee||0) + packAmount.value).toFixed(2)
|
console.log("菜品原金额===",goodsPrice)
|
||||||
|
return (parseFloat(goodsPrice) + parseFloat(tableFee.value) + parseFloat(packAmount.value)).toFixed(2)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
const newOriginPrice = computed(() => {
|
||||||
|
if(pageData.goodsList){
|
||||||
|
let goodsPrice = pageData.goodsList.filter(v => v.price != 0 && v.status !== "return").reduce((a, b) => {
|
||||||
|
return a + parseFloat(mathFloorPrice(b.num * b.unitPrice,b) - mathFloorPrice(b.returnNum*b.unitPrice,b) - mathFloorPrice(b.refundNum*b.unitPrice,b))
|
||||||
|
}, 0)
|
||||||
|
console.log("减去退款退费的菜品金额===",goodsPrice)
|
||||||
|
console.log("桌位费===", tableFee.value)
|
||||||
|
return (goodsPrice + tableFee.value + packAmount.value).toFixed(2)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -468,7 +492,7 @@
|
||||||
* 支付金额
|
* 支付金额
|
||||||
*/
|
*/
|
||||||
const payPrice = computed(() => {
|
const payPrice = computed(() => {
|
||||||
console.log("originPrice===",originPrice.value)
|
console.log("originPrice===",newOriginPrice.value)
|
||||||
console.log("vipDiscount===",vipDiscount.value)
|
console.log("vipDiscount===",vipDiscount.value)
|
||||||
console.log("discountSaleAmount===",discountSaleAmount.value)
|
console.log("discountSaleAmount===",discountSaleAmount.value)
|
||||||
console.log("pointCanDicountPrice===",pointCanDicountPrice.value)
|
console.log("pointCanDicountPrice===",pointCanDicountPrice.value)
|
||||||
|
|
@ -476,7 +500,7 @@
|
||||||
console.log("discount===",discount.value)
|
console.log("discount===",discount.value)
|
||||||
console.log("fullCouponDiscountAmount===",fullCouponDiscountAmount.value)
|
console.log("fullCouponDiscountAmount===",fullCouponDiscountAmount.value)
|
||||||
console.log("accountPoints===",accountPoints)
|
console.log("accountPoints===",accountPoints)
|
||||||
let total = (originPrice.value*1) - discountSaleAmount.value - (vipDiscount.value*1) - productCouponDiscountAmount.value - discount
|
let total = (newOriginPrice.value*1) - discountSaleAmount.value - (vipDiscount.value*1) - productCouponDiscountAmount.value - discount
|
||||||
.value - fullCouponDiscountAmount.value - accountPoints.price * (accountPoints.sel ? 1 : 0)
|
.value - fullCouponDiscountAmount.value - accountPoints.price * (accountPoints.sel ? 1 : 0)
|
||||||
console.log("payPrice===",total)
|
console.log("payPrice===",total)
|
||||||
return (total < 0 ? 0 : total).toFixed(2)
|
return (total < 0 ? 0 : total).toFixed(2)
|
||||||
|
|
@ -486,13 +510,12 @@
|
||||||
* 积分使用前金额
|
* 积分使用前金额
|
||||||
*/
|
*/
|
||||||
const orderAmount = computed(() => {
|
const orderAmount = computed(() => {
|
||||||
let total = (originPrice.value*1) - discountSaleAmount.value - (vipDiscount.value*1) - productCouponDiscountAmount.value - discount
|
let total = (newOriginPrice.value*1) - discountSaleAmount.value - (vipDiscount.value*1) - productCouponDiscountAmount.value - discount
|
||||||
.value - fullCouponDiscountAmount.value
|
.value - fullCouponDiscountAmount.value
|
||||||
console.log(total)
|
console.log(total)
|
||||||
return (total < 0 ? 0 : total).toFixed(2)
|
return (total < 0 ? 0 : total).toFixed(2)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
watch(() => accountPoints.sel, (newval) => {
|
watch(() => accountPoints.sel, (newval) => {
|
||||||
if (newval) {
|
if (newval) {
|
||||||
calcDeDuctionPoints()
|
calcDeDuctionPoints()
|
||||||
|
|
@ -943,12 +966,27 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
let res;
|
||||||
|
let timer;
|
||||||
|
if( error.code == 211 && error.msg == '等待用户付款'){
|
||||||
|
uni.showLoading({
|
||||||
|
title: '支付中...'
|
||||||
|
})
|
||||||
|
timer = setInterval(async ()=>{
|
||||||
|
res = await queryOrderStatus({orderId: pars.orderId})
|
||||||
|
if ( res == 'done') {
|
||||||
|
clearInterval(timer)
|
||||||
|
uni.hideLoading()
|
||||||
|
paySuccess()
|
||||||
|
}
|
||||||
|
console.log(res)
|
||||||
|
},1000)
|
||||||
|
}
|
||||||
payStatus = '';
|
payStatus = '';
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
paySuccess()
|
paySuccess()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -959,13 +997,14 @@
|
||||||
infoBox.showToast('支付成功')
|
infoBox.showToast('支付成功')
|
||||||
payStatus = 'success'
|
payStatus = 'success'
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
uni.removeStorageSync("table_code")
|
||||||
// uni.$emit('orderDetail:update')
|
// uni.$emit('orderDetail:update')
|
||||||
uni.$emit('get:table')
|
uni.$emit('get:table')
|
||||||
uni.$emit('update:orderDetail')
|
uni.$emit('update:orderDetail')
|
||||||
uni.navigateBack({
|
uni.navigateBack({
|
||||||
delta: 1
|
delta: 1
|
||||||
})
|
})
|
||||||
}, 500)
|
}, 1500)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@ export function returnProductCouponPrice(coup, goodsArr, vipUser) {
|
||||||
return price * coup.num
|
return price * coup.num
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//返回新的商品列表,过滤掉退菜的,退单的商品
|
//返回新的商品列表,过滤掉退菜的,退单的商品
|
||||||
export function returnNewGoodsList(arr) {
|
export function returnNewGoodsList(arr) {
|
||||||
let goods_list = []
|
let goods_list = []
|
||||||
|
|
@ -44,7 +46,6 @@ export function returnCoupCanUse(goodsArr = [], coup, selCoupArr = []) {
|
||||||
if (selCoupNumber >= findGoodsTotalNumber) {
|
if (selCoupNumber >= findGoodsTotalNumber) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
console.log(selCoupNumber,findGoodsTotalNumber);
|
|
||||||
return findGoodsTotalNumber < selCoupNumber ? false : true
|
return findGoodsTotalNumber < selCoupNumber ? false : true
|
||||||
}
|
}
|
||||||
//查找购物车商品根据购物车商品数据返回商品券信息(抵扣价格以及是否满足可用需求)
|
//查找购物车商品根据购物车商品数据返回商品券信息(抵扣价格以及是否满足可用需求)
|
||||||
|
|
@ -61,7 +62,6 @@ export function returnProductCoupon(coup, goodsArr, vipUser, selCoupArr = []) {
|
||||||
const memberPrice = item.memberPrice ? item.memberPrice : item.price;
|
const memberPrice = item.memberPrice ? item.memberPrice : item.price;
|
||||||
const price = item ? (isUseVipPrice(vipUser,item) ? memberPrice : item.price) : 0;
|
const price = item ? (isUseVipPrice(vipUser,item) ? memberPrice : item.price) : 0;
|
||||||
const discountAmount = (price * coup.num).toFixed(2)
|
const discountAmount = (price * coup.num).toFixed(2)
|
||||||
console.log(discountAmount);
|
|
||||||
|
|
||||||
// const canUse = !coup.use ? false : (discountAmount > 0 && returnCoupCanUse(goodsArr, coup, selCoupArr))
|
// const canUse = !coup.use ? false : (discountAmount > 0 && returnCoupCanUse(goodsArr, coup, selCoupArr))
|
||||||
// const canUse=discountAmount>0
|
// const canUse=discountAmount>0
|
||||||
|
|
@ -96,7 +96,6 @@ export function returnProductPayPrice(goods,vipUser){
|
||||||
}
|
}
|
||||||
//返回商品券抵扣的商品价格
|
//返回商品券抵扣的商品价格
|
||||||
export function returnProductCoupAllPrice(productPriceArr,startIndex,num,isMember=true){
|
export function returnProductCoupAllPrice(productPriceArr,startIndex,num,isMember=true){
|
||||||
console.log(productPriceArr);
|
|
||||||
return productPriceArr.slice(startIndex,startIndex+num).reduce((prve,cur)=>{
|
return productPriceArr.slice(startIndex,startIndex+num).reduce((prve,cur)=>{
|
||||||
let curPrice=0
|
let curPrice=0
|
||||||
if(typeof cur==='object'){
|
if(typeof cur==='object'){
|
||||||
|
|
@ -110,13 +109,10 @@ export function returnProductCoupAllPrice(productPriceArr,startIndex,num,isMembe
|
||||||
|
|
||||||
//返回商品券可抵扣的商品数量
|
//返回商品券可抵扣的商品数量
|
||||||
export function returnProductCanUseNum(productPriceArr,startIndex,num){
|
export function returnProductCanUseNum(productPriceArr,startIndex,num){
|
||||||
console.log(productPriceArr);
|
|
||||||
console.log(num);
|
|
||||||
let n=0;
|
let n=0;
|
||||||
for(let i=0;i<num;i++){
|
for(let i=0;i<num;i++){
|
||||||
if(productPriceArr[startIndex*1+i]){
|
if(productPriceArr[startIndex*1+i]){
|
||||||
n+=1
|
n+=1
|
||||||
console.log(n);
|
|
||||||
}else{
|
}else{
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
@ -136,12 +132,10 @@ export function returnGoodsPayPriceMap(goodsArr){
|
||||||
Object.values(goodsArr).forEach(item=>{
|
Object.values(goodsArr).forEach(item=>{
|
||||||
goods_arr = [...goods_arr,...Object.values(item)]
|
goods_arr = [...goods_arr,...Object.values(item)]
|
||||||
})
|
})
|
||||||
console.log(goods_arr)
|
|
||||||
return goods_arr.reduce((prve,cur)=>{
|
return goods_arr.reduce((prve,cur)=>{
|
||||||
if(!prve.hasOwnProperty(cur.productId)){
|
if(!prve.hasOwnProperty(cur.productId)){
|
||||||
prve[cur.productId]=[]
|
prve[cur.productId]=[]
|
||||||
}
|
}
|
||||||
console.log(Math.ceil(cur.num))
|
|
||||||
let arr = new Array(Math.ceil(cur.num)).fill(cur).map(v=>{
|
let arr = new Array(Math.ceil(cur.num)).fill(cur).map(v=>{
|
||||||
return {
|
return {
|
||||||
memberPrice:v.memberPrice?v.memberPrice:v.price,
|
memberPrice:v.memberPrice?v.memberPrice:v.price,
|
||||||
|
|
@ -149,7 +143,6 @@ export function returnGoodsPayPriceMap(goodsArr){
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
prve[cur.productId].push(...arr)
|
prve[cur.productId].push(...arr)
|
||||||
console.log(prve)
|
|
||||||
return prve
|
return prve
|
||||||
},{})
|
},{})
|
||||||
|
|
||||||
|
|
@ -167,7 +160,6 @@ export function returnProductCouponAllPrice(coupArr, goodsArr, vipUser) {
|
||||||
let coupMap={}
|
let coupMap={}
|
||||||
for(let i in coupArr){
|
for(let i in coupArr){
|
||||||
const coup=coupArr[i]
|
const coup=coupArr[i]
|
||||||
console.log(coup)
|
|
||||||
if(coupMap.hasOwnProperty(coup.proId)){
|
if(coupMap.hasOwnProperty(coup.proId)){
|
||||||
coupMap[coup.proId].push(coup)
|
coupMap[coup.proId].push(coup)
|
||||||
}else{
|
}else{
|
||||||
|
|
@ -192,15 +184,12 @@ export function returnProductCouponAllPrice(coupArr, goodsArr, vipUser) {
|
||||||
})
|
})
|
||||||
goodsPayPriceMap[coup.proId]=goodsMap[coup.proId].reduce((prve,cur)=>{
|
goodsPayPriceMap[coup.proId]=goodsMap[coup.proId].reduce((prve,cur)=>{
|
||||||
const arr=new Array(cur.number).fill(cur.payPrice)
|
const arr=new Array(cur.number).fill(cur.payPrice)
|
||||||
console.log(arr);
|
|
||||||
prve.push(...arr)
|
prve.push(...arr)
|
||||||
return prve
|
return prve
|
||||||
},[])
|
},[])
|
||||||
}
|
}
|
||||||
const proCoupStartIndex=returnProCoupStartIndex(arr,i)
|
const proCoupStartIndex=returnProCoupStartIndex(arr,i)
|
||||||
console.log(coup);
|
|
||||||
const coupNum = Math.min(goodsPayPriceMap[coup.proId].length,coup.number)
|
const coupNum = Math.min(goodsPayPriceMap[coup.proId].length,coup.number)
|
||||||
console.log(coupNum);
|
|
||||||
total+=returnProductCoupAllPrice(goodsPayPriceMap[coup.proId],proCoupStartIndex,coupNum)
|
total+=returnProductCoupAllPrice(goodsPayPriceMap[coup.proId],proCoupStartIndex,coupNum)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,23 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="min-page bg-gray u-p-30">
|
<view class="min-page bg-gray u-p-30">
|
||||||
<view class="bg-fff u-p-24 border-r-12 u-flex u-row-between">
|
<view class="bg-fff u-p-l-30 u-p-r-30 ">
|
||||||
<view>全退</view>
|
<view class="myTabs u-m-t-20">
|
||||||
<view>
|
<my-tabs :list="pageData.tabsList" :modelValue="pageData.tabsIndex" :textKey="'label'" @change="tabsChange"></my-tabs>
|
||||||
<my-radio v-model="allTui" :disabled="option.productId=='-999'"></my-radio>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<view v-if="pageData.tabsIndex == 2" class="bg-fff u-p-24 border-r-12 u-flex u-row-between" style="margin-top: 30rpx;">
|
||||||
|
<up-input type="digit" placeholder="请输入退款金额" @change="parseIntNumber($event)" border="surround" v-model="pageData.modify" >
|
||||||
|
<template #prefix>
|
||||||
|
<up-text text="¥" margin="0 3px 0 0" type="tips" ></up-text>
|
||||||
|
</template>
|
||||||
|
</up-input>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-m-t-24 u-font-24 u-font-24">
|
<view class="u-m-t-24 u-font-24 u-font-24">
|
||||||
<text class="color-red">*</text>
|
<text class="color-red">*</text>
|
||||||
<text>客座费只能全退</text>
|
<text>客座费只能全退</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="bg-fff border-r-12 list u-m-t-32">
|
<view v-if="pageData.tabsIndex != 2" class="bg-fff border-r-12 list u-m-t-32">
|
||||||
<view class="u-flex u-row-between border-top item u-p-t-32 u-p-b-32"
|
<view class="u-flex u-row-between border-top item u-p-t-32 u-p-b-32"
|
||||||
v-for="(item,index) in orderDetail.goodsList" :key="index">
|
v-for="(item,index) in orderDetail.goodsList" :key="index">
|
||||||
<view>
|
<view>
|
||||||
|
|
@ -43,23 +50,30 @@
|
||||||
<view class="bg-fff u-m-t-32 u-p-24 border-r-12 u-flex u-row-between" >
|
<view class="bg-fff u-m-t-32 u-p-24 border-r-12 u-flex u-row-between" >
|
||||||
<view>支付金额</view>
|
<view>支付金额</view>
|
||||||
<view>
|
<view>
|
||||||
{{to2(totalPrice)}}元
|
{{to2(orderDetail.info.payAmount)}}元
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="bg-fff u-m-t-32 u-p-24 border-r-12 u-flex u-row-between" >
|
||||||
|
<view>剩余可退金额</view>
|
||||||
|
<view class="color-red">
|
||||||
|
{{to2(orderDetail.info.payAmount - orderDetail.info.refundAmount)}}元
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="bg-fff u-m-t-32 u-p-24 border-r-12 u-flex u-row-between" >
|
<view class="bg-fff u-m-t-32 u-p-24 border-r-12 u-flex u-row-between" >
|
||||||
<view>退款金额</view>
|
<view>退款金额</view>
|
||||||
<view class="color-red">
|
<view class="color-red">
|
||||||
{{to2(tuikuanPrice)}}元
|
{{to2(pageData.tabsIndex == 1 ? alltuikuanPrice : (pageData.tabsIndex == 2 ? pageData.modify : tuikuanPrice))}}元
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<view class="bg-fff u-p-24 border-r-12 u-m-t-32">
|
<!-- <view class="bg-fff u-p-24 border-r-12 u-m-t-32">
|
||||||
<view>退回优惠券</view>
|
<view>退回优惠券</view>
|
||||||
<view class="u-font-24 color-999 u-m-t-16" v-if="!option.userCouponId">
|
<view class="u-font-24 color-999 u-m-t-16" v-if="!option.userCouponId">
|
||||||
该订单未使用优惠券
|
该订单未使用优惠券
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
|
|
||||||
<view class="bg-fff u-p-24 border-r-12 u-m-t-32">
|
<view class="bg-fff u-p-24 border-r-12 u-m-t-32">
|
||||||
<view>
|
<view>
|
||||||
<text class="color-red">*</text>
|
<text class="color-red">*</text>
|
||||||
|
|
@ -92,36 +106,25 @@
|
||||||
import infoBox from '@/commons/utils/infoBox.js';
|
import infoBox from '@/commons/utils/infoBox.js';
|
||||||
import {hasPermission} from '@/commons/utils/hasPermission.js'
|
import {hasPermission} from '@/commons/utils/hasPermission.js'
|
||||||
import { refundOrder } from '@/http/api/order.js'
|
import { refundOrder } from '@/http/api/order.js'
|
||||||
|
import { mathFloorPrice } from '@/commons/utils/goodsUtil.js'
|
||||||
let allTui = ref(false)
|
|
||||||
let note = ref('')
|
let note = ref('')
|
||||||
const tuikuan = reactive({
|
const tuikuan = reactive({
|
||||||
list: ['点错', '数量点错', '客人要求', '协商退费'],
|
list: ['点错', '数量点错', '客人要求', '协商退费'],
|
||||||
sel: -1
|
sel: -1
|
||||||
})
|
})
|
||||||
|
const pageData = reactive({
|
||||||
|
tabsList: [
|
||||||
|
{label: '部分退款', value: 0},
|
||||||
|
{label: '全部退款', value: 1},
|
||||||
|
{label: '自定义退款', value: 2},
|
||||||
|
],
|
||||||
|
tabsIndex: 0,
|
||||||
|
modify: '',
|
||||||
|
})
|
||||||
|
|
||||||
const option=reactive({
|
const option=reactive({
|
||||||
productId:'-999'
|
productId:'-999'
|
||||||
})
|
})
|
||||||
onLoad((opt) => {
|
|
||||||
console.log(JSON.parse(opt.goodsList));
|
|
||||||
|
|
||||||
orderDetail.goodsList = JSON.parse(opt.goodsList)
|
|
||||||
option.productId = orderDetail.goodsList[0].productId
|
|
||||||
option.orderId = orderDetail.goodsList[0].orderId
|
|
||||||
if(option.productId=='-999'){
|
|
||||||
allTui.value=true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
watch(() => allTui.value, (newval) => {
|
|
||||||
orderDetail.goodsList.map(v => {
|
|
||||||
v.number = newval ? v.num : 0
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
function changeTuiKuanSel(i) {
|
|
||||||
tuikuan.sel = i
|
|
||||||
}
|
|
||||||
const orderDetail = reactive({
|
const orderDetail = reactive({
|
||||||
goodsList: [],
|
goodsList: [],
|
||||||
info: {},
|
info: {},
|
||||||
|
|
@ -129,53 +132,120 @@
|
||||||
totalAmount: 0
|
totalAmount: 0
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
onLoad((opt) => {
|
||||||
|
orderDetail.info = JSON.parse(opt.orderInfo)
|
||||||
|
orderDetail.goodsList = JSON.parse(opt.goodsList)
|
||||||
|
console.log(orderDetail)
|
||||||
|
option.productId = orderDetail.goodsList[0].productId
|
||||||
|
option.orderId = orderDetail.goodsList[0].orderId
|
||||||
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* tabs切换
|
||||||
|
* @param {Object} i
|
||||||
|
*/
|
||||||
|
function tabsChange(i) {
|
||||||
|
pageData.tabsIndex = pageData.tabsList[i].value
|
||||||
|
if( pageData.tabsIndex == 0){ // 部分退款
|
||||||
|
orderDetail.goodsList.map(v => {
|
||||||
|
v.number = '0.00'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if( pageData.tabsIndex == 1){ // 全部退款
|
||||||
|
orderDetail.goodsList.map(v => {
|
||||||
|
v.number = v.num.toFixed(2)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if( pageData.tabsIndex == 2){ // 自定义退款
|
||||||
|
orderDetail.goodsList.map(v => {
|
||||||
|
v.number = '0.00'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function changeTuiKuanSel(i) {
|
||||||
|
tuikuan.sel = i
|
||||||
|
}
|
||||||
|
function parseIntNumber (e) {
|
||||||
|
if ( e > (orderDetail.info.payAmount - orderDetail.info.refundAmount) ) {
|
||||||
|
setTimeout(()=>{
|
||||||
|
pageData.modify = (orderDetail.info.payAmount - orderDetail.info.refundAmount).toFixed(2)
|
||||||
|
},100)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 菜品总数量
|
||||||
|
*/
|
||||||
const totalNumber = computed(() => {
|
const totalNumber = computed(() => {
|
||||||
return orderDetail.goodsList.reduce((prve, cur) => {
|
return orderDetail.goodsList.reduce((prve, cur) => {
|
||||||
return prve + cur.num * 1
|
return prve + cur.num * 1
|
||||||
}, 0)
|
}, 0)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款菜品总数量
|
||||||
|
*/
|
||||||
const tuikuanNumber = computed(() => {
|
const tuikuanNumber = computed(() => {
|
||||||
return orderDetail.goodsList.reduce((prve, cur) => {
|
return orderDetail.goodsList.reduce((prve, cur) => {
|
||||||
return prve + cur.number * 1
|
return prve + cur.number * 1
|
||||||
}, 0)
|
}, 0)
|
||||||
})
|
})
|
||||||
|
|
||||||
const totalPrice = computed(() => {
|
/**
|
||||||
return orderDetail.goodsList.reduce((prve, cur) => {
|
* 退款总金额
|
||||||
return prve + cur.priceAmount * 1
|
*/
|
||||||
}, 0)
|
|
||||||
})
|
|
||||||
const tuikuanPrice = computed(() => {
|
const tuikuanPrice = computed(() => {
|
||||||
return orderDetail.goodsList.reduce((prve, cur) => {
|
return orderDetail.goodsList.reduce((prve, cur) => {
|
||||||
const n=(cur.number/cur.num*100) * cur.priceAmount
|
const n= mathFloorPrice(cur.number * cur.unitPrice,cur)
|
||||||
console.log(n)
|
return (parseFloat(prve) + parseFloat(n)).toFixed(2)
|
||||||
console.log((n/100).toFixed(2))
|
|
||||||
console.log(parseFloat(prve) + parseFloat((n/100).toFixed(2)))
|
|
||||||
return parseFloat(prve) + parseFloat((n/100).toFixed(2))
|
|
||||||
}, 0)
|
}, 0)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 剩余退款金额
|
||||||
|
*/
|
||||||
|
const surplusRefundPrice = computed(() => {
|
||||||
|
return orderDetail.info.payAmount - orderDetail.goodsList.reduce((prve, cur) => {
|
||||||
|
const n = parseFloat( mathFloorPrice(cur.refundNum * cur.unitPrice,cur))
|
||||||
|
return (parseFloat(prve) + parseFloat(n)).toFixed(2)*1
|
||||||
|
}, 0)
|
||||||
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款总金额
|
||||||
|
*/
|
||||||
|
const alltuikuanPrice = computed(() => {
|
||||||
|
return orderDetail.info.payAmount - orderDetail.goodsList.reduce((prve, cur) => {
|
||||||
|
const n = parseFloat( mathFloorPrice(cur.refundNum * cur.unitPrice,cur))
|
||||||
|
return (parseFloat(prve) + parseFloat(n)).toFixed(2)*1
|
||||||
|
}, 0)
|
||||||
|
})
|
||||||
|
|
||||||
function to2(n) {
|
function to2(n) {
|
||||||
return Number(n).toFixed(2);
|
return Number(n).toFixed(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeItem(item, step) {
|
function changeItem(item, step) {
|
||||||
|
if( item.num <= 0){
|
||||||
|
return
|
||||||
|
}
|
||||||
if(item.productId=='-999'){
|
if(item.productId=='-999'){
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
console.log(item);
|
if( pageData.tabsIndex != 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
let newval = item.number * 1 + step * 1;
|
let newval = item.number * 1 + step * 1;
|
||||||
if (newval <= 0) {
|
if (newval <= 0) {
|
||||||
newval = 0;
|
newval = 0;
|
||||||
}
|
}
|
||||||
if (newval >= (item.num-(item.refundNum>0?item.refundNum:0))) {
|
if (newval >= (item.num)) {
|
||||||
newval = (item.num-(item.refundNum>0?item.refundNum:0));
|
newval = item.num
|
||||||
}
|
}
|
||||||
item.number = newval;
|
console.log(totalNumber.value)
|
||||||
allTui.value = totalNumber.value == tuikuanNumber.value ? true : false;
|
console.log(tuikuanNumber.value)
|
||||||
|
item.number = newval.toFixed(2);
|
||||||
|
pageData.tabsIndex = totalNumber.value == tuikuanNumber.value ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -186,20 +256,18 @@
|
||||||
if(!canTuikuan){
|
if(!canTuikuan){
|
||||||
return infoBox.showToast('您没有退款权限')
|
return infoBox.showToast('您没有退款权限')
|
||||||
}
|
}
|
||||||
if (tuikuanNumber.value <= 0) {
|
if (pageData.tabsIndex != 2&&tuikuanNumber.value <= 0) {
|
||||||
return infoBox.showToast('退款商品数量不能为0!')
|
return infoBox.showToast('退款商品数量不能为0!')
|
||||||
}
|
}
|
||||||
|
|
||||||
const selTag=tuikuan.list[tuikuan.sel]
|
const selTag=tuikuan.list[tuikuan.sel]
|
||||||
const noteResult=`${selTag?selTag:''}${note.value?(','+note.value):''}`
|
const noteResult=`${selTag?selTag:''}${note.value?(','+note.value):''}`
|
||||||
if (!noteResult) {
|
if (!noteResult) {
|
||||||
return infoBox.showToast('请输入或选择退款原因!')
|
return infoBox.showToast('请输入或选择退款原因!')
|
||||||
}
|
}
|
||||||
let refundAmount = orderDetail.goodsList.reduce((prve, cur) => {
|
|
||||||
return prve + (cur.number * 1 * cur.unitPrice)
|
|
||||||
}, 0)
|
|
||||||
let params = {
|
let params = {
|
||||||
orderId: option.orderId,
|
orderId: option.orderId,
|
||||||
refundAmount: refundAmount.toFixed(2),
|
|
||||||
refundReason: noteResult,
|
refundReason: noteResult,
|
||||||
refundDetails: orderDetail.goodsList.filter(v=>v.number*1).map(v=>{
|
refundDetails: orderDetail.goodsList.filter(v=>v.number*1).map(v=>{
|
||||||
return {
|
return {
|
||||||
|
|
@ -209,6 +277,16 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if( pageData.tabsIndex == 2){
|
||||||
|
params.modify = true
|
||||||
|
params.refundAmount = (pageData.modify*1).toFixed(2)
|
||||||
|
} else {
|
||||||
|
params.modify = false
|
||||||
|
params.refundAmount = pageData.tabsIndex == 1 ? alltuikuanPrice.value : tuikuanPrice.value
|
||||||
|
}
|
||||||
|
if ( pageData.tabsIndex == 2 && params.refundAmount > orderDetail.info.payAmount){
|
||||||
|
return infoBox.showToast('退款金额不能大于付款金额!')
|
||||||
|
}
|
||||||
await refundOrder(params)
|
await refundOrder(params)
|
||||||
infoBox.showToast('退款请求提交成功')
|
infoBox.showToast('退款请求提交成功')
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue