diff --git a/src/main/resources/templates/pages/group/application_multi.html b/src/main/resources/templates/pages/group/application_multi.html index f57df7df..86278eb8 100644 --- a/src/main/resources/templates/pages/group/application_multi.html +++ b/src/main/resources/templates/pages/group/application_multi.html @@ -17,13 +17,14 @@
@@ -53,10 +54,10 @@ }, response: { statusName: 'status' //规定数据状态的字段名称,默认:code - ,statusCode: 200 //规定成功的状态码,默认:0 - ,msgName: 'message' //规定状态信息的字段名称,默认:msg - ,countName: 'count' //规定数据总数的字段名称,默认:count - ,dataName: 'data' //规定数据列表的字段名称,默认:data + , statusCode: 200 //规定成功的状态码,默认:0 + , msgName: 'message' //规定状态信息的字段名称,默认:msg + , countName: 'count' //规定数据总数的字段名称,默认:count + , dataName: 'data' //规定数据列表的字段名称,默认:data }, toolbar: '#toolbarDemo', cols: [ @@ -65,11 +66,11 @@ {field: 'gname', width: 150, title: '组合名称'}, {field: 'code', width: 150, title: '组合编码'}, {title: '拥有物料', width: 700, align: "center"}, - {field: 'quantity', width: 200, title: '数量',edit:'quantity'}, + {field: 'quantity', width: 200, title: '数量', edit: 'quantity'}, {title: '操作', minWidth: 200, toolbar: '#currentTableBar', align: "center"}, ] ], - limits: [10, 15, 20, 25, 50,100], + limits: [10, 15, 20, 25, 50, 100], limit: 10, page: true, skin: 'line', @@ -78,10 +79,10 @@ let materialSimple = j["materialSimple"]; let gid = j["id"]; let keys = Object.keys(materialSimple); - var materialItem = $("[lay-id='currentTableId'] tr:eq(" + (i+1) + ")").children()[3]; + var materialItem = $("[lay-id='currentTableId'] tr:eq(" + (i + 1) + ")").children()[3]; var aItem = materialItem.childNodes[0]; for (let k = 0; k < keys.length; k++) { - $(aItem).append('') + $(aItem).append('') } }) } @@ -92,7 +93,7 @@ console.log(obj) }); - table.on('edit(currentTableFilter)', function(obj){ //注:edit是固定事件名,test是table原始容器的属性 lay-filter="对应的值" + table.on('edit(currentTableFilter)', function (obj) { //注:edit是固定事件名,test是table原始容器的属性 lay-filter="对应的值" var req = {}; req.gid = obj.data.id; @@ -107,7 +108,7 @@ var flag = res.data; if (!flag) { // 如果当前数目不合适 layer.msg("当前组合中有物料库存数量不足", {icon: 0, time: 500}, function () { - obj.update({quantity:1}) + obj.update({quantity: 1}) }); } @@ -130,8 +131,8 @@ req.gids[i] = data[i].id; } - if(obj.event==='delete'){ - if(req.gids.length > 0) { + if (obj.event === 'delete') { + if (req.gids.length > 0) { layer.confirm('真的删除么', {icon: 2, title: '提示'}, function (index) { $.ajax({ url: "/group/deleteApplicationToRedis", @@ -162,74 +163,74 @@ } }) }) - }else{ + } else { layer.msg("未选中记录,请确认!"); return false; } - } - else if(obj.event === 'applicationOut'){ - req.type = "more"; - $.ajax({ - url:"/group/createMultiApplication", - type:"post", - data:JSON.stringify(req), - dataType: "json", - contentType: "application/json;charset=utf-8", - success: function (d) { - layer.close(this.layerIndex); - if (d.status >= 300) { - layer.msg(d.statusInfo.message,{ - icon:0, - time:1000 - });//失败的表情 - return; - }else if(d.status === 1234){ - layer.msg(d.data,{ - icon:0, - time:1000 - }) - return - } - else { - layer.msg("申请成功!", { - icon: 6,//成功的表情 + } else if (obj.event === 'applicationOut') { + if (req.gids.length > 0) { + req.type = "more"; + $.ajax({ + url: "/group/createMultiApplication", + type: "post", + data: JSON.stringify(req), + dataType: "json", + contentType: "application/json;charset=utf-8", + success: function (d) { + layer.close(this.layerIndex); + if (d.status >= 300) { + layer.msg(d.statusInfo.message, { + icon: 0, time: 1000 - }, //1秒关闭(如果不配置,默认是3秒) - function(){ - //do something - table.reload('currentTableId', { - url: '/group/applicant_multi_create', - page: { - curr: 1 - } - }, 'data'); - }); + });//失败的表情 + return; + } else if (d.status === 1234) { + layer.msg(d.data, { + icon: 0, + time: 1000 + }) + return + } else { + layer.msg("申请成功!", { + icon: 6,//成功的表情 + time: 1000 + }, //1秒关闭(如果不配置,默认是3秒) + function () { + //do something + table.reload('currentTableId', { + url: '/group/applicant_multi_create', + page: { + curr: 1 + } + }, 'data'); + }); + } } - } - }); - return false; + }); + return false; + } } }); table.on('tool(currentTableFilter)', function (obj) { let data = obj.data; - if(obj.event === 'applicationOut'){ + if (obj.event === 'applicationOut') { // 出库申请 var req = data; req.type = "one"; $.ajax({ - url:"/group/createMultiApplication", - type:"post", - data:JSON.stringify(req), + url: "/group/createMultiApplication", + type: "post", + data: JSON.stringify(req), dataType: "json", contentType: "application/json;charset=utf-8", success: function (d) { layer.close(this.layerIndex); if (d.status >= 300) { - layer.msg(d.statusInfo.message,{ - icon:0, - time:1000 + layer.msg(d.statusInfo.message, { + icon: 0, + time: 1000 });//失败的表情 return; } else { @@ -237,7 +238,7 @@ icon: 6,//成功的表情 time: 1000 }, //1秒关闭(如果不配置,默认是3秒) - function(){ + function () { //do something table.reload('currentTableId', { url: '/group/applicant_multi_create',