From f7007f5260fc5d00cd5c810d255e7167ce191105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=99=93=E8=BF=AA?= <2596750866@qq.com> Date: Mon, 14 Oct 2024 08:36:35 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E4=BB=93=E5=BA=93=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E5=BA=93=E5=AD=98=E6=8A=A5=E6=8D=9F=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=BA=93=E5=AD=98=E6=8A=A5=E6=8D=9F=E6=B7=BB=E5=8A=A0=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E7=94=9F=E4=BA=A7=E8=AE=A2=E5=8D=95=E5=8F=B7=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=A1=86=E4=B8=BA=E4=B8=8B=E6=8B=89=E6=A1=86=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B7=BB=E5=8A=A0=E5=92=8C=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E5=9B=9E=E8=B0=83=E5=87=BD=E6=95=B0?= =?UTF-8?q?=EF=BC=9B=20=E6=96=B0=E5=A2=9E=E5=BA=93=E5=AD=98=E6=8A=A5?= =?UTF-8?q?=E6=8D=9F=E5=AE=9E=E4=BD=93=E7=B1=BB=E5=92=8Cmapper=E6=8A=A5?= =?UTF-8?q?=E9=94=80=E7=B1=BB=E5=9E=8B=E5=AD=97=E6=AE=B5=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WarehouseInventoryReportDamage.java | 11 ++ .../WarehouseInventoryReportDamageMapper.xml | 4 + .../warehouse/inventoryReportDamage/add.html | 101 ++++++++++----- .../warehouse/inventoryReportDamage/edit.html | 122 ++++++++++++------ .../inventoryReportDamage.html | 17 ++- 5 files changed, 175 insertions(+), 80 deletions(-) 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 @@
  • + +