From 3c824a50b4894545ecf6ea57b5889444fe77c11c Mon Sep 17 00:00:00 2001
From: chen.lin <1442464845@qq.com>
Date: 星期四, 29 一月 2026 15:45:38 +0800
Subject: [PATCH] 二维码打印——委外

---
 src/main/webapp/views/erpMaterialuse/materialuse.html |  383 +++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 318 insertions(+), 65 deletions(-)

diff --git a/src/main/webapp/views/erpMaterialuse/materialuse.html b/src/main/webapp/views/erpMaterialuse/materialuse.html
index bda3ef1..41595c6 100644
--- a/src/main/webapp/views/erpMaterialuse/materialuse.html
+++ b/src/main/webapp/views/erpMaterialuse/materialuse.html
@@ -69,7 +69,10 @@
                 <el-button type="primary" @click="fnPrintRed('鏄�')">鎵撳嵃(绾㈠瓧)</el-button>
             </el-form-item>
             <el-form-item label="">
-                <el-button type="primary" @click="fnCanelPrintRed()">鎾ら攢鐢熸垚(绾㈠瓧)</el-button>
+               <el-button type="primary" @click="fnCanelPrintRed()">鎾ら攢鐢熸垚(绾㈠瓧)</el-button>
+            </el-form-item>
+            <el-form-item label="">
+               <el-button type="success" @click="manualSync()">鎵嬪姩鍚屾</el-button>
             </el-form-item>
         </el-form>
         <el-table :data="tableData" border style="width: 100%" row-key="finterid" @selection-change="handleSelectionChange" max-height="650">
@@ -180,7 +183,7 @@
                         background: 'rgba(0, 0, 0, 0.7)',
                     })
                     $.ajax({
-                        url: "http://127.0.0.1:9090/mo/materialreceive/getList",
+                        url: "http://127.0.0.1:8133/mo/materialreceive/getList",
                         headers: {
                             'token': localStorage.getItem('token')
                         },
@@ -222,7 +225,7 @@
                         background: 'rgba(0, 0, 0, 0.7)',
                     })
                     $.ajax({
-                        url:"http://127.0.0.1:9090/mo/materialuse/canelprint",
+                        url:"http://127.0.0.1:8133/mo/materialuse/canelprint",
                         headers: {
                             'token': localStorage.getItem('token')
                         },
@@ -264,7 +267,7 @@
                         background: 'rgba(0, 0, 0, 0.7)',
                     })
                     $.ajax({
-                        url:"http://127.0.0.1:9090/mo/materialuse/canelprint1",
+                        url:"http://127.0.0.1:8133/mo/materialuse/canelprint1",
                         headers: {
                             'token': localStorage.getItem('token')
                         },
@@ -294,7 +297,7 @@
 
                 function getDepOptions(){
                     $.ajax({
-                        url: "http://127.0.0.1:9090/basicinfo/departmentl/getlistfordropdown",
+                        url: "http://127.0.0.1:8133/basicinfo/departmentl/getlistfordropdown",
                         contentType: 'application/json;charset=UTF-8',
                         method: 'GET',
                         success: function(res) {
@@ -321,14 +324,83 @@
                         });
                         return ;
                     }
-                    ElementPlus.ElMessageBox.confirm('纭畾鎵撳嵃鍚�?')
-                        .then(() => {
-                            print(izPrint,0)
-                        })
-                        .catch(() => {
-                            // catch error
-                        })
-
+                    // 鎵撳嵃鍓嶇‘璁�
+                    if (izPrint === '鏄�') {
+                        ElementPlus.ElMessageBox.confirm('纭畾鎵撳嵃鍚�?')
+                            .then(() => {
+                                print(izPrint, 0);
+                            })
+                            .catch(() => {
+                                // 鍙栨秷
+                            });
+                    } else {
+                        print(izPrint, 0);
+                    }
+                }
+                
+                // 鎵嬪姩鍚屾
+                function manualSync() {
+                    if (selectList.value.length === 0){
+                        ElementPlus.ElMessage({
+                            message: "璇峰厛閫夋嫨瑕佸悓姝ョ殑鏁版嵁",
+                            type: 'error'
+                        });
+                        return ;
+                    }
+                    
+                    ElementPlus.ElMessageBox.confirm('纭畾瑕佸悓姝ラ�変腑鐨勬暟鎹埌WMS鍚�?', '鎻愮ず', {
+                        confirmButtonText: '纭畾',
+                        cancelButtonText: '鍙栨秷',
+                        type: 'warning'
+                    }).then(() => {
+                        const loading = ElementPlus.ElLoading.service({
+                            lock: true,
+                            text: '鍚屾涓�...',
+                            background: 'rgba(0, 0, 0, 0.7)',
+                        });
+                        
+                        // 鏋勫缓鍚屾鍙傛暟锛堜紶閫掗�変腑鐨勬暟鎹級
+                        const syncParams = {
+                            icmoDTOS: JSON.stringify(selectList.value)
+                        };
+                        
+                        $.ajax({
+                            url: "http://127.0.0.1:8133/api/materialReceive/sync/manual",
+                            headers: {
+                                'token': localStorage.getItem('token')
+                            },
+                            data: JSON.stringify(syncParams),
+                            contentType: 'application/json;charset=UTF-8',
+                            method: 'POST',
+                            success: function(res) {
+                                loading.close();
+                                if (res.code == 200) {
+                                    ElementPlus.ElMessage({
+                                        message: res.data.message || "鍚屾浠诲姟宸叉彁浜�",
+                                        type: 'success'
+                                    });
+                                    // 鍒锋柊鍒楄〃
+                                    setTimeout(() => {
+                                        page();
+                                    }, 2000);
+                                } else {
+                                    ElementPlus.ElMessage({
+                                        message: res.msg || "鍚屾澶辫触",
+                                        type: 'error'
+                                    });
+                                }
+                            },
+                            error: function() {
+                                loading.close();
+                                ElementPlus.ElMessage({
+                                    message: "鍚屾璇锋眰澶辫触",
+                                    type: 'error'
+                                });
+                            }
+                        });
+                    }).catch(() => {
+                        // 鍙栨秷
+                    });
                 }
 
                 function fnPrintView(izPrint){
@@ -339,7 +411,8 @@
                         });
                         return ;
                     }
