From e31ca4e3e1774b7ddb832e8ec498b5ada24b2608 Mon Sep 17 00:00:00 2001
From: pan <antony1029@163.com>
Date: 星期日, 16 十一月 2025 19:13:58 +0800
Subject: [PATCH] 提交
---
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfoDetail.cs | 6
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService.cs | 14
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs | 7
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundPickingController.cs | 72 +
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs | 4
项目代码/WIDESEA_WMSClient/src/views/outbound/PickingConfirm.vue | 1458 +++++++++++++++++++++++++++++++++-------
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundPickingService.cs | 201 +++-
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs | 3
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_DTO/Outbound/OutboundOrderGetDTO.cs | 14
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutboundPickingService.cs | 4
项目代码/WMS无仓储版/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/CodeChunks.db-shm | 0
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs | 1
项目代码/WMS无仓储版/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/SemanticSymbols.db-shm | 0
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/RepositoryBase.cs | 3
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundLockInfo.cs | 7
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderDetailService.cs | 125 ---
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/SplitPackageService.cs | 98 +-
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs | 2
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs | 5
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_PickingRecord.cs | 9
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/OrderCreateTypeEnum.cs | 15
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs | 1
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs | 1
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_BasicService/InvokeMESService.cs | 6
24 files changed, 1,499 insertions(+), 557 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/PickingConfirm.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/PickingConfirm.vue"
index d9f3d25..a1be799 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/PickingConfirm.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/PickingConfirm.vue"
@@ -1,5 +1,5 @@
<template>
- <div class="picking-confirm">
+ <div class="OutboundPicking-container">
<div class="page-header">
<el-page-header @back="goBack">
<template #content>
@@ -7,90 +7,288 @@
</template>
</el-page-header>
</div>
+ <!-- 鎵爜鍖哄煙 -->
+ <div class="scanner-area">
+ <el-card>
+ <div class="scanner-form">
+ <el-input
+ ref="palletInput"
+ v-model="scanData.palletCode"
+ placeholder="鎵弿鎵樼洏鐮�"
+ @change="onPalletScan"
+ @keyup.enter.native="onPalletScan">
+ </el-input>
+ <el-input
+ ref="barcodeInput"
+ v-model="scanData.barcode"
+ placeholder="鎵弿鐗╂枡鏉$爜"
+ @change="onBarcodeScan"
+ @keyup.enter.native="onBarcodeScan">
+ </el-input>
+ <el-button type="success" @click="confirmPicking">纭鎷i��</el-button>
+ <el-button type="warning" @click="openSplitDialog">鎷嗗寘</el-button>
+ <el-button type="info" @click="openRevertSplitDialog">鎾ら攢鎷嗗寘</el-button>
+
+ <el-button type="primary" @click="openBatchReturnDialog">鍥炲簱</el-button>
+ <el-button type="danger" @click="handleDirectOutbound">鐩存帴鍑哄簱</el-button>
+
+ </div>
+ </el-card>
+ </div>
+
+ <!-- 姹囨�讳俊鎭� -->
+ <div class="summary-area">
+ <el-card>
+ <div class="summary-info">
+ <el-tag type="warning">鏈嫞閫夋潯鏁�: {{summary.unpickedCount}}</el-tag>
+ <el-tag type="danger">鏈嫞閫夋暟閲�: {{summary.unpickedQuantity}}</el-tag>
+ <el-tag type="success">宸叉嫞閫夋潯鏁�: {{summary.pickedCount}}</el-tag>
+ <el-tag type="info">鎵樼洏鐘舵��: {{palletStatus}}</el-tag>
+ </div>
+ </el-card>
+ </div>
+
+ <!-- 鏁版嵁鍒楄〃 -->
+ <div class="content-area">
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-card header="鏈嫞閫夊垪琛�">
+ <el-table :data="unpickedList" border height="440">
+ <el-table-column prop="materielCode" label="鐗╂枡缂栫爜" width="120"></el-table-column>
- <div class="content-layout">
- <!-- 宸︿晶锛氭壂鐮佸尯鍩� -->
- <div class="left-section">
- <div class="scan-section">
- <el-alert
- title="璇蜂娇鐢ㄦ壂鐮佹灙鎵弿鎵樼洏鐮佸拰鐗╂枡鏉$爜锛屾壂鐮佹灙甯﹀洖杞﹀姛鑳斤紝鎵畬鐗╂枡鏉$爜鑷姩纭"
- type="info"
- :closable="false"
- class="scan-alert"
- />
+ <el-table-column prop="assignQuantity" label="鍒嗛厤鏁伴噺" width="100"></el-table-column>
+ <el-table-column prop="remainQuantity" label="鍓╀綑鏁伴噺" width="100"></el-table-column>
+ <el-table-column prop="locationCode" label="璐т綅" width="100"></el-table-column>
+ <el-table-column prop="currentBarcode" label="鏉$爜"></el-table-column>
+ <!-- <el-table-column label="鎿嶄綔" width="100">
+ <template slot-scope="scope">
+ <el-button
+ size="mini"
+ type="primary"
+ @click="handleSingleReturn(scope.row)">
+ 鍥炲簱
+ </el-button>
+ </template>
+ </el-table-column> -->
+ </el-table>
+ </el-card>
+ </el-col>
+
+ <el-col :span="12">
+ <el-card header="宸叉嫞閫夊垪琛�">
+ <div class="table-actions">
+ <el-button
+ size="mini"
+ type="danger"
+ :disabled="selectedPickedRows.length === 0"
+ @click="batchCancelSelected">
+ 鍙栨秷鎷i��
+ </el-button>
+ <span class="selection-count">宸查�夋嫨 {{selectedPickedRows.length}} 椤�</span>
+ </div>
+ <el-table :data="pickedList" border height="400" style="width: 100%" @selection-change="handlePickedSelectionChange">
+ <el-table-column type="selection" width="55"></el-table-column>
+ <el-table-column prop="materielCode" label="鐗╂枡缂栫爜" width="120"></el-table-column>
+
+ <el-table-column prop="pickedQty" label="宸叉嫞鏁伴噺" width="100"></el-table-column>
+ <el-table-column prop="locationCode" label="璐т綅" width="100"></el-table-column>
+ <el-table-column prop="currentBarcode" label="鏉$爜"></el-table-column>
+
- <el-form :model="scanForm" label-width="100px" class="scan-form">
- <el-form-item label="鎵樼洏鐮�" required>
- <el-input
- ref="palletInput"
- v-model="scanForm.palletCode"
- placeholder="璇锋壂鎻忔墭鐩樼爜"
- @keyup.enter="handlePalletScan"
- @blur="loadPalletSummary"
- clearable
- />
- </el-form-item>
+ </el-table>
+ </el-card>
+ </el-col>
+ </el-row>
+ </div>
- <el-form-item label="鐗╂枡鏉$爜" required>
- <el-input
- ref="materialInput"
- v-model="scanForm.materialBarcode"
- placeholder="璇锋壂鎻忕墿鏂欐潯鐮�"
- :disabled="!scanForm.palletCode"
- @keyup.enter="handleMaterialScan"
- clearable
- />
- </el-form-item>
- </el-form>
+ <!-- 鎷嗗寘寮圭獥 -->
+<!-- 鎷嗗寘寮圭獥 -->
+ <div v-if="showCustomSplitDialog" class="custom-dialog-overlay">
+ <div class="custom-dialog-wrapper">
+ <div class="custom-dialog">
+ <div class="custom-dialog-header">
+ <h3>鎷嗗寘鎿嶄綔</h3>
+ <!-- <el-button
+ type="text"
+ icon="el-icon-close"
+ @click="closeCustomSplitDialog"
+ class="close-button">
+ </el-button> -->
+ <el-button
+ type="text"
+ @click="closeCustomSplitDialog"
+ class="close-button">
+ X
+ </el-button>
- <!-- 鎵樼洏鎷h揣缁熻 -->
- <div v-if="palletSummary" class="pallet-summary">
- <el-card header="鎵樼洏鎷h揣缁熻">
- <el-descriptions :column="3" border>
- <el-descriptions-item label="鎵樼洏鍙�">
- {{ scanForm.palletCode }}
- </el-descriptions-item>
- <el-descriptions-item label="鏈嫞璐ф潯鏁�">
- <el-text type="warning">{{ palletSummary.unpickedCount }}</el-text>
- </el-descriptions-item>
- <el-descriptions-item label="鏈嫞璐ф�绘暟">
- <el-text type="danger">{{ palletSummary.unpickedTotal }}</el-text>
- </el-descriptions-item>
- </el-descriptions>
- </el-card>
</div>
-
- <div class="action-buttons">
- <el-button type="primary" @click="handleConfirm" :loading="confirmLoading">
- 鎵嬪姩纭
- </el-button>
- <el-button @click="handleReset">閲嶇疆</el-button>
- <el-button @click="$emit('close')">鍙栨秷</el-button>
+ <div class="custom-dialog-body">
+ <el-form :model="splitForm" :rules="splitFormRules" ref="splitFormRef" label-width="100px">
+ <el-form-item label="璁㈠崟缂栧彿">
+ <el-input v-model="splitForm.orderNo" disabled></el-input>
+ </el-form-item>
+ <el-form-item label="鎵樼洏缂栧彿">
+ <el-input v-model="splitForm.palletCode" disabled></el-input>
+ </el-form-item>
+ <el-form-item label="鍘熸潯鐮�" prop="originalBarcode">
+ <el-input
+ v-model="splitForm.originalBarcode"
+ placeholder="鎵弿鍘熸潯鐮�"
+ @keyup.enter.native="onSplitBarcodeScan"
+ @change="onSplitBarcodeScan"
+ clearable>
+ </el-input>
+ </el-form-item>
+ <el-form-item label="鐗╂枡缂栫爜">
+ <el-input v-model="splitForm.materielCode" disabled></el-input>
+ </el-form-item>
+ <el-form-item label="鍓╀綑鏁伴噺">
+ <el-input v-model="splitForm.maxQuantity" disabled></el-input>
+ </el-form-item>
+ <el-form-item label="鎷嗗寘鏁伴噺" prop="splitQuantity">
+ <el-input-number
+ v-model="splitForm.splitQuantity"
+ :min="1"
+ :max="splitForm.maxQuantity"
+ :precision="2"
+ :step="1"
+ style="width: 100%">
+ </el-input-number>
+ </el-form-item>
+ </el-form>
+ </div>
+ <div class="custom-dialog-footer">
+ <el-button @click="closeCustomSplitDialog">鍙栨秷</el-button>
+ <el-button type="primary" @click="handleSplitPackage" :loading="splitLoading">纭鎷嗗寘</el-button>
</div>
</div>
</div>
+ </div>
+
- <!-- 鍙充晶锛氬嚭搴撹鎯呭垪琛� -->
- <div class="right-section">
- <el-card class="outbound-details-card" header="鍑哄簱璇︽儏">
- <vol-table
- ref="outboundTable"
- :table-config="outboundTableConfig"
- :height="300"
- />
- </el-card>
+ <!-- 鎾ら攢鎷嗗寘寮圭獥 -->
+ <div v-if="showRevertSplitDialog" class="custom-dialog-overlay">
+ <div class="custom-dialog-wrapper">
+ <div class="custom-dialog">
+ <div class="custom-dialog-header">
+ <h3>鎾ら攢鎷嗗寘</h3>
+ <el-button
+ type="text"
+ @click="closeRevertSplitDialog"
+ class="close-button">
+ 脳
+ </el-button>
+ </div>
+ <div class="custom-dialog-body">
+ <el-form
+ :model="revertSplitForm"
+ :rules="revertSplitFormRules"
+ ref="revertSplitFormRef"
+ label-width="100px">
+ <el-form-item label="鍘熸潯鐮�" prop="originalBarcode">
+ <el-input
+ v-model="revertSplitForm.originalBarcode"
+ placeholder="鎵弿鍘熸潯鐮�"
+ @keyup.enter.native="onRevertSplitBarcodeScan"
+ @change="onRevertSplitBarcodeScan"
+ clearable>
+ </el-input>
+ </el-form-item>
+ </el-form>
+ </div>
+ <div class="custom-dialog-footer">
+ <el-button @click="closeRevertSplitDialog">鍙栨秷</el-button>
+ <el-button type="primary" @click="handleRevertSplit" :loading="revertSplitLoading">纭鎾ら攢</el-button>
+ </div>
+ </div>
</div>
</div>
-
- <!-- 宸插垎鎷h褰曞垪琛� -->
- <div class="picked-records">
- <el-card header="宸插垎鎷h褰�">
- <vol-table
- ref="pickedTable"
- :table-config="pickedTableConfig"
- :height="300"
- />
- </el-card>
+
+ <!-- 鎵归噺鍥炲簱寮圭獥 -->
+ <div v-if="showBatchReturnDialog" class="custom-dialog-overlay">
+ <div class="custom-dialog-wrapper">
+ <div class="custom-dialog">
+ <div class="custom-dialog-header">
+ <h3>鍥炲簱</h3>
+ <el-button
+ type="text"
+ @click="closeBatchReturnDialog"
+ class="close-button">
+ 脳
+ </el-button>
+ </div>
+ <div class="custom-dialog-body">
+ <el-form
+ :model="batchReturnForm"
+ :rules="batchReturnFormRules"
+ ref="batchReturnFormRef"
+ label-width="100px">
+ <el-form-item label="璁㈠崟缂栧彿">
+ <el-input v-model="batchReturnForm.orderNo" disabled></el-input>
+ </el-form-item>
+ <el-form-item label="鎵樼洏缂栧彿" prop="palletCode">
+ <el-input
+ v-model="batchReturnForm.palletCode"
+ placeholder="鎵弿鎵樼洏鐮�"
+ @keyup.enter.native="onBatchReturnPalletScan"
+ @change="onBatchReturnPalletScan"
+ clearable>
+ </el-input>
+ </el-form-item>
+ <el-form-item label="鏈嫞閫夋暟閲�">
+ <el-input v-model="batchReturnForm.unpickedCount" disabled></el-input>
+ </el-form-item>
+ <el-form-item label="鏈嫞閫夋潯鏁�">
+ <el-input v-model="batchReturnForm.unpickedQuantity" disabled></el-input>
+ </el-form-item>
+ </el-form>
+ </div>
+ <div class="custom-dialog-footer">
+ <el-button @click="closeBatchReturnDialog">鍙栨秷</el-button>
+ <el-button type="primary" @click="handleBatchReturnConfirm" :loading="batchReturnLoading">纭鍥炲簱</el-button>
+ </div>
+ </div>
+ </div>
+ </div>
+ <!-- 鐩存帴鍑哄簱寮圭獥 -->
+ <div v-if="showDirectOutDialog" class="custom-dialog-overlay">
+ <div class="custom-dialog-wrapper">
+ <div class="custom-dialog">
+ <div class="custom-dialog-header">
+ <h3>鐩存帴鍑哄簱</h3>
+ <el-button
+ type="text"
+ @click="closeDirectOutDialog"
+ class="close-button">
+ 脳
+ </el-button>
+ </div>
+ <div class="custom-dialog-body">
+ <el-form
+ :model="directOutForm"
+ :rules="directOutFormRules"
+ ref="directOutFormRef"
+ label-width="100px">
+ <el-form-item label="璁㈠崟缂栧彿">
+ <el-input v-model="directOutForm.orderNo" disabled></el-input>
+ </el-form-item>
+ <el-form-item label="鎵樼洏缂栧彿" prop="palletCode">
+ <el-input
+ v-model="directOutForm.palletCode"
+ placeholder="鎵弿鎵樼洏鐮�"
+ @keyup.enter.native="onDirectOutPalletScan"
+ @change="onDirectOutPalletScan"
+ clearable>
+ </el-input>
+ </el-form-item>
+ </el-form>
+ </div>
+ <div class="custom-dialog-footer">
+ <el-button @click="closeDirectOutDialog">鍙栨秷</el-button>
+ <el-button type="primary" @click="handleDirectOutConfirm" :loading="directOutLoading">纭鍑哄簱</el-button>
+ </div>
+ </div>
+ </div>
</div>
</div>
</template>
@@ -98,8 +296,8 @@
<script>
import http from '@/api/http.js'
import { ref, defineComponent } from "vue";
-import { ElMessage } from "element-plus";
-import { useRoute } from 'vue-router'
+import { ElMessage } from 'element-plus'
+import { useRoute } from 'vue-router'
export default defineComponent({
name: 'PickingConfirm',
@@ -114,264 +312,968 @@
},
emits: ['confirm', 'close'],
data() {
+ // 瀹氫箟鎷嗗寘琛ㄥ崟楠岃瘉瑙勫垯
+ const validateOriginalBarcode = (rule, value, callback) => {
+ if (!value || value.trim() === '') {
+ callback(new Error('璇疯緭鍏ュ師鏉$爜'));
+ } else {
+ callback();
+ }
+ };
+
+ const validateSplitQuantity = (rule, value, callback) => {
+ if (value === null || value === undefined || value === '') {
+ callback(new Error('璇疯緭鍏ユ媶鍖呮暟閲�'));
+ } else if (value <= 0) {
+ callback(new Error('鎷嗗寘鏁伴噺蹇呴』澶т簬0'));
+ } else if (this.splitForm.maxQuantity && value > this.splitForm.maxQuantity) {
+ callback(new Error('鎷嗗寘鏁伴噺涓嶈兘澶т簬鍓╀綑鏁伴噺'));
+ } else {
+ callback();
+ }
+ };
+
+ // 瀹氫箟鎾ら攢鎷嗗寘琛ㄥ崟楠岃瘉瑙勫垯
+ const validateRevertOriginalBarcode = (rule, value, callback) => {
+ if (!value || value.trim() === '') {
+ callback(new Error('璇疯緭鍏ュ師鏉$爜'));
+ } else {
+ callback();
+ }
+ };
+ // 瀹氫箟鎵归噺鍥炲簱琛ㄥ崟楠岃瘉瑙勫垯
+ const validateBatchReturnPalletCode = (rule, value, callback) => {
+ if (!value || value.trim() === '') {
+ callback(new Error('璇疯緭鍏ユ墭鐩樼爜'));
+ } else {
+ callback();
+ }
+ };
+ // 瀹氫箟鐩存帴鍑哄簱琛ㄥ崟楠岃瘉瑙勫垯
+ const validateDirectOutPalletCode = (rule, value, callback) => {
+ if (!value || value.trim() === '') {
+ callback(new Error('璇疯緭鍏ユ墭鐩樼爜'));
+ } else {
+ callback();
+ }
+ };
return {
- scanForm: {
+ scanData: {
+ orderNo: '',
palletCode: '',
- materialBarcode: ''
+ barcode: ''
},
- palletSummary: null,
- confirmLoading: false,
- pickedTableConfig: {
- url: '/api/outbound/getPickingRecords',
- query: { orderNo: this.orderNo },
- columns: [
- { prop: 'TaskNo', label: '浠诲姟鍙�', width: 150 },
- { prop: 'Barcode', label: '鐗╂枡鏉$爜', width: 150 },
- { prop: 'MaterielName', label: '鐗╂枡鍚嶇О', width: 150 },
- { prop: 'PickQuantity', label: '鎷h揣鏁伴噺', width: 100 },
- { prop: 'LocationCode', label: '璐т綅', width: 120 },
- { prop: 'CreateTime', label: '鎷h揣鏃堕棿', width: 180 }
+ unpickedList: [],
+ pickedList: [],
+ selectedUnpickedRows: [], // 鏈嫞閫夊垪琛ㄩ�変腑鐨勮
+ selectedPickedRows: [], // 宸叉嫞閫夊垪琛ㄩ�変腑鐨勮
+ summary: {
+ unpickedCount: 0,
+ unpickedQuantity: 0,
+ pickedCount: 0
+ },
+ palletStatus: '鏈煡',
+ showSplitDialog: false,
+ showRevertSplitDialog: false,
+ showCustomSplitDialog: false, // 鑷畾涔夋媶鍖呭脊绐楁樉绀虹姸鎬�
+ showBatchReturnDialog: false, // 鎵归噺鍥炲簱寮圭獥鏄剧ず鐘舵��
+ showReturnDialog: false,
+ splitLoading: false,
+ revertSplitLoading: false,
+ batchReturnLoading: false, // 鎵归噺鍥炲簱鍔犺浇鐘舵��
+ splitForm: {
+ orderNo: '',
+ palletCode: '',
+ originalBarcode: '',
+ materielCode: '',
+ splitQuantity: 0,
+ maxQuantity: 0
+ },
+ // 鎷嗗寘琛ㄥ崟楠岃瘉瑙勫垯
+ splitFormRules: {
+ originalBarcode: [
+ { required: true, validator: validateOriginalBarcode, trigger: 'blur' }
+ ],
+ splitQuantity: [
+ { required: true, validator: validateSplitQuantity, trigger: 'blur' }
]
},
- // 鍑哄簱璇︽儏琛ㄦ牸閰嶇疆
- outboundTableConfig: {
- url: '/api/outbound/getOutboundDetails',
- query: { orderNo: this.orderNo },
- columns: [
- { prop: 'OrderNo', label: '鍑哄簱鍗曞彿', width: 150 },
- { prop: 'MaterialCode', label: '鐗╂枡缂栧彿', width: 120 },
- { prop: 'MaterialBarcode', label: '鐗╂枡鏉$爜', width: 150 },
- { prop: 'BatchNo', label: '鎵规鍙�', width: 120 },
- { prop: 'AssignQuantity', label: '鍒嗛厤鍑哄簱閲�', width: 100 },
- { prop: 'PalletCode', label: '鎵樼洏缂栧彿', width: 120 },
- { prop: 'Unit', label: '鍗曚綅', width: 80 }
+ revertSplitForm: {
+ originalBarcode: ''
+ },
+ // 鎾ら攢鎷嗗寘琛ㄥ崟楠岃瘉瑙勫垯
+ revertSplitFormRules: {
+ originalBarcode: [
+ { required: true, validator: validateRevertOriginalBarcode, trigger: 'blur' }
]
},
- orderInfo: {orderNo:''}
+ // 鎵归噺鍥炲簱琛ㄥ崟
+ batchReturnForm: {
+ orderNo: '',
+ palletCode: '',
+ unpickedCount: 0,
+ unpickedQuantity: 0
+ },
+ // 鎵归噺鍥炲簱琛ㄥ崟楠岃瘉瑙勫垯
+ batchReturnFormRules: {
+ palletCode: [
+ { required: true, validator: validateBatchReturnPalletCode, trigger: 'blur' }
+ ]
+ },
+ showDirectOutDialog: false, // 鐩存帴鍑哄簱寮圭獥鏄剧ず鐘舵��
+ directOutLoading: false, // 鐩存帴鍑哄簱鍔犺浇鐘舵��
+ directOutForm: {
+ orderNo: '',
+ palletCode: ''
+ },
+ directOutFormRules: {
+ palletCode: [
+ { required: true, validator: validateDirectOutPalletCode, trigger: 'blur' }
+ ]
+ },
+ returnForm: {
+ orderNo: '',
+ palletCode: '',
+ barcode: '',
+ materielCode: '',
+ returnQuantity: 0
+ },
+ isProcessing: false // 闃叉閲嶅鎻愪氦
}
},
mounted() {
- this.loadOrderInfo();
+ // 浠庤矾鐢卞弬鏁拌幏鍙栬鍗曠紪鍙�
+ if (this.$route.query.orderNo) {
+ this.scanData.orderNo = this.$route.query.orderNo;
+ this.splitForm.orderNo = this.$route.query.orderNo;
+ this.returnForm.orderNo = this.$route.query.orderNo;
+ }
+ // 椤甸潰鍔犺浇鍚庤嚜鍔ㄨ仛鐒﹀埌鎵樼洏鐮佽緭鍏ユ
this.$nextTick(() => {
- if (this.$refs.palletInput) {
- this.$refs.palletInput.focus()
- }
- })
+ this.$refs.palletInput.focus();
+ });
+
},
methods: {
- loadOrderInfo() {
- const orderId = this.$route.query.orderId
- if (!orderId) return
+ goBack(){
+ this.$router.back()
+ },
+
+ openSplitDialog() {
+ console.log('鎵撳紑鑷畾涔夋媶鍖呭脊绐�');
+ if (!this.scanData.palletCode) {
+ this.$message.warning('璇峰厛鎵弿鎵樼洏鐮�');
+ return;
+ }
+ this.showCustomSplitDialog = true;
+
+ // 閲嶇疆琛ㄥ崟
+ this.resetSplitForm();
+
+ // 璁剧疆璁㈠崟鍜屾墭鐩樹俊鎭�
+ this.splitForm.orderNo = this.scanData.orderNo;
+ this.splitForm.palletCode = this.scanData.palletCode;
+
+ // 娓呴櫎琛ㄥ崟楠岃瘉
+ this.$nextTick(() => {
+ if (this.$refs.splitFormRef) {
+ this.$refs.splitFormRef.clearValidate();
+ }
+ });
+ },
+
+ // 鍏抽棴鑷畾涔夋媶鍖呭脊绐�
+ closeCustomSplitDialog() {
+ this.showCustomSplitDialog = false;
+ this.resetSplitForm();
+ // 娓呴櫎琛ㄥ崟楠岃瘉
+ if (this.$refs.splitFormRef) {
+ this.$refs.splitFormRef.clearValidate();
+ }
+ },
+
+ // 鎵撳紑鎾ら攢鎷嗗寘寮圭獥
+ openRevertSplitDialog() {
+ console.log('鎵撳紑鎾ら攢鎷嗗寘寮圭獥');
+ this.showRevertSplitDialog = true;
+
+ // 閲嶇疆琛ㄥ崟
+ this.resetRevertSplitForm();
+
+ // 娓呴櫎琛ㄥ崟楠岃瘉
+ this.$nextTick(() => {
+ if (this.$refs.revertSplitFormRef) {
+ this.$refs.revertSplitFormRef.clearValidate();
+ }
+ });
+ },
+
+ // 鍏抽棴鎾ら攢鎷嗗寘寮圭獥
+ closeRevertSplitDialog() {
+ this.showRevertSplitDialog = false;
+ this.resetRevertSplitForm();
+
+ // 娓呴櫎琛ㄥ崟楠岃瘉
+ if (this.$refs.revertSplitFormRef) {
+ this.$refs.revertSplitFormRef.clearValidate();
+ }
+ },
+ // 鎵撳紑鎵归噺鍥炲簱寮圭獥
+ openBatchReturnDialog() {
+ console.log('鎵撳紑鎵归噺鍥炲簱寮圭獥');
+ this.showBatchReturnDialog = true;
+
+ // 閲嶇疆琛ㄥ崟
+ this.resetBatchReturnForm();
+
+ // 璁剧疆璁㈠崟淇℃伅
+ this.batchReturnForm.orderNo = this.scanData.orderNo;
+
+ // 鏇存柊鏈嫞閫変俊鎭�
+ this.batchReturnForm.unpickedCount = this.summary.unpickedCount || 0;
+ this.batchReturnForm.unpickedQuantity = this.summary.unpickedQuantity || 0;
+
+ // 娓呴櫎琛ㄥ崟楠岃瘉
+ this.$nextTick(() => {
+ if (this.$refs.batchReturnFormRef) {
+ this.$refs.batchReturnFormRef.clearValidate();
+ }
+ });
+ },
+
+ // 鍏抽棴鎵归噺鍥炲簱寮圭獥
+ closeBatchReturnDialog() {
+ this.showBatchReturnDialog = false;
+ this.resetBatchReturnForm();
+
+ // 娓呴櫎琛ㄥ崟楠岃瘉
+ if (this.$refs.batchReturnFormRef) {
+ this.$refs.batchReturnFormRef.clearValidate();
+ }
+ },
+
+ // 鎵归噺鍥炲簱鎵樼洏鐮佹壂鐮�
+ onBatchReturnPalletScan() {
+ if (!this.batchReturnForm.palletCode) return;
+
+ this.batchReturnForm.palletCode = this.batchReturnForm.palletCode.replace(/\n/g, '').trim();
+
+ // 娓呴櫎楠岃瘉鐘舵��
+ if (this.$refs.batchReturnFormRef) {
+ this.$refs.batchReturnFormRef.clearValidate(['palletCode']);
+ }
+ },
+
+ // 鎵归噺鍥炲簱纭
+ async handleBatchReturnConfirm() {
+ // 琛ㄥ崟楠岃瘉
+ if (this.$refs.batchReturnFormRef) {
+ this.$refs.batchReturnFormRef.validate((valid) => {
+ if (valid) {
+ this.submitBatchReturn();
+ } else {
+ this.$message.warning('璇锋壂鎻忔墭鐩樼爜');
+ return false;
+ }
+ });
+ } else {
+ // 濡傛灉娌℃湁琛ㄥ崟寮曠敤锛屼娇鐢ㄥ師鏈夌殑楠岃瘉
+ if (!this.batchReturnForm.palletCode) {
+ this.$message.warning('璇锋壂鎻忔墭鐩樼爜');
+ return;
+ }
+
+ this.submitBatchReturn();
+ }
+ },
+
+ // 鎻愪氦鎵归噺鍥炲簱璇锋眰
+ async submitBatchReturn() {
+ this.batchReturnLoading = true;
+
+ try {
+ const res = await this.http.post('/api/OutboundPicking/batch-return-to-stock', {
+ orderNo: this.batchReturnForm.orderNo,
+ palletCode: this.batchReturnForm.palletCode
+ });
+
+ if (res.status) {
+ this.$message.success('鎵归噺鍥炲簱鎴愬姛');
+ this.showBatchReturnDialog = false;
+ this.loadData();
+ } else {
+ this.$message.error(res.message || '鎵归噺鍥炲簱澶辫触');
+ }
+ } catch (error) {
+ this.$message.error('鎵归噺鍥炲簱澶辫触');
+ } finally {
+ this.batchReturnLoading = false;
+ }
+ },
+ // 鎵撳紑鐩存帴鍑哄簱寮圭獥
+ openDirectOutDialog() {
+ console.log('鎵撳紑鐩存帴鍑哄簱寮圭獥');
+ this.showDirectOutDialog = true;
+
+ // 閲嶇疆琛ㄥ崟
+ this.resetDirectOutForm();
+
+ // 璁剧疆璁㈠崟淇℃伅
+ this.directOutForm.orderNo = this.scanData.orderNo;
+
+ // 娓呴櫎琛ㄥ崟楠岃瘉
+ this.$nextTick(() => {
+ if (this.$refs.directOutFormRef) {
+ this.$refs.directOutFormRef.clearValidate();
+ }
+ });
+ },
+
+ // 鍏抽棴鐩存帴鍑哄簱寮圭獥
+ closeDirectOutDialog() {
+ this.showDirectOutDialog = false;
+ this.resetDirectOutForm();
+
+ // 娓呴櫎琛ㄥ崟楠岃瘉
+ if (this.$refs.directOutFormRef) {
+ this.$refs.directOutFormRef.clearValidate();
+ }
+ },
+
+ // 鐩存帴鍑哄簱鎵樼洏鐮佹壂鐮�
+ onDirectOutPalletScan() {
+ if (!this.directOutForm.palletCode) return;
+
+ this.directOutForm.palletCode = this.directOutForm.palletCode.replace(/\n/g, '').trim();
+
+ // 娓呴櫎楠岃瘉鐘舵��
+ if (this.$refs.directOutFormRef) {
+ this.$refs.directOutFormRef.clearValidate(['palletCode']);
+ }
+ },
+
+ // 鐩存帴鍑哄簱纭
+ async handleDirectOutConfirm() {
+ // 琛ㄥ崟楠岃瘉
+ if (this.$refs.directOutFormRef) {
+ this.$refs.directOutFormRef.validate((valid) => {
+ if (valid) {
+ this.submitDirectOut();
+ } else {
+ this.$message.warning('璇锋壂鎻忔墭鐩樼爜');
+ return false;
+ }
+ });
+ } else {
+ // 濡傛灉娌℃湁琛ㄥ崟寮曠敤锛屼娇鐢ㄥ師鏈夌殑楠岃瘉
+ if (!this.directOutForm.palletCode) {
+ this.$message.warning('璇锋壂鎻忔墭鐩樼爜');
+ return;
+ }
+
+ this.submitDirectOut();
+ }
+ },
+
+ // 鎻愪氦鐩存帴鍑哄簱璇锋眰
+ async submitDirectOut() {
+ this.directOutLoading = true;
+
+ try {
+ const res = await this.http.post('/api/OutboundPicking/direct-outbound', {
+ orderNo: this.directOutForm.orderNo,
+ palletCode: this.directOutForm.palletCode
+ });
+ debugger;
+ if (res.status) {
+ this.$message.success('鐩存帴鍑哄簱鎴愬姛');
+ this.showDirectOutDialog = false;
+ this.loadData();
+ } else {
+ this.$message.error(res.message || '鐩存帴鍑哄簱澶辫触');
+ }
+ } catch (error) {
+ this.$message.error('鐩存帴鍑哄簱澶辫触');
+ } finally {
+ this.directOutLoading = false;
+ }
+ },
+
+ // 閲嶇疆鐩存帴鍑哄簱琛ㄥ崟
+ resetDirectOutForm() {
+ this.directOutForm.palletCode = '';
+ },
+
+ // 淇敼鍘熸湁鐨勭洿鎺ュ嚭搴撴寜閽偣鍑讳簨浠�
+ handleDirectOutbound() {
+ this.openDirectOutDialog();
+ },
+ async loadData() {
+ if (!this.scanData.orderNo || !this.scanData.palletCode) {
+ return;
+ }
try {
- this.http.get(`/api/OutboundOrder/GetById?id=${orderId}`).then(response => {debugger;
- if (response.status) {
- this.orderInfo = response.data
+ // 鍔犺浇鏈嫞閫夊垪琛�
+ const unpickedRes = await this.http.post('/api/OutboundPicking/unpicked-list', this.scanData);
+ this.unpickedList = unpickedRes.data || [];
+
+ // 鍔犺浇宸叉嫞閫夊垪琛�
+ const pickedRes = await this.http.post('/api/OutboundPicking/picked-list', this.scanData);
+ this.pickedList = pickedRes.data || [];
+
+ // 鍔犺浇姹囨�讳俊鎭�
+ const summaryRes = await this.http.post('/api/OutboundPicking/picking-summary',this.scanData);
+ this.summary = summaryRes.data || {};
+
+ // 鏇存柊鎵樼洏鐘舵��
+ this.updatePalletStatus();
+
+ } catch (error) {
+ this.$message.error('鍔犺浇鏁版嵁澶辫触');
+ }
+ },
+
+ updatePalletStatus() {
+ if (this.unpickedList.length === 0 && this.pickedList.length > 0) {
+ this.palletStatus = '宸插叏閮ㄦ嫞閫�';
+ } else if (this.unpickedList.length > 0 && this.pickedList.length === 0) {
+ this.palletStatus = '寰呮嫞閫�';
+ } else if (this.unpickedList.length > 0 && this.pickedList.length > 0) {
+ this.palletStatus = '閮ㄥ垎鎷i��';
+ } else {
+ this.palletStatus = '鏃犳暟鎹�';
+ }
+ },
+ // 宸叉嫞閫夊垪琛ㄩ�夋嫨鍙樺寲
+ handlePickedSelectionChange(selection) {
+ this.selectedPickedRows = selection;
+ },
+ // 鎵归噺鍙栨秷閫変腑鐨勫凡鎷i�夐」
+ async batchCancelSelected() {
+ if (this.selectedPickedRows.length === 0) {
+ this.$message.warning('璇峰厛閫夋嫨瑕佸彇娑堢殑椤�');
+ return;
+ }
+
+ this.$confirm(`纭畾瑕佸彇娑堥�変腑鐨� ${this.selectedPickedRows.length} 椤瑰悧锛焋, '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(async () => {
+ try {
+ let successCount = 0;
+ let errorCount = 0;
+
+ for (const row of this.selectedPickedRows) {
+ try {
+ const res = await this.http.post('/api/OutboundPicking/CancelPicking', {
+ orderNo: this.scanData.orderNo,
+ palletCode: this.scanData.palletCode,
+ barcode: row.currentBarcode
+ });
- }
- })
- } catch (error) {
- ElMessage.error('鍔犺浇鍑哄簱鍗曚俊鎭け璐�')
- }
- },
- goBack() {
- this.$router.back()
- },
- async handlePalletScan() {
- if (this.scanForm.palletCode) {
- ElMessage.success(`宸叉壂鎻忔墭鐩�: ${this.scanForm.palletCode}`)
- await this.loadPalletSummary()
-
- this.$nextTick(() => {
- if (this.$refs.materialInput) {
- this.$refs.materialInput.focus()
- }
- })
- }
- },
- async handleMaterialScan() {
- if (!this.scanForm.palletCode) {
- ElMessage.warning('璇峰厛鎵弿鎵樼洏鐮�')
- this.$refs.palletInput.focus()
- return
- }
-
- if (!this.scanForm.materialBarcode) {
- ElMessage.warning('璇锋壂鎻忕墿鏂欐潯鐮�')
- return
- }
-
- await this.executePickingConfirm()
- },
- async loadPalletSummary() {
- if (!this.scanForm.palletCode) {
- this.palletSummary = null
- return
- }
-
- try {
- const result = await http.get('/api/outbound/getPalletPickingSummary', {
- params: {
- orderNo: this.orderNo,
- palletCode: this.scanForm.palletCode
- }
- })
-
- if (result.success) {
- // 澶勭悊缁熻淇℃伅
- const summary = result.data
- const assigned = summary.find(x => x.Status === '宸插垎閰�') || { TotalAssignQty: 0, TotalPickedQty: 0 }
- const picked = summary.find(x => x.Status === '宸叉嫞閫�') || { TotalPickedQty: 0 }
-
- this.palletSummary = {
- unpickedCount: assigned.TotalAssignQty > 0 ? 1 : 0, // 绠�鍖栬绠�
- unpickedTotal: assigned.TotalAssignQty - assigned.TotalPickedQty
- }
- }
- } catch (error) {
- console.error('鍔犺浇鎵樼洏缁熻澶辫触:', error)
- }
- },
- async handleConfirm() {
- if (!this.scanForm.palletCode || !this.scanForm.materialBarcode) {
- ElMessage.warning('璇峰~鍐欏畬鏁寸殑鎵爜淇℃伅')
- return
- }
-
- await this.executePickingConfirm()
- },
- async executePickingConfirm() {
- this.confirmLoading = true
-
- try {
- // 鍏堟壘鍒板搴旂殑鍑哄簱閿佸畾淇℃伅
- const lockInfoResult = await this.http.get('/api/outbound/getOutStockLockInfo', {
- params: {
- orderNo: this.orderNo,
- palletCode: this.scanForm.palletCode,
- materialBarcode: this.scanForm.materialBarcode
- }
- })
-
- if (!lockInfoResult.success || !lockInfoResult.data || lockInfoResult.data.length === 0) {
- ElMessage.error('鏈壘鍒板搴旂殑鍑哄簱閿佸畾淇℃伅')
- return
- }
-
- const lockInfo = lockInfoResult.data[0]
-
- const request = {
- outStockLockId: lockInfo.Id,
- taskNo: `TASK_${Date.now()}`,
- palletCode: this.scanForm.palletCode,
- materialBarcode: this.scanForm.materialBarcode,
- locationCode: lockInfo.LocationCode
- }
-
- const result = await this.http.post('/api/outbound/pickingConfirm', request)
-
- if (result.success) {
- ElMessage.success('鍒嗘嫞纭鎴愬姛')
- this.handleReset()
- this.$emit('confirm')
-
- // 鍒锋柊琛ㄦ牸
- if (this.$refs.pickedTable) {
- this.$refs.pickedTable.refresh()
+ if (res.status) {
+ successCount++;
+ } else {
+ errorCount++;
+ console.error(`鍙栨秷鎷i�夊け璐�: ${row.Barcode}`, res.message);
+ }
+ } catch (error) {
+ errorCount++;
+ console.error(`鍙栨秷鎷i�夊け璐�: ${row.Barcode}`, error);
+ }
}
- // 鍒锋柊鍑哄簱璇︽儏琛ㄦ牸
- if (this.$refs.outboundTable) {
- this.$refs.outboundTable.refresh()
+ if (errorCount === 0) {
+ this.$message.success(`鎴愬姛鍙栨秷 ${successCount} 椤筦);
+ } else {
+ this.$message.warning(`鎴愬姛鍙栨秷 ${successCount} 椤癸紝澶辫触 ${errorCount} 椤筦);
}
+
+ this.loadData();
+ this.selectedPickedRows = [];
+ } catch (error) {
+ this.$message.error('鎵归噺鍙栨秷鎿嶄綔澶辫触');
+ }
+ }).catch(() => {
+ this.$message.info('宸插彇娑堟壒閲忔搷浣�');
+ });
+ },
+ // 鎵樼洏鐮佹壂鐮�
+ onPalletScan() {
+ // 鍘婚櫎鍥炶溅绗﹀拰鍓嶅悗绌烘牸
+ this.scanData.palletCode = this.scanData.palletCode.replace(/\n/g, '').trim();
+ if (!this.scanData.palletCode) return;
+
+ this.splitForm.palletCode = this.scanData.palletCode;
+ this.returnForm.palletCode = this.scanData.palletCode;
+
+ // 鍔犺浇鏁版嵁
+ this.loadData();
+
+ // 鑷姩璺宠浆鍒扮墿鏂欐潯鐮佽緭鍏ユ
+ this.$nextTick(() => {
+ this.$refs.barcodeInput.focus();
+ });
+ },
- // 閲嶆柊鍔犺浇鎵樼洏缁熻
- await this.loadPalletSummary()
+ onBarcodeScan() {
+ // 鍘婚櫎鍥炶溅绗﹀拰鍓嶅悗绌烘牸
+ this.scanData.barcode = this.scanData.barcode.replace(/\n/g, '').trim();
+ if (!this.scanData.barcode) return;
+
+ // 鑷姩纭鎷i��
+ this.confirmPicking();
+ },
+
+ async confirmPicking() {
+ if (this.isProcessing) return;
+
+ if (!this.scanData.orderNo || !this.scanData.palletCode || !this.scanData.barcode) {
+ this.$message.warning('璇峰厛鎵弿鎵樼洏鐮佸拰鐗╂枡鏉$爜');
+ this.focusBarcodeInput();
+ return;
+ }
+
+ this.isProcessing = true;
+
+ try {
+ const res = await this.http.post('/api/OutboundPicking/confirm-picking', this.scanData);
+ if (res.status) {
+ this.$message.success('鎷i�夌‘璁ゆ垚鍔�');
+ this.scanData.barcode = ''; // 娓呯┖鐗╂枡鏉$爜
+ this.loadData();
+
+ // 鎴愬姛鍚庣户缁仛鐒﹀埌鐗╂枡鏉$爜杈撳叆妗嗭紝鍑嗗涓嬩竴涓壂鐮�
+ this.$nextTick(() => {
+ this.$refs.barcodeInput.focus();
+ });
} else {
- ElMessage.error(result.ElMessage)
+ // 鏄剧ず鍚庣杩斿洖鐨勯敊璇俊鎭�
+ this.$message.error(res.message || '鎷i�夌‘璁ゅけ璐�');
+ // 澶辫触鏃惰仛鐒﹀苟閫変腑鐗╂枡鏉$爜杈撳叆妗嗗唴瀹�
+ this.focusBarcodeInput(true);
}
} catch (error) {
- ElMessage.error('鍒嗘嫞纭澶辫触')
+ this.$message.error('鎷i�夌‘璁ゅけ璐�: ' + (error.message || '缃戠粶閿欒'));
+ // 澶辫触鏃惰仛鐒﹀苟閫変腑鐗╂枡鏉$爜杈撳叆妗嗗唴瀹�
+ this.focusBarcodeInput(true);
} finally {
- this.confirmLoading = false
+ this.isProcessing = false;
}
},
- handleReset() {
- this.scanForm.materialBarcode = ''
+
+ // 鑱氱劍鍒扮墿鏂欐潯鐮佽緭鍏ユ
+ focusBarcodeInput(selectText = false) {
this.$nextTick(() => {
- if (this.$refs.materialInput) {
- this.$refs.materialInput.focus()
+ const input = this.$refs.barcodeInput;
+ if (input && input.$el && input.$el.querySelector('input')) {
+ const inputEl = input.$el.querySelector('input');
+ inputEl.focus();
+ if (selectText) {
+ inputEl.select();
+ }
}
- })
+ });
+ },
+
+ async cancelPicking(row) {
+ try {
+ const res = await this.http.post('/api/OutboundPicking/CancelPicking', {
+ orderNo: this.scanData.orderNo,
+ palletCode: this.scanData.palletCode,
+ barcode: row.Barcode
+ });
+
+ if (res.status) {
+ this.$message.success('鍙栨秷鎷i�夋垚鍔�');
+ this.loadData();
+ } else {
+ this.$message.error(res.message || '鍙栨秷鎷i�夊け璐�');
+ }
+ } catch (error) {
+ this.$message.error('鍙栨秷鎷i�夊け璐�');
+ }
+ },
+
+ /* // 鍥炲簱鎿嶄綔 - 鍥炲簱鏁翠釜鎵樼洏鏈嫞閫夌殑璐х墿
+ async handleBatchReturn() {
+ if (!this.scanData.orderNo || !this.scanData.palletCode) {
+ this.$message.warning('璇峰厛鎵弿鎵樼洏鐮�');
+ return;
+ }
+
+ if (this.unpickedList.length === 0) {
+ this.$message.warning('璇ユ墭鐩樻病鏈夊彲鍥炲簱鐨勮揣鐗�');
+ return;
+ }
+
+ this.$confirm(`纭畾瑕佸洖搴撴暣涓墭鐩樼殑鏈嫞閫夎揣鐗╁悧锛熷叡 ${this.unpickedList.length} 鏉¤褰昤, '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(async () => {
+ try {
+ const res = await this.http.post('/api/OutboundPicking/batch-return-to-stock', {
+ orderNo: this.scanData.orderNo,
+ palletCode: this.scanData.palletCode
+ });
+
+ if (res.success) {
+ this.$message.success('鎵归噺鍥炲簱鎴愬姛');
+ this.loadData();
+ } else {
+ this.$message.error(res.message || '鎵归噺鍥炲簱澶辫触');
+ }
+ } catch (error) {
+ this.$message.error('鎵归噺鍥炲簱澶辫触');
+ }
+ }).catch(() => {
+ this.$message.info('宸插彇娑堟壒閲忓洖搴�');
+ });
+ }, */
+
+ /* // 鐩存帴鍑哄簱鎿嶄綔
+ async handleDirectOutbound() {
+ if (!this.scanData.orderNo || !this.scanData.palletCode) {
+ this.$message.warning('璇峰厛鎵弿鎵樼洏鐮�');
+ return;
+ }
+
+ this.$confirm('纭畾瑕佺洿鎺ュ嚭搴撴暣涓墭鐩樺悧锛�', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(async () => {
+ try {
+ const res = await this.http.post('/api/OutboundPicking/direct-outbound', {
+ orderNo: this.scanData.orderNo,
+ palletCode: this.scanData.palletCode
+ });
+
+ if (res.success) {
+ this.$message.success('鐩存帴鍑哄簱鎴愬姛');
+ this.loadData();
+ } else {
+ this.$message.error(res.message || '鐩存帴鍑哄簱澶辫触');
+ }
+ } catch (error) {
+ this.$message.error('鐩存帴鍑哄簱澶辫触');
+ }
+ }).catch(() => {
+ this.$message.info('宸插彇娑堢洿鎺ュ嚭搴�');
+ });
+ }, */
+ // 纭鍥炲簱锛堥�氳繃寮圭獥锛�
+ async handleReturnConfirm() {
+ if (!this.returnForm.barcode) {
+ this.$message.warning('璇锋壂鎻忓洖搴撴潯鐮�');
+ return;
+ }
+
+ try {
+ const res = await this.http.post('/api/OutboundPicking/return-to-stock', {
+ orderNo: this.returnForm.orderNo,
+ palletCode: this.returnForm.palletCode,
+ barcode: this.returnForm.barcode
+ });
+
+ if (res.success) {
+ this.$message.success('鍥炲簱鎴愬姛');
+ this.showReturnDialog = false;
+ this.resetReturnForm();
+ this.loadData();
+ } else {
+ this.$message.error(res.message || '鍥炲簱澶辫触');
+ }
+ } catch (error) {
+ this.$message.error('鍥炲簱澶辫触');
+ }
+ },
+
+ // 鎷嗗寘鎵爜
+ async onSplitBarcodeScan() {
+ if (!this.splitForm.originalBarcode) return;
+
+ // 鍘婚櫎鍥炶溅绗﹀拰鍓嶅悗绌烘牸
+ this.splitForm.originalBarcode = this.splitForm.originalBarcode.replace(/\n/g, '').trim();
+
+ try {
+ const res = await this.http.post('/api/OutboundPicking/split-package-info', {
+
+ orderNo: this.splitForm.orderNo,
+ palletCode: this.splitForm.palletCode,
+ barcode: this.splitForm.originalBarcode
+
+ });
+
+ if (res.status) {
+ this.splitForm.materielCode = res.data.materielCode;
+ this.splitForm.maxQuantity = res.data.remainQuantity;
+ this.splitForm.splitQuantity = Math.min(1, this.splitForm.maxQuantity);
+ // 娓呴櫎楠岃瘉鐘舵��
+ if (this.$refs.splitFormRef) {
+ this.$refs.splitFormRef.clearValidate(['originalBarcode']);
+ }
+ } else {
+ this.$message.error(res.message || '鑾峰彇鎷嗗寘淇℃伅澶辫触');
+ // 楠岃瘉澶辫触锛岃缃敊璇姸鎬�
+ if (this.$refs.splitFormRef) {
+ this.$refs.splitFormRef.validateField('originalBarcode');
+ }
+ }
+ } catch (error) {
+ this.$message.error('鑾峰彇鎷嗗寘淇℃伅澶辫触');
+ // 楠岃瘉澶辫触锛岃缃敊璇姸鎬�
+ if (this.$refs.splitFormRef) {
+ this.$refs.splitFormRef.validateField('originalBarcode');
+ }
+ }
+ },
+
+ async handleSplitPackage() {
+ // 琛ㄥ崟楠岃瘉
+ if (this.$refs.splitFormRef) {
+ this.$refs.splitFormRef.validate((valid) => {
+ if (valid) {
+ this.submitSplitPackage();
+ } else {
+ this.$message.warning('璇峰~鍐欏畬鏁寸殑鎷嗗寘淇℃伅');
+ return false;
+ }
+ });
+ } else {
+ // 濡傛灉娌℃湁琛ㄥ崟寮曠敤锛屼娇鐢ㄥ師鏈夌殑楠岃瘉
+ if (!this.splitForm.originalBarcode || this.splitForm.splitQuantity <= 0) {
+ this.$message.warning('璇峰~鍐欏畬鏁寸殑鎷嗗寘淇℃伅');
+ return;
+ }
+
+ if (this.splitForm.splitQuantity > this.splitForm.maxQuantity) {
+ this.$message.warning('鎷嗗寘鏁伴噺涓嶈兘澶т簬鍓╀綑鏁伴噺');
+ return;
+ }
+
+ this.submitSplitPackage();
+ }
+
+
+ },
+ // 鎻愪氦鎷嗗寘璇锋眰
+ async submitSplitPackage() {
+ this.splitLoading = true;
+ try {
+ const res = await this.http.post('/api/OutboundPicking/split-package', this.splitForm);
+ if (res.status) {
+ this.$message.success('鎷嗗寘鎴愬姛');
+ this.showSplitDialog = false;
+ this.resetSplitForm();
+ this.loadData();
+ } else {
+ this.$message.error(res.message || '鎷嗗寘澶辫触');
+ }
+ } catch (error) {
+ this.$message.error('鎷嗗寘澶辫触');
+ }
+ },
+ // 鎾ら攢鎷嗗寘鎵爜
+ onRevertSplitBarcodeScan() {
+ if (!this.revertSplitForm.originalBarcode) return;
+
+ this.revertSplitForm.originalBarcode = this.revertSplitForm.originalBarcode.replace(/\n/g, '').trim();
+
+ // 娓呴櫎楠岃瘉鐘舵��
+ if (this.$refs.revertSplitFormRef) {
+ this.$refs.revertSplitFormRef.clearValidate(['originalBarcode']);
+ }
+ },
+ async handleRevertSplit() {
+ // 琛ㄥ崟楠岃瘉
+ if (this.$refs.revertSplitFormRef) {
+ this.$refs.revertSplitFormRef.validate((valid) => {
+ if (valid) {
+ this.submitRevertSplit();
+ } else {
+ this.$message.warning('璇疯緭鍏ュ師鏉$爜');
+ return false;
+ }
+ });
+ } else {
+ // 濡傛灉娌℃湁琛ㄥ崟寮曠敤锛屼娇鐢ㄥ師鏈夌殑楠岃瘉
+ if (!this.revertSplitForm.originalBarcode) {
+ this.$message.warning('璇疯緭鍏ュ師鏉$爜');
+ return;
+ }
+
+ this.submitRevertSplit();
+ }
+ },
+ // 鎻愪氦鎾ら攢鎷嗗寘璇锋眰
+ async submitRevertSplit() {
+ this.revertSplitLoading = true;
+
+ try {
+ const res = await this.http.post('/api/OutboundPicking/revert-split-package', {
+ originalBarcode: this.revertSplitForm.originalBarcode
+ });
+
+ if (res.status) {
+ this.$message.success('鎾ら攢鎷嗗寘鎴愬姛');
+ this.showRevertSplitDialog = false;
+ this.revertSplitForm.originalBarcode = '';
+ this.loadData();
+ } else {
+ this.$message.error(res.message || '鎾ら攢鎷嗗寘澶辫触');
+ }
+ } catch (error) {
+ this.$message.error('鎾ら攢鎷嗗寘澶辫触');
+ }
+ },
+ resetSplitForm() {
+ this.splitForm.originalBarcode = '';
+ this.splitForm.materielCode = '';
+ this.splitForm.splitQuantity = 0;
+ this.splitForm.maxQuantity = 0;
+ },
+ // 閲嶇疆鎵归噺鍥炲簱琛ㄥ崟
+ resetBatchReturnForm() {
+ this.batchReturnForm.palletCode = '';
+ this.batchReturnForm.unpickedCount = 0;
+ this.batchReturnForm.unpickedQuantity = 0;
+ },
+ resetReturnForm() {
+ this.returnForm.barcode = '';
+ this.returnForm.materielCode = '';
+ this.returnForm.returnQuantity = 0;
}
}
})
</script>
<style scoped>
-.picking-confirm {
+.picking-container {
+ padding: 20px;
+ position: relative; /* 涓哄脊绐楀畾浣嶆彁渚涗笂涓嬫枃 */
+}
+.scanner-form {
display: flex;
- flex-direction: column;
- height: 70vh;
+ gap: 10px;
+ align-items: center;
+ flex-wrap: wrap;
}
-
-.content-layout {
+.scanner-form .el-input {
+ width: 200px;
+}
+.summary-info {
display: flex;
- gap: 16px;
- margin-bottom: 16px;
- flex: 1;
- min-height: 0; /* 閲嶈锛氶槻姝lex瀛愬厓绱犳孩鍑� */
+ gap: 20px;
+ flex-wrap: wrap;
}
-.left-section {
- flex: 1;
+/* 琛ㄦ牸鎿嶄綔鍖哄煙鏍峰紡 */
+.table-actions {
display: flex;
- flex-direction: column;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 10px;
+ padding: 0 10px;
}
-.right-section {
- flex: 1;
+.selection-count {
+ font-size: 12px;
+ color: #909399;
+}
+
+/* 琛ㄦ牸鏍峰紡璋冩暣 */
+.content-area .el-table {
+ margin-top: 0;
+}
+
+/* 纭繚琛ㄦ牸楂樺害閫傚簲 */
+.content-area .el-card__body {
+ padding: 15px;
+}
+
+
+/* 鑷畾涔夊脊绐楁牱寮� */
+.custom-dialog-overlay {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-color: rgba(0, 0, 0, 0.5);
display: flex;
- flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ z-index: 9999;
}
-.scan-section {
- flex-shrink: 0;
+.custom-dialog-wrapper {
+ position: relative;
+ z-index: 10000;
}
-.scan-alert {
- margin-bottom: 16px;
+.custom-dialog {
+ background: white;
+ border-radius: 4px;
+ width: 500px;
+ max-width: 90vw;
+ max-height: 90vh;
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+ overflow: auto;
}
-.scan-form {
- max-width: 500px;
-}
-
-.pallet-summary {
- margin: 16px 0;
-}
-
-.action-buttons {
- margin-top: 16px;
-}
-
-.outbound-details-card {
- height: 100%;
+.custom-dialog-header {
display: flex;
- flex-direction: column;
+ justify-content: space-between;
+ align-items: center;
+ padding: 20px 20px 10px;
+ border-bottom: 1px solid #ebeef5;
}
-.outbound-details-card :deep(.el-card__body) {
- flex: 1;
+.custom-dialog-header h3 {
+ margin: 0;
+ color: #303133;
+}
+
+/* 鍏抽棴鎸夐挳鏍峰紡 */
+.close-button {
+ font-size: 18px;
+ color: #909399;
padding: 0;
+ width: 24px;
+ height: 24px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
}
-.picked-records {
- flex-shrink: 0;
- height: 300px;
+.close-button:hover {
+ color: #409EFF;
+ background-color: transparent;
}
-.picked-records :deep(.el-card__body) {
- padding: 0;
+.custom-dialog-body {
+ padding: 20px;
+}
+
+.custom-dialog-footer {
+ padding: 10px 20px 20px;
+ text-align: right;
+ border-top: 1px solid #ebeef5;
+}
+
+.custom-dialog-footer .el-button {
+ margin-left: 10px;
+}
+
+/* 纭繚寮圭獥鍦ㄧЩ鍔ㄨ澶囦笂涔熻兘姝e父鏄剧ず */
+@media (max-width: 768px) {
+ .custom-dialog {
+ width: 95vw;
+ margin: 10px;
+ }
}
</style>
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/CodeChunks.db-shm" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/CodeChunks.db-shm"
index ce475c3..184b599 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/CodeChunks.db-shm"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/CodeChunks.db-shm"
Binary files differ
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/SemanticSymbols.db-shm" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/SemanticSymbols.db-shm"
index a0b5b32..890e021 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/SemanticSymbols.db-shm"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/SemanticSymbols.db-shm"
Binary files differ
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_BasicService/InvokeMESService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_BasicService/InvokeMESService.cs"
index 51b35eb..c6ee79d 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_BasicService/InvokeMESService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_BasicService/InvokeMESService.cs"
@@ -207,7 +207,7 @@
};
- var groupedData = lists.GroupBy(item => new { item.MaterielCode, item.SupplyCode, item.BatchNo, item.InboundOrderRowNo, item.Unit, item.WarehouseCode })
+ var groupedData = lists.GroupBy(item => new { item.MaterielCode, item.SupplyCode, item.BatchNo, item.InboundOrderRowNo, item.BarcodeUnit, item.WarehouseCode })
.Select(group => new FeedbackInboundDetailsModel
{
materialCode = group.Key.MaterielCode,
@@ -216,11 +216,11 @@
lineNo = group.Key.InboundOrderRowNo,
// warehouseCode = group.Key.WarehouseCode=="0"?"1072": group.Key.WarehouseCode,
warehouseCode =group.Key.WarehouseCode,
- unit = group.Key.Unit,
+ unit = group.Key.BarcodeUnit,
barcodes = group.Select(row => new FeedbackBarcodesModel
{
barcode = row.Barcode,
- qty = row.StockQuantity
+ qty = row.BarcodeQty
}).ToList()
}).ToList();
feedmodel.details = groupedData;
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/OrderCreateTypeEnum.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/OrderCreateTypeEnum.cs"
index 79c5516..e1a5870 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/OrderCreateTypeEnum.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/OrderCreateTypeEnum.cs"
@@ -10,15 +10,16 @@
public enum OrderCreateTypeEnum
{
/// <summary>
- /// 绯荤粺鍐呭垱寤�
- /// </summary>
- [Description("绯荤粺鍐呭垱寤�")]
- CreateInSystem,
-
- /// <summary>
/// 涓婃父绯荤粺鎺ㄩ��
/// </summary>
[Description("涓婃父绯荤粺鎺ㄩ��")]
- UpperSystemPush
+ UpperSystemPush,
+ /// <summary>
+ /// 绯荤粺鍐呭垱寤�
+ /// </summary>
+ [Description("绯荤粺鍐呭垱寤�")]
+ CreateInSystem
+
+
}
}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/RepositoryBase.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/RepositoryBase.cs"
index bbbab3f..db08c06 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/RepositoryBase.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/RepositoryBase.cs"
@@ -912,7 +912,8 @@
_db.InsertableByObject(obj).AS(type.Name + "_Hty").ExecuteCommand();
}
}
- return DeleteData(entity);
+ // return DeleteData(entity);
+ return true;
}
public bool DeleteAndMoveIntoHty(List<TEntity> entities, OperateTypeEnum operateType)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_DTO/Outbound/OutboundOrderGetDTO.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_DTO/Outbound/OutboundOrderGetDTO.cs"
index 72d582e..e62e839 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_DTO/Outbound/OutboundOrderGetDTO.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_DTO/Outbound/OutboundOrderGetDTO.cs"
@@ -1,4 +1,5 @@
锘縰sing Microsoft.AspNetCore.Components.Forms;
+using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -25,11 +26,23 @@
}
public class ConfirmPickingDto
{
+ [JsonProperty("orderNo")]
public string OrderNo { get; set; }
+ [JsonProperty("palletCode")]
public string PalletCode { get; set; }
+ [JsonProperty("barcode")]
public string Barcode { get; set; }
}
+ public class SummaryPickingDto
+ {
+ public string PalletCode { get; set; }
+ public string MaterielCode { get; set; }
+ public int UnpickedCount { get; set; }
+ public decimal UnpickedQuantity { get; set; }
+ public int pickedCount { get; set; }
+
+ }
public class PickingConfirmRequest
{
public int OrderDetailId { get; set; }
@@ -45,6 +58,7 @@
public class DirectOutboundRequest
{
public string PalletCode { get; set; }
+ public string OrderNo { get; set; }
}
public class CancelPickingRequest
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutboundPickingService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutboundPickingService.cs"
index ceac439..9a34fb3 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutboundPickingService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutboundPickingService.cs"
@@ -20,12 +20,14 @@
Task<WebResponseContent> ConfirmPicking(PickingConfirmRequest request);
Task<WebResponseContent> ConfirmPicking(string orderNo, string palletCode, string barcode);
Task<WebResponseContent> DirectOutbound(DirectOutboundRequest request);
+
Task<List<OutStockLockListResp>> GetOutStockLockListAsync(string orderNo);
Task<WebResponseContent> GetPalletOutboundStatus(string palletCode);
Task GetPalletPickingSummary(string orderNo, string palletCode);
Task<List<Dt_OutStockLockInfo>> GetPickedList(string orderNo, string palletCode);
Task<List<Dt_PickingRecord>> GetPickingHistory(int orderId);
- Task<object> GetPickingSummary(string orderNo);
+ Task<object> GetPickingSummary(ConfirmPickingDto dto);
+
Task<List<Dt_OutStockLockInfo>> GetUnpickedList(string orderNo, string palletCode);
Task<WebResponseContent> ValidateBarcode(string barcode);
}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs"
index 2b3c1dc..7dc0d95 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs"
@@ -45,5 +45,6 @@
Task<WebResponseContent> TaskCompleted(string taskNum);
Task<WebResponseContent> GenerateOutboundTasksAsync(int[] keys);
+
}
}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs"
index b3faa42..7e48a6a 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs"
@@ -367,10 +367,13 @@
SupplyCode = item.SupplyCode,
WarehouseCode = materielGroupDTO.WarehouseType,
StockQuantity = item.OrderQuantity,
+ BarcodeQty=item.BarcodeQty,
+ BarcodeUnit=item.BarcodeUnit,
+ FactoryArea= inboundOrder.FactoryArea,
Status = 0,
OrderNo = inboundOrder.InboundOrderNo,
BusinessType = inboundOrder.BusinessType,
- ProductionDate = DateTime.Now.ToString("yyyy-mm-dd HH:mm:ss")
+
});
item.ReceiptQuantity = item.BarcodeQty;
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundLockInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundLockInfo.cs"
index 03bc89c..167aebe 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundLockInfo.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundLockInfo.cs"
@@ -111,7 +111,7 @@
public string SupplyCode { get; set; }
public string WarehouseCode { get; set; }
/// <summary>
- /// 鐘舵�� 鐘舵�侊細0-宸插垎閰� 1-閮ㄥ垎鎷i�� 2-宸叉嫞閫� 3-宸插畬鎴�
+ /// 鐘舵�� 鐘舵�侊細0-宸插垎閰� 1-鍑哄簱涓� 2-閮ㄥ垎鎷i�� 3宸叉嫞閫�
/// </summary>
[SugarColumn(IsNullable = false, ColumnDescription = "鐘舵��")]
public int Status { get; set; }
@@ -127,7 +127,10 @@
[Navigate(NavigateType.OneToOne, nameof(StockInfo))]//涓�瀵逛竴 SchoolId鏄疭tudentA绫婚噷闈㈢殑
public Dt_StockInfo StockInfo { get; set; } //涓嶈兘璧嬪�煎彧鑳芥槸null
- [SugarColumn(IsIgnore = true)]
+
+ public string FactoryArea { get; set; }
+
+ [SqlSugar.SugarColumn(IsIgnore = true)]
public decimal RemainQuantity => AssignQuantity - PickedQty;
}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_PickingRecord.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_PickingRecord.cs"
index f291fa0..cddab2f 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_PickingRecord.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_PickingRecord.cs"
@@ -19,6 +19,8 @@
{
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int Id { get; set; }
+
+ public int TaskNo { get; set; }
public string OrderNo { get; set; }
public int OrderDetailId { get; set; }
@@ -41,6 +43,9 @@
public string LocationCode { get; set; }
public int StockId { get; set; }
+
+
+ public string FactoryArea { get; set; }
}
@@ -79,13 +84,15 @@
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int Id { get; set; }
public string OrderNo { get; set; }
+ public int? TaskNum { get; set; }
public string PalletCode { get; set; }
- public string StockId { get; set; }
+ public int StockId { get; set; }
public bool IsReverted { get; set; } = false;
public int OutStockLockInfoId { get; set; } // 鍏宠仈鐨勫嚭搴撻攣瀹氫俊鎭�
public string OriginalBarcode { get; set; } // 鍘熸潯鐮�
public string NewBarcode { get; set; } // 鏂版潯鐮�
+ public string FactoryArea { get; set; }
/// <summary>
/// 鎷嗗垎鏁伴噺锛堟柊鏉$爜鏁伴噺锛�
/// </summary>
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfoDetail.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfoDetail.cs"
index f3fd814..cc19acf 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfoDetail.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfoDetail.cs"
@@ -104,6 +104,7 @@
[SugarColumn(ColumnName = "supplyCode", ColumnDescription = "渚涘簲鍟嗙紪鍙�")]
public string? SupplyCode { get; set; }
+ public string FactoryArea { get; set; }
/// <summary>
/// 浠撳簱
/// 榛樿鍊�:
@@ -126,6 +127,11 @@
[SugarColumn(ColumnName = "businessType", ColumnDescription = "涓氬姟绫诲瀷")]
public string? BusinessType { get; set; }
+
+ public decimal BarcodeQty { get; set; }
+
+ public string BarcodeUnit { get; set; }
+
/// <summary>
/// 澶囨敞
/// </summary>
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService.cs"
index e93585a..a40785a 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutStockLockInfoService.cs"
@@ -34,9 +34,9 @@
_recordService = recordService;
}
-
+
/// <summary>
- /// 鍒涘缓鍑哄簱閿佸畾淇℃伅 - 淇鐗堟湰
+ /// 鍒涘缓鍑哄簱閿佸畾
/// </summary>
public Dt_OutStockLockInfo GetOutStockLockInfo(
Dt_OutboundOrder outboundOrder,
@@ -72,7 +72,7 @@
// 浣跨敤绗竴涓彲鐢ㄦ潯鐮�
var firstAvailableDetail = stockDetails
.Where(x => x.StockQuantity > x.OutboundQuantity)
- .OrderBy(x => x.ProductionDate)
+ .OrderBy(x => x.CreateDate)
.FirstOrDefault();
if (firstAvailableDetail == null)
@@ -84,6 +84,7 @@
return new Dt_OutStockLockInfo()
{
+
PalletCode = outStock.PalletCode,
AssignQuantity = assignQuantity,
MaterielCode = outboundOrderDetail.MaterielCode,
@@ -99,8 +100,9 @@
Status = (int)OutLockStockStatusEnum.宸插垎閰�,
StockId = outStock.Id,
Unit = outboundOrderDetail.Unit,
-
- SupplyCode = outboundOrderDetail.SupplyCode,
+ FactoryArea = outboundOrder.FactoryArea,
+ OrderType=outboundOrder.OrderType,
+ SupplyCode = outboundOrderDetail.SupplyCode,
WarehouseCode = outboundOrderDetail.WarehouseCode,
// 鏂板瀛楁
CurrentBarcode = targetBarcode,
@@ -141,7 +143,7 @@
Status = lockInfo.Status,
IsSplitted = lockInfo.IsSplitted,
ParentLockId = lockInfo.ParentLockId,
-
+
MaterielName = detail.MaterielName,
Unit = detail.Unit
})
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderDetailService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderDetailService.cs"
index 826d45a..fb068ec 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderDetailService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderDetailService.cs"
@@ -70,7 +70,7 @@
MaterielCode = x.Key.MaterielCode,
BatchNo = x.Key.BatchNo,
Details = x.ToList(),
- TotalNeedQuantity = x.Sum(v => v.OrderQuantity - v.OverOutQuantity - v.LockQuantity)
+ TotalNeedQuantity = x.Sum(v => v.OrderQuantity - v.OverOutQuantity - v.LockQuantity-v.MoveQty)
})
.Where(x => x.TotalNeedQuantity > 0)
.ToList();
@@ -107,7 +107,7 @@
}
/// <summary>
- /// 鎸夊厛杩涘厛鍑哄師鍒欏垎閰嶉攣瀹氭暟閲忓埌鍚勪釜鏄庣粏 - 淇鐗堟湰
+ /// 鎸夊厛杩涘厛鍑哄師鍒欏垎閰嶉攣瀹氭暟閲忓埌鍚勪釜鏄庣粏
/// </summary>
private void DistributeLockQuantityByFIFO(
List<Dt_OutboundOrderDetail> details,
@@ -118,7 +118,7 @@
{
// 鎸夊厛杩涘厛鍑烘帓搴忓嚭搴撳崟鏄庣粏锛堝亣璁惧厛鍒涘缓鐨勬槑缁嗛渶瑕佷紭鍏堟弧瓒筹級
var sortedDetails = details
- .Where(d => d.OrderQuantity - d.OverOutQuantity - d.LockQuantity > 0) // 鍙鐞嗚繕闇�瑕佸垎閰嶇殑鏁伴噺
+ .Where(d => d.OrderQuantity - d.OverOutQuantity - d.LockQuantity -d.MoveQty> 0) // 鍙鐞嗚繕闇�瑕佸垎閰嶇殑鏁伴噺
.OrderBy(x => x.Id)
.ToList();
@@ -128,7 +128,7 @@
var allocatedStockDetails = assignStocks
.SelectMany(x => x.Details)
.Where(x => stockAllocations.ContainsKey(x.Id))
- .OrderBy(x => x.ProductionDate)
+ .OrderBy(x => x.CreateDate)
.ThenBy(x => x.StockId)
.ToList();
@@ -201,123 +201,6 @@
}
}
-
-/// <summary>
- /// 鍒涘缓鍑哄簱閿佸畾淇℃伅
- /// </summary>
- private void CreateOutStockLockInfos(Dt_OutboundOrder outboundOrder,List<Dt_OutboundOrderDetail> details,
- List<Dt_StockInfo> assignStocks,List<Dt_OutStockLockInfo> outStockLockInfos)
- {
- foreach (var stock in assignStocks)
- {
- // 鑾峰彇璇ュ簱瀛樹腑鐩稿叧鐗╂枡鐨勫彲鐢ㄦ潯鐮佷俊鎭�
- var stockDetails = stock.Details
- .Where(x => details.Any(d => d.MaterielCode == x.MaterielCode) &&
- x.StockQuantity > x.OutboundQuantity)
- .OrderBy(x => x.ProductionDate) // 鍏堣繘鍏堝嚭
- .ToList();
- if (!stockDetails.Any()) continue;
-
- var stockAssignQuantity = stockDetails.Sum(x => x.OutboundQuantity);
-
-
- // 鏌ユ壘杩欎釜搴撳瓨宸茬粡鍒嗛厤鐨勬暟閲�
- var existingAssign = outStockLockInfos
- .Where(x => x.StockId == stock.Id &&
- details.Any(d => d.Id == x.OrderDetailId))
- .Sum(x => x.AssignQuantity);
-
- var availableAssign = stockAssignQuantity - existingAssign;
-
- if (availableAssign <= 0) continue;
-
- // 鎸夊厛杩涘厛鍑哄師鍒欏垎閰嶆潯鐮�
- var barcodeAllocation = AllocateBarcodes(stockDetails, availableAssign);
-
-
- // 鍒嗛厤缁欏悇涓槑缁�
- foreach (var detail in details.Where(d => d.LockQuantity > 0))
- {
- var alreadyAssigned = outStockLockInfos
- .Where(x => x.OrderDetailId == detail.Id && x.StockId == stock.Id)
- .Sum(x => x.AssignQuantity);
-
- var canAssign = Math.Min(detail.LockQuantity - alreadyAssigned, availableAssign);
-
- if (canAssign > 0)
- {
- // 涓鸿繖涓垎閰嶇‘瀹氭潯鐮�
- var (barcode, barcodeQuantity) = GetBarcodeForAllocation(barcodeAllocation, canAssign);
-
- var lockInfo = _outStockLockInfoService.GetOutStockLockInfo(
- outboundOrder, detail, stock, canAssign, barcode);
- outStockLockInfos.Add(lockInfo);
-
- availableAssign -= canAssign;
-
- // 鏇存柊鏉$爜鍒嗛厤璁板綍
- UpdateBarcodeAllocation(barcodeAllocation, barcode, barcodeQuantity);
- }
-
- if (availableAssign <= 0) break;
- }
- }
- }
-
- /// <summary>
- /// 鎸夊厛杩涘厛鍑哄師鍒欏垎閰嶆潯鐮�
- /// </summary>
- private Dictionary<string, decimal> AllocateBarcodes(List<Dt_StockInfoDetail> stockDetails, decimal totalQuantity)
- {
- var allocation = new Dictionary<string, decimal>();
- decimal remainingQuantity = totalQuantity;
-
- foreach (var detail in stockDetails.OrderBy(x => x.ProductionDate))
- {
- if (remainingQuantity <= 0) break;
-
- decimal available = detail.StockQuantity - detail.OutboundQuantity;
- decimal allocate = Math.Min(available, remainingQuantity);
-
- allocation[detail.Barcode] = allocate;
- remainingQuantity -= allocate;
- }
-
- return allocation;
- }
-
- /// <summary>
- /// 涓哄垎閰嶈幏鍙栧悎閫傜殑鏉$爜
- /// </summary>
- private (string barcode, decimal quantity) GetBarcodeForAllocation(Dictionary<string, decimal> barcodeAllocation, decimal requiredQuantity)
- {
- foreach (var (barcode, quantity) in barcodeAllocation)
- {
- if (quantity >= requiredQuantity)
- {
- return (barcode, requiredQuantity);
- }
- }
-
- // 濡傛灉鍗曚釜鏉$爜鏁伴噺涓嶈冻锛屼娇鐢ㄧ涓�涓潯鐮�
- var first = barcodeAllocation.First();
- return (first.Key, Math.Min(first.Value, requiredQuantity));
- }
-
- /// <summary>
- /// 鏇存柊鏉$爜鍒嗛厤璁板綍
- /// </summary>
- private void UpdateBarcodeAllocation(Dictionary<string, decimal> barcodeAllocation, string barcode, decimal usedQuantity)
- {
- if (barcodeAllocation.ContainsKey(barcode))
- {
- barcodeAllocation[barcode] -= usedQuantity;
- if (barcodeAllocation[barcode] <= 0)
- {
- barcodeAllocation.Remove(barcode);
- }
- }
- }
/// <summary>
/// 鍑哄簱搴撳瓨鍒嗛厤鍚庯紝鏇存柊鏁版嵁搴撴暟鎹�
/// </summary>
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundPickingService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundPickingService.cs"
index fafc2a8..cf875b6 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundPickingService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundPickingService.cs"
@@ -1,4 +1,6 @@
-锘縰sing Microsoft.AspNetCore.Http;
+锘縰sing Dm.filter;
+using MailKit.Search;
+using Microsoft.AspNetCore.Http;
using SqlSugar;
using System;
using System.Collections.Generic;
@@ -36,9 +38,10 @@
private readonly IOutboundOrderDetailService _outboundOrderDetailService;
private readonly IOutboundOrderService _outboundOrderService;
private readonly ISplitPackageService _splitPackageService;
+ private readonly IRepository<Dt_Task> _taskRepository;
- public OutboundPickingService(IRepository<Dt_PickingRecord> BaseDal, IUnitOfWorkManage unitOfWorkManage, IStockInfoService stockInfoService, IStockService stockService, IOutStockLockInfoService outStockLockInfoService, IStockInfoDetailService stockInfoDetailService, ILocationInfoService locationInfoService, IOutboundOrderDetailService outboundOrderDetailService, ISplitPackageService splitPackageService, IOutboundOrderService outboundOrderService) : base(BaseDal)
+ public OutboundPickingService(IRepository<Dt_PickingRecord> BaseDal, IUnitOfWorkManage unitOfWorkManage, IStockInfoService stockInfoService, IStockService stockService, IOutStockLockInfoService outStockLockInfoService, IStockInfoDetailService stockInfoDetailService, ILocationInfoService locationInfoService, IOutboundOrderDetailService outboundOrderDetailService, ISplitPackageService splitPackageService, IOutboundOrderService outboundOrderService, IRepository<Dt_Task> taskRepository) : base(BaseDal)
{
_unitOfWorkManage = unitOfWorkManage;
_stockInfoService = stockInfoService;
@@ -49,6 +52,7 @@
_outboundOrderDetailService = outboundOrderDetailService;
_splitPackageService = splitPackageService;
_outboundOrderService = outboundOrderService;
+ _taskRepository = taskRepository;
}
@@ -114,8 +118,7 @@
}
/// <summary>
- /// 鎵爜鎷i�夌‘璁� - 绠�鍖栫増鏈�
- /// 鍙鐞嗗疄闄呮嫞閫夌殑搴撳瓨鎵e噺
+ /// 鎵爜鎷i�夌‘璁�
/// </summary>
public async Task<WebResponseContent> ConfirmPicking(PickingConfirmRequest request)
{
@@ -221,19 +224,20 @@
if (stockDetail == null)
return WebResponseContent.Instance.Error("鏃犳晥鐨勬潯鐮佹垨鐗╂枡缂栫爜");
- // 2. 妫�鏌ュ簱瀛樺彲鐢ㄦ暟閲�
- var availableQty = stockDetail.StockQuantity - stockDetail.OutboundQuantity;
- if (availableQty <= 0)
- return WebResponseContent.Instance.Error("搴撳瓨鏁伴噺涓嶈冻");
+ //// 2. 妫�鏌ュ簱瀛樺彲鐢ㄦ暟閲�
+ //var availableQty = stockDetail.StockQuantity - stockDetail.OutboundQuantity;
+ //if (availableQty <= 0)
+ // return WebResponseContent.Instance.Error("搴撳瓨鏁伴噺涓嶈冻");
// 3. 鏌ユ壘鐩稿叧鐨勫嚭搴撹鎯呬俊鎭�
var outStockInfo = await _outStockLockInfoService.Db.Queryable<Dt_OutStockLockInfo>()
.Where(x => x.OrderNo == orderNo &&
x.PalletCode == palletCode &&
x.CurrentBarcode == barcode &&
- x.Status == 0 &&
- x.RemainQuantity > 0)
+ x.Status == (int)OutLockStockStatusEnum.鍑哄簱涓� &&
+ x.AssignQuantity - x.PickedQty > 0)
.FirstAsync();
+
if (outStockInfo == null)
return WebResponseContent.Instance.Error("鏈壘鍒板搴旂殑鎷i�変俊鎭垨宸叉嫞閫夊畬鎴�");
@@ -244,36 +248,45 @@
// 5. 鏇存柊鍑哄簱璇︽儏鐨勫凡鎷i�夋暟閲�
outStockInfo.PickedQty = outStockInfo.AssignQuantity;
- outStockInfo.Status = 1;
+ outStockInfo.Status = (int)OutLockStockStatusEnum.宸叉嫞閫�;
await _outStockLockInfoService.Db.Updateable(outStockInfo).ExecuteCommandAsync();
- // 6. 鏇存柊搴撳瓨鍑哄簱鏁伴噺
- await _stockInfoDetailService.Db.Updateable<Dt_StockInfoDetail>()
- .SetColumns(x => x.OutboundQuantity == x.OutboundQuantity + outStockInfo.AssignQuantity)
- .Where(x => x.Id == stockDetail.Id)
- .ExecuteCommandAsync();
+ //// 6. 鏇存柊搴撳瓨鍑哄簱鏁伴噺
+ //await _stockInfoDetailService.Db.Updateable<Dt_StockInfoDetail>()
+ // .SetColumns(x => x.OutboundQuantity == x.OutboundQuantity + outStockInfo.AssignQuantity)
+ // .Where(x => x.Id == stockDetail.Id)
+ // .ExecuteCommandAsync();
// 7. 鏇存柊鍑哄簱鍗曟槑缁�
var orderDetail = await _outboundOrderDetailService.Db.Queryable<Dt_OutboundOrderDetail>()
.Where(x => x.Id == outStockInfo.OrderDetailId)
.FirstAsync();
-
- orderDetail.OverOutQuantity += outStockInfo.AssignQuantity;
- await _outboundOrderDetailService.Db.Updateable(orderDetail).ExecuteCommandAsync();
-
+ if (orderDetail != null)
+ {
+ orderDetail.OverOutQuantity += outStockInfo.AssignQuantity;
+ orderDetail.LockQuantity -= outStockInfo.AssignQuantity;
+ await _outboundOrderDetailService.Db.Updateable(orderDetail).ExecuteCommandAsync();
+ }
// 8. 妫�鏌ユ槸鍚﹀畬鎴愬嚭搴�
await CheckAndUpdateOrderStatus(orderNo);
+ //鏌ヨ浠诲姟琛�
+ var task = _taskRepository.QueryData(x => x.OrderNo == orderNo && x.PalletCode == palletCode).FirstOrDefault();
// 9. 璁板綍鎷i�夊巻鍙�
var pickingHistory = new Dt_PickingRecord
{
-
+ FactoryArea = outStockInfo.FactoryArea,
+ TaskNo = task?.TaskNum ?? 0,
+ LocationCode = task?.SourceAddress ?? "",
+ StockId = stockDetail.Id,
OrderNo = orderNo,
+ OrderDetailId = orderDetail?.Id ?? 0,
PalletCode = palletCode,
Barcode = barcode,
MaterielCode = outStockInfo.MaterielCode,
PickQuantity = outStockInfo.AssignQuantity,
PickTime = DateTime.Now,
+ Operator = App.User.UserName,
OutStockLockId = outStockInfo.Id
};
await Db.Insertable(pickingHistory).ExecuteCommandAsync();
@@ -325,7 +338,7 @@
.Where(x => x.OrderNo == orderNo &&
x.PalletCode == palletCode &&
x.CurrentBarcode == barcode &&
- x.Status == 1)
+ x.Status == 2)
.FirstAsync();
if (outStockInfo == null)
@@ -333,14 +346,14 @@
// 杩樺師鍑哄簱璇︽儏鐘舵��
outStockInfo.PickedQty = 0;
- outStockInfo.Status = 0;
+ outStockInfo.Status = 1;
await _outStockLockInfoService.Db.Updateable(outStockInfo).ExecuteCommandAsync();
- // 杩樺師搴撳瓨鍑哄簱鏁伴噺
- await _stockInfoDetailService.Db.Updateable<Dt_StockInfoDetail>()
- .SetColumns(x => x.OutboundQuantity == x.OutboundQuantity - outStockInfo.AssignQuantity)
- .Where(x => x.Barcode == barcode)
- .ExecuteCommandAsync();
+ //// 杩樺師搴撳瓨鍑哄簱鏁伴噺
+ //await _stockInfoDetailService.Db.Updateable<Dt_StockInfoDetail>()
+ // .SetColumns(x => x.OutboundQuantity == x.OutboundQuantity - outStockInfo.AssignQuantity)
+ // .Where(x => x.Barcode == barcode)
+ // .ExecuteCommandAsync();
// 杩樺師鍑哄簱鍗曟槑缁�
var orderDetail = await _outboundOrderDetailService.Db.Queryable<Dt_OutboundOrderDetail>()
@@ -384,10 +397,9 @@
var list = await _outStockLockInfoService.Db.Queryable<Dt_OutStockLockInfo>()
.Where(x => x.OrderNo == orderNo &&
x.PalletCode == palletCode &&
- x.Status == 0 &&
- x.RemainQuantity > 0)
+ x.Status == 1)
.ToListAsync();
- return list;
+ return list.Where(x => x.RemainQuantity > 0).ToList();
}
// 鑾峰彇宸叉嫞閫夊垪琛�
@@ -396,26 +408,68 @@
var list = await _outStockLockInfoService.Db.Queryable<Dt_OutStockLockInfo>()
.Where(x => x.OrderNo == orderNo &&
x.PalletCode == palletCode &&
- x.Status == 1)
+ x.Status == 2)
.ToListAsync();
return list;
}
- // 鑾峰彇鎷i�夋眹鎬�
- public async Task<object> GetPickingSummary(string orderNo)
+
+ public async Task<object> GetPickingSummary(string orderNo, string palletCode)
{
var summary = await _outStockLockInfoService.Db.Queryable<Dt_OutStockLockInfo>()
- .Where(x => x.OrderNo == orderNo && x.Status == 0)
+ .Where(x => x.OrderNo == orderNo &&
+ x.PalletCode == palletCode && x.Status == 1)
.GroupBy(x => new { x.PalletCode, x.MaterielCode })
.Select(x => new
{
PalletCode = x.PalletCode,
MaterielCode = x.MaterielCode,
UnpickedCount = SqlFunc.AggregateCount(x.Id),
- UnpickedQuantity = SqlFunc.AggregateSum(x.RemainQuantity)
+ UnpickedQuantity = SqlFunc.AggregateSum(x.AssignQuantity) - SqlFunc.AggregateSum(x.PickedQty)
})
- .ToListAsync();
+ .FirstAsync();
- return summary;
+ return summary;
+ }
+
+ // 鑾峰彇鎷i�夋眹鎬�
+ public async Task<object> GetPickingSummary(ConfirmPickingDto dto)
+ {
+ var picked = await _outStockLockInfoService.Db.Queryable<Dt_OutStockLockInfo>()
+ .WhereIF(!string.IsNullOrEmpty(dto.OrderNo), x => x.OrderNo == dto.OrderNo)
+ .WhereIF(!string.IsNullOrEmpty(dto.PalletCode), x => x.PalletCode == dto.PalletCode)
+ .Where(x => x.Status == 2)
+ .GroupBy(x => new { x.PalletCode, x.MaterielCode })
+ .Select(x => new SummaryPickingDto
+ {
+ PalletCode = x.PalletCode,
+ MaterielCode = x.MaterielCode,
+ pickedCount = SqlFunc.AggregateCount(x.Id)
+ }).FirstAsync();
+ if (picked == null)
+ {
+ picked = new SummaryPickingDto { pickedCount = 0 };
+ }
+
+ var summary = await _outStockLockInfoService.Db.Queryable<Dt_OutStockLockInfo>()
+ .WhereIF(!string.IsNullOrEmpty(dto.OrderNo), x => x.OrderNo == dto.OrderNo)
+ .WhereIF(!string.IsNullOrEmpty(dto.PalletCode), x => x.PalletCode == dto.PalletCode)
+ .Where(x => x.Status == 1)
+ .GroupBy(x => new { x.PalletCode, x.MaterielCode })
+ .Select(x => new SummaryPickingDto
+ {
+ PalletCode = x.PalletCode,
+ MaterielCode = x.MaterielCode,
+ UnpickedCount = SqlFunc.AggregateCount(x.Id),
+ UnpickedQuantity = SqlFunc.AggregateSum(x.AssignQuantity) - SqlFunc.AggregateSum(x.PickedQty),
+
+ }).FirstAsync();
+ if (summary == null)
+ {
+ summary = new SummaryPickingDto { pickedCount = 0 };
+ }
+ summary.pickedCount = picked.pickedCount;
+
+ return summary;
}
/// <summary>
/// 鑾峰彇鎷i�夊巻鍙�
@@ -587,50 +641,59 @@
{
_unitOfWorkManage.BeginTran();
- // 1. 鑾峰彇鎵樼洏搴撳瓨淇℃伅
var stockInfo = await _stockInfoService.Db.Queryable<Dt_StockInfo>()
.Includes(x => x.Details)
- .Where(x => x.PalletCode == request.PalletCode)
- .FirstAsync();
+ .Where(x => x.PalletCode == request.PalletCode).FirstAsync();
if (stockInfo == null)
return WebResponseContent.Instance.Error("鏈壘鍒版墭鐩樺簱瀛樹俊鎭�");
- // 2. 鑾峰彇鐩稿叧鐨勫嚭搴撻攣瀹氫俊鎭�
+
var lockInfos = await _outStockLockInfoService.Db.Queryable<Dt_OutStockLockInfo>()
- .Where(x => x.PalletCode == request.PalletCode &&
- x.Status == (int)OutLockStockStatusEnum.鍑哄簱涓�)
+ .Where(x => x.OrderNo == request.OrderNo && x.PalletCode == request.PalletCode)
.ToListAsync();
- // 3. 鏁翠釜鎵樼洏鍑哄簱 - 璁剧疆鍑哄簱鏁伴噺绛変簬搴撳瓨鏁伴噺
- foreach (var detail in stockInfo.Details)
- {
- decimal outboundQuantity = detail.StockQuantity - detail.OutboundQuantity;
- detail.OutboundQuantity = detail.StockQuantity; // 鍏ㄩ儴鍑哄簱
- await _stockInfoDetailService.Db.Updateable(detail).ExecuteCommandAsync();
- }
- // 4. 鏇存柊鍑哄簱閿佸畾淇℃伅
foreach (var lockInfo in lockInfos)
{
- decimal unpicked = lockInfo.AssignQuantity - lockInfo.PickedQty;
- lockInfo.PickedQty += unpicked; // 鏍囪涓哄叏閮ㄦ嫞閫�
+ if (lockInfo.Status == (int)OutLockStockStatusEnum.鍑哄簱涓�)
+ {
+ lockInfo.PickedQty = lockInfo.AssignQuantity;
+ }
lockInfo.Status = (int)OutLockStockStatusEnum.宸插嚭搴�;
await _outStockLockInfoService.Db.Updateable(lockInfo).ExecuteCommandAsync();
- // 鏇存柊鍑哄簱鍗曟槑缁�
var orderDetail = await _outboundOrderDetailService.Db.Queryable<Dt_OutboundOrderDetail>()
- .Where(x => x.Id == lockInfo.OrderDetailId)
- .FirstAsync();
- orderDetail.OverOutQuantity += unpicked;
- orderDetail.LockQuantity -= unpicked;
- orderDetail.OrderDetailStatus = (int)OrderDetailStatusEnum.Over;
- orderDetail.LockQuantity = 0;
-
- await _outboundOrderDetailService.Db.Updateable(orderDetail).ExecuteCommandAsync();
+ .Where(x => x.Id == lockInfo.OrderDetailId)
+ .FirstAsync();
+ if (orderDetail != null)
+ {
+ orderDetail.OverOutQuantity += lockInfo.PickedQty;
+ orderDetail.LockQuantity -= lockInfo.PickedQty;
+ orderDetail.OrderDetailStatus = (int)OrderDetailStatusEnum.Over;
+ orderDetail.LockQuantity = 0;
+ await _outboundOrderDetailService.Db.Updateable(orderDetail).ExecuteCommandAsync();
+ }
+ }
+ var groupDetails = lockInfos.GroupBy(x => x.OrderDetailId).Select(x => new
+ {
+ OrderDetailId = x.Key,
+ TotalQuantity = x.Sum(o => o.PickedQty)
+ }).ToList();
+ foreach (var item in groupDetails)
+ {
+ var orderDetail = await _outboundOrderDetailService.Db.Queryable<Dt_OutboundOrderDetail>().Where(x => x.Id == item.OrderDetailId).FirstAsync();
+ if (orderDetail != null)
+ {
+ orderDetail.OverOutQuantity = item.TotalQuantity;
+ orderDetail.LockQuantity = 0;
+ orderDetail.OrderDetailStatus = (int)OrderDetailStatusEnum.Over;
+ await _outboundOrderDetailService.Db.Updateable(orderDetail).ExecuteCommandAsync();
+ }
}
- // 5. 鏇存柊鎷嗗寘璁板綍鐘舵��
+ await CheckAndUpdateOrderStatus(request.OrderNo);
+
var lockInfoIds = lockInfos.Select(x => x.Id).ToList();
var splitRecords = await _splitPackageService.Db.Queryable<Dt_SplitPackageRecord>()
.Where(x => lockInfoIds.Contains(x.OutStockLockInfoId) &&
@@ -643,7 +706,7 @@
await _splitPackageService.Db.Updateable(record).ExecuteCommandAsync();
}
- // 6. 娓呯┖璐т綅
+
var location = await _locationInfoService.Db.Queryable<Dt_LocationInfo>()
.Where(x => x.LocationCode == stockInfo.LocationCode)
.FirstAsync();
@@ -653,6 +716,14 @@
await _locationInfoService.Db.Updateable(location).ExecuteCommandAsync();
}
+ foreach (var detail in stockInfo.Details)
+ {
+ await _stockInfoDetailService.Db.Deleteable(detail).ExecuteCommandAsync();
+ }
+ await _stockInfoService.Db.Deleteable(stockInfo).ExecuteCommandAsync();
+
+
+
_unitOfWorkManage.CommitTran();
return WebResponseContent.Instance.OK("鐩存帴鍑哄簱鎴愬姛");
}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/SplitPackageService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/SplitPackageService.cs"
index 33f0cd7..8d496b8 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/SplitPackageService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_OutboundService/SplitPackageService.cs"
@@ -9,6 +9,7 @@
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
using WIDESEA_DTO.Outbound;
+using WIDESEA_IBasicService;
using WIDESEA_IOutboundService;
using WIDESEA_IStockService;
using WIDESEA_Model.Models;
@@ -23,13 +24,15 @@
private readonly IStockInfoService _stockInfoService;
private readonly IStockInfoDetailService _stockInfoDetailService;
private readonly IOutStockLockInfoService _outStockLockInfoService;
+ private readonly IDailySequenceService _dailySequenceService;
- public SplitPackageService(IRepository<Dt_SplitPackageRecord> BaseDal, IUnitOfWorkManage unitOfWorkManage, IStockInfoService stockInfoService, IOutStockLockInfoService outStockLockInfoService, IStockInfoDetailService stockInfoDetailService) : base(BaseDal)
+ public SplitPackageService(IRepository<Dt_SplitPackageRecord> BaseDal, IUnitOfWorkManage unitOfWorkManage, IStockInfoService stockInfoService, IOutStockLockInfoService outStockLockInfoService, IStockInfoDetailService stockInfoDetailService, IDailySequenceService dailySequenceService) : base(BaseDal)
{
_unitOfWorkManage = unitOfWorkManage;
_stockInfoService = stockInfoService;
_outStockLockInfoService = outStockLockInfoService;
_stockInfoDetailService = stockInfoDetailService;
+ _dailySequenceService = dailySequenceService;
}
/// <summary>
@@ -42,16 +45,16 @@
_unitOfWorkManage.BeginTran();
// 1. 楠岃瘉鍑哄簱閿佸畾淇℃伅
- var lockInfo = await _stockInfoDetailService.Db.Queryable<Dt_OutStockLockInfo>()
+ var lockInfo = await _outStockLockInfoService.Db.Queryable<Dt_OutStockLockInfo>()
.Where(x => x.OrderNo == request.OrderNo &&
x.PalletCode == request.PalletCode &&
x.CurrentBarcode == request.OriginalBarcode &&
- x.Status == 0)
+ x.Status == 1)
.FirstAsync();
if (lockInfo == null)
return WebResponseContent.Instance.Error("鏈壘鍒版湁鏁堢殑鍑哄簱閿佸畾淇℃伅");
-
+
// 2. 妫�鏌ュ墿浣欓攣瀹氭暟閲�
decimal remainingLockQuantity = lockInfo.AssignQuantity - lockInfo.PickedQty;
if (request.SplitQuantity > remainingLockQuantity)
@@ -61,12 +64,14 @@
.Where(x => x.Barcode == request.OriginalBarcode)
.FirstAsync();
+ var seq = await _dailySequenceService.GetNextSequenceAsync();
// 3. 鐢熸垚鏂版潯鐮�
- string newBarcode = "";
+ string newBarcode = "WSLOT" + DateTime.Now.ToString("yyyyMMdd") + seq.ToString()?.PadLeft(5, '0');
// 4. 鍒涘缓鏂扮殑鍑哄簱閿佸畾淇℃伅锛堟柊鏉$爜锛�
var newLockInfo = new Dt_OutStockLockInfo
{
+
OrderNo = lockInfo.OrderNo,
OrderDetailId = lockInfo.OrderDetailId,
BatchNo = lockInfo.BatchNo,
@@ -82,22 +87,28 @@
TaskNum = lockInfo.TaskNum,
Status = (int)OutLockStockStatusEnum.鍑哄簱涓�,
Unit = lockInfo.Unit,
-
+ SupplyCode = lockInfo.SupplyCode,
+ OrderType=lockInfo.OrderType,
CurrentBarcode = newBarcode, // 鏂版潯鐮�
OriginalLockQuantity = request.SplitQuantity,
IsSplitted = 1,
ParentLockId = lockInfo.Id // 璁板綍鐖剁骇閿佸畾ID
};
- await Db.Insertable(newLockInfo).ExecuteCommandAsync();
+ await _outStockLockInfoService.Db.Insertable(newLockInfo).ExecuteCommandAsync();
// 5. 鏇存柊鍘熼攣瀹氫俊鎭殑鍒嗛厤鏁伴噺锛堝噺灏戞媶鍖呮暟閲忥級
lockInfo.AssignQuantity -= request.SplitQuantity;
- await Db.Updateable(lockInfo).ExecuteCommandAsync();
+ await _outStockLockInfoService.Db.Updateable(lockInfo).ExecuteCommandAsync();
// 6. 璁板綍鎷嗗寘鍘嗗彶锛堢敤浜庤拷韪級
var splitHistory = new Dt_SplitPackageRecord
{
+ FactoryArea = lockInfo.FactoryArea,
+ TaskNum=lockInfo.TaskNum,
OutStockLockInfoId = lockInfo.Id,
+ StockId = stockDetail?.StockId ?? 0,
+ Operator = App.User.UserName,
+ IsReverted = false,
OriginalBarcode = lockInfo.CurrentBarcode,
NewBarcode = newBarcode,
SplitQty = request.SplitQuantity,
@@ -110,10 +121,10 @@
};
await Db.Insertable(splitHistory).ExecuteCommandAsync();
- Db.Ado.CommitTran();
+ _unitOfWorkManage.CommitTran();
// 7. 鍥炰紶鏂版潯鐮佺粰MES
- // await SendBarcodeToMES(newBarcode, request.MaterielCode, request.SplitQuantity);
+ // await SendBarcodeToMES(newBarcode, request.MaterielCode, request.SplitQuantity);
return WebResponseContent.Instance.OK("鎷嗗寘鎴愬姛", new
{
@@ -123,7 +134,7 @@
}
catch (Exception ex)
{
- Db.Ado.RollbackTran();
+ _unitOfWorkManage.RollbackTran();
return WebResponseContent.Instance.Error($"鎷嗗寘澶辫触: {ex.Message}");
}
}
@@ -140,66 +151,67 @@
.OrderByDescending(x => x.CreateDate)
.FirstAsync();
- if (splitPackage == null)
- return WebResponseContent.Instance.Error("鏈壘鍒版媶鍖呰褰�");
+ if (splitPackage == null)
+ return WebResponseContent.Instance.Error("鏈壘鍒版媶鍖呰褰�");
- // 妫�鏌ユ柊鏉$爜鏄惁宸叉嫞閫�
- var newOutStockInfo = await _outStockLockInfoService.Db.Queryable<Dt_OutStockLockInfo>()
- .Where(x => x.CurrentBarcode == splitPackage.NewBarcode)
- .FirstAsync();
+ // 妫�鏌ユ柊鏉$爜鏄惁宸叉嫞閫�
+ var newOutStockInfo = await _outStockLockInfoService.Db.Queryable<Dt_OutStockLockInfo>()
+ .Where(x => x.CurrentBarcode == splitPackage.NewBarcode)
+ .FirstAsync();
- if (newOutStockInfo.Status == 1)
- return WebResponseContent.Instance.Error("鏂版潯鐮佸凡鎷i�夛紝鏃犳硶鎾ら攢鎷嗗寘");
+ if (newOutStockInfo.Status == 2)
+ return WebResponseContent.Instance.Error("鏂版潯鐮佸凡鎷i�夛紝鏃犳硶鎾ら攢鎷嗗寘");
- // 杩樺師鍘熷嚭搴撹鎯呮暟閲�
- var originalOutStockInfo = await _outStockLockInfoService.Db.Queryable<Dt_OutStockLockInfo>()
- .Where(x => x.CurrentBarcode == originalBarcode)
- .FirstAsync();
+ // 杩樺師鍘熷嚭搴撹鎯呮暟閲�
+ var originalOutStockInfo = await _outStockLockInfoService.Db.Queryable<Dt_OutStockLockInfo>()
+ .Where(x => x.CurrentBarcode == originalBarcode)
+ .FirstAsync();
- originalOutStockInfo.AssignQuantity += splitPackage.SplitQty;
- await _outStockLockInfoService.Db.Updateable(originalOutStockInfo).ExecuteCommandAsync();
+ originalOutStockInfo.AssignQuantity += splitPackage.SplitQty;
+ await _outStockLockInfoService.Db.Updateable(originalOutStockInfo).ExecuteCommandAsync();
- // 鍒犻櫎鏂板嚭搴撹鎯呰褰�
- await _outStockLockInfoService.Db.Deleteable<Dt_OutStockLockInfo>()
- .Where(x => x.CurrentBarcode == splitPackage.NewBarcode)
- .ExecuteCommandAsync();
+ // 鍒犻櫎鏂板嚭搴撹鎯呰褰�
+ await _outStockLockInfoService.Db.Deleteable<Dt_OutStockLockInfo>()
+ .Where(x => x.CurrentBarcode == splitPackage.NewBarcode)
+ .ExecuteCommandAsync();
- // 鏍囪鎷嗗寘璁板綍涓哄凡鎾ら攢
- splitPackage.IsReverted = true;
- await Db.Updateable(splitPackage).ExecuteCommandAsync();
+ // 鏍囪鎷嗗寘璁板綍涓哄凡鎾ら攢
+ splitPackage.IsReverted = true;
+ await Db.Updateable(splitPackage).ExecuteCommandAsync();
_unitOfWorkManage.CommitTran();
- return WebResponseContent.Instance.OK("鎾ら攢鎷嗗寘鎴愬姛");
-
+ return WebResponseContent.Instance.OK("鎾ら攢鎷嗗寘鎴愬姛");
+
}
catch (Exception ex)
{
- return WebResponseContent.Instance.Error($"鎾ら攢鎷嗗寘澶辫触锛歿ex.Message}");
+ _unitOfWorkManage.RollbackTran();
+ return WebResponseContent.Instance.Error($"鎾ら攢鎷嗗寘澶辫触锛歿ex.Message}");
}
}
// 鑾峰彇鎷嗗寘淇℃伅
- public async Task< WebResponseContent > GetSplitPackageInfo(string orderNo, string palletCode, string barcode)
+ public async Task<WebResponseContent> GetSplitPackageInfo(string orderNo, string palletCode, string barcode)
{
var outStockInfo = await _outStockLockInfoService.Db.Queryable<Dt_OutStockLockInfo>()
.Where(x => x.OrderNo == orderNo &&
x.PalletCode == palletCode &&
x.CurrentBarcode == barcode &&
- x.Status == 0)
+ x.Status == 1)
.FirstAsync();
if (outStockInfo == null)
- return WebResponseContent.Instance .Error("鏈壘鍒板搴旂殑鍑哄簱淇℃伅");
+ return WebResponseContent.Instance.Error("鏈壘鍒板搴旂殑鍑哄簱淇℃伅");
- var stockDetail = await _stockInfoDetailService.Db.Queryable<Dt_StockInfoDetail>()
- .Where(x => x.Barcode == barcode)
- .FirstAsync();
+ //var stockDetail = await _stockInfoDetailService.Db.Queryable<Dt_StockInfoDetail>()
+ // .Where(x => x.Barcode == barcode)
+ // .FirstAsync();
- return WebResponseContent.Instance .OK("",new
+ return WebResponseContent.Instance.OK("", new
{
MaterielCode = outStockInfo.MaterielCode,
RemainQuantity = outStockInfo.RemainQuantity,
- Unit = "涓�" // 鏍规嵁瀹為檯鎯呭喌鑾峰彇鍗曚綅
+ Unit = outStockInfo.Unit
});
}
/// <summary>
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs"
index fd7e47c..efe19b8 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs"
@@ -113,7 +113,7 @@
if (stockTotalQuantity < needQuantity)
{
residueQuantity = needQuantity - stockTotalQuantity;
- // 涓嶆姏鍑哄紓甯革紝鍏佽閮ㄥ垎鍒嗛厤
+
}
else
{
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
index 8113068..596284c 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
@@ -108,6 +108,7 @@
_outStockLockInfoService = outStockLockInfoService;
}
+
/// <summary>
///
/// </summary>
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs"
index e918645..dd1ab98 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs"
@@ -70,7 +70,8 @@
TaskStatus = TaskStatusEnum.New.ObjToInt(),
WarehouseId = stockInfo.WarehouseId,
PalletType = stockInfo.PalletType,
-
+ OrderNo= stockInfo.Details.FirstOrDefault()?.OrderNo
+
};
//绌虹
if (stockInfo.PalletType == PalletTypeEnum.Empty.ObjToInt())
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
index 340a6c3..868259e 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
@@ -164,7 +164,7 @@
tasks = GetTasks(result.Item1, typeEnum);
tasks.ForEach(x =>
{
- x.OrderNo = outboundOrder.UpperOrderNo;
+ x.OrderNo = outboundOrder.OrderNo;
});
result.Item2.ForEach(x =>
{
@@ -331,7 +331,7 @@
// TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
PalletType = stockInfo.PalletType,
WarehouseId = stockInfo.WarehouseId,
-
+
};
//if (taskType != TaskTypeEnum.OutEmpty)
//{
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs"
index f854191..e98db31 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs"
@@ -50,13 +50,14 @@
[HttpPost, Route("Test"), AllowAnonymous, MethodParamsValidate]
public async Task<WebResponseContent> Test()
{
- var purchaseToStockResult = await _materialUnitService.ConvertPurchaseToStockAsync("101001-00002", 10);
+ // var purchaseToStockResult = await _materialUnitService.ConvertPurchaseToStockAsync("101001-00002", 10);
- var pdddurchaseToStockResult = await _materialUnitService.ConvertPurchaseToStockAsync("100513-00210", 10);
+ // var pdddurchaseToStockResult = await _materialUnitService.ConvertPurchaseToStockAsync("100513-00210", 10);
var sddd = _locationInfoService.AssignLocation();
var code = sddd.LocationCode;
- // await _dailySequenceService.GetNextSequenceAsync();
+ //var ssss=await _dailySequenceService.GetNextSequenceAsync();
+ //var ddddssss = "WSLOT" + DateTime.Now.ToString("yyyyMMddHHmmss") + ssss.ToString().PadLeft(5, '0');
//erpApiService.GetSuppliersAsync();
//erpApiService.GetMaterialUnitAsync();
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundPickingController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundPickingController.cs"
index e92783d..a0d02a9 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundPickingController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundPickingController.cs"
@@ -23,7 +23,7 @@
/// <summary>
/// 鑾峰彇鎵樼洏鐨勫嚭搴撶姸鎬�
/// </summary>
- [HttpGet("GetPalletOutboundStatus")]
+ [HttpPost("GetPalletOutboundStatus")]
public async Task<WebResponseContent> GetPalletOutboundStatus(string palletCode)
{
return await Service.GetPalletOutboundStatus(palletCode);
@@ -32,7 +32,7 @@
/// <summary>
/// 鑾峰彇鎵樼洏鐨勯攣瀹氫俊鎭�
/// </summary>
- [HttpGet("GetPalletLockInfos")]
+ [HttpPost("GetPalletLockInfos")]
public async Task<WebResponseContent> GetPalletLockInfos(string palletCode)
{
var lockInfos = await _outStockLockInfoService.GetPalletLockInfos(palletCode);
@@ -41,17 +41,17 @@
- [HttpGet("unpicked-list")]
- public async Task<WebResponseContent> GetUnpickedList(string orderNo, string palletCode)
+ [HttpPost("unpicked-list")]
+ public async Task<WebResponseContent> GetUnpickedList([FromBody] ConfirmPickingDto dto)
{
- var lists= await Service.GetUnpickedList(orderNo, palletCode);
+ var lists= await Service.GetUnpickedList(dto.OrderNo, dto.PalletCode);
return WebResponseContent.Instance.OK("", lists);
}
- [HttpGet("picked-list")]
- public async Task<WebResponseContent> GetPickedList(string orderNo, string palletCode)
+ [HttpPost("picked-list")]
+ public async Task<WebResponseContent> GetPickedList([FromBody] ConfirmPickingDto dto)
{
- var lists = await Service.GetPickedList(orderNo, palletCode);
+ var lists = await Service.GetPickedList(dto.OrderNo, dto.PalletCode);
return WebResponseContent.Instance.OK("", lists);
}
@@ -61,11 +61,48 @@
return await Service.ConfirmPicking(dto.OrderNo, dto.PalletCode, dto.Barcode);
}
- [HttpGet("picking-summary")]
- public async Task<WebResponseContent> GetPickingSummary(string orderNo)
+ [HttpPost("picking-summary")]
+ public async Task<WebResponseContent> GetPickingSummary([FromBody] ConfirmPickingDto dto)
{
- var data = await Service.GetPickingSummary(orderNo);
+ var data = await Service.GetPickingSummary(dto);
return WebResponseContent.Instance.OK("", data);
+ }
+
+ [HttpPost("split-package")]
+ public async Task<WebResponseContent> SplitPackage([FromBody] SplitPackageDto dto)
+ {
+ return await _splitPackageService.SplitPackage(dto);
+
+ }
+
+ [HttpPost("revert-split-package")]
+ public async Task<WebResponseContent> RevertSplitPackage([FromBody] RevertSplitDto dto)
+ {
+ return await _splitPackageService.RevertSplitPackage(dto.OriginalBarcode);
+
+
+ }
+
+ [HttpPost("split-package-info")]
+ public async Task<WebResponseContent> GetSplitPackageInfo([FromBody] ConfirmPickingDto dto)
+ {
+ return await _splitPackageService.GetSplitPackageInfo(dto.OrderNo, dto.PalletCode, dto.Barcode);
+
+ }
+
+
+ [HttpPost("return-to-stock")]
+ public async Task<WebResponseContent> ReturnToStock( )
+ {
+ var data= "";
+ return WebResponseContent.Instance.OK("", data);
+ }
+
+ [HttpPost("direct-outbound")]
+ public async Task<WebResponseContent> DirectOutbound([FromBody] DirectOutboundRequest dto)
+ {
+ return await Service.DirectOutbound(dto);
+
}
///// <summary>
@@ -84,14 +121,7 @@
{
return await Service.ValidateBarcode(barcode);
}
- /// <summary>
- /// 鎷嗗寘鎿嶄綔
- /// </summary>
- [HttpPost("SplitPackage")]
- public async Task<WebResponseContent> SplitPackage([FromBody] SplitPackageDto request)
- {
- return await _splitPackageService.SplitPackage(request);
- }
+
///// <summary>
///// 鐩存帴鍑哄簱
@@ -116,9 +146,9 @@
/// 鎾ら攢鎷i��
/// </summary>
[HttpPost("CancelPicking")]
- public async Task<WebResponseContent> CancelPicking([FromBody] CancelPickingRequest request)
+ public async Task<WebResponseContent> CancelPicking([FromBody] ConfirmPickingDto dto)
{
- return await Service.CancelPicking(request);
+ return await Service.CancelPicking(dto.OrderNo,dto.PalletCode,dto.Barcode);
}
}
}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs"
index 8b54df6..ff1ac1e 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs"
@@ -24,6 +24,7 @@
{
}
+
[HttpPost, Route("PalletOutboundTask"), AllowAnonymous, MethodParamsValidate]
public async Task<WebResponseContent> PalletOutboundTask(string endStation, string palletCode = "")
--
Gitblit v1.9.3