|
|
|
|
@ -25,9 +25,8 @@
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 搜索条件 -->
|
|
|
|
|
<div class="col-xl-2 col-lg-2 col-sm-3">
|
|
|
|
|
<q-input dense label="日期范围" ref="rangDateRef" readonly outlined v-model="rangDateText" :rules="[
|
|
|
|
|
(val: string) => (val !== null && val !== '' && val !== undefined) || '请选择日期范围',
|
|
|
|
|
]">
|
|
|
|
|
<!-- :rules="[ (val: string) => (val !== null && val !== '' && val !== undefined) || '请选择日期范围' ]" -->
|
|
|
|
|
<q-input dense label="日期范围" ref="rangDateRef" readonly outlined v-model="rangDateText">
|
|
|
|
|
<template v-slot:append>
|
|
|
|
|
<q-icon name="event" class="cursor-pointer">
|
|
|
|
|
<q-tooltip content-class="bg-amber text-black shadow-4" :offset="[10, 10]"
|
|
|
|
|
@ -175,7 +174,7 @@ const onRequest = (props: any) => {
|
|
|
|
|
|
|
|
|
|
const pagination = ref(new Pagination(new EquipmentRecord()));
|
|
|
|
|
const getPage = () => {
|
|
|
|
|
rangDateRef.value.resetValidation();
|
|
|
|
|
// rangDateRef.value.resetValidation();
|
|
|
|
|
if (rangeDate.value) {
|
|
|
|
|
pagination.value.data.begTime = rangeDate.value.from + ' 00:00:00';
|
|
|
|
|
pagination.value.data.endTime = rangeDate.value.to + ' 23:59:59';
|
|
|
|
|
@ -267,23 +266,23 @@ const wrapCsvValue = (val: any, formatFn: any) => {
|
|
|
|
|
// 导出Excel
|
|
|
|
|
const equipmentNoTimeRecord = ref();
|
|
|
|
|
const exportTable = () => {
|
|
|
|
|
rangDateRef.value.validate();
|
|
|
|
|
if (!rangDateRef.value.hasError) {
|
|
|
|
|
// rangDateRef.value.validate();
|
|
|
|
|
// if (!rangDateRef.value.hasError) {
|
|
|
|
|
|
|
|
|
|
if (rangeDate.value) {
|
|
|
|
|
let begTime = rangeDate.value.from + ' 00:00:00';
|
|
|
|
|
let endTime = rangeDate.value.to + ' 23:59:59';
|
|
|
|
|
const diff = date.getDateDiff(new Date(endTime), new Date(begTime), 'days') // 计算日期差值
|
|
|
|
|
//const diff = date.getDateDiff(new Date(endTime), new Date(begTime), 'days') // 计算日期差值
|
|
|
|
|
// 判断 时间范围是否大于30天
|
|
|
|
|
if (diff > 30) {
|
|
|
|
|
Notify.create({
|
|
|
|
|
position: 'top',
|
|
|
|
|
message: '日期范围不能大于30天!',
|
|
|
|
|
icon: 'feedback',
|
|
|
|
|
color: 'negative',
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
// if (diff > 30) {
|
|
|
|
|
// Notify.create({
|
|
|
|
|
// position: 'top',
|
|
|
|
|
// message: '日期范围不能大于30天!',
|
|
|
|
|
// icon: 'feedback',
|
|
|
|
|
// color: 'negative',
|
|
|
|
|
// })
|
|
|
|
|
// return
|
|
|
|
|
// }
|
|
|
|
|
equipmentNoTimeRecord.value = new EquipmentNoTimeRecord();
|
|
|
|
|
equipmentNoTimeRecord.value.begTime = begTime;
|
|
|
|
|
equipmentNoTimeRecord.value.endTime = endTime;
|
|
|
|
|
@ -370,7 +369,7 @@ const exportTable = () => {
|
|
|
|
|
Loading.hide();
|
|
|
|
|
});
|
|
|
|
|
}).onCancel(() => { })
|
|
|
|
|
}
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|