打印机字段修改

This commit is contained in:
duan
2024-10-18 11:16:44 +08:00
parent b80ce77096
commit 9c97a912a7
12 changed files with 214 additions and 78 deletions

View File

@@ -114,15 +114,15 @@
<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="all" :checked="form.printMethod == '1'" class="scale7" />
<radio value="all" :checked="form.printMethod == 'all'" class="scale7" />
<text>打印全部</text>
</label>
<label class="radio u-m-r-60">
<radio value="one" :checked="form.printMethod == '2'" class="scale7" />
<radio value="one" :checked="form.printMethod == 'one'" class="scale7" />
<text>仅打印制作单[厨房]</text>
</label>
<label class="radio u-m-r-60">
<radio value="normal" :checked="form.printMethod == '2'" class="scale7" />
<radio value="normal" :checked="form.printMethod == 'normal'" class="scale7" />
<text>仅打印结账单[前台]</text>
</label>
</radio-group>
@@ -146,9 +146,6 @@
</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">
@@ -197,7 +194,8 @@
<my-button shape="circle" @click="save">保存</my-button>
</view>
</view>
<!-- 消息提示 -->
<up-toast ref="uToastRef"></up-toast>
<!-- 选择分类 -->
<choose-category v-model="chooseCategoryShow"></choose-category>
@@ -223,7 +221,8 @@
computed,
watch,
onMounted,
toRef
toRef,
getCurrentInstance
} from 'vue';
import go from '@/commons/utils/go.js';
@@ -243,6 +242,7 @@
list: brand,
selIndex: '',
})
const refs = getCurrentInstance()
// 小票
const receipt = reactive({
list: receipts,
@@ -313,17 +313,39 @@
}))
let form = reactive({
sort: "0",
status: 0,
status: 1,
connectionType: "network",
printType: [],
name: '',
receiptSize: '58mm',
classifyPrint: '0',
printQty: 'm1^1',
printType: ["refund", 'handover', 'queue'],
printMethod: "all",
selectcheckbox:[]
})
async function save() {
// 效验
if (!form.contentType || !form.subType || !form.name || !form.address) {
refs.ctx.$refs.uToastRef.show({
type: 'default',
message: "请输入必填项",
})
return
}
if (form.classifyPrint == 1 && form.selectcheckbox.length == 0) {
refs.ctx.$refs.uToastRef.show({
type: 'default',
message: "请选择部分分类",
})
return
}
// 部分分类处理
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])