打印机跳转修改

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

View File

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