New file |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | 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.*; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.MatPrint; |
| | | import com.zy.asrs.entity.result.KeyValueVo; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.asrs.utils.MatExcelListener; |
| | | import com.zy.common.CodeRes; |
| | | import com.zy.common.config.AdminInterceptor; |
| | | import com.zy.common.entity.MatExcel; |
| | | import com.zy.common.utils.BarcodeUtils; |
| | | import com.zy.common.utils.QrCode; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class MatController extends BaseController { |
| | | |
| | | @Autowired |
| | | private MatService matService; |
| | | @Autowired |
| | | private SnowflakeIdWorker snowflakeIdWorker; |
| | | |
| | | @RequestMapping(value = "/mat/auto/matnr/auth") |
| | | public R autoMatnr(){ |
| | | return R.ok().add("YJ" + DateUtils.convert(new Date(), DateUtils.yyyyMMddHHmmsssss).substring(0, 16)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/mat/list/pda/auth") |
| | | @ManagerAuth |
| | | public R pdaList(@RequestParam(required = true)Long tagId){ |
| | | EntityWrapper<Mat> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("tag_id", tagId); |
| | | wrapper.orderBy("create_time", false); |
| | | List<Mat> mats = matService.selectList(wrapper); |
| | | return R.ok().add(mats); |
| | | } |
| | | |
| | | @RequestMapping(value = "/mat/search/pda/auth") |
| | | @ManagerAuth |
| | | public R pdaSearch(@RequestParam(required = false)String condition){ |
| | | EntityWrapper<Mat> wrapper = new EntityWrapper<>(); |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.like("matnr", condition).or().like("maktx", condition); |
| | | } |
| | | wrapper.orderBy("create_time", false); |
| | | List<Mat> mats = matService.selectList(wrapper); |
| | | return R.ok().add(mats); |
| | | } |
| | | |
| | | @RequestMapping(value = "/mat/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(matService.selectById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/matCode/auth0") |
| | | @ManagerAuth |
| | | public R find(@RequestParam("matnr") String matnr) { |
| | | return R.ok(matService.selectOne(new EntityWrapper<Mat>().eq("matnr", matnr))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/mat/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){ |
| | | Object tagId = param.get("tag_id"); |
| | | if (Cools.isEmpty(tagId)) { |
| | | tagId = getOriginTag().getId(); |
| | | } |
| | | return R.ok(matService.getPage(new Page<>(curr, limit) |
| | | , String.valueOf(tagId) |
| | | , param.get("matnr") |
| | | , param.get("maktx")) |
| | | ); |
| | | |
| | | } |
| | | |
| | | 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 = "/mat/add/auth") |
| | | @ManagerAuth |
| | | public R add(Mat mat) { |
| | | if (null != matService.selectByMatnr(mat.getMatnr())) { |
| | | return R.error("编号已存在"); |
| | | } |
| | | Date now = new Date(); |
| | | mat.setCreateBy(getUserId()); |
| | | mat.setCreateTime(now); |
| | | mat.setUpdateBy(getUserId()); |
| | | mat.setUpdateTime(now); |
| | | mat.setStatus(1); |
| | | if (!matService.insert(mat)) { |
| | | throw new CoolException("添加失败,请联系管理员"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/mat/update/auth") |
| | | @ManagerAuth |
| | | public R update(Mat mat){ |
| | | if (Cools.isEmpty(mat) || null==mat.getId()){ |
| | | return R.error(); |
| | | } |
| | | mat.setUpdateBy(getUserId()); |
| | | mat.setUpdateTime(new Date()); |
| | | matService.updateById(mat); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/mat/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam String param){ |
| | | List<Mat> list = JSONArray.parseArray(param, Mat.class); |
| | | if (Cools.isEmpty(list)){ |
| | | return R.error(); |
| | | } |
| | | for (Mat entity : list){ |
| | | if (!matService.delete(new EntityWrapper<>(entity))) { |
| | | throw new CoolException("删除失败,请联系管理员"); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/mat/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<Mat> wrapper = new EntityWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("mat")); |
| | | convert(map, wrapper); |
| | | List<Mat> list = matService.selectList(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/matQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<Mat> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("matnr", condition).or().like("maktx", condition); |
| | | Page<Mat> page = matService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (Mat mat : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", mat.getId()); |
| | | map.put("value", mat.getMatnr() + "(" + mat.getMaktx() + ")"); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/mat/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<Mat> wrapper = new EntityWrapper<Mat>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != matService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(Mat.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /*************************************** 打印相关 ***********************************************/ |
| | | |
| | | @RequestMapping(value = "/mac/code/auth") |
| | | // @ManagerAuth(memo = "物料编码条形码获取(type:1(条形码);2(二维码)") |
| | | public R matCodeBarcode(@RequestParam(defaultValue = "1") Integer type |
| | | , @RequestParam String param |
| | | , HttpServletResponse response) throws Exception { |
| | | AdminInterceptor.cors(response); |
| | | if (Cools.isEmpty(param)){ |
| | | return R.parse(BaseRes.EMPTY); |
| | | } |
| | | BufferedImage img; |
| | | if (type == 1) { |
| | | img = BarcodeUtils.encode(param); |
| | | } else { |
| | | img = QrCode.createImg(param); |
| | | } |
| | | if (!ImageIO.write(img, "jpg", response.getOutputStream())) { |
| | | throw new IOException("Could not write an image of format jpg"); |
| | | } |
| | | response.getOutputStream().flush(); |
| | | response.getOutputStream().close(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | // 打印 |
| | | @RequestMapping(value = "/mat/print/auth") |
| | | @ManagerAuth(memo = "商品编码打印") |
| | | public R matCodePrint(@RequestParam(value = "param[]") String[] param) { |
| | | if(Cools.isEmpty(param)) { |
| | | return R.parse(CodeRes.EMPTY); |
| | | } |
| | | List<MatPrint> res = new ArrayList<>(); |
| | | for (String matnr : param){ |
| | | Mat mat = matService.selectByMatnr(matnr); |
| | | // 打印数据注入 |
| | | MatPrint print = new MatPrint(); |
| | | print.setMatnr(mat.getMatnr()); |
| | | print.setBarcode(mat.getBarcode()); |
| | | print.setMaktx(mat.getMaktx()); |
| | | print.setSpecs(mat.getSpecs()); |
| | | print.setUnit(mat.getUnit()); |
| | | print.setMemo(mat.getMemo()); |
| | | res.add(print); |
| | | } |
| | | return R.ok().add(res); |
| | | } |
| | | |
| | | |
| | | /*************************************** 数据相关 ***********************************************/ |
| | | |
| | | /** |
| | | * excel导入模板下载 |
| | | */ |
| | | @RequestMapping(value = "/mat/excel/import/mould") |
| | | public void matExcelImportMould(HttpServletResponse response) throws IOException { |
| | | List<MatExcel> excels = new ArrayList<>(); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | String fileName = URLEncoder.encode("商品档案Excel导入模板", "UTF-8"); |
| | | response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); |
| | | EasyExcel.write(response.getOutputStream(), MatExcel.class) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .sheet("sheet1") |
| | | .doWrite(excels); |
| | | } |
| | | |
| | | // excel导入 |
| | | @PostMapping(value = "/mat/excel/import/auth") |
| | | @ManagerAuth(memo = "商品档案数据导入") |
| | | @Transactional |
| | | public R matExcelImport(MultipartFile file) throws IOException { |
| | | MatExcelListener listener = new MatExcelListener(getUserId()); |
| | | EasyExcel.read(file.getInputStream(), MatExcel.class, listener).sheet().doRead(); |
| | | return R.ok("成功同步"+listener.getTotal()+"条商品数据"); |
| | | } |
| | | |
| | | /*************************************** xm-select ***********************************************/ |
| | | |
| | | // xm-select 搜索商品列表 |
| | | @RequestMapping("/mat/all/get/kv0") // todo:luxiaotao |
| | | @ManagerAuth |
| | | public R getMatDataKV(@RequestParam(required = false) String condition) { |
| | | Wrapper<Mat> wrapper = new EntityWrapper<Mat>() |
| | | .andNew().like("matnr", condition).or().like("maktx", condition) |
| | | .orderBy("create_time", false); |
| | | List<Mat> mats = matService.selectPage(new Page<>(1, 30), wrapper).getRecords(); |
| | | List<KeyValueVo> valueVos = new ArrayList<>(); |
| | | for (Mat mat : mats) { |
| | | KeyValueVo vo = new KeyValueVo(); |
| | | vo.setName(mat.getMatnr() + " - " + mat.getMaktx()); |
| | | vo.setValue(mat.getId()); |
| | | valueVos.add(vo); |
| | | } |
| | | return R.ok().add(valueVos); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | 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 com.zy.asrs.entity.Tag; |
| | | import com.zy.asrs.service.TagService; |
| | | import com.zy.common.utils.ListUtils; |
| | | import com.zy.common.utils.NodeUtils; |
| | | import com.zy.common.utils.TreeUtils; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class TagController extends BaseController { |
| | | |
| | | @Autowired |
| | | private TagService tagService; |
| | | @Autowired |
| | | private TreeUtils treeUtils; |
| | | |
| | | @RequestMapping(value = "/tag/list/pda/auth") |
| | | @ManagerAuth |
| | | public R pdaList(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)Long parentId){ |
| | | EntityWrapper<Tag> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("parent_id", parentId==null?getOriginTag().getId():parentId); |
| | | wrapper.orderBy("sort"); |
| | | List<Tag> tags = tagService.selectList(wrapper); |
| | | return R.ok().add(tags); |
| | | } |
| | | |
| | | @RequestMapping(value = "/tag/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(tagService.selectById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/tag/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<Tag> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.parse("0-操作成功").add(tagService.selectList(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 = "/tag/add/auth") |
| | | @ManagerAuth |
| | | public R add(Tag tag) { |
| | | tag.setLevel(1); |
| | | if (tag.getParentId() != null && tag.getParentId() > 0) { |
| | | Tag parent = tagService.selectById(tag.getParentId()); |
| | | if (parent != null) { |
| | | tag.setParentName(parent.getName()); |
| | | tag.setLevel(parent.getLevel() + 1); |
| | | } |
| | | } else { |
| | | tag.setParentId(0L); |
| | | } |
| | | // path |
| | | NodeUtils nodeUtils = new NodeUtils(); |
| | | nodeUtils.executePath(tag); |
| | | tag.setPath(nodeUtils.path.toString()); |
| | | tag.setPathName(nodeUtils.pathName.toString()); |
| | | |
| | | tag.setCreateBy(getUserId()); |
| | | tag.setCreateTime(new Date()); |
| | | tag.setUpdateBy(getUserId()); |
| | | tag.setUpdateTime(new Date()); |
| | | tag.setStatus(1); |
| | | tagService.insert(tag); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/tag/update/auth") |
| | | @ManagerAuth |
| | | public R update(Tag tag){ |
| | | if (Cools.isEmpty(tag) || null==tag.getId()){ |
| | | return R.error(); |
| | | } |
| | | if (tag.getParentId() != null && tag.getParentId() > 0) { |
| | | if (tag.getParentId().equals(tag.getId())) { |
| | | return R.error("数据错误"); |
| | | } |
| | | Tag parent = tagService.selectById(tag.getParentId()); |
| | | if (parent != null) { |
| | | tag.setParentName(parent.getName()); |
| | | tag.setLevel(parent.getLevel() + 1); |
| | | } |
| | | } |
| | | // path |
| | | NodeUtils nodeUtils = new NodeUtils(); |
| | | nodeUtils.executePath(tag); |
| | | tag.setPath(nodeUtils.path.toString()); |
| | | tag.setPathName(nodeUtils.pathName.toString()); |
| | | tag.setUpdateBy(getUserId()); |
| | | tag.setUpdateTime(new Date()); |
| | | tagService.updateById(tag); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/tag/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | for (Long id : ids){ |
| | | tagService.deleteById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/tag/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<Tag> wrapper = new EntityWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("tag")); |
| | | convert(map, wrapper); |
| | | List<Tag> list = tagService.selectList(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/tagQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<Tag> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("uuid", condition).or().like("name", condition); |
| | | Page<Tag> page = tagService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (Tag tag : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", tag.getId()); |
| | | map.put("value", tag.getName()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/tag/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<Tag> wrapper = new EntityWrapper<Tag>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != tagService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(Tag.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping(value = "/tag/tree/auth") |
| | | @ManagerAuth |
| | | public R tree(@RequestParam(required = false, defaultValue = "") String condition) throws IOException, ClassNotFoundException { |
| | | ArrayList<Map> tree = treeUtils.getTree(String.valueOf(getOriginTag().getId())); |
| | | // 深拷贝 |
| | | List<Map> result = ListUtils.deepCopy(tree); |
| | | if (!Cools.isEmpty(condition)) { |
| | | treeUtils.remove(condition, result); |
| | | treeUtils.remove(condition, result); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.TagService; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.UserService; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("man_mat") |
| | | public class Mat implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableField(exist = false) |
| | | private Double stock; |
| | | |
| | | public Double getStock() { |
| | | return stock; |
| | | } |
| | | |
| | | public void setStock(Double stock) { |
| | | this.stock = stock; |
| | | } |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value= "ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 编号 |
| | | */ |
| | | @ApiModelProperty(value= "编号") |
| | | private String uuid; |
| | | |
| | | /** |
| | | * 所属区域 |
| | | */ |
| | | @ApiModelProperty(value= "所属区域") |
| | | @TableField("node_id") |
| | | private Long nodeId; |
| | | |
| | | /** |
| | | * 所属归类 |
| | | */ |
| | | @ApiModelProperty(value= "所属归类") |
| | | @TableField("tag_id") |
| | | private Long tagId; |
| | | |
| | | /** |
| | | * 商品编号 |
| | | */ |
| | | @ExcelProperty(index = 2, value = "商品编号") |
| | | @ApiModelProperty(value= "商品编号") |
| | | private String matnr; |
| | | |
| | | /** |
| | | * 商品名称 |
| | | */ |
| | | @ExcelProperty(index = 3, value = "商品名称") |
| | | @ApiModelProperty(value= "商品名称") |
| | | private String maktx; |
| | | |
| | | /** |
| | | * 名称 |
| | | */ |
| | | @ApiModelProperty(value= "名称") |
| | | private String name; |
| | | |
| | | /** |
| | | * 规格 |
| | | */ |
| | | @ExcelProperty(index = 4, value = "规格") |
| | | @ApiModelProperty(value= "规格") |
| | | private String specs; |
| | | |
| | | /** |
| | | * 型号 |
| | | */ |
| | | @ExcelProperty(index = 5, value = "型号") |
| | | @ApiModelProperty(value= "型号") |
| | | private String model; |
| | | |
| | | /** |
| | | * 批号 |
| | | */ |
| | | @ExcelProperty(index = 6, value = "批号") |
| | | @ApiModelProperty(value= "批号") |
| | | private String batch; |
| | | |
| | | /** |
| | | * 单位 |
| | | */ |
| | | @ExcelProperty(index = 7, value = "单位") |
| | | @ApiModelProperty(value= "单位") |
| | | private String unit; |
| | | |
| | | /** |
| | | * SKC |
| | | */ |
| | | @ExcelProperty(index = 8, value = "SKC") |
| | | @ApiModelProperty(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; |
| | | |
| | | /** |
| | | * 单价 |
| | | */ |
| | | @ExcelProperty(index = 9, value = "单价") |
| | | @ApiModelProperty(value= "单价") |
| | | private Double price; |
| | | |
| | | /** |
| | | * 重量 |
| | | */ |
| | | @ExcelProperty(index = 10, value = "重量") |
| | | @ApiModelProperty(value= "重量") |
| | | private Double weight; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | 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; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ExcelProperty(index = 11, value = "备注") |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | public Mat() {} |
| | | |
| | | public Mat(String uuid,Long nodeId,Long tagId,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.uuid = uuid; |
| | | this.nodeId = nodeId; |
| | | this.tagId = tagId; |
| | | 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; |
| | | } |
| | | |
| | | // Mat mat = new Mat( |
| | | // 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 getTagId$(){ |
| | | TagService service = SpringUtils.getBean(TagService.class); |
| | | Tag tag = service.selectById(this.tagId); |
| | | if (!Cools.isEmpty(tag)){ |
| | | return String.valueOf(tag.getName()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | 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 String getCreateTime$(){ |
| | | if (Cools.isEmpty(this.createTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.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 String getUpdateTime$(){ |
| | | if (Cools.isEmpty(this.updateTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * Created by vincent on 2020/6/8 |
| | | */ |
| | | @Data |
| | | public class MatPrint { |
| | | |
| | | /** |
| | | * 物料编码 |
| | | */ |
| | | private String matnr; |
| | | |
| | | /** |
| | | * SKC |
| | | */ |
| | | private String barcode; |
| | | |
| | | /** |
| | | * 物料名称 |
| | | */ |
| | | private String maktx; |
| | | |
| | | /** |
| | | * 物料单位 |
| | | */ |
| | | private String unit; |
| | | |
| | | /** |
| | | * 物料规格 |
| | | */ |
| | | private String specs; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String memo; |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.UserService; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | @TableName("man_tag") |
| | | public class Tag implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value= "ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 编号 |
| | | */ |
| | | @ApiModelProperty(value= "编号") |
| | | private String uuid; |
| | | |
| | | /** |
| | | * 名称 |
| | | */ |
| | | @ApiModelProperty(value= "名称") |
| | | private String name; |
| | | |
| | | /** |
| | | * 父级 |
| | | */ |
| | | @ApiModelProperty(value= "父级") |
| | | @TableField("parent_id") |
| | | private Long parentId; |
| | | |
| | | /** |
| | | * 父级名称 |
| | | */ |
| | | @ApiModelProperty(value= "父级名称") |
| | | @TableField("parent_name") |
| | | private String parentName; |
| | | |
| | | /** |
| | | * 关联路径 |
| | | */ |
| | | @ApiModelProperty(value= "关联路径") |
| | | private String path; |
| | | |
| | | /** |
| | | * 关联路径名 |
| | | */ |
| | | @ApiModelProperty(value= "关联路径名") |
| | | @TableField("path_name") |
| | | private String pathName; |
| | | |
| | | /** |
| | | * 类型 1: 盒装 2: 袋装 0: 其他 |
| | | */ |
| | | @ApiModelProperty(value= "类型 1: 盒装 2: 袋装 0: 其他 ") |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 负责人 |
| | | */ |
| | | @ApiModelProperty(value= "负责人") |
| | | private String leading; |
| | | |
| | | /** |
| | | * 图片 |
| | | */ |
| | | @ApiModelProperty(value= "图片") |
| | | private String img; |
| | | |
| | | /** |
| | | * 简要描述 |
| | | */ |
| | | @ApiModelProperty(value= "简要描述") |
| | | private String brief; |
| | | |
| | | /** |
| | | * 数量 |
| | | */ |
| | | @ApiModelProperty(value= "数量") |
| | | private Integer count; |
| | | |
| | | /** |
| | | * 等级 |
| | | */ |
| | | @ApiModelProperty(value= "等级") |
| | | private Integer level; |
| | | |
| | | /** |
| | | * 排序 |
| | | */ |
| | | @ApiModelProperty(value= "排序") |
| | | private Integer sort; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 禁用 |
| | | */ |
| | | @ApiModelProperty(value= "状态 1: 正常 0: 禁用 ") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @ApiModelProperty(value= "添加时间") |
| | | @TableField("create_time") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 添加人员 |
| | | */ |
| | | @ApiModelProperty(value= "添加人员") |
| | | @TableField("create_by") |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @TableField("update_time") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | @TableField("update_by") |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | public Tag() {} |
| | | |
| | | public Tag(String uuid,String name,Long parentId,String parentName,String path,String pathName,Integer type,String leading,String img,String brief,Integer count,Integer level,Integer sort,Integer status,Date createTime,Long createBy,Date updateTime,Long updateBy,String memo) { |
| | | this.uuid = uuid; |
| | | this.name = name; |
| | | this.parentId = parentId; |
| | | this.parentName = parentName; |
| | | this.path = path; |
| | | this.pathName = pathName; |
| | | this.type = type; |
| | | this.leading = leading; |
| | | this.img = img; |
| | | this.brief = brief; |
| | | this.count = count; |
| | | this.level = level; |
| | | this.sort = sort; |
| | | this.status = status; |
| | | this.createTime = createTime; |
| | | this.createBy = createBy; |
| | | this.updateTime = updateTime; |
| | | this.updateBy = updateBy; |
| | | this.memo = memo; |
| | | } |
| | | |
| | | // Tag tag = new Tag( |
| | | // null, // 编号 |
| | | // null, // 名称 |
| | | // null, // 父级 |
| | | // null, // 父级名称 |
| | | // null, // 关联路径 |
| | | // null, // 关联路径名 |
| | | // null, // 类型 |
| | | // null, // 负责人 |
| | | // null, // 图片 |
| | | // null, // 简要描述 |
| | | // null, // 数量 |
| | | // null, // 等级 |
| | | // null, // 排序 |
| | | // null, // 状态 |
| | | // null, // 添加时间 |
| | | // null, // 添加人员 |
| | | // null, // 修改时间 |
| | | // null, // 修改人员 |
| | | // null // 备注 |
| | | // ); |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getUuid() { |
| | | return uuid; |
| | | } |
| | | |
| | | public void setUuid(String uuid) { |
| | | this.uuid = uuid; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public Long getParentId() { |
| | | return parentId; |
| | | } |
| | | |
| | | public void setParentId(Long parentId) { |
| | | this.parentId = parentId; |
| | | } |
| | | |
| | | public String getParentName() { |
| | | return parentName; |
| | | } |
| | | |
| | | public void setParentName(String parentName) { |
| | | this.parentName = parentName; |
| | | } |
| | | |
| | | public String getPath() { |
| | | return path; |
| | | } |
| | | |
| | | public void setPath(String path) { |
| | | this.path = path; |
| | | } |
| | | |
| | | public String getPathName() { |
| | | return pathName; |
| | | } |
| | | |
| | | public void setPathName(String pathName) { |
| | | this.pathName = pathName; |
| | | } |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public String getType$(){ |
| | | if (null == this.type){ return null; } |
| | | switch (this.type){ |
| | | case 1: |
| | | return "盒装"; |
| | | case 2: |
| | | return "袋装"; |
| | | case 0: |
| | | return "其他"; |
| | | default: |
| | | return String.valueOf(this.type); |
| | | } |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getLeading() { |
| | | return leading; |
| | | } |
| | | |
| | | public void setLeading(String leading) { |
| | | this.leading = leading; |
| | | } |
| | | |
| | | public String getImg() { |
| | | return img; |
| | | } |
| | | |
| | | public void setImg(String img) { |
| | | this.img = img; |
| | | } |
| | | |
| | | public String getBrief() { |
| | | return brief; |
| | | } |
| | | |
| | | public void setBrief(String brief) { |
| | | this.brief = brief; |
| | | } |
| | | |
| | | public Integer getCount() { |
| | | return count; |
| | | } |
| | | |
| | | public void setCount(Integer count) { |
| | | this.count = count; |
| | | } |
| | | |
| | | public Integer getLevel() { |
| | | return level; |
| | | } |
| | | |
| | | public void setLevel(Integer level) { |
| | | this.level = level; |
| | | } |
| | | |
| | | public Integer getSort() { |
| | | return sort; |
| | | } |
| | | |
| | | public void setSort(Integer sort) { |
| | | this.sort = sort; |
| | | } |
| | | |
| | | 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 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 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 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 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 String getMemo() { |
| | | return memo; |
| | | } |
| | | |
| | | public void setMemo(String memo) { |
| | | this.memo = memo; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.entity.result; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * Created by vincent on 2021/4/13 |
| | | */ |
| | | @Data |
| | | public class KeyValueVo { |
| | | |
| | | private String name; |
| | | |
| | | private Long value; |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | import com.zy.asrs.entity.Mat; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface MatMapper extends BaseMapper<Mat> { |
| | | |
| | | List<Mat> listByPage(Page page, @Param("tagId") String tagId, @Param("matnr") Object matnr, @Param("maktx") Object maktx); |
| | | |
| | | Mat selectByMatnr(@Param("matnr")String matnr); |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | import com.zy.asrs.entity.Tag; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface TagMapper extends BaseMapper<Tag> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.Mat; |
| | | |
| | | public interface MatService extends IService<Mat> { |
| | | |
| | | Page<Mat> getPage(Page page, String tagId, Object matnr, Object maktx); |
| | | |
| | | Mat selectByMatnr(String matnr); |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.Tag; |
| | | |
| | | public interface TagService extends IService<Tag> { |
| | | |
| | | Tag getTop(); |
| | | |
| | | Tag selectByName(String name, Integer level); |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.mapper.MatMapper; |
| | | import com.zy.asrs.service.MatService; |
| | | |
| | | @Service("matService") |
| | | public class MatServiceImpl extends ServiceImpl<MatMapper, Mat> implements MatService { |
| | | |
| | | @Override |
| | | public Page<Mat> getPage(Page page, String tagId, Object matnr, Object maktx) { |
| | | return page.setRecords(baseMapper.listByPage(page, tagId, matnr, maktx)); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Mat selectByMatnr(String matnr) { |
| | | return this.baseMapper.selectByMatnr(matnr); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.core.exception.CoolException; |
| | | import org.springframework.stereotype.Service; |
| | | import com.zy.asrs.entity.Tag; |
| | | import com.zy.asrs.mapper.TagMapper; |
| | | import com.zy.asrs.service.TagService; |
| | | |
| | | @Service("tagService") |
| | | public class TagServiceImpl extends ServiceImpl<TagMapper, Tag> implements TagService { |
| | | |
| | | @Override |
| | | public synchronized Tag getTop() { |
| | | Tag top = this.selectOne(new EntityWrapper<Tag>().eq("level", 1)); |
| | | if (top == null) { |
| | | top = new Tag(); |
| | | top.setName("全部"); |
| | | top.setType(0); |
| | | top.setLevel(1); |
| | | top.setStatus(1); |
| | | top.setSort(0); |
| | | Integer insert = this.baseMapper.insert(top); |
| | | if (insert == 0) { |
| | | throw new CoolException("服务器异常"); |
| | | } |
| | | } |
| | | return top; |
| | | } |
| | | |
| | | @Override |
| | | public Tag selectByName(String name, Integer level) { |
| | | return this.selectOne(new EntityWrapper<Tag>().eq("name", name).eq("level", level)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.asrs.utils; |
| | | |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.Tag; |
| | | import com.zy.asrs.mapper.TagMapper; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.asrs.service.TagService; |
| | | import com.zy.common.entity.MatExcel; |
| | | import com.zy.common.utils.NodeUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Created by vincent on 2019-11-25 |
| | | */ |
| | | @Slf4j |
| | | public class MatExcelListener extends AnalysisEventListener<MatExcel> { |
| | | |
| | | private int total = 0; |
| | | private Long userId; |
| | | |
| | | public MatExcelListener() { |
| | | } |
| | | |
| | | public MatExcelListener(Long userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | /** |
| | | * 每隔5条存储数据库,实际使用中可以3000条,然后清理list ,方便内存回收 |
| | | */ |
| | | private static final int BATCH_COUNT = 50; |
| | | |
| | | private final List<MatExcel> list = new ArrayList<>(); |
| | | |
| | | /** |
| | | * 这里会一行行的返回头 |
| | | */ |
| | | @Override |
| | | public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) { |
| | | } |
| | | |
| | | /** |
| | | * 这个每一条数据解析都会来调用 |
| | | */ |
| | | @Override |
| | | public void invoke(MatExcel excel, AnalysisContext ctx) { |
| | | TagService tagService = SpringUtils.getBean(TagService.class); |
| | | TagMapper tagMapper = SpringUtils.getBean(TagMapper.class); |
| | | MatService matService = SpringUtils.getBean(MatService.class); |
| | | Date now = new Date(); |
| | | Long tagId; |
| | | // 分类 |
| | | // 一级分类 |
| | | if (!Cools.isEmpty(excel.getPriClass()) && !Cools.isEmpty(excel.getSecClass())) { |
| | | Tag priTag = tagService.selectByName(excel.getPriClass(), 2); |
| | | if (priTag == null) { |
| | | Tag top = tagService.getTop(); |
| | | NodeUtils nodeUtils = new NodeUtils(); |
| | | nodeUtils.executePath(top.getId()); |
| | | priTag = new Tag( |
| | | null, // 编号 |
| | | excel.getPriClass(), // 名称 |
| | | top.getId(), // 父级 |
| | | top.getName(), // 父级名称 |
| | | nodeUtils.path.toString(), // 关联路径 |
| | | nodeUtils.pathName.toString(), // 关联路径名 |
| | | 0, // 类型 |
| | | null, // 负责人 |
| | | null, // 图片 |
| | | null, // 简要描述 |
| | | null, // 数量 |
| | | 2, // 等级 |
| | | null, // 排序 |
| | | 1, // 状态 |
| | | now, // 添加时间 |
| | | null, // 添加人员 |
| | | now, // 修改时间 |
| | | null, // 修改人员 |
| | | null // 备注 |
| | | ); |
| | | if (tagMapper.insert(priTag) == 0) { |
| | | throw new CoolException("保存一级分类失败"); |
| | | } |
| | | } |
| | | // 二级分类 |
| | | Tag secTag = tagService.selectByName(excel.getSecClass(), 3); |
| | | if (secTag == null) { |
| | | NodeUtils nodeUtils = new NodeUtils(); |
| | | nodeUtils.executePath(priTag.getId()); |
| | | secTag = new Tag( |
| | | null, // 编号 |
| | | excel.getSecClass(), // 名称 |
| | | priTag.getId(), // 父级 |
| | | priTag.getName(), // 父级名称 |
| | | nodeUtils.path.toString(), // 关联路径 |
| | | nodeUtils.pathName.toString(), // 关联路径名 |
| | | 0, // 类型 |
| | | null, // 负责人 |
| | | null, // 图片 |
| | | null, // 简要描述 |
| | | null, // 数量 |
| | | 3, // 等级 |
| | | null, // 排序 |
| | | 1, // 状态 |
| | | now, // 添加时间 |
| | | null, // 添加人员 |
| | | now, // 修改时间 |
| | | null, // 修改人员 |
| | | null // 备注 |
| | | ); |
| | | if (tagMapper.insert(secTag) == 0) { |
| | | throw new CoolException("保存二级分类失败"); |
| | | } |
| | | } |
| | | tagId = secTag.getId(); |
| | | } else { |
| | | tagId = tagService.getTop().getId(); |
| | | } |
| | | // 商品 |
| | | Mat mat = matService.selectByMatnr(excel.getMatnr()); |
| | | if (mat == null) { |
| | | mat = excel; |
| | | mat.setTagId(tagId); |
| | | if (!matService.insert(mat)) { |
| | | throw new CoolException("保存商品信息失败,商品编码:" + excel.getMatnr()); |
| | | } |
| | | total++; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 所有数据解析完成了调用 |
| | | * 适合事务 |
| | | */ |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext ctx) { |
| | | log.info("新增{}条物料信息!", total); |
| | | } |
| | | |
| | | public int getTotal() { |
| | | return total; |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.common.entity; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.zy.asrs.entity.Mat; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 0.A 1.B 2.C 3.D 4.E 5.F 6.G 7.H 8.I |
| | | * 9.J 10.K 11.L 12.M 13.N 14.O 15.P 16.Q 17.R 18.S |
| | | * 19.T 20.U 21.V 22.W 23.X 24.Y 25.Z |
| | | */ |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | public class MatExcel extends Mat { |
| | | |
| | | @ExcelProperty(index = 0, value = "一级分类") |
| | | private String priClass; |
| | | |
| | | @ExcelProperty(index = 1, value = "二级分类") |
| | | private String secClass; |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.common.utils; |
| | | |
| | | import java.io.*; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Created by vincent on 2020/10/17 |
| | | */ |
| | | public class ListUtils { |
| | | |
| | | public static List<Map> deepCopy(List<Map> src) throws IOException, ClassNotFoundException { |
| | | ByteArrayOutputStream byteOut = new ByteArrayOutputStream(); |
| | | ObjectOutputStream out = new ObjectOutputStream(byteOut); |
| | | out.writeObject(src); |
| | | |
| | | ByteArrayInputStream byteIn = new ByteArrayInputStream(byteOut.toByteArray()); |
| | | ObjectInputStream in = new ObjectInputStream(byteIn); |
| | | @SuppressWarnings("unchecked") |
| | | List<Map> dest = (List<Map>) in.readObject(); |
| | | return dest; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.common.utils; |
| | | |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.Tag; |
| | | import com.zy.asrs.service.TagService; |
| | | |
| | | /** |
| | | * Created by vincent on 2021/1/19 |
| | | */ |
| | | public class NodeUtils { |
| | | |
| | | public StringBuilder path = new StringBuilder(); |
| | | |
| | | public StringBuilder pathName = new StringBuilder(); |
| | | |
| | | public void executePath(Tag tag) { |
| | | TagService bean = SpringUtils.getBean(TagService.class); |
| | | Tag parent = bean.selectById(tag.getParentId()); |
| | | if (null != parent) { |
| | | path.insert(0, parent.getId()).insert(0,","); |
| | | pathName.insert(0, parent.getName()).insert(0,","); |
| | | if (parent.getParentId() != null) { |
| | | executePath(parent); |
| | | } else { |
| | | path.deleteCharAt(0); |
| | | pathName.deleteCharAt(0); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void executePath(Long parentId) { |
| | | TagService bean = SpringUtils.getBean(TagService.class); |
| | | Tag parent = bean.selectById(parentId); |
| | | if (null != parent) { |
| | | path.insert(0, parent.getId()).insert(0,","); |
| | | pathName.insert(0, parent.getName()).insert(0,","); |
| | | if (parent.getParentId() != null) { |
| | | executePath(parent); |
| | | } else { |
| | | path.deleteCharAt(0); |
| | | pathName.deleteCharAt(0); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.common.utils; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.zy.asrs.entity.Tag; |
| | | import com.zy.asrs.service.TagService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 树形图工具 |
| | | * Created by vincent on 2020/10/16 |
| | | */ |
| | | @Component |
| | | public class TreeUtils { |
| | | |
| | | @Autowired |
| | | private TagService tagService; |
| | | |
| | | /******************************** 归类树 *********************************/ |
| | | |
| | | /** |
| | | * 获取树图数据结构 |
| | | */ |
| | | @Cacheable(cacheNames="tagTree",key="#id") |
| | | public ArrayList<Map> getTree(String id){ |
| | | ArrayList<Map> result = new ArrayList<>(); |
| | | Tag tag = tagService.selectById(id); |
| | | // 主节点 |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("title", tag.getName()); |
| | | map.put("id", tag.getId()); |
| | | map.put("spread", true); |
| | | List<Map> childrens = new ArrayList<>(); |
| | | map.put("children", childrens); |
| | | dealTag(tag, childrens); |
| | | result.add(map); |
| | | // 开始处理字节点 |
| | | // deal(tag, childrens); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 递归获取子节点数据 |
| | | */ |
| | | public void dealTag(Tag parent, List<Map> list) { |
| | | List<Tag> tags = tagService.selectList( |
| | | new EntityWrapper<Tag>() |
| | | .eq("parent_id", parent.getId()) |
| | | .eq("status", "1")); |
| | | for (Tag tag : tags) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("title", tag.getName()); |
| | | map.put("id", tag.getId()); |
| | | map.put("spread", true); |
| | | List<Map> childrens = new ArrayList<>(); |
| | | map.put("children", childrens); |
| | | dealTag(tag, childrens); |
| | | list.add(map); |
| | | } |
| | | } |
| | | |
| | | |
| | | // ------------------------------------------------------------------------------------------------------- |
| | | |
| | | /** |
| | | * 条件筛选 |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | public void remove(String condition, List<Map> list) { |
| | | Iterator<Map> iterator = list.iterator(); |
| | | while (iterator.hasNext()) { |
| | | Map map = iterator.next(); |
| | | if (map.get("children") != null) { |
| | | List<Map> children = (List<Map>) map.get("children"); |
| | | if (children.size() > 0) { |
| | | remove(condition, children); |
| | | } else { |
| | | if (!String.valueOf(map.get("title")).contains(condition)) { |
| | | iterator.remove(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import com.core.common.Cools; |
| | | import com.core.controller.AbstractBaseController; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.Tag; |
| | | import com.zy.asrs.service.TagService; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.UserService; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | protected HttpServletRequest request; |
| | | @Autowired |
| | | private UserService userService; |
| | | @Autowired |
| | | private TagService tagService; |
| | | |
| | | protected Long getUserId(){ |
| | | return Long.parseLong(String.valueOf(request.getAttribute("userId"))); |
| | |
| | | return ""; |
| | | } |
| | | |
| | | protected Tag getOriginTag(){ |
| | | return tagService.getTop(); |
| | | } |
| | | |
| | | /** |
| | | * 分页组装 |
| | | * @param pageNumber |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="zy.cloud.wms.manager.mapper.DocLogMapper"> |
| | | <mapper namespace="com.zy.asrs.mapper.DocLogMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.DocLog"> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zy.asrs.mapper.MatMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.Mat"> |
| | | <id column="id" property="id" /> |
| | | <result column="uuid" property="uuid" /> |
| | | <result column="node_id" property="nodeId" /> |
| | | <result column="tag_id" property="tagId" /> |
| | | <result column="matnr" property="matnr" /> |
| | | <result column="maktx" property="maktx" /> |
| | | <result column="name" property="name" /> |
| | | <result column="specs" property="specs" /> |
| | | <result column="model" property="model" /> |
| | | <result column="batch" property="batch" /> |
| | | <result column="unit" property="unit" /> |
| | | <result column="barcode" property="barcode" /> |
| | | <result column="doc_id" property="docId" /> |
| | | <result column="doc_num" property="docNum" /> |
| | | <result column="cust_name" property="custName" /> |
| | | <result column="item_num" property="itemNum" /> |
| | | <result column="count" property="count" /> |
| | | <result column="price" property="price" /> |
| | | <result column="weight" property="weight" /> |
| | | <result column="status" property="status" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="memo" property="memo" /> |
| | | |
| | | <result column="stock" property="stock" /> |
| | | </resultMap> |
| | | |
| | | <select id="listByPage" resultMap="BaseResultMap"> |
| | | SELECT |
| | | isnull(mld.amount,0) as stock, |
| | | mm.* |
| | | FROM man_mat mm |
| | | LEFT JOIN man_tag mt ON mm.tag_id = mt.id |
| | | LEFT JOIN ( |
| | | select |
| | | matnr, |
| | | sum(anfme) as amount |
| | | from man_loc_detl |
| | | group by matnr |
| | | ) as mld on mld.matnr = mm.matnr |
| | | WHERE 1=1 |
| | | AND (CHARINDEX(','+#{tagId}+',', ','+mt.path+',') > 0 OR mt.id = #{tagId}) |
| | | <if test="matnr != null and matnr != ''"> |
| | | and mm.matnr like concat('%',#{matnr},'%') |
| | | </if> |
| | | <if test="maktx != null and maktx != ''"> |
| | | and mm.maktx like concat('%',#{maktx},'%') |
| | | </if> |
| | | ORDER BY mm.create_time DESC |
| | | </select> |
| | | |
| | | <select id="selectByMatnr" resultMap="BaseResultMap"> |
| | | select top 1 * from man_mat where 1=1 and matnr = #{matnr} |
| | | </select> |
| | | </mapper> |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="zy.cloud.wms.manager.mapper.RequestLogMapper"> |
| | | <mapper namespace="com.zy.asrs.mapper.RequestLogMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.RequestLog"> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zy.asrs.mapper.TagMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.Tag"> |
| | | <id column="id" property="id" /> |
| | | <result column="uuid" property="uuid" /> |
| | | <result column="name" property="name" /> |
| | | <result column="parent_id" property="parentId" /> |
| | | <result column="parent_name" property="parentName" /> |
| | | <result column="path" property="path" /> |
| | | <result column="path_name" property="pathName" /> |
| | | <result column="type" property="type" /> |
| | | <result column="leading" property="leading" /> |
| | | <result column="img" property="img" /> |
| | | <result column="brief" property="brief" /> |
| | | <result column="count" property="count" /> |
| | | <result column="level" property="level" /> |
| | | <result column="sort" property="sort" /> |
| | | <result column="status" property="status" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="memo" property="memo" /> |
| | | |
| | | </resultMap> |
| | | |
| | | </mapper> |
New file |
| | |
| | | #organizationTreeBar { |
| | | padding: 10px 15px; |
| | | border: 1px solid #e6e6e6; |
| | | background-color: #f2f2f2; |
| | | } |
| | | #organizationTree { |
| | | border: 1px solid #e6e6e6; |
| | | border-top: none; |
| | | padding: 10px 5px; |
| | | overflow: auto; |
| | | height: -webkit-calc(100vh - 125px); |
| | | height: -moz-calc(100vh - 125px); |
| | | height: calc(100vh - 125px); |
| | | } |
| | | .layui-tree-entry .layui-tree-txt { |
| | | padding: 0 5px; |
| | | border: 1px transparent solid; |
| | | text-decoration: none !important; |
| | | } |
| | | |
| | | .layui-tree-entry.ew-tree-click .layui-tree-txt { |
| | | background-color: #fff3e0; |
| | | border: 1px #FFE6B0 solid; |
| | | } |
| | | |
| | | |
| | | |
| | | #organizationEditForm.layui-form { |
| | | padding: 25px 30px 0 0; |
| | | } |
| | | #organizationEditForm .layui-form-label { |
| | | padding: 8px 15px; |
| | | box-sizing: content-box; |
| | | -webkit-box-sizing: content-box; |
| | | } |
| | | #organizationEditForm .layui-form-required:before { |
| | | content: "*"; |
| | | display: inline-block; |
| | | font-family: SimSun,serif; |
| | | margin-right: 4px; |
| | | font-size: 14px; |
| | | line-height: 1; |
| | | color: #ed4014; |
| | | } |
| | | #organizationEditForm .layui-input { |
| | | height: 36px; |
| | | border-radius: 4px; |
| | | } |
| | | #organizationEditForm .cool-button-contain { |
| | | text-align: right; |
| | | margin: 20px 0; |
| | | } |
| | | #organizationEditForm .layui-form-radio>i:hover, .layui-form-radioed>i { |
| | | color: #007bff; |
| | | } |
| | | #organizationEditForm .layui-btn { |
| | | height: 36px; |
| | | line-height: 36px; |
| | | border-radius: 4px; |
| | | box-shadow: 0 1px 0 rgba(0,0,0,.03); |
| | | } |
| | | #organizationEditForm .layui-btn-primary:hover { |
| | | border-color: #777777; |
| | | } |
| | | |
| | | |
| | | /* 自定义 */ |
| | | #condition { |
| | | height: 30px; |
| | | } |
New file |
| | |
| | | var pageCurr; |
| | | var printMatCodeNos = []; |
| | | var admin; |
| | | function getCol() { |
| | | var cols = [ |
| | | {type: 'checkbox'} |
| | | ,{field: 'tagId$', align: 'center',title: '归类', templet: '#tagTpl'} |
| | | ]; |
| | | cols.push.apply(cols, matCols); |
| | | cols.push( |
| | | {fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | ) |
| | | return cols; |
| | | } |
| | | |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).extend({ |
| | | dropdown: 'dropdown/dropdown', |
| | | }).use(['table','laydate', 'form', 'treeTable', 'admin', 'xmSelect', 'dropdown', 'element'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | admin = layui.admin; |
| | | var treeTable = layui.treeTable; |
| | | var xmSelect = layui.xmSelect; |
| | | |
| | | // 商品分类数据 |
| | | var insTb = treeTable.render({ |
| | | elem: '#tag', |
| | | url: baseUrl+'/tag/list/auth', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | tree: { |
| | | iconIndex: 2, // 折叠图标显示在第几列 |
| | | isPidData: true, // 是否是id、pid形式数据 |
| | | idName: 'id', // id字段名称 |
| | | pidName: 'parentId' // pid字段名称 |
| | | }, |
| | | cols: [], |
| | | done: function (data) { |
| | | $('.ew-tree-table-box').css('height', '100%'); |
| | | insTb.expandAll(); |
| | | } |
| | | }); |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#mat', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/mat/list/auth', |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | height: 'full-105', |
| | | cols: [getCol()], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | form.on('checkbox(tableCheckbox)', function (data) { |
| | | var _index = $(data.elem).attr('table-index')||0; |
| | | if(data.elem.checked){ |
| | | res.data[_index][data.value] = 'Y'; |
| | | }else{ |
| | | res.data[_index][data.value] = 'N'; |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(locMast)', 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 |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(mat)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | switch(obj.event) { |
| | | case 'addData': |
| | | showEditModel() |
| | | break; |
| | | case 'deleteData': |
| | | var data = checkStatus.data; |
| | | if (data.length === 0){ |
| | | layer.msg('请选择数据'); |
| | | } else { |
| | | layer.confirm('确定删除'+(data.length===1?'此':data.length)+'条数据吗', function(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/mat/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {param: JSON.stringify(data)}, |
| | | method: 'POST', |
| | | traditional:true, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.closeAll(); |
| | | tableReload(false); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | 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 = { |
| | | 'mat': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/mat/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) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | // 批量打印 |
| | | case "btnPrintBatch": |
| | | printMatCodeNos = []; |
| | | var data = checkStatus.data; |
| | | if (data.length === 0){ |
| | | layer.msg('请选择打印数据'); |
| | | } else { |
| | | layer.open({ |
| | | type: 1, |
| | | title: '批量打印 [数量'+ data.length +']', |
| | | area: ['500px'], |
| | | shadeClose: true, |
| | | content: $('#printDataDiv'), |
| | | success: function(layero, index){ |
| | | for (var i = 0; i<data.length;i++) { |
| | | printMatCodeNos.push(data[i].matnr); |
| | | } |
| | | }, |
| | | end: function () { |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(mat)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | // 打印 |
| | | case "btnPrint": |
| | | printMatCodeNos = []; |
| | | layer.open({ |
| | | type: 1, |
| | | title: data.matnr + ' [数量:1]', |
| | | area: ['500px'], |
| | | shadeClose: true, |
| | | content: $('#printDataDiv'), |
| | | success: function(layero, index){ |
| | | layer.iframeAuto(index); |
| | | printMatCodeNos.push(data.matnr); |
| | | }, |
| | | end: function () { |
| | | } |
| | | }); |
| | | break; |
| | | // 编辑 |
| | | case 'edit': |
| | | showEditModel(data) |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | /* 显示表单弹窗 */ |
| | | function showEditModel(mData) { |
| | | admin.open({ |
| | | type: 1, |
| | | area: '600px', |
| | | title: (mData ? '修改' : '添加') + '商品', |
| | | content: $('#editDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | // 回显表单数据 |
| | | form.val('detail', mData); |
| | | // 新增自动生成商品编号 |
| | | if (!mData) { |
| | | http.get(baseUrl + "/mat/auto/matnr/auth", null, function (res) { |
| | | $('#matnr').val(res.data); |
| | | }) |
| | | } |
| | | // 表单提交事件 |
| | | form.on('submit(editSubmit)', function (data) { |
| | | data.field.tagId = insXmSel.getValue('valueStr'); |
| | | if (isEmpty(data.field.tagId)) { |
| | | layer.msg('分类不能为空', {icon: 2}); |
| | | return false; |
| | | } |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/mat/"+(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}); |
| | | $(".layui-laypage-btn")[0].click(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | return false; |
| | | }); |
| | | // 渲染下拉树 |
| | | var insXmSel = xmSelect.render({ |
| | | el: '#tagSel', |
| | | height: '250px', |
| | | data: insTb.options.data, |
| | | initValue: mData ? [mData.tagId] : [], |
| | | model: {label: {type: 'text'}}, |
| | | prop: { |
| | | name: 'name', |
| | | value: 'id' |
| | | }, |
| | | radio: true, |
| | | clickClose: true, |
| | | tree: { |
| | | show: true, |
| | | indent: 15, |
| | | strict: false, |
| | | expandedKeys: true |
| | | } |
| | | }); |
| | | // 弹窗不出现滚动条 |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | layui.form.render('select'); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 模板选择 |
| | | form.on('radio(selectTemplateRadio)', function (data) { |
| | | $('.template-preview').hide(); |
| | | $('#template-preview-'+data.value).show(); |
| | | }); |
| | | |
| | | // 开始打印 |
| | | form.on('submit(doPrint)', function (data) { |
| | | var templateNo = data.field.selectTemplate; |
| | | $.ajax({ |
| | | url: baseUrl+"/mat/print/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {param: printMatCodeNos}, |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.closeAll(); |
| | | for (let i=0;i<res.data.length;i++){ |
| | | var templateDom = $("#templatePreview"+templateNo); |
| | | var className = templateDom.attr("class"); |
| | | if (className === 'template-barcode') { |
| | | res.data[i]["barcodeUrl"]=baseUrl+"/mac/code/auth?type=1¶m="+res.data[i].matnr; |
| | | } else { |
| | | res.data[i]["barcodeUrl"]=baseUrl+"/mac/code/auth?type=2¶m="+res.data[i].matnr; |
| | | } |
| | | } |
| | | var tpl = templateDom.html(); |
| | | var template = Handlebars.compile(tpl); |
| | | var html = template(res); |
| | | var box = $("#box"); |
| | | box.html(html);box.show(); |
| | | box.print({mediaPrint:true}); |
| | | box.hide(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | |
| | | // 搜索栏搜索事件 |
| | | 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' |
| | | }); |
| | | |
| | | |
| | | }); |
| | | |
| | | // excel导入模板下载 |
| | | function excelMouldDownload(){ |
| | | layer.load(1, {shade: [0.1,'#fff']}); |
| | | location.href = baseUrl + "/mat/excel/import/mould"; |
| | | layer.closeAll('loading'); |
| | | } |
| | | |
| | | // excel导入 |
| | | function importExcel() { |
| | | $("#importExcel").trigger("click"); |
| | | } |
| | | function upload(obj){ |
| | | if(!obj.files) { |
| | | return; |
| | | } |
| | | var file = obj.files[0]; |
| | | admin.confirm('确认同步 [' + file.name +'] 文件吗?', function (index) { |
| | | layer.load(1, {shade: [0.1,'#fff']}); |
| | | var url = baseUrl + "/mat/excel/import/auth"; |
| | | var form = new FormData(); |
| | | form.append("file", file); |
| | | xhr = new XMLHttpRequest(); |
| | | xhr.open("post", url, true); //post方式,url为服务器请求地址,true 该参数规定请求是否异步处理。 |
| | | xhr.setRequestHeader('token', localStorage.getItem('token')); |
| | | xhr.onload = uploadComplete; //请求完成 |
| | | xhr.onerror = uploadFailed; //请求失败 |
| | | xhr.onloadend = function () { // // 上传完成重置文件流 |
| | | layer.closeAll('loading'); |
| | | $("#importExcel").val(""); |
| | | }; |
| | | // xhr.upload.onprogress = progressFunction;//【上传进度调用方法实现】 |
| | | xhr.upload.onloadstart = function(){//上传开始执行方法 |
| | | ot = new Date().getTime(); //设置上传开始时间 |
| | | oloaded = 0;//设置上传开始时,以上传的文件大小为0 |
| | | }; |
| | | xhr.send(form); |
| | | }, function(index){ |
| | | $("#importExcel").val(""); |
| | | }); |
| | | } |
| | | function uploadComplete(evt) { |
| | | var res = JSON.parse(evt.target.responseText); |
| | | if(res.code === 200) { |
| | | layer.msg(res.msg, {icon: 1}); |
| | | loadTree(""); |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | function uploadFailed(evt) { |
| | | var res = JSON.parse(evt.target.responseText); |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | |
| | | // excel导出 |
| | | function exportExcel() { |
| | | |
| | | } |
| | | |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | (child ? parent.tableIns : tableIns).reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | if (res.data.length === 0 && count !== 0) { |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr-1 |
| | | } |
| | | }); |
| | | pageCurr -= 1; |
| | | } |
| | | limit(child); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function clearFormVal(el) { |
| | | $(':input', el) |
| | | .val('') |
| | | .removeAttr('checked') |
| | | .removeAttr('selected'); |
| | | } |
| | | |
| | | $('body').keydown(function () { |
| | | if (event.keyCode === 13) { |
| | | $("#search").click(); |
| | | } |
| | | }); |
New file |
| | |
| | | var currentTemId; |
| | | var currentTemName; |
| | | var currentTemSsbm; |
| | | var init = false; |
| | | |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" // 配置模块所在的目录 |
| | | }).use(['table','laydate', 'form', 'tree', 'xmSelect'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var tree = layui.tree; |
| | | var xmSelect = layui.xmSelect; |
| | | var selObj, treeData; // 左树选中数据 |
| | | |
| | | var organizationTree; |
| | | window.loadTree = function(condition){ |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/tag/tree/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | 'condition': condition |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.close(loadIndex); |
| | | // 树形图 |
| | | organizationTree = tree.render({ |
| | | elem: '#organizationTree', |
| | | id: 'organizationTree', |
| | | onlyIconControl: true, |
| | | data: res.data, |
| | | click: function (obj) { |
| | | currentTemId = obj.data.id; |
| | | currentTemName = obj.data.title.split(" - ")[0]; |
| | | currentTemSsbm = obj.data.title.split(" - ")[1]; |
| | | selObj = obj; |
| | | $('#organizationTree').find('.ew-tree-click').removeClass('ew-tree-click'); |
| | | $(obj.elem).children('.layui-tree-entry').addClass('ew-tree-click'); |
| | | tableIns.reload({ |
| | | where: {tag_id: obj.data.id}, |
| | | page: {curr: 1} |
| | | }); |
| | | } |
| | | }); |
| | | treeData = res.data; |
| | | if (isEmpty(condition) && init) { |
| | | tableIns.reload({ |
| | | where: {tag_id: ""}, |
| | | page: {curr: 1} |
| | | }); |
| | | } |
| | | if (!init) { |
| | | init = true; |
| | | } |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | loadTree(); |
| | | |
| | | /* 树形图重置 */ |
| | | $('#treeReset').click(function () { |
| | | $("#condition").val(""); |
| | | loadTree(""); |
| | | }) |
| | | |
| | | }) |
| | | |
| | | function closeDialog() { |
| | | layer.closeAll(); |
| | | } |
| | | |
| | | /* 树形图搜索 */ |
| | | function findData(el) { |
| | | var condition = $(el).val(); |
| | | loadTree(condition) |
| | | } |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/tree.css" media="all"> |
| | | <style> |
| | | body { |
| | | color: #595959; |
| | | background-color: #f5f7f9; |
| | | } |
| | | .layui-fluid { |
| | | padding: 15px; |
| | | } |
| | | .layui-form.layui-border-box.layui-table-view { |
| | | /*margin: 15px 0 35px 0;*/ |
| | | width: 100%; |
| | | border-width: 1px; |
| | | } |
| | | .layui-form.layui-border-box.layui-table-view { |
| | | height: calc(100vh - 160px); |
| | | } |
| | | .layui-form.layui-border-box.layui-table-view { |
| | | margin: 0; |
| | | } |
| | | #search-box { |
| | | padding: 30px 30px 10px 0px; |
| | | margin-left: 0px; |
| | | } |
| | | .layui-form.layui-border-box.layui-table-view { |
| | | height: 100%; |
| | | } |
| | | |
| | | .admin-form { |
| | | padding: 25px 30px 0 0 !important; |
| | | margin: 0 !important; |
| | | } |
| | | |
| | | /* ------------------------- 打印表格 ----------------------- */ |
| | | .template-preview { |
| | | height: 200px; |
| | | display: inline-block; |
| | | } |
| | | .contain td { |
| | | border: 1px solid #000; |
| | | /*font-family: 黑体;*/ |
| | | /*font-weight: bold;*/ |
| | | /*color: #000000;*/ |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | |
| | | <div class="layui-fluid"> |
| | | <!-- 左 --> |
| | | <div class="layui-row layui-col-space15"> |
| | | <div class="layui-col-md3"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body" style="padding: 10px;"> |
| | | <!-- 树工具栏 --> |
| | | <div class="layui-form toolbar" id="organizationTreeBar"> |
| | | <div class="layui-inline" style="max-width: 200px;"> |
| | | <input id="condition" onkeyup="findData(this)" type="text" class="layui-input" placeholder="请输入关键字" autocomplete="off"> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <button class="layui-btn icon-btn layui-btn-sm" id="treeReset" style="padding: 0 10px"> |
| | | <i class="layui-icon layui-icon-close"></i> |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <!-- 树 --> |
| | | <div class="layui-form toolbar" id="organizationTree"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- 右 --> |
| | | <div class="layui-col-md9"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body" style="padding: 10px;"> |
| | | <!-- 表格工具栏2 --> |
| | | <div id="search-box" class="layui-form toolbar" style="padding-top: 5px"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="padding: 8px 15px 8px 15px">商品编号:</label> |
| | | <div class="layui-input-inline"> |
| | | <input name="matnr" class="layui-input" placeholder="输入商品编号"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="padding: 8px 15px 8px 15px">商品名称:</label> |
| | | <div class="layui-input-inline"> |
| | | <input name="maktx" class="layui-input" placeholder="输入商品名称"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline">  |
| | | <button class="layui-btn icon-btn" lay-filter="search" lay-submit> |
| | | <i class="layui-icon"></i>搜索 |
| | | </button> |
| | | <button class="layui-btn icon-btn" lay-filter="reset" lay-submit> |
| | | <i class="layui-icon"></i>重置 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <table class="layui-hide" id="mat" lay-filter="mat"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <script type="text/html" id="tagTpl"> |
| | | <span name="tagId" class="layui-badge layui-badge-gray">{{d.tagId$}}</span> |
| | | </script> |
| | | |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-sm" id="btn-print-batch" lay-event="btnPrintBatch">批量打印</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-normal" id="btn-add" lay-event="addData">新增</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <!-- 商品/物料 数据中心 --> |
| | | <div class="dropdown-menu" style="float: right"> |
| | | <button class="layui-btn layui-btn-primary layui-border-black icon-btn layui-btn-sm"> 数据同步 <i class="layui-icon layui-icon-drop"></i></button> |
| | | <ul class="dropdown-menu-nav dark"> |
| | | <div class="dropdown-anchor"></div> |
| | | <li class="title">1st menu</li> |
| | | <li><a onclick="excelMouldDownload()" style="font-size: 12px"><i class="layui-icon layui-icon-template-1"></i>模板下载</a></li> |
| | | <li><a onclick="importExcel()" style="font-size: 12px"><i class="layui-icon layui-icon-upload"></i>导入 Excel</a></li> |
| | | <li style="display: none"><input id="importExcel" type="file" onchange="upload(this)" ></li> |
| | | <hr> |
| | | <li class="title">2nd menu</li> |
| | | <li><a onclick="exportExcel()" style="font-size: 12px"><i class="layui-icon layui-icon-export"></i>导出 Excel</a></li> |
| | | </ul> |
| | | </div> |
| | | <!-- <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right;margin-right: -10px">导出</button>--> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-xs btn-edit layui-btn-primary" lay-event="edit">修改</a> |
| | | <button class="layui-btn layui-btn-xs btn-print" lay-event="btnPrint">打印</button> |
| | | </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/jquery/jQuery.print.js"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></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/mat/mat.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/tagTree.js" charset="utf-8"></script> |
| | | |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="editDialog"> |
| | | <form id="detail" lay-filter="detail" class="layui-form admin-form"> |
| | | <input name="id" type="hidden"> |
| | | <input name="uuid" type="hidden"> |
| | | <input name="nodeId" type="hidden"> |
| | | <input name="tag_id" type="hidden"> |
| | | <input name="model" type="hidden"> |
| | | <input name="name" type="hidden"> |
| | | <input name="batch" type="hidden"> |
| | | <input name="docId" type="hidden"> |
| | | <input name="docNum" type="hidden"> |
| | | <input name="custName" type="hidden"> |
| | | <input name="itemNum" type="hidden"> |
| | | <input name="count" type="hidden"> |
| | | <input name="weight" type="hidden"> |
| | | <input name="status" type="hidden"> |
| | | <input name="createBy" type="hidden"> |
| | | <input name="updateTime$" type="hidden"> |
| | | <input name="updateBy" type="hidden"> |
| | | <div class="layui-row"> |
| | | |
| | | <div class="layui-col-md6"> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">分类</label> |
| | | <div class="layui-input-block"> |
| | | <div id="tagSel" class="ew-xmselect-tree"></div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">商品名称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="maktx" placeholder="请输入商品名称" class="layui-input" lay-vertype="tips" lay-verify="required" required=""> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">SKC</label> |
| | | <div class="layui-input-block"> |
| | | <input name="barcode" placeholder="请输入条码" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">单价</label> |
| | | <div class="layui-input-block"> |
| | | <input name="price" type="number" placeholder="请输入单价" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <div class="layui-col-md6"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">商品编号</label> |
| | | <div class="layui-input-block"> |
| | | <input id="matnr" name="matnr" placeholder="请输入商品编号" class="layui-input" lay-vertype="tips" lay-verify="required" required=""> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">规格</label> |
| | | <div class="layui-input-block"> |
| | | <input name="specs" placeholder="请输入规格" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">单位</label> |
| | | <div class="layui-input-block"> |
| | | <input name="unit" placeholder="请输入单位" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">备注</label> |
| | | <div class="layui-input-block"> |
| | | <input name="memo" placeholder="请输入备注" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label layui-form-required">状态</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <select name="status" lay-vertype="tips" lay-verify="required" required="">--> |
| | | <!-- <option value="">请选择状态</option>--> |
| | | <!-- <option value="1">正常</option>--> |
| | | <!-- <option value="0">禁用</option>--> |
| | | <!-- </select>--> |
| | | <!-- </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> |
| | | |
| | | <!-- 打印操作弹窗 --> |
| | | <div id="printDataDiv" style="display: none;padding: 20px"> |
| | | <div class="layui-form" style="text-align: center"> |
| | | <hr> |
| | | <!--单选框--> |
| | | <div class="layui-form-item" style="display: inline-block; margin-bottom: 10px"> |
| | | <input type="radio" name="selectTemplate" value="1" title="模板一" lay-filter="selectTemplateRadio" checked=""> |
| | | <input type="radio" name="selectTemplate" value="2" title="模板二" lay-filter="selectTemplateRadio"> |
| | | <input type="radio" name="selectTemplate" value="3" title="模板三" lay-filter="selectTemplateRadio"> |
| | | </div> |
| | | <fieldset class="layui-elem-field site-demo-button" style="margin-top: 30px;text-align: left;"> |
| | | <legend>打印预览</legend> |
| | | <div id="template-container" style="margin: 20px;text-align: center"> |
| | | |
| | | <!-- 预览图 1 --> |
| | | <div id="template-preview-1" class="template-preview" style="display: inline-block"> |
| | | <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;"> |
| | | <tr style="height: 74px"> |
| | | <td colspan="3" align="center" scope="col">商品编码</td> |
| | | <td class="barcode" colspan="9" align="center" scope="col"> |
| | | <img class="template-code template-barcode" src="" width="90%;"> |
| | | <div style="letter-spacing: 2px;margin-top: 1px; text-align: center;"> |
| | | <span>xxxxxx</span> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | <tr style="height: 74px"> |
| | | <td align="center" colspan="3">商品</td> |
| | | <td align="center" colspan="5">xxxxxx-xx/xx</td> |
| | | <td align="center" colspan="2">备注</td> |
| | | <td align="center" colspan="2">xx</td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | |
| | | <!-- 预览图 2 --> |
| | | <div id="template-preview-2" class="template-preview" style="display: none"> |
| | | <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;"> |
| | | <tr style="height: 30px"> |
| | | <td align="center" width="20%">商品</td> |
| | | <td align="center" width="80%" style="overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">xxxxxxx</td> |
| | | </tr> |
| | | <tr style="height: 30px"> |
| | | <td align="center" width="20%">备注</td> |
| | | <td align="center" width="80%">xxxxxxxx</td> |
| | | </tr> |
| | | <tr style="height: 75px;"> |
| | | <td align="center" colspan="2" width="100%" style="border: none"> |
| | | <img class="template-code template-barcode" src="" width="80%"> |
| | | <div style="letter-spacing: 2px;margin-top: 1px; text-align: center"> |
| | | <span>xxxxxx</span> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | |
| | | <!-- 预览图 3 --> |
| | | <div id="template-preview-3" class="template-preview" style="display: none"> |
| | | <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;"> |
| | | <tr style="height: 74px"> |
| | | <td align="center" scope="col" colspan="1">商品</td> |
| | | <td align="center" scope="col" colspan="1" style="">xxxxxx-xx/xx</td> |
| | | <td align="center" scope="col" colspan="2" rowspan="2"> |
| | | <img class="template-code template-qrcode" src="" width="80%"> |
| | | <div style="letter-spacing: 1px;margin-top: 1px; text-align: center"> |
| | | <span>xxxxxx</span> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | <tr style="height: 74px"> |
| | | <td align="center" colspan="1">备注</td> |
| | | <td align="center" colspan="1" style="overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">xxxxxxx</td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | </fieldset> |
| | | |
| | | <button class="layui-btn" id="doPrint" lay-submit lay-filter="doPrint" style="margin-top: 20px">确定</button> |
| | | </div> |
| | | </div> |
| | | |
| | | <div id="box" style="display: block"></div> |
| | | |
| | | <!-- 初始化打印模板的条形码 --> |
| | | <script type="text/javascript"> |
| | | $('.template-barcode').attr("src", baseUrl+"/mac/code/auth?type=1¶m=123"); |
| | | $('.template-qrcode').attr("src", baseUrl+"/mac/code/auth?type=2¶m=123"); |
| | | </script> |
| | | |
| | | <!-- 模板引擎 --> |
| | | <!-- 模板1 --> |
| | | <script type="text/template" id="templatePreview1" class="template-barcode"> |
| | | {{#each data}} |
| | | <table class="contain" width="280" style="overflow: hidden;font-size: small;table-layout: fixed;"> |
| | | <tr style="height: 74px"> |
| | | <td align="center" colspan="3" scope="col">商品编码</td> |
| | | <td align="center" class="barcode" colspan="9" scope="col"> |
| | | <img class="template-code" src="{{this.barcodeUrl}}" width="90%"> |
| | | <div style="letter-spacing: 2px;margin-top: 1px; text-align: center"> |
| | | <span>{{this.matnr}}</span> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | <tr style="height: 74px"> |
| | | <td align="center" colspan="3">商品</td> |
| | | <td align="center" colspan="5" style="overflow: hidden; white-space: nowrap;text-overflow: ellipsis;">{{this.maktx}}</td> |
| | | <td align="center" colspan="2">备注</td> |
| | | <td align="center" colspan="2">{{this.memo}}</td> |
| | | </tr> |
| | | </table> |
| | | {{/each}} |
| | | </script> |
| | | <!-- 模板2 --> |
| | | <script type="text/template" id="templatePreview2" class="template-barcode"> |
| | | {{#each data}} |
| | | <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;"> |
| | | <tr style="height: 35px"> |
| | | <td align="center" width="20%">商品</td> |
| | | <td align="center" width="80%" style="overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">{{this.maktx}}</td> |
| | | </tr> |
| | | <tr style="height: 35px"> |
| | | <td align="center" width="20%">备注</td> |
| | | <td align="center" width="80%">{{this.memo}}</td> |
| | | </tr> |
| | | <tr style="height: 79px;"> |
| | | <td align="center" colspan="2" width="100%" style="border: none"> |
| | | <img class="template-code" src="{{this.barcodeUrl}}" width="80%"> |
| | | <div style="letter-spacing: 2px;margin-top: 1px; text-align: center"> |
| | | <span>{{this.matnr}}</span> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | {{/each}} |
| | | </script> |
| | | <!-- 模板3 --> |
| | | <script type="text/template" id="templatePreview3" class="template-qrcode"> |
| | | {{#each data}} |
| | | <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;"> |
| | | <tr style="height: 74px" > |
| | | <td align="center" scope="col" colspan="1">商品</td> |
| | | <td align="center" scope="col" colspan="1" style=" |
| | | display: inline-block; |
| | | line-height: 20px; |
| | | vertical-align: middle; |
| | | border: none; |
| | | border-top: 1px solid #000; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | display: -webkit-box; |
| | | -webkit-line-clamp: 3; |
| | | -webkit-box-orient: vertical; |
| | | "> |
| | | {{this.maktx}} |
| | | </td> |
| | | <td align="center" scope="col" colspan="2" rowspan="2"> |
| | | <img class="template-code template-qrcode" src="{{this.barcodeUrl}}" width="80%"> |
| | | <div style="letter-spacing: 1px;margin-top: 1px; text-align: center"> |
| | | <span>{{this.matnr}}</span> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | <tr style="height: 74px"> |
| | | <td align="center" colspan="1">备注</td> |
| | | <td align="center" colspan="1" style="overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">{{this.memo}}</td> |
| | | </tr> |
| | | </table> |
| | | {{/each}} |
| | | </script> |
| | | |
| | | </body> |
| | | </html> |
| | | |
| | |
| | | show: true, |
| | | indent: 15, |
| | | strict: false, |
| | | expandedKeys: true |
| | | expandedKeys: false |
| | | } |
| | | }); |
| | | // 弹窗不出现滚动条 |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | <style> |
| | | #detail { |
| | | padding: 25px 30px 0 0; |
| | | } |
| | | .ew-tree-table-box { |
| | | height: 100%; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | |
| | | <!-- 正文开始 --> |
| | | <div class="layui-fluid"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body"> |
| | | <!-- 数据表格 --> |
| | | <table id="tag"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <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-del" lay-event="del">删除</a> |
| | | </script> |
| | | |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="editDialog"> |
| | | <form id="detail" lay-filter="detail" class="layui-form"> |
| | | <input name="id" type="hidden"> |
| | | <input name="uuid" type="hidden"> |
| | | <input name="path" type="hidden"> |
| | | <input name="pathName" type="hidden"> |
| | | <input name="img" type="hidden"> |
| | | <input name="brief" type="hidden"> |
| | | <input name="level" type="hidden"> |
| | | <input name="count" type="hidden"> |
| | | <input name="createTime$" type="hidden"> |
| | | <input name="createBy" type="hidden"> |
| | | <input name="updateTime$" type="hidden"> |
| | | <input name="updateBy" type="hidden"> |
| | | <div class="layui-row"> |
| | | |
| | | <div class="layui-col-md6"> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">上级菜单</label> |
| | | <div class="layui-input-block"> |
| | | <div id="tagParentSel" class="ew-xmselect-tree"></div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">类型</label> |
| | | <div class="layui-input-block"> |
| | | <select name="type" lay-vertype="tips"> |
| | | <option value="">请选择类型</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 name="leading" placeholder="请输入负责人" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <div class="layui-col-md6"> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">归类名称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="name" placeholder="请输入归类名称" class="layui-input" lay-vertype="tips" lay-verify="required" required=""> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">排序</label> |
| | | <div class="layui-input-block"> |
| | | <input name="sort" placeholder="请输入排序" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">备注</label> |
| | | <div class="layui-input-block"> |
| | | <input name="memo" placeholder="请输入备注" class="layui-input"> |
| | | </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> |
| | | |
| | | <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> |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['form','treeTable', 'admin', 'xmSelect'], function() { |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | var treeTable = layui.treeTable; |
| | | var xmSelect = layui.xmSelect; |
| | | var tbDataList = []; |
| | | |
| | | var insTb = treeTable.render({ |
| | | elem: '#tag', |
| | | url: baseUrl+'/tag/list/auth', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | height: 'full-200', |
| | | toolbar: ['<p>', |
| | | '<button lay-event="add" class="layui-btn layui-btn-sm icon-btn"><i class="layui-icon"></i>添加</button> ', |
| | | '<button lay-event="del" class="layui-btn layui-btn-sm layui-btn-danger icon-btn"><i class="layui-icon"></i>删除</button>', |
| | | '</p>'].join(''), |
| | | tree: { |
| | | iconIndex: 2, // 折叠图标显示在第几列 |
| | | isPidData: true, // 是否是id、pid形式数据 |
| | | idName: 'id', // id字段名称 |
| | | pidName: 'parentId' // pid字段名称 |
| | | }, |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | ,{type: 'numbers'} |
| | | ,{field: 'name', align: 'left',title: '名称', minWidth: 150} |
| | | // ,{field: 'uuid', align: 'center',title: '编号'} |
| | | ,{field: 'type$', align: 'center',title: '类型'} |
| | | ,{field: 'leading', align: 'center',title: '负责人'} |
| | | ,{field: 'img', align: 'center',title: '图片', hide: true} |
| | | // ,{field: 'brief', align: 'center',title: '简要描述'} |
| | | // ,{field: 'count', align: 'center',title: '数量'} |
| | | ,{field: 'sort', align: 'center',title: '排序'} |
| | | ,{field: 'status$', align: 'center',title: '状态'} |
| | | ,{field: 'updateTime$', align: 'center',title: '修改时间'} |
| | | ,{field: 'updateBy$', align: 'center',title: '修改人员', hide: true} |
| | | ,{field: 'memo', align: 'center',title: '备注', hide: true} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | ]], |
| | | done: function (data) { |
| | | $('.ew-tree-table-box').css('height', '100%'); |
| | | insTb.expandAll(); |
| | | tbDataList = data; |
| | | } |
| | | }); |
| | | |
| | | /* 表格头工具栏点击事件 */ |
| | | treeTable.on('toolbar(tag)', function (obj) { |
| | | if (obj.event === 'add') { // 添加 |
| | | showEditModel(); |
| | | } else if (obj.event === 'del') { // 删除 |
| | | var checkRows = insTb.checkStatus(); |
| | | if (checkRows.length === 0) { |
| | | layer.msg('请选择要删除的数据', {icon: 2}); |
| | | return; |
| | | } |
| | | var ids = checkRows.map(function (d) { |
| | | if (!d.LAY_INDETERMINATE) { |
| | | return d.id; |
| | | } else { |
| | | return null; |
| | | } |
| | | }); |
| | | doDel({ids: ids}); |
| | | } |
| | | }); |
| | | |
| | | /* 表格操作列点击事件 */ |
| | | treeTable.on('tool(tag)', function (obj) { |
| | | if (obj.event === 'edit') { // 修改 |
| | | showEditModel(obj.data); |
| | | } else if (obj.event === 'del') { // 删除 |
| | | doDel(obj); |
| | | } |
| | | }); |
| | | |
| | | /* 显示表单弹窗 */ |
| | | 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) { |
| | | data.field.parentId = insXmSel.getValue('valueStr'); |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/tag/"+(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}); |
| | | insTb.refresh(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | return false; |
| | | }); |
| | | // 渲染下拉树 |
| | | var insXmSel = xmSelect.render({ |
| | | el: '#tagParentSel', |
| | | height: '250px', |
| | | data: insTb.options.data, |
| | | initValue: mData ? [mData.parentId] : [], |
| | | model: {label: {type: 'text'}}, |
| | | prop: { |
| | | name: 'name', |
| | | value: 'id' |
| | | }, |
| | | radio: true, |
| | | clickClose: true, |
| | | tree: { |
| | | show: true, |
| | | indent: 15, |
| | | strict: false, |
| | | expandedKeys: false |
| | | } |
| | | }); |
| | | // 弹窗不出现滚动条 |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | layui.form.render('select'); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /* 删除 */ |
| | | function doDel(obj) { |
| | | layer.confirm('确定要删除选中数据吗?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | }, function (i) { |
| | | layer.close(i); |
| | | var loadIndex = layer.load(2); |
| | | var ids; |
| | | if (obj.data) { |
| | | ids = []; |
| | | ids[0] = obj.data.id; |
| | | } else { |
| | | ids = obj.ids; |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl+"/tag/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}); |
| | | insTb.refresh(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | }); |
| | | </script> |
| | | </body> |
| | | </html> |
| | | |