Files
hht-longdianningxin-uni/pages/manage/raw-foil-progess.vue
2025-03-07 10:47:39 +08:00

190 lines
4.9 KiB
Vue

<template>
<view class="zd_container">
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">点位</span>
</view>
<view class="zd-col-17">
<search-box
v-model="val1"
/>
</view>
</view>
</view>
<view class="zd-row mgb20">
<button class="zd-col-11 button-primary" :class="{'button-info': !val1}" :disabled="disabled" @tap="_needEmptyVehicle">呼叫空辊</button>
<button class="zd-col-11 button-primary" :class="{'button-info': !val1}" :disabled="disabled" @tap="_necessaryEmptyVehicle">空辊回库</button>
</view>
<view class="zd-row mgb20">
<button class="zd-col-11 button-primary" :class="{'button-info': !val1}" :disabled="disabled" @tap="_confirmBlanking('1')">允许进入</button>
<button class="zd-col-11 button-primary" :class="{'button-info': !val1}" :disabled="disabled" @tap="_confirmBlanking('2')">允许离开</button>
</view>
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">母卷号</span>
</view>
<view class="zd-col-17">
<search-box
v-model="val2"
/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">收卷辊码</span>
</view>
<view class="zd-col-17">
<input v-model="val3" type="text" class="filter_input">
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">呼叫收卷辊</span>
</view>
<view class="relative zd-col-17">
<switch :checked="isChecked" color="#6798ef" style="transform:scale(0.8)"/>
<text @tap="setWStatus" style="position: absolute;display: inline-block;width: 52px; height: 32px;left: 0;"></text>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">长度</span>
</view>
<view class="zd-col-17">
<input v-model="val4" type="number" class="filter_input">
</view>
</view>
<view class="zd-row">
<view class="zd-col-7">
<span class="filter_label">重量</span>
</view>
<view class="zd-col-17">
<input v-model="val5" type="number" class="filter_input">
</view>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-8 button-default" @tap="clearUp">清空</button>
<button class="zd-col-15 button-primary" :class="{'button-info': !val1 || !val3 || !val2}" :disabled="disabled" @tap="_needEmptyAxisv2">生箔下料</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {needEmptyVehicle, necessaryEmptyVehicle, needEmptyAxisv2, confirmBlanking} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
val1: '',
val2: '',
val3: '',
val4: '',
val5: '',
isChecked: false,
disabled: false
};
},
onLoad (options) {
this.title = options.title
},
methods: {
setWStatus () {
this.isChecked = !this.isChecked
},
clearUp () {
this.val1 = ''
this.val2 = ''
this.val3 = ''
this.isChecked = false
this.disabled = false
this.val4 = ''
this.val5 = ''
},
async _needEmptyVehicle () {
this.disabled = true
if (!this.val1) {
this.disabled = false
return
}
try {
let res = await needEmptyVehicle(this.val1)
this.clearUp()
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
},
async _necessaryEmptyVehicle () {
this.disabled = true
if (!this.val1) {
this.disabled = false
return
}
try {
let res = await necessaryEmptyVehicle(this.val1)
this.clearUp()
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
},
async _needEmptyAxisv2 () {
this.disabled = true
if (!this.val1 || !this.val3 || !this.val2) {
this.disabled = false
return
}
try {
let checked = this.isChecked ? '1' : '0'
let res = await needEmptyAxisv2(this.val1, this.val2, checked, this.val3, this.val4, this.val5)
this.clearUp()
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
},
async _confirmBlanking (type) {
this.disabled = true
if (!this.val1) {
this.disabled = false
return
}
try {
let res = await confirmBlanking(this.val1, type)
this.clearUp()
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
}
}
}
</script>
<style lang="stylus" scoped>
</style>