Files
hht-ruitaimagang-uni/pages/modules/man-group.vue

129 lines
3.1 KiB
Vue
Raw Normal View History

2023-09-13 15:03:07 +08:00
<template>
2023-09-26 10:16:11 +08:00
<view class="zd_container">
<nav-bar 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">
<input type="number" class="filter_input" v-model="val1">
</view>
</view>
<view class="filter_item">
2023-09-26 17:28:46 +08:00
<view class="filter_label">载具类型</view>
2023-09-26 10:16:11 +08:00
<view class="filter_input_wraper">
<uni-data-select v-model="index1" :localdata="options1" @change="selectChange1"></uni-data-select>
</view>
</view>
<view class="filter_item">
<view class="filter_label_wraper">
2023-09-26 17:28:46 +08:00
<span class="filter_label">点位编码</span>
2023-09-26 10:16:11 +08:00
</view>
<view class="filter_input_wraper">
<uni-data-select v-model="index2" :localdata="options2" @change="selectChange2"></uni-data-select>
</view>
</view>
<view class="filter_item">
<view class="filter_label_wraper">
<span class="filter_label">物料重量</span>
</view>
<view class="filter_input_wraper">
<input type="number" class="filter_input" v-model="val2">
</view>
</view>
</view>
</view>
<view class="submit-bar">
<button class="submit-button" :class="{'btn-disabled': !index1 || !index2}" :disabled="disabled1" @tap="toSure">确认</button>
<button class="submit-button" @tap="toCancle">取消</button>
</view>
2023-09-13 15:03:07 +08:00
</view>
</template>
<script>
2023-09-26 10:16:11 +08:00
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
2023-09-26 17:28:46 +08:00
import {getPressCode, getVehicleType, groupmanual} from '@/utils/getData1.js'
2023-09-13 15:03:07 +08:00
export default {
2023-09-26 10:16:11 +08:00
components: {
NavBar,
SearchBox
},
2023-09-13 15:03:07 +08:00
data() {
return {
2023-09-26 10:16:11 +08:00
val1: '',
val2: '',
options1: [],
index1: '',
options2: [],
index2: '',
disabled1: false
2023-09-13 15:03:07 +08:00
};
2023-09-26 10:16:11 +08:00
},
created () {
2023-09-26 17:28:46 +08:00
this._getPressCode()
this._getVehicleType()
2023-09-26 10:16:11 +08:00
},
methods: {
/** 选择器 */
selectChange1(e) {
this.index1 = e
},
selectChange2(e) {
this.index2 = e
},
2023-09-26 17:28:46 +08:00
/** 获取载具类型下拉框 */
async _getVehicleType () {
let res = await getVehicleType()
2023-09-26 10:16:11 +08:00
this.options1 = [...res]
},
2023-09-26 17:28:46 +08:00
/** 获取点位编码下拉框 */
async _getPressCode () {
let res = await getPressCode()
2023-09-26 10:16:11 +08:00
this.options2 = [...res]
},
/** 确定 */
async toSure () {
this.disabled1 = true
if (!this.index1) {
this.disabled1 = false
return
}
if (!this.index2) {
this.disabled1 = false
return
}
try {
2023-09-26 17:28:46 +08:00
let res = await groupmanual(this.val1, this.index1, this.index2, this.val2)
2023-09-26 10:16:11 +08:00
this.disabled1 = false
2023-09-26 17:28:46 +08:00
this.val1 = ''
this.val2 = ''
2023-09-26 10:16:11 +08:00
this.index1 = ''
this.index2 = ''
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled1 = false
}
},
toCancle () {
this.disabled1 = false
2023-09-26 17:28:46 +08:00
this.val1 = ''
this.val2 = ''
2023-09-26 10:16:11 +08:00
this.index1 = ''
this.index2 = ''
}
2023-09-13 15:03:07 +08:00
}
}
</script>
2023-09-26 10:16:11 +08:00
<style lang="stylus" scoped>
.filter_item_1, .filter_input_wraper_1
align-items: flex-start
height 210rpx
2023-09-13 15:03:07 +08:00
</style>