Browse Source

新增剩余假期表

Lijy 2 years ago
parent
commit
d5b5df23b7

+ 38 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/leave/list.vue

@@ -544,7 +544,7 @@
           <div class="flex">
             <div>
               <span>{{ $t('leavetype') }}</span>
-              <el-select v-model="leaveTypeItem" :placeholder="$t('pleaseselectthetypeofleave')" @change="leaveTypeChange()" style="width: 180px" size="small"  filterable="true">
+              <el-select v-model="leaveTypeItem" :placeholder="$t('pleaseselectthetypeofleave')" @change="leaveTypeChange()" style="width: 120px" size="small"  filterable="true">
                   <span v-for="item in leaveTypeList" :key="item.leaveCode">
                   <el-option :label="item.leaveName" :value="item.leaveCode"></el-option>
                   </span> 
@@ -565,14 +565,15 @@
               </div>
               <div>
                 <span>{{ $t('personnelselection') }}</span>
-                <el-select v-model="userSelId" :placeholder="$t('pleaseselectthepersonaskingforleave')" clearable @change="userChg()" style="width: 180px" size="small" v-show="permissions.leaveAll" filterable="true">
+                <el-select v-model="userSelId" :placeholder="$t('pleaseselectthepersonaskingforleave')" clearable @change="userChg()" style="width: 140px" size="small" v-show="permissions.leaveAll" filterable="true">
                     <span v-for="(item, index) in users" :key="index">
                     <el-option :label="item.name" :value="item.id"></el-option>
                     </span> 
                 </el-select>
               </div>
-              <div style="margin:0 10px 0 40px">
+              <div style="margin:0 0px 0 10px">
                 <el-button size="small" type="primary" @click="listSynchronize" :loading="synchronizeLoading">{{ $t('synchronizefromStaple') }}</el-button>
+                <el-button size="small" type="primary" @click="exportLeaveList" :loading="exporLoading">{{ $t('dao-chu-jia-qi') }}</el-button>
               </div>
             </template>
             
@@ -853,6 +854,7 @@ export default {
       hubs: 0,
       vueCasaderItem: [], // 仿数据
       vueIAlDataSItems: undefined, // 仿数据
+      exporLoading: false
     };
   },
   computed: {},
@@ -922,6 +924,39 @@ export default {
         })
       })
     },
+    // 导出假期
+    exportLeaveList() {
+      this.exporLoading = true
+      let param = {
+        leaveCode: this.leaveTypeItem,
+        companyId: this.user.companyId,
+        departmentId: this.departmentSel ? this.departmentSel[this.departmentSel.length - 1] : '',
+        userId: this.user.id,
+      }
+      this.http.post('/user-yearleave-setting/exportDingDingLeaveQt',param,
+      res => {
+        this.exporLoading = false
+        if(res.code == 'ok'){
+          var filePath = res.data;
+          const a = document.createElement('a'); // 创建a标签
+          a.setAttribute('download', '剩余假期');// download属性
+          a.setAttribute('href', filePath);// href链接
+          a.click(); //自执行点击事件
+          a.remove();
+        }else{
+          this.$message({
+            message: res.msg,
+            type: 'error'
+          })
+        }
+      },err => {
+        this.exporLoading = false
+        this.$message({
+          message: err,
+          type: 'error'
+        })
+      })
+    },
 
     // 从钉钉同步假期剩余表
     listSynchronize(){

+ 3 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/project/projectInside.vue

@@ -1041,8 +1041,8 @@
     import 'quill/dist/quill.bubble.css'
     // 导入富文本
     import { quillEditor } from 'vue-quill-editor'
-import { error } from 'dingtalk-jsapi';
-import delete$ from 'dingtalk-jsapi/api/biz/cspace/delete';
+    import { error } from 'dingtalk-jsapi';
+    import delete$ from 'dingtalk-jsapi/api/biz/cspace/delete';
     let id=1;
     export default {
         name: "two-list-headerslots",
@@ -3258,6 +3258,7 @@ import delete$ from 'dingtalk-jsapi/api/biz/cspace/delete';
             };
         },
         mounted() {
+
             this.curProjectId = parseInt(this.$route.params.id);
             this.activeName = this.$route.path.split("/")[1];
             this.getDetail();