From f7591079229d2c01eb5db181815c7b8a81c0bfac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Fri, 4 Dec 2020 00:12:37 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=99=E5=8D=95=E6=8D=AE=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=89=AB=E7=A0=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- erp_web/js/pages/bill/in_out.js | 32 +++++++++++++++++++- erp_web/pages/bill/allocation_out_list.html | 13 +++++--- erp_web/pages/bill/assemble_list.html | 13 +++++--- erp_web/pages/bill/disassemble_list.html | 13 +++++--- erp_web/pages/bill/other_in_list.html | 13 +++++--- erp_web/pages/bill/other_out_list.html | 13 +++++--- erp_web/pages/bill/purchase_back_list.html | 13 +++++--- erp_web/pages/bill/purchase_in_list.html | 13 +++++--- erp_web/pages/bill/purchase_orders_list.html | 13 +++++--- erp_web/pages/bill/retail_back_list.html | 13 +++++--- erp_web/pages/bill/retail_out_list.html | 13 +++++--- erp_web/pages/bill/sale_back_list.html | 13 +++++--- erp_web/pages/bill/sale_orders_list.html | 13 +++++--- erp_web/pages/bill/sale_out_list.html | 13 +++++--- 14 files changed, 148 insertions(+), 53 deletions(-) diff --git a/erp_web/js/pages/bill/in_out.js b/erp_web/js/pages/bill/in_out.js index a443d5d1..4cca87e8 100644 --- a/erp_web/js/pages/bill/in_out.js +++ b/erp_web/js/pages/bill/in_out.js @@ -1222,6 +1222,28 @@ $('#depotFM').form('clear'); bindDepotEvent(); }, + //扫码 + switchToBarCode: function () { + if($('#sweepBarCode').css('display') == "none") { + $("#sweepBarCode").show().val(""); + $("#sweepBarCode").off("keyup").on("keyup",function(e){ + var evt = window.event || e; + if (evt.keyCode == 13) { + var meId = inOutService.getInfoByBarCode($("#sweepBarCode").val()); + var rec = {}; rec.Id = meId; + var body =$("#depotHeadFM .datagrid-view2 .datagrid-body"); + var rowDom = body.find(".datagrid-row").eq(editIndex); + var materialName = rowDom.find("[field='name']").find("input[type=text]").val(); + if(materialName){ + inOutService.append(); //新增行 + } + inOutService.materialSelect(rec, getNowFormatMonth()); + } + }); + } else { + $("#sweepBarCode").hide(); + } + }, //新增商品 appendMaterial: function () { js.addTabPage(null, "商品信息", "/pages/materials/material.html"); @@ -1350,6 +1372,9 @@ pageSize: initPageSize }); }); + $("#appendMaterial").off("click").on("click",function(){ + js.addTabPage(null, "商品信息", "/pages/materials/material.html"); + }); $("#checkMaterial").off("click").on("click",function(){ var rowData = $("#materialSelectData").datagrid('getChecked')[0]; $('#materialSelectDlg').dialog('close'); @@ -1427,7 +1452,12 @@ detailPrice = 0; } var operNumber = 1; - currentRowDom.find("[field='OperNumber']").find(input).val(operNumber).focus().select(); //数量初始化 + currentRowDom.find("[field='OperNumber']").find(input).val(operNumber); //数量初始化 + if($('#sweepBarCode').css('display') == "none") { + currentRowDom.find("[field='OperNumber']").find(input).focus().select(); + } else { + $("#sweepBarCode").val("").focus().select(); + } currentRowDom.find("[field='UnitPrice']").find(input).val(detailPrice); currentRowDom.find("[field='AllPrice']").find(input).val(detailPrice); var taxRate = currentRowDom.find("[field='TaxRate']").find(input).val()-0; //获取税率 diff --git a/erp_web/pages/bill/allocation_out_list.html b/erp_web/pages/bill/allocation_out_list.html index 26df4427..ac46e618 100644 --- a/erp_web/pages/bill/allocation_out_list.html +++ b/erp_web/pages/bill/allocation_out_list.html @@ -146,6 +146,9 @@
查询
+
+ 新增商品 +
@@ -572,11 +575,11 @@ } }, { - id:'appendMaterial', - text:'新增商品', - iconCls:'icon-add', + id:'switchToBarCode', + text:'扫码', + iconCls:'icon-search', handler:function() { - js.addTabPage(null, "商品信息", "/pages/materials/material.html"); + inOutService.switchToBarCode(); //扫码 } } ], @@ -585,6 +588,8 @@ return; } }); + var sweepBarCodeHtml = ''; + $('#depotHeadFM .datagrid-toolbar tr').append(sweepBarCodeHtml); $.ajax({ type:"get", url: '/depotItem/getDetailList', diff --git a/erp_web/pages/bill/assemble_list.html b/erp_web/pages/bill/assemble_list.html index 79fa9bad..b430e956 100644 --- a/erp_web/pages/bill/assemble_list.html +++ b/erp_web/pages/bill/assemble_list.html @@ -145,6 +145,9 @@
查询
+
+ 新增商品 +
@@ -556,11 +559,11 @@ } }, { - id:'appendMaterial', - text:'新增商品', - iconCls:'icon-add', + id:'switchToBarCode', + text:'扫码', + iconCls:'icon-search', handler:function() { - js.addTabPage(null, "商品信息", "/pages/materials/material.html"); + inOutService.switchToBarCode(); //扫码 } } ], @@ -569,6 +572,8 @@ return; } }); + var sweepBarCodeHtml = ''; + $('#depotHeadFM .datagrid-toolbar tr').append(sweepBarCodeHtml); $.ajax({ type:"get", url: '/depotItem/getDetailList', diff --git a/erp_web/pages/bill/disassemble_list.html b/erp_web/pages/bill/disassemble_list.html index 7987e996..13541c95 100644 --- a/erp_web/pages/bill/disassemble_list.html +++ b/erp_web/pages/bill/disassemble_list.html @@ -145,6 +145,9 @@
查询
+
+ 新增商品 +
@@ -557,11 +560,11 @@ } }, { - id:'appendMaterial', - text:'新增商品', - iconCls:'icon-add', + id:'switchToBarCode', + text:'扫码', + iconCls:'icon-search', handler:function() { - js.addTabPage(null, "商品信息", "/pages/materials/material.html"); + inOutService.switchToBarCode(); //扫码 } } ], @@ -570,6 +573,8 @@ return; } }); + var sweepBarCodeHtml = ''; + $('#depotHeadFM .datagrid-toolbar tr').append(sweepBarCodeHtml); $.ajax({ type:"get", url: '/depotItem/getDetailList', diff --git a/erp_web/pages/bill/other_in_list.html b/erp_web/pages/bill/other_in_list.html index e077d033..570d5a43 100644 --- a/erp_web/pages/bill/other_in_list.html +++ b/erp_web/pages/bill/other_in_list.html @@ -160,6 +160,9 @@
查询
+
+ 新增商品 +
@@ -573,11 +576,11 @@ } }, { - id:'appendMaterial', - text:'新增商品', - iconCls:'icon-add', + id:'switchToBarCode', + text:'扫码', + iconCls:'icon-search', handler:function() { - js.addTabPage(null, "商品信息", "/pages/materials/material.html"); + inOutService.switchToBarCode(); //扫码 } } ], @@ -586,6 +589,8 @@ return; } }); + var sweepBarCodeHtml = ''; + $('#depotHeadFM .datagrid-toolbar tr').append(sweepBarCodeHtml); $.ajax({ type:"get", url: '/depotItem/getDetailList', diff --git a/erp_web/pages/bill/other_out_list.html b/erp_web/pages/bill/other_out_list.html index 1ba1c207..4e371f8c 100644 --- a/erp_web/pages/bill/other_out_list.html +++ b/erp_web/pages/bill/other_out_list.html @@ -154,6 +154,9 @@
查询
+
+ 新增商品 +
@@ -566,11 +569,11 @@ } }, { - id:'appendMaterial', - text:'新增商品', - iconCls:'icon-add', + id:'switchToBarCode', + text:'扫码', + iconCls:'icon-search', handler:function() { - js.addTabPage(null, "商品信息", "/pages/materials/material.html"); + inOutService.switchToBarCode(); //扫码 } } ], @@ -579,6 +582,8 @@ return; } }); + var sweepBarCodeHtml = ''; + $('#depotHeadFM .datagrid-toolbar tr').append(sweepBarCodeHtml); $.ajax({ type:"get", url: '/depotItem/getDetailList', diff --git a/erp_web/pages/bill/purchase_back_list.html b/erp_web/pages/bill/purchase_back_list.html index c47376e9..9125de21 100644 --- a/erp_web/pages/bill/purchase_back_list.html +++ b/erp_web/pages/bill/purchase_back_list.html @@ -282,6 +282,9 @@
查询
+
+ 新增商品 +
@@ -703,11 +706,11 @@ } }, { - id:'appendMaterial', - text:'新增商品', - iconCls:'icon-add', + id:'switchToBarCode', + text:'扫码', + iconCls:'icon-search', handler:function() { - js.addTabPage(null, "商品信息", "/pages/materials/material.html"); + inOutService.switchToBarCode(); //扫码 } } ], @@ -716,6 +719,8 @@ return; } }); + var sweepBarCodeHtml = ''; + $('#depotHeadFM .datagrid-toolbar tr').append(sweepBarCodeHtml); $.ajax({ type:"get", url: '/depotItem/getDetailList', diff --git a/erp_web/pages/bill/purchase_in_list.html b/erp_web/pages/bill/purchase_in_list.html index 33f3c410..8d52a11b 100644 --- a/erp_web/pages/bill/purchase_in_list.html +++ b/erp_web/pages/bill/purchase_in_list.html @@ -307,6 +307,9 @@
查询
+
+ 新增商品 +
@@ -828,11 +831,11 @@ } }, { - id:'appendMaterial', - text:'新增商品', - iconCls:'icon-add', + id:'switchToBarCode', + text:'扫码', + iconCls:'icon-search', handler:function() { - js.addTabPage(null, "商品信息", "/pages/materials/material.html"); + inOutService.switchToBarCode(); //扫码 } } ], @@ -841,6 +844,8 @@ return; } }); + var sweepBarCodeHtml = ''; + $('#depotHeadFM .datagrid-toolbar tr').append(sweepBarCodeHtml); $.ajax({ type:"get", url: '/depotItem/getDetailList', diff --git a/erp_web/pages/bill/purchase_orders_list.html b/erp_web/pages/bill/purchase_orders_list.html index 166638cc..440f1d42 100644 --- a/erp_web/pages/bill/purchase_orders_list.html +++ b/erp_web/pages/bill/purchase_orders_list.html @@ -209,6 +209,9 @@
查询
+
+ 新增商品 +
@@ -658,11 +661,11 @@ } }, { - id:'appendMaterial', - text:'新增商品', - iconCls:'icon-add', + id:'switchToBarCode', + text:'扫码', + iconCls:'icon-search', handler:function() { - js.addTabPage(null, "商品信息", "/pages/materials/material.html"); + inOutService.switchToBarCode(); //扫码 } } ], @@ -671,6 +674,8 @@ return; } }); + var sweepBarCodeHtml = ''; + $('#depotHeadFM .datagrid-toolbar tr').append(sweepBarCodeHtml); $.ajax({ type:"get", url: '/depotItem/getDetailList', diff --git a/erp_web/pages/bill/retail_back_list.html b/erp_web/pages/bill/retail_back_list.html index 59988b3c..b51582f5 100644 --- a/erp_web/pages/bill/retail_back_list.html +++ b/erp_web/pages/bill/retail_back_list.html @@ -222,6 +222,9 @@
查询
+
+ 新增商品 +
@@ -718,11 +721,11 @@ } }, { - id:'appendMaterial', - text:'新增商品', - iconCls:'icon-add', + id:'switchToBarCode', + text:'扫码', + iconCls:'icon-search', handler:function() { - js.addTabPage(null, "商品信息", "/pages/materials/material.html"); + inOutService.switchToBarCode(); //扫码 } } ], @@ -731,6 +734,8 @@ return; } }); + var sweepBarCodeHtml = ''; + $('#depotHeadFM .datagrid-toolbar tr').append(sweepBarCodeHtml); $.ajax({ type:"get", url: '/depotItem/getDetailList', diff --git a/erp_web/pages/bill/retail_out_list.html b/erp_web/pages/bill/retail_out_list.html index 7897b6c0..0d9fbaf3 100644 --- a/erp_web/pages/bill/retail_out_list.html +++ b/erp_web/pages/bill/retail_out_list.html @@ -259,6 +259,9 @@
查询
+
+ 新增商品 +
@@ -754,11 +757,11 @@ } }, { - id:'appendMaterial', - text:'新增商品', - iconCls:'icon-add', + id:'switchToBarCode', + text:'扫码', + iconCls:'icon-search', handler:function() { - js.addTabPage(null, "商品信息", "/pages/materials/material.html"); + inOutService.switchToBarCode(); //扫码 } } ], @@ -767,6 +770,8 @@ return; } }); + var sweepBarCodeHtml = ''; + $('#depotHeadFM .datagrid-toolbar tr').append(sweepBarCodeHtml); $.ajax({ type:"get", url: '/depotItem/getDetailList', diff --git a/erp_web/pages/bill/sale_back_list.html b/erp_web/pages/bill/sale_back_list.html index d42e4fc6..05fe8237 100644 --- a/erp_web/pages/bill/sale_back_list.html +++ b/erp_web/pages/bill/sale_back_list.html @@ -282,6 +282,9 @@
查询
+
+ 新增商品 +
@@ -744,11 +747,11 @@ } }, { - id:'appendMaterial', - text:'新增商品', - iconCls:'icon-add', + id:'switchToBarCode', + text:'扫码', + iconCls:'icon-search', handler:function() { - js.addTabPage(null, "商品信息", "/pages/materials/material.html"); + inOutService.switchToBarCode(); //扫码 } } ], @@ -757,6 +760,8 @@ return; } }); + var sweepBarCodeHtml = ''; + $('#depotHeadFM .datagrid-toolbar tr').append(sweepBarCodeHtml); $.ajax({ type:"get", url: '/depotItem/getDetailList', diff --git a/erp_web/pages/bill/sale_orders_list.html b/erp_web/pages/bill/sale_orders_list.html index cfb59ec2..551085fb 100644 --- a/erp_web/pages/bill/sale_orders_list.html +++ b/erp_web/pages/bill/sale_orders_list.html @@ -211,6 +211,9 @@
查询
+
+ 新增商品 +
@@ -702,11 +705,11 @@ } }, { - id:'appendMaterial', - text:'新增商品', - iconCls:'icon-add', + id:'switchToBarCode', + text:'扫码', + iconCls:'icon-search', handler:function() { - js.addTabPage(null, "商品信息", "/pages/materials/material.html"); + inOutService.switchToBarCode(); //扫码 } } ], @@ -715,6 +718,8 @@ return; } }); + var sweepBarCodeHtml = ''; + $('#depotHeadFM .datagrid-toolbar tr').append(sweepBarCodeHtml); $.ajax({ type:"get", url: '/depotItem/getDetailList', diff --git a/erp_web/pages/bill/sale_out_list.html b/erp_web/pages/bill/sale_out_list.html index 9ef0e122..d7d76173 100644 --- a/erp_web/pages/bill/sale_out_list.html +++ b/erp_web/pages/bill/sale_out_list.html @@ -309,6 +309,9 @@
查询
+
+ 新增商品 +
@@ -897,11 +900,11 @@ } }, { - id:'appendMaterial', - text:'新增商品', - iconCls:'icon-add', + id:'switchToBarCode', + text:'扫码', + iconCls:'icon-search', handler:function() { - js.addTabPage(null, "商品信息", "/pages/materials/material.html"); + inOutService.switchToBarCode(); //扫码 } } ], @@ -910,6 +913,8 @@ return; } }); + var sweepBarCodeHtml = ''; + $('#depotHeadFM .datagrid-toolbar tr').append(sweepBarCodeHtml); $.ajax({ type:"get", url: '/depotItem/getDetailList',