Merge branch 'test' of e.coding.net:g-cphe0354/yinshoukeguanliduan/management into gyq

This commit is contained in:
gyq 2024-10-10 11:22:42 +08:00
commit 64b4ebb88a
13 changed files with 69 additions and 29 deletions

View File

@ -14,7 +14,18 @@ export function tbPrintMachine(data, method = 'post') {
}
})
}
// 打印机切换
export function switchtbPrintMachine(data, method = 'post') {
return request({
url: '/api/shop-config/printer/update-status',
method: method,
data: {
shopId: localStorage.getItem('shopId'),
...data
}
})
}
/**
* 打印机列表
* @returns

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

@ -51,7 +51,7 @@ export const constantRouterMap = [
path: 'data_forms',
component: (resolve) => require(['@/views/home/data_forms'], resolve),
name: 'data_forms',
meta: { title: '数据报表' }
meta: { title: '销量统计' }
},
{
path: 'data_tables',

View File

@ -47,15 +47,15 @@
<el-radio-group v-model="forms.classifyPrint">
<el-radio label="0">打印所有</el-radio>
<el-radio label="1">部分分类</el-radio>
<el-radio label="2">部分商品</el-radio>
<!-- <el-radio label="2">部分商品</el-radio> -->
</el-radio-group>
</el-form-item>
<el-form-item label="桌台打印">
<!-- <el-form-item label="桌台打印">
<el-radio-group v-model="forms.tablePrint">
<el-radio label="0">打印所有</el-radio>
<el-radio label="1">打印部分桌台</el-radio>
</el-radio-group>
</el-form-item>
</el-form-item> -->
<el-form-item label="打印数量">
<el-radio-group v-model="forms.printQty">
<el-radio label="c1m1^2">顾客联+商家联2</el-radio>

View File

@ -54,8 +54,7 @@
</el-table-column>
<el-table-column label="操作" width="200">
<template v-slot="scope">
<el-button type="text" icon="el-icon-edit"
@click="toUrl(scope.row)">编辑</el-button>
<el-button type="text" icon="el-icon-edit" @click="toUrl(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>
@ -75,7 +74,7 @@
<script>
import { devices, models, subTypes } from './devices'
import addDevice from './components/addDevice'
import { tbPrintMachineGet, tbPrintMachine, delTableHandle } from '@/api/devices'
import { tbPrintMachineGet, switchtbPrintMachine, delTableHandle } from '@/api/devices'
import dayjs from 'dayjs'
export default {
components: {
@ -123,7 +122,7 @@ export default {
},
methods: {
toUrl(item) {
this.$router.push({ path: '/shop/devices/details', query:{id:item.id}})
this.$router.push({ path: '/shop/devices/details', query: { id: item.id } })
},
//
async statusChange(e, row) {
@ -131,7 +130,11 @@ export default {
this.tableData.loading = true
const data = { ...row }
data.status = e
await tbPrintMachine(data, 'put')
if (data.id) {
delete data.createdAt
delete data.updatedAt
}
await switchtbPrintMachine(data)
this.getTableData()
} catch (error) {
console.log(error)

View File

@ -1,9 +1,9 @@
<template>
<div class="app-container">
<el-tabs v-model="orderType" @tab-click="getTableData">
<!-- <el-tabs v-model="orderType" @tab-click="getTableData">
<el-tab-pane label="收款" name="1"></el-tab-pane>
<el-tab-pane label="销量" name="2"></el-tab-pane>
</el-tabs>
</el-tabs> -->
<div class="head-container">
<el-form :model="query" inline label-position="left">
<template v-if="orderType == 2">
@ -109,22 +109,22 @@
</el-table-column>
</el-table>
<el-table :data="tableData.data" v-loading="tableData.loading" v-if="orderType == 2">
<el-table-column label="商品名称" prop="productName"></el-table-column>
<el-table-column label="商品分类" prop="cateName"></el-table-column>
<!-- <el-table-column label="商品分类" prop="cateName"></el-table-column>
<el-table-column label="商品描述" prop="productSkuName"></el-table-column>
<el-table-column label="单价" prop="price"></el-table-column>
<el-table-column label="单价" prop="price"></el-table-column> -->
<el-table-column label="商品名称" prop="productName"></el-table-column>
<el-table-column label="销量" prop="salesNum"></el-table-column>
<el-table-column label="退单量" prop="refNum"></el-table-column>
<el-table-column label="销售金额" prop="salesAmount">
<template v-slot="scope">
{{ scope.row.salesAmount }}
</template>
</el-table-column>
<el-table-column label="退款金额" prop="refAmount">
<template v-slot="scope">
{{ scope.row.refAmount }}
</template>
</el-table-column>
<el-table-column label="销售金额" prop="salesAmount">
<template v-slot="scope">
{{ scope.row.salesAmount }}
</template>
</el-table-column>
</el-table>
</div>
<div class="head-container">
@ -146,7 +146,7 @@ export default {
return {
timeValue: "",
resetQuery: null,
orderType: "1",
orderType: "2",
categorys: [],
query: {
createdAt: [],
@ -169,7 +169,7 @@ export default {
timeFilter(time) {
return dayjs(time).format("YYYY-MM-DD HH:mm:ss");
},
totalfilter(item,d) {
totalfilter(item, d) {
let num = item + d
return num.toFixed(2)
}
@ -362,9 +362,27 @@ export default {
.collect_wrap {
display: flex;
gap: 14px;
justify-content: space-between;
.item:nth-child(1) {
background-image: url(../../assets/images/home/data_forms4.png);
}
.item:nth-child(2) {
background-image: url(../../assets/images/home/data_forms3.png);
}
.item:nth-child(3) {
background-image: url(../../assets/images/home/data_forms2.png);
}
.item:nth-child(4) {
background-image: url(../../assets/images/home/data_forms1.png);
}
.item {
flex: 1;
background-size: 100% 100%;
width: 255px;
display: flex;
align-items: center;
background-color: #f5f5f5;

View File

@ -27,7 +27,7 @@
<el-radio :label="0">禁用</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="售卖时间管控" v-if="form.id">
<el-form-item label="售卖时间管控" >
<el-radio-group v-model="form.useTime">
<el-radio :label="1">启用</el-radio>
<el-radio :label="0">禁用</el-radio>
@ -51,7 +51,7 @@
</el-form-item>
<el-form-item label="分组排序" v-if="form.id">
<el-form-item label="分组排序" >
<el-input-number v-model="form.sort" controls-position="right" :min="0"></el-input-number>
</el-form-item>

View File

@ -373,6 +373,8 @@ export default {
tableId: this.selTable.tableId,
useType: this.selTable.useType,
maxCapacity:this.selTable.maxCapacity,
masterId:this.selTable.masterId,
orderId:this.selTable.orderId,
...query,
},
});

View File

@ -7,7 +7,7 @@
@click="changeKey('paysSel', index)"
v-for="(item, index) in pays"
:key="index"
:type="paysSel == index ? 'success' : ''"
:type="paysSel == index ? 'primary' : ''"
>{{ item.text }}</el-button
>
</div>
@ -189,10 +189,12 @@ export default {
open() {
this.show = true;
this.form.money = Number(this.price).toFixed(2);
$getOrderPayUrl({ orderId: this.order.id }).then((res) => {
console.log(res);
this.paymentQrcode = res;
});
if (this.openSwitch) {
$getOrderPayUrl({ orderId: this.order.id }).then((res) => {
console.log(res);
this.paymentQrcode = res;
});
}
this.$nextTick(() => {
this.$refs.refInputCode.focus();
});

View File

@ -2112,6 +2112,7 @@ export default {
if (this.table.tableId) {
return $getMasterId({
tableId: this.table.tableId,
orderId:this.table.orderId,
vipUserId: this.vipUser.id,
useType: this.useTypes.sel == "takeout" ? "takeout" : "",
});
@ -2944,6 +2945,8 @@ export default {
tableId: params.tableId,
useType: params.useType,
maxCapacity: params.maxCapacity * 1,
masterId:params.masterId,
orderId:params.orderId,
},
key = params.key,
perpoleNumber = params.num;
@ -2959,6 +2962,7 @@ export default {
this.isCreateOrder = this.key == "isPayOrder" ? true : false;
this.perpole = perpoleNumber;
this.table = item;
this.masterId = item.masterId;
},
close() {
if (this.table.tableId) {