Merge remote-tracking branch 'origin/0.8.X' into 0.8.X
This commit is contained in:
@@ -27,10 +27,11 @@
|
|||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="getLogList">查询</el-button>
|
<el-button type="primary" @click="getLogList">查询</el-button>
|
||||||
<el-button @click="resetParams">重置</el-button>
|
<el-button @click="resetParams">重置</el-button>
|
||||||
|
<el-button @click="exportLog">导出</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-table v-loading="logLoading" :data="logList" style="width: 100%" border stripe>
|
<el-table v-loading="logLoading" :data="logList" height="calc(100vh - 200px)" style="width: 100%" border stripe>
|
||||||
<el-table-column prop="createTime" label="操作时间" width="180">
|
<el-table-column prop="createTime" label="操作时间" width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.createTime }}
|
{{ scope.row.createTime }}
|
||||||
@@ -115,13 +116,36 @@ export default {
|
|||||||
RawMaterialInfo,
|
RawMaterialInfo,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
// 计算昨天和今天的日期
|
||||||
|
const today = new Date();
|
||||||
|
const yesterday = new Date();
|
||||||
|
yesterday.setDate(yesterday.getDate() - 1);
|
||||||
|
|
||||||
|
// 昨天设置为0点0分0秒
|
||||||
|
yesterday.setHours(0, 0, 0, 0);
|
||||||
|
// 今天设置为23点59分59秒
|
||||||
|
today.setHours(23, 59, 59, 999);
|
||||||
|
|
||||||
|
// 格式化日期为 yyyy-MM-dd HH:mm:ss
|
||||||
|
const formatDate = (date) => {
|
||||||
|
const year = date.getFullYear();
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||||
|
const day = String(date.getDate()).padStart(2, '0');
|
||||||
|
const hours = String(date.getHours()).padStart(2, '0');
|
||||||
|
const minutes = String(date.getMinutes()).padStart(2, '0');
|
||||||
|
const seconds = String(date.getSeconds()).padStart(2, '0');
|
||||||
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||||
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
logList: [],
|
logList: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
logParams: {
|
logParams: {
|
||||||
coilId: null,
|
coilId: null,
|
||||||
startTime: "",
|
// startTime: yesterday,
|
||||||
endTime: "",
|
// endTime: today,
|
||||||
|
startTime: formatDate(yesterday),
|
||||||
|
endTime: formatDate(today),
|
||||||
operationType: null,
|
operationType: null,
|
||||||
inOutType: null,
|
inOutType: null,
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
@@ -201,11 +225,40 @@ export default {
|
|||||||
.catch((err) => { this.$message.error("删除失败:" + err.message); });
|
.catch((err) => { this.$message.error("删除失败:" + err.message); });
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
exportLog() {
|
||||||
|
this.download('/wms/coilWarehouseOperationLog/exportByWarehouseAndTime', {
|
||||||
|
...this.logParams,
|
||||||
|
}, '日志导出.xlsx')
|
||||||
|
},
|
||||||
// 重置筛选条件
|
// 重置筛选条件
|
||||||
resetParams() {
|
resetParams() {
|
||||||
|
// 计算昨天和今天的日期
|
||||||
|
const today = new Date();
|
||||||
|
const yesterday = new Date();
|
||||||
|
yesterday.setDate(yesterday.getDate() - 1);
|
||||||
|
|
||||||
|
// 昨天设置为0点0分0秒
|
||||||
|
yesterday.setHours(0, 0, 0, 0);
|
||||||
|
// 今天设置为23点59分59秒
|
||||||
|
today.setHours(23, 59, 59, 999);
|
||||||
|
|
||||||
|
// 格式化日期为 yyyy-MM-dd HH:mm:ss
|
||||||
|
const formatDate = (date) => {
|
||||||
|
const year = date.getFullYear();
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||||
|
const day = String(date.getDate()).padStart(2, '0');
|
||||||
|
const hours = String(date.getHours()).padStart(2, '0');
|
||||||
|
const minutes = String(date.getMinutes()).padStart(2, '0');
|
||||||
|
const seconds = String(date.getSeconds()).padStart(2, '0');
|
||||||
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||||
|
};
|
||||||
|
|
||||||
this.logParams = {
|
this.logParams = {
|
||||||
startTime: "",
|
coilId: this.coilId,
|
||||||
endTime: "",
|
// startTime: yesterday,
|
||||||
|
// endTime: today,
|
||||||
|
startTime: formatDate(yesterday),
|
||||||
|
endTime: formatDate(today),
|
||||||
operationType: null,
|
operationType: null,
|
||||||
inOutType: null,
|
inOutType: null,
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user