优化
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
<template>
|
||||
<div class="device_container">
|
||||
<div class="header" @click="router.back()">
|
||||
<el-icon
|
||||
style="position: relative; top: 2px; margin-right: 4px"
|
||||
size="22"
|
||||
>
|
||||
<el-icon style="position: relative; top: 2px; margin-right: 4px" size="22">
|
||||
<ArrowLeft />
|
||||
</el-icon>
|
||||
<el-text>{{ form.id ? "编辑小票打印机" : "添加小票打印机" }}</el-text>
|
||||
@@ -26,28 +23,15 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="选择设备">
|
||||
<el-select v-model="form.config.deviceName">
|
||||
<el-option
|
||||
:label="item.name"
|
||||
:value="item.name"
|
||||
v-for="item in printList"
|
||||
:key="item.name"
|
||||
></el-option>
|
||||
<el-option :label="item.name" :value="item.name" v-for="item in printList" :key="item.name"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称">
|
||||
<el-input
|
||||
v-model="form.name"
|
||||
placeholder="请输入设备名称"
|
||||
></el-input>
|
||||
<el-input v-model="form.name" placeholder="请输入设备名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="打印份数">
|
||||
<el-select v-model="form.config.printerNum">
|
||||
<el-option
|
||||
:label="item"
|
||||
:value="item"
|
||||
v-for="item in 4"
|
||||
:key="item"
|
||||
></el-option>
|
||||
<el-option :label="item" :value="item" v-for="item in 4" :key="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品模式">
|
||||
@@ -70,12 +54,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="尾部留空">
|
||||
<el-select v-model="form.config.feet">
|
||||
<el-option
|
||||
:label="`${item}行`"
|
||||
:value="`${item}`"
|
||||
v-for="item in feets"
|
||||
:key="item"
|
||||
></el-option>
|
||||
<el-option :label="`${item}行`" :value="`${item}`" v-for="item in feets" :key="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -144,12 +123,7 @@
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="btn">
|
||||
<el-button
|
||||
type="primary"
|
||||
style="width: 100%"
|
||||
:loading="loading"
|
||||
@click="submitHandle"
|
||||
>
|
||||
<el-button type="primary" style="width: 100%" :loading="loading" @click="submitHandle">
|
||||
保存
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -161,6 +135,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import dayjs from 'dayjs'
|
||||
import { ipcRenderer } from "electron";
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
@@ -211,10 +186,43 @@ function printHandle() {
|
||||
ElMessage.warning("请选择打印设备");
|
||||
return;
|
||||
}
|
||||
ipcRenderer.send(
|
||||
"printStart",
|
||||
JSON.stringify({ deviceName: form.value.config.deviceName })
|
||||
);
|
||||
|
||||
// ipcRenderer.send(
|
||||
// "printStart",
|
||||
// JSON.stringify({ deviceName: form.value.config.deviceName })
|
||||
// );
|
||||
|
||||
const data = {
|
||||
shop_name: '溜溜',
|
||||
carts: [
|
||||
{
|
||||
id: 1,
|
||||
name: '娃哈哈矿泉水',
|
||||
skuName: '500ml',
|
||||
salePrice: '1.0',
|
||||
number: '10',
|
||||
totalAmount: '10'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '柠檬奶茶',
|
||||
skuName: '加冰、加珍珠',
|
||||
salePrice: '10',
|
||||
number: '2',
|
||||
totalAmount: '20'
|
||||
}
|
||||
],
|
||||
amount: '30.00',
|
||||
remark: '',
|
||||
orderInfo: {
|
||||
masterId: '#002',
|
||||
orderNo: '202404021023542223445'
|
||||
},
|
||||
deviceName: form.value.config.deviceName,
|
||||
createdAt: '2024-04-02 10:15',
|
||||
printTime: '2024-04-02 10:15',
|
||||
};
|
||||
ipcRenderer.send("printerInfoSync", JSON.stringify(data));
|
||||
}
|
||||
|
||||
// 提交打印机
|
||||
|
||||
@@ -141,7 +141,7 @@ function checkLocalPrint(deviceName) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!print.name || !print.status) {
|
||||
if (!print.name) {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
|
||||
@@ -397,7 +397,7 @@ const ordereData = reactive({//表格数据
|
||||
list: [],
|
||||
size: 10,
|
||||
page: 1,
|
||||
status: 'cash',
|
||||
status: '',
|
||||
total: '',
|
||||
orderNo: '',
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user