This commit is contained in:
2025-08-21 14:39:09 +08:00
parent 26ed7822b2
commit 3a43e50e15
9 changed files with 341 additions and 66 deletions

View File

@@ -1,6 +1,6 @@
<template>
<view class="zd_container">
<!-- 空托盘入库 -->
<!-- 物料组盘 -->
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
@@ -62,11 +62,19 @@
<NumberInput v-model="currentData.qty" />
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">供应商</span>
</view>
<view class="zd-col-24 filter_select">
<uni-data-select v-model="index2" :localdata="options2" @change="selectChange2"></uni-data-select>
</view>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-6 button-default" @tap="clearUp">清空</button>
<button class="zd-col-16 button-primary" :class="{'button-info': JSON.stringify(currentData) === '{}' || !val1 || !index}" :disabled="disabled" @tap="_zwgroupPlate">组盘确认</button>
<button class="zd-col-16 button-primary" :class="{'button-info': JSON.stringify(currentData) === '{}' || !val1 || !index || !index2}" :disabled="disabled" @tap="_zwgroupPlate">组盘确认</button>
</view>
</view>
</template>
@@ -75,7 +83,7 @@
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import NumberInput from '@/components/NumberInput.vue'
import {getFormDataList, getFormMaterial, zwgroupPlate} from '@/utils/getData4.js'
import {getFormDataList, getFormMaterial, supplierdroplist, zwgroupPlate} from '@/utils/getData4.js'
export default {
components: {
NavBar,
@@ -89,6 +97,8 @@
currentData: {},
options: [],
index: '',
options2: [],
index2: '',
disabled: false
};
},
@@ -97,6 +107,7 @@
},
created () {
this._getFormDataList()
this._supplierdroplist()
},
methods: {
toJump () {
@@ -114,6 +125,18 @@
this.options = []
}
},
async _supplierdroplist () {
try {
let res = await supplierdroplist()
if (res) {
this.options2 = res.data
} else {
this.options2 = []
}
} catch (e) {
this.options2 = []
}
},
async _getFormMaterial () {
try {
let res = await getFormMaterial(this.index)
@@ -132,21 +155,26 @@
this._getFormMaterial()
}
},
selectChange2 (e) {
this.index2 = e
},
clearUp () {
this.val1 = ''
this.index = ''
this.index2 = ''
this.currentData = {}
this.disabled = false
},
async _zwgroupPlate () {
this.disabled = true
if (JSON.stringify(this.currentData) === '{}' || !this.val1 || !this.index) {
if (JSON.stringify(this.currentData) === '{}' || !this.val1 || !this.index || !this.index2) {
this.disabled = false
return
}
try {
this.currentData.stor_code = this.index
let res = await zwgroupPlate(this.val1, this.currentData.material_id, this.currentData.qty, this.index)
let selobj = this.options2.find(item => item.value === this.index2)
let res = await zwgroupPlate(this.val1, this.currentData.material_id, this.currentData.qty, this.index, this.index2, selobj.text)
uni.showToast({
title: res.message,
icon: 'none'