Browse Source

Merge remote-tracking branch 'origin/dev' into dev

asce 1 year ago
parent
commit
6ab4694c72

+ 5 - 11
ruoyi-admin/src/main/java/com/ruoyi/asset/controller/TbAssetInformationController.java

@@ -132,17 +132,11 @@ public class TbAssetInformationController extends BaseController
         for (TbAssetInformation tbAssetInformation : tbAssetInformationList) {
             // 然后再转回对象,便不会影响到原对象
             PTXLabelInfo ptxLabelInfo = JSONUtil.toBean(ptxLabelInfoModel, PTXLabelInfo.class);
-            Integer quantity = tbAssetInformation.getQuantity();
-            if (quantity != null && quantity > 1) {
-                List<AssetEpcInfo> childNumberInfo = tbAssetInformation.getChildNumberInfo();
-                for (AssetEpcInfo assetEpcInfo : childNumberInfo) {
-                    tbAssetInformation.setNumber(assetEpcInfo.getNumber());
-                    tbAssetInformation.setEpc(assetEpcInfo.getEpc());
-                    tbAssetInformation.setEpcReplenishLength(assetEpcInfo.getEpcReplenishLength());
-                    ptxLabelInfo = ptxService.filterInfo(ptxLabelInfo, tbAssetInformation);
-                    ptxLabelInfos.add(ptxLabelInfo);
-                }
-            } else {
+            List<AssetEpcInfo> childNumberInfo = tbAssetInformation.getChildNumberInfo();
+            for (AssetEpcInfo assetEpcInfo : childNumberInfo) {
+                tbAssetInformation.setNumber(assetEpcInfo.getNumber());
+                tbAssetInformation.setEpc(assetEpcInfo.getEpc());
+                tbAssetInformation.setEpcReplenishLength(assetEpcInfo.getEpcReplenishLength());
                 ptxLabelInfo = ptxService.filterInfo(ptxLabelInfo, tbAssetInformation);
                 ptxLabelInfos.add(ptxLabelInfo);
             }

+ 22 - 0
ruoyi-admin/src/main/java/com/ruoyi/asset/domain/TbAssetInformation.java

@@ -6,6 +6,7 @@ import cn.hutool.core.util.CharsetUtil;
 import cn.hutool.core.util.HexUtil;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruoyi.asset.domain.dto.AssetEpcInfo;
+import com.ruoyi.common.utils.MyUtils;
 import lombok.*;
 import com.ruoyi.common.annotation.Excel;
 import com.ruoyi.common.core.domain.BaseEntity;
@@ -49,6 +50,9 @@ public class TbAssetInformation extends BaseEntity
     /** epc补充长度 */
     private Integer epcReplenishLength;
 
+    /** ecp前置补充 */
+    private String epcPreSupplement;
+
     /** 图片路径 */
 //    @Excel(name = "图片路径")
     private String imageUrl;
@@ -265,8 +269,17 @@ public class TbAssetInformation extends BaseEntity
         // 将epc大写
         epc = epc.toUpperCase();
 
+        int epcLength = epc.length();
+        String epcPre = "";
+        // 判断epc长度是否超过24位
+        if (epcLength > 24) {
+            epcPre = epc.substring(0, epcLength - 24);
+            epc = epc.substring(epcLength - 24);
+        }
+
         setEpc(epc);
         setEpcReplenishLength(epcReplenishLength);
+        setEpcPreSupplement(epcPre);
     }
 
     /**
@@ -308,6 +321,7 @@ public class TbAssetInformation extends BaseEntity
             assetEpcInfo.setNumber(number);
             assetEpcInfo.setEpc(epc);
             assetEpcInfo.setEpcReplenishLength(epcReplenishLength);
+            assetEpcInfo.setEpcPreSupplement(epcPreSupplement);
 
             assetEpcInfos.add(assetEpcInfo);
 
@@ -333,9 +347,17 @@ public class TbAssetInformation extends BaseEntity
 
             // 将epc大写
             epc = epc.toUpperCase();
+            int epcLength = epc.length();
+            String epcPre = "";
+            // 判断epc长度是否超过24位
+            if (epcLength > 24) {
+                epcPre = epc.substring(0, epcLength - 24);
+                epc = epc.substring(epcLength - 24);
+            }
 
             assetEpcInfo.setEpc(epc);
             assetEpcInfo.setEpcReplenishLength(epcReplenishLength);
+            assetEpcInfo.setEpcPreSupplement(epcPre);
 
             assetEpcInfos.add(assetEpcInfo);
         }

+ 2 - 0
ruoyi-admin/src/main/java/com/ruoyi/asset/domain/dto/AssetEpcInfo.java

@@ -10,4 +10,6 @@ public class AssetEpcInfo {
     private String epc;
 
     private Integer epcReplenishLength;
+
+    private String epcPreSupplement;
 }

+ 1 - 0
ruoyi-admin/src/main/java/com/ruoyi/asset/service/impl/TbAssetInformationServiceImpl.java

@@ -167,6 +167,7 @@ public class TbAssetInformationServiceImpl implements ITbAssetInformationService
             tbAssetInformation.setLocationNumber(null);
         }
         tbAssetInformation.setEpcInfo();
+        tbAssetInformation.setChildNumberInfo();
 
         tbAssetInformation.setUpdateTime(DateUtils.getNowDate());
         return tbAssetInformationMapper.updateTbAssetInformation(tbAssetInformation);

+ 3 - 4
ruoyi-admin/src/main/java/com/ruoyi/inventory/controller/TbAssetInventoryController.java

@@ -178,11 +178,11 @@ public class TbAssetInventoryController extends BaseController
      * @return
      */
     @GetMapping("/getDepAssetLossTb")
-    public AjaxResult getDepAssetLossTb(String depId){
+    public AjaxResult getDepAssetLossTb(String deptId){
 
         List<DepAssetLossResultDto> result = null;
         try {
-            result = tbAssetInventoryService.inventoryDepAssetById(depId);
+            result = tbAssetInventoryService.inventoryDepAssetById(deptId);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -190,8 +190,7 @@ public class TbAssetInventoryController extends BaseController
     }
 
     @PostMapping("/exportDepAssetLossTb/{deptId}")
-    public void exportDepAssetLossTb(HttpServletResponse response, @RequestParam String deptId){
-
+    public void exportDepAssetLossTb(HttpServletResponse response, @PathVariable String deptId){
         List<DepAssetLossResultDto> result = null;
         try {
             result = tbAssetInventoryService.inventoryDepAssetById(deptId);

+ 14 - 9
ruoyi-admin/src/main/java/com/ruoyi/inventory/controller/TbInventoryDetailController.java

@@ -15,10 +15,12 @@ import com.ruoyi.inventory.domain.TbAssetInventory;
 import com.ruoyi.inventory.domain.TbInventoryCompare;
 import com.ruoyi.inventory.domain.TbInventoryCompareResult;
 import com.ruoyi.inventory.domain.dto.AssetInventoryStatement;
+import com.ruoyi.inventory.domain.dto.InventoryCompareDTO;
+import com.ruoyi.inventory.domain.enums.InventoryPlanResult;
 import com.ruoyi.inventory.domain.enums.InventoryResult;
 import com.ruoyi.inventory.domain.enums.InventoryStatus;
-import com.ruoyi.inventory.mapper.TbAssetInventoryMapper;
 import com.ruoyi.inventory.mapper.TbInventoryDetailMapper;
+import com.ruoyi.inventory.service.ITbAssetInventoryService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -33,7 +35,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
 
 /**
  * 资产盘点明细Controller
- *
+ * 
  * @author ydl
  * @date 2023-06-01
  */
@@ -56,9 +58,6 @@ public class TbInventoryDetailController extends BaseController
         return getDataTable(list);
     }
 
-    @Autowired
-    private TbInventoryDetailMapper tbInventoryDetailMapper;
-
     /**
      * 查询全单位或者部门的资产对比分析报表
      * @return
@@ -119,7 +118,7 @@ public class TbInventoryDetailController extends BaseController
 //    }
 
     @Autowired
-    private TbAssetInventoryMapper tbAssetInventoryMapper;
+    private ITbAssetInventoryService inventoryService;
 
     /**
      * 导出资产盘点明细列表
@@ -136,7 +135,7 @@ public class TbInventoryDetailController extends BaseController
             throw new RuntimeException("盘点计划编码不能为空");
         }
 
-        TbAssetInventory tbAssetInventory = tbAssetInventoryMapper.selectTbAssetInventoryByNumber(orderNumber);
+        TbAssetInventory tbAssetInventory = inventoryService.selectTbAssetInventoryByNumber(orderNumber);
 
         List<AssetInventoryStatement> assetInventoryStatements = getInventoryStatement(tbAssetInventory, list);
 
@@ -144,15 +143,16 @@ public class TbInventoryDetailController extends BaseController
 
         util.exportExcel(response, assetInventoryStatements, DateUtil.format(tbAssetInventory.getInventoryDate(), "yyyy年MM月dd日"), tbAssetInventory.getName());
     }
+
     /**
      * 导出资产盘点记录列表
      */
     @PreAuthorize("@ss.hasPermi('inventory:inventory:export')")
-    @Log(title = "全单位资产对比分析报表", businessType = BusinessType.EXPORT)
+    @Log(title = "资产盘点报表", businessType = BusinessType.EXPORT)
     @PostMapping("/export/detail")
     public void exportDetail(HttpServletResponse response, TbAssetInventory tbAssetInventory)
     {
-        List<TbAssetInventory> tbAssetInventoryList = tbAssetInventoryMapper.selectTbAssetInventoryList(tbAssetInventory);
+        List<TbAssetInventory> tbAssetInventoryList = inventoryService.selectTbAssetInventoryList(tbAssetInventory);
         List<AssetInventoryStatement> assetInventoryStatements = new ArrayList<>();
 
         for (TbAssetInventory assetInventory : tbAssetInventoryList) {
@@ -300,6 +300,11 @@ public class TbInventoryDetailController extends BaseController
             // 设置盘点时间
             assetInventoryStatement.setInventoryDate(tbAssetInventory.getInventoryDate());
 
+            // 设置盘点计划结果
+            Integer inventoryPlanResult = tbAssetInventory.getInventoryResult();
+            String inventoryPlanResultName = InventoryPlanResult.getName(inventoryPlanResult);
+            assetInventoryStatement.setInventoryPlanResult(inventoryPlanResultName);
+
             // 设置资产原值
             assetInventoryStatement.setOriginalValue(assetInformation.getOriginalValue());
 

+ 4 - 0
ruoyi-admin/src/main/java/com/ruoyi/inventory/domain/dto/AssetInventoryStatement.java

@@ -69,6 +69,10 @@ public class AssetInventoryStatement {
     @Excel(name = "盘点部门")
     private String inventoryDepartmentName;
 
+    /** 盘点部门 */
+    @Excel(name = "盘点计划结果")
+    private String inventoryPlanResult;
+
     /**原值*/
     private Double originalValue;
 

+ 13 - 0
ruoyi-admin/src/main/java/com/ruoyi/inventory/domain/dto/InventoryCompareDTO.java

@@ -0,0 +1,13 @@
+package com.ruoyi.inventory.domain.dto;
+
+import com.ruoyi.common.core.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class InventoryCompareDTO extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    private String deptId;
+}

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/inventory/service/impl/TbAssetInventoryServiceImpl.java

@@ -476,7 +476,7 @@ public class TbAssetInventoryServiceImpl implements ITbAssetInventoryService
 
         List<String> childDeptIdList = tbAssetInventoryMapper.getChildDeptId(depId);
         if(childDeptIdList == null || childDeptIdList.size()==0){
-            throw new Exception("不存在该部门id");
+            throw new RuntimeException("不存在该部门id");
         }
         List<DepAssetLossResultDto> resultDtoList = new ArrayList<>();
         //历史盘点计划编码和日期

+ 10 - 3
ruoyi-admin/src/main/resources/mapper/asset/TbAssetInformationMapper.xml

@@ -49,13 +49,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="paymentReceivingTime"    column="payment_receiving_time"    />
         <result property="epc"    column="epc"    />
         <result property="epcReplenishLength"    column="epc_replenish_length"    />
+        <result property="epcPreSupplement" column="epc_pre_supplement" />
         <result property="lifeExpectancy"    column="life_expectancy"    />
         <result property="lifeUnits"    column="life_units"    />
         <result property="startDate"    column="start_date"    />
     </resultMap>
 
     <sql id="selectTbAssetInformationVo">
-        select id, code, name, number, image_url, category_number, specifications_model, abc_category, manage_status, user_department, department, responsible_person, location_number, property, purchase_date, commissioning_date, original_value, durable_years, net_value, residual_value, accumulated_depreciation, last_depreciation_date, depreciation_method, contract_number, factory_number, manufacturer, supplier, purpose, maintenance_date, maintenance_tel, maintenance_user, corporation, record_status, remark, create_by, create_time, update_by, update_time, is_whitelist, quantity, units, payment_receiving_time, epc, epc_replenish_length, life_expectancy, life_units, start_date from tb_asset_information
+        select id, code, name, number, image_url, category_number, specifications_model, abc_category, manage_status, user_department, department, responsible_person, location_number, property, purchase_date, commissioning_date, original_value, durable_years, net_value, residual_value, accumulated_depreciation, last_depreciation_date, depreciation_method, contract_number, factory_number, manufacturer, supplier, purpose, maintenance_date, maintenance_tel, maintenance_user, corporation, record_status, remark, create_by, create_time, update_by, update_time, is_whitelist, quantity, units, payment_receiving_time, epc, epc_replenish_length, epc_pre_supplement, life_expectancy, life_units, start_date from tb_asset_information
     </sql>
 
     <sql id="selectTbAssetInformation">
@@ -101,6 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             a.payment_receiving_time paymentReceivingTime,
             a.epc,
             a.epc_replenish_length epcReplenishLength,
+            a.epc_pre_supplement epcPreSupplement,
             a.life_expectancy lifeExpectancy,
             a.life_units lifeUnits,
             a.start_date startDate,
@@ -171,6 +173,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             a.payment_receiving_time paymentReceivingTime,
             a.epc,
             a.epc_replenish_length epcReplenishLength,
+            a.epc_pre_supplement epcPreSupplement,
             a.life_expectancy lifeExpectancy,
             a.life_units lifeUnits,
             a.start_date startDate,
@@ -252,9 +255,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>
             <if test="code != null  and code != ''"> and a.code = #{code}</if>
             <if test="name != null  and name != ''"> and a.name like concat('%', #{name}, '%')</if>
-            <if test="number != null  and number != ''"> and a.number = #{number}</if>
+            <if test="number != null  and number != ''"> and a.number like concat('%', #{number}, '%')</if>
             <if test="imageUrl != null  and imageUrl != ''"> and a.image_url = #{imageUrl}</if>
-            <if test="categoryNumber != null  and categoryNumber != ''"> and a.category_number = #{categoryNumber}</if>
+            <if test="categoryNumber != null  and categoryNumber != ''"> and a.category_number like concat('%', #{number}, '%')</if>
             <if test="specificationsModel != null  and specificationsModel != ''"> and a.specifications_model = #{specificationsModel}</if>
             <if test="abcCategory != null  and abcCategory != ''"> and a.abc_category = #{abcCategory}</if>
             <if test="manageStatus != null "> and a.manage_status = #{manageStatus}</if>
@@ -291,6 +294,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="paymentReceivingTime != null"> and a.payment_receiving_time = #{paymentReceivingTime}</if>
             <if test="epc != null  and epc != ''"> and a.epc = #{epc}</if>
             <if test="epcReplenishLength != null"> and a.epc_replenish_length = #{epcReplenishLength}</if>
+            <if test="epcPreSupplement != null">and a.epc_pre_supplement = #{epcPreSupplement}</if>
             <if test="lifeExpectancy != null"> and a.life_expectancy = #{lifeExpectancy}</if>
             <if test="lifeUnits != null  and lifeUnits != ''"> and a.life_units = #{lifeUnits}</if>
             <if test="startDate != null"> and a.start_date = #{startDate}</if>
@@ -408,6 +412,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="paymentReceivingTime != null">payment_receiving_time,</if>
             <if test="epc != null">epc,</if>
             <if test="epcReplenishLength != null">epc_replenish_length,</if>
+            <if test="epcPreSupplement != null">epc_pre_supplement,</if>
             <if test="lifeExpectancy != null">life_expectancy,</if>
             <if test="lifeUnits != null">life_units,</if>
             <if test="startDate != null">start_date,</if>
@@ -456,6 +461,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="paymentReceivingTime != null">#{paymentReceivingTime},</if>
             <if test="epc != null">#{epc},</if>
             <if test="epcReplenishLength != null">#{epcReplenishLength},</if>
+            <if test="epcPreSupplement != null">#{epcPreSupplement},</if>
             <if test="lifeExpectancy != null">#{lifeExpectancy},</if>
             <if test="lifeUnits != null">#{lifeUnits},</if>
             <if test="startDate != null">#{startDate},</if>
@@ -508,6 +514,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="paymentReceivingTime != null">payment_receiving_time = #{paymentReceivingTime},</if>
             <if test="epc != null">epc= #{epc},</if>
             <if test="epcReplenishLength != null">epc_replenish_length = #{epcReplenishLength},</if>
+            <if test="epcPreSupplement != null">epc_pre_supplement = #{epcPreSupplement},</if>
             <if test="lifeExpectancy != null">life_expectancy = #{lifeExpectancy},</if>
             <if test="lifeUnits != null">life_units = #{lifeUnits},</if>
             <if test="startDate != null">start_date = #{startDate},</if>

+ 2 - 2
ruoyi-admin/src/main/resources/mapper/inventory/TbAssetInventoryMapper.xml

@@ -54,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             )</if>
             <if test="inventoryBy != null  and inventoryBy != ''"> and a.inventory_by = #{inventoryBy}</if>
             <if test="inventoryDate != null "> and a.inventory_date = #{inventoryDate}</if>
-            <if test="inventoryLocation != null  and inventoryLocation != ''"> and a.inventory_location = #{inventoryLocation} or c.sequence like concat('%', #{inventoryLocation}, '%')</if>
+            <if test="inventoryLocation != null  and inventoryLocation != ''"> and a.inventory_location like concat('%', #{inventoryLocation}, '%')</if>
             <if test="inventoryStatus != null "> and a.inventory_status = #{inventoryStatus}</if>
             <if test="inventoryResult != null "> and a.inventory_result = #{inventoryResult}</if>
             <if test="recordStatus != null "> and a.record_status = #{recordStatus}</if>
@@ -211,6 +211,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="getChildDeptId" parameterType="String" resultType="String">
         select dept_id
         from sys_dept
-        where dept_id = #{deptId} OR ancestors like concat('%,', #{deptId}, ',%')
+        where dept_id = #{deptId} OR parent_id = #{deptId} OR ancestors like concat('%,', #{deptId}, ',%')
     </select>
 </mapper>

+ 15 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/MyUtils.java

@@ -46,4 +46,19 @@ public class MyUtils {
         }
         return StrUtil.subBetweenAll(str, "${", "}");
     }
+
+    /**
+     * 判断是否可转为Int类型
+     *
+     * @param str 字符串
+     * @return 布尔值
+     */
+    public static boolean isConvertibleToInt(String str) {
+        try {
+            Integer.parseInt(str);
+            return true;
+        } catch (NumberFormatException e) {
+            return false;
+        }
+    }
 }

+ 10 - 0
ruoyi-ui/src/api/inventory/detail.js

@@ -42,3 +42,13 @@ export function delDetail(id) {
     method: 'delete'
   })
 }
+
+
+// 查询全单位或者部门的资产对比分析报表
+export function getDepAssetLossTb(query) {
+  return request({
+    url: '/inventory/inventory/getDepAssetLossTb',
+    method: 'get',
+    params: query
+  })
+}

+ 0 - 9
ruoyi-ui/src/api/inventory/inventory.js

@@ -55,12 +55,3 @@ export function delInventory(id) {
 export function selectQrCode(number, v) {
   return `/inventory/inventory/code/${number}?v=${v}`
 }
-
-
-// 删除资产盘点记录
-export function getDepAssetLossTb(id) {
-  return request({
-    url: '/inventory/inventory/getDepAssetLossTb?depId=' + id,
-    method: 'get'
-  })
-}

+ 22 - 21
ruoyi-ui/src/views/asset/information/index.vue

@@ -17,8 +17,8 @@
       </el-form-item>
       <el-form-item label="所在位置" prop="locationNumber">
         <treeselect v-model="queryParams.locationNumber" :options="locationList" :normalizer="tenantIdnormalizer" placeholder="选择位置" />
-      </el-form-item> 
-      <el-form-item label="使用部门" prop="userDepartment">
+      </el-form-item>
+      <el-form-item v-if="isExist('使用部门')" label="使用部门" prop="userDepartment">
         <div style="display: inline-block; width: 183px">
           <treeselect v-model="queryParams.userDepartment" :options="deptOptions" :normalizer="normalizer" placeholder="选择使用部门" />
         </div>
@@ -38,7 +38,7 @@
           clearable
           @keyup.enter.native="handleQuery"
         />
-      </el-form-item> 
+      </el-form-item>
       <el-form-item v-if="isExist('责任人')" label="责任人" prop="responsiblePerson">
         <el-input v-model="queryParams.responsiblePerson" placeholder="请输入责任人" clearable @keyup.enter.native="handleQuery" />
       </el-form-item>
@@ -65,7 +65,7 @@
       </el-form-item>
       <el-form-item v-if="isExist('管理状态')" label="管理状态" prop="manageStatus">
         <el-select v-model="queryParams.manageStatus" placeholder="请选择管理状态" clearable>
-          <el-option v-for="dict in dict.type.asset_order_type" :key="dict.value" :label="dict.label" :value="dict.value" />
+          <el-option v-for="dict in dict.type.sys_manage_status" :key="dict.value" :label="dict.label" :value="dict.value" />
         </el-select>
       </el-form-item>
       <el-form-item v-if="isExist('入账时间')" label="入账时间" prop="paymentReceivingTime">
@@ -227,36 +227,38 @@
       <el-table-column type="selection" width="55" align="center" />
       <!-- <el-table-column label="编号" align="center" prop="id" /> -->
       <el-table-column label="资产编号" align="center" prop="number" />
-      <el-table-column label="资产名称" align="center" prop="name" />
-      <el-table-column label="EPC" align="center" prop="epc" v-if="isExist('epc')" width="180">
-        <template slot-scope="scope">
-          <div>{{scope.row.epc}}<br/>&lceil;补位:{{scope.row.epcReplenishLength}}&rfloor;</div>
-        </template>
-      </el-table-column>
-      <el-table-column label="资产条码" v-if="isExist('资产条码')" align="center" prop="code" />
       <el-table-column label="照片" align="center" prop="imageUrl" width="100">
         <template slot-scope="scope">
           <image-preview :src="scope.row.imageUrl" :width="50" :height="50" v-show="scope.row.imageUrl === '' || scope.row.imageUrl == null ? false : true" />
         </template>
       </el-table-column>
+      <el-table-column label="资产名称" align="center" prop="name" />
+      <el-table-column label="数量" align="center" prop="quantity" />
+      <el-table-column label="计量" align="center" prop="units" />
       <el-table-column label="资产分类" align="center" prop="categoryName">
         <!-- <template slot-scope="scope">
           <span>{{ scope.row.categoryNumber != null ? categoryName(scope.row.categoryNumber) : '' }}</span>
         </template> -->
       </el-table-column>
-      <el-table-column label="使用部门" align="center" prop="userDepartmentName">
+      <el-table-column label="所在位置" align="center" prop="locationName" width="120">
+        <template slot-scope="scope">
+          <span>{{ (scope.row.ancestorLocationName ? scope.row.ancestorLocationName + "-" : "") +  (scope.row.parentLocationName ?  scope.row.parentLocationName + "-" : "") + scope.row.locationName }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column v-if="isExist('使用部门')" label="使用部门" align="center" prop="userDepartmentName">
         <!-- <template slot-scope="scope">
           <span>{{ scope.row.userDepartment != null ? companyName(scope.row.userDepartment) : '' }}</span>
         </template> -->
       </el-table-column>
-      <el-table-column v-if="isExist('管理部门')" label="管理部门" align="center">
+      <el-table-column label="资产条码" v-if="isExist('资产条码')" align="center" prop="code" />
+      <el-table-column label="EPC" align="center" prop="epc" v-if="isExist('epc')" width="180">
         <template slot-scope="scope">
-          <span>{{ scope.row.departmentName }}</span>
+          <div>{{scope.row.epc}}<br/>&lceil;补位:{{scope.row.epcReplenishLength}}&rfloor;</div>
         </template>
       </el-table-column>
-      <el-table-column label="所在位置" align="center" prop="locationName" width="120">
+      <el-table-column v-if="isExist('管理部门')" label="管理部门" align="center">
         <template slot-scope="scope">
-          <span>{{ (scope.row.ancestorLocationName ? scope.row.ancestorLocationName + "-" : "") +  (scope.row.parentLocationName ?  scope.row.parentLocationName + "-" : "") + scope.row.locationName }}</span>
+          <span>{{ scope.row.departmentName }}</span>
         </template>
       </el-table-column>
       <el-table-column v-if="isExist('所属公司')" label="所属公司" align="center" prop="corporationName">
@@ -264,13 +266,11 @@
           <span>{{ scope.row.corporation != null ? companyName(scope.row.corporation) : '' }}</span>
         </template> -->
       </el-table-column>
-      <el-table-column label="数量" align="center" prop="quantity" />
-      <el-table-column label="计量" align="center" prop="units" />
       <el-table-column v-if="isExist('入账时间')" label="入账时间" align="center" prop="paymentReceivingTime" />
       <el-table-column v-if="isExist('备注')" label="备注" align="center" prop="remark" />
       <el-table-column v-if="isExist('管理状态')" label="管理状态" align="center" prop="manageStatus">
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.asset_order_type" :value="scope.row.manageStatus" />
+          <dict-tag :options="dict.type.sys_manage_status" :value="scope.row.manageStatus" />
         </template>
       </el-table-column>
       <el-table-column v-if="isExist('资产性质')" label="资产性质" align="center" prop="property">
@@ -333,7 +333,7 @@
       <el-table-column label="预计使用期限" v-if="isExist('预计使用期限')" align="center" prop="lifeExpectancy" />
       <el-table-column label="预计使用期限单位" v-if="isExist('预计使用期限单位')" align="center" prop="lifeUnits" />
       <!-- <el-table-column label="预留字段j" align="center" prop="reservedColumnJ" /> -->
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button size="mini" type="text" icon="el-icon-printer" @click="handPrinter(scope.row)" v-hasPermi="['asset:information:query']">打印</el-button>
           <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['asset:information:edit']">修改</el-button>
@@ -598,6 +598,7 @@
         <div>
           <el-checkbox-group v-model="checkList" mini>
             <el-checkbox label="epc" border></el-checkbox>
+            <el-checkbox label="使用部门" border></el-checkbox>
             <el-checkbox label="资产条码" border></el-checkbox>
             <el-checkbox label="资产性质" border></el-checkbox>
             <el-checkbox label="规格型号" border></el-checkbox>
@@ -687,7 +688,7 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 
 export default {
   name: 'Information',
-  dicts: ['asset_record_status', 'sys_yes_no', 'asset_order_type', 'sys_asset_property'],
+  dicts: ['asset_record_status', 'sys_yes_no', 'sys_manage_status', 'sys_asset_property'],
   components: {
     ImageUploadTemp,
     Treeselect,

+ 6 - 101
ruoyi-ui/src/views/inventory/inventory/index.vue

@@ -132,17 +132,7 @@
           size="mini"
           @click="onOpenExportDetail"
           v-hasPermi="['inventory:inventory:export']"
-        >导出报表</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          plain
-          icon="el-icon-download"
-          size="mini"
-          @click="onOpenLoss"
-          v-hasPermi="['inventory:inventory:export']"
-        >资产报表</el-button>
+        >盘点报表</el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
@@ -258,7 +248,7 @@
         </el-form-item>
         <el-form-item label="盘点位置" prop="inventoryLocation">
           <treeselect
-          v-model="form.inventoryLocation" 
+          v-model="form.inventoryLocation"
           :multiple="true"
           :clearable="true"
           :searchable="true"
@@ -266,7 +256,7 @@
           :clear-on-select="true"
           :sort-value-by="'INDEX'"
           :options="locationOption"
-          :limit="3" 
+          :limit="3"
           placeholder="选择位置" />
         </el-form-item>
         <el-form-item label="备注" prop="remark">
@@ -288,51 +278,6 @@
       <UserSearch @submit="onSelectUser" @cancel="() => {openUserSearch = false}" v-if="openUserSearch"></UserSearch>
     </el-dialog>
 
-    <el-dialog :visible.sync="openLoss" title="资产报表查看">
-      <el-row>
-        <el-form>
-          <el-form-item label="盘点部门" prop="inventoryDepartment">
-            <treeselect
-              v-model="deptId"
-              :options="deptOptions"
-              placeholder="选择盘点部门"
-              @keyup.enter.native="onQueryLoss"
-            />
-          </el-form-item>
-        </el-form>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="onQueryLoss">搜索</el-button>
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-download"
-          size="mini"
-          @click="onLossExport"
-          v-hasPermi="['inventory:inventory:export']"
-        >导出</el-button>
-      </el-row>
-      <el-row>
-        <el-table :data="lossData">
-          <el-table-column
-            prop="totalLossVal"
-            label="损耗总额"
-            width="100">
-          </el-table-column>
-          <el-table-column
-            prop="date"
-            label="盘点时间"
-            width="100">
-          </el-table-column>
-          <el-table-column label="资产盘点结果集">
-            <el-table-column
-              prop="date"
-              label="盘点时间"
-              width="100">
-            </el-table-column>
-          </el-table-column>
-        </el-table>
-      </el-row>
-    </el-dialog>
-
     <el-dialog title="导出报表" :visible.sync="openExport" width="360px">
       <el-form ref="form" :model="exportParams" label-width="80px">
         <el-form-item label="盘点部门" prop="inventoryDepartment">
@@ -365,7 +310,7 @@
 
 <script>
 import { deptTreeSelect } from '@/api/system/user.js'
-import { listInventory, getInventory, delInventory, addInventory, updateInventory,selectQrCode,getDepAssetLossTb } from "@/api/inventory/inventory";
+import { listInventory, getInventory, delInventory, addInventory, updateInventory,selectQrCode } from "@/api/inventory/inventory";
 import { treeSelect } from "@/api/asset/location";
 import { listDept } from "@/api/system/dept";
 import UserSearch from '@/components/SysUserSearch/index.vue'
@@ -426,23 +371,6 @@ export default {
         inventoryLocation: null,
         recordStatus: 1,
       },
-      openLoss: false,
-      deptId: null,
-      lossData: [
-        {
-          totalLossVal: null,
-          date: null,
-          assetResultList: [
-            {
-              assetName: null,
-              category: null,
-              nowQuantity: null,
-              lossQuantity: null,
-              lossVal: null
-            }
-          ]
-        }
-      ],
       pickerOptions: {
         disabledDate(time) {
           return time.getTime() < Date.now() - 8.64e7;
@@ -470,7 +398,7 @@ export default {
         inventoryLocation: [
           { required: true, message: "盘点位置不能为空", trigger: "change" }
         ],
-      }
+      },
     };
   },
   created() {
@@ -502,29 +430,6 @@ export default {
       }, `资产盘点报表_${new Date().getTime()}.xlsx`)
       this.openExport = false
     },
-    onOpenLoss() {
-      this.openLoss = true
-    },
-    onQueryLoss() {
-      if (this.deptId === null) {
-        this.$modal.msgWarning("部门不能为空");
-        return
-      }
-      getDepAssetLossTb(this.deptId).then(res => {
-        this.lossData = res.data
-        console.log('资产报表', this.lossData)
-      })
-    },
-    onLossExport() {
-      if (this.deptId === null) {
-        this.$modal.msgWarning("部门不能为空");
-        return
-      }
-      const deptId = this.deptId
-      this.download('inventory/inventory/exportDepAssetLossTb/' + deptId, {
-      }, `资产报表_${new Date().getTime()}.xlsx`)
-      this.openExport = false
-    },
     /** 查询部门下拉树结构 */
     getDeptTree() {
       deptTreeSelect().then((response) => {
@@ -671,7 +576,7 @@ export default {
     handleExport() {
       this.download('inventory/inventory/export', {
         ...this.queryParams
-      }, `inventory_${new Date().getTime()}.xlsx`)
+      }, `盘点计划报表_${new Date().getTime()}.xlsx`)
     }
   }
 };

+ 170 - 0
ruoyi-ui/src/views/inventory/statement/index.vue

@@ -0,0 +1,170 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams"  ref="queryForm" class="queryForm" size="small" :inline="true"  label-width="68px">
+      <el-form-item label="盘点部门" prop="inventoryDepartment">
+        <treeselect
+          v-model="queryParams.deptId"
+          :options="deptOptions"
+          placeholder="选择盘点部门"
+          @keyup.enter.native="onQueryLoss"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="onQueryLoss">搜索</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-button
+        type="warning"
+        plain
+        icon="el-icon-download"
+        size="mini"
+        @click="onLossExport"
+        v-hasPermi="['inventory:inventory:export']"
+      >导出</el-button>
+    </el-row>
+
+    <el-table :data="lossList">
+      <el-table-column type="expand">
+        <template v-slot="slot">
+          <el-table :data="slot.row.compareResultList" ref="table" :header-cell-style="{ background: '#dcdfe6' }" >
+            <el-table-column
+              prop="assetName"
+              label="资产名称">
+            </el-table-column>
+            <el-table-column
+              prop="location"
+              label="资产位置">
+            </el-table-column>
+            <el-table-column
+              prop="category"
+              label="类别">
+            </el-table-column>
+            <el-table-column
+              prop="nowQuantity"
+              label="账面数量变化">
+            </el-table-column>
+            <el-table-column
+              prop="invQuantity"
+              label="实点数量变化">
+            </el-table-column>
+            <el-table-column
+              prop="lossQuantity"
+              label="损耗数量变化">
+            </el-table-column>
+            <el-table-column
+              prop="units"
+              label="计量单位">
+            </el-table-column>
+            <el-table-column
+              prop="lossVal"
+              label="损耗值变化">
+            </el-table-column>
+          </el-table>
+        </template>
+      </el-table-column>
+      <el-table-column
+        prop="deptName"
+        label="盘点部门">
+      </el-table-column>
+      <el-table-column
+        prop="lastSecondDate"
+        label="最后第二次盘点日期">
+      </el-table-column>
+      <el-table-column
+        prop="lastFirstDate"
+        label="最后盘点日期">
+      </el-table-column>
+    </el-table>
+
+    <!-- <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="onQueryLoss"
+    /> -->
+  </div>
+
+</template>
+
+<script>
+import { deptTreeSelect } from '@/api/system/user.js'
+import { getDepAssetLossTb } from '@/api/inventory/detail';
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+export default {
+  components : {
+    Treeselect
+  },
+  data() {
+    return {
+      // 总条数
+      total: 0,
+      lossList: [],
+      deptOptions: [],
+      // 查询参数
+      queryParams: {
+        // pageNum: 1,
+        // pageSize: 10,
+        deptId: null
+      }
+    }
+  },
+  created() {
+    this.getDeptTree()
+  },
+  methods: {
+    /** 查询部门下拉树结构 */
+    getDeptTree() {
+      deptTreeSelect().then((response) => {
+        this.deptOptions = response.data;
+        this.queryParams.deptId = this.deptOptions[0].id;
+        this.onQueryLoss()
+      });
+    },
+    onQueryLoss() {
+      if (this.queryParams.deptId === null) {
+        this.$modal.msgWarning("部门不能为空");
+        return
+      }
+      getDepAssetLossTb(this.queryParams).then(response => {
+        this.lossList = response.data
+        // this.total = response.total;
+        console.log('资产报表', this.lossData)
+      })
+    },
+    onLossExport() {
+      if (this.queryParams.deptId === null) {
+        this.$modal.msgWarning("部门不能为空");
+        return
+      }
+      const deptId = this.queryParams.deptId
+      this.download('inventory/inventory/exportDepAssetLossTb/' + deptId, {
+      }, `资产报表_${new Date().getTime()}.xlsx`)
+      this.openExport = false
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+/deep/ .vue-treeselect {
+  display: inline-block;
+}
+.queryForm {
+  /deep/ .vue-treeselect {
+    width: 205px;
+    height: 32px;
+  }
+}
+.clickNumber{
+  color: #409EFF;
+
+  &:hover{
+    cursor: pointer;
+    text-decoration: underline;
+  }
+}
+</style>