fix:日志提交时若无结束时间,则获取服务器当前时间,更新后再提交日志

This commit is contained in:
shijing 2025-09-11 15:23:10 +08:00
parent 3d53796fa5
commit 6981147670
2 changed files with 14 additions and 6 deletions

View File

@ -96,4 +96,10 @@ export default {
}, },
}, },
}, },
servertime: {
name: "获取服务器时间",
req: async function () {
return await http.get(`${config.API_URL}/develop/server_time/`);
},
}
}; };

View File

@ -933,13 +933,15 @@ export default {
mlogSubmit() { mlogSubmit() {
let that = this; let that = this;
that.isSaveing = true; that.isSaveing = true;
let obj = {};
if(that.mlogItem.work_end_time==''||that.mlogItem.work_end_time==null){ if(that.mlogItem.work_end_time==''||that.mlogItem.work_end_time==null){
obj.work_end_time = that.mlogItem.work_end_time = that.$TOOL.dateFormat1(new Date()); that.$API.bi.servertime.req().then((res) => {
obj.handle_date = that.mlogItem.handle_date = that.$TOOL.dateFormat2(new Date()); let obj = {};
that.$API.wpm.mlog.change.req(that.mlogItem.id, obj).then((res) => { obj.work_end_time = res.server_time;
that.submitMlog(); obj.handle_date = this.$TOOL.dateFormat2(new Date());
}); that.$API.wpm.mlog.change.req(that.mlogItem.id, obj).then((res) => {
that.submitMlog();
});
})
}else{ }else{
that.submitMlog(); that.submitMlog();
} }