From 632bde0f32999a2b319b706e23d90bc1b5dd8cc2 Mon Sep 17 00:00:00 2001
From: zwl <1051256694@qq.com>
Date: 星期二, 21 四月 2026 17:22:56 +0800
Subject: [PATCH] 1.新增拍照功能

---
 src/main/webapp/static/js/common.js |   45 ++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 40 insertions(+), 5 deletions(-)

diff --git a/src/main/webapp/static/js/common.js b/src/main/webapp/static/js/common.js
index d8fd1dc..614d7ec 100644
--- a/src/main/webapp/static/js/common.js
+++ b/src/main/webapp/static/js/common.js
@@ -1,4 +1,4 @@
-var baseUrl = "/jshdasrs";
+var baseUrl = "/lggslasrs";
 
 // 璇︽儏绐楀彛-楂樺害
 var detailHeight = '80%';
@@ -228,12 +228,13 @@
 
 var detlCols = [
     {field: 'matnr', align: 'center',title: '鍟嗗搧缂栧彿', sort:true}
-    ,{field: 'maktx', align: 'center',title: '鍟嗗搧鍚嶇О', sort:true}
+    ,{field: 'maktx', align: 'center',title: '鍟嗗搧鍚嶇О', sort:true,hide:true}
     ,{field: 'orderNo', align: 'center',title: '鍗曟嵁缂栧彿', hide: false}
     // ,{field: 'batch', align: 'center',title: '璐у搧鐗瑰緛', sort:true,hide:true}
     ,{field: 'anfme', align: 'center',title: '鏁伴噺', hide: false}
     ,{field: 'zpallet', align: 'center',title: '鎵樼洏鏉$爜', hide: false}
 
+    ,{field: 'boxType1', align: 'center',title: '璐т富', hide: false}
     ,{field: 'boxType3', align: 'center',title: '閲囪喘鍗曞彿', hide: false}
     // ,{field: 'model', align: 'center',title: '浠g爜', hide: true}
     // ,{field: 'color', align: 'center',title: '棰滆壊', hide: true}
@@ -241,13 +242,13 @@
     // ,{field: 'unit', align: 'center',title: '鍗曚綅', hide: true}
     // ,{field: 'price', align: 'center',title: '鍗曚环', hide: true}
     ,{field: 'standby2', align: 'center',title: '鏉$爜upc', hide: false}
-    ,{field: 'units', align: 'center',title: '鍗曠姣涢噸kg', hide: true}
+    ,{field: 'units', align: 'center',title: '鍗曠姣涢噸kg', hide: false}
     // ,{field: 'barcode', align: 'center',title: '鏉$爜', hide: true}
     // ,{field: 'origin', align: 'center',title: '鍦ㄥ簱鏍囪', hide: true}
     ,{field: 'manu', align: 'center',title: '浠撳簱缂栫爜', hide: true}
     // ,{field: 'manuDate', align: 'center',title: '鐢熶骇鏃ユ湡', hide: true}
     // ,{field: 'safeQty', align: 'center',title: '鎬讳欢鏁�', hide: true}
-    ,{field: 'weight', align: 'center',title: '鍗曠鍑�閲峩g', hide: false}
+    ,{field: 'weight', align: 'center',title: '鍗曠鍑�閲峩g', hide: true}
     // ,{field: 'manLength', align: 'center',title: '闀匡紙姣背锛�', hide: false}
     // ,{field: 'width', align: 'center',title: '瀹斤紙姣背锛�', hide: false}
     // ,{field: 'height', align: 'center',title: '楂橈紙姣背锛�', hide: false}
@@ -281,6 +282,40 @@
         if(pair[0] == variable){return pair[1];}
     }
     return(false);
+}
+
+function showPhotoViewer(layer, urls) {
+    if (!urls || urls.length === 0) {
+        layer.msg('鏆傛棤鐓х墖');
+        return;
+    }
+    var html = '<div style="padding:16px;display:flex;flex-wrap:wrap;gap:12px;max-height:70vh;overflow:auto;background:#f7f7f7;">';
+    for (var i = 0; i < urls.length; i++) {
+        var url = escapePhotoHtml(urls[i]);
+        html += '<a href="' + url + '" target="_blank" style="display:block;width:360px;max-width:100%;background:#fff;border:1px solid #e6e6e6;padding:8px;">'
+            + '<img src="' + url + '" style="display:block;width:100%;height:auto;max-height:360px;object-fit:contain;" alt="photo">'
+            + '</a>';
+    }
+    html += '</div>';
+    layer.open({
+        type: 1,
+        title: '鏌ョ湅鐓х墖',
+        area: ['900px', '75%'],
+        maxmin: true,
+        shadeClose: true,
+        content: html
+    });
+}
+
+function escapePhotoHtml(value) {
+    if (value === undefined || value === null) {
+        return '';
+    }
+    return String(value)
+        .replace(/&/g, '&amp;')
+        .replace(/"/g, '&quot;')
+        .replace(/</g, '&lt;')
+        .replace(/>/g, '&gt;');
 }
 
 /**
@@ -335,4 +370,4 @@
         '<rect x="50" y="0"  width="15" height="4" rx="1"/><rect x="55" y="4"  width="5"  height="32" rx="1.5"/><rect x="50" y="36" width="15" height="4" rx="1"/>' +
         '</g>' +
         '</svg>';
-}
\ No newline at end of file
+}

--
Gitblit v1.9.1