This commit is contained in:
魏啾
2024-10-09 17:42:48 +08:00
6 changed files with 35 additions and 13 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 * @returns

View File

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

View File

@@ -54,8 +54,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" width="200"> <el-table-column label="操作" width="200">
<template v-slot="scope"> <template v-slot="scope">
<el-button type="text" icon="el-icon-edit" <el-button type="text" icon="el-icon-edit" @click="toUrl(scope.row)">编辑</el-button>
@click="toUrl(scope.row)">编辑</el-button>
<el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])"> <el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
<el-button type="text" icon="el-icon-delete" style="margin-left: 20px !important;" <el-button type="text" icon="el-icon-delete" style="margin-left: 20px !important;"
slot="reference">删除</el-button> slot="reference">删除</el-button>
@@ -75,7 +74,7 @@
<script> <script>
import { devices, models, subTypes } from './devices' import { devices, models, subTypes } from './devices'
import addDevice from './components/addDevice' import addDevice from './components/addDevice'
import { tbPrintMachineGet, tbPrintMachine, delTableHandle } from '@/api/devices' import { tbPrintMachineGet, switchtbPrintMachine, delTableHandle } from '@/api/devices'
import dayjs from 'dayjs' import dayjs from 'dayjs'
export default { export default {
components: { components: {
@@ -123,7 +122,7 @@ export default {
}, },
methods: { methods: {
toUrl(item) { 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) { async statusChange(e, row) {
@@ -131,7 +130,11 @@ export default {
this.tableData.loading = true this.tableData.loading = true
const data = { ...row } const data = { ...row }
data.status = e data.status = e
await tbPrintMachine(data, 'put') if (data.id) {
delete data.createdAt
delete data.updatedAt
}
await switchtbPrintMachine(data)
this.getTableData() this.getTableData()
} catch (error) { } catch (error) {
console.log(error) console.log(error)

View File

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

View File

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

View File

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