|
@@ -65,7 +65,10 @@
|
|
<div class="cart-item" v-for="cartInfo in cartList">
|
|
<div class="cart-item" v-for="cartInfo in cartList">
|
|
<img class="image" :src="cartInfo.logo" />
|
|
<img class="image" :src="cartInfo.logo" />
|
|
<div class="info">
|
|
<div class="info">
|
|
- <div class="name">{{ cartInfo.name }}</div>
|
|
|
|
|
|
+ <div class="name">
|
|
|
|
+ <template v-if="hangNo">{{ hangNo }}-</template>
|
|
|
|
+ {{ cartInfo.name }}
|
|
|
|
+ </div>
|
|
<div class="spec" v-if="cartInfo.specList && cartInfo.specList.length > 0">
|
|
<div class="spec" v-if="cartInfo.specList && cartInfo.specList.length > 0">
|
|
<span class="item" v-for="spec in cartInfo.specList" :title="spec.value">
|
|
<span class="item" v-for="spec in cartInfo.specList" :title="spec.value">
|
|
{{ spec.value }}
|
|
{{ spec.value }}
|
|
@@ -303,7 +306,7 @@ import {
|
|
removeFromCart,
|
|
removeFromCart,
|
|
submitSettlement,
|
|
submitSettlement,
|
|
doPay,
|
|
doPay,
|
|
- getMemberInfoById
|
|
|
|
|
|
+ getMemberInfoById,
|
|
} from '@/api/cashier'
|
|
} from '@/api/cashier'
|
|
import { getOrderInfo } from '@/api/order'
|
|
import { getOrderInfo } from '@/api/order'
|
|
import { getUserId, setUserId, removeUserId } from '@/utils/auth'
|
|
import { getUserId, setUserId, removeUserId } from '@/utils/auth'
|
|
@@ -331,7 +334,7 @@ export default {
|
|
memberList,
|
|
memberList,
|
|
couponConfirm,
|
|
couponConfirm,
|
|
noGoodsCashier,
|
|
noGoodsCashier,
|
|
- bindStaffDialog
|
|
|
|
|
|
+ bindStaffDialog,
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -359,7 +362,7 @@ export default {
|
|
menuList: [
|
|
menuList: [
|
|
{ name: '收银主页', key: 'cashier', logo: require('../../assets/images/cashier.png') },
|
|
{ name: '收银主页', key: 'cashier', logo: require('../../assets/images/cashier.png') },
|
|
{ name: '订单管理', key: 'order', logo: require('../../assets/images/order.png') },
|
|
{ name: '订单管理', key: 'order', logo: require('../../assets/images/order.png') },
|
|
- { name: '退出', key: 'exit', logo: require('../../assets/images/order.png') }
|
|
|
|
|
|
+ { name: '退出', key: 'exit', logo: require('../../assets/images/order.png') },
|
|
// { name: '会员管理', key: 'member', logo: require('../../assets/images/hot.png') },
|
|
// { name: '会员管理', key: 'member', logo: require('../../assets/images/hot.png') },
|
|
// { name: '卡券核销', key: 'coupon', logo: require('../../assets/images/life.png') }
|
|
// { name: '卡券核销', key: 'coupon', logo: require('../../assets/images/life.png') }
|
|
],
|
|
],
|
|
@@ -411,7 +414,7 @@ export default {
|
|
couponList: [],
|
|
couponList: [],
|
|
// 挂单序号
|
|
// 挂单序号
|
|
hangNo: '',
|
|
hangNo: '',
|
|
- isSearch: false
|
|
|
|
|
|
+ isSearch: false,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
@@ -540,7 +543,7 @@ export default {
|
|
logo: item.goodsInfo.logo,
|
|
logo: item.goodsInfo.logo,
|
|
price: item.goodsInfo.price,
|
|
price: item.goodsInfo.price,
|
|
buyNum: item.num,
|
|
buyNum: item.num,
|
|
- specList: specList
|
|
|
|
|
|
+ specList: specList,
|
|
}
|
|
}
|
|
app.cartList.push(cartInfo)
|
|
app.cartList.push(cartInfo)
|
|
})
|
|
})
|
|
@@ -673,7 +676,7 @@ export default {
|
|
skuId: skuId,
|
|
skuId: skuId,
|
|
userId: getUserId(),
|
|
userId: getUserId(),
|
|
hangNo: app.hangNo,
|
|
hangNo: app.hangNo,
|
|
- buyNum: app.goodsNum
|
|
|
|
|
|
+ buyNum: app.goodsNum,
|
|
}
|
|
}
|
|
app.loading = true
|
|
app.loading = true
|
|
saveCart(cartInfo)
|
|
saveCart(cartInfo)
|
|
@@ -694,15 +697,32 @@ export default {
|
|
// 删除购物车
|
|
// 删除购物车
|
|
removeFromCart(cartId) {
|
|
removeFromCart(cartId) {
|
|
const app = this
|
|
const app = this
|
|
- removeFromCart({ cartId: [cartId], userId: getUserId() })
|
|
|
|
- .then((response) => {
|
|
|
|
- if (response.data) {
|
|
|
|
- app.getCartList()
|
|
|
|
- }
|
|
|
|
|
|
+ this.$confirm('此操作将清空, 是否继续?', '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ removeFromCart({ cartId: [cartId], userId: getUserId() })
|
|
|
|
+ .then((response) => {
|
|
|
|
+ if (response.data) {
|
|
|
|
+ app.getCartList()
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'success',
|
|
|
|
+ message: '删除成功!',
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ app.loading = false
|
|
|
|
+ console.log(err.toString())
|
|
|
|
+ })
|
|
})
|
|
})
|
|
- .catch((err) => {
|
|
|
|
- app.loading = false
|
|
|
|
- console.log(err.toString())
|
|
|
|
|
|
+ .catch(() => {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'info',
|
|
|
|
+ message: '已取消删除',
|
|
|
|
+ })
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 购物车数量变化
|
|
// 购物车数量变化
|
|
@@ -715,7 +735,7 @@ export default {
|
|
action: '=',
|
|
action: '=',
|
|
userId: app.memberInfo ? app.memberInfo.id : null,
|
|
userId: app.memberInfo ? app.memberInfo.id : null,
|
|
hangNo: app.hangNo,
|
|
hangNo: app.hangNo,
|
|
- buyNum: cartInfo.buyNum
|
|
|
|
|
|
+ buyNum: cartInfo.buyNum,
|
|
}
|
|
}
|
|
app.loading = true
|
|
app.loading = true
|
|
saveCart(param)
|
|
saveCart(param)
|
|
@@ -812,14 +832,14 @@ export default {
|
|
payType: param.payType,
|
|
payType: param.payType,
|
|
cashierPayAmount: param.totalPrice,
|
|
cashierPayAmount: param.totalPrice,
|
|
cashierDiscountAmount: param.discountPrice,
|
|
cashierDiscountAmount: param.discountPrice,
|
|
- userId: getUserId()
|
|
|
|
|
|
+ userId: getUserId(),
|
|
}).then((response) => {
|
|
}).then((response) => {
|
|
app.openSettlementDialog = false
|
|
app.openSettlementDialog = false
|
|
if (response.data.orderInfo.payStatus == 'B') {
|
|
if (response.data.orderInfo.payStatus == 'B') {
|
|
app.showPayResult({
|
|
app.showPayResult({
|
|
isSuccess: true,
|
|
isSuccess: true,
|
|
payAmount: response.data.orderInfo.payAmount,
|
|
payAmount: response.data.orderInfo.payAmount,
|
|
- orderId: response.data.orderInfo.id
|
|
|
|
|
|
+ orderId: response.data.orderInfo.id,
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
app.$alert(response.data.message ? response.data.message : '抱歉,订单操作异常!')
|
|
app.$alert(response.data.message ? response.data.message : '抱歉,订单操作异常!')
|
|
@@ -843,7 +863,7 @@ export default {
|
|
type: app.cartList.length > 0 ? 'goods' : 'payment',
|
|
type: app.cartList.length > 0 ? 'goods' : 'payment',
|
|
couponId: param.userCouponId ? param.userCouponId : 0,
|
|
couponId: param.userCouponId ? param.userCouponId : 0,
|
|
userId: getUserId(),
|
|
userId: getUserId(),
|
|
- staffId: app.staffInfo ? app.staffInfo.id : 0
|
|
|
|
|
|
+ staffId: app.staffInfo ? app.staffInfo.id : 0,
|
|
}
|
|
}
|
|
if (app.loading) {
|
|
if (app.loading) {
|
|
return false
|
|
return false
|
|
@@ -874,7 +894,7 @@ export default {
|
|
app.showPayResult({
|
|
app.showPayResult({
|
|
isSuccess: true,
|
|
isSuccess: true,
|
|
payAmount: response.data.orderInfo.payAmount,
|
|
payAmount: response.data.orderInfo.payAmount,
|
|
- orderId: response.data.orderInfo.id
|
|
|
|
|
|
+ orderId: response.data.orderInfo.id,
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
app.$alert(response.data.message)
|
|
app.$alert(response.data.message)
|
|
@@ -981,8 +1001,8 @@ export default {
|
|
// 确认关闭
|
|
// 确认关闭
|
|
handleClose() {
|
|
handleClose() {
|
|
return false
|
|
return false
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ },
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|