区域锁定页
This commit is contained in:
126
components/LinkScan.vue
Normal file
126
components/LinkScan.vue
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
<template>
|
||||||
|
<view class="scan_wraper">
|
||||||
|
<view class="zd-row">
|
||||||
|
<view class="zd-col-24 zd-row jcflexstart" @tap="focusState=true">
|
||||||
|
<view v-show="scanList.length" class="scaned_font">{{scanList.join()+','}}</view>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="search_input"
|
||||||
|
confirm-type="go"
|
||||||
|
v-model="value"
|
||||||
|
:focus="focusState"
|
||||||
|
@focus="handleFocus"
|
||||||
|
@blur="handleBlur"
|
||||||
|
@confirm="handleSend">
|
||||||
|
</view>
|
||||||
|
<uni-icons v-show="scanList.length" class="mgr20" type="clear" size="24" color="#4e6ef2" @tap="toDel"></uni-icons>
|
||||||
|
<uni-icons type="scan" size="22" :color="focusState ? '#D7592F' : '#4e6ef2'" @tap="focusState=true"></uni-icons>
|
||||||
|
</view>
|
||||||
|
<view v-show="scanList.length > 0 && show" class="scan_list_select">
|
||||||
|
<view class="pop_arrow"></view>
|
||||||
|
<view class="zd-row" v-for="(e, i) in scanList" :key="i">
|
||||||
|
<view class="scan_list_item">{{e}}</view>
|
||||||
|
<uni-icons type="clear" size="20" color="#666" @tap="toDelItem(i)"></uni-icons>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import permision from "@/utils/permission.js"
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
focusState: false,
|
||||||
|
scanList: [],
|
||||||
|
value: '',
|
||||||
|
show: false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleFocus () {
|
||||||
|
this.focusState = true
|
||||||
|
this.show = true
|
||||||
|
},
|
||||||
|
handleBlur () {
|
||||||
|
this.focusState = false
|
||||||
|
if (this.value) {
|
||||||
|
this.scanList.push(this.value)
|
||||||
|
this.value = ''
|
||||||
|
this.$emit('getScanlist', this.scanList)
|
||||||
|
}
|
||||||
|
this.show = false
|
||||||
|
},
|
||||||
|
toDel () {
|
||||||
|
this.value = ''
|
||||||
|
this.scanList = []
|
||||||
|
// setTimeout(()=> {
|
||||||
|
// this.focusState = true
|
||||||
|
// }, 100)
|
||||||
|
},
|
||||||
|
toDelItem (i) {
|
||||||
|
this.scanList.splice(i, 1)
|
||||||
|
this.$emit('getScanlist', this.scanList)
|
||||||
|
setTimeout(()=> {
|
||||||
|
this.focusState = true
|
||||||
|
}, 100)
|
||||||
|
},
|
||||||
|
handleSend (e) {
|
||||||
|
if (this.value) {
|
||||||
|
this.scanList.push(this.value)
|
||||||
|
this.value = ''
|
||||||
|
}
|
||||||
|
setTimeout(()=> {
|
||||||
|
this.focusState = true
|
||||||
|
}, 100)
|
||||||
|
this.$emit('getScanlist', this.scanList)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="stylus" scoped>
|
||||||
|
@import '../common/style/mixin.styl';
|
||||||
|
.scan_wraper
|
||||||
|
position relative
|
||||||
|
_wh(100%, 80rpx)
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
padding: 0 10rpx
|
||||||
|
.search_input
|
||||||
|
width 50%
|
||||||
|
height 80rpx;
|
||||||
|
_font(28rpx, 80rpx, #606266,,)
|
||||||
|
border: 0;
|
||||||
|
background-color: transparent;
|
||||||
|
.scaned_font
|
||||||
|
max-width 50%
|
||||||
|
_font(26rpx, 60rpx, #606266,,)
|
||||||
|
white-space nowrap
|
||||||
|
text-overflow ellipsis
|
||||||
|
overflow hidden
|
||||||
|
margin-right 6rpx
|
||||||
|
.scan_list_select
|
||||||
|
position absolute
|
||||||
|
top calc(100% + 12px)
|
||||||
|
left 0
|
||||||
|
z-index 3
|
||||||
|
width 100%
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
border: 1px solid #EBEEF5;
|
||||||
|
border-radius: 6px;
|
||||||
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||||
|
padding: 8rpx 10rpx
|
||||||
|
.pop_arrow
|
||||||
|
position absolute
|
||||||
|
top: -12px
|
||||||
|
left: 10%
|
||||||
|
border: 6px solid #EBEEF5;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
border-top-color: transparent;
|
||||||
|
border-left-color: transparent;
|
||||||
|
border-right-color: transparent;
|
||||||
|
.scan_list_select
|
||||||
|
_font(26rpx, 80rpx, #606266,,)
|
||||||
|
</style>
|
||||||
@@ -8,15 +8,15 @@
|
|||||||
<span class="filter_label">区域</span>
|
<span class="filter_label">区域</span>
|
||||||
</view>
|
</view>
|
||||||
<view class="zd-col-19 filter_select">
|
<view class="zd-col-19 filter_select">
|
||||||
<zxz-uni-data-select v-model="index1" filterable :localdata="options1" @change="selectChange"></zxz-uni-data-select>
|
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="zd-row submit-bar">
|
<view class="zd-row submit-bar">
|
||||||
<button class="zd-col-5 button-default" @tap="clearUp">清空</button>
|
<button class="zd-col-5 button-default" @tap="clearUp">清空</button>
|
||||||
<button class="zd-col-8 button-primary" :class="{'button-info': index1 === ''}" :disabled="disabled" @tap="_fullVehicleOut">锁定</button>
|
<button class="zd-col-8 button-primary" :class="{'button-info': index === ''}" :disabled="disabled" @tap="_handheldLock('1')">锁定</button>
|
||||||
<button class="zd-col-8 button-primary" :class="{'button-info': index1 === ''}" :disabled="disabled" @tap="_fullVehicleOut">释放</button>
|
<button class="zd-col-8 button-primary" :class="{'button-info': index === ''}" :disabled="disabled" @tap="_handheldLock('0')">释放</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import NavBar from '@/components/NavBar.vue'
|
import NavBar from '@/components/NavBar.vue'
|
||||||
import SearchBox from '@/components/SearchBox.vue'
|
import SearchBox from '@/components/SearchBox.vue'
|
||||||
import {queryMaterial, queryLinkMaterial, fullVehicleOut} from '@/utils/getData2.js'
|
import {regionList, handheldLock} from '@/utils/getData2.js'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
NavBar,
|
NavBar,
|
||||||
@@ -33,33 +33,34 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
title: '',
|
title: '',
|
||||||
options1: [],
|
options: [],
|
||||||
index1: '',
|
index: '',
|
||||||
disabled: false
|
disabled: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad (options) {
|
onLoad (options) {
|
||||||
this.title = options.title
|
this.title = options.title
|
||||||
|
this._regionList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async _queryMaterial (e) {
|
async _regionList () {
|
||||||
let res = await queryMaterial(e)
|
let res = await regionList()
|
||||||
res.map(el => {
|
this.options = [...res.content]
|
||||||
this.$set(el, 'value', el.material_id)
|
this.options.map(el => {
|
||||||
this.$set(el, 'text', el.material_name)
|
this.$set(el, 'text', el.label)
|
||||||
})
|
})
|
||||||
this.options1 = [...res]
|
|
||||||
},
|
},
|
||||||
selectChange (e) {
|
selectChange (e) {
|
||||||
|
this.index = e
|
||||||
},
|
},
|
||||||
async _fullVehicleOut () {
|
async _handheldLock (type) {
|
||||||
this.disabled = true
|
this.disabled = true
|
||||||
if (this.index1 === '') {
|
if (this.index === '') {
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
let res = await fullVehicleOut(this.index1)
|
let res = await handheldLock(this.index, type)
|
||||||
this.clearUp()
|
this.clearUp()
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.message,
|
title: res.message,
|
||||||
@@ -70,7 +71,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
clearUp () {
|
clearUp () {
|
||||||
this.index1 = ''
|
this.index = ''
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<view class="zd_wrapper">
|
<view class="zd_wrapper">
|
||||||
<view class="zd-row border-bottom">
|
<view class="zd-row border-bottom">
|
||||||
<view class="zd-col-5">
|
<view class="zd-col-5">
|
||||||
<span class="filter_label">地面点位</span>
|
<span class="filter_label">当前点位</span>
|
||||||
</view>
|
</view>
|
||||||
<view class="zd-col-19">
|
<view class="zd-col-19">
|
||||||
<search-box
|
<search-box
|
||||||
@@ -15,20 +15,17 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="zd-row">
|
<view class="zd-row">
|
||||||
<view class="zd-col-5">
|
<view class="zd-col-5">
|
||||||
<span class="filter_label">载具类型</span>
|
<span class="filter_label">载具号</span>
|
||||||
</view>
|
</view>
|
||||||
<view class="zd-col-17 filter_picker">
|
<view class="zd-col-19">
|
||||||
<picker @change="pickerChange" :value="index1" :range="options1" range-key="text">
|
<link-scan ref="scanChild" @getScanlist="getScanlist"/>
|
||||||
<view class="uni-input">{{index1 !== '' ? options1[index1].text : ''}}</view>
|
|
||||||
</picker>
|
|
||||||
</view>
|
</view>
|
||||||
<uni-icons type="right" size="14" color="#999"></uni-icons>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="zd-row submit-bar">
|
<view class="zd-row submit-bar">
|
||||||
<button class="zd-col-7 button-default" @tap="clearUp">清空</button>
|
<button class="zd-col-7 button-default" @tap="clearUp">清空</button>
|
||||||
<button class="zd-col-15 button-primary" :class="{'button-info': index1 === '' || !val1}" :disabled="disabled" @tap="_callEmptyVehicle">送回确认</button>
|
<button class="zd-col-15 button-primary" :class="{'button-info': !val1}" :disabled="disabled" @tap="_callEmptyVehicle">送回确认</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -36,20 +33,19 @@
|
|||||||
<script>
|
<script>
|
||||||
import NavBar from '@/components/NavBar.vue'
|
import NavBar from '@/components/NavBar.vue'
|
||||||
import SearchBox from '@/components/SearchBox.vue'
|
import SearchBox from '@/components/SearchBox.vue'
|
||||||
|
import LinkScan from '@/components/LinkScan.vue'
|
||||||
import {getVehicleType, callEmptyVehicle} from '@/utils/getData2.js'
|
import {getVehicleType, callEmptyVehicle} from '@/utils/getData2.js'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
NavBar,
|
NavBar,
|
||||||
SearchBox
|
SearchBox,
|
||||||
|
LinkScan
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
title: '',
|
title: '',
|
||||||
options1: [],
|
|
||||||
index1: '',
|
|
||||||
// options2: [],
|
|
||||||
// index2: '',
|
|
||||||
val1: '',
|
val1: '',
|
||||||
|
val2: '',
|
||||||
disabled: false
|
disabled: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -57,6 +53,9 @@
|
|||||||
this.title = options.title
|
this.title = options.title
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getScanlist (e) {
|
||||||
|
this.val2 = e.join()
|
||||||
|
},
|
||||||
/** 载具类型下拉框 */
|
/** 载具类型下拉框 */
|
||||||
async _getVehicleType () {
|
async _getVehicleType () {
|
||||||
let res = await getVehicleType()
|
let res = await getVehicleType()
|
||||||
@@ -67,12 +66,12 @@
|
|||||||
},
|
},
|
||||||
async _callEmptyVehicle () {
|
async _callEmptyVehicle () {
|
||||||
this.disabled = true
|
this.disabled = true
|
||||||
if (!this.val1 || this.index1 === '') {
|
if (!this.val1) {
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
let res = await callEmptyVehicle(this.options1[this.index1].value, this.val1)
|
let res = await callEmptyVehicle(this.val1)
|
||||||
this.clearUp()
|
this.clearUp()
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.message,
|
title: res.message,
|
||||||
@@ -83,8 +82,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
clearUp () {
|
clearUp () {
|
||||||
this.index1 = ''
|
|
||||||
this.val1 = ''
|
this.val1 = ''
|
||||||
|
this.val2 = ''
|
||||||
|
this.$refs.scanChild.toDel()
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,17 @@ export const handLogin = (user, password) => request({
|
|||||||
password: password
|
password: password
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
// 区域
|
||||||
|
export const regionList = () => request({
|
||||||
|
url:'api/fab/regionList',
|
||||||
|
method: 'GET'
|
||||||
|
})
|
||||||
|
// 区域锁定
|
||||||
|
export const handheldLock = (code, status) => request({
|
||||||
|
url:'api/handheld/lock',
|
||||||
|
data: {region_code: code, status: status}
|
||||||
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 空托盘出库
|
* 空托盘出库
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user