From 027b75833ae1bc3bd1bb597b18c65c9177fa62d4 Mon Sep 17 00:00:00 2001
From: yangpeixing <yangpeixing@hnkhzn.com>
Date: 星期三, 17 十二月 2025 12:10:18 +0800
Subject: [PATCH] 1.WMS中添加自动打印开关

---
 项目代码/WMS/WIDESEA_WMSClient/src/views/widesea_wms/Order/InboundOrder.vue |  117 ++++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 93 insertions(+), 24 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/views/widesea_wms/Order/InboundOrder.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/views/widesea_wms/Order/InboundOrder.vue"
index b606a26..1ee9241 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/views/widesea_wms/Order/InboundOrder.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/views/widesea_wms/Order/InboundOrder.vue"
@@ -4,40 +4,58 @@
  *浠g爜鐢辨鏋剁敓鎴�,浠讳綍鏇存敼閮藉彲鑳藉鑷磋浠g爜鐢熸垚鍣ㄨ鐩�
  *涓氬姟璇峰湪@/extension/widesea_wms/taskinfo/Dt_Task.js姝ゅ缂栧啓
  -->
- <template>
+<template>
+    <div class="switch">
+        <span class="switchTitle">鑷姩鎵撳嵃</span>
+        <el-switch v-model="value1" @change="handleSwitchChange" />
+    </div>
     <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields"
         :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
         :table="table" :extend="extend" />
 </template>
 <script>
+import http from "@/api/http";
 import extend from "@/extension/widesea_wms/Order/InboundOrder.js";
