| | |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.result.LocDetlAll; |
| | | import com.zy.asrs.entity.result.LocDetlDTO; |
| | | import com.zy.asrs.mapper.LocDetlMapper; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.LocOwnerService; |
| | |
| | | private LocDetlMapper locDetlMapper; |
| | | @Autowired |
| | | private MatService matService; |
| | | @Autowired |
| | | private ManLocDetlService manLocDetlService; |
| | | |
| | | @RequestMapping(value = "/locDetl/update") |
| | | public R update1() { |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | if (param.get("owner$") != null && param.get("owner$") != ""){ |
| | | LocOwner locOwner = locOwnerService.selectOne(new EntityWrapper<LocOwner>().eq("owner", param.get("owner$"))); |
| | | param.remove("owner$"); |
| | | param.put("owner",locOwner.getId()); |
| | | LocOwner locOwner = locOwnerService.selectOne(new EntityWrapper<LocOwner>().eq("owner", param.get("owner$"))); |
| | | if(locOwner == null){ |
| | | return R.error("参数有误!"); |
| | | } |
| | | param.remove("owner$"); |
| | | param.put("owner",locOwner.getId()); |
| | | } |
| | | |
| | | LocDetlDTO locDetlDTO = new LocDetlDTO(); |
| | | locDetlDTO.setPageSize(limit); |
| | | locDetlDTO.setPageNumber(curr); |
| | | String locNo = String.valueOf(param.get("locNo")); |
| | | String owner = String.valueOf(param.get("owner")); |
| | | String matnr = String.valueOf(param.get("matnr")); |
| | | if (!Cools.isEmpty(locNo) && !locNo.equals("null")) { |
| | | locDetlDTO.setLocNo(locNo); |
| | | } |
| | | if (!Cools.isEmpty(matnr) && !matnr.equals("null")) { |
| | | locDetlDTO.setMatnr(matnr); |
| | | } |
| | | if (!Cools.isEmpty(owner) && !owner.equals("null")) { |
| | | locDetlDTO.setOwner(owner); |
| | | } |
| | | List<LocDetlAll> list = locDetlService.selectAllPyment(locDetlDTO); |
| | | int count = locDetlService.selectAllPymentcount(locDetlDTO); |
| | | Page<LocDetlAll> page = new Page<>(); |
| | | page.setRecords(list); |
| | | page.setTotal(count); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | EntityWrapper<LocDetl> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("payment",0); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(locDetlService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | @RequestMapping(value = "/locDetl/selectOwner/list/auth") |
| | | @ManagerAuth |
| | | public R selectOwnerlist(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | if (param.get("owner$") != null && param.get("owner$") != ""){ |
| | | LocOwner locOwner = locOwnerService.selectOne(new EntityWrapper<LocOwner>().eq("owner", param.get("owner$"))); |
| | | if(locOwner == null){ |
| | | return R.error("参数有误!"); |
| | | } |
| | | param.remove("owner$"); |
| | | param.put("owner",locOwner.getId()); |
| | | } |
| | | |
| | | LocDetlDTO locDetlDTO = new LocDetlDTO(); |
| | | locDetlDTO.setPageSize(limit); |
| | | locDetlDTO.setPageNumber(curr); |
| | | String locNo = String.valueOf(param.get("locNo")); |
| | | String owner = String.valueOf(param.get("owner")); |
| | | String matnr = String.valueOf(param.get("matnr")); |
| | | if (!Cools.isEmpty(locNo) && !locNo.equals("null")) { |
| | | locDetlDTO.setLocNo(locNo); |
| | | } |
| | | if (!Cools.isEmpty(matnr) && !matnr.equals("null")) { |
| | | locDetlDTO.setMatnr(matnr); |
| | | } |
| | | if (!Cools.isEmpty(owner) && !owner.equals("null")) { |
| | | locDetlDTO.setOwner(owner); |
| | | } |
| | | List<LocDetlAll> list = locDetlService.selectAllOwner(locDetlDTO); |
| | | int count = locDetlService.selectAllCount(locDetlDTO); |
| | | Page<LocDetlAll> page = new Page<>(); |
| | | page.setRecords(list); |
| | | page.setTotal(count); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | |
| | |
| | | @TableField("real_anfme") |
| | | private Date realAnfme; |
| | | |
| | | @ApiModelProperty(value= "订单号") |
| | | @TableField("order_no") |
| | | private String orderNo; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | public static class LocDetl { |
| | | |
| | | // 库位号 |
| | | private String locNo; |
| | | private String loc_no; |
| | | |
| | | // 商品编号 |
| | | private String matnr; |
| | |
| | | private Double count; |
| | | |
| | | // 订单 |
| | | private String orderNo; |
| | | private String order_no; |
| | | |
| | | // 翻包 |
| | | private String memo; |
New file |
| | |
| | | package com.zy.asrs.entity.result; |
| | | |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.LocOwner; |
| | | import com.zy.asrs.service.LocOwnerService; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class LocDetlAll { |
| | | private String loc_no; |
| | | private String zpallet; |
| | | private String matnr; |
| | | private String maktx; |
| | | private String specs; |
| | | private Double anfme; |
| | | private String batch; |
| | | private Double weight; |
| | | |
| | | private String order_no; |
| | | private Integer owner; |
| | | private Integer payment; |
| | | private Date modi_time; |
| | | private Date appe_time; |
| | | private String meno; |
| | | private String manu; |
| | | |
| | | public String getOwner$(){ |
| | | LocOwnerService service = SpringUtils.getBean(LocOwnerService.class); |
| | | LocOwner locOwner = service.selectById(this.owner); |
| | | if (!Cools.isEmpty(locOwner)){ |
| | | return String.valueOf(locOwner.getOwner()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getPayment$(){ |
| | | if (null == this.payment){ return null; } |
| | | switch (this.payment){ |
| | | case 1: |
| | | return "仓储"; |
| | | case 0: |
| | | return "代采"; |
| | | default: |
| | | return String.valueOf(this.payment); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.asrs.entity.result; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class LocDetlDTO { |
| | | |
| | | private int pageNumber; |
| | | private int pageSize; |
| | | private Integer row; |
| | | private String locNo; |
| | | private String matnr; |
| | | private String owner; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.result.LocDetlAll; |
| | | import com.zy.asrs.entity.result.LocDetlDTO; |
| | | import com.zy.asrs.entity.result.StockVo; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | List<LocDetl> searchByLike(String orderNo, String matnr, String maktx, String specs, String locNo); |
| | | |
| | | List<LocDetl> queryStock2(String matnr, String batch, int owner); |
| | | |
| | | List<LocDetlAll> selectAllOwner(LocDetlDTO locDetlDTO); |
| | | |
| | | int selectAllCount(LocDetlDTO locDetlDTO); |
| | | |
| | | List<LocDetlAll> selectAllPyment(LocDetlDTO locDetlDTO); |
| | | |
| | | int selectAllPymentcount(LocDetlDTO locDetlDTO); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.result.LocDetlAll; |
| | | import com.zy.asrs.entity.result.LocDetlDTO; |
| | | import com.zy.asrs.entity.result.StockVo; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | //通过订单号、物料号、物料名称、规格、库位号进行模糊搜索 |
| | | List<LocDetl> searchByLike(String orderNo, String matnr, String maktx, String specs, String locNo); |
| | | |
| | | List<LocDetlAll> selectAllOwner(LocDetlDTO locDetlDTO); |
| | | List<LocDetlAll> selectAllPyment(LocDetlDTO locDetlDTO); |
| | | |
| | | int selectAllCount(LocDetlDTO locDetlDTO); |
| | | int selectAllPymentcount(LocDetlDTO locDetlDTO); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.result.LocDetlAll; |
| | | import com.zy.asrs.entity.result.LocDetlDTO; |
| | | import com.zy.asrs.entity.result.StockVo; |
| | | import com.zy.asrs.mapper.LocDetlMapper; |
| | | import com.zy.asrs.service.LocDetlService; |
| | |
| | | } |
| | | return this.baseMapper.searchByLike(orderNo, matnr, maktx, specs, locNo); |
| | | } |
| | | |
| | | @Override |
| | | public List<LocDetlAll> selectAllOwner(LocDetlDTO locDetlDTO) { |
| | | return this.baseMapper.selectAllOwner(locDetlDTO); |
| | | } |
| | | |
| | | @Override |
| | | public List<LocDetlAll> selectAllPyment(LocDetlDTO locDetlDTO) { |
| | | return this.baseMapper.selectAllPyment(locDetlDTO); |
| | | } |
| | | |
| | | @Override |
| | | public int selectAllCount(LocDetlDTO locDetlDTO) { |
| | | return this.baseMapper.selectAllCount(locDetlDTO); |
| | | } |
| | | |
| | | @Override |
| | | public int selectAllPymentcount(LocDetlDTO locDetlDTO) { |
| | | return this.baseMapper.selectAllPymentcount(locDetlDTO); |
| | | } |
| | | } |
| | |
| | | manLocDetl.setBatch(jsonOrderDetl.getBatch()); |
| | | manLocDetl.setOwner(orderDetl.getOwner()); |
| | | manLocDetl.setWeight(jsonOrderDetl.getWeight()); |
| | | manLocDetl.setOrderNo(jsonOrderDetl.getOrderNo()); |
| | | if(!manLocDetlService.insert(manLocDetl)){ |
| | | return R.error("插入平库物料失败!"); |
| | | } |
| | |
| | | String[][] locNos2 =new String[param.getLocDetls().size()][2]; |
| | | int i=0; |
| | | for (EmptyPlateOutParam.LocDetl locDetl : param.getLocDetls()){ |
| | | if (!locNos.contains(locDetl.getLocNo())){ |
| | | locNos.add(locDetl.getLocNo()); |
| | | locNos2[i][0]=locDetl.getLocNo(); |
| | | if (!locNos.contains(locDetl.getLoc_no())){ |
| | | locNos.add(locDetl.getLoc_no()); |
| | | locNos2[i][0]=locDetl.getLoc_no(); |
| | | locNos2[i][1]=locDetl.getManu(); |
| | | i++; |
| | | } |
| | |
| | | String[][] locNos2 =new String[param.getLocDetls().size()][2]; |
| | | int i=0; |
| | | for (EmptyPlateOutParam.LocDetl locDetl : param.getLocDetls()){ |
| | | if (!locNos.contains(locDetl.getLocNo())){ |
| | | locNos.add(locDetl.getLocNo()); |
| | | locNos2[i][0]=locDetl.getLocNo(); |
| | | if (locDetl.getLocNo().substring(0,2) == "DT"){ |
| | | locNos2[i][1]= "平库"; |
| | | }else { |
| | | locNos2[i][1]= "立库"; |
| | | } |
| | | |
| | | if (!locNos.contains(locDetl.getLoc_no())){ |
| | | locNos.add(locDetl.getLoc_no()); |
| | | locNos2[i][0]=locDetl.getLoc_no(); |
| | | locNos2[i][1]=locDetl.getManu(); |
| | | i++; |
| | | } |
| | | } |
| | |
| | | end |
| | | desc |
| | | </select> |
| | | <sql id="selectAllSql"> |
| | | <if test="locNo!=null and locNo!='' "> |
| | | and t.loc_no like '%' + #{locNo} + '%' |
| | | </if> |
| | | <if test="matnr != null and matnr !='' "> |
| | | and t.matnr like '%' + #{matnr} + '%' |
| | | </if> |
| | | <if test="owner != null and owner !='' "> |
| | | and t.owner like '%' + #{owner} + '%' |
| | | </if> |
| | | |
| | | </sql> |
| | | <select id="selectAllOwner" resultType="com.zy.asrs.entity.result.LocDetlAll" parameterType="com.zy.asrs.entity.result.LocDetlDTO"> |
| | | SELECT * FROM ( |
| | | SELECT ROW_NUMBER() over(order by matnr) as row,* FROM ( |
| | | SELECT * FROM asr_loc_detl_all |
| | | ) t |
| | | WHERE 1=1 |
| | | <include refid="selectAllSql"></include> |
| | | ) a |
| | | WHERE a.row BETWEEN ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | </select> |
| | | <select id="selectAllCount" resultType="java.lang.Integer" parameterType="com.zy.asrs.entity.result.LocDetlDTO"> |
| | | SELECT count(*) FROM ( |
| | | SELECT ROW_NUMBER() over(order by matnr) as row,* FROM ( |
| | | SELECT * FROM asr_loc_detl_all |
| | | ) t |
| | | WHERE 1=1 |
| | | <include refid="selectAllSql"></include> |
| | | ) a |
| | | |
| | | </select> |
| | | <select id="selectAllPyment" resultType="com.zy.asrs.entity.result.LocDetlAll" parameterType="com.zy.asrs.entity.result.LocDetlDTO"> |
| | | SELECT * FROM ( |
| | | SELECT ROW_NUMBER() over(order by matnr) as row,* FROM ( |
| | | SELECT * FROM asr_loc_detl_all |
| | | ) t |
| | | WHERE 1=1 and t.payment = 0 |
| | | <include refid="selectAllSql"></include> |
| | | ) a |
| | | WHERE a.row BETWEEN ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="selectAllPymentcount" resultType="java.lang.Integer" parameterType="com.zy.asrs.entity.result.LocDetlDTO"> |
| | | SELECT count(*) FROM ( |
| | | SELECT ROW_NUMBER() over(order by matnr) as row,* FROM ( |
| | | SELECT * FROM asr_loc_detl_all |
| | | ) t |
| | | WHERE 1=1 and t.payment = 0 |
| | | <include refid="selectAllSql"></include> |
| | | ) a |
| | | |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | <result column="owner" property="owner" /> |
| | | <result column="payment" property="payment" /> |
| | | <result column="real_anfme" property="realAnfme" /> |
| | | <result column="order_no" property="orderNo" /> |
| | | </resultMap> |
| | | |
| | | <sql id="locDetlCondition"> |
| | |
| | | where loc_no = #{locNo} |
| | | and matnr = #{matnr} |
| | | </select> |
| | | <select id="selectItem" resultType="com.zy.asrs.entity.ManLocDetl"> |
| | | <select id="selectItem" resultMap="BaseResultMap"> |
| | | select top 1 * from man_loc_detl |
| | | where loc_no = #{locNo} |
| | | and matnr = #{matnr} |
| | |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | limit: 500, |
| | | cols: [getCol()], |
| | | cols: [[ |
| | | ,{field: 'matnr', align: 'center',title: '商品编号', sort:true} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称', sort:true} |
| | | ,{field: 'loc_no', align: 'center',title: '库位号', sort:true} |
| | | ,{field: 'orderNo', align: 'center',title: '单据编号', hide: true} |
| | | ,{field: 'batch', align: 'center',title: '批号', sort:true} |
| | | ,{field: 'anfme', align: 'center',title: '数量',hide: true} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码',hide: false} |
| | | ,{field: 'specs', align: 'center',title: '规格',hide: true} |
| | | ,{field: 'weight', align: 'center',title: '重量', hide: false} |
| | | ,{field: 'owner$', align: 'center',title: '货主', hide: false} |
| | | ,{field: 'payment$', align: 'center',title: '货物形态', hide: false} |
| | | ]], |
| | | done: function(res, curr, count) { |
| | | tableMerge.render(this); |
| | | limit(); |
| | |
| | | maxmin: false, |
| | | area: ['90%', '85%'], |
| | | shadeClose: true, |
| | | content: 'turnOverQuery.html', |
| | | content: 'turnOverOwner.html', |
| | | success: function(layero, index){ |
| | | layer.close(loadIndex); |
| | | } |
New file |
| | |
| | | var locDetlLayerIdx; |
| | | var locDetlData = []; |
| | | function getCol() { |
| | | var cols = [ |
| | | {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', 'tableMerge'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var 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, |
| | | limit: 500, |
| | | 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 = { |
| | | ownerId: staNo, |
| | | locDetls: locDetlData |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl+"/turn/over/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; |
| | | case 'outboundPayment': |
| | | if (locDetlData.length === 0){ |
| | | layer.msg('请先提取商品库存', {icon: 2}); |
| | | } else { |
| | | // var staNo = $("#staNoSelect").val(); |
| | | // if (staNo === "" || staNo === null){ |
| | | // layer.msg("请选择目标货主", {icon: 2}); |
| | | // return; |
| | | // } |
| | | let param = { |
| | | locDetls: locDetlData |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl+"/turn/over/out/payment/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+"/turn/over/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: 'turnOverQuery.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"> |
| | | <link rel="stylesheet" href="../../static/css/common.css" media="all"> |
| | | <style> |
| | | body { |
| | | } |
| | | .layui-table-box { |
| | | border-right: 1px solid #9F9F9F; |
| | | border-left: 1px solid #9F9F9F; |
| | | } |
| | | |
| | | #search-box { |
| | | padding: 30px 0 20px 0; |
| | | } |
| | | #search-box .layui-inline:first-child { |
| | | margin-left: 30px; |
| | | } |
| | | #search-box .layui-inline { |
| | | margin-right: 5px; |
| | | } |
| | | |
| | | #data-search-btn { |
| | | margin-left: 10px; |
| | | display: inline-block; |
| | | } |
| | | #data-search-btn.layui-btn-container .layui-btn { |
| | | margin-right: 20px; |
| | | } |
| | | </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> |
| | | <!-- 搜索栏 --> |
| | | <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="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"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="owner$" 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> |
| | | |
| | | <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> |
| | | |
| | | <div class="layui-form"> |
| | | <table class="layui-hide" id="stockOut" lay-filter="stockOut"></table> |
| | | </div> |
| | | |
| | | <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() { |
| | | var cols = [ |
| | | {type: 'checkbox'} |
| | | ,{field: 'locNo$', align: 'center',title: '库位号'} |
| | | ]; |
| | | cols.push.apply(cols, detlCols); |
| | | 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', 'admin', 'tableMerge'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | var tableMerge = layui.tableMerge; |
| | | |
| | | // 数据渲染 |
| | | locDetlTableIns = table.render({ |
| | | elem: '#stockOut', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/locDetl/selectOwner/list/auth', |
| | | page: true, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | limit: 16, |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | ,{field: 'matnr', align: 'center',title: '商品编号', sort:true} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称', sort:true} |
| | | ,{field: 'loc_no', align: 'center',title: '库位号', sort:true} |
| | | ,{field: 'orderNo', align: 'center',title: '单据编号', hide: true} |
| | | ,{field: 'batch', align: 'center',title: '批号', sort:true} |
| | | ,{field: 'anfme', align: 'center',title: '数量',hide: true} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码',hide: false} |
| | | ,{field: 'specs', align: 'center',title: '规格',hide: true} |
| | | ,{field: 'weight', align: 'center',title: '重量', hide: false} |
| | | ,{field: 'owner$', align: 'center',title: '货主', hide: false} |
| | | ,{field: 'payment$', align: 'center',title: '货物形态', hide: false} |
| | | ] |
| | | |
| | | ], |
| | | 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+"/"; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(stockOut)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | var data = checkStatus.data; |
| | | switch(obj.event) { |
| | | case 'confirm': |
| | | if (data.length === 0){ |
| | | layer.msg("请选择数据"); |
| | | 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; |
| | | }); |
| | | locDetlTableIns.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/pakStore/turnOver.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/pakStore/turnOver2.js" charset="utf-8"></script> |
| | | |
| | | <script type="text/template" id="takeSiteSelectTemplate"> |
| | | {{#each data}} |
| | |
| | | <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="owner$" placeholder="货主" autocomplete="off"> |