|
@@ -591,7 +591,7 @@
|
|
|
</el-form>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">撤回</el-button>
|
|
|
- <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit">删除</el-button>
|
|
|
+ <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">删除</el-button>
|
|
|
<el-button @click="dialogVisible = false">取消</el-button>
|
|
|
<el-button v-if="!isSubstitude" @click="submitReport(1)" :loading="submitingReport" :disabled="workForm.domains.length==0?true:(canEdit?false:true)">暂存</el-button>
|
|
|
<el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
|
|
@@ -601,6 +601,24 @@
|
|
|
|
|
|
<!-- 按周填报 -->
|
|
|
<el-dialog title="按周填报" :visible.sync="diasZho" width="60%" :close-on-click-modal="false" @closed="guanbi(),zhoAddqx()">
|
|
|
+ <!-- 按周填报-已填工时-点击 -->
|
|
|
+ <el-dialog append-to-body title="已填日报" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
|
|
|
+ <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
|
|
|
+ <el-table-column prop="project" label="项目名称"></el-table-column>
|
|
|
+ <el-table-column prop="time" label="工时(h)"></el-table-column>
|
|
|
+ <el-table-column prop="state" label="状态">
|
|
|
+ <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column label="操作">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column> -->
|
|
|
+ </el-table>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">删除</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
<el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!selConShow">
|
|
|
<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" :clearable="false"></el-date-picker>
|
|
@@ -615,6 +633,12 @@
|
|
|
{{scope.row.zhoDataTime}}({{scope.row.zhoDataTime | zhoData}})
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column fixed="left" label="已填工时(h)" width="100" prop="filledTime" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
|
|
|
+ <p v-else></p>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<!-- <el-table-column align="center" v-for="(item, index) in projectList" :key="item.id" :label="item.projectName" width="200"> -->
|
|
|
<el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="200">
|
|
|
<template slot-scope="scope">
|
|
@@ -636,10 +660,11 @@
|
|
|
<span v-else>暂无考勤记录</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+
|
|
|
<el-table-column fixed="right" prop="he" label="合计(h)" width="120">
|
|
|
<template slot-scope="scope">
|
|
|
<div class="zhiss">
|
|
|
- <p>{{scope.row.he}}</p>
|
|
|
+ <p>{{scope.row.filledTime ? scope.row.he*1 + scope.row.filledTime*1 : scope.row.he}}</p>
|
|
|
<el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -647,6 +672,8 @@
|
|
|
</el-table>
|
|
|
</el-form>
|
|
|
|
|
|
+
|
|
|
+
|
|
|
|
|
|
<!-- 按周填报项目筛选 -->
|
|
|
<div v-if="selConShow" class="selConStyle">
|
|
@@ -666,9 +693,6 @@
|
|
|
<el-button type="primary" @click="selListFun()">下一步</el-button>
|
|
|
<!-- :loading="submitingReport" -->
|
|
|
</span>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
<span slot="footer" class="dialog-footer" v-if="!selConShow">
|
|
|
<el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">选择项目</el-button>
|
|
|
<el-button @click="zhoAddqx()">取 消</el-button>
|
|
@@ -1567,7 +1591,15 @@
|
|
|
|
|
|
canCancelInDialog: false,
|
|
|
approveinData: {},
|
|
|
- approveinDialog: false
|
|
|
+ approveinDialog: false,
|
|
|
+ reportCanDelete: false,
|
|
|
+
|
|
|
+ weeklyFilledTimeDialog: false,
|
|
|
+ weeklyFilledTimeList: [],
|
|
|
+ weeklyFilledTimeLoading: false,
|
|
|
+ workReportStateString: ['待审核','已通过','已驳回','待提交'],
|
|
|
+ weeklyFilledTimeCanDelete: false,
|
|
|
+ weeklyFilledTimeDate: null
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -1600,6 +1632,77 @@
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
+ weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
|
|
|
+ this.weeklyFilledTimeDialog = true
|
|
|
+ this.weeklyFilledTimeLoading = true
|
|
|
+ this.weeklyFilledTimeDate = parameterDate
|
|
|
+ this.http.post('/report/getReportList',{
|
|
|
+ date: parameterDate,
|
|
|
+ userId: this.user.id
|
|
|
+ },res => {
|
|
|
+ this.weeklyFilledTimeLoading = false
|
|
|
+ if(res.code == 'ok'){
|
|
|
+ this.weeklyFilledTimeList = res.data[0].data
|
|
|
+ let candelete = true
|
|
|
+ for(let i in this.weeklyFilledTimeList){
|
|
|
+ if(this.weeklyFilledTimeList[i].state < 2){
|
|
|
+ candelete = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.weeklyFilledTimeCanDelete = candelete
|
|
|
+ }else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },err => {
|
|
|
+ this.weeklyFilledTimeLoading = false
|
|
|
+ this.$message({
|
|
|
+ message: err,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
|
|
|
+ this.$confirm("确定要删除该日报吗?","提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.http.post('/report/delete',{
|
|
|
+ userId: this.user.id,
|
|
|
+ date: this.weeklyFilledTimeDate
|
|
|
+ },res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.$message({
|
|
|
+ message: "删除成功",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ this.getWeeklyWorkTime()
|
|
|
+ this.getReportList();
|
|
|
+ this.getDepartment();
|
|
|
+ this.weeklyFilledTimeDialog = false;
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
getApprovalProcess(item){
|
|
|
// console.log('this.date',this.choseDate);
|
|
|
this.http.post('/report-log/get',{
|
|
@@ -3789,6 +3892,7 @@
|
|
|
if(list.report.length != 0) {
|
|
|
var arr = [];
|
|
|
this.canEdit = false;
|
|
|
+ let candelete = true
|
|
|
for(var i in list.report) {
|
|
|
var flg = null
|
|
|
list.report[i].isOvertime == 1 ? flg = true : flg = false
|
|
@@ -3831,10 +3935,14 @@
|
|
|
if (list.report[i].state >= 2) {
|
|
|
this.canEdit = true;
|
|
|
}
|
|
|
+ if(list.report[i].state < 2){
|
|
|
+ candelete = false
|
|
|
+ }
|
|
|
if (list.report[i].state == 0){
|
|
|
this.canCancelInDialog = true
|
|
|
}
|
|
|
}
|
|
|
+ this.reportCanDelete = candelete
|
|
|
this.workForm = {
|
|
|
createDate: this.workForm.createDate,
|
|
|
domains: arr,
|
|
@@ -3900,6 +4008,7 @@
|
|
|
// 打开日报填写
|
|
|
fillInReport(i, isBatch) {
|
|
|
this.isWeekend = false
|
|
|
+ this.reportCanDelete = false
|
|
|
// console.log(this.user.timeType.type, '选择时长')
|
|
|
if(i != 1) {
|
|
|
this.falsss = false
|
|
@@ -4192,7 +4301,9 @@
|
|
|
obj[xinzhi].workingTime = 0
|
|
|
}
|
|
|
this.zhoData.push(obj)
|
|
|
- this.getWeeklyCardTime();
|
|
|
+ if(this.user.timeType.showDdCardtime == 1 || this.user.timeType.showCorpwxCardtime == 1){
|
|
|
+ this.getWeeklyCardTime();
|
|
|
+ }
|
|
|
this.getWeeklyWorkTime();
|
|
|
},
|
|
|
// 减去时间
|
|
@@ -4268,7 +4379,7 @@
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- getWeeklyCardTime(){
|
|
|
+ getWeeklyCardTime(){ //按周填报获取考勤信息
|
|
|
let dateStr = []
|
|
|
for(let i in this.zhoData){
|
|
|
dateStr.push(this.zhoData[i].zhoDataTime)
|
|
@@ -4298,7 +4409,6 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- console.log('can can need',this.zhoData);
|
|
|
}else{
|
|
|
this.$message({
|
|
|
message: res.msg,
|
|
@@ -4312,7 +4422,7 @@
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- getWeeklyWorkTime(){
|
|
|
+ getWeeklyWorkTime(){ //按周填报获取已填工时
|
|
|
let dateStr = []
|
|
|
for(let i in this.zhoData){
|
|
|
dateStr.push(this.zhoData[i].zhoDataTime)
|
|
@@ -4321,9 +4431,19 @@
|
|
|
dateStr: JSON.stringify(dateStr)
|
|
|
},res => {
|
|
|
if(res.code == 'ok'){
|
|
|
+ for(let n in this.zhoData){
|
|
|
+ delete this.zhoData[n].filledTime
|
|
|
+ }
|
|
|
for(let i in res.data){
|
|
|
-
|
|
|
+ let 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()){
|
|
|
+ this.$set(this.zhoData[m],'filledTime',res.data[i].workingTime)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+ console.log('zhodata',this.zhoData);
|
|
|
}else{
|
|
|
this.$message({
|
|
|
message: res.msg,
|
|
@@ -4444,6 +4564,7 @@
|
|
|
}
|
|
|
if(this.zhoData.length && (this.user.timeType.showDdCardtime == 1 || this.user.timeType.showCorpwxCardtime == 1)){
|
|
|
this.getWeeklyCardTime()
|
|
|
+ // this.getWeeklyFilledTime()
|
|
|
}
|
|
|
if (this.zhoData.length) {
|
|
|
this.getWeeklyWorkTime();
|