Files
hht-oulun-uni/pages/outbound/out-store-confirm.vue
2025-07-29 09:53:02 +08:00

153 lines
4.4 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-7">
<span class="filter_label">载具信息</span>
</view>
<view class="zd-col-24">
<search-box
v-model="val1"
@handleChange="handleChange"
/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label filter_input_disabled">物料名称</span>
</view>
<view class="zd-col-17">
<input type="text" class="filter_input filter_input_disabled" v-model="currentData.material_name" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label filter_input_disabled">物料规格</span>
</view>
<view class="zd-col-17">
<input type="text" class="filter_input filter_input_disabled" v-model="currentData.material_spec" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label filter_input_disabled">物料编号</span>
</view>
<view class="zd-col-17">
<input type="text" class="filter_input filter_input_disabled" v-model="currentData.material_code" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label filter_input_disabled">物料批次</span>
</view>
<view class="zd-col-17">
<input type="text" class="filter_input filter_input_disabled" v-model="currentData.pcsn" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label filter_input_disabled">物料数量</span>
</view>
<view class="zd-col-17">
<input type="text" class="filter_input filter_input_disabled" v-model="currentData.qty" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label filter_input_disabled">出库数量</span>
</view>
<view class="zd-col-17">
<input type="text" class="filter_input filter_input_disabled" :class="{'hightlight': currentData.qty !== currentData.frozen_qty}" v-model="currentData.frozen_qty" disabled>
</view>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-6 button-default" @tap="clearUp">清空</button>
<button class="zd-col-8 button-primary" :class="{'button-info': !val1 || !this.currentData.group_id}" :disabled="disabled" @tap="_outstoreconfirm('2')">强制确认</button>
<button class="zd-col-8 button-primary" :class="{'button-info': !val1 || !this.currentData.group_id}" :disabled="disabled" @tap="_outstoreconfirm('1')">出库确认</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {iosOutgetVehicleMaterial, outstoreconfirm} from '@/utils/getData3.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
val1: '',
currentData: {},
disabled: false,
isDiff: false,
};
},
onLoad (options) {
this.title = options.title
},
created () {
},
methods: {
clearUp () {
this.code = ''
this.disabled = false
},
handleChange (e) {
if (e) {
this._iosOutgetVehicleMaterial(e)
}
},
async _iosOutgetVehicleMaterial (e) {
try {
let res = await iosOutgetVehicleMaterial(e)
if (res.code === '200') {
this.currentData = res.data[0]
} else {
this.currentData = {}
}
} catch (e) {
this.currentData = {}
}
},
async _outstoreconfirm (type) {
this.disabled = true
if (!this.val1 || !this.currentData.group_id) {
this.disabled = false
return
}
try {
let res = await outstoreconfirm(this.currentData.group_id, this.val1, type)
if (res.code === '200') {
uni.showToast({
title: res.message,
icon: 'none'
})
this.clearUp()
} else {
uni.showToast({
title: res.message,
icon: 'none'
})
this.disabled = false
}
} catch (e) {
this.disabled = false
}
}
}
}
</script>
<style lang="stylus">
.hightlight
color #f00
</style>