#
luxiaotao1123
2021-07-29 8c1a2f7deff4081e9d43c4255350917aaddebf89
#
7个文件已添加
4个文件已修改
1247 ■■■■■ 已修改文件
src/main/java/zy/cloud/wms/common/service/erp/ErpService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/zy/cloud/wms/common/service/task/OrderScheduler.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/zy/cloud/wms/common/utils/VersionUtils.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/zy/cloud/wms/manager/controller/PakinController.java 130 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/zy/cloud/wms/manager/entity/Pakin.java 518 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/zy/cloud/wms/manager/mapper/PakinMapper.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/zy/cloud/wms/manager/service/PakinService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/zy/cloud/wms/manager/service/impl/PakinServiceImpl.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/zy/cloud/wms/manager/service/impl/WorkServiceImpl.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/pakin/pakin.js 268 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pakin/pakin.html 230 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/zy/cloud/wms/common/service/erp/ErpService.java
@@ -81,7 +81,7 @@
            try {
                // 日志记录
                RequestLog logInfo = new RequestLog();
                logInfo.setName("单据上传,单据类型" + docId.toString());
                logInfo.setName("单据上传,单据类型" + docId);
                logInfo.setRequest(JSON.toJSONString(uploadBill)); // 入参
                logInfo.setResponse(response); // 出参
                logInfo.setCreateTime(new Date());
src/main/java/zy/cloud/wms/common/service/task/OrderScheduler.java
@@ -47,7 +47,7 @@
            // 保存订单明细历史档
            int saveOrderDetlLog = jdbcTemplate.update("insert into man_order_detl_log select * from man_order_detl where order_id=" + order.getId());
            if (saveOrderDetlLog == 0) {
                throw new CoolException("保存订单明细历史档失败");
//                throw new CoolException("保存订单明细历史档失败");
            }
            // 删除订单
            int delOrder = jdbcTemplate.update("delete from man_order where id=" + order.getId());
@@ -57,7 +57,7 @@
            // 删除订单明细
            int delOrderDetl = jdbcTemplate.update("delete from man_order_detl where order_id=" + order.getId());
            if (delOrderDetl == 0) {
                throw new CoolException("删除订单明细失败");
//                throw new CoolException("删除订单明细失败");
            }
        }
