diff --git a/src/views/qualityManagement/FQC/qualityStatistics.vue b/src/views/qualityManagement/FQC/qualityStatistics.vue
index a79d7b0..f3d8d1e 100644
--- a/src/views/qualityManagement/FQC/qualityStatistics.vue
+++ b/src/views/qualityManagement/FQC/qualityStatistics.vue
@@ -4,11 +4,11 @@
-
+
-
+
@@ -189,7 +189,7 @@
downloadStatisticsTableExcel
} from '@/api/qualityManagement/qualityStatistics_V2'
export default {
- name: 'qualityStatistics',
+ name: 'QualityStatistics',
data() {
return {
inputWidth: '180px',
@@ -219,8 +219,8 @@
}, ],
},
search: {
- starttime: new Date(new Date(new Date().toLocaleDateString()).getTime()),
- endtime: new Date(new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1),
+ starttime: null,
+ endtime: null,
team: null,
workorderid: null,
partnumber: null,
@@ -284,11 +284,52 @@
},
}
},
+ watch: {
+ 'search.starttime'(newValue, oldValue) {
+ if (newValue != null && newValue != oldValue) {
+ try {
+ window.sessionStorage.setItem('QualityStatisticsStartTime', JSON.stringify(newValue))
+ } catch (err) {
+
+ }
+ }
+ },
+ 'search.endtime'(newValue, oldValue) {
+ if (newValue != null && newValue != oldValue) {
+ try {
+ window.sessionStorage.setItem('QualityStatisticsEndTime', JSON.stringify(newValue))
+ } catch (err) {
+
+ }
+ }
+ }
+ },
mounted() {
this.getList()
},
- created() {},
+ created() {
+ this.init();
+ },
methods: {
+ init() {
+ const QualityStatisticsStartTime = JSON.parse(window.sessionStorage.getItem("QualityStatisticsStartTime"));
+ const QualityStatisticsEndTime = JSON.parse(window.sessionStorage.getItem("QualityStatisticsEndTime"));
+ if (this.search.starttime == null) {
+ if (QualityStatisticsStartTime) {
+ this.search.starttime = QualityStatisticsStartTime;
+ } else {
+ this.search.starttime = this.$dayjs().startOf('day').toDate();
+ }
+ }
+ if (this.search.endtime == null) {
+ if (QualityStatisticsEndTime) {
+ this.search.endtime = QualityStatisticsEndTime;
+ } else {
+ this.search.endtime = this.$dayjs().endOf('day').toDate();
+ }
+
+ }
+ },
//todo 设置表合并行
mergeTable(num) {
this.mergeCells = []
@@ -455,13 +496,13 @@
$table.resetColumn();
this.resetMergeTable();
},
- resetMergeTable(){
- if(this.search.reportType === 3){
+ resetMergeTable() {
+ if (this.search.reportType === 3) {
this.mergeTable(2);
- }else{
+ } else {
this.mergeTable(3);
}
-
+
},
// 删除数据
removeData(row) {