|
@@ -11,7 +11,7 @@
|
|
|
<el-link type="primary" :underline="false" v-if="user.role != 0" @click="exportReport">导出日报</el-link>
|
|
|
</el-form-item>
|
|
|
<el-form-item style="float:right;">
|
|
|
- <el-link type="primary" :underline="false" @click="fillInReport">填写日报</el-link>
|
|
|
+ <el-link type="primary" :underline="false" @click="fillInReport(-1)">填写日报</el-link>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</el-col>
|
|
@@ -35,11 +35,15 @@
|
|
|
</span>
|
|
|
<el-link v-if="user.role != 0" type="primary" :underline="false" @click="junpToDeskTop(item1.id)">系统智能统计:{{item1.calculateTime}}h</el-link>
|
|
|
<span v-else>系统智能统计:{{item1.calculateTime}}h</span>
|
|
|
+ <span style="margin-left:15px;color:#DAA520;" v-if="item1.state == 0">[ 待审核 ]</span>
|
|
|
+ <span style="margin-left:15px;color:#32CD32;" v-else-if="item1.state == 1">[ 已通过 ]</span>
|
|
|
+ <span style="margin-left:15px;color:#FF0000;" v-else-if="item1.state == 2">[ 已驳回 ]</span>
|
|
|
</span>
|
|
|
<div class="checkbtn">
|
|
|
<el-button v-if="user.role != 0 && item1.state == 0" type="primary" :loading="logining" size="small" @click="approve(item1.id)">通过</el-button>
|
|
|
<el-button v-if="user.role != 0 && item1.state == 0" type="danger" :loading="logining" size="small" @click="deny(item1.id,0)">驳回</el-button>
|
|
|
<el-button v-if="user.role != 0 && item1.state == 1" type="danger" :loading="logining" size="small" @click="deny(item1.id,1)">撤销</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">
|
|
|
<el-timeline>
|
|
@@ -54,7 +58,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 简陋的无报告提示 -->
|
|
|
- <span v-if="reportList.length==0">本日暂无报告</span>
|
|
|
+ <div v-if="reportList.length==0" style="font-size:17px;text-align:center;margin-top:175px;color:#aaa;">本日暂无报告</div>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
</div>
|
|
@@ -64,7 +68,7 @@
|
|
|
<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="选择工作日期"></el-date-picker>
|
|
|
+ @change="changeMonth()" :clearable="false" type="date" placeholder="选择工作日期" :disabled="isDisable"></el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="待分配时长" prop="name">
|
|
|
<span>{{report.time}}h</span>
|
|
@@ -114,7 +118,7 @@
|
|
|
user: JSON.parse(sessionStorage.getItem("user")),
|
|
|
|
|
|
allDate: [],
|
|
|
- date: util.formatDate.format(new Date(new Date()), "yyyy-MM"),
|
|
|
+ date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
|
|
|
choseDay: 0,
|
|
|
|
|
|
tableHeight: 0,
|
|
@@ -126,7 +130,7 @@
|
|
|
dialogVisible: false, //项目弹窗
|
|
|
report: '',
|
|
|
workForm: {
|
|
|
- createDate: util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
|
|
|
+ createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
|
|
|
domains: [{
|
|
|
id: null,
|
|
|
projectId: "",
|
|
@@ -140,6 +144,7 @@
|
|
|
},
|
|
|
|
|
|
logining: false,
|
|
|
+ isDisable: false,
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -152,6 +157,8 @@
|
|
|
// 选择日期
|
|
|
choseDate(i) {
|
|
|
this.choseDay = i;
|
|
|
+ let day = this.choseDay > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
|
|
|
+ sessionStorage.msg = this.date + day,
|
|
|
this.getReportList();
|
|
|
},
|
|
|
|
|
@@ -163,8 +170,14 @@
|
|
|
var str = new Date(this.date.replace(/-/g, "/")).getMonth() + 1 + "月" + k + "日";
|
|
|
if ( new Date(this.date.replace(/-/g, "/")).getFullYear() == new Date(new Date()).getFullYear() &&
|
|
|
new Date(this.date.replace(/-/g, "/")).getMonth() == new Date(new Date()).getMonth()) {
|
|
|
- if (new Date().getDate() == k) {
|
|
|
- this.choseDay = k - 1;
|
|
|
+ if(sessionStorage.msg) {
|
|
|
+ if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
|
|
|
+ this.choseDay = k - 1;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (new Date().getDate() == k) {
|
|
|
+ this.choseDay = k - 1;
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
this.choseDay = 0;
|
|
@@ -267,7 +280,7 @@
|
|
|
},
|
|
|
|
|
|
// 获取个人某天的日报
|
|
|
- getReport() {
|
|
|
+ getReport(i) {
|
|
|
this.http.post( this.port.report.getPort, {
|
|
|
date: this.workForm.createDate
|
|
|
},
|
|
@@ -302,7 +315,6 @@
|
|
|
}],
|
|
|
}
|
|
|
}
|
|
|
- console.log(this.workForm)
|
|
|
} else {
|
|
|
this.$message({
|
|
|
message: res.msg,
|
|
@@ -319,8 +331,16 @@
|
|
|
},
|
|
|
|
|
|
// 打开日报填写
|
|
|
- fillInReport() {
|
|
|
- this.getReport();
|
|
|
+ fillInReport(i) {
|
|
|
+ if(i == -1) {
|
|
|
+ this.isDisable = false;
|
|
|
+ this.workForm.createDate = util.formatDate.format(new Date(new Date()), "yyyy-MM-dd");
|
|
|
+ } else {
|
|
|
+ this.isDisable = true;
|
|
|
+ let day = this.choseDay > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
|
|
|
+ this.workForm.createDate = this.date + day;
|
|
|
+ }
|
|
|
+ this.getReport(i);
|
|
|
this.dialogVisible = true;
|
|
|
},
|
|
|
|