|
@@ -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"
|
|
@@ -602,11 +602,23 @@
|
|
|
<!-- 按周填报 -->
|
|
|
<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">
|
|
|
- <el-table-column></el-table-column>
|
|
|
+ <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>
|
|
|
- </el-dialog> -->
|
|
|
+ <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>
|
|
@@ -623,7 +635,7 @@
|
|
|
</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.filledTime}}</el-link>
|
|
|
+ <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>
|
|
@@ -1579,7 +1591,15 @@
|
|
|
|
|
|
canCancelInDialog: false,
|
|
|
approveinData: {},
|
|
|
- approveinDialog: false
|
|
|
+ approveinDialog: false,
|
|
|
+ reportCanDelete: false,
|
|
|
+
|
|
|
+ weeklyFilledTimeDialog: false,
|
|
|
+ weeklyFilledTimeList: [],
|
|
|
+ weeklyFilledTimeLoading: false,
|
|
|
+ workReportStateString: ['待审核','已通过','已驳回','待提交'],
|
|
|
+ weeklyFilledTimeCanDelete: false,
|
|
|
+ weeklyFilledTimeDate: null
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -1612,8 +1632,73 @@
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
- weeklyFilledTimeClick(){ //按周填报-已填工时-点击
|
|
|
+ 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(() => {});
|
|
|
},
|
|
|
|
|
|
|
|
@@ -3807,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
|
|
@@ -3849,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,
|
|
@@ -3918,6 +4008,7 @@
|
|
|
// 打开日报填写
|
|
|
fillInReport(i, isBatch) {
|
|
|
this.isWeekend = false
|
|
|
+ this.reportCanDelete = false
|
|
|
// console.log(this.user.timeType.type, '选择时长')
|
|
|
if(i != 1) {
|
|
|
this.falsss = false
|
|
@@ -4340,6 +4431,9 @@
|
|
|
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){
|