From 266e4bf654c55ce2f7e9271048e4625f1b8b49f6 Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期一, 29 十二月 2025 14:36:08 +0800
Subject: [PATCH] Merge branch 'htq20251215' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu into htq20251215

---
 项目代码/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js |  181 ++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 176 insertions(+), 5 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js"
index f101fdc..6fa1f60 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js"
@@ -3,7 +3,6 @@
 import http from '@/api/http.js'
 import { h, createVNode, render, reactive, ref } from 'vue';
 import { ElDialog, ElForm, ElFormItem, ElInput, ElButton, ElMessage, ElSelect, ElOption } from 'element-plus';
-
 import gridBody from './extend/outOrderDetail.vue'
 import gridHeader from './extend/NoStockOut.vue'
 import gridFooter from './extend/EmptyTrayOutbound.vue'
@@ -325,8 +324,6 @@
             table.clearSelection();
             table.toggleRowSelection(row, true);
           }
-          const rowId = row.id;
-          console.log(rowId);
           this.$refs.gridBody.open(row);
         }
       });
@@ -351,10 +348,10 @@
             .post(`api/MesFeedback/OutboundFeedback?orderNo=${selectedRows[0].orderNo}`, {}, "鏁版嵁澶勭悊涓�...")
             .then((x) => {
               if (x.status) {
-                _this.$Message.success('鍒嗘壒鍑哄簱鍥炶皟瀹屾垚');
+                _this.$Message.success(x.message);
                 _this.refresh();
               } else {
-                return _this.$Message.error('鍒嗘壒鍑哄簱鍥炶皟澶辫触');
+                return _this.$Message.error(x.message);
               }
             })
             .catch((error) => {
@@ -379,6 +376,180 @@
         }
       }
 
+      let OrderOutBtn = this.buttons.find(x => x.value == 'OrderOut');
+if (OrderOutBtn) {
+  // 1. 鏀逛负绠ご鍑芥暟锛岀‘淇漷his鎸囧悜Vue缁勪欢瀹炰緥锛堝師鏅�氬嚱鏁皌his鎸囧悜鎸夐挳鏈韩锛�
+  OrderOutBtn.onClick = async () => {
+    // 鐜板湪this鏄疺ue缁勪欢瀹炰緥锛岃兘姝g‘鑾峰彇$refs
+    let rows = this.$refs.table.getSelected();
+    if (rows.length == 0) return this.$error("璇烽�夋嫨鏁版嵁!");
+    if (rows.length > 1) return this.$error("璇烽�夋嫨涓�鏉℃暟鎹�!");
+    
+    
+    // 纭繚閫変腑琛屾湁id锛堟牴鎹疄闄呰〃鏍兼暟鎹瓧娈佃皟鏁达紝姣斿rows[0].detailId绛夛級
+    const selectedId = rows[0].id || rows[0].detailId;
+    if (!selectedId) return this.$error("閫変腑鏁版嵁缂哄皯蹇呰ID瀛楁!");
+
+    if(rows[0].orderStatus!=0&&rows[0].orderStatus!=1)return this.$error("璇ュ崟鎹凡缁忓畬鎴�");
+
+    const platformOptions = [
+      { label: "绔欏彴2", value: "2-1" },
+      { label: "绔欏彴3", value: "3-1" },
+    ];
+    const mountNode = document.createElement("div");
+    document.body.appendChild(mountNode);
+
+    const formData = reactive({
+      selectedPlatform: platformOptions[0].value,
+    });
+
+    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: {
+                selectedPlatform: [
+                  { required: true, message: "璇烽�夋嫨鍑哄簱绔欏彴", trigger: "change" },
+                ],
+              },
+              ref: "outboundForm", // 琛ㄥ崟ref
+              labelWidth: "100px",
+              style: {
+                padding: "0 30px",
+              },
+            },
+            [
+              h(ElFormItem, {
+                label: "鍑哄簱绔欏彴",
+                prop: "selectedPlatform",
+                style: {
+                  marginBottom: "24px",
+                },
+              }, [
+                h(ElSelect, {
+                  placeholder: "璇烽�夋嫨鍑哄簱绔欏彴锛�3-12锛�",
+                  modelValue: formData.selectedPlatform,
+                  "onUpdate:modelValue": (val) => {
+                    formData.selectedPlatform = val;
+                  },
+                  style: {
+                    width: "100%",
+                    height: "40px",
+                    borderRadius: "4px",
+                    borderColor: "#dcdfe6",
+                  },
+                }, platformOptions.map((platform) =>
+                  h(ElOption, { label: platform.label, value: platform.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 () => {
+                    // 2. 纭繚琛ㄥ崟ref宸叉寕杞斤紙鐢╪extTick閬垮厤鑾峰彇涓嶅埌锛�
+                    await this.$nextTick();
+                    const formRef = vnode.component.refs.outboundForm;
+                    
+                    if (!formRef) {
+                      ElMessage.error("琛ㄥ崟鍒濆鍖栧け璐ワ紝璇烽噸璇�");
+                      return;
+                    }
+
+                    try {
+                      await formRef.validate();
+                    } catch (err) {
+                      return;
+                    }
+                    var param = rows[0].orderNo;
+                    const requestParams = {
+                      detailIds: [],
+                      outboundTargetLocation: formData.selectedPlatform,
+                      outboundQuantity: 1,
+                      operator: this.currentOperator || "admin", 
+                      orderNo: param,
+                    };
+
+                    try {
+
+                      const x = await this.http.post(
+                        "api/Outbound/ProcessPickingOutbound",
+                        requestParams,
+                        "鏁版嵁澶勭悊涓�"
+                      );
+
+                      if (!x.status) {
+                        ElMessage.error(x.message || "鎿嶄綔澶辫触");
+                        return;
+                      }
+
+                      ElMessage.success("鎿嶄綔鎴愬姛");
+                      this.showDetialBox = false;
+                      this.$emit("parentCall", ($vue) => {
+                        $vue.getData();
+                      });
+                    } catch (error) {
+                      // 5. 鎵撳紑閿欒鎹曡幏锛屾柟渚胯皟璇�
+                      console.error("鍑哄簱鎺ュ彛璇锋眰澶辫触锛�", error);
+                      ElMessage.error("璇锋眰澶辫触锛岃绋嶅悗閲嶈瘯");
+                    } finally {
+                      // 鏃犺鎴愬姛澶辫触锛岄兘鍏抽棴寮圭獥
+                      render(null, mountNode);
+                      document.body.removeChild(mountNode);
+                    }
+                  },
+                  style: {
+                    borderRadius: "4px",
+                    padding: "8px 20px",
+                  },
+                }, "纭畾鍑哄簱"),
+              ]),
+            ]),
+      }
+    );
+
+    vnode.appContext = this.$.appContext;
+    render(vnode, mountNode);
+  };
+}
+
     },
     onInited() {
       //妗嗘灦鍒濆鍖栭厤缃悗

--
Gitblit v1.9.3