Преглед на файлове

增加登录记录页面

yanshichao преди 1 година
родител
ревизия
73c6a0a24c
променени са 3 файла, в които са добавени 179 реда и са изтрити 8 реда
  1. 11 0
      src/api/system/loginInfo.js
  2. 33 8
      src/views/material/monthCheck.vue
  3. 135 0
      src/views/system/loginInfo.vue

+ 11 - 0
src/api/system/loginInfo.js

@@ -0,0 +1,11 @@
+import request from '@/utils/request'
+
+// 查询字典列表
+export function listLoginInfo(query) {
+  return request({
+    url: '/system/login/info/list',
+    method: 'get',
+    params: query
+  })
+}
+

+ 33 - 8
src/views/material/monthCheck.vue

@@ -32,7 +32,7 @@
       </el-row>
     </div>
 
-    <el-collapse v-model="activeName" accordion style="height: calc(100vh - 150px);overflow: auto">
+    <el-collapse v-model="activeName" accordion style="height: calc(100vh - 140px);overflow: auto">
       <template v-for="(item,index) in checkList">
         <el-collapse-item :name="index">
           <template slot="title">
@@ -74,12 +74,27 @@
             </el-table-column>
             <el-table-column label="是否确认">
               <template slot-scope="scope">
-                <el-tag type="info" v-if="scope.row.receiveConfirm==='0'">
-                  <i class="el-icon-coordinate"></i>未确认
-                </el-tag>
-                <el-tag type="success" v-if="scope.row.receiveConfirm==='1'">
-                  <i class="el-icon-coordinate"></i>已确认
-                </el-tag>
+                <div v-if="item.userName==='仓库'">
+                  <el-button
+                    icon="el-icon-coordinate"
+                    size="mini"
+                    type="text"
+                    v-if="scope.row.receiveConfirm==='0'"
+                    @click="handleConfirm(scope.row)"
+                  >确认
+                  </el-button>
+                  <el-tag type="success" v-if="scope.row.receiveConfirm==='1'">
+                    <i class="el-icon-coordinate"></i>已确认
+                  </el-tag>
+                </div>
+                <div v-else>
+                  <el-tag type="info" v-if="scope.row.receiveConfirm==='0'">
+                    <i class="el-icon-coordinate"></i>未确认
+                  </el-tag>
+                  <el-tag type="success" v-if="scope.row.receiveConfirm==='1'">
+                    <i class="el-icon-coordinate"></i>已确认
+                  </el-tag>
+                </div>
               </template>
             </el-table-column>
           </el-table>
@@ -92,7 +107,7 @@
 <script>
 import {
   monthCheck,
-  getMonthCheckList
+  getMonthCheckList, monthCheckConfirm
 } from "@/api/material/transfer";
 import DateUtil from "@/utils/date"
 
@@ -119,6 +134,16 @@ export default {
       getMonthCheckList({date: val}).then(res => {
         this.checkList = res.data
       })
+    },
+    handleConfirm(row) {
+      let data = {
+        date: this.date,
+        assetIds: [row.id]
+      }
+      monthCheckConfirm(data).then(res => {
+        row.receiveConfirm = '1'
+        this.$message.success(res.message)
+      })
     }
   }
 }

+ 135 - 0
src/views/system/loginInfo.vue

@@ -0,0 +1,135 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true">
+      <el-form-item label="登录账号" prop="userAccount">
+        <el-input
+          v-model="queryParams.userAccount"
+          placeholder="请输入登录账号"
+          clearable
+          style="width: 200px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="登录用户名" prop="userName">
+        <el-input
+          v-model="queryParams.userName"
+          placeholder="请输入登录用户名"
+          clearable
+          style="width: 200px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+
+    <el-table :data="loginInfoList" size="mini">
+      <el-table-column label="编号" prop="id"/>
+      <el-table-column label="登录账号" prop="userAccount"/>
+      <el-table-column label="登录用户名" prop="userName"/>
+      <el-table-column label="登录IP" prop="ipaddr"/>
+      <el-table-column label="浏览器类型" prop="browser"/>
+      <el-table-column label="操作系统" prop="os" min-width="150"/>
+      <el-table-column label="登录时间" prop="loginTime"/>
+    </el-table>
+
+    <div style="margin-top: 10px;text-align: center">
+      <el-pagination
+        background
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page="queryParams.pageNum"
+        :page-sizes="[10, 20, 50]"
+        :page-size="queryParams.pageSize"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="total">
+      </el-pagination>
+    </div>
+
+  </div>
+</template>
+
+<script>
+import {
+  listLoginInfo,
+} from "@/api/system/loginInfo";
+
+export default {
+  name: "dict",
+  data() {
+    return {
+      // 总条数
+      total: 0,
+      // 登录信息数据
+      loginInfoList: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        userAccount: undefined,
+        userName: undefined
+      }
+
+    };
+  },
+  created() {
+    this.initData();
+  },
+  methods: {
+    initData() {
+      this.getList();
+    },
+    /** 查询登录日志列表 */
+    getList() {
+      listLoginInfo(this.queryParams).then(response => {
+          this.loginInfoList = response.data.records;
+          this.total = response.data.total;
+        }
+      );
+    },
+
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.dateRange = [];
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    handleSizeChange(val) {
+      this.queryParams.pageSize = val;
+      this.getList();
+    },
+    handleCurrentChange(val) {
+      this.queryParams.pageNum = val;
+      this.getList();
+    },
+
+  }
+};
+</script>
+
+<style scoped lang="scss">
+.el-form-item--mini.el-form-item, .el-form-item--small.el-form-item {
+  margin-bottom: 10px;
+}
+
+.item-card ::v-deep {
+  margin-bottom: 10px;
+
+  .el-card__header {
+    padding: 10px 10px 0px 10px;
+  }
+
+  .el-card__body {
+    padding: 10px;
+  }
+}
+
+</style>