This commit is contained in:
xd 2024-03-19 13:35:59 +08:00
parent f3d00a2c50
commit 789ac20f7c
5 changed files with 81 additions and 14 deletions

View File

@ -5,6 +5,7 @@ import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.core.redis.RedisLock; import com.ruoyi.common.core.redis.RedisLock;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
@ -419,12 +420,11 @@ public class storageLocationController extends BaseController
* 获取操作记录 * 获取操作记录
*/ */
@GetMapping("/listOperlog") @GetMapping("/listOperlog")
public AjaxResult listOperlog(Operlog operlog) public TableDataInfo listOperlog(Operlog operlog)
{ {
AjaxResult ajaxResult = new AjaxResult(); startPage();
List<Operlog> operlogData = storageLocationService.selectOperlogs(operlog); List<Operlog> list = storageLocationService.selectOperlogs(operlog);
ajaxResult.put("operlogData",operlogData); return getDataTable(list);
return ajaxResult;
} }
/*===========================================操作记录==========================================================*/ /*===========================================操作记录==========================================================*/

View File

@ -1,6 +1,8 @@
package com.ruoyi.storageLocation.domain; package com.ruoyi.storageLocation.domain;
public class Operlog { import com.ruoyi.common.core.domain.BaseEntity;
public class Operlog extends BaseEntity {
private String operlog_id; private String operlog_id;
private String operlog_kw; private String operlog_kw;
private String operlog_date; private String operlog_date;

View File

@ -143,7 +143,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select operlog_date,operlog_user_name,operlog_event,operlog_zlh,operlog_xingh select operlog_date,operlog_user_name,operlog_event,operlog_zlh,operlog_xingh
,operlog_guig,operlog_diany,operlog_ms ,operlog_guig,operlog_diany,operlog_ms
from operlog from operlog
where operlog_kw = #{operlog_kw} order by operlog_date desc <where>
<if test="operlog_kw != null and operlog_kw != ''">
AND operlog_kw = #{operlog_kw}
</if>
<if test="operlog_user_name != null and operlog_user_name != ''">
AND operlog_user_name like concat('%', #{operlog_user_name}, '%')
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and datediff(d, operlog_date, #{params.beginTime}) <![CDATA[<=]]> 0
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and datediff(d, operlog_date, #{params.endTime}) <![CDATA[>=]]> 0
</if>
</where>
order by operlog_date desc
</select> </select>
<select id="selectYlrStorageLocation" parameterType="java.lang.String" resultType="StorageLocation"> <select id="selectYlrStorageLocation" parameterType="java.lang.String" resultType="StorageLocation">

View File

@ -83,7 +83,7 @@
<el-tag size="mini" type="success" @click="openDialog(item)">空闲</el-tag> <el-tag size="mini" type="success" @click="openDialog(item)">空闲</el-tag>
</span> </span>
<span v-if = "item.materialState=='1'"> <span v-if = "item.materialState=='1'">
<el-tag size="mini" type="danger">已用</el-tag> <el-tag size="mini" type="danger" @click="openUpdDialog(item)">已用</el-tag>
</span> </span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :span="2" :contentStyle='contentStyle' :labelStyle='labelStyle'> <el-descriptions-item :span="2" :contentStyle='contentStyle' :labelStyle='labelStyle'>
@ -136,7 +136,7 @@
<el-tag size="mini" type="success" @click="openDialog(item)">空闲</el-tag> <el-tag size="mini" type="success" @click="openDialog(item)">空闲</el-tag>
</span> </span>
<span v-if = "item.materialState=='1'"> <span v-if = "item.materialState=='1'">
<el-tag size="mini" type="danger">已用</el-tag> <el-tag size="mini" type="danger" @click="openUpdDialog(item)">已用</el-tag>
</span> </span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :span="2" :contentStyle='contentStyle' :labelStyle='labelStyle'> <el-descriptions-item :span="2" :contentStyle='contentStyle' :labelStyle='labelStyle'>
@ -425,7 +425,7 @@
// //
cancel(form) { cancel(form) {
if(form.userName){ if(!form.userName){
cancelStorageLocation(this.form).then(response => { cancelStorageLocation(this.form).then(response => {
this.open = false; this.open = false;
this.reset(); this.reset();

View File

@ -1,13 +1,38 @@
<template> <template>
<div> <div>
<h1>{{ materialBhProp }}</h1>
<el-form :inline="true" :model="queryParams" class="demo-form-inline">
<el-form-item label="库位">
<span style="font-size: 20px;color: #1682e6">{{ materialBhProp }}</span>
<el-input v-model="queryParams.operlog_kw" v-if="false"></el-input>
</el-form-item>
<el-form-item label="操作时间">
<el-date-picker
v-model="dateRange"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
></el-date-picker>
</el-form-item>
<el-form-item label="操作人">
<el-input v-model="queryParams.operlog_user_name" placeholder="操作人"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="search()">查询</el-button>
</el-form-item>
</el-form>
<el-table <el-table
:data="operlogData" :data="operlogData"
v-loading="loading"
height="500" height="500"
style="width: 100%"> style="width: 100%">
<el-table-column <el-table-column
prop="operlog_date" prop="operlog_date"
label="时间" label="操作时间"
width="200" width="200"
fixed> fixed>
</el-table-column> </el-table-column>
@ -51,6 +76,13 @@
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getOperlogData"
/>
</div> </div>
</template> </template>
<script> <script>
@ -63,8 +95,18 @@ import { listOperlog } from "@/api/storageLocation/operlog";
data() { data() {
return { return {
queryParams: { queryParams: {
pageNum: 1,
pageSize: 10,
operlog_kw: null, operlog_kw: null,
operlog_date: null,
operlog_user_name: null
}, },
//
loading: true,
//
total: 0,
//
dateRange: [],
operlogData: [], operlogData: [],
} }
}, },
@ -80,11 +122,20 @@ import { listOperlog } from "@/api/storageLocation/operlog";
methods: { methods: {
/*获取操作记录*/ /*获取操作记录*/
getOperlogData() { getOperlogData() {
this.loading = true;
this.queryParams.operlog_kw = this._props.materialBhProp; this.queryParams.operlog_kw = this._props.materialBhProp;
this.operlogData = []; this.operlogData = [];
listOperlog(this.queryParams).then(response => { listOperlog(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.operlogData = response.operlogData; this.operlogData = response.rows;
this.total = response.total;
this.loading = false;
}); });
},
//
search(){
this.queryParams.pageNum = 1;
this.getOperlogData();
} }
} }
} }