| | |
| | | var dataCheck = []; |
| | | var admin; |
| | | var printData = []; |
| | | var layDate; |
| | | function getCol() { |
| | | var cols = [ |
| | | {field: 'id', title: 'id', align: 'center',hide:true} |
| | | ,{type: 'checkbox'} |
| | | ,{field:'id', width:80, title: '', sort: true, totalRowText: '合计:',hide: true} |
| | | ,{field: 'pakinTime$', title: '入库时间', align: 'center' , sort:true} |
| | | ,{field: 'owner', align: 'center',title: '主体',edit:true} |
| | | ,{field: 'type', align: 'center',title: '物资类别',hide:true,edit:true} |
| | | ,{field: 'proOrderNo', align: 'center',title: '生产订单编号',hide:true,edit:true} |
| | | ,{field: 'workshop', align: 'center',title: '生产车间',hide:true,edit:true} |
| | | ,{field: 'line', align: 'center',title: '生产线',hide:true,edit:true} |
| | | ,{field: 'matnr', align: 'center',title: '存货编码',hide:true,edit:true} |
| | | ,{field: 'brand', align: 'center',title: '牌号',edit:true} |
| | | ,{field: 'batch', align: 'center',title: '批号',edit:true, width: 150, sort:true} |
| | |
| | | ,{field: 'position', align: 'center',title: '存放位置',edit:true,hide:true} |
| | | ,{field: 'stash', align: 'center',title: '仓库',edit:true,hide:true} |
| | | ,{field: 'locNo', align: 'center',title: '库位',edit:true} |
| | | ,{field: 'weightAnfme', align: 'center',title: '剩余重量(KG)',edit:true} |
| | | ,{field: 'owner', align: 'center',title: '主体',edit:true} |
| | | ,{field: 'type', align: 'center',title: '物资类别',hide:true,edit:true} |
| | | ,{field: 'proOrderNo', align: 'center',title: '生产订单编号',hide:true,edit:true} |
| | | ,{field: 'workshop', align: 'center',title: '生产车间',hide:true,edit:true} |
| | | ,{field: 'line', align: 'center',title: '生产线',hide:true,edit:true} |
| | | ,{field: 'weightAnfme', align: 'center',title: '剩余重量(KG)',edit:true,totalRow:true} |
| | | ,{field: 'qtyAnfme', align: 'center',title: '待出库重量(KG)',hide:true} |
| | | ,{field: 'status', align: 'center',title: '状态', templet: setState ,edit:true} |
| | | ,{field: 'stockFreeze', align: 'center',title: '库存冻结', templet: '#stockFreezeTpl'} |
| | | ,{field: 'stockFreezeBy', align: 'center',title: '操作人员',hide:true} |
| | | ,{field: 'stockFreezeDate$', align: 'center',title: '操作日期',hide:true} |
| | | ,{align: 'center', title: '流转明细', toolbar: '#tbLook'} |
| | | ,{field: 'createTime$', title: '创建时间', align: 'center' , sort:true} |
| | | // ,{field: 'orderNo', align: 'center',title: '单号', hide:true} |
| | | // ,{field: 'pakoutTime', align: 'center',title: '出库时间', hide:true} |
| | | // ,{field: 'orderWeight', align: 'center',title: '重量', hide:true} |
| | |
| | | |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).extend({ |
| | | dropdown: 'dropdown/dropdown', |
| | | }).use(['table','laydate', 'form', 'admin', 'dropdown'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | laydate = layui.laydate; |
| | | var form = layui.form; |
| | | admin = layui.admin; |
| | | |
| | | // 日期时间范围 |
| | | laydate.render({ |
| | | elem: '#ID-laydate-range-datetime', |
| | | type: 'datetime', |
| | | range: true |
| | | }); |
| | | |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/pla/list/auth?step=2', |
| | | page: true, |
| | | totalRow: true, // 开启合计行 |
| | | height: function(){ |
| | | var otherHeight = $('.function-area').outerHeight() + $('#search-box').outerHeight(); // 自定义其他区域的高度 |
| | | console.log($(window).height() - otherHeight); |
| | | return $(window).height() - otherHeight - 100; // 返回 number 类型 |
| | | }, |
| | | //height: 'full', |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | size: "lg", |
| | | cellMinWidth: 50, |
| | | cols: [getCol()], |
| | | request: { |
| | |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | 'data': res.data.records, |
| | | } |
| | | }, |
| | | response: { |
| | |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | //滚动body,header跟随滚动 |
| | | $('.layui-table-body').on('scroll', function(e) { |
| | | var leftPx = $(e.target).scrollLeft(); //获取表格body,滚动条距离左边的长度 |
| | | var left = 'translateX(-' + leftPx + 'px)'; |
| | | $('.layui-table-header .layui-table').css('transform', left); //设置表格header的内容反向(-)移动 |
| | | }); |
| | | |
| | | table.on('tool(plaDetl)', function (obj) { |