1.1删除功能

v1.2.0
‘wangjiuyun 2024-11-06 10:04:43 +08:00
parent 90867530d3
commit c8bb8ef089
2 changed files with 26 additions and 10 deletions

View File

@ -87,6 +87,10 @@ export const workLogApi = {
method: 'put',
data: data,
}),
delLog: (id) => request({
url: `/business/work/hour/${id}`,
method: 'delete',
}),
}

View File

@ -34,6 +34,7 @@
:highligt="true"
ref="projectRef"
style="height: 100%"
rowKey="projectId"
/>
</div>
</div>
@ -107,9 +108,7 @@
disabled: isFutureDate(data.date) && isInProjectRange(data),
}"
>
{{
data.day.split("-")[1] + "/" + data.day.split("-")[2]
}}
{{ data.day.split("-")[1] + "/" + data.day.split("-")[2] }}
</div>
</template>
</el-calendar>
@ -171,6 +170,7 @@
v-if="projectInfo.userId == $store.state.user.id"
>
<el-button @click="logDialogVisible = false">取消</el-button>
<el-button v-if="logForm.loggerId" type="danger" @click="delWorkLog"></el-button>
<el-button type="primary" @click="saveWorkLog"></el-button>
</span>
</template>
@ -313,8 +313,9 @@ export default {
loggerDate: this.logForm.loggerDate,
});
this.logForm.max =
Number(res.data) + (Number(this.logForm.workTime) || 0);
this.logForm.max = (
Number(res.data) + (Number(this.logForm.workTime) || 0)
).toFixed(1);
this.logDialogVisible = true;
this.$nextTick(() => {
this.changeMonth();
@ -412,9 +413,9 @@ export default {
}
this.logDialogVisible = false;
this.$modal.msgSuccess("操作成功");
this.handleProjectClick(this.projectInfo);
const response = await workLogApi.userProject(this.projectInfo.userId);
this.projectList = response.data;
this.handleProjectClick(this.projectInfo);
},
async fetchUserProjects() {
try {
@ -449,6 +450,17 @@ export default {
//
this.fetchUserProjects();
},
//
delWorkLog() {
this.$modal.confirm(`是否确认删日志`).then(async () => {
await workLogApi.delLog(this.logForm.loggerId);
this.$modal.msgSuccess("操作成功");
this.logDialogVisible=false
this.changeMonth();
const response = await workLogApi.userProject(this.projectInfo.userId);
this.projectList = response.data;
});
},
},
watch: {
$route(to, from) {
@ -545,8 +557,8 @@ export default {
color: white; /* 白色文字 */
padding: 5px 0; /* 增加一些内边距 */
}
.project-info-calendar ::v-deep .el-calendar__body th{
height: 60px !important;
.project-info-calendar ::v-deep .el-calendar__body th {
height: 60px !important;
font-weight: bold !important;
font-size: 20px;
}
@ -560,8 +572,8 @@ export default {
.project-info-calendar .calendar-view ::v-deep .el-calendar-day.disabled {
cursor: not-allowed;
}
.project-info-calendar .calendar-view ::v-deep table *{
border: none;
.project-info-calendar .calendar-view ::v-deep table * {
border: none;
}
.project-info-calendar .calendar-view ::v-deep .date-cell {
cursor: pointer;