package constvar type BaseJobType int const ( BaseJobTypeIncoming BaseJobType = iota + 1 //收货 BaseJobTypeOutgoing //交货 BaseJobTypeInternal //内部调拨 ) func (slf BaseJobType) IsValid() bool { return slf == BaseJobTypeIncoming || slf == BaseJobTypeOutgoing || slf == BaseJobTypeInternal } type ReservationMethod int const ( ReservationMethodAtConfirm ReservationMethod = iota + 1 //在确认时 ReservationMethodManual //手动 ReservationMethodByDate //在预定日期之前 ) func (slf ReservationMethod) IsValid() bool { return slf == ReservationMethodAtConfirm || slf == ReservationMethodManual || slf == ReservationMethodByDate } type WhetherType int const ( WhetherTypeAsk WhetherType = iota + 1 //询问 WhetherTypeAlways //总是 ReservationNever //从不 ) func (slf WhetherType) IsValid() bool { return slf == WhetherTypeAsk || slf == WhetherTypeAlways || slf == ReservationNever }