diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java b/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java index f5f01e6e..f4118d13 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java @@ -2311,14 +2311,44 @@ public class DepositoryRecordController { Integer id = jsonObject.getInteger("id"); // 获取当前物料的库存数据 Inventory inventoryById = materialService.findInventoryById(id); + + List inventoryAmountList = new ArrayList<>(); + // 获取当前库存 + double inventory = 0; + + // 获取当前库存的底层拆单记录 + SplitInfo splitInfo = splitUnitService.findBaseSplitInfoForMid(inventoryById.getMid()); + // 标记当前出入库数量是否全部按照拆单单位进行(默认否) + boolean flagForSplitInfo = false; + if (splitInfo != null) { + flagForSplitInfo = true; + Map paramForSelectStringObjectMap = new HashMap<>(); + paramForSelectStringObjectMap.put("iid", id); + List placeAndMaterialByCondition = placeService.findPlaceAndMaterialByCondition(paramForSelectStringObjectMap); + for (MaterialAndPlaceForViewP materialAndPlaceForViewP : placeAndMaterialByCondition) { + // 定义物料与库位的对应关系 + MaterialAndPlace mp = new MaterialAndPlace(); + // 设置id + mp.setId(materialAndPlaceForViewP.getId()); + // 设置数量 + mp.setQuantity(materialAndPlaceForViewP.getInventory().intValue()); + double allInventory = splitUnitService.findAllInventoryForSplitInfo(-1, mp, splitInfo.getId(), 0, true); + inventory = ObjectFormatUtil.sum(allInventory, inventory); + } + + } else { + inventory = ObjectFormatUtil.divide(inventoryById.getQuantity(), 100.0, 2); + } + // 获取本月至今的日期 Map monthBeginToNow = DateUtil.getMonthBeginToNow(); // 获取至今的日期名称 List dayNames = ObjectFormatUtil.objToList(monthBeginToNow.get("dayName"), String.class); // 获取至今的日期时间戳 List dayTimeSpaces = ObjectFormatUtil.objToList(monthBeginToNow.get("dayTimeSpace"), Long.class); + dayTimeSpaces.add(Calendar.getInstance().getTimeInMillis()); // 获取当前物料的入库总额与数量 - Map seriesForApplicationIn = depositoryRecordService.getApplicationByMaterial(id, dayTimeSpaces, 1); + Map seriesForApplicationIn = depositoryRecordService.getApplicationByMaterial(id, dayTimeSpaces, 1,flagForSplitInfo,splitInfo); Object amountItemForIn = seriesForApplicationIn.get("amountItem"); Object countItemForIn = seriesForApplicationIn.get("countItem"); @@ -2328,7 +2358,7 @@ public class DepositoryRecordController { List amountListForIn = ObjectFormatUtil.objToList(countItemForInMapString.get("data"), Double.class); // 获取当前物料的出库总额与数量 - Map seriesForApplicationOut = depositoryRecordService.getApplicationByMaterial(id, dayTimeSpaces, 2); + Map seriesForApplicationOut = depositoryRecordService.getApplicationByMaterial(id, dayTimeSpaces, 2,flagForSplitInfo,splitInfo); Object amountItemForOut = seriesForApplicationOut.get("amountItem"); Object countItemForOut = seriesForApplicationOut.get("countItem"); @@ -2339,9 +2369,7 @@ public class DepositoryRecordController { // 定义库存数量列表 List inventoryCountList = new ArrayList<>(); // 定义库存总额列表 - List inventoryAmountList = new ArrayList<>(); - // 获取当前库存 - double inventory = inventoryById.getQuantity() / 100.0; + // 获取当前物料单价 Double price = inventoryById.getPrice(); // 获取当前物料总额 @@ -2372,8 +2400,8 @@ public class DepositoryRecordController { legendItem.put("data", legends); result.put("legend", legendItem); result.put("dayNames", dayNames); - result.put("countItemForInventory",countItemForInventory); - result.put("amountItemForInventory",amountItemForInventory); + result.put("countItemForInventory", countItemForInventory); + result.put("amountItemForInventory", amountItemForInventory); return new RestResponse(result); } diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java b/src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java index 4e5e173f..dd5019cc 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java @@ -194,6 +194,70 @@ public class MaterialController { return new RestResponse(list, total, 200); } + + /** + * 获取当前物料的库存记录 + * + * @param map 查询数据 + * @param request + * @return + */ + @GetMapping("/findInventoryByMid") + public RestResponse findInventoryByMid(@RequestParam Map map, HttpServletRequest request) { + if (map.containsKey("mid")) { + String token = request.getHeader("user-token"); + if (token == null) { + token = (String) request.getSession().getAttribute("userToken"); + } + UserByPort userToken = AuthenticationTokenPool.getUserToken(token); + Integer maindeparment = userToken.getMaindeparment(); + if (!PublicConfig.roleAdminorgList.contains(maindeparment)) { // 如果不是管理部门 + // 获取当前用户可见的仓库id列表 + List didList = roleService.findDepositoryIdForUserHas(userToken); + map.put("depositoryIdList", didList); + } + // 声明库存列表 + List inventoryPList = new ArrayList<>(); + // 获取当前物料id与仓库id的库存记录 + List inventoryByMidAndDidList = materialService.findInventoryByMidAndDidList(map); + // 声明用于获取当前库存所处的库位map + Map paramForStringObjectMap = new HashMap<>(); + if (inventoryByMidAndDidList != null && inventoryByMidAndDidList.size() > 0) { // 如果存在库存记录且记录数大于零 + // 获取当前物料id + Integer mid = ObjectFormatUtil.toInteger(map.get("mid")); + // 获取当前物料的拆单记录 + List splitInfoByMid = splitUnitService.findSplitInfoByMid(mid); + for (Inventory inventory : inventoryByMidAndDidList) { + InventoryP inventoryP = new InventoryP(inventory); + inventoryP.setSplitInfoList(splitInfoByMid); + paramForStringObjectMap.put("iid", inventoryP.getId()); + // 获取当前库存所处的库位记录 + List placeAndMaterialByCondition = placeService.findPlaceAndMaterialByCondition(paramForStringObjectMap); + for (MaterialAndPlaceForViewP materialAndPlaceForViewP : placeAndMaterialByCondition) { + double quantity = ObjectFormatUtil.divide(materialAndPlaceForViewP.getInventory(), 100.0, 2); + double amount = ObjectFormatUtil.multiply(quantity, inventoryP.getPrice()); + materialAndPlaceForViewP.setInventory(quantity); + materialAndPlaceForViewP.setAmount(amount); + } + inventoryP.setMaterialAndPlaceList(placeAndMaterialByCondition); + inventoryPList.add(inventoryP); + } + } + Integer count = materialService.findInventoryCountByMidAndDidList(map); + return new RestResponse(inventoryPList, count, 200); + } else { + return new RestResponse(new ArrayList<>(), 0, 200); + } + + } + + /** + * 修改库存备注 + * + * @param map + * @param request + * @return + */ @PostMapping("/updateInventoryRemark") public RestResponse updateInventoryRemark(@RequestBody Map map, HttpServletRequest request) { if (map.containsKey("id")) { @@ -1937,7 +2001,7 @@ public class MaterialController { if (splitInventory != null) { quantity = splitUnitService.findAllInventoryForSplitInfo(-1, placeAndMaterialByMidAndPid, splitInfo.getId(), 0, true); } else { - quantity = (inventoryById.getQuantity() * Scale / 100.0); + quantity = (placeAndMaterialByMidAndPid.getQuantity() * Scale / 100.0); } amount = ObjectFormatUtil.multiply(quantity, price); diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java b/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java index cff56d34..78f3b90e 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/PageController.java @@ -496,7 +496,7 @@ public class PageController { return mv; } - /* // 库位树形菜单 + // 库位树形菜单 @GetMapping("/selectPlaceByDepository") public ModelAndView selectPlaceByDepository(Integer depositoryId, Integer mid, String placeCode, String unit) { ModelAndView mv = new ModelAndView(); @@ -532,10 +532,11 @@ public class PageController { SplitInfo splitInfo = splitUnitService.findSplitInfoByMidAndUnit(paramForSplitInfo); SplitInventory splitInventory = splitUnitService.findSplitInventoryByIidAndSid(placeAndMaterialByMidAndPid.getId(), splitInfo.getId()); if (splitInventory != null) { - mv.addObject("quantity", (splitInventory.getSaveQuantity() / 100)); + double quantity = splitUnitService.findAllInventoryForSplitInfo(-1, placeAndMaterialByMidAndPid, splitInfo.getId(), 0, true); + mv.addObject("quantity", quantity); } else { int Scale = splitUnitService.findSplitInfoScaleQuantity(splitInfo, -1); - mv.addObject("quantity", (inventoryById.getQuantity() * Scale / 100)); + mv.addObject("quantity", (placeAndMaterialByMidAndPid.getQuantity() * Scale / 100)); } } mv.addObject("depositoryId", depositoryId); @@ -543,11 +544,11 @@ public class PageController { mv.addObject("unit", unit); mv.setViewName("pages/material/selectPlaceByDepository"); return mv; - }*/ + } // 同一仓库下的库位树形菜单 - @GetMapping("/selectPlaceByDepository") - public ModelAndView selectPlaceByDepository(Integer id, String unit) { + @GetMapping("/selectPlaceByDepositoryForInventory") + public ModelAndView selectPlaceByDepositoryForInventory(Integer id, String unit) { if (id != null) { ModelAndView mv = new ModelAndView(); MaterialAndPlace placeAndMaterialById = placeService.findPlaceAndMaterialById(id); @@ -570,7 +571,7 @@ public class PageController { mv.addObject("quantity", quantity); } else { int Scale = splitUnitService.findSplitInfoScaleQuantity(splitInfo, -1); - mv.addObject("quantity", (inventoryById.getQuantity() * Scale / 100)); + mv.addObject("quantity", (placeAndMaterialById.getQuantity() * Scale / 100)); } } mv.addObject("depositoryId", placeAndMaterialById.getDid()); @@ -1190,7 +1191,7 @@ public class PageController { public ModelAndView InventoryView(Integer id, HttpServletRequest request) { if (id != null) { ModelAndView mv = new ModelAndView(); - mv.setViewName("pages/depository/Inventory-view_back"); + mv.setViewName("pages/depository/Inventory-view"); Inventory inventoryById = materialService.findInventoryById(id); if (inventoryById != null) { InventoryP inventory = new InventoryP(inventoryById); @@ -1243,15 +1244,23 @@ public class PageController { public ModelAndView InventoryViewBack(Integer id, HttpServletRequest request) { if (id != null) { ModelAndView mv = new ModelAndView(); - mv.setViewName("pages/depository/Inventory-view"); - Inventory inventoryById = materialService.findInventoryById(id); - if (inventoryById != null) { - InventoryP inventory = new InventoryP(inventoryById); - List placeByMidAndDid = placeService.findPlaceByMidAndDid(inventoryById.getId(), inventory.getDepositoryId()); - inventory.setPlacePList(placeByMidAndDid); - List splitInfoByMid = splitUnitService.findSplitInfoByMid(inventoryById.getMid()); - inventory.setSplitInfoList(splitInfoByMid); - mv.addObject("record", inventory); + mv.setViewName("pages/material/material-view_back"); + Material materialById = materialService.findMaterialById(id); + if (materialById != null) { + MaterialP materialP = new MaterialP(materialById); + Map param = new HashMap<>(); + param.put("mid", id); + List placeAndMaterialByDidAndMid = placeService.findPlaceAndMaterialByMid(param); + for (MaterialAndPlaceForViewP materialAndPlaceForViewP : placeAndMaterialByDidAndMid) { + double quantity = materialAndPlaceForViewP.getInventory() / 100.0; + materialAndPlaceForViewP.setInventory(quantity); + materialAndPlaceForViewP.setAmount(ObjectFormatUtil.multiply(materialP.getPrice(), quantity)); + } + materialP.setMaterialAndPlaceList(placeAndMaterialByDidAndMid); + List splitInfoByMid = splitUnitService.findSplitInfoByMid(id); + materialP.setSplitInfoList(splitInfoByMid); + + mv.addObject("record", materialP); String userAgent = request.getHeader("user-agent"); String token = request.getHeader("user-token"); if (token == null) { @@ -1267,7 +1276,7 @@ public class PageController { // 判断当前使用的设备为移动端还是pc端 boolean b = DeviceUtil.checkAgentIsMobile(userAgent); if (b) { - mv.setViewName("pages/depository/Inventory-view_mobile"); +// mv.setViewName("pages/material/material-view_mobile"); } return mv; } else { diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/PlaceController.java b/src/main/java/com/dreamchaser/depository_manage/controller/PlaceController.java index 7c00545f..29078504 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/PlaceController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/PlaceController.java @@ -203,7 +203,7 @@ public class PlaceController { Object depositoryId = map.get("depositoryId"); insert.put("did", depositoryId); // 获取当前仓库的托盘数量 - Integer countForTray = placeService.findPlaceCoutnByTypeForFlag(2, ObjectFormatUtil.toInteger(depositoryId)); + Integer countForTray = placeService.findPlaceCountByTypeForFlag(2, ObjectFormatUtil.toInteger(depositoryId)); if ("one".equals(type)) { String code = "F" + String.format("%02d", countForTray + 1); insert.put("code", code); @@ -500,6 +500,12 @@ public class PlaceController { } + /** + * 获取当前位置信息 + * + * @param map + * @return + */ @PostMapping("/findLocationById") public RestResponse findLocationById(@RequestBody Map map) { if (map.containsKey("id") && map.containsKey("type")) { @@ -528,4 +534,6 @@ public class PlaceController { throw new MyException("缺少必要参数"); } } + + } diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/SplitController.java b/src/main/java/com/dreamchaser/depository_manage/controller/SplitController.java index 430925b3..05305077 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/SplitController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/SplitController.java @@ -138,29 +138,6 @@ public class SplitController { } - @PostMapping("/calcPriceForSplit") - public RestResponse calcPriceForSplit(@RequestBody Map map) { - // 通过物料id与计量单位获取对应拆单信息 - SplitInfo splitInfoByMidAndUnit = splitUnitService.findSplitInfoByMidAndUnit(map); - if (splitInfoByMidAndUnit != null) { - // 如果有拆单信息,获取对应物料的库存记录 - List inventoryByMid = materialService.findInventoryByMid(splitInfoByMidAndUnit.getMid()); - if (inventoryByMid.size() > 0) { - Inventory inventory = inventoryByMid.get(0); - return new RestResponse(inventory.getPrice() / splitUnitService.findSplitInfoScaleQuantity(splitInfoByMidAndUnit, -1)); - } - } else { - Integer mid = ObjectFormatUtil.toInteger(map.get("mid")); - List inventoryList = materialService.findInventoryByMid(mid); - if (inventoryList.size() > 0) { - Inventory inventory = inventoryList.get(0); - return new RestResponse(inventory.getPrice()); - } - } - return new RestResponse(0); - } - - /** * 用于查找当前禁用的拆单是否正在使用 * diff --git a/src/main/java/com/dreamchaser/depository_manage/entity/MaterialAndPlace.java b/src/main/java/com/dreamchaser/depository_manage/entity/MaterialAndPlace.java index 5a4f9e19..e15feec3 100644 --- a/src/main/java/com/dreamchaser/depository_manage/entity/MaterialAndPlace.java +++ b/src/main/java/com/dreamchaser/depository_manage/entity/MaterialAndPlace.java @@ -42,4 +42,7 @@ public class MaterialAndPlace { */ private Integer quantity; + + + } diff --git a/src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.java b/src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.java index 1b1adff2..14d5dc37 100644 --- a/src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.java +++ b/src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.java @@ -9,9 +9,9 @@ import java.util.List; import java.util.Map; - /** * 仓库调度类 + * * @author Dreamchaser */ @Mapper @@ -19,21 +19,24 @@ import java.util.Map; public interface DepositoryRecordMapper { /** * 插入一条仓库调度记录 + * * @param map 仓库调度信息 * @return 受影响的行数 */ - Integer insertDepositoryRecord(Map map); + Integer insertDepositoryRecord(Map map); /** * 插入一条入库记录 + * * @param map * @return */ - Integer insertApplicationInRecord(Map map); + Integer insertApplicationInRecord(Map map); /** * 根据id删除一条仓库调度记录 + * * @param id 记录id * @return 受影响的行数 */ @@ -41,20 +44,23 @@ public interface DepositoryRecordMapper { /** * 根据id修改仓库调度记录 + * * @param map 参数map * @return 受影响的行数 */ - Integer updateDepositoryRecord(Map map); + Integer updateDepositoryRecord(Map map); /** * 根据id修改仓库调度记录 + * * @param map 参数map * @return 受影响的行数 */ - Integer updateApplicationOutRecord(Map map); + Integer updateApplicationOutRecord(Map map); /** * 根据id主键查询数据 + * * @param id id * @return 该id的数据记录 */ @@ -62,85 +68,99 @@ public interface DepositoryRecordMapper { /** * 查找所有仓库调度记录 + * * @return 所有的仓库调度记录集合 */ List findDepositoryRecordAll(); /** * 查找所有入库记录 + * * @return */ List findApplicationInRecordPAll(); /** * 根据主键id列表获取入库订单列表 + * * @param ids * @return */ List findApplicationInRecordsByIds(List ids); + /** * 查找所有入库记录 + * * @return */ List findApplicationInRecordPByDepositoryList(List list); /** * 查询一段时间内的入库记录 + * * @param map 条件,起止时间 * @return */ - List findApplicationInRecordPForAPeriodOfTime(Map map); + List findApplicationInRecordPForAPeriodOfTime(Map map); /** * 查找所有出库记录 + * * @return */ List findApplicationOutRecordPAll(); /** * 查询一段时间内的出库记录 + * * @param map 条件,起止时间 * @return */ - List findApplicationOutRecordPForAPeriodOfTime(Map map); + List findApplicationOutRecordPForAPeriodOfTime(Map map); /** * 根据条件查询仓库调度记录,同时支持分页查询(需要begin和size参数) + * * @param map 查询参数 * @return 符合条件的仓库调度记录集合 */ - List findDepositoryRecordByCondition(Map map); + List findDepositoryRecordByCondition(Map map); /** * 根据条件查询自己的任务(根据isDone来决定查询已完成或者未完成的任务),同时支持分页查询(需要begin和size参数) + * * @param map 查询参数 * @return 我的任务 */ - List findMyTask(Map map); + List findMyTask(Map map); /** * 根据条件查询自己的出库审批任务(根据isDone来决定查询已完成或者未完成的任务),同时支持分页查询(需要begin和size参数) + * * @param map 查询参数 * @return 我的任务 */ - List findMyTaskOut(Map map); + List findMyTaskOut(Map map); /** * 根据条件查询自己的入库审批任务(根据isDone来决定查询已完成或者未完成的任务),同时支持分页查询(需要begin和size参数) + * * @param map 查询参数 * @return 我的任务 */ - List findMyTaskIn(Map map); + List findMyTaskIn(Map map); /** * 根据id删除仓库记录 + * * @return 受影响的行数 */ Integer deleteDepositoryRecordById(); /** * 根据id集合删除多条仓库记录 + * * @param list id集合 * @return 受影响的行数 */ @@ -148,43 +168,50 @@ public interface DepositoryRecordMapper { /** * 返回该表的总条数 + * * @return 条数 */ Integer findCount(); /** * 返回该我的任务数(完成或者未完成) + * * @param map 参数map * @return 条数 */ - Integer findMyTaskCount(Map map); + Integer findMyTaskCount(Map map); + /** * 返回该我的任务数(完成或者未完成) + * * @param map 参数map * @return 条数 */ - Integer findMyTaskOutCount(Map map); + Integer findMyTaskOutCount(Map map); /** * 返回该我的任务数(完成或者未完成) + * * @return 条数 */ - Integer findMyTaskInCount(Map map); + Integer findMyTaskInCount(Map map); /** * 根据查询条件返回该表的总条数 + * * @param map 条件参数 * @return 条数 */ - Integer findCountByCondition(Map map); + Integer findCountByCondition(Map map); /** * 获取一段时间内的库存额度 + * * @param map * @return */ - Double findDepositoryRecordByDate(Map map); + Double findDepositoryRecordByDate(Map map); /** @@ -193,9 +220,7 @@ public interface DepositoryRecordMapper { * @param map * @return */ - Integer findApplicationInRecordByDate(Map map); - - + Integer findApplicationInRecordByDate(Map map); /** @@ -204,75 +229,96 @@ public interface DepositoryRecordMapper { * @param map * @return */ - Integer findApplicationOutRecordByDate(Map map); + Integer findApplicationOutRecordByDate(Map map); /** * 根据条件获取月份中物料的总额 + * * @param map * @return */ - Integer findMaterialCountByMonth(Map map); + Integer findMaterialCountByMonth(Map map); /** * 根据条件获取月份中入库物料的总额 + * + * @param map 查询条件 + * @return + */ + Integer findApplicationInSumQuantityByDateAndMaterial(Map map); + + /** + * 根据条件获取月份中该物料的入库记录 + * * @param map 查询条件 * @return */ - Integer findApplicationInByDateAndMaterial(Map map); + List findApplicationInByDateAndMaterial(Map map); + /** * 根据条件获取月份中出库物料的总额 + * * @param map 查询条件 * @return */ - Integer findApplicationOutByDateAndMaterial(Mapmap); + Integer findApplicationOutSumQuantityByDateAndMaterial(Map map); + + List findApplicationOutByDateAndMaterial(Map map); - Integer findApplicationInByMonthTest(Map map); + Integer findApplicationInByMonthTest(Map map); /** * 根据条件获取月份中出库物料的总额 + * * @param map * @return */ - Integer findApplicationOutByMonth(Map map); + Integer findApplicationOutByMonth(Map map); /** * 查询仓库当天流水 + * * @return */ - Integer findWarehouseRecord(Map map); + Integer findWarehouseRecord(Map map); /** * 根据条件查询入库记录,同时支持分页查询 + * * @param map * @return */ - List findApplicationInRecordPByCondition(Map map); + List findApplicationInRecordPByCondition(Map map); /** * 查询当前用户入库记录及其管理仓库的入库记录 + * * @param map 查询条件 * @return */ - List findApplicationInRecordPByUser(Map map); + List findApplicationInRecordPByUser(Map map); /** * 查询当前用户入库记录及其管理仓库的入库记录数目 + * * @param map 查询条件 * @return */ - Integer findApplicationInRecordPCountByUser(Map map); + Integer findApplicationInRecordPCountByUser(Map map); /** * 查询当前仓库的入库记录 - * @param depositoryId 待查询仓库id + * + * @param depositoryId 待查询仓库id * @return */ List findApplicationInRecordByDepository(String depositoryId); /** * 查询当前仓库的出库记录 + * * @param depositoryId 待查询仓库id * @return */ @@ -281,49 +327,56 @@ public interface DepositoryRecordMapper { /** * 根据条件查询出库记录,同时支持分页查询 + * * @param map * @return */ - List findApplicationOutRecordPByCondition(Map map); + List findApplicationOutRecordPByCondition(Map map); /** * 获取所有数量为0的出库单 + * * @return */ List findApplicationOutRecordPForBad(); /** * 查询当前用户出库记录及其管理仓库的出库记录 + * * @param map 查询条件 * @return */ - List findApplicationOutRecordPByUser(Map map); + List findApplicationOutRecordPByUser(Map map); /** * 查询当前用户出库记录及其管理仓库的出库记录数目 + * * @param map 查询条件 * @return */ - Integer findApplicationOutRecordPCountByUser(Map map); + Integer findApplicationOutRecordPCountByUser(Map map); /** * 根据条件查询入库记录数目 + * * @param map * @return */ - Integer findApplicationInRecordPCountByCondition(Map map); + Integer findApplicationInRecordPCountByCondition(Map map); /** * 根据条件查询出库记录数目 + * * @param map * @return */ - Integer findApplicationOutRecordPCountByCondition(Map map); + Integer findApplicationOutRecordPCountByCondition(Map map); /** * 根据id查询入库记录 + * * @param id * @return */ @@ -332,16 +385,16 @@ public interface DepositoryRecordMapper { /** * 根据组合入库订单id获取入库记录 + * * @param id * @return */ List findApplicationInRecordPByToGroupId(Integer id); - - /** * 根据id查询出库申请 + * * @param id * @return */ @@ -350,6 +403,7 @@ public interface DepositoryRecordMapper { /** * 根据id批量查询出库申请 + * * @param list * @return */ @@ -357,13 +411,15 @@ public interface DepositoryRecordMapper { /** * 根据id删除入库记录 - * @return 受影响的行数 + * * @param id + * @return 受影响的行数 */ Integer deleteApplicationInRecordById(Integer id); /** * 根据id集合删除多条入库记录 + * * @param list id集合 * @return 受影响的行数 */ @@ -371,29 +427,33 @@ public interface DepositoryRecordMapper { /** * 插入一条出库记录 + * * @param map * @return */ - Integer insertApplicationOutRecord(Map map); + Integer insertApplicationOutRecord(Map map); /** * 根据id删除出库记录 - * @return 受影响的行数 + * * @param id + * @return 受影响的行数 */ Integer deleteApplicationOutRecordById(Integer id); /** * 根据主id删除具体出库记录 - * @return 受影响的行数 + * * @param id + * @return 受影响的行数 */ Integer deleteApplicationOutRecordMinById(Integer id); /** * 根据id集合删除多条出库记录 + * * @param list id集合 * @return 受影响的行数 */ @@ -402,6 +462,7 @@ public interface DepositoryRecordMapper { /** * 根据主id集合删除多条出库记录 + * * @param list id集合 * @return 受影响的行数 */ @@ -409,6 +470,7 @@ public interface DepositoryRecordMapper { /** * 根据申请单号获取入库申请 + * * @param code * @return */ @@ -416,6 +478,7 @@ public interface DepositoryRecordMapper { /** * 根据申请单号获取出库申请 + * * @param code * @return */ @@ -424,13 +487,15 @@ public interface DepositoryRecordMapper { /** * 插入一条出库子订单 + * * @param map * @return */ - Integer insertApplicationOutRecordMin(Map map); + Integer insertApplicationOutRecordMin(Map map); /** * 根据id获取出库子订单 + * * @param id * @return */ @@ -438,6 +503,7 @@ public interface DepositoryRecordMapper { /** * 根据id批量获取出库子订单 + * * @param list * @return */ @@ -445,6 +511,7 @@ public interface DepositoryRecordMapper { /** * 根据主表获取所有子表 + * * @param parentId * @return */ @@ -452,6 +519,7 @@ public interface DepositoryRecordMapper { /** * 根据主表获取所有子表 + * * @param list * @return */ @@ -459,41 +527,46 @@ public interface DepositoryRecordMapper { /** * 修改子表记录 + * * @param map * @return */ - Integer updateApplicationOutRecordMin(Map map); + Integer updateApplicationOutRecordMin(Map map); - Integer updateApplicationInRecord(Map map); + Integer updateApplicationInRecord(Map map); /** * 修改子表记录 + * * @param applicationOutRecordMin * @return */ Integer updateApplicationOutRecordMin(ApplicationOutRecordMin applicationOutRecordMin); + /** * 根据条件获取子订单 + * * @param map * @return */ - List findApplicationOutMinByCondition(Map map); + List findApplicationOutMinByCondition(Map map); /** * 获取所有已经完成的子订单 + * * @return */ - List findApplicationOutMinForComplete(Map map); + List findApplicationOutMinForComplete(Map map); /** * 用于修改组合入库审批时创建的子物料订单 + * * @param map * @return */ - Integer updateApplicationInRecordForToGroupId(Map map); - + Integer updateApplicationInRecordForToGroupId(Map map); } diff --git a/src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml b/src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml index 995c5639..9e47983c 100644 --- a/src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml +++ b/src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml @@ -1741,7 +1741,7 @@ - select ifnull(sum(quantity),0) from applicationinrecordinfo where 1 = 1 @@ -1760,7 +1760,27 @@ - + select + + from applicationinrecordinfo + where 1 = 1 + + and did = #{depository_id} + + and applicant_time between #{start} and #{end} + + and tname = #{tname} + + + and mtid = #{typeId} + + + and mid = #{mid} + + + + + + - SELECT - FROM findInventory WHERE mid =#{mid} + FROM findInventory + WHERE 1 = 1 + + and mid =#{mid} + + + and depositoryId in + + #{did} + + + + LIMIT #{begin},#{size} + + + + + + + - + + + + + + -
- -
- -
-
-
- -
- + +
+
+
+
+
+
物料基本信息 + +
+
+ + + + + + + + + + + + + + + + + + +
物料编码:物料名称:规格型号:物料材质:
物料品牌:物料类型: + 计量单位: + + + 物料单价:
物料备注:
+
+
+
+
+
+
数据图标 +
+
+
+
+
物料入库明细
+
+
+
+
+
+
+
+
+
物料出库明细
+
+
+
+
+
+
+
+
+
物料库存明细
+
+
+
+
+
+
+
+
+
-
+
+
+
+
库存基本信息
+
-
- -
- -
-
-
- -
- -
-
-
-
- -
- -
-
-
- -
- + + + - - -
- -
- -
-
-
- -
- - -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
- +
+ + + + + + + + + + + + + + + + + +
所属仓库:备注:
所处库位计量单位对应数量金额操作
+ + + - + + + + + + 入库 + 出库 +
+
+
+
- - +
+ diff --git a/src/main/resources/templates/pages/depository/table-stock.html b/src/main/resources/templates/pages/depository/table-stock.html index ea4820c6..89cf381e 100644 --- a/src/main/resources/templates/pages/depository/table-stock.html +++ b/src/main/resources/templates/pages/depository/table-stock.html @@ -100,7 +100,7 @@ @@ -211,14 +211,15 @@ {field: 'brand', width: 200, title: '品牌',hide:true}, {field: 'version', width: 200, title: '规格型号'}, {field: 'typeName', width: 200, title: '物料类型',hide:true}, - {field: "unit", title: '计量单位', width: 200, templet: '#changeUnit', align: "center"}, - {field: 'quantity', width: 200, title: '数量'}, + {field: "unit", title: '计量单位', width: 100, templet: '#changeUnit', align: "center"}, + {field: 'quantity', width: 100, title: '数量'}, {field: 'depositoryName', width: 200, title: '仓库名称'}, - {field: 'depositoryCode', width: 200, title: '仓库编码'}, - {title: '所处库位', width: 200, templet: '#changePlace', align: "center"}, - {field: 'warningCount', width: 200, title: '待过期数量', sort: true}, - {field: 'price', title: '单价', width: 200, sort: true}, - {field: 'amounts', title: '总金额', width: 200, sort: true}, + {field: 'depositoryCode', width: 200, title: '仓库编码',hide:true}, + // {title: '所处库位', width: 200, templet: '#changePlace', align: "center"}, + {field: "placeKingdeeCode", title: '所处库位', width: 200, templet: '#changePlace', align: "center"}, + {field: 'warningCount', width: 100, title: '待过期数量', sort: true,hide:true}, + {field: 'price', title: '单价', width: 100, sort: true}, + {field: 'amounts', title: '总金额', width: 100, sort: true}, {field: 'texture', width: 200, title: '材质',hide:true}, {field: 'iremark', width: 200, title: '备注',hide:true}, {title: '操作', minWidth: 250, toolbar: '#currentTableBar', align: "center"} @@ -258,12 +259,13 @@ {field: 'brand', width: 200, title: '品牌', hide: true}, {field: 'version', width: 200, title: '规格型号'}, {field: 'typeName', width: 200, title: '物料类型', hide: true}, - {field: "unit", title: '计量单位', width: 200, templet: '#changeUnit', align: "center"}, - {field: 'quantity', width: 200, title: '数量'}, + {field: "unit", title: '计量单位', width: 100, templet: '#changeUnit', align: "center"}, + {field: 'quantity', width: 100, title: '数量'}, {field: 'depositoryName', width: 200, title: '仓库名称'}, {field: 'depositoryCode', width: 200, title: '仓库编码', hide: true}, - {title: '所处库位', width: 200, templet: '#changePlace', align: "center"}, - {field: 'warningCount', width: 200, title: '待过期数量', sort: true, hide: true}, + // {title: '所处库位', width: 200, templet: '#changePlace', align: "center"}, + {field: "placeKingdeeCode", title: '所处库位', width: 200, templet: '#changePlace', align: "center"}, + {field: 'warningCount', width: 100, title: '待过期数量', sort: true, hide: true}, {field: 'texture', width: 200, title: '材质', hide: true}, {field: 'iremark', width: 200, title: '备注',}, {title: '操作', minWidth: 250, toolbar: '#currentTableBar', align: "center"} @@ -283,6 +285,10 @@ } $.each(res['data'], function (i, j) { let jElement = j['warningCount']; + let placeCode = j['placeCode'].split(" "); + let placeKingdeeCode = j['placeKingdeeCode'].split(" "); + let depositoryId = j['depositoryId']; + let mid = j['id']; if (jElement !== null && jElement !== undefined) { let flag = (Number(jElement) !== 0); if (flag) { @@ -290,6 +296,17 @@ } } + // 所处库位 + var placeCodeItem = $("[lay-id='currentTableId'] tr:eq(" + (i + 1) + ")").children()[10]; + //计量单位 + // 用于库位的添加 + var aItem = placeCodeItem.childNodes[0]; + // 用于计量单位的添加 + for (let k = 0; k < placeKingdeeCode.length; k++) { + if (placeKingdeeCode[k] !== "") { + $(aItem).append('') + } + } }); } diff --git a/src/main/resources/templates/pages/material/material-out.html b/src/main/resources/templates/pages/material/material-out.html index ea4ee6ec..f4a1e17c 100644 --- a/src/main/resources/templates/pages/material/material-out.html +++ b/src/main/resources/templates/pages/material/material-out.html @@ -767,7 +767,7 @@ }); - showDetail = function (obj) { + /*showDetail = function (obj) { var index = layer.open({ title: '物料信息详情', type: 2, @@ -790,11 +790,32 @@ layer.full(index); }); return false; - } + }*/ - $('body').on('click', '[data-refresh]', function () { - location.reload(); - }) + showDetail = function (obj) { + var index = layer.open({ + title: '库存信息详情', + type: 2, + shade: 0.2, + maxmin: true, + shadeClose: true, + area: ['100%', '100%'], + content: '/InventoryViewBack?id=' + obj.id, + end: function () { + //执行搜索重载 + table.reloadData('currentTableId', { + url: '/material/material', + page: { + curr: 1 + } + }, 'data'); + } + }); + $(window).on("resize", function () { + layer.full(index); + }); + return false; + } }); diff --git a/src/main/resources/templates/pages/depository/Inventory-view_back.html b/src/main/resources/templates/pages/material/material-view_back.html similarity index 64% rename from src/main/resources/templates/pages/depository/Inventory-view_back.html rename to src/main/resources/templates/pages/material/material-view_back.html index 66eab2b0..71c02019 100644 --- a/src/main/resources/templates/pages/depository/Inventory-view_back.html +++ b/src/main/resources/templates/pages/material/material-view_back.html @@ -64,13 +64,79 @@ 物料单价: - 物料备注: + 物料备注:
+ +
+
+
库存基本信息
+
+ + +
+ +
+
+
+ +
数据图标 @@ -107,71 +173,42 @@
-
-
-
-
库存基本信息
-
+
+
- - - + - - - - - - - - - - - - - - - - - - -
所属仓库:备注:
所处库位计量单位对应数量金额操作
- - - + + + + + - - - - - - 入库 - 出库 -
-
-
-
- - - @@ -188,16 +225,73 @@ } + function changePlaceForQuantity() { + + } + var barCode = []; var flag = false; - layui.use(['form', 'laydate', 'util'], function () { + layui.use(['form', 'laydate', 'util', 'table'], function () { var form = layui.form, laydate = layui.laydate, $ = layui.$, + table = layui.table, util = layui.util; let iremark = $("#iremark").val(); - let id = $("#id").val(); + let mid = $("#id").val(); + + table.render({ + elem: "#currentTableId", + url: '/material/findInventoryByMid', + parseData: function (res) { //res 即为原始返回的数据 + return { + "status": res.status, //解析接口状态 + "message": res.statusInfo.message, //解析提示文本 + "count": res.count, //解析数据长度 + "data": res.data //解析数据列表 + }; + }, + request: { + pageName: 'page', //页码的参数名称,默认:page + limitName: 'size' //每页数据量的参数名,默认:limit + }, + where: { + "mid": mid + }, + response: { + statusName: 'status' //规定数据状态的字段名称,默认:code + , statusCode: 200 //规定成功的状态码,默认:0 + , msgName: 'message' //规定状态信息的字段名称,默认:msg + , countName: 'count' //规定数据总数的字段名称,默认:count + , dataName: 'data' //规定数据列表的字段名称,默认:data + }, + cols: [ + [ + {type: "checkbox", width: 50}, + {field: 'depositoryName', width: 200, title: '仓库名称'}, + { + field: 'unit', + width: 100, + title: '计量单位', + templet: '#unitItemList', + }, + {field: 'place', width: 100, title: '所处库位', templet: '#placeItemList'}, + {title: '库存数', width: 230, templet: '#quantityItem', align: "center"}, + {field: 'remark', width: 150, title: '备注'}, + {title: '操作', width: 150, toolbar: '#currentTableBar', align: "center"}, + + ] + ], + limits: [10, 15, 20, 25, 50, 100], + limit: 10, + page: true, + skin: 'line', + done: function (res, curr, count) { + } + + }); + form.on('select()', function (data) { var id = data.elem.id; //得到select原始DOM对象id @@ -274,7 +368,7 @@ btn: ['确定', '取消'] //按钮 }, function () { let req = {}; - req.id = id; + req.id = mid; req.remark = newIremark; $.ajax({ url: "/material/updateInventoryRemark", @@ -343,11 +437,36 @@ * @param obj */ changeUnitForQuantity = function (obj) { - let materialUnitObj = $(obj); + let id = obj.id.split("unitItem")[1]; + let unit = obj.value; + let placeAndMaterialId = $("#placeItem" + id).val(); + let req = {}; + req.unit = unit; + req.id = placeAndMaterialId; + $.ajax({ + url: "/material/getQuantityForLocationAndUnit", + type: "post", + dataType: 'json', + data: JSON.stringify(req), + contentType: "application/json;charset=utf-8", + success: function (res) { + let data = res.data; + $("#quantity" + id).text("库存数:" + data.quantity); + $("#amount" + id).text("总金额:" + data.amount); + } + }); + + }; + + changePlaceForQuantity = function (obj) { + let pid = $(obj).find("option:selected").attr("pid"); + let id = obj.id.split("placeItem")[1]; + let placeAndMaterialId = obj.value; + $("#applicationIn"+id).attr("placeId",pid); + let unit = $("#unitItem" + id).val(); let req = {}; - req.unit = materialUnitObj.val(); - let id = materialUnitObj.attr("id").split("materialUnit")[1].trim(); - req.id = id; + req.unit = unit; + req.id = placeAndMaterialId; $.ajax({ url: "/material/getQuantityForLocationAndUnit", type: "post", @@ -356,8 +475,9 @@ contentType: "application/json;charset=utf-8", success: function (res) { let data = res.data; - $("#quantity" + id).text(data.quantity); - $("#amounts" + id).text(data.amount); + $("#quantity" + id).text("库存数:" + data.quantity); + $("#amount" + id).text("总金额:" + data.amount); + } }); @@ -414,7 +534,7 @@ }; - $.ajax({ + /*$.ajax({ url: '/depositoryRecord/getApplicationForMaterial', type: 'post', async: true, @@ -463,7 +583,7 @@ echartLineChartOut.setOption(optionLineChartOut); echartLineChartInventory.setOption(optionLineChartInventory); } - }) + })*/ }); diff --git a/src/test/java/com/dreamchaser/depository_manage/LineChartForInventoryTest.java b/src/test/java/com/dreamchaser/depository_manage/LineChartForInventoryTest.java index 7e12ff4b..f4ba769e 100644 --- a/src/test/java/com/dreamchaser/depository_manage/LineChartForInventoryTest.java +++ b/src/test/java/com/dreamchaser/depository_manage/LineChartForInventoryTest.java @@ -40,8 +40,9 @@ public class LineChartForInventoryTest { List dayNames = ObjectFormatUtil.objToList(monthBeginToNow.get("dayName"), String.class); // 获取至今的日期时间戳 List dayTimeSpaces = ObjectFormatUtil.objToList(monthBeginToNow.get("dayTimeSpace"), Long.class); + dayTimeSpaces.add(Calendar.getInstance().getTimeInMillis()); // 获取当前物料的入库总额与数量 - Map seriesForApplicationIn = depositoryRecordService.getApplicationByMaterial(id, dayTimeSpaces, 1); + Map seriesForApplicationIn = depositoryRecordService.getApplicationByMaterial(id, dayTimeSpaces, 1,true,null); Object amountItemForIn = seriesForApplicationIn.get("amountItem"); Object countItemForIn = seriesForApplicationIn.get("countItem"); @@ -51,7 +52,7 @@ public class LineChartForInventoryTest { List amountListForIn = ObjectFormatUtil.objToList(countItemForInMapString.get("data"), Double.class); // 获取当前物料的出库总额与数量 - Map seriesForApplicationOut = depositoryRecordService.getApplicationByMaterial(id, dayTimeSpaces, 2); + Map seriesForApplicationOut = depositoryRecordService.getApplicationByMaterial(id, dayTimeSpaces, 2,true,null); Object amountItemForOut = seriesForApplicationOut.get("amountItem"); Object countItemForOut = seriesForApplicationOut.get("countItem"); @@ -88,6 +89,8 @@ public class LineChartForInventoryTest { result.put("countItemForIn", countItemForIn); result.put("amountItemForOut", amountItemForOut); result.put("countItemForOut", countItemForOut); + System.out.println(countItemForIn); + System.out.println(countItemForOut); Map> legendItem = new HashMap<>(); List legends = new ArrayList<>(); legends.add("count"); @@ -103,6 +106,6 @@ public class LineChartForInventoryTest { @Test public void Test() { - getInventoryApplication(136); + getInventoryApplication(3537); } } diff --git a/target/classes/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml b/target/classes/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml index 995c5639..9e47983c 100644 --- a/target/classes/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml +++ b/target/classes/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml @@ -1741,7 +1741,7 @@ - select ifnull(sum(quantity),0) from applicationinrecordinfo where 1 = 1 @@ -1760,7 +1760,27 @@ - + select + + from applicationinrecordinfo + where 1 = 1 + + and did = #{depository_id} + + and applicant_time between #{start} and #{end} + + and tname = #{tname} + + + and mtid = #{typeId} + + + and mid = #{mid} + + + + + + - SELECT - FROM findInventory WHERE mid =#{mid} + FROM findInventory + WHERE 1 = 1 + + and mid =#{mid} + + + and depositoryId in + + #{did} + + + + LIMIT #{begin},#{size} + + + + + + + - + + + + + + -
- -
- -
-
-
- -
- + +
+
+
+
+
+
物料基本信息 + +
+
+ + + + + + + + + + + + + + + + + + +
物料编码:物料名称:规格型号:物料材质:
物料品牌:物料类型: + 计量单位: + + + 物料单价:
物料备注:
+
+
+
+
+
+
数据图标 +
+
+
+
+
物料入库明细
+
+
+
+
+
+
+
+
+
物料出库明细
+
+
+
+
+
+
+
+
+
物料库存明细
+
+
+
+
+
+
+
+
+
-
+
+
+
+
库存基本信息
+
-
- -
- -
-
-
- -
- -
-
-
-
- -
- -
-
-
- -
- + + + - - -
- -
- -
-
-
- -
- - -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
- +
+ + + + + + + + + + + + + + + + + +
所属仓库:备注:
所处库位计量单位对应数量金额操作
+ + + - + + + + + + 入库 + 出库 +
+
+
+
- - +
+ diff --git a/target/classes/templates/pages/depository/table-stock.html b/target/classes/templates/pages/depository/table-stock.html index ea4820c6..89cf381e 100644 --- a/target/classes/templates/pages/depository/table-stock.html +++ b/target/classes/templates/pages/depository/table-stock.html @@ -100,7 +100,7 @@ @@ -211,14 +211,15 @@ {field: 'brand', width: 200, title: '品牌',hide:true}, {field: 'version', width: 200, title: '规格型号'}, {field: 'typeName', width: 200, title: '物料类型',hide:true}, - {field: "unit", title: '计量单位', width: 200, templet: '#changeUnit', align: "center"}, - {field: 'quantity', width: 200, title: '数量'}, + {field: "unit", title: '计量单位', width: 100, templet: '#changeUnit', align: "center"}, + {field: 'quantity', width: 100, title: '数量'}, {field: 'depositoryName', width: 200, title: '仓库名称'}, - {field: 'depositoryCode', width: 200, title: '仓库编码'}, - {title: '所处库位', width: 200, templet: '#changePlace', align: "center"}, - {field: 'warningCount', width: 200, title: '待过期数量', sort: true}, - {field: 'price', title: '单价', width: 200, sort: true}, - {field: 'amounts', title: '总金额', width: 200, sort: true}, + {field: 'depositoryCode', width: 200, title: '仓库编码',hide:true}, + // {title: '所处库位', width: 200, templet: '#changePlace', align: "center"}, + {field: "placeKingdeeCode", title: '所处库位', width: 200, templet: '#changePlace', align: "center"}, + {field: 'warningCount', width: 100, title: '待过期数量', sort: true,hide:true}, + {field: 'price', title: '单价', width: 100, sort: true}, + {field: 'amounts', title: '总金额', width: 100, sort: true}, {field: 'texture', width: 200, title: '材质',hide:true}, {field: 'iremark', width: 200, title: '备注',hide:true}, {title: '操作', minWidth: 250, toolbar: '#currentTableBar', align: "center"} @@ -258,12 +259,13 @@ {field: 'brand', width: 200, title: '品牌', hide: true}, {field: 'version', width: 200, title: '规格型号'}, {field: 'typeName', width: 200, title: '物料类型', hide: true}, - {field: "unit", title: '计量单位', width: 200, templet: '#changeUnit', align: "center"}, - {field: 'quantity', width: 200, title: '数量'}, + {field: "unit", title: '计量单位', width: 100, templet: '#changeUnit', align: "center"}, + {field: 'quantity', width: 100, title: '数量'}, {field: 'depositoryName', width: 200, title: '仓库名称'}, {field: 'depositoryCode', width: 200, title: '仓库编码', hide: true}, - {title: '所处库位', width: 200, templet: '#changePlace', align: "center"}, - {field: 'warningCount', width: 200, title: '待过期数量', sort: true, hide: true}, + // {title: '所处库位', width: 200, templet: '#changePlace', align: "center"}, + {field: "placeKingdeeCode", title: '所处库位', width: 200, templet: '#changePlace', align: "center"}, + {field: 'warningCount', width: 100, title: '待过期数量', sort: true, hide: true}, {field: 'texture', width: 200, title: '材质', hide: true}, {field: 'iremark', width: 200, title: '备注',}, {title: '操作', minWidth: 250, toolbar: '#currentTableBar', align: "center"} @@ -283,6 +285,10 @@ } $.each(res['data'], function (i, j) { let jElement = j['warningCount']; + let placeCode = j['placeCode'].split(" "); + let placeKingdeeCode = j['placeKingdeeCode'].split(" "); + let depositoryId = j['depositoryId']; + let mid = j['id']; if (jElement !== null && jElement !== undefined) { let flag = (Number(jElement) !== 0); if (flag) { @@ -290,6 +296,17 @@ } } + // 所处库位 + var placeCodeItem = $("[lay-id='currentTableId'] tr:eq(" + (i + 1) + ")").children()[10]; + //计量单位 + // 用于库位的添加 + var aItem = placeCodeItem.childNodes[0]; + // 用于计量单位的添加 + for (let k = 0; k < placeKingdeeCode.length; k++) { + if (placeKingdeeCode[k] !== "") { + $(aItem).append('') + } + } }); } diff --git a/target/classes/templates/pages/material/material-out.html b/target/classes/templates/pages/material/material-out.html index ea4ee6ec..f4a1e17c 100644 --- a/target/classes/templates/pages/material/material-out.html +++ b/target/classes/templates/pages/material/material-out.html @@ -767,7 +767,7 @@ }); - showDetail = function (obj) { + /*showDetail = function (obj) { var index = layer.open({ title: '物料信息详情', type: 2, @@ -790,11 +790,32 @@ layer.full(index); }); return false; - } + }*/ - $('body').on('click', '[data-refresh]', function () { - location.reload(); - }) + showDetail = function (obj) { + var index = layer.open({ + title: '库存信息详情', + type: 2, + shade: 0.2, + maxmin: true, + shadeClose: true, + area: ['100%', '100%'], + content: '/InventoryViewBack?id=' + obj.id, + end: function () { + //执行搜索重载 + table.reloadData('currentTableId', { + url: '/material/material', + page: { + curr: 1 + } + }, 'data'); + } + }); + $(window).on("resize", function () { + layer.full(index); + }); + return false; + } });