Files
hht-hdyy-uni/pages/hdyy/kzj/kzj-outstore.vue

114 lines
3.0 KiB
Vue
Raw Normal View History

2026-01-05 17:01:08 +08:00
<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-6">
<span class="filter_label">出库点</span>
</view>
<view class="zd-col-18">
<search-box v-model="val1"/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">载具类型</span>
</view>
<view class="zd-col-18 filter_select">
<uni-data-select v-model="index" :localdata="options"></uni-data-select>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">载具库区</span>
</view>
<view class="zd-col-18 filter_select">
<uni-data-select v-model="index2" :localdata="options2"></uni-data-select>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label filter_input_disabled">出库数量</span>
</view>
<view class="zd-col-18">
<input type="number" v-model="num" class="filter_input filter_input_disabled" disabled>
</view>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
2026-01-07 16:15:05 +08:00
<button class="zd-col-18 button-primary" :class="{'button-info': !val1 || !index || !index2 || !num}" :disabled="disabled" @tap="_callEmptyVehicle">呼叫出库</button>
2026-01-05 17:01:08 +08:00
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
2026-01-07 16:15:05 +08:00
import {getSectList, callEmptyVehicle} from '@/utils/getData3.js'
2026-01-05 17:01:08 +08:00
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
val1: '',
num: null,
options: [],
index: '',
options2: [{text: '原料区', value: 1}, {text: '辅料区', value: 2}, {text: '批料室', value: 3}, {text: '内包材区', value: 4}],
index2: '',
disabled: false
};
},
onLoad (options) {
this.title = options.title
2026-01-07 16:15:05 +08:00
this._getSectList()
2026-01-05 17:01:08 +08:00
},
methods: {
2026-01-07 16:15:05 +08:00
async _getSectList () {
2026-01-05 17:01:08 +08:00
try {
2026-01-07 16:15:05 +08:00
let res = await getSectList()
2026-01-05 17:01:08 +08:00
if (res && res.data.length > 0) {
this.options2 = [...res.data]
} else {
this.options2 = []
}
} catch (e) {
this.options2 = []
}
},
toEmpty () {
this.val1 = ''
this.index = ''
this.index2 = ''
2026-01-07 16:15:05 +08:00
this.num = null
2026-01-05 17:01:08 +08:00
this.disabled = false
},
2026-01-07 16:15:05 +08:00
async _callEmptyVehicle () {
2026-01-05 17:01:08 +08:00
this.disabled = true
2026-01-07 16:15:05 +08:00
if (!this.val1 || !this.index || !this.index2 || !this.num) {
2026-01-05 17:01:08 +08:00
this.disabled = false
return
}
try {
2026-01-07 16:15:05 +08:00
let res = await callEmptyVehicle(this.index2, this.val1, this.index, this.num)
2026-01-05 17:01:08 +08:00
if (res) {
uni.showToast({
title: res.message,
icon: 'none'
})
}
this.toEmpty()
} catch (e) {
this.disabled = false
}
}
}
}
</script>