|
@@ -8,7 +8,7 @@
|
|
|
<el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
|
|
|
style="width:190px;"
|
|
|
@change="changeMonthOut" :clearable="false" type="month" placeholder="选择月份"></el-date-picker>
|
|
|
- <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showMonthWorkTime"></el-button>
|
|
|
+ <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
|
|
|
</div>
|
|
|
<span v-for="(item,index) in allDate" :id="'day'+index" :class="index==choseDay?'chooseDate date_item':'date_item'"
|
|
|
@click="choseDate(index, item)" :key="index" >
|
|
@@ -694,53 +694,354 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <el-dialog title="员工每日填报工时数" v-if="monthWorkTimeDialog" :visible.sync="monthWorkTimeDialog" :close-on-click-modal="false" customClass="customWidth" width="90%">
|
|
|
- <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
|
|
|
- <el-table :data="monthWorkData" border :height="500" highlight-current-row style="width: 100%;">
|
|
|
+ <el-dialog
|
|
|
+ v-if="monthWorkTimeDialog"
|
|
|
+ :visible.sync="monthWorkTimeDialog"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ customClass="customWidth selectworktime"
|
|
|
+ width="90%"
|
|
|
+ title=""
|
|
|
+ >
|
|
|
+ <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
|
|
|
+ <el-tabs v-model="activeName" @tab-click="handleClick">
|
|
|
+ <el-tab-pane label="已填工时情况" name="first">
|
|
|
+ <div class="selectworktime_export">
|
|
|
+ <div class="selectworktime_export_l">
|
|
|
+ <el-date-picker
|
|
|
+ class="selecteworktime_datapick"
|
|
|
+ v-model="WorktimeDatepickValue1"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ type="daterange"
|
|
|
+ align="right"
|
|
|
+ unlink-panels
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ :default-time="['12:00:00', '12:00:00']"
|
|
|
+ size="small"
|
|
|
+ popper-class="selecteorktime_datapick_popper"
|
|
|
+ @change="showMonthWorkTime()"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ <el-button size="small" @click="getLastWeek(1)">上周</el-button>
|
|
|
+ <el-button size="small" @click="getThisWeek(1)">本周</el-button>
|
|
|
+ <el-button size="small" @click="getNextWeek(1)">下周</el-button>
|
|
|
+ <!-- 222 -->
|
|
|
+ </div>
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ style="float: right; margin-right: 60px; vertical-align: middle"
|
|
|
+ @click="exportMembAlreadyWorkHours()"
|
|
|
+ >导出数据</el-link
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-table
|
|
|
+ :data="monthworkDate"
|
|
|
+ border
|
|
|
+ :height="500"
|
|
|
+ highlight-current-row
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
<el-table-column width="60" type="index" fixed="left" label="序号">
|
|
|
- <template slot-scope="scope" >
|
|
|
- {{scope.$index+1}}
|
|
|
- </template>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.$index + 1 }}
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
-
|
|
|
- <el-table-column width="100" prop="name" fixed="left" label="姓名">
|
|
|
|
|
|
+ <el-table-column width="100" prop="name" fixed="left" label="姓名">
|
|
|
</el-table-column>
|
|
|
- <el-table-column width="90" v-for="(item,index) in allDate" :key="index" :label="item.showDate+'/'+item.weekDay" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div style="color:red;"
|
|
|
- v-if="scope.row.worktimeList.filter(w=>w.createDate.split('-')[2] == item.date.split('月')[1].replace('日','')
|
|
|
- || w.createDate.split('-')[2] == '0'+item.date.split('月')[1].replace('日','') ).length > 0 && scope.row.worktimeList.filter(w=>w.createDate.split('-')[2] == item.date.split('月')[1].replace('日','')
|
|
|
- || w.createDate.split('-')[2] == '0'+item.date.split('月')[1].replace('日','') )[0].workingTime < reportTimeType.allday">
|
|
|
- {{scope.row.worktimeList.filter(w=>w.createDate.split('-')[2] == item.date.split('月')[1].replace('日','')
|
|
|
- || w.createDate.split('-')[2] == '0'+item.date.split('月')[1].replace('日','') )[0].workingTime
|
|
|
- }}</div>
|
|
|
- <div style="color:#20a0ff;"
|
|
|
- v-if="scope.row.worktimeList.filter(w=>w.createDate.split('-')[2] == item.date.split('月')[1].replace('日','')
|
|
|
- || w.createDate.split('-')[2] == '0'+item.date.split('月')[1].replace('日','') ).length > 0 && scope.row.worktimeList.filter(w=>w.createDate.split('-')[2] == item.date.split('月')[1].replace('日','')
|
|
|
- || w.createDate.split('-')[2] == '0'+item.date.split('月')[1].replace('日','') )[0].workingTime > reportTimeType.allday">
|
|
|
- {{scope.row.worktimeList.filter(w=>w.createDate.split('-')[2] == item.date.split('月')[1].replace('日','')
|
|
|
- || w.createDate.split('-')[2] == '0'+item.date.split('月')[1].replace('日','') )[0].workingTime
|
|
|
- }}</div>
|
|
|
- <div v-if="scope.row.worktimeList.filter(w=>w.createDate.split('-')[2] == item.date.split('月')[1].replace('日','')
|
|
|
- || w.createDate.split('-')[2] == '0'+item.date.split('月')[1].replace('日','') ).length > 0 && scope.row.worktimeList.filter(w=>w.createDate.split('-')[2] == item.date.split('月')[1].replace('日','')
|
|
|
- || w.createDate.split('-')[2] == '0'+item.date.split('月')[1].replace('日','') )[0].workingTime == reportTimeType.allday">
|
|
|
- {{scope.row.worktimeList.filter(w=>w.createDate.split('-')[2] == item.date.split('月')[1].replace('日','')
|
|
|
- || w.createDate.split('-')[2] == '0'+item.date.split('月')[1].replace('日','') )[0].workingTime
|
|
|
- }}</div>
|
|
|
- <div v-if="scope.row.worktimeList.filter(w=>w.createDate.split('-')[2] == item.date.split('月')[1].replace('日','')
|
|
|
- || w.createDate.split('-')[2] == '0'+item.date.split('月')[1].replace('日','') ).length == 0">
|
|
|
- 0
|
|
|
- </div>
|
|
|
- </template>
|
|
|
+ <el-table-column
|
|
|
+ width="90"
|
|
|
+ v-for="(item, index) in allDate"
|
|
|
+ :key="index"
|
|
|
+ :label="item.showDate + '/' + item.weekDay"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div
|
|
|
+ style="color: red"
|
|
|
+ v-if="
|
|
|
+ scope.row.worktimeList.filter(
|
|
|
+ (w) =>
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ item.date.split('月')[1].replace('日', '') ||
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ '0' + item.date.split('月')[1].replace('日', '')
|
|
|
+ ).length > 0 &&
|
|
|
+ scope.row.worktimeList.filter(
|
|
|
+ (w) =>
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ item.date.split('月')[1].replace('日', '') ||
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ '0' + item.date.split('月')[1].replace('日', '')
|
|
|
+ )[0].workingTime < reportTimeType.allday
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{
|
|
|
+ scope.row.worktimeList.filter(
|
|
|
+ (w) =>
|
|
|
+ w.createDate.split("-")[2] ==
|
|
|
+ item.date.split("月")[1].replace("日", "") ||
|
|
|
+ w.createDate.split("-")[2] ==
|
|
|
+ "0" + item.date.split("月")[1].replace("日", "")
|
|
|
+ )[0].workingTime
|
|
|
+ }}
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ style="color: #20a0ff"
|
|
|
+ v-if="
|
|
|
+ scope.row.worktimeList.filter(
|
|
|
+ (w) =>
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ item.date.split('月')[1].replace('日', '') ||
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ '0' + item.date.split('月')[1].replace('日', '')
|
|
|
+ ).length > 0 &&
|
|
|
+ scope.row.worktimeList.filter(
|
|
|
+ (w) =>
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ item.date.split('月')[1].replace('日', '') ||
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ '0' + item.date.split('月')[1].replace('日', '')
|
|
|
+ )[0].workingTime > reportTimeType.allday
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{
|
|
|
+ scope.row.worktimeList.filter(
|
|
|
+ (w) =>
|
|
|
+ w.createDate.split("-")[2] ==
|
|
|
+ item.date.split("月")[1].replace("日", "") ||
|
|
|
+ w.createDate.split("-")[2] ==
|
|
|
+ "0" + item.date.split("月")[1].replace("日", "")
|
|
|
+ )[0].workingTime
|
|
|
+ }}
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ v-if="
|
|
|
+ scope.row.worktimeList.filter(
|
|
|
+ (w) =>
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ item.date.split('月')[1].replace('日', '') ||
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ '0' + item.date.split('月')[1].replace('日', '')
|
|
|
+ ).length > 0 &&
|
|
|
+ scope.row.worktimeList.filter(
|
|
|
+ (w) =>
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ item.date.split('月')[1].replace('日', '') ||
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ '0' + item.date.split('月')[1].replace('日', '')
|
|
|
+ )[0].workingTime == reportTimeType.allday
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{
|
|
|
+ scope.row.worktimeList.filter(
|
|
|
+ (w) =>
|
|
|
+ w.createDate.split("-")[2] ==
|
|
|
+ item.date.split("月")[1].replace("日", "") ||
|
|
|
+ w.createDate.split("-")[2] ==
|
|
|
+ "0" + item.date.split("月")[1].replace("日", "")
|
|
|
+ )[0].workingTime
|
|
|
+ }}
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ v-if="
|
|
|
+ scope.row.worktimeList.filter(
|
|
|
+ (w) =>
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ item.date.split('月')[1].replace('日', '') ||
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ '0' + item.date.split('月')[1].replace('日', '')
|
|
|
+ ).length == 0
|
|
|
+ "
|
|
|
+ >
|
|
|
+ 0
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
- </el-table>
|
|
|
- <div slot="title" class="dialog-title">
|
|
|
- <label style="font-size:16px;">员工每日填报工时数</label>
|
|
|
- <el-link type="primary" style="float:right;margin-right:60px;" @click="exportMembWorkHours()" >导出数据</el-link>
|
|
|
- <!-- <el-button >导出</el-button> -->
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <!-- <div slot="title" class="dialog-title selectworktime_title">
|
|
|
+ <label style="font-size: 16px">员工每日已填报工时数</label>
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ style="float: right; margin-right: 60px"
|
|
|
+ @click="exportMembWorkHours()"
|
|
|
+ >导出已填报数据</el-link
|
|
|
+ > -->
|
|
|
+ <!-- <el-button >导出</el-button> -->
|
|
|
+ <!-- </div> -->
|
|
|
+ </el-tab-pane>
|
|
|
+
|
|
|
+ <el-tab-pane label="未填人员列表" name="second">
|
|
|
+ <div class="selectworktime_export">
|
|
|
+ <div class="selectworktime_export_l">
|
|
|
+ <el-date-picker
|
|
|
+ class="selecteworktime_datapick"
|
|
|
+ v-model="WorktimeDatepickValue2"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ type="daterange"
|
|
|
+ align="right"
|
|
|
+ unlink-panels
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ :default-time="['12:00:00', '12:00:00']"
|
|
|
+ size="small"
|
|
|
+ popper-class="selecteorktime_datapick_popper"
|
|
|
+ @change="showMonthNotWorkTime()"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ <el-button size="small" @click="getLastWeek()">上周</el-button>
|
|
|
+ <el-button size="small" @click="getThisWeek()">本周</el-button>
|
|
|
+ <el-button size="small" @click="getNextWeek()">下周</el-button>
|
|
|
</div>
|
|
|
- </el-dialog>
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ style="float: right; margin-right: 60px; vertical-align: middle"
|
|
|
+ @click="exportMembNotWorkHours()"
|
|
|
+ >导出数据</el-link
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <el-table
|
|
|
+ :data="monthNotWorkDate"
|
|
|
+ border
|
|
|
+ :height="500"
|
|
|
+ highlight-current-row
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-table-column width="60" type="index" fixed="left" label="序号">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.$index + 1 }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column width="100" prop="name" fixed="left" label="姓名">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ width="90"
|
|
|
+ v-for="(item, index) in allDate"
|
|
|
+ :key="index"
|
|
|
+ :label="item.showDate + '/' + item.weekDay"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div
|
|
|
+ style="color: red"
|
|
|
+ v-if="
|
|
|
+ scope.row.worktimeList.filter(
|
|
|
+ (w) =>
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ item.date.split('月')[1].replace('日', '') ||
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ '0' + item.date.split('月')[1].replace('日', '')
|
|
|
+ ).length > 0 &&
|
|
|
+ scope.row.worktimeList.filter(
|
|
|
+ (w) =>
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ item.date.split('月')[1].replace('日', '') ||
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ '0' + item.date.split('月')[1].replace('日', '')
|
|
|
+ )[0].workingTime < reportTimeType.allday
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{
|
|
|
+ scope.row.worktimeList.filter(
|
|
|
+ (w) =>
|
|
|
+ w.createDate.split("-")[2] ==
|
|
|
+ item.date.split("月")[1].replace("日", "") ||
|
|
|
+ w.createDate.split("-")[2] ==
|
|
|
+ "0" + item.date.split("月")[1].replace("日", "")
|
|
|
+ )[0].workingTime
|
|
|
+ }}
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ style="color: #20a0ff"
|
|
|
+ v-if="
|
|
|
+ scope.row.worktimeList.filter(
|
|
|
+ (w) =>
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ item.date.split('月')[1].replace('日', '') ||
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ '0' + item.date.split('月')[1].replace('日', '')
|
|
|
+ ).length > 0 &&
|
|
|
+ scope.row.worktimeList.filter(
|
|
|
+ (w) =>
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ item.date.split('月')[1].replace('日', '') ||
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ '0' + item.date.split('月')[1].replace('日', '')
|
|
|
+ )[0].workingTime > reportTimeType.allday
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{
|
|
|
+ scope.row.worktimeList.filter(
|
|
|
+ (w) =>
|
|
|
+ w.createDate.split("-")[2] ==
|
|
|
+ item.date.split("月")[1].replace("日", "") ||
|
|
|
+ w.createDate.split("-")[2] ==
|
|
|
+ "0" + item.date.split("月")[1].replace("日", "")
|
|
|
+ )[0].workingTime
|
|
|
+ }}
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ v-if="
|
|
|
+ scope.row.worktimeList.filter(
|
|
|
+ (w) =>
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ item.date.split('月')[1].replace('日', '') ||
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ '0' + item.date.split('月')[1].replace('日', '')
|
|
|
+ ).length > 0 &&
|
|
|
+ scope.row.worktimeList.filter(
|
|
|
+ (w) =>
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ item.date.split('月')[1].replace('日', '') ||
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ '0' + item.date.split('月')[1].replace('日', '')
|
|
|
+ )[0].workingTime == reportTimeType.allday
|
|
|
+ "
|
|
|
+ >
|
|
|
+ {{
|
|
|
+ scope.row.worktimeList.filter(
|
|
|
+ (w) =>
|
|
|
+ w.createDate.split("-")[2] ==
|
|
|
+ item.date.split("月")[1].replace("日", "") ||
|
|
|
+ w.createDate.split("-")[2] ==
|
|
|
+ "0" + item.date.split("月")[1].replace("日", "")
|
|
|
+ )[0].workingTime
|
|
|
+ }}
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ v-if="
|
|
|
+ scope.row.worktimeList.filter(
|
|
|
+ (w) =>
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ item.date.split('月')[1].replace('日', '') ||
|
|
|
+ w.createDate.split('-')[2] ==
|
|
|
+ '0' + item.date.split('月')[1].replace('日', '')
|
|
|
+ ).length == 0
|
|
|
+ "
|
|
|
+ >
|
|
|
+ 0
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <!-- <div slot="title" class="dialog-title">
|
|
|
+ <label style="font-size: 16px">员工每日未填报工时数</label>
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ style="float: right; margin-right: 60px"
|
|
|
+ @click="exportMembWorkHours()"
|
|
|
+ >导出未填报数据</el-link
|
|
|
+ > -->
|
|
|
+ <!-- <el-button >导出</el-button> -->
|
|
|
+ <!-- </div> -->
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ </el-dialog>
|
|
|
<!--驳回弹出框 -->
|
|
|
<el-dialog title="请输入原因" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
|
|
|
<div>
|
|
@@ -881,6 +1182,10 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+
|
|
|
+ WorktimeDatepickValue1: [],
|
|
|
+ WorktimeDatepickValue2: [],
|
|
|
+ activeName:"first",
|
|
|
submitingReport: false,
|
|
|
importResultMsg:null,
|
|
|
showImportResult:false,
|
|
@@ -1430,51 +1735,209 @@
|
|
|
|
|
|
this.selectProject(itemDomain, newIndex);
|
|
|
},
|
|
|
- //导出员工每日填报工时数
|
|
|
- exportMembWorkHours() {
|
|
|
- this.http.post('/report/exportUserDailyWorkTime',{
|
|
|
- month: this.date
|
|
|
- },
|
|
|
- res => {
|
|
|
- if (res.code == "ok") {
|
|
|
- var url = res.data;
|
|
|
- this.downloadByA("人员每日工时统计.xls", url);
|
|
|
- }
|
|
|
- },
|
|
|
- error => {
|
|
|
- this.$message({
|
|
|
- message: error,
|
|
|
- type: "error"
|
|
|
- });
|
|
|
- }
|
|
|
- );
|
|
|
- },
|
|
|
- downloadByA(name, url) {
|
|
|
- const a = document.createElement('a'); // 创建a标签
|
|
|
- a.setAttribute('download', name);// download属性
|
|
|
- a.setAttribute('href', url);// href链接
|
|
|
- a.click();// 自执行点击事件
|
|
|
- a.remove();
|
|
|
- },
|
|
|
- showMonthWorkTime() {
|
|
|
- this.monthWorkTimeDialog = true;
|
|
|
- this.http.post('/report/getUserDailyWorkTime',{
|
|
|
- month: this.date
|
|
|
- },
|
|
|
- res => {
|
|
|
- if (res.code == "ok") {
|
|
|
- this.monthWorkData = res.data.list;
|
|
|
- this.$forceUpdate();
|
|
|
- }
|
|
|
- },
|
|
|
- error => {
|
|
|
- this.$message({
|
|
|
- message: error,
|
|
|
- type: "error"
|
|
|
- });
|
|
|
- }
|
|
|
- );
|
|
|
- },
|
|
|
+ // tabupdata(){
|
|
|
+ // if(this.WorktimeDatepickValue2.length == 0){
|
|
|
+ // this.WorktimeDatepickValue2 = [this.getAutoWeekDate()[0],this.getAutoWeekDate()[6]];
|
|
|
+ // // this.showMonthNotWorkTime()
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ showWorkTime(){
|
|
|
+ this.monthWorkTimeDialog = true;
|
|
|
+ this.showMonthWorkTime()
|
|
|
+ },
|
|
|
+
|
|
|
+ handleClick(t,e){
|
|
|
+ console.log("tabname",t.name);
|
|
|
+ if (t.name == "first") {
|
|
|
+ this.showMonthWorkTime()
|
|
|
+ }else{
|
|
|
+ this.showMonthNotWorkTime()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //导出员工每日填报工时数
|
|
|
+ exportMembAlreadyWorkHours() {
|
|
|
+ console.log("exportMembAlreadyWorkHours",this.WorktimeDatepickValue1);
|
|
|
+ this.http.post(
|
|
|
+ "/report/exportUserDailyWorkTime",
|
|
|
+ {
|
|
|
+ // month: this.date,
|
|
|
+ startDate: this.WorktimeDatepickValue1[0],
|
|
|
+ endDate: this.WorktimeDatepickValue1[1],
|
|
|
+ },
|
|
|
+ (res) => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ let url = res.data;
|
|
|
+ console.log(res);
|
|
|
+ this.downloadByA("人员每日工时统计.xls", url);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ (error) => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
+ },
|
|
|
+ exportMembNotWorkHours() {
|
|
|
+
|
|
|
+ this.http.post(
|
|
|
+ "/report/getNoReportUserList",
|
|
|
+ {
|
|
|
+ // month: this.date,
|
|
|
+ startDate: this.WorktimeDatepickValue2[0],
|
|
|
+ endDate: this.WorktimeDatepickValue2[1],
|
|
|
+ },
|
|
|
+ (res) => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ let url = res.data;
|
|
|
+ // console.log(res.data);
|
|
|
+ this.downloadByA("人员每日工时统计.xls", url);
|
|
|
+ console.log(url);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ (error) => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
+ },
|
|
|
+
|
|
|
+ downloadByA(name, url) {
|
|
|
+ console.log(name,url);
|
|
|
+ const a = document.createElement("a"); // 创建a标签
|
|
|
+ a.setAttribute("download", name); // download属性
|
|
|
+ a.setAttribute("href", url); // href链接
|
|
|
+ a.click(); // 自执行点击事件
|
|
|
+ a.remove();
|
|
|
+ },
|
|
|
+
|
|
|
+ // 111
|
|
|
+ showMonthWorkTime() {
|
|
|
+
|
|
|
+ if(this.WorktimeDatepickValue1.length == 0){
|
|
|
+ let newdate = new Date();
|
|
|
+ let nowdate = newdate.toLocaleDateString();
|
|
|
+ let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
|
|
|
+ this.WorktimeDatepickValue1 = nowwd
|
|
|
+ }
|
|
|
+ this.http.post(
|
|
|
+ "/report/getUserDailyWorkTime",
|
|
|
+ // "/report/getNoReportUserList",
|
|
|
+ {
|
|
|
+ // month: this.date,
|
|
|
+ startDate: this.WorktimeDatepickValue1[0],
|
|
|
+ endDate: this.WorktimeDatepickValue1[1],
|
|
|
+ },
|
|
|
+ (res) => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.monthworkDate = res.data.list;
|
|
|
+ this.$forceUpdate();
|
|
|
+ console.log("monthworkdate", this.monthworkDate);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ (error) => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
+ },
|
|
|
+ showMonthNotWorkTime() {
|
|
|
+ if(this.WorktimeDatepickValue2.length == 0){
|
|
|
+ let newdate = new Date();
|
|
|
+ let nowdate = newdate.toLocaleDateString();
|
|
|
+ let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
|
|
|
+ this.WorktimeDatepickValue2 = nowwd
|
|
|
+ }
|
|
|
+ console.log("exportMembNotWorkHours",this.WorktimeDatepickValue2);
|
|
|
+ this.http.post(
|
|
|
+ // "/report/getUserDailyWorkTime",
|
|
|
+ "/report/getNoReportUserList",
|
|
|
+ {
|
|
|
+ // month: this.date,
|
|
|
+ startDate: this.WorktimeDatepickValue2[0],
|
|
|
+ endDate: this.WorktimeDatepickValue2[1],
|
|
|
+ },
|
|
|
+ (res) => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.monthNotWorkDate = res.data.list;
|
|
|
+ this.$forceUpdate();
|
|
|
+ console.log("monthNotWorkDate", this.monthNotWorkDate);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ (error) => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
+ },
|
|
|
+ // 获取默认这zhou日期参数 222
|
|
|
+ getLastWeek(e){
|
|
|
+ let newdate = new Date()
|
|
|
+ let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
|
|
|
+ let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
|
|
|
+ if(e){
|
|
|
+ this.WorktimeDatepickValue1 = lastwd
|
|
|
+ this.showMonthWorkTime()
|
|
|
+ }else{
|
|
|
+ this.WorktimeDatepickValue2 = lastwd
|
|
|
+ this.showMonthNotWorkTime()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getThisWeek(e){
|
|
|
+ let newdate = new Date();
|
|
|
+ let nowdate = newdate.toLocaleDateString();
|
|
|
+ let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
|
|
|
+ if(e){
|
|
|
+ this.WorktimeDatepickValue1 = nowwd
|
|
|
+ this.showMonthWorkTime()
|
|
|
+ }else{
|
|
|
+ this.WorktimeDatepickValue2 = nowwd
|
|
|
+ this.showMonthNotWorkTime()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getNextWeek(e){
|
|
|
+ let newdate = new Date()
|
|
|
+ let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() + 7))
|
|
|
+ let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
|
|
|
+ if(e){
|
|
|
+ this.WorktimeDatepickValue1 = nextwd
|
|
|
+ this.showMonthWorkTime()
|
|
|
+ }else{
|
|
|
+ this.WorktimeDatepickValue2 = nextwd
|
|
|
+ this.showMonthNotWorkTime()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getAutoWeekDate(e) {
|
|
|
+ let dateString = e;
|
|
|
+ let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
|
|
|
+ if (dateString.match(dateStringReg)) {
|
|
|
+ let presentDate = new Date(dateString),
|
|
|
+ today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
|
|
|
+ return Array.from(new Array(7), function (val, index) {
|
|
|
+ let formatDate = new Date(
|
|
|
+ presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
|
|
|
+ );
|
|
|
+ return (
|
|
|
+ formatDate.getFullYear() +
|
|
|
+ "-" +
|
|
|
+ ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
|
|
|
+ "-" +
|
|
|
+ (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
|
|
|
+ );
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ throw new Error(
|
|
|
+ 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
|
|
|
+ );
|
|
|
+ }
|
|
|
+ },
|
|
|
onProgressChange() {
|
|
|
this.$forceUpdate();
|
|
|
},
|