Sfoglia il codice sorgente

资产信息新增自定义按钮

ljx 1 anno fa
parent
commit
f3abdeb608

+ 24 - 0
ruoyi-admin/src/main/java/com/ruoyi/asset/controller/TbAssetInformationController.java

@@ -2,6 +2,8 @@ package com.ruoyi.asset.controller;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -101,4 +103,26 @@ public class TbAssetInformationController extends BaseController
     {
         return toAjax(tbAssetInformationService.deleteTbAssetInformationByIds(ids));
     }
+
+    /**
+     * 自定义字段
+     */
+    @PreAuthorize("@ss.hasPermi('asset:information:query')")
+    @Log(title = "资产信息字段自定义")
+    @PostMapping("/setDiy")
+    public AjaxResult setDiy(@RequestBody List<String> labels)
+    {
+        return toAjax(tbAssetInformationService.setDiy(labels));
+    }
+
+    /**
+     * 自定义字段
+     */
+    @PreAuthorize("@ss.hasPermi('asset:information:query')")
+    @Log(title = "资产信息字段自定义")
+    @GetMapping("/getDiy")
+    public AjaxResult getDiy()
+    {
+        return success(tbAssetInformationService.getDiy());
+    }
 }

+ 7 - 0
ruoyi-admin/src/main/java/com/ruoyi/asset/service/ITbAssetInformationService.java

@@ -66,4 +66,11 @@ public interface ITbAssetInformationService
      * @return 结果
      */
     public int deleteTbAssetInformationById(Long id);
+
+    /**
+     * 自定义字段
+     */
+    public boolean setDiy(List<String> labels);
+
+    public List<String> getDiy();
 }

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

@@ -1,14 +1,20 @@
 package com.ruoyi.asset.service.impl;
 
 import java.util.List;
+
+import cn.hutool.core.collection.ListUtil;
+import cn.hutool.json.JSONUtil;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.SecurityUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.stereotype.Service;
 import com.ruoyi.asset.mapper.TbAssetInformationMapper;
 import com.ruoyi.asset.domain.TbAssetInformation;
 import com.ruoyi.asset.service.ITbAssetInformationService;
 
