批量提交使用说明

duizhaopin
tangxuan 2 years ago
parent 0e9ffb6db5
commit 64f50d8fff

@ -372,13 +372,23 @@ def get_dangerous_list():
# @token_auth.login_required
def save_drug_img_info():
# 药剂类别
variety_id = request.values.get("variety_id")
medicament_id = request.values.get("medicament_id")
file_base64 = request.files.get("file")
# variety_id = request.values.get("variety_id")
# medicament_id = request.values.get("medicament_id")
if request.values.get("selected"):
medicament_list = json.loads(request.values.get("selected"))
else:
medicament_list = [{
"variety_id": request.values.get("variety_id"),
"medicament_id": request.values.get("medicament_id"),
}]
# try:
gaopaiyi_obj = GaoPaiYi()
img_path = f"{Utils.UUID()}.jpg"
file_base64.save(os.path.join(gaopaiyi_obj.path, img_path))
for medicament in medicament_list:
variety_id = medicament.get("variety_id")
medicament_id = medicament.get("medicament_id")
# 根据条码查询试剂信息
drug_info = BllMedicament().findEntity(
EntityMedicament.medicament_id == medicament_id)
@ -405,12 +415,21 @@ def get_drug_img(img_path):
@token_auth.login_required
def use_gaopaiyi():
# 药剂类别
variety_id = request.values.get("variety_id")
medicament_id = request.values.get("medicament_id")
# variety_id = request.values.get("variety_id")
# medicament_id = request.values.get("medicament_id")
if request.values.get("selected"):
medicament_list = json.loads(request.values.get("selected"))
else:
medicament_list = [{
"variety_id": request.values.get("variety_id"),
"medicament_id": request.values.get("medicament_id"),
}]
pic_data = GaoPaiYi().getPic()
if pic_data['code'] == 0:
for medicament in medicament_list:
variety_id = medicament.get("variety_id")
medicament_id = medicament.get("medicament_id")
# 根据条码查询试剂信息
drug_info = BllMedicament().findEntity(
EntityMedicament.medicament_id == medicament_id)

Loading…
Cancel
Save