141 lines
3.5 KiB
Vue
141 lines
3.5 KiB
Vue
|
|
<template>
|
||
|
|
<view class="zd_container">
|
||
|
|
<!-- <nav-bar title="备货出入库"></nav-bar> -->
|
||
|
|
<nav-bar :title="title"></nav-bar>
|
||
|
|
<view class="zd_content">
|
||
|
|
<view class="zd_wrapper">
|
||
|
|
<view class="filter_item">
|
||
|
|
<view class="filter_label_wraper">
|
||
|
|
<span class="filter_label">点位</span>
|
||
|
|
</view>
|
||
|
|
<view class="filter_input_wraper">
|
||
|
|
<search-box v-model="val1" />
|
||
|
|
</view>
|
||
|
|
</view>
|
||
|
|
<view class="filter_item">
|
||
|
|
<view class="filter_label_wraper">
|
||
|
|
<span class="filter_label">托盘号</span>
|
||
|
|
</view>
|
||
|
|
<view class="filter_input_wraper">
|
||
|
|
<search-box v-model="val2" />
|
||
|
|
</view>
|
||
|
|
</view>
|
||
|
|
</view>
|
||
|
|
<view class="zd_wrapper grid-wraper">
|
||
|
|
<view class="slide_new">
|
||
|
|
<table>
|
||
|
|
<thead>
|
||
|
|
<tr>
|
||
|
|
<th>起点</th>
|
||
|
|
<th>终点</th>
|
||
|
|
<th>任务类型</th>
|
||
|
|
<th>载具号</th>
|
||
|
|
<th>创建时间</th>
|
||
|
|
<th>更新时间</th>
|
||
|
|
</tr>
|
||
|
|
</thead>
|
||
|
|
<tbody>
|
||
|
|
<tr v-for="(e, i) in dataList" :key="i">
|
||
|
|
<td>{{e.point_code1}}</td>
|
||
|
|
<td>{{e.point_code2}}</td>
|
||
|
|
<td>{{e.vehicle_type}}</td>
|
||
|
|
<td>{{e.vehicle_code}}</td>
|
||
|
|
<td>{{e.create_time}}</td>
|
||
|
|
<td>{{e.update_time}}</td>
|
||
|
|
</tr>
|
||
|
|
</tbody>
|
||
|
|
</table>
|
||
|
|
</view>
|
||
|
|
</view>
|
||
|
|
</view>
|
||
|
|
<view class="zd-row submitbar">
|
||
|
|
<button class="zd-col-5 btn-submit btn-default" @tap="clearUp">清空</button>
|
||
|
|
<button class="zd-col-5 btn-submit btn-success" @tap="_taskTubeVehicle">刷新数据</button>
|
||
|
|
<button class="zd-col-6 btn-submit btn-success" :class="{'btn-info': !val1 || !val2}" :disabled="disabled" @tap="_emptyTubeVehicleOut">托盘移出</button>
|
||
|
|
<button class="zd-col-6 btn-submit btn-success" :class="{'btn-info': !val1 || !val2}" :disabled="disabled" @tap="_fullTubeVehicleIn">备货入库</button>
|
||
|
|
</view>
|
||
|
|
</view>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script>
|
||
|
|
import NavBar from '@/components/NavBar.vue'
|
||
|
|
import SearchBox from '@/components/SearchBox.vue'
|
||
|
|
import {taskTubeVehicle, fullTubeVehicleIn, emptyTubeVehicleOut} from '@/utils/getData3.js'
|
||
|
|
export default {
|
||
|
|
components: {
|
||
|
|
NavBar,
|
||
|
|
SearchBox
|
||
|
|
},
|
||
|
|
data() {
|
||
|
|
return {
|
||
|
|
title: '',
|
||
|
|
val1: '',
|
||
|
|
val2: '',
|
||
|
|
dataList: [],
|
||
|
|
disabled: false
|
||
|
|
};
|
||
|
|
},
|
||
|
|
onLoad (options) {
|
||
|
|
this.title = options.title
|
||
|
|
},
|
||
|
|
created () {
|
||
|
|
this._taskTubeVehicle()
|
||
|
|
},
|
||
|
|
methods: {
|
||
|
|
/**查询物料下拉框*/
|
||
|
|
async _taskTubeVehicle () {
|
||
|
|
this.dataList = []
|
||
|
|
try {
|
||
|
|
let res = await taskTubeVehicle()
|
||
|
|
if (res && res.status === 200) {
|
||
|
|
this.dataList = [...res.data]
|
||
|
|
} else {
|
||
|
|
this.dataList = []
|
||
|
|
}
|
||
|
|
} catch (e) {
|
||
|
|
this.dataList = []
|
||
|
|
}
|
||
|
|
},
|
||
|
|
async _emptyTubeVehicleOut () {
|
||
|
|
this.disabled = true
|
||
|
|
if (!this.val1 || !this.val2) {
|
||
|
|
this.disabled = false
|
||
|
|
return
|
||
|
|
}
|
||
|
|
try {
|
||
|
|
let res = await emptyTubeVehicleOut(this.val1, this.val2)
|
||
|
|
uni.showToast({
|
||
|
|
title: res.message,
|
||
|
|
icon: 'none'
|
||
|
|
})
|
||
|
|
this.clearUp()
|
||
|
|
this.disabled = false
|
||
|
|
} catch (e) {
|
||
|
|
this.disabled = false
|
||
|
|
}
|
||
|
|
},
|
||
|
|
async _fullTubeVehicleIn () {
|
||
|
|
this.disabled = true
|
||
|
|
if (!this.val1 || !this.val2) {
|
||
|
|
this.disabled = false
|
||
|
|
return
|
||
|
|
}
|
||
|
|
try {
|
||
|
|
let res = await fullTubeVehicleIn(this.val1, this.val2)
|
||
|
|
uni.showToast({
|
||
|
|
title: res.message,
|
||
|
|
icon: 'none'
|
||
|
|
})
|
||
|
|
this.clearUp()
|
||
|
|
this.disabled = false
|
||
|
|
} catch (e) {
|
||
|
|
this.disabled = false
|
||
|
|
}
|
||
|
|
},
|
||
|
|
clearUp () {
|
||
|
|
this.val1 = ''
|
||
|
|
this.val2 = ''
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
</script>
|