Files
hht-ynhl-one-uni/pages/SecondPhase/EmptyVehicleInStore.vue

115 lines
3.4 KiB
Vue
Raw Normal View History

2025-05-23 15:38:21 +08:00
<template>
<view class="zd_container">
<!-- <nav-bar title="空载具入库"></nav-bar> -->
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
2025-06-30 17:13:34 +08:00
<view class="filter_item is-required">
2025-05-23 15:38:21 +08:00
<view class="filter_label_wraper">
2025-06-03 15:51:44 +08:00
<span class="filter_label">{{$t('filter.vehicle-code')}}</span>
2025-05-23 15:38:21 +08:00
</view>
<view class="filter_input_wraper">
<search-box v-model="val1" />
</view>
</view>
2025-06-30 17:13:34 +08:00
<view class="filter_item is-required">
2025-06-03 15:51:44 +08:00
<view class="filter_label">{{$t('filter.vehicle-type')}}</view>
2025-05-23 15:38:21 +08:00
<view class="filter_input_wraper">
2025-06-03 15:51:44 +08:00
<uni-data-select v-model="index" :placeholder="$t('uni.dataSelect.placeholder')" :emptyTips="$t('uni.dataSelect.emptyTips')" :localdata="options" @change="selectChange"></uni-data-select>
2025-05-23 15:38:21 +08:00
</view>
</view>
2025-06-30 17:13:34 +08:00
<view class="filter_item is-required">
2025-05-23 15:38:21 +08:00
<view class="filter_label_wraper">
2025-06-03 15:51:44 +08:00
<span class="filter_label">{{$t('grid.point-code')}}</span>
2025-05-23 15:38:21 +08:00
</view>
<view class="filter_input_wraper">
<search-box v-model="val2" />
</view>
</view>
2026-07-07 18:17:12 +08:00
<view class="filter_item is-required">
<view class="filter_label">{{$t('filter.layers')}}</view>
<view class="filter_input_wraper">
<uni-data-select v-model="index2" :placeholder="$t('uni.dataSelect.placeholder')" :emptyTips="$t('uni.dataSelect.emptyTips')" :localdata="options2" @change="selectChange2"></uni-data-select>
</view>
</view>
2025-05-23 15:38:21 +08:00
</view>
</view>
<view class="zd-row submitbar">
2025-06-03 15:51:44 +08:00
<button class="zd-col-6 btn-submit btn-default" @tap="clearUp">{{$t('button.clear')}}</button>
2026-07-07 18:17:12 +08:00
<button class="zd-col-15 btn-submit btn-success" :class="{'btn-info': !val1 || !val2 || !index || !index2}" :disabled="disabled" @tap="handleConfirm">{{$t('button.storage-confirm')}}</button>
2025-05-23 15:38:21 +08:00
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
2025-06-30 17:13:34 +08:00
import { confirmAction } from '@/utils/utils.js'
2026-07-07 18:17:12 +08:00
import {dictDetailpdaPost, twoPdaVehicleIn} from '@/utils/getData3.js'
2025-05-23 15:38:21 +08:00
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
val1: '',
2025-06-13 15:44:52 +08:00
options: [{value: '1', text: this.$t('select.coaster')}, {value: '2', text: this.$t('select.large-tray')}],
2025-05-23 15:38:21 +08:00
index: '',
2026-07-07 18:17:12 +08:00
options2: [],
index2: '',
2025-05-23 15:38:21 +08:00
val2: '',
disabled: false
};
},
onLoad (options) {
this.title = options.title
},
2026-07-07 18:17:12 +08:00
created () {
this._dictDetailpdaPost()
},
2025-05-23 15:38:21 +08:00
methods: {
2026-07-07 18:17:12 +08:00
/** 生产区域下拉框查询 */
async _dictDetailpdaPost () {
let res = await dictDetailpdaPost()
this.options2 = [...res.data]
},
2025-05-23 15:38:21 +08:00
selectChange (e) {
this.index = e
},
2026-07-07 18:17:12 +08:00
selectChange2 (e) {
this.index2 = e
},
2025-06-30 17:13:34 +08:00
async handleConfirm() {
2026-07-07 18:17:12 +08:00
if (!this.val1 || !this.val2 || !this.index || !this.index2) {
2025-05-23 15:38:21 +08:00
return
}
2026-01-21 11:27:09 +08:00
const isConfirmed = await confirmAction(this.$t('toast.prompt'), this.$t('toast.sure-perform-operation'))
2025-06-30 17:13:34 +08:00
if (isConfirmed) {
this._twoPdaVehicleIn()
}
},
async _twoPdaVehicleIn () {
this.disabled = true
2025-05-23 15:38:21 +08:00
try {
2026-07-07 18:17:12 +08:00
let res = await twoPdaVehicleIn(this.val1, this.index, this.val2, this.index2)
2025-05-23 15:38:21 +08:00
uni.showToast({
title: res.message,
icon: 'none'
})
2025-06-24 16:39:10 +08:00
this.clearUp()
2025-05-23 15:38:21 +08:00
this.disabled = false
} catch (e) {
this.disabled = false
}
},
clearUp () {
this.val1 = ''
this.index = ''
2026-07-07 18:17:12 +08:00
this.index2 = ''
2025-05-23 15:38:21 +08:00
this.val2 = ''
}
}
}
</script>