diff --git a/ruoyi-admin/src/main/resources/templates/warehouse/inventoryCheck/add.html b/ruoyi-admin/src/main/resources/templates/warehouse/inventoryCheck/add.html index dddc7b13..5ddf1795 100644 --- a/ruoyi-admin/src/main/resources/templates/warehouse/inventoryCheck/add.html +++ b/ruoyi-admin/src/main/resources/templates/warehouse/inventoryCheck/add.html @@ -124,7 +124,7 @@ //添加物料信息 function insertRow() { - var url = ctx + 'warehouse/inventoryCheck/materialSelect'; + var url = ctx + "erp/material/select"; var options = { title: '选择物料', url: url, @@ -168,27 +168,41 @@ }) function doSubmit(index, layero,uniqueId){ - console.log(uniqueId); var iframeWin = window[layero.find('iframe')[0]['name']]; - var rowData = iframeWin.$('#bootstrap-materialSelect-table').bootstrapTable('getSelections')[0]; - console.log("rowData: "+rowData); - $("#bootstrap-table").bootstrapTable('insertRow', { - index:1, - row: { - materialNo:rowData.materialNo, + var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections'); + //判断是否重复 + var data = $("#bootstrap-table").bootstrapTable('getData'); + var rows = data.length; + if(rows > 0){ + for(var i=0;i 0){ + for(var i=0;i
+
+
+
+ +
+
+
+
-
+
@@ -22,14 +43,19 @@ $(function() { var materialList = [[${materialList}]]; + materialList.forEach(function (data){ + data.describe = data.materialDescribe; + data.brand = data.materialBrand; + data.unit = data.materialUnit; + }) var formattedData = { total: materialList.length, // 总记录数 rows: materialList // 数据行 }; var options = { - id: 'bootstrap-materialSelect-table', + id: 'bootstrap-select-table', clickToSelect: true, // 点击选中行 - singleSelect: true, // 单选 + // singleSelect: true, // 单选 // url: prefix + "/getAllMaterialInfo", data: formattedData, pagination: true, @@ -64,15 +90,15 @@ }, { title: '描述', - field: 'materialDescribe', + field: 'describe', }, { title: '品牌', - field: 'materialBrand', + field: 'brand', }, { title: '单位', - field: 'materialUnit', + field: 'unit', }, { title: '加工方式', field: 'processMethod',