Files
hht-tongbo/pages/ProductManage/BakeProcess.vue

159 lines
3.9 KiB
Vue
Raw Normal View History

2022-10-11 08:39:10 +08:00
<template>
2022-10-15 15:29:58 +08:00
<view class="zd_container">
2022-10-13 14:44:45 +08:00
<nav-bar title="烘烤工序"></nav-bar>
2022-10-15 15:29:58 +08:00
<view class="zd_content">
<view class="zd_wrapper">
2022-10-13 14:44:45 +08:00
<view class="filter_item">
<view class="filter_label_wraper">
<span class="filter_label">点位</span>
</view>
<view class="filter_input_wraper">
2022-12-13 10:56:09 +08:00
<search-box v-model="val1" @handleChange="handleChange1"/>
2022-10-13 14:44:45 +08:00
</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 class="filter_item">
<view class="filter_label">温度</view>
<view class="filter_input_wraper">
2022-10-14 16:05:55 +08:00
<input type="text" class="filter_input" v-model="val3">
2022-10-13 14:44:45 +08:00
</view>
</view>
<view class="filter_item">
<view class="filter_label">时间</view>
<view class="filter_input_wraper">
2022-10-14 16:05:55 +08:00
<input type="text" class="filter_input" v-model="val4">
2022-10-13 14:44:45 +08:00
</view>
</view>
</view>
</view>
<view class="submit-bar">
2022-11-11 19:09:45 +08:00
<button class="submit-button" :class="{'btn-disabled': !val1 || !val2 || !val3 || !val4}" :disabled="disabled" @tap="_ovenInAndOut1('1')">入箱</button>
<button class="submit-button" :class="{'btn-disabled': !val1 || !val2}" :disabled="disabled" @tap="_ovenInAndOut2('2')">出箱</button>
2022-10-17 10:13:52 +08:00
<button class="submit-button" :class="{'btn-disabled': !val1 || !val2}" :disabled="disabled3" @tap="_inCoolIvt">入冷却</button>
2022-12-12 10:53:27 +08:00
<button class="submit-button" :class="{'btn-disabled': !val1}" :disabled="disabled4" @tap="_bakingrelease">解警</button>
2022-10-13 14:44:45 +08:00
</view>
2022-10-11 08:39:10 +08:00
</view>
</template>
<script>
2022-10-13 14:44:45 +08:00
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
2022-12-13 10:56:09 +08:00
import {ovenInAndOut, inCoolIvt, bakingrelease, bakingquery} from '@/utils/getData1.js'
2022-10-11 08:39:10 +08:00
export default {
2022-10-13 14:44:45 +08:00
components: {
NavBar,
SearchBox
},
2022-10-11 08:39:10 +08:00
data() {
return {
2022-10-13 14:44:45 +08:00
val1: '',
val2: '',
val3: '',
val4: '',
2022-10-17 10:13:52 +08:00
disabled: false,
2022-12-12 10:53:27 +08:00
disabled3: false,
disabled4: false
2022-10-11 08:39:10 +08:00
};
2022-10-13 14:44:45 +08:00
},
methods: {
2022-12-13 10:56:09 +08:00
handleChange1 (e) {
this._bakingquery(e)
},
/** 查询 */
async _bakingquery (val1) {
if (!val1) {
return
}
let res = await bakingquery(val1)
this.val2 = res.data.container_name
2022-10-13 14:44:45 +08:00
},
2022-11-11 19:09:45 +08:00
async _ovenInAndOut1 (type) {
2022-10-13 14:44:45 +08:00
this.disabled = true
if (!this.val1 || !this.val2 ||!this.val3 || !this.val4) {
this.disabled = false
return
}
try {
let res = await ovenInAndOut(this.val1, this.val2,this.val3, this.val4, type)
uni.showToast({
2022-10-15 10:58:20 +08:00
title: res.message,
2022-10-13 14:44:45 +08:00
icon: 'none'
})
2022-12-13 10:56:09 +08:00
this.val1 = ''
this.val2 = ''
this.val3 = ''
this.val4 = ''
2022-10-13 14:44:45 +08:00
this.disabled = false
} catch (e) {
this.disabled = false
}
2022-10-17 10:13:52 +08:00
},
2022-11-11 19:09:45 +08:00
async _ovenInAndOut2 (type) {
this.disabled = true
if (!this.val1 || !this.val2) {
this.disabled = false
return
}
try {
let res = await ovenInAndOut(this.val1, this.val2,'', '', type)
uni.showToast({
title: res.message,
icon: 'none'
})
2022-12-13 10:56:09 +08:00
this.val1 = ''
this.val2 = ''
this.val3 = ''
this.val4 = ''
2022-11-11 19:09:45 +08:00
this.disabled = false
} catch (e) {
this.disabled = false
}
},
2022-10-17 10:13:52 +08:00
async _inCoolIvt () {
this.disabled3 = true
if (!this.val1 || !this.val2) {
this.disabled3 = false
return
}
try {
let res = await inCoolIvt(this.val1, this.val2)
uni.showToast({
title: res.message,
icon: 'none'
})
this.disabled3 = false
} catch (e) {
this.disabled3 = false
}
2022-12-12 10:53:27 +08:00
},
async _bakingrelease () {
this.disabled4 = true
if (!this.val1) {
this.disabled4 = false
return
}
try {
let res = await bakingrelease(this.val1)
uni.showToast({
title: res.message,
icon: 'none'
})
this.disabled4 = false
} catch (e) {
this.disabled4 = false
}
2022-10-13 14:44:45 +08:00
}
2022-10-11 08:39:10 +08:00
}
}
</script>
<style lang="stylus">
</style>