| | |
| | | return R.ok(locDetls); |
| | | } |
| | | |
| | | @PostMapping("/getBoxLocDateByLocNo") |
| | | @ManagerAuth(memo = "根据包装组号提取一整箱库存") |
| | | public R getBoxLocDateByLocNo(@RequestBody List<String> packageNoList) { |
| | | |
| | | List<LocDetl> locDetls = locDetlMapper.selectList(new EntityWrapper<LocDetl>().in("loc_no", packageNoList)); |
| | | |
| | | return R.ok(locDetls); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void importLocData1(MultipartFile multipartFile) throws IOException { |
| | | EasyExcel.read(multipartFile.getInputStream(), LocMat.class, |
| | |
| | | return R.ok(stockOut); |
| | | } |
| | | |
| | | @RequestMapping(value = "/stock/boxOut/list/auth") |
| | | @ManagerAuth |
| | | public R boxOut(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam Map<String, Object> param){ |
| | | if (!Cools.isEmpty(param.get("modi_time"))){ |
| | | String val = String.valueOf(param.get("modi_time")); |
| | | if (val.contains(RANGE_TIME_LINK)) { |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | param.put("startTime", DateUtils.convert(dates[0])); |
| | | param.put("endTime", DateUtils.convert(dates[1])); |
| | | param.remove("modi_time"); |
| | | } |
| | | } |
| | | param.put("matnr","空箱"); |
| | | Page<LocDetl> stockOut = locDetlService.getStockOut(toPage(curr, limit, param, LocDetl.class)); |
| | | if (stockOut.getRecords().size()==0){ |
| | | stockOut = locDetlService.getStockOut(toPage(1, limit, param, LocDetl.class)); |
| | | } |
| | | return R.ok(stockOut); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locDetl/list/auth")// /locDetl/list/auth 接口问题 |
| | | @ManagerAuth |
| | | public R list(@RequestParam(defaultValue = "1")Integer curr, |
| | |
| | | |
| | | } |
| | | |
| | | @RequestMapping(value = "/boxMat/list/auth") |
| | | @ManagerAuth |
| | | public R listBox(@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 tagIdObj = param.get("tag_id"); |
| | | if (Cools.isEmpty(tagIdObj)) { |
| | | tagIdObj = getOriginTag().getId(); |
| | | } |
| | | |
| | | String tagId = String.valueOf(tagIdObj); |
| | | |
| | | |
| | | |
| | | return R.ok(matService.getPage( |
| | | new Page<>(curr, limit), |
| | | tagId, |
| | | param.get("matnr"), |
| | | param.get("memo") |
| | | )); |
| | | } |
| | | |
| | | |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | |
| | | return mobileService.pdaFxprk(param, getUserId()); |
| | | } |
| | | |
| | | @PostMapping("/pdaBoxIn") |
| | | @ManagerAuth(memo = "pda空箱入库") |
| | | public synchronized R pdaBoxIn(@RequestBody BoxInParam param) { |
| | | |
| | | return mobileService.pdaBoxIn(param, getUserId()); |
| | | } |
| | | |
| | | @PostMapping("/pdaGetMemo") |
| | | @ManagerAuth(memo = "pda获取木箱资料") |
| | | public synchronized List<Map<String, Object>> pdaGetMemo() { |
| | | return mobileService.pdaGetMemo(); |
| | | } |
| | | |
| | | @PostMapping("/pdaFhhd") |
| | | @ManagerAuth(memo = "pda发货核对") |
| | | public synchronized R pdaFhhd(@RequestBody PdaDhhdParam param) { |
New file |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class BoxInParam { |
| | | private String barcode; // 托盘码 |
| | | private Integer palletizingNo;// 码垛位编号 |
| | | |
| | | private String batch; //尺寸 |
| | | private String memo; // 备注 |
| | | private Double anfme; |
| | | } |
| | |
| | | @Repository |
| | | public interface MatMapper extends BaseMapper<Mat> { |
| | | |
| | | List<Mat> listByPage(Page page, @Param("tagId") String tagId, @Param("matnr") Object matnr, @Param("maktx") Object maktx); |
| | | List<Mat> listByPage(Page page, @Param("tagId") String tagId, @Param("matnr") Object matnr, @Param("memo") Object memo); |
| | | List<Mat> listByPage2(Page page, @Param("tagId") String tagId, @Param("matnr") Object matnr, @Param("maktx") Object maktx, @Param("specs") Object specs); |
| | | |
| | | Mat selectByMatnr(@Param("matnr")String matnr); |
| | |
| | | @Update("update man_mat set origin= #{boxPos},barcode=#{barcode} where brand= #{packageGroupNo}") |
| | | Integer updateBoxPos(@Param("packageGroupNo") String packageGroupNo, @Param("boxPos") String boxPos,@Param("barcode") String barcode); |
| | | |
| | | List<Map<String, Object>> getBoxMemoMap(@Param("tagIds") List<Integer> tagIds); |
| | | } |
| | |
| | | |
| | | public interface MatService extends IService<Mat> { |
| | | |
| | | Page<Mat> getPage(Page page, String tagId, Object matnr, Object maktx); |
| | | Page<Mat> getPage(Page page, String tagId, Object matnr,Object memo); |
| | | Page<Mat> getPage2(Page page, String tagId, Object matnr, Object maktx, Object specs); |
| | | |
| | | Mat selectByMatnr(String matnr); |
| | |
| | | |
| | | Page<Mat> getMatTurnPage(Page<Mat> page); |
| | | |
| | | |
| | | } |
| | |
| | | R pdaFxprk(GwmsGenerateInventoryDto param, Long userId); |
| | | |
| | | /** |
| | | * pda空箱入库 |
| | | */ |
| | | R pdaBoxIn(BoxInParam param, Long userId); |
| | | |
| | | /** |
| | | * 盘点异常按实物调整库存信息 |
| | | */ |
| | | R pdtz(PdtzParam param); |
| | |
| | | * 发货核对 |
| | | */ |
| | | R pdaFhhd(PdaDhhdParam param,Long userId); |
| | | |
| | | List<Map<String, Object>> pdaGetMemo(); |
| | | } |
| | |
| | | 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)); |
| | | public Page<Mat> getPage(Page page, String tagId, Object matnr, Object memo) { |
| | | return page.setRecords(baseMapper.listByPage(page, tagId, matnr, memo)); |
| | | } |
| | | @Override |
| | | public Page<Mat> getPage2(Page page, String tagId, Object matnr, Object maktx, Object specs) { |
| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | return R.ok("反修入库成功"); |
| | | } |
| | | |
| | | @Override |
| | | public R pdaBoxIn(BoxInParam param, Long userId) { |
| | | |
| | | if (Cools.isEmpty(param.getBarcode())) { |
| | | throw new CoolException("条码不能为空:" + param.getBarcode()); |
| | | } |
| | | |
| | | int zpalletCount = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet", param.getBarcode())); |
| | | if (zpalletCount > 0) { |
| | | throw new CoolException("库存托盘码已存在:" + param.getBarcode()); |
| | | } |
| | | |
| | | int barcodeCount = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("barcode", param.getBarcode())); |
| | | if (barcodeCount > 0) { |
| | | throw new CoolException("工作档已存在该托盘码:" + param.getBarcode()); |
| | | } |
| | | |
| | | LocTypeDto locTypeDto = new LocTypeDto(); |
| | | locTypeDto.setLocType1((short) 1); |
| | | int iotype = 1; //空箱 |
| | | |
| | | // 根据源站点寻找库位 |
| | | StartupDto dto = commonService.getLocNo(iotype, param.getPalletizingNo(), locTypeDto, 0); |
| | | |
| | | int workNo = dto.getWorkNo(); |
| | | Date now = new Date(); |
| | | // 生成工作档 |
| | | WrkMast wrkMast = new WrkMast(); |
| | | wrkMast.setWrkNo(workNo); |
| | | wrkMast.setIoTime(new Date()); |
| | | wrkMast.setWrkSts(1L); // 工作状态:设备上走 |
| | | wrkMast.setIoType(iotype); // 入出库状态:1.入库 |
| | | wrkMast.setIoPri(13D); // 优先级 |
| | | wrkMast.setCrnNo(dto.getCrnNo()); |
| | | wrkMast.setSourceStaNo(param.getPalletizingNo()); |
| | | wrkMast.setStaNo(dto.getStaNo()); |
| | | wrkMast.setLocNo(dto.getLocNo()); |
| | | wrkMast.setBarcode(param.getBarcode()); // 托盘码 |
| | | wrkMast.setFullPlt("Y"); // 满板:Y |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setEmptyMk("Y"); // 空板 |
| | | wrkMast.setLinkMis("Y"); |
| | | wrkMast.setCtnType(1); // 容器类型 |
| | | // 操作人员数据 |
| | | wrkMast.setAppeTime(now); |
| | | wrkMast.setAppeUser(userId); |
| | | wrkMast.setModiTime(now); |
| | | wrkMast.setModiUser(userId); |
| | | wrkMastService.insert(wrkMast); |
| | | |
| | | if (!Cools.isEmpty(param.getBatch())) { |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | wrkDetl.setMatnr("空箱"); |
| | | wrkDetl.setWrkNo(wrkMast.getWrkNo()); |
| | | wrkDetl.setWrkNo(wrkMast.getWrkNo()); |
| | | wrkDetl.setBatch(param.getBatch()); // 尺寸 |
| | | wrkDetl.setZpallet(param.getBarcode()); // 托盘码 |
| | | wrkDetl.setBarcode(param.getBarcode()); |
| | | wrkDetl.setMemo(param.getMemo()); //备注 |
| | | wrkDetl.setAnfme(param.getAnfme()); |
| | | wrkDetl.setIoTime(now); |
| | | wrkDetl.setAppeTime(now); |
| | | wrkDetl.setAppeUser(userId); |
| | | wrkDetl.setModiUser(userId); |
| | | wrkDetl.setModiTime(now); |
| | | if (!wrkDetlService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作明细失败"); |
| | | } |
| | | } |
| | | |
| | | // 更新目标库位状态 |
| | | LocMast locMast = locMastService.selectById(dto.getLocNo()); |
| | | if (locMast.getLocSts().equals("O")) { |
| | | locMast.setLocSts("S"); // S.入库预约 |
| | | locMast.setModiTime(now); |
| | | if (!locMastService.updateById(locMast)) { |
| | | throw new CoolException("改变库位状态失败"); |
| | | } |
| | | } else { |
| | | throw new CoolException(dto.getLocNo() + "目标库位已被占用"); |
| | | } |
| | | |
| | | // 返回GWCS目标信息 |
| | | openServiceImpl.pushStaNoToGwcs(param.getPalletizingNo(), dto.getStaNo(), dto.getWorkNo(), param.getBarcode(), "一楼空箱入库推送gwcs"); |
| | | |
| | | return R.ok("空箱入库成功"); |
| | | } |
| | | |
| | | private void pushFxrkToMes(GwmsGenerateInventoryDto param) { |
| | | |
| | | for (GwmsGenerateInventoryDto.MatList matList : param.getMatList()){ |
| | |
| | | * 调整库存明细 |
| | | */ |
| | | @Transactional |
| | | void insertLocDetl(String locNo, String barcode, List<PdtzParam.MatList> matList) { |
| | | public void insertLocDetl(String locNo, String barcode, List<PdtzParam.MatList> matList) { |
| | | Date now = new Date(); |
| | | for (PdtzParam.MatList mat : matList) { |
| | | LocDetl locDetl = new LocDetl(); |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> pdaGetMemo() { |
| | | List<Integer> tagIds = Arrays.asList(7, 8); |
| | | List<Map<String, Object>> raw = matMapper.getBoxMemoMap(tagIds); |
| | | |
| | | // 用 Map<String, List<String>> 分组 |
| | | Map<String, List<String>> grouped = new HashMap<>(); |
| | | for (Map<String, Object> row : raw) { |
| | | String tagId = String.valueOf(row.get("tag_id")); |
| | | String memo = String.valueOf(row.get("memo")); |
| | | if (memo == null || "null".equalsIgnoreCase(memo)) continue; |
| | | |
| | | grouped.computeIfAbsent(tagId, k -> new ArrayList<>()).add(memo); |
| | | } |
| | | |
| | | // 转成 List<Map<String, Object>> 结构返回 |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (Map.Entry<String, List<String>> entry : grouped.entrySet()) { |
| | | Map<String, Object> item = new HashMap<>(); |
| | | item.put("tagId", entry.getKey()); |
| | | item.put("memos", entry.getValue()); |
| | | result.add(item); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | // 获取库位明细 |
| | | List<LocDetlDto> locDetlDtos = new ArrayList<>(); |
| | | for (StockOutParam.LocDetl paramLocDetl : param.getLocDetls()) { |
| | | LocDetl one = new LocDetl(); |
| | | // if (!Cools.isEmpty(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getCount())) { |
| | | LocDetl one = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no",paramLocDetl.getLocNo()) |
| | | one = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no",paramLocDetl.getLocNo()) |
| | | .eq("brand",paramLocDetl.getBrand()).eq("model",paramLocDetl.getModel())); |
| | | // selectItem(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getBatch()); |
| | | if (null != one) { |
| | | if(paramLocDetl.getMatnr().equals("空箱")){ |
| | | one= locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no",paramLocDetl.getLocNo())); |
| | | } |
| | | if (null != one && !paramLocDetl.getMatnr().equals("空箱")) { |
| | | if(!"合格".equals(one.getThreeCode())) { |
| | | throw new CoolException(one.getModel() + "卷不合格:" + one.getThreeCode() ); |
| | | } |
| | | locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount(), param.getOrderNo())); |
| | | }else{ |
| | | locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount(), param.getOrderNo())); |
| | | } |
| | | // } |
| | |
| | | } |
| | | // 入库 + 库位转移 |
| | | if (wrkMast.getIoType() < 60) { |
| | | wrkMast.setWrkSts(5L); |
| | | wrkMast.setWrkSts(4L); |
| | | // 出库 |
| | | } else if (wrkMast.getIoType() > 100 && wrkMast.getIoType() != 103 && wrkMast.getIoType() != 107 && wrkMast.getIoType() != 109) { |
| | | wrkMast.setWrkSts(14L); |
| | |
| | | locDetl.setBarcode(wrkMast.getBarcode()); |
| | | locDetl.setModiTime(now); |
| | | locDetl.setAppeTime(now); |
| | | locDetl.setBatch(""); |
| | | // locDetl.setBatch(""); |
| | | if (!locDetlService.insert(locDetl)) { |
| | | // exceptionHandle("全板入库 ===>> 添加库存明细失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | |
| | | FROM man_mat mm |
| | | LEFT JOIN man_tag mt ON mm.tag_id = mt.id |
| | | LEFT JOIN ( |
| | | select |
| | | SELECT |
| | | matnr, |
| | | sum(anfme) as amount |
| | | from man_loc_detl |
| | | group by matnr |
| | | ) as mld on mld.matnr = mm.matnr |
| | | SUM(anfme) AS amount |
| | | FROM man_loc_detl |
| | | GROUP BY matnr |
| | | ) AS mld ON mld.matnr = mm.matnr |
| | | WHERE 1=1 |
| | | and (mm.memo is null or mm.memo != '打包上线') |
| | | <!-- ✅ 屏蔽 tag_id = 6 --> |
| | | AND mt.id != 6 |
| | | |
| | | <!-- ✅ 判断是否在路径中 or 本身 id 匹配 --> |
| | | AND (CHARINDEX(','+#{tagId}+',', ','+mt.path+',') > 0 OR mt.id = #{tagId}) |
| | | |
| | | <if test="matnr != null and matnr != ''"> |
| | | and mm.matnr like concat('%',#{matnr},'%') |
| | | AND mm.matnr LIKE CONCAT('%', #{matnr}, '%') |
| | | </if> |
| | | <if test="maktx != null and maktx != ''"> |
| | | and mm.maktx like concat('%',#{maktx},'%') |
| | | <if test="memo != null and memo != ''"> |
| | | AND mm.memo LIKE CONCAT('%', #{memo}, '%') |
| | | </if> |
| | | ORDER BY mm.create_time DESC |
| | | </select> |
| | | |
| | | |
| | | <select id="listByPage2" resultMap="BaseResultMap"> |
| | | SELECT |
| | |
| | | ) t where t.matNo between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | </select> |
| | | |
| | | |
| | | <select id="getBoxMemoMap" resultType="map"> |
| | | SELECT tag_id, memo |
| | | FROM man_mat |
| | | WHERE tag_id IN |
| | | <foreach item="id" collection="tagIds" open="(" close=")" separator=","> |
| | | #{id} |
| | | </foreach> |
| | | </select> |
| | | |
| | | |
| | | <select id="getStockOutPageCount" parameterType="java.util.Map" resultType="java.lang.Integer"> |
| | | select |
| | | count(1) |
| | |
| | | // ,{field: 'anfme', align: 'center',title: '数量',hide: true} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码'} |
| | | ,{field: 'matnr', align: 'center',title: '规格', sort:true,width: 150} |
| | | ,{field: 'batch', align: 'center',title: '空箱尺寸', hide: true} |
| | | ,{field: 'memo', align: 'center',title: '空箱备注', hide: true} |
| | | ,{field: 'brand', align: 'center',title: '包装组号', hide: false,width: 150} |
| | | ,{field: 'model', align: 'center',title: '卷号', hide: false,width: 150} |
| | | ,{field: 'unit', align: 'center',title: '箱号', hide: false,width: 150} |
| | |
| | | ,{field: 'volume', align: 'center',title: '单箱毛重', hide: true} |
| | | ,{field: 'specs', align: 'center',title: '接头', hide:true} |
| | | ,{field: 'deadWarn$', align: 'center',title: '理货状态', hide: false} |
| | | |
| | | |
| | | ,{ |
| | | field: 'threeCode', |
| | | align: 'center', |
New file |
| | |
| | | var pageCurr; |
| | | var printMatCodeNos = []; |
| | | var admin; |
| | | function getCol() { |
| | | var cols = [ |
| | | {type: 'checkbox'} |
| | | ,{field: 'tagId$', align: 'center',title: '归类', templet: '#tagTpl'} |
| | | ,{field: 'memo', align: 'center',title: '木箱资料',hide:false} |
| | | ]; |
| | | // 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+'/boxMat/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) { |
| | | console.log(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 locDetlLayerIdx; |
| | | var locDetlData = []; |
| | | var admin; |
| | | function getCol() { |
| | | var cols = [ |
| | | // {field: 'count', align: 'center',title: '出库数量', edit:'text', width: 130, style:'color: blue;font-weight: bold'}, |
| | | {field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'locNo$', align: 'center',title: '库位号'} |
| | | ,{field: 'batch', align: 'center',title: '木箱尺寸'} |
| | | ,{field: 'memo', align: 'center',title: '木箱备注'} |
| | | ]; |
| | | // cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width: 80}) |
| | | return cols; |
| | | } |
| | | |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var form = layui.form; |
| | | admin = layui.admin; |
| | | |
| | | tableIns = table.render({ |
| | | elem: '#chooseData', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | data: [], |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | limit: 500, |
| | | cols: [getCol()], |
| | | done: function(res, curr, count) { |
| | | limit(); |
| | | getOutBound(); |
| | | } |
| | | }); |
| | | |
| | | // 页面修改 |
| | | table.on('edit(chooseData)', function (obj) { |
| | | let index = obj.tr.attr("data-index"); |
| | | let data = locDetlData[index]; |
| | | let modify = true; |
| | | // if (obj.field === 'count'){ |
| | | // let vle = Number(obj.value); |
| | | // if (isNaN(vle)) { |
| | | // layer.msg("请输入数字", {icon: 2}); |
| | | // modify = false; |
| | | // } else { |
| | | // if (vle <= 0) { |
| | | // layer.msg("数量必须大于零", {icon: 2}); |
| | | // modify = false; |
| | | // } |
| | | // if (vle > Number(data.anfme)) { |
| | | // layer.msg("出库数量不得大于库存数量", {icon: 2}); |
| | | // modify = false; |
| | | // } |
| | | // } |
| | | // } |
| | | if (modify) { |
| | | data[obj.field] = obj.value; |
| | | } |
| | | tableIns.reload({data: locDetlData}); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(chooseData)', function (obj) { |
| | | switch (obj.event) { |
| | | case 'outbound': |
| | | if (locDetlData.length === 0){ |
| | | layer.msg('请先提取商品库存', {icon: 2}); |
| | | } else { |
| | | var staNo = $("#staNoSelect").val(); |
| | | if (staNo === "" || staNo === null){ |
| | | layer.msg("请选择出库口", {icon: 2}); |
| | | return; |
| | | } |
| | | let param = { |
| | | outSite: staNo, |
| | | locDetls: locDetlData |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl+"/plate/out/start", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | locDetlData = []; |
| | | tableIns.reload({data: locDetlData,done:function (res) {limit();getOutBound();}}); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(chooseData)', function(obj){ |
| | | switch (obj.event) { |
| | | case 'remove': |
| | | let index = obj.tr.attr("data-index"); |
| | | locDetlData.splice(index, 1); |
| | | tableIns.reload({data: locDetlData}); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 获取出库口 |
| | | function getOutBound(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/available/take/site", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | var tpl = $("#takeSiteSelectTemplate").html(); |
| | | var template = Handlebars.compile(tpl); |
| | | var html = template(res); |
| | | $('#staNoSelect').append(html); |
| | | form.render('select'); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | $(document).on('click','#mat-query', function () { |
| | | let loadIndex = layer.msg('请求中...', {icon: 16, shade: 0.01, time: false}); |
| | | locDetlLayerIdx = layer.open({ |
| | | type: 2, |
| | | title: false, |
| | | closeBtn: false, |
| | | maxmin: false, |
| | | area: ['90%', '85%'], |
| | | shadeClose: true, |
| | | content: 'boxQuery.html', |
| | | success: function(layero, index){ |
| | | layer.close(loadIndex); |
| | | } |
| | | }); |
| | | }) |
| | | |
| | | }) |
| | | |
| | | // 添加表格数据 |
| | | function addTableData(data) { |
| | | let newData = []; |
| | | |
| | | for (let i = 0; i < data.length; i++) { |
| | | let item = data[i]; |
| | | let exist = locDetlData.some(old => |
| | | (old.locNo$ === item.locNo$ || old.locNo === item.locNo) |
| | | ); |
| | | |
| | | if (!exist) { |
| | | item.count = item.anfme; |
| | | newData.push(item); |
| | | } |
| | | } |
| | | |
| | | locDetlData = locDetlData.concat(newData); |
| | | console.log("传入表格数据长度:", locDetlData.length, locDetlData); |
| | | tableIns.reload({data: locDetlData}); |
| | | layer.close(locDetlLayerIdx); |
| | | } |
| | | |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/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="name" 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="memo" 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="specs" 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/boxMat.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="memo" 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="weight" placeholder="请输入总重量" class="layui-input">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">单箱体积</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input name="volume" 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="memo" placeholder="请输入备注" class="layui-input">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">单箱毛重</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input name="length" placeholder="请输入单箱毛重" class="layui-input">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">单箱体积</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input name="threeCode" 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> |
| | | |
| | | <!--<!– 打印操作弹窗 –>--> |
| | | <!--<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> |
| | | |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/common.css" media="all"> |
| | | <style> |
| | | html { |
| | | height: 100%; |
| | | padding: 10px; |
| | | background-color: #f1f1f1; |
| | | box-sizing: border-box; |
| | | } |
| | | body { |
| | | background-color: #fff; |
| | | border-radius: 5px; |
| | | box-shadow: 0 0 3px rgba(0,0,0,.3); |
| | | padding-bottom: 20px; |
| | | } |
| | | |
| | | #staNoSpan { |
| | | text-align: center; |
| | | display: inline-block; |
| | | width: 100px; |
| | | font-size: 13px; |
| | | } |
| | | .layui-btn-container .layui-form-select { |
| | | display: inline-block; |
| | | width: 150px; |
| | | height: 30px; |
| | | } |
| | | .layui-btn-container .layui-form-select.layui-form-selected { |
| | | display: inline-block; |
| | | width: 150px; |
| | | } |
| | | .layui-btn-container .layui-select-title input { |
| | | font-size: 13px; |
| | | } |
| | | .layui-btn-container .layui-anim.layui-anim-upbit dd { |
| | | font-size: 13px; |
| | | } |
| | | |
| | | #btn-outbound { |
| | | margin-left: 60px; |
| | | display: none; |
| | | } |
| | | |
| | | /*----------------------------------*/ |
| | | .function-area { |
| | | padding: 20px 50px; |
| | | } |
| | | .function-btn { |
| | | font-size: 16px; |
| | | padding: 1px 2px; |
| | | width: 100px; |
| | | height: 50px; |
| | | border-color: #2b425b; |
| | | border-radius: 4px; |
| | | border-width: 2px; |
| | | background: none; |
| | | border-style: solid; |
| | | transition: 0.4s; |
| | | cursor: pointer; |
| | | letter-spacing: 1.5px; |
| | | } |
| | | .function-btn:hover { |
| | | background-color: #2b425b; |
| | | color: #fff; |
| | | } |
| | | |
| | | #mat-query { |
| | | display: none; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | |
| | | <!-- 功能区 --> |
| | | <div class="function-area"> |
| | | <button id="mat-query" class="function-btn">提取库存</button> |
| | | </div> |
| | | |
| | | <hr> |
| | | |
| | | <!-- 表格 --> |
| | | <div style="padding-bottom: 5px; margin-bottom: 45px"> |
| | | |
| | | <!-- 头部 --> |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-form"> |
| | | <div class="layui-btn-container"> |
| | | <!-- 1.选择出库口 --> |
| | | <span id="staNoSpan">出库口:</span> |
| | | <select id="staNoSelect" lay-verify="required"> |
| | | <option value="">请选择站点</option> |
| | | </select> |
| | | <!-- 2.启动出库 --> |
| | | <button class="layui-btn layui-btn-lg" id="btn-outbound" lay-event="outbound">启动出库</button> |
| | | </div> |
| | | </div> |
| | | </script> |
| | | |
| | | <!-- 行 --> |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="remove">移除</a> |
| | | </script> |
| | | |
| | | <table class="layui-table" id="chooseData" lay-filter="chooseData"></table> |
| | | </div> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/jquery/jQuery.print.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/handlebars/handlebars-v4.5.3.js"></script> |
| | | <script type="text/javascript" src="../../static/js/pakStore/boxOut.js" charset="utf-8"></script> |
| | | |
| | | <script type="text/template" id="takeSiteSelectTemplate"> |
| | | {{#each data}} |
| | | <option value="{{siteId}}">{{desc}}</option> |
| | | {{/each}} |
| | | </script> |
| | | </body> |
| | | </html> |
| | | |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/common.css" media="all"> |
| | | <style> |
| | | body { |
| | | } |
| | | .layui-table-box { |
| | | border-right: 1px solid #9F9F9F; |
| | | border-left: 1px solid #9F9F9F; |
| | | } |
| | | |
| | | #search-box { |
| | | padding: 30px 0 20px 0; |
| | | } |
| | | #search-box .layui-inline:first-child { |
| | | margin-left: 30px; |
| | | } |
| | | #search-box .layui-inline { |
| | | margin-right: 5px; |
| | | } |
| | | |
| | | #data-search-btn { |
| | | margin-left: 10px; |
| | | display: inline-block; |
| | | } |
| | | #data-search-btn.layui-btn-container .layui-btn { |
| | | margin-right: 20px; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <div style="padding: 25px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;"> |
| | | <span style="font-size: large; font-weight: bold">提取库存商品</span> |
| | | </div> |
| | | <!-- 搜索栏 --> |
| | | <fieldset class="layui-elem-field site-demo-button" style="margin: 20px;"> |
| | | <legend>搜索栏</legend> |
| | | <!-- 搜索栏 --> |
| | | <div id="search-box" class="layui-form layui-card-header"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="crnNo" class="layui-input" name="crnNo" type="text" placeholder="请输入" autocomplete="off" style="display: none"> |
| | | <input id="crnNo$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="堆垛机号" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="basCrnpQueryBycrnNo" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="basCrnpQueryBycrnNoSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="loc_no" placeholder="库位号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <input class="layui-input" type="text" name="matnr" placeholder="空箱" autocomplete="off">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="batch" placeholder="尺寸" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="memo" placeholder="备注" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- 日期范围 --> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input layui-laydate-range" name="modi_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |
| | | </div> |
| | | </div> |
| | | <!-- 待添加 --> |
| | | <div id="data-search-btn" class="layui-btn-container layui-form-item" style="display: inline-block"> |
| | | <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索</button> |
| | | </div> |
| | | </div> |
| | | </fieldset> |
| | | |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn" id="btn-confirm" lay-event="confirm" style="">提取</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <div class="layui-form"> |
| | | <table class="layui-hide" id="stockOut" lay-filter="stockOut"></table> |
| | | </div> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | |
| | | </body> |
| | | <script> |
| | | |
| | | function getCol() { |
| | | var cols = [ |
| | | {type: 'checkbox', merge: ['locNo']} |
| | | ,{field: 'locNo', align: 'center',title: '库位号', merge: true, style: 'font-weight: bold'} |
| | | ,{field: 'matnr', align: 'center',title: '物料类型',style: 'font-weight: bold'} |
| | | ,{field: 'batch', align: 'center',title: '木箱尺寸',style: 'font-weight: bold'} |
| | | ,{field: 'memo', align: 'center',title: '木箱备注',style: 'font-weight: bold'} |
| | | ,{field: 'anfme', align: 'center',title: '数量',style: 'font-weight: bold'} |
| | | |
| | | ]; |
| | | cols.push({field: 'modiUser$', align: 'center',title: '修改人员',hide:true} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间'}) |
| | | return cols; |
| | | } |
| | | |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin', 'tableMerge'], function() { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | var tableMerge = layui.tableMerge; |
| | | var dataSource = [] |
| | | |
| | | // 数据渲染 |
| | | locDetlTableIns = table.render({ |
| | | elem: '#stockOut', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/stock/boxOut/list/auth', |
| | | page: true, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | limit: 16, |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [getCol()], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit', |
| | | }, |
| | | parseData: function (res) { |
| | | dataSource = res.data.records |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | tableMerge.render(this); |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(stockOut)', function (obj) { |
| | | |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | var data = checkStatus.data; |
| | | var dataList = [] |
| | | for (var j = 0; j < data.length; j++) { |
| | | var locno = data[j].locNo |
| | | for(var i = 0;i < dataSource.length; i++) { |
| | | if (dataSource[i].locNo === locno) { |
| | | dataList.push(dataSource[i]) |
| | | } |
| | | } |
| | | } |
| | | |
| | | switch(obj.event) { |
| | | case 'confirm': |
| | | if (data.length === 0){ |
| | | layer.msg("请选择数据"); |
| | | return; |
| | | } |
| | | |
| | | const reqDate = [...new Set(dataList.map(obj => obj.locNo))] |
| | | $.ajax({ |
| | | url: baseUrl+"/getBoxLocDateByLocNo", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(reqDate), |
| | | contentType:'application/json;charset=UTF-8', |
| | | dataType:'json', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | console.log(res) |
| | | parent.addTableData(res.data); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 搜索栏搜索事件 |
| | | form.on('submit(search)', function (data) { |
| | | tableReload(); |
| | | }); |
| | | |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | }); |
| | | }) |
| | | |
| | | function tableReload() { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | locDetlTableIns.reload({ |
| | | where: searchData, |
| | | }); |
| | | } |
| | | </script> |
| | | </html> |
| | | |
| | |
| | | <input class="layui-input" type="text" name="unit" placeholder="箱号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="matnr" placeholder="空箱" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="batch" placeholder="尺寸" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="memo" placeholder="备注" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- 日期范围 --> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |