|
@@ -53,11 +53,15 @@ func PurchaseReview(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
if !isManager(user.Roles) {
|
|
|
return nil, errors.New("该用户没有权限")
|
|
|
}
|
|
|
- // 更改状态为已审核
|
|
|
+ // 更改状态为已审核 并签字
|
|
|
+ signs := make([]primitive.ObjectID, 0)
|
|
|
+ signs = append(signs, userId)
|
|
|
purchase := model.PurchaseBill{
|
|
|
Reviewed: 1,
|
|
|
UpdateTime: time.Now(),
|
|
|
+ SignUsers: signs,
|
|
|
}
|
|
|
+
|
|
|
return repo.RepoUpdateSetDoc(apictx.CreateRepoCtx(), repo.CollectionBillPurchase, _id, &purchase)
|
|
|
|
|
|
}
|
|
@@ -97,6 +101,9 @@ func CreateBill(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
}
|
|
|
|
|
|
bill.Status = "created"
|
|
|
+ if bill.Reviewed == 0 {
|
|
|
+ bill.Reviewed = -1
|
|
|
+ }
|
|
|
bill.CreateTime = time.Now()
|
|
|
bill.UpdateTime = time.Now()
|
|
|
|