上料下料
This commit is contained in:
@@ -6,7 +6,8 @@
|
||||
<view class="filter_item">
|
||||
<view class="filter_label">区域</view>
|
||||
<view class="filter_input_wraper">
|
||||
<uni-data-select v-model="index1" :localdata="options1" @change="selectChange1"></uni-data-select>
|
||||
<!-- <uni-data-select v-model="index1" :localdata="options1" @change="selectChange1"></uni-data-select> -->
|
||||
<zxz-uni-data-select v-model="index1" filterable :localdata="options1" @inputChange="inputChange1" @change="selectChange1"></zxz-uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="filter_item">
|
||||
@@ -17,16 +18,24 @@
|
||||
<uni-data-select v-model="index2" :localdata="options2" @change="selectChange2"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="filter_item filter_item_1">
|
||||
<view class="filter_item">
|
||||
<view class="filter_label">载具编码</view>
|
||||
<view class="filter_input_wraper">
|
||||
<search-box v-model="val1" @handleChange="handleChange1"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="filter_item">
|
||||
<view class="filter_label_wraper">
|
||||
<span class="filter_label">物料类型</span>
|
||||
</view>
|
||||
<view class="filter_input_wraper">
|
||||
<uni-data-select v-model="index3" :localdata="options3" @change="selectChange3"></uni-data-select>
|
||||
</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" :class="{'btn-disabled': !val1 || !index2}" :disabled="disabled1" @tap="toSure">确认</button>
|
||||
<button class="submit-button" @tap="toCancle">取消</button>
|
||||
</view>
|
||||
</view>
|
||||
@@ -35,7 +44,7 @@
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {deviceInfo, deviceStatus, deviceCheckVerify} from '@/utils/getData2.js'
|
||||
import {queryRegion, queryPoint, outStructOutSave} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
@@ -47,58 +56,76 @@
|
||||
index1: '',
|
||||
options2: [],
|
||||
index2: '',
|
||||
remark: '',
|
||||
options3: [{text: '正极板', value: '1'}, {text: '负极板', value: '2'}, {text: '边负极板', value: '3'}],
|
||||
index3: '',
|
||||
val1: '',
|
||||
disabled1: false
|
||||
};
|
||||
},
|
||||
created () {
|
||||
this._deviceInfo()
|
||||
this._deviceStatus()
|
||||
this._queryRegion()
|
||||
},
|
||||
methods: {
|
||||
/** 选择器 */
|
||||
/** 选择器1 */
|
||||
inputChange1 (e) {
|
||||
// console.log('inputChange1:' + e)
|
||||
},
|
||||
selectChange1(e) {
|
||||
this.index1 = e
|
||||
// console.log('selectChange1:' + e)
|
||||
if (e) {
|
||||
this.index1 = e.region_code
|
||||
this._queryPoint(e.region_code)
|
||||
} else {
|
||||
this.options2 = []
|
||||
}
|
||||
},
|
||||
selectChange2(e) {
|
||||
this.index2 = e
|
||||
},
|
||||
/** 获取设备下拉框 */
|
||||
async _deviceInfo () {
|
||||
let res = await deviceInfo()
|
||||
this.options1 = [...res]
|
||||
selectChange3(e) {
|
||||
this.index3 = e
|
||||
},
|
||||
/** 获取设备状态下拉框 */
|
||||
async _deviceStatus () {
|
||||
let res = await deviceStatus()
|
||||
this.options2 = [...res]
|
||||
/** 获取区域下拉框 */
|
||||
async _queryRegion () {
|
||||
let res = await queryRegion()
|
||||
this.options1 = [...res.result]
|
||||
this.options1.map(el => {
|
||||
this.$set(el, 'value', el.region_code)
|
||||
this.$set(el, 'text', el.region_name)
|
||||
})
|
||||
},
|
||||
/** 获取点位状态下拉框 */
|
||||
async _queryPoint (e) {
|
||||
let res = await queryPoint(e)
|
||||
this.options2 = [...res.result]
|
||||
this.options2.map(el => {
|
||||
this.$set(el, 'value', el.device_code)
|
||||
this.$set(el, 'text', el.device_name)
|
||||
})
|
||||
},
|
||||
/** 确定 */
|
||||
async toSure () {
|
||||
this.disabled1 = true
|
||||
if (!this.index1) {
|
||||
if (!this.index2) {
|
||||
uni.showToast({
|
||||
title: '设备号不能为空',
|
||||
title: '点位不能为空',
|
||||
icon: 'none'
|
||||
})
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
if (!this.index2) {
|
||||
if (!this.val1) {
|
||||
uni.showToast({
|
||||
title: '状态不能为空',
|
||||
title: '载具编码不能为空',
|
||||
icon: 'none'
|
||||
})
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let userName = this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).username : ''
|
||||
let res = await deviceCheckVerify(this.index1, userName,this.remark, this.index2)
|
||||
let res = await outStructOutSave(this.index2,this.val1, this.index3)
|
||||
this.disabled1 = false
|
||||
this.index1 = ''
|
||||
this.index2 = ''
|
||||
this.remark = ''
|
||||
this.toCancle()
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
@@ -111,14 +138,13 @@
|
||||
this.disabled1 = false
|
||||
this.index1 = ''
|
||||
this.index2 = ''
|
||||
this.remark = ''
|
||||
this.options2 = []
|
||||
this.val1 = ''
|
||||
this.index3 = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.filter_item_1, .filter_input_wraper_1
|
||||
align-items: flex-start
|
||||
height 210rpx
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user