+import javax.annotation.Resource;
+
 /**
  * 资产信息Service业务层处理
  * 
@@ -21,6 +27,9 @@ public class TbAssetInformationServiceImpl implements ITbAssetInformationService
     @Autowired
     private TbAssetInformationMapper tbAssetInformationMapper;
 
+    @Resource
+    private StringRedisTemplate stringRedisTemplate;
+
     /**
      * 查询资产信息
      * 
@@ -100,4 +109,19 @@ public class TbAssetInformationServiceImpl implements ITbAssetInformationService
     {
         return tbAssetInformationMapper.deleteTbAssetInformationById(id);
     }
+
+    @Override
+    public boolean setDiy(List<String> labels) {
+        String key = "func:assetInfo:" + SecurityUtils.getUserId();
+        String jsonStr = JSONUtil.toJsonStr(labels);
+        stringRedisTemplate.opsForValue().set(key, jsonStr);
+        return true;
+    }
+
+    @Override
+    public List<String> getDiy(){
+        String json = stringRedisTemplate.opsForValue().get("func:assetInfo:" + SecurityUtils.getUserId());
+        List<String> labels = JSONUtil.toList(json, String.class);
+        return labels;
+    }
 }

+ 1 - 1
ruoyi-admin/src/main/resources/application.yml

@@ -18,7 +18,7 @@ ruoyi:
 # 开发环境配置
 server:
   # 服务器的HTTP端口,默认为8080
-  port: 8080
+  port: 14567
   servlet:
     # 应用的访问路径
     context-path: /

+ 16 - 0
ruoyi-ui/src/api/asset/information.js

@@ -42,3 +42,19 @@ export function delInformation(id) {
     method: 'delete'
   })
 }
+
+//自定义字段
+export function getDiy() {
+  return request({
+    url: '/asset/information/getDiy',
+    method: 'get'
+  })
+}
+
+export function setDiy(data) {
+  return request({
+    url: '/asset/information/setDiy',
+    method: 'post',
+    data: data
+  })
+}

+ 211 - 121
ruoyi-ui/src/views/asset/information/index.vue

@@ -35,22 +35,6 @@
             ></el-option>
           </el-select>
         </el-form-item>
-      <el-form-item label="规格型号" prop="specificationsModel">
-        <el-input
-          v-model="queryParams.specificationsModel"
-          placeholder="请输入规格型号"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="ABC分类" prop="abcCategory">
-        <el-input
-          v-model="queryParams.abcCategory"
-          placeholder="请输入ABC分类"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
       <el-form-item label="使用部门" prop="userDepartment">
         <div style="display:inline-block; width: 183px;">
           <treeselect
@@ -71,14 +55,6 @@
               />
         </div>
       </el-form-item>
-      <el-form-item label="责任人" prop="responsiblePerson">
-        <el-input
-          v-model="queryParams.responsiblePerson"
-          placeholder="请输入责任人"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
       <el-form-item label="所在位置" prop="locationNumber">
         <el-select v-model="queryParams.locationNumber" placeholder="请选择所在位置">
             <el-option
@@ -97,7 +73,41 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="购置日期" prop="purchaseDate">
+      <el-form-item label="所属公司" prop="corporation">
+        <div style="display:inline-block; width: 183px;">
+          <treeselect
+                v-model="queryParams.corporation"
+                :options="deptOptions"
+                :normalizer="normalizer"
+                placeholder="选择所属公司"
+              />
+        </div>
+      </el-form-item>
+      <el-form-item v-if="isExist('规格型号')" label="规格型号" prop="specificationsModel">
+        <el-input
+          v-model="queryParams.specificationsModel"
+          placeholder="请输入规格型号"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item v-if="isExist('ABC分类')" label="ABC分类" prop="abcCategory">
+        <el-input
+          v-model="queryParams.abcCategory"
+          placeholder="请输入ABC分类"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </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>
+      <el-form-item  v-if="isExist('购置日期')" label="购置日期" prop="purchaseDate">
         <el-date-picker clearable
           v-model="queryParams.purchaseDate"
           type="date"
@@ -105,7 +115,7 @@
           placeholder="请选择购置日期">
         </el-date-picker>
       </el-form-item>
-      <el-form-item label="启用日期" prop="commissioningDate">
+      <el-form-item  v-if="isExist('启用日期')" label="启用日期" prop="commissioningDate">
           <el-date-picker clearable
           v-model="queryParams.commissioningDate"
           type="date"
@@ -113,7 +123,7 @@
           placeholder="请选择启用日期">
           </el-date-picker>  
       </el-form-item>
-      <el-form-item label="原值" prop="originalValue">
+      <el-form-item v-if="isExist('原值')" label="原值" prop="originalValue">
         <el-input
           v-model="queryParams.originalValue"
           placeholder="请输入原值"
@@ -121,7 +131,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="使用年限" prop="durableYears">
+      <el-form-item  v-if="isExist('使用年限')" label="使用年限" prop="durableYears">
         <el-input
           v-model="queryParams.durableYears"
           placeholder="请输入使用年限"
@@ -129,7 +139,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="净值" prop="netValue">
+      <el-form-item  v-if="isExist('净值')" label="净值" prop="netValue">
         <el-input
           v-model="queryParams.netValue"
           placeholder="请输入净值"
@@ -137,7 +147,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="残值" prop="residualValue">
+      <el-form-item  v-if="isExist('残值')" label="残值" prop="residualValue">
         <el-input
           v-model="queryParams.residualValue"
           placeholder="请输入残值"
@@ -145,7 +155,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="累计折旧" prop="accumulatedDepreciation">
+      <el-form-item  v-if="isExist('累计折旧')" label="累计折旧" prop="accumulatedDepreciation">
         <el-input
           v-model="queryParams.accumulatedDepreciation"
           placeholder="请输入累计折旧"
@@ -153,7 +163,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="最近折旧日期" prop="lastDepreciationDate">
+      <el-form-item  v-if="isExist('最近折旧日期')" label="最近折旧日期" prop="lastDepreciationDate">
         <el-date-picker clearable
           v-model="queryParams.lastDepreciationDate"
           type="date"
@@ -161,7 +171,7 @@
           placeholder="请选择最近折旧日期">
         </el-date-picker>
       </el-form-item>
-      <el-form-item label="折旧方式" prop="depreciationMethod">
+      <el-form-item  v-if="isExist('折旧方式')" label="折旧方式" prop="depreciationMethod">
         <el-input
           v-model="queryParams.depreciationMethod"
           placeholder="请输入折旧方式"
@@ -169,7 +179,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="合同编号" prop="contractNumber">
+      <el-form-item v-if="isExist('合同编号')"  label="合同编号" prop="contractNumber">
         <el-input
           v-model="queryParams.contractNumber"
           placeholder="请输入合同编号"
@@ -177,7 +187,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="出厂编号" prop="factoryNumber">
+      <el-form-item  v-if="isExist('出厂编号')" label="出厂编号" prop="factoryNumber">
         <el-input
           v-model="queryParams.factoryNumber"
           placeholder="请输入出厂编号"
@@ -185,7 +195,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="制造商" prop="manufacturer">
+      <el-form-item  v-if="isExist('制造商')" label="制造商" prop="manufacturer">
         <el-input
           v-model="queryParams.manufacturer"
           placeholder="请输入制造商"
@@ -193,7 +203,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="供应商" prop="supplier">
+      <el-form-item  v-if="isExist('供应商')" label="供应商" prop="supplier">
         <el-input
           v-model="queryParams.supplier"
           placeholder="请输入供应商"
@@ -201,7 +211,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="维保到期日期" prop="maintenanceDate">
+      <el-form-item v-if="isExist('维保到期日期')"  label="维保到期日期" prop="maintenanceDate">
         <el-date-picker clearable
           v-model="queryParams.maintenanceDate"
           type="date"
@@ -209,7 +219,7 @@
           placeholder="请选择维保到期日期">
         </el-date-picker>
       </el-form-item>
-      <el-form-item label="维修电话" prop="maintenanceTel">
+      <el-form-item v-if="isExist('维修电话')" label="维修电话" prop="maintenanceTel">
         <el-input
           v-model="queryParams.maintenanceTel"
           placeholder="请输入维修电话"
@@ -217,7 +227,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="维修人员" prop="maintenanceUser">
+      <el-form-item v-if="isExist('维修人员')"  label="维修人员" prop="maintenanceUser">
         <el-input
           v-model="queryParams.maintenanceUser"
           placeholder="请输入维修人员"
@@ -225,17 +235,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="所属公司" prop="corporation">
-        <div style="display:inline-block; width: 183px;">
-          <treeselect
-                v-model="queryParams.corporation"
-                :options="deptOptions"
-                :normalizer="normalizer"
-                placeholder="选择所属公司"
-              />
-        </div>
-      </el-form-item>
-      <el-form-item label="记录状态" prop="recordStatus">
+      <el-form-item  v-if="isExist('记录状态')" label="记录状态" prop="recordStatus">
         <el-select v-model="queryParams.recordStatus" placeholder="请选择记录状态" clearable>
           <el-option
             v-for="dict in dict.type.asset_record_status"
@@ -245,7 +245,7 @@
           />
         </el-select>
       </el-form-item>
-      <el-form-item label="是否白名单" prop="isWhitelist">
+      <el-form-item  v-if="isExist('是否白名单')" label="是否白名单" prop="isWhitelist">
         <el-select v-model="queryParams.isWhitelist" placeholder="请选择是否白名单" clearable>
           <el-option
             v-for="dict in dict.type.sys_yes_no"
@@ -376,6 +376,16 @@
           v-hasPermi="['asset:information:export']"
         >导出</el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-menu"
+          size="mini"
+          @click="handleDIY"
+          v-hasPermi="['asset:information:query']"
+        >自定义字段</el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -395,8 +405,6 @@
           <span>{{ scope.row.categoryNumber != null ? categoryName(scope.row.categoryNumber) : ""}}</span>
         </template>
       </el-table-column>
-      <el-table-column label="规格型号" align="center" prop="specificationsModel" />
-      <el-table-column label="ABC分类" align="center" prop="abcCategory" />
       <el-table-column label="管理状态" align="center" prop="manageStatus" />
       <el-table-column label="使用部门" align="center" prop="userDepartment" >
         <template slot-scope="scope">
@@ -408,58 +416,60 @@
           <span>{{ scope.row.department != null ? companyName(scope.row.department) : ""}}</span>
         </template>
       </el-table-column>
-      <el-table-column label="责任人" align="center" prop="responsiblePerson" />
       <el-table-column label="所在位置" align="center" prop="locationNumber" >
         <template slot-scope="scope">
           <span>{{ scope.row.locationNumber != null ? locationName(scope.row.locationNumber) : ""}}</span>
         </template>
       </el-table-column>
-      <el-table-column label="资产性质" align="center" prop="property" />
-      <el-table-column label="购置日期" align="center" prop="purchaseDate" width="180">
+      <el-table-column label="所属公司" align="center" prop="corporation" >
+        <template slot-scope="scope">
+          <span>{{ scope.row.corporation != null ? companyName(scope.row.corporation) : ""}}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column v-if="isExist('规格型号')" label="规格型号" align="center" prop="specificationsModel" />
+      <el-table-column  v-if="isExist('ABC分类')" label="ABC分类" align="center" prop="abcCategory" />
+      <el-table-column  v-if="isExist('责任人')" label="责任人" align="center" prop="responsiblePerson" />
+      <el-table-column  v-if="isExist('资产性质')" label="资产性质" align="center" prop="property" />
+      <el-table-column  v-if="isExist('购置日期')" label="购置日期" align="center" prop="purchaseDate" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.purchaseDate, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="启用日期" align="center" prop="commissioningDate" width="180">
+      <el-table-column  v-if="isExist('启用日期')" label="启用日期" align="center" prop="commissioningDate" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.commissioningDate, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="原值" align="center" prop="originalValue" />
-      <el-table-column label="使用年限" align="center" prop="durableYears" />
-      <el-table-column label="净值" align="center" prop="netValue" />
-      <el-table-column label="残值" align="center" prop="residualValue" />
-      <el-table-column label="累计折旧" align="center" prop="accumulatedDepreciation" />
-      <el-table-column label="最近折旧日期" align="center" prop="lastDepreciationDate" width="180">
+      <el-table-column v-if="isExist('原值')"  label="原值" align="center" prop="originalValue" />
+      <el-table-column v-if="isExist('使用年限')" label="使用年限" align="center" prop="durableYears" />
+      <el-table-column  v-if="isExist('净值')" label="净值" align="center" prop="netValue" />
+      <el-table-column  v-if="isExist('残值')" label="残值" align="center" prop="residualValue" />
+      <el-table-column  v-if="isExist('累计折旧')" label="累计折旧" align="center" prop="accumulatedDepreciation" />
+      <el-table-column  v-if="isExist('最近折旧日期')" label="最近折旧日期" align="center" prop="lastDepreciationDate" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.lastDepreciationDate, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="折旧方式" align="center" prop="depreciationMethod" />
-      <el-table-column label="合同编号" align="center" prop="contractNumber" />
-      <el-table-column label="出厂编号" align="center" prop="factoryNumber" />
-      <el-table-column label="制造商" align="center" prop="manufacturer" />
-      <el-table-column label="供应商" align="center" prop="supplier" />
-      <el-table-column label="资产用途" align="center" prop="purpose" />
-      <el-table-column label="维保到期日期" align="center" prop="maintenanceDate" width="180">
+      <el-table-column  v-if="isExist('折旧方式')" label="折旧方式" align="center" prop="depreciationMethod" />
+      <el-table-column  v-if="isExist('合同编号')" label="合同编号" align="center" prop="contractNumber" />
+      <el-table-column v-if="isExist('出厂编号')"  label="出厂编号" align="center" prop="factoryNumber" />
+      <el-table-column  v-if="isExist('制造商')" label="制造商" align="center" prop="manufacturer" />
+      <el-table-column  v-if="isExist('供应商')" label="供应商" align="center" prop="supplier" />
+      <el-table-column  v-if="isExist('资产用途')" label="资产用途" align="center" prop="purpose" />
+      <el-table-column  v-if="isExist('维保到期日期')" label="维保到期日期" align="center" prop="maintenanceDate" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.maintenanceDate, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="维修电话" align="center" prop="maintenanceTel" />
-      <el-table-column label="维修人员" align="center" prop="maintenanceUser" />
-      <el-table-column label="所属公司" align="center" prop="corporation" >
-        <template slot-scope="scope">
-          <span>{{ scope.row.corporation != null ? companyName(scope.row.corporation) : ""}}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="记录状态" align="center" prop="recordStatus">
+      <el-table-column  v-if="isExist('维修电话')" label="维修电话" align="center" prop="maintenanceTel" />
+      <el-table-column  v-if="isExist('维修人员')" label="维修人员" align="center" prop="maintenanceUser" />
+      <el-table-column  v-if="isExist('记录状态')" label="记录状态" align="center" prop="recordStatus">
         <template slot-scope="scope">
           <dict-tag :options="dict.type.asset_record_status" :value="scope.row.recordStatus"/>
         </template>
       </el-table-column>
-      <el-table-column label="备注" align="center" prop="remark" />
-      <el-table-column label="是否白名单" align="center" prop="isWhitelist" >
+      <el-table-column  v-if="isExist('是否白名单')" label="是否白名单" align="center" prop="isWhitelist" >
         <template slot-scope="scope">
           <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isWhitelist"/>
         </template>
@@ -504,7 +514,7 @@
     <!-- 添加或修改资产信息对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="资产条码" prop="code">
+        <el-form-item  label="资产条码" prop="code">
           <el-input v-model="form.code" placeholder="请输入资产条码" />
         </el-form-item>
         <el-form-item label="资产名称" prop="name">
@@ -526,12 +536,6 @@
             ></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item label="规格型号" prop="specificationsModel">
-          <el-input v-model="form.specificationsModel" placeholder="请输入规格型号" />
-        </el-form-item>
-        <el-form-item label="ABC分类" prop="abcCategory">
-          <el-input v-model="form.abcCategory" placeholder="请输入ABC分类" />
-        </el-form-item>
         <el-form-item label="使用部门" prop="userDepartment">
               <treeselect
                 v-model="form.userDepartment"
@@ -548,9 +552,6 @@
                 placeholder="选择管理部门"
               />
         </el-form-item>
-        <el-form-item label="责任人" prop="responsiblePerson">
-          <el-input v-model="form.responsiblePerson" placeholder="请输入责任人" />
-        </el-form-item>
         <el-form-item label="所在位置" prop="locationNumber">
           <el-select v-model="form.locationNumber" placeholder="请选择所在位置">
             <el-option
@@ -564,7 +565,27 @@
         <el-form-item label="资产性质" prop="property">
           <el-input v-model="form.property" placeholder="请输入资产性质" />
         </el-form-item>
-        <el-form-item label="购置日期" prop="purchaseDate">
+        <el-form-item label="所属公司" prop="corporation">
+              <treeselect
+                v-model="form.corporation"
+                :options="deptOptions"
+                :normalizer="normalizer"
+                placeholder="选择所属公司"
+              />
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" placeholder="请输入备注" />
+        </el-form-item>
+        <el-form-item v-if="isExist('规格型号')" label="规格型号" prop="specificationsModel">
+          <el-input v-model="form.specificationsModel" placeholder="请输入规格型号" />
+        </el-form-item>
+        <el-form-item  v-if="isExist('ABC分类')" label="ABC分类" prop="abcCategory">
+          <el-input v-model="form.abcCategory" placeholder="请输入ABC分类" />
+        </el-form-item>
+        <el-form-item   v-if="isExist('责任人')" label="责任人" prop="responsiblePerson">
+          <el-input v-model="form.responsiblePerson" placeholder="请输入责任人" />
+        </el-form-item>
+        <el-form-item   v-if="isExist('购置日期')" label="购置日期" prop="purchaseDate">
           <el-date-picker clearable
             v-model="form.purchaseDate"
             type="date"
@@ -572,7 +593,7 @@
             placeholder="请选择购置日期">
           </el-date-picker>
         </el-form-item>
-        <el-form-item label="启用日期" prop="commissioningDate">
+        <el-form-item   v-if="isExist('启用日期')" label="启用日期" prop="commissioningDate">
           <el-date-picker clearable
             v-model="form.commissioningDate"
             type="date"
@@ -580,22 +601,22 @@
             placeholder="请选择启用日期">
           </el-date-picker>
         </el-form-item>
-        <el-form-item label="原值" prop="originalValue">
+        <el-form-item  v-if="isExist('原值')" label="原值" prop="originalValue">
           <el-input v-model="form.originalValue" placeholder="请输入原值" />
         </el-form-item>
         <el-form-item label="使用年限" prop="durableYears">
           <el-input v-model="form.durableYears" placeholder="请输入使用年限" />
         </el-form-item>
-        <el-form-item label="净值" prop="netValue">
+        <el-form-item  v-if="isExist('净值')" label="净值" prop="netValue">
           <el-input v-model="form.netValue" placeholder="请输入净值" />
         </el-form-item>
-        <el-form-item label="残值" prop="residualValue">
+        <el-form-item  v-if="isExist('残值')" label="残值" prop="residualValue">
           <el-input v-model="form.residualValue" placeholder="请输入残值" />
         </el-form-item>
-        <el-form-item label="累计折旧" prop="accumulatedDepreciation">
+        <el-form-item  v-if="isExist('累计折旧')" label="累计折旧" prop="accumulatedDepreciation">
           <el-input v-model="form.accumulatedDepreciation" placeholder="请输入累计折旧" />
         </el-form-item>
-        <el-form-item label="最近折旧日期" prop="lastDepreciationDate">
+        <el-form-item  v-if="isExist('最近折旧日期')" label="最近折旧日期" prop="lastDepreciationDate">
           <el-date-picker clearable
             v-model="form.lastDepreciationDate"
             type="date"
@@ -603,25 +624,25 @@
             placeholder="请选择最近折旧日期">
           </el-date-picker>
         </el-form-item>
-        <el-form-item label="折旧方式" prop="depreciationMethod">
+        <el-form-item  v-if="isExist('折旧方式')" label="折旧方式" prop="depreciationMethod">
           <el-input v-model="form.depreciationMethod" placeholder="请输入折旧方式" />
         </el-form-item>
-        <el-form-item label="合同编号" prop="contractNumber">
+        <el-form-item  v-if="isExist('合同编号')" label="合同编号" prop="contractNumber">
           <el-input v-model="form.contractNumber" placeholder="请输入合同编号" />
         </el-form-item>
-        <el-form-item label="出厂编号" prop="factoryNumber">
+        <el-form-item  v-if="isExist('出厂编号')" label="出厂编号" prop="factoryNumber">
           <el-input v-model="form.factoryNumber" placeholder="请输入出厂编号" />
         </el-form-item>
-        <el-form-item label="制造商" prop="manufacturer">
+        <el-form-item  v-if="isExist('制造商')" label="制造商" prop="manufacturer">
           <el-input v-model="form.manufacturer" placeholder="请输入制造商" />
         </el-form-item>
-        <el-form-item label="供应商" prop="supplier">
+        <el-form-item  v-if="isExist('供应商')" label="供应商" prop="supplier">
           <el-input v-model="form.supplier" placeholder="请输入供应商" />
         </el-form-item>
-        <el-form-item label="资产用途" prop="purpose">
+        <el-form-item  v-if="isExist('资产用途')" label="资产用途" prop="purpose">
           <el-input v-model="form.purpose" type="textarea" placeholder="请输入内容" />
         </el-form-item>
-        <el-form-item label="维保到期日期" prop="maintenanceDate">
+        <el-form-item  v-if="isExist('维保到期日期')" label="维保到期日期" prop="maintenanceDate">
           <el-date-picker clearable
             v-model="form.maintenanceDate"
             type="date"
@@ -629,21 +650,13 @@
             placeholder="请选择维保到期日期">
           </el-date-picker>
         </el-form-item>
-        <el-form-item label="维修电话" prop="maintenanceTel">
+        <el-form-item  v-if="isExist('维修电话')" label="维修电话" prop="maintenanceTel">
           <el-input v-model="form.maintenanceTel" placeholder="请输入维修电话" />
         </el-form-item>
-        <el-form-item label="维修人员" prop="maintenanceUser">
+        <el-form-item  v-if="isExist('维修人员')" label="维修人员" prop="maintenanceUser">
           <el-input v-model="form.maintenanceUser" placeholder="请输入维修人员" />
         </el-form-item>
-        <el-form-item label="所属公司" prop="corporation">
-              <treeselect
-                v-model="form.corporation"
-                :options="deptOptions"
-                :normalizer="normalizer"
-                placeholder="选择所属公司"
-              />
-        </el-form-item>
-        <el-form-item label="记录状态" prop="recordStatus">
+        <el-form-item  v-if="isExist('记录状态')" label="记录状态" prop="recordStatus">
           <el-select v-model="form.recordStatus" placeholder="请选择记录状态">
             <el-option
               v-for="dict in dict.type.asset_record_status"
@@ -653,10 +666,7 @@
             ></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item label="备注" prop="remark">
-          <el-input v-model="form.remark" placeholder="请输入备注" />
-        </el-form-item>
-        <el-form-item label="是否白名单" prop="isWhitelist">
+        <el-form-item  v-if="isExist('是否白名单')" label="是否白名单" prop="isWhitelist">
           <el-select v-model="form.isWhitelist" placeholder="请输入是否白名单">
             <el-option
               v-for="dict in dict.type.sys_yes_no"
@@ -699,11 +709,44 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+  <el-dialog :title="title" :visible.sync="diyOpen" width="700px" append-to-body>
+  <template>
+    <div>
+      <el-checkbox-group v-model="checkList" mini>
+        <el-checkbox label="规格型号" border></el-checkbox>
+        <el-checkbox label="ABC分类" 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>
+        <el-checkbox label="原值" 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>
+        <el-checkbox label="折旧方式" 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>
+        <el-checkbox label="维保到期日期" 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>
+      </el-checkbox-group>
+    </div>
+  </template>
+  <div slot="footer" class="dialog-footer">
+    <el-button type="primary" @click="submitDIY">确 定</el-button>
+    <el-button @click="cancelDIY">取 消</el-button>
+  </div>
+</el-dialog>
   </div>
 </template>
 
 <script>
-import { listInformation, getInformation, delInformation, addInformation, updateInformation } from "@/api/asset/information";
+import { listInformation, getInformation, delInformation, addInformation, updateInformation, setDiy, getDiy } from "@/api/asset/information";
 import { listCategory } from "@/api/asset/category";
 import { listLocation } from "@/api/asset/location";
 import ImageUploadTemp from "@/components/ImageUploadTemp"
@@ -717,6 +760,16 @@ export default {
   components:{
     ImageUploadTemp,Treeselect
   },
+  computed:{
+    isExist() {
+      return (label) => {
+        if (!this.checkList.length) {
+          return false
+        }
+        return this.checkList.some(item => item === label);
+      }
+    }
+  },
   data() {
     return {
       // 遮罩层
@@ -744,6 +797,10 @@ export default {
       title: "",
       // 是否显示弹出层
       open: false,
+      //字段自定义弹出层
+      diyOpen: false,
+      //自定义字段列表
+      checkList: [],
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -817,6 +874,9 @@ export default {
     /** 查询资产信息列表 */
     getList() {
       this.loading = true;
+      getDiy().then(response => {
+        this.checkList = response.data
+      })
       listDept().then((response) => {
         this.deptOptions = this.handleTree(response.data, "deptId");
         this.arr = response.data
@@ -959,6 +1019,20 @@ export default {
         this.title = "修改资产信息";
       });
     },
+    /** 自定义字段按钮 */
+    handleDIY(){
+      this.diyOpen = true;
+      this.title = "自定义字段";
+    },
+    submitDIY(){
+      setDiy(this.checkList).then(response => {
+        this.diyOpen = false
+        this.$modal.msgSuccess("修改成功");
+      })
+    },
+    cancelDIY(){
+      this.diyOpen = false
+    },
     /** 提交按钮 */
     submitForm() {
       this.$refs["form"].validate(valid => {
@@ -998,3 +1072,19 @@ export default {
   }
 };
 </script>
+
+<style lang="less" scoped>
+/deep/ .el-checkbox-group{
+  display: flex;
+  align-items: center;
+  flex-wrap: wrap;
+  .el-checkbox {
+    flex-basis: 25%;
+    margin-bottom: 10px; /* 调整间距 */
+
+    &:nth-child(1) {
+      margin-left: 10px;
+    }
+  }
+}
+</style>

+ 45 - 11
ruoyi-ui/src/views/order/order/index.vue

@@ -54,12 +54,21 @@
         label="【调整】资产编号"
         prop="adjustmentAssetNumber"
       >
-        <el-input
-          v-model="queryParams.adjustmentAssetNumber"
-          placeholder="请输入【调整】资产编号"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
+      <template>
+            <el-select
+              v-model="queryParams.adjustmentAssetNumber"
+              filterable
+              placeholder="请输入资产编号"
+            >
+              <el-option
+                v-for="item in informationList"
+                :key="item.number"
+                :label="item.name"
+                :value="item.number"
+              >
+              </el-option>
+            </el-select>
+          </template>
       </el-form-item>
       <el-form-item
         v-if="queryParams.orderType === '2'"
@@ -364,7 +373,11 @@
         label="【调整】资产编号"
         align="center"
         prop="adjustmentAssetNumber"
-      />
+      >
+      <template slot-scope="scope">
+          <span>{{ scope.row.adjustmentAssetNumber != null ? getAssetName(scope.row.adjustmentAssetNumber) : ""}}</span>
+        </template>
+    </el-table-column>
       <el-table-column
         v-if="queryParams.orderType === '1'"
         label="【调整】资产原信息"
@@ -564,10 +577,21 @@
           label="【调整】资产编号"
           prop="adjustmentAssetNumber"
         >
-          <el-input
-            v-model="form.adjustmentAssetNumber"
-            placeholder="请输入【调整】资产编号"
-          />
+        <template>
+            <el-select
+              v-model="form.adjustmentAssetNumber"
+              filterable
+              placeholder="请输入资产编号"
+            >
+              <el-option
+                v-for="item in informationList"
+                :key="item.number"
+                :label="item.name"
+                :value="item.number"
+              >
+              </el-option>
+            </el-select>
+          </template>
         </el-form-item>
         <el-form-item
           v-if="form.orderType === 1"
@@ -768,6 +792,7 @@ import { deptTreeSelect } from "@/api/system/user";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import { auditOrder } from "@/api/order/order";
+import { listInformation } from "@/api/asset/information";
 export default {
   name: "Order",
   dicts: ["asset_order_type", "asset_record_status"],
@@ -790,6 +815,8 @@ export default {
       showSearch: true,
       // 总条数
       total: 0,
+      // 资产信息表格数据
+      informationList: [],
       // 资产单据表格数据
       orderList: [],
       orderType: 1,
@@ -874,6 +901,9 @@ export default {
     /** 查询资产单据列表 */
     getList() {
       this.loading = true;
+      listInformation().then((response) => {
+        this.informationList = response.rows;
+      });
       listOrder(this.queryParams).then((response) => {
         this.orderList = response.rows;
         console.log("单据列表", this.orderList);
@@ -887,6 +917,10 @@ export default {
         this.deptOptions = response.data;
       });
     },
+    getAssetName(val){
+      let arr = this.informationList.filter(item => item.number===val);
+       return arr[0].name
+    },
     // 取消按钮
     cancel() {
       this.open = false;

+ 3 - 2
ruoyi-ui/vue.config.js

@@ -9,7 +9,7 @@ const CompressionPlugin = require('compression-webpack-plugin')
 
 const name = process.env.VUE_APP_TITLE || 'RFID酒店管理系统' // 网页标题
 
-const port = process.env.port || process.env.npm_config_port || 80 // 端口
+const port = process.env.port || process.env.npm_config_port || 14568 // 端口
 
 // vue.config.js 配置说明
 //官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
@@ -35,7 +35,8 @@ module.exports = {
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        target: `http://localhost:8080`,
+        //target: `http://114.116.114.108:14567`,
+        target: `http://localhost:14567`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''