|
@@ -601,9 +601,9 @@
|
|
|
|
|
|
<!-- 按周填报 -->
|
|
<!-- 按周填报 -->
|
|
<el-dialog title="按周填报" :visible.sync="diasZho" width="60%" :close-on-click-modal="false" @closed="guanbi(),zhoAddqx()">
|
|
<el-dialog title="按周填报" :visible.sync="diasZho" width="60%" :close-on-click-modal="false" @closed="guanbi(),zhoAddqx()">
|
|
- <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!selConShow">
|
|
|
|
|
|
+ <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!selConShow">
|
|
<el-form-item label="工作日期" prop="createDate">
|
|
<el-form-item label="工作日期" prop="createDate">
|
|
- <el-date-picker v-model="zhoRqi" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="zhoRqis()" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="margin-right: 18px"></el-date-picker>
|
|
|
|
|
|
+ <el-date-picker v-model="zhoRqi" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="zhoRqis()" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="margin-right: 18px" :clearable="false"></el-date-picker>
|
|
<el-button @click="handleGetPrevWeek()">上一周</el-button>
|
|
<el-button @click="handleGetPrevWeek()">上一周</el-button>
|
|
<el-button @click="handleGetNextvWeek()">下一周</el-button>
|
|
<el-button @click="handleGetNextvWeek()">下一周</el-button>
|
|
<el-button @click="getCurrentWeek()">本周</el-button>
|
|
<el-button @click="getCurrentWeek()">本周</el-button>
|
|
@@ -630,6 +630,12 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
+ <el-table-column fixed="right" label="考勤打卡" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours + 'h'}}</span>
|
|
|
|
+ <span v-else>暂无考勤记录</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
<el-table-column fixed="right" prop="he" label="合计(h)" width="120">
|
|
<el-table-column fixed="right" prop="he" label="合计(h)" width="120">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<div class="zhiss">
|
|
<div class="zhiss">
|
|
@@ -3929,7 +3935,6 @@
|
|
},
|
|
},
|
|
// 按周填报里内容的填写
|
|
// 按周填报里内容的填写
|
|
tianxies(item, i, names, row) {
|
|
tianxies(item, i, names, row) {
|
|
- // console.log(item, i, names, row, '你好')
|
|
|
|
var idd = ''
|
|
var idd = ''
|
|
var obj = {}
|
|
var obj = {}
|
|
for(var l in this.projectList) {
|
|
for(var l in this.projectList) {
|
|
@@ -4024,6 +4029,8 @@
|
|
type: 'warning'
|
|
type: 'warning'
|
|
})
|
|
})
|
|
}else {
|
|
}else {
|
|
|
|
+
|
|
|
|
+
|
|
this.tianxieDialogVisible = false
|
|
this.tianxieDialogVisible = false
|
|
var zhong = this.zhoData
|
|
var zhong = this.zhoData
|
|
zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
|
|
zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
|
|
@@ -4164,6 +4171,7 @@
|
|
obj[xinzhi].workingTime = 0
|
|
obj[xinzhi].workingTime = 0
|
|
}
|
|
}
|
|
this.zhoData.push(obj)
|
|
this.zhoData.push(obj)
|
|
|
|
+ this.getWeeklyCardTime()
|
|
},
|
|
},
|
|
// 减去时间
|
|
// 减去时间
|
|
dateChange(num = 1,date = false) {
|
|
dateChange(num = 1,date = false) {
|
|
@@ -4230,7 +4238,6 @@
|
|
for (let i = 0; i < this.selCon.length; i++) {
|
|
for (let i = 0; i < this.selCon.length; i++) {
|
|
this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
|
|
this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
|
|
}
|
|
}
|
|
- // console.log("已筛选列表",this.selProjectList);
|
|
|
|
this.selConShow = false
|
|
this.selConShow = false
|
|
}else{
|
|
}else{
|
|
this.$message({
|
|
this.$message({
|
|
@@ -4239,6 +4246,43 @@
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ 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){
|
|
|
|
+ for(let m in this.zhoData){
|
|
|
|
+ let datem = new Date(this.zhoData[m].zhoDataTime)
|
|
|
|
+ let datei = res.data[i].workDate
|
|
|
|
+ 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)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ console.log('can can need',this.zhoData);
|
|
|
|
+ }else{
|
|
|
|
+ this.$message({
|
|
|
|
+ message: res.msg,
|
|
|
|
+ type: 'error'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },err => {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: err,
|
|
|
|
+ type: 'error'
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
selListqx(){
|
|
selListqx(){
|
|
this.diasZho = false
|
|
this.diasZho = false
|
|
this.selProjectList = []
|
|
this.selProjectList = []
|
|
@@ -4344,6 +4388,9 @@
|
|
}
|
|
}
|
|
this.zhoData = arrst
|
|
this.zhoData = arrst
|
|
}
|
|
}
|
|
|
|
+ if(this.zhoData.length && (this.user.timeType.showDdCardtime == 1 || this.user.timeType.showCorpwxCardtime == 1)){
|
|
|
|
+ this.getWeeklyCardTime()
|
|
|
|
+ }
|
|
},
|
|
},
|
|
zhoZhi(res, i) {
|
|
zhoZhi(res, i) {
|
|
var zhi = 0
|
|
var zhi = 0
|
|
@@ -4423,6 +4470,20 @@
|
|
})
|
|
})
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
|
|
+ let overcorp = ''
|
|
|
|
+ for(let n in zhi){
|
|
|
|
+ if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
|
|
|
|
+ overcorp += zhi[n].zhoDataTime + ','
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(overcorp != ''){
|
|
|
|
+ overcorp = overcorp.substring(0,overcorp.length - 1)
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '日期[' + overcorp + ']填报工时之和不能超过考勤总工时',
|
|
|
|
+ type: 'error'
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
var submits = []
|
|
var submits = []
|