From fa8171059a6f30209ad0dd332003794ee0719e09 Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期四, 25 十二月 2025 08:53:26 +0800
Subject: [PATCH] 盘点

---
 项目代码/WIDESEA_WMSClient/src/views/inbound/takeStockOrder.vue                                            |  291 +++++++
 项目代码/WIDESEA_WMSClient/src/extension/stock/stockView.js                                                |  172 ++++
 项目代码/WIDESEA_WMSClient/src/extension/inbound/takeStockOrder.js                                         |   83 ++
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs                         |   10 
 项目代码/WIDESEA_WMSClient/src/router/viewGird.js                                                          |    8 
 项目代码/WIDESEA_WMSClient/src/views/inbound/takeStockOrderDetail.vue                                      |  254 ++++++
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_DTO/Inbound/CompleteStockTakeDTO.cs                             |   23 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_TakeStockOrderDetail.cs                 |   21 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryService.cs                          |   48 +
 项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/OrderStockTake.vue                                 |  868 +++++++++++++++++++++
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_IInboundService/ITakeStockOrderService.cs                       |   24 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/TakeStockOrderDetailController.cs |   16 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/TakeStockOrderDetailService.cs                   |   21 
 项目代码/WIDESEA_WMSClient/config/buttons.js                                                               |   19 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs                                  |  133 +++
 项目代码/WIDESEA_WMSClient/src/extension/inbound/takeStockOrderDetail.js                                   |   58 +
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_IInboundService/ITakeStockOrderDetailService.cs                 |   14 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/TakeStockOrderService.cs                         |  252 ++++++
 项目代码/WIDESEA_WMSClient/src/views/outbound/outboundOrder.vue                                            |    1 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/TakeStockOrderController.cs       |   57 +
 20 files changed, 2,364 insertions(+), 9 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 b3561d6..26a9f2e 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"
@@ -275,7 +275,24 @@
     type: 'primary',
     onClick: function () {
     }
