From ac4341ea6b66ae02427d39d35f41d42d78b2eb2e Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期五, 14 二月 2025 10:08:32 +0800
Subject: [PATCH] #
---
zy-asrs-admin/src/components/orderOut/orderOutMergePreview/stockOut.vue | 75 ++++++++++++++++++++++++++++---------
1 files changed, 56 insertions(+), 19 deletions(-)
diff --git a/zy-asrs-admin/src/components/orderOut/orderOutMergePreview/stockOut.vue b/zy-asrs-admin/src/components/orderOut/orderOutMergePreview/stockOut.vue
index 0117588..480d07f 100644
--- a/zy-asrs-admin/src/components/orderOut/orderOutMergePreview/stockOut.vue
+++ b/zy-asrs-admin/src/components/orderOut/orderOutMergePreview/stockOut.vue
@@ -11,7 +11,7 @@
const TABLE_KEY = 'table-order-out-preview';
-const emit = defineEmits(['closeParent'])
+const emit = defineEmits(['closeParent', 'reload'])
const {
getColumnSearchProps,
@@ -25,6 +25,7 @@
const open = ref(false);
const showWidth = ref("60%")
const records = ref([])
+const waveId = ref(null)
const loading = ref(false)
let tableDataValue = []
let tableDataColSpan = []
@@ -159,12 +160,18 @@
})
const handleOk = () => {
- post('/api/out/orderOut/merge', tableData.value).then((resp) => {
+ let requestParam = {
+ waveId: waveId.value,
+ list: tableData.value
+ };
+
+ post('/api/out/orderOut/merge/wave', requestParam).then((resp) => {
let result = resp.data;
if (result.code == 200) {
message.success(formatMessage('page.add.success', '鍑哄簱鎴愬姛'));
open.value = false;
emit('closeParent', true)
+ emit('reload', true)
} else {
message.error(result.msg);
}
@@ -200,21 +207,11 @@
let idx = 0;
let colSpan = []
tmp.forEach((item) => {
- item.locs.forEach((val) => {
- let dataTmp = JSON.parse(JSON.stringify(item));
- dataTmp.locId = val.locId;
- dataTmp.locNo = val.locNo;
- dataTmp.locDetlId = val.locDetlId;
- dataTmp.anfme = val.anfme;
- dataTmp.key = idx;
- dataTmp.operationPort = defaultOperationPort;
-
- tableDataTmp.push(dataTmp);
- })
-
let count = item.locs.length;
- if (item.anfme > 0) {
+
+ if (item.locs.length == 0) {
let dataTmp = JSON.parse(JSON.stringify(item));
+
dataTmp.locId = null;
dataTmp.locNo = null;
dataTmp.locDetlId = null;
@@ -224,9 +221,47 @@
tableDataTmp.push(dataTmp);
count++;
+ } else {
+ let isused = item.anfme;
+ console.log(isused);
+
+ for (let i = 0; i < item.locs.length; i++) {
+ if (isused == 0) {
+ break;
+ }
+ const val = item.locs[i];
+ let dataTmp = JSON.parse(JSON.stringify(item));
+ let anfme = isused - val.anfme > 0 ? val.anfme : isused;
+ isused -= anfme;
+
+ dataTmp.locId = val.locId;
+ dataTmp.locNo = val.locNo;
+ dataTmp.locDetlId = val.locDetlId;
+ dataTmp.anfme = anfme;
+ dataTmp.key = idx;
+ dataTmp.operationPort = defaultOperationPort;
+
+ tableDataTmp.push(dataTmp);
+ }
+
+ console.log(tableDataTmp);
+
+
+ if (isused > 0) {
+ let dataTmp = JSON.parse(JSON.stringify(item));
+ dataTmp.locId = null;
+ dataTmp.locNo = null;
+ dataTmp.locDetlId = null;
+ dataTmp.anfme = isused;
+ dataTmp.key = idx;
+ dataTmp.operationPort = defaultOperationPort;
+
+ tableDataTmp.push(dataTmp);
+ count++;
+ }
}
- colSpan[idx] = count
+ colSpan[idx] = count;
idx += count;
})
@@ -241,7 +276,7 @@
}
const handleGlobalOperationPortChange = () => {
- if(tableData.value.length > 0) {
+ if (tableData.value.length > 0) {
tableData.value.forEach((item) => {
item.operationPort = globalOperationPort.value;
})
@@ -252,6 +287,7 @@
open,
showWidth,
records,
+ waveId,
})
</script>
@@ -267,13 +303,14 @@
:title="formatMessage('page.orderOutPreview.preview', '棰勮鍚堝苟璁㈠崟鍑哄簱')" @ok="handleOk">
<div>
<span>浣滀笟鍙o細</span>
- <a-select v-model:value="globalOperationPort" :options="operationPortList" @change="handleGlobalOperationPortChange"></a-select>
+ <a-select v-model:value="globalOperationPort" :options="operationPortList"
+ @change="handleGlobalOperationPortChange"></a-select>
</div>
<a-table :data-source="tableData" :loading="loading" :defaultExpandAllRows="false" :key="TABLE_KEY"
rowKey="index" :scroll="{ y: 768, scrollToFirstRowOnChange: true }" :columns="columns">
<template #bodyCell="{ column, text, record, index }">
<template v-if="column.dataIndex === 'locNo'">
- <div v-if="record.locId != null">
+ <div v-if="record.locId != null && record.anfme > 0">
<a-tag color="green">{{ record.locNo }}</a-tag>
</div>
<div v-else>
--
Gitblit v1.9.1