打印机跳转修改

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

@@ -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)
if (res.categoryIds) {
let arr = res.categoryIds.split(',') let arr = res.categoryIds.split(',')
let arrs = [] let arrs = []
arr.forEach(eles => { arr.forEach(eles => {
arrs.push(eles * 1) 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>