-}
+},{
+    name: "閫� 瀹� 搴� 瀛� 鐩� 鐐�",
+    icon: '',
+    class: '',
+    value: 'SelectStockTake',
+    type: 'warning',
+    onClick: function () {
+    }
+},
+,{
+    name: "鍗� 鎹� 鐩� 鐐� 鎿� 浣�",
+    icon: '',
+    class: '',
+    value: 'OrderStockTake',
+    type: 'warning',
+    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/src/extension/inbound/extend/OrderStockTake.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/OrderStockTake.vue"
new file mode 100644
index 0000000..5f1f0be
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/OrderStockTake.vue"
@@ -0,0 +1,868 @@
+<template>
+  <div>
+    <vol-box
+      v-model="showStockTakeBox"
+      :lazy="true"
+      :width="isMobile ? '95%' : '70%'"
+      :padding="24"
+      title="搴撳瓨鐩樼偣鎿嶄綔"
+      class="custom-vol-box"
+    >
+      <div class="stock-take-container">
+        <div class="receipt-info">
+          <el-tag type="primary" size="small" class="receipt-tag">
+            褰撳墠鐩樼偣鍗曟嵁鍙凤細<span class="receipt-no">{{ orderNo }}</span>
+          </el-tag>
+        </div>
+
+        <!-- 鏍稿績杈撳叆琛ㄥ崟 -->
+        <el-form
+          :model="formData"
+          ref="formRef"
+          label-width="100px"
+          class="stock-take-form"
+          @submit.prevent
+        >
+          <!-- 鏂欑鍙疯緭鍏ユ -->
+          <el-form-item
+            label="鏂欑鍙凤細"
+            name="boxNo"
+            :rules="[
+              {
+                required: true,
+                message: '璇锋壂鎻忔垨杈撳叆鏂欑鍙�',
+                trigger: 'blur',
+              },
+              { validator: validateBoxNo, trigger: 'blur' },
+            ]"
+            class="form-item"
+          >
+            <el-input
+              ref="boxNoInputRef"
+              v-model="formData.boxNo"
+              placeholder="璇蜂娇鐢ㄦ壂鐮佹灙鎵弿鏂欑鍙凤紝鎴栨墜鍔ㄨ緭鍏�"
+              clearable
+              @keydown.enter="debouncedHandleBoxNoScan"
+              @blur="handleBoxNoBlur"
+              :disabled="loading"
+              class="custom-input"
+              :class="{ 'has-value': formData.boxNo.trim() }"
+            >
+              <template #append>
+                <el-button
+                  icon="Search"
+                  type="primary"
+                  size="small"
+                  @click="handleBoxNoScan"
+                  :disabled="!formData.boxNo.trim() || loading"
+                  class="input-btn"
+                ></el-button>
+              </template>
+            </el-input>
+          </el-form-item>
+
+          <!-- 鏉$爜杈撳叆妗� -->
+          <el-form-item
+            label="鐩樼偣鏉$爜锛�"
+            name="barcode"
+            :rules="[
+              { required: true, message: '璇锋壂鎻忔垨杈撳叆鏉$爜', trigger: 'blur' },
+              { validator: validateBarcode, trigger: 'blur' },
+            ]"
+            class="form-item"
+          >
+            <el-input
+              ref="barcodeInputRef"
+              v-model="formData.barcode"
+              placeholder="璇蜂娇鐢ㄦ壂鐮佹灙鎵弿鏉$爜锛屾垨鎵嬪姩杈撳叆"
+              clearable
+              @keydown.enter="debouncedHandleBarcodeScan"
+              :disabled="!formData.boxNo.trim() || loading"
+              class="custom-input"
+              :class="{ 'has-value': formData.barcode.trim() }"
+            >
+              <template #append>
+                <el-button
+                  icon="Search"
+                  type="primary"
+                  size="small"
+                  @click="handleBarcodeScan"
+                  :disabled="
+                    !formData.boxNo.trim() ||
+                    !formData.barcode.trim() ||
+                    loading
+                  "
+                  class="input-btn"
+                ></el-button>
+              </template>
+            </el-input>
+          </el-form-item>
+
+          <!-- 搴撳瓨鏁伴噺妗嗭紙鍙锛� -->
+          <el-form-item
+            label="搴撳瓨鏁伴噺锛�"
+            name="stockQuantity"
+            class="form-item"
+          >
+            <el-input
+              v-model="formData.stockQuantity"
+              placeholder="鎵弿鏉$爜鍚庤嚜鍔ㄥ~鍏�"
+              readonly
+              class="custom-input custom-readonly-input"
+              :class="{ 'has-value': formData.stockQuantity }"
+            ></el-input>
+          </el-form-item>
+
+          <!-- 瀹為檯鐩樼偣鏁伴噺 -->
+          <el-form-item
+            label="瀹為檯鐩樼偣鏁伴噺锛�"
+            name="actualQuantity"
+            :rules="[
+              {
+                required: true,
+                message: '璇疯緭鍏ュ疄闄呯洏鐐规暟閲�',
+                trigger: 'blur',
+              },
+              { type: 'number', message: '璇疯緭鍏ユ湁鏁堢殑鏁板瓧', trigger: 'blur' },
+              { validator: validateActualQuantity, trigger: 'blur' },
+            ]"
+            class="form-item"
+          >
+            <el-input
+              v-model.number="formData.actualQuantity"
+              placeholder="璇疯緭鍏ュ疄闄呯洏鐐规暟閲忥紙澶т簬0锛�"
+              type="number"
+              clearable
+              @keydown.enter="handleStockTakeComplete"
+              :disabled="!formData.stockQuantity || loading"
+              class="custom-input"
+              :class="{ 'has-value': formData.actualQuantity }"
+            ></el-input>
+          </el-form-item>
+        </el-form>
+
+        <!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
+        <div class="action-buttons">
+          <el-button
+            type="info"
+            size="small"
+            @click="handleBoxReturn"
+            :disabled="!formData.boxNo.trim() || loading"
+            class="return-btn"
+          >
+            <Return /> 鏂欑鍥炲簱
+          </el-button>
+          <el-button
+            type="primary"
+            size="small"
+            @click="handleStockTakeComplete"
+            :disabled="
+              loading ||
+              !formData.boxNo.trim() ||
+              !formData.barcode.trim() ||
+              !formData.stockQuantity ||
+              !formData.actualQuantity
+            "
+            class="complete-btn"
+          >
+            <Check /> 鐩樼偣瀹屾垚
+          </el-button>
+          <el-button
+            type="text"
+            size="small"
+            @click="handleCancel"
+            :disabled="loading"
+            class="cancel-btn"
+          >
+            鍙栨秷
+          </el-button>
+        </div>
+      </div>
+    </vol-box>
+  </div>
+</template>
+
+<script setup>
+import { ref, reactive, onMounted, nextTick, watch, defineEmits, computed } from "vue";
+import { ElMessage, ElTag, ElMessageBox } from "element-plus";
+import { Search, Check, Return } from "@element-plus/icons-vue";
+
+import VolBox from "@/components/basic/VolBox.vue";
+import http from "@/api/http";
+
+// 鍝嶅簲寮忓彉閲� - 鍗曟嵁鍙�
+const orderNo = ref("");
+
+// 鏆撮湶浜嬩欢
+const emit = defineEmits(["close", "refresh", "box-returned"]);
+
+// 鍝嶅簲寮忔暟鎹�
+const showStockTakeBox = ref(false);
+const formData = reactive({
+  boxNo: "", // 鏂欑鍙�
+  barcode: "", // 鐩樼偣鏉$爜
+  stockQuantity: "", // 搴撳瓨鏁伴噺锛堝彧璇伙級
+  actualQuantity: "", // 瀹為檯鐩樼偣鏁伴噺
+});
+const loading = ref(false);
+const formRef = ref(null);
+
+// 妯℃澘寮曠敤
+const boxNoInputRef = ref(null);
+const barcodeInputRef = ref(null);
+
+// 妫�娴嬫槸鍚︿负绉诲姩绔�
+const isMobile = computed(() => {
+  return window.innerWidth < 768;
+});
+
+// 缁勪欢鎸傝浇鏃惰仛鐒﹀埌鏂欑鍙疯緭鍏ユ
+onMounted(() => {
+  nextTick(() => {
+    boxNoInputRef.value?.focus();
+  });
+  // 鐩戝惉绐楀彛澶у皬鍙樺寲
+  window.addEventListener("resize", () => {});
+});
+
+// 鐩戝惉鏂欑鍙峰彉鍖栵紝娓呯┖鍚庣画鐩稿叧瀛楁
+watch(
+  () => formData.boxNo,
+  (newVal) => {
+    if (!newVal.trim()) {
+      formData.barcode = "";
+      formData.stockQuantity = "";
+      formData.actualQuantity = "";
+    }
+  },
+  { immediate: true }
+);
+
+// 闃叉姈鍑芥暟
+const debounce = (fn, delay = 100) => {
+  let timer = null;
+  return (...args) => {
+    if (timer) clearTimeout(timer);
+    timer = setTimeout(() => {
+      fn.apply(this, args);
+    }, delay);
+  };
+};
+
+// 鎵撳紑寮圭獥骞舵帴鏀跺崟鎹彿
+const open = (receiptNo) => {
+  showStockTakeBox.value = true;
+  orderNo.value = receiptNo;
+  // 閲嶇疆琛ㄥ崟
+  formData.boxNo = "";
+  formData.barcode = "";
+  formData.stockQuantity = "";
+  formData.actualQuantity = "";
+  nextTick(() => {
+    boxNoInputRef.value?.focus();
+  });
+};
+
+// 鍏抽棴寮圭獥
+const handleCancel = (e) => {
+  e.stopPropagation();
+  e.preventDefault();
+  showStockTakeBox.value = false;
+  emit("close");
+  orderNo.value = "";
+};
+
+// 鏂欑鍙烽獙璇侊紙浼樺寲锛氭湁鍊兼椂浠呴獙璇侀暱搴︼紝鏃犲�兼椂瑙﹀彂蹇呭~锛�
+const validateBoxNo = (rule, value, callback) => {
+  // 鏈夊�兼椂楠岃瘉闀垮害
+  if (value && value.trim().length < 3) {
+    callback(new Error("鏂欑鍙烽暱搴︿笉鑳藉皯浜�3浣�"));
+  } 
+  // 鏃犲�兼椂鐢眗equired瑙勫垯澶勭悊锛岃繖閲屼笉閲嶅鎻愮ず
+  else {
+    callback();
+  }
+};
+
+// 鏉$爜楠岃瘉锛堜紭鍖栵細鏈夊�兼椂浠呴獙璇侀暱搴︼級
+const validateBarcode = (rule, value, callback) => {
+  if (value && value.trim().length < 6) {
+    callback(new Error("鏉$爜闀垮害涓嶈兘灏戜簬6浣�"));
+  } else {
+    callback();
+  }
+};
+
+// 瀹為檯鐩樼偣鏁伴噺楠岃瘉锛堜紭鍖栵細鏈夊�兼椂楠岃瘉鍚堟硶鎬э級
+const validateActualQuantity = (rule, value, callback) => {
+  if (value === null || value === undefined) {
+    callback(new Error("璇疯緭鍏ュ疄闄呯洏鐐规暟閲�"));
+  } else if (value <= 0) {
+    callback(new Error("瀹為檯鐩樼偣鏁伴噺蹇呴』澶т簬0"));
+  } else if (!Number.isInteger(value)) {
+    callback(new Error("瀹為檯鐩樼偣鏁伴噺蹇呴』鏄暣鏁�"));
+  } else {
+    callback();
+  }
+};
+
+// 鏂欑鍙峰け鐒﹀鐞�
+const handleBoxNoBlur = () => {
+  if (formData.boxNo.trim() && boxNoInputRef.value?.input) {
+    boxNoInputRef.value.input.select();
+  }
+};
+
+// 鏂欑鍙锋壂鎻忛獙璇侊紙鍚庣鎺ュ彛锛�
+const validateBoxNoApi = async (boxNo) => {
+  try {
+    const res = await http.post(
+      `/api/TakeStockOrder/ValidateBoxNo?orderNo=${encodeURIComponent(
+        orderNo.value
+      )}&boxNo=${encodeURIComponent(boxNo)}`,
+      "楠岃瘉鏂欑鍙蜂腑..."
+    );
+
+    if (!res.status) {
+      throw new Error(res.message || "鏂欑鍙烽獙璇佸け璐�");
+    }
+    return res.data;
+  } catch (error) {
+    throw error;
+  }
+};
+
+// 鏂欑鍙锋壂鎻忓鐞�
+const handleBoxNoScan = async () => {
+  if (!formRef.value) return;
+  // 鎵嬪姩瑙﹀彂楠岃瘉锛堜粎楠岃瘉褰撳墠瀛楁锛�
+  const valid = await formRef.value.validateField("boxNo");
+  if (valid !== true) return;
+
+  const boxNo = formData.boxNo.trim();
+  if (!boxNo) return;
+
+  try {
+    loading.value = true;
+    await validateBoxNoApi(boxNo);
+    ElMessage.success(`鏂欑鍙� ${boxNo} 楠岃瘉閫氳繃`);
+    nextTick(() => {
+      barcodeInputRef.value?.focus();
+    });
+  } catch (error) {
+    ElMessage.error(error.message);
+    nextTick(() => {
+      if (boxNoInputRef.value?.input) {
+        boxNoInputRef.value.input.select();
+      }
+    });
+  } finally {
+    loading.value = false;
+  }
+};
+
+// 鏉$爜鎵弿楠岃瘉锛堝悗绔帴鍙o級
+const validateBarcodeApi = async (boxNo, barcode) => {
+  try {
+    const res = await http.post(
+      `/api/TakeStockOrder/ValidateBarcode?boxNo=${encodeURIComponent(
+        boxNo
+      )}&barcode=${encodeURIComponent(barcode)}`,
+      "楠岃瘉鏉$爜涓�..."
+    );
+
+    if (!res.status) {
+      throw new Error(res.message || "鏉$爜楠岃瘉澶辫触");
+    }
+
+    if (
+      res.data?.stockQuantity === undefined ||
+      res.data?.stockQuantity === null
+    ) {
+      throw new Error("鏈煡璇㈠埌璇ユ潯鐮佺殑搴撳瓨鏁伴噺");
+    }
+
+    return res.data;
+  } catch (error) {
+    throw error;
+  }
+};
+
+// 鏉$爜鎵弿澶勭悊
+const handleBarcodeScan = async () => {
+  if (!formRef.value) return;
+  const valid = await formRef.value.validateField("barcode");
+  if (valid !== true) return;
+
+  const boxNo = formData.boxNo.trim();
+  const barcode = formData.barcode.trim();
+  if (!boxNo || !barcode) return;
+
+  try {
+    loading.value = true;
+    const result = await validateBarcodeApi(boxNo, barcode);
+    formData.stockQuantity = result.stockQuantity;
+    ElMessage.success(
+      `鏉$爜 ${barcode} 楠岃瘉閫氳繃锛屽簱瀛樻暟閲忥細${result.stockQuantity}`
+    );
+    nextTick(() => {
+      const actualQuantityInput = document.querySelector(
+        ".form-item:last-child .el-input__inner"
+      );
+      actualQuantityInput?.focus();
+    });
+  } catch (error) {
+    ElMessage.error(error.message);
+    nextTick(() => {
+      if (barcodeInputRef.value?.input) {
+        barcodeInputRef.value.input.select();
+      }
+    });
+  } finally {
+    loading.value = false;
+  }
+};
+
+// 鐩樼偣瀹屾垚鎻愪氦
+const handleStockTakeComplete = async () => {
+  if (!formRef.value) return;
+  // 鍏ㄨ〃鍗曢獙璇�
+  const valid = await formRef.value.validate();
+  if (!valid) return;
+
+  const { boxNo, barcode, actualQuantity, stockQuantity } = formData;
+  const receiptNo = orderNo.value;
+
+  try {
+    loading.value = true;
+
+    const res = await http.post(
+      "/api/TakeStockOrder/CompleteStockTake",
+      {
+        orderNo: receiptNo,
+        boxNo,
+        barcode,
+        actualQuantity,
+        stockQuantity,
+      },
+      {
+        loadingText: "鎻愪氦鐩樼偣鏁版嵁涓�...",
+      }
+    );
+
+    if (res.status) {
+      ElMessage.success("鐩樼偣瀹屾垚锛屾彁浜ゆ垚鍔燂紒");
+      formData.barcode = "";
+      formData.stockQuantity = "";
+      formData.actualQuantity = "";
+      nextTick(() => {
+        barcodeInputRef.value?.focus();
+      });
+      emit("refresh");
+    } else {
+      throw new Error(res.message || "鐩樼偣鎻愪氦澶辫触");
+    }
+  } catch (error) {
+    ElMessage.error(error.message || "缃戠粶寮傚父锛屾彁浜ゅけ璐�");
+  } finally {
+    loading.value = false;
+  }
+};
+
+// 鏂欑鍥炲簱鍔熻兘
+const handleBoxReturn = async () => {
+  const boxNo = formData.boxNo.trim();
+  if (!boxNo) {
+    ElMessage.warning("璇峰厛杈撳叆鎴栨壂鎻忔枡绠卞彿");
+    return;
+  }
+
+  try {
+    await ElMessageBox.confirm(`纭畾灏嗘枡绠便��${boxNo}銆戝洖搴撳悧锛焋, "鍥炲簱纭", {
+      confirmButtonText: "纭畾",
+      cancelButtonText: "鍙栨秷",
+      type: "info",
+      center: true,
+      confirmButtonClass: "el-button--primary",
+      cancelButtonClass: "el-button--text",
+    });
+
+    loading.value = true;
+
+    const res = await http.post(
+      `/api/TakeStockOrder/ReturnBox?boxNo=${encodeURIComponent(boxNo)}&orderNo=${encodeURIComponent(
+        orderNo.value
+      )}`,
+      "鏂欑鍥炲簱涓�..."
+    );
+
+    if (res.status) {
+      ElMessage.success(`鏂欑銆�${boxNo}銆戝洖搴撴垚鍔燂紒`);
+      formData.boxNo = "";
+      formData.barcode = "";
+      formData.stockQuantity = "";
+      formData.actualQuantity = "";
+      nextTick(() => {
+        boxNoInputRef.value?.focus();
+      });
+      emit("box-returned", boxNo);
+    } else {
+      throw new Error(res.message || "鏂欑鍥炲簱澶辫触");
+    }
+  } catch (error) {
+    if (error.name !== "Cancel") {
+      ElMessage.error(error.message);
+    }
+  } finally {
+    loading.value = false;
+  }
+};
+
+// 甯﹂槻鎶栫殑鎵弿澶勭悊
+const debouncedHandleBoxNoScan = debounce(async (e) => {
+  e.stopPropagation();
+  e.preventDefault();
+  await handleBoxNoScan();
+}, 100);
+
+const debouncedHandleBarcodeScan = debounce(async (e) => {
+  e.stopPropagation();
+  e.preventDefault();
+  await handleBarcodeScan();
+}, 100);
+
+// 鏆撮湶鏂规硶
+defineExpose({
+  open,
+});
+</script>
+
+<style scoped>
+/* 涓诲鍣ㄦ牱寮� - 浼樺寲闂磋窛鍜屽搷搴斿紡 */
+.stock-take-container {
+  width: 100%;
+  display: flex;
+  flex-direction: column;
+  gap: 16px;
+  padding: 8px 0;
+}
+
+/* 鍗曟嵁淇℃伅鏍峰紡 - 浼樺寲瑙嗚灞傜骇 */
+.receipt-info {
+  margin-bottom: 4px;
+}
+
+.receipt-tag {
+  padding: 8px 16px;
+  font-size: 14px;
+  background-color: #e8f4f8 !important;
+  border-color: #409eff !important;
+  color: #1989fa !important;
+  border-radius: 8px;
+  box-shadow: 0 2px 8px rgba(64, 158, 255, 0.1);
+}
+
+.receipt-no {
+  font-weight: 600;
+  color: #1989fa;
+  margin-left: 6px;
+}
+
+/* 琛ㄥ崟鏍峰紡 - 浼樺寲闃村奖鍜屽唴杈硅窛 */
+.stock-take-form {
+  width: 100%;
+  background-color: #ffffff;
+  padding: 20px;
+  border-radius: 12px;
+  box-shadow: 0 2px 12px rgba(64, 158, 255, 0.06);
+  border: 1px solid #f0f8fb;
+}
+
+.form-item {
+  margin-bottom: 16px;
+}
+
+/* 杈撳叆妗嗘牳蹇冩牱寮� - 浼樺寲鐘舵�佹樉绀� */
+.custom-input {
+  width: 100%;
+  position: relative;
+}
+
+/* 鏈夊�兼椂闅愯棌鍗犱綅绗� + 浼樺寲杈规 */
+.custom-input.has-value :deep(.el-input__inner) {
+  --el-input-placeholder-color: transparent; /* 闅愯棌鍗犱綅绗� */
+  border-color: #8cc5ff; /* 娴呰摑杈规锛屽尯鍒嗘棤鍊肩姸鎬� */
+  background-color: #ffffff;
+}
+
+.custom-input :deep(.el-input__inner) {
+  border-radius: 8px;
+  border-color: #e5f0fa;
+  transition: all 0.2s ease;
+  height: 42px;
+  line-height: 42px;
+  font-size: 14px;
+  background-color: #f8fbff;
+  padding: 0 12px;
+}
+
+/* 鑱氱劍鏍峰紡浼樺寲 */
+.custom-input :deep(.el-input__inner:focus) {
+  border-color: #409eff;
+  box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.1);
+  background-color: #ffffff;
+  outline: none;
+}
+
+/* 娓呴櫎鎸夐挳鏍峰紡浼樺寲 */
+.custom-input :deep(.el-input__clear) {
+  color: #91c9f7;
+  width: 18px;
+  height: 18px;
+}
+
+.custom-input :deep(.el-input__clear:hover) {
+  color: #409eff;
+}
+
+/* 鍙杈撳叆妗嗘牱寮� - 澧炲己鍖哄垎搴� */
+.custom-readonly-input :deep(.el-input__inner) {
+  background-color: #f0f8fb;
+  color: #1989fa;
+  font-weight: 500;
+  cursor: default;
+  border-color: #d1e7fd;
+  padding-right: 12px;
+}
+
+/* 杈撳叆妗嗘寜閽牱寮� - 浼樺寲灏哄鍜宧over鏁堟灉 */
+.input-btn {
+  border-radius: 0 8px 8px 0 !important;
+  height: 42px;
+  width: 48px;
+  background-color: #409eff;
+  border-color: #409eff;
+  transition: all 0.2s ease;
+}
+
+.input-btn:hover {
+  background-color: #1989fa !important;
+  border-color: #1989fa !important;
+  box-shadow: 0 2px 8px rgba(64, 158, 255, 0.2);
+  transform: translateY(-1px);
+}
+
+/* 琛ㄥ崟楠岃瘉閿欒鏍峰紡 - 鍏抽敭锛氭湁鍊兼椂涓嶆樉绀洪敊璇竟妗� */
+.form-item :deep(.el-form-item__error) {
+  font-size: 12px;
+  color: #f56c6c;
+  margin-top: 4px;
+  /* 浠呭湪杈撳叆妗嗕负绌轰笖楠岃瘉澶辫触鏃舵樉绀� */
+  display: none;
+}
+
+/* 鍙湁杈撳叆妗嗕负绌� + 楠岃瘉澶辫触鏃舵樉绀洪敊璇彁绀� */
+.form-item:deep(.el-form-item--error) .custom-input:not(.has-value) + .el-form-item__error {
+  display: block;
+}
+
+/* 鏈夊�兼椂鍗充娇楠岃瘉澶辫触锛屼篃涓嶆樉绀洪敊璇竟妗� */
+.custom-input.has-value :deep(.el-input__inner.el-input__inner--error) {
+  border-color: #8cc5ff;
+  box-shadow: none;
+}
+
+/* 鎿嶄綔鎸夐挳鍖哄煙 - 浼樺寲闂磋窛鍜屽搷搴斿紡 */
+.action-buttons {
+  display: flex;
+  justify-content: flex-end;
+  gap: 10px;
+  margin-top: 20px;
+  flex-wrap: wrap;
+}
+
+/* 鍥炲簱鎸夐挳鏍峰紡 - 浼樺寲浜や簰 */
+.return-btn {
+  border-radius: 8px;
+  padding: 9px 20px;
+  font-size: 14px;
+  font-weight: 500;
+  background-color: #e8f4f8;
+  border-color: #409eff;
+  color: #1989fa;
+  transition: all 0.2s ease;
+}
+
+.return-btn:hover {
+  background-color: #d1e7fd !important;
+  border-color: #1989fa !important;
+  color: #1989fa !important;
+  transform: translateY(-1px);
+  box-shadow: 0 2px 8px rgba(64, 158, 255, 0.15);
+}
+
+.return-btn:disabled {
+  background-color: #f0f8fb !important;
+  border-color: #b3d8ff !important;
+  color: #91c9f7 !important;
+  cursor: not-allowed;
+  transform: none;
+  box-shadow: none;
+}
+
+/* 鐩樼偣瀹屾垚鎸夐挳鏍峰紡 - 浼樺寲浜や簰 */
+.complete-btn {
+  border-radius: 8px;
+  padding: 9px 20px;
+  font-size: 14px;
+  font-weight: 500;
+  background-color: #409eff;
+  border-color: #409eff;
+  transition: all 0.2s ease;
+}
+
+.complete-btn:hover {
+  background-color: #1989fa !important;
+  border-color: #1989fa !important;
+  transform: translateY(-1px);
+  box-shadow: 0 2px 8px rgba(64, 158, 255, 0.2);
+}
+
+.complete-btn:disabled {
+  background-color: #a0cfff !important;
+  border-color: #a0cfff !important;
+  color: #ffffff !important;
+  cursor: not-allowed;
+  transform: none;
+  box-shadow: none;
+}
+
+/* 鍙栨秷鎸夐挳鏍峰紡 - 浼樺寲鐐瑰嚮鍖哄煙 */
+.cancel-btn {
+  color: #666666;
+  font-size: 14px;
+  transition: all 0.2s ease;
+  padding: 9px 20px;
+  border-radius: 8px;
+  min-width: 80px;
+}
+
+.cancel-btn:hover {
+  color: #1989fa !important;
+  background-color: #f0f8fb !important;
+}
+
+/* 寮圭獥鏁翠綋鏍峰紡 - 浼樺寲鍦嗚鍜岄槾褰� */
+.custom-vol-box {
+  border-radius: 16px !important;
+  overflow: hidden;
+  box-shadow: 0 8px 24px rgba(64, 158, 255, 0.12);
+}
+
+.custom-vol-box :deep(.el-dialog__header) {
+  background-color: #e8f4f8;
+  border-bottom: 1px solid #d1e7fd;
+  padding: 16px 24px;
+}
+
+.custom-vol-box :deep(.el-dialog__title) {
+  color: #1989fa;
+  font-size: 18px;
+  font-weight: 600;
+}
+
+.custom-vol-box :deep(.el-dialog__body) {
+  padding: 16px 24px;
+}
+
+/* 鍝嶅簲寮忛�傞厤 - 灏忓睆骞曚紭鍖� */
+@media (max-width: 768px) {
+  .stock-take-form {
+    padding: 16px;
+  }
+
+  .form-item {
+    margin-bottom: 12px;
+  }
+
+  .action-buttons {
+    justify-content: center;
+  }
+
+  .custom-vol-box :deep(.el-dialog__header) {
+    padding: 12px 16px;
+  }
+
+  .custom-vol-box :deep(.el-dialog__body) {
+    padding: 12px 16px;
+  }
+}
+</style>
+
+<style>
+/* 鍏ㄥ眬琛ュ厖鏍峰紡 - 缁熶竴涓婚 */
+.el-tag--primary {
+  --el-tag-bg-color: #e8f4f8;
+  --el-tag-border-color: #409eff;
+  --el-tag-text-color: #1989fa;
+}
+
+/* 鍗犱綅绗︽牱寮� - 缁熶竴棰滆壊 */
+.el-input__inner::-webkit-input-placeholder {
+  color: #b3d8ff;
+  font-size: 13px;
+}
+
+.el-input__inner::-moz-placeholder {
+  color: #b3d8ff;
+  font-size: 13px;
+}
+
+.el-input__inner:-ms-input-placeholder {
+  color: #b3d8ff;
+  font-size: 13px;
+}
+
+.el-input__inner::placeholder {
+  color: #b3d8ff;
+  font-size: 13px;
+}
+
+/* 淇℃伅鎸夐挳鍏ㄥ眬鏍峰紡 */
+.el-button--info {
+  --el-button-bg-color: #e8f4f8;
+  --el-button-border-color: #409eff;
+  --el-button-text-color: #1989fa;
+  --el-button-hover-bg-color: #d1e7fd;
+  --el-button-hover-border-color: #1989fa;
+  --el-button-hover-text-color: #1989fa;
+}
+
+/* 纭寮圭獥鏍峰紡浼樺寲 */
+.el-message-box {
+  border-radius: 12px !important;
+  box-shadow: 0 4px 20px rgba(64, 158, 255, 0.15);
+}
+
+.el-message-box__header {
+  border-bottom: 1px solid #f0f8fb;
+  padding: 12px 20px;
+}
+
+.el-message-box__title {
+  color: #1989fa;
+  font-size: 16px;
+  font-weight: 600;
+}
+
+.el-message-box__content {
+  color: #666666;
+  font-size: 14px;
+  padding: 16px 20px;
+}
+
+.el-message-box__btns {
+  padding: 12px 20px;
+  border-top: 1px solid #f0f8fb;
+}
+</style>
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/takeStockOrder.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/takeStockOrder.js"
new file mode 100644
index 0000000..cae7d0a
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/takeStockOrder.js"
@@ -0,0 +1,83 @@
+// 鑷畾涔夋墿灞曚笟鍔′唬鐮�
+import gridBody from "./extend/OrderStockTake.vue";
+
+let extension = {
+  components: {
+    // 鏌ヨ鐣岄潰鎵╁睍缁勪欢锛氬皢鑷畾涔夊脊绐楁敞鍐屼负 gridBody 缁勪欢
+    gridHeader: '',
+    gridBody: gridBody, // 瀵瑰簲浣犵殑鐩樼偣寮圭獥缁勪欢
+    gridFooter: '',
+    // 鏂板缓/缂栬緫寮瑰嚭妗嗘墿灞曠粍浠讹紙姝ゅ涓嶇敤锛岀暀绌猴級
+    modelHeader: '',
+    modelBody: '',
+    modelFooter: ''
+  },
+  tableAction: '', // 鏃犻渶鎸囧畾琛ㄥ悕锛堥粯璁ら�傜敤褰撳墠椤甸潰琛ㄦ牸锛�
+  buttons: { view: [], box: [], detail: [] }, // 鎵╁睍鎸夐挳锛堝闇�棰濆娣诲姞鍙湪姝ら厤缃級
+  methods: {
+    onInit() {
+      // 鎵惧埌 value 涓� "OrderStockTake" 鐨勬寜閽紙闇�鍦ㄦ鏋朵腑鎻愬墠閰嶇疆璇ユ寜閽級
+      let OrderStockTakeBtn = this.buttons.find(x => x.value === 'OrderStockTake');
+      if (OrderStockTakeBtn) {
+        // 閲嶅啓鎸夐挳鐐瑰嚮浜嬩欢
+        OrderStockTakeBtn.onClick = function () {
+          // 1. 鑾峰彇琛ㄦ牸閫変腑琛屾暟鎹�
+          let rows = this.$refs.table.getSelected();
+          if (rows.length === 0) return this.$error("璇烽�夋嫨涓�鏉$洏鐐瑰崟鎹暟鎹紒");
+          if (rows.length > 1) return this.$error("鍙兘閫夋嫨涓�鏉$洏鐐瑰崟鎹暟鎹紒");
+          
+          const selectedReceiptNo = rows[0].orderNo;
+          if (!selectedReceiptNo) return this.$error("閫変腑鐨勫崟鎹己灏戞湁鏁堢殑鍗曟嵁鍙凤紒");
+
+          // 3. 璋冪敤鑷畾涔夊脊绐楃殑 open 鏂规硶锛屽苟浼犻�掑崟鎹彿锛堟牳蹇冿細缁欏脊绐椾紶鍙傦級
+          this.$refs.gridBody.open(selectedReceiptNo);
+        };
+      }
+
+      // 4. 鐩戝惉鑷畾涔夊脊绐楃殑浜嬩欢锛堝悓姝ヤ富椤甸潰鏁版嵁锛�
+      this.$nextTick(() => {
+        const stockTakeComp = this.$refs.gridBody;
+        if (stockTakeComp) {
+          // 鐩戝惉寮圭獥鐨� "refresh" 浜嬩欢锛堢洏鐐瑰畬鎴愬悗鍒锋柊涓婚〉闈級
+          stockTakeComp.$on('refresh', () => {
+            this.$refs.table.reload(); // 鍒锋柊琛ㄦ牸鏁版嵁
+          });
+
+          // 鐩戝惉寮圭獥鐨� "box-returned" 浜嬩欢锛堟枡绠卞洖搴撳悗鍙寜闇�澶勭悊锛�
+          stockTakeComp.$on('box-returned', (boxNo) => {
+            this.$success(`鏂欑銆�${boxNo}銆戝洖搴撴垚鍔燂紝琛ㄦ牸灏嗗埛鏂帮紒`);
+            this.$refs.table.reload(); // 鍥炲簱鍚庝篃鍒锋柊琛ㄦ牸锛堝彲閫夛紝鏍规嵁涓氬姟闇�姹傦級
+          });
+        }
+      });
+    },
+    onInited() {
+      // 妗嗘灦鍒濆鍖栧畬鎴愬悗鎵ц锛堝闇�閰嶇疆鏄庣粏琛ㄥ彲鍦ㄦ鎿嶄綔锛�
+    },
+    searchBefore(param) {
+      // 鏌ヨ鍓嶆嫤鎴細鍙坊鍔犻澶栨煡璇㈡潯浠讹紙濡傛潈闄愯繃婊わ級
+      return true;
+    },
+    searchAfter(result) {
+      // 鏌ヨ鍚庢暟鎹鐞嗭紙濡傛牸寮忓寲鏃ユ湡銆佺姸鎬佹樉绀猴級
+      return true;
+    },
+    addBefore(formData) {
+      // 鏂板缓淇濆瓨鍓嶅鐞嗭紙姝ゅ涓嶇敤锛�
+      return true;
+    },
+    updateBefore(formData) {
+      // 缂栬緫淇濆瓨鍓嶅鐞嗭紙姝ゅ涓嶇敤锛�
+      return true;
+    },
+    rowClick({ row, column, event }) {
+      // 鍗曞嚮琛岄�変腑褰撳墠琛岋紙浼樺寲鐢ㄦ埛浣撻獙锛�
+      this.$refs.table.$refs.table.toggleRowSelection(row);
+    },
+    modelOpenAfter(row) {
+      // 鏂板缓/缂栬緫寮圭獥鎵撳紑鍚庡鐞嗭紙姝ゅ涓嶇敤锛�
+    }
+  }
+};
+
+export default extension;
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/takeStockOrderDetail.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/takeStockOrderDetail.js"
new file mode 100644
index 0000000..24e1d94
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/takeStockOrderDetail.js"
@@ -0,0 +1,58 @@
+
+//姝s鏂囦欢鏄敤鏉ヨ嚜瀹氫箟鎵╁睍涓氬姟浠g爜锛屽彲浠ユ墿灞曚竴浜涜嚜瀹氫箟椤甸潰鎴栬�呴噸鏂伴厤缃敓鎴愮殑浠g爜
+
+let extension = {
+    components: {
+      //鏌ヨ鐣岄潰鎵╁睍缁勪欢
+      gridHeader: '',
+      gridBody: '',
+      gridFooter: '',
+      //鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢
+      modelHeader: '',
+      modelBody: '',
+      modelFooter: ''
+    },
+    tableAction: '', //鎸囧畾鏌愬紶琛ㄧ殑鏉冮檺(杩欓噷濉啓琛ㄥ悕,榛樿涓嶇敤濉啓)
+    buttons: { view: [], box: [], detail: [] }, //鎵╁睍鐨勬寜閽�
+    methods: {
+       //涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄�
+      onInit() {  
+      },
+      onInited() {
+        //妗嗘灦鍒濆鍖栭厤缃悗
+        //濡傛灉瑕侀厤缃槑缁嗚〃,鍦ㄦ鏂规硶鎿嶄綔
+        //this.detailOptions.columns.forEach(column=>{ });
+      },
+      searchBefore(param) {
+        //鐣岄潰鏌ヨ鍓�,鍙互缁檖aram.wheres娣诲姞鏌ヨ鍙傛暟
+        //杩斿洖false锛屽垯涓嶄細鎵ц鏌ヨ
+        return true;
+      },
+      searchAfter(result) {
+        //鏌ヨ鍚庯紝result杩斿洖鐨勬煡璇㈡暟鎹�,鍙互鍦ㄦ樉绀哄埌琛ㄦ牸鍓嶅鐞嗚〃鏍肩殑鍊�
+        return true;
+      },
+      addBefore(formData) {
+        //鏂板缓淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛紝鍙互缁欑粰琛ㄥ崟璁剧疆鍊硷紝鑷繁杈撳嚭鐪媐ormData鐨勫��
+        return true;
+      },
+      updateBefore(formData) {
+        //缂栬緫淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛ㄣ�佸垹闄よ鐨処d
+        return true;
+      },
+      rowClick({ row, column, event }) {
+        //鏌ヨ鐣岄潰鐐瑰嚮琛屼簨浠�
+        this.$refs.table.$refs.table.toggleRowSelection(row); //鍗曞嚮琛屾椂閫変腑褰撳墠琛�;
+      },
+      modelOpenAfter(row) {
+        //鐐瑰嚮缂栬緫銆佹柊寤烘寜閽脊鍑烘鍚庯紝鍙互鍦ㄦ澶勫啓閫昏緫锛屽锛屼粠鍚庡彴鑾峰彇鏁版嵁
+        //(1)鍒ゆ柇鏄紪杈戣繕鏄柊寤烘搷浣滐細 this.currentAction=='Add';
+        //(2)缁欏脊鍑烘璁剧疆榛樿鍊�
+        //(3)this.editFormFields.瀛楁='xxx';
+        //濡傛灉闇�瑕佺粰涓嬫媺妗嗚缃粯璁ゅ�硷紝璇烽亶鍘唗his.editFormOptions鎵惧埌瀛楁閰嶇疆瀵瑰簲data灞炴�х殑key鍊�
+        //鐪嬩笉鎳傚氨鎶婅緭鍑虹湅锛歝onsole.log(this.editFormOptions)
+      }
+    }
+  };
+  export default extension;
+  
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/stock/stockView.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/stock/stockView.js"
index c58c825..62c338f 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/stock/stockView.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/stock/stockView.js"
@@ -1,4 +1,5 @@
-
+import { createVNode, render, h, reactive } from 'vue';
+import { ElDialog, ElForm, ElFormItem, ElSelect, ElOption, ElButton, ElMessage, ElLoading } from 'element-plus';
 let extension = {
   components: {
     //鏌ヨ鐣岄潰鎵╁睍缁勪欢
@@ -156,6 +157,175 @@
           }
         }
       })
+
+      let SelectTake = this.buttons.find(x => x.value == 'SelectStockTake');
+if (SelectTake) {
+  // 鏀逛负绠ご鍑芥暟纭繚this鎸囧悜Vue缁勪欢瀹炰緥
+  SelectTake.onClick = async () => {
+    // 鑾峰彇閫変腑鏁版嵁锛堜笌鍘熼�昏緫涓�鑷达紝纭繚鏄暟缁勬牸寮忥級
+    let stockViews = this.$refs.table.getSelected();
+    
+    // 鏁版嵁鏍¢獙锛氳嚦灏戦�夋嫨涓�鏉℃暟鎹�
+    if (stockViews.length === 0) return ElMessage.error("璇烽�夋嫨闇�瑕佹搷浣滅殑鏁版嵁!");
+    
+    // 绔欏彴閫夐」锛堝彲鏍规嵁瀹為檯涓氬姟璋冩暣閫夐」鍊硷級
+    const stationOptions = [
+      { label: "绔欏彴2", value: "2-1" },
+      { label: "绔欏彴3", value: "3-1" },
+      { label: "绔欏彴4", value: "4-1" },
+    ];
+    
+    // 鍒涘缓寮圭獥鎸傝浇鑺傜偣
+    const mountNode = document.createElement("div");
+    document.body.appendChild(mountNode);
+    
+    // 琛ㄥ崟鏁版嵁锛堢粦瀹氶�変腑鐨勭珯鍙帮級
+    const formData = reactive({
+      outStation: stationOptions[0].value, // 榛樿閫変腑绗竴涓珯鍙�
+    });
+    
+    // 鍒涘缓寮圭獥VNode
+    const vnode = createVNode(
+      ElDialog,
+      {
+        title: "搴撳瓨鎿嶄綔 - 閫夋嫨鍑哄簱绔欏彴",
+        width: "500px",
+        modelValue: true,
+        appendToBody: true,
+        "onUpdate:modelValue": (isVisible) => {
+          if (!isVisible) {
+            render(null, mountNode);
+            document.body.removeChild(mountNode);
+          }
+        },
+        style: {
+          padding: "20px 0",
+          borderRadius: "8px",
+        },
+      },
+      {
+        default: () =>
+          h(
+            ElForm,
+            {
+              model: formData,
+              rules: {
+                outStation: [
+                  { required: true, message: "璇烽�夋嫨鍑哄簱绔欏彴", trigger: "change" },
+                ],
+              },
+              ref: "stockTakeForm", // 琛ㄥ崟ref鏍囪瘑
+              labelWidth: "100px",
+              style: {
+                padding: "0 30px",
+              },
+            },
+            [
+              // 绔欏彴閫夋嫨涓嬫媺妗�
+              h(ElFormItem, {
+                label: "鍑哄簱绔欏彴",
+                prop: "outStation",
+                style: { marginBottom: "24px" },
+              }, [
+                h(ElSelect, {
+                  placeholder: "璇烽�夋嫨鍑哄簱绔欏彴",
+                  modelValue: formData.outStation,
+                  "onUpdate:modelValue": (val) => {
+                    formData.outStation = val;
+                  },
+                  style: {
+                    width: "100%",
+                    height: "40px",
+                    borderRadius: "4px",
+                    borderColor: "#dcdfe6",
+                  },
+                }, stationOptions.map((station) =>
+                  h(ElOption, { label: station.label, value: station.value })
+                )),
+              ]),
+              // 搴曢儴鎸夐挳鍖哄煙
+              h("div", {
+                style: {
+                  textAlign: "right",
+                  marginTop: "8px",
+                  paddingRight: "4px",
+                },
+              }, [
+                // 鍙栨秷鎸夐挳
+                h(ElButton, {
+                  type: "text",
+                  onClick: () => {
+                    render(null, mountNode);
+                    document.body.removeChild(mountNode);
+                    ElMessage.info("鍙栨秷搴撳瓨鎿嶄綔");
+                  },
+                  style: { marginRight: "8px", color: "#606266" },
+                }, "鍙栨秷"),
+                // 纭畾鎸夐挳
+                h(ElButton, {
+                  type: "primary",
+                  onClick: async () => {
+                    // 纭繚琛ㄥ崟ref宸叉寕杞�
+                    await this.$nextTick();
+                    const formRef = vnode.component.refs.stockTakeForm;
+
+                    if (!formRef) {
+                      ElMessage.error("琛ㄥ崟鍒濆鍖栧け璐ワ紝璇烽噸璇�");
+                      return;
+                    }
+
+                    // 琛ㄥ崟楠岃瘉
+                    try {
+                      await formRef.validate();
+                    } catch (err) {
+                      return;
+                    }
+
+                    // 鏋勯�犺姹傚弬鏁帮細
+                    // 1. 璇锋眰浣擄細鐩存帴浼犻�抯tockViews鏁扮粍锛堝搴斿悗绔疞ist<StockViewDTO>锛�
+                    // 2. outStation锛氶�氳繃鏌ヨ鍙傛暟浼犻�掞紙鍥犲悗绔湭鎸囧畾[FromBody]鎺ユ敹璇ュ弬鏁帮級
+                    const requestBody = stockViews; // 鐩存帴浼犻�掗�変腑鏁扮粍锛堢‘淇濇暟缁勫唴瀵硅薄缁撴瀯涓嶴tockViewDTO涓�鑷达級
+                    const outStation = formData.outStation;
+
+                    // 鎺ュ彛璇锋眰锛歅ost鏂瑰紡锛岃姹備綋浼爏tockViews鏁扮粍锛宱utStation鎷煎埌URL鏌ヨ鍙傛暟
+                    try {
+                      // 鎷兼帴鏌ヨ鍙傛暟锛堝鏋渙utStation鏈夌壒娈婂瓧绗︼紝鍙娇鐢╡ncodeURIComponent澶勭悊锛�
+                      const url = `api/Task/TakeOutbound?outStation=${encodeURIComponent(outStation)}`;
+                      
+                      const x = await this.http.post(
+                        url, // 甯︽煡璇㈠弬鏁扮殑URL
+                        requestBody, // 璇锋眰浣擄細stockViews鏁扮粍
+                        "鏁版嵁澶勭悊涓�"
+                      );
+
+                      if (!x.status) {
+                        ElMessage.error(x.message || "搴撳瓨鎿嶄綔澶辫触");
+                        return;
+                      }
+
+                      ElMessage.success("鎿嶄綔鎴愬姛");
+                      this.refresh(); // 鍘熷埛鏂伴�昏緫淇濈暀
+                    } catch (error) {
+                      console.error("搴撳瓨鎺ュ彛璇锋眰澶辫触锛�", error);
+                      ElMessage.error("璇锋眰澶辫触锛岃绋嶅悗閲嶈瘯");
+                    } finally {
+                      // 鏃犺鎴愬姛澶辫触锛屽叧闂脊绐�
+                      render(null, mountNode);
+                      document.body.removeChild(mountNode);
+                    }
+                  },
+                  style: { borderRadius: "4px", padding: "8px 20px" },
+                }, "纭畾鎿嶄綔"),
+              ]),
+            ]),
+      }
+    );
+
+    // 缁戝畾app涓婁笅鏂囷紙纭繚寮圭獥鍐呯粍浠舵甯稿伐浣滐級
+    vnode.appContext = this.$.appContext;
+    render(vnode, mountNode);
+  };
+}
     },
     onInited() {
       //妗嗘灦鍒濆鍖栭厤缃悗
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/router/viewGird.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/router/viewGird.js"
index 9b747c8..fc89499 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/router/viewGird.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/router/viewGird.js"
@@ -239,6 +239,14 @@
     component: () => import('@/views/system/Log.vue'),
     meta: {
     }
+  }, {
+    path: '/takeStockOrder',
+    name: 'takeStockOrder',
+    component: () => import('@/views/inbound/takeStockOrder.vue')
+  }, {
+    path: '/takeStockOrderDetail',
+    name: 'takeStockOrderDetail',
+    component: () => import('@/views/inbound/takeStockOrderDetail.vue')
   }
 ]
 
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/takeStockOrder.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/takeStockOrder.vue"
new file mode 100644
index 0000000..88f8af2
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/takeStockOrder.vue"
@@ -0,0 +1,291 @@
+
+<template>
+    <!-- <div>
+      <assemble-dist></assemble-dist>
+    </div> -->
+    <view-grid
+      ref="grid"
+      :columns="columns"
+      :detail="detail"
+      :editFormFields="editFormFields"
+      :editFormOptions="editFormOptions"
+      :searchFormFields="searchFormFields"
+      :searchFormOptions="searchFormOptions"
+      :table="table"
+      :extend="extend"
+    >
+    </view-grid>
+  </template>
+<script>
+  import extend from "@/extension/inbound/takeStockOrder.js";
+  import { ref, defineComponent } from "vue";
+  // import AssembleDistVue from '../charts/AssembleDist.vue';
+  export default defineComponent({
+    // components: {
+    //   'assemble-dist': AssembleDistVue,
+    // },
+    setup() {
+      //浣跨敤缁勪欢AssembleDist
+      const table = ref({ 
+        key: "id",
+        footer: "Foots",
+        cnName: "鐩樼偣鍗�",
+        name: "takeStockOrder",
+        url: "/TakeStockOrder/",
+        sortName: "id",
+      });
+  
+      const searchFormFields = ref({
+        orderNo:""
+      });
+      const searchFormOptions = ref([
+        [
+        { title: "鍗曟嵁缂栧彿", field: "orderNo", type: "like" },
+        ]
+      ]);
+  
+      const editFormFields = ref({
+        orderNo:"",
+        warehouseId: "",
+        remark:""
+      });
+      const editFormOptions = ref([
+      [
+        {
+          field: "orderNo",
+          title: "鍗曟嵁缂栧彿",
+          type: "string",
+          readonly: "true",
+        },
+        {
+          title: "浠撳簱",
+          field: "warehouseId",
+          type: "select",
+          dataKey: "warehouses",
+          data: [],
+          required: true,
+        },
+        {
+          field: "remark",
+          title: "澶囨敞",
+          type: "string",
+        }
+      ]
+      ]);
+      const columns = ref([
+        {
+          field: "id",
+          title: "Id",
+          type: "int",
+          width: 90,
+          hidden: true,
+          readonly: true,
+          require: true,
+          align: "left",
+        },
+        {
+          field: "orderNo",
+          title: "鐩樼偣鍗曞彿",
+          type: "string",
+          width: 150,
+          align: "left",
+        },
+        {
+          field: "takeStockStatus",
+          title: "鐩樼偣鐘舵��",
+          type: "string",
+          width: 120,
+          align: "left",
+          bind: { key: "takeStockStatusEnum", data: [] },
+        },
+        {
+          field: "allPalletCode",
+          title: "鍗曟嵁鐩樼偣鎵樼洏",
+          type: "string",
+          width: 600,
+          align: "left",
+        },
+        {
+          field: "creater",
+          title: "鍒涘缓浜�",
+          type: "string",
+          width: 90,
+          align: "left",
+        },
+        {
+          field: "createDate",
+          title: "鍒涘缓鏃堕棿",
+          type: "datetime",
+          width: 160,
+          align: "left",
+        },
+        {
+          field: "modifier",
+          title: "淇敼浜�",
+          type: "string",
+          width: 100,
+          align: "left",
+        },
+        {
+          field: "modifyDate",
+          title: "淇敼鏃堕棿",
+          type: "datetime",
+          width: 160,
+          align: "left",
+        },
+        {
+          field: "remark",
+          title: "鍑哄簱绔欏彴",
+          type: "string",
+          width: 100,
+          align: "left",
+        },
+      ]);
+      const detail = ref({
+        cnName: "鐩樼偣鏄庣粏",
+        table: "Dt_TakeStockOrderDetail",
+        columns: [
+          {
+            field: "id",
+            title: "Id",
+            type: "int",
+            width: 90,
+            hidden: true,
+            readonly: true,
+            require: true,
+            align: "left",
+          },
+          {
+            field: "takeStockId",
+            title: "鐩樼偣鍗曚富閿�",
+            type: "string",
+            width: 90,
+            align: "left",
+            hidden: true,
+          },
+          {
+            field: "takePalletCode",
+            title: "鐩樼偣鎵樼洏",
+            type: "string",
+            width: 150,
+            align: "left",
+            required: true,
+          },
+          {
+            field: "takeDetalStatus",
+            title: "鐩樼偣鏄庣粏鐘舵��",
+            type: "int",
+            width: 130,
+            align: "left",
+            bind: { key: "takeStockDetailStatusEnum", data: [] },
+          },
+          {
+            field: "materielCode",
+            title: "鐗╂枡缂栫爜",
+            type: "string",
+            width: 110,
+            align: "left",
+            required: true,
+          },
+          {
+            field: "materielName",
+            title: "鐗╂枡鍚嶇О",
+            type: "string",
+            width: 120,
+            align: "left",
+            required: true,
+          },
+          {
+            field: "batchNo",
+            title: "鎵规鍙�",
+            type: "string",
+            width: 130,
+            align: "left",
+            required: true,
+          },
+          {
+            field: "materielSpec",
+            title: "鐗╂枡鍚嶇О",
+            type: "string",
+            width: 120,
+            align: "left",
+            required: true,
+          },
+          {
+            field: "sysQty",
+            title: "璐﹂潰鏁伴噺",
+            type: "decimal",
+            width: 90,
+            align: "left",
+            required: true,
+            edit: { type: "decimal" }
+          },
+          {
+            field: "qty",
+            title: "瀹炵洏鏁伴噺",
+            type: "decimal",
+            width: 90,
+            align: "left",
+            required: true,
+            edit: { type: "decimal" }
+          },
+          {
+            field: "unit",
+            title: "鍗曚綅",
+            type: "string",
+            width: 90,
+            align: "left",
+          },
+          {
+            field: "creater",
+            title: "鍒涘缓浜�",
+            type: "string",
+            width: 90,
+            align: "left",
+          },
+          {
+            field: "createDate",
+            title: "鍒涘缓鏃堕棿",
+            type: "datetime",
+            width: 160,
+            align: "left",
+          },
+          {
+            field: "modifier",
+            title: "淇敼浜�",
+            type: "string",
+            width: 100,
+            align: "left",
+          },
+          {
+            field: "modifyDate",
+            title: "淇敼鏃堕棿",
+            type: "datetime",
+            width: 160,
+            align: "left",
+          },
+          {
+            field: "remark",
+            title: "澶囨敞",
+            type: "string",
+            width: 100,
+            align: "left",
+          },
+        ],
+        sortName: "id",
+        key: "id",
+      });
+      return {
+        table,
+        extend,
+        editFormFields,
+        editFormOptions,
+        searchFormFields,
+        searchFormOptions,
+        columns,
+        detail,
+      };
+    },
+  });
+  </script>
+        
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/takeStockOrderDetail.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/takeStockOrderDetail.vue"
new file mode 100644
index 0000000..28acfed
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/takeStockOrderDetail.vue"
@@ -0,0 +1,254 @@
+
+<template>
+    <!-- <div>
+      <assemble-dist></assemble-dist>
+    </div> -->
+    <view-grid
+      ref="grid"
+      :columns="columns"
+      :detail="detail"
+      :editFormFields="editFormFields"
+      :editFormOptions="editFormOptions"
+      :searchFormFields="searchFormFields"
+      :searchFormOptions="searchFormOptions"
+      :table="table"
+      :extend="extend"
+    >
+    </view-grid>
+  </template>
+<script>
+  import extend from "@/extension/inbound/takeStockOrderDetail.js";
+  import { ref, defineComponent } from "vue";
+  // import AssembleDistVue from '../charts/AssembleDist.vue';
+  export default defineComponent({
+    // components: {
+    //   'assemble-dist': AssembleDistVue,
+    // },
+    setup() {
+      //浣跨敤缁勪欢AssembleDist
+      const table = ref({ 
+        key: "id",
+        footer: "Foots",
+        cnName: "鐩樼偣鍗�",
+        name: "TakeStockOrderDetail",
+        url: "/TakeStockOrderDetail/",
+        sortName: "id",
+      });
+  
+      const searchFormFields = ref({
+        orderNo:""
+      });
+      const searchFormOptions = ref([
+        [
+        { title: "鐩樼偣鍗曟嵁", field: "takeStockNo", type: "like" },
+        { title: "鐩樼偣鏂欑", field: "takePalletCode", type: "like" },
+        { title: "鐗╂枡缂栧彿", field: "materielCode", type: "like" },
+        { title: "鎵规鍙�", field: "batchNo", type: "like" },
+
+        ],
+        [
+        { title: "鏉$爜", field: "barcode", type: "like" },
+        { title: "浠撳簱", field: "warehouseCode", type: "like" },
+        { title: "鍘傚尯", field: "factoryArea", type: "like" },
+        { title: "渚涘簲鍟嗙紪鍙�", field: "supplyCode", type: "like" },
+        ],
+        [
+        { title: "鍒涘缓浜�", field: "creater", type: "like" },
+        { title: "鍒涘缓鏃堕棿", field: "createDate", type: "datetime" },
+        ]
+      ]);
+  
+      const editFormFields = ref({
+        orderNo:"",
+        warehouseId: "",
+        remark:""
+      });
+      const editFormOptions = ref([
+      [
+        {
+          field: "orderNo",
+          title: "鍗曟嵁缂栧彿",
+          type: "string",
+          readonly: "true",
+        },
+        {
+          title: "浠撳簱",
+          field: "warehouseId",
+          type: "select",
+          dataKey: "warehouses",
+          data: [],
+          required: true,
+        },
+        {
+          field: "remark",
+          title: "澶囨敞",
+          type: "string",
+        }
+      ]
+      ]);
+      const columns = ref([
+        {
+            field: "id",
+            title: "Id",
+            type: "int",
+            width: 90,
+            hidden: true,
+            readonly: true,
+            require: true,
+            align: "left",
+          },
+          {
+            field: "takeStockId",
+            title: "鐩樼偣鍗曚富閿�",
+            type: "string",
+            width: 90,
+            align: "left",
+            hidden: true,
+          },
+          {
+            field: "takeStockNo",
+            title: "鐩樼偣鍗曟嵁",
+            type: "string",
+            width: 145,
+            align: "left",
+          },
+          {
+            field: "takePalletCode",
+            title: "鐩樼偣鏂欑",
+            type: "string",
+            width: 110,
+            align: "left",
+            required: true,
+          },
+          
+          {
+            field: "materielCode",
+            title: "鐗╂枡缂栫爜",
+            type: "string",
+            width: 130,
+            align: "left",
+            required: true,
+          },
+          {
+            field: "materielName",
+            title: "鐗╂枡鍚嶇О",
+            type: "string",
+            width: 120,
+            align: "left",
+            required: true,
+          },
+          {
+            field: "batchNo",
+            title: "鎵规鍙�",
+            type: "string",
+            width: 130,
+            align: "left",
+            required: true,
+          },
+          {
+            field: "barcode",
+            title: "鏉$爜",
+            type: "string",
+            width: 120,
+            align: "left",
+            required: true,
+          },
+          {
+            field: "sysQty",
+            title: "璐﹂潰鏁伴噺",
+            type: "decimal",
+            width: 90,
+            align: "left",
+            required: true,
+            edit: { type: "decimal" }
+          },
+          {
+            field: "qty",
+            title: "瀹炵洏鏁伴噺",
+            type: "decimal",
+            width: 90,
+            align: "left",
+            required: true,
+            edit: { type: "decimal" }
+          },
+          {
+            field: "unit",
+            title: "鍗曚綅",
+            type: "string",
+            width: 90,
+            align: "left",
+          },
+          {
+            field: "takeDetalStatus",
+            title: "鐩樼偣鏄庣粏鐘舵��",
+            type: "int",
+            width: 130,
+            align: "left",
+            bind: { key: "takeStockDetailStatusEnum", data: [] },
+          },
+          {
+            field: "warehouseCode",
+            title: "浠撳簱缂栧彿",
+            type: "string",
+            width: 90,
+            align: "left",
+          },
+          {
+            field: "factoryArea",
+            title: "鍘傚尯",
+            type: "string",
+            width: 90,
+            align: "left",
+          },
+          {
+            field: "supplyCode",
+            title: "渚涘簲鍟嗙紪鍙�",
+            type: "string",
+            width: 90,
+            align: "left",
+          },
+          {
+            field: "creater",
+            title: "鍒涘缓浜�",
+            type: "string",
+            width: 90,
+            align: "left",
+          },
+          {
+            field: "createDate",
+            title: "鍒涘缓鏃堕棿",
+            type: "datetime",
+            width: 160,
+            align: "left",
+          },
+          {
+            field: "remark",
+            title: "澶囨敞",
+            type: "string",
+            width: 100,
+            align: "left",
+          },
+      ]);
+      const detail = ref({
+        cnName: "鐩樼偣鏄庣粏",
+        table: "Dt_TakeStockOrderDetail",
+        columns: [
+          
+        ],
+        sortName: "id",
+        key: "id",
+      });
+      return {
+        table,
+        extend,
+        editFormFields,
+        editFormOptions,
+        searchFormFields,
+        searchFormOptions,
+        columns,
+        detail,
+      };
+    },
+  });
+  </script>
+        
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/outboundOrder.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/outboundOrder.vue"
index 99010c3..d3d1a67 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/outboundOrder.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/outboundOrder.vue"
@@ -350,7 +350,6 @@
           width: 90,
           align: "left",
           edit: { type: "number" },
-          readonly:true
         },
         {
           field: "rowNo",
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/Inbound/CompleteStockTakeDTO.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/Inbound/CompleteStockTakeDTO.cs"
new file mode 100644
index 0000000..0ea1bed
--- /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_DTO/Inbound/CompleteStockTakeDTO.cs"
@@ -0,0 +1,23 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.Attributes;
+
+namespace WIDESEA_DTO.Inbound
+{
+    public class CompleteStockTakeDTO
+    {
+        
+        public string orderNo { get; set; }
+
+        public string boxNo { get; set; }
+
+        public string barcode { get; set; }
+
+        public decimal actualQuantity { get; set; }
+
+        public decimal stockQuantity { 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_IInboundService/ITakeStockOrderDetailService.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_IInboundService/ITakeStockOrderDetailService.cs"
new file mode 100644
index 0000000..3e7ec4e
--- /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_IInboundService/ITakeStockOrderDetailService.cs"
@@ -0,0 +1,14 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.BaseServices;
+using WIDESEA_Model.Models;
+
+namespace WIDESEA_IInboundService
+{
+    public interface ITakeStockOrderDetailService:IService<Dt_TakeStockOrderDetail>
+    {
+    }
+}
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_IInboundService/ITakeStockOrderService.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_IInboundService/ITakeStockOrderService.cs"
new file mode 100644
index 0000000..74387b8
--- /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_IInboundService/ITakeStockOrderService.cs"
@@ -0,0 +1,24 @@
+锘縰sing Microsoft.AspNetCore.Mvc;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core;
+using WIDESEA_Core.BaseServices;
+using WIDESEA_DTO.Inbound;
+using WIDESEA_Model.Models;
+
+namespace WIDESEA_IInboundService
+{
+    public interface ITakeStockOrderService : IService<Dt_TakeStockOrder>
+    {
+        WebResponseContent ValidateBoxNo(string orderNo, string boxNo);
+
+        WebResponseContent ValidateBarcode(string boxNo, string barcode);
+
+        WebResponseContent CompleteStockTake([FromBody] CompleteStockTakeDTO completeStockTakeDTO);
+
+        WebResponseContent ReturnBox(string orderNo, string boxNo);
+    }
+}
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/TakeStockOrderDetailService.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/TakeStockOrderDetailService.cs"
new file mode 100644
index 0000000..f5f7395
--- /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_InboundService/TakeStockOrderDetailService.cs"
@@ -0,0 +1,21 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.BaseRepository;
+using WIDESEA_Core.BaseServices;
+using WIDESEA_IInboundService;
+using WIDESEA_Model.Models;
+
+namespace WIDESEA_InboundService
+{
+    public class TakeStockOrderDetailService : ServiceBase<Dt_TakeStockOrderDetail, IRepository<Dt_TakeStockOrderDetail>>, ITakeStockOrderDetailService
+
+    {
+        public IRepository<Dt_TakeStockOrderDetail> Repository => BaseDal;
+        public TakeStockOrderDetailService(IRepository<Dt_TakeStockOrderDetail> BaseDal) : base(BaseDal)
+        {
+        }
+    }
+}
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/TakeStockOrderService.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/TakeStockOrderService.cs"
new file mode 100644
index 0000000..d98ba61
--- /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_InboundService/TakeStockOrderService.cs"
@@ -0,0 +1,252 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.BaseServices;
+using WIDESEA_Core;
+using WIDESEA_IInboundService;
+using WIDESEA_Model.Models;
+using WIDESEA_Common.OrderEnum;
+using WIDESEA_Core.Helper;
+using Microsoft.AspNetCore.Mvc.RazorPages;
+using WIDESEA_Core.Enums;
+using SqlSugar;
+using WIDESEA_Core.BaseRepository;
+using WIDESEA_Common.StockEnum;
+using Microsoft.AspNetCore.Mvc;
+using WIDESEA_DTO.Inbound;
+using WIDESEA_DTO.ReturnMES;
+using MailKit.Search;
+using static System.Collections.Specialized.BitVector32;
+using WIDESEA_Common.CommonEnum;
+using WIDESEA_Common.TaskEnum;
+using WIDESEA_IBasicService;
+
+namespace WIDESEA_InboundService
+{
+    public class TakeStockOrderService : ServiceBase<Dt_TakeStockOrder, IRepository<Dt_TakeStockOrder>>, ITakeStockOrderService
+    {
+        public IRepository<Dt_TakeStockOrder> Repository => BaseDal;
+        private readonly IUnitOfWorkManage _unitOfWorkManage;
+        private readonly IRepository<Dt_TakeStockOrder> _takeStockOrder;
+        private readonly IRepository<Dt_StockInfo> _stockInfoRepository;
+        private readonly IRepository<Dt_TakeStockOrderDetail> _takeStockOrderDetail;
+        private readonly IRepository<Dt_Task> _taskRepository;
+        private readonly ILocationInfoService _locationInfoService;
+        public TakeStockOrderService(IRepository<Dt_TakeStockOrder> BaseDal, IUnitOfWorkManage unitOfWorkManage,IRepository<Dt_TakeStockOrder> takeStockOrder,IRepository<Dt_StockInfo> stockInfoRepository,IRepository<Dt_TakeStockOrderDetail> takeStockOrderDetail,IRepository<Dt_Task> taskRepository,ILocationInfoService locationInfoService) : base(BaseDal)
+        {
+            _unitOfWorkManage = unitOfWorkManage;
+            _takeStockOrder = takeStockOrder;
+            _stockInfoRepository = stockInfoRepository;
+            _takeStockOrderDetail = takeStockOrderDetail;
+            _taskRepository = taskRepository;
+            _locationInfoService = locationInfoService;
+        }
+
+        public WebResponseContent ValidateBoxNo(string orderNo, string boxNo)
+        {
+            try
+            {
+                Dt_StockInfo stockInfo = _stockInfoRepository.QueryFirst(x => x.PalletCode == boxNo);
+                if (stockInfo == null) {
+                    return WebResponseContent.Instance.Error("鏈壘鍒拌鎵樼洏搴撳瓨");
+                }
+                if(stockInfo.StockStatus != StockStatusEmun.鐩樼偣鍑哄簱瀹屾垚.ObjToInt())
+                {
+                    return WebResponseContent.Instance.Error("璇ユ墭鐩樺浜庨潪鐩樼偣鐘舵�侊紝璇锋鏌ョ洏鐐逛换鍔�");
+                }
+                Dt_TakeStockOrder takeStockOrder = _takeStockOrder.QueryFirst(x=>x.OrderNo == orderNo);
+                if (takeStockOrder == null)
+                {
+                    return WebResponseContent.Instance.Error("鏈壘鍒拌鐩樼偣鍗曟嵁");
+                }
+                if (takeStockOrder.AllPalletCode.Contains(","))
+                {
+                    var remarkValues = takeStockOrder.AllPalletCode
+                        .Split(',')
+                        .Select(s => s.Trim()) 
+                        .Where(s => !string.IsNullOrWhiteSpace(s)) 
+                        .ToList();
+                    if (remarkValues.Count == 0)
+                    {
+                        return WebResponseContent.Instance.Error("鐩樼偣鍗曠鍙蜂粎鍖呭惈閫楀彿锛屾棤鏈夋晥绠卞彿鏁版嵁");
+                    }
+
+                    bool isMatch = remarkValues.Any(val => val.Equals(boxNo, StringComparison.OrdinalIgnoreCase));
+                    if (!isMatch)
+                    {
+                        return WebResponseContent.Instance.Error($"绠卞彿銆恵boxNo}銆戞湭鍦ㄧ洏鐐瑰崟绠卞彿銆恵takeStockOrder.Remark}銆戜腑鎵惧埌鍖归厤椤�");
+                    }
+                }
+                else
+                {
+                    bool isMatch = takeStockOrder.Remark.Trim().Equals(boxNo, StringComparison.OrdinalIgnoreCase);
+                    if (!isMatch)
+                    {
+                        return WebResponseContent.Instance.Error($"绠卞彿銆恵boxNo}銆戜笌鐩樼偣鍗曠鍙枫�恵takeStockOrder.Remark}銆戜笉鍖归厤");
+                    }
+                }
+
+                return WebResponseContent.Instance.OK();
+            }
+            catch(Exception ex)
+            {
+                return WebResponseContent.Instance.Error(ex.Message);
+            }
+        }
+
+        public WebResponseContent ValidateBarcode(string boxNo, string barcode)
+        {
+            try
+            {
+                Dt_StockInfo stockInfo = _stockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == boxNo).Includes(x => x.Details).First();
+                if(stockInfo == null)
+                {
+                    return WebResponseContent.Instance.Error("鏈壘鍒拌鏂欑搴撳瓨淇℃伅");
+                }
+                if(stockInfo.Details == null)
+                {
+                    return WebResponseContent.Instance.Error("鏈壘鍒拌鏂欑搴撳瓨");
+                }
+                List<string> barcodes = stockInfo.Details.Select(x => x.Barcode).ToList();
+
+                bool isMatch = barcodes.Any(val => val.Equals(barcode, StringComparison.OrdinalIgnoreCase));
+                if (!isMatch)
+                {
+                    return WebResponseContent.Instance.Error($"鏉$爜銆恵barcode}銆戞湭鍦ㄣ�恵boxNo}銆戞枡绠辨潯鐮佷腑鎵惧埌鍖归厤椤�");
+                }
+                var stockDetail = stockInfo.Details.FirstOrDefault(x=>x.Barcode == barcode);
+
+                var resultData = new { stockQuantity = stockDetail.StockQuantity };
+
+                return WebResponseContent.Instance.OK(data:resultData);
+            }
+            catch(Exception ex)
+            {
+                return WebResponseContent.Instance.Error(ex.Message);
+            }
+        }
+
+        public WebResponseContent CompleteStockTake([FromBody] CompleteStockTakeDTO completeStockTakeDTO)
+        {
+            try
+            {
+                Dt_TakeStockOrder takeStockOrder = _takeStockOrder.QueryFirst(x=>x.OrderNo == completeStockTakeDTO.orderNo);
+                if (takeStockOrder == null)
+                {
+                    return WebResponseContent.Instance.Error("鏈壘鍒拌鐩樼偣鍗曟嵁");
+                }
+                Dt_StockInfo stockInfo = _stockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == completeStockTakeDTO.boxNo).Includes(x=>x.Details).First();
+                if(stockInfo == null)
+                {
+                    return WebResponseContent.Instance.Error("鏈壘鍒拌鎵樼洏搴撳瓨");
+                }
+                Dt_StockInfoDetail stockInfoDetail = stockInfo.Details.FirstOrDefault(x => x.Barcode == completeStockTakeDTO.barcode);
+                if(stockInfoDetail == null)
+                {
+                    return WebResponseContent.Instance.Error("鏉$爜搴撳瓨鏁版嵁鏈壘鍒板尮閰嶆暟鎹�");
+                }
+                Dt_TakeStockOrderDetail takeStockOrderDetail = new Dt_TakeStockOrderDetail()
+                {
+                    TakeStockId = takeStockOrder.Id,
+                    MaterielCode = stockInfoDetail.MaterielCode,
+                    MaterielName = stockInfoDetail.MaterielName??"",
+                    BatchNo = stockInfoDetail.BatchNo,
+                    TakePalletCode = completeStockTakeDTO.boxNo,
+                    TakeDetalStatus = TakeStockDetailStatusEnum.鐩樼偣瀹屾垚.ObjToInt(),
+                    Unit = stockInfoDetail.Unit,
+                    SysQty = completeStockTakeDTO.stockQuantity,
+                    Qty =completeStockTakeDTO.actualQuantity,
+                    Remark = completeStockTakeDTO.stockQuantity-completeStockTakeDTO.actualQuantity>=0 ?"鐩樹簭":"鐩樼泩",
+                    barcode = completeStockTakeDTO.barcode,
+                    WarehouseCode = stockInfoDetail.WarehouseCode??"",
+                    FactoryArea = stockInfoDetail.FactoryArea,
+                    SupplyCode = stockInfoDetail.SupplyCode??"",
+                    TakeStockNo = takeStockOrder.OrderNo,
+
+                };
+                _unitOfWorkManage.BeginTran();
+                _takeStockOrderDetail.AddData(takeStockOrderDetail);
+                _unitOfWorkManage.CommitTran();
+                return WebResponseContent.Instance.OK();
+            } 
+            catch (Exception ex) 
+            {
+                _unitOfWorkManage.RollbackTran();
+                return WebResponseContent.Instance.Error(ex.Message);
+            }
+        }
+
+        public WebResponseContent ReturnBox(string orderNo, string boxNo)
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                Dt_TakeStockOrder takeStockOrder = _takeStockOrder.QueryFirst(x=>x.OrderNo == orderNo);
+                if(takeStockOrder == null)
+                {
+                    return content.Error("鏈壘鍒拌鐩樼偣鍗曟嵁");
+                }
+                var stock = _stockInfoRepository.QueryFirst(x => x.PalletCode == boxNo);
+
+                if (stock == null)
+                {
+                    return content.Error($"鏈壘鍒版墭鐩榹boxNo}搴撳瓨淇℃伅涓嶅厑璁稿洖搴�");
+                }
+
+                var task = _taskRepository.QueryFirst(x => x.PalletCode == boxNo);
+                    
+
+                if (task != null)
+                {
+                    return content.Error($"鎵樼洏{boxNo}瀛樺湪浠诲姟鍥炲簱澶辫触!");
+                }
+                if(stock.StockStatus != StockStatusEmun.鐩樼偣鍑哄簱瀹屾垚.ObjToInt())
+                {
+                    return content.Error("璇ユ墭鐩樼姸鎬佷笉瀵�,涓嶅厑璁哥洏鐐瑰叆搴�");
+                }
+                stock.StockStatus = StockStatusEmun.鍏ュ簱纭.ObjToInt();
+
+                takeStockOrder.TakeStockStatus = TakeStockStatusEnum.鐩樼偣瀹屾垚.ObjToInt();
+                // 鍒嗛厤鏂拌揣浣�
+                var newLocation = _locationInfoService.AssignLocation(stock.LocationType);
+
+                var newTask = new Dt_Task()
+                {
+                    CurrentAddress = takeStockOrder.Remark,
+                    Grade = 0,
+                    PalletCode = boxNo,
+                    NextAddress = "",
+                    OrderNo = takeStockOrder.OrderNo,
+                    Roadway = newLocation.RoadwayNo,
+                    SourceAddress = takeStockOrder.Remark,
+                    TargetAddress = newLocation.LocationCode,
+                    TaskStatus = (int)TaskStatusEnum.New,
+                    TaskType = TaskTypeEnum.InInventory.ObjToInt(),
+                    PalletType = stock.PalletType,
+                    WarehouseId = stock.WarehouseId
+                };
+                _unitOfWorkManage.BeginTran();
+                _stockInfoRepository.UpdateData(stock);
+                _takeStockOrder.UpdateData(takeStockOrder);
+                _taskRepository.AddData(newTask);
+                _unitOfWorkManage.CommitTran();
+
+                //var moveResult = await _eSSApiService.MoveContainerAsync(new MoveContainerRequest
+                //{
+                //    slotCode = movestations[station],
+                //    containerCode = palletCode
+                //});
+                return content.OK();
+
+            }
+            catch (Exception ex)
+            {
+                _unitOfWorkManage.RollbackTran();
+                return content.Error(ex.Message);
+            }
+        }
+    }
+    
+}
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_TakeStockOrderDetail.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_TakeStockOrderDetail.cs"
index 2c6c80b..487b615 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_TakeStockOrderDetail.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_TakeStockOrderDetail.cs"
@@ -1,4 +1,5 @@
-锘縰sing SqlSugar;
+锘縰sing Magicodes.ExporterAndImporter.Core;
+using SqlSugar;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -18,108 +19,126 @@
         /// 涓婚敭
         /// </summary>
         [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")]
+        [ExporterHeader(DisplayName = "涓婚敭")]
         public int Id { get; set; }
 
         /// <summary>
         /// 鐩樼偣鍗曚富閿�
         /// </summary>
         [SugarColumn(IsNullable = false, ColumnDescription = "鐩樼偣鍗曚富閿�")]
+        [ExporterHeader(DisplayName = "鐩樼偣鍗曚富閿�")]
         public int TakeStockId { get; set; }
 
         /// <summary>
         /// 鐗╂枡缂栫爜
         /// </summary>
         [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鐗╂枡缂栫爜")]
+        [ExporterHeader(DisplayName = "鐗╂枡缂栫爜")]
         public string MaterielCode { get; set; }
 
         /// <summary>
         /// 鐗╂枡鍚嶇О
         /// </summary>
         [SugarColumn(IsNullable = false, Length = 200, ColumnDescription = "鐗╂枡鍚嶇О")]
+        [ExporterHeader(DisplayName = "鐗╂枡鍚嶇О")]
         public string MaterielName { get; set; }
 
         /// <summary>
         /// 鎵规鍙�
         /// </summary>
         [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鎵规鍙�")]
+        [ExporterHeader(DisplayName = "鎵规鍙�")]
         public string BatchNo { get; set; }
 
         /// <summary>
         /// 鐗╂枡瑙勬牸
         /// </summary>
         [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "鐗╂枡瑙勬牸")]
+        [ExporterHeader(DisplayName = "鐗╂枡瑙勬牸")]
         public string MaterielSpec { get; set; }
 
         /// <summary>
         /// 鍘熶粨浣�
         /// </summary>
         [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鍘熶粨浣�")]
+        [ExporterHeader(DisplayName = "鍘熶粨浣�")]
         public string LocationCode { get; set; }
 
         /// <summary>
         /// 鐩樼偣鎵樼洏
         /// </summary>
         [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鐩樼偣鎵樼洏")]
+        [ExporterHeader(DisplayName = "鐩樼偣鎵樼洏")]
         public string TakePalletCode { get; set; }
 
         /// <summary>
         /// 鐩樼偣鏄庣粏鐘舵��
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDescription = "鐩樼偣鏄庣粏鐘舵��")]
+        [ExporterHeader(DisplayName = "鐩樼偣鏄庣粏鐘舵��")]
         public int TakeDetalStatus { get; set; }
 
         /// <summary>
         /// 鍗曚綅
         /// </summary>
         [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鍗曚綅")]
+        [ExporterHeader(DisplayName = "鍗曚綅")]
         public string Unit { get; set; }
 
         /// <summary>
         /// 璐﹂潰鏁伴噺
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDescription = "璐﹂潰鏁伴噺")]
+        [ExporterHeader(DisplayName = "璐﹂潰鏁伴噺")]
         public decimal SysQty { get; set; }
 
         /// <summary>
         /// 瀹炵洏鏁伴噺
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDescription = "瀹炵洏鏁伴噺")]
+        [ExporterHeader(DisplayName = "瀹炵洏鏁伴噺")]
         public decimal Qty { get; set; }
 
         /// <summary>
         /// 澶囨敞
         /// </summary>
         [SugarColumn(IsNullable = true, Length = 500, ColumnDescription = "澶囨敞")]
+        [ExporterHeader(DisplayName = "澶囨敞")]
         public string Remark { get; set; }
 
         /// <summary>
         /// 鏉$爜
         /// </summary>
         [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鏉$爜")]
+        [ExporterHeader(DisplayName = "鏉$爜")]
         public string barcode { get; set; }
 
         /// <summary>
         /// 鐗╂枡浠撳簱
         /// </summary>
         [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "鐗╂枡浠撳簱")]
+        [ExporterHeader(DisplayName = "鐗╂枡浠撳簱")]
         public string WarehouseCode { get; set; }
 
         /// <summary>
         /// 鍘傚尯
         /// </summary>
         [SugarColumn(IsNullable = true, Length = 10, ColumnDescription = "鍘傚尯")]
+        [ExporterHeader(DisplayName = "鍘傚尯")]
         public string FactoryArea { get; set; }
 
         /// <summary>
         /// 渚涘簲鍟嗙紪鍙�
         /// </summary>
         [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "渚涘簲鍟嗙紪鍙�")]
+        [ExporterHeader(DisplayName = "渚涘簲鍟嗙紪鍙�")]
         public string SupplyCode { get; set; }
 
         /// <summary>
         /// 鐩樼偣鍗曞崟鎹�
         /// </summary>
         [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鐩樼偣鍗曞崟鎹�")]
+        [ExporterHeader(DisplayName = "鐩樼偣鍗曞崟鎹�")]
         public string TakeStockNo { 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_SystemService/Sys_DictionaryService.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_SystemService/Sys_DictionaryService.cs"
index 3e3aea1..5b4bdcb 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_SystemService/Sys_DictionaryService.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_SystemService/Sys_DictionaryService.cs"
@@ -295,6 +295,54 @@
                             result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
                         }
                         break;
+                    case "takeStockStatusEnum":
+                        {
+                            List<object> data = new List<object>();
+                            Type type = typeof(TakeStockStatusEnum);
+                            List<int> enums = Enum.GetValues(typeof(TakeStockStatusEnum)).Cast<int>().ToList();
+                            int index = 0;
+                            foreach (var item in enums)
+                            {
+                                FieldInfo? fieldInfo = typeof(TakeStockStatusEnum).GetField(((TakeStockStatusEnum)item).ToString());
+                                DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
+                                if (description != null)
+                                {
+                                    data.Add(new { key = item.ToString(), value = description.Description });
+                                }
+                                else
+                                {
+                                    data.Add(new { key = item.ToString(), value = item.ToString() });
+                                }
+                                index++;
+                            }
+
+                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
+                        }
+                        break;
+                    case "takeStockDetailStatusEnum":
+                        {
+                            List<object> data = new List<object>();
+                            Type type = typeof(TakeStockDetailStatusEnum);
+                            List<int> enums = Enum.GetValues(typeof(TakeStockDetailStatusEnum)).Cast<int>().ToList();
+                            int index = 0;
+                            foreach (var item in enums)
+                            {
+                                FieldInfo? fieldInfo = typeof(TakeStockDetailStatusEnum).GetField(((TakeStockDetailStatusEnum)item).ToString());
+                                DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
+                                if (description != null)
+                                {
+                                    data.Add(new { key = item.ToString(), value = description.Description });
+                                }
+                                else
+                                {
+                                    data.Add(new { key = item.ToString(), value = item.ToString() });
+                                }
+                                index++;
+                            }
+
+                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
+                        }
+                        break;
                 }
                 return result;
             }
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 107197e..c095cfd 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"
@@ -94,6 +94,7 @@
         private readonly IRepository<Dt_AllocateMaterialInfo_Hty> _allocateMaterialInfo_Hty;
         private readonly HttpClientHelper _httpClientHelper;
         private readonly IBasicService _basicService;
+        private readonly IRepository<Dt_TakeStockOrder> _takeStockOrder;
         public IRepository<Dt_Task> Repository => BaseDal;
 
         private Dictionary<string, SqlSugar.OrderByType> _taskOrderBy = new()
@@ -113,7 +114,7 @@
 
         public List<int> TaskOutboundTypes => typeof(TaskTypeEnum).GetEnumIndexList();
 
-        public TaskService(IRepository<Dt_Task> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_StockInfo> stockRepository, ILocationInfoService locationInfoService, IInboundOrderService inboundOrderService, ILocationStatusChangeRecordService locationStatusChangeRecordService, IESSApiService eSSApiService, ILogger<TaskService> logger, IStockService stockService, IRecordService recordService, IInboundOrderDetailService inboundOrderDetailService, IOutboundOrderService outboundOrderService, IOutboundOrderDetailService outboundOrderDetailService, IInvokeMESService invokeMESService, IOutStockLockInfoService outStockLockInfoService, IAllocateService allocateService, IRepository<Dt_OutboundBatch> outboundBatchRepository, IRepository<Dt_ReCheckOrder> reCheckOrderRepository, IRepository<Dt_AllocateOrderDetail> allocateOrderDetailRepository, IRepository<Dt_AllocateOrder> allocateOrderRepository, IMaterialUnitService materialUnitService, ITask_HtyService task_HtyService, IRepository<Dt_AllocateMaterialInfo> allocateMaterialInfo, IRepository<Dt_AllocateMaterialInfo_Hty> allocateMaterialInfo_Hty, HttpClientHelper httpClientHelper, IBasicService basicService) : base(BaseDal)
+        public TaskService(IRepository<Dt_Task> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_StockInfo> stockRepository, ILocationInfoService locationInfoService, IInboundOrderService inboundOrderService, ILocationStatusChangeRecordService locationStatusChangeRecordService, IESSApiService eSSApiService, ILogger<TaskService> logger, IStockService stockService, IRecordService recordService, IInboundOrderDetailService inboundOrderDetailService, IOutboundOrderService outboundOrderService, IOutboundOrderDetailService outboundOrderDetailService, IInvokeMESService invokeMESService, IOutStockLockInfoService outStockLockInfoService, IAllocateService allocateService, IRepository<Dt_OutboundBatch> outboundBatchRepository, IRepository<Dt_ReCheckOrder> reCheckOrderRepository, IRepository<Dt_AllocateOrderDetail> allocateOrderDetailRepository, IRepository<Dt_AllocateOrder> allocateOrderRepository, IMaterialUnitService materialUnitService, ITask_HtyService task_HtyService, IRepository<Dt_AllocateMaterialInfo> allocateMaterialInfo, IRepository<Dt_AllocateMaterialInfo_Hty> allocateMaterialInfo_Hty, HttpClientHelper httpClientHelper, IBasicService basicService,IRepository<Dt_TakeStockOrder> takeStockOrder) : base(BaseDal)
         {
             _mapper = mapper;
             _unitOfWorkManage = unitOfWorkManage;
@@ -141,6 +142,7 @@
             _allocateMaterialInfo_Hty = allocateMaterialInfo_Hty;
             _httpClientHelper = httpClientHelper;
             _basicService = basicService;
+            _takeStockOrder = takeStockOrder;
         }
 
         public async Task TaskStatusChange(string taskNum, TaskStatusEnum taskStatusEnum)
@@ -1849,5 +1851,134 @@
             return TaskCompleted(TaskNum);
         }
 
+        /// <summary>
+        /// 鐩樼偣鍑哄簱瀹屾垚
+        /// </summary>
+        public WebResponseContent OutInventoryTaskCompleted(Dt_Task task)
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                task = BaseDal.QueryFirst(x => x.TaskNum == task.TaskNum);
+                if (task == null)
+                {
+                    return WebResponseContent.Instance.Error("鏈壘鍒颁换鍔′俊鎭�");
+                }
+                var SourceAddress = task.SourceAddress;
+                Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.QueryFirst(x=>x.PalletCode == task.PalletCode);
+                Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == SourceAddress);
+                if (stockInfo == null) return WebResponseContent.Instance.Error("鏈壘鍒板簱瀛樹俊鎭�");
+                if (locationInfo == null) return WebResponseContent.Instance.Error("鏈壘鍒拌揣浣嶄俊鎭�");
+                //鑾峰彇瀵瑰簲鐩樼偣鍗�
+                Dt_TakeStockOrder takeStockOrder = _takeStockOrder.Db.Queryable<Dt_TakeStockOrder>().Where(x => x.OrderNo == task.OrderNo).Includes(x => x.Details).First();
+                if (takeStockOrder == null)
+                {
+                    return content.Error($"鐩樼偣鍗晎task.OrderNo}涓嶅瓨鍦�");
+                }
+                if (takeStockOrder.TakeStockStatus != TakeStockStatusEnum.鐩樼偣涓�.ObjToInt())
+                {
+                    return content.Error($"鐩樼偣鍗晎task.OrderNo}鐩樼偣宸插畬鎴愭垨鏈紑濮�");
+                }
+                if (stockInfo.StockStatus != StockStatusEmun.鍑哄簱閿佸畾.ObjToInt())
+                {
+                    return content.Error($"{stockInfo.PalletCode}搴撳瓨鐘舵�佷笉姝g‘");
+                }
+                if (locationInfo.LocationStatus != LocationStatusEnum.Lock.ObjToInt())
+                {
+                    return content.Error($"{locationInfo.LocationCode}璐т綅鐘舵�佷笉姝g‘");
+                }
+                
+                stockInfo.StockStatus = StockStatusEmun.鐩樼偣鍑哄簱瀹屾垚.ObjToInt();
+                stockInfo.LocationCode = "";
+                task.TaskStatus = TaskStatusEnum.Finish.ObjToInt();
+                int beforeStatus = locationInfo.LocationStatus;
+                locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt();
+                _unitOfWorkManage.BeginTran();
+                //璐т綅鍙樺姩璁板綍
+                _basicService.LocationInfoService.UpdateData(locationInfo);
+                _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, LocationStatusEnum.Free.ObjToInt(),  takeStockOrder?.OrderNo ?? "", task.TaskNum);
+                _stockRepository.UpdateData(stockInfo);
+                BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.鑷姩瀹屾垚 : OperateTypeEnum.浜哄伐瀹屾垚);
+                _unitOfWorkManage.CommitTran();
+                content.OK();
+            }
+            catch (Exception ex)
+            {
+                _unitOfWorkManage.RollbackTran();
+                content.Error(ex.Message);
+            }
+            return content;
+        }
+
+        /// <summary>
+        /// 鐩樼偣鍏ュ簱瀹屾垚
+        /// </summary>
+        /// <param name="task"></param>
+        /// <returns></returns>
+        public async Task<WebResponseContent> InInventoryTaskCompleted(Dt_Task task)
+        {
+
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+
+                Dt_LocationInfo locationInfo = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress);
+                if (locationInfo == null)
+                {
+                    return content.Error($"鏈壘鍒板搴旂殑缁堢偣璐т綅淇℃伅");
+                }
+                Dt_StockInfo stockInfo = _stockRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == task.PalletCode && x.WarehouseId == task.WarehouseId).First();
+                if (stockInfo == null)
+                {
+                    return WebResponseContent.Instance.Error($"鏈壘鍒版墭鐩樺搴旂殑缁勭洏淇℃伅");
+                }
+
+                if (!string.IsNullOrEmpty(stockInfo.LocationCode))
+                {
+                    return WebResponseContent.Instance.Error($"璇ユ墭鐩樺凡缁戝畾璐т綅");
+                }
+                if (locationInfo.LocationStatus == LocationStatusEnum.InStock.ObjToInt())
+                {
+                    return WebResponseContent.Instance.Error($"璐т綅鐘舵�佷笉姝g‘");
+                }
+
+
+                var beforelocationStatus = locationInfo.LocationStatus;
+                locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
+                
+
+                stockInfo.LocationCode = locationInfo.LocationCode;
+                stockInfo.PalletCode = task.PalletCode;
+                stockInfo.LocationCode = task.TargetAddress;
+                stockInfo.StockStatus = StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt();
+                task.TaskStatus = TaskStatusEnum.Finish.ObjToInt();
+
+                _unitOfWorkManage.BeginTran();
+                _locationInfoService.Repository.UpdateData(locationInfo);
+                _stockRepository.UpdateData(stockInfo);
+                var result = _task_HtyService.DeleteAndMoveIntoHty(task, OperateTypeEnum.浜哄伐鍒犻櫎);
+                _unitOfWorkManage.CommitTran();
+
+                if (!result)
+                {
+                    await Db.Deleteable(task).ExecuteCommandAsync();
+                }
+                try
+                {
+                    _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforelocationStatus, StockChangeType.Inbound.ObjToInt(), "", task.TaskNum);
+                }
+                catch (Exception ex)
+                {
+                    _logger.LogInformation($"InEmptyTaskCompleted AddLocationStatusChangeRecord : {ex.Message} ");
+                }
+                return content;
+            }
+            catch (Exception ex)
+            {
+                _unitOfWorkManage.RollbackTran();
+                return await Task.FromResult(WebResponseContent.Instance.Error(ex.Message));
+            }
+        }
     }
 }
+
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 e85a591..87f4d36 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"
@@ -393,7 +393,7 @@
                             TargetAddress = outStation,
                             TaskStatus = TaskStatusEnum.New.ObjToInt(),
                             TaskType = taskType.ObjToInt(),
-                            // TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
+                            //TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
                             PalletType = stockInfo.PalletType,
                             WarehouseId = stockInfo.WarehouseId,
                         };
@@ -1127,7 +1127,7 @@
                 }
                 //鑾峰彇璐т綅
                 List<string> locStrs = stockInfos.Select(x => x.LocationCode).ToList();
-                List<Dt_LocationInfo> locationInfos = (List<Dt_LocationInfo>)_locationInfoService.Db.Queryable<Dt_LocationInfo>().Where(x => locStrs.Contains(x.LocationCode));
+                List<Dt_LocationInfo> locationInfos =_locationInfoService.Db.Queryable<Dt_LocationInfo>().Where(x => locStrs.Contains(x.LocationCode)).ToList();
                 if (stockInfos.Count != locationInfos.Count)
                 {
                     string? locStr = locStrs.FirstOrDefault(x => !locationInfos.Select(x => x.LocationCode).ToList().Contains(x));
@@ -1138,7 +1138,9 @@
                     WarehouseId = stockInfos.FirstOrDefault().WarehouseId,
                     TakeStockStatus = TakeStockStatusEnum.鐩樼偣涓�.ObjToInt(),
                     OrderNo = CreateCodeByRule(nameof(RuleCodeEnum.PDCodeRule)),
-                    Details = new List<Dt_TakeStockOrderDetail>()
+                    AllPalletCode = string.Join(",", stockInfos.Select(item => item.PalletCode).Where(palletCode => !string.IsNullOrEmpty(palletCode))),
+                    Remark = outStation
+                    
                 };
                 foreach (var item in stockInfos)
                 {
@@ -1172,7 +1174,7 @@
                 _unitOfWorkManage.BeginTran();
                 //鏇存柊搴撳瓨鐘舵��
                 _stockRepository.UpdateData(stockInfos);
-                BaseDal.Db.InsertNav(takeStockOrder);
+                _takeStockOrder.AddData(takeStockOrder);
                 //鏂板缓浠诲姟
                 BaseDal.AddData(tasks);
                 _locationInfoService.UpdateData(locationInfos);
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/TakeStockOrderController.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/TakeStockOrderController.cs"
new file mode 100644
index 0000000..3db09d1
--- /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_WMSServer/Controllers/Inbound/TakeStockOrderController.cs"
@@ -0,0 +1,57 @@
+锘縰sing Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using WIDESEA_Core;
+using WIDESEA_Core.BaseController;
+using WIDESEA_DTO.Inbound;
+using WIDESEA_IInboundService;
+using WIDESEA_Model.Models;
+
+namespace WIDESEA_WMSServer.Controllers.Inbound
+{
+    /// <summary>
+    /// 鐩樼偣鍗�
+    /// </summary>
+    [Route("api/TakeStockOrder")]
+    [ApiController]
+    public class TakeStockOrderController : ApiBaseController<ITakeStockOrderService, Dt_TakeStockOrder>
+    {
+        public TakeStockOrderController(ITakeStockOrderService service) : base(service)
+        {
+        }
+        /// <summary>
+        /// 鏂欑楠岃瘉
+        /// </summary>
+        [HttpPost,HttpGet, Route("ValidateBoxNo"), AllowAnonymous]
+        public WebResponseContent ValidateBoxNo(string orderNo , string boxNo)
+        {
+            return Service.ValidateBoxNo(orderNo,boxNo);
+        }
+
+        /// <summary>
+        /// 鏉$爜楠岃瘉
+        /// </summary>
+        [HttpPost, HttpGet, Route("ValidateBarcode"), AllowAnonymous]
+        public WebResponseContent ValidateBarcode( string boxNo,string barcode)
+        {
+            return Service.ValidateBarcode(boxNo, barcode);
+        }
+
+        /// <summary>
+        /// 鐩樼偣瀹屾垚璁板綍
+        /// </summary>
+        [HttpPost, HttpGet, Route("CompleteStockTake"), AllowAnonymous]
+        public WebResponseContent CompleteStockTake([FromBody] CompleteStockTakeDTO completeStockTakeDTO)
+        {
+            return Service.CompleteStockTake(completeStockTakeDTO);
+        }
+        /// <summary>
+        /// 鐩樼偣鏂欑鍥炲簱
+        /// </summary>
+        [HttpPost, HttpGet, Route("ReturnBox"), AllowAnonymous]
+        public WebResponseContent ReturnBox(string orderNo, string boxNo)
+        {
+            return Service.ReturnBox(orderNo, boxNo);
+        }
+    }
+}
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/TakeStockOrderDetailController.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/TakeStockOrderDetailController.cs"
new file mode 100644
index 0000000..b40a957
--- /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_WMSServer/Controllers/Inbound/TakeStockOrderDetailController.cs"
@@ -0,0 +1,16 @@
+锘縰sing Microsoft.AspNetCore.Mvc;
+using WIDESEA_Core.BaseController;
+using WIDESEA_IInboundService;
+using WIDESEA_Model.Models;
+
+namespace WIDESEA_WMSServer.Controllers.Inbound
+{
+    [Route("api/TakeStockOrderDetail")]
+    [ApiController]
+    public class TakeStockOrderDetailController : ApiBaseController<ITakeStockOrderDetailService, Dt_TakeStockOrderDetail>
+    {
+        public TakeStockOrderDetailController(ITakeStockOrderDetailService service) : base(service)
+        {
+        }
+    }
+}

--
Gitblit v1.9.3