-                    print(izPrint,0)
+                    // 鎵撳嵃棰勮鐩存帴璋冪敤鎵撳嵃鎺ュ彛锛堝悗绔笉鏍¢獙鍑哄簱瀹屾垚鐘舵�侊級
+                    print(izPrint, 0);
                 }
 
                 function fnPrintRedView(izPrint) {
@@ -350,7 +423,8 @@
                         });
                         return ;
                     }
-                    print(izPrint,1);
+                    // 鎵撳嵃棰勮鐩存帴璋冪敤鎵撳嵃鎺ュ彛锛堝悗绔笉鏍¢獙鍑哄簱瀹屾垚鐘舵�侊級
+                    print(izPrint, 1);
                 }
 
                 function fnPrintRed(izPrint) {
@@ -361,14 +435,18 @@
                         });
                         return ;
                     }
-                    ElementPlus.ElMessageBox.confirm('纭畾绾㈠瓧鎵撳嵃鍚�?')
-                        .then(() => {
-                            print(izPrint,1);
-                        })
-                        .catch(() => {
-                            // catch error
-                        })
-
+                    // 鎵撳嵃鍓嶇‘璁�
+                    if (izPrint === '鏄�') {
+                        ElementPlus.ElMessageBox.confirm('纭畾鎵撳嵃鍚�?')
+                            .then(() => {
+                                print(izPrint, 1);
+                            })
+                            .catch(() => {
+                                // 鍙栨秷
+                            });
+                    } else {
+                        print(izPrint, 1);
+                    }
                 }
 
                 function print(izPrint,izRed){
@@ -379,7 +457,7 @@
                         background: 'rgba(0, 0, 0, 0.7)',
                     })
                     $.ajax({
-                        url:"http://127.0.0.1:9090/mo/materialuse/print",
+                        url:"http://127.0.0.1:8133/mo/materialuse/print",
                         headers: {
                             'token': localStorage.getItem('token')
                         },
@@ -399,58 +477,232 @@
                                     type: 'success'
                                 });
                                 page()