src/main/java/zy/cloud/wms/common/utils/VersionUtils.java
@@ -76,6 +76,21 @@
        pakout.setWeight(mat.getWeight());
    }
    public static void setPakin(Pakin pakin, Mat mat) {
        pakin.setMatnr(mat.getMatnr());
        pakin.setMaktx(mat.getMaktx());
        pakin.setName(mat.getName());
        pakin.setSpecs(mat.getSpecs());
        pakin.setModel(mat.getModel());
        pakin.setBatch(mat.getBatch());
        pakin.setUnit(mat.getUnit());
        pakin.setBarcode(mat.getBarcode());
        pakin.setCustName(mat.getCustName());
        pakin.setItemNum(mat.getItemNum());
        pakin.setCount(mat.getCount());
        pakin.setWeight(mat.getWeight());
    }
    public static void setPakout(Pakout pakout, LocDetl locDetl) {
        pakout.setNodeId(locDetl.getNodeId());
        pakout.setLocNo(locDetl.getLocNo());
src/main/java/zy/cloud/wms/manager/controller/PakinController.java
New file
@@ -0,0 +1,130 @@
package zy.cloud.wms.manager.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.core.annotations.ManagerAuth;
import com.core.common.BaseRes;
import com.core.common.Cools;
import com.core.common.DateUtils;
import com.core.common.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import zy.cloud.wms.common.web.BaseController;
import zy.cloud.wms.manager.entity.Pakin;
import zy.cloud.wms.manager.service.PakinService;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
public class PakinController extends BaseController {
    @Autowired
    private PakinService pakinService;
    @RequestMapping(value = "/pakin/{id}/auth")
    @ManagerAuth
    public R get(@PathVariable("id") String id) {
        return R.ok(pakinService.selectById(String.valueOf(id)));
    }
    @RequestMapping(value = "/pakin/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 Map<String, Object> param){
        EntityWrapper<Pakin> wrapper = new EntityWrapper<>();
        excludeTrash(param);
        convert(param, wrapper);
        if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
        return R.ok(pakinService.selectPage(new Page<>(curr, limit), wrapper));
    }
    private void convert(Map<String, Object> map, EntityWrapper wrapper){
        for (Map.Entry<String, Object> entry : map.entrySet()){
            String val = String.valueOf(entry.getValue());
            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]));
            } else {
                wrapper.like(entry.getKey(), val);
            }
        }
    }
    @RequestMapping(value = "/pakin/add/auth")
    @ManagerAuth
    public R add(Pakin pakin) {
        pakinService.insert(pakin);
        return R.ok();
    }
    @RequestMapping(value = "/pakin/update/auth")
    @ManagerAuth
    public R update(Pakin pakin){
        if (Cools.isEmpty(pakin) || null==pakin.getWrkNo()){
            return R.error();
        }
        pakinService.updateById(pakin);
        return R.ok();
    }
    @RequestMapping(value = "/pakin/delete/auth")
    @ManagerAuth
    public R delete(@RequestParam String param){
        List<Pakin> list = JSONArray.parseArray(param, Pakin.class);
        if (Cools.isEmpty(list)){
            return R.error();
        }
        for (Pakin entity : list){
            pakinService.delete(new EntityWrapper<>(entity));
        }
        return R.ok();
    }
    @RequestMapping(value = "/pakin/export/auth")
    @ManagerAuth
    public R export(@RequestBody JSONObject param){
        EntityWrapper<Pakin> wrapper = new EntityWrapper<>();
        List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class);
        Map<String, Object> map = excludeTrash(param.getJSONObject("pakin"));
        convert(map, wrapper);
        List<Pakin> list = pakinService.selectList(wrapper);
        return R.ok(exportSupport(list, fields));
    }
    @RequestMapping(value = "/pakinQuery/auth")
    @ManagerAuth
    public R query(String condition) {
        EntityWrapper<Pakin> wrapper = new EntityWrapper<>();
        wrapper.like("id", condition);
        Page<Pakin> page = pakinService.selectPage(new Page<>(0, 10), wrapper);
        List<Map<String, Object>> result = new ArrayList<>();
        for (Pakin pakin : page.getRecords()){
            Map<String, Object> map = new HashMap<>();
            map.put("id", pakin.getWrkNo());
            map.put("value", pakin.getWrkNo());
            result.add(map);
        }
        return R.ok(result);
    }
    @RequestMapping(value = "/pakin/check/column/auth")
    @ManagerAuth
    public R query(@RequestBody JSONObject param) {
        Wrapper<Pakin> wrapper = new EntityWrapper<Pakin>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val"));
        if (null != pakinService.selectOne(wrapper)){
            return R.parse(BaseRes.REPEAT).add(getComment(Pakin.class, String.valueOf(param.get("key"))));
        }
        return R.ok();
    }
}
src/main/java/zy/cloud/wms/manager/entity/Pakin.java
New file
@@ -0,0 +1,518 @@
package zy.cloud.wms.manager.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.core.common.Cools;
import com.core.common.SpringUtils;
import io.swagger.annotations.ApiModelProperty;
import zy.cloud.wms.manager.service.WrkStsService;
import zy.cloud.wms.system.entity.User;
import zy.cloud.wms.system.service.UserService;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
@TableName("man_pakin")
public class Pakin implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 任务号
     */
    @ApiModelProperty(value= "任务号")
    @TableField("wrk_no")
    private String wrkNo;
    /**
     * 工作状态
     */
    @ApiModelProperty(value= "工作状态")
    @TableField("wrk_sts")
    private Long wrkSts;
    /**
     * 托盘号
     */
    @ApiModelProperty(value= "托盘号")
    private String zpallet;
    /**
     * 入库数量
     */
    @ApiModelProperty(value= "入库数量")
    @ExcelProperty(value = "入库总量")
    private Double anfme;
    /**
     * 关联货位
     */
    @ApiModelProperty(value= "关联货位")
    @TableField("node_id")
    private Long nodeId;
    /**
     * 货位
     */
    @ApiModelProperty(value= "货位")
    @TableField("loc_no")
    private String locNo;
    /**
     * 商品编码
     */
    @ApiModelProperty(value= "商品编码")
    @ExcelProperty(value = "商品编码")
    private String matnr;
    /**
     * 商品名称
     */
    @ApiModelProperty(value= "商品名称")
    @ExcelProperty(value = "商品名称")
    private String maktx;
    /**
     * 名称
     */
    @ApiModelProperty(value= "名称")
    private String name;
    /**
     * 尺码
     */
    @ApiModelProperty(value= "尺码")
    @ExcelProperty(value = "尺码")
    private String specs;
    /**
     * 型号
     */
    @ApiModelProperty(value= "型号")
    private String model;
    /**
     * 批号
     */
    @ApiModelProperty(value= "批号")
    private String batch;
    /**
     * 单位
     */
    @ApiModelProperty(value= "单位")
    @ExcelProperty(value = "单位")
    private String unit;
    /**
     * SKC
     */
    @ApiModelProperty(value= "SKC")
    @ExcelProperty(value = "SKC")
    private String barcode;
    /**
     * 单据类型
     */
    @ApiModelProperty(value= "单据类型")
    @TableField("doc_id")
    private Long docId;
    /**
     * 单据编号
     */
    @ApiModelProperty(value= "单据编号")
    @TableField("doc_num")
    private String docNum;
    /**
     * 客户名称
     */
    @ApiModelProperty(value= "客户名称")
    @TableField("cust_name")
    private String custName;
    /**
     * 品项数
     */
    @ApiModelProperty(value= "品项数")
    @TableField("item_num")
    private Integer itemNum;
    /**
     * 数量
     */
    @ApiModelProperty(value= "数量")
    private Integer count;
    /**
     * 重量
     */
    @ApiModelProperty(value= "重量")
    private Double weight;
    /**
     * 状态 1: 正常  0: 禁用
     */
    @ApiModelProperty(value= "状态 1: 正常  0: 禁用  ")
    private Integer status;
    /**
     * 添加人员
     */
    @ApiModelProperty(value= "添加人员")
    @TableField("create_by")
    private Long createBy;
    /**
     * 添加时间
     */
    @ApiModelProperty(value= "添加时间")
    @TableField("create_time")
    private Date createTime;
    /**
     * 修改人员
     */
    @ApiModelProperty(value= "修改人员")
    @TableField("update_by")
    private Long updateBy;
    /**
     * 修改时间
     */
    @ApiModelProperty(value= "修改时间")
    @TableField("update_time")
    private Date updateTime;
    /**
     * 备注
     */
    @ApiModelProperty(value= "备注")
    private String memo;
    public Pakin() {}
    public Pakin(String wrkNo, Long wrkSts, String zpallet, Double anfme, Long nodeId, String locNo, String matnr, String maktx, String name, String specs, String model, String batch, String unit, String barcode, Long docId, String docNum, String custName, Integer itemNum, Integer count, Double weight, Integer status, Long createBy, Date createTime, Long updateBy, Date updateTime, String memo) {
        this.wrkNo = wrkNo;
        this.wrkSts = wrkSts;
        this.zpallet = zpallet;
        this.anfme = anfme;
        this.nodeId = nodeId;
        this.locNo = locNo;
        this.matnr = matnr;
        this.maktx = maktx;
        this.name = name;
        this.specs = specs;
        this.model = model;
        this.batch = batch;
        this.unit = unit;
        this.barcode = barcode;
        this.docId = docId;
        this.docNum = docNum;
        this.custName = custName;
        this.itemNum = itemNum;
        this.count = count;
        this.weight = weight;
        this.status = status;
        this.createBy = createBy;
        this.createTime = createTime;
        this.updateBy = updateBy;
        this.updateTime = updateTime;
        this.memo = memo;
    }
