| | |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.FrozenParam; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.LocOwner; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.param.AbnormalLocDetlParam; |
| | |
| | | import com.zy.asrs.entity.result.LocDetlDTO; |
| | | import com.zy.asrs.mapper.LocDetlMapper; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.LocOwnerService; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.common.web.BaseController; |
| | |
| | | |
| | | @Autowired |
| | | private LocOwnerService locOwnerService; |
| | | |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | |
| | | @RequestMapping(value = "/locDetl/update") |
| | | public R update1() { |
| | |
| | | // } |
| | | // } |
| | | excludeTrash(param); |
| | | // 处理 mk 字段查询(需要关联 LocMast 表) |
| | | Object mkParam = param.get("mk"); |
| | | if (!Cools.isEmpty(mkParam)) { |
| | | String mkValue = String.valueOf(mkParam); |
| | | EntityWrapper<LocMast> locMastWrapper = new EntityWrapper<>(); |
| | | if ("Y".equals(mkValue)) { |
| | | locMastWrapper.eq("mk", "Y"); |
| | | } else { |
| | | locMastWrapper.ne("mk", "Y"); |
| | | } |
| | | // 查询符合条件的库位号列表 |
| | | List<LocMast> locMastList = locMastService.selectList(locMastWrapper); |
| | | if (locMastList != null && !locMastList.isEmpty()) { |
| | | List<String> locNos = new ArrayList<>(); |
| | | for (LocMast locMast : locMastList) { |
| | | if (!Cools.isEmpty(locMast.getLocNo())) { |
| | | locNos.add(locMast.getLocNo()); |
| | | } |
| | | } |
| | | if (!locNos.isEmpty()) { |
| | | wrapper.in("loc_no", locNos); |
| | | } else { |
| | | // 如果没有符合条件的库位,返回空结果 |
| | | wrapper.eq("1", "0"); |
| | | } |
| | | } else { |
| | | // 如果没有符合条件的库位,返回空结果 |
| | | wrapper.eq("1", "0"); |
| | | } |
| | | // 移除 mk 参数,避免在 convert 方法中重复处理 |
| | | param.remove("mk"); |
| | | } |
| | | convert(param, wrapper); |
| | | allLike(LocDetl.class, param.keySet(), wrapper, condition); |
| | | // 在 allLike 中排除 mk 字段,因为 mk 字段在 LocMast 表中 |
| | | Set<String> excludeFields = new HashSet<>(param.keySet()); |
| | | excludeFields.add("mk"); // 确保 mk 字段被排除 |
| | | allLike(LocDetl.class, excludeFields, wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | // if (!row.equals("")){ |
| | | // wrapper.and() |
| | | // .where("loc_no like '" +row +"%'"); |
| | | // } |
| | | return R.ok(locDetlService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | Page<LocDetl> page = locDetlService.selectPage(new Page<>(curr, limit), wrapper); |
| | | // 填充 mk 字段(是否盘点状态) |
| | | if (page != null && page.getRecords() != null && !page.getRecords().isEmpty()) { |
| | | // 收集所有库位号 |
| | | Set<String> locNos = new HashSet<>(); |
| | | for (LocDetl locDetl : page.getRecords()) { |
| | | if (!Cools.isEmpty(locDetl.getLocNo())) { |
| | | locNos.add(locDetl.getLocNo()); |
| | | } |
| | | } |
| | | // 批量查询库位信息 |
| | | if (!locNos.isEmpty()) { |
| | | Map<String, String> locMkMap = new HashMap<>(); |
| | | for (String locNo : locNos) { |
| | | com.zy.asrs.entity.LocMast locMast = locMastService.selectById(locNo); |
| | | if (locMast != null) { |
| | | locMkMap.put(locNo, locMast.getMk()); |
| | | } |
| | | } |
| | | // 填充 mk 字段 |
| | | for (LocDetl locDetl : page.getRecords()) { |
| | | if (!Cools.isEmpty(locDetl.getLocNo())) { |
| | | locDetl.setMk(locMkMap.get(locDetl.getLocNo())); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return R.ok(page); |
| | | } |
| | | |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String key = entry.getKey(); |
| | | // 排除 mk 字段,因为 mk 字段在 LocMast 表中,不在 LocDetl 表中 |
| | | if ("mk".equals(key)) { |
| | | continue; |
| | | } |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else if (entry.getKey().equals("loc_no")){ |
| | | wrapper.like(entry.getKey(), val); |
| | | } else if (entry.getKey().equals("mk")){ |
| | | // 处理是否盘点查询 |
| | | if ("Y".equals(val)){ |
| | | wrapper.eq("mk", "Y"); |
| | | } else { |
| | | // 未盘点:mk != 'Y' 或者 mk is null |
| | | wrapper.ne("mk", "Y"); |
| | | } |
| | | } else { |
| | | if (entry.getKey().equals("loc_type1")){ |
| | | sign=true; |
| | |
| | | return R.error("初始化失败===>"+e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/locMast/clearMk/auth") |
| | | @ManagerAuth(memo = "清除盘点状态") |
| | | public R clearMk(@RequestBody Map<String, Object> param) { |
| | | List<String> locNos = (List<String>) param.get("locNos"); |
| | | if (Cools.isEmpty(locNos)) { |
| | | return R.error("库位号列表不能为空"); |
| | | } |
| | | try { |
| | | // 批量更新 mk 字段为 'N' |
| | | for (String locNo : locNos) { |
| | | LocMast locMast = locMastService.selectById(locNo); |
| | | if (!Cools.isEmpty(locMast)) { |
| | | locMast.setMk("N"); |
| | | locMast.setModiUser(getUserId()); |
| | | locMast.setModiTime(new Date()); |
| | | locMastService.updateById(locMast); |
| | | } |
| | | } |
| | | return R.ok("清除盘点状态成功,共处理 " + locNos.size() + " 个库位"); |
| | | } catch (Exception e) { |
| | | return R.error("清除盘点状态失败:" + e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | |
| | | //库存状态 |
| | | private String cstateid; |
| | | |
| | | @ApiModelProperty(value= "盘点状态") |
| | | @TableField(exist = false) |
| | | private String mk; |
| | | |
| | | public String getLocNo$(){ |
| | | LocMastService service = SpringUtils.getBean(LocMastService.class); |
| | | LocMast locMast = service.selectById(this.locNo); |
| | |
| | | wrkMast.setModiUser(userId); |
| | | wrkMast.setModiTime(now); |
| | | wrkMast.setCrnNo(staDesc.getCrnNo()); |
| | | wrkMast.setMk(locMast.getMk()); |
| | | if (!wrkMastService.insert(wrkMast)) { |
| | | throw new CoolException("保存工作档失败,出库库位号:" + param.getLocNo()); |
| | | } |
| | |
| | | wrkMast.setModiTime(now); |
| | | wrkMast.setAppeUser(userId); |
| | | wrkMast.setModiUser(userId); |
| | | wrkMast.setMk(locMast.getMk()); |
| | | wrkMastService.insert(wrkMast); |
| | | |
| | | Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", combMat.getMatnr())); |
| | |
| | | wrkMast.setModiUser(userId); |
| | | wrkMast.setModiTime(now); |
| | | wrkMast.setBarcode(locMast.getBarcode()); |
| | | wrkMast.setMk(locMast.getMk()); |
| | | if (!wrkMastService.insert(wrkMast)) { |
| | | throw new CoolException("保存工作档失败,出库库位号:" + locDetl.getLocNo()); |
| | | } |
| | |
| | | wrkMast.setModiUser(userId); |
| | | wrkMast.setModiTime(now); |
| | | wrkMast.setPacked(itemId); |
| | | wrkMast.setMk(locMast.getMk()); |
| | | if (!wrkMastService.insert(wrkMast)) { |
| | | throw new CoolException("保存工作档失败,出库库位号:" + dto.getLocNo()); |
| | | } |
| | |
| | | wrkMast.setAppeTime(now); |
| | | wrkMast.setModiUser(userId); |
| | | wrkMast.setModiTime(now); |
| | | wrkMast.setMk(locMast.getMk()); |
| | | if (!wrkMastService.insert(wrkMast)) { |
| | | throw new CoolException("保存工作档失败,出库库位号:" + taskDto.getLocNo()); |
| | | } |
| | |
| | | wrkMast.setAppeTime(now); |
| | | wrkMast.setModiUser(userId); |
| | | wrkMast.setModiTime(now); |
| | | wrkMast.setMk(locMast.getMk()); |
| | | boolean res = wrkMastService.insert(wrkMast); |
| | | if (!res) { |
| | | throw new CoolException("保存工作档失败"); |
| | |
| | | wrkMast.setAppeTime(now); |
| | | wrkMast.setModiUser(1L); |
| | | wrkMast.setModiTime(now); |
| | | wrkMast.setMk(locMast.getMk()); |
| | | wrkMast.setMemo("生成自动空板出库"); |
| | | boolean res = wrkMastService.insert(wrkMast); |
| | | if (!res) { |
| | |
| | | throw new CoolException(firstFrozenLocNo + "库位已被冻结!"); |
| | | } |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetlDtos.get(0).getLocDetl().getLocNo())); |
| | | |
| | | if (locMast.getLocSts().equals("F")) { |
| | | // 启动出库开始 107.盘点出库 |
| | | stockOut(staNo, locDetlDtos, IoWorkType.CHECK_OUT, userId, param.getCheckId(), null); |
| | |
| | | wrkMast.setAppeTime(now); |
| | | wrkMast.setModiUser(9999L); |
| | | wrkMast.setModiTime(now); |
| | | wrkMast.setMk(locMast.getMk()); |
| | | boolean res = wrkMastService.insert(wrkMast); |
| | | if (!res) { |
| | | throw new CoolException("保存工作档失败"); |
| | |
| | | locMast.setLocSts(wrkMast.getFullPlt().equals("Y") ? "F" : "D"); |
| | | locMast.setBarcode(wrkMast.getBarcode()); |
| | | locMast.setIoTime(now); |
| | | //set 盘点字段为Y |
| | | locMast.setMk("Y"); |
| | | locMast.setModiTime(now); |
| | | if (!locMastService.updateById(locMast)) { |
| | | // exceptionHandle("盘点入库 ===>> 修改库位状态失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | |
| | | if (null != sourceLoc) { |
| | | sourceLoc.setBarcode(""); |
| | | sourceLoc.setLocSts("O"); |
| | | sourceLoc.setMk("N"); |
| | | sourceLoc.setModiTime(now); |
| | | sourceLoc.setIoTime(now); |
| | | if (!locMastService.updateById(sourceLoc)) { |
| | |
| | | // 修改目标库位状态 ==> .locSts |
| | | locMast.setLocSts(locSts); |
| | | locMast.setBarcode(wrkMast.getBarcode()); |
| | | locMast.setMk("Y"); |
| | | locMast.setIoTime(now); |
| | | locMast.setModiTime(now); |
| | | if (!locMastService.updateById(locMast)) { |
| | |
| | | // 修改源库位状态 R ===>> O |
| | | if (locMast.getLocSts().equals("R")) { |
| | | locMast.setLocSts("O"); |
| | | //设置盘点字段为N |
| | | locMast.setMk("N"); |
| | | locMast.setBarcode(""); |
| | | locMast.setModiTime(now); |
| | | locMast.setIoTime(now); |
| | |
| | | } |
| | | String column = null; |
| | | if (field.isAnnotationPresent(TableField.class)) { |
| | | column = field.getAnnotation(TableField.class).value(); |
| | | TableField tableField = field.getAnnotation(TableField.class); |
| | | // 如果字段标记为 exist = false,跳过该字段 |
| | | if (!tableField.exist()) { |
| | | continue; |
| | | } |
| | | column = tableField.value(); |
| | | } |
| | | if (Cools.isEmpty(column)) { |
| | | column = field.getName(); |
| | |
| | | wrkMast.setLocNo(dto.getLocNo()); |
| | | wrkMast.setBarcode(param.getBarcode()); // 托盘码 |
| | | wrkMast.setModiTime(now); |
| | | if(wrkMast.getIoType()==57){ |
| | | wrkMast.setMk("Y"); |
| | | } |
| | | wrkMast.setUpdMk("");//允许再次移库 |
| | | if (!wrkMastService.updateById(wrkMast)) { |
| | | throw new CoolException("更新工作档数据状态失败"); |
| | |
| | | |
| | | // 修改库位状态 Q.拣料/盘点/并板再入库 |
| | | locMast.setLocSts("Q"); |
| | | locMast.setMk(wrkMast.getMk()); |
| | | locMast.setModiTime(new Date()); |
| | | if (!locMastService.updateById(locMast)) { |
| | | throw new CoolException("修改库位状态失败"); |
| | |
| | | throw new CoolException(sourceLocMast.getLocNo() + "库位状态不处于P.拣料盘点出库"); |
| | | } |
| | | |
| | | // locMast.setMk(sourceLocMast.getMk()); |
| | | // if (!locMastService.updateById(locMast)) { |
| | | // throw new CoolException("修改是否盘点状态失败"); |
| | | // } |
| | | //获取源库存信息并迁移至新库位 |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>() |
| | | .eq("loc_no", sourceLocMast.getLocNo())); |
| | |
| | | // 修改源库位状态 P ===>> O |
| | | if (sourceLocMast.getLocSts().equals("P")) { |
| | | sourceLocMast.setLocSts("O"); |
| | | //更换盘点标记为N |
| | | sourceLocMast.setMk("N"); |
| | | sourceLocMast.setBarcode(""); |
| | | sourceLocMast.setModiTime(now); |
| | | sourceLocMast.setIoTime(now); |
| | |
| | | <result column="box_type2" property="boxType2" /> |
| | | <result column="box_type3" property="boxType3" /> |
| | | <result column="cstateid" property="cstateid" /> |
| | | <result column="mk" property="mk" /> |
| | | </resultMap> |
| | | |
| | | <sql id="batchSeq"> |
| | |
| | | <if test="standby1!=null and standby1!='' "> |
| | | and a.standby1 like '%' + #{standby1} + '%' |
| | | </if> |
| | | <if test="mk!=null and mk!='' "> |
| | | <if test='mk=="Y"'> |
| | | and b.mk='Y' |
| | | </if> |
| | | <if test='mk=="N"'> |
| | | and (b.mk!='Y' or b.mk is null) |
| | | </if> |
| | | </if> |
| | | </sql> |
| | | |
| | | <select id="getStockOutPage" resultMap="BaseResultMap"> |
| | |
| | | ( |
| | | select |
| | | ROW_NUMBER() over (order by a.appe_time,a.matnr,a.loc_no) as row, |
| | | a.* |
| | | a.*, b.mk |
| | | from asr_loc_detl a |
| | | left join asr_loc_mast b on a.loc_no = b.loc_no |
| | | where 1=1 |
| | |
| | | ,{field: 'supp', align: 'center',title: '客户'} |
| | | ,{field: 'standby1$', align: 'center',title: '仓库'} |
| | | ,{field: 'cstateid$', align: 'center',title: '库存状态'} |
| | | ,{field: 'mk', align: 'center',title: '是否盘点', templet: function(row){ |
| | | if (row.mk === 'Y') { |
| | | return '<span style="color: #5FB878;">已盘点</span>'; |
| | | } else if (row.mk === 'N') { |
| | | return '<span style="color: #999;">未盘点</span>'; |
| | | } else { |
| | | return '<span style="color: #999;">-</span>'; |
| | | } |
| | | }} |
| | | ,{field: 'color', align: 'center',title: '颜色', hide: true} |
| | | ,{field: 'brand', align: 'center',title: '品牌', hide: true} |
| | | ,{field: 'price', align: 'center',title: '单价', hide: true} |
| | |
| | | ,{field: 'model', align: 'center',title: '型号'} |
| | | ,{field: 'standby1$', align: 'center',title: '仓库'} |
| | | ,{field: 'cstateid$', align: 'center',title: '库存状态'} |
| | | ,{field: 'mk', align: 'center',title: '是否盘点', hide:false, templet: function(row){ |
| | | if (row.mk === 'Y') { |
| | | return '<span style="color: #5FB878;">已盘点</span>'; |
| | | } else { |
| | | return '<span style="color: #999;">未盘点</span>'; |
| | | } |
| | | }} |
| | | ,{field: 'color', align: 'center',title: '颜色', hide: true} |
| | | ,{field: 'brand', align: 'center',title: '品牌', hide: true} |
| | | ,{field: 'price', align: 'center',title: '单价', hide: true} |
| | |
| | | }); |
| | | }); |
| | | break; |
| | | case 'clearMk': |
| | | var data = checkStatus.data; |
| | | if (data.length === 0){ |
| | | layer.msg("请选择要清除盘点状态的库存明细", {icon: 2}); |
| | | return; |
| | | } |
| | | // 去重获取库位号列表 |
| | | var locNoSet = new Set(); |
| | | data.forEach(function(elem) { |
| | | if (elem.locNo) { |
| | | locNoSet.add(elem.locNo); |
| | | } |
| | | }); |
| | | var locNoList = Array.from(locNoSet); |
| | | |
| | | layer.confirm('确定要清除所选库位的盘点状态吗?', {icon: 3, title:'提示'}, function(index){ |
| | | $.ajax({ |
| | | url: baseUrl+"/locMast/clearMk/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | contentType: 'application/json;charset=UTF-8', |
| | | data: JSON.stringify({locNos: locNoList}), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | layer.msg("清除盘点状态成功", {icon: 1}); |
| | | tableReload(false); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg || "清除盘点状态失败", {icon: 2}); |
| | | } |
| | | }, |
| | | error: function() { |
| | | layer.msg("请求失败,请稍后重试", {icon: 2}); |
| | | } |
| | | }); |
| | | layer.close(index); |
| | | }); |
| | | break; |
| | | // 冻结 |
| | | case 'frozen': |
| | | let frozenData = checkStatus.data; |
| | |
| | | },width:80, hide:false} |
| | | // ,{field: 'outEnable', align: 'center',title: ''} |
| | | ,{field: 'ioTime$', align: 'center',title: 'ioTime', hide:true} |
| | | ,{field: 'mk', align: 'center',title: '是否盘点', hide:false, templet: function(row){ |
| | | if (row.mk === 'Y') { |
| | | return '<span style="color: #5FB878;">已盘点</span>'; |
| | | } else { |
| | | return '<span style="color: #999;">未盘点</span>'; |
| | | } |
| | | }} |
| | | // ,{field: 'firstTime$', align: 'center',title: '', hide:true} |
| | | ,{field: 'modiUser$', align: 'center',title: '修改人员', hide:true} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间', hide:true} |
| | |
| | | var pageCurr; |
| | | var locNo; |
| | | var locMk; |
| | | layui.use(['table','laydate', 'form'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | |
| | | ,{field: 'locType1$', align: 'center',title: '高低类型', hide:true} |
| | | ,{field: 'locType2$', align: 'center',title: '宽窄类型', hide:true} |
| | | ,{field: 'locType3$', align: 'center',title: '轻重类型', hide:true} |
| | | ,{field: 'mk', align: 'center',title: '是否盘点', hide:false, templet: function(row){ |
| | | if (row.mk === 'Y') { |
| | | return '<span style="color: #5FB878;">已盘点</span>'; |
| | | } else { |
| | | return '<span style="color: #999;">未盘点</span>'; |
| | | } |
| | | }} |
| | | ,{field: 'modiUser$', align: 'center',title: '修改人员', hide:true} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间', width: 180, hide:false} |
| | | ,{ fixed: 'right', title:'操作', align: 'center', toolbar: '#operate'} |
| | |
| | | case 'refreshSto': // todo:luxiaotao |
| | | alert("还没做"); |
| | | break; |
| | | case 'clearMk': |
| | | var data = checkStatus.data; |
| | | if (data.length === 0){ |
| | | layer.msg("请选择要清除盘点状态的库位", {icon: 2}); |
| | | return; |
| | | } |
| | | // 去重获取库位号列表 |
| | | var locNoSet = new Set(); |
| | | data.forEach(function(elem) { |
| | | if (elem.locNo) { |
| | | locNoSet.add(elem.locNo); |
| | | } |
| | | }); |
| | | var locNoList = Array.from(locNoSet); |
| | | |
| | | layer.confirm('确定要清除所选库位的盘点状态吗?', {icon: 3, title:'提示'}, function(index){ |
| | | $.ajax({ |
| | | url: baseUrl+"/locMast/clearMk/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | contentType: 'application/json;charset=UTF-8', |
| | | data: JSON.stringify({locNos: locNoList}), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | layer.msg("清除盘点状态成功", {icon: 1}); |
| | | tableIns.reload(); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg || "清除盘点状态失败", {icon: 2}); |
| | | } |
| | | }, |
| | | error: function() { |
| | | layer.msg("请求失败,请稍后重试", {icon: 2}); |
| | | } |
| | | }); |
| | | layer.close(index); |
| | | }); |
| | | break; |
| | | case 'exportData': |
| | | layer.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | |
| | | layer.msg("此库位的状态不存在物料"); |
| | | return; |
| | | } |
| | | locDetlToLayer(data.locNo); |
| | | locDetlToLayer(data.locNo,data.mk); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // iframe物料详情 |
| | | function locDetlToLayer(val) { |
| | | function locDetlToLayer(val,mk) { |
| | | locNo = val; |
| | | locMk = mk; |
| | | layer.open({ |
| | | type: 2, |
| | | title: '库存明细', |
| | |
| | | ,{field: 'altme', align: 'center',title: '单位'} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码'} |
| | | ,{field: 'bname', align: 'center',title: '用户ID'} |
| | | ,{field: 'mk', align: 'center',title: '是否盘点', hide:false, templet: function(row){ |
| | | if (row.mk === 'Y') { |
| | | return '<span style="color: #5FB878;">已盘点</span>'; |
| | | } else { |
| | | return '<span style="color: #999;">未盘点</span>'; |
| | | } |
| | | }} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | ,{field: 'staNo$', align: 'center',title: '目标站'} |
| | | ,{field: 'sourceLocNo$', align: 'center',title: '源库位'} |
| | | ,{field: 'locNo$', align: 'center',title: '目标库位'} |
| | | ,{field: 'mk', align: 'center',title: '是否盘点', templet: function(row){ |
| | | if (row.mk === 'Y') { |
| | | return '<span style="color: #5FB878;">已盘点</span>'; |
| | | } else if (row.mk !== 'Y') { |
| | | return '<span style="color: #999;">未盘点</span>'; |
| | | } |
| | | }} |
| | | ,{field: 'barcode', align: 'center',title: '条码'} |
| | | ,{field: 'preHave', align: 'center',title: '先入品', hide: true} |
| | | ,{field: 'takeNone', align: 'center',title: '空操作', hide: true} |
| | |
| | | ,{field: 'staNo$', align: 'center',title: '目标站'} |
| | | ,{field: 'sourceLocNo$', align: 'center',title: '源库位'} |
| | | ,{field: 'locNo$', align: 'center',title: '目标库位'} |
| | | ,{field: 'mk', align: 'center',title: '是否盘点', templet: function(row){ |
| | | if (row.mk === 'Y') { |
| | | return '<span style="color: #5FB878;">已盘点</span>'; |
| | | } else if (row.mk === 'N') { |
| | | return '<span style="color: #999;">未盘点</span>'; |
| | | } else { |
| | | return '<span style="color: #999;">-</span>'; |
| | | } |
| | | }} |
| | | // ,{field: 'picking', align: 'center',title: '拣料', templet:function(row){ |
| | | // var html = "<input value='picking' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'"; |
| | | // if(row.picking === 'Y'){html += " checked ";} |
| | |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select name="mk" class="layui-input" type="text" autocomplete="off"> |
| | | <option value="">是否盘点</option> |
| | | <option value="Y">已盘点</option> |
| | | <option value="N">未盘点</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <div class="layui-input-inline">--> |
| | |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-primary layui-bg-blue layui-btn-sm" id="frozen-btn" lay-event="frozen" style="margin-top: 1px">冻结</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="unfreeze-btn" lay-event="unfreeze" style="margin-top: 1px">解冻</button> |
| | | <button class="layui-btn layui-btn-normal layui-btn-sm" id="btn-clear-mk" lay-event="clearMk" style="margin-top: 1px">清除盘点状态</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="margin-top: 1px">导出</button> |
| | | </div> |
| | | </script> |
| | |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select name="mk" class="layui-input" type="text" autocomplete="off"> |
| | | <option value="">盘点状态</option> |
| | | <option value="Y">已盘点</option> |
| | | <option value="N">未盘点</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <!-- 日期范围 --> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |
| | |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn" id="btn-confirm" lay-event="confirm" style="">提取</button> |
| | | <button class="layui-btn layui-btn-normal" id="btn-clear-mk" lay-event="clearMk" style="">清除盘点状态</button> |
| | | </div> |
| | | </script> |
| | | |
| | |
| | | ,{field: 'locNo', align: 'center',title: '库位号', merge: true, style: 'font-weight: bold'} |
| | | ]; |
| | | cols.push.apply(cols, detlCols); |
| | | let cstateidIndex = cols.findIndex(col => col.field === 'cstateid$'); |
| | | if (cstateidIndex !== -1) { |
| | | cols.splice(cstateidIndex + 1, 0, { |
| | | field: 'mk', |
| | | align: 'center', |
| | | title: '是否盘点', |
| | | templet: function(row) { |
| | | if (row.mk === 'Y') { |
| | | return '<span style="color: #5FB878;">已盘点</span>'; |
| | | } else { |
| | | return '<span style="color: #999;">未盘点</span>'; |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | cols.push({field: 'modiUser$', align: 'center',title: '修改人员', hide: true} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间'} |
| | | ,{field: 'appeTime$', align: 'center',title: '入库时间'}) |
| | |
| | | }) |
| | | parent.addTableData(data); |
| | | break; |
| | | case 'clearMk': |
| | | if (data.length === 0){ |
| | | layer.msg("请选择要清除盘点状态的库位", {icon: 2}); |
| | | return; |
| | | } |
| | | // 去重获取库位号列表 |
| | | let locNoSet = new Set(); |
| | | data.forEach(function(elem) { |
| | | if (elem.locNo) { |
| | | locNoSet.add(elem.locNo); |
| | | } |
| | | }); |
| | | let locNoList = Array.from(locNoSet); |
| | | |
| | | layer.confirm('确定要清除所选库位的盘点状态吗?', {icon: 3, title:'提示'}, function(index){ |
| | | $.ajax({ |
| | | url: baseUrl+"/locMast/clearMk/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | contentType: 'application/json;charset=UTF-8', |
| | | data: JSON.stringify({locNos: locNoList}), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | layer.msg("清除盘点状态成功", {icon: 1}); |
| | | locDetlTableIns.reload(); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg || "清除盘点状态失败", {icon: 2}); |
| | | } |
| | | }, |
| | | error: function() { |
| | | layer.msg("请求失败,请稍后重试", {icon: 2}); |
| | | } |
| | | }); |
| | | layer.close(index); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | |
| | | }else { |
| | | $('#locNo').val(tmp); |
| | | } |
| | | var tmpMk = getQueryVariable("locMk") |
| | | |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | |
| | | <option value="1">已冻结</option> |
| | | </select> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select name="mk" class="layui-input" type="text" autocomplete="off"> |
| | | <option value="">是否盘点</option> |
| | | <option value="Y">已盘点</option> |
| | | <option value="N">未盘点</option> |
| | | </select> |
| | | </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> |
| | |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <!-- <button class="layui-btn layui-btn-normal layui-btn-sm" id="refresh-sto" lay-event="refreshSto" style="margin-left: 10px">更新库存</button>--> |
| | | <button class="layui-btn layui-btn-normal layui-btn-sm" id="btn-clear-mk" lay-event="clearMk" style="margin-left: 10px">清除盘点状态</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right;margin-top: 10px">导出</button> |
| | | </div> |
| | | </script> |