Files
hht-longdianningxin-uni/pages/manage/call-sampling.vue
2024-12-05 15:41:54 +08:00

120 lines
2.7 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-5">
<span class="filter_label">起点</span>
</view>
<view class="zd-col-19">
<search-box
v-model="val1"
/>
</view>
</view>
<view class="zd-row">
<view class="zd-col-5">
<span class="filter_label">终点</span>
</view>
<view class="zd-col-19">
<search-box
v-model="val2"
/>
</view>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-5 button-default" @tap="clearUp">清空</button>
<button class="zd-col-8 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_callAgvToSampling">呼叫</button>
<button class="zd-col-8 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_resumeMoveWasteFoilv3('2')">结束</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {callAgvToSampling, callAgvToSamplingVerify, resumeMoveWasteFoilv3} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
val1: '',
val2: '',
disabled: false
};
},
onLoad (options) {
this.title = options.title
},
methods: {
async _callAgvToSampling () {
this.disabled = true
if (!this.val1 || !this.val2) {
this.disabled1 = false
return
}
try {
let res = await callAgvToSampling(this.val1, this.val2)
this.clearUp()
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
},
async _callAgvToSamplingVerify (type) {
this.disabled = true
if (!this.val1 || !this.val2) {
this.disabled1 = false
return
}
try {
let res = await callAgvToSamplingVerify(type, this.val1, this.val2)
this.clearUp()
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
},
clearUp () {
this.val1 = ''
this.val2 = ''
this.disabled = false
},
async _resumeMoveWasteFoilv3 (type) {
this.disabled = true
if (!this.val1 || !this.val2) {
this.disabled1 = false
return
}
try {
let res = await resumeMoveWasteFoilv3(type, this.val1, this.val2)
this.clearUp()
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
}
}
}
</script>
<style lang="stylus">
</style>