xiziwen 3 miesięcy temu
rodzic
commit
1160029950

+ 12 - 0
controllers/business_trip/business_apply.go

@@ -78,6 +78,11 @@ func (this *BusinessTrip) ApplyAdd() {
 		return
 	}
 
+	if req.Itinerary == "" {
+		br.Msg = "请填写行程说明"
+		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)
@@ -188,6 +193,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 {
 		br.Msg = "申请失败"
@@ -332,6 +338,11 @@ func (this *BusinessTrip) ApplyEdit() {
 		return
 	}
 
+	if req.Itinerary == "" {
+		br.Msg = "请填写行程说明"
+		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)
@@ -459,6 +470,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/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 {
@@ -73,6 +75,7 @@ type BusinessApplyView struct {
 	ModifyTime      string `description:"修改时间"`
 	IsClose         bool   `description:"true,可关闭,false,不可关闭"`
 	CloseReason     string `description:"关闭理由"`
+	Itinerary       string `description:"行程说明"`
 }
 
 func GetBusinessApplyListCount(condition string, pars []interface{}) (count int, err error) {
@@ -161,6 +164,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) {