自动化立体仓库 - WMS系统
LSH
2022-10-29 9cecb5ead4cc1144ac7fd662c0db2d1527cdf5bc
#添加订单明细筛选重复商品
异常库存页面修改
4个文件已修改
617 ■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/LocDetlController.java 133 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/LocDetl.java 149 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/locDetlGroup/locDetlGroup.js 322 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/order/order.js 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/LocDetlController.java
@@ -22,8 +22,10 @@
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.xml.crypto.Data;
import java.io.IOException;
import java.net.URLEncoder;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
@@ -53,7 +55,7 @@
    @RequestMapping(value = "/locDetl/auth")
    @ManagerAuth
    public R stockOutList(@RequestParam(value = "locNos[]") List<String> locNos){
    public R stockOutList(@RequestParam(value = "locNos[]") List<String> locNos) {
        if (!locNos.isEmpty()) {
            List<LocDetl> res = new ArrayList<>();
            for (String locNo : new HashSet<>(locNos)) {
@@ -69,10 +71,10 @@
    @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("modi_time"))){
    public R stockOutList(@RequestParam(defaultValue = "1") Integer curr,
                          @RequestParam(defaultValue = "10") Integer limit,
                          @RequestParam Map<String, Object> param) {
        if (!Cools.isEmpty(param.get("modi_time"))) {
            String val = String.valueOf(param.get("modi_time"));
            if (val.contains(RANGE_TIME_LINK)) {
                String[] dates = val.split(RANGE_TIME_LINK);
@@ -86,13 +88,13 @@
    @RequestMapping(value = "/locDetl/list/auth")
    @ManagerAuth
    public R list(@RequestParam(defaultValue = "1")Integer curr,
                  @RequestParam(defaultValue = "10")Integer limit,
                  @RequestParam(required = false)String orderByField,
                  @RequestParam(required = false)String orderByType,
                  @RequestParam(required = false)String condition,
    public R list(@RequestParam(defaultValue = "1") Integer curr,
                  @RequestParam(defaultValue = "10") Integer limit,
                  @RequestParam(required = false) String orderByField,
                  @RequestParam(required = false) String orderByType,
                  @RequestParam(required = false) String condition,
                  @RequestParam Map<String, Object> param,
                  @RequestParam(required = false)Boolean unreason){
                  @RequestParam(required = false) Boolean unreason) {
        if (!Cools.isEmpty(unreason) && unreason) {
            return R.ok(locDetlService.selectPage(new Page<>(curr, limit), new EntityWrapper<LocDetl>()
@@ -107,7 +109,7 @@
            if (chooseRow.length() == 1) {
                row = "0" + chooseRow;
                param.remove("row");
            }else {
            } else {
                row = chooseRow;
                param.remove("row");
            }
@@ -115,19 +117,21 @@
        excludeTrash(param);
        convert(param, wrapper);
        allLike(LocDetl.class, param.keySet(), wrapper, condition);
        if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
        if (!row.equals("")){
        if (!Cools.isEmpty(orderByField)) {
            wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));
        }
        if (!row.equals("")) {
            wrapper.and()
                    .where("loc_no like '" +row +"%'");
                    .where("loc_no like '" + row + "%'");
        }
        return R.ok(locDetlService.selectPage(new Page<>(curr, limit), wrapper));
    }
    private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){
        for (Map.Entry<String, Object> entry : map.entrySet()){
    private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper) {
        for (Map.Entry<String, Object> entry : map.entrySet()) {
            String val = String.valueOf(entry.getValue());
            if (val.contains(RANGE_TIME_LINK)){
            if (val.contains(RANGE_TIME_LINK)) {
                String[] dates = val.split(RANGE_TIME_LINK);
                wrapper.ge(entry.getKey(), DateUtils.convert(dates[0]));
                wrapper.le(entry.getKey(), DateUtils.convert(dates[1]));
@@ -152,10 +156,10 @@
        return R.ok();
    }
    @RequestMapping(value = "/locDetl/update/auth")
    @ManagerAuth(memo = "库位明细修改")
    public R update(LocDetl locDetl){
        if (Cools.isEmpty(locDetl) || null==locDetl.getMatnr()){
    @RequestMapping(value = "/locDetl/update/auth")
    @ManagerAuth(memo = "库位明细修改")
    public R update(LocDetl locDetl) {
        if (Cools.isEmpty(locDetl) || null == locDetl.getMatnr()) {
            return R.error();
        }
        locDetl.setModiUser(getUserId());
@@ -166,12 +170,12 @@
    @RequestMapping(value = "/locDetl/delete/auth")
    @ManagerAuth(memo = "库位明细删除")
    public R delete(@RequestParam String param){
    public R delete(@RequestParam String param) {
        List<LocDetl> list = JSONArray.parseArray(param, LocDetl.class);
        if (Cools.isEmpty(list)){
        if (Cools.isEmpty(list)) {
            return R.error();
        }
        for (LocDetl entity : list){
        for (LocDetl entity : list) {
            locDetlService.delete(new EntityWrapper<>(entity));
        }
        return R.ok();
@@ -179,7 +183,7 @@
    @RequestMapping(value = "/locDetl/export/auth")
    @ManagerAuth(memo = "库位明细导出")
    public synchronized R export(@RequestBody JSONObject param){
    public synchronized R export(@RequestBody JSONObject param) {
        List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class);
        EntityWrapper<LocDetl> wrapper = new EntityWrapper<>();
        Map<String, Object> map = excludeTrash(param.getJSONObject("locDetl"));
@@ -189,15 +193,15 @@
            if (chooseRow.length() == 1) {
                row = "0" + chooseRow;
                map.remove("row");
            }else {
            } else {
                row = chooseRow;
                map.remove("row");
            }
        }
        convert(map, wrapper);
        if (!row.equals("")){
        if (!row.equals("")) {
            wrapper.and()
                    .where("loc_no like '" +row +"%'");
                    .where("loc_no like '" + row + "%'");
        }
        List<LocDetl> list = locDetlService.selectList(wrapper);
        return R.ok(exportSupport(list, fields));
@@ -210,7 +214,7 @@
        wrapper.like("matnr", condition);
        Page<LocDetl> page = locDetlService.selectPage(new Page<>(0, 10), wrapper);
        List<Map<String, Object>> result = new ArrayList<>();
        for (LocDetl locDetl : page.getRecords()){
        for (LocDetl locDetl : page.getRecords()) {
            Map<String, Object> map = new HashMap<>();
            map.put("id", locDetl.getMatnr());
            map.put("value", locDetl.getMatnr());
@@ -223,7 +227,7 @@
    @ManagerAuth
    public R query(@RequestBody JSONObject param) {
        Wrapper<LocDetl> wrapper = new EntityWrapper<LocDetl>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val"));
        if (null != locDetlService.selectOne(wrapper)){
        if (null != locDetlService.selectOne(wrapper)) {
            return R.parse(BaseRes.REPEAT).add(getComment(LocDetl.class, String.valueOf(param.get("key"))));
        }
        return R.ok();
@@ -231,8 +235,8 @@
    @RequestMapping(value = "/locDetl/statis/auth")
    @ManagerAuth
    public R statis(@RequestParam(defaultValue = "1")Integer curr,
                    @RequestParam(defaultValue = "10")Integer limit,
    public R statis(@RequestParam(defaultValue = "1") Integer curr,
                    @RequestParam(defaultValue = "10") Integer limit,
                    @RequestParam Map<String, Object> param) {
        Page<LocDetl> stockStatis = locDetlService.getStockStatis(toPage(curr, limit, param, LocDetl.class));
        for (LocDetl locDetl : stockStatis.getRecords()) {
@@ -269,10 +273,11 @@
    /**
     * 获取库存总数
     *
     * @return
     */
    @RequestMapping("/locDetl/count")
    public R getAllCount(){
    public R getAllCount() {
        Integer sum = locDetlService.sum();
        return R.ok(sum);
    }
@@ -282,44 +287,53 @@
    @RequestMapping(value = "/locDetl/grouplist/auth")
    @ManagerAuth
    public R groupList(@RequestParam(defaultValue = "1")Integer curr,
                  @RequestParam(defaultValue = "10")Integer limit,
                  @RequestParam(required = false)String orderByField,
                  @RequestParam(required = false)String orderByType,
                  @RequestParam(required = false)String condition,
                  @RequestParam Map<String, Object> param){
    public R groupList(@RequestParam(defaultValue = "1") Integer curr,
                       @RequestParam(defaultValue = "10") Integer limit,
                       @RequestParam(required = false) String orderByField,
                       @RequestParam(required = false) String orderByType,
                       @RequestParam(required = false) String condition,
                       @RequestParam Map<String, Object> param) {
        List<LocDetl> result = new ArrayList<>();
//        excludeTrash(param);
        param.put("curr",curr);
        param.put("limit",limit);
        List<LocDetl> groupLocDetl = locDetlService.selectGroupPage(param,curr,limit);
        param.put("curr", curr);
        param.put("limit", limit);
        List<LocDetl> groupLocDetl = locDetlService.selectGroupPage(param, curr, limit);
        for (LocDetl locDetl : groupLocDetl) {
            Mat mat = matService.selectOne(new EntityWrapper<Mat>()
                    .eq("matnr", locDetl.getMatnr()));
            locDetl.setStoreMax(mat.getStoreMax());
            locDetl.setStoreMaxDate(mat.getStoreMaxDate());
            locDetl.setStoreMin(mat.getStoreMin());
            if (Cools.isEmpty(mat)
                    || Cools.isEmpty(mat.getStoreMax())
                    || Cools.isEmpty(mat.getStoreMaxDate())
                    || Cools.isEmpty(mat.getStoreMin())) {
                continue;
            }
            if (locDetl.getAnfme() > mat.getStoreMax()){
                result.add(locDetl);
            } else if (Cools.isEmpty(locDetl.getBatch())) {
                continue;
            } else if (locDetl.getBatch().length() != 8) {
                continue;
            }
            if (locDetl.getAnfme() < mat.getStoreMin()){
            try {
                SimpleDateFormat simple = new SimpleDateFormat("yyyyMMdd");
                Date maxDate = simple.parse(locDetl.getBatch());
                long time = maxDate.getTime();
                Date now = new Date();
                long time1 = now.getTime();
                locDetl.setNowTime((int)((time1 - time)/(1000*60*60*24)));
            } catch (ParseException e) {
                e.printStackTrace();
            }
            if (locDetl.getAnfme() > mat.getStoreMax()) {
                result.add(locDetl);
                continue;
            } else if (locDetl.getAnfme() < mat.getStoreMin()) {
                result.add(locDetl);
                continue;
            }
            if (Cools.isEmpty(locDetl.getBatch())) {
                continue;
            }
            if (locDetl.getBatch().length() != 8){
                continue;
            }
            try{
            try {
                SimpleDateFormat simple = new SimpleDateFormat("yyyyMMdd");
                Date maxDate = simple.parse(locDetl.getBatch());
                Calendar calendar = new GregorianCalendar();
@@ -332,14 +346,13 @@
                if (now.compareTo(maxDate) > 0) {
                    result.add(locDetl);
                }
            }catch (Exception e){
            } catch (Exception e) {
                continue;
            }
        }
        Page<LocDetl> locDetlPage = new Page<>();
        locDetlPage.setRecords(paging(result,curr,limit));
        locDetlPage.setRecords(paging(result, curr, limit));
        locDetlPage.setTotal(result.size());
        locDetlPage.setCurrent(curr);
        locDetlPage.setSize(limit);
@@ -350,10 +363,10 @@
        List<LocDetl> pageRecord = new ArrayList<LocDetl>();
        int minIndex = (curr - 1) * limit;
        int maxIndex = (curr * limit) - 1;
        if (result.size() < maxIndex){
        if (result.size() < maxIndex) {
            maxIndex = result.size();
        }
        for (int i = minIndex; i < maxIndex; i++){
        for (int i = minIndex; i < maxIndex; i++) {
            pageRecord.add(result.get(i));
        }
        return pageRecord;
src/main/java/com/zy/asrs/entity/LocDetl.java
@@ -24,152 +24,175 @@
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value= "库位号")
    @ApiModelProperty(value = "库位号")
    @TableField("loc_no")
    private String locNo;
    @ApiModelProperty(value= "托盘条码")
    @ApiModelProperty(value = "托盘条码")
    private String zpallet;
    @ApiModelProperty(value= "数量")
    @ApiModelProperty(value = "数量")
    @ExcelProperty("数量")
    private Double anfme;
    @ApiModelProperty(value= "商品编号")
    @ApiModelProperty(value = "商品编号")
    @ExcelProperty("商品编号")
    private String matnr;
    @ApiModelProperty(value= "商品名称")
    @ApiModelProperty(value = "商品名称")
    @ExcelProperty("商品名称")
    private String maktx;
    @ApiModelProperty(value= "序列码")
    @ApiModelProperty(value = "序列码")
    @ExcelProperty("序列码")
    private String batch;
    @ApiModelProperty(value= "单据编号")
    @ApiModelProperty(value = "单据编号")
    @ExcelProperty("单据编号")
    @TableField("order_no")
    private String orderNo;
    @ApiModelProperty(value= "c")
    @ApiModelProperty(value = "c")
    @ExcelProperty("规格")
    private String specs;
    @ApiModelProperty(value= "型号")
    @ApiModelProperty(value = "型号")
    private String model;
    @ApiModelProperty(value= "颜色")
    @ApiModelProperty(value = "颜色")
    private String color;
    @ApiModelProperty(value= "品牌")
    @ApiModelProperty(value = "品牌")
    private String brand;
    @ApiModelProperty(value= "单位")
    @ApiModelProperty(value = "单位")
    private String unit;
    @ApiModelProperty(value= "单价")
    @ApiModelProperty(value = "单价")
    private Double price;
    @ApiModelProperty(value= "sku")
    @ApiModelProperty(value = "sku")
    private String sku;
    @ApiModelProperty(value= "单位量")
    @ApiModelProperty(value = "单位量")
    private Double units;
    @ApiModelProperty(value= "条码")
    @ApiModelProperty(value = "条码")
    private String barcode;
    @ApiModelProperty(value= "产地")
    @ApiModelProperty(value = "产地")
    private String origin;
    @ApiModelProperty(value= "厂家")
    @ApiModelProperty(value = "厂家")
    private String manu;
    @ApiModelProperty(value= "生产日期")
    @ApiModelProperty(value = "生产日期")
    @TableField("manu_date")
    private String manuDate;
    @ApiModelProperty(value= "品项数")
    @ApiModelProperty(value = "品项数")
    @TableField("item_num")
    private String itemNum;
    @ApiModelProperty(value= "安全库存量")
    @ApiModelProperty(value = "安全库存量")
    @TableField("safe_qty")
    private Double safeQty;
    @ApiModelProperty(value= "重量")
    @ApiModelProperty(value = "重量")
    private Double weight;
    @ApiModelProperty(value= "长度")
    @ApiModelProperty(value = "长度")
    private Double length;
    @ApiModelProperty(value= "体积")
    @ApiModelProperty(value = "体积")
    private Double volume;
    @ApiModelProperty(value= "三方编码")
    @ApiModelProperty(value = "三方编码")
    @TableField("three_code")
    private String threeCode;
    @ApiModelProperty(value= "供应商")
    @ApiModelProperty(value = "供应商")
    private String supp;
    @ApiModelProperty(value= "供应商编码")
    @ApiModelProperty(value = "供应商编码")
    @TableField("supp_code")
    private String suppCode;
    @ApiModelProperty(value= "是否批次 1: 是  0: 否  ")
    @ApiModelProperty(value = "是否批次 1: 是  0: 否  ")
    @TableField("be_batch")
    private Integer beBatch;
    @ApiModelProperty(value= "保质期")
    @ApiModelProperty(value = "保质期")
    @TableField("dead_time")
    private String deadTime;
    @ApiModelProperty(value= "预警天数")
    @ApiModelProperty(value = "预警天数")
    @TableField("dead_warn")
    private Integer deadWarn;
    @ApiModelProperty(value= "制购 1: 制造  2: 采购  3: 外协  ")
    @ApiModelProperty(value = "制购 1: 制造  2: 采购  3: 外协  ")
    private Integer source;
    @ApiModelProperty(value= "要求检验 1: 是  0: 否  ")
    @ApiModelProperty(value = "要求检验 1: 是  0: 否  ")
    private Integer inspect;
    @ApiModelProperty(value= "危险品 1: 是  0: 否  ")
    @ApiModelProperty(value = "危险品 1: 是  0: 否  ")
    private Integer danger;
    @ApiModelProperty(value= "修改人员")
    @ApiModelProperty(value = "修改人员")
    @TableField("modi_user")
    private Long modiUser;
    @ApiModelProperty(value= "修改时间")
    @ApiModelProperty(value = "修改时间")
    @TableField("modi_time")
    private Date modiTime;
    @ApiModelProperty(value= "创建者")
    @ApiModelProperty(value = "创建者")
    @TableField("appe_user")
    private Long appeUser;
    @ApiModelProperty(value= "添加时间")
    @ApiModelProperty(value = "添加时间")
    @TableField("appe_time")
    private Date appeTime;
    @ApiModelProperty(value= "备注")
    @ApiModelProperty(value = "备注")
    private String memo;
    public String getLocNo$(){
    /**
     * 库存预警数量上限
     */
    private Double storeMax;
    /**
     * 库存预警数量下限
     */
    private Double storeMin;
    /**
     * 库龄预警上限
     */
    private Integer storeMaxDate;
    /**
     * 实际在库天数
     */
    private Integer nowTime;
    public String getLocNo$() {
        LocMastService service = SpringUtils.getBean(LocMastService.class);
        LocMast locMast = service.selectById(this.locNo);
        if (!Cools.isEmpty(locMast)){
        if (!Cools.isEmpty(locMast)) {
            return String.valueOf(locMast.getLocNo());
        }
        return null;
    }
    public String getBeBatch$(){
        if (null == this.beBatch){ return null; }
        switch (this.beBatch){
    public String getBeBatch$() {
        if (null == this.beBatch) {
            return null;
        }
        switch (this.beBatch) {
            case 1:
                return "是";
            case 0:
@@ -179,9 +202,11 @@
        }
    }
    public String getSource$(){
        if (null == this.source){ return null; }
        switch (this.source){
    public String getSource$() {
        if (null == this.source) {
            return null;
        }
        switch (this.source) {
            case 1:
                return "制造";
            case 2:
@@ -193,9 +218,11 @@
        }
    }
    public String getInspect$(){
        if (null == this.inspect){ return null; }
        switch (this.inspect){
    public String getInspect$() {
        if (null == this.inspect) {
            return null;
        }
        switch (this.inspect) {
            case 1:
                return "是";
            case 0:
@@ -205,9 +232,11 @@
        }
    }
    public String getDanger$(){
        if (null == this.danger){ return null; }
        switch (this.danger){
    public String getDanger$() {
        if (null == this.danger) {
            return null;
        }
        switch (this.danger) {
            case 1:
                return "是";
            case 0:
@@ -217,33 +246,33 @@
        }
    }
    public String getModiUser$(){
    public String getModiUser$() {
        UserService service = SpringUtils.getBean(UserService.class);
        User user = service.selectById(this.modiUser);
        if (!Cools.isEmpty(user)){
        if (!Cools.isEmpty(user)) {
            return String.valueOf(user.getUsername());
        }
        return null;
    }
    public String getModiTime$(){
        if (Cools.isEmpty(this.modiTime)){
    public String getModiTime$() {
        if (Cools.isEmpty(this.modiTime)) {
            return "";
        }
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.modiTime);
    }
    public String getAppeUser$(){
    public String getAppeUser$() {
        UserService service = SpringUtils.getBean(UserService.class);
        User user = service.selectById(this.appeUser);
        if (!Cools.isEmpty(user)){
        if (!Cools.isEmpty(user)) {
            return String.valueOf(user.getUsername());
        }
        return null;
    }
    public String getAppeTime$(){
        if (Cools.isEmpty(this.appeTime)){
    public String getAppeTime$() {
        if (Cools.isEmpty(this.appeTime)) {
            return "";
        }
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.appeTime);
src/main/webapp/static/js/locDetlGroup/locDetlGroup.js
@@ -1,13 +1,16 @@
var pageCurr;
function getCol() {
    var cols = [
        {field: 'matnr', align: 'center',title: '物料号', sort:true}
        ,{field: 'maktx', align: 'center',title: '物料名称', sort:true}
        ,{field: 'specs', align: 'center',title: '规格'}
        ,{field: 'batch', align: 'center',title: '批号', width: 300, sort:true}
        ,{field: 'anfme', align: 'center',title: '数量'}
        {field: 'matnr', align: 'center', title: '物料号', sort: true}
        , {field: 'maktx', align: 'center', title: '物料名称', sort: true}
        , {field: 'specs', align: 'center', title: '规格'}
        , {field: 'batch', align: 'center', title: '批号', width: 300, sort: true}
        , {field: 'storeMax', align: 'center', title: '数量上限', sort: true}
        , {field: 'storeMin', align: 'center', title: '数量下限', sort: true}
        , {field: 'storeMaxDate', align: 'center', title: '库龄上限', sort: true}
        , {field: 'anfme', align: 'center', title: '实际数量'}
        , {field: 'nowTime', align: 'center', title: '实际库龄'}
    ];
@@ -15,7 +18,7 @@
    return cols;
}
layui.use(['table','laydate', 'form'], function(){
layui.use(['table', 'laydate', 'form'], function () {
    var table = layui.table;
    var $ = layui.jquery;
    var layer = layui.layer;
@@ -26,7 +29,7 @@
    tableIns = table.render({
        elem: '#locDetl',
        headers: {token: localStorage.getItem('token')},
        url: baseUrl+'/locDetl/grouplist/auth',
        url: baseUrl + '/locDetl/grouplist/auth',
        page: true,
        limit: 20,
        limits: [20, 30, 50, 100, 200, 500],
@@ -49,17 +52,17 @@
        response: {
            statusCode: 200
        },
        done: function(res, curr, count) {
        done: function (res, curr, count) {
            if (res.code === 403) {
                top.location.href = baseUrl+"/";
                top.location.href = baseUrl + "/";
            }
            pageCurr=curr;
            pageCurr = curr;
            limit();
            form.on('checkbox(tableCheckbox)', function (data) {
                var _index = $(data.elem).attr('table-index')||0;
                if(data.elem.checked){
                var _index = $(data.elem).attr('table-index') || 0;
                if (data.elem.checked) {
                    res.data[_index][data.value] = 'Y';
                }else{
                } else {
                    res.data[_index][data.value] = 'N';
                }
            });
@@ -69,7 +72,7 @@
    // 监听排序事件
    table.on('sort(locDetl)', function (obj) {
        var searchData = {};
        $.each($('#search-box [name]').serializeArray(), function() {
        $.each($('#search-box [name]').serializeArray(), function () {
            searchData[this.name] = this.value;
        });
        searchData['orderByField'] = obj.field;
@@ -81,9 +84,9 @@
            },
            done: function (res, curr, count) {
                if (res.code === 403) {
                    top.location.href = baseUrl+"/";
                    top.location.href = baseUrl + "/";
                }
                pageCurr=curr;
                pageCurr = curr;
                limit();
            }
        });
@@ -92,7 +95,7 @@
    // 监听头工具栏事件
    table.on('toolbar(locDetl)', function (obj) {
        var checkStatus = table.checkStatus(obj.config.id);
        switch(obj.event) {
        switch (obj.event) {
            case 'addData':
                layer.open({
                    type: 2,
@@ -101,10 +104,11 @@
                    area: [top.detailWidth, top.detailHeight],
                    shadeClose: false,
                    content: 'locDetl_detail.html',
                    success: function(layero, index){
                    success: function (layero, index) {
                        layer.getChildFrame('#data-detail-submit-edit', index).hide();
                        clearFormVal(layer.getChildFrame('#detail', index));
                        layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                        clearFormVal(layer.getChildFrame('#detail', index));
                        layer.iframeAuto(index);
                        layer.style(index, {top: (($(window).height() - layer.getChildFrame('#data-detail', index).height()) / 3) + "px"});
                    }
                });
                break;
@@ -118,22 +122,22 @@
                break;
            case 'deleteData':
                var data = checkStatus.data;
                if (data.length === 0){
                if (data.length === 0) {
                    layer.msg('请选择数据');
                } else {
                    layer.confirm('确定删除'+(data.length===1?'此':data.length)+'条数据吗', function(){
                    layer.confirm('确定删除' + (data.length === 1 ? '此' : data.length) + '条数据吗', function () {
                        $.ajax({
                            url: baseUrl+"/locDetl/delete/auth",
                            url: baseUrl + "/locDetl/delete/auth",
                            headers: {'token': localStorage.getItem('token')},
                            data: {param: JSON.stringify(data)},
                            method: 'POST',
                            traditional:true,
                            traditional: true,
                            success: function (res) {
                                if (res.code === 200){
                                if (res.code === 200) {
                                    layer.closeAll();
                                    tableReload(false);
                                } else if (res.code === 403){
                                    top.location.href = baseUrl+"/";
                                } else if (res.code === 403) {
                                    top.location.href = baseUrl + "/";
                                } else {
                                    layer.msg(res.msg)
                                }
@@ -143,9 +147,9 @@
                }
                break;
            case 'exportData':
                layer.confirm('确定导出Excel吗', {shadeClose: true}, function(){
                    var titles=[];
                    var fields=[];
                layer.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);
@@ -153,7 +157,7 @@
                        }
                    });
                    var exportData = {};
                    $.each($('#search-box [name]').serializeArray(), function() {
                    $.each($('#search-box [name]').serializeArray(), function () {
                        exportData[this.name] = this.value;
                    });
                    var param = {
@@ -162,19 +166,19 @@
                    };
                    var loadIndex = layer.msg('正在导出...', {icon: 16, shade: 0.01, time: false});
                    $.ajax({
                        url: baseUrl+"/locDetl/export/auth",
                        url: baseUrl + "/locDetl/export/auth",
                        headers: {'token': localStorage.getItem('token')},
                        data: JSON.stringify(param),
                        dataType:'json',
                        contentType:'application/json;charset=UTF-8',
                        dataType: 'json',
                        contentType: 'application/json;charset=UTF-8',
                        method: 'POST',
                        success: function (res) {
                            layer.close(loadIndex);
                            layer.closeAll();
                            if (res.code === 200) {
                                table.exportFile(titles,res.data,'xls');
                                table.exportFile(titles, res.data, 'xls');
                            } else if (res.code === 403) {
                                top.location.href = baseUrl+"/";
                                top.location.href = baseUrl + "/";
                            } else {
                                layer.msg(res.msg)
                            }
@@ -186,7 +190,7 @@
    });
    // 监听行工具事件
    table.on('tool(locDetl)', function(obj){
    table.on('tool(locDetl)', function (obj) {
        var data = obj.data;
        switch (obj.event) {
            // 详情
@@ -198,11 +202,12 @@
                    area: [top.detailWidth, top.detailHeight],
                    shadeClose: false,
                    content: 'locDetl_detail.html',
                    success: function(layero, index){
                    success: function (layero, index) {
                        setFormVal(layer.getChildFrame('#detail', index), data, true);
                        top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
                        layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
                        layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                        layer.iframeAuto(index);
                        layer.style(index, {top: (($(window).height() - layer.getChildFrame('#data-detail', index).height()) / 3) + "px"});
                        layero.find('iframe')[0].contentWindow.layui.form.render('select');
                        layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                    }
@@ -217,12 +222,13 @@
                    area: [top.detailWidth, top.detailHeight],
                    shadeClose: false,
                    content: 'locDetl_detail.html',
                    success: function(layero, index){
                    success: function (layero, index) {
                        layer.getChildFrame('#data-detail-submit-save', index).hide();
                        setFormVal(layer.getChildFrame('#detail', index), data, false);
                        top.convertDisabled(layer.getChildFrame('#data-detail :input', index), false);
                        top.convertDisabled(layer.getChildFrame('#locNo,#matnr', index), true);
                        layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                        layer.iframeAuto(index);
                        layer.style(index, {top: (($(window).height() - layer.getChildFrame('#data-detail', index).height()) / 3) + "px"});
                        layero.find('iframe')[0].contentWindow.layui.form.render('select');
                        layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                    }
@@ -233,35 +239,36 @@
                if (param === undefined) {
                    layer.msg("无数据");
                } else {
                   layer.open({
                       type: 2,
                       title: '库位号详情',
                       maxmin: true,
                       area: [top.detailWidth, top.detailHeight],
                       shadeClose: false,
                       content: '../locMast/locMast_detail.html',
                       success: function(layero, index){
                           $.ajax({
                               url: baseUrl+"/locMast/"+ param +"/auth",
                               headers: {'token': localStorage.getItem('token')},
                               method: 'GET',
                               success: function (res) {
                                   if (res.code === 200){
                                       setFormVal(layer.getChildFrame('#detail', index), res.data, true);
                                       top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
                                       layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
                                       layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                                       layero.find('iframe')[0].contentWindow.layui.form.render('select');
                                       layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                                   } else if (res.code === 403){
                                       parent.location.href = "/";
                                   }else {
                                       layer.msg(res.msg)
                                   }
                               }
                           })
                       }
                   });
                    layer.open({
                        type: 2,
                        title: '库位号详情',
                        maxmin: true,
                        area: [top.detailWidth, top.detailHeight],
                        shadeClose: false,
                        content: '../locMast/locMast_detail.html',
                        success: function (layero, index) {
                            $.ajax({
                                url: baseUrl + "/locMast/" + param + "/auth",
                                headers: {'token': localStorage.getItem('token')},
                                method: 'GET',
                                success: function (res) {
                                    if (res.code === 200) {
                                        setFormVal(layer.getChildFrame('#detail', index), res.data, true);
                                        top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
                                        layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
                                        layer.iframeAuto(index);
                                        layer.style(index, {top: (($(window).height() - layer.getChildFrame('#data-detail', index).height()) / 3) + "px"});
                                        layero.find('iframe')[0].contentWindow.layui.form.render('select');
                                        layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                                    } else if (res.code === 403) {
                                        parent.location.href = "/";
                                    } else {
                                        layer.msg(res.msg)
                                    }
                                }
                            })
                        }
                    });
                }
                break;
            case 'modiUser':
@@ -269,35 +276,36 @@
                if (param === undefined) {
                    layer.msg("无数据");
                } else {
                   layer.open({
                       type: 2,
                       title: '修改人员详情',
                       maxmin: true,
                       area: [top.detailWidth, top.detailHeight],
                       shadeClose: false,
                       content: '../user/user_detail.html',
                       success: function(layero, index){
                           $.ajax({
                               url: baseUrl+"/user/"+ param +"/auth",
                               headers: {'token': localStorage.getItem('token')},
                               method: 'GET',
                               success: function (res) {
                                   if (res.code === 200){
                                       setFormVal(layer.getChildFrame('#detail', index), res.data, true);
                                       top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
                                       layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
                                       layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                                       layero.find('iframe')[0].contentWindow.layui.form.render('select');
                                       layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                                   } else if (res.code === 403){
                                       parent.location.href = "/";
                                   }else {
                                       layer.msg(res.msg)
                                   }
                               }
                           })
                       }
                   });
                    layer.open({
                        type: 2,
                        title: '修改人员详情',
                        maxmin: true,
                        area: [top.detailWidth, top.detailHeight],
                        shadeClose: false,
                        content: '../user/user_detail.html',
                        success: function (layero, index) {
                            $.ajax({
                                url: baseUrl + "/user/" + param + "/auth",
                                headers: {'token': localStorage.getItem('token')},
                                method: 'GET',
                                success: function (res) {
                                    if (res.code === 200) {
                                        setFormVal(layer.getChildFrame('#detail', index), res.data, true);
                                        top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
                                        layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
                                        layer.iframeAuto(index);
                                        layer.style(index, {top: (($(window).height() - layer.getChildFrame('#data-detail', index).height()) / 3) + "px"});
                                        layero.find('iframe')[0].contentWindow.layui.form.render('select');
                                        layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                                    } else if (res.code === 403) {
                                        parent.location.href = "/";
                                    } else {
                                        layer.msg(res.msg)
                                    }
                                }
                            })
                        }
                    });
                }
                break;
            case 'appeUser':
@@ -305,35 +313,36 @@
                if (param === undefined) {
                    layer.msg("无数据");
                } else {
                   layer.open({
                       type: 2,
                       title: '创建者详情',
                       maxmin: true,
                       area: [top.detailWidth, top.detailHeight],
                       shadeClose: false,
                       content: '../user/user_detail.html',
                       success: function(layero, index){
                           $.ajax({
                               url: baseUrl+"/user/"+ param +"/auth",
                               headers: {'token': localStorage.getItem('token')},
                               method: 'GET',
                               success: function (res) {
                                   if (res.code === 200){
                                       setFormVal(layer.getChildFrame('#detail', index), res.data, true);
                                       top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
                                       layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
                                       layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                                       layero.find('iframe')[0].contentWindow.layui.form.render('select');
                                       layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                                   } else if (res.code === 403){
                                       parent.location.href = "/";
                                   }else {
                                       layer.msg(res.msg)
                                   }
                               }
                           })
                       }
                   });
                    layer.open({
                        type: 2,
                        title: '创建者详情',
                        maxmin: true,
                        area: [top.detailWidth, top.detailHeight],
                        shadeClose: false,
                        content: '../user/user_detail.html',
                        success: function (layero, index) {
                            $.ajax({
                                url: baseUrl + "/user/" + param + "/auth",
                                headers: {'token': localStorage.getItem('token')},
                                method: 'GET',
                                success: function (res) {
                                    if (res.code === 200) {
                                        setFormVal(layer.getChildFrame('#detail', index), res.data, true);
                                        top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
                                        layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
                                        layer.iframeAuto(index);
                                        layer.style(index, {top: (($(window).height() - layer.getChildFrame('#data-detail', index).height()) / 3) + "px"});
                                        layero.find('iframe')[0].contentWindow.layui.form.render('select');
                                        layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                                    } else if (res.code === 403) {
                                        parent.location.href = "/";
                                    } else {
                                        layer.msg(res.msg)
                                    }
                                }
                            })
                        }
                    });
                }
                break;
@@ -342,7 +351,7 @@
    // 数据保存动作
    form.on('submit(save)', function () {
        if (banMsg != null){
        if (banMsg != null) {
            layer.msg(banMsg);
            return;
        }
@@ -354,9 +363,9 @@
        method("update")
    });
    function method(name){
    function method(name) {
        var index = layer.load(1, {
            shade: [0.5,'#000'] //0.1透明度的背景
            shade: [0.5, '#000'] //0.1透明度的背景
        });
        var data = {
//            id: $('#id').val(),
@@ -380,20 +389,20 @@
        };
        $.ajax({
            url: baseUrl+"/locDetl/"+name+"/auth",
            url: baseUrl + "/locDetl/" + name + "/auth",
            headers: {'token': localStorage.getItem('token')},
            data: top.reObject(data),
            method: 'POST',
            success: function (res) {
                if (res.code === 200){
                if (res.code === 200) {
                    parent.layer.closeAll();
                    parent.$(".layui-laypage-btn")[0].click();
                    $("#data-detail :input").each(function () {
                        $(this).val("");
                    });
                } else if (res.code === 403){
                    top.location.href = baseUrl+"/";
                }else {
                } else if (res.code === 403) {
                    top.location.href = baseUrl + "/";
                } else {
                    layer.msg(res.msg)
                }
                layer.close(index);
@@ -439,9 +448,9 @@
            done: function (res, curr, count) {
                if (res.code === 403) {
                    top.location.href = baseUrl+"/";
                    top.location.href = baseUrl + "/";
                }
                pageCurr=curr;
                pageCurr = curr;
                limit(child);
            }
@@ -462,14 +471,13 @@
});
// 关闭动作
$(document).on('click','#data-detail-close', function () {
$(document).on('click', '#data-detail-close', function () {
    parent.layer.closeAll();
});
function tableReload(child) {
    var searchData = {
    };
    $.each($('#search-box [name]').serializeArray(), function() {
    var searchData = {};
    $.each($('#search-box [name]').serializeArray(), function () {
        searchData[this.name] = this.value;
    });
    (child ? parent.tableIns : tableIns).reload({
@@ -479,14 +487,14 @@
        },
        done: function (res, curr, count) {
            if (res.code === 403) {
                top.location.href = baseUrl+"/";
                top.location.href = baseUrl + "/";
            }
            pageCurr=curr;
            pageCurr = curr;
            if (res.data.length === 0 && count !== 0) {
                tableIns.reload({
                    where: searchData,
                    page: {
                        curr: pageCurr-1
                        curr: pageCurr - 1
                    }
                });
                pageCurr -= 1;
@@ -499,10 +507,10 @@
function setFormVal(el, data, showImg) {
    for (var val in data) {
        var find = el.find(":input[id='" + val + "']");
        if (find[0]!=null){
            if (find[0].type === 'checkbox'){
                if (data[val]==='Y'){
                    find.attr("checked","checked");
        if (find[0] != null) {
            if (find[0].type === 'checkbox') {
                if (data[val] === 'Y') {
                    find.attr("checked", "checked");
                    find.val('Y');
                } else {
                    find.remove("checked");
@@ -512,9 +520,9 @@
            }
        }
        find.val(data[val]);
        if (showImg){
        if (showImg) {
            var next = find.next();
            if (next.get(0)){
            if (next.get(0)) {
                if (next.get(0).localName === "img") {
                    find.hide();
                    next.attr("src", data[val]);
@@ -534,13 +542,13 @@
function detailScreen(index) {
    var detail = layer.getChildFrame('#data-detail', index);
    var height = detail.height()+60;
    if (height > ($(window).height()*0.9)) {
        height = ($(window).height()*0.8);
    var height = detail.height() + 60;
    if (height > ($(window).height() * 0.9)) {
        height = ($(window).height() * 0.8);
    }
    layer.style(index, {
//        top: (($(window).height()-height)/3)+"px",
        height: height+'px'
        height: height + 'px'
    });
}
src/main/webapp/static/js/order/order.js
@@ -341,8 +341,17 @@
                                        async: false,
                                        success: function (res) {
                                            if (res.code === 200){
                                                xxDataList.push(res.data);
                                                insTbSSXM.reload({data: xxDataList, page: {curr: 1}});
                                                var bige=true;
                                                for (var j = 0; j < xxDataList.length; j++) {
                                                    if (xxDataList[j].matnr === res.data.matnr && xxDataList[j].batch === res.data.batch) {
                                                        bige=false;
                                                        break;
                                                    }
                                                }
                                                if (bige){
                                                    xxDataList.push(res.data);
                                                    insTbSSXM.reload({data: xxDataList, page: {curr: 1}});
                                                }
                                            } else if (res.code === 403){
                                                top.location.href = baseUrl+"/";
                                            }else {