|
@@ -1,79 +1,139 @@
|
|
<template>
|
|
<template>
|
|
<section>
|
|
<section>
|
|
<!--工具条-->
|
|
<!--工具条-->
|
|
- <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
|
|
|
|
|
|
+ <!-- <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
|
|
<el-form :inline="true">
|
|
<el-form :inline="true">
|
|
<el-form-item>
|
|
<el-form-item>
|
|
<el-date-picker v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM" @change="changeMonthOut" :clearable="false" type="month" placeholder="选择月份"></el-date-picker>
|
|
<el-date-picker v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM" @change="changeMonthOut" :clearable="false" type="month" placeholder="选择月份"></el-date-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item style="float:right;">
|
|
|
|
- <el-link type="primary" :underline="false" v-if="user.role != 0" @click="exportReport">导出日报</el-link>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item style="float:right;">
|
|
|
|
- <el-link type="primary" :underline="false" @click="fillInReport(-1)">填写日报</el-link>
|
|
|
|
- </el-form-item>
|
|
|
|
</el-form>
|
|
</el-form>
|
|
- </el-col>
|
|
|
|
|
|
+ </el-col> -->
|
|
|
|
|
|
<!--列表-->
|
|
<!--列表-->
|
|
<div>
|
|
<div>
|
|
- <el-card class="box-card daily" shadow="never" :style="'height:'+tableHeight +'px'">
|
|
|
|
|
|
+ <el-card class="box-card daily" shadow="never" >
|
|
<div slot="header" class="clearfix">
|
|
<div slot="header" class="clearfix">
|
|
|
|
+ <el-date-picker v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM" @change="changeMonthOut" :clearable="false" type="month" placeholder="选择月份"></el-date-picker>
|
|
|
|
+ <span >
|
|
<span>日期:</span>
|
|
<span>日期:</span>
|
|
<span v-for="(item,index) in allDate" :id="'day'+index" :class="index==choseDay?'chooseDate date_item':'date_item'"
|
|
<span v-for="(item,index) in allDate" :id="'day'+index" :class="index==choseDay?'chooseDate date_item':'date_item'"
|
|
@click="choseDate(index)" :key="index">{{item}}</span>
|
|
@click="choseDate(index)" :key="index">{{item}}</span>
|
|
|
|
+ </span>
|
|
</div>
|
|
</div>
|
|
- <div class="allDaily">
|
|
|
|
- <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
|
|
|
|
- <i class="fa fa-circle"></i>{{item1.name}}
|
|
|
|
- <span style="margin-left:30px;">
|
|
|
|
- <span style="margin-right:20px;">
|
|
|
|
- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i>
|
|
|
|
- 总填报:
|
|
|
|
- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span>
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <div style="float:left;width:200px;" v-if="user.role == 1">
|
|
|
|
+ <div>
|
|
|
|
+ <el-select v-model="selectState" size="small" @change="stateChange">
|
|
|
|
+ <el-option value="-1" label="全部状态" >全部状态</el-option>
|
|
|
|
+ <el-option value="-2" label="未填报">未填报</el-option>
|
|
|
|
+ <el-option value="1" label="已通过">已通过</el-option>
|
|
|
|
+ <el-option value="0" label="待审核">待审核</el-option>
|
|
|
|
+ <el-option value="2" label="不通过">不通过</el-option>
|
|
|
|
+ </el-select></div>
|
|
|
|
+ <div>
|
|
|
|
+ <el-tree :data="data" @node-click="handleNodeClick" >
|
|
|
|
+ <span class="custom-tree-node" slot-scope="{ node, data}">
|
|
|
|
+ <span>{{ node.label }}</span>
|
|
|
|
+ <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
|
|
|
|
+ <div style="width:0%;float:right;">
|
|
|
|
+ <span v-if="data.isUser == 1 && data.state == null" style="color:red;">
|
|
|
|
+ 未填报
|
|
|
|
+ </span>
|
|
|
|
+ <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;">
|
|
|
|
+ 待审核
|
|
|
|
+ </span>
|
|
|
|
+ <span v-if="data.isUser == 1 && data.state == 1" style="color:green;">
|
|
|
|
+ 已通过
|
|
|
|
+ </span>
|
|
|
|
+ <span v-if="data.isUser == 1 && data.state == 2" style="color:red;">
|
|
|
|
+ 未通过
|
|
</span>
|
|
</span>
|
|
- <el-link v-if="user.role != 0" type="primary" :underline="false" @click="junpToDeskTop(item1.id)">系统智能统计:{{item1.calculateTime}}h</el-link>
|
|
|
|
- <span v-else>系统智能统计:{{item1.calculateTime}}h</span>
|
|
|
|
- <span style="margin-left:15px;color:#DAA520;" v-if="item1.state == 0">[ 待审核 ]</span>
|
|
|
|
- <span style="margin-left:15px;color:#32CD32;" v-else-if="item1.state == 1">[ 已通过 ]</span>
|
|
|
|
- <span style="margin-left:15px;color:#FF0000;" v-else-if="item1.state == 2">[ 已驳回 ]</span>
|
|
|
|
|
|
+ </div>
|
|
</span>
|
|
</span>
|
|
- <div class="checkbtn">
|
|
|
|
- <el-button v-if="user.role != 0 && item1.state == 0" type="primary" :loading="logining" size="small" @click="approve(item1.id)">通过</el-button>
|
|
|
|
- <el-button v-if="user.role != 0 && item1.state == 0" type="danger" :loading="logining" size="small" @click="deny(item1.id,0)">驳回</el-button>
|
|
|
|
- <el-button v-if="user.role != 0 && item1.state == 1" type="danger" :loading="logining" size="small" @click="deny(item1.id,1)">撤销</el-button>
|
|
|
|
- <el-button v-if="item1.state == 2 && user.id == item1.id" type="primary" size="small" @click="fillInReport(index1)">编辑日报</el-button>
|
|
|
|
- </div>
|
|
|
|
- <div class="one_daily_body">
|
|
|
|
- <el-timeline>
|
|
|
|
- <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
|
|
|
|
- <el-card shadow="never">
|
|
|
|
- <p>项目:<b>{{item2.project}}</b></p>
|
|
|
|
- <p>时长:{{item2.time}}h</p>
|
|
|
|
- <p>事项:<span v-html="item2.content"></span></p>
|
|
|
|
- </el-card>
|
|
|
|
- </el-timeline-item>
|
|
|
|
- </el-timeline>
|
|
|
|
|
|
+ </el-tree>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div :style="'height:'+tableHeight+'px;width:0.5px;background:#eee;margin-right:10px;float:left;'" ></div>
|
|
|
|
+ <div class="allDaily" style="float:left;">
|
|
|
|
+ <div class="report_title"><span>工作日报 | {{depData.label}}</span> - 已填写<span style="margin-left:5px;margin-right:5px;color:red;">{{reportList.length}}</span>人,
|
|
|
|
+ 未填写<span style="margin-left:5px;margin-right:5px;color:red;">{{(depData == null?data[0].membCount:(depData.isUser == 1?1:depData.membCount))-reportList.length}}</span>人
|
|
|
|
+ <span style="float:right;">
|
|
|
|
+ <el-link type="primary" style="margin-right:10px;" :underline="false" @click="fillInReport(-1)">填写日报</el-link>
|
|
|
|
+ <el-link type="primary" style="margin-right:10px;" :underline="false" v-if="user.role != 0" @click="exportReport">导出日报</el-link>
|
|
|
|
+ <el-link type="primary" style="margin-right:10px;" :underline="false" v-if="user.role != 0" @click="batchApprove">批量审核</el-link>
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ <div style="height:490px;overflow:scroll;padding-top:10px;">
|
|
|
|
+ <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
|
|
|
|
+ <i class="fa fa-circle"></i>{{item1.name}}
|
|
|
|
+ <span style="margin-left:30px;">
|
|
|
|
+ <span style="margin-right:20px;">
|
|
|
|
+ <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
|
|
|
|
+ 工作总时长:
|
|
|
|
+ <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
|
|
|
|
+ <span style="color:red;">{{item1.reportTime}}h</span>
|
|
|
|
+ </span>
|
|
|
|
+ <!-- <el-link v-if="user.role != 0" type="primary" :underline="false" @click="junpToDeskTop(item1.id)">系统智能统计:{{item1.calculateTime}}h</el-link>
|
|
|
|
+ <span v-else>系统智能统计:{{item1.calculateTime}}h</span> -->
|
|
|
|
+ <span style="margin-left:15px;color:#DAA520;" v-if="item1.state == 0">[ 待审核 ]</span>
|
|
|
|
+ <span style="margin-left:15px;color:#32CD32;" v-else-if="item1.state == 1">[ 已通过 ]</span>
|
|
|
|
+ <span style="margin-left:15px;color:#FF0000;" v-else-if="item1.state == 2">[ 已驳回 ]</span>
|
|
|
|
+ </span>
|
|
|
|
+ <div class="checkbtn">
|
|
|
|
+ <el-button v-if="user.role != 0 && item1.state == 0" type="primary" :loading="logining" size="small" @click="approve(item1.id)">通过</el-button>
|
|
|
|
+ <el-button v-if="user.role != 0 && item1.state == 0" type="danger" :loading="logining" size="small" @click="deny(item1.id,0)">驳回</el-button>
|
|
|
|
+ <el-button v-if="user.role != 0 && item1.state == 1" type="danger" :loading="logining" size="small" @click="deny(item1.id,1)">撤销</el-button>
|
|
|
|
+ <el-button v-if="item1.state == 2 && user.id == item1.id" type="primary" size="small" @click="fillInReport(index1)">编辑日报</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="one_daily_body">
|
|
|
|
+ <el-timeline>
|
|
|
|
+ <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
|
|
|
|
+ <el-card shadow="never">
|
|
|
|
+ <p>项目:<b>{{item2.project}}</b></p>
|
|
|
|
+ <p>时长:{{item2.time}}h ({{typeList[item2.timeType]}})</p>
|
|
|
|
+ <p>事项:<span v-html="item2.content"></span></p>
|
|
|
|
+ </el-card>
|
|
|
|
+ </el-timeline-item>
|
|
|
|
+ </el-timeline>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <!-- 简陋的无报告提示 -->
|
|
|
|
+ <div v-if="reportList.length==0" style="width:800px;font-size:17px;text-align:center;color:#aaa;">今日暂无报告</div>
|
|
</div>
|
|
</div>
|
|
- <!-- 简陋的无报告提示 -->
|
|
|
|
- <div v-if="reportList.length==0" style="font-size:17px;text-align:center;margin-top:175px;color:#aaa;">本日暂无报告</div>
|
|
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</el-card>
|
|
</el-card>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <!-- 项目管理的dialog -->
|
|
|
|
|
|
+ <!-- 填写日报的dialog -->
|
|
<el-dialog title="填写日报" :visible.sync="dialogVisible" width="60%">
|
|
<el-dialog title="填写日报" :visible.sync="dialogVisible" width="60%">
|
|
<el-form ref="workForm" :model="workForm" :rules="workRules" label-width="100px">
|
|
<el-form ref="workForm" :model="workForm" :rules="workRules" label-width="100px">
|
|
<el-form-item label="工作日期" prop="createDate">
|
|
<el-form-item label="工作日期" prop="createDate">
|
|
<el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
|
|
<el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
|
|
@change="changeMonth()" :clearable="false" type="date" placeholder="选择工作日期" :disabled="isDisable"></el-date-picker>
|
|
@change="changeMonth()" :clearable="false" type="date" placeholder="选择工作日期" :disabled="isDisable"></el-date-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="待分配时长" prop="name">
|
|
|
|
|
|
+ <!-- <el-form-item label="待分配时长" prop="name">
|
|
<span>{{report.time}}h</span>
|
|
<span>{{report.time}}h</span>
|
|
<el-link type="primary" :underline="false" @click="addDomain" style="margin-left:40px">添加项目</el-link>
|
|
<el-link type="primary" :underline="false" @click="addDomain" style="margin-left:40px">添加项目</el-link>
|
|
- </el-form-item>
|
|
|
|
|
|
+ </el-form-item> -->
|
|
|
|
+
|
|
<div v-for="(domain, index) in workForm.domains" :key="domain.id">
|
|
<div v-for="(domain, index) in workForm.domains" :key="domain.id">
|
|
|
|
+ <el-form-item label="工作时间" :prop="'domains.' + index + '.timeType'"
|
|
|
|
+ :rules="{ required: true, message: '请选择工作时间', trigger: 'blur' }">
|
|
|
|
+ <!-- <el-input v-model.number="domain.workingTime" placeholder="请输入投入时长" type='number' clearable style="width:200px;"
|
|
|
|
+ :disabled="workForm.domains.length==0?true:(workForm.domains[0].state==2?false:true)"></el-input> -->
|
|
|
|
+ <el-select v-model="domain.timeType" placeholder="请选择工作时间"
|
|
|
|
+ :disabled="workForm.domains.length==0?true:(workForm.domains[0].state==2?false:true)"
|
|
|
|
+ @change="onTimeTypeChange(domain.timeType)">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in timeType"
|
|
|
|
+ :key="item.value"
|
|
|
|
+ :label="item.label"
|
|
|
|
+ :value="item.value">
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
<el-form-item label="投入项目" :prop="'domains.' + index + '.projectId'"
|
|
<el-form-item label="投入项目" :prop="'domains.' + index + '.projectId'"
|
|
:rules="{ required: true, message: '请选择投入项目', trigger: ['change','blur'] }">
|
|
:rules="{ required: true, message: '请选择投入项目', trigger: ['change','blur'] }">
|
|
<el-select v-model="domain.projectId" placeholder="请选择" style="width:200px;"
|
|
<el-select v-model="domain.projectId" placeholder="请选择" style="width:200px;"
|
|
@@ -85,19 +145,13 @@
|
|
<i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
|
|
<i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
|
|
</el-link>
|
|
</el-link>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
-
|
|
|
|
- <el-form-item label="投入时长" :prop="'domains.' + index + '.workingTime'"
|
|
|
|
- :rules="{ required: true, message: '请输入投入时长', trigger: 'blur' }">
|
|
|
|
- <el-input v-model.number="domain.workingTime" placeholder="请输入投入时长" type='number' clearable style="width:200px;"
|
|
|
|
- :disabled="workForm.domains.length==0?true:(workForm.domains[0].state==2?false:true)"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
-
|
|
|
|
- <el-form-item label="工作事项" :prop="'domains.' + index + '.content'" :rules="{ required: true, message: '请输入工作事项', trigger: 'blur' }">
|
|
|
|
|
|
+ <el-form-item label="工作事项" :prop="'domains.' + index + '.content'" >
|
|
<el-input v-model="domain.content" type="textarea" :rows="4" placeholder="请输入投入时长" clearable
|
|
<el-input v-model="domain.content" type="textarea" :rows="4" placeholder="请输入投入时长" clearable
|
|
:disabled="workForm.domains.length==0?true:(workForm.domains[0].state==2?false:true)"></el-input>
|
|
:disabled="workForm.domains.length==0?true:(workForm.domains[0].state==2?false:true)"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-divider v-if="workForm.domains.length>1"></el-divider>
|
|
<el-divider v-if="workForm.domains.length>1"></el-divider>
|
|
</div>
|
|
</div>
|
|
|
|
+ <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain" style="margin-left:40px">添加更多</el-link>
|
|
</el-form>
|
|
</el-form>
|
|
<span slot="footer" class="dialog-footer">
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button @click="dialogVisible = false">取消</el-button>
|
|
<el-button @click="dialogVisible = false">取消</el-button>
|
|
@@ -105,6 +159,18 @@
|
|
:disabled="workForm.domains.length==0?true:(workForm.domains[0].state==2?false:true)" >提交</el-button>
|
|
:disabled="workForm.domains.length==0?true:(workForm.domains[0].state==2?false:true)" >提交</el-button>
|
|
</span>
|
|
</span>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+
|
|
|
|
+ <!-- 批量日报审核 -->
|
|
|
|
+ <el-dialog title="批量日报审核" :visible.sync="approveDialogVisible" width="500px">
|
|
|
|
+ <el-checkbox v-model="isAllSelect" label="全选" style="margin-left:24px;" @change="selectAll" v-if="batchShowData.length > 0"></el-checkbox>
|
|
|
|
+ <el-tree ref="approveTree" node-key="id" :data="batchShowData" show-checkbox="true" @check-change="handleCheckChange" >
|
|
|
|
+ </el-tree>
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button @click="approveDialogVisible = false">取消</el-button>
|
|
|
|
+ <el-button type="primary" @click="submitBatchApprove" :disabled="batchShowData.length == 0">审核通过</el-button>
|
|
|
|
+ </span>
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
</section>
|
|
</section>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -114,9 +180,16 @@
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ isAllSelect: false,
|
|
|
|
+ approveDialogVisible:false,
|
|
|
|
+ deptId:null,
|
|
|
|
+ targetUid: null,
|
|
|
|
+ membCount:0,
|
|
|
|
+ selectState:"-1",
|
|
user: JSON.parse(sessionStorage.getItem("user")),
|
|
user: JSON.parse(sessionStorage.getItem("user")),
|
|
-
|
|
|
|
|
|
+ showAddMore:false,
|
|
allDate: [],
|
|
allDate: [],
|
|
|
|
+ typeList:['全天','上午','下午'],
|
|
date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
|
|
date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
|
|
choseDay: 0,
|
|
choseDay: 0,
|
|
|
|
|
|
@@ -134,6 +207,7 @@
|
|
id: null,
|
|
id: null,
|
|
projectId: "",
|
|
projectId: "",
|
|
workingTime: "",
|
|
workingTime: "",
|
|
|
|
+ timeType:0,
|
|
content: "",
|
|
content: "",
|
|
state: 2,
|
|
state: 2,
|
|
}],
|
|
}],
|
|
@@ -144,14 +218,331 @@
|
|
|
|
|
|
logining: false,
|
|
logining: false,
|
|
isDisable: false,
|
|
isDisable: false,
|
|
|
|
+ timeType:[],
|
|
|
|
+ //部门人员树状结构
|
|
|
|
+ data: [
|
|
|
|
+ {
|
|
|
|
+ id: -1,
|
|
|
|
+ label: '全部人员',
|
|
|
|
+ membCount:0
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ id: 0,
|
|
|
|
+ label: '未分配',
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ allData:{},
|
|
|
|
+ batchShowData:{},
|
|
|
|
+ option: [],
|
|
|
|
+ depData: {
|
|
|
|
+ id: -1,
|
|
|
|
+ label: '全部人员',
|
|
|
|
+ },
|
|
|
|
+ defaultProps: {
|
|
|
|
+ children: 'children',
|
|
|
|
+ label: 'label'
|
|
|
|
+ },
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ //提交批量审核数据
|
|
|
|
+ submitBatchApprove() {
|
|
|
|
+ console.log(this.$refs.approveTree.getCheckedNodes());
|
|
|
|
+ var data = this.$refs.approveTree.getCheckedNodes();
|
|
|
|
+ var ids = '';
|
|
|
|
+ if (data.length == 0) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '请选择要审核的人员',
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ for (var i=0;i<data.length; i++) {
|
|
|
|
+ ids += data[i].id;
|
|
|
|
+ if (i < data.length-1) {
|
|
|
|
+ ids += ',';
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ let day = this.choseDay > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
|
|
|
|
+ this.http.post("/report/batchApproveReport", {ids:ids, date:this.date + day},
|
|
|
|
+ res => {
|
|
|
|
+ if (res.code == "ok") {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '审核成功',
|
|
|
|
+ type: "success"
|
|
|
|
+ });
|
|
|
|
+ this.getReportList();
|
|
|
|
+ this.getDepartment();
|
|
|
|
+ this.approveDialogVisible = false;
|
|
|
|
+ } else {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: res.msg,
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ error => {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: error,
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ selectAll() {
|
|
|
|
+ if (this.isAllSelect) {
|
|
|
|
+ var keys = [];
|
|
|
|
+ this.batchShowData.forEach(b=>{
|
|
|
|
+ keys.push(b.id);
|
|
|
|
+ })
|
|
|
|
+ this.$refs.approveTree.setCheckedKeys(keys);
|
|
|
|
+ } else {
|
|
|
|
+ this.$refs.approveTree.setCheckedKeys([]);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //批量审核
|
|
|
|
+ batchApprove() {
|
|
|
|
+ this.approveDialogVisible = true;
|
|
|
|
+ console.log(this.allData);
|
|
|
|
+ this.batchShowData = JSON.parse(JSON.stringify(this.allData));
|
|
|
|
+ //去掉全部人员
|
|
|
|
+ this.batchShowData.splice(0,1);
|
|
|
|
+ //过滤。只显示待审核的
|
|
|
|
+ this.filterState(0, this.batchShowData);
|
|
|
|
+ this.calculateMembCount(this.batchShowData);
|
|
|
|
+ //去掉空的部门
|
|
|
|
+ this.removeEmptyNode(this.batchShowData);
|
|
|
|
+ },
|
|
|
|
+ removeEmptyNode(list) {
|
|
|
|
+ for (var i=0;i<list.length;i++) {
|
|
|
|
+ var cnt = 0;
|
|
|
|
+ if (list[i].membCount == 0) {
|
|
|
|
+ list.splice(i, 1);
|
|
|
|
+ i--;
|
|
|
|
+ } else if (list[i].children != null) {
|
|
|
|
+ this.removeEmptyNode(list[i].children);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ calculateMembCount(list) {
|
|
|
|
+ for (var i in list) {
|
|
|
|
+ var cnt = 0;
|
|
|
|
+ if (list[i].children != null) {
|
|
|
|
+ this.calculateMembCount(list[i].children);
|
|
|
|
+ for (var m in list[i].children) {
|
|
|
|
+ cnt += list[i].children[m].membCount;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (list[i].isUser == 1) {
|
|
|
|
+ cnt++;
|
|
|
|
+ this.membCount++;
|
|
|
|
+ }
|
|
|
|
+ list[i].membCount = cnt;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ stateChange() {
|
|
|
|
+ this.membCount = 0;
|
|
|
|
+ if (this.selectState == -1) {
|
|
|
|
+ //全部状态
|
|
|
|
+ this.data = this.allData;
|
|
|
|
+ } else {
|
|
|
|
+ //未填报
|
|
|
|
+ var newData = JSON.parse(JSON.stringify(this.allData));
|
|
|
|
+ this.filterState(this.selectState, newData);
|
|
|
|
+ this.data = newData;
|
|
|
|
+ }
|
|
|
|
+ this.calculateMembCount(this.data);
|
|
|
|
+ this.data[0].membCount = this.membCount;//总人数
|
|
|
|
+ },
|
|
|
|
+ //按状态过滤部门人员
|
|
|
|
+ filterState(state, list) {
|
|
|
|
+ for (var i =0;i<list.length; i++) {
|
|
|
|
+ var obj = list[i];
|
|
|
|
+ if (obj.isUser == 1) {
|
|
|
|
+ var match = false;
|
|
|
|
+ if (state == -2) {
|
|
|
|
+ if (obj.state == null) {
|
|
|
|
+ match = true;
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (obj.state == state) {
|
|
|
|
+ match = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (!match) {
|
|
|
|
+ console.log("不匹配,删除="+obj.label+', state='+obj.state);
|
|
|
|
+ list.splice(i, 1);
|
|
|
|
+ i--;
|
|
|
|
+ } else {
|
|
|
|
+ console.log("匹配"+obj.label);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (obj.children != null) {
|
|
|
|
+ this.filterState(state, obj.children);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 部门列表点击
|
|
|
|
+ handleNodeClick(data) {
|
|
|
|
+ console.log(data);
|
|
|
|
+ // if(this.depData == null || data.id != this.depData.id) {
|
|
|
|
+ // this.depData = data;
|
|
|
|
+ // //this.getUser();
|
|
|
|
+
|
|
|
|
+ // }
|
|
|
|
+ this.depData = data;
|
|
|
|
+ if (data.id == -1) {
|
|
|
|
+ this.deptId = null;
|
|
|
|
+ this.targetUid = null;
|
|
|
|
+ } else if (data.isUser == 1) {
|
|
|
|
+ this.deptId = null;
|
|
|
|
+ this.targetUid = data.id;
|
|
|
|
+ } else {
|
|
|
|
+ this.deptId = data.id;
|
|
|
|
+ this.targetUid = null;
|
|
|
|
+ }
|
|
|
|
+ this.getReportList();
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 获取部门列表
|
|
|
|
+ getDepartment() {
|
|
|
|
+ let day = this.choseDay > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
|
|
|
|
+ this.http.post("/report/getMembList", {date:this.date + day},
|
|
|
|
+ res => {
|
|
|
|
+ if (res.code == "ok") {
|
|
|
|
+ var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
|
|
|
|
+ list.splice(0,0,{
|
|
|
|
+ id: -1,
|
|
|
|
+ label: '全部人员',
|
|
|
|
+ })
|
|
|
|
+ list.push({
|
|
|
|
+ id: 0,
|
|
|
|
+ label: '未分配',
|
|
|
|
+ })
|
|
|
|
+ this.membCount = 0;
|
|
|
|
+ //设置员工到部门下面
|
|
|
|
+ this.setUserToDept(list);
|
|
|
|
+ this.data = list;
|
|
|
|
+ this.allData = list;
|
|
|
|
+ this.option = this.changeArr(list1);
|
|
|
|
+ list[0].membCount = this.membCount;
|
|
|
|
+ if (this.depData.id == -1) {
|
|
|
|
+ this.depData.membCount = this.membCount;
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: res.msg,
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ error => {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: error,
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ setUserToDept(list) {
|
|
|
|
+ for (var i in list) {
|
|
|
|
+ var cnt = 0;
|
|
|
|
+ if (list[i].children != null) {
|
|
|
|
+ this.setUserToDept(list[i].children);
|
|
|
|
+ for (var m in list[i].children) {
|
|
|
|
+ cnt += list[i].children[m].membCount;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (list[i].userList != null) {
|
|
|
|
+ if (list[i].children == null) {
|
|
|
|
+ list[i].children = [];
|
|
|
|
+ }
|
|
|
|
+ list[i].userList.forEach(element => {
|
|
|
|
+ var obj = {id: element.id, label:element.name, state:element.state, parentId:element.departmentId, isUser:1};
|
|
|
|
+ list[i].children.push(obj);
|
|
|
|
+ this.membCount++;
|
|
|
|
+ cnt++;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ list[i].membCount = cnt;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 修改数组
|
|
|
|
+ changeArr(arr) {
|
|
|
|
+ for (var i = 0; i < arr.length; i++) {
|
|
|
|
+ if(arr[i].id != -1 && arr[i].id != 0) {
|
|
|
|
+ if (arr[i].children != null && arr[i].children.length>0) {
|
|
|
|
+ arr[i].children = this.changeArr(arr[i].children);
|
|
|
|
+ }
|
|
|
|
+ arr[i].id && (arr[i].value = arr[i].id);
|
|
|
|
+ delete arr[i].id;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ for(var i in arr) {
|
|
|
|
+ if(arr[i].id == -1 || arr[i].id == 0) {
|
|
|
|
+ arr.splice(i,1)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return arr;
|
|
|
|
+ },
|
|
|
|
+ //时间段范围设置改动,监听
|
|
|
|
+ onTimeTypeChange(timeType) {
|
|
|
|
+ this.showAddMore = true;
|
|
|
|
+ console.log("======" + timeType);
|
|
|
|
+ for(var i in this.workForm.domains) {
|
|
|
|
+ if (this.workForm.domains[i].timeType == 0) {
|
|
|
|
+ this.showAddMore = false;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (this.showAddMore) {
|
|
|
|
+ //检测数量
|
|
|
|
+ if (this.workForm.domains.length == 2) {
|
|
|
|
+ this.showAddMore = false;
|
|
|
|
+ } else {
|
|
|
|
+ this.showAddMore = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ getTimeType() {
|
|
|
|
+ this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
|
|
|
|
+ res => {
|
|
|
|
+ if (res.code == "ok") {
|
|
|
|
+ var t = res.data;
|
|
|
|
+ //转化时间格式
|
|
|
|
+ if (t.allday != null) {
|
|
|
|
+ this.timeType.push({value:0, label:'全天 - '+t.allday+'小时', hours:t.allday});
|
|
|
|
+ }
|
|
|
|
+ if (t.am != null) {
|
|
|
|
+ this.timeType.push({value:1, label:'上午 - '+t.am+'小时', hours: t.am});
|
|
|
|
+ }
|
|
|
|
+ if (t.pm != null) {
|
|
|
|
+ this.timeType.push({value:2, label:'上午 - '+t.pm+'小时', hours: t.pm});
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: res.msg,
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ error => {
|
|
|
|
+ this.listLoading = false;
|
|
|
|
+ this.$message({
|
|
|
|
+ message: error,
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
// 改变月份
|
|
// 改变月份
|
|
changeMonthOut() {
|
|
changeMonthOut() {
|
|
console.log(sessionStorage.msg)
|
|
console.log(sessionStorage.msg)
|
|
this.getAllDate();
|
|
this.getAllDate();
|
|
this.getReportList();
|
|
this.getReportList();
|
|
|
|
+ this.getDepartment();
|
|
},
|
|
},
|
|
|
|
|
|
// 选择日期
|
|
// 选择日期
|
|
@@ -160,6 +551,7 @@
|
|
let day = this.choseDay > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
|
|
let day = this.choseDay > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
|
|
sessionStorage.msg = this.date + day,
|
|
sessionStorage.msg = this.date + day,
|
|
this.getReportList();
|
|
this.getReportList();
|
|
|
|
+ this.getDepartment();
|
|
},
|
|
},
|
|
|
|
|
|
// 获取日期列表
|
|
// 获取日期列表
|
|
@@ -200,7 +592,14 @@
|
|
getReportList() {
|
|
getReportList() {
|
|
this.listLoading = true;
|
|
this.listLoading = true;
|
|
let day = this.choseDay > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
|
|
let day = this.choseDay > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
|
|
- this.http.post( this.port.report.list, { date: this.date + day },
|
|
|
|
|
|
+ let param = {date: this.date + day};
|
|
|
|
+ if (this.deptId != null) {
|
|
|
|
+ param.deptId = this.deptId;
|
|
|
|
+ }
|
|
|
|
+ if (this.targetUid != null) {
|
|
|
|
+ param.userId = this.targetUid;
|
|
|
|
+ }
|
|
|
|
+ this.http.post( this.port.report.list, param,
|
|
res => {
|
|
res => {
|
|
this.listLoading = false;
|
|
this.listLoading = false;
|
|
if (res.code == "ok") {
|
|
if (res.code == "ok") {
|
|
@@ -296,7 +695,8 @@
|
|
projectId: list.report[i].projectId,
|
|
projectId: list.report[i].projectId,
|
|
workingTime: list.report[i].workingTime,
|
|
workingTime: list.report[i].workingTime,
|
|
content: list.report[i].content,
|
|
content: list.report[i].content,
|
|
- state: list.report[i].state
|
|
|
|
|
|
+ state: list.report[i].state,
|
|
|
|
+ timeType: list.report[i].timeType
|
|
})
|
|
})
|
|
}
|
|
}
|
|
this.workForm = {
|
|
this.workForm = {
|
|
@@ -312,6 +712,7 @@
|
|
workingTime: "",
|
|
workingTime: "",
|
|
content: "",
|
|
content: "",
|
|
state: 2,
|
|
state: 2,
|
|
|
|
+ timeType:0,
|
|
}],
|
|
}],
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -346,16 +747,28 @@
|
|
|
|
|
|
// 添加模块
|
|
// 添加模块
|
|
addDomain() {
|
|
addDomain() {
|
|
|
|
+
|
|
this.workForm.domains.push({
|
|
this.workForm.domains.push({
|
|
projectId: "",
|
|
projectId: "",
|
|
workingTime: "",
|
|
workingTime: "",
|
|
- content: ""
|
|
|
|
|
|
+ content: "",
|
|
});
|
|
});
|
|
|
|
+ //检测时间段数量,达到2个,不能再加了
|
|
|
|
+ var length = this.workForm.domains.length;
|
|
|
|
+ if (length == 2) {
|
|
|
|
+ this.showAddMore = false;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
// 移除模块
|
|
// 移除模块
|
|
delDomain(i) {
|
|
delDomain(i) {
|
|
this.workForm.domains.splice(i,1)
|
|
this.workForm.domains.splice(i,1)
|
|
|
|
+ //检测当前剩下的一个,时间类型是否是全天
|
|
|
|
+ if (this.workForm.domains[0].timeType == 0) {
|
|
|
|
+ this.showAddMore = false;
|
|
|
|
+ } else {
|
|
|
|
+ this.showAddMore = true;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
// 改变月份
|
|
// 改变月份
|
|
@@ -367,6 +780,48 @@
|
|
submitDepartment() {
|
|
submitDepartment() {
|
|
this.$refs.workForm.validate(valid => {
|
|
this.$refs.workForm.validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
|
|
+ //检查时间,全天和上下午不能同时存在
|
|
|
|
+ var alldayNum = 0;
|
|
|
|
+ var amNum = 0;
|
|
|
|
+ var pmNum = 0;
|
|
|
|
+ for(var i in this.workForm.domains) {
|
|
|
|
+ if (this.workForm.domains[i].timeType == 0) {
|
|
|
|
+ alldayNum ++;
|
|
|
|
+ } else if (this.workForm.domains[i].timeType == 1) {
|
|
|
|
+ amNum++;
|
|
|
|
+ } else if (this.workForm.domains[i].timeType == 2) {
|
|
|
|
+ pmNum++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (alldayNum > 1) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "工作时间-全天,只能选择一次",
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (amNum > 1) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "工作时间-上午,只能选择一次",
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (pmNum > 1) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "工作时间-下午,只能选择一次",
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "工作时间-全天,不能和上下午同时存在",
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
this.listLoading = true;
|
|
this.listLoading = true;
|
|
let formData = new FormData();
|
|
let formData = new FormData();
|
|
for(var i in this.workForm.domains) {
|
|
for(var i in this.workForm.domains) {
|
|
@@ -376,8 +831,15 @@
|
|
formData.append("id", -1);
|
|
formData.append("id", -1);
|
|
}
|
|
}
|
|
formData.append("projectId", this.workForm.domains[i].projectId);
|
|
formData.append("projectId", this.workForm.domains[i].projectId);
|
|
- formData.append("workingTime", this.workForm.domains[i].workingTime);
|
|
|
|
- formData.append("content", this.workForm.domains[i].content);
|
|
|
|
|
|
+ formData.append("timeType", this.workForm.domains[i].timeType);
|
|
|
|
+ var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
|
|
|
|
+ formData.append("workingTime", workingTime);
|
|
|
|
+ if (this.workForm.domains[i].content == null || this.workForm.domains[i].content == '') {
|
|
|
|
+ formData.append("content", '-');
|
|
|
|
+ } else {
|
|
|
|
+ formData.append("content", this.workForm.domains[i].content);
|
|
|
|
+ }
|
|
|
|
+
|
|
formData.append("createDate", this.workForm.createDate);
|
|
formData.append("createDate", this.workForm.createDate);
|
|
}
|
|
}
|
|
this.http.uploadFile( this.port.report.editPort, formData,
|
|
this.http.uploadFile( this.port.report.editPort, formData,
|
|
@@ -390,6 +852,7 @@
|
|
});
|
|
});
|
|
this.dialogVisible = false;
|
|
this.dialogVisible = false;
|
|
this.getReportList();
|
|
this.getReportList();
|
|
|
|
+ this.getDepartment();
|
|
} else {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
message: res.msg,
|
|
message: res.msg,
|
|
@@ -427,6 +890,7 @@
|
|
type: "success"
|
|
type: "success"
|
|
});
|
|
});
|
|
this.getReportList();
|
|
this.getReportList();
|
|
|
|
+ this.getDepartment();
|
|
} else {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
message: res.msg,
|
|
message: res.msg,
|
|
@@ -456,6 +920,7 @@
|
|
type: "success"
|
|
type: "success"
|
|
});
|
|
});
|
|
this.getReportList();
|
|
this.getReportList();
|
|
|
|
+ this.getDepartment();
|
|
} else {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
message: res.msg,
|
|
message: res.msg,
|
|
@@ -475,21 +940,29 @@
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
let height = window.innerHeight;
|
|
let height = window.innerHeight;
|
|
- this.tableHeight = height - 150;
|
|
|
|
|
|
+ this.tableHeight = height - 233;
|
|
const that = this;
|
|
const that = this;
|
|
window.onresize = function temp() {
|
|
window.onresize = function temp() {
|
|
- that.tableHeight = window.innerHeight - 150;
|
|
|
|
|
|
+ that.tableHeight = window.innerHeight - 233;
|
|
};
|
|
};
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
this.getAllDate();
|
|
this.getAllDate();
|
|
this.getReportList();
|
|
this.getReportList();
|
|
this.getProjectList();
|
|
this.getProjectList();
|
|
|
|
+ this.getTimeType();
|
|
|
|
+ this.getDepartment();
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
|
+ .allDaily {
|
|
|
|
+ width:82%;
|
|
|
|
+ }
|
|
|
|
+ .report_title {
|
|
|
|
+ padding:10px 0;
|
|
|
|
+ }
|
|
.clearfix {
|
|
.clearfix {
|
|
overflow-x: auto;
|
|
overflow-x: auto;
|
|
white-space: nowrap;
|
|
white-space: nowrap;
|
|
@@ -529,14 +1002,16 @@
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
.daily {
|
|
.daily {
|
|
.el-card__body {
|
|
.el-card__body {
|
|
- height: 82%;
|
|
|
|
|
|
+ height: 80%;
|
|
overflow-y: auto;
|
|
overflow-y: auto;
|
|
}
|
|
}
|
|
|
|
|
|
.el-card__header {
|
|
.el-card__header {
|
|
padding: 0 20px;
|
|
padding: 0 20px;
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
+
|
|
</style>
|
|
</style>
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|