This commit is contained in:
魏啾 2024-11-06 17:51:30 +08:00
commit 4acb025bb9
14 changed files with 154 additions and 45 deletions

View File

@ -6,7 +6,7 @@ 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'

View File

@ -139,5 +139,6 @@ export default {
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
}
</style>

View File

@ -461,3 +461,14 @@ export function $returnTableDetail(data) {
}
});
}
//获取订单可用优惠券
export function $activateByOrderId(data) {
return request({
url: '/api/tbShopCoupon/activateByOrderId',
method: "get",
params:{
shopId: localStorage.getItem("shopId"),
...data
}
});
}

View File

@ -14,8 +14,8 @@
</el-form-item>
<el-form-item>
<el-select v-model="query.status" placeholder="状态" style="width: 140px;">
<el-option label="待自取" value="waiting"></el-option>
<el-option label="已完成" value="done"></el-option>
<el-option :label="item.label" :value="item.value" v-for="item in statusList"
:key="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item>
@ -54,27 +54,38 @@
</div>
<div class="head-container">
<el-table :data="tableData.list" v-loading="tableData.loading">
<el-table-column label="订单编号" prop="orderNo"></el-table-column>
<el-table-column label="用户名" prop="memberName">
<el-table-column label="订单编号" prop="orderNo" width="200"></el-table-column>
<el-table-column label="用户名" prop="memberName" width="200">
<template v-slot="scope">
<div class="goods_info">
<el-image :src="scope.row.avatarUrl" style="width:40px;height:40px;flex-shrink: 0;"
:preview-src-list="avatarUrlList" />
:preview-src-list="avatarUrlList">
<div slot="error" class="image-slot">
<i class="el-icon-folder-delete"></i>
</div>
</el-image>
<span>{{ scope.row.memberName }}</span>
</div>
</template>
</el-table-column>
<el-table-column label="商品" prop="pointsGoodsName">
<el-table-column label="商品" prop="pointsGoodsName" width="200">
<template v-slot="scope">
<div class="goods_info">
<el-image :src="scope.row.goodsImageUrl" style="width:40px;height:40px;flex-shrink: 0;"
:preview-src-list="srcList" />
:preview-src-list="srcList">
<div slot="error" class="image-slot">
<i class="el-icon-folder-delete"></i>
</div>
</el-image>
<span>{{ scope.row.pointsGoodsName }}</span>
</div>
</template>
</el-table-column>
<el-table-column label="使用积分" prop="spendPoints"></el-table-column>
<el-table-column label="支付金额" prop="extraPaymentAmount"></el-table-column>
<el-table-column label="支付方式" prop="payMethod"></el-table-column>
<el-table-column label="实际支付时间" prop="payTime" width="200"></el-table-column>
<el-table-column label="下单时间" prop="createTime" width="200"></el-table-column>
<el-table-column label="领取方式" prop="pickupMethod">
<template v-slot="scope">
<el-tag type="success" effect="plain" disable-transitions
@ -88,18 +99,27 @@
<template v-slot="scope">
<el-tag type="warning" disable-transitions v-if="scope.row.status == 'waiting'">待自取</el-tag>
<el-tag type="success" disable-transitions v-if="scope.row.status == 'done'">已完成</el-tag>
<el-tag type="warning" disable-transitions v-if="scope.row.status == 'unpaid'">待支付</el-tag>
<el-tag type="info" disable-transitions v-if="scope.row.status == 'cancel'">已取消</el-tag>
</template>
</el-table-column>
<el-table-column label="下单时间" prop="createTime"></el-table-column>
<el-table-column label="操作">
<el-table-column label="取消/退款" prop="cancelOrRefundTime" width="200">
<template v-slot="scope">
<el-button type="text" icon="el-icon-finished" disabled
v-if="scope.row.status == 'done'">已完成</el-button>
<template v-else>
<template v-if="scope.row.status == 'cancel'">
<div>{{ scope.row.cancelOrRefundTime }}</div>
<div>{{ scope.row.cancelOrRefundReason }}</div>
</template>
</template>
</el-table-column>
<el-table-column label="操作" width="120" fixed="right">
<template v-slot="scope">
<template v-if="scope.row.status == 'waiting'">
<el-popconfirm title="确定核销吗?" @confirm="confirmOrder(scope.row.couponCode)">
<el-button type="text" icon="el-icon-finished" slot="reference">待核销</el-button>
</el-popconfirm>
</template>
<el-button type="text" icon="el-icon-finished" disabled v-else>{{
scope.row.status | statusFilter }}</el-button>
</template>
</el-table-column>
</el-table>
@ -114,9 +134,28 @@
<script>
import { exchangeRecordPage, exchangeRecordTotal, recordCheckout } from '@/api/points.js'
const statusList = [
{
value: 'unpaid',
label: '待支付'
},
{
value: 'waiting',
label: '待自取'
},
{
value: 'done',
label: '已完成'
},
{
value: 'cancel',
label: '已取消'
},
]
export default {
data() {
return {
statusList,
srcList: [],
avatarUrlList: [],
countData: {
@ -141,6 +180,11 @@ export default {
},
}
},
filters: {
statusFilter(t) {
return statusList.find(item => item.value == t).label
}
},
mounted() {
this.resetQuery = { ...this.query }
this.getTableData()

View File

@ -4,21 +4,35 @@
<el-form-item label="是否消费赠送积分">
<el-switch v-model.trim="form.enableRewards" :active-value="1" :inactive-value="0"></el-switch>
</el-form-item>
<el-form-item label="费赠送积分" prop="consumeAmount" v-if="form.enableRewards">
<el-input v-model="form.consumeAmount" style="width: 250px;"
@input="inputFilterInt($event, 'consumeAmount')">
<template slot="prepend">每消费</template>
<template slot="append">元赠送1积分</template>
</el-input>
</el-form-item>
<template v-if="form.enableRewards">
<el-form-item label="适用群体">
<el-radio-group v-model="form.rewardsGroup">
<el-radio label="all">全部</el-radio>
<el-radio label="vip">仅会员</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="费赠送积分" prop="consumeAmount">
<el-input v-model="form.consumeAmount" style="width: 250px;"
@input="inputFilterInt($event, 'consumeAmount')">
<template slot="prepend">每消费</template>
<template slot="append">元赠送1积分</template>
</el-input>
</el-form-item>
</template>
<el-form-item label="开启下单积分抵扣" style="margin-top: 50px;">
<el-switch v-model.trim="form.enableDeduction" :active-value="1" :inactive-value="0"></el-switch>
</el-form-item>
<template v-if="form.enableDeduction">
<el-form-item label="下单积分抵扣门槛" prop="minDeductionPoint">
<el-input v-model="form.minDeductionPoint" style="width: 150px;"
@input="inputFilterInt($event, 'minDeductionPoint')">
<template slot="append">积分</template>
<el-form-item label="适用群体">
<el-radio-group v-model="form.deductionGroup">
<el-radio label="all">全部</el-radio>
<el-radio label="vip">仅会员</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="下单实付抵扣门槛" prop="minPaymentAmount">
<el-input v-model="form.minPaymentAmount" style="width: 150px;"
@input="inputFilterInt($event, 'minPaymentAmount')">
<template slot="append"></template>
</el-input>
</el-form-item>
<el-form-item label="下单最高抵扣比例" prop="maxDeductionRatio">
@ -95,10 +109,12 @@ export default {
loading: false,
form: {
id: '',
rewardsGroup: 'all',
deductionGroup: 'all',
enableRewards: 1,
consumeAmount: "",
enableDeduction: 1,
minDeductionPoint: "",
minPaymentAmount: "",
maxDeductionRatio: "",
equivalentPoints: "",
enablePointsMall: 1,
@ -112,7 +128,7 @@ export default {
trigger: 'blur'
}
],
minDeductionPoint: [
minPaymentAmount: [
{
required: true,
message: ' ',

View File

@ -7,7 +7,7 @@
<!-- 优惠券 -->
<div v-if="form.type == 1" class="content">
<el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="left">
<el-form-item label="优惠卷卷名" prop="title">
<el-form-item label="优惠券券名" prop="title">
<el-input v-model="form.title" placeholder="" style="width: 289px;" />
</el-form-item>
<el-form-item label="使用门槛">
@ -82,7 +82,7 @@
<!-- 商品券 -->
<div v-if="form.type == 2" class="content">
<el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="left">
<el-form-item label="商品卷卷名" prop="title">
<el-form-item label="商品券券名" prop="title">
<el-input v-model="form.title" placeholder="" style="width: 289px;" />
</el-form-item>
<el-form-item label="发放数量" prop="number">

View File

@ -46,10 +46,10 @@
<el-form-item label="分类打印">
<el-radio-group v-model="forms.classifyPrint">
<el-radio label="0">打印所有</el-radio>
<el-radio label="1">部分分类</el-radio>
<el-radio label="1">部分分类(仅打印制作单[厨房])</el-radio>
<!-- <el-radio label="2">部分商品</el-radio> -->
</el-radio-group>
<div v-if="forms.classifyPrint == 1" style="color: rgb(255, 77, 79);margin-left: 80px;">仅打印制作单[厨房]</div>
<!-- <div v-if="forms.classifyPrint == 1" style="color: rgb(255, 77, 79);margin-left: 80px;"></div> -->
<div v-if="forms.classifyPrint == 1" style="margin-left:70px">
<!-- <el-tree :data="partList" show-checkbox node-key="id" ref="tree" :default-checked-keys="this.forms.categoryIds"
:props="{ children: 'childrenList', label: 'name' }">

View File

@ -134,12 +134,11 @@ export default {
//table id
toTableOrderList(data) {
// console.log(data)
let date = [this.query.createdAt[0], this.query.createdAt[1]]
this.$router.push({
path: '/order_manage/order_list',
query: {
tableName: data.tableName,
date: date
timeValue: this.timeValue
}
})
},

View File

@ -999,10 +999,10 @@ export default {
res.map(item => item.saleAmount)
];
console.log(p1);
console.log(p2);
// console.log(p1);
// console.log(p2);
this.initProduceChart(p1, p2);
// this.initProduceChart(p1, p2);
} catch (error) {
console.log(error);
}

View File

@ -120,7 +120,20 @@
<template v-slot="scope">
<el-input-number v-model="scope.row.price" :min="0" controls-position="right"
@change="consCountTotal($event, scope.row, 'price')"></el-input-number>
<div class="tips" style="font-size: 16px;">原价{{ scope.row.costPrice }}/{{ scope.row.conUnit }}
<div class="tips" style="font-size: 16px;">原价
<!-- {{ scope.row.costPrice }}/{{ scope.row.conUnit }} -->
{{ !scope.row.unit ?
(scope.row.defaultUnit ?
scope.row.defaultUnit== scope.row.conUnitTwo?
((scope.row.costPrice*scope.row.conUnitTwoConvert).toFixed(2)): scope.row.costPrice:scope.row.costPrice)
: scope.row.unit== scope.row.conUnitTwo?
((scope.row.costPrice*scope.row.conUnitTwoConvert).toFixed(2)): scope.row.costPrice}}
/
{{ !scope.row.unit ? (scope.row.defaultUnit ? scope.row.defaultUnit :
scope.row.conUnit) : scope.row.unit }}
</div>
</template>
</el-table-column>

View File

@ -118,18 +118,32 @@
<template v-slot="scope">
<el-input-number v-model="scope.row.price" :min="0" controls-position="right"
@change="consCountTotal($event, scope.row, 'price')"></el-input-number>
<div class="tips" style="font-size: 16px;">原价{{ scope.row.costPrice }}/{{ scope.row.conUnit }}</div>
<div class="tips" style="font-size: 16px;">原价
<!-- {{ scope.row.costPrice }}/{{ scope.row.conUnit }} -->
{{ !scope.row.unit ?
(scope.row.defaultUnit ?
scope.row.defaultUnit== scope.row.conUnitTwo?
((scope.row.costPrice*scope.row.conUnitTwoConvert).toFixed(2)): scope.row.costPrice:scope.row.costPrice)
: scope.row.unit== scope.row.conUnitTwo?
((scope.row.costPrice*scope.row.conUnitTwoConvert).toFixed(2)): scope.row.costPrice}}
/
{{ !scope.row.unit ? (scope.row.defaultUnit ? scope.row.defaultUnit :
scope.row.conUnit) : scope.row.unit }}
</div>
</template>
</el-table-column>
<el-table-column label="单位">
<template v-slot="scope">
<el-select @change="consCountTotal($event, scope.row, 'unit')" v-model="scope.row.unit"
:placeholder="scope.row.conUnit">
:placeholder="scope.row.defaultUnit ? scope.row.defaultUnit : scope.row.conUnit">
<el-option :label="scope.row.conUnit" :value="scope.row.conUnit"> </el-option>
<el-option :label="scope.row.conUnitTwo" :value="scope.row.conUnitTwo"
v-if="scope.row.conUnitTwo"> </el-option>
</el-select>
<div class="tips"> &nbsp;</div>
</template>
</el-table-column>
<el-table-column label="数量">

View File

@ -184,10 +184,8 @@ export default {
merchantName: this.loginForm.merchantName,
username: this.loginForm.username,
}))
// this.$router.push({ path: this.redirect || '/' })
window.location.href = './'
this.$router.push({ path: this.redirect || '/' })
// window.location.replace = './'
}).catch(() => {
this.loading = false
this.getCode()

View File

@ -233,7 +233,10 @@ export default {
mounted() {
if (this.$route.query.tableName) {
this.query.tableName = this.$route.query.tableName
this.query.createdAt = this.$route.query.date
}
if (this.$route.query.timeValue) {
this.timeValue = this.$route.query.timeValue
this.timeChange(this.timeValue);
}
if (this.$route.query.orderNo) {
this.query.orderNo = this.$route.query.orderNo

View File

@ -825,7 +825,7 @@
</div>
</div>
<!-- <div class="forms">
<div class="forms">
<el-form
ref="form"
:model="createOrder.form"
@ -843,7 +843,7 @@
</el-button>
</el-form-item>
</el-form>
</div> -->
</div>
</div>
<div class="btn_group">
<el-button size="medium" @click="disCountShow">
@ -1287,6 +1287,7 @@ import {
tbShopTableGet,
$changeUseType,
$returnTableDetail,
$activateByOrderId
} from "@/api/table";
import { tbShopCategoryGet } from "@/api/shop";
import {
@ -1745,6 +1746,7 @@ export default {
tableId: this.table.tableId,
masterId: this.masterId,
vipUserId: val,
orderId:this.createOrder.data.id||'',
type: val === "" ? 1 : 0,
});
},
@ -3407,9 +3409,17 @@ export default {
this.table = params.tableId ? item : "";
},
async getOrderData(params) {
const orderId= params ? params.orderId : this.createOrder.data.id
const res = await tbOrderInfoDetail(
params ? params.orderId : this.createOrder.data.id
);
if(res.memberId){
$activateByOrderId({
orderId,memberId:res.memberId
})
}
if (res.status != "unpaid") {
return res;
}