涂板线叫空架
This commit is contained in:
143
pages/modules/calling-empty.vue
Normal file
143
pages/modules/calling-empty.vue
Normal file
@@ -0,0 +1,143 @@
|
||||
<template>
|
||||
<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">区域</view>
|
||||
<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">
|
||||
<span class="filter_label">点位</span>
|
||||
</view>
|
||||
<view class="filter_input_wraper">
|
||||
<zxz-uni-data-select v-model="index2" filterable :localdata="options2" @inputChange="inputChange2" @change="selectChange2"></zxz-uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="filter_item">
|
||||
<view class="filter_label">载具编码</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">
|
||||
<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': !val1 || !index2}" :disabled="disabled1" @tap="toSure">确认</button>
|
||||
<button class="submit-button" @tap="toCancle">取消</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {queryPoint, outStructOutSave} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
options1: [{text: '涂板线1', value: 'TBX1'}, {text: '涂板线2', value: 'TBX2'}],
|
||||
index1: 'TBX1',
|
||||
options2: [],
|
||||
index2: '',
|
||||
options3: [{text: '正极板', value: '1'}, {text: '负极板', value: '2'}, {text: '边负极板', value: '3'}],
|
||||
index3: '',
|
||||
val1: '',
|
||||
disabled1: false
|
||||
};
|
||||
},
|
||||
created () {
|
||||
this._queryPoint('TBX1')
|
||||
},
|
||||
methods: {
|
||||
/** 选择器1 */
|
||||
selectChange1(e) {
|
||||
this.index1 = e
|
||||
if (e) {
|
||||
this._queryPoint(e)
|
||||
} else {
|
||||
this.options2 = []
|
||||
this.index2 = ''
|
||||
}
|
||||
},
|
||||
inputChange2 (e) {
|
||||
// console.log(e)
|
||||
},
|
||||
selectChange2(e) {
|
||||
if (e) {
|
||||
this.index2 = e.point_code
|
||||
}
|
||||
},
|
||||
selectChange3(e) {
|
||||
this.index3 = e
|
||||
},
|
||||
/** 获取点位状态下拉框 */
|
||||
async _queryPoint (e) {
|
||||
let res = await queryPoint(e)
|
||||
this.options2 = [...res]
|
||||
this.options2.map(el => {
|
||||
this.$set(el, 'value', el.point_code)
|
||||
this.$set(el, 'text', el.point_name)
|
||||
})
|
||||
},
|
||||
/** 确定 */
|
||||
async toSure () {
|
||||
this.disabled1 = true
|
||||
if (!this.index2) {
|
||||
uni.showToast({
|
||||
title: '点位不能为空',
|
||||
icon: 'none'
|
||||
})
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
if (!this.val1) {
|
||||
uni.showToast({
|
||||
title: '载具编码不能为空',
|
||||
icon: 'none'
|
||||
})
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await outStructOutSave(this.index2,this.val1, this.index3)
|
||||
this.disabled1 = false
|
||||
this.toCancle()
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
}
|
||||
},
|
||||
toCancle () {
|
||||
this.disabled1 = false
|
||||
this.index1 = 'TBX1'
|
||||
this.index2 = ''
|
||||
this.options2 = []
|
||||
this._queryPoint('TBX1')
|
||||
this.val1 = ''
|
||||
this.index3 = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
</style>
|
||||
Reference in New Issue
Block a user