From 5c640ca754afda2ea725e9fed2ff7bac0c62fa23 Mon Sep 17 00:00:00 2001
From: pan <antony1029@163.com>
Date: 星期日, 30 十一月 2025 10:38:46 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu
---
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundPickingController.cs | 31 ++
项目代码/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js | 27 +
项目代码/WIDESEA_WMSClient/package.json | 1
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundPickingService.cs | 211 ++++++++++++++
项目代码/WIDESEA_WMSClient/src/extension/outbound/extend/outOrderDetail.vue | 7
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutboundPickingService.cs | 21 +
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrderDetail.cs | 6
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/NoStockOutModel.cs | 46 +++
项目代码/WIDESEA_WMSClient/config/buttons.js | 10
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrderDetail.cs | 5
项目代码/WIDESEA_WMSClient/src/extension/outbound/extend/NoStockOut.vue | 512 +++++++++++++++++++++++++--------
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/WIDESEA_OutboundService.csproj | 1
12 files changed, 733 insertions(+), 145 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/config/buttons.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/config/buttons.js"
index 67c05e7..11b7c6b 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/config/buttons.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/config/buttons.js"
@@ -180,6 +180,16 @@
onClick: function () {
}
},
+
+{
+ name: "铏氭嫙鍑哄叆搴�",
+ icon: 'el-icon-setting',
+ class: '',
+ value: 'NoStockOut',
+ type: 'success',
+ onClick: function () {
+ }
+},
]
export default buttons
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/package.json" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/package.json"
index e81efa4..d729177 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/package.json"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/package.json"
@@ -16,6 +16,7 @@
"core-js": "^3.6.5",
"echarts": "^5.0.2",
"element-plus": "^2.2.14",
+ "element-ui": "^2.15.14",
"jsbarcode": "^3.11.6",
"less": "^4.1.1",
"qrcode": "^1.5.4",
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/NoStockOut.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/NoStockOut.vue"
index 252da58..d058411 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/NoStockOut.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/NoStockOut.vue"
@@ -5,29 +5,85 @@
:lazy="true"
width="65%"
:padding="20"
- title="鏃犲簱瀛樺嚭搴�"
+ title="铏氭嫙鍑哄叆搴�"
class="custom-vol-box"
>
<div>
+ <!-- 鍗曟嵁閫夋嫨鍖哄煙锛堝彲杈撳叆鎼滅储锛� -->
+ <el-form :inline="true" :model="orderForm" style="margin-bottom: 20px; align-items: flex-end;">
+ <el-form-item label="鍑哄簱鍗曟嵁:" name="outboundOrderId">
+ <el-select
+ v-model="orderForm.outboundOrderId"
+ placeholder="璇烽�夋嫨鎴栨壂鎻忓嚭搴撳崟鎹彿"
+ clearable
+ style="width: 220px; margin-right: 10px;"
+ @change="handleOrderChange"
+ @visible-change="handleOutboundVisibleChange"
+ :loading="loading"
+ filterable
+ :filter-method="filterOutboundOrders"
+ @input="handleOutboundScanInput"
+ ref="outboundSelectRef"
+ >
+ <el-option
+ v-for="order in filteredOutboundOrders"
+ :key="order.id"
+ :label="order.orderNo"
+ :value="order.id"
+ ></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="閲囪喘鍗曟嵁:" name="purchaseOrderId">
+ <el-select
+ v-model="orderForm.purchaseOrderId"
+ placeholder="璇烽�夋嫨鎴栨壂鎻忛噰璐崟鎹彿"
+ clearable
+ style="width: 220px; margin-right: 10px;"
+ @change="handleOrderChange"
+ @visible-change="handlePurchaseVisibleChange"
+ :loading="loading"
+ filterable
+ :filter-method="filterPurchaseOrders"
+ @input="handlePurchaseScanInput"
+ ref="purchaseSelectRef"
+ >
+ <el-option
+ v-for="order in filteredPurchaseOrders"
+ :key="order.id"
+ :label="order.orderNo"
+ :value="order.id"
+ ></el-option>
+ </el-select>
+ </el-form-item>
+ </el-form>
+
<!-- 涓婃柟杈撳叆妗� -->
- <el-form :inline="true" :model="formData" ref="formData" style="margin-bottom: 20px; align-items: flex-end;">
+ <el-form :inline="true" :model="formData" ref="formRef" style="margin-bottom: 20px; align-items: flex-end;">
<el-form-item
label="鎵弿鏉$爜:"
style="width: 80%"
- prop="barcode"
+ name="barcode"
+ :rules="[{ required: true, message: '璇锋壂鎻忔垨杈撳叆鏉$爜', trigger: 'blur' }]"
>
<el-input
- ref="barcodeInput"
+ ref="barcodeInputRef"
v-model="formData.barcode"
placeholder="璇蜂娇鐢ㄦ壂鐮佹灙鎵弿鏉$爜锛屾垨鎵嬪姩杈撳叆"
@keyup.enter="handleScan"
autofocus
class="custom-input"
+ :disabled="!orderForm.outboundOrderId || !orderForm.purchaseOrderId"
></el-input>
</el-form-item>
<el-form-item>
- <el-button type="primary" size="small" @click="handleScan" class="custom-button">
- <i class="el-icon-search"></i> 纭鎵弿
+ <el-button
+ type="primary"
+ size="small"
+ @click="handleScan"
+ class="custom-button"
+ :disabled="!orderForm.outboundOrderId || !orderForm.purchaseOrderId || loading"
+ >
+ <Search /> 纭鎵弿
</el-button>
</el-form-item>
</el-form>
@@ -37,27 +93,23 @@
<el-card shadow="hover" style="margin-bottom: 10px; border: none;" class="custom-card">
<div class="card-header">
<span class="header-title">宸叉壂鎻忔潯鐮佸垪琛紙鍏眥{ scannedBarcodes.length }}鏉★級</span>
- <el-button
- class="clear-all-btn"
- @click="clearAll"
- :disabled="scannedBarcodes.length === 0"
- >娓呯┖鎵�鏈�</el-button>
</div>
<div class="card-body">
<el-scrollbar height="400px" class="custom-scrollbar">
- <!-- 浣跨敤 transition-group 鍖呰9浠ュ疄鐜板姩鐢� -->
<transition-group name="barcode-item-transition">
- <div class="barcode-item" v-for="(barcode, index) in scannedBarcodes" :key="barcode" :data-index="index">
- <span class="barcode-text">{{ index + 1 }}. {{ barcode }}</span>
+ <div class="barcode-item" v-for="(item, index) in scannedBarcodes" :key="item.barcode" :data-index="index">
+ <span class="barcode-text">{{ index + 1 }}. {{ item.barcode }}</span>
<el-button
class="delete-btn"
- @click="removeItem(index)"
- >鍒犻櫎</el-button>
+ @click="removeItem(index, item.barcode)"
+ icon="Delete"
+ circle
+ :disabled="loading"
+ ></el-button>
</div>
</transition-group>
<div class="empty-tip" v-if="scannedBarcodes.length === 0">
- <i class="el-icon-information"></i>
- <span>鏆傛棤鎵弿璁板綍锛岃鎵弿鏉$爜</span>
+ <span>鏆傛棤鎵弿璁板綍锛岃鍏堥�夋嫨鍗曟嵁鍚庢壂鎻忔潯鐮�</span>
</div>
</el-scrollbar>
</div>
@@ -67,10 +119,16 @@
<template #footer>
<div class="footer-actions">
- <el-button type="primary" size="small" @click="submit" :disabled="scannedBarcodes.length === 0" class="submit-btn">
- <i class="el-icon-check"></i> 鎻愪氦鍑哄簱
+ <el-button
+ type="primary"
+ size="small"
+ @click="submit"
+ :disabled="scannedBarcodes.length === 0 || !orderForm.outboundOrderId || !orderForm.purchaseOrderId || loading"
+ class="submit-btn"
+ >
+ <Check /> 鎻愪氦鍑哄簱
</el-button>
- <el-button type="text" size="small" @click="showDetailBox = false" class="cancel-btn">
+ <el-button type="text" size="small" @click="showDetailBox = false" class="cancel-btn" :disabled="loading">
鍙栨秷
</el-button>
</div>
@@ -79,99 +137,307 @@
</div>
</template>
-<script>
+<script setup>
+import { ref, reactive, onMounted, nextTick } from 'vue';
+import { ElMessage } from 'element-plus';
+
import VolBox from "@/components/basic/VolBox.vue";
+import http from '@/api/http';
-export default {
- components: { VolBox },
- data() {
- return {
- showDetailBox: false,
- formData: {
- barcode: "",
- },
- scannedBarcodes: [],
- };
- },
- methods: {
- open() {
- this.showDetailBox = true;
- this.scannedBarcodes = [];
- this.formData.barcode = "";
- this.$nextTick(() => {
- this.$refs.barcodeInput.focus();
- });
- },
+// 鍝嶅簲寮忔暟鎹�
+const showDetailBox = ref(false);
+const orderForm = reactive({
+ outboundOrderId: "",
+ purchaseOrderId: ""
+});
+const formData = reactive({
+ barcode: "",
+});
+const scannedBarcodes = ref([]);
+const outboundOrders = ref([]);
+const purchaseOrders = ref([]);
+const filteredOutboundOrders = ref([]);
+const filteredPurchaseOrders = ref([]);
+const loading = ref(false);
- handleScan() {
- const barcode = this.formData.barcode.trim();
- if (!barcode) {
- this.$refs.barcodeInput.focus();
- return;
- }
- if (this.scannedBarcodes.includes(barcode)) {
- this.$message.warning(`鏉$爜 ${barcode} 宸叉壂鎻忚繃锛岃鍕块噸澶嶆壂鎻廯);
- this.formData.barcode = "";
- this.$refs.barcodeInput.focus();
- return;
- }
+// 妯℃澘寮曠敤
+const formRef = ref(null);
+const barcodeInputRef = ref(null);
+const outboundSelectRef = ref(null); // 鏂板锛氬嚭搴撳崟select鐨剅ef
+const purchaseSelectRef = ref(null); // 鏂板锛氶噰璐崟select鐨剅ef
- this.scannedBarcodes.push(barcode);
- this.formData.barcode = "";
+// 鐢ㄤ簬闃叉杈撳叆浜嬩欢鍜宑hange浜嬩欢鍐茬獊鐨勯攣
+const isProcessingScan = ref(false);
- this.$nextTick(() => {
- this.$refs.barcodeInput.focus();
- });
- },
+// 缁勪欢鎸傝浇鏃跺垵濮嬪寲杩囨护鍚庣殑鍒楄〃
+onMounted(() => {
+ filteredOutboundOrders.value = [...outboundOrders.value];
+ filteredPurchaseOrders.value = [...purchaseOrders.value];
+});
- removeItem(index) {
- this.scannedBarcodes.splice(index, 1);
- },
-
- clearAll() {
- this.$confirm("纭畾瑕佹竻绌烘墍鏈夋壂鎻忚褰曞悧锛�", "鎻愮ず", {
- confirmButtonText: "纭畾",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- }).then(() => {
- this.scannedBarcodes = [];
- }).catch(() => {
- this.$refs.barcodeInput.focus();
- });
- },
-
- submit() {
- if (this.scannedBarcodes.length === 0) {
- this.$message.warning("璇峰厛鎵弿鑷冲皯涓�鏉℃潯鐮�");
- this.$refs.barcodeInput.focus();
- return;
- }
-
- const params = {
- barcodes: this.scannedBarcodes,
- };
-
- this.http
- .post("/api/OutboundOrder/NoStockOut", params, "鏁版嵁澶勭悊涓�...")
- .then((res) => {
- if (!res.status) {
- this.$message.error(res.message);
- this.$refs.barcodeInput.focus();
- return;
- }
- this.$message.success("鍑哄簱鎴愬姛");
- this.showDetailBox = false;
- this.$emit("parentCall", ($vue) => {
- $vue.refresh();
- });
- })
- .catch((err) => {
- this.$message.error(`璇锋眰澶辫触锛�${err.message || "鏈煡閿欒"}`);
- this.$refs.barcodeInput.focus();
- });
- },
- },
+// 鎵撳紑寮圭獥
+const open = () => {
+ showDetailBox.value = true;
+ scannedBarcodes.value = [];
+ formData.barcode = "";
+ orderForm.outboundOrderId = "";
+ orderForm.purchaseOrderId = "";
+ nextTick(() => {
+ barcodeInputRef.value?.focus();
+ });
};
+
+// 鍔犺浇鍑哄簱鍗曟嵁鍒楄〃
+const loadOutboundOrders = async () => {
+ if (outboundOrders.value.length > 0) return;
+ try {
+ loading.value = true;
+ const res = await http.get("/api/OutboundPicking/GetAvailablePickingOrders");
+
+ if (res.code === 0) {
+ outboundOrders.value = res.data.map(orderNo => ({
+ id: orderNo,
+ orderNo: orderNo
+ }));
+ filteredOutboundOrders.value = [...outboundOrders.value];
+ } else {
+ ElMessage.error("鍔犺浇鍑哄簱鍗曟嵁澶辫触锛�" + (res.message || '鏈煡閿欒'));
+ }
+ } catch (error) {
+ ElMessage.error("鍔犺浇鍑哄簱鍗曟嵁寮傚父锛�" + error.message);
+ } finally {
+ loading.value = false;
+ }
+};
+
+// 鍔犺浇閲囪喘鍗曟嵁鍒楄〃
+const loadPurchaseOrders = async () => {
+ if (purchaseOrders.value.length > 0) return;
+ try {
+ loading.value = true;
+ const res = await http.get("/api/OutboundPicking/GetAvailablePurchaseOrders");
+
+ if (res.status === true) {
+ purchaseOrders.value = res.data.map(orderNo => ({
+ id: orderNo,
+ orderNo: orderNo
+ }));
+ filteredPurchaseOrders.value = [...purchaseOrders.value];
+ } else {
+ ElMessage.error("鍔犺浇閲囪喘鍗曟嵁澶辫触锛�" + (res.message || '鏈煡閿欒'));
+ }
+ } catch (error) {
+ ElMessage.error("鍔犺浇閲囪喘鍗曟嵁寮傚父锛�" + error.message);
+ } finally {
+ loading.value = false;
+ }
+};
+
+// 鍑哄簱鍗曟嵁杩囨护鏂规硶
+const filterOutboundOrders = (value) => {
+ if (!value) {
+ filteredOutboundOrders.value = [...outboundOrders.value];
+ } else {
+ const lowerValue = value.toLowerCase();
+ filteredOutboundOrders.value = outboundOrders.value.filter(order =>
+ order.orderNo.toLowerCase().includes(lowerValue)
+ );
+ }
+};
+
+// 閲囪喘鍗曟嵁杩囨护鏂规硶
+const filterPurchaseOrders = (value) => {
+ if (!value) {
+ filteredPurchaseOrders.value = [...purchaseOrders.value];
+ } else {
+ const lowerValue = value.toLowerCase();
+ filteredPurchaseOrders.value = purchaseOrders.value.filter(order =>
+ order.orderNo.toLowerCase().includes(lowerValue)
+ );
+ }
+};
+
+// 鍑哄簱鍗曟嵁涓嬫媺妗嗘樉绀�/闅愯棌鏃惰Е鍙�
+const handleOutboundVisibleChange = (visible) => {
+ if (visible) {
+ loadOutboundOrders();
+ } else {
+ // 褰撲笅鎷夋鍏抽棴鏃讹紝濡傛灉鏄壂鎻忔搷浣滃鑷寸殑锛屾竻绌鸿緭鍏ユ
+ if (isProcessingScan.value) {
+ nextTick(() => {
+ outboundSelectRef.value?.clearInput();
+ isProcessingScan.value = false;
+ });
+ }
+ }
+};
+
+// 閲囪喘鍗曟嵁涓嬫媺妗嗘樉绀�/闅愯棌鏃惰Е鍙�
+const handlePurchaseVisibleChange = (visible) => {
+ if (visible) {
+ loadPurchaseOrders();
+ } else {
+ // 褰撲笅鎷夋鍏抽棴鏃讹紝濡傛灉鏄壂鎻忔搷浣滃鑷寸殑锛屾竻绌鸿緭鍏ユ
+ if (isProcessingScan.value) {
+ nextTick(() => {
+ purchaseSelectRef.value?.clearInput();
+ isProcessingScan.value = false;
+ });
+ }
+ }
+};
+
+// 鍗曟嵁閫夋嫨鍙樺寲鏃惰Е鍙�
+const handleOrderChange = () => {
+ // 濡傛灉鏄墜鍔ㄩ�夋嫨锛屽垯涓嶆竻绌鸿緭鍏ユ
+ isProcessingScan.value = false;
+
+ scannedBarcodes.value = [];
+ nextTick(() => {
+ barcodeInputRef.value?.focus();
+ });
+};
+
+/**
+ * 澶勭悊鍑哄簱鍗曟壂鎻忚緭鍏�
+ * @param {string} scanText - 鎵弿鏋緭鍏ョ殑鏂囨湰
+ */
+const handleOutboundScanInput = async (scanText) => {
+ // 閬垮厤澶勭悊绌哄瓧绗︿覆鎴栫敱change浜嬩欢瑙﹀彂鐨勫唴閮ㄦ搷浣�
+ if (!scanText || isProcessingScan.value) return;
+
+ // 鏌ユ壘瀹屽叏鍖归厤鐨勮鍗�
+ const matchedOrder = outboundOrders.value.find(order => order.orderNo === scanText);
+
+ if (matchedOrder) {
+ isProcessingScan.value = true; // 鏍囪涓烘鍦ㄥ鐞嗘壂鎻�
+ // 鎵嬪姩璧嬪��
+ orderForm.outboundOrderId = matchedOrder.id;
+ ElMessage.success(`鎴愬姛閫夋嫨鍑哄簱鍗曪細${matchedOrder.orderNo}`);
+
+ // 寤惰繜鑱氱劍鍒颁笅涓�涓緭鍏ユ锛岀‘淇濊祴鍊煎畬鎴�
+ setTimeout(() => {
+ purchaseSelectRef.value?.focus();
+ }, 100);
+ }
+ // 濡傛灉娌℃湁鍖归厤椤癸紝涓嶅仛浠讳綍浜嬶紝璁〆l-select淇濇寔杩囨护鐘舵�侊紝鐢ㄦ埛鍙互鎵嬪姩閫夋嫨
+};
+
+/**
+ * 澶勭悊閲囪喘鍗曟壂鎻忚緭鍏�
+ * @param {string} scanText - 鎵弿鏋緭鍏ョ殑鏂囨湰
+ */
+const handlePurchaseScanInput = async (scanText) => {
+ if (!scanText || isProcessingScan.value) return;
+
+ const matchedOrder = purchaseOrders.value.find(order => order.orderNo === scanText);
+
+ if (matchedOrder) {
+ isProcessingScan.value = true; // 鏍囪涓烘鍦ㄥ鐞嗘壂鎻�
+ orderForm.purchaseOrderId = matchedOrder.id;
+ ElMessage.success(`鎴愬姛閫夋嫨閲囪喘鍗曪細${matchedOrder.orderNo}`);
+
+ setTimeout(() => {
+ barcodeInputRef.value?.focus();
+ }, 100);
+ }
+};
+
+
+// 鎵弿鏉$爜澶勭悊
+const handleScan = async () => {
+ if (!formRef.value) return;
+ await formRef.value.validateField('barcode');
+
+ const barcode = formData.barcode.trim();
+
+ if (scannedBarcodes.value.some(item => item.barcode === barcode)) {
+ ElMessage.warning(`鏉$爜 ${barcode} 宸叉壂鎻忚繃锛岃鍕块噸澶嶆壂鎻廯);
+ formData.barcode = "";
+ nextTick(() => barcodeInputRef.value?.focus());
+ return;
+ }
+
+ try {
+ loading.value = true;
+ const res = await http.post("/api/OutboundPicking/BarcodeValidate", {
+ outOder: orderForm.outboundOrderId,
+ inOder: orderForm.purchaseOrderId,
+ barCode: barcode
+ });
+
+ if (res.status === true) {
+ scannedBarcodes.value.push({ barcode });
+ ElMessage.success("鎵弿鎴愬姛");
+ formData.barcode = "";
+ } else {
+ ElMessage.error("鎵弿澶辫触锛�" + (res.message || '楠岃瘉澶辫触'));
+ }
+ } catch (error) {
+ ElMessage.error("鎵弿楠岃瘉寮傚父锛�" + error.message);
+ } finally {
+ loading.value = false;
+ nextTick(() => barcodeInputRef.value?.focus());
+ }
+};
+
+// 绉婚櫎鍗曟潯鎵弿璁板綍
+const removeItem = async (index, barcode) => {
+ try {
+ loading.value = true;
+ const res = await http.post("/api/OutboundPicking/DeleteBarcode", {
+ outOder: orderForm.outboundOrderId,
+ inOder: orderForm.purchaseOrderId,
+ barCode: barcode
+ });
+
+ if (res.status === true) {
+ scannedBarcodes.value.splice(index, 1);
+ ElMessage.success("鍒犻櫎鎴愬姛");
+ } else {
+ ElMessage.error("鍒犻櫎澶辫触锛�" + (res.message || '鍒犻櫎澶辫触'));
+ }
+ } catch (error) {
+ ElMessage.error("鍒犻櫎鏉$爜寮傚父锛�" + error.message);
+ } finally {
+ loading.value = false;
+ }
+};
+
+// 鎻愪氦鍑哄簱
+const submit = async () => {
+ if (scannedBarcodes.value.length === 0) {
+ ElMessage.warning("璇峰厛鎵弿鑷冲皯涓�鏉℃潯鐮�");
+ return;
+ }
+
+ const barcodes = scannedBarcodes.value.map(item => item.barcode);
+
+ try {
+ loading.value = true;
+ const res = await http.post("/api/OutboundPicking/NoStockOutSubmit", {
+ OutOderSubmit: orderForm.outboundOrderId,
+ InOderSubmit: orderForm.purchaseOrderId,
+ BarCodeSubmit: barcodes
+ });
+
+ if (res.status === true) {
+ ElMessage.success("鍑哄簱鎻愪氦鎴愬姛");
+ showDetailBox.value = false;
+ } else {
+ ElMessage.error("鍑哄簱鎻愪氦澶辫触锛�" + (res.message || '鎻愪氦澶辫触'));
+ }
+ } catch (error) {
+ ElMessage.error("鍑哄簱鎻愪氦寮傚父锛�" + error.message);
+ } finally {
+ loading.value = false;
+ }
+};
+
+// 鏆撮湶缁欑埗缁勪欢鐨勬柟娉�
+defineExpose({
+ open
+});
</script>
<style scoped>
@@ -219,31 +485,22 @@
font-size: 15px;
color: #333;
}
-.clear-all-btn {
- color: #f56c6c;
- font-size: 13px;
- transition: color 0.2s;
-}
-.clear-all-btn:hover {
- color: #e53e3e;
- background: rgba(245, 108, 108, 0.1);
-}
.card-body {
padding: 0;
}
/* 鑷畾涔夋粴鍔ㄦ潯 */
-.custom-scrollbar ::v-deep .el-scrollbar__thumb {
+.custom-scrollbar :deep(.el-scrollbar__thumb) {
background: rgba(0, 0, 0, 0.2);
border-radius: 4px;
width: 4px;
}
-.custom-scrollbar ::v-deep .el-scrollbar__bar:hover .el-scrollbar__thumb {
+.custom-scrollbar :deep(.el-scrollbar__bar:hover .el-scrollbar__thumb) {
background: rgba(0, 0, 0, 0.3);
width: 6px;
}
-.custom-scrollbar ::v-deep .el-scrollbar__wrap {
+.custom-scrollbar :deep(.el-scrollbar__wrap) {
overflow-x: hidden;
}
@@ -260,7 +517,7 @@
}
/* 涓哄鏁拌娣诲姞杞诲井鐨勮儗鏅壊锛屽寮哄彲璇绘�� */
.barcode-item:nth-child(odd) {
- background-color: #e1e1e1;
+ background-color: #f9f9f9;
}
.barcode-text {
flex: 1;
@@ -274,16 +531,15 @@
.delete-btn {
color: #ea1919;
- font-size: 20px;
+ font-size: 16px;
transition: all 0.2s;
- transform: scale(0.8);
+ opacity: 0.7;
}
.barcode-item:hover .delete-btn {
opacity: 1;
- transform: scale(1);
}
.delete-btn:hover {
- color: #f56c6c !important; /* 浣跨敤 !important 瑕嗙洊 Element UI 榛樿鏍峰紡 */
+ color: #f56c6c !important;
background: rgba(245, 108, 108, 0.1);
}
@@ -296,22 +552,22 @@
flex-direction: column;
align-items: center;
justify-content: center;
+ gap: 15px;
}
.empty-tip i {
font-size: 40px;
- margin-bottom: 15px;
color: #dcdfe6;
}
/* 鑷畾涔夎緭鍏ユ */
-.custom-input ::v-deep .el-input__inner {
+.custom-input :deep(.el-input__inner) {
border-radius: 6px;
border-color: #e4e7ed;
transition: all 0.3s;
height: 36px;
line-height: 36px;
}
-.custom-input ::v-deep .el-input__inner:focus {
+.custom-input :deep(.el-input__inner:focus) {
border-color: #409eff;
box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.1);
}
@@ -355,7 +611,7 @@
</style>
<style>
-/* ... (鍏ㄥ眬鏍峰紡閮ㄥ垎淇濇寔涓嶅彉) ... */
+/* 鍏ㄥ眬鏍峰紡閮ㄥ垎淇濇寔涓嶅彉 */
.text-button:hover {
background-color: #f0f9eb !important;
}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/outOrderDetail.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/outOrderDetail.vue"
index 75e3cfb..ab7d308 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/outOrderDetail.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/extend/outOrderDetail.vue"
@@ -217,13 +217,6 @@
icon: "el-icon-s-grid",
},
{
- prop: "NoStockOut",
- title: "鏃犲簱瀛樺嚭搴�",
- type: "icon",
- width: 100,
- icon: "el-icon-setting",
- },
- {
prop: "viewDetail",
title: "鍑哄簱璇︾粏",
type: "icon",
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js"
index 6183f76..361b25c 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js"
@@ -5,10 +5,11 @@
import { ElDialog, ElForm, ElFormItem, ElInput, ElButton, ElMessage, ElSelect, ElOption } from 'element-plus';
import gridBody from './extend/outOrderDetail.vue'
+import gridHeader from './extend/NoStockOut.vue'
let extension = {
components: {
//鏌ヨ鐣岄潰鎵╁睍缁勪欢
- gridHeader: '',
+ gridHeader: gridHeader,
gridBody: gridBody,
gridFooter: '',
//鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢
@@ -326,6 +327,13 @@
this.$refs.gridBody.open(row);
}
});
+ let TaskHandCompletedBtn = this.buttons.find(x => x.value == 'NoStockOut');
+ if (TaskHandCompletedBtn) {
+ TaskHandCompletedBtn.onClick = function () {
+ this.$refs.gridHeader.open();
+ }
+ }
+
},
onInited() {
//妗嗘灦鍒濆鍖栭厤缃悗
@@ -335,15 +343,16 @@
searchBefore(param) {
//鐣岄潰鏌ヨ鍓�,鍙互缁檖aram.wheres娣诲姞鏌ヨ鍙傛暟
//杩斿洖false锛屽垯涓嶄細鎵ц鏌ヨ
-
- let wheres = [{
- 'name': 'orderType',
- 'value': '0',
- 'displayType': 'text'}];
-
- param.wheres.push(...wheres);
- return true;
+ let wheres = [{
+ 'name': 'orderType',
+ 'value': '0',
+ 'displayType': 'text'
+ }];
+
+
+ param.wheres.push(...wheres);
+ return true;
return true;
},
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 3f76b5e..56b1b45 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"
@@ -25,6 +25,27 @@
Task<WebResponseContent> ConfirmPicking(string orderNo, string palletCode, string barcode);
Task<WebResponseContent> ReturnRemaining(string orderNo, string palletCode, string reason);
+ /// <summary>
+ /// 鍗曟嵁鏌ユ壘
+ /// </summary>
+ /// <returns></returns>
+ WebResponseContent GetAvailablePurchaseOrders();
+ WebResponseContent GetAvailablePickingOrders();
+
+ /// <summary>
+ /// 鎵爜楠岃瘉
+ /// </summary>
+ WebResponseContent BarcodeValidate(NoStockOutModel noStockOut);
+ /// <summary>
+ /// 鏉$爜鍒犻櫎
+ /// </summary>
+ /// <param name="noStockOut"></param>
+ /// <returns></returns>
+ WebResponseContent DeleteBarcode(NoStockOutModel noStockOut);
+
+ WebResponseContent NoStockOutSubmit(NoStockOutSubmit noStockOutSubmit);
+
Task<WebResponseContent> RemoveEmptyPallet(string orderNo, string palletCode);
+
}
}
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/Inbound/Dt_InboundOrderDetail.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/Inbound/Dt_InboundOrderDetail.cs"
index 92661a4..6f5a669 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/Inbound/Dt_InboundOrderDetail.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/Inbound/Dt_InboundOrderDetail.cs"
@@ -140,5 +140,10 @@
/// </summary>
[SugarColumn(IsNullable = true, ColumnDescription = "澶囨敞")]
public string Remark { get; set; }
+
+ /// <summary>
+ /// 铏氭嫙鍑哄叆搴撴暟閲�
+ /// </summary>
+ public decimal NoStockOutQty { get; set; }
}
}
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_OutboundOrderDetail.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_OutboundOrderDetail.cs"
index 95fcf3b..58e3fa1 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_OutboundOrderDetail.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_OutboundOrderDetail.cs"
@@ -149,5 +149,11 @@
public decimal AllocatedQuantity { get; set; }
public string BatchAllocateStatus { get; set; }
+
+ /// <summary>
+ /// 铏氭嫙鍑哄叆搴撴暟閲�
+ /// </summary>
+ public decimal NoStockOutQty { get; set; }
+
}
}
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/NoStockOutModel.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/NoStockOutModel.cs"
new file mode 100644
index 0000000..6ebc3ff
--- /dev/null
+++ "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/NoStockOutModel.cs"
@@ -0,0 +1,46 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEA_Model.Models
+{
+ /// <summary>
+ /// 铏氭嫙鍑哄叆搴撳疄浣撶被
+ /// </summary>
+ public class NoStockOutModel
+ {
+ /// <summary>
+ /// 鍏ュ簱鍗�
+ /// </summary>
+ public string inOder { get; set; }
+ /// <summary>
+ /// 鍑哄簱鍗�
+ /// </summary>
+ public string outOder { get; set; }
+ /// <summary>
+ /// 鏉$爜
+ /// </summary>
+ public string barCode { get; set; }
+ }
+ /// <summary>
+ /// 鎻愪氦鍑哄簱瀹炰綋绫�
+ /// </summary>
+ public class NoStockOutSubmit
+ {
+ /// <summary>
+ /// 鎻愪氦鍏ュ簱鍗�
+ /// </summary>
+ public string InOderSubmit { get; set; }
+ /// <summary>
+ /// 鎻愪氦鍑哄簱鍗�
+ /// </summary>
+ public string OutOderSubmit { get; set; }
+ /// <summary>
+ /// 鎻愪氦鏉$爜闆嗗悎
+ /// </summary>
+ public List<string> BarCodeSubmit { get; set; }
+ }
+
+}
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 be0de12..27b0b60 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"
@@ -26,6 +26,7 @@
using WIDESEA_DTO.Outbound;
using WIDESEA_IAllocateService;
using WIDESEA_IBasicService;
+using WIDESEA_IInboundService;
using WIDESEA_IOutboundService;
using WIDESEA_IStockService;
using WIDESEA_Model.Models;
@@ -53,6 +54,9 @@
private readonly IInvokeMESService _invokeMESService;
private readonly IDailySequenceService _dailySequenceService;
private readonly IAllocateService _allocateService;
+ private readonly IRepository<Dt_InboundOrder> _inboundOrderRepository;
+ private readonly IInboundOrderDetailService _inboundOrderDetailService;
+
private readonly ILogger<OutboundPickingService> _logger;
@@ -73,7 +77,7 @@
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, IESSApiService eSSApiService, ILogger<OutboundPickingService> logger, IInvokeMESService invokeMESService, IDailySequenceService dailySequenceService, IAllocateService allocateService) : base(BaseDal)
+ IRepository<Dt_Task> taskRepository, IESSApiService eSSApiService, ILogger<OutboundPickingService> logger, IInvokeMESService invokeMESService, IDailySequenceService dailySequenceService, IAllocateService allocateService, IRepository<Dt_InboundOrder> inboundOrderRepository,IInboundOrderDetailService inboundOrderDetailService) : base(BaseDal)
{
_unitOfWorkManage = unitOfWorkManage;
_stockInfoService = stockInfoService;
@@ -90,6 +94,8 @@
_invokeMESService = invokeMESService;
_dailySequenceService = dailySequenceService;
_allocateService = allocateService;
+ _inboundOrderRepository = inboundOrderRepository;
+ _inboundOrderDetailService = inboundOrderDetailService;
}
@@ -2395,9 +2401,212 @@
return WebResponseContent.Instance.OK("鎷i�夌‘璁ゆ垚鍔�", new { SplitResults = new List<SplitResult>() });
}
+
+
+ #region 铏氭嫙鍑哄叆搴�
+ public WebResponseContent GetAvailablePurchaseOrders()
+ {
+ List<Dt_InboundOrder> InOders = _inboundOrderRepository.QueryData().Where(x => x.OrderStatus != InOrderStatusEnum.鍏ュ簱瀹屾垚.ObjToInt()).ToList();
+ List<string> InOderCodes = InOders.Select(x => x.UpperOrderNo).ToList();
+ return WebResponseContent.Instance.OK("鎴愬姛",data: InOderCodes);
+ }
+
+ public WebResponseContent GetAvailablePickingOrders()
+ {
+ List<Dt_OutboundOrder> outOders = _outboundOrderService.Db.Queryable<Dt_OutboundOrder>().Where(x => x.OrderStatus != OutOrderStatusEnum.鍑哄簱瀹屾垚.ObjToInt()).ToList();
+
+ List<string> outOderCodes = outOders.Select(x => x.UpperOrderNo).ToList();
+ return WebResponseContent.Instance.OK("鎴愬姛", data: outOderCodes);
+
+ }
+ public WebResponseContent BarcodeValidate(NoStockOutModel noStockOut)
+ {
+ try
+ {
+ Dt_InboundOrder inboundOrder = Db.Queryable<Dt_InboundOrder>().Where(x => x.UpperOrderNo == noStockOut.inOder && x.OrderStatus != InOrderStatusEnum.鍏ュ簱瀹屾垚.ObjToInt()).Includes(x => x.Details).First();
+ if(inboundOrder == null)
+ {
+ return WebResponseContent.Instance.Error($"鏈壘鍒伴噰璐崟锛歿noStockOut.inOder}");
+ }
+ var matchedDetail = inboundOrder.Details.FirstOrDefault(detail => detail.Barcode == noStockOut.barCode && detail.OrderDetailStatus != OrderDetailStatusEnum.Over.ObjToInt());
+
+ if (matchedDetail == null)
+ {
+ return WebResponseContent.Instance.Error($"鍦ㄩ噰璐崟 {noStockOut.inOder} 涓湭鎵惧埌鏉$爜涓� {noStockOut.barCode} 鐨勬槑缁嗐��");
+ }
+ matchedDetail.NoStockOutQty = 0;
+
+ Dt_OutboundOrder outboundOrder = Db.Queryable<Dt_OutboundOrder>().Where(x => x.UpperOrderNo == noStockOut.outOder && x.OrderStatus != OutOrderStatusEnum.鍑哄簱瀹屾垚.ObjToInt()).Includes(x => x.Details).First();
+ if (outboundOrder == null)
+ {
+ return WebResponseContent.Instance.Error($"鏈壘鍒板嚭搴撳崟锛歿noStockOut.inOder}");
+ }
+ var matchedCode = outboundOrder.Details.FirstOrDefault(detail => detail.MaterielCode == matchedDetail.MaterielCode && detail.OrderDetailStatus != OrderDetailStatusEnum.Over.ObjToInt());
+
+ if (matchedCode == null)
+ {
+ return WebResponseContent.Instance.Error($"鍦ㄥ嚭搴撳崟鐨勭墿鏂欑紪鐮佷腑鏈壘鍒颁笌閲囪喘鍗曚腑鐨剓matchedDetail.MaterielCode} 瀵瑰簲鐨勭墿鏂欍��");
+ }
+ matchedCode.NoStockOutQty = 0;
+
+ //鍓╀綑鍏ュ簱鏁伴噺鍗宠櫄鎷熷嚭鍏ュ簱鍓╀綑鍙嚭鏁伴噺
+ decimal outQuantity = matchedDetail.OrderQuantity - matchedDetail.ReceiptQuantity;
+ if(outQuantity == 0)
+ {
+ return WebResponseContent.Instance.Error($"璇ラ噰璐崟涓殑鏉$爜瀵瑰簲鐨勫彲鍑烘暟閲忎负0");
+ }
+ if (matchedCode.OrderQuantity < outQuantity)
+ {
+ return WebResponseContent.Instance.Error($"璇ラ噰璐崟涓殑鏉$爜瀵瑰簲鐨勫彲鍑烘暟閲忚秴鍑哄嚭搴撳崟鍑哄簱鏁伴噺{matchedDetail.OrderQuantity - matchedCode.OrderQuantity},涓嶆弧瓒虫暣鍖呭嚭搴�");
+ }
+ //鍗曟嵁鍑哄簱閿佸畾鏁伴噺
+ matchedDetail.NoStockOutQty += outQuantity;
+ matchedCode.NoStockOutQty += outQuantity;
+
+ if ((matchedCode.LockQuantity + matchedCode.NoStockOutQty) > matchedCode.OrderQuantity)
+ {
+ return WebResponseContent.Instance.Error($"鍑哄簱鍗曟槑缁嗘暟閲忔孩鍑簕matchedCode.LockQuantity - matchedCode.OrderQuantity}");
+ }
+ matchedDetail.OrderDetailStatus = OrderDetailStatusEnum.Inbounding.ObjToInt();
+ matchedCode.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt();
+
+ _unitOfWorkManage.BeginTran();
+ _inboundOrderDetailService.UpdateData(matchedDetail);
+ _outboundOrderDetailService.UpdateData(matchedCode);
+ _unitOfWorkManage.CommitTran();
+ return WebResponseContent.Instance.OK();
+ }
+ catch(Exception ex)
+ {
+ _unitOfWorkManage.RollbackTran();
+ return WebResponseContent.Instance.Error(ex.Message);
+ }
+ }
+
+
+ public WebResponseContent DeleteBarcode(NoStockOutModel noStockOut)
+ {
+ try
+ {
+ Dt_InboundOrder inboundOrder = Db.Queryable<Dt_InboundOrder>().Where(x => x.UpperOrderNo == noStockOut.inOder && x.OrderStatus != InOrderStatusEnum.鍏ュ簱瀹屾垚.ObjToInt()).Includes(x => x.Details).First();
+ if (inboundOrder == null)
+ {
+ return WebResponseContent.Instance.Error($"鏈壘鍒伴噰璐崟锛歿noStockOut.inOder}");
+ }
+ var matchedDetail = inboundOrder.Details.FirstOrDefault(detail => detail.Barcode == noStockOut.barCode && detail.OrderDetailStatus != OrderDetailStatusEnum.Over.ObjToInt());
+
+ if (matchedDetail == null)
+ {
+ return WebResponseContent.Instance.Error($"鍦ㄩ噰璐崟 {noStockOut.inOder} 涓湭鎵惧埌鏉$爜涓� {noStockOut.barCode} 鐨勬槑缁嗐��");
+ }
+ matchedDetail.NoStockOutQty = 0;
+
+ Dt_OutboundOrder outboundOrder = Db.Queryable<Dt_OutboundOrder>().Where(x => x.UpperOrderNo == noStockOut.outOder && x.OrderStatus != OutOrderStatusEnum.鍑哄簱瀹屾垚.ObjToInt()).Includes(x => x.Details).First();
+ if (outboundOrder == null)
+ {
+ return WebResponseContent.Instance.Error($"鏈壘鍒板嚭搴撳崟锛歿noStockOut.inOder}");
+ }
+ var matchedCode = outboundOrder.Details.FirstOrDefault(detail => detail.MaterielCode == matchedDetail.MaterielCode && detail.OrderDetailStatus != OrderDetailStatusEnum.Over.ObjToInt());
+
+ if (matchedCode == null)
+ {
+ return WebResponseContent.Instance.Error($"鍦ㄥ嚭搴撳崟鐨勭墿鏂欑紪鐮佷腑鏈壘鍒颁笌閲囪喘鍗曚腑鐨剓matchedDetail.MaterielCode} 瀵瑰簲鐨勭墿鏂欍��");
+ }
+ matchedCode.NoStockOutQty = 0;
+ _unitOfWorkManage.BeginTran();
+ _inboundOrderDetailService.UpdateData(matchedDetail);
+ _outboundOrderDetailService.UpdateData(matchedCode);
+ _unitOfWorkManage.CommitTran();
+ return WebResponseContent.Instance.OK();
+
+ }
+ catch(Exception ex)
+ {
+ _unitOfWorkManage.RollbackTran();
+ return WebResponseContent.Instance.Error(ex.Message);
+ }
+ }
+
+ public WebResponseContent NoStockOutSubmit(NoStockOutSubmit noStockOutSubmit)
+ {
+ try
+ {
+ Dt_InboundOrder inboundOrder = Db.Queryable<Dt_InboundOrder>().Where(x => x.UpperOrderNo == noStockOutSubmit.InOderSubmit && x.OrderStatus != InOrderStatusEnum.鍏ュ簱瀹屾垚.ObjToInt()).Includes(x => x.Details).First();
+ if (inboundOrder == null)
+ {
+ return WebResponseContent.Instance.Error($"鏈壘鍒伴噰璐崟锛歿noStockOutSubmit.InOderSubmit}");
+ }
+ Dt_OutboundOrder outboundOrder = Db.Queryable<Dt_OutboundOrder>().Where(x => x.UpperOrderNo == noStockOutSubmit.OutOderSubmit && x.OrderStatus != OutOrderStatusEnum.鍑哄簱瀹屾垚.ObjToInt()).Includes(x => x.Details).First();
+ if (outboundOrder == null)
+ {
+ return WebResponseContent.Instance.Error($"鏈壘鍒板嚭搴撳崟锛歿noStockOutSubmit.OutOderSubmit}");
+ }
+ List<Dt_InboundOrderDetail> inboundOrderDetails = new List<Dt_InboundOrderDetail>();
+ List<Dt_OutboundOrderDetail> outboundOrderDetails = new List<Dt_OutboundOrderDetail>();
+ foreach (var BarCode in noStockOutSubmit.BarCodeSubmit)
+ {
+ var inboundOrderDetail = inboundOrder.Details.FirstOrDefault(detail => detail.Barcode == BarCode && detail.OrderDetailStatus != OrderDetailStatusEnum.Over.ObjToInt());
+
+ if(inboundOrderDetail == null)
+ {
+ return WebResponseContent.Instance.Error($"鍦ㄩ噰璐崟 {noStockOutSubmit.InOderSubmit} 涓湭鎵惧埌鏉$爜涓� {BarCode} 鐨勬槑缁嗐��");
+ }
+ var outboundOrderDetail = outboundOrder.Details.FirstOrDefault(detail => detail.MaterielCode == inboundOrderDetail.MaterielCode && detail.OrderDetailStatus != OrderDetailStatusEnum.Over.ObjToInt());
+
+ if (outboundOrderDetail == null)
+ {
+ return WebResponseContent.Instance.Error($"鍦ㄥ嚭搴撳崟鐨勭墿鏂欑紪鐮佷腑鏈壘鍒颁笌閲囪喘鍗曚腑鐨剓inboundOrderDetail.MaterielCode} 瀵瑰簲鐨勭墿鏂欍��");
+ }
+ inboundOrderDetail.ReceiptQuantity += inboundOrderDetail.NoStockOutQty;
+ inboundOrderDetail.OverInQuantity = inboundOrderDetail.ReceiptQuantity;
+ inboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.Over.ObjToInt();
+ inboundOrderDetails.Add(inboundOrderDetail);
+
+ outboundOrderDetail.LockQuantity += outboundOrderDetail.NoStockOutQty;
+ outboundOrderDetail.OverOutQuantity = outboundOrderDetail.LockQuantity;
+ if(outboundOrderDetail.OrderQuantity == outboundOrderDetail.OverOutQuantity)
+ {
+ outboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.Over.ObjToInt();
+ }
+ outboundOrderDetails.Add(outboundOrderDetail);
+
+ }
+ //鍒ゆ柇鍏ュ簱鍗曟嵁鏄庣粏鏄惁鍏ㄩ儴鏄畬鎴愮姸鎬�
+ bool inoderOver = inboundOrder.Details.Count() == inboundOrder.Details.Select(x => x.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt()).Count();
+ if (inoderOver)
+ {
+ inboundOrder.OrderStatus = InOrderStatusEnum.鍏ュ簱瀹屾垚.ObjToInt();
+ }
+ //鍒ゆ柇鍑哄簱鍗曟嵁鏄庣粏鏄惁鍏ㄩ儴鏄畬鎴愮姸鎬�
+ bool outOderOver = outboundOrder.Details.Count() == outboundOrder.Details.Select(x => x.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt()).Count();
+ if (outOderOver)
+ {
+ outboundOrder.OrderStatus = OutOrderStatusEnum.鍑哄簱瀹屾垚.ObjToInt();
+ }
+ //鏁版嵁澶勭悊
+ _unitOfWorkManage.BeginTran();
+ _inboundOrderDetailService.UpdateData(inboundOrderDetails);
+ _outboundOrderDetailService.UpdateData(outboundOrderDetails);
+ _inboundOrderRepository.UpdateData(inboundOrder);
+ _outboundOrderService.UpdateData(outboundOrder);
+ _unitOfWorkManage.CommitTran();
+
+ return WebResponseContent.Instance.OK();
+ }
+ catch(Exception ex)
+ {
+ _unitOfWorkManage.RollbackTran();
+ return WebResponseContent.Instance.Error(ex.Message);
+ }
+ }
+ #endregion
+
+
#endregion
}
+
+
#region 鏀寔绫诲畾涔�
public class ValidationResult<T>
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/WIDESEA_OutboundService.csproj" "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/WIDESEA_OutboundService.csproj"
index a9892c1..6f9f90f 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/WIDESEA_OutboundService.csproj"
+++ "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/WIDESEA_OutboundService.csproj"
@@ -10,6 +10,7 @@
<ProjectReference Include="..\WIDESEA_BasicService\WIDESEA_BasicService.csproj" />
<ProjectReference Include="..\WIDESEA_IAllocateService\WIDESEA_IAllocateService.csproj" />
<ProjectReference Include="..\WIDESEA_IBasicService\WIDESEA_IBasicService.csproj" />
+ <ProjectReference Include="..\WIDESEA_IInboundService\WIDESEA_IInboundService.csproj" />
<ProjectReference Include="..\WIDESEA_IOutboundService\WIDESEA_IOutboundService.csproj" />
<ProjectReference Include="..\WIDESEA_IRecordService\WIDESEA_IRecordService.csproj" />
<ProjectReference Include="..\WIDESEA_IStockService\WIDESEA_IStockService.csproj" />
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 35c2dc3..95ae57a 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"
@@ -1,4 +1,5 @@
锘縰sing Autofac.Core;
+using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WIDESEA_Core;
@@ -113,5 +114,35 @@
{
return await Service.CancelPicking(dto.OrderNo,dto.PalletCode,dto.Barcode);
}
+
+ [HttpPost,HttpGet, Route("GetAvailablePurchaseOrders"),AllowAnonymous]
+ public WebResponseContent GetAvailablePurchaseOrders()
+ {
+ return Service.GetAvailablePurchaseOrders();
+ }
+
+ [HttpPost, HttpGet, Route("GetAvailablePickingOrders"),AllowAnonymous]
+ public WebResponseContent GetAvailablePickingOrders()
+ {
+ return Service.GetAvailablePickingOrders();
+ }
+
+ [HttpPost, HttpGet, Route("BarcodeValidate"), AllowAnonymous]
+ public WebResponseContent BarcodeValidate([FromBody] NoStockOutModel noStockOut)
+ {
+ return Service.BarcodeValidate(noStockOut);
+ }
+
+ [HttpPost, HttpGet, Route("DeleteBarcode"), AllowAnonymous]
+ public WebResponseContent DeleteBarcode([FromBody] NoStockOutModel noStockOut)
+ {
+ return Service.DeleteBarcode(noStockOut);
+ }
+
+ [HttpPost, HttpGet, Route("NoStockOutSubmit"), AllowAnonymous]
+ public WebResponseContent NoStockOutSubmit([FromBody] NoStockOutSubmit noStockOutSubmit)
+ {
+ return Service.NoStockOutSubmit(noStockOutSubmit);
+ }
}
}
--
Gitblit v1.9.3