Merge remote-tracking branch 'origin/master'

master
夜笙歌 1 week ago
commit e673690245

File diff suppressed because it is too large Load Diff

@ -535,11 +535,11 @@
<el-form-item label="已包数量" prop="printedNum">
<el-input v-model="childrenTableInfoForm.printedNum" placeholder="" :disabled="true"/>
</el-form-item>
<el-form-item label="分包数量" prop="printNum">
<el-input v-model="childrenTableInfoForm.printNum" placeholder="请输入分包数量" />
<el-form-item label="分包数量" prop="splitPackageCount">
<el-input-number v-model="childrenTableInfoForm.splitPackageCount" :min="1" :max="remainingQty" placeholder="请输入分包数量" />
</el-form-item>
<el-form-item label="打印数量" prop="barcodeNum">
<el-input v-model="childrenTableInfoForm.barcodeNum" placeholder="请输入打印条码数量" />
<el-form-item label="打印数量" prop="printCopies" v-if="childrenTableInfoForm.splitPackageCount === 1 || !childrenTableInfoForm.splitPackageCount">
<el-input-number v-model="childrenTableInfoForm.printCopies" :min="1" :max="20" placeholder="请输入打印条码数量" />
</el-form-item>
</el-form>
<template #footer>
@ -572,7 +572,7 @@
<script setup name="Linkage" lang="ts">
import { listInstockOrder, getInstockOrder, delInstockOrder, addInstockOrder, updateInstockOrder, approveInstockOrder } from '@/api/wms/instockOrder';
import type { InstockOrderForm } from '@/api/wms/instockOrder/types';
import {onMounted, reactive, watch} from 'vue'
import {onMounted, reactive, watch, computed} from 'vue'
import {ElMessage, ElMessageBox} from 'element-plus'
import {getBaseWarehouseList} from "@/api/wms/baseWarehouse";
import {UserVO} from "@/api/system/user/types";
@ -667,9 +667,36 @@ listUser().then(e => {
})
/** 提交按钮 */
const submitForm = async() => {
await updateInstockDetail(childrenTableInfoForm.value);
getChildrenTable({instockId: partntTableSelectCell.value.instockId});
childrenTableInfoVisible.value = false;
if (!childrenTableInfoForm.value.instockQty || !childrenTableInfoForm.value.printedNum) {
ElMessage.error('物料数据未加载完成,请重试')
return
}
const split = Number(childrenTableInfoForm.value.splitPackageCount) || 1
const copies = Number(childrenTableInfoForm.value.printCopies) || 1
const remaining = remainingQty.value
if (split > remaining) {
ElMessage.error('分包数量不能超过剩余物料量')
return
}
if (split > 1) {
if (remaining % split !== 0) {
ElMessage.error('剩余物料量无法平均分包,请调整分包数量')
return
}
// >1barcodeNum=11
childrenTableInfoForm.value.printCopies = 1
} else {
if (copies < 1) {
ElMessage.error('重复打印数量至少为1')
return
}
}
await updateInstockDetail(childrenTableInfoForm.value)
getChildrenTable({instockId: partntTableSelectCell.value.instockId})
childrenTableInfoVisible.value = false
}
let mategoryOptions = ref([]);
@ -893,6 +920,8 @@ const parentTableInfoSubmit = () =>{
//
const childrenTableUpdate = async (e) => {
childrenTableInfoForm.value = (await getInstockDetail(e.instockDetailId)).data
childrenTableInfoForm.value.splitPackageCount = 1
childrenTableInfoForm.value.printCopies = 1
childrenTableInfoVisible.value = true
}
//
@ -1072,6 +1101,12 @@ const validateQty = (row, val) => {
}
};
// computed
const remainingQty = computed(() => {
const instock = Number(childrenTableInfoForm.value.instockQty) || 0
const printed = Number(childrenTableInfoForm.value.printedNum) || 0
return Math.max(0, instock - printed) // Math.max
})
</script>
<style>

Loading…
Cancel
Save