This commit is contained in:
2025-04-03 13:17:12 +08:00
parent 705dfc36f9
commit 95e2db8341

View File

@@ -4,6 +4,14 @@
<nav-bar :title="title"></nav-bar> <nav-bar :title="title"></nav-bar>
<view class="zd_content"> <view class="zd_content">
<view class="zd_wrapper"> <view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-9">
<span class="filter_label">入库单类型</span>
</view>
<view class="zd-col-24 filter_select">
<uni-data-select v-model="index1" :localdata="options1" @change="selectChange1"></uni-data-select>
</view>
</view>
<view class="zd-row border-bottom"> <view class="zd-row border-bottom">
<view class="zd-col-6"> <view class="zd-col-6">
<span class="filter_label">单据编码</span> <span class="filter_label">单据编码</span>
@@ -74,7 +82,7 @@
</view> </view>
<view class="zd-row submit-bar"> <view class="zd-row submit-bar">
<button class="zd-col-6 button-default" @tap="toEmpty">清空</button> <button class="zd-col-6 button-default" @tap="toEmpty">清空</button>
<button class="zd-col-16 button-primary" :class="{'button-info': !val1 || !val1 || !index}" :disabled="disabled" @tap="_inStorageConfirm">组盘确认</button> <button class="zd-col-16 button-primary" :class="{'button-info': !val1 || !val1 || !index || !index1}" :disabled="disabled" @tap="_inStorageConfirm">组盘确认</button>
</view> </view>
<view class="zd_content msg_wrapper" :class="show ? 'popshow' : 'pophide'"> <view class="zd_content msg_wrapper" :class="show ? 'popshow' : 'pophide'">
<view class="pop-line"></view> <view class="pop-line"></view>
@@ -120,7 +128,7 @@
<script> <script>
import NavBar from '@/components/NavBar.vue' import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue' import SearchBox from '@/components/SearchBox.vue'
import {getBillNoInfo, storList, inStorageConfirm} from '@/utils/getData2.js' import {outStorageOrder, getBillNoInfo, storList, inStorageConfirm} from '@/utils/getData2.js'
export default { export default {
components: { components: {
NavBar, NavBar,
@@ -133,19 +141,31 @@
show: false, show: false,
dataList: [], dataList: [],
pkId: '', pkId: '',
pkObj: {},
currentData: {}, currentData: {},
val1: null, val1: null,
val2: null, val2: null,
options: [], options: [],
index: '', index: '',
disabled: false disabled: false,
options1: [],
index1: ''
}; };
}, },
onLoad (options) { onLoad (options) {
this.title = options.title this.title = options.title
this._outStorageOrder()
this._storList() this._storList()
}, },
methods: { methods: {
/** 下拉框*/
async _outStorageOrder () {
let res = await outStorageOrder()
this.options1 = [...res]
},
selectChange1 (e) {
this.index1 = e
},
handleChange1 (e) { handleChange1 (e) {
if (e) { if (e) {
this._getBillNoInfo(e) this._getBillNoInfo(e)
@@ -157,8 +177,8 @@
this.index = '' this.index = ''
}, },
toSearch () { toSearch () {
if (this.code && this.currentData) { if (this.code) {
this.show = true this._getBillNoInfo(this.code)
} else { } else {
uni.showToast({ uni.showToast({
title: '请扫码', title: '请扫码',
@@ -173,16 +193,28 @@
this.dataList = [...res] this.dataList = [...res]
this.pkId = '' this.pkId = ''
this.pkObj = {} this.pkObj = {}
this.currentData = {}
this.index = ''
this.val1 = null
this.val2 = null
this.show = true this.show = true
} }
} catch (e) {} } catch (e) {}
}, },
toCheck (e) { toCheck (e) {
this.pkId = this.pkId === e.material_code ? '' : e.material_code this.pkId = this.pkId === e.material_code ? '' : e.material_code
this.currentData = this.pkId === e.material_code ? e : {} this.pkObj = this.pkId === e.material_code ? e : {}
}, },
confirmModal () { confirmModal () {
if (!this.pkId) {
uni.showToast({
title: '请选择一行',
icon: 'none'
})
return
}
this.show = false this.show = false
this.currentData = this.pkObj
this.code = this.currentData.code this.code = this.currentData.code
this.val1 = this.currentData.qty this.val1 = this.currentData.qty
this.val2 = this.currentData.vehicle_code this.val2 = this.currentData.vehicle_code
@@ -231,16 +263,17 @@
this.index = '' this.index = ''
this.val1 = null this.val1 = null
this.val2 = null this.val2 = null
this.index1 = ''
this.disabled = false this.disabled = false
}, },
async _inStorageConfirm () { async _inStorageConfirm () {
this.disabled = true this.disabled = true
if (!this.val1 || !this.val2 || !this.index) { if (!this.val1 || !this.val2 || !this.index || !this.index1) {
this.disabled = false this.disabled = false
return return
} }
try { try {
let obj = Object.assign(this.currentData, {qty: this.val1, vehicle_code: this.val2, stor_code: this.index}) let obj = Object.assign(this.currentData, {qty: this.val1, vehicle_code: this.val2, stor_code: this.index, form_type: this.index1})
let res = await inStorageConfirm(obj) let res = await inStorageConfirm(obj)
if (res.code === '200') { if (res.code === '200') {
this.toEmpty() this.toEmpty()