//    Pakin pakin = new Pakin(
//            null,    // 任务号[非空]
//            null,    // 工作状态
//            null,    // 托盘号
//            null,    // 入库数量
//            null,    // 关联货位[非空]
//            null,    // 货位[非空]
//            null,    // 商品编码[非空]
//            null,    // 商品名称
//            null,    // 名称
//            null,    // 尺码
//            null,    // 型号
//            null,    // 批号
//            null,    // 单位
//            null,    // SKC
//            null,    // 单据类型
//            null,    // 单据编号
//            null,    // 客户名称
//            null,    // 品项数
//            null,    // 数量
//            null,    // 重量
//            null,    // 状态
//            null,    // 添加人员
//            null,    // 添加时间
//            null,    // 修改人员
//            null,    // 修改时间
//            null    // 备注
//    );
    public String getWrkNo() {
        return wrkNo;
    }
    public void setWrkNo(String wrkNo) {
        this.wrkNo = wrkNo;
    }
    public Long getWrkSts() {
        return wrkSts;
    }
    public String getWrkSts$(){
        WrkStsService service = SpringUtils.getBean(WrkStsService.class);
        WrkSts wrkSts = service.selectById(this.wrkSts);
        if (!Cools.isEmpty(wrkSts)){
            return String.valueOf(wrkSts.getStsName());
        }
        return null;
    }
    public void setWrkSts(Long wrkSts) {
        this.wrkSts = wrkSts;
    }
    public String getZpallet() {
        return zpallet;
    }
    public void setZpallet(String zpallet) {
        this.zpallet = zpallet;
    }
    public Double getAnfme() {
        return anfme;
    }
    public void setAnfme(Double anfme) {
        this.anfme = anfme;
    }
    public Long getNodeId() {
        return nodeId;
    }
    public void setNodeId(Long nodeId) {
        this.nodeId = nodeId;
    }
    public String getLocNo() {
        return locNo;
    }
    public void setLocNo(String locNo) {
        this.locNo = locNo;
    }
    public String getMatnr() {
        return matnr;
    }
    public void setMatnr(String matnr) {
        this.matnr = matnr;
    }
    public String getMaktx() {
        return maktx;
    }
    public void setMaktx(String maktx) {
        this.maktx = maktx;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getSpecs() {
        return specs;
    }
    public void setSpecs(String specs) {
        this.specs = specs;
    }
    public String getModel() {
        return model;
    }
    public void setModel(String model) {
        this.model = model;
    }
    public String getBatch() {
        return batch;
    }
    public void setBatch(String batch) {
        this.batch = batch;
    }
    public String getUnit() {
        return unit;
    }
    public void setUnit(String unit) {
        this.unit = unit;
    }
    public String getBarcode() {
        return barcode;
    }
    public void setBarcode(String barcode) {
        this.barcode = barcode;
    }
    public Long getDocId() {
        return docId;
    }
    public void setDocId(Long docId) {
        this.docId = docId;
    }
    public String getDocNum() {
        return docNum;
    }
    public void setDocNum(String docNum) {
        this.docNum = docNum;
    }
    public String getCustName() {
        return custName;
    }
    public void setCustName(String custName) {
        this.custName = custName;
    }
    public Integer getItemNum() {
        return itemNum;
    }
    public void setItemNum(Integer itemNum) {
        this.itemNum = itemNum;
    }
    public Integer getCount() {
        return count;
    }
    public void setCount(Integer count) {
        this.count = count;
    }
    public Double getWeight() {
        return weight;
    }
    public void setWeight(Double weight) {
        this.weight = weight;
    }
    public Integer getStatus() {
        return status;
    }
    public String getStatus$(){
        if (null == this.status){ return null; }
        switch (this.status){
            case 1:
                return "正常";
            case 0:
                return "禁用";
            default:
                return String.valueOf(this.status);
        }
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    public Long getCreateBy() {
        return createBy;
    }
    public String getCreateBy$(){
        UserService service = SpringUtils.getBean(UserService.class);
        User user = service.selectById(this.createBy);
        if (!Cools.isEmpty(user)){
            return String.valueOf(user.getNickname());
        }
        return null;
    }
    public void setCreateBy(Long createBy) {
        this.createBy = createBy;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public String getCreateTime$(){
        if (Cools.isEmpty(this.createTime)){
            return "";
        }
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime);
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Long getUpdateBy() {
        return updateBy;
    }
    public String getUpdateBy$(){
        UserService service = SpringUtils.getBean(UserService.class);
        User user = service.selectById(this.updateBy);
        if (!Cools.isEmpty(user)){
            return String.valueOf(user.getNickname());
        }
        return null;
    }
    public void setUpdateBy(Long updateBy) {
        this.updateBy = updateBy;
    }
    public Date getUpdateTime() {
        return updateTime;
    }
    public String getUpdateTime$(){
        if (Cools.isEmpty(this.updateTime)){
            return "";
        }
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime);
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    public String getMemo() {
        return memo;
    }
    public void setMemo(String memo) {
        this.memo = memo;
    }
}
src/main/java/zy/cloud/wms/manager/mapper/PakinMapper.java
New file
@@ -0,0 +1,17 @@
package zy.cloud.wms.manager.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import zy.cloud.wms.manager.entity.Pakin;
import java.util.List;
import java.util.Map;
@Mapper
@Repository
public interface PakinMapper extends BaseMapper<Pakin> {
}
src/main/java/zy/cloud/wms/manager/service/PakinService.java
New file
@@ -0,0 +1,12 @@
package zy.cloud.wms.manager.service;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import zy.cloud.wms.manager.entity.Pakin;
import java.util.List;
public interface PakinService extends IService<Pakin> {
}
src/main/java/zy/cloud/wms/manager/service/impl/PakinServiceImpl.java
New file
@@ -0,0 +1,16 @@
package zy.cloud.wms.manager.service.impl;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import zy.cloud.wms.manager.entity.Pakin;
import zy.cloud.wms.manager.mapper.PakinMapper;
import zy.cloud.wms.manager.service.PakinService;
import java.util.List;
@Service("pakinService")
public class PakinServiceImpl extends ServiceImpl<PakinMapper, Pakin> implements PakinService {
}
src/main/java/zy/cloud/wms/manager/service/impl/WorkServiceImpl.java
@@ -62,6 +62,8 @@
    private ErpService erpService;
    @Autowired
    private AsrsService asrsService;
    @Autowired
    private PakinService pakinService;
    @Override
    @Transactional
@@ -98,6 +100,39 @@
            if (mat == null) {
                throw new CoolException("物料数据错误,请联系管理员");
            }
            // 保存入库记录
            Pakin pakin = new Pakin(
                    "I" + String.valueOf(snowflakeIdWorker.nextId()),    // 任务号[非空]
                    null,    // 工作状态
                    null,    // 托盘号
                    dto.getCount(),    // 入库数量
                    node.getId(),    // 关联货位[非空]
                    node.getUuid(),    // 货位[非空]
                    mat.getMatnr(),    // 商品编码[非空]
                    null,    // 商品名称
                    null,    // 名称
                    null,    // 尺码
                    null,    // 型号
                    null,    // 批号
                    null,    // 单位
                    null,    // SKC
                    null,    // 单据类型
                    null,    // 单据编号
                    null,    // 客户名称
                    null,    // 品项数
                    null,    // 数量
                    null,    // 重量
                    1,    // 状态
                    userId,    // 添加人员
                    now,    // 添加时间
                    userId,    // 修改人员
                    now,    // 修改时间
                    null    // 备注
            );
            VersionUtils.setPakin(pakin, mat);
            if (!pakinService.insert(pakin)) {
                throw new CoolException("保存入库记录失败");
            }
            LocDetl locDetl = locDetlService.getLocDetl(node.getId(), dto.getMatnr());
            if (locDetl == null) {
                // 更新货位库存明细
src/main/webapp/static/js/pakin/pakin.js
New file
@@ -0,0 +1,268 @@
var pageCurr;
layui.config({
    base: baseUrl + "/static/layui/lay/modules/"
}).use(['table','laydate', 'form', 'admin'], function(){
    var table = layui.table;
    var $ = layui.jquery;
    var layer = layui.layer;
    var layDate = layui.laydate;
    var form = layui.form;
    var admin = layui.admin;
    // 数据渲染
    tableIns = table.render({
        elem: '#pakin',
        headers: {token: localStorage.getItem('token')},
        url: baseUrl+'/pakin/list/auth',
        page: true,
        limit: 16,
        limits: [16, 30, 50, 100, 200, 500],
        toolbar: '#toolbar',
        cellMinWidth: 50,
        cols: [[
            {type: 'checkbox'}
            ,{field: 'wrkNo', align: 'center',title: '任务号'}
            ,{field: 'wrkSts$', align: 'center',title: '工作状态',event: 'wrkSts', style: 'cursor:pointer'}
            ,{field: 'zpallet', align: 'center',title: '托盘号'}
            ,{field: 'anfme', align: 'center',title: '出库数量'}
            ,{field: 'nodeId', align: 'center',title: '关联货位'}
            ,{field: 'locNo', align: 'center',title: '货位'}
            ,{field: 'matnr', align: 'center',title: '商品编码'}
            ,{field: 'maktx', align: 'center',title: '商品名称'}
            ,{field: 'name', align: 'center',title: '名称'}
            ,{field: 'specs', align: 'center',title: '尺码'}
            ,{field: 'model', align: 'center',title: '型号'}
            ,{field: 'batch', align: 'center',title: '批号'}
            ,{field: 'unit', align: 'center',title: '单位'}
            ,{field: 'barcode', align: 'center',title: 'SKC'}
            ,{field: 'docId', align: 'center',title: '单据类型'}
            ,{field: 'docNum', align: 'center',title: '单据编号'}
            ,{field: 'custName', align: 'center',title: '客户名称'}
            ,{field: 'itemNum', align: 'center',title: '品项数'}
            ,{field: 'count', align: 'center',title: '数量'}
            ,{field: 'weight', align: 'center',title: '重量'}
            ,{field: 'status$', align: 'center',title: '状态'}
            ,{field: 'createBy$', align: 'center',title: '添加人员',event: 'createBy', style: 'cursor:pointer'}
            ,{field: 'createTime$', align: 'center',title: '添加时间'}
            ,{field: 'updateBy$', align: 'center',title: '修改人员',event: 'updateBy', style: 'cursor:pointer'}
            ,{field: 'updateTime$', align: 'center',title: '修改时间'}
            ,{field: 'memo', align: 'center',title: '备注'}
            ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150}
        ]],
        request: {
            pageName: 'curr',
            pageSize: 'limit'
        },
        parseData: function (res) {
            return {
                'code': res.code,
                'msg': res.msg,
                'count': res.data.total,
                'data': res.data.records
            }
        },
        response: {
            statusCode: 200
        },
        done: function(res, curr, count) {
            if (res.code === 403) {
                top.location.href = baseUrl+"/";
            }
            pageCurr=curr;
            limit();
        }
    });
    // 监听排序事件
    table.on('sort(pakin)', function (obj) {
        var searchData = {};
        $.each($('#search-box [name]').serializeArray(), function() {
            searchData[this.name] = this.value;
        });
        searchData['orderByField'] = obj.field;
        searchData['orderByType'] = obj.type;
        tableIns.reload({
            where: searchData,
            page: {curr: 1}
        });
    });
    // 监听头工具栏事件
    table.on('toolbar(pakin)', function (obj) {
        var checkStatus = table.checkStatus(obj.config.id);
        switch(obj.event) {
            case 'addData':
                showEditModel();
                break;
            case 'deleteData':
               if (checkStatus.length === 0) {
                   layer.msg('请选择要删除的数据', {icon: 2});
                   return;
               }
               var ids = checkStatus.map(function (d) {
                   return d.id;
               });
               del(ids);
               break;
            case 'exportData':
                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);
                            fields.push(col.field);
                        }
                    });
                    var exportData = {};
                    $.each($('#search-box [name]').serializeArray(), function() {
                        exportData[this.name] = this.value;
                    });
                    var param = {
                        'pakin': exportData,
                        'fields': fields
                    };
                    $.ajax({
                        url: baseUrl+"/pakin/export/auth",
                        headers: {'token': localStorage.getItem('token')},
                        data: JSON.stringify(param),
                        dataType:'json',
                        contentType:'application/json;charset=UTF-8',
                        method: 'POST',
                        success: function (res) {
                            layer.closeAll();
                            if (res.code === 200) {
                                table.exportFile(titles,res.data,'xls');
                            } else if (res.code === 403) {
                                top.location.href = baseUrl+"/";
                            } else {
                                layer.msg(res.msg, {icon: 2})
                            }
                        }
                    });
                });
                break;
        }
    });
    // 监听行工具事件
    table.on('tool(pakin)', function(obj){
        var data = obj.data;
        switch (obj.event) {
            case 'edit':
                showEditModel(data);
                break;
            case "del":
                var ids = [data.id];
                del(ids);
                break;
        }
    });
    /* 弹窗 - 新增、修改 */
    function showEditModel(mData) {
        admin.open({
            type: 1,
            area: '600px',
            title: (mData ? '修改' : '添加') + '订单状态',
            content: $('#editDialog').html(),
            success: function (layero, dIndex) {
                form.val('detail', mData);
                form.on('submit(editSubmit)', function (data) {
                    var loadIndex = layer.load(2);
                    $.ajax({
                        url: baseUrl+"/pakin/"+(mData?'update':'add')+"/auth",
                        headers: {'token': localStorage.getItem('token')},
                        data: data.field,
                        method: 'POST',
                        success: function (res) {
                            layer.close(loadIndex);
                            if (res.code === 200){
                                layer.close(dIndex);
                                layer.msg(res.msg, {icon: 1});
                                tableReload();
                            } else if (res.code === 403){
                                top.location.href = baseUrl+"/";
                            }else {
                                layer.msg(res.msg, {icon: 2});
                            }
                        }
                    })
                    return false;
                });
                $(layero).children('.layui-layer-content').css('overflow', 'visible');
                layui.form.render('select');
            }
        });
    }
    /* 删除 */
    function del(ids) {
        layer.confirm('确定要删除选中数据吗?', {
            skin: 'layui-layer-admin',
            shade: .1
        }, function (i) {
            layer.close(i);
            var loadIndex = layer.load(2);
            $.ajax({
                url: baseUrl+"/pakin/delete/auth",
                headers: {'token': localStorage.getItem('token')},
                data: {ids: ids},
                method: 'POST',
                success: function (res) {
                    layer.close(loadIndex);
                    if (res.code === 200){
                        layer.msg(res.msg, {icon: 1});
                        tableReload();
                    } else if (res.code === 403){
                        top.location.href = baseUrl+"/";
                    } else {
                        layer.msg(res.msg, {icon: 2});
                    }
                }
            })
        });
    }
    // 搜索
    form.on('submit(search)', function (data) {
        pageCurr = 1;
        tableReload(false);
    });
    // 重置
    form.on('submit(reset)', function (data) {
        pageCurr = 1;
        clearFormVal($('#search-box'));
        tableReload(false);
    });
    // 时间选择器
    layDate.render({
        elem: '#createTime\\$',
        type: 'datetime'
    });
    layDate.render({
        elem: '#updateTime\\$',
        type: 'datetime'
    });
});
// 关闭动作
$(document).on('click','#data-detail-close', function () {
    parent.layer.closeAll();
});
function tableReload(child) {
    var searchData = {};
    $.each($('#search-box [name]').serializeArray(), function() {
        searchData[this.name] = this.value;
    });
    tableIns.reload({
        where: searchData,
        page: {curr: pageCurr}
     });
}
src/main/webapp/views/pakin/pakin.html
New file
@@ -0,0 +1,230 @@
<!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" media="all">
    <link rel="stylesheet" href="../../static/css/cool.css" media="all">
    <link rel="stylesheet" href="../../static/css/common.css" media="all">
