打印机
This commit is contained in:
@@ -8,24 +8,24 @@
|
||||
</view>
|
||||
<view class="u-flex u-col-center">
|
||||
<template v-if="data.status">
|
||||
<text class="online" >在线,状态正常</text>
|
||||
<text class="online">在线,状态正常</text>
|
||||
</template>
|
||||
<template v-else>
|
||||
<image class="icon-warning" src="/pagePrinter/static/icon/icon-warning.svg" mode=""></image>
|
||||
<text class="leave u-m-l-10" >离线</text>
|
||||
<text class="leave u-m-l-10">离线</text>
|
||||
</template>
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="u-m-t-24">
|
||||
<view class="u-flex u-row-between">
|
||||
<view class="u-flex u-col-center">
|
||||
<image class="icon" src="/pagePrinter/static/icon/icon-setting.svg" mode=""></image>
|
||||
<view class="color-666 u-m-l-10">设置</view>
|
||||
<view class="color-666 u-m-l-10">是否启用</view>
|
||||
</view>
|
||||
<view>
|
||||
{{modelsName(data.config.model)}}
|
||||
<my-switch v-model="data.status" @change="openDiscountChange"></my-switch>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex u-row-between u-m-t-32">
|
||||
@@ -47,28 +47,40 @@
|
||||
</view>
|
||||
</view>
|
||||
<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" @click="toUrl" :width="140" :height="56" plain>编辑</my-button>
|
||||
<my-button shape="circle" :width="140" :height="56" type="cancel" @tap="delTableHandleEvent()"
|
||||
plain>删除</my-button>
|
||||
<my-button shape="circle" @click="toUrl" :width="140" :height="56" plain>编辑</my-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<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'
|
||||
import {
|
||||
shopConfigprinter,
|
||||
delTableHandle
|
||||
} from '@/http/yskApi/devices.js'
|
||||
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
}
|
||||
})
|
||||
let toUrl =()=>{
|
||||
go.to('PAGES_PRINTER_EDIT',{
|
||||
id:1
|
||||
const emit = defineEmits(['init'])
|
||||
let toUrl = () => {
|
||||
go.to('PAGES_PRINTER_ADD', {
|
||||
id: props.data.id
|
||||
})
|
||||
}
|
||||
|
||||
function devicesName(value) {
|
||||
return devices.find(item => item.value == value).name
|
||||
}
|
||||
@@ -84,26 +96,46 @@
|
||||
function timeFilter(s) {
|
||||
return dayjs(s).format('YYYY-MM-DD HH:mm:ss')
|
||||
}
|
||||
|
||||
async function openDiscountChange(d) {
|
||||
delete props.data.createdAt
|
||||
delete props.data.updatedAt
|
||||
const res = await shopConfigprinter({
|
||||
...props.data,
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
})
|
||||
emit('init', '')
|
||||
}
|
||||
// 删除
|
||||
async function delTableHandleEvent() {
|
||||
const res = await delTableHandle(props.data.id)
|
||||
emit('init', '')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.border-bottom{
|
||||
border-bottom: 1px solid rgb(240,240,240);
|
||||
.border-bottom {
|
||||
border-bottom: 1px solid rgb(240, 240, 240);
|
||||
}
|
||||
|
||||
.box-shadow {
|
||||
box-shadow: 0 0 5px #eee;
|
||||
}
|
||||
.online{
|
||||
|
||||
.online {
|
||||
color: #0FC161;
|
||||
}
|
||||
.leave{
|
||||
color:#999 ;
|
||||
|
||||
.leave {
|
||||
color: #999;
|
||||
}
|
||||
.icon-warning{
|
||||
|
||||
.icon-warning {
|
||||
width: 34rpx;
|
||||
height: 30rpx;
|
||||
}
|
||||
.icon{
|
||||
|
||||
.icon {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
//品牌
|
||||
const brands = reactive({
|
||||
list: devices,
|
||||
brand:brand,
|
||||
selIndex: '',
|
||||
})
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="min-page bg-gray u-p-30 u-flex u-flex-col u-row-center">
|
||||
<view class="min-page bg-gray u-p-30 u-flex u-flex-col ">
|
||||
<div class="w-full" v-for="item in pageData.list " :key="item.id">
|
||||
<printer-item :data="item"></printer-item>
|
||||
<printer-item :data="item" @init='init'></printer-item>
|
||||
</div>
|
||||
<view v-if="!pageData.list.length&&pageData.hasAjax">
|
||||
<my-img-empty ></my-img-empty>
|
||||
@@ -43,7 +43,6 @@
|
||||
async function init() {
|
||||
const res =await Api.tbPrintMachineGet(pageData.query)
|
||||
pageData.hasAjax=true
|
||||
console.log(res);
|
||||
pageData.list = res.filter(v=>v.address)
|
||||
}
|
||||
onMounted(() => {
|
||||
|
||||
Reference in New Issue
Block a user