From 7a08ca0a2a67e73e3cdaa93ec3e1dabc41828be9 Mon Sep 17 00:00:00 2001 From: 18516761980 <56479841@qq.com> Date: 星期二, 28 六月 2022 16:50:46 +0800 Subject: [PATCH] Merge branch 'master' of https://gitee.com/luxiaotao1123/zy-asrs into hylyasrs --- src/main/webapp/static/js/waitPakin/waitPakin.js | 82 +++++++++++++++++++++++++++++----------- 1 files changed, 59 insertions(+), 23 deletions(-) diff --git a/src/main/webapp/static/js/waitPakin/waitPakin.js b/src/main/webapp/static/js/waitPakin/waitPakin.js index 623a5b0..4027f58 100644 --- a/src/main/webapp/static/js/waitPakin/waitPakin.js +++ b/src/main/webapp/static/js/waitPakin/waitPakin.js @@ -1,10 +1,34 @@ var pageCurr; -layui.use(['table','laydate', 'form'], function(){ +function getCol() { + var cols = [ {type: 'checkbox'} ]; + cols.push.apply(cols, detlCols); + cols.push({field: 'locNo', align: 'center',title: '搴撲綅鍙�'} + ,{field: 'status', align: 'center',title: '鏁版嵁鐘舵��', templet:function(row){ + var html = "<input value='status' type='checkbox' lay-skin='switch' lay-text='姝e父|閿佸畾'' lay-filter='tableCheckbox' disabled='disabled' table-index='"+row.LAY_TABLE_INDEX+"'"; + if(row.status === 'Y'){html += " checked ";} + html += ">"; + return html; + }, hide: true} + ,{field: 'ioStatus', align: 'center',title: '鍏ュ嚭鐘舵��', templet:function(row){ + var html = "<input value='ioStatus' type='checkbox' lay-skin='switch' lay-text='鍏ュ簱涓瓅寰呭叆搴�' lay-filter='tableCheckbox' disabled='disabled' table-index='"+row.LAY_TABLE_INDEX+"'"; + if(row.ioStatus === 'Y'){html += " checked ";} + html += ">"; + return html; + }} + ,{field: 'modiUser$', align: 'center',title: '淇敼浜哄憳', hide:true} + ,{field: 'modiTime$', align: 'center',title: '淇敼鏃堕棿', hide:true}) + return cols; +} + +layui.config({ + base: baseUrl + "/static/layui/lay/modules/" +}).use(['table','laydate', 'form', 'tableMerge'], function(){ var table = layui.table; var $ = layui.jquery; var layer = layui.layer; var layDate = layui.laydate; var form = layui.form; + var tableMerge = layui.tableMerge; // 鏁版嵁娓叉煋 tableIns = table.render({ @@ -17,27 +41,7 @@ even: true, toolbar: '#toolbar', cellMinWidth: 50, - cols: [[ - {type: 'checkbox'} -// ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} - ,{field: 'id', align: 'center',title: '缂栧彿', sort: true} - ,{field: 'barcode', align: 'center',title: '鎵樼洏鐮�'} - ,{field: 'matnr', align: 'center',title: '鐗╂枡缂栫爜'} - ,{field: 'maktx', align: 'center',title: '鐗╂枡鎻忚堪'} - ,{field: 'anfme', align: 'center',title: '鏁伴噺'} - ,{field: 'unit', align: 'center',title: '鍗曚綅'} - ,{field: 'status', align: 'center',title: '鐘舵��', templet:function(row){ - var html = "<input value='status' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' disabled='disabled' table-index='"+row.LAY_TABLE_INDEX+"'"; - if(row.status === 'Y'){html += " checked ";} - html += ">"; - return html; - }} - ,{field: 'memo', align: 'center',title: '澶囨敞'} - ,{field: 'modiTime$', align: 'center',title: '淇敼鏃堕棿', hide: true} - ,{field: 'modiUser$', align: 'center',title: '淇敼浜哄憳', hide: true} - - // ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:150} - ]], + cols: [getCol()], request: { pageName: 'curr', pageSize: 'limit' @@ -54,6 +58,7 @@ statusCode: 200 }, done: function(res, curr, count) { + // tableMerge.render(this); if (res.code === 403) { top.location.href = baseUrl+"/"; } @@ -97,6 +102,33 @@ table.on('toolbar(waitPakin)', function (obj) { var checkStatus = table.checkStatus(obj.config.id); switch(obj.event) { + case 'addWrk': + if (checkStatus.data.length === 0){ + layer.msg('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�', {icon: 2}); + } else { + layer.confirm('纭畾鐢熸垚宸ヤ綔妗d换鍔″悧', function(){ + $.ajax({ + url: baseUrl+"/create/waitPain/wrkMast/start", + headers: {'token': localStorage.getItem('token')}, + data: JSON.stringify(checkStatus.data), + contentType:'application/json;charset=UTF-8', + method: 'POST', + traditional:true, + success: function (res) { + if (res.code === 200){ + layer.closeAll(); + tableReload(false); + layer.msg(res.msg, {icon: 1}) + } else if (res.code === 403){ + top.location.href = baseUrl+"/"; + } else { + layer.msg(res.msg, {icon: 2}) + } + } + }) + }); + } + break; case 'addData': layer.open({ type: 2, @@ -384,7 +416,11 @@ elem: '#appeTime\\$', type: 'datetime' }); - + layDate.render({ + elem: '.layui-laydate-range' + ,type: 'datetime' + ,range: true + }); }); -- Gitblit v1.9.1