</head>
<body>
<!-- 搜索栏 -->
<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="id" placeholder="编号" autocomplete="off">
        </div>
    </div>
    <!-- 待添加 -->
    <div id="data-search-btn" class="layui-btn-container layui-form-item">
        <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索</button>
        <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset">重置</button>
    </div>
</div>
<!-- 表格 -->
<div class="layui-form">
    <table class="layui-hide" id="pakin" lay-filter="pakin"></table>
</div>
<script type="text/html" id="toolbar">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button>
        <button class="layui-btn layui-btn-sm" id="btn-delete" lay-event="deleteData">删除</button>
        <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData">导出</button>
    </div>
</script>
<script type="text/html" id="operate">
    <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">修改</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">删除</a>
</script>
<script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script>
<script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script>
<script type="text/javascript" src="../../static/js/pakin/pakin.js" charset="utf-8"></script>
</body>
<!-- 表单弹窗 -->
<script type="text/html" id="editDialog">
    <form id="detail" lay-filter="detail" class="layui-form admin-form">
        <input name="id" type="hidden">
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">任务号: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="wrkNo" placeholder="请输入任务号" lay-vertype="tips" lay-verify="required">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">工作状态: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="wrkSts" placeholder="请输入工作状态">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">托盘号: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="zpallet" placeholder="请输入托盘号">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">出库数量: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="anfme" placeholder="请输入出库数量">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">关联货位: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="nodeId" placeholder="请输入关联货位" lay-vertype="tips" lay-verify="required">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">货位: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="locNo" placeholder="请输入货位" lay-vertype="tips" lay-verify="required">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">商品编码: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="matnr" placeholder="请输入商品编码" lay-vertype="tips" lay-verify="required">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">商品名称: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="maktx" placeholder="请输入商品名称">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">名称: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="name" placeholder="请输入名称">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">尺码: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="specs" placeholder="请输入尺码">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">型号: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="model" placeholder="请输入型号">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">批号: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="batch" placeholder="请输入批号">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">单位: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="unit" placeholder="请输入单位">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">SKC: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="barcode" placeholder="请输入SKC">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">单据类型: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="docId" placeholder="请输入单据类型">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">单据编号: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="docNum" placeholder="请输入单据编号">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">客户名称: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="custName" placeholder="请输入客户名称">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">品项数: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="itemNum" placeholder="请输入品项数">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">数量: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="count" placeholder="请输入数量">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">重量: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="weight" placeholder="请输入重量">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">状态: </label>
                    <div class="layui-input-block">
                        <select name="status">
                            <option value="">请选择状态</option>
                            <option value="1">正常</option>
                            <option value="0">禁用</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">添加人员: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="createBy" placeholder="请输入添加人员">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">添加时间: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="createTime" placeholder="请输入添加时间">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">修改人员: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="updateBy" placeholder="请输入修改人员">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">修改时间: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="updateTime" placeholder="请输入修改时间">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">备注: </label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="memo" placeholder="请输入备注">
                    </div>
                </div>
             </div>
        </div>
        <hr class="layui-bg-gray">
        <div class="layui-form-item text-right">
            <button class="layui-btn" lay-filter="editSubmit" lay-submit="">保存</button>
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button>
        </div>
    </form>
</script>
</html>