Browse Source

Signed-off-by: liuboyan <632697560@qq.com>
bug

liuboyan 4 years ago
parent
commit
bc9449be73
4 changed files with 88 additions and 24 deletions
  1. 12 12
      .idea/workspace.xml
  2. 19 0
      src/api/maintain.js
  3. 2 2
      src/views/device/deviceSpace.vue
  4. 55 10
      src/views/maintain/roomManage.vue

+ 12 - 12
.idea/workspace.xml

@@ -64,8 +64,8 @@
     </configuration>
     <recent_temporary>
       <list>
-        <item itemvalue="npm.dev" />
         <item itemvalue="npm.build" />
+        <item itemvalue="npm.dev" />
       </list>
     </recent_temporary>
   </component>
@@ -102,7 +102,7 @@
       <workItem from="1616980179924" duration="3371000" />
       <workItem from="1616983576621" duration="24475000" />
       <workItem from="1617067374202" duration="14701000" />
-      <workItem from="1617087683955" duration="1408000" />
+      <workItem from="1617087683955" duration="4285000" />
     </task>
     <servers />
   </component>
@@ -118,22 +118,22 @@
       <screen x="0" y="0" width="1920" height="1080" />
     </state>
     <state x="690" y="233" key="FileChooserDialogImpl/-1366.0.1366.768/0.0.1920.1080@0.0.1920.1080" timestamp="1617087670458" />
-    <state width="1893" height="250" key="GridCell.Tab.0.bottom" timestamp="1617088498034">
+    <state width="1893" height="250" key="GridCell.Tab.0.bottom" timestamp="1617092054647">
       <screen x="0" y="0" width="1920" height="1080" />
     </state>
-    <state width="1893" height="250" key="GridCell.Tab.0.bottom/-1366.0.1366.768/0.0.1920.1080@0.0.1920.1080" timestamp="1617088498034" />
-    <state width="1893" height="250" key="GridCell.Tab.0.center" timestamp="1617088498034">
+    <state width="1893" height="250" key="GridCell.Tab.0.bottom/-1366.0.1366.768/0.0.1920.1080@0.0.1920.1080" timestamp="1617092054647" />
+    <state width="1893" height="250" key="GridCell.Tab.0.center" timestamp="1617092054646">
       <screen x="0" y="0" width="1920" height="1080" />
     </state>
-    <state width="1893" height="250" key="GridCell.Tab.0.center/-1366.0.1366.768/0.0.1920.1080@0.0.1920.1080" timestamp="1617088498034" />
-    <state width="1893" height="250" key="GridCell.Tab.0.left" timestamp="1617088498034">
+    <state width="1893" height="250" key="GridCell.Tab.0.center/-1366.0.1366.768/0.0.1920.1080@0.0.1920.1080" timestamp="1617092054646" />
+    <state width="1893" height="250" key="GridCell.Tab.0.left" timestamp="1617092054646">
       <screen x="0" y="0" width="1920" height="1080" />
     </state>
-    <state width="1893" height="250" key="GridCell.Tab.0.left/-1366.0.1366.768/0.0.1920.1080@0.0.1920.1080" timestamp="1617088498034" />
-    <state width="1893" height="250" key="GridCell.Tab.0.right" timestamp="1617088498034">
+    <state width="1893" height="250" key="GridCell.Tab.0.left/-1366.0.1366.768/0.0.1920.1080@0.0.1920.1080" timestamp="1617092054646" />
+    <state width="1893" height="250" key="GridCell.Tab.0.right" timestamp="1617092054646">
       <screen x="0" y="0" width="1920" height="1080" />
     </state>
-    <state width="1893" height="250" key="GridCell.Tab.0.right/-1366.0.1366.768/0.0.1920.1080@0.0.1920.1080" timestamp="1617088498034" />
+    <state width="1893" height="250" key="GridCell.Tab.0.right/-1366.0.1366.768/0.0.1920.1080@0.0.1920.1080" timestamp="1617092054646" />
     <state x="509" y="165" width="1048" height="750" key="find.popup" timestamp="1617084968465">
       <screen x="0" y="0" width="1920" height="1080" />
     </state>
@@ -142,10 +142,10 @@
       <screen x="0" y="0" width="1920" height="1080" />
     </state>
     <state x="540" y="251" key="run.anything.popup/-1366.0.1366.768/0.0.1920.1080@0.0.1920.1080" timestamp="1616053585795" />
-    <state x="539" y="45" width="840" height="1034" key="search.everywhere.popup" timestamp="1616564513171">
+    <state x="539" y="45" width="840" height="1034" key="search.everywhere.popup" timestamp="1617091507631">
       <screen x="0" y="0" width="1920" height="1080" />
     </state>
-    <state x="539" y="45" width="840" height="1034" key="search.everywhere.popup/-1366.0.1366.768/0.0.1920.1080@0.0.1920.1080" timestamp="1616564513171" />
+    <state x="539" y="45" width="840" height="1034" key="search.everywhere.popup/-1366.0.1366.768/0.0.1920.1080@0.0.1920.1080" timestamp="1617091507631" />
   </component>
   <component name="XDebuggerManager">
     <breakpoint-manager>

+ 19 - 0
src/api/maintain.js

@@ -48,6 +48,24 @@ export function submitDeleteAssetsFormOfRoom (object) {
         type: 'JSON'
     })
 }
+//  房间管理--导出房间模板
+export function downloadImportMouldOfRoom (object) {
+    return download({
+        url: `/device/jywsRoom/downloadRoomTemplate`,
+        method: 'get',
+        params: object,
+        type: 'JSON'
+    })
+}
+//  房间管理--导出资产模板
+export function downloadAssetsImportMouldOfRoom (object) {
+    return download({
+        url: `/device/jywsRoom/downloadRoomAssetsTemplate`,
+        method: 'get',
+        params: object,
+        type: 'JSON'
+    })
+}
 
 /***** 计划管理 *****/
 
@@ -298,3 +316,4 @@ export function downloadTaskTableList (object) {
         type: 'JSON'
     })
 }
+

+ 2 - 2
src/views/device/deviceSpace.vue

@@ -30,14 +30,14 @@
                             <el-form-item prop="addressName">
                                 <el-input v-model="formData.filterForm.addressName" placeholder="请输入机房名称" clearable></el-input>
                             </el-form-item>
-                            <el-form-item>
+                            <!--<el-form-item>
                                 <el-select v-model="formData.filterForm.fx" placeholder="房型" clearable>
                                 </el-select>
                             </el-form-item>
                             <el-form-item>
                                 <el-select v-model="formData.filterForm.fjzt" placeholder="房间状态" clearable>
                                 </el-select>
-                            </el-form-item>
+                            </el-form-item>-->
                             <el-form-item>
                                 <el-button type="primary" @click="handlePageChange(1)" :disabled="!tableData.selectNode || tableData.selectNode.level < 2">查询</el-button>
                             </el-form-item>

+ 55 - 10
src/views/maintain/roomManage.vue

@@ -16,16 +16,17 @@
                     <template #header>
                         <div class="card-header">
                             <span class="card-title">房间列表</span>
-                            <span>
+                            <span style="display: flex">
+                                <el-button size="mini" type="primary" @click="downloadMould" v-if="checkMenuLimit('room/room/Import')">导出模板</el-button>
                                 <el-upload
                                     :action="'device/jywsRoom/importRoom/' + (tableData.selectNode ? tableData.selectNode.data.value : '')"
                                     :headers="{Authorization: 'Bearer '+ token}"
                                     accept=".xlsx"
                                     :show-file-list="false"
                                     :on-success="uploadSuccess"
-                                    :disabled="!tableData.selectNode"
-                                    v-if="checkMenuLimit('room/room/Import')">
-                                    <el-button size="mini" type="primary" :disabled="!tableData.selectNode">批量导入</el-button>
+                                    v-if="checkMenuLimit('room/room/Import')"
+                                    style="margin-left: 8px">
+                                    <el-button size="mini" type="primary">批量导入</el-button>
                                 </el-upload>
                             </span>
                         </div>
@@ -64,12 +65,12 @@
                         <el-table-column prop="roomCode" label="房间编码" minWidth="160" align="center"></el-table-column>
                         <el-table-column label="房型" minWidth="120" align="center">
                             <template #default="scope">
-                                {{dictionaryData.roomList.find(site => site.value == scope.row.roomType).label}}
+                                {{getTypeName(scope.row.roomType)}}
                             </template>
                         </el-table-column>
                         <el-table-column label="房间状态" minWidth="120" align="center">
                             <template #default="scope">
-                                {{dictionaryData.stateList.find(site => site.value == scope.row.roomStatus).label}}
+                                {{getStateName(scope.row.roomStatus)}}
                             </template>
                         </el-table-column>
                         <el-table-column prop="currentYearRepairNum" label="本年维保次数" minWidth="120" align="center"></el-table-column>
@@ -96,12 +97,12 @@
                                         <el-form-item label="房间号">{{formData.detailForm.roomNumber}}</el-form-item>
                                     </el-col>
                                     <el-col :span="12">
-                                        <el-form-item label="房型">{{dictionaryData.roomList.find(site => site.value == formData.detailForm.roomType).label}}</el-form-item>
+                                        <el-form-item label="房型">{{getTypeName(formData.detailForm.roomType)}}</el-form-item>
                                     </el-col>
                                 </el-row>
                                 <el-row>
                                     <el-col :span="12">
-                                        <el-form-item label="房间状态">{{dictionaryData.stateList.find(site => site.value == formData.detailForm.roomStatus).label}}</el-form-item>
+                                        <el-form-item label="房间状态">{{getStateName(formData.detailForm.roomStatus)}}</el-form-item>
                                     </el-col>
                                     <el-col :span="12"></el-col>
                                 </el-row>
@@ -155,13 +156,26 @@
                         </div>
                     </el-tab-pane>
                     <el-tab-pane label="资产信息" name="2">
-                        <el-table :data="tableData.assetsTableList" v-loading="tableData.assetsTableLoading" :height="props.resizeHeight - 250" stripe border fit>
+                        <div style="display: flex; justify-content: flex-end; margin-bottom: 10px;">
+                            <el-button size="mini" type="primary" @click="downloadAssetsMould" v-if="checkMenuLimit('room/room/AssetImport')">导出模板</el-button>
+                            <el-upload
+                                    :action="'device/jywsRoom/importRoomAssets/' + (tableData.selectNode ? tableData.selectNode.data.value : '')"
+                                    :headers="{Authorization: 'Bearer '+ token}"
+                                    accept=".xlsx"
+                                    :show-file-list="false"
+                                    :on-success="uploadSuccess"
+                                    v-if="checkMenuLimit('room/room/AssetImport')"
+                                    style="margin-left: 8px">
+                                <el-button size="mini" type="primary">批量导入</el-button>
+                            </el-upload>
+                        </div>
+                        <el-table :data="tableData.assetsTableList" v-loading="tableData.assetsTableLoading" :height="props.resizeHeight - 290" stripe border fit>
                             <el-table-column prop="assetsClassify" label="资产分类" minWidth="120" align="center"></el-table-column>
                             <el-table-column prop="assetsName" label="资产名称" minWidth="120" align="center"></el-table-column>
                             <el-table-column prop="costPrice" label="成本价" minWidth="120" align="center"></el-table-column>
                             <el-table-column prop="washPrice" label="清洗费" minWidth="120" align="center"></el-table-column>
                             <el-table-column prop="purchasePrice" label="购买/赔偿价" minWidth="120" align="center"></el-table-column>
-                            <el-table-column label="操作" width="160" align="center" fixed="right">
+                            <el-table-column label="操作" width="160" align="center">
                                 <template #default="scope">
                                     <el-button size="mini" type="primary" @click="handleAssetsDetail" v-if="checkMenuLimit('room/room/AssetEdit')">编辑</el-button>
                                     <el-button size="mini" type="danger" @click="handleAssetsDelete" v-if="checkMenuLimit('room/room/AssetDelete')">删除</el-button>
@@ -236,6 +250,8 @@
         getAssetsTableListOfRoom,
         submitEditAssetsFormOfRoom,
         submitDeleteAssetsFormOfRoom,
+        downloadImportMouldOfRoom,
+        downloadAssetsImportMouldOfRoom,
     } from 'api/maintain'
     import {
         ElNotification,
@@ -266,9 +282,26 @@
                     {label:'住脏房', value: 'DO',},
                     {label:'维修房', value: 'O',},
                     {label:'锁房', value: 'S',},
+                    {label:'临时', value: 'I',},
                 ],
                 assetsList: [],
             })
+            //  获取房型名称
+            function getTypeName(code){
+                if (dictionaryData.roomList.find(site => site.value == code)){
+                    return dictionaryData.roomList.find(site => site.value == code).label
+                } else {
+                    return '其他'
+                }
+            }
+            //  获取房态名称
+            function getStateName(code){
+                if (dictionaryData.stateList.find(site => site.value == code)){
+                    return dictionaryData.stateList.find(site => site.value == code).label
+                } else {
+                    return '其他'
+                }
+            }
             //  树形结构点击节点
             function nodeClick (node, data) {
                 tableData.tableList = []
@@ -507,6 +540,14 @@
                     });
                 }
             }
+            //  导出房间模板
+            function downloadMould () {
+                downloadImportMouldOfRoom({})
+            }
+            //  导出资产模板
+            function downloadAssetsMould () {
+                downloadAssetsImportMouldOfRoom({})
+            }
             //  暴露
             return {
                 checkMenuLimit,
@@ -514,6 +555,8 @@
                 token,
                 //  字典
                 dictionaryData,
+                getTypeName,
+                getStateName,
                 //  树形
                 nodeClick,
                 //  表格
@@ -533,6 +576,8 @@
                 submitAssetsForm,
                 //  上传
                 uploadSuccess,
+                downloadMould,
+                downloadAssetsMould,
             }
         }
     }