组盘新

This commit is contained in:
2025-08-06 15:03:47 +08:00
parent f11679a5a0
commit 1e06bc56b7
2 changed files with 66 additions and 65 deletions

View File

@@ -4,6 +4,14 @@
<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-17">
<search-box v-model="val1"/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">载具编码</span>
@@ -17,62 +25,36 @@
<span class="filter_label">物料信息</span>
</view>
<view class="zd-col-17">
<input type="text" class="filter_input" v-model="currentData.material_name" @tap="toJump">
<input type="text" class="filter_input" v-model="wlxxtext" @tap="toJump">
</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">物料数量</span>
</view>
<view class="zd-col-17">
<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-17">
<input type="text" class="filter_input" v-model="val3">
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">源单编码</span>
</view>
<view class="zd-col-17">
<search-box v-model="val1"/>
</view>
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
<th>物料名称</th>
<th>物料编码</th>
<th>数量</th>
<th>批次号</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i">
<td>{{e.material_name}}</td>
<td>{{e.material_code}}</td>
<td>{{e.qty}}</td>
<td>{{e.pcsn}}</td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-6 button-default" @tap="toEmpty">清空</button>
<button class="zd-col-16 button-primary" :class="{'button-info': JSON.stringify(currentData) === '{}'}" :disabled="disabled" @tap="_groupPlate">组盘确认</button>
<button class="zd-col-16 button-primary" :class="{'button-info': !this.val2 || !this.dataList.length}" :disabled="disabled" @tap="_groupPlate">组盘确认</button>
</view>
</view>
</template>
@@ -94,7 +76,8 @@
val1: '',
val2: '',
val3: '',
currentData: {},
wlxxtext: '',
dataList: [],
options: [],
index: '',
disabled: false
@@ -104,8 +87,8 @@
this.title = options.title
},
onShow() {
if (this.$store.getters.publicObj !== '') {
this.currentData = this.$store.getters.publicObj
if (this.$store.getters.publicArr.length) {
this.dataList = this.$store.getters.publicArr
}
},
methods: {
@@ -115,19 +98,18 @@
})
},
toEmpty () {
this.currentData = {}
this.dataList = []
this.index = ''
this.disabled = false
},
async _groupPlate () {
this.disabled = true
if (JSON.stringify(this.currentData) === '{}') {
if (!this.val2 || !this.dataList.length) {
this.disabled = false
return
}
try {
this.currentData.stor_code = this.index
let res = await groupPlate(this.currentData.material_id, this.val3, this.currentData.qty, this.val2, this.val1)
let res = await groupPlate(this.dataList, this.val2, this.val1)
uni.showToast({
title: res.message,
icon: 'none'