Files
pad-hl-hcx-new/pages/management/HcxOutError.vue

153 lines
3.9 KiB
Vue
Raw Normal View History

2023-03-22 19:32:48 +08:00
<template>
<view class="content">
<nav-bar title="缓存线出箱异常"></nav-bar>
2023-03-23 15:42:19 +08:00
<view class="search-confirm-wrap">
<view class="search-wrap">
<view class="search-item">
2023-03-30 16:14:01 +08:00
<label class="search-label">生产区域</label>
2023-03-23 15:42:19 +08:00
<view class="filter_input_wraper">
<uni-data-select v-model="index1" :localdata="options1" @change="selectChange1"></uni-data-select>
</view>
2023-03-23 14:13:31 +08:00
</view>
2023-03-23 15:42:19 +08:00
<view class="search-item">
2023-03-30 16:14:01 +08:00
<label class="search-label">缓存线</label>
<view class="filter_input_wraper">
<uni-data-select v-model="index2" :localdata="options2" @change="selectChange2"></uni-data-select>
</view>
</view>
<view class="search-item">
<label class="search-label">缓存线位置</label>
2023-03-23 15:42:19 +08:00
<view class="filter_input_wraper">
<input type="text" class="search-input-l" v-model="val1">
</view>
2023-03-23 14:13:31 +08:00
</view>
2023-03-30 16:14:01 +08:00
<view class="search-item">
<label class="search-label">料箱码</label>
<view class="filter_input_wraper">
<search-box
v-model="val2"
/>
</view>
</view>
2023-05-10 15:32:25 +08:00
<view class="search-item_2 flexend">
<button class="confirm-button" @tap="toSearch()">查询</button>
<button class="confirm-button" :disabled="disabled" @tap="toSure()">确认</button>
</view>
2023-03-23 15:42:19 +08:00
</view>
2023-03-22 19:32:48 +08:00
</view>
<view class="grid-wrap">
<table class="grid-table">
<thead>
<tr>
<th>选择</th>
2023-03-23 15:42:19 +08:00
<th>指令编号</th>
<th>设备编号</th>
2023-03-30 16:14:01 +08:00
<th>条码</th>
2023-03-22 19:32:48 +08:00
<th>起点</th>
2023-03-23 15:42:19 +08:00
<th>目的</th>
<th>目的2</th>
2023-03-22 19:32:48 +08:00
</tr>
</thead>
<tbody>
2023-03-23 15:42:19 +08:00
<tr v-for="e in dataList" :key="e.instruct_uuid" @click="toRadio(e)">
2023-03-22 19:32:48 +08:00
<td>
2023-03-23 15:42:19 +08:00
<view class="iconfont icon-check" :class="{'icon-checked': pkId === e.instruct_uuid}"></view>
2023-03-22 19:32:48 +08:00
</td>
2023-03-30 16:48:50 +08:00
<td>{{e.instructoperate_num}}</td>
2023-03-23 15:42:19 +08:00
<td>{{e.wcsdevice_code}}</td>
2023-03-30 16:14:01 +08:00
<td>{{e.vehicle_code}}</td>
2023-03-23 15:42:19 +08:00
<td>{{e.startpoint_code}}</td>
<td>{{e.nextpoint_code}}</td>
<td>{{e.nextpoint_code2}}</td>
2023-03-22 19:32:48 +08:00
</tr>
</tbody>
</table>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
2023-03-23 15:42:19 +08:00
import SearchBox from '@/components/SearchBox.vue'
2023-03-30 16:14:01 +08:00
import {getCacheLine, cacheLineOutBoxExceptionQuery, cacheLineOutBoxExceptionConfirm} from '@/utils/getData1.js'
2023-03-22 19:32:48 +08:00
export default {
components: {
2023-03-23 15:42:19 +08:00
NavBar,
SearchBox
2023-03-22 19:32:48 +08:00
},
data() {
return {
2023-03-30 16:14:01 +08:00
options1: [{text: 'A1', value: 'A1'}, {text: 'A2', value: 'A2'}],
index1: 'A1',
options2: [],
index2: '',
2023-03-23 15:42:19 +08:00
val1: '',
2023-03-30 16:14:01 +08:00
val2: '',
2023-03-22 19:32:48 +08:00
dataList: [],
pkId: '',
2023-03-23 15:42:19 +08:00
disabled: false
2023-03-22 19:32:48 +08:00
};
},
2023-03-30 16:14:01 +08:00
created() {
this._getCacheLine('A1')
},
2023-03-22 19:32:48 +08:00
methods: {
2023-03-23 15:42:19 +08:00
/** 选择器1 */
selectChange1(e) {
this.index1 = e
2023-03-30 16:14:01 +08:00
if (this.index1) {
this._getCacheLine(e)
}
this.index2 = ''
},
/** 选择器2 */
selectChange2(e) {
this.index2 = e
2023-03-22 19:32:48 +08:00
},
toSearch () {
this.dataList = []
2023-03-30 16:14:01 +08:00
this.pkId = ''
this._cacheLineOutBoxExceptionQuery()
},
async _getCacheLine (id) {
let res = await getCacheLine(id)
this.options2 = [...res]
2023-03-23 15:42:19 +08:00
},
2023-03-30 16:14:01 +08:00
async _cacheLineOutBoxExceptionQuery () {
let res = await cacheLineOutBoxExceptionQuery(this.index2, this.val1)
this.dataList = [...res]
2023-03-22 19:32:48 +08:00
},
2023-03-30 16:14:01 +08:00
async toSure () {
2023-03-23 15:42:19 +08:00
this.disabled = true
if (!this.pkId) {
2023-03-22 19:32:48 +08:00
uni.showToast({
2023-03-23 15:42:19 +08:00
title: '请选择',
2023-03-22 19:32:48 +08:00
icon: 'none'
})
2023-03-23 15:42:19 +08:00
this.disabled = false
return
2023-03-22 19:32:48 +08:00
}
2023-03-30 16:14:01 +08:00
try {
let res = await cacheLineOutBoxExceptionConfirm(this.index2,this.pkId, '2', this.val2, this.index1, this.val1)
this.disabled = false
this.toSearch()
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
2023-03-22 19:32:48 +08:00
},
toRadio (e) {
2023-03-23 15:42:19 +08:00
this.pkId = this.pkId === e.instruct_uuid ? '' : e.instruct_uuid
2023-03-22 19:32:48 +08:00
}
}
}
</script>
<style lang="stylus" scoped>
@import '../../common/style/mixin.styl';
2023-03-23 15:42:19 +08:00
.grid-wrap
2023-05-10 15:32:25 +08:00
height: calc(100% - 187px); /** 42+ 15*5+ 35*2 */
2023-03-23 15:42:19 +08:00
</style>