合并代码
This commit is contained in:
27
commons/utils/goodsUtil.js
Normal file
27
commons/utils/goodsUtil.js
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
export function canComputedPackFee(v) {
|
||||||
|
return v.pack && v.status != 'return' && v.status != 'refund' && v.status != 'refunding'
|
||||||
|
}
|
||||||
|
export function returnCanComputedGoodsArr(arr) {
|
||||||
|
return arr.filter(v=>canComputedPackFee(v))
|
||||||
|
}
|
||||||
|
export function returnPackFee(arr) {
|
||||||
|
return arr.reduce((prve, cur) => {
|
||||||
|
return prve + cur.packAmount
|
||||||
|
}, 0).toFixed(2)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function canTuicai(orderInfo,item){
|
||||||
|
return orderInfo.status=='unpaid'&&orderInfo.useType!='dine-in-before'&& item.status!='return'
|
||||||
|
}
|
||||||
|
export function canTuiKuan(orderInfo,item){
|
||||||
|
return orderInfo.status!='unpaid'&& item.status!='return'&&item.status!='refund'&&item.status!='refunding'
|
||||||
|
}
|
||||||
|
export function isTui(item){
|
||||||
|
return item.status=='return'||item.status=='refund'||item.status=='refunding'
|
||||||
|
}
|
||||||
|
export function numSum(arr){
|
||||||
|
const sum=arr.reduce((a,b)=>{
|
||||||
|
return a+b*100
|
||||||
|
},0)
|
||||||
|
return (sum/100).toFixed(2)
|
||||||
|
}
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
<view class="u-m-t-40 u-flex ">
|
<view class="u-m-t-40 u-flex ">
|
||||||
<view>实收金额</view>
|
<view>实收金额</view>
|
||||||
<view class="u-m-l-32 border u-p-l-10 u-p-r-10 u-flex-1">
|
<view class="u-m-l-32 border u-p-l-10 u-p-r-10 u-flex-1">
|
||||||
<uni-easyinput style="digit" @input="currentPriceInput" @change="currentPriceChange" paddingNone :inputBorder="false"
|
<uni-easyinput type="number" @input="currentPriceInput" @change="currentPriceChange" paddingNone :inputBorder="false"
|
||||||
v-model="form.currentPrice"
|
v-model="form.currentPrice"
|
||||||
placeholder="输入实际金额"></uni-easyinput>
|
placeholder="输入实际金额"></uni-easyinput>
|
||||||
</view>
|
</view>
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
<view>优惠折扣</view>
|
<view>优惠折扣</view>
|
||||||
<view class="u-m-l-32 u-flex-1 u-flex border u-p-l-10 u-p-r-10">
|
<view class="u-m-l-32 u-flex-1 u-flex border u-p-l-10 u-p-r-10">
|
||||||
<view class="u-flex-1">
|
<view class="u-flex-1">
|
||||||
<uni-easyinput @input="discountInput" @change="discountChange" style="digit" paddingNone :inputBorder="false"
|
<uni-easyinput type="number" @input="discountInput" @change="discountChange" paddingNone :inputBorder="false"
|
||||||
v-model="form.discount"
|
v-model="form.discount"
|
||||||
placeholder="输入折扣"></uni-easyinput>
|
placeholder="输入折扣"></uni-easyinput>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -17,13 +17,13 @@ import infoBox from "@/commons/utils/infoBox.js"
|
|||||||
import go from '@/commons/utils/go.js';
|
import go from '@/commons/utils/go.js';
|
||||||
import { reject } from 'lodash';
|
import { reject } from 'lodash';
|
||||||
// 测试服
|
// 测试服
|
||||||
let baseUrl = 'https://admintestpapi.sxczgkj.cn'
|
// let baseUrl = 'https://admintestpapi.sxczgkj.cn'
|
||||||
|
|
||||||
//预发布
|
//预发布
|
||||||
// let baseUrl = 'https://pre-cashieradmin.sxczgkj.cn'
|
// let baseUrl = 'https://pre-cashieradmin.sxczgkj.cn'
|
||||||
|
|
||||||
//正式
|
//正式
|
||||||
// let baseUrl = 'https://cashieradmin.sxczgkj.cn'
|
let baseUrl = 'https://cashieradmin.sxczgkj.cn'
|
||||||
|
|
||||||
// 王伟本地测
|
// 王伟本地测
|
||||||
// let baseUrl = '/ww'
|
// let baseUrl = '/ww'
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ onShow(() => {
|
|||||||
|
|
||||||
const saveImage = () => {
|
const saveImage = () => {
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
saveQrcodeImg()
|
|
||||||
uni.downloadFile({
|
uni.downloadFile({
|
||||||
url: vdata.QrcodeUrl,
|
url: vdata.QrcodeUrl,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
@@ -92,16 +91,6 @@ function downloadQR() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//#endif
|
//#endif
|
||||||
const saveQrcodeImg = () => {
|
|
||||||
saveHeadImgFile(vdata.QrcodeUrl, 80)
|
|
||||||
.then((success) => {
|
|
||||||
infoBox.showSuccessToast('保存成功')
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
console.log(err)
|
|
||||||
infoBox.showErrorToast('保存失败')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const saveWxQrcodeImg = (data) => {
|
const saveWxQrcodeImg = (data) => {
|
||||||
const fileManager = wx.getFileSystemManager()
|
const fileManager = wx.getFileSystemManager()
|
||||||
|
|||||||
@@ -298,9 +298,11 @@
|
|||||||
const isSku = computed(() => {
|
const isSku = computed(() => {
|
||||||
return props.goods.typeEnum == 'sku'
|
return props.goods.typeEnum == 'sku'
|
||||||
})
|
})
|
||||||
let isBindGuige = ref(isSku.value)
|
let isBindGuige = ref(false)
|
||||||
watch(() => props.goods.typeEnum, (newval) => {
|
watch(() => props.goods.typeEnum, (newval) => {
|
||||||
isBindGuige.value = isSku.value
|
if(!newval){
|
||||||
|
isBindGuige.value = false
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@@ -385,7 +387,6 @@
|
|||||||
$haocaiMap[item.id] = item
|
$haocaiMap[item.id] = item
|
||||||
}
|
}
|
||||||
haoCaiList.value = res.content
|
haoCaiList.value = res.content
|
||||||
|
|
||||||
})
|
})
|
||||||
tbShopCurrencyGet({
|
tbShopCurrencyGet({
|
||||||
page: 0,
|
page: 0,
|
||||||
@@ -400,6 +401,8 @@
|
|||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
init()
|
init()
|
||||||
|
const firstItem= props.goods.conInfos[0]
|
||||||
|
isBindGuige.value=firstItem?(firstItem.productSkuId==0?false:true):false
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -143,6 +143,11 @@
|
|||||||
// icon: '/static/indexImg/icon-staff.svg',
|
// icon: '/static/indexImg/icon-staff.svg',
|
||||||
// pageUrl: 'PAGES_USER'
|
// pageUrl: 'PAGES_USER'
|
||||||
// },
|
// },
|
||||||
|
{
|
||||||
|
title: '订阅通知',
|
||||||
|
icon: '/static/indexImg/icon-notification.svg',
|
||||||
|
pageUrl: 'PAGES_NOTIFICATION_INDEX',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '设置中心',
|
title: '设置中心',
|
||||||
icon: '/static/indexImg/icon-cashier.svg',
|
icon: '/static/indexImg/icon-cashier.svg',
|
||||||
|
|||||||
@@ -166,7 +166,7 @@
|
|||||||
async function getTable() {
|
async function getTable() {
|
||||||
// let state=status.list[status.active].key
|
// let state=status.list[status.active].key
|
||||||
// state=state?(state=='all'?'':state):''
|
// state=state?(state=='all'?'':state):''
|
||||||
const areaId=area.list[area.defaultCateIndex].id
|
const areaId=area.list[area.defaultCateIndex].id||''
|
||||||
let {
|
let {
|
||||||
content,total
|
content,total
|
||||||
} = await $table.get({...query,areaId,name:searchValue.value,state:'idle'})
|
} = await $table.get({...query,areaId,name:searchValue.value,state:'idle'})
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- <view class="u-p-b-24 u-m-b-24 border-bottom">
|
<!-- <view class="u-p-b-24 u-m-b-24 border-bottom">
|
||||||
<view>就餐类型</view>
|
<view>就餐类型</view>
|
||||||
<view class="u-m-t-24 u-flex ">
|
<view class="u-m-t-24 u-flex ">
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<template v-if="user">
|
<template v-if="user&&user.id">
|
||||||
<view class="block">
|
<view class="block">
|
||||||
<view class="">
|
<view class="">
|
||||||
<view class="u-flex border-bottom u-p-b-24 ">
|
<view class="u-flex border-bottom u-p-b-24 ">
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
<view class="u-p-b-24 ">
|
<view class="u-p-b-24 ">
|
||||||
<view class="font-bold">订单备注</view>
|
<view class="font-bold">订单备注</view>
|
||||||
<view class="u-m-t-32 u-flex ">
|
<view class="u-m-t-32 u-flex ">
|
||||||
<uni-easyinput type="textarea" v-model="note" placeholder="请输入备注"></uni-easyinput>
|
<uni-easyinput type="textarea" v-model="note" placeholder="请输入备注"></uni-easyinput>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -183,7 +183,7 @@
|
|||||||
<button class="tag" hover-class="hover-class"
|
<button class="tag" hover-class="hover-class"
|
||||||
@tap="toggleGoodsItemKey(item,index,'isGift')">{{item.isGift?'取消赠送':'赠送'}}</button>
|
@tap="toggleGoodsItemKey(item,index,'isGift')">{{item.isGift?'取消赠送':'赠送'}}</button>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-m-r-20 " >
|
<view class="u-flex u-m-r-20 ">
|
||||||
<button class="tag" hover-class="hover-class"
|
<button class="tag" hover-class="hover-class"
|
||||||
@tap="toggleGoodsItemKey(item,index,'isPack')">{{item.isPack?'取消打包':'打包'}}</button>
|
@tap="toggleGoodsItemKey(item,index,'isPack')">{{item.isPack?'取消打包':'打包'}}</button>
|
||||||
</view>
|
</view>
|
||||||
@@ -201,24 +201,24 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="border-bottom">
|
<view class="border-bottom">
|
||||||
<template v-if="$seatFee&&$seatFee.totalAmount">
|
<template v-if="$seatFee&&$seatFee.totalAmount">
|
||||||
<view class="u-flex u-row-between u-m-t-18 u-p-b-34 ">
|
<view class="u-flex u-row-between u-m-t-18 u-p-b-34 ">
|
||||||
<view>
|
<view>
|
||||||
<text >桌位费</text>
|
<text>桌位费</text>
|
||||||
</view>
|
</view>
|
||||||
<view>¥{{$seatFee.totalAmount||'0.00'}}</view>
|
<view>¥{{$seatFee.totalAmount||'0.00'}}</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="$packFee>0">
|
<template v-if="$packFee>0">
|
||||||
<view class="u-flex u-row-between u-m-t-18 u-p-b-34 ">
|
<view class="u-flex u-row-between u-m-t-18 u-p-b-34 ">
|
||||||
<view>
|
<view>
|
||||||
<text >打包费</text>
|
<text>打包费</text>
|
||||||
</view>
|
</view>
|
||||||
<view>¥{{$packFee||'0.00'}}</view>
|
<view>¥{{$packFee||'0.00'}}</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<view class="u-flex u-row-right u-m-t-38">
|
<view class="u-flex u-row-right u-m-t-38">
|
||||||
<!-- <template v-if="$shop.registerType=='munchies'">
|
<!-- <template v-if="$shop.registerType=='munchies'">
|
||||||
@@ -273,7 +273,9 @@
|
|||||||
computed,
|
computed,
|
||||||
watch
|
watch
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
import {getSafeBottomHeight} from '@/commons/utils/safe-bottom.js'
|
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 oneRemark from './components/remark'
|
import oneRemark from './components/remark'
|
||||||
@@ -291,7 +293,9 @@
|
|||||||
import {
|
import {
|
||||||
getNowCart
|
getNowCart
|
||||||
} from '@/pagesCreateOrder/util.js'
|
} from '@/pagesCreateOrder/util.js'
|
||||||
import {hasPermission} from '@/commons/utils/hasPermission.js'
|
import {
|
||||||
|
hasPermission
|
||||||
|
} from '@/commons/utils/hasPermission.js'
|
||||||
const models = new Map();
|
const models = new Map();
|
||||||
const modelData = reactive({
|
const modelData = reactive({
|
||||||
data: {},
|
data: {},
|
||||||
@@ -311,7 +315,7 @@
|
|||||||
modelData.selIndex = index
|
modelData.selIndex = index
|
||||||
const model = models.get(key)
|
const model = models.get(key)
|
||||||
model && model.open({
|
model && model.open({
|
||||||
remark: modelData.data.note||''
|
remark: modelData.data.note || ''
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -325,7 +329,7 @@
|
|||||||
const userNumbers = reactive({
|
const userNumbers = reactive({
|
||||||
list: new Array(100).fill(1).map((v, index) => {
|
list: new Array(100).fill(1).map((v, index) => {
|
||||||
// return index === 0 ? '无' : index + '人'
|
// return index === 0 ? '无' : index + '人'
|
||||||
return (index+1)+ '人'
|
return (index + 1) + '人'
|
||||||
}),
|
}),
|
||||||
defaultCateIndex: 0,
|
defaultCateIndex: 0,
|
||||||
})
|
})
|
||||||
@@ -336,15 +340,23 @@
|
|||||||
//更新就餐人数
|
//更新就餐人数
|
||||||
async function updateChoseCount() {
|
async function updateChoseCount() {
|
||||||
console.log($shop.value);
|
console.log($shop.value);
|
||||||
if (!$shop.value.isTableFee&& table.value.tableId) {
|
const maxCapacity = table.value.tableId ? (table.value.maxCapacity || 0) : 100
|
||||||
|
if (table.value.tableId && userNumbers.defaultCateIndex * 1 + 1 > maxCapacity) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '当前台桌最大人数为: ' + maxCapacity
|
||||||
|
})
|
||||||
|
userNumbers.defaultCateIndex=maxCapacity-1
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!$shop.value.isTableFee && table.value.tableId) {
|
||||||
//不免餐位费
|
//不免餐位费
|
||||||
const res = await Api.$choseCount({
|
const res = await Api.$choseCount({
|
||||||
masterId: option.masterId,
|
masterId: option.masterId,
|
||||||
tableId: table.value.tableId,
|
tableId: table.value.tableId || '',
|
||||||
num: userNumbers.defaultCateIndex+1,
|
num: userNumbers.defaultCateIndex * 1 + 1,
|
||||||
})
|
})
|
||||||
Object.assign($seatFee, res)
|
Object.assign($seatFee, res)
|
||||||
userNumbers.defaultCateIndex = res.totalNumber-1
|
userNumbers.defaultCateIndex = res.totalNumber - 1
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -362,14 +374,15 @@
|
|||||||
skuId,
|
skuId,
|
||||||
id,
|
id,
|
||||||
number,
|
number,
|
||||||
isPack,isGift
|
isPack,
|
||||||
|
isGift
|
||||||
} = item
|
} = item
|
||||||
const par = {
|
const par = {
|
||||||
cartId:id,
|
cartId: id,
|
||||||
isPack,
|
isPack,
|
||||||
isGift,
|
isGift,
|
||||||
masterId: option.masterId,
|
masterId: option.masterId,
|
||||||
tableId: table.value.tableId,
|
tableId: table.value.tableId || '',
|
||||||
productId,
|
productId,
|
||||||
num: number,
|
num: number,
|
||||||
skuId
|
skuId
|
||||||
@@ -377,7 +390,7 @@
|
|||||||
par[key] = !item[key]
|
par[key] = !item[key]
|
||||||
const res = await Api.$updateCart(par)
|
const res = await Api.$updateCart(par)
|
||||||
goods.list[index][key] = returnBoolean(res[key])
|
goods.list[index][key] = returnBoolean(res[key])
|
||||||
if(key=='isPack'){
|
if (key == 'isPack') {
|
||||||
getCart()
|
getCart()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -400,11 +413,11 @@
|
|||||||
],
|
],
|
||||||
active: 'dine-in'
|
active: 'dine-in'
|
||||||
})
|
})
|
||||||
|
|
||||||
const $packFee=computed(()=>{
|
const $packFee = computed(() => {
|
||||||
return goods.list.reduce((prve,cur)=>{
|
return goods.list.reduce((prve, cur) => {
|
||||||
return prve+cur.packFee
|
return prve + cur.packFee
|
||||||
},0).toFixed(2)
|
}, 0).toFixed(2)
|
||||||
})
|
})
|
||||||
|
|
||||||
function chooseUser() {
|
function chooseUser() {
|
||||||
@@ -427,7 +440,7 @@
|
|||||||
console.log(option);
|
console.log(option);
|
||||||
const submitPar = {
|
const submitPar = {
|
||||||
masterId: option.masterId,
|
masterId: option.masterId,
|
||||||
tableId: table.value.tableId,
|
tableId: table.value.tableId || "",
|
||||||
vipUserId: user.value.id ? user.value.id : '',
|
vipUserId: user.value.id ? user.value.id : '',
|
||||||
type: user.value.id ? 0 : 1 //0 设置 1 取消
|
type: user.value.id ? 0 : 1 //0 设置 1 取消
|
||||||
}
|
}
|
||||||
@@ -481,16 +494,16 @@
|
|||||||
})
|
})
|
||||||
const goodsPrice = computed(() => {
|
const goodsPrice = computed(() => {
|
||||||
const goodsTotalPrice = goods.list.reduce((prve, cur) => {
|
const goodsTotalPrice = goods.list.reduce((prve, cur) => {
|
||||||
const tPrice=cur.salePrice * cur.number
|
const tPrice = cur.salePrice * cur.number
|
||||||
console.log(cur.isPack);
|
console.log(cur.isPack);
|
||||||
const tpackFee=cur.isPack? cur.packFee*1:0
|
const tpackFee = cur.isPack ? cur.packFee * 1 : 0
|
||||||
return prve +(cur.isGift?0:tPrice) +tpackFee
|
return prve + (cur.isGift ? 0 : tPrice) + tpackFee
|
||||||
}, 0)
|
}, 0)
|
||||||
return (goodsTotalPrice|| 0).toFixed(2)
|
return (goodsTotalPrice || 0).toFixed(2)
|
||||||
})
|
})
|
||||||
const allPrice = computed(() => {
|
const allPrice = computed(() => {
|
||||||
console.log(goodsPrice.value);
|
console.log(goodsPrice.value);
|
||||||
const n=goodsPrice.value*1 + $seatFee.totalAmount
|
const n = goodsPrice.value * 1 + $seatFee.totalAmount
|
||||||
return n.toFixed(2)
|
return n.toFixed(2)
|
||||||
// const goodsTotalPrice = goods.list.reduce((prve, cur) => {
|
// const goodsTotalPrice = goods.list.reduce((prve, cur) => {
|
||||||
// return prve + cur.salePrice * cur.number * (cur.isGift ? 0 : 1)
|
// return prve + cur.salePrice * cur.number * (cur.isGift ? 0 : 1)
|
||||||
@@ -510,7 +523,7 @@
|
|||||||
page: 0,
|
page: 0,
|
||||||
size: 300,
|
size: 300,
|
||||||
masterId: option.masterId,
|
masterId: option.masterId,
|
||||||
tableId: table.value.tableId
|
tableId: table.value.tableId || ''
|
||||||
}) {
|
}) {
|
||||||
const {
|
const {
|
||||||
records,
|
records,
|
||||||
@@ -524,10 +537,10 @@
|
|||||||
}
|
}
|
||||||
goods.list = getNowCart(records)
|
goods.list = getNowCart(records)
|
||||||
if (seatFee && seatFee.totalNumber) {
|
if (seatFee && seatFee.totalNumber) {
|
||||||
userNumbers.defaultCateIndex = seatFee.totalNumber-1 || 0
|
userNumbers.defaultCateIndex = seatFee.totalNumber - 1 || 0
|
||||||
Object.assign($seatFee, seatFee)
|
Object.assign($seatFee, seatFee)
|
||||||
}else{
|
} else {
|
||||||
$seatFee.totalAmount=0
|
$seatFee.totalAmount = 0
|
||||||
}
|
}
|
||||||
console.log(userNumbers.defaultCateIndex);
|
console.log(userNumbers.defaultCateIndex);
|
||||||
}
|
}
|
||||||
@@ -550,20 +563,20 @@
|
|||||||
note: note.value,
|
note: note.value,
|
||||||
postPay: true,
|
postPay: true,
|
||||||
orderId: '',
|
orderId: '',
|
||||||
tableId: table.value.tableId
|
tableId: table.value.tableId || ''
|
||||||
}) {
|
}) {
|
||||||
if (!$shop.value.isTableFee) {
|
if (!$shop.value.isTableFee) {
|
||||||
//不免餐位费
|
//不免餐位费
|
||||||
await Api.$choseCount({
|
await Api.$choseCount({
|
||||||
masterId: option.masterId,
|
masterId: option.masterId,
|
||||||
tableId: table.value.tableId,
|
tableId: table.value.tableId || "",
|
||||||
num: userNumbers.defaultCateIndex+1,
|
num: userNumbers.defaultCateIndex + 1,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if ($shop.value.registerType == 'munchies'||eatTypes.active=='takeout') {
|
if ($shop.value.registerType == 'munchies' || eatTypes.active == 'takeout') {
|
||||||
const canJiesuan=await hasPermission('允许收款')
|
const canJiesuan = await hasPermission('允许收款')
|
||||||
if(!canJiesuan){
|
if (!canJiesuan) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// updateChoseCount()
|
// updateChoseCount()
|
||||||
@@ -571,21 +584,20 @@
|
|||||||
uni.$emit('update:createOrderIndex')
|
uni.$emit('update:createOrderIndex')
|
||||||
console.log($shop.value);
|
console.log($shop.value);
|
||||||
console.log(res);
|
console.log(res);
|
||||||
if ($shop.value.registerType == 'munchies'||eatTypes.active=='takeout') {
|
if ($shop.value.registerType == 'munchies' || eatTypes.active == 'takeout') {
|
||||||
//先付
|
//先付
|
||||||
return go.to('PAGES_ORDER_PAY', {
|
return go.to('PAGES_ORDER_PAY', {
|
||||||
orderId: res.id,
|
orderId: res.id,
|
||||||
isNowPay:true
|
isNowPay: true
|
||||||
},'redirect'
|
}, 'redirect')
|
||||||
)
|
|
||||||
} else {
|
} else {
|
||||||
//后付
|
//后付
|
||||||
console.log(option.isCreateOrderToDetail);
|
console.log(option.isCreateOrderToDetail);
|
||||||
if (option.isCreateOrderToDetail!='0') {
|
if (option.isCreateOrderToDetail != '0') {
|
||||||
console.log('PAGES_ORDER_DETAIL');
|
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');
|
console.log('back');
|
||||||
uni.navigateBack({
|
uni.navigateBack({
|
||||||
@@ -616,7 +628,7 @@
|
|||||||
cartId: cart.id,
|
cartId: cart.id,
|
||||||
productId: cart.productId,
|
productId: cart.productId,
|
||||||
skuId: cart.skuId,
|
skuId: cart.skuId,
|
||||||
tableId: option.tableId,
|
tableId: option.tableId || "",
|
||||||
note: e.remark,
|
note: e.remark,
|
||||||
num: cart.number // 0会删除此商品
|
num: cart.number // 0会删除此商品
|
||||||
})
|
})
|
||||||
@@ -634,22 +646,27 @@
|
|||||||
|
|
||||||
onLoad((opt) => {
|
onLoad((opt) => {
|
||||||
Object.assign(option, opt)
|
Object.assign(option, opt)
|
||||||
console.log(option,);
|
console.log(opt);
|
||||||
if (opt) {
|
if (opt) {
|
||||||
table.value = {
|
table.value = {
|
||||||
tableId: opt.tableId,
|
...option,
|
||||||
|
tableId: opt.tableId || '',
|
||||||
name: opt.name
|
name: opt.name
|
||||||
}
|
}
|
||||||
|
userNumbers.list = new Array(opt.maxCapacity?opt.maxCapacity*1:100).fill(1).map((v, index) => {
|
||||||
|
return (index + 1) + '人'
|
||||||
|
})
|
||||||
|
// console.log(userNumbers.list);
|
||||||
}
|
}
|
||||||
init()
|
init()
|
||||||
|
|
||||||
// updateChoseCount()
|
// updateChoseCount()
|
||||||
})
|
})
|
||||||
let bottomHeight=ref(100)
|
let bottomHeight = ref(100)
|
||||||
onReady(()=>{
|
onReady(() => {
|
||||||
getSafeBottomHeight('safe-bottom').then(res=>{
|
getSafeBottomHeight('safe-bottom').then(res => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
bottomHeight.value=res
|
bottomHeight.value = res
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -668,12 +685,12 @@
|
|||||||
uni.setStorageSync("useType", useType);
|
uni.setStorageSync("useType", useType);
|
||||||
}
|
}
|
||||||
const tableId = useType == 'takeout' ? undefined : table.value.tableId;
|
const tableId = useType == 'takeout' ? undefined : table.value.tableId;
|
||||||
if(!goods.list.length){
|
if (!goods.list.length) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const res = await Api.$changeUseType({
|
const res = await Api.$changeUseType({
|
||||||
useType,
|
useType,
|
||||||
tableId,
|
tableId: tableId || '',
|
||||||
cartIds: goods.list.map((v) => v.id),
|
cartIds: goods.list.map((v) => v.id),
|
||||||
})
|
})
|
||||||
getCart()
|
getCart()
|
||||||
@@ -712,6 +729,7 @@
|
|||||||
border-radius: 18rpx;
|
border-radius: 18rpx;
|
||||||
margin-bottom: 32rpx;
|
margin-bottom: 32rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.textarea {
|
.textarea {
|
||||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||||
padding: 32rpx 0 32rpx 24rpx;
|
padding: 32rpx 0 32rpx 24rpx;
|
||||||
@@ -722,6 +740,7 @@
|
|||||||
.goods {
|
.goods {
|
||||||
// padding-bottom: 30rpx;
|
// padding-bottom: 30rpx;
|
||||||
border-bottom: 1px dashed #E5E5E5;
|
border-bottom: 1px dashed #E5E5E5;
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
.img {
|
.img {
|
||||||
width: 84rpx;
|
width: 84rpx;
|
||||||
|
|||||||
@@ -448,21 +448,26 @@
|
|||||||
})
|
})
|
||||||
console.log(res);
|
console.log(res);
|
||||||
if (res && res.content[0]) {
|
if (res && res.content[0]) {
|
||||||
// data.table=res.content[0]
|
data.table={...res.content[0],...data.table}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let $originGoods = []
|
let $originGoods = []
|
||||||
let $category = []
|
let $category = []
|
||||||
async function init() {
|
async function init() {
|
||||||
const masterRes = await getMasterId()
|
if(option.type=='add'){
|
||||||
data.masterId = masterRes.masterId
|
data.masterId = option.masterId
|
||||||
|
setTabBar($category, $originGoods, [])
|
||||||
|
}else{
|
||||||
|
const masterRes = await getMasterId()
|
||||||
|
data.masterId = masterRes.masterId
|
||||||
|
}
|
||||||
const shopInfo = await tbShopInfo()
|
const shopInfo = await tbShopInfo()
|
||||||
$shop.value = shopInfo
|
$shop.value = shopInfo
|
||||||
const useType = data.table.status == 'using' ? data.table.useType : $returnUseType(shopInfo)
|
const useType = data.table.status == 'using' ? data.table.useType : $returnUseType(shopInfo)
|
||||||
uni.setStorageSync('useType', useType)
|
uni.setStorageSync('useType', useType)
|
||||||
console.log(shopInfo);
|
console.log(shopInfo);
|
||||||
getTableInfo()
|
await getTableInfo()
|
||||||
const categoryRes = await getCategory()
|
const categoryRes = await getCategory()
|
||||||
const category = categoryRes.content.reduce((prve, cur) => {
|
const category = categoryRes.content.reduce((prve, cur) => {
|
||||||
prve.push({
|
prve.push({
|
||||||
@@ -482,16 +487,24 @@
|
|||||||
return isShow;
|
return isShow;
|
||||||
});
|
});
|
||||||
$originGoods = goods
|
$originGoods = goods
|
||||||
if (!data.table.tableId) {
|
console.log(option);
|
||||||
//无桌台
|
if(option.type=='add'){
|
||||||
|
cars.length = 0
|
||||||
setTabBar(category, goods, [])
|
setTabBar(category, goods, [])
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const {
|
if (!data.table.tableId) {
|
||||||
masterId
|
//无桌台
|
||||||
} = await getMasterId()
|
const cartRes = await getCart()
|
||||||
data.masterId = masterId
|
cars.length = 0
|
||||||
|
const cartArr = getNowCart(cartRes.records)
|
||||||
|
for (let i in cartArr) {
|
||||||
|
cars.push(cartArr[i])
|
||||||
|
}
|
||||||
|
setTabBar(category, goods, cars)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const cartRes = await getCart()
|
const cartRes = await getCart()
|
||||||
cars.length = 0
|
cars.length = 0
|
||||||
const cartArr = getNowCart(cartRes.records)
|
const cartArr = getNowCart(cartRes.records)
|
||||||
@@ -1089,7 +1102,9 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
watch(() => data.table.tableId, (newval, oldval) => {
|
watch(() => data.table.tableId, (newval, oldval) => {
|
||||||
onSelTable()
|
if(option.type!='add'){
|
||||||
|
onSelTable()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
async function onSelTable() {
|
async function onSelTable() {
|
||||||
const {
|
const {
|
||||||
|
|||||||
@@ -1,30 +1,30 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="default-box-padding bg-fff border-r-12 u-m-t-20" v-if="packeFee>0||data.totalAmount>0">
|
<view class="default-box-padding bg-fff border-r-12 u-m-t-20" v-if="packeFee>0||data.priceAmount>0">
|
||||||
<view class="u-flex u-row-between">
|
<view class="u-flex u-row-between">
|
||||||
<view class="font-bold">附加费</view>
|
<view class="font-bold">附加费</view>
|
||||||
<template v-if="orderInfo.status=='unpaid'&&data.status!='return'">
|
<template v-if="extraCanTuicai(orderInfo,data)">
|
||||||
<my-button plain shape="circle" :width="160" :height="56" @click="tuicai">退菜</my-button>
|
<my-button plain shape="circle" :width="160" :height="56" @click="tuicai">退菜</my-button>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="orderInfo.status=='closed'&&data.status!='return'">
|
<template v-if=" extraCanTuiKuan(orderInfo,data)">
|
||||||
<my-button plain shape="circle" :width="160" :height="56" @click="tuikuan">退款</my-button>
|
<my-button plain shape="circle" :width="160" :height="56" @click="tuikuan">退款</my-button>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<template v-if="data.status!='return'">
|
<template v-if="data.status!='return'&&data.status!='refund'&&data.status!='refunding'">
|
||||||
<view class="u-flex u-row-between u-m-t-24">
|
<view class="u-flex u-row-between u-m-t-24" v-if="data.priceAmount*1>0">
|
||||||
<view>{{data.name||'餐位费'}}</view>
|
<view>{{data.productName||'餐位费'}}</view>
|
||||||
<view>x{{data.number||0}}</view>
|
<view>x{{data.num||0}}</view>
|
||||||
<view class="price-min-width">¥{{data.totalAmount}}</view>
|
<view class="price-min-width">¥{{data.priceAmount}}</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<view class="u-flex u-row-between u-m-t-24 color-999">
|
<view class="u-flex u-row-between u-m-t-24 color-999">
|
||||||
<view class="u-flex">
|
<view class="u-flex">
|
||||||
<view class="line-th ">{{data.name||'餐位费'}}</view>
|
<view class="line-th ">{{data.productName||'餐位费'}}</view>
|
||||||
<view class="tag yitui u-m-l-10">已退</view>
|
<view class="tag yitui u-m-l-10">{{data.status=='refunding'?'退款中': '已退'}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="line-th">x{{data.number||0}}</view>
|
<view class="line-th">x{{data.num||0}}</view>
|
||||||
<view class="line-th">¥{{data.totalAmount}}</view>
|
<view class="line-th">¥{{data.priceAmount}}</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<!-- <view class="u-flex u-row-right u-m-t-24">
|
<!-- <view class="u-flex u-row-right u-m-t-24">
|
||||||
@@ -49,6 +49,16 @@
|
|||||||
import {
|
import {
|
||||||
computed
|
computed
|
||||||
} from 'vue'
|
} from 'vue'
|
||||||
|
import {
|
||||||
|
returnCanComputedGoodsArr,canComputedPackFee,
|
||||||
|
returnPackFee
|
||||||
|
} from '@/commons/utils/goodsUtil.js'
|
||||||
|
function extraCanTuicai(orderInfo,data){
|
||||||
|
return orderInfo.status=='unpaid'&&data.status!='return'&&data.priceAmount*1>0
|
||||||
|
}
|
||||||
|
function extraCanTuiKuan(orderInfo,data){
|
||||||
|
return orderInfo.status=='closed'&&data.status!='return'&&data.priceAmount*1>0
|
||||||
|
}
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@@ -72,16 +82,16 @@
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
return props.orderInfo.detailList.reduce((prve, cur) => {
|
return props.orderInfo.detailList.reduce((prve, cur) => {
|
||||||
return prve + (cur.packAmount>0?cur.num:0)
|
return prve + (cur.packAmount > 0 ? cur.num : 0)
|
||||||
}, 0)
|
}, 0)
|
||||||
})
|
})
|
||||||
const packeFee = computed(() => {
|
const packeFee = computed(() => {
|
||||||
if (!props.orderInfo.detailList) {
|
if (!props.orderInfo.detailList) {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
return props.orderInfo.detailList.reduce((prve, cur) => {
|
const arr = returnCanComputedGoodsArr(props.orderInfo.detailList)
|
||||||
return prve + cur.packAmount
|
console.log(arr);
|
||||||
}, 0).toFixed(2)
|
return returnPackFee(arr)
|
||||||
})
|
})
|
||||||
|
|
||||||
const statusMap = {
|
const statusMap = {
|
||||||
@@ -113,7 +123,8 @@
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.price-min-width{
|
|
||||||
|
.price-min-width {
|
||||||
min-width: 100rpx;
|
min-width: 100rpx;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,10 +23,10 @@
|
|||||||
|
|
||||||
<view class="">
|
<view class="">
|
||||||
<view class="u-flex">
|
<view class="u-flex">
|
||||||
<view class="tui" v-if="item.status=='return'||item.status=='refund'">
|
<view class="tui" v-if="isTui(item)">
|
||||||
已退
|
{{item.status=='refunding'?'退款中':'已退'}}
|
||||||
</view>
|
</view>
|
||||||
<view :class="{'line-th':item.status=='return'||item.status=='refund'}">{{item.name||item.productName}}
|
<view :class="{'line-th':item.status=='return'||item.status=='refund'||item.status=='refunding'}">{{item.name||item.productName}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-m-t-8">
|
<view class="u-flex u-m-t-8">
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
</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.status=='return'||item.gift||item.status=='refund'">
|
<template v-if="isTui(item)">
|
||||||
<view>¥0.00</view>
|
<view>¥0.00</view>
|
||||||
<view class="line-th color-666 ">¥{{returnTotalMoney(item)}}
|
<view class="line-th color-666 ">¥{{returnTotalMoney(item)}}
|
||||||
</view>
|
</view>
|
||||||
@@ -62,20 +62,18 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<template v-if="orderInfo.status=='unpaid'&&orderInfo.useType!='dine-in-before'">
|
<template v-if="canTuicai(orderInfo,item)">
|
||||||
<view class="u-flex u-row-right gap-20 u-m-t-24" v-if="item.status!='return'">
|
<view class="u-flex u-row-right gap-20 u-m-t-24">
|
||||||
<!-- <my-button :height="60" color="#333" plain type="cancel" shape="circle">更多操作</my-button> -->
|
<!-- <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="item.status!='refund'&&!item.gift">
|
<template v-if="canTuiKuan(orderInfo,item)">
|
||||||
<template v-if="orderInfo.status=='closed'||orderInfo.status=='refund'">
|
<view class="u-flex u-row-right gap-20 u-m-t-20">
|
||||||
<view class="u-flex u-row-right gap-20 u-m-t-20" v-if="item.status!='return'">
|
|
||||||
<my-button :width="128" :height="48" plain shape="circle"
|
<my-button :width="128" :height="48" plain shape="circle"
|
||||||
@tap="tuikuan(item,index)"><text class="no-wrap">退款</text> </my-button>
|
@tap="tuikuan(item,index)"><text class="no-wrap">退款</text> </my-button>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
@@ -131,6 +129,7 @@
|
|||||||
<view></view>
|
<view></view>
|
||||||
<view>
|
<view>
|
||||||
<text>总计¥</text>
|
<text>总计¥</text>
|
||||||
|
<!-- <text class="font-bold u-font-32">{{numSum([allPrice,seatFeePrice,packFee]) }}</text> -->
|
||||||
<text class="font-bold u-font-32">{{to2(allPrice*1+seatFeePrice*1+packFee*1) }}</text>
|
<text class="font-bold u-font-32">{{to2(allPrice*1+seatFeePrice*1+packFee*1) }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -149,6 +148,7 @@
|
|||||||
import {
|
import {
|
||||||
hasPermission
|
hasPermission
|
||||||
} from '@/commons/utils/hasPermission.js'
|
} from '@/commons/utils/hasPermission.js'
|
||||||
|
import {isTui,canTuiKuan,canTuicai,numSum} from '@/commons/utils/goodsUtil.js'
|
||||||
const emits = defineEmits(['tuicai', 'tuikuan', 'printOrder'])
|
const emits = defineEmits(['tuicai', 'tuikuan', 'printOrder'])
|
||||||
|
|
||||||
function returnTotalMoney(item) {
|
function returnTotalMoney(item) {
|
||||||
@@ -193,10 +193,10 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
const seatFeePrice = computed(() => {
|
const seatFeePrice = computed(() => {
|
||||||
if (!props.seatFee.totalAmount) {
|
if (!props.seatFee.priceAmount) {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
const n = props.seatFee.totalAmount * (props.seatFee.status == 'return' ? 0 : 1)
|
const n = props.seatFee.priceAmount * (props.seatFee.status == 'return' ? 0 : 1)
|
||||||
return n.toFixed(2)
|
return n.toFixed(2)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -26,11 +26,21 @@
|
|||||||
</view> -->
|
</view> -->
|
||||||
<view class="u-flex u-row-between u-m-t-24">
|
<view class="u-flex u-row-between u-m-t-24">
|
||||||
<view>下单时间</view>
|
<view>下单时间</view>
|
||||||
<view><up-text v-if="data.createdAt" mode="date" format="yyyy-mm-dd hh:MM:ss" :text="data.createdAt"></up-text></view>
|
<view><up-text v-if="data.createdAt" mode="date" format="yyyy-mm-dd hh:MM:ss"
|
||||||
|
:text="data.createdAt"></up-text></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-row-between u-m-t-24">
|
<view class="u-flex u-row-between u-m-t-24">
|
||||||
<view>订单编号</view>
|
<view>订单编号</view>
|
||||||
<view>{{data.orderNo}}</view>
|
<view class="u-flex">
|
||||||
|
<view>{{data.orderNo}}</view>
|
||||||
|
<view v-if="data.orderNo" class="u-m-l-6">
|
||||||
|
<up-copy :content="data.orderNo" >
|
||||||
|
<up-icon name="/static/copy.svg" :size="16"></up-icon>
|
||||||
|
</up-copy>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-row-between u-m-t-24 u-col-top">
|
<view class="u-flex u-row-between u-m-t-24 u-col-top">
|
||||||
<view class="no-wrap">商家备注</view>
|
<view class="no-wrap">商家备注</view>
|
||||||
|
|||||||
@@ -5,21 +5,24 @@
|
|||||||
<view>
|
<view>
|
||||||
{{data.productName}}
|
{{data.productName}}
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-m-t-32">
|
<view class="u-flex u-m-t-32" :class="{'gray':data.productId=='-999'}">
|
||||||
<up-number-box :min="1" :max="data.num" :buttonSize="44" v-model="number" integer>
|
<up-number-box :min="1" :max="data.num" :buttonSize="44" v-model="number" integer :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 @change="parseIntNumber($event,false)" @blur="parseIntNumber($event,true)"
|
<up-input
|
||||||
|
:disabled="data.productId=='-999'"
|
||||||
|
@change="parseIntNumber($event,false)" @blur="parseIntNumber($event,true)"
|
||||||
v-model="number" border="none" type="number"></up-input>
|
v-model="number" border="none" type="number"></up-input>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<template #plus>
|
<template #plus>
|
||||||
<view class="plus number-box-btn">
|
<view class="plus number-box-btn">
|
||||||
<up-icon name="plus" color="#999" size="16" bold></up-icon>
|
<up-icon v-if="data.productId=='-999'" name="plus" color="#ccc" size="16" bold></up-icon>
|
||||||
|
<up-icon v-else name="plus" color="#999" size="16" bold></up-icon>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</up-number-box>
|
</up-number-box>
|
||||||
@@ -66,7 +69,11 @@
|
|||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {}
|
default: () => {
|
||||||
|
return {
|
||||||
|
productId:'-999'
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
show: {
|
show: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@@ -143,10 +150,17 @@
|
|||||||
|
|
||||||
function open() {
|
function open() {
|
||||||
model.value.open()
|
model.value.open()
|
||||||
|
if(props.data.productId=='-999'){
|
||||||
|
number.value=props.data.num
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function close() {
|
function close() {
|
||||||
model.value.close()
|
model.value.close()
|
||||||
|
tags.value.map(v=>{
|
||||||
|
v.checked=false
|
||||||
|
})
|
||||||
|
form.note=''
|
||||||
}
|
}
|
||||||
|
|
||||||
function confirm() {
|
function confirm() {
|
||||||
@@ -191,7 +205,12 @@
|
|||||||
::v-deep .uni-input-input {
|
::v-deep .uni-input-input {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.gray{
|
||||||
|
.minus::after{
|
||||||
|
border-color: #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
.minus {
|
.minus {
|
||||||
&::after {
|
&::after {
|
||||||
content: '';
|
content: '';
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
function onSeatFeeTuicai(seatFee) {
|
function onSeatFeeTuicai(seatFee) {
|
||||||
seatFee={...seatFee,num:seatFee.number,productName:seatFee.name}
|
seatFee={...seatFee,num:seatFee.num,productName:seatFee.productName}
|
||||||
console.log(seatFee);
|
console.log(seatFee);
|
||||||
tuicai.show = true
|
tuicai.show = true
|
||||||
tuicai.isSeatFee = seatFee
|
tuicai.isSeatFee = seatFee
|
||||||
@@ -94,26 +94,26 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
const {
|
const {
|
||||||
id,
|
id,cartId,
|
||||||
productId,
|
productId,
|
||||||
productSkuId,
|
productSkuId,
|
||||||
name,
|
productName,
|
||||||
cartId,
|
num,
|
||||||
number,
|
priceAmount,
|
||||||
totalAmount,
|
price
|
||||||
salePrice
|
|
||||||
} = seatFee
|
} = seatFee
|
||||||
go.to('PAGES_ORDER_TUIKUAN', {
|
go.to('PAGES_ORDER_TUIKUAN', {
|
||||||
orderId:orderDetail.info.id,
|
orderId:orderDetail.info.id,
|
||||||
id:seatFee.id,
|
id,
|
||||||
|
cartId,
|
||||||
productId,
|
productId,
|
||||||
productSkuId,
|
productSkuId,
|
||||||
productName:name,
|
productName,
|
||||||
num:number,
|
num,
|
||||||
number: 0,
|
number: 0,
|
||||||
productSkuName: '',
|
productSkuName: '',
|
||||||
priceAmount:totalAmount,
|
priceAmount,
|
||||||
price:salePrice
|
price
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,6 +211,7 @@
|
|||||||
go.to('PAGES_CREATE_ORDER', {
|
go.to('PAGES_CREATE_ORDER', {
|
||||||
tableId: options.tableId || orderDetail.info.tableId,
|
tableId: options.tableId || orderDetail.info.tableId,
|
||||||
name: options.name || orderDetail.info.tableName,
|
name: options.name || orderDetail.info.tableName,
|
||||||
|
masterId:orderDetail.info.masterId,
|
||||||
type: 'add'
|
type: 'add'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -282,12 +283,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
console.log(res.seatInfo);
|
||||||
orderDetail.seatFee = res.seatInfo|| {
|
orderDetail.seatFee = res.seatInfo|| {
|
||||||
name: '客座费',
|
// name: '客座费',
|
||||||
number: res.seatCount,
|
// number: res.seatCount,
|
||||||
totalNumber: res.seatCount,
|
// num: res.seatCount,
|
||||||
totalAmount: res.seatAmount,
|
// totalNumber: res.seatCount,
|
||||||
status:''
|
// priceAmount: res.seatAmount,
|
||||||
|
// status:'',
|
||||||
|
totalNumber:0,
|
||||||
}
|
}
|
||||||
orderDetail.goodsList = Object.entries(goodsMap).map(([key, value]) => ({
|
orderDetail.goodsList = Object.entries(goodsMap).map(([key, value]) => ({
|
||||||
info: value,
|
info: value,
|
||||||
|
|||||||
@@ -59,6 +59,7 @@
|
|||||||
<view class="no-wrap u-m-r-32">打包费</view>
|
<view class="no-wrap u-m-r-32">打包费</view>
|
||||||
<view>¥{{data.packFee||0}}</view>
|
<view>¥{{data.packFee||0}}</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view style="height: 32rpx;" v-if="data.packFee>0&&data.seatInfo&&data.seatInfo.priceAmount>0"></view>
|
||||||
<view class="u-flex u-row-between u-col-top" v-if="data.seatInfo&&data.seatInfo.priceAmount>0">
|
<view class="u-flex u-row-between u-col-top" v-if="data.seatInfo&&data.seatInfo.priceAmount>0">
|
||||||
<view class="no-wrap u-m-r-32">{{data.seatInfo.productName}}</view>
|
<view class="no-wrap u-m-r-32">{{data.seatInfo.productName}}</view>
|
||||||
<view>¥{{data.seatInfo.priceAmount}}</view>
|
<view>¥{{data.seatInfo.priceAmount}}</view>
|
||||||
@@ -72,7 +73,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="u-m-t-32">
|
<view class="u-m-t-32">
|
||||||
<view class="u-flex u-row-right">
|
<view class="u-flex u-row-right">
|
||||||
<text>小计¥</text>
|
<text>总计¥</text>
|
||||||
<text class="font-bold u-font-32">{{data.orderAmount}}</text>
|
<text class="font-bold u-font-32">{{data.orderAmount}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-row-right u-m-t-24">
|
<view class="u-flex u-row-right u-m-t-24">
|
||||||
@@ -87,6 +88,7 @@
|
|||||||
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 {isTui,canTuiKuan,canTuicai} from '@/commons/utils/goodsUtil.js'
|
||||||
import {
|
import {
|
||||||
computed,
|
computed,
|
||||||
reactive,
|
reactive,
|
||||||
@@ -119,7 +121,7 @@
|
|||||||
|
|
||||||
const priceSize = 9
|
const priceSize = 9
|
||||||
function goodsPriceAmount(item){
|
function goodsPriceAmount(item){
|
||||||
return item.price*item.num
|
return (item.price*item.num).toFixed(2)
|
||||||
}
|
}
|
||||||
// const packeFee=computed(()=>{
|
// const packeFee=computed(()=>{
|
||||||
// return props.data.detailList.reduce((prve,cur)=>{
|
// return props.data.detailList.reduce((prve,cur)=>{
|
||||||
|
|||||||
@@ -3,9 +3,13 @@
|
|||||||
<view class="bg-fff u-p-24 border-r-12 u-flex u-row-between">
|
<view class="bg-fff u-p-24 border-r-12 u-flex u-row-between">
|
||||||
<view>全退</view>
|
<view>全退</view>
|
||||||
<view>
|
<view>
|
||||||
<my-radio v-model="allTui"></my-radio>
|
<my-radio v-model="allTui" :disabled="option.productId=='-999'"></my-radio>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="u-m-t-24 u-font-24 u-font-24">
|
||||||
|
<text class="color-red">*</text>
|
||||||
|
<text>客座费只能全退</text>
|
||||||
|
</view>
|
||||||
<view class="bg-fff border-r-12 list u-m-t-32">
|
<view 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">
|
||||||
@@ -14,15 +18,25 @@
|
|||||||
<view class="u-m-t-10 color-999 u-font-24">{{item.productSkuName||""}}</view>
|
<view class="u-m-t-10 color-999 u-font-24">{{item.productSkuName||""}}</view>
|
||||||
<view class="u-m-t-10 color-999 u-font-24">最多可退×{{item.num}}</view>
|
<view class="u-m-t-10 color-999 u-font-24">最多可退×{{item.num}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex">
|
<template v-if="option.productId=='-999'">
|
||||||
<view class="color-red">¥{{item.priceAmount}}</view>
|
<view class="u-flex">
|
||||||
<view class="u-flex u-m-l-32 u-col-center">
|
<view class="color-red">¥{{item.priceAmount}}</view>
|
||||||
<up-icon @click="changeItem(item,-1)" :size="20" name="minus-circle"></up-icon>
|
<view class="u-flex u-m-l-32 u-col-center">
|
||||||
<view class="u-m-l-28 u-m-r-28">{{item.number}}</view>
|
<view class="u-m-l-28 u-m-r-28">x{{item.number}}</view>
|
||||||
<up-icon @click="changeItem(item,1)" :color="color.ColorMain" :size="20"
|
</view>
|
||||||
name="plus-circle-fill"></up-icon>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<view class="u-flex">
|
||||||
|
<view class="color-red">¥{{item.priceAmount}}</view>
|
||||||
|
<view class="u-flex u-m-l-32 u-col-center">
|
||||||
|
<up-icon @click="changeItem(item,-1)" :size="20" name="minus-circle"></up-icon>
|
||||||
|
<view class="u-m-l-28 u-m-r-28">{{item.number}}</view>
|
||||||
|
<up-icon @click="changeItem(item,1)" :color="color.ColorMain" :size="20"
|
||||||
|
name="plus-circle-fill"></up-icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
</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">
|
||||||
@@ -139,6 +153,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function changeItem(item, step) {
|
function changeItem(item, step) {
|
||||||
|
if(item.productId=='-999'){
|
||||||
|
return
|
||||||
|
}
|
||||||
console.log(item);
|
console.log(item);
|
||||||
let newval = item.number * 1 + step * 1;
|
let newval = item.number * 1 + step * 1;
|
||||||
if (newval <= 0) {
|
if (newval <= 0) {
|
||||||
@@ -179,9 +196,14 @@
|
|||||||
uni.navigateBack({delta:1})
|
uni.navigateBack({delta:1})
|
||||||
},500)
|
},500)
|
||||||
}
|
}
|
||||||
const option=reactive({})
|
const option=reactive({
|
||||||
|
productId:'-999'
|
||||||
|
})
|
||||||
onLoad((opt) => {
|
onLoad((opt) => {
|
||||||
Object.assign(option,opt)
|
Object.assign(option,opt)
|
||||||
|
if(opt.productId=='-999'){
|
||||||
|
allTui.value=true
|
||||||
|
}
|
||||||
if (Array.isArray(opt)) {
|
if (Array.isArray(opt)) {
|
||||||
orderDetail.goodsList = opt
|
orderDetail.goodsList = opt
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
1
static/copy.svg
Normal file
1
static/copy.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1730281062594" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4292" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><path d="M394.666667 106.666667h448a74.666667 74.666667 0 0 1 74.666666 74.666666v448a74.666667 74.666667 0 0 1-74.666666 74.666667H394.666667a74.666667 74.666667 0 0 1-74.666667-74.666667V181.333333a74.666667 74.666667 0 0 1 74.666667-74.666666z m0 64a10.666667 10.666667 0 0 0-10.666667 10.666666v448a10.666667 10.666667 0 0 0 10.666667 10.666667h448a10.666667 10.666667 0 0 0 10.666666-10.666667V181.333333a10.666667 10.666667 0 0 0-10.666666-10.666666H394.666667z m245.333333 597.333333a32 32 0 0 1 64 0v74.666667a74.666667 74.666667 0 0 1-74.666667 74.666666H181.333333a74.666667 74.666667 0 0 1-74.666666-74.666666V394.666667a74.666667 74.666667 0 0 1 74.666666-74.666667h74.666667a32 32 0 0 1 0 64h-74.666667a10.666667 10.666667 0 0 0-10.666666 10.666667v448a10.666667 10.666667 0 0 0 10.666666 10.666666h448a10.666667 10.666667 0 0 0 10.666667-10.666666v-74.666667z" fill="#8a8a8a" p-id="4293"></path></svg>
|
||||||
|
After Width: | Height: | Size: 1.2 KiB |
Reference in New Issue
Block a user