Files
hht-shangdianke-uni/pages/manage/empty-tray-in.vue

109 lines
2.6 KiB
Vue
Raw Permalink Normal View History

2024-03-11 13:43:45 +08:00
<template>
<view class="zd_container">
2024-03-12 15:23:12 +08:00
<nav-bar :title="title"></nav-bar>
2024-03-11 13:43:45 +08:00
<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>
2024-03-11 17:11:26 +08:00
<view class="zd-col-17 filter_picker">
2024-03-11 13:43:45 +08:00
<picker @change="pickerChange" :value="index1" :range="options1" range-key="text">
<view class="uni-input">{{index1 !== '' ? options1[index1].text : ''}}</view>
</picker>
</view>
2024-03-12 15:23:12 +08:00
<uni-icons type="right" size="14" color="#999"></uni-icons>
2024-03-11 13:43:45 +08:00
</view>
<view class="zd-row border-bottom">
<view class="zd-col-5">
<span class="filter_label">载具编码</span>
</view>
<view class="zd-col-19">
2024-03-11 17:11:26 +08:00
<search-box
v-model="val1"
/>
2024-03-11 13:43:45 +08:00
</view>
</view>
<view class="zd-row">
<view class="zd-col-5">
<span class="filter_label">点位编码</span>
</view>
<view class="zd-col-19">
<search-box
2024-03-11 17:11:26 +08:00
v-model="val2"
2024-03-11 13:43:45 +08:00
/>
</view>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-11 button-default" @tap="clearUp">清空</button>
<button class="zd-col-11 button-primary" :class="{'button-info': index1 === '' || !val1 || !val2}" :disabled="disabled" @tap="_emptyInStore">确认</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getVehicleType, emptyInStore} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
2024-03-12 15:23:12 +08:00
title: '',
2024-03-11 13:43:45 +08:00
options1: [],
index1: '',
val1: '',
val2: '',
disabled: false
};
},
2024-03-12 15:23:12 +08:00
onLoad (options) {
this.title = options.title
},
2024-03-11 13:43:45 +08:00
created () {
this._getVehicleType()
},
methods: {
/** 载具类型下拉框 */
async _getVehicleType () {
let res = await getVehicleType()
this.options1 = [...res]
},
pickerChange (e) {
this.index1 = e.detail.value
},
async _emptyInStore () {
this.disabled = true
2024-03-11 17:11:26 +08:00
if (this.index1 === '' || !this.val1 || !this.val2) {
2024-03-11 13:43:45 +08:00
this.disabled = false
return
}
try {
2024-03-11 17:11:26 +08:00
let res = await emptyInStore(this.options1[this.index1].value, this.val1, this.val2)
2024-03-11 13:43:45 +08:00
this.clearUp()
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
},
clearUp () {
this.index1 = ''
this.val1 = ''
this.val2 = ''
this.disabled = false
}
}
}
</script>
<style lang="stylus">
</style>