-import { ref, defineComponent } from "vue";
+import { ref, defineComponent, onMounted } from "vue"; // 鏂板 onMounted
+
 export default defineComponent({
     setup() {
         const table = ref({
-            key: '',
+            key: "id",
             footer: "Foots",
             cnName: '鍏ュ簱鍗曟嵁',
             name: '',
             url: "/InboundOrder/",
-            sortName: ""
+            sortName: "upperOrderNo"
         });
         const editFormFields = ref({
-            
+            orderNo: "",
+            upperOrderNo: "",
+            materialNo: "",
+            materialName: "",
+            demandClassification: "",
+            orderType: "",
+            datetime: "",
+            lineNumber: "",
+            productDrawingNumber: "",
+            weight: "",
+            unit: "",
+            texture: "",
+            orderStatus: ""
         });
         const editFormOptions = ref([
-        
+            [
+                { "title": "浠撳簱", "field": "wareHouseId", "type": "select", dataKey: "WareAreaTypeEnable", data: [] },
+                { "title": "鏁伴噺", "field": "quantity", "type": "text" },
+            ],
         ]);
-        const searchFormFields = ref({
-
-        });
+        const searchFormFields = ref({});
         const searchFormOptions = ref([
-        [
+            [
                 { "title": "璁㈠崟缂栧彿", "field": "orderNo", "type": "text" },
                 { "title": "涓婃父鍗曞彿", "field": "upperOrderNo", "type": "text" },
                 { "title": "闇�姹傚垎绫�", "field": "demandClassification", "type": "text" },
-                { "title": "鍗曟嵁绫诲瀷", "field": "orderType", "type": "text" },
-
+                { "title": "鍗曟嵁绫诲瀷", "field": "orderType", "type": "select", dataKey: "orderTypeEmun", data: [] },
             ],
             [
                 { "title": "鐗╂枡缂栫爜", "field": "materialNo", type: "text" },
@@ -46,8 +64,8 @@
                 { "title": "鏃堕棿", "field": "datetime", type: "text" },
             ],
             [
-                { "title": "浠撳簱鍚嶇О", "field": "warehouseName", type: "text" },
-                { "title": "鍗曢噸", "field": "weight", type: "text",  },
+                { "title": "浠撳簱鍚嶇О", "field": "wareHouseId", type: "select", dataKey: "WareAreaTypeEnable", data: [] },
+                { "title": "鍗曢噸", "field": "weight", type: "text", },
                 { "title": "瑙勬牸", "field": "specs", type: "text" },
                 { "title": "鏁伴噺", "field": "quantity", type: "text" },
             ],
@@ -57,9 +75,10 @@
             { field: 'upperOrderNo', title: '涓婃父鍗曞彿', type: 'string', width: 180, align: 'left' },
             { field: 'materialNo', title: '鐗╂枡缂栫爜', type: 'string', width: 180, align: 'left' },
             { field: 'materialName', title: '鐗╂枡鍚嶇О', type: 'string', width: 180, align: 'left' },
+            { field: 'quantity', title: '鏁伴噺', type: 'string', width: 90, align: 'left' },
             { field: 'demandClassification', title: '闇�姹傚垎绫�', type: 'string', width: 180, align: 'left' },
-            { field: 'orderType', title: '鍗曟嵁绫诲瀷', type: 'string', width: 110, align: 'left' },
-            { field: 'warehouseName', title: '浠撳簱鍚嶇О', type: 'string', width: 120, align: 'left' },
+            { field: 'orderType', title: '鍗曟嵁绫诲瀷', type: 'string', width: 110, align: 'left', bind: { key: "orderTypeEmun", data: [] } },
+            { field: 'wareHouseId', title: '浠撳簱', type: 'string', width: 120, align: 'left', bind: { key: "WareAreaTypeEnable", data: [] } },
             { field: 'datetime', title: '鏃堕棿', type: 'string', width: 180, align: 'left' },
             { field: 'lineNumber', title: '琛屽彿', type: 'string', width: 90, align: 'left' },
             { field: 'productDrawingNumber', title: '鍥惧彿', type: 'string', width: 180, align: 'left' },
@@ -67,13 +86,12 @@
             { field: 'specs', title: '瑙勬牸', type: 'string', width: 180, align: 'left' },
             { field: 'unit', title: '鍗曚綅', type: 'string', width: 90, align: 'left' },
             { field: 'texture', title: '鏉愯川', type: 'string', width: 180, align: 'left' },
-            {field: 'quantity', title: '鏁伴噺', type: 'string', width: 90, align: 'left' },
-            {field: 'orderStatus', title: '璁㈠崟鐘舵��', type: 'string', width: 90, align: 'left' },
-           { field: 'creater', title: '鍒涘缓浜�', type: 'string', width: 120, align: 'left' },
-           { field: 'createDate', title: '鍒涘缓鏃堕棿', type: 'datetime', sort: true, width: 150, align: 'left', sort: true },
-           { field: 'modifier', title: '淇敼浜�', type: 'string', width: 120, align: 'left' },
-        { field: 'modifyDate', title: '淇敼鏃堕棿', type: 'datetime', sort: true, width: 150, align: 'left', sort: true },
-    ]);
+            { field: 'orderStatus', title: '璁㈠崟鐘舵��', type: 'string', width: 90, align: 'left' },
+            { field: 'creater', title: '鍒涘缓浜�', type: 'string', width: 120, align: 'left' },
+            { field: 'createDate', title: '鍒涘缓鏃堕棿', type: 'datetime', sort: true, width: 150, align: 'left', sort: true },
+            { field: 'modifier', title: '淇敼浜�', type: 'string', width: 120, align: 'left' },
+            { field: 'modifyDate', title: '淇敼鏃堕棿', type: 'datetime', sort: true, width: 150, align: 'left', sort: true },
+        ]);
         const detail = ref({
             cnName: "#detailCnName",
             table: "#detailTable",
@@ -81,6 +99,41 @@
             sortName: "",
             key: ""
         });
+
+        // 瀹氫箟寮�鍏崇姸鎬�
+        const value1 = ref(false);
+
+        const getAutomaticPrintStatus = async () => {
+            try {
+                // 璇锋眰鍚庣鎺ュ彛鑾峰彇褰撳墠鐘舵��
+                const res = await http.get(`/api/InboundOrder/GetAutomaticPrint`);
+                // 鍒濆鍖栧紑鍏冲��
+                if (res !== undefined) {
+                    value1.value = res;
+                }
+                console.log("鑷姩鎵撳嵃鐘舵�佸垵濮嬪寲瀹屾垚锛�", value1.value);
+            } catch (error) {
+                console.error("鑾峰彇鑷姩鎵撳嵃鐘舵�佸け璐ワ細", error);
+                // 寮傚父鏃堕粯璁ゅ叧闂�
+                value1.value = false;
+            }
+        };
+
+        onMounted(() => {
+            getAutomaticPrintStatus(); 
+        });
+
+        const handleSwitchChange = async (val) => {
+            try {
+                await http.get(`/api/InboundOrder/AutomaticPrint?AutomaticPrintStatus=${val}`);
+                console.log("鑷姩鎵撳嵃鐘舵�佸凡淇敼涓猴細", val);
+            } catch (error) {
+                console.error("淇敼鑷姩鎵撳嵃鐘舵�佸け璐ワ細", error);
+                // 澶辫触鏃跺洖婊氬紑鍏崇姸鎬�
+                value1.value = !val;
+            }
+        };
+
         return {
             table,
             extend,
@@ -90,7 +143,23 @@
             searchFormOptions,
             columns,
             detail,
+            value1, // 鏆撮湶寮�鍏崇姸鎬�
+            handleSwitchChange // 鏆撮湶鏂规硶
         };
-    },
+    }
 });
 </script>
+<style>
+.switch {
+    text-align: center;
+    position: fixed;
+    top: 7.1rem;
+    left: 54rem;
+    z-index: 9999;
+}
+
+.switchTitle {
+    font-size: 15px;
+    margin-left: 20px;
+}
+</style>

--
Gitblit v1.9.3