|
@@ -700,12 +700,13 @@ func (this *BusinessTrip) ApplyDetail() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- // 审批人/申请人均可关闭
|
|
|
if item.ApproveId == sysUserId {
|
|
|
item.IsApprove = true
|
|
|
- item.IsClose = true
|
|
|
}
|
|
|
- if sysUserId == item.BusinessApplyId {
|
|
|
+ // 审批已通过且在出差日期之前时, 审批人/申请人均可关闭
|
|
|
+ nowDate, _ := time.ParseInLocation(utils.FormatDate, time.Now().Format(utils.FormatDate), time.Local)
|
|
|
+ arriveDate, _ := time.ParseInLocation(utils.FormatDate, item.ArriveDate, time.Local)
|
|
|
+ if item.Status == "已通过" && arriveDate.After(nowDate) && (sysUserId == item.ApproveId || sysUserId == item.ApplyAdminId) {
|
|
|
item.IsClose = true
|
|
|
}
|
|
|
this.OkDetailed(item, "获取成功")
|