This commit is contained in:
魏啾 2024-11-26 10:59:01 +08:00
commit feea4c04a6
18 changed files with 582 additions and 202 deletions

View File

@ -6,10 +6,10 @@ ENV = 'production'
# 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'
# 如果接口是 http 形式, wss 需要改为 ws

View File

@ -30,10 +30,11 @@ export function getbinding(data) {
* 获取应用中心列表
* @returns
*/
export function appCenterGet() {
export function appCenterGet(params) {
return request({
url: "/api/appCenter",
method: "get"
method: "get",
params
});
}

View File

@ -2,7 +2,7 @@
<div class="app-container">
<div class="title">应用中心</div>
<div class="list">
<div class="item" @click="upPop">
<!-- <div class="item" @click="upPop">
<img src="./kp.png" class="icon">
<div class="info">
<div class="name">开票</div>
@ -10,7 +10,7 @@
</div>
</div>
</div>
</div> -->
<div class="item" v-for="item in list" :key="item.id" @click="to(item)">
<img :src="item.coverImg" class="icon">
<div class="info">
@ -22,7 +22,7 @@
</div>
</div>
<!-- 弹窗 -->
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
<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>
@ -67,14 +67,11 @@ export default {
},
mounted() {
this.appCenterGet()
this.getbinding()
// this.getbinding()
},
methods: {
upPop() {
this.dialogVisible = true
},
handleClose() {
},
sumbitEvent() {
if (this.forms.account) {

View File

@ -81,9 +81,9 @@
</el-form-item>
<el-form-item label="发放数量" prop="number" style="width: 100%;">
<el-input v-model="form.number" oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" placeholder="" style="width: 200px;" />
<el-tooltip class="item" effect="dark" content="限用户自行领取,(当库存为 0时集草等活动仍会赠送" placement="top-start">
<!-- <el-tooltip class="item" effect="dark" content="限用户自行领取,(当库存为 0时集草等活动仍会赠送" placement="top-start">
<i class="el-icon-question" />
</el-tooltip>
</el-tooltip> -->
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
@ -97,7 +97,7 @@
<el-input v-model="form.title" placeholder="" style="width: 289px;" />
</el-form-item>
<el-form-item label="使用门槛" prop="fullAmount">
额满<el-input v-model="form.fullAmount" oninput="value= value.replace(/[^\d|\.]/g, '')" placeholder="" style="width: 100px;margin: 0 23px;"><template slot="suffix"></template></el-input>可用
额满<el-input v-model="form.fullAmount" oninput="value= value.replace(/[^\d|\.]/g, '')" placeholder="" style="width: 100px;margin: 0 23px;"><template slot="suffix"></template></el-input>可用
</el-form-item>
<el-form-item label="有效期类型" style="width: 100%;">
<el-radio-group v-model="form.validityType">
@ -158,9 +158,9 @@
</el-form-item>
<el-form-item label="发放数量" prop="number" style="width: 100%;">
<el-input v-model="form.number" oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" placeholder="" style="width: 200px;" />
<el-tooltip class="item" effect="dark" content="限用户自行领取,(当库存为 0时集草等活动仍会赠送" placement="top-start">
<!-- <el-tooltip class="item" effect="dark" content="限用户自行领取,(当库存为 0时集草等活动仍会赠送" placement="top-start">
<i class="el-icon-question" />
</el-tooltip>
</el-tooltip> -->
</el-form-item>
<el-form-item label="赠送商品" prop="products">
<div>

View File

@ -91,7 +91,7 @@
<div class="head-container">
<el-pagination
:total="tableData.total"
:current-page="tableData.page + 1"
:current-page="tableData.page"
:page-size="tableData.size"
layout="total, sizes, prev, pager, next, jumper"
@current-change="paginationChange"
@ -130,7 +130,7 @@ export default {
resetQuery: null,
tableData: {
data: [],
page: 0,
page: 1,
size: 10,
loading: false,
total: 0
@ -146,7 +146,7 @@ export default {
*/
async getTableData() {
// eslint-disable-next-line no-unused-vars, prefer-const
console.log(this.couponId)
// console.log(this.couponId)
// eslint-disable-next-line no-unused-vars, prefer-const
let res = await queryReceive({
@ -168,8 +168,13 @@ export default {
* 时间选择监听
*/
queryTimeChange(e) {
this.query.startTime = e[0]
this.query.endTime = e[1]
if (e) {
this.query.startTime = e[0]
this.query.endTime = e[1]
} else {
this.query.startTime = ''
this.query.endTime = ''
}
},
/**
@ -200,7 +205,8 @@ export default {
},
//
paginationChange(e) {
this.tableData.page = e - 1
this.tableData.page = e
this.query.page = e
this.getTableData()
},
/**

View File

@ -81,7 +81,8 @@ export default {
stocktakinNum: '', //
price: '', //
remark: "", //
stockNumber: 0
stockNumber: 0,
balance: ''
},
rules: {
stocktakinNum: [
@ -155,6 +156,7 @@ export default {
})
},
async show(obj) {
console.log(obj, 111)
let res = await hasPermission('允许耗材盘点');
if (!res) { return; }
this.form.remark = ''
@ -165,8 +167,9 @@ export default {
this.form = Object.assign(this.form, obj)
this.dialogVisible = true
this.form.conInfoId = obj.consId
this.form.stockNumber = obj.stockNumber
this.form.balance = obj.stockNumber
this.form.stockNumber = obj.balance < 0 ? 0 : obj.balance
// this.form.balance = obj.stockNumber
this.form.balance = obj.balance
this.form.price == null ? 0 : this.form.price
this.searhForm.productId = obj.id
this.getTableData()
@ -186,7 +189,7 @@ export default {
try {
this.tableData.loading = true
const res = await tbConCheckGet({
page: this.tableData.page,
size: this.tableData.size,
conInfoId: this.searhForm.productId,

View 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>

View File

@ -1,7 +1,13 @@
<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="title" style="text-align: center;">收银订单</div>
<div class="title" style="text-align: center">收银订单</div>
<div class="container">
<div class="info_content">
<div class="item">
@ -72,15 +78,20 @@
<div class="row">
<div>打包费{{ detail.packFee || "-" }}</div>
<div>订单原价{{ detail.originAmount }}</div>
<div>优惠金额{{ detail.userCouponAmount || "-" }}</div>
<div>优惠金额{{ youHuiJinE }}</div>
<div>
实收金额<span style="color: red;">{{ detail.payAmount }}</span>
实收金额<span style="color: red">{{ detail.payAmount }}</span>
</div>
</div>
<div class="row">
<div>
退款金额{{ 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>支付方式{{ detail.payType }}</div>
</div>
@ -100,20 +111,26 @@
</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-column label="商品">
<template v-slot="scope">
<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>
<span>
{{ scope.row.productName ||'客座费'}}
{{ scope.row.productName || "客座费" }}
</span>
</div>
<div class="info">
<span :class="[scope.row.isVip == 1 ? 'colorStyle' : '']">{{ scope.row.productName }}</span>
<span style="color: #999;">{{
<span :class="[scope.row.isVip == 1 ? 'colorStyle' : '']">{{
scope.row.productName
}}</span>
<span style="color: #999">{{
scope.row.productSkuName
}}</span>
</div>
@ -121,29 +138,52 @@
</template>
</el-table-column>
<el-table-column label="数量">
<template v-slot="scope">
x{{ scope.row.num }}
</template>
<template v-slot="scope"> x{{ scope.row.num }} </template>
</el-table-column>
<el-table-column label="单价">
<template v-slot="scope">
{{ scope.row.price }}/
</template>
<template v-slot="scope">
{{ scope.row.price }}
<!-- <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 label="小计">
<template v-slot="scope">
{{ scope.row.priceAmount }}
</template>
<template v-slot="scope"> {{ scope.row.canReturnAmount }} </template>
</el-table-column>
<el-table-column label="操作">
<template v-slot="scope">
<template v-if="scope.row.status!='unpaid'">
<el-button v-if="canTuikuan(scope.row)" type="text" size="mini" @click="tuikuan(scope.row)"><span >退款</span></el-button>
<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
>
<span class="color-999" v-if="isTui(scope.row)">已退款</span>
</template>
<template v-if="scope.row.status=='unpaid'">
<el-button 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 v-if="detail.status == 'unpaid'">
<el-button
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>
</el-table-column>
@ -211,13 +251,13 @@
<!-- </el-tabs> -->
</div>
<return-cart
:modal="false"
:modal="false"
ref="refReturnCart"
:max="selGoods.num"
@confirm="refReturnCartConfirm"
></return-cart>
<return-money
:modal="false"
:modal="false"
ref="refReturnMoney"
:max="selGoods.num"
:goods="selGoods"
@ -232,12 +272,10 @@ import dayjs from "dayjs";
import { tbOrderInfoDetail, tbOrderInfoData } from "@/api/order";
import returnCart from "@/views/tool/Instead/components/return-cart.vue";
import returnMoney from "@/views/tool/Instead/components/return-money.vue";
import {
$returnCart,$returnOrder
} from "@/api/table";
import * as $util from '../order_goods_util.js'
import { $returnCart, $returnOrder } from "@/api/table";
import * as $util from "../order_goods_util.js";
export default {
components: { returnCart,returnMoney },
components: { returnCart, returnMoney },
data() {
return {
@ -247,27 +285,30 @@ export default {
detail: "",
loading: false,
refoundList: [],
selGoods:{num:1}
selGoods: { num: 1 },
};
},
filters: {
to2(n){
return Number(n).toFixed(2)
},
orderTypeFilter(t) {
if (t) {
return t && orderEnum.orderType.find(item => item.key == t).label;
return t && orderEnum.orderType.find((item) => item.key == t).label;
} else {
return t;
}
},
sendTypeFilter(t) {
if (t) {
return orderEnum.sendType.find(item => item.key == t).label;
return orderEnum.sendType.find((item) => item.key == t).label;
} else {
return t;
}
},
statusFilter(t) {
if (t) {
return t && orderEnum.status.find(item => item.key == t).label;
return t && orderEnum.status.find((item) => item.key == t).label;
} else {
return t;
}
@ -278,45 +319,89 @@ export default {
} else {
return "-";
}
}
},
},
watch:{
drawer:function(newval){
if(!newval){
watch: {
drawer: function (newval) {
if (!newval) {
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: {
close(){
console.log('drawer close')
this.$emit('close');
isShowGoodsVipPrice(item){
return $util.isShowGoodsVipPrice(item);
},
isTui(item){
isUseCalcPrice(item){
return $util.isUseCalcPrice(this.detail,item);
},
close() {
console.log("drawer close");
this.$emit("close");
},
isTui(item) {
return $util.isTui(item);
},
canTuikuan(item){
return $util.canTuiKuan(this.detail,item);
canTuikuan(item) {
return $util.canTuiKuan(this.detail, item);
},
canTuicai(item){
return $util.canTuicai(this.detail,item);
canTuicai(item) {
return $util.canTuicai(this.detail, item);
},
async refReturnMoneyConfirm(e){
async refReturnMoneyConfirm(e) {
const res = await $returnOrder({
...e,
orderId:this.detail.id,
orderDetails:[{
id:this.selGoods.id,
num:e.num
}]
orderId: this.detail.id,
orderDetails: [
{
id: this.selGoods.id,
num: e.num,
},
],
});
this.$message.success("退款成功");
this.update();
},
update(){
update() {
this.tbOrderInfoDetail(this.detail.id);
},
async refReturnCartConfirm(e){
async refReturnCartConfirm(e) {
const res = await $returnCart({
...e,
cartId: this.selGoods.cartId,
@ -325,13 +410,13 @@ export default {
this.$message.success("退菜成功");
this.update();
},
tuikuan(item){
this.selGoods=item;
tuikuan(item) {
this.selGoods = item;
console.log(item);
this.$refs.refReturnMoney.open(item);
this.$refs.refReturnMoney.open({...item,priceAmount:item.canReturnAmount});
},
tuiCai(item){
this.selGoods=item;
tuiCai(item) {
this.selGoods = item;
console.log(item);
this.$refs.refReturnCart.open(item);
},
@ -348,7 +433,7 @@ export default {
source: this.detail.id,
page: 0,
pageSize: 500,
orderType: "0"
orderType: "0",
});
this.refoundList = res.content;
} catch (error) {
@ -371,23 +456,23 @@ export default {
this.type = "1";
this.detail = "";
this.tbOrderInfoDetail(obj.id);
}
}
},
},
};
</script>
<style scoped lang="scss">
.packeFee{
.packeFee {
width: 40px;
box-sizing: border-box;
height: 40px;
background: #3f9eff;
color: #fff;
font-size: 12px;
display: flex;
justify-content: center;
align-items: center;
white-space: nowrap;
color: #fff;
font-size: 12px;
display: flex;
justify-content: center;
align-items: center;
white-space: nowrap;
}
.shop_info {
display: flex;
@ -425,7 +510,9 @@ export default {
}
}
}
.line-th{
text-decoration: line-through;
}
.container {
padding: 0 20px;
font-size: 14px;

View File

@ -18,7 +18,7 @@ export function canTuicai(orderInfo,item){
}
export function canTuiKuan(orderInfo,item){
// 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){
return item.status=='return'||item.status=='refund'||item.status=='refunding'
@ -28,4 +28,17 @@ export function numSum(arr){
return a+b*100
},0)
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
}

View File

@ -57,9 +57,9 @@
</el-form>
</div>
<div class="head-container">
<!-- <div class="head-container">
<div class="collect_wrap">
<!-- <div class="item">
<div class="item">
<div class="icon_wrap" style="--bg-color:#C978EE">
<i class="icon el-icon-s-goods"></i>
</div>
@ -67,8 +67,8 @@
<div class="m">{{ payCountTotal }}</div>
<div class="t">总金额</div>
</div>
</div> -->
<div class="item" v-for="item in payCountList" :key="item.payType">
</div>
<div class="item" v-for="item in payCountList" :key="item.payType">
<div class="icon_wrap" style="--bg-color:#fff">
<el-image class="img" :src="item.icon"></el-image>
</div>
@ -76,9 +76,9 @@
<div class="m">{{ item.payAmount || 0 }}</div>
<div class="t">{{ item.payType }}</div>
</div>
</div>
</div>
</div>
</div>
</div>-->
<div class="head-container">
<el-table :data="tableData.data" v-loading="tableData.loading">
<el-table-column label="订单号信息">
@ -150,7 +150,8 @@
<template v-slot="scope">
<div class="u-flex gap-10">
<el-button type="text" @click="$refs.orderDetail.show(scope.row)">详情</el-button>
<el-button v-if="scope.row.status == 'unpaid'" type="primary" size="mini" @click="payOrder(scope.row)">结账</el-button>
<el-button v-if="scope.row.status == 'unpaid'" type="primary" size="mini"
@click="payOrder(scope.row)">结账</el-button>
</div>
</template>
</el-table-column>
@ -207,24 +208,24 @@ export default {
filters: {
orderTypeFilter(t) {
if (t) {
const item= orderEnum.orderType.find(item => item.key == t);
return t && item?item.label:'';
const item = orderEnum.orderType.find(item => item.key == t);
return t && item ? item.label : '';
} else {
return t;
}
},
sendTypeFilter(t) {
if (t) {
const item= orderEnum.sendType.find(item => item.key == t);
return item?item.label:'';
const item = orderEnum.sendType.find(item => item.key == t);
return item ? item.label : '';
} else {
return t;
}
},
statusFilter(t) {
if (t) {
const item= orderEnum.status.find(item => item.key == t);
return t && item?item.label:'';
const item = orderEnum.status.find(item => item.key == t);
return t && item ? item.label : '';
} else {
return t;
}
@ -254,11 +255,11 @@ export default {
this.getTableData();
}, 200);
}
},
methods: {
//
payOrder(order){
payOrder(order) {
console.log(order);
this.$router.push({
path: "/tool/Instead/index",
@ -268,7 +269,7 @@ export default {
useType: order.useType,
masterId: order.masterId,
orderId: order.id,
key:'isJieZhang'
key: 'isJieZhang'
},
});
},
@ -324,7 +325,7 @@ export default {
async getTableData(switchs = false) {
this.tableData.loading = true;
try {
this.payCount();
// this.payCount();
const productName = this.query.productName.replace(/\s+/g, '')
const res = await tbOrderInfoData({
page: this.tableData.page,

View File

@ -189,11 +189,13 @@
style="margin-left: 20px !important;">
<el-button type="text" icon="el-icon-edit">编辑</el-button>
</router-link> -->
<el-button type="text" icon="el-icon-edit" @click="toPath('/product/add_shop', scope.row)">编辑</el-button>
<el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
<el-button type="text" icon="el-icon-delete" style="margin-left: 20px !important;"
slot="reference">删除</el-button>
</el-popconfirm>
<div style="display: flex;gap: 10px;">
<el-button type="text" icon="el-icon-edit" @click="toPath('/product/add_shop', scope.row)"
v-if="scope.row.typeEnum">编辑</el-button>
<el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
<el-button type="text" icon="el-icon-delete" slot="reference">删除</el-button>
</el-popconfirm>
</div>
</template>
</el-table-column>
</el-table>
@ -244,7 +246,7 @@ import { tbProductListV2, tbShopCategoryGet, tbProductDelete, tbProductIsHot, up
import { hasPermission } from '@/utils/limits.js'
export default {
name:'product',
name: 'product',
components: {
BindCons,
StockHistory

View File

@ -192,7 +192,18 @@ export default {
},
//
selectConfirmGoods(res) {
this.$set(this.form.list, this.activeItem, { ...res[0] })
// this.form.list = res
const flag = this.form.list.filter(item => item.id == res[0].id)
if (flag.length) {
this.$notify({
title: '注意',
message: '请勿重复添加',
type: 'error'
})
} else {
this.$set(this.form.list, this.activeItem, { ...res[0] })
}
},
// tab
tabChange() {

View File

@ -7,8 +7,12 @@
</el-input>
</div>
<div class="tree_wrap">
<el-tree :data="treeData" node-key="id" highlight-current :props="{ label: 'name' }" default-expand-all
@node-click="treeItemClick"></el-tree>
<!-- <el-tree :data="treeData" node-key="id" highlight-current :props="{ label: 'name' }" default-expand-all
@node-click="treeItemClick"></el-tree> -->
<div class="item" :class="{ active: selectCatoryIndex == index }" v-for="(item, index) in treeData"
:key="item.id" @click="treeItemClick(item, index)">
{{ item.name }}
</div>
</div>
</div>
<div class="table_wrap">
@ -62,6 +66,7 @@ export default {
query: {
name: ''
},
selectCatoryIndex: 0,
selectCatory: '',
treeDataOrgin: [],
treeData: [],
@ -88,6 +93,12 @@ export default {
this.treeData = this.treeDataOrgin.filter(item => {
return item.name.includes(this.query.name)
})
if (this.treeData.length) {
this.selectCatoryIndex = 0
this.selectCatory = this.treeData[this.selectCatoryIndex]
this.getTableData()
}
},
//
tableDrag() {
@ -147,7 +158,8 @@ export default {
}
},
//
treeItemClick(data) {
treeItemClick(data, index) {
this.selectCatoryIndex = index
this.selectCatory = data
this.tableData.page = 1
this.getTableData()
@ -164,6 +176,7 @@ export default {
})
this.treeDataOrgin = res.content
this.treeData = res.content
this.selectCatory = res.content[this.selectCatoryIndex]
this.getTableData()
} catch (error) {
console.log(error)
@ -235,6 +248,22 @@ export default {
width: 100%;
height: calc(100% - 70px);
overflow-y: auto;
.item {
padding: 10px 15px;
font-size: 14px;
display: flex;
align-items: center;
&:hover {
cursor: pointer;
}
&.active {
background-color: #1890ff;
color: #fff;
}
}
}
}

View File

@ -3,7 +3,7 @@
<div class="u-p-15">
<div class="u-m-t-20">
<el-form label-width="90px" label-position="left">
<el-form-item label="总价">
<el-form-item label="应付金额">
<div class="color-red u-font-18 font-600">{{ form.money }}</div>
<!-- <el-input :value="form.money" disabled> </el-input> -->
</el-form-item>
@ -168,6 +168,7 @@ export default {
},
confirm() {
console.log(this.form.discount / 100)
this.$emit("confirm", (this.form.discount / 100));
this.close();
},

View File

@ -229,6 +229,7 @@ export default {
},
data() {
return {
discount:1,
orderPrice: 0,
fullReductionCouponSel: {
id: "",
@ -285,12 +286,15 @@ export default {
//
const arr = this.quans.productCoupon.filter((v) => v.proId == row.proId);
const index = arr.findIndex((v) => v.id == row.id);
const item=this.goodsArr.find((v) => v.productId == row.proId);
if (index != -1) {
return returnProductCoupAllPrice(
const n=returnProductCoupAllPrice(
$goodsPayPriceMap[row.proId],
index,
row.num
).toFixed(2);
row.num,
item.isMember
)
return (n*this.discount).toFixed(2);
} else {
return 0;
}
@ -383,7 +387,7 @@ export default {
.catch(() => {});
}
if (this.fullReductionCouponSel.fullAmount > payPrice) {
this.$confirm(
this.$confirm(
"选择该商品券后将不满足选择抵扣券的最低满减需求,继续选择将取消选择的满减券",
"提示",
{
@ -397,7 +401,11 @@ export default {
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;

View File

@ -12,10 +12,18 @@
<div class="u-flex color-999 u-m-t-4">
{{ goods.productSkuName||'' }}
</div>
<div class="flex u-row-between u-p-b-16 u-m-t-10 border-bottom">
<span>退款数量</span>
<div class="u-flex">
<number-box v-model="number" :min="1" :max="max"></number-box>
<div class="u-p-b-16 border-bottom">
<div class="flex u-row-between">
<span>退款数量</span>
<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 class="u-m-t-12 u-font-12 color-999">菜品已点数量 {{ max }} </div>
@ -25,7 +33,7 @@
</div>
<div class="u-flex u-m-t-12 ">
<span>退款金额</span>
<span class="color-red font-bold">{{ goods.price * number|to2 }}</span>
<span class="color-red font-bold">{{ tuikuanJine }}</span>
</div>
<div class="u-m-t-26">
<div><span>退款原因</span> <span class="color-red">*</span></div>
@ -57,6 +65,8 @@
</template>
<script>
import numberBox from "./number-box.vue";
import {returnIsSeatFee} from '../util.js'
export default {
components: { numberBox },
props: {
@ -64,12 +74,6 @@ export default {
type: Boolean,
default: true,
},
goods: {
type: Object,
default: () => {
return {};
},
},
max: {
type: Number,
default: 1,
@ -87,8 +91,20 @@ export default {
{ label: "等待时间过长", checked: false },
],
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:{
to2(val){
return val.toFixed(2);
@ -112,9 +128,15 @@ export default {
}
this.note = tag + "," + this.note;
},
open(note) {
open(item) {
this.goods = item?item:this.goods;
console.log(item)
this.show = true;
this.number = 1;
if (item.productId != "-999") {
this.number = 1;
} else {
this.number = item.num;
}
},
close() {
this.show = false;

View File

@ -1065,16 +1065,11 @@
</div>
<div class="detail_form_item">
<div class="left">积分抵扣</div>
<div class="right">-{{ points.toMoney | to2 }}</div>
<div class="right">-{{ pointsDiscountAmount | to2 }}</div>
</div>
<div class="detail_form_item">
<div class="left">整单改价</div>
<div class="right">
-{{
((1 - createOrder.discount) * createOrder.data.amount)
| to2
}}
</div>
<div class="right">-{{ gaijia | to2 }}</div>
</div>
<div class="detail_form_item" v-if="createOrder.data.packFee">
<div class="left">打包费</div>
@ -1718,6 +1713,22 @@ export default {
};
},
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() {
if (!this.shopInfo.isMemberPrice) {
return false;
@ -1725,44 +1736,22 @@ export default {
return this.vipUser.isVip ? true : false;
},
coupdiscount() {
return returnCouponAllPrice(
this.quansSelArr,
this.createOrder.data.detailList || [],
this.vipUser
);
const n = this.quansSelArr.reduce((prve, cur) => {
return prve + cur.discountAmount * 1;
}, 0);
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() {
const amount = this.createOrder.data.amount || 0;
const discount = this.createOrder.discount || 1;
// const total=((amount - this.coupdiscount) * this.createOrder.discount - this.points.toMoney)
const total = (amount) * this.createOrder.discount - this.coupdiscount;
const total = amount - this.gaijia - this.coupdiscount;
return total <= 0 ? 0 : total;
},
yinFuJinE() {
const total = this.currentPayMoney - (this.points.toMoney || 0);
console.log(total)
const total =
this.currentPayMoney - (this.points.selected ? this.points.toMoney : 0);
console.log(total);
if (this.isCreateOrder) {
return total.toFixed(2);
} else {
@ -1886,13 +1875,20 @@ export default {
const seatFee =
this.order.seatFee.totalAmount *
(returnStatus.includes(this.order.seatFee.status) ? 0 : 1);
// return (
// (oldPrice + price + +packFee + seatFee - this.youhuiAllPrice) *
// this.createOrder.discount
// ).toFixed(2);
return (
(oldPrice + price + +packFee + seatFee - this.youhuiAllPrice) *
this.createOrder.discount
oldPrice +
price +
+packFee +
seatFee -
this.youhuiAllPrice
).toFixed(2);
},
vipDiscountPrice() {
if (!this.vipUser.isVip) {
if (!this.vipUser.isVip || !this.shopInfo.isMemberPrice) {
return 0;
}
const oldMemberPrice = this.order.old.list.reduce((a, b) => {
@ -1990,10 +1986,15 @@ export default {
this.goods.status = "loadmore";
this.getGoods();
},
pointsCanDicountMoney: function (newval) {
this.getCalcUsablePoints();
},
currentPayMoney: function (newval) {
if (this.createOrder.data.memberId || this.vipUser.id) {
this.getCalcUsablePoints().then((res) => {
this.pointsValueChange(this.points.value);
if (this.points.selected) {
this.pointsValueChange(this.points.value);
}
});
}
},
@ -2054,6 +2055,13 @@ export default {
if (this.order.status == "finish") {
return;
}
if (
!this.table.tableId &&
this.order.list.length <= 0 &&
this.order.old.list.length <= 0
) {
return;
}
$setUser({
tableId: this.table.tableId,
masterId: this.masterId,
@ -2191,12 +2199,18 @@ export default {
//
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) {
return returnProductCoupAllPrice(
const n = returnProductCoupAllPrice(
$goodsPayPriceMap[row.proId],
index,
row.num
).toFixed(2);
row.num,
item.isMember
);
return (n * this.createOrder.discount).toFixed(2);
} else {
return 0;
}
@ -2209,6 +2223,13 @@ export default {
console.log(index);
if (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() {
@ -2228,6 +2249,9 @@ export default {
this.vipUser.accountPoints,
this.points.res.maxUsablePoints || 0
);
if(!pointsRes.usable){
this.points.selected=false
}
}
return pointsRes;
},
@ -2262,12 +2286,21 @@ export default {
id: this.createOrder.data.id,
memberId: this.createOrder.data.memberId || this.vipUser.id,
orderPrice: (this.yinFuJinE * 1 + this.coupdiscount * 1).toFixed(2),
discount: this.createOrder.discount,
},
[...this.quansSelArr]
);
},
quansConfirm(e, goodsPayPriceMap) {
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];
$goodsPayPriceMap = goodsPayPriceMap;
},
@ -2315,7 +2348,7 @@ export default {
// return
// }
await this.returnCreateOrderData();
this.payBeforeClear();
// this.payBeforeClear();
// this.order.payType = "";
},
async cashPayClick() {
@ -2408,10 +2441,13 @@ export default {
if (!canJiesuan) {
return;
}
const order = await this.returnCreateOrderData();
this.order.payType = "scanCode";
this.payTypeItemClick({ payType: "scanCode", order });
this.payBeforeClear();
if (!this.isCreateOrder) {
const order = await this.returnCreateOrderData();
this.order.payType = "scanCode";
this.payTypeItemClick({ payType: "scanCode", order });
return;
}
this.payTypeItemClick({ payType: "scanCode" });
},
async changeOrderUseType(useType) {
if (useType && this.order.list.length) {
@ -2548,10 +2584,11 @@ export default {
},
//退
async refReturnCartConfirm(e) {
console.log(this.order.selGoods);
const res = await $returnCart({
...e,
cartId: this.order.selGoods.cartId,
cartId: this.isCreateOrder
? this.order.selGoods.id
: this.order.selGoods.cartId,
tableId: this.table.tableId,
});
this.order.selGoods.status = "return";
@ -2670,14 +2707,41 @@ export default {
}
},
ChangeDiscount(discount) {
const fullCoupIndex = this.quansSelArr.findIndex((v) => v.type == 1);
const fullCoup = this.quansSelArr[fullCoupIndex];
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() {
const canDiscount = await hasPermission("允许打折");
if (!canDiscount) {
return;
}
const amount = this.createOrder.data.amount;
const amount = (this.createOrder.data.amount - this.coupdiscount).toFixed(
2
);
console.log(amount);
this.refToggle("refDiscount", true, {
amount,
discount: this.createOrder.discount * 100,
@ -4510,6 +4574,15 @@ input[type="number"]::-webkit-outer-spin-button {
font-size: 20px;
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 {
border: 1px solid #dcdfe6;

View File

@ -91,11 +91,12 @@ export function returnProductPayPrice(goods,vipUser){
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)=>{
let curPrice=0
if(typeof cur==='object'){
curPrice=cur.memberPrice*1
curPrice=isMember?cur.memberPrice*1:cur.price
}else{
curPrice=cur*1
}
@ -216,9 +217,9 @@ export function returnCouponAllPrice(coupArr, goodsArr, vipUser) {
export function returnCanUseFullReductionCoupon(coupArr, payPrice, selCoup) {
return coupArr.map(v => {
if (v.id == selCoup.id) {
return v
return {...v,use:true}
}
const isfullAmount = payPrice >= v.fullAmount * 1
const isfullAmount = payPrice*1 >= v.fullAmount * 1
if(payPrice<=0){
return {
...v,
@ -229,5 +230,21 @@ export function returnCanUseFullReductionCoupon(coupArr, payPrice, selCoup) {
...v,
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
}