-                                LODOP.PRINT_INITA(0,0,800,1100,"鐢熶骇棰嗘枡鍗�");
+                                LODOP.PRINT_INITA(0,0,800,1100,"鐢熸垚棰嗘枡鍗�");
                                 LODOP.SET_PRINT_PAGESIZE(1,0,0,"A4");
                                 LODOP.SET_PRINT_MODE("PRINT_NOCOLLATE",1);
-                                if(izRed==1)
-                                {
-                                    LODOP.ADD_PRINT_TEXT(28,268,331,36,"鐢熶骇棰嗘枡鍗曪紙绾㈠瓧锛�");
+                                
+                                // 鏀堕泦浜岀淮鐮佸崟鍙凤細浼樺厛浣跨敤鐢熶骇鍗曞彿锛屼絾濡傛灉鐢熶骇鍗曞彿娌℃湁琚叏閮ㄩ�変腑锛屽垯浣跨敤浠诲姟鍗曞彿
+                                var barcodeCodeSet = new Set();
+                                if (selectList.value && selectList.value.length > 0 && tableData.value && tableData.value.length > 0) {
+                                    // 鎸夌敓浜у崟鍙峰垎缁勶紝缁熻姣忎釜鐢熶骇鍗曞彿鐨勬�昏鏁板拰閫変腑琛屾暟
+                                    var soCodeGroups = {};
+                                    tableData.value.forEach(function(item) {
+                                        if (item.soCode) {
+                                            if (!soCodeGroups[item.soCode]) {
+                                                soCodeGroups[item.soCode] = {
+                                                    total: 0,
+                                                    selected: 0,
+                                                    soCode: item.soCode
+                                                };
+                                            }
+                                            soCodeGroups[item.soCode].total++;
+                                        }
+                                    });
+                                    
+                                    // 缁熻姣忎釜鐢熶骇鍗曞彿鐨勯�変腑琛屾暟
+                                    selectList.value.forEach(function(item) {
+                                        if (item.soCode && soCodeGroups[item.soCode]) {
+                                            soCodeGroups[item.soCode].selected++;
+                                        }
+                                    });
+                                    
+                                    // 鏍规嵁鏄惁鍏ㄩ儴閫変腑鍐冲畾浣跨敤鐢熶骇鍗曞彿杩樻槸浠诲姟鍗曞彿
+                                    selectList.value.forEach(function(item) {
+                                        if (item.soCode && soCodeGroups[item.soCode]) {
+                                            var group = soCodeGroups[item.soCode];
+                                            // 濡傛灉璇ョ敓浜у崟鍙风殑鎵�鏈夎閮借閫変腑锛屼娇鐢ㄧ敓浜у崟鍙�
+                                            if (group.selected === group.total) {
+                                                barcodeCodeSet.add(item.soCode);
+                                            } else {
+                                                // 濡傛灉璇ョ敓浜у崟鍙峰彧鏈夐儴鍒嗚琚�変腑锛屼娇鐢ㄤ换鍔″崟鍙�
+                                                if (item.fbillno) {
+                                                    barcodeCodeSet.add(item.fbillno);
+                                                }
+                                            }
+                                        }
+                                    });
                                 }
-                                else{
-                                    LODOP.ADD_PRINT_TEXT(28,268,331,36,"鐢熶骇棰嗘枡鍗�");
+                                var barcodeCodeStr = Array.from(barcodeCodeSet).join('|');
+                                
+                                // 瀹氫箟娣诲姞鏉″舰鐮佺殑鍑芥暟
+                                function addBarcodeToPrint() {
+                                    // 鍦ㄥ彸涓婅娣诲姞鏉″舰鐮侊紙濡傛灉鏈夊崟鍙凤級
+                                    if (barcodeCodeStr) {
+                                        // 灏嗘墍鏈夊崟鍙风敤绔栫嚎杩炴帴锛岀敤浜庢潯褰㈢爜锛圕ode128鏀寔绔栫嚎锛�
+                                        var barcodeCodeArray = barcodeCodeStr.split('|');
+                                        // 浣跨敤鎵�鏈夊崟鍙锋嫾鎺ワ紝鐢ㄧ珫绾垮垎闅�
+                                        var barcodeValue = barcodeCodeStr; // 鐩存帴浣跨敤鎷兼帴鍚庣殑瀛楃涓诧紝宸茬粡鏄敤绔栫嚎鍒嗛殧鐨�
+                                        
+                                        // 鎺у埗鍙版墦鍗板弬鏁�
+                                        // console.log("鏉″舰鐮佺紪鐮佺殑鐪熷疄瀛楃锛堢敓浜у崟鍙�/浠诲姟鍗曞彿锛�:", barcodeValue);
+                                        // console.log("鍗曞彿鏁扮粍:", barcodeCodeArray);
+                                        // console.log("鍗曞彿鏁扮粍闀垮害:", barcodeCodeArray.length);
+                                        
+                                        // 浣跨敤鍚庣鎺ュ彛鐢熸垚鏉″舰鐮佸浘鐗囷紝鍏堝姞杞藉浘鐗囪浆鎹负base64
+                                        // type=1琛ㄧず鏉″舰鐮侊紝type=2琛ㄧず浜岀淮鐮�
+                                        // 灏嗘墍鏈夊崟鍙烽兘缂栫爜鍒版潯褰㈢爜涓�
+                                        // 鍥哄畾浜岀淮鐮佸昂瀵革紝淇濇寔姝f柟褰㈡瘮渚嬶紝閬垮厤鎸ゅ崰鎵撳嵃鏂囨湰鍜岃鎷夐暱
+                                        var barcodeWidth = 130; // 鍥哄畾瀹藉害130px锛屼笉鏍规嵁鏁伴噺鍔ㄦ�佽皟鏁�
+                                        var barcodeHeight = 130; // 鍥哄畾楂樺害130px锛屼繚鎸佹鏂瑰舰姣斾緥
+                                        var barcodeUrl = baseUrl + "/file/barcode/qrcode/auth?type=2&param=" + encodeURIComponent(barcodeValue) + "&width=" + barcodeWidth + "&height=" + barcodeHeight;
+                                        
+                                        // console.log("鏉″舰鐮佸搴︼紙鍥哄畾锛�:", barcodeWidth);
+                                        // console.log("鏉″舰鐮佺紪鐮佸唴瀹癸紙鐢熶骇鍗曞彿/浠诲姟鍗曞彿锛�:", barcodeValue);
+                                        
+                                        // 鎺у埗鍙版墦鍗版潯褰㈢爜鐨勭湡瀹炲瓧绗︼紙缂栫爜鐨勬暟鎹唴瀹癸級
+                                        // console.log("=== 鏉″舰鐮佷俊鎭� ===");
+                                        // console.log("鏉″舰鐮佺紪鐮佺殑鐪熷疄瀛楃锛堢敓浜у崟鍙�/浠诲姟鍗曞彿锛岀敤|鍒嗛殧锛�:", barcodeValue);
+                                        // console.log("鏉″舰鐮佸瓧绗﹂暱搴�:", barcodeValue.length);
+                                        // console.log("鏉″舰鐮佸瓧绗︾紪鐮侊紙UTF-8锛�:", encodeURIComponent(barcodeValue));
+                                        // console.log("鏉″舰鐮乁RL鍙傛暟閮ㄥ垎:", "type=1&param=" + encodeURIComponent(barcodeValue) + "&width=130&height=40");
+                                        
+                                        // 鍒涘缓涓�涓复鏃秈mg鍏冪礌鍔犺浇鍥剧墖锛岀劧鍚庤浆鎹负base64
+                                        var img = new Image();
+                                        img.crossOrigin = 'anonymous';
+                                        img.onload = function() {
+                                            try {
+                                                // 鍒涘缓canvas灏嗗浘鐗囪浆鎹负base64
+                                                var canvas = document.createElement('canvas');
+                                                canvas.width = img.width;
+                                                canvas.height = img.height;
+                                                var ctx = canvas.getContext('2d');
+                                                ctx.drawImage(img, 0, 0);
+                                                var base64Image = canvas.toDataURL('image/png');
+                                                
+                                                // 鎺у埗鍙版墦鍗版潯褰㈢爜鍥剧墖淇℃伅
+                                                // console.log("鏉″舰鐮佸浘鐗囧凡鐢熸垚");
+                                                // console.log("鏉″舰鐮佸浘鐗嘼ase64鍓�50涓瓧绗�:", base64Image.substring(0, 50) + "...");
+                                                // console.log("鏉″舰鐮佸浘鐗嘼ase64鎬婚暱搴�:", base64Image.length);
+                                                // console.log("鏉″舰鐮佸浘鐗囧昂瀵�:", img.width + "x" + img.height);
+                                                // console.log("鏉″舰鐮佺紪鐮佸唴瀹圭‘璁わ紙鐢熶骇鍗曞彿/浠诲姟鍗曞彿锛�:", barcodeValue);
+                                                // console.log("=== 鏉″舰鐮佷俊鎭粨鏉� ===");
+                                                
+                                                // LODOP娣诲姞鍥剧墖锛屼娇鐢╞ase64鏍煎紡
+                                                // ADD_PRINT_IMAGE鍙傛暟锛歍op, Left, Width, Height, ImageURL鎴朓mageData
+                                                // 鏉″舰鐮佷綅缃細鍙充笂瑙掞紝Top: 20, Left: 650 (椤甸潰瀹藉害800锛屽彸杈圭暀50鍍忕礌杈硅窛)
+                                                // 鍥哄畾鏄剧ず灏哄锛屼繚鎸佹鏂瑰舰姣斾緥锛岄伩鍏嶆尋鍗犳墦鍗版枃鏈拰琚媺闀�
+                                                var displayWidth = barcodeWidth; // 鍥哄畾瀹藉害130px
+                                                var displayHeight = barcodeHeight; // 鍥哄畾楂樺害130px锛屼繚鎸佹鏂瑰舰
+                                                var displayLeft = 800 - displayWidth - 20; // 鍙冲榻愶紝鐣�20px杈硅窛
+                                                try {
+                                                    LODOP.ADD_PRINT_IMAGE(20, displayLeft, displayWidth, displayHeight, base64Image);
+                                                    console.log("鏉″舰鐮佸浘鐗囧凡娣诲姞鍒版墦鍗伴〉闈紙ADD_PRINT_IMAGE鏂瑰紡锛夛紝浣嶇疆:", displayLeft + ", 瀹藉害:", displayWidth);
+                                                } catch(e) {
+                                                    // 濡傛灉ADD_PRINT_IMAGE澶辫触锛屼娇鐢℉TML鏂瑰紡
+                                                    console.log("ADD_PRINT_IMAGE澶辫触锛屽皾璇旽TML鏂瑰紡");
+                                                    var htmlContent = '<img src="' + base64Image + '" style="width:' + displayWidth + 'px;height:' + displayHeight + 'px;" />';
+                                                    LODOP.ADD_PRINT_HTM(20, displayLeft, displayWidth, displayHeight, htmlContent);
+                                                    console.log("鏉″舰鐮佸浘鐗囧凡娣诲姞鍒版墦鍗伴〉闈紙ADD_PRINT_HTM鏂瑰紡锛夛紝浣嶇疆:", displayLeft + ", 瀹藉害:", displayWidth);
+                                                }
+                                                
+                                                // 濡傛灉鏈夊涓崟鍙凤紝鍦ㄦ潯褰㈢爜涓嬫柟鏄剧ず鎵�鏈夊崟鍙风殑鏂囨湰锛堟柟渚夸汉宸ヨ瘑鍒級
+                                                // 宸叉敞閲婏細浜岀淮鐮佸簳涓嬩笉鏄剧ず瀛楃涓�
+                                                // if (barcodeCodeArray.length > 1) {
+                                                //     LODOP.ADD_PRINT_TEXT(65, 650, 130, 20, barcodeCodeStr);
+                                                //     LODOP.SET_PRINT_STYLEA(0, "FontSize", 9);
+                                                //     LODOP.SET_PRINT_STYLEA(0, "Alignment", 2); // 灞呬腑瀵归綈
+                                                // }
+                                                
+                                                // 鍥剧墖鍔犺浇瀹屾垚鍚庯紝鎵ц鎵撳嵃鎴栭瑙�
+                                                executePrint();
+                                            } catch(e) {
+                                                console.error("杞崲鍥剧墖澶辫触:", e);
+                                                // 濡傛灉杞崲澶辫触锛屽彧鏄剧ず鏂囨湰锛堢敓浜у崟鍙�/浠诲姟鍗曞彿锛�
+                                                var displayWidth = barcodeWidth; // 鍥哄畾瀹藉害130px
+                                                var displayHeight = barcodeHeight; // 鍥哄畾楂樺害130px
+                                                var displayLeft = 800 - displayWidth - 20;
+                                                LODOP.ADD_PRINT_TEXT(20, displayLeft, displayWidth, displayHeight, barcodeValue);
+                                                LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
+                                                LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
+                                                executePrint();
+                                            }
+                                        };
+                                        img.onerror = function() {
+                                            console.error("鍔犺浇鏉″舰鐮佸浘鐗囧け璐�");
+                                            // 濡傛灉鍔犺浇澶辫触锛屽彧鏄剧ず鏂囨湰锛堢敓浜у崟鍙�/浠诲姟鍗曞彿锛�
+                                            var displayWidth = barcodeWidth; // 鍥哄畾瀹藉害130px
+                                            var displayHeight = barcodeHeight; // 鍥哄畾楂樺害130px
+                                            var displayLeft = 800 - displayWidth - 20;
+                                            LODOP.ADD_PRINT_TEXT(20, displayLeft, displayWidth, displayHeight, barcodeValue);
+                                            LODOP.SET_PRINT_STYLEA(0, "FontSize", 12);
+                                            LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
+                                            executePrint();
+                                        };
+                                        img.src = barcodeUrl;
+                                    } else {
+                                        // 娌℃湁鍗曞彿锛岀洿鎺ユ墽琛屾墦鍗�
+                                        executePrint();
+                                    }
                                 }
-
-
-                                LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
-                                LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
-                                LODOP.ADD_PRINT_TEXT(69,21,213,25,"鐢熶骇绾匡細"+depName.value);
-                                LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
-                                LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
-                                LODOP.ADD_PRINT_TEXT(70,268,213,25,"璁″垝寮�宸ユ棩鏈燂細"+tableSearchParam.value.fplancommitdate.toLocaleString('zh-CN', {
-                                    timeZone: 'Asia/Shanghai',
-                                    year: 'numeric',
-                                    month: '2-digit',
-                                    day: '2-digit',
-                                    hour: '2-digit',
-                                    minute: '2-digit',
-                                    second: '2-digit',
-                                    hour12: false
-                                }).slice(0, 10));
-                                LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
-                                LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
-                                LODOP.ADD_PRINT_TABLE(96,16,2000,960,CreateTable(res.data));
-                                LODOP.SET_PRINT_STYLEA(0,"TableHeightScope",1);
-
-                                LODOP.SET_PRINT_MODE("FULL_WIDTH_FOR_OVERFLOW",true);
-
-                                if(izPrint=="鏄�")
-                                {
-                                    LODOP.PRINT();
+                                
+                                // 瀹氫箟鎵ц鎵撳嵃鐨勫嚱鏁�
+                                function executePrint() {
+                                    // 璁$畻琛ㄦ牸鐨勮捣濮嬩綅缃細濡傛灉鏈変簩缁寸爜锛岃〃鏍奸渶瑕佸悜涓嬬Щ鍔�
+                                    var tableTop = 96; // 榛樿琛ㄦ牸璧峰浣嶇疆
+                                    var qrCodeTop = 20; // 浜岀淮鐮侀《閮ㄤ綅缃�
+                                    var qrCodeHeight = 130; // 浜岀淮鐮侀珮搴�
+                                    var qrCodeBottom = qrCodeTop + qrCodeHeight; // 浜岀淮鐮佸簳閮ㄤ綅缃細150
+                                    var spacing = 10; // 浜岀淮鐮佸拰琛ㄦ牸涔嬮棿鐨勯棿璺�
+                                    
+                                    // 濡傛灉鏈変簩缁寸爜锛屼笖琛ㄦ牸鍘熷浣嶇疆浼氳浜岀淮鐮佽鐩栵紝鍒欏悜涓嬬Щ鍔ㄨ〃鏍�
+                                    if (barcodeCodeStr && tableTop < qrCodeBottom) {
+                                        tableTop = qrCodeBottom + spacing; // 琛ㄦ牸浠庝簩缁寸爜涓嬫柟寮�濮嬶紝鐣�10px闂磋窛
+                                    }
+                                    
+                                    if(izRed==1)
+                                    {
+                                        LODOP.ADD_PRINT_TEXT(28,268,331,36,"鐢熸垚棰嗘枡鍗曪紙绾㈠瓧锛�");
+                                    }
+                                    else{
+                                        LODOP.ADD_PRINT_TEXT(28,268,331,36,"鐢熸垚棰嗘枡鍗�");
+                                    }
+                                    LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
+                                    LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
+                                    LODOP.ADD_PRINT_TEXT(69,21,213,25,"鐢熶骇绾匡細"+depName.value);
+                                    LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
+                                    LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
+                                    LODOP.ADD_PRINT_TEXT(70,268,213,25,"璁″垝寮�宸ユ棩鏈燂細"+tableSearchParam.value.fplancommitdate.toLocaleString('zh-CN', {
+                                        timeZone: 'Asia/Shanghai',
+                                        year: 'numeric',
+                                        month: '2-digit',
+                                        day: '2-digit',
+                                        hour: '2-digit',
+                                        minute: '2-digit',
+                                        second: '2-digit',
+                                        hour12: false
+                                    }).slice(0, 10));
+                                    LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
+                                    LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
+                                    LODOP.ADD_PRINT_TABLE(tableTop,16,2000,960,CreateTable(res.data));
+                                    LODOP.SET_PRINT_STYLEA(0,"TableHeightScope",1);
+                                    LODOP.SET_PRINT_MODE("FULL_WIDTH_FOR_OVERFLOW",true);
+                                    if(izPrint=="鏄�")
+                                    {
+                                        LODOP.PRINT();
+                                    }
+                                    else{
+                                        LODOP.PREVIEW();
+                                    }
                                 }
-                                else{
-                                    LODOP.PREVIEW();
-                                }
-
-
-//                    LODOP.PRINT_DESIGN();
+                                
+                                // 寮�濮嬪姞杞芥潯褰㈢爜鍥剧墖
+                                addBarcodeToPrint();
                             } else if (res.code === 403) {
                                 top.location.href = baseUrl + "/";
                             } else {
-                                ElementPlus.ElMessage({
-                                    message: res.msg,
+                                // 鍚庣杩斿洖閿欒淇℃伅锛堟牎楠屽け璐ワ級
+                                ElementPlus.ElMessageBox.alert(res.msg || "鎵撳嵃澶辫触", '閿欒', {
+                                    confirmButtonText: '纭畾',
                                     type: 'error'
                                 });
                             }
+                        },
+                        error: function(xhr, status, error) {
+                            loading.close()
+                            ElementPlus.ElMessage({
+                                message: "鎵撳嵃璇锋眰澶辫触锛岃绋嶅悗閲嶈瘯",
+                                type: 'error'
+                            });
                         }
                     });
                 }
@@ -526,6 +778,7 @@
                     fnCanelPrintRed,
                     fnPrintRed,
                     fnPrintRedView,
+                    manualSync,
                     handleSizeChange,
                     handleCurrentChange,
                     handleSelectionChange

--
Gitblit v1.9.1