Browse Source

企业基础信息考勤和高企证书增加loading

ljb 6 months ago
parent
commit
9abbc05f2d

+ 1 - 2
src/mixins/crud.js

@@ -61,8 +61,7 @@ export default (app, option = {}) => {
           this.$refs.crud.doLayout();
           this.$refs.crud.doLayout();
         });
         });
       }
       }
-      console.log(this.params.yearAndMonth)
-      if (this.params.yearAndMonth != this.pageYear) {
+      if (this.params.yearAndMonth != undefined && this.params.yearAndMonth != this.pageYear) {
         this.params.yearAndMonth = this.pageYear + this.params.yearAndMonth.substring(4, 6);
         this.params.yearAndMonth = this.pageYear + this.params.yearAndMonth.substring(4, 6);
       }
       }
     },
     },

+ 21 - 5
src/views/basic-resource/comp-basic-info/comp-info-setting.vue

@@ -1,7 +1,7 @@
 <template>
 <template>
   <basic-container>
   <basic-container>
 
 
-    <basic-card title="LOGO设置">
+    <basic-card title="LOGO设置" v-loading="tenantLoading">
       <avue-form :option="logoOption" v-model="logoForm" style="width: 100%; margin: 0;" @submit="handleSubmitLogo"></avue-form>
       <avue-form :option="logoOption" v-model="logoForm" style="width: 100%; margin: 0;" @submit="handleSubmitLogo"></avue-form>
     </basic-card>
     </basic-card>
 
 
@@ -29,12 +29,12 @@
       
       
     </basic-card>
     </basic-card>
 
 
-    <basic-card title="高企证书上传">
+    <basic-card title="高企证书上传" v-loading="compBasicLoading">
       <el-button type="primary" plain size="small" @click="handleLastYearData(2)" style="margin-bottom: 12px;">读取上年度数据</el-button>
       <el-button type="primary" plain size="small" @click="handleLastYearData(2)" style="margin-bottom: 12px;">读取上年度数据</el-button>
       <avue-form :option="picOption" v-model="picForm" style="width: 100%; margin: 0;" @submit="handleHighTecChange"></avue-form>
       <avue-form :option="picOption" v-model="picForm" style="width: 100%; margin: 0;" @submit="handleHighTecChange"></avue-form>
     </basic-card>
     </basic-card>
 
 
-    <basic-card title="出勤时间设置">
+    <basic-card title="出勤时间设置" v-loading="compBasicLoading">
       <el-button type="primary" plain size="small" @click="handleLastYearData(1)" style="margin-bottom: 12px;">读取上年度数据</el-button>
       <el-button type="primary" plain size="small" @click="handleLastYearData(1)" style="margin-bottom: 12px;">读取上年度数据</el-button>
       <avue-form :option="attendOption" v-model="attendForm" @submit="handleSubmitAtten" style="width: 600px; margin: 0;"></avue-form>
       <avue-form :option="attendOption" v-model="attendForm" @submit="handleSubmitAtten" style="width: 600px; margin: 0;"></avue-form>
     </basic-card>
     </basic-card>
@@ -132,11 +132,14 @@ export default {
             precision: 1,
             precision: 1,
          }
          }
         ]
         ]
-      }
+      },
+
+      tenantLoading: false,
+      compBasicLoading: false,
     }
     }
   },
   },
   computed: {
   computed: {
-    ...mapGetters(["userInfo"]),
+    ...mapGetters(["userInfo", 'pageYear']),
   },
   },
   watch: {
   watch: {
     yearAndMonth(newVal) {
     yearAndMonth(newVal) {
@@ -146,6 +149,11 @@ export default {
   mounted() {
   mounted() {
     this.getTenantDetailFunc(this.userInfo.tenant_id);
     this.getTenantDetailFunc(this.userInfo.tenant_id);
   },
   },
+  activated() {
+    if (this.yearAndMonth != this.pageYear) {
+      this.yearAndMonth = this.pageYear;
+    }
+  },
   methods: {
   methods: {
     /**
     /**
      * 读取上年度高企证书或出勤信息
      * 读取上年度高企证书或出勤信息
@@ -166,10 +174,14 @@ export default {
       });
       });
     },
     },
     getTenantDetailFunc(tenantId) {
     getTenantDetailFunc(tenantId) {
+      this.tenantLoading = true;
       getTenantDetail(tenantId).then(({ data }) => {
       getTenantDetail(tenantId).then(({ data }) => {
+        this.tenantLoading = false;
         if (data.code == 200) {
         if (data.code == 200) {
           this.logoForm = data.data;
           this.logoForm = data.data;
         }
         }
+      }).catch(() => {
+        this.tenantLoading = false;
       });
       });
     },
     },
     handleSubmitLogo(form, done) {
     handleSubmitLogo(form, done) {
@@ -184,7 +196,9 @@ export default {
       })
       })
     },
     },
     getAttenDetailFunc(yearAndMonth) {
     getAttenDetailFunc(yearAndMonth) {
+      this.compBasicLoading = true;
       getAttenDetail(yearAndMonth).then(({ data }) => {
       getAttenDetail(yearAndMonth).then(({ data }) => {
+        this.compBasicLoading = false;
         if (data.code == 200) {
         if (data.code == 200) {
           if (Object.keys(data.data).length) {
           if (Object.keys(data.data).length) {
             const _data = data.data;
             const _data = data.data;
@@ -195,6 +209,8 @@ export default {
             this.attendForm = { id: undefined, workHours: undefined };
             this.attendForm = { id: undefined, workHours: undefined };
           }
           }
         }
         }
+      }).catch(() => {
+        this.compBasicLoading = false;
       })
       })
     },
     },
     handleHighTecChange(form, done) {
     handleHighTecChange(form, done) {

+ 1 - 1
src/views/tech-person/month-cjcyry.vue

@@ -135,7 +135,7 @@ export default window.$crudCommon({
       };
       };
     },
     },
     handleZjyyClick() {
     handleZjyyClick() {
-      this.$confirm('确认要引用项目预算表中的数据吗?', '提示', {
+      this.$confirm('请确认是否引用数据?', '提示', {
         confirmButtonText: '确定',
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         cancelButtonText: '取消',
         type: 'warning'
         type: 'warning'