diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseStorageController.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseStorageController.java index d4a20160..7f4de215 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseStorageController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseStorageController.java @@ -1,6 +1,9 @@ package com.ruoyi.purchase.controller; import java.util.List; + +import com.ruoyi.purchase.domain.PurchaseStorageChild; +import com.ruoyi.purchase.service.IPurchaseStorageChildService; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -34,6 +37,10 @@ public class PurchaseStorageController extends BaseController @Autowired private IPurchaseStorageService purchaseStorageService; + @Autowired + private IPurchaseStorageChildService purchaseStorageChildService; + + @RequiresPermissions("purchase:purchaseStorage:view") @GetMapping() public String purchaseStorage() @@ -112,6 +119,46 @@ public class PurchaseStorageController extends BaseController return toAjax(purchaseStorageService.updatePurchaseStorage(purchaseStorage)); } + + /** + * 采购入库单详情 + * + * */ + @GetMapping("/detail/{purchaseStorageId}") + public String detail(@PathVariable("purchaseStorageId") Long purchaseStorageId, ModelMap mmap) + { + PurchaseStorage purchaseStorage = purchaseStorageService.selectPurchaseStorageById(purchaseStorageId); + mmap.put("purchaseStorage", purchaseStorage); + return prefix + "/detail"; + } + + /** + * 修改保存采购入库单详情 + */ + @Log(title = "采购入库单", businessType = BusinessType.UPDATE) + @PostMapping("/detail") + @ResponseBody + public AjaxResult detailSave(PurchaseStorage purchaseStorage) + { + return toAjax(purchaseStorageService.detailPurchaseStorage(purchaseStorage)); + } + + + /** + * 查询采购入库单详情物料信息 + */ + @PostMapping("/selectStorageChildMaterialList") + @ResponseBody + public TableDataInfo selectStorageChildMaterialList(PurchaseStorage purchaseStorage) + { + startPage(); + + String warehouseStorageCode = purchaseStorage.getWarehouseStorageCode(); + List list = purchaseStorageChildService.selectPurchaseStorageChildListByCode(warehouseStorageCode); + return getDataTable(list); + } + + /** * 删除采购入库单 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseStorageChildMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseStorageChildMapper.java index 346edf6b..f0163dc3 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseStorageChildMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseStorageChildMapper.java @@ -79,4 +79,9 @@ public interface PurchaseStorageChildMapper * 批量新增采购入库单子表 * */ int insertBatchPurchaseStorageChild(List purchaseStorageChildren); + + /** + * 根据采购入库单号查询采购入库单子表 + * */ + List selectPurchaseStorageChildListByCode(String warehouseStorageCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseStorageChildService.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseStorageChildService.java index 8bd07eac..f8e61e34 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseStorageChildService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseStorageChildService.java @@ -72,4 +72,9 @@ public interface IPurchaseStorageChildService * @return */ int restorePurchaseStorageChildById(Long purchaseStorageChildId); + + /** + * 通过采购入库单号查询采购入库单子表 + * */ + List selectPurchaseStorageChildListByCode(String warehouseStorageCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseStorageService.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseStorageService.java index 22dc2dd7..0ecd03b7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseStorageService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseStorageService.java @@ -72,4 +72,10 @@ public interface IPurchaseStorageService * @return */ int restorePurchaseStorageById(Long purchaseStorageId); + + /** + * 保存采购入库单详情 + * + * */ + int detailPurchaseStorage(PurchaseStorage purchaseStorage); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseStorageChildServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseStorageChildServiceImpl.java index 330f3673..b00d5d7f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseStorageChildServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseStorageChildServiceImpl.java @@ -46,6 +46,17 @@ public class PurchaseStorageChildServiceImpl implements IPurchaseStorageChildSer return purchaseStorageChildMapper.selectPurchaseStorageChildList(purchaseStorageChild); } + /** + * 根据采购入库单号查询采购入库单子表列表 + * + * @param warehouseStorageCode 采购入库单号 + * @return 采购入库单子表 + */ + @Override + public List selectPurchaseStorageChildListByCode(String warehouseStorageCode) { + return purchaseStorageChildMapper.selectPurchaseStorageChildListByCode(warehouseStorageCode); + } + /** * 新增采购入库单子表 * diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseStorageServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseStorageServiceImpl.java index e20cbef3..edb384cd 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseStorageServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseStorageServiceImpl.java @@ -76,6 +76,18 @@ public class PurchaseStorageServiceImpl implements IPurchaseStorageService return purchaseStorageMapper.updatePurchaseStorage(purchaseStorage); } + + /** + * 详情采购入库单 + * + * @param purchaseStorage 采购入库单 + * @return 结果 + */ + @Override + public int detailPurchaseStorage(PurchaseStorage purchaseStorage) { + return 1; + } + /** * 删除采购入库单对象 * diff --git a/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseStorageChildMapper.xml b/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseStorageChildMapper.xml index b300c968..d767ecce 100644 --- a/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseStorageChildMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseStorageChildMapper.xml @@ -59,7 +59,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where purchase_storage_child_id = #{purchaseStorageChildId} - + + + insert into purchase_storage_child diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/addPurchaseStorage.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/addPurchaseStorage.html index 73e092f4..bddec91a 100644 --- a/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/addPurchaseStorage.html +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/addPurchaseStorage.html @@ -176,7 +176,7 @@ title: '物料类型', field: 'materialType', formatter: function (value,row, index) { - $.table.selectCategoryLabel(materialTypeDatas, value) + return $.table.selectCategoryLabel(materialTypeDatas, value) } }, { diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseStorage/detail.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseStorage/detail.html index 8ecfe64a..b07de413 100644 --- a/ruoyi-admin/src/main/resources/templates/purchase/purchaseStorage/detail.html +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseStorage/detail.html @@ -3,194 +3,115 @@ -
-
- + + +
+ +
+ +
+
- +
- +
- +
- +
+ +
- +
- +
-
- -
-
- -
+ + + + + +
+
+
+
- +
+
- diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseStorage/purchaseStorage.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseStorage/purchaseStorage.html index f7a34c29..1131ddcd 100644 --- a/ruoyi-admin/src/main/resources/templates/purchase/purchaseStorage/purchaseStorage.html +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseStorage/purchaseStorage.html @@ -263,7 +263,7 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); + actions.push('详情 '); var actionLinks = actions.join(''); return $.table.dropdownToggle(actionLinks); } @@ -271,6 +271,12 @@ }; $.table.init(options); }); + + //详情 + function detail(purchaseStorageId) { + var url = prefix + "/detail/" + purchaseStorageId; + $.modal.open("详情", url); + } \ No newline at end of file