添加编辑打印机
This commit is contained in:
parent
200ecaea29
commit
4f9517ac7f
|
|
@ -48,7 +48,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="u-m-t-32 u-flex u-row-right gap-20">
|
<view class="u-m-t-32 u-flex u-row-right gap-20">
|
||||||
<my-button shape="circle" :width="140" :height="56" type="cancel" plain>删除</my-button>
|
<my-button shape="circle" :width="140" :height="56" type="cancel" plain>删除</my-button>
|
||||||
<my-button shape="circle" :width="140" :height="56" plain>编辑</my-button>
|
<my-button shape="circle" @click="toUrl" :width="140" :height="56" plain>编辑</my-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
@ -57,14 +57,18 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { devices, models, subTypes } from '@/pagePrinter/devices.js'
|
import { devices, models, subTypes } from '@/pagePrinter/devices.js'
|
||||||
|
import go from '@/commons/utils/go.js'
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {}
|
default: () => {}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
let toUrl =()=>{
|
||||||
|
go.to('PAGES_PRINTER_EDIT',{
|
||||||
|
id:1
|
||||||
|
})
|
||||||
|
}
|
||||||
function devicesName(value) {
|
function devicesName(value) {
|
||||||
return devices.find(item => item.value == value).name
|
return devices.find(item => item.value == value).name
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,174 @@
|
||||||
|
<template>
|
||||||
|
<view class="page-gray color-333 u-font-28">
|
||||||
|
<view class="block">
|
||||||
|
<picker-item title="打印机类型" v-model="brands.selIndex" rangeKey="name" :list="brands.list"></picker-item>
|
||||||
|
<view class="u-p-b-14 u-m-b-24 border-bottom">
|
||||||
|
<view class="title">设备号</view>
|
||||||
|
<view class="">
|
||||||
|
<uni-easyinput :inputBorder="false" :padding-none="true" v-model="form.form"
|
||||||
|
placeholder="输入设备号"></uni-easyinput>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="u-p-b-24 u-m-b-24 border-bottom">
|
||||||
|
<view class="title font-bold">商品分类</view>
|
||||||
|
<view class="u-m-t-16 u-flex u-row-between " @click="categoryShow">
|
||||||
|
<view class="color-333" v-if="form.sort">{{form.sort}}</view>
|
||||||
|
<view class="color-999" v-else>请选择</view>
|
||||||
|
<uni-icons type="right" color="#999" size="16"></uni-icons>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view style="height: 60rpx;"></view>
|
||||||
|
<view class="">
|
||||||
|
<view class="btn">
|
||||||
|
<my-button shape="circle" @click="save">保存</my-button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 选择分类 -->
|
||||||
|
<choose-category v-model="chooseCategoryShow"></choose-category>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
devices,
|
||||||
|
models,
|
||||||
|
subTypes
|
||||||
|
} from '@/pagePrinter/devices.js'
|
||||||
|
import {
|
||||||
|
onLoad,
|
||||||
|
onShow
|
||||||
|
} from '@dcloudio/uni-app'
|
||||||
|
import {
|
||||||
|
ref,
|
||||||
|
onBeforeUnmount,
|
||||||
|
reactive,
|
||||||
|
computed,
|
||||||
|
watch
|
||||||
|
} from 'vue';
|
||||||
|
import go from '@/commons/utils/go.js';
|
||||||
|
import pickerItem from '../add-printer/components/picker-item.vue'
|
||||||
|
import myRadioGroup from '../add-printer/components/my-radio-group.vue';
|
||||||
|
import * as Api from '@/http/yskApi/devices.js'
|
||||||
|
import chooseCategory from '../add-printer/components/choose-category.vue';
|
||||||
|
|
||||||
|
//选择分类
|
||||||
|
let chooseCategoryShow = ref(false)
|
||||||
|
|
||||||
|
function categoryShow() {
|
||||||
|
chooseCategoryShow.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
//品牌
|
||||||
|
const brands = reactive({
|
||||||
|
list: devices,
|
||||||
|
selIndex: '',
|
||||||
|
})
|
||||||
|
|
||||||
|
//设备尺寸
|
||||||
|
const deciveSize = reactive({
|
||||||
|
list: [{
|
||||||
|
label: '58mm',
|
||||||
|
value: '0'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '80mm',
|
||||||
|
value: '1'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
selIndex: 1
|
||||||
|
})
|
||||||
|
|
||||||
|
function sizeChange(e) {
|
||||||
|
deciveSize.selIndex = e.detail.value
|
||||||
|
}
|
||||||
|
|
||||||
|
//打印份数
|
||||||
|
const printerNums = reactive({
|
||||||
|
list: new Array(4).fill(1).map((v, index) => {
|
||||||
|
return {
|
||||||
|
label: index * 1 + 1 + '份',
|
||||||
|
value: '' + index
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
selIndex: 0
|
||||||
|
})
|
||||||
|
//尾部留空
|
||||||
|
const feets = ref([0, 1, 2, 3, 4, 5, 8].map(v => {
|
||||||
|
return v + '行'
|
||||||
|
}))
|
||||||
|
|
||||||
|
const form = reactive({
|
||||||
|
id: '',
|
||||||
|
contentType: '',
|
||||||
|
config: {
|
||||||
|
width: '80mm', // 设备尺寸
|
||||||
|
printerNum: 1, //打印份数
|
||||||
|
categoryList: '', // 商品分类
|
||||||
|
model: 'normal', // 出品模式,
|
||||||
|
feet: '0',
|
||||||
|
autoCut: 0
|
||||||
|
},
|
||||||
|
name: '',
|
||||||
|
subType: 'kitchen', // 打印类型
|
||||||
|
status: 0,
|
||||||
|
sort: ''
|
||||||
|
})
|
||||||
|
|
||||||
|
function save() {
|
||||||
|
|
||||||
|
}
|
||||||
|
watch(() => form.config.model, (newval) => {
|
||||||
|
console.log(newval);
|
||||||
|
})
|
||||||
|
|
||||||
|
const option = reactive({})
|
||||||
|
|
||||||
|
onLoad((opt) => {
|
||||||
|
console.log(opt);
|
||||||
|
Object.assign(option, opt)
|
||||||
|
})
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
|
||||||
|
})
|
||||||
|
onShow(() => {})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.page-gray {
|
||||||
|
padding: 32rpx 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.block {
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 32rpx 24rpx;
|
||||||
|
border-radius: 18rpx;
|
||||||
|
margin-bottom: 32rpx;
|
||||||
|
box-shadow: 0 0 5px #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.radio {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fixed_b {
|
||||||
|
left: 30rpx;
|
||||||
|
right: 30rpx;
|
||||||
|
bottom: calc(env(safe-area-inset-bottom) + 10rpx);
|
||||||
|
/* #ifdef H5 */
|
||||||
|
bottom: 30rpx;
|
||||||
|
/* #endif */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
},
|
},
|
||||||
setup() {
|
setup() {
|
||||||
const toggle = (type) => {
|
const toggle = (type) => {
|
||||||
console.log(refs, '调试1')
|
// console.log(refs, '调试1')
|
||||||
this.$refs.popup.open(type)
|
this.$refs.popup.open(type)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1244,6 +1244,13 @@
|
||||||
// "navigationBarTitleText" : "添加/编辑云打印机"
|
// "navigationBarTitleText" : "添加/编辑云打印机"
|
||||||
"navigationBarTitleText": ""
|
"navigationBarTitleText": ""
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pageId": "PAGES_PRINTER_EDIT",
|
||||||
|
"path": "index/editPrinter",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText" : "打印机编辑"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue