Compare commits
31 Commits
gaohao2.0.
...
dev_dwb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9f97b6ddb | ||
|
|
e0abb6a589 | ||
| 22bec823b2 | |||
| 468209308c | |||
| 54f0a407c2 | |||
| 94bf94b16a | |||
| 62d775a668 | |||
| ae03b5b9f3 | |||
| 56b9c1ebf7 | |||
| adfdee835b | |||
| 5076efee3a | |||
| f266501a7b | |||
|
|
c94acd899a | ||
|
|
224552f546 | ||
| 270c7350d3 | |||
|
|
e8299f8d12 | ||
| 862812caa3 | |||
|
|
25c030f2a2 | ||
|
|
f7e4fd77aa | ||
|
|
8cb0d99962 | ||
|
|
f8130508a2 | ||
|
|
f5348be1b8 | ||
| 48b8daea75 | |||
| 9969251050 | |||
| edf8e4e254 | |||
| d9cf881b62 | |||
| e00213be32 | |||
| c7283a493c | |||
| aa8be5e906 | |||
| 7ff8632af9 | |||
| d9c789da8f |
@@ -6,10 +6,10 @@ ENV = 'production'
|
|||||||
# VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
|
# VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn'
|
||||||
|
|
||||||
# 生产
|
# 生产
|
||||||
# VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
|
VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
|
||||||
|
|
||||||
# 预发布接口
|
# 预发布接口
|
||||||
VUE_APP_BASE_API = 'https://pre-cashieradmin.sxczgkj.cn'
|
# VUE_APP_BASE_API = 'https://pre-cashieradmin.sxczgkj.cn'
|
||||||
|
|
||||||
# VUE_APP_BASE_API = 'http://192.168.2.98:8000'
|
# VUE_APP_BASE_API = 'http://192.168.2.98:8000'
|
||||||
# 如果接口是 http 形式, wss 需要改为 ws
|
# 如果接口是 http 形式, wss 需要改为 ws
|
||||||
|
|||||||
@@ -15,14 +15,26 @@ export function tbPrintMachine(data, method = "post") {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 开票
|
||||||
|
export function getbinding(data) {
|
||||||
|
return request({
|
||||||
|
url: "/api/tbShopInfo/binding",
|
||||||
|
method: "post",
|
||||||
|
data: {
|
||||||
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
...data
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 获取应用中心列表
|
* 获取应用中心列表
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function appCenterGet() {
|
export function appCenterGet(params) {
|
||||||
return request({
|
return request({
|
||||||
url: "/api/appCenter",
|
url: "/api/appCenter",
|
||||||
method: "get"
|
method: "get",
|
||||||
|
params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,15 @@
|
|||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<div class="title">应用中心</div>
|
<div class="title">应用中心</div>
|
||||||
<div class="list">
|
<div class="list">
|
||||||
|
<!-- <div class="item" @click="upPop">
|
||||||
|
<img src="./kp.png" class="icon">
|
||||||
|
<div class="info">
|
||||||
|
<div class="name">开票</div>
|
||||||
|
<div class="intro">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div> -->
|
||||||
<div class="item" v-for="item in list" :key="item.id" @click="to(item)">
|
<div class="item" v-for="item in list" :key="item.id" @click="to(item)">
|
||||||
<img :src="item.coverImg" class="icon">
|
<img :src="item.coverImg" class="icon">
|
||||||
<div class="info">
|
<div class="info">
|
||||||
@@ -12,21 +21,64 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 弹窗 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" >
|
||||||
|
<el-form :model="forms">
|
||||||
|
<el-form-item label="账号:" label-width="60px">
|
||||||
|
<el-input v-model="forms.account" :disabled="title != '绑定数点票账号'" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="密码/验证码" label-width="120px">
|
||||||
|
<el-input v-model="forms.name" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="开票项目:" label-width="120px">
|
||||||
|
<el-input v-model="forms.name" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="开票类型:" label-width="120px">
|
||||||
|
<el-input v-model="forms.name" autocomplete="off"></el-input>
|
||||||
|
</el-form-item> -->
|
||||||
|
<div style="text-align: right;" v-if="title == '绑定数点票账号'">联系区域经理开通</div>
|
||||||
|
<div style="text-align: center;" v-else @click="title = '绑定数点票账号'">更换绑定</div>
|
||||||
|
<!-- <el-form-item label="活动区域" label-width="120px">
|
||||||
|
<el-select v-model="form.region" placeholder="请选择活动区域">
|
||||||
|
<el-option label="区域一" value="shanghai"></el-option>
|
||||||
|
<el-option label="区域二" value="beijing"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item> -->
|
||||||
|
</el-form>
|
||||||
|
<span slot="footer" class="dialog-footer" v-if="title == '绑定数点票账号'">
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="sumbitEvent">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { appCenterGet } from "@/api/application";
|
import { appCenterGet, getbinding } from "@/api/application";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: []
|
list: [],
|
||||||
|
dialogVisible: false,
|
||||||
|
forms: {},
|
||||||
|
title: '绑定数点票账号',
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.appCenterGet()
|
this.appCenterGet()
|
||||||
|
// this.getbinding()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
upPop() {
|
||||||
|
this.dialogVisible = true
|
||||||
|
},
|
||||||
|
sumbitEvent() {
|
||||||
|
if (this.forms.account) {
|
||||||
|
this.dialogVisible = false
|
||||||
|
this.getbinding(this.forms)
|
||||||
|
}
|
||||||
|
},
|
||||||
// 跳转
|
// 跳转
|
||||||
to(item) {
|
to(item) {
|
||||||
localStorage.setItem('applocation', JSON.stringify(item))
|
localStorage.setItem('applocation', JSON.stringify(item))
|
||||||
@@ -42,7 +94,24 @@ export default {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 开票
|
||||||
|
async getbinding(d = "") {
|
||||||
|
try {
|
||||||
|
const res = await getbinding(d)
|
||||||
|
if (res) {
|
||||||
|
this.forms = res.store
|
||||||
|
this.title = '数电票账号已绑定'
|
||||||
|
} else {
|
||||||
|
this.title = '绑定数点票账号'
|
||||||
|
this.forms = {}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
BIN
src/views/application/kp.png
Normal file
BIN
src/views/application/kp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 746 B |
@@ -173,7 +173,7 @@ export default {
|
|||||||
|
|
||||||
|
|
||||||
async profilepicture(d) {
|
async profilepicture(d) {
|
||||||
this.handleSpeak(d.callNum)
|
this.handleSpeak('请'+d.callNum+'用餐')
|
||||||
let res = await callTablecall({
|
let res = await callTablecall({
|
||||||
shopId: localStorage.getItem('shopId'),
|
shopId: localStorage.getItem('shopId'),
|
||||||
callQueueId: d.id
|
callQueueId: d.id
|
||||||
|
|||||||
109
src/views/marketing/index.vue
Normal file
109
src/views/marketing/index.vue
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<div class="title">营销中心</div>
|
||||||
|
<div class="list">
|
||||||
|
<div class="item" v-for="item in list" :key="item.id" @click="to(item)">
|
||||||
|
<img :src="item.coverImg" class="icon">
|
||||||
|
<div class="info">
|
||||||
|
<div class="name">{{ item.name }}</div>
|
||||||
|
<div class="intro">
|
||||||
|
{{ item.value }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { appCenterGet } from "@/api/application";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
list: [],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.appCenterGet()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 跳转
|
||||||
|
to(item) {
|
||||||
|
localStorage.setItem('applocation', JSON.stringify(item))
|
||||||
|
this.$router.push({
|
||||||
|
name: item.absUrl
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 获取应用列表
|
||||||
|
async appCenterGet() {
|
||||||
|
try {
|
||||||
|
const res = await appCenterGet({
|
||||||
|
type:'market'
|
||||||
|
})
|
||||||
|
this.list = res
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.title {
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: bold;
|
||||||
|
padding-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list {
|
||||||
|
padding: 20px 0;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 14px;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
width: 400px;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 14px;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
.info {
|
||||||
|
.name {
|
||||||
|
color: #39D47A;
|
||||||
|
}
|
||||||
|
|
||||||
|
.intro {
|
||||||
|
color: #39D47A;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
flex: 1;
|
||||||
|
padding-left: 10px;
|
||||||
|
|
||||||
|
.name {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.intro {
|
||||||
|
color: #999;
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,7 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-drawer title="订单详情" size="50%" :visible.sync="drawer" direction="rtl" v-loading="loading" >
|
<el-drawer
|
||||||
|
title="订单详情"
|
||||||
|
size="50%"
|
||||||
|
:visible.sync="drawer"
|
||||||
|
direction="rtl"
|
||||||
|
v-loading="loading"
|
||||||
|
>
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<div class="title" style="text-align: center;">【收银订单】</div>
|
<div class="title" style="text-align: center">【收银订单】</div>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="info_content">
|
<div class="info_content">
|
||||||
<div class="item">
|
<div class="item">
|
||||||
@@ -72,15 +78,20 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div>打包费:{{ detail.packFee || "-" }}</div>
|
<div>打包费:{{ detail.packFee || "-" }}</div>
|
||||||
<div>订单原价:¥{{ detail.originAmount }}</div>
|
<div>订单原价:¥{{ detail.originAmount }}</div>
|
||||||
<div>优惠金额:¥{{ detail.userCouponAmount || "-" }}</div>
|
<div>优惠金额:¥{{ youHuiJinE }}</div>
|
||||||
<div>
|
<div>
|
||||||
实收金额:<span style="color: red;">¥{{ detail.payAmount }}</span>
|
实收金额:<span style="color: red">¥{{ detail.payAmount }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div>
|
<div>
|
||||||
退款金额:¥{{ detail.refundAmount }}
|
退款金额:¥{{ detail.refundAmount }}
|
||||||
<span style="color: #FF9731;cursor: pointer;" v-if="detail.isRefund" @click="type = '3'">退款详情></span>
|
<span
|
||||||
|
style="color: #ff9731; cursor: pointer"
|
||||||
|
v-if="detail.isRefund"
|
||||||
|
@click="type = '3'"
|
||||||
|
>退款详情></span
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<div>支付方式:{{ detail.payType }}</div>
|
<div>支付方式:{{ detail.payType }}</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -100,20 +111,26 @@
|
|||||||
</div> -->
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div style="margin-bottom: 16px;font-size:16px;">商品信息</div>
|
<div style="margin-bottom: 16px; font-size: 16px">商品信息</div>
|
||||||
<el-table :data="detail.detailList">
|
<el-table :data="detail.detailList">
|
||||||
<el-table-column label="商品">
|
<el-table-column label="商品">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div class="shop_info">
|
<div class="shop_info">
|
||||||
<el-image v-if="scope.row.productSkuId!='-999'" :src="scope.row.productImg" style="width: 40px;height: 40px;"></el-image>
|
<el-image
|
||||||
|
v-if="scope.row.productSkuId != '-999'"
|
||||||
|
:src="scope.row.productImg"
|
||||||
|
style="width: 40px; height: 40px"
|
||||||
|
></el-image>
|
||||||
<div class="packeFee" v-else>
|
<div class="packeFee" v-else>
|
||||||
<span>
|
<span>
|
||||||
{{ scope.row.productName ||'客座费'}}
|
{{ scope.row.productName || "客座费" }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<span :class="[scope.row.isVip == 1 ? 'colorStyle' : '']">{{ scope.row.productName }}</span>
|
<span :class="[scope.row.isVip == 1 ? 'colorStyle' : '']">{{
|
||||||
<span style="color: #999;">{{
|
scope.row.productName
|
||||||
|
}}</span>
|
||||||
|
<span style="color: #999">{{
|
||||||
scope.row.productSkuName
|
scope.row.productSkuName
|
||||||
}}</span>
|
}}</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -121,29 +138,52 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="数量">
|
<el-table-column label="数量">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope"> x{{ scope.row.num }} </template>
|
||||||
x{{ scope.row.num }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="单价">
|
<el-table-column label="单价">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
¥{{ scope.row.price }}/
|
¥{{ scope.row.price }}
|
||||||
</template>
|
<!-- <template v-if="isUseCalcPrice(scope.row)">
|
||||||
|
<div class=""> ¥{{ (scope.row.canReturnAmount / scope.row.num) |to2 }}</div>
|
||||||
|
<div class="line-th"> ¥{{ scope.row.price }}</div>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<div v-if="isShowGoodsVipPrice(scope.row)">
|
||||||
|
<div class="" > ¥{{ scope.row.memberPrice }}</div>
|
||||||
|
<div class="line-th"> ¥{{ scope.row.price }}</div>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<div class="" > ¥{{ scope.row.price }}</div>
|
||||||
|
</div>
|
||||||
|
</template> -->
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="小计">
|
<el-table-column label="小计">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope"> ¥{{ scope.row.canReturnAmount }} </template>
|
||||||
¥{{ scope.row.priceAmount }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作">
|
<el-table-column label="操作">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<template v-if="scope.row.status!='unpaid'">
|
<template v-if="detail.status != 'unpaid'">
|
||||||
<el-button v-if="canTuikuan(scope.row)" type="text" size="mini" @click="tuikuan(scope.row)"><span >退款</span></el-button>
|
<el-button
|
||||||
|
v-if="canTuikuan(scope.row)"
|
||||||
|
type="text"
|
||||||
|
size="mini"
|
||||||
|
@click="tuikuan(scope.row)"
|
||||||
|
><span>退款</span></el-button
|
||||||
|
>
|
||||||
<span class="color-999" v-if="isTui(scope.row)">已退款</span>
|
<span class="color-999" v-if="isTui(scope.row)">已退款</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="scope.row.status=='unpaid'">
|
<template v-if="detail.status == 'unpaid'">
|
||||||
<el-button v-if="canTuicai(scope.row)" type="text" size="mini" @click="tuiCai(scope.row)"><span >退菜</span></el-button>
|
<el-button
|
||||||
<span class="color-999" v-if="scope.row=='return'">已退菜</span>
|
v-if="canTuicai(scope.row)"
|
||||||
|
type="text"
|
||||||
|
size="mini"
|
||||||
|
@click="tuiCai(scope.row)"
|
||||||
|
><span>退菜</span></el-button
|
||||||
|
>
|
||||||
|
<span class="color-999" v-if="scope.row == 'return'"
|
||||||
|
>已退菜</span
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -211,13 +251,13 @@
|
|||||||
<!-- </el-tabs> -->
|
<!-- </el-tabs> -->
|
||||||
</div>
|
</div>
|
||||||
<return-cart
|
<return-cart
|
||||||
:modal="false"
|
:modal="false"
|
||||||
ref="refReturnCart"
|
ref="refReturnCart"
|
||||||
:max="selGoods.num"
|
:max="selGoods.num"
|
||||||
@confirm="refReturnCartConfirm"
|
@confirm="refReturnCartConfirm"
|
||||||
></return-cart>
|
></return-cart>
|
||||||
<return-money
|
<return-money
|
||||||
:modal="false"
|
:modal="false"
|
||||||
ref="refReturnMoney"
|
ref="refReturnMoney"
|
||||||
:max="selGoods.num"
|
:max="selGoods.num"
|
||||||
:goods="selGoods"
|
:goods="selGoods"
|
||||||
@@ -232,12 +272,10 @@ import dayjs from "dayjs";
|
|||||||
import { tbOrderInfoDetail, tbOrderInfoData } from "@/api/order";
|
import { tbOrderInfoDetail, tbOrderInfoData } from "@/api/order";
|
||||||
import returnCart from "@/views/tool/Instead/components/return-cart.vue";
|
import returnCart from "@/views/tool/Instead/components/return-cart.vue";
|
||||||
import returnMoney from "@/views/tool/Instead/components/return-money.vue";
|
import returnMoney from "@/views/tool/Instead/components/return-money.vue";
|
||||||
import {
|
import { $returnCart, $returnOrder } from "@/api/table";
|
||||||
$returnCart,$returnOrder
|
import * as $util from "../order_goods_util.js";
|
||||||
} from "@/api/table";
|
|
||||||
import * as $util from '../order_goods_util.js'
|
|
||||||
export default {
|
export default {
|
||||||
components: { returnCart,returnMoney },
|
components: { returnCart, returnMoney },
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -247,27 +285,30 @@ export default {
|
|||||||
detail: "",
|
detail: "",
|
||||||
loading: false,
|
loading: false,
|
||||||
refoundList: [],
|
refoundList: [],
|
||||||
selGoods:{num:1}
|
selGoods: { num: 1 },
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
|
to2(n){
|
||||||
|
return Number(n).toFixed(2)
|
||||||
|
},
|
||||||
orderTypeFilter(t) {
|
orderTypeFilter(t) {
|
||||||
if (t) {
|
if (t) {
|
||||||
return t && orderEnum.orderType.find(item => item.key == t).label;
|
return t && orderEnum.orderType.find((item) => item.key == t).label;
|
||||||
} else {
|
} else {
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
sendTypeFilter(t) {
|
sendTypeFilter(t) {
|
||||||
if (t) {
|
if (t) {
|
||||||
return orderEnum.sendType.find(item => item.key == t).label;
|
return orderEnum.sendType.find((item) => item.key == t).label;
|
||||||
} else {
|
} else {
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
statusFilter(t) {
|
statusFilter(t) {
|
||||||
if (t) {
|
if (t) {
|
||||||
return t && orderEnum.status.find(item => item.key == t).label;
|
return t && orderEnum.status.find((item) => item.key == t).label;
|
||||||
} else {
|
} else {
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@@ -278,45 +319,89 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
return "-";
|
return "-";
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
watch:{
|
watch: {
|
||||||
drawer:function(newval){
|
drawer: function (newval) {
|
||||||
if(!newval){
|
if (!newval) {
|
||||||
this.close();
|
this.close();
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
vipDiscountAmount() {
|
||||||
|
if (!this.detail.memberId) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (this.detail.status == "unpaid") {
|
||||||
|
return this.detail.detailList
|
||||||
|
.filter((v) => !$util.isTui(v) && v.productId != "-999")
|
||||||
|
.reduce((prve, cur) => {
|
||||||
|
if (!cur.isMember) {
|
||||||
|
return prve + 0;
|
||||||
|
} else {
|
||||||
|
const memberPrice = cur.memberPrice ? cur.memberPrice : cur.price;
|
||||||
|
return prve + (cur.price - memberPrice) * cur.num;
|
||||||
|
}
|
||||||
|
}, 0)
|
||||||
|
.toFixed(2);
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
},
|
||||||
|
youHuiJinE() {
|
||||||
|
console.log(this.vipDiscountAmount);
|
||||||
|
const discountAmount=this.detail.discountAmount;
|
||||||
|
const n = $util.numSum([
|
||||||
|
this.vipDiscountAmount,
|
||||||
|
discountAmount,
|
||||||
|
this.detail.productCouponDiscountAmount,
|
||||||
|
this.detail.fullCouponDiscountAmount,
|
||||||
|
this.detail.pointsDiscountAmount,
|
||||||
|
]);
|
||||||
|
if (n * 1 <= 0) {
|
||||||
|
return "-";
|
||||||
|
}
|
||||||
|
return n;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
close(){
|
isShowGoodsVipPrice(item){
|
||||||
console.log('drawer close')
|
return $util.isShowGoodsVipPrice(item);
|
||||||
this.$emit('close');
|
|
||||||
},
|
},
|
||||||
isTui(item){
|
isUseCalcPrice(item){
|
||||||
|
return $util.isUseCalcPrice(this.detail,item);
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
console.log("drawer close");
|
||||||
|
this.$emit("close");
|
||||||
|
},
|
||||||
|
isTui(item) {
|
||||||
return $util.isTui(item);
|
return $util.isTui(item);
|
||||||
},
|
},
|
||||||
canTuikuan(item){
|
canTuikuan(item) {
|
||||||
return $util.canTuiKuan(this.detail,item);
|
return $util.canTuiKuan(this.detail, item);
|
||||||
},
|
},
|
||||||
canTuicai(item){
|
canTuicai(item) {
|
||||||
return $util.canTuicai(this.detail,item);
|
return $util.canTuicai(this.detail, item);
|
||||||
},
|
},
|
||||||
async refReturnMoneyConfirm(e){
|
async refReturnMoneyConfirm(e) {
|
||||||
const res = await $returnOrder({
|
const res = await $returnOrder({
|
||||||
...e,
|
...e,
|
||||||
orderId:this.detail.id,
|
orderId: this.detail.id,
|
||||||
orderDetails:[{
|
orderDetails: [
|
||||||
id:this.selGoods.id,
|
{
|
||||||
num:e.num
|
id: this.selGoods.id,
|
||||||
}]
|
num: e.num,
|
||||||
|
},
|
||||||
|
],
|
||||||
});
|
});
|
||||||
this.$message.success("退款成功");
|
this.$message.success("退款成功");
|
||||||
this.update();
|
this.update();
|
||||||
},
|
},
|
||||||
update(){
|
update() {
|
||||||
this.tbOrderInfoDetail(this.detail.id);
|
this.tbOrderInfoDetail(this.detail.id);
|
||||||
},
|
},
|
||||||
async refReturnCartConfirm(e){
|
async refReturnCartConfirm(e) {
|
||||||
const res = await $returnCart({
|
const res = await $returnCart({
|
||||||
...e,
|
...e,
|
||||||
cartId: this.selGoods.cartId,
|
cartId: this.selGoods.cartId,
|
||||||
@@ -325,13 +410,13 @@ export default {
|
|||||||
this.$message.success("退菜成功");
|
this.$message.success("退菜成功");
|
||||||
this.update();
|
this.update();
|
||||||
},
|
},
|
||||||
tuikuan(item){
|
tuikuan(item) {
|
||||||
this.selGoods=item;
|
this.selGoods = item;
|
||||||
console.log(item);
|
console.log(item);
|
||||||
this.$refs.refReturnMoney.open(item);
|
this.$refs.refReturnMoney.open({...item,priceAmount:item.canReturnAmount});
|
||||||
},
|
},
|
||||||
tuiCai(item){
|
tuiCai(item) {
|
||||||
this.selGoods=item;
|
this.selGoods = item;
|
||||||
console.log(item);
|
console.log(item);
|
||||||
this.$refs.refReturnCart.open(item);
|
this.$refs.refReturnCart.open(item);
|
||||||
},
|
},
|
||||||
@@ -348,7 +433,7 @@ export default {
|
|||||||
source: this.detail.id,
|
source: this.detail.id,
|
||||||
page: 0,
|
page: 0,
|
||||||
pageSize: 500,
|
pageSize: 500,
|
||||||
orderType: "0"
|
orderType: "0",
|
||||||
});
|
});
|
||||||
this.refoundList = res.content;
|
this.refoundList = res.content;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -371,23 +456,23 @@ export default {
|
|||||||
this.type = "1";
|
this.type = "1";
|
||||||
this.detail = "";
|
this.detail = "";
|
||||||
this.tbOrderInfoDetail(obj.id);
|
this.tbOrderInfoDetail(obj.id);
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.packeFee{
|
.packeFee {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
background: #3f9eff;
|
background: #3f9eff;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
.shop_info {
|
.shop_info {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -425,7 +510,9 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.line-th{
|
||||||
|
text-decoration: line-through;
|
||||||
|
}
|
||||||
.container {
|
.container {
|
||||||
padding: 0 20px;
|
padding: 0 20px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export function canTuicai(orderInfo,item){
|
|||||||
}
|
}
|
||||||
export function canTuiKuan(orderInfo,item){
|
export function canTuiKuan(orderInfo,item){
|
||||||
// return orderInfo.status!='unpaid'&& item.status!='return'&&item.status!='refund'&&item.status!='refunding'
|
// return orderInfo.status!='unpaid'&& item.status!='return'&&item.status!='refund'&&item.status!='refunding'
|
||||||
return orderInfo.status=='closed'&& item.status!='return'&&item.status!='refund'&&item.status!='refunding' && !item.userCouponId
|
return orderInfo.status=='closed'&& item.status!='return'&&item.status!='refund'&&item.status!='refunding'
|
||||||
}
|
}
|
||||||
export function isTui(item){
|
export function isTui(item){
|
||||||
return item.status=='return'||item.status=='refund'||item.status=='refunding'
|
return item.status=='return'||item.status=='refund'||item.status=='refunding'
|
||||||
@@ -28,4 +28,17 @@ export function numSum(arr){
|
|||||||
return a+b*100
|
return a+b*100
|
||||||
},0)
|
},0)
|
||||||
return (sum/100).toFixed(2)
|
return (sum/100).toFixed(2)
|
||||||
|
}
|
||||||
|
//是否使用计算的会员价
|
||||||
|
export function isUseCalcPrice(order,item){
|
||||||
|
console.log(order)
|
||||||
|
if(order.fullCouponDiscountAmount>0||order.pointsDiscountAmount>0){
|
||||||
|
return true
|
||||||
|
}else{
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//商品列表是否展示会员价
|
||||||
|
export function isShowGoodsVipPrice(item){
|
||||||
|
return item.isMember==1&&item.memberPrice&&item.memberPrice!=item.price
|
||||||
}
|
}
|
||||||
@@ -189,11 +189,13 @@
|
|||||||
style="margin-left: 20px !important;">
|
style="margin-left: 20px !important;">
|
||||||
<el-button type="text" icon="el-icon-edit">编辑</el-button>
|
<el-button type="text" icon="el-icon-edit">编辑</el-button>
|
||||||
</router-link> -->
|
</router-link> -->
|
||||||
<el-button type="text" icon="el-icon-edit" @click="toPath('/product/add_shop', scope.row)">编辑</el-button>
|
<div style="display: flex;gap: 10px;">
|
||||||
<el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
|
<el-button type="text" icon="el-icon-edit" @click="toPath('/product/add_shop', scope.row)"
|
||||||
<el-button type="text" icon="el-icon-delete" style="margin-left: 20px !important;"
|
v-if="scope.row.typeEnum">编辑</el-button>
|
||||||
slot="reference">删除</el-button>
|
<el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
|
||||||
</el-popconfirm>
|
<el-button type="text" icon="el-icon-delete" slot="reference">删除</el-button>
|
||||||
|
</el-popconfirm>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -244,7 +246,7 @@ import { tbProductListV2, tbShopCategoryGet, tbProductDelete, tbProductIsHot, up
|
|||||||
import { hasPermission } from '@/utils/limits.js'
|
import { hasPermission } from '@/utils/limits.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name:'product',
|
name: 'product',
|
||||||
components: {
|
components: {
|
||||||
BindCons,
|
BindCons,
|
||||||
StockHistory
|
StockHistory
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
confirm() {
|
confirm() {
|
||||||
|
console.log(this.form.discount / 100)
|
||||||
this.$emit("confirm", (this.form.discount / 100));
|
this.$emit("confirm", (this.form.discount / 100));
|
||||||
this.close();
|
this.close();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
v-for="(item, index) in list"
|
v-for="(item, index) in list"
|
||||||
:key="index"
|
:key="index"
|
||||||
:type="sel === item.payType ? 'primary' : ''"
|
:type="sel === item.payType ? 'primary' : ''"
|
||||||
|
:disabled="disabledPayType.includes(item.payType)"
|
||||||
>
|
>
|
||||||
{{ item.payName }}
|
{{ item.payName }}
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -30,6 +31,10 @@ export default {
|
|||||||
type: [String, Number],
|
type: [String, Number],
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
|
disabledPayType:{
|
||||||
|
type:Array,
|
||||||
|
default:()=>[]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -38,6 +43,10 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
disabledPayType(){
|
||||||
|
const item = this.list.find(v=>!this.disabledPayType.includes(v.payType))
|
||||||
|
this.sel=item.payType
|
||||||
|
},
|
||||||
sel(newval) {
|
sel(newval) {
|
||||||
console.log(newval);
|
console.log(newval);
|
||||||
this.$emit("input", newval);
|
this.$emit("input", newval);
|
||||||
|
|||||||
@@ -16,11 +16,7 @@
|
|||||||
:data="quans.fullReductionCoupon"
|
:data="quans.fullReductionCoupon"
|
||||||
@cell-click="fullReductionCouponClick"
|
@cell-click="fullReductionCouponClick"
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column type="index" label="">
|
||||||
type="index"
|
|
||||||
label=""
|
|
||||||
v-if="quans.fullReductionCoupon.length > 0"
|
|
||||||
>
|
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
@change="fullReductionCouponClick(scope.row)"
|
@change="fullReductionCouponClick(scope.row)"
|
||||||
@@ -65,10 +61,7 @@
|
|||||||
:data="quans.productCoupon"
|
:data="quans.productCoupon"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column>
|
||||||
label=""
|
|
||||||
v-if="quans.fullReductionCoupon.length > 0"
|
|
||||||
>
|
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
@change="productCouponClick(scope.row)"
|
@change="productCouponClick(scope.row)"
|
||||||
@@ -112,11 +105,11 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="useRestrictions" label="描述">
|
<el-table-column prop="useRestrictions" label="描述">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="useRestrictions" label="是否可用">
|
<!-- <el-table-column prop="useRestrictions" label="是否可用">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
{{ scope.row.use ? "可以" : "不可用" }}
|
{{ scope.row.use ? "可以" : "不可用" }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
@@ -232,11 +225,12 @@ export default {
|
|||||||
isVip: false,
|
isVip: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
orderPrice:0,
|
discount:1,
|
||||||
|
orderPrice: 0,
|
||||||
fullReductionCouponSel: {
|
fullReductionCouponSel: {
|
||||||
id: "",
|
id: "",
|
||||||
},
|
},
|
||||||
@@ -292,12 +286,15 @@ export default {
|
|||||||
//相同商品抵扣券数组
|
//相同商品抵扣券数组
|
||||||
const arr = this.quans.productCoupon.filter((v) => v.proId == row.proId);
|
const arr = this.quans.productCoupon.filter((v) => v.proId == row.proId);
|
||||||
const index = arr.findIndex((v) => v.id == row.id);
|
const index = arr.findIndex((v) => v.id == row.id);
|
||||||
|
const item=this.goodsArr.find((v) => v.productId == row.proId);
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
return returnProductCoupAllPrice(
|
const n=returnProductCoupAllPrice(
|
||||||
$goodsPayPriceMap[row.proId],
|
$goodsPayPriceMap[row.proId],
|
||||||
index,
|
index,
|
||||||
row.num
|
row.num,
|
||||||
);
|
item.isMember
|
||||||
|
)
|
||||||
|
return (n*this.discount).toFixed(2);
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -310,7 +307,8 @@ export default {
|
|||||||
const index = this.quansSelArr.findIndex((item) => item.id == row.id);
|
const index = this.quansSelArr.findIndex((item) => item.id == row.id);
|
||||||
if (row.type == 2 && index != -1) {
|
if (row.type == 2 && index != -1) {
|
||||||
this.quansSelArr.splice(index, 1);
|
this.quansSelArr.splice(index, 1);
|
||||||
this.quans.productCoupon[index].checked = false;
|
const proIndex=this.quans.productCoupon.findIndex((v) => v.id == row.id);
|
||||||
|
this.quans.productCoupon[proIndex].checked = false;
|
||||||
}
|
}
|
||||||
if (row.type == 1 && index != -1) {
|
if (row.type == 1 && index != -1) {
|
||||||
this.fullReductionCouponSel = { id: "" };
|
this.fullReductionCouponSel = { id: "" };
|
||||||
@@ -350,18 +348,46 @@ export default {
|
|||||||
if (!item.use) {
|
if (!item.use) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const hasSelNum = this.quansSelArr
|
||||||
|
.filter((v) => v.type == 2 && v.proId == item.proId)
|
||||||
|
.reduce((a, b) => {
|
||||||
|
return a + b.num;
|
||||||
|
}, 0);
|
||||||
|
const maxSelNum = $goodsPayPriceMap[item.proId].length;
|
||||||
|
const coupMaxUseNum = Math.min(item.num, maxSelNum - hasSelNum);
|
||||||
|
const canUseNum = Math.min(maxSelNum, coupMaxUseNum);
|
||||||
|
|
||||||
if (this.fullReductionCouponSel.id && !item.checked) {
|
if (this.fullReductionCouponSel.id && !item.checked) {
|
||||||
const goodsQuan = this.quans.productCoupon.filter((v) => v.checked);
|
const goodsQuan = this.quans.productCoupon.filter((v) => v.checked);
|
||||||
const fullReductionCoupon = this.fullReductionCouponSel.id
|
const fullReductionCoupon = this.fullReductionCouponSel.id
|
||||||
? [this.fullReductionCouponSel]
|
? [this.fullReductionCouponSel]
|
||||||
: [];
|
: [];
|
||||||
let coupArr = [...goodsQuan, item];
|
|
||||||
|
let coupArr = [...goodsQuan, { ...item, num: canUseNum }];
|
||||||
const payPrice =
|
const payPrice =
|
||||||
this.orderPrice -
|
this.orderPrice -
|
||||||
returnCouponAllPrice(coupArr, canDikouGoodsArr, this.vipUser);
|
returnCouponAllPrice(coupArr, canDikouGoodsArr, this.vipUser);
|
||||||
console.log(payPrice);
|
console.log(payPrice);
|
||||||
|
if (payPrice <= 0) {
|
||||||
|
return this.$confirm(
|
||||||
|
"选择该商品券后支付金额将为0,继续选择将取消选择的满减券",
|
||||||
|
"提示",
|
||||||
|
{
|
||||||
|
confirmButtonText: "继续选择",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
this.fullReductionCouponSel = {
|
||||||
|
id: "",
|
||||||
|
};
|
||||||
|
this.quansSelArr.splice(0, 1);
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
}
|
||||||
if (this.fullReductionCouponSel.fullAmount > payPrice) {
|
if (this.fullReductionCouponSel.fullAmount > payPrice) {
|
||||||
this.$confirm(
|
this.$confirm(
|
||||||
"选择该商品券后将不满足选择抵扣券的最低满减需求,继续选择将取消选择的满减券",
|
"选择该商品券后将不满足选择抵扣券的最低满减需求,继续选择将取消选择的满减券",
|
||||||
"提示",
|
"提示",
|
||||||
{
|
{
|
||||||
@@ -375,17 +401,27 @@ export default {
|
|||||||
id: "",
|
id: "",
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {
|
||||||
|
item.checked=false
|
||||||
|
const index = this.quansSelArr.findIndex((v) => v.id == item.id);
|
||||||
|
this.quansSelArr.splice(index, 1);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
item.checked = !item.checked;
|
item.checked = !item.checked;
|
||||||
|
if (!item.checked) {
|
||||||
|
console.log(index);
|
||||||
|
const index = this.quansSelArr.findIndex((v) => v.id == item.id);
|
||||||
|
this.quansSelArr.splice(index, 1);
|
||||||
|
} else {
|
||||||
|
this.quansSelArr.push({ ...item, num: canUseNum });
|
||||||
|
}
|
||||||
const CheckedArr = this.quans.productCoupon.filter((v) => v.checked);
|
const CheckedArr = this.quans.productCoupon.filter((v) => v.checked);
|
||||||
this.quansSelArr = [
|
if (CheckedArr.length <= 0) {
|
||||||
...(this.fullReductionCouponSel.id
|
return this.quans.productCoupon.map((v) => {
|
||||||
? [this.fullReductionCouponSel]
|
v.use = true;
|
||||||
: []),
|
});
|
||||||
...CheckedArr,
|
}
|
||||||
];
|
|
||||||
const noCheckedArr = this.quans.productCoupon.filter((v) => !v.checked);
|
const noCheckedArr = this.quans.productCoupon.filter((v) => !v.checked);
|
||||||
noCheckedArr.map((v) => {
|
noCheckedArr.map((v) => {
|
||||||
v.use = returnCoupCanUse(canDikouGoodsArr, v, CheckedArr);
|
v.use = returnCoupCanUse(canDikouGoodsArr, v, CheckedArr);
|
||||||
@@ -405,12 +441,12 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
confirm() {
|
confirm() {
|
||||||
this.$emit("confirm", [...this.quansSelArr]);
|
this.$emit("confirm", [...this.quansSelArr], $goodsPayPriceMap);
|
||||||
this.close();
|
this.close();
|
||||||
},
|
},
|
||||||
async open(data, propSelCoup) {
|
async open(data, propSelCoup) {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
this.orderPrice=data.orderPrice;
|
this.orderPrice = data.orderPrice;
|
||||||
this.quansSelArr = [...propSelCoup];
|
this.quansSelArr = [...propSelCoup];
|
||||||
$goodsPayPriceMap = returnGoodsPayPriceMap(this.goodsArr || []);
|
$goodsPayPriceMap = returnGoodsPayPriceMap(this.goodsArr || []);
|
||||||
if (data.memberId) {
|
if (data.memberId) {
|
||||||
@@ -419,7 +455,7 @@ export default {
|
|||||||
memberId: data.memberId,
|
memberId: data.memberId,
|
||||||
});
|
});
|
||||||
quansRes.fullReductionCoupon = quansRes.fullReductionCoupon.filter(
|
quansRes.fullReductionCoupon = quansRes.fullReductionCoupon.filter(
|
||||||
(v) => v.use && this.orderPrice * 1 >= v.fullAmount * 1
|
(v) =>this.orderPrice<=0?false:(v.use && this.orderPrice * 1 >= v.fullAmount * 1)
|
||||||
);
|
);
|
||||||
const selFullReductionCoupon = this.quansSelArr.find(
|
const selFullReductionCoupon = this.quansSelArr.find(
|
||||||
(v) => v.type == 1
|
(v) => v.type == 1
|
||||||
@@ -442,6 +478,7 @@ export default {
|
|||||||
checked: this.quansSelArr.find((selCoup) => selCoup.id == v.id)
|
checked: this.quansSelArr.find((selCoup) => selCoup.id == v.id)
|
||||||
? true
|
? true
|
||||||
: false,
|
: false,
|
||||||
|
use:this.orderPrice<=0?false:calcCoup.use
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.filter((v) => v.use);
|
.filter((v) => v.use);
|
||||||
|
|||||||
@@ -12,10 +12,18 @@
|
|||||||
<div class="u-flex color-999 u-m-t-4">
|
<div class="u-flex color-999 u-m-t-4">
|
||||||
{{ goods.productSkuName||'' }}
|
{{ goods.productSkuName||'' }}
|
||||||
</div>
|
</div>
|
||||||
<div class="flex u-row-between u-p-b-16 u-m-t-10 border-bottom">
|
<div class="u-p-b-16 border-bottom">
|
||||||
<span>退款数量</span>
|
<div class="flex u-row-between">
|
||||||
<div class="u-flex">
|
<span>退款数量</span>
|
||||||
<number-box v-model="number" :min="1" :max="max"></number-box>
|
<div class="u-flex" v-if="!isSeatFee">
|
||||||
|
<number-box v-model="number" :min="1" :max="max"></number-box>
|
||||||
|
</div>
|
||||||
|
<div class="u-flex" v-else>
|
||||||
|
{{ number }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="u-font-12 color-999 u-m-t-8" v-if="isSeatFee">
|
||||||
|
<div><span class="color-red">*</span><span>客座费只能全退</span> </div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="u-m-t-12 u-font-12 color-999">菜品已点数量 {{ max }} 份</div>
|
<div class="u-m-t-12 u-font-12 color-999">菜品已点数量 {{ max }} 份</div>
|
||||||
@@ -25,7 +33,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="u-flex u-m-t-12 ">
|
<div class="u-flex u-m-t-12 ">
|
||||||
<span>退款金额</span>
|
<span>退款金额</span>
|
||||||
<span class="color-red font-bold">¥{{ goods.price * number|to2 }}</span>
|
<span class="color-red font-bold">¥{{ tuikuanJine }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="u-m-t-26">
|
<div class="u-m-t-26">
|
||||||
<div><span>退款原因</span> <span class="color-red">*</span></div>
|
<div><span>退款原因</span> <span class="color-red">*</span></div>
|
||||||
@@ -57,6 +65,8 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import numberBox from "./number-box.vue";
|
import numberBox from "./number-box.vue";
|
||||||
|
import {returnIsSeatFee} from '../util.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { numberBox },
|
components: { numberBox },
|
||||||
props: {
|
props: {
|
||||||
@@ -64,12 +74,6 @@ export default {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
goods: {
|
|
||||||
type: Object,
|
|
||||||
default: () => {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
max: {
|
max: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 1,
|
default: 1,
|
||||||
@@ -87,8 +91,20 @@ export default {
|
|||||||
{ label: "等待时间过长", checked: false },
|
{ label: "等待时间过长", checked: false },
|
||||||
],
|
],
|
||||||
note: "",
|
note: "",
|
||||||
|
goods:{
|
||||||
|
productId: -999
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
computed:{
|
||||||
|
tuikuanJine(){
|
||||||
|
const danjia=(this.goods.priceAmount||0)/this.goods.num
|
||||||
|
return (danjia*this.number).toFixed(2);
|
||||||
|
},
|
||||||
|
isSeatFee(){
|
||||||
|
return returnIsSeatFee(this.goods)
|
||||||
|
}
|
||||||
|
},
|
||||||
filters:{
|
filters:{
|
||||||
to2(val){
|
to2(val){
|
||||||
return val.toFixed(2);
|
return val.toFixed(2);
|
||||||
@@ -112,9 +128,15 @@ export default {
|
|||||||
}
|
}
|
||||||
this.note = tag + "," + this.note;
|
this.note = tag + "," + this.note;
|
||||||
},
|
},
|
||||||
open(note) {
|
open(item) {
|
||||||
|
this.goods = item?item:this.goods;
|
||||||
|
console.log(item)
|
||||||
this.show = true;
|
this.show = true;
|
||||||
this.number = 1;
|
if (item.productId != "-999") {
|
||||||
|
this.number = 1;
|
||||||
|
} else {
|
||||||
|
this.number = item.num;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
this.show = false;
|
this.show = false;
|
||||||
|
|||||||
@@ -982,9 +982,14 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="discountAmount" label="抵扣">
|
<el-table-column prop="discountAmount" label="抵扣">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<span class="color-red">
|
<span class="color-red" v-if="scope.row.type == 1">
|
||||||
¥{{ scope.row.discountAmount }}
|
¥{{ scope.row.discountAmount }}
|
||||||
</span>
|
</span>
|
||||||
|
<span class="color-red" v-if="scope.row.type == 2">
|
||||||
|
¥{{
|
||||||
|
returnProDiscount(scope.row, scope.row.index)
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="useRestrictions" label="">
|
<el-table-column prop="useRestrictions" label="">
|
||||||
@@ -1011,6 +1016,7 @@
|
|||||||
ref="refPayType"
|
ref="refPayType"
|
||||||
v-model="order.payType"
|
v-model="order.payType"
|
||||||
@itemClick="payTypeItemClick"
|
@itemClick="payTypeItemClick"
|
||||||
|
:disabledPayType="disabledPayType"
|
||||||
>
|
>
|
||||||
</pay-type>
|
</pay-type>
|
||||||
<div style="margin-top: 20px">
|
<div style="margin-top: 20px">
|
||||||
@@ -1059,16 +1065,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="detail_form_item">
|
<div class="detail_form_item">
|
||||||
<div class="left">积分抵扣</div>
|
<div class="left">积分抵扣</div>
|
||||||
<div class="right">-¥{{ points.toMoney | to2 }}</div>
|
<div class="right">-¥{{ pointsDiscountAmount | to2 }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="detail_form_item">
|
<div class="detail_form_item">
|
||||||
<div class="left">整单改价</div>
|
<div class="left">整单改价</div>
|
||||||
<div class="right">
|
<div class="right">-¥{{ gaijia | to2 }}</div>
|
||||||
-¥{{
|
|
||||||
((1 - createOrder.discount) * createOrder.data.amount)
|
|
||||||
| to2
|
|
||||||
}}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="detail_form_item" v-if="createOrder.data.packFee">
|
<div class="detail_form_item" v-if="createOrder.data.packFee">
|
||||||
<div class="left">打包费</div>
|
<div class="left">打包费</div>
|
||||||
@@ -1094,13 +1095,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="detail_form_item">
|
<div class="detail_form_item">
|
||||||
<div class="left">应付金额</div>
|
<div class="left">应付金额</div>
|
||||||
<div class="right redfont">
|
<div class="right redfont">¥{{ yinFuJinE }}</div>
|
||||||
¥{{
|
|
||||||
currentPayMoney - points.toMoney <= 0
|
|
||||||
? 0
|
|
||||||
: (currentPayMoney - points.toMoney) | to2
|
|
||||||
}}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="line"></div>
|
<div class="line"></div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1481,6 +1476,9 @@ import {
|
|||||||
returnVipDiscountPrice,
|
returnVipDiscountPrice,
|
||||||
returnCouponAllPrice,
|
returnCouponAllPrice,
|
||||||
} from "./util.js";
|
} from "./util.js";
|
||||||
|
import { returnProductCoupAllPrice } from "./quan_util.js";
|
||||||
|
//商品数量从0到n每一个对应的价格
|
||||||
|
let $goodsPayPriceMap = {};
|
||||||
import { $status } from "@/utils/table.js";
|
import { $status } from "@/utils/table.js";
|
||||||
|
|
||||||
let $originTableList = [];
|
let $originTableList = [];
|
||||||
@@ -1501,6 +1499,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
disabledPayType: [],
|
||||||
//积分抵扣
|
//积分抵扣
|
||||||
points: {
|
points: {
|
||||||
res: {
|
res: {
|
||||||
@@ -1609,7 +1608,7 @@ export default {
|
|||||||
total: 0,
|
total: 0,
|
||||||
},
|
},
|
||||||
order: {
|
order: {
|
||||||
status:'',
|
status: "",
|
||||||
packFee: {
|
packFee: {
|
||||||
totalNumber: 0,
|
totalNumber: 0,
|
||||||
status: "",
|
status: "",
|
||||||
@@ -1714,50 +1713,45 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
pointsDiscountAmount() {
|
||||||
|
if (this.points.selected) {
|
||||||
|
return this.points.toMoney;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
gaijia() {
|
||||||
|
const disCountOriginPrice =
|
||||||
|
this.createOrder.data.amount - this.coupdiscount;
|
||||||
|
const disocunt = (1 - this.createOrder.discount) * disCountOriginPrice;
|
||||||
|
return disocunt.toFixed(2);
|
||||||
|
},
|
||||||
|
pointsCanDicountMoney() {
|
||||||
|
return (this.yinFuJinE - this.points.toMoney).toFixed(2);
|
||||||
|
},
|
||||||
isShowVipPrice() {
|
isShowVipPrice() {
|
||||||
if(!this.shopInfo.isMemberPrice){
|
if (!this.shopInfo.isMemberPrice) {
|
||||||
return false
|
return false;
|
||||||
}
|
}
|
||||||
return this.vipUser.isVip ? true : false;
|
return this.vipUser.isVip ? true : false;
|
||||||
},
|
},
|
||||||
coupdiscount() {
|
coupdiscount() {
|
||||||
return returnCouponAllPrice(
|
const n = this.quansSelArr.reduce((prve, cur) => {
|
||||||
this.quansSelArr,
|
return prve + cur.discountAmount * 1;
|
||||||
this.createOrder.data.detailList || [],
|
}, 0);
|
||||||
this.vipUser
|
return n;
|
||||||
);
|
|
||||||
},
|
},
|
||||||
goodsDisCount() {
|
|
||||||
const goodsQuanArr = this.quansSelArr.filter((v) => v.type == 2);
|
|
||||||
let result = 0;
|
|
||||||
if (goodsQuanArr.length < 0) {
|
|
||||||
result = 0;
|
|
||||||
} else {
|
|
||||||
result = goodsQuanArr.reduce((a, b) => {
|
|
||||||
const item = this.createOrder.data.detailList.find(
|
|
||||||
(v) => v.productId == b.proId
|
|
||||||
);
|
|
||||||
const memberPrice = item.memberPrice ? item.memberPrice : item.price;
|
|
||||||
const price = item
|
|
||||||
? this.vipUser.isVip
|
|
||||||
? memberPrice
|
|
||||||
: item.price
|
|
||||||
: 0;
|
|
||||||
return a + price;
|
|
||||||
}, 0);
|
|
||||||
}
|
|
||||||
return result.toFixed(2);
|
|
||||||
},
|
|
||||||
|
|
||||||
currentPayMoney() {
|
currentPayMoney() {
|
||||||
const amount = this.createOrder.data.amount || 0;
|
const amount = this.createOrder.data.amount || 0;
|
||||||
const discount = this.createOrder.discount || 1;
|
const discount = this.createOrder.discount || 1;
|
||||||
// const total=((amount - this.coupdiscount) * this.createOrder.discount - this.points.toMoney)
|
// const total=((amount - this.coupdiscount) * this.createOrder.discount - this.points.toMoney)
|
||||||
const total = (amount - this.coupdiscount) * this.createOrder.discount;
|
const total = amount - this.gaijia - this.coupdiscount;
|
||||||
return total <= 0 ? 0 : total;
|
return total <= 0 ? 0 : total;
|
||||||
},
|
},
|
||||||
yinFuJinE() {
|
yinFuJinE() {
|
||||||
const total = this.currentPayMoney - (this.points.toMoney || 0);
|
const total =
|
||||||
|
this.currentPayMoney - (this.points.selected ? this.points.toMoney : 0);
|
||||||
|
console.log(total);
|
||||||
if (this.isCreateOrder) {
|
if (this.isCreateOrder) {
|
||||||
return total.toFixed(2);
|
return total.toFixed(2);
|
||||||
} else {
|
} else {
|
||||||
@@ -1881,13 +1875,20 @@ export default {
|
|||||||
const seatFee =
|
const seatFee =
|
||||||
this.order.seatFee.totalAmount *
|
this.order.seatFee.totalAmount *
|
||||||
(returnStatus.includes(this.order.seatFee.status) ? 0 : 1);
|
(returnStatus.includes(this.order.seatFee.status) ? 0 : 1);
|
||||||
|
// return (
|
||||||
|
// (oldPrice + price + +packFee + seatFee - this.youhuiAllPrice) *
|
||||||
|
// this.createOrder.discount
|
||||||
|
// ).toFixed(2);
|
||||||
return (
|
return (
|
||||||
(oldPrice + price + +packFee + seatFee - this.youhuiAllPrice) *
|
oldPrice +
|
||||||
this.createOrder.discount
|
price +
|
||||||
|
+packFee +
|
||||||
|
seatFee -
|
||||||
|
this.youhuiAllPrice
|
||||||
).toFixed(2);
|
).toFixed(2);
|
||||||
},
|
},
|
||||||
vipDiscountPrice() {
|
vipDiscountPrice() {
|
||||||
if (!this.vipUser.isVip) {
|
if (!this.vipUser.isVip || !this.shopInfo.isMemberPrice) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
const oldMemberPrice = this.order.old.list.reduce((a, b) => {
|
const oldMemberPrice = this.order.old.list.reduce((a, b) => {
|
||||||
@@ -1972,16 +1973,28 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
yinFuJinE: function (newval) {
|
||||||
|
if (newval <= 0) {
|
||||||
|
this.disabledPayType = ["scanCode", "deposit"];
|
||||||
|
} else {
|
||||||
|
this.disabledPayType = [];
|
||||||
|
}
|
||||||
|
},
|
||||||
"goods.query.categoryId": function (newval) {
|
"goods.query.categoryId": function (newval) {
|
||||||
this.goods.query.page = 1;
|
this.goods.query.page = 1;
|
||||||
this.goods.list = [];
|
this.goods.list = [];
|
||||||
this.goods.status = "loadmore";
|
this.goods.status = "loadmore";
|
||||||
this.getGoods();
|
this.getGoods();
|
||||||
},
|
},
|
||||||
|
pointsCanDicountMoney: function (newval) {
|
||||||
|
this.getCalcUsablePoints();
|
||||||
|
},
|
||||||
currentPayMoney: function (newval) {
|
currentPayMoney: function (newval) {
|
||||||
if (this.createOrder.data.memberId || this.vipUser.id) {
|
if (this.createOrder.data.memberId || this.vipUser.id) {
|
||||||
this.getCalcUsablePoints().then((res) => {
|
this.getCalcUsablePoints().then((res) => {
|
||||||
this.pointsValueChange(this.points.value);
|
if (this.points.selected) {
|
||||||
|
this.pointsValueChange(this.points.value);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -2039,9 +2052,16 @@ export default {
|
|||||||
// this.masterId = masterId;
|
// this.masterId = masterId;
|
||||||
console.log("this.createOrder.data");
|
console.log("this.createOrder.data");
|
||||||
console.log(this.createOrder.data);
|
console.log(this.createOrder.data);
|
||||||
if(this.order.status=='finish'){
|
if (this.order.status == "finish") {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
if (
|
||||||
|
!this.table.tableId &&
|
||||||
|
this.order.list.length <= 0 &&
|
||||||
|
this.order.old.list.length <= 0
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
$setUser({
|
$setUser({
|
||||||
tableId: this.table.tableId,
|
tableId: this.table.tableId,
|
||||||
masterId: this.masterId,
|
masterId: this.masterId,
|
||||||
@@ -2054,8 +2074,8 @@ export default {
|
|||||||
this.getOrderData().then(() => {
|
this.getOrderData().then(() => {
|
||||||
this.pointsValueChange(this.points.value);
|
this.pointsValueChange(this.points.value);
|
||||||
});
|
});
|
||||||
}else{
|
} else {
|
||||||
this.getCart()
|
this.getCart();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -2174,6 +2194,27 @@ export default {
|
|||||||
this.open(this.$route.query);
|
this.open(this.$route.query);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
returnProDiscount(row) {
|
||||||
|
console.log(row);
|
||||||
|
//相同商品抵扣券数组
|
||||||
|
const arr = this.quansSelArr.filter((v) => v.proId == row.proId);
|
||||||
|
const index = arr.findIndex((v) => v.id == row.id);
|
||||||
|
const item = this.createOrder.data.detailList.find(
|
||||||
|
(v) => v.productId == row.proId
|
||||||
|
);
|
||||||
|
|
||||||
|
if (index != -1) {
|
||||||
|
const n = returnProductCoupAllPrice(
|
||||||
|
$goodsPayPriceMap[row.proId],
|
||||||
|
index,
|
||||||
|
row.num,
|
||||||
|
item.isMember
|
||||||
|
);
|
||||||
|
return (n * this.createOrder.discount).toFixed(2);
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
},
|
||||||
lingshicaiShow() {
|
lingshicaiShow() {
|
||||||
this.$refs.refPopAddCai.open();
|
this.$refs.refPopAddCai.open();
|
||||||
},
|
},
|
||||||
@@ -2182,6 +2223,13 @@ export default {
|
|||||||
console.log(index);
|
console.log(index);
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
this.quansSelArr.splice(index, 1);
|
this.quansSelArr.splice(index, 1);
|
||||||
|
this.quansSelArr
|
||||||
|
.map((v, index) => {
|
||||||
|
return {
|
||||||
|
...v,
|
||||||
|
discountAmount:v.type==2?this.returnProDiscount(v):v.discountAmount,
|
||||||
|
};
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async getCalcUsablePoints() {
|
async getCalcUsablePoints() {
|
||||||
@@ -2201,6 +2249,9 @@ export default {
|
|||||||
this.vipUser.accountPoints,
|
this.vipUser.accountPoints,
|
||||||
this.points.res.maxUsablePoints || 0
|
this.points.res.maxUsablePoints || 0
|
||||||
);
|
);
|
||||||
|
if(!pointsRes.usable){
|
||||||
|
this.points.selected=false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return pointsRes;
|
return pointsRes;
|
||||||
},
|
},
|
||||||
@@ -2234,14 +2285,24 @@ export default {
|
|||||||
{
|
{
|
||||||
id: this.createOrder.data.id,
|
id: this.createOrder.data.id,
|
||||||
memberId: this.createOrder.data.memberId || this.vipUser.id,
|
memberId: this.createOrder.data.memberId || this.vipUser.id,
|
||||||
orderPrice:(this.yinFuJinE*1+this.coupdiscount*1).toFixed(2)
|
orderPrice: (this.yinFuJinE * 1 + this.coupdiscount * 1).toFixed(2),
|
||||||
|
discount: this.createOrder.discount,
|
||||||
},
|
},
|
||||||
[...this.quansSelArr]
|
[...this.quansSelArr]
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
quansConfirm(e) {
|
quansConfirm(e, goodsPayPriceMap) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
|
this.createOrder.discount = 1;
|
||||||
|
this.points.selected = "";
|
||||||
|
e.map((v, index) => {
|
||||||
|
return {
|
||||||
|
...v,
|
||||||
|
discountAmount:v.type==2? this.returnProDiscount(v):v.discountAmount,
|
||||||
|
};
|
||||||
|
});
|
||||||
this.quansSelArr = [...e];
|
this.quansSelArr = [...e];
|
||||||
|
$goodsPayPriceMap = goodsPayPriceMap;
|
||||||
},
|
},
|
||||||
searchInput(e) {
|
searchInput(e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
@@ -2287,7 +2348,7 @@ export default {
|
|||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
await this.returnCreateOrderData();
|
await this.returnCreateOrderData();
|
||||||
this.payBeforeClear();
|
// this.payBeforeClear();
|
||||||
// this.order.payType = "";
|
// this.order.payType = "";
|
||||||
},
|
},
|
||||||
async cashPayClick() {
|
async cashPayClick() {
|
||||||
@@ -2380,10 +2441,13 @@ export default {
|
|||||||
if (!canJiesuan) {
|
if (!canJiesuan) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const order = await this.returnCreateOrderData();
|
if (!this.isCreateOrder) {
|
||||||
this.order.payType = "scanCode";
|
const order = await this.returnCreateOrderData();
|
||||||
this.payTypeItemClick({ payType: "scanCode", order });
|
this.order.payType = "scanCode";
|
||||||
this.payBeforeClear();
|
this.payTypeItemClick({ payType: "scanCode", order });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.payTypeItemClick({ payType: "scanCode" });
|
||||||
},
|
},
|
||||||
async changeOrderUseType(useType) {
|
async changeOrderUseType(useType) {
|
||||||
if (useType && this.order.list.length) {
|
if (useType && this.order.list.length) {
|
||||||
@@ -2520,10 +2584,11 @@ export default {
|
|||||||
},
|
},
|
||||||
//退菜
|
//退菜
|
||||||
async refReturnCartConfirm(e) {
|
async refReturnCartConfirm(e) {
|
||||||
console.log(this.order.selGoods);
|
|
||||||
const res = await $returnCart({
|
const res = await $returnCart({
|
||||||
...e,
|
...e,
|
||||||
cartId: this.order.selGoods.cartId,
|
cartId: this.isCreateOrder
|
||||||
|
? this.order.selGoods.id
|
||||||
|
: this.order.selGoods.cartId,
|
||||||
tableId: this.table.tableId,
|
tableId: this.table.tableId,
|
||||||
});
|
});
|
||||||
this.order.selGoods.status = "return";
|
this.order.selGoods.status = "return";
|
||||||
@@ -2642,14 +2707,41 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
ChangeDiscount(discount) {
|
ChangeDiscount(discount) {
|
||||||
|
const fullCoupIndex = this.quansSelArr.findIndex((v) => v.type == 1);
|
||||||
|
const fullCoup = this.quansSelArr[fullCoupIndex];
|
||||||
this.createOrder.discount = discount;
|
this.createOrder.discount = discount;
|
||||||
|
if (fullCoup && this.yinFuJinE < fullCoup.fullAmount) {
|
||||||
|
return this.$confirm(
|
||||||
|
"改价后价格不满足满减券最低满减需求" + fullCoup.fullAmount + "元",
|
||||||
|
"提示",
|
||||||
|
{
|
||||||
|
confirmButtonText: "删除满减券",
|
||||||
|
cancelButtonText: "取消改价",
|
||||||
|
type: "warning",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
this.quansSelArr.splice(fullCoupIndex, 1);
|
||||||
|
this.createOrder.discount = discount;
|
||||||
|
})
|
||||||
|
.catch((action) => {
|
||||||
|
this.createOrder.discount = 1;
|
||||||
|
this.$message({
|
||||||
|
type: "info",
|
||||||
|
message: "已取消改价",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async disCountShow() {
|
async disCountShow() {
|
||||||
const canDiscount = await hasPermission("允许打折");
|
const canDiscount = await hasPermission("允许打折");
|
||||||
if (!canDiscount) {
|
if (!canDiscount) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const amount = this.createOrder.data.amount - this.coupdiscount;
|
const amount = (this.createOrder.data.amount - this.coupdiscount).toFixed(
|
||||||
|
2
|
||||||
|
);
|
||||||
|
console.log(amount);
|
||||||
this.refToggle("refDiscount", true, {
|
this.refToggle("refDiscount", true, {
|
||||||
amount,
|
amount,
|
||||||
discount: this.createOrder.discount * 100,
|
discount: this.createOrder.discount * 100,
|
||||||
@@ -2837,7 +2929,7 @@ export default {
|
|||||||
title: "支付成功",
|
title: "支付成功",
|
||||||
type: "success",
|
type: "success",
|
||||||
});
|
});
|
||||||
this.order.status='finish'
|
this.order.status = "finish";
|
||||||
this.close();
|
this.close();
|
||||||
// this.reset();
|
// this.reset();
|
||||||
},
|
},
|
||||||
@@ -3069,11 +3161,14 @@ export default {
|
|||||||
}
|
}
|
||||||
if (key === "returnCart") {
|
if (key === "returnCart") {
|
||||||
console.log(this.order);
|
console.log(this.order);
|
||||||
let selGoods=undefined
|
let selGoods = undefined;
|
||||||
if(this.order.selPlaceNum==-10){
|
if (this.order.selPlaceNum == -10) {
|
||||||
selGoods = {...this.order.seatFee,num:this.order.seatFee.number}
|
selGoods = { ...this.order.seatFee, num: this.order.seatFee.number };
|
||||||
}else{
|
} else {
|
||||||
selGoods = this.order.old.list[this.order.selPlaceNum-1].info[this.order.old.selIndex];
|
selGoods =
|
||||||
|
this.order.old.list[this.order.selPlaceNum - 1].info[
|
||||||
|
this.order.old.selIndex
|
||||||
|
];
|
||||||
}
|
}
|
||||||
console.log(selGoods);
|
console.log(selGoods);
|
||||||
this.refToggle("refReturnCart", true, selGoods);
|
this.refToggle("refReturnCart", true, selGoods);
|
||||||
@@ -3542,6 +3637,7 @@ export default {
|
|||||||
},
|
},
|
||||||
reset() {
|
reset() {
|
||||||
// this.goods.list = [];
|
// this.goods.list = [];
|
||||||
|
this.order.status = "";
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.table = "";
|
this.table = "";
|
||||||
this.order.list = [];
|
this.order.list = [];
|
||||||
@@ -3915,7 +4011,6 @@ export default {
|
|||||||
this.$router.replace({ path: "/tool/table_list" });
|
this.$router.replace({ path: "/tool/table_list" });
|
||||||
} else {
|
} else {
|
||||||
this.$router.replace({ path: "/tool/Instead/index" });
|
this.$router.replace({ path: "/tool/Instead/index" });
|
||||||
this.$router.go(0);
|
|
||||||
// this.reset();
|
// this.reset();
|
||||||
// this.$router.replace({ path: "/tool/Instead/index" });
|
// this.$router.replace({ path: "/tool/Instead/index" });
|
||||||
}
|
}
|
||||||
@@ -4479,6 +4574,15 @@ input[type="number"]::-webkit-outer-spin-button {
|
|||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
::v-deep input[aria-hidden="true"] {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep
|
||||||
|
.el-radio:focus:not(.is-focus):not(:active):not(.is-disabled)
|
||||||
|
.el-radio__inner {
|
||||||
|
box-shadow: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
::v-deep .categorys .el-tag--plain.el-tag--info {
|
::v-deep .categorys .el-tag--plain.el-tag--info {
|
||||||
border: 1px solid #dcdfe6;
|
border: 1px solid #dcdfe6;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ export function isTui(item) {
|
|||||||
return item.status == 'return' || item.status == 'refund' || item.status == 'refunding'
|
return item.status == 'return' || item.status == 'refund' || item.status == 'refunding'
|
||||||
}
|
}
|
||||||
//是否使用会员价
|
//是否使用会员价
|
||||||
export function isUseMemberPrice(vipUser,goods){
|
export function isUseVipPrice(vipUser,goods){
|
||||||
return vipUser.id&&vipUser.isVip&&goods.isMember
|
return vipUser.id&&vipUser.isVip&&goods.isMember
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ export function returnProductCouponPrice(coup, goodsArr, vipUser) {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
const memberPrice = item.memberPrice ? item.memberPrice : item.price;
|
const memberPrice = item.memberPrice ? item.memberPrice : item.price;
|
||||||
const price = item ? (isUseMemberPrice(vipUser,item) ? memberPrice : item.price) : 0;
|
const price = item ? (isUseVipPrice(vipUser,item) ? memberPrice : item.price) : 0;
|
||||||
return price * coup.num
|
return price * coup.num
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,8 @@ export function returnCoupCanUse(goodsArr = [], coup, selCoupArr = []) {
|
|||||||
if (selCoupNumber >= findGoodsTotalNumber) {
|
if (selCoupNumber >= findGoodsTotalNumber) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return findGoodsTotalNumber < (coup.num + selCoupNumber) ? false : true
|
console.log(selCoupNumber,findGoodsTotalNumber);
|
||||||
|
return findGoodsTotalNumber < selCoupNumber ? false : true
|
||||||
}
|
}
|
||||||
//查找购物车商品根据购物车商品数据返回商品券信息(抵扣价格以及是否满足可用需求)
|
//查找购物车商品根据购物车商品数据返回商品券信息(抵扣价格以及是否满足可用需求)
|
||||||
export function returnProductCoupon(coup, goodsArr, vipUser, selCoupArr = []) {
|
export function returnProductCoupon(coup, goodsArr, vipUser, selCoupArr = []) {
|
||||||
@@ -54,12 +55,13 @@ 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 ? (isUseMemberPrice(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);
|
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
|
||||||
|
const canUse=coup.use
|
||||||
return {
|
return {
|
||||||
...coup,
|
...coup,
|
||||||
discountAmount: discountAmount,
|
discountAmount: discountAmount,
|
||||||
@@ -85,21 +87,39 @@ export function returnProductAllCoup(coupArr, goodsArr, vipUser) {
|
|||||||
//返回商品实际支付价格
|
//返回商品实际支付价格
|
||||||
export function returnProductPayPrice(goods,vipUser){
|
export function returnProductPayPrice(goods,vipUser){
|
||||||
const memberPrice = goods.memberPrice ? goods.memberPrice : goods.price;
|
const memberPrice = goods.memberPrice ? goods.memberPrice : goods.price;
|
||||||
const price = isUseMemberPrice(vipUser,goods) ? memberPrice : goods.price;
|
const price = isUseVipPrice(vipUser,goods) ? memberPrice : goods.price;
|
||||||
return price
|
return price
|
||||||
}
|
}
|
||||||
//返回商品券抵扣的商品价格
|
//返回商品券抵扣的商品价格
|
||||||
export function returnProductCoupAllPrice(productPriceArr,startIndex,num){
|
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'){
|
||||||
curPrice=cur.memberPrice*1
|
curPrice=isMember?cur.memberPrice*1:cur.price
|
||||||
}else{
|
}else{
|
||||||
curPrice=cur*1
|
curPrice=cur*1
|
||||||
}
|
}
|
||||||
return prve+curPrice
|
return prve+curPrice
|
||||||
},0)
|
},0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//返回商品券可抵扣的商品数量
|
||||||
|
export function returnProductCanUseNum(productPriceArr,startIndex,num){
|
||||||
|
console.log(productPriceArr);
|
||||||
|
console.log(num);
|
||||||
|
let n=0;
|
||||||
|
for(let i=0;i<num;i++){
|
||||||
|
if(productPriceArr[startIndex*1+i]){
|
||||||
|
n+=1
|
||||||
|
console.log(n);
|
||||||
|
}else{
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
//返回同类商品券在同类商品价格数组里的开始位置
|
//返回同类商品券在同类商品价格数组里的开始位置
|
||||||
export function returnProCoupStartIndex(coupArr,index){
|
export function returnProCoupStartIndex(coupArr,index){
|
||||||
return coupArr.slice(0,index).reduce((prve,cur)=>{
|
return coupArr.slice(0,index).reduce((prve,cur)=>{
|
||||||
@@ -166,7 +186,9 @@ export function returnProductCouponAllPrice(coupArr, goodsArr, vipUser) {
|
|||||||
}
|
}
|
||||||
const proCoupStartIndex=returnProCoupStartIndex(arr,i)
|
const proCoupStartIndex=returnProCoupStartIndex(arr,i)
|
||||||
console.log(proCoupStartIndex);
|
console.log(proCoupStartIndex);
|
||||||
total+=returnProductCoupAllPrice(goodsPayPriceMap[coup.proId],proCoupStartIndex,coup.num)
|
const coupNum=Math.min(goodsPayPriceMap[coup.proId].length,coup.num)
|
||||||
|
console.log(coupNum);
|
||||||
|
total+=returnProductCoupAllPrice(goodsPayPriceMap[coup.proId],proCoupStartIndex,coupNum)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,12 +217,34 @@ export function returnCouponAllPrice(coupArr, goodsArr, vipUser) {
|
|||||||
export function returnCanUseFullReductionCoupon(coupArr, payPrice, selCoup) {
|
export function returnCanUseFullReductionCoupon(coupArr, payPrice, selCoup) {
|
||||||
return coupArr.map(v => {
|
return coupArr.map(v => {
|
||||||
if (v.id == selCoup.id) {
|
if (v.id == selCoup.id) {
|
||||||
return v
|
return {...v,use:true}
|
||||||
|
}
|
||||||
|
const isfullAmount = payPrice*1 >= v.fullAmount * 1
|
||||||
|
if(payPrice<=0){
|
||||||
|
return {
|
||||||
|
...v,
|
||||||
|
use: false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const isfullAmount = payPrice >= v.fullAmount * 1
|
|
||||||
return {
|
return {
|
||||||
...v,
|
...v,
|
||||||
use: v.use && isfullAmount
|
use: v.use && isfullAmount
|
||||||
}
|
}
|
||||||
})
|
}).filter(v => v.use)
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据商品数量还有商品券数量返回优惠券可以使用的数量数组
|
||||||
|
export function returnCanUseNumProductCoup(coupArr,){
|
||||||
|
let productCoup = coupArr.filter(v => v.type == 2)
|
||||||
|
//商品券分组
|
||||||
|
let coupMap={}
|
||||||
|
for(let i in productCoup){
|
||||||
|
const coup=productCoup[i]
|
||||||
|
if(coupMap.hasOwnProperty(coup.proId)){
|
||||||
|
coupMap[coup.proId].push(coup)
|
||||||
|
}else{
|
||||||
|
coupMap[coup.proId]=[coup]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return arr
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user