diff --git a/klp-ui/src/views/wms/warehouse/components/LogTable.vue b/klp-ui/src/views/wms/warehouse/components/LogTable.vue
index a34d88ef..828ede51 100644
--- a/klp-ui/src/views/wms/warehouse/components/LogTable.vue
+++ b/klp-ui/src/views/wms/warehouse/components/LogTable.vue
@@ -27,10 +27,11 @@
查询
重置
+ 导出
-
+
{{ scope.row.createTime }}
@@ -115,13 +116,36 @@ export default {
RawMaterialInfo,
},
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 {
logList: [],
total: 0,
logParams: {
coilId: null,
- startTime: "",
- endTime: "",
+ // startTime: yesterday,
+ // endTime: today,
+ startTime: formatDate(yesterday),
+ endTime: formatDate(today),
operationType: null,
inOutType: null,
pageNum: 1,
@@ -201,11 +225,40 @@ export default {
.catch((err) => { this.$message.error("删除失败:" + err.message); });
})
},
+ exportLog() {
+ this.download('/wms/coilWarehouseOperationLog/exportByWarehouseAndTime', {
+ ...this.logParams,
+ }, '日志导出.xlsx')
+ },
// 重置筛选条件
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 = {
- startTime: "",
- endTime: "",
+ coilId: this.coilId,
+ // startTime: yesterday,
+ // endTime: today,
+ startTime: formatDate(yesterday),
+ endTime: formatDate(today),
operationType: null,
inOutType: null,
pageNum: 1,