| | |
| | | |
| | | Integer getStockOutPageCount(Map<String, Object> map); |
| | | |
| | | @Update("update asr_loc_detl set loc_no = #{newLocNo}, modi_time=getDate() where loc_no = #{oldLocNo}") |
| | | @Update("update man_loc_detl set loc_no = #{newLocNo}, modi_time=getDate() where loc_no = #{oldLocNo}") |
| | | int updateLocNo(String newLocNo, String oldLocNo); |
| | | |
| | | @Select("SELECT ld.loc_no FROM asr_loc_detl ld LEFT JOIN asr_loc_mast lm ON ld.loc_no = lm.loc_no WHERE (1 = 1 AND ld.matnr = #{matnr} AND (lm.row1 >= #{start} AND lm.row1 <= #{end}) AND lm.loc_sts = 'F' AND DateDiff(dd, lm.appe_time, getdate()) = 0) ORDER BY lm.appe_time ASC") |
| | |
| | | if(agvWrkMast.getSourceLocNo().contains("C")){ |
| | | agvTaskkDescribeParam.setFromLocationCode(agvWrkMast.getSourceLocNo()); |
| | | } |
| | | agvTaskkDescribeParam.setFromLocationCode(agvWrkMast.getSourceLocNo()); |
| | | agvTaskkDescribeParam.setToLocationCode(agvWrkMast.getLocNo()); |
| | | agvTaskkDescribeParam.setContainerCode(agvWrkMast.getBarcode()); |
| | | return agvTaskParam; |
| | |
| | | import com.zy.asrs.utils.SaasUtils; |
| | | import com.zy.common.model.LocDto; |
| | | import com.zy.system.entity.User; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | Date now = new Date(); |
| | | for (LocDetlAdjustParam.LocDetlAdjust locDetlAdjust : param.getList()) { |
| | | ManLocDetl manLocDetl = this.baseMapper.selectItem(param.getLocNo(), locDetlAdjust.getMatnr(), locDetlAdjust.getBatch()); |
| | | |
| | | if(Cools.isEmpty(manLocDetl)){ |
| | | addManlocDetl(locDetlAdjust,param.getLocNo()); |
| | | continue; |
| | | } |
| | | |
| | | this.baseMapper.delete(new EntityWrapper<ManLocDetl>() |
| | | .eq("loc_no", param.getLocNo()).eq("matnr",locDetlAdjust.getMatnr())); |
| | | Mat mat = matService.selectOne(new EntityWrapper<Mat>() |
| | |
| | | } |
| | | } |
| | | |
| | | private void addManlocDetl(LocDetlAdjustParam.LocDetlAdjust param, String locNo){ |
| | | Date now = new Date(); |
| | | ManLocDetl manLocDetl = new ManLocDetl(); |
| | | Node node = nodeService.selectOne(new EntityWrapper<Node>().eq("name", locNo)); |
| | | Mat mat = matService.selectByMatnr(param.getMatnr()); |
| | | BeanUtils.copyProperties(mat,manLocDetl); |
| | | manLocDetl.setNodeId(node.getId()); |
| | | manLocDetl.setBatch(param.getBatch()); |
| | | manLocDetl.setAnfme(param.getCount()); |
| | | manLocDetl.setContainerCode(param.getSuppCode()); |
| | | manLocDetl.setCsocode(param.getThreeCode()); |
| | | manLocDetl.setIsoseq(param.getDeadTime()); |
| | | manLocDetl.setCreateTime(now); |
| | | manLocDetl.setModiTime(now); |
| | | manLocDetl.setLocNo(locNo); |
| | | manLocDetl.setStatus(1); |
| | | this.insert(manLocDetl); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | @Override |
| | | public List<ManPakOut> selectByLocType(String locType) { |
| | | return this.selectList(new EntityWrapper<ManPakOut>().like("loc_no",locType).eq("status",1)); |
| | | return this.selectList(new EntityWrapper<ManPakOut>().like("loc_no",locType+"-") |
| | | .andNew().eq("status",0).or().eq("status",8)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | u8: |
| | | url: http://192.168.1.55:8010 |
| | | orderReportPath: /api/RdAudit |
| | | |
| | |
| | | and mld.loc_no like concat('%',#{loc_no},'%') |
| | | </if> |
| | | <if test="locNo != null and locNo != ''"> |
| | | and mld.loc_no like concat('%',#{loc_no},'%') |
| | | and mld.loc_no like concat('%',#{locNo},'%') |
| | | </if> |
| | | <if test="matnr != null and matnr != ''"> |
| | | and mld.matnr like concat('%',#{matnr},'%') |
New file |
| | |
| | | var pageCurr; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#locRule', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/locRule/list/auth', |
| | | page: true, |
| | | limit: 15, |
| | | limits: [15, 30, 50, 100, 200, 500], |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | height: 'full-120', |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | // ,{field: 'id', align: 'center',title: 'ID'} |
| | | ,{field: 'matnr', align: 'center',title: '商品编号'} |
| | | ,{field: 'specs', align: 'center',title: '规格', hide: true} |
| | | ,{field: 'model', align: 'center',title: '通用型号', hide: true} |
| | | ,{field: 'cstmr', align: 'center',title: '客户', hide: true} |
| | | ,{field: 'batch', align: 'center',title: '批号'} |
| | | ,{field: 'other', align: 'center',title: '其他', hide: true} |
| | | ,{field: 'rowBeg', align: 'center',title: '开始排'} |
| | | ,{field: 'rowEnd', align: 'center',title: '结束排'} |
| | | ,{field: 'bayBeg', align: 'center',title: '开始列'} |
| | | ,{field: 'bayEnd', align: 'center',title: '结束列'} |
| | | ,{field: 'levBeg', align: 'center',title: '开始层'} |
| | | ,{field: 'levEnd', align: 'center',title: '结束层'} |
| | | ,{field: 'limit', align: 'center',title: '上限', hide: true} |
| | | ,{field: 'status$', align: 'center',title: '状态', hide: true} |
| | | ,{field: 'createBy$', align: 'center',title: '添加人员', hide: true} |
| | | ,{field: 'createTime$', align: 'center',title: '添加时间', hide: true} |
| | | ,{field: 'updateBy$', align: 'center',title: '修改人员', hide: true} |
| | | ,{field: 'updateTime$', align: 'center',title: '修改时间', hide: true} |
| | | ,{field: 'memo', align: 'center',title: '备注', hide: true} |
| | | ,{field: 'mixed$', align: 'center',title: '混载'} |
| | | // ,{field: 'keepGo$', align: 'center',title: '继续搜索'} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(locRule)', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | searchData['orderByField'] = obj.field; |
| | | searchData['orderByType'] = obj.type; |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: 1} |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(locRule)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id).data; |
| | | switch(obj.event) { |
| | | case 'addData': |
| | | showEditModel(); |
| | | break; |
| | | case 'deleteData': |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('请选择要删除的数据', {icon: 2}); |
| | | return; |
| | | } |
| | | del(checkStatus.map(function (d) { |
| | | return d.id; |
| | | })); |
| | | break; |
| | | case 'exportData': |
| | | admin.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | | var fields=[]; |
| | | obj.config.cols[0].map(function (col) { |
| | | if (col.type === 'normal' && col.hide === false && col.toolbar == null) { |
| | | titles.push(col.title); |
| | | fields.push(col.field); |
| | | } |
| | | }); |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | | 'locRule': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/locRule/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | table.exportFile(titles,res.data,'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(locRule)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'edit': |
| | | showEditModel(data); |
| | | break; |
| | | case "del": |
| | | del([data.id]); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | /* 弹窗 - 新增、修改 */ |
| | | function showEditModel(mData) { |
| | | admin.open({ |
| | | type: 1, |
| | | area: '1000px', |
| | | title: (mData ? '修改' : '添加') + '库区规则', |
| | | content: $('#editDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | layDateRender(mData); |
| | | form.val('detail', mData); |
| | | form.on('submit(editSubmit)', function (data) { |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/locRule/"+(mData?'update':'add')+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: data.field, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.close(dIndex); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | return false; |
| | | }); |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | layui.form.render('select'); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /* 删除 */ |
| | | function del(ids) { |
| | | layer.confirm('确定要删除选中数据吗?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | }, function (i) { |
| | | layer.close(i); |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/locRule/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {ids: ids}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | // 搜索 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 重置 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 时间选择器 |
| | | function layDateRender(data) { |
| | | setTimeout(function () { |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | }); |
| | | layDate.render({ |
| | | elem: '#createTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['createTime\\$']:null |
| | | }); |
| | | layDate.render({ |
| | | elem: '#updateTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['updateTime\\$']:null |
| | | }); |
| | | |
| | | }, 300); |
| | | } |
| | | layDateRender(); |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: pageCurr} |
| | | }); |
| | | } |
New file |
| | |
| | | var pageCurr; |
| | | layui.use(['table','laydate', 'form'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | |
| | | getInBound(); |
| | | limit(); |
| | | |
| | | // 获取入库口 |
| | | function getInBound(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/agv/available/empty/put/site", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | var tpl = $("#putSiteSelectTemplate").html(); |
| | | var template = Handlebars.compile(tpl); |
| | | var html = template(res); |
| | | $('#inSiteSelect').append(html); |
| | | form.render('select'); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 空板入库 |
| | | form.on('submit(inbound)', function (data) { |
| | | var inSite = $('#inSiteSelect').val(); |
| | | layer.confirm('请确保该工作位上已放有空板', function(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/agv/empty/plate/in/start", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | data: {sourceStaNo: inSite}, |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.msg("入库启动成功,目标库位:" + res.data); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | |
| | | }); |
| | | |
| | | |
| | | |
| | | }) |
| | | |
New file |
| | |
| | | var pageCurr; |
| | | |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | |
| | | // 获取出库口 |
| | | function getOutBound(){ |
| | | // $.ajax({ |
| | | // url: baseUrl+"/agv/available/empty/put/site", |
| | | // headers: {'token': localStorage.getItem('token')}, |
| | | // method: 'POST', |
| | | // async: false, |
| | | // success: function (res) { |
| | | // if (res.code === 200){ |
| | | // var tpl = $("#takeSiteSelectTemplate").html(); |
| | | // var template = Handlebars.compile(tpl); |
| | | // var html = template(res); |
| | | // $('#staNoSelect').append(html); |
| | | // form.render('select'); |
| | | // } else if (res.code === 403){ |
| | | // top.location.href = baseUrl+"/"; |
| | | // }else { |
| | | // layer.msg(res.msg) |
| | | // } |
| | | // } |
| | | // }) |
| | | } |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#locMast', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/agv/locMast/list/auth', |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | where: {loc_sts: "D",floor:$('#floorSelect option:selected').val()}, |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | defaultToolbar: ['filter'], |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {type: 'checkbox', fixed: 'left'} |
| | | ,{field: 'locNo', align: 'center',title: '库位号',sort:true} |
| | | ,{field: 'locSts$', align: 'center',title: '库位状态',width:200} |
| | | // ,{field: 'whsType$', align: 'center',title: '库位类型'} |
| | | ,{field: 'row1', align: 'center',title: '排'} |
| | | ,{field: 'bay1', align: 'center',title: '列'} |
| | | ,{field: 'lev1', align: 'center',title: '层'} |
| | | // ,{field: 'fullPlt', align: 'center',title: '满板', templet:function(row){ |
| | | // var html = "<input value='fullPlt' type='checkbox' disabled=‘disabled’ lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'"; |
| | | // if(row.fullPlt === 'Y'){html += " checked ";} |
| | | // html += ">"; |
| | | // return html; |
| | | // },width:80} |
| | | ,{field: 'modiUser$', align: 'center',title: '修改人员',event: 'modiUser'} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间'} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | getOutBound(); |
| | | limit(); |
| | | form.on('checkbox(tableCheckbox)', function (data) { |
| | | var _index = $(data.elem).attr('table-index')||0; |
| | | if(data.elem.checked){ |
| | | res.data[_index][data.value] = 'Y'; |
| | | }else{ |
| | | res.data[_index][data.value] = 'N'; |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(locMast)', function (obj) { |
| | | var data = table.checkStatus(obj.config.id).data; |
| | | switch (obj.event) { |
| | | case 'outbound': |
| | | var staNo = $("#staNoSelect").val(); |
| | | if (staNo === "" || staNo === null){ |
| | | layer.msg("请选择出库口"); |
| | | return; |
| | | } |
| | | var locNos = []; |
| | | data.forEach(function(elem) { |
| | | locNos.push(elem.locNo); |
| | | }); |
| | | if (data.length === 0){ |
| | | layer.msg('请至少选中一行数据'); |
| | | } else { |
| | | $.ajax({ |
| | | url: baseUrl+"/agv/empty/plate/out/start", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | stationCode: staNo, |
| | | locNos: locNos |
| | | }, |
| | | method: 'POST', |
| | | traditional:true, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | tableReload(); // 重载表格 |
| | | getOutBound(); // 重载出库口 |
| | | layer.msg(res.msg); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | function changeStation(){ |
| | | var floor = $('#floorSelect option:selected').val(); |
| | | $('#staNoSelect').empty(); |
| | | if(floor == 1){ |
| | | $('#staNoSelect').append("<option value=CS-101>CS-101</option>"); |
| | | $('#staNoSelect').append("<option value=CS-102>CS-102</option>") |
| | | } |
| | | if(floor == 3){ |
| | | $('#staNoSelect').append("<option value=CS-305>CS-305</option>"); |
| | | $('#staNoSelect').append("<option value=CS-306>CS-306</option>") |
| | | $('#staNoSelect').append("<option value=CS-307>CS-307</option>") |
| | | } |
| | | form.render(); |
| | | } |
| | | |
| | | // 搜索栏搜索事件 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | $('#detlTable').css("display", 'none'); |
| | | tableReload(false); |
| | | getOutBound(); |
| | | changeStation(); |
| | | }); |
| | | |
| | | // 搜索栏重置事件 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | $('#detlTable').css("display", 'none'); |
| | | tableReload(false); |
| | | getOutBound(); |
| | | }); |
| | | |
| | | }) |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | (child ? parent.tableIns : tableIns).reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | if (res.data.length === 0 && count !== 0) { |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr-1 |
| | | } |
| | | }); |
| | | pageCurr -= 1; |
| | | } |
| | | limit(child); |
| | | } |
| | | }); |
| | | } |
New file |
| | |
| | | var locDetlLayerIdx; |
| | | var tableIns; |
| | | var form; |
| | | var locDetlData = []; |
| | | function getCol() { |
| | | var cols = [ |
| | | {field: 'locNo', align: 'center',title: '库位号', merge: true, style: 'font-weight: bold'} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ]; |
| | | arrRemove(detlCols, 'field', 'zpallet'); |
| | | cols.push.apply(cols, detlCols); |
| | | return cols; |
| | | } |
| | | |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin', 'tableMerge'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | form = layui.form; |
| | | var admin = layui.admin; |
| | | var tableMerge = layui.tableMerge; |
| | | |
| | | tableIns = table.render({ |
| | | elem: '#chooseData', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | data: [], |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [getCol()], |
| | | done: function(res, curr, count) { |
| | | tableMerge.render(this); |
| | | limit(); |
| | | getOutBound(); |
| | | } |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(chooseData)', function (obj) { |
| | | switch (obj.event) { |
| | | case 'outbound': |
| | | if (locDetlData.length === 0){ |
| | | layer.msg('请先添加盘点库存', {icon: 2}); |
| | | } else { |
| | | var staNo = $("#staNoSelect").val(); |
| | | if (staNo === "" || staNo === null){ |
| | | layer.msg("请选择盘点站", {icon: 2}); |
| | | return; |
| | | } |
| | | let param = { |
| | | station: staNo, |
| | | locDetls: locDetlData |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl+"/agv/locCheck/out/start", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | locDetlData = []; |
| | | tableIns.reload({data: locDetlData}); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 获取出库口 |
| | | function getOutBound(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/available/take/check/site", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | var tpl = $("#takeSiteSelectTemplate").html(); |
| | | var template = Handlebars.compile(tpl); |
| | | var html = template(res); |
| | | $('#staNoSelect').append(html); |
| | | form.render('select'); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | $(document).on('click','#mat-query', function () { |
| | | let loadIndex = layer.msg('请求中...', {icon: 16, shade: 0.01, time: false}); |
| | | locDetlLayerIdx = layer.open({ |
| | | type: 2, |
| | | title: false, |
| | | closeBtn: false, |
| | | maxmin: false, |
| | | area: ['90%', '85%'], |
| | | shadeClose: true, |
| | | content: 'locDetlCheckQuery.html', |
| | | success: function(layero, index){ |
| | | layer.close(loadIndex); |
| | | } |
| | | }); |
| | | }) |
| | | |
| | | }) |
| | | |
| | | // 添加表格数据 |
| | | function addTableData(data,floor) { |
| | | if(locDetlData[0]){ |
| | | if(floor != locDetlData[0].locNo.split('@')[1]){ |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | for (let i=0;i<data.length;i++){ |
| | | let pass = false; |
| | | for (let j=0;j<locDetlData.length;j++){ |
| | | if (data[i].matnr === locDetlData[j].matnr && data[i].batch === locDetlData[j].batch && data[i].locNo === locDetlData[j].locNo) { |
| | | pass = true; |
| | | break; |
| | | } |
| | | } |
| | | if (pass) { |
| | | data.splice(i--, 1); |
| | | } else { |
| | | data[i]["count"] = data[i]["anfme"]; |
| | | } |
| | | |
| | | } |
| | | locDetlData.push.apply(locDetlData, data); |
| | | tableIns.reload({data: locDetlData}); |
| | | layer.close(locDetlLayerIdx); |
| | | return true; |
| | | } |
| | | |
| | | // 添加盘点站选择 |
| | | function addStationData(data) { |
| | | $('#staNoSelect').empty(); |
| | | if(data == 1){ |
| | | $('#staNoSelect').append("<option value=CS-101>CS-101</option>"); |
| | | $('#staNoSelect').append("<option value=CS-102>CS-102</option>") |
| | | } |
| | | if(data == 3){ |
| | | $('#staNoSelect').append("<option value=CS-305>CS-305</option>"); |
| | | $('#staNoSelect').append("<option value=CS-306>CS-306</option>") |
| | | $('#staNoSelect').append("<option value=CS-307>CS-307</option>") |
| | | } |
| | | form.render(); |
| | | } |
New file |
| | |
| | | var pageCurr = 0; |
| | | var tableIns; |
| | | function getCol() { |
| | | var cols = [ |
| | | {field: 'locNo', align: 'center',title: '库位号', merge: true, style: 'font-weight: bold'} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ]; |
| | | arrRemove(detlCols, 'field', 'zpallet'); |
| | | cols.push.apply(cols, detlCols); |
| | | return cols; |
| | | } |
| | | |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'tableMerge'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var form = layui.form; |
| | | var tableMerge = layui.tableMerge; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#locMatCode', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | // url: baseUrl+'/locDetl/list/auth', |
| | | data:[], |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 50, 100, 200, 500], |
| | | even: true, |
| | | cellMinWidth: 50, |
| | | cols: [getCol()], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | tableMerge.render(this); |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | clearSelect(); |
| | | } |
| | | }); |
| | | |
| | | }); |
| | | |
| | | // 搜索库位物料 |
| | | function getLoc(el) { |
| | | tableIns.reload({ |
| | | url: baseUrl+'/agv/locDetl/list/auth' |
| | | , where: {loc_no: el.value} |
| | | , done:function (res) { |
| | | limit(); |
| | | clearSelect(); |
| | | // 获取同一堆垛机的空库位 |
| | | http.post(baseUrl + "/agv/group/empty/stock", {sourceLocNo: el.value}, function (res) { |
| | | if (res.data != null) { |
| | | var tpl = $("#emptyLocStock").html(); |
| | | var template = Handlebars.compile(tpl); |
| | | var html = template(res); |
| | | $('#targetLocNo').append(html); |
| | | layui.form.render('select'); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 移库启动 |
| | | function locMove() { |
| | | var sourceLocNo = $("#sourceLocNo").val(); |
| | | var targetLocNo = $("#targetLocNo").val(); |
| | | if (sourceLocNo === null || sourceLocNo === ""){ |
| | | $("#sourceLocNo").css("border-color", "red"); |
| | | setTimeout(function () { |
| | | $("#sourceLocNo").css("border-color", "#b8b8b8"); |
| | | }, 1000); |
| | | layer.msg("请输入源库位"); |
| | | return; |
| | | } |
| | | if (targetLocNo === null || targetLocNo === "") { |
| | | $(".layui-select-title .layui-input").css("border-color", "red"); |
| | | setTimeout(function () { |
| | | $(".layui-select-title .layui-input").css("border-color", "#b8b8b8"); |
| | | }, 1000); |
| | | layer.msg("请输入目标库位"); |
| | | return; |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl + "/agv/loc/move/start", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | dataType: 'json', |
| | | data: { |
| | | sourceLocNo: sourceLocNo, |
| | | targetLocNo: targetLocNo |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | $("#sourceLocNo").val(""); |
| | | $("#targetLocNo").empty(); |
| | | layui.form.render('select'); |
| | | tableIns.reload({ |
| | | data: [], |
| | | url: '', |
| | | done:function (res) { |
| | | limit();clearSelect(); |
| | | } |
| | | }); |
| | | layer.msg(res.msg); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | function clearSelect() { |
| | | $("#targetLocNo").empty(); |
| | | layui.form.render('select'); |
| | | } |
New file |
| | |
| | | var matCodeLayerIdx; |
| | | var initCountVal = 0; |
| | | var matCodeData = []; |
| | | function getCol() { |
| | | var cols = [ |
| | | {fixed: 'left', field: 'anfme', title: '数量(必填)', align: 'center', edit:'text', width: 120, style:'color: blue;font-weight: bold'}, |
| | | {field: 'batch', title: '序列码(选填)', align: 'center', edit:'text', width: 200, style:'color: block;font-weight: bold'} |
| | | ]; |
| | | cols.push.apply(cols, matCols); |
| | | cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width: 80}) |
| | | return cols; |
| | | } |
| | | |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['admin', 'table','laydate', 'form'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | |
| | | tableIns = table.render({ |
| | | elem: '#chooseData', |
| | | data: [], |
| | | even: true, |
| | | limit: 500, |
| | | cellMinWidth: 50, |
| | | toolbar: '#toolbar', |
| | | cols: [getCol()], |
| | | done: function (res, curr, count) { |
| | | limit(); |
| | | getInBound(); |
| | | } |
| | | }); |
| | | |
| | | // 页面修改 |
| | | table.on('edit(chooseData)', function (obj) { |
| | | let index = obj.tr.attr("data-index"); |
| | | let data = matCodeData[index]; |
| | | let modify = true; |
| | | if (obj.field === 'anfme'){ |
| | | let vle = Number(obj.value); |
| | | if (isNaN(vle)) { |
| | | layer.msg("请输入数字", {icon: 2}); |
| | | modify = false; |
| | | } else { |
| | | if (vle <= 0) { |
| | | layer.msg("数量必须大于零", {icon: 2}); |
| | | modify = false; |
| | | } |
| | | } |
| | | } |
| | | if (modify) { |
| | | data[obj.field] = obj.value; |
| | | } |
| | | tableIns.reload({data: matCodeData}); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(chooseData)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | var data = checkStatus.data; |
| | | switch(obj.event) { |
| | | case 'comb': |
| | | // 判断是否存在物料 |
| | | if (matCodeData.length === 0) { |
| | | layer.msg("请先提取商品", {icon: 2}); |
| | | return; |
| | | } |
| | | // 判断物料数量是否存在异常 |
| | | for (var i=0;i<matCodeData.length;i++){ |
| | | if (isNaN(matCodeData[i].anfme)) { |
| | | layer.msg("请输入数字", {icon: 2}); |
| | | return; |
| | | } |
| | | if (matCodeData[i].anfme <= 0){ |
| | | layer.msg("数量必须大于零", {icon: 2}); |
| | | return; |
| | | } |
| | | } |
| | | let devpNo = $('#putSiteSelect').val(); |
| | | if (isEmpty(devpNo)) { |
| | | layer.msg("请选择入库站", {icon: 2}); |
| | | return; |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl+"/full/store/put/start", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | devpNo: Number(devpNo), |
| | | list: matCodeData |
| | | }), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.msg("入库启动成功,目标库位:" + res.data, {icon: 1}); |
| | | matCodeData = []; |
| | | $('#focusMatByMat').val(""); |
| | | tableIns.reload({data: matCodeData,done:function (res) { limit(); getInBound();}}); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }) |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(chooseData)', function(obj){ |
| | | switch (obj.event) { |
| | | case 'remove': |
| | | let index = obj.tr.attr("data-index"); |
| | | matCodeData.splice(index, 1); |
| | | tableIns.reload({data: matCodeData}); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 获取可用入库站点 |
| | | function getInBound() { |
| | | $.ajax({ |
| | | url: baseUrl + "/available/put/site", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | var tpl = $("#putSiteSelectTemplate").html(); |
| | | var template = Handlebars.compile(tpl); |
| | | var html = template(res); |
| | | $('#putSiteSelect').append(html); |
| | | form.render('select'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 提取物料 |
| | | $(document).on('click','#mat-query', function () { |
| | | let loadIndex = layer.msg('请求中...', {icon: 16, shade: 0.01, time: false}); |
| | | matCodeLayerIdx = admin.open({ |
| | | type: 2, |
| | | title: false, |
| | | closeBtn: false, |
| | | maxmin: false, |
| | | area: ['90%', '85%'], |
| | | shadeClose: true, |
| | | content: 'matQuery.html', |
| | | success: function(layero, index){ |
| | | layer.close(loadIndex); |
| | | } |
| | | }); |
| | | }) |
| | | |
| | | }); |
| | | |
| | | |
| | | |
| | | // 扫码 |
| | | function focusMat(el) { |
| | | if (isEmpty(el.value)) { |
| | | return |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl + "/mat/" + el.value + "/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | matCodeData = []; |
| | | var param = new Array(); |
| | | param[0] = res.data; |
| | | addTableData(param); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 添加表格数据 |
| | | function addTableData(list) { |
| | | list.map(function (d) { |
| | | d['anfme'] = initCountVal; |
| | | }) |
| | | matCodeData.push.apply(matCodeData, list); |
| | | tableIns.reload({data: matCodeData}); |
| | | layer.close(matCodeLayerIdx); |
| | | } |
New file |
| | |
| | | var initCountVal = 0; |
| | | var initAnfmeVal = "-"; |
| | | var matCodeData = []; |
| | | var currLocNo; |
| | | var matCodeLayerIdx; |
| | | function getCol() { |
| | | var cols = [ |
| | | {fixed: 'left', field: 'count', title: '实际数量', align: 'center', edit:'text', width: 120, style:'color: blue;font-weight: bold'} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'batch', align: 'center',title: '序列码', edit: true, style: 'font-weight:bold'} |
| | | ,{field: 'threeCode', align: 'center',title: '销售订单号', edit: true, style: 'font-weight:bold'} |
| | | ,{field: 'deadTime', align: 'center',title: '销售订单行号', edit: true, style: 'font-weight:bold'} |
| | | ,{field: 'suppCode', align: 'center',title: '料箱码', edit: true, style: 'font-weight:bold'} |
| | | ]; |
| | | arrRemove(detlCols, "field", "zpallet"); |
| | | arrRemove(detlCols, "field", "anfme"); |
| | | arrRemove(detlCols, "field", "batch"); |
| | | arrRemove(detlCols, "field", "threeCode"); |
| | | arrRemove(detlCols, "field", "deadTime"); |
| | | cols.push.apply(cols, detlCols); |
| | | cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:80}) |
| | | return cols; |
| | | } |
| | | |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | |
| | | tableIns = table.render({ |
| | | elem: '#chooseData', |
| | | data: [], |
| | | even: true, |
| | | limit: 500, |
| | | cellMinWidth: 50, |
| | | toolbar: '#toolbar', |
| | | cols: [getCol()], |
| | | done: function (res, curr, count) { |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | // 页面修改 |
| | | table.on('edit(chooseData)', function (obj) { |
| | | let index = obj.tr.attr("data-index"); |
| | | let data = matCodeData[index]; |
| | | let modify = true; |
| | | if (obj.field === 'count'){ |
| | | let vle = Number(obj.value); |
| | | if (isNaN(vle)) { |
| | | layer.msg("请输入数字", {icon: 2}); |
| | | modify = false; |
| | | } else { |
| | | if (vle <= 0) { |
| | | layer.msg("数量必须大于零", {icon: 2}); |
| | | modify = false; |
| | | } |
| | | } |
| | | } |
| | | if (modify) { |
| | | data[obj.field] = obj.value; |
| | | } |
| | | tableIns.reload({data: matCodeData}); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(chooseData)', function (obj) { |
| | | switch(obj.event) { |
| | | case 'adjust': |
| | | if (isEmpty(currLocNo)) { |
| | | layer.msg("请先检索库位", {icon: 2}) |
| | | inputTip($("#searchLocNo")); |
| | | return; |
| | | } |
| | | if (matCodeData.length === 0) { |
| | | layer.msg("请先添加明细", {icon: 2}); |
| | | return; |
| | | } |
| | | for (var i=0;i<matCodeData.length;i++){ |
| | | if (isNaN(matCodeData[i].count)) { |
| | | layer.msg("请输入数字", {icon: 2}); |
| | | return; |
| | | } |
| | | if (matCodeData[i].count < 0){ |
| | | layer.msg("数量不能小于零", {icon: 2}); |
| | | return; |
| | | } |
| | | } |
| | | layer.confirm('确定调整'+currLocNo+'库位的明细吗?', {shadeClose: true}, function(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/manLocDetl/adjust/start", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | locNo: currLocNo, |
| | | list: matCodeData |
| | | }), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.msg(currLocNo + res.msg, {icon: 1}); |
| | | init(currLocNo) |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(chooseData)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'remove': |
| | | let index = obj.tr.attr("data-index"); |
| | | matCodeData.splice(index, 1); |
| | | tableIns.reload({data: matCodeData}); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 检索事件 |
| | | form.on('submit(search)', function (data) { |
| | | let locNo = data.field.loc_no; |
| | | if (locNo === "") { |
| | | inputTip($("#searchLocNo")); |
| | | layer.msg("请输入库位号"); |
| | | return; |
| | | } |
| | | init(locNo); |
| | | }); |
| | | |
| | | // 重置事件 |
| | | form.on('submit(reset)', function (data) { |
| | | reset(); |
| | | }); |
| | | |
| | | function init(locNo) { |
| | | http.post(baseUrl + "/manLocDetl/list/auth", {locNo: locNo,limit: 1000}, function (res) { |
| | | matCodeData = []; |
| | | matCodeData = res.data.records; |
| | | for (var i = 0; i<matCodeData.length; i++) { |
| | | matCodeData[i]["count"] = matCodeData[i]["anfme"]; |
| | | } |
| | | locTips(true, locNo); |
| | | tableReload(); |
| | | }) |
| | | } |
| | | |
| | | function reset() { |
| | | clearFormVal($('#search-box')); |
| | | matCodeData = []; |
| | | tableReload(); |
| | | locTips(false); |
| | | } |
| | | |
| | | // 重载表格 |
| | | function tableReload() { |
| | | tableIns.reload({data: matCodeData}); |
| | | } |
| | | |
| | | // 库位提示框 |
| | | function locTips(retrieve, locNo) { |
| | | if (retrieve) { |
| | | http.post(baseUrl+"/node/select/"+locNo+"/auth", null, function (res) { |
| | | let data = res.data; |
| | | if (data != null) { |
| | | $(".retrieve").show(); |
| | | $("#locMsg").html(locNo + " ,库位状态:" + data.locSts$); |
| | | $('.not-retrieve').hide(); |
| | | currLocNo = locNo; |
| | | } else { |
| | | layer.msg("请输入有效库位号", {icon: 2}); |
| | | $('.not-retrieve').show(); |
| | | $("#locMsg").html(""); |
| | | $(".retrieve").hide(); |
| | | currLocNo = null; |
| | | inputTip($("#searchLocNo")); |
| | | } |
| | | }) |
| | | } else { |
| | | $('.not-retrieve').show(); |
| | | $("#locMsg").html(""); |
| | | $(".retrieve").hide(); |
| | | currLocNo = null; |
| | | } |
| | | } |
| | | |
| | | $(document).on('click','#mat-query', function () { |
| | | if (isEmpty(currLocNo)) { |
| | | layer.msg("请先检索库位") |
| | | inputTip($("#searchLocNo")); |
| | | return; |
| | | } |
| | | let loadIndex = layer.msg('请求中...', {icon: 16, shade: 0.01, time: false}); |
| | | matCodeLayerIdx = admin.open({ |
| | | type: 2, |
| | | title: false, |
| | | closeBtn: false, |
| | | maxmin: false, |
| | | area: ['90%', '85%'], |
| | | shadeClose: true, |
| | | content: 'matQuery.html', |
| | | success: function(layero, index){ |
| | | layer.close(loadIndex); |
| | | } |
| | | }); |
| | | }) |
| | | |
| | | }) |
| | | |
| | | // 搜索框空值提示 |
| | | function inputTip(el) { |
| | | el.css("border-color", "red"); |
| | | setTimeout(function () { |
| | | el.css("border-color", "#b8b8b8"); |
| | | }, 1000); |
| | | } |
| | | |
| | | // 添加表格数据 |
| | | function addTableData(data) { |
| | | for (let i=0;i<data.length;i++){ |
| | | for (let j=0;j<matCodeData.length;j++){ |
| | | if (data[i].matnr === matCodeData[j].matnr && data[i].batch === matCodeData[j].batch) { |
| | | data.splice(i, 1); |
| | | break; |
| | | } else { |
| | | data[i]['anfme'] = initAnfmeVal; |
| | | data[i]['count'] = initCountVal; |
| | | } |
| | | } |
| | | } |
| | | matCodeData.push.apply(matCodeData, data); |
| | | tableIns.reload({data: matCodeData}); |
| | | layer.close(matCodeLayerIdx); |
| | | } |
New file |
| | |
| | | var locDetlLayerIdx; |
| | | var locDetlData = []; |
| | | function getCol() { |
| | | var cols = [ |
| | | {field: 'count', align: 'center',title: '出库数量', edit:'text', width: 130, style:'color: blue;font-weight: bold'} |
| | | ,{field: 'anfme', align: 'center',title: '库存数量'} |
| | | ,{field: 'locNo$', align: 'center',title: '库位号'} |
| | | ]; |
| | | arrRemove(detlCols, 'field', 'anfme'); |
| | | cols.push.apply(cols, detlCols); |
| | | cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width: 80}) |
| | | return cols; |
| | | } |
| | | |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | |
| | | tableIns = table.render({ |
| | | elem: '#chooseData', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | data: [], |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | limit: 500, |
| | | cols: [getCol()], |
| | | done: function(res, curr, count) { |
| | | limit(); |
| | | getOutBound(); |
| | | } |
| | | }); |
| | | |
| | | // 页面修改 |
| | | table.on('edit(chooseData)', function (obj) { |
| | | let index = obj.tr.attr("data-index"); |
| | | let data = locDetlData[index]; |
| | | let modify = true; |
| | | if (obj.field === 'count'){ |
| | | let vle = Number(obj.value); |
| | | if (isNaN(vle)) { |
| | | layer.msg("请输入数字", {icon: 2}); |
| | | modify = false; |
| | | } else { |
| | | if (vle <= 0) { |
| | | layer.msg("数量必须大于零", {icon: 2}); |
| | | modify = false; |
| | | } |
| | | if (vle > Number(data.anfme)) { |
| | | layer.msg("出库数量不得大于库存数量", {icon: 2}); |
| | | modify = false; |
| | | } |
| | | } |
| | | } |
| | | if (modify) { |
| | | data[obj.field] = obj.value; |
| | | } |
| | | tableIns.reload({data: locDetlData}); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(chooseData)', function (obj) { |
| | | switch (obj.event) { |
| | | case 'outbound': |
| | | if (locDetlData.length === 0){ |
| | | layer.msg('请先提取商品库存', {icon: 2}); |
| | | } else { |
| | | var staNo = $("#staNoSelect").val(); |
| | | if (staNo === "" || staNo === null){ |
| | | layer.msg("请选择出库口", {icon: 2}); |
| | | return; |
| | | } |
| | | let param = { |
| | | outSite: staNo, |
| | | locDetls: locDetlData |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl+"/plate/out/start", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | locDetlData = []; |
| | | tableIns.reload({data: locDetlData,done:function (res) {limit();getOutBound();}}); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(chooseData)', function(obj){ |
| | | switch (obj.event) { |
| | | case 'remove': |
| | | let index = obj.tr.attr("data-index"); |
| | | locDetlData.splice(index, 1); |
| | | tableIns.reload({data: locDetlData}); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 获取出库口 |
| | | function getOutBound(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/available/take/site", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | var tpl = $("#takeSiteSelectTemplate").html(); |
| | | var template = Handlebars.compile(tpl); |
| | | var html = template(res); |
| | | $('#staNoSelect').append(html); |
| | | form.render('select'); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | $(document).on('click','#mat-query', function () { |
| | | let loadIndex = layer.msg('请求中...', {icon: 16, shade: 0.01, time: false}); |
| | | locDetlLayerIdx = layer.open({ |
| | | type: 2, |
| | | title: false, |
| | | closeBtn: false, |
| | | maxmin: false, |
| | | area: ['90%', '85%'], |
| | | shadeClose: true, |
| | | content: 'locDetlQuery.html', |
| | | success: function(layero, index){ |
| | | layer.close(loadIndex); |
| | | } |
| | | }); |
| | | }) |
| | | |
| | | }) |
| | | |
| | | // 添加表格数据 |
| | | function addTableData(data) { |
| | | for (var i=0;i<data.length;i++){ |
| | | let pass = false; |
| | | for (var j=0;j<locDetlData.length;j++){ |
| | | if (data[i].matnr === locDetlData[j].matnr && data[i].batch === locDetlData[j].batch && data[i].locNo$ === locDetlData[j].locNo$) { |
| | | pass = true; |
| | | break; |
| | | } |
| | | } |
| | | if (pass) { |
| | | data.splice(i--, 1); |
| | | } else { |
| | | data[i]["count"] = data[i]["anfme"]; |
| | | } |
| | | } |
| | | locDetlData.push.apply(locDetlData, data); |
| | | tableIns.reload({data: locDetlData}); |
| | | layer.close(locDetlLayerIdx); |
| | | } |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | </head> |
| | | <body> |
| | | |
| | | <div class="layui-fluid"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar" id="search-box"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="id" placeholder="编号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input layui-laydate-range" name="create_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline">  |
| | | <button class="layui-btn icon-btn" lay-filter="search" lay-submit> |
| | | <i class="layui-icon"></i>搜索 |
| | | </button> |
| | | <button class="layui-btn icon-btn" lay-filter="reset" lay-submit> |
| | | <i class="layui-icon"></i>重置 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <table class="layui-hide" id="locRule" lay-filter="locRule"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right">导出</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">删除</a> |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/locRule/locRule.js" charset="utf-8"></script> |
| | | </body> |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="editDialog"> |
| | | <form id="detail" lay-filter="detail" class="layui-form admin-form model-form"> |
| | | <input name="id" type="hidden"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md6"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">商品编号: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="matnr" placeholder="请输入商品编号"> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">规格: </label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input class="layui-input" name="specs" placeholder="请输入规格">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">型号: </label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input class="layui-input" name="model" placeholder="请输入型号">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">客户: </label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input class="layui-input" name="cstmr" placeholder="请输入客户">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">批号: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="batch" placeholder="请输入批号"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">库区: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="batch" placeholder="请输入库区"> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">其他: </label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input class="layui-input" name="other" placeholder="请输入其他">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">上限: </label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input class="layui-input" name="limit" placeholder="请输入上限">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">混载: </label> |
| | | <div class="layui-input-block"> |
| | | <select name="mixed"> |
| | | <option value="1" selected>是</option> |
| | | <option value="0">否</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-form-item"> |
| | | <label class="layui-form-label">混载未找到库位继续搜索: </label> |
| | | <div class="layui-input-block"> |
| | | <select name="keepGo"> |
| | | <option value="1">是</option> |
| | | <option value="0" selected>否</option> |
| | | </select> |
| | | </div> |
| | | </div>--> |
| | | |
| | | </div> |
| | | |
| | | <div class="layui-col-md6"> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <label class="layui-form-label">排范围</label>--> |
| | | <!-- <div class="layui-input-inline" style="width: 100px;">--> |
| | | <!-- <input type="text" name="price_min" placeholder="¥" autocomplete="off" class="layui-input">--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-form-mid">-</div>--> |
| | | <!-- <div class="layui-input-inline" style="width: 100px;">--> |
| | | <!-- <input type="text" name="price_max" placeholder="¥" autocomplete="off" class="layui-input">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">开始排: </label> |
| | | <div class="layui-input-block"> |
| | | <input type="number" min="1" class="layui-input" name="rowBeg" placeholder="请输入开始排" lay-vertype="tips" lay-verify="required" required=""> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">结束排: </label> |
| | | <div class="layui-input-block"> |
| | | <input type="number" min="1" class="layui-input" name="rowEnd" placeholder="请输入结束排" lay-vertype="tips" lay-verify="required" required=""> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">开始列: </label> |
| | | <div class="layui-input-block"> |
| | | <input type="number" min="1" class="layui-input" name="bayBeg" placeholder="请输入开始列" lay-vertype="tips" lay-verify="required" required=""> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">结束列: </label> |
| | | <div class="layui-input-block"> |
| | | <input type="number" min="1" class="layui-input" name="bayEnd" placeholder="请输入结束列" lay-vertype="tips" lay-verify="required" required=""> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">开始层: </label> |
| | | <div class="layui-input-block"> |
| | | <input type="number" min="1" class="layui-input" name="levBeg" placeholder="请输入开始层" lay-vertype="tips" lay-verify="required" required=""> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">结束层: </label> |
| | | <div class="layui-input-block"> |
| | | <input type="number" min="1" class="layui-input" name="levEnd" placeholder="请输入结束层" lay-vertype="tips" lay-verify="required" required=""> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <hr class="layui-bg-gray"> |
| | | <div class="layui-form-item text-right"> |
| | | <button class="layui-btn" lay-filter="editSubmit" lay-submit="">保存</button> |
| | | <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button> |
| | | </div> |
| | | </form> |
| | | </script> |
| | | </html> |
| | | |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/common.css" media="all"> |
| | | <style> |
| | | body { |
| | | /*overflow: hidden;*/ |
| | | } |
| | | .layui-table-box { |
| | | border-right: 1px solid #9F9F9F; |
| | | border-left: 1px solid #9F9F9F; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <div style="padding: 25px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;"> |
| | | <span style="font-size: large; font-weight: bold">选择商品</span> |
| | | </div> |
| | | <div class="layui-card" style="padding: 0 20px; overflow: scroll;"> |
| | | <fieldset class="layui-elem-field site-demo-button" style="margin: 20px;"> |
| | | <legend>搜索栏</legend> |
| | | <div id="search-box" class="layui-form layui-card-header"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="matnr" placeholder="物料号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="maktx" placeholder="物料号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- 日期范围 --> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input layui-laydate-range" name="modi_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- 待添加 --> |
| | | <div id="data-search-btn" class="layui-btn-container layui-form-item" style="display: inline-block"> |
| | | <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索</button> |
| | | </div> |
| | | </div> |
| | | </fieldset> |
| | | |
| | | <div class="layui-form"> |
| | | <table class="layui-hide" id="mat" lay-filter="mat"></table> |
| | | </div> |
| | | </div> |
| | | |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn" id="btn-confirm" lay-event="confirm" style="">提取</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | |
| | | </body> |
| | | <script> |
| | | function getCol() { |
| | | let cols = [ |
| | | {type: 'checkbox', fixed: 'left'} |
| | | ]; |
| | | cols.push.apply(cols, matCols); |
| | | cols.push( |
| | | {field: 'modiUser$', align: 'center',title: '修改人员', hide: true}, |
| | | {field: 'modiTime$', align: 'center',title: '修改时间'} |
| | | ) |
| | | return cols; |
| | | } |
| | | |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | |
| | | // 物料查询数据表 |
| | | matQueryTable = table.render({ |
| | | elem: '#mat', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl + '/mat/list/auth', |
| | | page: true, |
| | | limit: 7, |
| | | limits: [7, 10, 30,50,100], |
| | | even: true, |
| | | cellMinWidth: 50, |
| | | toolbar: '#toolbar', |
| | | cols: [getCol()], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(mat)', function (obj) { |
| | | let checkStatus = table.checkStatus(obj.config.id); |
| | | let data = checkStatus.data; |
| | | switch(obj.event) { |
| | | case 'confirm': |
| | | if (data.length === 0){ |
| | | layer.msg("请选择数据", {icon: 2}); |
| | | return; |
| | | } |
| | | parent.addTableData(data); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 搜索栏搜索事件 |
| | | form.on('submit(search)', function (data) { |
| | | tableReload(); |
| | | }); |
| | | |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | }); |
| | | }) |
| | | |
| | | function tableReload() { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | matQueryTable.reload({ |
| | | where: searchData |
| | | }); |
| | | } |
| | | |
| | | </script> |
| | | </html> |
| | | |
| | |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | <script type="text/javascript" src="../../static/js/agvPakStore/stockAdjust.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/saasPakStore/stockAdjust.js" charset="utf-8"></script> |
| | | |
| | | </body> |
| | | </html> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | </head> |
| | | <body> |
| | | |
| | | <div class="layui-fluid"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar" id="search-box"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="id" placeholder="编号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input layui-laydate-range" name="create_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline">  |
| | | <button class="layui-btn icon-btn" lay-filter="search" lay-submit> |
| | | <i class="layui-icon"></i>搜索 |
| | | </button> |
| | | <button class="layui-btn icon-btn" lay-filter="reset" lay-submit> |
| | | <i class="layui-icon"></i>重置 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <table class="layui-hide" id="locRule" lay-filter="locRule"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right">导出</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">删除</a> |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/saasLocRule/locRule.js" charset="utf-8"></script> |
| | | </body> |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="editDialog"> |
| | | <form id="detail" lay-filter="detail" class="layui-form admin-form model-form"> |
| | | <input name="id" type="hidden"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md6"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">商品编号: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="matnr" placeholder="请输入商品编号"> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">规格: </label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input class="layui-input" name="specs" placeholder="请输入规格">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">型号: </label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input class="layui-input" name="model" placeholder="请输入型号">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">客户: </label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input class="layui-input" name="cstmr" placeholder="请输入客户">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">批号: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="batch" placeholder="请输入批号"> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">其他: </label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input class="layui-input" name="other" placeholder="请输入其他">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">上限: </label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input class="layui-input" name="limit" placeholder="请输入上限">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">混载: </label> |
| | | <div class="layui-input-block"> |
| | | <select name="mixed"> |
| | | <option value="1" selected>是</option> |
| | | <option value="0">否</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-form-item"> |
| | | <label class="layui-form-label">混载未找到库位继续搜索: </label> |
| | | <div class="layui-input-block"> |
| | | <select name="keepGo"> |
| | | <option value="1">是</option> |
| | | <option value="0" selected>否</option> |
| | | </select> |
| | | </div> |
| | | </div>--> |
| | | |
| | | </div> |
| | | |
| | | <div class="layui-col-md6"> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <label class="layui-form-label">排范围</label>--> |
| | | <!-- <div class="layui-input-inline" style="width: 100px;">--> |
| | | <!-- <input type="text" name="price_min" placeholder="¥" autocomplete="off" class="layui-input">--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-form-mid">-</div>--> |
| | | <!-- <div class="layui-input-inline" style="width: 100px;">--> |
| | | <!-- <input type="text" name="price_max" placeholder="¥" autocomplete="off" class="layui-input">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">开始排: </label> |
| | | <div class="layui-input-block"> |
| | | <input type="number" min="1" class="layui-input" name="rowBeg" placeholder="请输入开始排" lay-vertype="tips" lay-verify="required" required=""> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">结束排: </label> |
| | | <div class="layui-input-block"> |
| | | <input type="number" min="1" class="layui-input" name="rowEnd" placeholder="请输入结束排" lay-vertype="tips" lay-verify="required" required=""> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">开始列: </label> |
| | | <div class="layui-input-block"> |
| | | <input type="number" min="1" class="layui-input" name="bayBeg" placeholder="请输入开始列" lay-vertype="tips" lay-verify="required" required=""> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">结束列: </label> |
| | | <div class="layui-input-block"> |
| | | <input type="number" min="1" class="layui-input" name="bayEnd" placeholder="请输入结束列" lay-vertype="tips" lay-verify="required" required=""> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">开始层: </label> |
| | | <div class="layui-input-block"> |
| | | <input type="number" min="1" class="layui-input" name="levBeg" placeholder="请输入开始层" lay-vertype="tips" lay-verify="required" required=""> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">结束层: </label> |
| | | <div class="layui-input-block"> |
| | | <input type="number" min="1" class="layui-input" name="levEnd" placeholder="请输入结束层" lay-vertype="tips" lay-verify="required" required=""> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <hr class="layui-bg-gray"> |
| | | <div class="layui-form-item text-right"> |
| | | <button class="layui-btn" lay-filter="editSubmit" lay-submit="">保存</button> |
| | | <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button> |
| | | </div> |
| | | </form> |
| | | </script> |
| | | </html> |
| | | |