init
This commit is contained in:
105
pages/mode/command.vue
Normal file
105
pages/mode/command.vue
Normal file
@@ -0,0 +1,105 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<!-- 设备操控 -->
|
||||
<nav-bar :title="title"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-8">
|
||||
<span class="filter_label">扫码点位</span>
|
||||
</view>
|
||||
<view class="zd-col-16">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-8">
|
||||
<span class="filter_label">载具编码</span>
|
||||
</view>
|
||||
<view class="zd-col-16">
|
||||
<search-box
|
||||
v-model="val2"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-8">
|
||||
<span class="filter_label">库存校验</span>
|
||||
</view>
|
||||
<view class="relative zd-col-16">
|
||||
<switch :checked="isChecked" color="#4e6ef2" style="transform:scale(0.8); transform-origin: left;"/>
|
||||
<text @tap="setWStatus" style="position: absolute;display: inline-block;width: 52px; height: 32px;left: 0;"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-6 button-default" @tap="toEmpty">清空</button>
|
||||
<button class="zd-col-16 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_toCommandTP">下发输送线运动命令</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {toCommandTP} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
val1: '',
|
||||
val2: '',
|
||||
disabled: false,
|
||||
isChecked: true
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
methods: {
|
||||
async _toCommandTP () {
|
||||
this.disabled = true
|
||||
if (!this.val1 || !this.val2) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let check = this.isChecked ? '1' : '0'
|
||||
let res = await toCommandTP(this.val1, '1', this.val2, check)
|
||||
this.disabled = false
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
toEmpty () {
|
||||
this.val1 = ''
|
||||
this.val2 = ''
|
||||
this.disabled = false
|
||||
this.isChecked = true
|
||||
},
|
||||
setWStatus () {
|
||||
this.isChecked = !this.isChecked
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@import '../../common/style/mixin.styl';
|
||||
.button-primary, .button-default
|
||||
_fj(center)
|
||||
font-size 26rpx
|
||||
height 88rpx
|
||||
line-height 30rpx
|
||||
</style>
|
||||
92
pages/mode/pick.vue
Normal file
92
pages/mode/pick.vue
Normal file
@@ -0,0 +1,92 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<!-- 设备操控 -->
|
||||
<nav-bar :title="title"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-8">
|
||||
<span class="filter_label">扫码点位</span>
|
||||
</view>
|
||||
<view class="zd-col-16">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-8">
|
||||
<span class="filter_label">操作命令</span>
|
||||
</view>
|
||||
<view class="zd-col-16 filter_select">
|
||||
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-6 button-default" @tap="toEmpty">清空</button>
|
||||
<button class="zd-col-16 button-primary" :class="{'button-info': !val1 || !index}" :disabled="disabled" @tap="_pinkStartStop">拣选工位启停模式</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {pinkStartStop} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
val1: '',
|
||||
options: [{value: '0', text: '停用'}, {value: '1', text: '启用'}],
|
||||
index: '',
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
methods: {
|
||||
selectChange (e) {
|
||||
this.index = e
|
||||
},
|
||||
async _pinkStartStop () {
|
||||
this.disabled = true
|
||||
if (!this.val1 || !this.index) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await pinkStartStop(this.val1, this.index)
|
||||
this.disabled = false
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
toEmpty () {
|
||||
this.val1 = ''
|
||||
this.index = ''
|
||||
this.disabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@import '../../common/style/mixin.styl';
|
||||
.button-primary, .button-default
|
||||
_fj(center)
|
||||
font-size 26rpx
|
||||
height 88rpx
|
||||
line-height 30rpx
|
||||
</style>
|
||||
92
pages/mode/switch-in-out.vue
Normal file
92
pages/mode/switch-in-out.vue
Normal file
@@ -0,0 +1,92 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<!-- 设备操控 -->
|
||||
<nav-bar :title="title"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-8">
|
||||
<span class="filter_label">扫码点位</span>
|
||||
</view>
|
||||
<view class="zd-col-16">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-8">
|
||||
<span class="filter_label">操作命令</span>
|
||||
</view>
|
||||
<view class="zd-col-16 filter_select">
|
||||
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-6 button-default" @tap="toEmpty">清空</button>
|
||||
<button class="zd-col-16 button-primary" :class="{'button-info': !val1 || !index}" :disabled="disabled" @tap="_switchInOut">切换出入库模式</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {switchInOut} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
val1: '',
|
||||
options: [{value: '0', text: '入库模式'}, {value: '1', text: '出库模式'}],
|
||||
index: '',
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
},
|
||||
methods: {
|
||||
selectChange (e) {
|
||||
this.index = e
|
||||
},
|
||||
async _switchInOut () {
|
||||
this.disabled = true
|
||||
if (!this.val1 || !this.index) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await switchInOut(this.val1, this.index)
|
||||
this.disabled = false
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
toEmpty () {
|
||||
this.val1 = ''
|
||||
this.index = ''
|
||||
this.disabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@import '../../common/style/mixin.styl';
|
||||
.button-primary, .button-default
|
||||
_fj(center)
|
||||
font-size 26rpx
|
||||
height 88rpx
|
||||
line-height 30rpx
|
||||
</style>
|
||||
Reference in New Issue
Block a user