2.开瓶有效期规则变化,手动设置每个分类的开瓶有效期延长时间

4.分类编辑只要管理员可以编辑
5.易制毒易制爆归还时提示本次用量,包括液体体积量
6..申请其中一个人驳回,另外一个人同意目前还是有效状态
7.申请流程管理员自己不能驳回自己的申请
8.申请时要可以多选统一填写申请理由
duizhaopin
tangxuan 2 years ago
parent db7d37a98d
commit f724d0e926

@ -172,33 +172,30 @@ def solve_apply():
# user_id_pt = request.values.get("user_id_pt")
t = request.values.get("t")
obj = BllUserApply().findEntity(EntityUserApply.id == apply_id)
if obj.is_solve == 1:
return jsonify(Utils.false_return(msg="已受理,无需重复受理"))
# obj.is_solve = 1
if obj.is_solve == 1 or obj.is_solve == 2:
msg = "驳回" if obj.is_solve == 2 else "受理"
return jsonify(Utils.false_return(msg=f"{msg},无需重复处理"))
if user_id == obj.user_id:
return jsonify(Utils.false_return(msg="申请人与审批人不能为同一人"))
if user_id in [obj.solve_user_id_sh, obj.solve_user_id, obj.solve_user_id_sh]:
return jsonify(Utils.false_return(msg="不能为同一人审批"))
if not obj.solve_user_id_sh:
obj.solve_user_id_sh = user_id
elif not obj.solve_user_id:
obj.solve_user_id = user_id
else:
obj.solve_user_id_pt = user_id
if str(request.values.get('result')) == "0":
obj.information = request.values.get("information")
obj.is_solve = 2
else:
if user_id == obj.user_id:
return jsonify(Utils.false_return(msg="申请人与审批人不能为同一人"))
if not obj.solve_user_id_sh:
obj.solve_user_id_sh = user_id
else:
if not obj.solve_user_id:
if user_id == obj.solve_user_id_sh:
return jsonify(Utils.false_return(msg="不能位同一人审批"))
obj.solve_user_id = user_id
else:
if user_id == obj.solve_user_id or user_id == obj.solve_user_id_sh:
return jsonify(Utils.false_return(msg="不能位同一人审批"))
obj.solve_user_id_pt = user_id
obj.is_solve = 1
obj.time_hour = t
BllUserTemporaryAuth().create_temporary_auth(user_ids=[obj.user_id, obj.user_id_pt], auth_type=2, t=t)
if obj.solve_user_id_pt:
obj.is_solve = 1
obj.time_hour = t
BllUserTemporaryAuth().create_temporary_auth(user_ids=[obj.user_id, obj.user_id_pt], auth_type=2, t=t)
obj.solve_date = Utils.get_str_datetime()
# obj.solve_user_id = user_id
# obj.solve_user_id_pt = user_id_pt
# BllUserTemporaryAuth().create_temporary_auth(user_ids=[obj.user_id, obj.user_pt], auth_type=2)
BllUserApply().update(obj)
return jsonify(Utils.true_return())

@ -962,13 +962,10 @@ class BllMedicament(Repository):
:param drug_entry:
:return:
"""
expiration_dict = {
"ml": 1,
"g": 5,
"mg": 5,
}
unit = drug_entry.net_weight_unit
add_year = expiration_dict.get(unit) if expiration_dict.get(unit) else 2
# 从分类表中获取时间年份
medicament_variety_obj = BllMedicamentVariety().findEntity(
EntityMedicamentVariety.variety_id == drug_entry.variety_id)
add_year = int(medicament_variety_obj.remark5) if medicament_variety_obj.remark5 else 1
date_now = datetime.datetime.now()
add_expiration_date = (date_now + relativedelta(years=add_year)).strftime("%Y-%m-%d %H:%M:%S")
if add_expiration_date > drug_entry.expiration_date:

@ -209,11 +209,11 @@ class EntityMedicamentVariety(Base):
create_user_name = Column(String(50), comment="创建用户名称")
is_add = Column(Integer, comment="", default=0)
remark1 = Column(String(50), comment='扩展字段1')
remark1 = Column(String(50), comment='扩展字段1 func_type类型')
remark2 = Column(String(50), comment='扩展字段2')
remark3 = Column(String(50), comment='扩展字段3')
remark4 = Column(String(50), comment='扩展字段4')
remark5 = Column(String(50), comment='扩展字段5')
remark5 = Column(String(50), comment='扩展字段5 试剂有效期年份')
remark6 = Column(String(50), comment='扩展字段6')
remark7 = Column(String(50), comment='扩展字段7')
remark8 = Column(String(50), comment='扩展字段8')

Loading…
Cancel
Save