|
@@ -11,19 +11,32 @@
|
|
|
|
|
|
<!--列表-->
|
|
|
<div>
|
|
|
+
|
|
|
<el-card class="box-card daily" shadow="never">
|
|
|
<div slot="header" class="clearfix" id="clearfix" style="padding-left: 260px;">
|
|
|
<div class="jjk" style="display:inline-block;position:fixed;top:70px;background:#fff;left:250px;">
|
|
|
- <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM" @change="changeMonthOut" :clearable="false" type="month" placeholder="选择月份"></el-date-picker>
|
|
|
- <span>日期:</span>
|
|
|
+ <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>
|
|
|
+ <!-- <span>日期:</span> -->
|
|
|
</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">{{item}}</span>
|
|
|
+
|
|
|
+ <!-- <el-card class="box-card daily" shadow="never" >
|
|
|
+ <div slot="header" class="clearfix" @mousewheel="wheel" id="dateScroll">
|
|
|
+ <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" style="width:187px;"
|
|
|
+ value-format="yyyy-MM" @change="changeMonthOut" :clearable="false" type="month" placeholder="选择月份"></el-date-picker>
|
|
|
+ <span >
|
|
|
+ <span style="color:#999;">日期:</span>
|
|
|
+ <span v-for="(item,index) in allDate" :id="'day'+index" :class="index==choseDay?'chooseDate date_item':'date_item'"
|
|
|
+ @click="choseDate(index, item)" :key="index">{{item}}</span>
|
|
|
+ </span> -->
|
|
|
+
|
|
|
</div>
|
|
|
<div style="display:flex;">
|
|
|
- <div v-if="user.role > 0 || user.manageDeptId != 0">
|
|
|
- <div>
|
|
|
- <el-select v-model="selectState" size="small" @change="stateChange">
|
|
|
+ <div v-if="user.role > 0 || user.manageDeptId != 0" >
|
|
|
+ <div style="width:190px;">
|
|
|
+ <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>
|
|
@@ -60,19 +73,19 @@
|
|
|
|
|
|
<div :style="'height:'+tableHeight+'px;width:0.5px;background:#eee;margin-right:10px;margin-left:10px;'" ></div>
|
|
|
<div class="allDaily" style="float:left;flex-grow:1">
|
|
|
- <!--系统管理员 -->
|
|
|
- <div class="report_title" v-if="user.role > 0 || user.manageDeptId > 0">
|
|
|
+ <!--系统管理员和部门负责人 -->
|
|
|
+ <div class="report_title" v-if="user.role == 1 || user.role == 2 || user.manageDeptId > 0">
|
|
|
<span>工作日报 | {{depData.label}}</span> - 已填写<span style="margin-left:5px;margin-right:5px;color:green;">{{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" @click="exportReport">导出日报</el-link>
|
|
|
- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="batchApprove">批量审核</el-link>
|
|
|
+ <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog">导出日报</el-link>
|
|
|
+ <el-link type="primary" style="margin-right:10px;" :underline="false" @click="batchApprove" >批量审核</el-link>
|
|
|
</span>
|
|
|
</div>
|
|
|
<!--普通员工,含项目经理 -->
|
|
|
- <div class="report_title" v-if="user.role==0"><span>日报列表</span>
|
|
|
- <span style="float:right;" v-if="user.role==0">
|
|
|
+ <div class="report_title" v-if="(user.role==0||user.role==5) && user.manageDeptId == 0"><span>日报列表</span>
|
|
|
+ <span style="float:right;" v-if="(user.role==0||user.role==5) && user.manageDeptId == 0">
|
|
|
<el-link type="primary" style="margin-right:10px;" :underline="false" @click="fillInReport(-1)">填写日报</el-link>
|
|
|
<el-link type="primary" v-if="user.leader" style="margin-right:10px;" :underline="false" @click="batchApprove">批量审核</el-link>
|
|
|
</span>
|
|
@@ -86,16 +99,16 @@
|
|
|
工作总时长:
|
|
|
<!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
|
|
|
<span >{{item1.reportTime}}</span>h
|
|
|
- <span v-if="user.role > 0"><span style="margin-left:10px;">成本:</span>
|
|
|
+ <span v-if="user.role >=1 && user.role <=3"><span style="margin-left:10px;">成本:</span>
|
|
|
<span >{{item1.cost}}</span>元</span>
|
|
|
</span>
|
|
|
</span>
|
|
|
<div class="checkbtn">
|
|
|
- <el-button v-if="(user.role != 0 || user.id == item1.data[0].inchargerId) && item1.state == 0" type="primary" :loading="logining" size="small" @click="approve(item1.id, item1)">通过</el-button>
|
|
|
- <el-button v-if="(user.role != 0 || user.id == item1.data[0].inchargerId) && item1.state == 0" type="danger" :loading="logining" size="small" @click="deny(item1.id,0, item1)">驳回</el-button>
|
|
|
+ <el-button v-if="(user.role == 1 || user.role == 2 || user.id == item1.data[0].inchargerId) && item1.state == 0" type="primary" :loading="logining" size="small" @click="approve(item1.id, item1)">通过</el-button>
|
|
|
+ <el-button v-if="(user.role == 1 || user.role == 2 || user.id == item1.data[0].inchargerId) && item1.state == 0" type="danger" :loading="logining" size="small" @click="deny(item1.id,0, item1)">驳回</el-button>
|
|
|
<!--自己可以撤回待审核状态的报告 -->
|
|
|
<el-button v-if="(user.id == item1.id) && item1.state == 0" type="normal" :loading="logining" size="small" @click="cancel(item1)">撤回</el-button>
|
|
|
- <el-button v-if="(user.role != 0 || user.id == item1.data[0].inchargerId) && item1.state == 1" type="normal" :loading="logining" size="small" @click="deny(item1.id,1, item1)">撤销</el-button>
|
|
|
+ <el-button v-if="(user.role == 1 || user.role == 2 || user.id == item1.data[0].inchargerId) && item1.state == 1" type="normal" :loading="logining" size="small" @click="deny(item1.id,1, item1)">撤销</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">
|
|
@@ -133,13 +146,16 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- 填写日报的dialog -->
|
|
|
- <el-dialog title="填写日报" :visible.sync="dialogVisible" width="60%">
|
|
|
+ <el-dialog title="填写日报" :visible.sync="dialogVisible" width="60%" :close-on-click-modal="false">
|
|
|
<el-form ref="workForm" :model="workForm" :rules="workRules" label-width="100px">
|
|
|
<el-form-item label="工作日期" prop="createDate">
|
|
|
<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>
|
|
|
-
|
|
|
- <span v-if="reportTimeType.type == 3" style="margin-left:30px;" >总时长: {{reportTimeType.allday.toFixed(1)}}小时</span>
|
|
|
+ <span v-if="reportTimeType.type == 3" style="margin-left:30px;">总时长:</span>
|
|
|
+ <el-input-number :disabled="!canEdit" v-if="reportTimeType.type == 3" style="margin-left:10px;" @change="changeAllTime"
|
|
|
+ v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
|
|
|
+ <span v-if="reportTimeType.type == 3">小时</span>
|
|
|
+ <!-- <span v-if="reportTimeType.type == 3" style="margin-left:30px;" >总时长: {{reportTimeType.allday.toFixed(1)}}小时</span> -->
|
|
|
</el-form-item>
|
|
|
|
|
|
<div v-for="(domain, index) in workForm.domains" :key="domain.id">
|
|
@@ -193,7 +209,7 @@
|
|
|
}">
|
|
|
</el-time-picker>
|
|
|
</span>
|
|
|
- <div class="overtime"><el-checkbox v-model="domain.isOvertime">加班</el-checkbox></div>
|
|
|
+ <div class="overtime"><el-checkbox :disabled="!canEdit" v-model="domain.isOvertime">加班</el-checkbox></div>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="投入项目" :prop="'domains.' + index + '.projectId'"
|
|
@@ -215,11 +231,11 @@
|
|
|
|
|
|
<el-form-item v-if="reportTimeType.type == 3" label="用时占比" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
|
|
|
:rules="{ required: true, message: '请选择工作时长', trigger: 'blur' }">
|
|
|
- <div style="width:250px;">
|
|
|
- <el-col span="14"><el-slider v-model="domain.progress" :min="10" :show-tooltip="false" :step="10" style="width:136px;" @change="domain.workingTime = (reportTimeType.allday*domain.progress/100).toFixed(1)"></el-slider></el-col>
|
|
|
+ <div style="width:300px;">
|
|
|
+ <el-col span="14"><el-slider :disabled="!canEdit" v-model="domain.progress" :min="10" :show-tooltip="false" :step="10" style="width:180px;" @change="domain.workingTime = (reportTimeType.allday*domain.progress/100).toFixed(1)"></el-slider></el-col>
|
|
|
<el-col span="10"><span style="margin-left:10px;float:right;"><span style="margin-right:10px;">{{domain.progress}}%</span>{{domain.workingTime}}小时</span></el-col>
|
|
|
</div>
|
|
|
- <div class="overtime"><el-checkbox v-model="domain.isOvertime">加班</el-checkbox></div>
|
|
|
+ <div class="overtime"><el-checkbox :disabled="!canEdit" v-model="domain.isOvertime">加班</el-checkbox></div>
|
|
|
</el-form-item>
|
|
|
|
|
|
<!--项目管理专业版模式下,项目下的近期执行的任务 -->
|
|
@@ -233,9 +249,9 @@
|
|
|
<el-input v-model="domain.content" type="textarea" :rows="4" placeholder="请填写工作事项" clearable
|
|
|
:disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-divider v-if="workForm.domains.length>1"></el-divider>
|
|
|
+ <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider>
|
|
|
</div>
|
|
|
- <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain" style="margin-left:40px">添加更多</el-link>
|
|
|
+ <el-link v-if="showAddMore" :disabled="!canEdit" type="primary" :underline="false" @click="addDomain" style="margin-left:40px">添加更多</el-link>
|
|
|
</el-form>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="deleteReport" v-if="workForm.domains[0].id != null">删除</el-button>
|
|
@@ -246,7 +262,7 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 批量日报审核 -->
|
|
|
- <el-dialog title="批量日报审核" :visible.sync="approveDialogVisible" width="500px">
|
|
|
+ <el-dialog title="批量日报审核" :visible.sync="approveDialogVisible" width="500px" >
|
|
|
<el-checkbox v-model="isAllSelect" label="全选" style="margin-left:24px;" @change="selectAll" v-if="reportNames.length > 0"></el-checkbox>
|
|
|
<el-tree ref="approveTree" node-key="id" :data="reportNames" show-checkbox="true" @check-change="handleCheckChange" >
|
|
|
</el-tree>
|
|
@@ -255,7 +271,31 @@
|
|
|
<el-button type="primary" @click="submitBatchApprove" :disabled="batchShowData.length == 0">审核通过</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
-
|
|
|
+ <!--导出报表条件选择 -->
|
|
|
+ <el-dialog title="日报导出" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
|
|
|
+ <el-form ref="form3" :model="exportParam" >
|
|
|
+ <el-form-item prop="projectId" label="选择项目">
|
|
|
+ <el-select v-model="exportParam.projectId" placeholder="全部项目" clearable style="width:350px;">
|
|
|
+ <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="projectId" label="日期范围">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="exportParam.dateRange" :editable="false"
|
|
|
+ format="yyyy-MM-dd" value-format="yyyy-MM-dd"
|
|
|
+ :clearable="true"
|
|
|
+ range-separator="至"
|
|
|
+ type="daterange"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ ></el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="exportReport" style="width:100%;" >导出</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</section>
|
|
|
</template>
|
|
|
|
|
@@ -265,6 +305,8 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ exportParam:{projectId: null, dateRange:[]},
|
|
|
+ exportDialog:false,
|
|
|
timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
|
|
|
subProjectList:[],
|
|
|
canEdit: true,
|
|
@@ -342,6 +384,7 @@
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+
|
|
|
scrollFunction () {
|
|
|
this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
|
|
|
if (this.domObj.attachEvent) { // IE
|
|
@@ -362,6 +405,28 @@
|
|
|
this.domObj.scrollLeft = this.domObj.scrollLeft + step
|
|
|
},
|
|
|
|
|
|
+ // //左右滚动
|
|
|
+ // wheel(e){
|
|
|
+ // var a = document.getElementById("dateScroll");
|
|
|
+ // var scroll_width = 80; //滚动一下的距离
|
|
|
+ // var e = e || window.event, v;
|
|
|
+ // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
|
|
|
+ // if(v>3||-v>3) v=-v;
|
|
|
+ // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
|
|
|
+
|
|
|
+ // e.preventDefault(); //阻止浏览器的默认滚动
|
|
|
+ // },
|
|
|
+
|
|
|
+ showExportDialog() {
|
|
|
+ this.exportDialog = true;
|
|
|
+ },
|
|
|
+ changeAllTime() {
|
|
|
+ //总时长发生改变,自动按比例计算
|
|
|
+ this.workForm.domains.forEach(d=>{
|
|
|
+ d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
// 是否加班的单机事件
|
|
|
check() {
|
|
|
this.selected = !this.selected
|
|
@@ -765,6 +830,7 @@
|
|
|
// 改变月份
|
|
|
changeMonthOut() {
|
|
|
console.log(sessionStorage.msg)
|
|
|
+
|
|
|
this.getAllDate();
|
|
|
this.getReportList();
|
|
|
this.getDepartment();
|
|
@@ -784,6 +850,7 @@
|
|
|
getAllDate() {
|
|
|
var dayArry = [];
|
|
|
var day = this.getCountDays();
|
|
|
+ let curMonthDay = null;
|
|
|
for (var k = 1; k <= day; k++) {
|
|
|
var str = new Date(this.date.replace(/-/g, "/")).getMonth() + 1 + "月" + k + "日";
|
|
|
if ( new Date(this.date.replace(/-/g, "/")).getFullYear() == new Date(new Date()).getFullYear() &&
|
|
@@ -791,20 +858,36 @@
|
|
|
if(sessionStorage.msg) {
|
|
|
if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
|
|
|
this.choseDay = k - 1;
|
|
|
+ curMonthDay = str;
|
|
|
}
|
|
|
} else {
|
|
|
if (new Date().getDate() == k) {
|
|
|
this.choseDay = k - 1;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
} else {
|
|
|
this.choseDay = 0;
|
|
|
}
|
|
|
dayArry.push(str);
|
|
|
}
|
|
|
this.allDate = dayArry;
|
|
|
- if (sessionStorage.msg) {
|
|
|
+ //不能超过最大日期
|
|
|
+ if (this.choseDay > day-1) {
|
|
|
+ this.choseDay = day-1;
|
|
|
+ }
|
|
|
+ //从消息点击跳转过来的,直接加载指定日期
|
|
|
+ if (sessionStorage.from == 1 && sessionStorage.msg) {
|
|
|
+ console.log('sssss');
|
|
|
this.curDate = sessionStorage.msg;
|
|
|
+ sessionStorage.from = 0;
|
|
|
+ } else {
|
|
|
+ if (curMonthDay != null) {
|
|
|
+ this.curDate = curMonthDay;
|
|
|
+ } else {
|
|
|
+ var d = new Date(this.date.replace(/-/g, "/"))
|
|
|
+ this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -853,35 +936,34 @@
|
|
|
|
|
|
//导出日报
|
|
|
exportReport() {
|
|
|
- if (this.reportList.length > 0) {
|
|
|
- this.listLoading = true;
|
|
|
- //首先处理日期
|
|
|
- let day = this.choseDay > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
|
|
|
- this.http.post( this.port.report.export, { date: this.date + day },
|
|
|
- res => {
|
|
|
- this.listLoading = false;
|
|
|
- if (res.code == "ok") {
|
|
|
- location.href = res.data;
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- message: res.msg,
|
|
|
- type: "error"
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- error => {
|
|
|
- this.listLoading = false;
|
|
|
+ this.listLoading = true;
|
|
|
+ var param = {};
|
|
|
+ if (this.exportParam.dateRange != null) {
|
|
|
+ param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
|
|
|
+ }
|
|
|
+ if (this.exportParam.projectId != null) {
|
|
|
+ param.projectId = this.exportParam.projectId;
|
|
|
+ }
|
|
|
+ this.http.post( this.port.report.export, param,
|
|
|
+ res => {
|
|
|
+ this.listLoading = false;
|
|
|
+ if (res.code == "ok") {
|
|
|
+ location.href = res.data;
|
|
|
+ this.exportDialog = false;
|
|
|
+ } else {
|
|
|
this.$message({
|
|
|
- message: error,
|
|
|
+ message: res.msg,
|
|
|
type: "error"
|
|
|
});
|
|
|
- });
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.listLoading = false;
|
|
|
this.$message({
|
|
|
- message: "当天没有报告 无法导出",
|
|
|
- type: "info"
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
});
|
|
|
- }
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
//获取项目列表
|
|
@@ -957,7 +1039,7 @@
|
|
|
projectId: "",
|
|
|
workingTime: this.reportTimeType.type==3?(10*this.reportTimeType.allday/100).toFixed(1):"",
|
|
|
content: "",
|
|
|
- progress:10,
|
|
|
+ progress:100,
|
|
|
state: 2,
|
|
|
timeType:0,
|
|
|
}],
|
|
@@ -994,11 +1076,23 @@
|
|
|
|
|
|
// 添加模块
|
|
|
addDomain() {
|
|
|
+ var leftProgress = 10;
|
|
|
+ if (this.reportTimeType.type == 3) {
|
|
|
+ //计算已经待分配工时比例
|
|
|
+ let array = this.workForm.domains;
|
|
|
+ let totalProgress = 0;
|
|
|
+ for (var i=0;i<array.length; i++) {
|
|
|
+ totalProgress += array[i].progress;
|
|
|
+ }
|
|
|
+ if (totalProgress < 100) {
|
|
|
+ leftProgress = 100 - totalProgress;
|
|
|
+ }
|
|
|
+ }
|
|
|
this.workForm.domains.push({
|
|
|
projectId: "",
|
|
|
- workingTime: this.reportTimeType.type == 3?(10*this.reportTimeType.allday/100).toFixed(1):"",
|
|
|
+ workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):"",
|
|
|
content: "",
|
|
|
- progress:10,
|
|
|
+ progress:leftProgress,
|
|
|
state:2,//2-表示待提交
|
|
|
});
|
|
|
|
|
@@ -1087,6 +1181,12 @@
|
|
|
type: "error"
|
|
|
});
|
|
|
return;
|
|
|
+ } else if (total < 100) {
|
|
|
+ this.$message({
|
|
|
+ message: "工时尚未完全分配,无法提交",
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1300,6 +1400,10 @@
|
|
|
|
|
|
},
|
|
|
mounted() {
|
|
|
+ var now = new Date();
|
|
|
+ var t = util.formatDate.format(now, 'yyyy-MM-dd');
|
|
|
+ var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
|
|
|
+ this.exportParam.dateRange = [startStr,t];
|
|
|
this.getAllDate();
|
|
|
this.getReportList();
|
|
|
this.getProjectList();
|
|
@@ -1316,6 +1420,7 @@
|
|
|
}
|
|
|
.report_title {
|
|
|
padding:10px 0;
|
|
|
+ color:#666;
|
|
|
}
|
|
|
.clearfix {
|
|
|
overflow-x: auto;
|