From 00bbbcf357b6e9d8a2547ea85afd6ad93a47ab33 Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Fri, 11 Oct 2019 11:21:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B6=E4=BB=96=E5=85=A5=E5=BA=93=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/otherwarehous/otherwarehousadd.js | 101 +----------------- .../tpl/otherwarehous/otherwarehousadd.html | 23 ++-- 2 files changed, 10 insertions(+), 114 deletions(-) diff --git a/erp-modular/src/main/resources/template/js/otherwarehous/otherwarehousadd.js b/erp-modular/src/main/resources/template/js/otherwarehous/otherwarehousadd.js index 24519815..6cb9df65 100644 --- a/erp-modular/src/main/resources/template/js/otherwarehous/otherwarehousadd.js +++ b/erp-modular/src/main/resources/template/js/otherwarehous/otherwarehousadd.js @@ -1,5 +1,3 @@ -var enclosureList = new Array(); //附件 - var assetArticles = new Array(); //用品集合 layui.config({ @@ -7,7 +5,7 @@ layui.config({ version: skyeyeVersion }).extend({ //指定js别名 window: 'js/winui.window' -}).define(['window', 'jquery', 'winui', 'fileUpload'], function(exports) { +}).define(['window', 'jquery', 'winui'], function(exports) { winui.renderColor(); layui.use(['form'], function(form) { var index = parent.layer.getFrameIndex(window.name); //获取窗口索引 @@ -139,14 +137,6 @@ layui.config({ remark: $("#remark").val(), assetArticlesStr: JSON.stringify(tableData) }; - if(enclosureList.length == 0 || isNull($('#enclosureUploadBtn'))) { - params.enclosureInfo = ""; - } else { - $.each(enclosureList, function(i, item) { - enclosureInfo += item.id + ','; - }); - params.enclosureInfo = enclosureInfo; - } //表单类型为保存为草稿 params.subType = '1'; AjaxPostUtil.request({url: reqBasePath + "assetarticles019", params: params, type: 'json', callback: function(json) { @@ -161,78 +151,6 @@ layui.config({ return false; }); - form.on('submit(formSubBean)', function(data) { - //表单验证 - if(winui.verifyForm(data.elem)) { - //获取已选用品数据 - var rowTr = $("#useTable tr"); - if(rowTr.length == 0) { - winui.window.msg('请选择需要领用的用品~', {icon: 2, time: 2000}); - return false; - } - var tableData = new Array(); - var noError = false; //循环遍历表格数据时,是否有其他错误信息 - $.each(rowTr, function(i, item) { - var rowNum = $(item).attr("trcusid").replace("tr", ""); - var residualNum = parseInt($("#residualNum" + rowNum).html()); - if(parseInt($("#useNum" + rowNum).val()) == 0) { - $("#useNum" + rowNum).addClass("layui-form-danger"); - $("#useNum" + rowNum).focus(); - winui.window.msg('领用数量不能为0', {icon: 2, time: 2000}); - noError = true; - return false; - } - if(parseInt($("#useNum" + rowNum).val()) > residualNum) { - $("#useNum" + rowNum).addClass("layui-form-danger"); - $("#useNum" + rowNum).focus(); - winui.window.msg('领用数量不能超过库存数量', {icon: 2, time: 2000}); - noError = true; - return false; - } - if(inTableDataArrayByAssetarId($("#assetarId" + rowNum).val(), tableData)){ - winui.window.msg('领用单存在相同的用品', {icon: 2, time: 2000}); - noError = true; - return false; - } - var row = { - typeId: $("#typeId" + rowNum).val(), - assetarId: $("#assetarId" + rowNum).val(), - useNum: $("#useNum" + rowNum).val(), - remark: $("#remark" + rowNum).val() - }; - tableData.push(row); - }); - if(noError) { - return false; - } - - var params = { - title: $("#useTitle").html(), - remark: $("#remark").val(), - assetArticlesStr: JSON.stringify(tableData) - }; - if(enclosureList.length == 0 || isNull($('#enclosureUploadBtn'))) { - params.enclosureInfo = ""; - } else { - $.each(enclosureList, function(i, item) { - enclosureInfo += item.id + ','; - }); - params.enclosureInfo = enclosureInfo; - } - //表单类型为提交审批 - params.subType = '2'; - AjaxPostUtil.request({url: reqBasePath + "assetarticles019", params: params, type: 'json', callback: function(json) { - if(json.returnCode == 0) { - parent.layer.close(index); - parent.refreshCode = '0'; - } else { - winui.window.msg(json.returnMessage, {icon: 2, time: 2000}); - } - }}); - } - return false; - }); - //判断选中的用品是否也在数组中 function inTableDataArrayByAssetarId(str, array) { var isIn = false; @@ -287,23 +205,6 @@ layui.config({ } } - //附件上传 - $("body").on("click", "#enclosureUploadBtn", function() { - _openNewWindows({ - url: "../../tpl/common/enclosureupload.html", - title: "上传附件", - pageId: "enclosureuploadpage", - area: ['420px', '420px'], - callBack: function(refreshCode) { - var str = ""; - $.each([].concat(enclosureList), function(i, item) { - str += '
' + item.name + ''; - }); - $("#enclosureUploadBtn").parent().html('' + str); - } - }); - }); - //根据类型重置用户列表 function resetAssetList(thisRowNum, list) { var sHtml = getDataUseHandlebars(selOption, { diff --git a/erp-modular/src/main/resources/template/tpl/otherwarehous/otherwarehousadd.html b/erp-modular/src/main/resources/template/tpl/otherwarehous/otherwarehousadd.html index 07469572..13472ebe 100644 --- a/erp-modular/src/main/resources/template/tpl/otherwarehous/otherwarehousadd.html +++ b/erp-modular/src/main/resources/template/tpl/otherwarehous/otherwarehousadd.html @@ -41,11 +41,13 @@ - 用品类别 - 用品名称 - 规格(单位) - 库存 - 领用数量 + 仓库 + 产品(型号) + 单位 + 库存 + 数量 + 单价 + 金额 备注 @@ -60,17 +62,10 @@ -
- -
- -
-
- - +
@@ -92,7 +87,7 @@ \ No newline at end of file