1.1删除功能
parent
90867530d3
commit
c8bb8ef089
|
@ -87,6 +87,10 @@ export const workLogApi = {
|
|||
method: 'put',
|
||||
data: data,
|
||||
}),
|
||||
delLog: (id) => request({
|
||||
url: `/business/work/hour/${id}`,
|
||||
method: 'delete',
|
||||
}),
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue