xtk 7 months ago
parent
commit
abfdeb3dae

+ 4 - 1
src/components/buttons/search.vue

@@ -5,7 +5,7 @@
             <img :src="down_blue" />
         </div>
         <button class="btn_primary" @click="search">查询</button>
-        <button class="btn_nomal">重置</button>
+        <button class="btn_nomal" @click="reSearch">重置</button>
     </div>
 </template>
 <script>
@@ -21,6 +21,9 @@ export default {
         },
         search(){
             this.$emit('search')
+        },
+        reSearch(){
+            this.$emit('reSearch')
         }
     }
 }

+ 8 - 8
src/components/layouts/left.vue

@@ -27,18 +27,18 @@ export default {
                     path: '/zbgh',
                     name: '装备归还',
                 },
-                {
-                    path: '/syfx',
-                    name: '使用分析',
-                },
+                // {
+                //     path: '/syfx',
+                //     name: '使用分析',
+                // },
                 {
                     path: '/zbgl',
                     name: '装备管理'
                 },
-                {
-                    path: '/system',
-                    name: '系统设置'
-                }
+                // {
+                //     path: '/system',
+                //     name: '系统设置'
+                // }
             ],
             pathImg: {
                 '/main': require('./img/nav_home.svg'),

+ 7 - 1
src/components/map/viewDrawer.vue

@@ -96,7 +96,13 @@ export default {
         getData() {
             this.loading = true
             getpage(1, 10, { zbbh: this.dataList.zbbh }).then(res => {
-                this.dataDetail = res.data.data.records[0]
+                // this.dataDetail = res.data.data.records[0]
+                const list = res.data.data
+                let arr = []
+                for (let i = 0; i < list.length; i++) {
+                    arr.unshift(list[i])
+                }
+                this.historyList = arr
             })
             selectLsjl(this.dataList.zbbh).then(res => {
                 this.historyList = res.data.data

+ 1 - 1
src/page/login/index.vue

@@ -7,7 +7,7 @@
           {{ time }}
         </div>
         <p class="title">{{ $t('login.info') }}</p>
-        <div style="font-size: 15px">
+        <div style="font-size: 15px;display: none;">
           <span>----------------------------------------------</span>
           <br>
           <span>管理租户编号:000000</span>

+ 5 - 3
src/page/login/userlogin.vue

@@ -5,7 +5,7 @@
            ref="loginForm"
            :model="loginForm"
            label-width="0">
-    <el-form-item v-if="tenantMode" prop="tenantId">
+    <el-form-item v-if="tenantMode" prop="tenantId" style="display: none;">
       <el-input size="small"
                 @keyup.enter.native="handleLogin"
                 v-model="loginForm.tenantId"
@@ -88,9 +88,11 @@
           //角色ID
           roleId: "",
           //用户名
-          username: "admin",
+          username: "",
+          // username: "admin",
           //密码
-          password: "admin",
+          password: "",
+          // password: "admin",
           // password: "xwkj2022@",
           //账号类型
           type: "account",

+ 1 - 0
src/views/main/com/giveBack.vue

@@ -37,6 +37,7 @@ export default {
         },
         dialogSave() {
             this.giveBackData.zbzt = '03'
+            console.log('giveBackData',this.giveBackData)
             this.loading = true
             update(this.giveBackData).then(res => {
                 if (res.data.code == 200) {

+ 8 - 1
src/views/main/index.vue

@@ -2,7 +2,7 @@
     <div class="content_body" v-loading="loading">
         <Tree ref="tree"></Tree>
         <div style="flex: 1;">
-            <Search @search="search" ref="search1" @searchBtnChange="searchBtnChange"></Search>
+            <Search @search="search" ref="search1" @searchBtnChange="searchBtnChange" @reSearch="reSearch"></Search>
             <div class="tab_body">
                 <!-- <button class="btn_empty" @click="lqsb" :disabled="!currentRow" :style="{
                     backgroundColor: currentRow ? '#fff' : '#ecf5ff',
@@ -196,6 +196,13 @@ export default {
                 this.total = res.data.data.total
             }).finally(() => this.loading = false)
         },
+        reSearch(){
+            this.page = {
+                pageSize: 10,
+                pageCurrent: 1,
+            },
+            this.getData()
+        },
         view(scope) {
             this.drawerTitle = '装备信息'
             this.dataList = scope.row

+ 6 - 2
src/views/main/search.vue

@@ -15,7 +15,7 @@
                 </el-date-picker>
             </el-form-item>
         </el-form>
-        <Search @searchBtnChange="searchBtnChange" @search="search"></Search>
+        <Search @searchBtnChange="searchBtnChange" @search="search" @reSearch="reSearch"></Search>
     </div>
 </template>
 <script>
@@ -59,7 +59,11 @@ export default {
                 this.offsetHeight = el.offsetHeight
                 this.$emit('searchBtnChange')
             })
-        }
+        },
+        reSearch(){
+            this.searchForm = {}
+            this.$emit('reSearch')
+        },
     }
 
 }

+ 6 - 6
src/views/main/viewDrawer.vue

@@ -129,13 +129,13 @@ export default {
             this.loading = true
             selectLsjl(this.dataList.zbbh).then(res => {
                 const list = res.data.data
-                // let arr = []
-                // for (let i = 0; i < list.length; i++) {
-                //     arr.unshift(list[i])
-                // }
+                let arr = []
+                for (let i = 0; i < list.length; i++) {
+                    arr.unshift(list[i])
+                }
                 // console.log('arr', arr)
-                // this.historyList = arr
-                this.historyList = list
+                this.historyList = arr
+                // this.historyList = list
             }).finally(() => this.loading = false)
         },
         // 归还后的刷新

+ 30 - 5
src/views/zbgh/index.vue

@@ -2,7 +2,7 @@
     <div class="content_body" v-loading="loading">
         <Tree ref="tree"></Tree>
         <div style="flex: 1;">
-            <Search @search="search" ref="search1" @searchBtnChange="searchBtnChange"></Search>
+            <Search @search="search" ref="search1" @searchBtnChange="searchBtnChange" @reSearch="reSearch"></Search>
             <div class="tab_body">
                 <el-tabs v-model="activeName" @tab-click="handleClick">
                     <el-tab-pane label="待归还" name="list">
@@ -70,7 +70,7 @@
                             <el-table-column fixed="right" label="操作" width="100">
                                 <template slot-scope="scope">
                                     <el-button @click="view(scope)" type="text" size="small">查看</el-button>
-                                    <el-button @click="view(scope)" type="text" size="small">归还</el-button>
+                                    <el-button @click="toGiveBack(scope)" type="text" size="small">归还</el-button>
                                 </template>
                             </el-table-column>
                         </el-table>
@@ -159,7 +159,8 @@
             </div>
         </div>
         <viewDrawer ref="viewDrawer" :dataList="dataList" :selectedIndex="selectedIndex" :detailMaxPage="detailMaxPage"
-            @prevPage="prevPage" @nextPage="nextPage" :title="drawerTitle" />
+            @prevPage="prevPage" @nextPage="nextPage" :title="drawerTitle" @refresh="getData" />
+        <giveBack ref="giveBack" @giveBack="giveBackOk" :giveBackData="giveBackData" />
     </div>
 </template>
 <script>
@@ -167,9 +168,10 @@ import Search from './search.vue'
 import Tree from '@/components/tree.vue'
 import viewDrawer from '@/views/main/viewDrawer.vue'
 import { getpage } from '@/api/zdzb/zdzb.js'
+import giveBack from '@/views/main/com/giveBack.vue'
 
 export default {
-    components: { Search, Tree, viewDrawer, },
+    components: { Search, Tree, viewDrawer, giveBack },
     data() {
         return {
             activeName: 'list',
@@ -186,6 +188,7 @@ export default {
             ssdws: [],                  // tree 自选 所属单位
             tableKey: Math.random(),
             loading: false,
+            giveBackData: {}
         }
     },
     computed: {
@@ -223,12 +226,33 @@ export default {
             let deptList = this.ssdws.map(item => {
                 return item.id
             })
+            let zbzt
+            if (this.activeName == 'list') {
+                zbzt = "01,02"
+            }
+            if (this.activeName == 'back') {
+                zbzt = "03,04"
+            }
             getpage(this.page.pageCurrent, this.page.pageSize,
-                { ...this.$refs.search1.searchForm, deptList: deptList }).then(res => {
+                { ...this.$refs.search1.searchForm, deptList: deptList, zbzt: zbzt }).then(res => {
                     this.tableList = res.data.data.records
                     this.total = res.data.data.total
                 }).finally(() => this.loading = false)
         },
+        reSearch() {
+            this.page = {
+                pageSize: 10,
+                pageCurrent: 1,
+            },
+                this.getData()
+        },
+        toGiveBack(scope) {
+            this.giveBackData = scope.row
+            this.$refs.giveBack.show()
+        },
+        giveBackOk() {
+            this.getData()
+        },
         view(scope) {
             this.drawerTitle = '装备信息'
             this.dataList = scope.row
@@ -256,6 +280,7 @@ export default {
             this.getData()
         },
         handleClick(el) {
+            this.getData()
             this.tableKey = Math.random();
         }
     }

+ 6 - 2
src/views/zbgh/search.vue

@@ -15,7 +15,7 @@
                 </el-date-picker>
             </el-form-item>
         </el-form>
-        <Search @searchBtnChange="searchBtnChange" @search="search"></Search>
+        <Search @searchBtnChange="searchBtnChange" @search="search" @reSearch="reSearch"></Search>
     </div>
 </template>
 <script>
@@ -52,7 +52,11 @@ export default {
                 this.offsetHeight = el.offsetHeight
                 this.$emit('searchBtnChange')
             })
-        }
+        },
+        reSearch(){
+            this.searchForm = {}
+            this.$emit('reSearch')
+        },
     }
 
 }

+ 8 - 2
src/views/zbgl/index.vue

@@ -2,7 +2,7 @@
     <div class="content_body">
         <Tree ref="tree"></Tree>
         <div style="flex: 1;">
-            <Search @search="search" ref="search3" @searchBtnChange="searchBtnChange"></Search>
+            <Search @search="search" ref="search3" @searchBtnChange="searchBtnChange" @reSearch="reSearch"></Search>
             <div class="tab_body">
                 <button class="btn_empty1 btn_empty" @click="xzzb">+ 新增装备</button>
                 <!-- <button class="btn_empty2 btn_empty" @click="lqsb">+ 领取装备</button> -->
@@ -194,7 +194,13 @@ export default {
                 this.tableList = res.data.data.records
                 this.total = res.data.data.total
             })
-
+        },
+        reSearch(){
+            this.page = {
+                pageSize: 10,
+                pageCurrent: 1,
+            },
+            this.getData()
         },
         view(scope) {
             this.drawerTitle = '装备信息'

+ 6 - 2
src/views/zbgl/search.vue

@@ -21,7 +21,7 @@
                 </el-select>
             </el-form-item>
         </el-form>
-        <Search @searchBtnChange="searchBtnChange" @search="search"></Search>
+        <Search @searchBtnChange="searchBtnChange" @search="search" @reSearch="reSearch"></Search>
     </div>
 </template>
 <script>
@@ -65,7 +65,11 @@ export default {
                 this.offsetHeight = el.offsetHeight
                 this.$emit('searchBtnChange')
             })
-        }
+        },
+        reSearch(){
+            this.searchForm = {}
+            this.$emit('reSearch')
+        },
     }
 
 }