diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseInventoryReportDamage.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseInventoryReportDamage.java index 1de04c8e..72e093f9 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseInventoryReportDamage.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseInventoryReportDamage.java @@ -76,6 +76,9 @@ public class WarehouseInventoryReportDamage extends BaseEntity @Excel(name = "仓库存放地址") private String warehouseStoreAddress; + /** 报废类型 */ + private String scrapType; + /** 流程实例ID */ private String instanceId; @@ -321,6 +324,14 @@ public class WarehouseInventoryReportDamage extends BaseEntity this.removeFileIdStr = removeFileIdStr; } + public String getScrapType() { + return scrapType; + } + + public void setScrapType(String scrapType) { + this.scrapType = scrapType; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseInventoryReportDamageMapper.xml b/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseInventoryReportDamageMapper.xml index e4b7dbfd..cf52cf9e 100644 --- a/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseInventoryReportDamageMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseInventoryReportDamageMapper.xml @@ -14,6 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -46,6 +47,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and report_damage_code in ( select report_damage_code from warehouse_inventory_report_damage_child where material_name like concat('%', #{materialName}, '%') ) + + and report_damage_code in ( select report_damage_code from warehouse_inventory_report_damage_child where scrap_type like concat('%', #{scrapType}, '%') ) + and create_time between #{params.beginCreateTime} and #{params.endCreateTime} diff --git a/ruoyi-admin/src/main/resources/templates/warehouse/inventoryReportDamage/add.html b/ruoyi-admin/src/main/resources/templates/warehouse/inventoryReportDamage/add.html index e63f781e..461232e5 100644 --- a/ruoyi-admin/src/main/resources/templates/warehouse/inventoryReportDamage/add.html +++ b/ruoyi-admin/src/main/resources/templates/warehouse/inventoryReportDamage/add.html @@ -19,13 +19,13 @@
- +
- +
@@ -34,7 +34,7 @@
- +
@@ -49,13 +49,15 @@
- +
- + +
- +
- +
- +
@@ -124,7 +126,7 @@ var whetherMakeNo = $("input[name='whetherMakeNo']:checked").val(); warehouseInventoryReportDamage.whetherMakeNo = whetherMakeNo; if(whetherMakeNo === "1"){ - var makeNo = $("input[name='makeNo']").val(); + var makeNo = $("select[name='makeNo']").val(); warehouseInventoryReportDamage.makeNo = makeNo; } warehouseInventoryReportDamage.warehouseName = $("select[name='warehouseName']").val(); @@ -168,7 +170,8 @@ function insertRow() { var ifMakeNo = $("input[name='whetherMakeNo']:checked").val(); if(ifMakeNo === "1"){ - var makeNo = $("input[name='makeNo']").val(); + var makeNo = $("select[name='makeNo']").val(); + console.log(makeNo); if(!makeNo){ $.modal.alertWarning("请输入生产单号!") }else{ @@ -181,7 +184,7 @@ $.modal.openOptions(options); } }else{ - var url = ctx + 'warehouse/inventoryCheck/materialSelect'; + var url = ctx + "erp/material/select"; var options = { title: '选择物料', url: url, @@ -191,35 +194,36 @@ } } 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]; - var rows = $("#bootstrap-table-reportDamage-child").bootstrapTable('getData'); - if(rows.length > 0){ - for(var i=0;i 0){ + for(var i=0;i-->
- +
- +
@@ -36,7 +36,7 @@
- +
@@ -51,9 +51,10 @@
- +
- + +
@@ -69,25 +70,25 @@
- +
- +
- +
- +
@@ -127,6 +128,7 @@ $("#form-inventoryReportDamage-edit").validate({focusCleanup: true}); var warehouseInventoryReportDamage = [[${warehouseInventoryReportDamage}]]; var stockData = []; + var makeNo = [[${warehouseInventoryReportDamage.makeNo}]] function submitHandler() { if ($.validate.form()) { var warehouseInventoryReportDamage = { @@ -192,6 +194,10 @@ var options = { id : 'bootstrap-table-reportDamage-child', modalName: "仓库库存报损物料信息", + showColumns: false, + showSearch: false, + showRefresh:false, + showToggle:false, data: [[${warehouseInventoryReportDamage.warehouseInventoryReportDamageChildList}]], columns: [ {title: '库存报损id', field: 'reportDamageChildId', visible: false}, @@ -273,6 +279,8 @@ var stockName = warehouseInventoryReportDamage.warehouseName; loadWarehouseCodes(stockName); + // loadMakeNo(); + $("#selectMakeNo").val(makeNo); changeWhetherMakeNo(); getDeptName(); @@ -330,7 +338,38 @@ } }); } - + function loadMakeNo() { + var options = []; + options.push({id: '',text: '',value: ''}) + $.ajax({ + url: ctx + 'system/makeorder/getAllMakeNos', + type: "GET", + dataType: "json", + success: function (result) { + if (result != null) { + result.forEach(function (re){ + var option = {}; + option.id = re.makeNo; + option.text = re.makeNo; + option.value = re.makeNo; + options.push(option); + }); + $("#selectMakeNo").select2({ + data: options, + }).on('select2:loaded', function(e) { + // 打印所有选项 + var allOptions = $("#selectMakeNo").select2('data'); + console.log("All Options from Select2:", allOptions); + allOptions.forEach(function(option) { + console.log("ID: " + option.id + ", Text: " + option.text); + }); + }); + } else { + $.modal.msgError("生产订单编号获取失败!"); + } + } + }); + } function getDeptName(){ $.ajax({ url: prefix + "/getUserDeptName", @@ -378,44 +417,45 @@ } } 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]; - var rows = $("#bootstrap-table-reportDamage-child").bootstrapTable('getData'); - if(rows.length > 0){ - for(var i=0;i 0){ + for(var i=0;i + +
@@ -20,14 +22,15 @@
  • - + + + + +
  • - @@ -74,6 +77,8 @@
  • + +