| | |
| | | Object nodeId = param.get("node_id"); |
| | | if (Cools.isEmpty(nodeId)) { |
| | | nodeId = getOriginNode().getId(); |
| | | param.put("node_id", String.valueOf(nodeId)); |
| | | } |
| | | return R.ok(locDetlService.getPage(new Page<>(curr, limit) |
| | | , String.valueOf(nodeId) |
| | | , param.get("loc_no") |
| | | , param.get("matnr") |
| | | , param.get("maktx")) |
| | | ); |
| | | if (!Cools.isEmpty(param.get("update_time"))){ |
| | | String val = String.valueOf(param.get("update_time")); |
| | | if (val.contains(RANGE_TIME_LINK)) { |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | param.put("startTime", DateUtils.convert(dates[0])); |
| | | param.put("endTime", DateUtils.convert(dates[1])); |
| | | param.remove("update_time"); |
| | | } |
| | | } |
| | | return R.ok(locDetlService.getPage(toPage(curr, limit, param, LocDetl.class))); |
| | | } |
| | | |
| | | // @RequestMapping(value = "/stock/out/list/auth") |
| | | // @ManagerAuth |
| | | // public R stockOutList(@RequestParam(defaultValue = "1")Integer curr, |
| | | // @RequestParam(defaultValue = "10")Integer limit, |
| | | // @RequestParam Map<String, Object> param){ |
| | | // if (!Cools.isEmpty(param.get("update_time"))){ |
| | | // String val = String.valueOf(param.get("update_time")); |
| | | // if (val.contains(RANGE_TIME_LINK)) { |
| | | // String[] dates = val.split(RANGE_TIME_LINK); |
| | | // param.put("startTime", DateUtils.convert(dates[0])); |
| | | // param.put("endTime", DateUtils.convert(dates[1])); |
| | | // param.remove("modi_time"); |
| | | // } |
| | | // } |
| | | // return R.ok(locDetlService.getStockOut(toPage(curr, limit, param, LocDetl.class))); |
| | | // } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | |
| | | package zy.cloud.wms.manager.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | import zy.cloud.wms.manager.entity.LocDetl; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface LocDetlMapper extends BaseMapper<LocDetl> { |
| | | |
| | | List<LocDetl> listByPage(Page page, @Param("nodeId") String nodeId, @Param("locNo") Object locNo, @Param("matnr") Object matnr, @Param("maktx") Object maktx); |
| | | List<LocDetl> listByPage(Map<String, Object> map); |
| | | |
| | | Integer listByPageCount(Map<String, Object> map); |
| | | |
| | | LocDetl selectByLocNoAndMatnr(@Param("nodeId")Long nodeId, @Param("matnr")String martnr); |
| | | |
| | |
| | | |
| | | public interface LocDetlService extends IService<LocDetl> { |
| | | |
| | | Page<LocDetl> getPage(Page page, String nodeId, Object locNo, Object matnr, Object maktx); |
| | | Page<LocDetl> getPage(Page<LocDetl> page); |
| | | |
| | | LocDetl getLocDetl(Long nodeId, String matnr); |
| | | |
| | |
| | | private MatService matService; |
| | | |
| | | @Override |
| | | public Page<LocDetl> getPage(Page page, String nodeId, Object locNo, Object matnr, Object maktx) { |
| | | return page.setRecords(baseMapper.listByPage(page, nodeId, locNo, matnr, maktx)); |
| | | public Page<LocDetl> getPage(Page<LocDetl> page) { |
| | | page.setRecords(baseMapper.listByPage(page.getCondition())); |
| | | page.setTotal(baseMapper.listByPageCount(page.getCondition())); |
| | | return page; |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | </resultMap> |
| | | |
| | | <select id="listByPage" resultMap="BaseResultMap"> |
| | | SELECT |
| | | mld.* |
| | | FROM man_loc_detl mld |
| | | LEFT JOIN man_node mn ON mld.node_id = mn.id |
| | | WHERE 1=1 |
| | | AND (CHARINDEX(#{nodeId}, ','+mn.path+',') > 0 OR mn.id = #{nodeId}) |
| | | <if test="locNo != null and locNo != ''"> |
| | | and mld.loc_no like concat('%',#{locNo},'%') |
| | | <sql id="locDetlCondition"> |
| | | <if test="loc_no != null and loc_no != ''"> |
| | | and mld.loc_no like concat('%',#{loc_no},'%') |
| | | </if> |
| | | <if test="matnr != null and matnr != ''"> |
| | | and mld.matnr like concat('%',#{matnr},'%') |
| | |
| | | <if test="maktx != null and maktx != ''"> |
| | | and mld.maktx like concat('%',#{maktx},'%') |
| | | </if> |
| | | ORDER BY mld.create_time DESC |
| | | <if test="startTime!=null and endTime!=null"> |
| | | and mld.update_time between #{startTime} and #{endTime} |
| | | </if> |
| | | </sql> |
| | | |
| | | <select id="listByPage" resultMap="BaseResultMap"> |
| | | select * from |
| | | ( |
| | | SELECT |
| | | ROW_NUMBER() over (order by mld.create_time desc) as row, |
| | | mld.* |
| | | FROM man_loc_detl mld |
| | | LEFT JOIN man_node mn ON mld.node_id = mn.id |
| | | WHERE 1=1 |
| | | AND (CHARINDEX(#{node_id}, ','+mn.path+',') > 0 OR mn.id = #{node_id}) |
| | | <include refid="locDetlCondition"></include> |
| | | ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | </select> |
| | | |
| | | <select id="listByPageCount" parameterType="java.util.Map" resultType="java.lang.Integer"> |
| | | select |
| | | count(1) |
| | | FROM man_loc_detl mld |
| | | LEFT JOIN man_node mn ON mld.node_id = mn.id |
| | | WHERE 1=1 |
| | | AND (CHARINDEX(#{node_id}, ','+mn.path+',') > 0 OR mn.id = #{node_id}) |
| | | <include refid="locDetlCondition"></include> |
| | | </select> |
| | | |
| | | <select id="selectByLocNoAndMatnr" resultMap="BaseResultMap"> |
| | |
| | | var detlCols = [ |
| | | {field: 'matnr', align: 'center',title: '商品编号'} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称'} |
| | | ,{field: 'name', align: 'center',title: '名称'} |
| | | ,{field: 'specs', align: 'center',title: '规格'} |
| | | ,{field: 'anfme', align: 'center',title: '库存数量'} |
| | | ,{field: 'name', align: 'center',title: '名称', hide: true} |
| | | ,{field: 'specs', align: 'center',title: '规格', hide: true} |
| | | ,{field: 'model', align: 'center',title: '型号', hide: true} |
| | | ,{field: 'batch', align: 'center',title: '批号', hide: true} |
| | | ,{field: 'unit', align: 'center',title: '单位'} |
| | |
| | | ,{field: 'docNum', align: 'center',title: '单据编号', hide: true} |
| | | ,{field: 'custName', align: 'center',title: '客户名称', hide: true} |
| | | ,{field: 'itemNum', align: 'center',title: '品项数', hide: true} |
| | | ,{field: 'count', align: 'center',title: '数量'} |
| | | ,{field: 'count', align: 'center',title: '数量', hide: true} |
| | | ,{field: 'weight', align: 'center',title: '重量', hide: true} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码'} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘码'} |
| | | ] |
| | |
| | | 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: '库位号'} |
| | | {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}) |
| | | cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:80}) |
| | | return cols; |
| | | } |
| | | |
| | |
| | | cols: [getCol()], |
| | | done: function(res, curr, count) { |
| | | limit(); |
| | | getOutBound(); |
| | | // getOutBound(); |
| | | } |
| | | }); |
| | | |
| | |
| | | if (data.length === 0){ |
| | | layer.msg('请先添加库位物料'); |
| | | } else { |
| | | var staNo = $("#staNoSelect").val(); |
| | | if (staNo === "" || staNo === null){ |
| | | layer.msg("请选择出库口"); |
| | | return; |
| | | } |
| | | // var staNo = $("#staNoSelect").val(); |
| | | // if (staNo === "" || staNo === null){ |
| | | // layer.msg("请选择出库口"); |
| | | // return; |
| | | // } |
| | | var locDetls = []; |
| | | data.forEach(function(elem) { |
| | | locDetls.push({locNo: elem.locNo, matnr: elem.matnr, count: elem.count}); |
| | |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | locDetlData = []; |
| | | tableIns.reload({data: locDetlData,done:function (res) {limit();getOutBound();}}); |
| | | tableIns.reload({data: locDetlData,done:function (res) { |
| | | limit(); |
| | | // getOutBound(); |
| | | }}); |
| | | layer.msg(res.msg); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | |
| | | locDetlData.splice(i, 1); |
| | | } |
| | | } |
| | | tableIns.reload({data: locDetlData,done:function (res) {limit();getOutBound();}}); |
| | | tableIns.reload({data: locDetlData,done:function (res) { |
| | | limit(); |
| | | // getOutBound(); |
| | | }}); |
| | | break; |
| | | } |
| | | }); |
| | |
| | | layer.msg("数量必须大于零"); |
| | | } |
| | | } |
| | | tableIns.reload({data: locDetlData,done:function (res) {limit(); getOutBound();}}); |
| | | tableIns.reload({data: locDetlData,done:function (res) { |
| | | limit(); |
| | | // getOutBound(); |
| | | }}); |
| | | } |
| | | |
| | | // 获取出库口 |
| | |
| | | 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].locNo$ === locDetlData[j].locNo$) { |
| | | if (data[i].matnr === locDetlData[j].matnr && data[i].locNo === locDetlData[j].locNo) { |
| | | pass = true; |
| | | break; |
| | | } |
| | |
| | | <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="loc_no" placeholder="库位号" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="loc_no" placeholder="货位" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="matnr" placeholder="物料号" autocomplete="off"> |
| | | <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"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="type" placeholder="物料类别" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="lgnum" placeholder="规格" autocomplete="off"> |
| | | <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"> |
| | | <input class="layui-input layui-laydate-range" name="update_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |
| | | </div> |
| | | </div> |
| | | <!-- 待添加 --> |
| | |
| | | function getCol() { |
| | | var cols = [ |
| | | {type: 'checkbox'} |
| | | ,{field: 'locNo$', align: 'center',title: '库位号'} |
| | | ,{field: 'locNo', align: 'center',title: '货位'} |
| | | ]; |
| | | cols.push.apply(cols, detlCols); |
| | | cols.push({field: 'modiUser$', align: 'center',title: '修改人员', hide: true} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间'}) |
| | | cols.push({field: 'updateBy$', align: 'center',title: '修改人员', hide: true} |
| | | ,{field: 'updateTime$', align: 'center',title: '修改时间'}) |
| | | return cols; |
| | | } |
| | | |
| | |
| | | locDetlTableIns = table.render({ |
| | | elem: '#stockOut', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/stock/out/list/auth', |
| | | url: baseUrl+'/locDetl/list/auth', |
| | | page: true, |
| | | limit: 10, |
| | | even: true, |
| | |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | $('.layui-form-checkbox').css("pointer-events", "none"); |
| | | $('td[data-field="0').css("cursor", "pointer") |
| | | // $('.layui-form-checkbox').css("pointer-events", "none"); |
| | | // $('td[data-field="0').css("cursor", "pointer") |
| | | } |
| | | }); |
| | | |
| | |
| | | }); |
| | | }) |
| | | |
| | | var b = true; |
| | | $(function(){ |
| | | $(document.body).on('click','td[data-field="0"]',function(){ |
| | | var locNo = $(this).next().children("div").html(); |
| | | if (b) { |
| | | b = false; |
| | | $("tr td[data-field=locNo\\$] div:contains("+ locNo +")").parent().prev().children().children("div").click(); |
| | | setTimeout(function () { |
| | | b = true; |
| | | }, 200) |
| | | } |
| | | }); |
| | | }) |
| | | // var b = true; |
| | | // $(function(){ |
| | | // $(document.body).on('click','td[data-field="0"]',function(){ |
| | | // var locNo = $(this).next().children("div").html(); |
| | | // if (b) { |
| | | // b = false; |
| | | // $("tr td[data-field=locNo\\$] div:contains("+ locNo +")").parent().prev().children().children("div").click(); |
| | | // setTimeout(function () { |
| | | // b = true; |
| | | // }, 200) |
| | | // } |
| | | // }); |
| | | // }) |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | |
| | | } |
| | | |
| | | #btn-outbound { |
| | | margin-left: 60px; |
| | | margin-left: 20px; |
| | | display: none; |
| | | } |
| | | |
| | |
| | | <div class="layui-form"> |
| | | <div class="layui-btn-container"> |
| | | <!-- 1.选择出库口 --> |
| | | <span id="staNoSpan">出库口:</span> |
| | | <select id="staNoSelect" lay-verify="required"> |
| | | <option value="">请选择站点</option> |
| | | </select> |
| | | <!-- <span id="staNoSpan">出库口:</span>--> |
| | | <!-- <select id="staNoSelect" lay-verify="required">--> |
| | | <!-- <option value="">请选择站点</option>--> |
| | | <!-- </select>--> |
| | | <!-- 2.启动出库 --> |
| | | <button class="layui-btn layui-btn-lg" id="btn-outbound" lay-event="outbound">启动出库</button> |
| | | </div> |
| | |
| | | <!-- 表格工具栏2 --> |
| | | <div id="search-box" class="layui-form toolbar" style="padding-top: 5px"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="padding: 8px 15px 8px 15px">货位编号:</label> |
| | | <label class="layui-form-label" style="padding: 8px 15px 8px 15px">货位:</label> |
| | | <div class="layui-input-inline"> |
| | | <input name="loc_no" class="layui-input" placeholder="输入货位编号"/> |
| | | <input name="loc_no" class="layui-input" placeholder="输入货位"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |