优化
This commit is contained in:
@@ -19,13 +19,8 @@
|
||||
</div>
|
||||
<div class="number_wrap">
|
||||
<div class="menus">
|
||||
<div
|
||||
class="item"
|
||||
:class="{ active: payActive == index }"
|
||||
v-for="(item, index) in payList"
|
||||
:key="item.id"
|
||||
@click="payTypeChange(index, item)"
|
||||
>
|
||||
<div class="item" :class="{ active: payActive == index }" v-for="(item, index) in payList" :key="item.id"
|
||||
@click="payTypeChange(index, item)">
|
||||
<div class="icon">
|
||||
<el-image :src="item.icon" class="img"></el-image>
|
||||
</div>
|
||||
@@ -40,12 +35,7 @@
|
||||
</div>
|
||||
<div class="keybord_wrap">
|
||||
<div class="left">
|
||||
<div
|
||||
class="item"
|
||||
v-for="item in 9"
|
||||
:key="item"
|
||||
@click="amountInput(`${item}`)"
|
||||
>
|
||||
<div class="item" v-for="item in 9" :key="item" @click="amountInput(`${item}`)">
|
||||
{{ item }}
|
||||
</div>
|
||||
<div class="item" @click="amountInput('.')">.</div>
|
||||
@@ -63,12 +53,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<scanModal
|
||||
ref="scanModalRef"
|
||||
fast
|
||||
:amount="money"
|
||||
@success="scanCodeSuccess"
|
||||
/>
|
||||
<scanModal ref="scanModalRef" fast :amount="money" @success="scanCodeSuccess" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -115,6 +100,7 @@ function payTypeChange(index, item) {
|
||||
|
||||
// 结算支付
|
||||
async function confirmOrder() {
|
||||
if (payLoading.value) return
|
||||
try {
|
||||
if (payList.value[payActive.value].payType == "scanCode") {
|
||||
scanModalRef.value.show();
|
||||
@@ -203,6 +189,7 @@ onMounted(() => {
|
||||
border-bottom: 1px solid #ececec;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.return {
|
||||
$size: 50px;
|
||||
width: $size;
|
||||
@@ -219,6 +206,7 @@ onMounted(() => {
|
||||
font-size: var(--el-font-size-base);
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
.t1 {
|
||||
display: flex;
|
||||
@@ -320,9 +308,7 @@ onMounted(() => {
|
||||
flex: 1;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
grid-template-rows: var(--item-height) var(--item-height) var(--item-height) var(
|
||||
--item-height
|
||||
);
|
||||
grid-template-rows: var(--item-height) var(--item-height) var(--item-height) var(--item-height);
|
||||
gap: var(--el-font-size-base);
|
||||
|
||||
.item {
|
||||
|
||||
@@ -110,6 +110,7 @@ function payTypeChange(index, item) {
|
||||
|
||||
// 结算支付
|
||||
async function confirmOrder() {
|
||||
if (payLoading.value) return
|
||||
try {
|
||||
if (payList.value[payActive.value].payType == 'scanCode') {
|
||||
scanModalRef.value.show()
|
||||
|
||||
@@ -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