|
@@ -126,16 +126,11 @@
|
|
</span>
|
|
</span>
|
|
<span style="float:right;">
|
|
<span style="float:right;">
|
|
<el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
|
|
<el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
|
|
- <el-link v-if="reportTimeType.type != 0" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
|
|
|
|
<el-link type="primary" v-if="permissions.reportsFillOut" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
|
|
<el-link type="primary" v-if="permissions.reportsFillOut" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
|
|
- <el-link type="primary" v-if="permissions.reportBatch" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
|
|
|
|
- <el-link type="primary" v-if="permissions.importReport || user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="imports()">{{$t('textLink.workHoursImport')}}</el-link>
|
|
|
|
|
|
+ <el-link type="primary" v-if="permissions.reportSettings" style="margin-right:10px;" :underline="false" @click="fillInReport(-1,2)">补报设置</el-link>
|
|
<el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
|
|
<el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
|
|
<!--部门负责人给个导出工时的功能 -->
|
|
<!--部门负责人给个导出工时的功能 -->
|
|
<el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
|
|
<el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
|
|
- <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">推送工时</el-link>
|
|
|
|
- <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
|
|
|
|
-
|
|
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
|
|
<div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
|
|
@@ -2132,8 +2127,8 @@
|
|
this.exportParam.dateRange = [startStr,t];
|
|
this.exportParam.dateRange = [startStr,t];
|
|
this.getAllDate(1);
|
|
this.getAllDate(1);
|
|
// this.getReportList();
|
|
// this.getReportList();
|
|
- this.getProjectList();
|
|
|
|
- this.getFillProjectList();
|
|
|
|
|
|
+
|
|
|
|
+ // this.getFillProjectList();
|
|
// this.getTimeType();
|
|
// this.getTimeType();
|
|
this.getDepartment();
|
|
this.getDepartment();
|
|
this.scrollFunction()
|
|
this.scrollFunction()
|
|
@@ -4315,7 +4310,6 @@
|
|
this.leaveAllNum += 1
|
|
this.leaveAllNum += 1
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- this.stateChange()
|
|
|
|
} else {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
message: res.msg,
|
|
message: res.msg,
|
|
@@ -4737,62 +4731,34 @@
|
|
},
|
|
},
|
|
|
|
|
|
//获取项目列表
|
|
//获取项目列表
|
|
- getProjectList() {
|
|
|
|
- this.listLoading = true;
|
|
|
|
- this.http.post( this.port.project.list, {},
|
|
|
|
- res => {
|
|
|
|
- this.listLoading = false;
|
|
|
|
- if (res.code == "ok") {
|
|
|
|
- for(var i in res.data) {
|
|
|
|
- if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
|
|
|
|
- res.data[i].projectCode = ''
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- this.projectList = res.data;
|
|
|
|
-
|
|
|
|
- // console.log("项目列表",this.projectList);
|
|
|
|
- } else {
|
|
|
|
- this.$message({
|
|
|
|
- message: res.msg,
|
|
|
|
- type: "error"
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- error => {
|
|
|
|
- this.listLoading = false;
|
|
|
|
- this.$message({
|
|
|
|
- message: error,
|
|
|
|
- type: "error"
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
|
|
+
|
|
// 获取填报日报的项目下拉列表
|
|
// 获取填报日报的项目下拉列表
|
|
- getFillProjectList() {
|
|
|
|
- this.http.post( this.port.project.list, {
|
|
|
|
- forReport: 1
|
|
|
|
- },res => {
|
|
|
|
- if (res.code == "ok") {
|
|
|
|
- for(var i in res.data) {
|
|
|
|
- if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
|
|
|
|
- res.data[i].projectCode = ''
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- this.fillProjectList = res.data;
|
|
|
|
- this.getRecentlyProject()
|
|
|
|
- } else {
|
|
|
|
- this.$message({
|
|
|
|
- message: res.msg,
|
|
|
|
- type: "error"
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- error => {
|
|
|
|
- this.$message({
|
|
|
|
- message: error,
|
|
|
|
- type: "error"
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
|
|
+ // getFillProjectList() {
|
|
|
|
+ // this.http.post( this.port.project.list, {
|
|
|
|
+ // forReport: 1
|
|
|
|
+ // },res => {
|
|
|
|
+ // if (res.code == "ok") {
|
|
|
|
+ // for(var i in res.data) {
|
|
|
|
+ // if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
|
|
|
|
+ // res.data[i].projectCode = ''
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // this.fillProjectList = res.data;
|
|
|
|
+ // this.getRecentlyProject()
|
|
|
|
+ // } else {
|
|
|
|
+ // this.$message({
|
|
|
|
+ // message: res.msg,
|
|
|
|
+ // type: "error"
|
|
|
|
+ // });
|
|
|
|
+ // }
|
|
|
|
+ // },
|
|
|
|
+ // error => {
|
|
|
|
+ // this.$message({
|
|
|
|
+ // message: error,
|
|
|
|
+ // type: "error"
|
|
|
|
+ // });
|
|
|
|
+ // });
|
|
|
|
+ // },
|
|
|
|
|
|
getAIReport(createDate) {
|
|
getAIReport(createDate) {
|
|
this.http.post('/report/getAIReport', {},
|
|
this.http.post('/report/getAIReport', {},
|
|
@@ -5113,209 +5079,6 @@
|
|
this.dialogVisible = true;
|
|
this.dialogVisible = true;
|
|
|
|
|
|
},
|
|
},
|
|
- // 按周填报里内容的填写
|
|
|
|
- tianxies(item, i, names, row) {
|
|
|
|
- if (item.state == 0) {
|
|
|
|
- this.$message({
|
|
|
|
- message: '待审核状态不可修改,请返回到查看日报中先撤回',
|
|
|
|
- type: "error"
|
|
|
|
- });
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- if (item.state == 1) {
|
|
|
|
- this.$message({
|
|
|
|
- message: '已通过状态不可修改',
|
|
|
|
- type: "error"
|
|
|
|
- });
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(this.user.timeType.notAllowedNoAttendance == 1){
|
|
|
|
- if(this.zhoData[i].corpTime){
|
|
|
|
- if(this.zhoData[i].corpTime.workHours == 0){
|
|
|
|
- this.$message({
|
|
|
|
- message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
|
|
|
|
- type: 'error'
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- this.$message({
|
|
|
|
- message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
|
|
|
|
- type: 'error'
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- var idd = ''
|
|
|
|
- var obj = {}
|
|
|
|
- for(var l in this.projectList) {
|
|
|
|
- if(this.projectList[l].projectName == names) idd = this.projectList[l].id
|
|
|
|
- }
|
|
|
|
- obj.projectId = idd
|
|
|
|
- this.selectProject(obj, 0)
|
|
|
|
- // console.log(this.workForm.domains[0], '打印出来的')
|
|
|
|
- this.tianxieDialogVisible = true
|
|
|
|
- this.scopess = item
|
|
|
|
- var sss = {}
|
|
|
|
- if (item.id != null) {
|
|
|
|
- sss.id = item.id;
|
|
|
|
- sss.state = item.state;
|
|
|
|
- } else {
|
|
|
|
- sss.id = -1;
|
|
|
|
- sss.state = 3;
|
|
|
|
- }
|
|
|
|
- sss.projectId = idd;
|
|
|
|
- sss.con = item.con
|
|
|
|
- sss.progress = item.progress
|
|
|
|
- sss.time = item.time
|
|
|
|
- if (sss.time == '' && this.reportTimeType.type == 2) {
|
|
|
|
- //取已填时间范围中最大的一个作为开始时间
|
|
|
|
- var startTime = '09:00';
|
|
|
|
- var fillStartTime = '00:00';
|
|
|
|
- for (var t in this.selProjectList) {
|
|
|
|
- var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
|
|
|
|
- if (fillItem.time) {
|
|
|
|
- if (fillItem.time[1] > fillStartTime) {
|
|
|
|
- fillStartTime = fillItem.time[1];
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (fillStartTime == '00:00') {
|
|
|
|
- fillStartTime = '09:00';
|
|
|
|
- }
|
|
|
|
- var fillEndMax = '18:00';
|
|
|
|
- if (fillStartTime >= '18:00') {
|
|
|
|
- fillEndMax = '23:59';
|
|
|
|
- }
|
|
|
|
- sss.time = [fillStartTime, fillEndMax];
|
|
|
|
- }
|
|
|
|
- sss.groupId = item.groupId
|
|
|
|
- sss.stage = item.stage;
|
|
|
|
- sss.workingTime = item.workingTime
|
|
|
|
- sss.projectAuditorId = item.projectAuditorId;
|
|
|
|
- if (this.timeBasecostList && this.timeBasecostList.length > 0) {
|
|
|
|
- //默认选中第一个
|
|
|
|
- sss.basecostId = this.timeBasecostList[0].id;
|
|
|
|
- }
|
|
|
|
- var that = this
|
|
|
|
- setTimeout(() =>{
|
|
|
|
- var isFirstEdit = false;
|
|
|
|
- if(Object.keys(item).length < 5) {
|
|
|
|
- //首次点开当前的这个cell,初始化数据
|
|
|
|
- isFirstEdit = true;
|
|
|
|
- sss.subProjectId = that.workForm.domains[0].subProjectId
|
|
|
|
- sss.stage = that.workForm.domains[0].stage
|
|
|
|
- sss.subProjectList = that.workForm.domains[0].subProjectList
|
|
|
|
- sss.stages = that.workForm.domains[0].stages
|
|
|
|
- sss.taskGroups = that.workForm.domains[0].taskGroups;
|
|
|
|
- sss.auditUserList = obj.auditUserList;
|
|
|
|
- } else {
|
|
|
|
- sss.subProjectId = item.subProjectId
|
|
|
|
- sss.stage = item.stage
|
|
|
|
- sss.subProjectList = item.subProjectList
|
|
|
|
- sss.stages = item.stages
|
|
|
|
- sss.taskGroups = item.taskGroups;
|
|
|
|
- sss.auditUserList = obj.auditUserList;
|
|
|
|
- sss.degreeId = item.degreeId;
|
|
|
|
- sss.customData = item.customData;
|
|
|
|
- }
|
|
|
|
- if (sss.auditUserList != null && sss.auditUserList.length==1) {
|
|
|
|
- //只有一个审核人,自动设置上去
|
|
|
|
- sss.projectAuditorId = sss.auditUserList[0].auditorId;
|
|
|
|
- }
|
|
|
|
- sss.wuduList = row[0].wuduList
|
|
|
|
- // console.log(sss, '数据')
|
|
|
|
- that.zhoBaoIdx = i
|
|
|
|
- that.zhoBaoName = names
|
|
|
|
- that.zhoBao = sss
|
|
|
|
- that.zhis = row
|
|
|
|
- if (sss.groupId) {
|
|
|
|
- //最后一个参数表示是否保留stage的值,不要重置为空
|
|
|
|
- this.getGroupStages(that.zhoBao, 0, !isFirstEdit)
|
|
|
|
- }
|
|
|
|
- that.$forceUpdate();
|
|
|
|
- },600);
|
|
|
|
- },
|
|
|
|
- // 按周填报里内容的填写点击确定
|
|
|
|
- setWeekProItemData() {
|
|
|
|
- //检查子项目是否必填
|
|
|
|
- if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
|
|
|
|
- this.$message({
|
|
|
|
- message: '子项目必填,请检查',
|
|
|
|
- type: "error"
|
|
|
|
- });
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
|
|
|
|
- this.$message({
|
|
|
|
- message: this.$t('message.Pleaseselectareviewer'),
|
|
|
|
- type: "error"
|
|
|
|
- });
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- if(this.user.timeType.reportAuditType == 3){
|
|
|
|
- let auditTips = ''
|
|
|
|
- if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
|
|
|
|
- // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
|
|
|
|
- // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
|
|
|
|
- if(auditTips){
|
|
|
|
- auditTips = auditTips.substring(0,auditTips.length - 1)
|
|
|
|
- this.$message({
|
|
|
|
- message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
|
|
|
|
- type: 'error'
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- let errtips = ''
|
|
|
|
- if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0 && !this.zhoBao.degreeId) {
|
|
|
|
- errtips += this.user.timeType.customDegreeName + '、'
|
|
|
|
- }
|
|
|
|
- if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
|
|
|
|
- errtips += this.user.timeType.customDataName + '、'
|
|
|
|
- }
|
|
|
|
- if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
|
|
|
|
- errtips += this.user.timeType.customTextName + '、'
|
|
|
|
- }
|
|
|
|
- if(this.user.timeType.workContentState == 1 && !this.zhoBao.con){
|
|
|
|
- errtips += this.user.companyId==781?this.$t('other.specificcontentandresults')+'、': this.$t('other.workMatters') +'、'
|
|
|
|
- }
|
|
|
|
- if(errtips){
|
|
|
|
- errtips = errtips.substring(0,errtips.length - 1)
|
|
|
|
- this.$message({
|
|
|
|
- message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
|
|
|
|
- type: 'error'
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- this.tianxieDialogVisible = false
|
|
|
|
- var zhong = this.zhoData
|
|
|
|
- zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
|
|
|
|
- this.zhoData = zhong
|
|
|
|
- if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
|
|
|
|
- if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
|
|
|
|
- if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
|
|
|
|
- },
|
|
|
|
- // 获取本周
|
|
|
|
- getCurrentWeek() {
|
|
|
|
- //今天
|
|
|
|
- this.targetWeekDate = new Date();
|
|
|
|
- this.initWeekFormData();
|
|
|
|
- // this.jiazai()
|
|
|
|
- },
|
|
|
|
- // 获取上周
|
|
|
|
- handleGetPrevWeek() {
|
|
|
|
- this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
|
|
|
|
- this.initWeekFormData();
|
|
|
|
- // this.jiazai()
|
|
|
|
- },
|
|
|
|
- // 获取下周
|
|
|
|
- handleGetNextvWeek() {
|
|
|
|
- this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
|
|
|
|
- this.initWeekFormData()
|
|
|
|
- },
|
|
|
|
|
|
|
|
// 加载动画
|
|
// 加载动画
|
|
jiazai() {
|
|
jiazai() {
|
|
@@ -5333,117 +5096,6 @@
|
|
const d = (dt.getDate() + '').padStart(2, '0')
|
|
const d = (dt.getDate() + '').padStart(2, '0')
|
|
return `${y}-${m}-${d}`
|
|
return `${y}-${m}-${d}`
|
|
},
|
|
},
|
|
- // 按周填报
|
|
|
|
- fillInReportss() {
|
|
|
|
- window.addEventListener('scroll', this.handleScroll, true)
|
|
|
|
- // this.jiazai()
|
|
|
|
- this.fillWeekDialogVisi = true
|
|
|
|
- this.getCurrentWeek();
|
|
|
|
- if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
|
|
|
|
- //重新获取工时预警类型的预算项
|
|
|
|
- this.http.post('/project-basecost-setting/getReportBasecostList', {
|
|
|
|
- companyId: this.user.companyId
|
|
|
|
- },
|
|
|
|
- res => {
|
|
|
|
- if (res.code == "ok") {
|
|
|
|
- this.timeBasecostList = res.data;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- // 按周填报的项目筛选
|
|
|
|
- selListFun(){
|
|
|
|
- this.selProjectList = []
|
|
|
|
- if(this.selCon.length){
|
|
|
|
- for (let i = 0; i < this.selCon.length; i++) {
|
|
|
|
- this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
|
|
|
|
- }
|
|
|
|
- this.selConShow = false ;
|
|
|
|
- for (let i in this.zhoData) {
|
|
|
|
- var obj = this.zhoData[i];
|
|
|
|
- for(var j in this.selProjectList) {
|
|
|
|
- var xinzhi = this.selProjectList[j].projectName
|
|
|
|
- obj[xinzhi] = {}
|
|
|
|
- obj[xinzhi].time = ''
|
|
|
|
- obj[xinzhi].con = ''
|
|
|
|
- obj[xinzhi].progress = 0
|
|
|
|
- obj[xinzhi].workingTime = 0
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- this.initWeekFormData();
|
|
|
|
- }else{
|
|
|
|
- this.$message({
|
|
|
|
- message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
|
|
|
|
- type:'error'
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- setWeekCardTimeData(list) {
|
|
|
|
- for(let i in list){
|
|
|
|
- let datei = '';
|
|
|
|
- if (this.user.timeType.showDdCardtime == 1) {
|
|
|
|
- datei = list[i].workDate;
|
|
|
|
- } else if (this.user.timeType.showCorpwxCardtime == 1) {
|
|
|
|
- datei = list[i].createDate;
|
|
|
|
- } else if (this.user.timeType.syncFanwei == 1) {
|
|
|
|
- datei = list[i].workDate;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- for(let m in this.zhoData) {
|
|
|
|
- if(datei == this.zhoData[m].zhoDataTime){
|
|
|
|
- let item = {
|
|
|
|
- startTime: list[i].startTime,
|
|
|
|
- endTime: list[i].endTime,
|
|
|
|
- workHours: list[i].workHours
|
|
|
|
- }
|
|
|
|
- this.$set(this.zhoData[m],'corpTime',item)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- getWeeklyCardTime(){ //按周填报获取考勤信息
|
|
|
|
- let dateStr = []
|
|
|
|
- for(let i in this.zhoData){
|
|
|
|
- dateStr.push(this.zhoData[i].zhoDataTime)
|
|
|
|
- }
|
|
|
|
- this.http.post('/report/getWeeklyCardTime',{
|
|
|
|
- dateStr: JSON.stringify(dateStr)
|
|
|
|
- },res => {
|
|
|
|
- if(res.code == 'ok'){
|
|
|
|
- for(let i in res.data){
|
|
|
|
- let datei = '';
|
|
|
|
- if (this.user.timeType.showDdCardtime == 1) {
|
|
|
|
- datei = res.data[i].workDate.split('-');
|
|
|
|
- } else if (this.user.timeType.showCorpwxCardtime == 1) {
|
|
|
|
- datei = res.data[i].createDate.split('-');
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- for(let m in this.zhoData){
|
|
|
|
- let datem = new Date(this.zhoData[m].zhoDataTime)
|
|
|
|
-
|
|
|
|
- if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
|
|
|
|
- let item = {
|
|
|
|
- startTime: res.data[i].startTime,
|
|
|
|
- endTime: res.data[i].endTime,
|
|
|
|
- workHours: res.data[i].workHours
|
|
|
|
- }
|
|
|
|
- this.$set(this.zhoData[m],'corpTime',item)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- this.$message({
|
|
|
|
- message: res.msg,
|
|
|
|
- type: 'error'
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- },err => {
|
|
|
|
- this.$message({
|
|
|
|
- message: err,
|
|
|
|
- type: 'error'
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
|
|
|
|
selListqx(){
|
|
selListqx(){
|
|
this.fillWeekDialogVisi = false
|
|
this.fillWeekDialogVisi = false
|
|
@@ -5453,64 +5105,7 @@
|
|
handleScroll() {
|
|
handleScroll() {
|
|
this.changdu = this.projectList.length + 1
|
|
this.changdu = this.projectList.length + 1
|
|
},
|
|
},
|
|
- // 自动选择时间点的事件
|
|
|
|
- // async zhoTimes(item, i) {
|
|
|
|
- // var iss = i
|
|
|
|
- // if(item.time == null) {
|
|
|
|
- // return
|
|
|
|
- // } else {
|
|
|
|
- // const zhi = this.zhoData[iss];
|
|
|
|
- // let he = 0;
|
|
|
|
- // const timeArr = Object.values(zhi)
|
|
|
|
- // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
|
|
|
|
- // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
|
|
|
|
- // const data = await this.getWeekHoursByTimeRange(timeArr);
|
|
|
|
- // console.log(data, 'data');
|
|
|
|
- // zhi.he = `${he}h`;
|
|
|
|
-
|
|
|
|
- // }
|
|
|
|
- // },
|
|
|
|
- async zhoTimes(item, index) {
|
|
|
|
- const zho = this.zhoData[index];
|
|
|
|
- if (!item.time) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- const timeArr = Object.values(zho)
|
|
|
|
- .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
|
|
|
|
- .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
|
|
|
|
- const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
|
|
|
|
- zho.he = `${totalHours[0]}h`;
|
|
|
|
- },
|
|
|
|
- // 判断两个时间段是否重叠
|
|
|
|
- timeOverlap(idx, dateAr) {
|
|
|
|
- let zhi = 0
|
|
|
|
- for (let k in dateAr) {
|
|
|
|
- if (idx !== k) {
|
|
|
|
- if (((dateAr[k].s <= dateAr[idx].s && dateAr[k].e >= dateAr[idx].s) || (dateAr[k].s <= dateAr[idx].s && dateAr[k].e <= dateAr[idx].e))) {
|
|
|
|
- // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
|
|
|
|
- if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
|
|
|
|
- zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
|
|
|
|
- }
|
|
|
|
- // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
|
|
|
|
- if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
|
|
|
|
- zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
|
|
|
|
- } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
|
|
|
|
- zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
|
|
|
|
- } else {
|
|
|
|
- // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
|
|
|
|
- if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
|
|
|
|
- zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
|
|
|
|
- }
|
|
|
|
- // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
|
|
|
|
- if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
|
|
|
|
- zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return zhi
|
|
|
|
- },
|
|
|
|
|
|
+
|
|
// 计算时间
|
|
// 计算时间
|
|
getHourMinutes(str, end) {
|
|
getHourMinutes(str, end) {
|
|
var he = 0
|
|
var he = 0
|