|
|
|
|
@@ -1,19 +1,19 @@
|
|
|
|
|
<template>
|
|
|
|
|
<view class="page-gray color-333 u-font-28">
|
|
|
|
|
<view class="block">
|
|
|
|
|
<picker-item title="打印机品牌" v-model="form.contentType" :modelValue="form.contentType"
|
|
|
|
|
<picker-item title="打印机品牌" required v-model="form.contentType" :modelValue="form.contentType"
|
|
|
|
|
:list="brandt.list"></picker-item>
|
|
|
|
|
<picker-item title="小票打印" v-model="form.subType" :modelValue="form.subType"
|
|
|
|
|
<picker-item title="小票打印" required v-model="form.subType" :modelValue="form.subType"
|
|
|
|
|
:list="receipt.list"></picker-item>
|
|
|
|
|
<view class="u-p-b-14 u-m-b-24 border-bottom">
|
|
|
|
|
<view class="title">打印机名称</view>
|
|
|
|
|
<view class="title"><span style="color: red;">*</span>打印机名称</view>
|
|
|
|
|
<view class="">
|
|
|
|
|
<uni-easyinput :inputBorder="false" :padding-none="true" v-model="form.name"
|
|
|
|
|
placeholder="设置打印机名称"></uni-easyinput>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="u-p-b-14 u-m-b-24 border-bottom">
|
|
|
|
|
<view class="title">打印机编号</view>
|
|
|
|
|
<view class="title"><span style="color: red;">*</span>打印机编号</view>
|
|
|
|
|
<view class="">
|
|
|
|
|
<uni-easyinput :inputBorder="false" :padding-none="true" v-model="form.address"
|
|
|
|
|
placeholder="设置打印机名称"></uni-easyinput>
|
|
|
|
|
@@ -23,7 +23,7 @@
|
|
|
|
|
<view class="title">打印机密钥</view>
|
|
|
|
|
<view class="">
|
|
|
|
|
<uni-easyinput :inputBorder="false" :padding-none="true" v-model="form.port"
|
|
|
|
|
placeholder="设置打印机名称"></uni-easyinput>
|
|
|
|
|
placeholder="设置打印机密钥"></uni-easyinput>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="u-p-b-24 u-m-b-24 border-bottom">
|
|
|
|
|
@@ -60,6 +60,16 @@
|
|
|
|
|
</radio-group>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="u-p-b-24 u-m-b-24 border-bottom" v-if="form.classifyPrint ==1">
|
|
|
|
|
<view class="title">部分打印</view>
|
|
|
|
|
<view class="u-m-t-16" style="display: flex;">
|
|
|
|
|
<up-checkbox-group v-model="form.selectcheckbox">
|
|
|
|
|
<up-checkbox v-for="item in partList" :key="item.id" :customStyle="{marginBottom: '8px'}"
|
|
|
|
|
:label="item.name" :name="item.id" style="margin-right: 40rpx;font-size: 28rpx;">
|
|
|
|
|
</up-checkbox>
|
|
|
|
|
</up-checkbox-group>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- <view class="u-p-b-24 u-m-b-24 border-bottom">
|
|
|
|
|
<view class="title">桌台打印</view>
|
|
|
|
|
<view class="u-m-t-16">
|
|
|
|
|
@@ -103,19 +113,23 @@
|
|
|
|
|
<view class="u-m-t-16">
|
|
|
|
|
<radio-group class="u-flex u-flex-wrap" @change="sizeChange($event,'printMethod')">
|
|
|
|
|
<label class="radio u-m-r-60">
|
|
|
|
|
<radio value="1" :checked="form.printMethod == '1'" class="scale7" />
|
|
|
|
|
<text>普通</text>
|
|
|
|
|
<radio value="normal" :checked="form.printMethod == '1'" class="scale7" />
|
|
|
|
|
<text>普通出菜</text>
|
|
|
|
|
</label>
|
|
|
|
|
<label class="radio u-m-r-60">
|
|
|
|
|
<radio value="2" :checked="form.printMethod == '2'" class="scale7" />
|
|
|
|
|
<text>单个菜</text>
|
|
|
|
|
<radio value="one" :checked="form.printMethod == '2'" class="scale7" />
|
|
|
|
|
<text>一菜一品</text>
|
|
|
|
|
</label>
|
|
|
|
|
<label class="radio u-m-r-60">
|
|
|
|
|
<radio value="callTicket" :checked="form.printMethod == '2'" class="scale7" />
|
|
|
|
|
<text>排队取号</text>
|
|
|
|
|
</label>
|
|
|
|
|
</radio-group>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view class="u-p-b-24 u-m-b-24 border-bottom">
|
|
|
|
|
<!-- <view class="u-p-b-24 u-m-b-24 border-bottom">
|
|
|
|
|
<view class="title">打印类型</view>
|
|
|
|
|
<view class="u-m-t-16" style="display: flex;">
|
|
|
|
|
<up-checkbox-group v-model="form.printType">
|
|
|
|
|
@@ -130,7 +144,7 @@
|
|
|
|
|
</up-checkbox>
|
|
|
|
|
</up-checkbox-group>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view> -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -197,7 +211,7 @@
|
|
|
|
|
models,
|
|
|
|
|
subTypes,
|
|
|
|
|
brand,
|
|
|
|
|
receipts
|
|
|
|
|
receipts,
|
|
|
|
|
} from '@/pagePrinter/devices.js'
|
|
|
|
|
import {
|
|
|
|
|
onLoad,
|
|
|
|
|
@@ -208,7 +222,10 @@
|
|
|
|
|
onBeforeUnmount,
|
|
|
|
|
reactive,
|
|
|
|
|
computed,
|
|
|
|
|
watch
|
|
|
|
|
watch,
|
|
|
|
|
onMounted,
|
|
|
|
|
toRef
|
|
|
|
|
|
|
|
|
|
} from 'vue';
|
|
|
|
|
import go from '@/commons/utils/go.js';
|
|
|
|
|
import pickerItem from './components/picker-item.vue';
|
|
|
|
|
@@ -238,7 +255,7 @@
|
|
|
|
|
list: devices,
|
|
|
|
|
selIndex: '',
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
let partList = ref([])
|
|
|
|
|
//设备尺寸
|
|
|
|
|
const deciveSize = reactive({
|
|
|
|
|
list: [{
|
|
|
|
|
@@ -252,6 +269,34 @@
|
|
|
|
|
],
|
|
|
|
|
selIndex: 1
|
|
|
|
|
})
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
getlist()
|
|
|
|
|
})
|
|
|
|
|
let getlist = async () => {
|
|
|
|
|
const res = await Api.tbShopCategoryget({
|
|
|
|
|
shopId: uni.getStorageSync("shopId"),
|
|
|
|
|
sort: "sort,desc",
|
|
|
|
|
page: 0,
|
|
|
|
|
size: 500
|
|
|
|
|
})
|
|
|
|
|
let arr = []
|
|
|
|
|
res.content.forEach(ele => {
|
|
|
|
|
arr.push({
|
|
|
|
|
id: ele.id,
|
|
|
|
|
name: ele.name
|
|
|
|
|
})
|
|
|
|
|
if (ele.childrenList.length > 0) {
|
|
|
|
|
ele.childrenList.forEach(element => {
|
|
|
|
|
arr.push({
|
|
|
|
|
id: element.id,
|
|
|
|
|
name: element.name
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
partList.value = arr
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function sizeChange(e, name) {
|
|
|
|
|
form[name] = e.detail.value
|
|
|
|
|
@@ -277,10 +322,21 @@
|
|
|
|
|
status: 0,
|
|
|
|
|
connectionType: "network",
|
|
|
|
|
printType: [],
|
|
|
|
|
name: ''
|
|
|
|
|
name: '',
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
async function save() {
|
|
|
|
|
// 部分分类处理
|
|
|
|
|
if (form.classifyPrint == 1) {
|
|
|
|
|
let idstr = ''
|
|
|
|
|
let arr = []
|
|
|
|
|
console.log(form.selectcheckbox, '提交')
|
|
|
|
|
form.selectcheckbox.forEach(element => {
|
|
|
|
|
idstr += element + ','
|
|
|
|
|
arr.push(partList.value.filter(ele => ele.id == element)[0])
|
|
|
|
|
})
|
|
|
|
|
form.categoryIds = idstr.substring(0, idstr.length - 1)
|
|
|
|
|
form.categoryList = JSON.stringify(arr)
|
|
|
|
|
}
|
|
|
|
|
if (userId.value) {
|
|
|
|
|
delete form.createdAt
|
|
|
|
|
delete form.updatedAt
|
|
|
|
|
@@ -302,8 +358,13 @@
|
|
|
|
|
// const option = reactive({})
|
|
|
|
|
async function getdetails() {
|
|
|
|
|
const res = await Api.printerd(userId.value)
|
|
|
|
|
let arr = res.categoryIds.split(',')
|
|
|
|
|
let arrs = []
|
|
|
|
|
arr.forEach(eles => {
|
|
|
|
|
arrs.push(eles * 1)
|
|
|
|
|
})
|
|
|
|
|
res.selectcheckbox = arrs
|
|
|
|
|
form = Object.assign(form, res)
|
|
|
|
|
form.printType = JSON.parse(res.printType)
|
|
|
|
|
}
|
|
|
|
|
onLoad((options) => {
|
|
|
|
|
if (options.id) {
|
|
|
|
|
|