Browse Source

月份表头增加loading

ljb 8 months ago
parent
commit
0a7a198db4

+ 7 - 7
src/views/yf-cost-manage/basic-data-setting/atten-info.vue

@@ -175,15 +175,14 @@ export default window.$crudCommon({
       return `${yearAndMonthCN}${this.tag.label}`.replace(/每月/g, '');
       return `${yearAndMonthCN}${this.tag.label}`.replace(/每月/g, '');
     }
     }
   },
   },
-  // async created() {
-  //   this.defaultColumns = deepClone(this.option.column);
-  //   this.refreshTableCol(this.params.yearAndMonth);
-  // },
-  // beforeDestroy() {
-  //   this.option.column = deepClone(this.defaultColumns);
-  // },
   methods: {
   methods: {
     refreshTableCol(yearAndMonth) {
     refreshTableCol(yearAndMonth) {
+      const loading = this.$loading({
+        lock: true,
+        text: '表头加载中...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
       let yearMonth = moment(yearAndMonth).format("YYYY-MM").split("-");
       let yearMonth = moment(yearAndMonth).format("YYYY-MM").split("-");
       const monthDays = getMonthDatesWithMarkers(Number(yearMonth[0]), Number(yearMonth[1]));
       const monthDays = getMonthDatesWithMarkers(Number(yearMonth[0]), Number(yearMonth[1]));
       for (let i=monthDays.length; i<31; i++) {
       for (let i=monthDays.length; i<31; i++) {
@@ -223,6 +222,7 @@ export default window.$crudCommon({
       });
       });
 
 
       this.option.column = newColumns;
       this.option.column = newColumns;
+      loading.close();
     },
     },
     getFormData() {
     getFormData() {
       const newFormData = { ...this.form, yearAndMonth: this.params.yearAndMonth  };
       const newFormData = { ...this.form, yearAndMonth: this.params.yearAndMonth  };

+ 7 - 0
src/views/yf-cost-manage/basic-data-setting/dev-work-hours-register.vue

@@ -209,6 +209,12 @@ export default window.$crudCommon({
   },
   },
   methods: {
   methods: {
     refreshTableCol(yearAndMonth) {
     refreshTableCol(yearAndMonth) {
+      const loading = this.$loading({
+        lock: true,
+        text: '表头加载中...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
       let yearMonth = moment(yearAndMonth).format("YYYY-MM").split("-");
       let yearMonth = moment(yearAndMonth).format("YYYY-MM").split("-");
       const monthDays = getMonthDatesWithMarkers(Number(yearMonth[0]), Number(yearMonth[1]));
       const monthDays = getMonthDatesWithMarkers(Number(yearMonth[0]), Number(yearMonth[1]));
       for (let i=monthDays.length; i<31; i++) {
       for (let i=monthDays.length; i<31; i++) {
@@ -248,6 +254,7 @@ export default window.$crudCommon({
       });
       });
 
 
       this.option.column = newColumns;
       this.option.column = newColumns;
+      loading.close();
     },
     },
     handleImport() {
     handleImport() {
       let excelParams = { yearAndMonth: this.params.yearAndMonth };
       let excelParams = { yearAndMonth: this.params.yearAndMonth };

+ 7 - 0
src/views/yf-cost-manage/basic-data-setting/working-hours-records.vue

@@ -217,6 +217,12 @@ export default window.$crudCommon({
       done();
       done();
     },
     },
     refreshTableCol(yearAndMonth) {
     refreshTableCol(yearAndMonth) {
+      const loading = this.$loading({
+        lock: true,
+        text: '表头加载中...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
       this.option.column = [];
       this.option.column = [];
       let yearMonth = moment(yearAndMonth).format("YYYY-MM").split("-");
       let yearMonth = moment(yearAndMonth).format("YYYY-MM").split("-");
       const monthDays = getMonthDatesWithMarkers(Number(yearMonth[0]), Number(yearMonth[1]));
       const monthDays = getMonthDatesWithMarkers(Number(yearMonth[0]), Number(yearMonth[1]));
@@ -280,6 +286,7 @@ export default window.$crudCommon({
       // });
       // });
 
 
       this.option.column = newColumns;
       this.option.column = newColumns;
+      loading.close();
     },
     },
     handleImport() {
     handleImport() {
       let excelParams = { yearAndMonth: this.params.yearAndMonth };
       let excelParams = { yearAndMonth: this.params.yearAndMonth };

+ 7 - 0
src/views/yf-cost-manage/yf-cost-statistics/person-cost-statistics/yf-work-hours-allocation-list.vue

@@ -184,6 +184,12 @@ export default window.$crudCommon({
   },
   },
   methods: {
   methods: {
     refreshTableCol(yearAndMonth) {
     refreshTableCol(yearAndMonth) {
+      const loading = this.$loading({
+        lock: true,
+        text: '表头加载中...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
       this.allMonthCols = [];
       this.allMonthCols = [];
       let yearMonth = moment(yearAndMonth).format("YYYY-MM").split("-");
       let yearMonth = moment(yearAndMonth).format("YYYY-MM").split("-");
       const monthDays = getMonthDatesWithMarkers(Number(yearMonth[0]), Number(yearMonth[1]));
       const monthDays = getMonthDatesWithMarkers(Number(yearMonth[0]), Number(yearMonth[1]));
@@ -224,6 +230,7 @@ export default window.$crudCommon({
       });
       });
 
 
       this.option.column = newColumns;
       this.option.column = newColumns;
+      loading.close();
     },
     },
     handleExport() {
     handleExport() {
       exportBloByPost(`/api/kd-scientific/xm/technician/hours/myyfgsfpb/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
       exportBloByPost(`/api/kd-scientific/xm/technician/hours/myyfgsfpb/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {