From b3065621cfb6cad77b56d77d81c597ce914af9d4 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Tue, 29 Oct 2024 17:42:11 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=E5=B7=A5=E7=A8=8B=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9bom=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=EF=BC=9A=E6=96=B0=E5=A2=9E=E5=9E=8B=E5=8F=B7=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=EF=BC=8C=E5=8E=BB=E6=8E=89=E5=A4=9A=E4=BD=99=E7=9A=84=E5=87=BD?= =?UTF-8?q?=E6=95=B0=EF=BC=8C=E8=AE=BE=E7=BD=AE=E5=AD=90=E8=A1=A8=E9=87=8C?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E9=83=BD=E4=B8=8D=E8=83=BD=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E3=80=82=E5=8E=BB=E6=8E=89=E9=80=89=E4=B8=AD=E4=B8=80?= =?UTF-8?q?=E8=A1=8C=E5=92=8C=E6=96=B0=E5=A2=9E=E4=B8=80=E8=A1=8C=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/templates/erp/bom/detail.html | 129 ++---------------- 1 file changed, 11 insertions(+), 118 deletions(-) diff --git a/ruoyi-admin/src/main/resources/templates/erp/bom/detail.html b/ruoyi-admin/src/main/resources/templates/erp/bom/detail.html index 17cf99c2..37f937ee 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/bom/detail.html +++ b/ruoyi-admin/src/main/resources/templates/erp/bom/detail.html @@ -52,6 +52,12 @@ +
+ +
+ +
+
@@ -71,14 +77,6 @@
-
- - 新增行 - - - 删除选择行 - -
@@ -191,6 +189,11 @@ align: 'center', title: '描述' }, + { + field: 'materialModel', + align: 'center', + title: '型号' + }, { field: 'brand', align: 'center', @@ -208,68 +211,11 @@ field: 'useNum', align: 'center', title: '用量', - editable : { - type : 'text', - title : '用量', - validate : function(value) { - if (!value) { - return '用量不能为空'; - } - if (isNaN(value)) { - return '用量必须为数字'; - } - if(value < 0){ - return "输入数值不能小于0"; - } - } - } }, { field: 'lossRate', align: 'center', title: '损耗率(%)', - editable : { - editor: { - defaultValue: '%', - title : '损耗率(%)', - mode:'inline', - type: 'text', - // 编辑时同样附带百分比符号 - formatter: function(value) { - return value + '%'; - }, - // 编辑后去除百分比符号 - custom_getter: function(value) { - return value.replace('%', ''); - } - }, - validate : function(value) { - if (!value) { - return '损耗率不能为空'; - } - const regex = /(\d+(?:\.\d+)?)%/g; // 创建正则表达式,g标志表示全局匹配 - const match = value.match(regex); // 使用match方法查找所有匹配 - if (!match) { - return '损耗率必须以百分比结尾'; - } - var num = value.replace('%', ''); - if (num < 0 || num > 100) { - return '损耗率必须大于等于0小于等于100'; - } - }, - }, - formatter: function (value,row,index){ - if (value == null || value == ''){ - return "%"; - } - const regex = /(\d+(?:\.\d+)?)%/g; // 创建正则表达式,g标志表示全局匹配 - const match = value.match(regex); // 使用match方法查找所有匹配 - if (match) { - return value; - }else{ - return value + "%"; - } - }, }, { field: 'processMethod', @@ -283,7 +229,6 @@ field: 'remark', align: 'center', title: '备注', - editable: true } ] }; @@ -309,58 +254,6 @@ curParams.parentId = $("#id").val(); return curParams; } - function doSubmit(index, layero,uniqueId){ - console.log(uniqueId); - var iframeWin = window[layero.find('iframe')[0]['name']]; - var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0]; - console.log(rowData.materialName); - var timestamp = new Date().getTime(); - var totalNum = $("#bootstrap-sub-table-1").bootstrapTable('getData').length; - $("#bootstrap-sub-table-1").bootstrapTable('insertRow', { - index:totalNum, - replace:true, - row: { - id:rowData.subId, - materialNo: rowData.materialNo, - bomNo: rowData.bomNo, - level: "1", - materialName: rowData.materialName, - materialType: rowData.materialType, - describe: rowData.describe, - brand: rowData.brand, - unit: rowData.unit, - processMethod: rowData.processMethod, - } - }) - - - layer.close(index); - } - - /* 新增表格行 */ - function insertRow(){ - // var uuidStr = uuid(); - var url = ctx + "erp/material/select"; - var options = { - title: '选择料号', - url: url, - callBack: doSubmit - }; - $.modal.openOptions(options); - } - - /* 删除指定表格行 */ - function removeRow(){ - var ids = $.table.selectColumns("id"); - if (ids.length == 0) { - $.modal.alertWarning("请至少选择一条记录"); - return; - } - $("#bootstrap-sub-table-1").bootstrapTable('remove', { - field: 'id', - values: ids - }) - }