xiziwen 3 月之前
父节点
当前提交
4b60c8f110
共有 2 个文件被更改,包括 16 次插入0 次删除
  1. 12 0
      controllers/business_trip/business_apply.go
  2. 4 0
      models/tables/business_trip/business_apply.go

+ 12 - 0
controllers/business_trip/business_apply.go

@@ -65,6 +65,11 @@ func (this *BusinessTrip) ApplyAdd() {
 		return
 	}
 
+	if req.Itinerary == "" {
+		this.FailWithMessage("请填写行程说明", "请填写行程说明")
+		return
+	}
+
 	startP, _ := time.ParseInLocation(utils.FormatDate, req.ArriveDate, time.Local)
 	endP, _ := time.ParseInLocation(utils.FormatDate, req.ReturnDate, time.Local)
 	nowDate, _ := time.ParseInLocation(utils.FormatDate, time.Now().Format(utils.FormatDate), time.Local)
@@ -163,6 +168,7 @@ func (this *BusinessTrip) ApplyAdd() {
 	item.ApproveName = approveItem.RealName
 	item.CreateTime = time.Now()
 	item.ModifyTime = time.Now()
+	item.Itinerary = req.Itinerary
 	applyId, err := business_trip.AddBusinessApply(item)
 	if err != nil {
 		this.FailWithMessage("申请失败", "申请失败,Err:"+err.Error())
@@ -281,6 +287,11 @@ func (this *BusinessTrip) ApplyEdit() {
 		return
 	}
 
+	if req.Itinerary == "" {
+		this.FailWithMessage("请填写行程说明", "请填写行程说明")
+		return
+	}
+
 	startP, _ := time.ParseInLocation(utils.FormatDate, req.ArriveDate, time.Local)
 	endP, _ := time.ParseInLocation(utils.FormatDate, req.ReturnDate, time.Local)
 	nowDate, _ := time.ParseInLocation(utils.FormatDate, time.Now().Format(utils.FormatDate), time.Local)
@@ -397,6 +408,7 @@ func (this *BusinessTrip) ApplyEdit() {
 	updateParams["refuse_reason"] = ""
 	updateParams["create_time"] = time.Now()
 	updateParams["modify_time"] = time.Now()
+	updateParams["itinerary"] = req.Itinerary
 
 	err = business_trip.UpdateBusinessApply(whereParams, updateParams)
 	if err != nil {

+ 4 - 0
models/tables/business_trip/business_apply.go

@@ -28,6 +28,7 @@ type BusinessApply struct {
 	CloseTime       time.Time `description:"关闭时间"`
 	CreateTime      time.Time `description:"创建时间"`
 	ModifyTime      time.Time `description:"修改时间"`
+	Itinerary       string    `description:"行程说明"`
 }
 
 // 添加出差申请
@@ -49,6 +50,7 @@ type BusinessApplyReq struct {
 	Transportation string `description:"交通工具"`
 	PeerPeopleId   string `description:"同行人id"`
 	PeerPeopleName string `description:"同行人"`
+	Itinerary      string `description:"行程说明"`
 }
 
 type BusinessApplyView struct {
@@ -75,6 +77,7 @@ type BusinessApplyView struct {
 	CloseReason     string `description:"关闭理由"`
 	CloseTime       string `description:"关闭时间"`
 	IsClose         bool   `description:"true,可关闭,false,不可关闭"`
+	Itinerary       string `description:"行程说明"`
 }
 
 func GetBusinessApplyListCount(condition string, pars []interface{}) (count int, err error) {
@@ -151,6 +154,7 @@ type BusinessApplyEditReq struct {
 	Transportation  string `description:"交通工具"`
 	PeerPeopleId    string `description:"同行人id"`
 	PeerPeopleName  string `description:"同行人"`
+	Itinerary       string `description:"行程说明"`
 }
 
 func CheckBusinessApplyDateCount(condition string, pars []interface{}) (count int, err error) {