From ee4d94defe7cc7f36f87aebf2e9efed38ba93a40 Mon Sep 17 00:00:00 2001
From: 懒羊羊 <15939171744@163.com>
Date: 星期二, 14 十一月 2023 16:44:18 +0800
Subject: [PATCH] 优化

---
 guns-vip-main/src/main/webapp/assets/modular/kb/formula/formulaView.js |   96 ++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 89 insertions(+), 7 deletions(-)

diff --git a/guns-vip-main/src/main/webapp/assets/modular/kb/formula/formulaView.js b/guns-vip-main/src/main/webapp/assets/modular/kb/formula/formulaView.js
index 7f6c962..ab0d4c3 100644
--- a/guns-vip-main/src/main/webapp/assets/modular/kb/formula/formulaView.js
+++ b/guns-vip-main/src/main/webapp/assets/modular/kb/formula/formulaView.js
@@ -28,6 +28,36 @@
             {field: 'operationType', sort: true, title: '绫诲瀷'},
         ]];
     };
+    $('#imgs').click(function (){
+        console.log("11111111111111");
+        var img = new Image();
+        img.src = "http://localhost:8081/img/9f2f070828381f30fdf1be0da9014c086f06f0ad.jpg";
+        // var height = img.height; //鑾峰彇鍥剧墖楂樺害
+        // var width = img.width; //鑾峰彇鍥剧墖瀹藉害
+        var height = 500; //鑾峰彇鍥剧墖楂樺害
+        var width = 800; //鑾峰彇鍥剧墖瀹藉害
+        if (height > 1000 || width > 800) {
+            height = height / 1.5;
+            width = width / 1.5;
+        }
+        var imgHtml = "<img src='http://localhost:8081/img/9f2f070828381f30fdf1be0da9014c086f06f0ad.jpg' style='width: " + width + "px;height:" + height + "px'/>";
+        layer.open({
+            type: 1,
+            offset: 'auto',
+            area: [width + 'px', height + 'px'],
+            shadeClose: true,//鐐瑰嚮澶栧洿鍏抽棴寮圭獥
+            scrollbar: true,//涓嶇幇瀹炴粴鍔ㄦ潯
+            title: false, //涓嶆樉绀烘爣棰�
+            content: imgHtml, //鎹曡幏鐨勫厓绱狅紝娉ㄦ剰锛氭渶濂借鎸囧畾鐨勫厓绱犺瀛樻斁鍦╞ody鏈�澶栧眰锛屽惁鍒欏彲鑳借鍏跺畠鐨勭浉瀵瑰厓绱犳墍褰卞搷
+            cancel: function () {
+
+            }
+        });
+        console.log(height);
+        console.log(width);
+
+    });
+
 
 
     initLineInfo();
@@ -53,7 +83,8 @@
         url: Feng.ctxPath + '/formulaChildInfo/list',
         page: false,
         // height: "full-158",
-        height: 460,
+        // height: 460,
+        height: 400,
         cellMinWidth: 100,
         where: queryData,
         cols: FormulaChildInfo.initColumn(),
@@ -132,12 +163,13 @@
         }
     });
 
-    setInterval(function() {
-        $('input[name="sex1"][value="nan1"]').prop('checked', true);
-    }, 1000);
-    setInterval(function() {
-        radioElement.prop('checked', false);
-    }, 2000);
+    // //redio闂儊
+    // setInterval(function() {
+    //     $('input[name="sex1"][value="nan1"]').prop('checked', true);
+    // }, 1000);
+    // setInterval(function() {
+    //     radioElement.prop('checked', false);
+    // }, 2000);
 
     //Hash鍦板潃鐨勫畾浣�
     var layid = location.hash.replace(/^#test=/, '');
@@ -147,4 +179,54 @@
         location.hash = 'test='+ $(this).attr('lay-id');
     });
 
+    /**
+     * 鍩虹BOM绠$悊
+     */
+    var ProductBomChildInfo = {
+        tableId: "productBomChildInfoTable"
+    };
+
+    /**
+     * 鍒濆鍖栬〃鏍肩殑鍒�
+     */
+    ProductBomChildInfo.initColumn = function () {
+        return [[
+            {field: 'id', hide: true, title: '涓婚敭id'},
+            {field: 'opCode', sort: true, title: '宸ュ簭缂栫爜'},
+            {field: 'opName', sort: true, title: '宸ュ簭鍚嶇О'},
+            {field: 'materialCode', sort: true, title: '鐗╂枡缂栫爜'},
+            {field: 'costQty', sort: true, title: '鍗曡��'},
+            {field: 'bomCode', sort: true, title: 'BOM缂栫爜'},
+        ]];
+    };
+
+    var queryData = {};
+    queryData['bomCode'] = "301002000021";
+    // 娓叉煋琛ㄦ牸
+    table.render({
+        elem: '#' + ProductBomChildInfo.tableId,
+        url: Feng.ctxPath + '/productBomChildInfo/list',
+        page: true,
+        height: 460,
+        cellMinWidth: 100,
+        where: queryData,
+        cols: ProductBomChildInfo.initColumn()
+    });
+
+    $("#scanCode").keydown(function(event) {
+        if (event.keyCode === 13) {
+            // 鎵ц鎮ㄦ兂瑕佺殑浠g爜
+            var ajax = new $ax(Feng.ctxPath + "/kb/formulaView/addFormulaState?formulaCode="+msg.recipeCode);
+            var result = ajax.start();
+            table.reload("formulaChildInfoTable")
+            return false; // 闃绘榛樿琛屼负
+        }
+    });
+
+    $("#clear").click(function() {
+        var ajax = new $ax(Feng.ctxPath + "/kb/formulaView/clear?formulaCode="+msg.recipeCode);
+        var result = ajax.start();
+        table.reload("formulaChildInfoTable")
+    });
+
 });

--
Gitblit v1.9.3