打印机跳转修改

This commit is contained in:
duan
2024-10-17 15:03:01 +08:00
parent 25dfe869f0
commit 138be3bd75
2 changed files with 40 additions and 29 deletions

View File

@@ -1,7 +1,7 @@
<template>
<view class="page-gray color-333 u-font-28">
<view class="block">
<!-- <up-popup :show="show" @close="close" @open="open"> -->
<!-- <up-popup :show="show" @close="close" @open="open"> -->
<picker-item title="打印机品牌" required v-model="form.contentType" :modelValue="form.contentType"
:list="brandt.list"></picker-item>
<picker-item title="小票打印" required v-model="form.subType" :modelValue="form.subType"
@@ -130,26 +130,26 @@
</view>
<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">
<up-checkbox :customStyle="{marginBottom: '8px'}" label="确认退款单" name="refund"
style="margin-right: 40rpx;font-size: 28rpx;">
</up-checkbox>
<up-checkbox :customStyle="{marginBottom: '8px'}" label="交班单" name="handover"
style="margin-right: 40rpx;font-size: 28rpx;">
</up-checkbox>
<up-checkbox :customStyle="{marginBottom: '8px'}" label="排队取号" name="queue"
style="margin-right: 40rpx;font-size: 28rpx;">
</up-checkbox>
</up-checkbox-group>
</view>
<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">
<up-checkbox :customStyle="{marginBottom: '8px'}" label="确认退款单" name="refund"
style="margin-right: 40rpx;font-size: 28rpx;">
</up-checkbox>
<up-checkbox :customStyle="{marginBottom: '8px'}" label="交班单" name="handover"
style="margin-right: 40rpx;font-size: 28rpx;">
</up-checkbox>
<up-checkbox :customStyle="{marginBottom: '8px'}" label="排队取号" name="queue"
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="u-p-b-24 u-m-b-24 border-bottom">
<view class="title">打印单据</view>
<view class="u-m-t-16">
<radio-group class="u-flex u-flex-wrap" @change="sizeChange($event,'printReceipt')">
@@ -268,9 +268,7 @@
],
selIndex: 1
})
onMounted(() => {
getlist()
})
let getlist = async () => {
const res = await Api.tbShopCategoryget({
shopId: uni.getStorageSync("shopId"),
@@ -295,6 +293,7 @@
})
partList.value = arr
}
function sizeChange(e, name) {
form[name] = e.detail.value
}
@@ -343,7 +342,8 @@
...form
})
}
go.to('/pagePrinter/index/index')
go.back()
// go.to('/pagePrinter/index/index')
}
// watch(() => form.config.model, (newval) => {
// console.log(newval);
@@ -351,16 +351,19 @@
// 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
if (res.categoryIds) {
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(form.printType)
}
onLoad((options) => {
getlist()
if (options.id) {
// 有id是编辑获取详情
userId.value = options.id
@@ -370,6 +373,9 @@
}
// Object.assign(option, opt)
})
// show(()=>{
// getlist()
// })
</script>
<style lang="scss" scoped>

View File

@@ -20,6 +20,9 @@
<script setup>
import go from '@/commons/utils/go.js'
import {
onShow,
} from '@dcloudio/uni-app'
import {
onMounted,
reactive
@@ -43,13 +46,15 @@
async function init() {
const res =await Api.tbPrintMachineGet(pageData.query)
pageData.hasAjax=true
console.log(res,'调试')
pageData.list = res
// pageData.list = res.filter(v=>v.address)
}
onMounted(() => {
onShow(()=>{
init()
})
// onMounted(() => {
// init()
// })
</script>
<style lang="scss" scoped>