Browse Source

导出月度工时统计表

seyason 9 months ago
parent
commit
4a76add3b9

+ 16 - 4
fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue

@@ -92,7 +92,12 @@
 
         <!--导出报表条件选择 -->
         <el-dialog :title="$t('timeReportExport')" v-if="exportDialog" :visible.sync="exportDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
-            <el-form ref="form3" :model="exportParam" >
+            <el-form ref="form4"  v-if="user.companyId == 10">
+                <el-form-item :label="this.$t('Selectmonth')" >
+                    <el-date-picker size="small" v-model="exportParam.date" :editable="false" format="yyyy-MM" value-format="yyyy-MM" :clearable="false" type="month" :placeholder="$t('Selectmonth')" style="margin-right: 20px"></el-date-picker>
+                </el-form-item>
+            </el-form>
+            <el-form ref="form3" :model="exportParam" v-else>
                 <el-form-item prop="projectCategoryId" :label="$t('projectclassification')" v-if="radio == $t('projectclassification')||radio==$t('other.project')">
                     <el-select v-model="exportParam.projectCategoryId" :placeholder="$t('classificationitems')"  clearable style="width:350px;" filterable="true" @change="filterCategory">
                         <el-option v-for="item in categoryList"  :key="item.id" :label="item.name" :value="item.id">
@@ -226,7 +231,7 @@
                 hasReportUserList:[],
                 projectList:[],
                 categoryList: [],
-                exportParam:{projectId:null,dateRange:[],userId: null,type: '0', withPercent: false},
+                exportParam:{projectId:null,dateRange:[],userId: null,type: '0', withPercent: false, date: null},
                 exportDialog:false,
                 dateRange:[],
                 user: JSON.parse(sessionStorage.getItem("user")),
@@ -327,7 +332,6 @@
                 },
             
             showExportDialog() {
-                // console.log(12345)
                 // 清空选择的人
                 if(this.radio == this.$t('ren-yuan')) {
                     this.exportParam.userIds = new Array()
@@ -336,7 +340,10 @@
 
                 this.exportDialog = true;
                 this.exportParam.dateRange = this.dateRange;
-                // console.log(this.hasReportUserList)
+                var array = this.exportParam.dateRange[0].split('-');
+                this.exportParam.date = array[0] + '-' + array[1];
+                console.log(this.exportParam.date)
+                this.$forceUpdate();
                 if (this.radio == this.$t('ren-yuan')) {
                     // this.exportParam.userIds = [];
                 }
@@ -406,6 +413,11 @@
                      if (this.exportParam.withPercent) {
                         param.withPercent = 1;
                      }
+                     if (this.user.companyId == 10) {
+                        param.date = this.exportParam.date;
+                        url = '/project/exportTimeByProjectAndEmployee';
+                        fileName = param.date + '月度工时成本统计表.xlsx';
+                     }
                  }
                  if (this.radio == this.$t('ren-yuan') ) {
                     //  console.log(this.exportParam.userIds);

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/finance.vue

@@ -4,7 +4,7 @@
         <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
             <el-form :inline="true">
                 <!-- <el-form-item label="财务核算成本 | 月份选择" style="margin-top:5px;"> -->
-                <el-form-item :label="this.$t('Selectmonth')" >
+            <el-form-item :label="this.$t('Selectmonth')" >
                 <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM" @change="loadMonthData" :clearable="false" type="month" :placeholder="$t('Selectmonth')" style="margin-right: 20px"></el-date-picker>
                 <el-link type="primary" :underline="false" @click="audits()" v-if="user.timeType.financeAudit == '1'">{{revaelse}}</el-link>
             </el-form-item>