Files
hht-shangdianke-uni/pages/manage/out-storage-confirm.vue

183 lines
4.8 KiB
Vue
Raw Normal View History

<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"
@handleChange="handleChange"
/>
</view>
</view>
<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="val2"
/>
</view>
</view>
<view class="zd-row border-bottom filter_input_disabled">
<view class="zd-col-5">
<span class="filter_label">物料编码</span>
</view>
<view class="zd-col-19">
<input type="text" class="filter_input" v-model="data.material_code" disabled>
</view>
</view>
<view class="zd-row border-bottom filter_input_disabled">
<view class="zd-col-5">
<span class="filter_label">物料名称</span>
</view>
<view class="zd-col-19">
<input type="text" class="filter_input" v-model="data.material_name" disabled>
</view>
</view>
<view class="zd-row border-bottom filter_input_disabled">
<view class="zd-col-5">
<span class="filter_label">配盘批次</span>
</view>
<view class="zd-col-19">
<input type="text" class="filter_input" v-model="data.pcsn" disabled>
</view>
</view>
<view class="zd-row border-bottom filter_input_disabled">
<view class="zd-col-5">
<span class="filter_label">物料数量</span>
</view>
<view class="zd-col-19">
2024-03-19 10:07:38 +08:00
<input type="text" class="filter_input" v-model="val5" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-5">
<span class="filter_label">出库数量</span>
</view>
<view class="zd-col-19">
<input type="number" class="filter_input" v-model="val3">
</view>
</view>
2024-03-18 15:23:50 +08:00
<view class="zd-row">
<view class="zd-col-5">
<span class="filter_label">剩余数量</span>
</view>
<view class="zd-col-19">
<input type="number" class="filter_input" v-model="val4">
</view>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-7 button-default" @tap="clearUp">清空</button>
2024-03-19 10:07:38 +08:00
<button class="zd-col-7 button-primary" :class="{'button-info': !val1 || !val2 || val4 === ''}" :disabled="disabled1" @tap="_fullVehicleOutConfirm">出库确认</button>
<button class="zd-col-7 button-primary" :class="{'button-info': !val1 || !val2 || val4 === ''}" :disabled="disabled2" @tap="_vehicleGoBack">回库</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {queryGroupInfoByVehicle, fullVehicleOutConfirm, vehicleGoBack} from '@/utils/getData2.js'
import {accSubtract} from '@/utils/utils.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
val1: '',
val2: '',
val3: '',
2024-03-19 10:45:22 +08:00
val4: '',
2024-03-19 10:07:38 +08:00
val5: '',
data: {},
title: '',
disabled1: false,
disabled2: false
};
},
2024-03-19 10:45:22 +08:00
watch: {
val3 () {
if (this.val5 !== '') {
this.val4 = accSubtract(this.val5, this.val3)
}
},
val4 () {
2024-03-19 10:07:38 +08:00
if (this.val5 !== '') {
2024-03-19 10:45:22 +08:00
this.val3 = accSubtract(this.val5, this.val4)
}
}
},
onLoad (options) {
this.title = options.title
},
methods: {
handleChange (e) {
this._queryGroupInfoByVehicle(e)
},
async _queryGroupInfoByVehicle (e) {
let res = await queryGroupInfoByVehicle(e)
this.data = res
this.val2 = this.data.point_code
2024-03-19 10:07:38 +08:00
if (this.data.material_qty) {
this.val5 = this.data.material_qty
}
},
async _fullVehicleOutConfirm () {
this.disabled1 = true
2024-03-19 10:07:38 +08:00
if (!this.val1 || !this.val2 || this.val4 === '') {
this.disabled1 = false
return
}
try {
let res = await fullVehicleOutConfirm(this.val2, this.val1, this.val4)
this.disabled1 = false
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled1 = false
}
},
async _vehicleGoBack () {
this.disabled2 = true
2024-03-19 10:07:38 +08:00
if (!this.val1 || !this.val2 || this.val4 === '') {
this.disabled2 = false
return
}
try {
let res = await vehicleGoBack(this.val2, this.val1, this.val4)
this.disabled2 = false
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled2 = false
}
},
clearUp () {
this.val1 = ''
this.val2 = ''
this.val3 = ''
this.data = {}
this.disabled1 = false
this.disabled2 = false
}
}
}
</script>
<style lang="stylus">
</style>