duizhaopin
13507605001 2 years ago
parent f303c05831
commit 0971dd71e9

@ -1 +1,9 @@
# RMS后台管理系统4.0 # RMS后台管理系统4.0
库存判断模块
时间,人,终端,详情,序号
点击详情界面
展示试剂名称:输入量,库存量
手动入库模板需求
根据输入名称搜索数据库内的分组试剂数据,点击分组数据后进行填充表单界面

@ -51,7 +51,7 @@ def show_template():
# 添加容错,模板内容为空直接跳过 # 添加容错,模板内容为空直接跳过
if i["template_content"] == 'null' or not i["template_content"]: if i["template_content"] == 'null' or not i["template_content"]:
continue continue
for a in eval(i["template_content"]): for a in json.loads(i["template_content"]):
all_export_cout += int(a.get("export_count", 0)) all_export_cout += int(a.get("export_count", 0))
new_dic = { new_dic = {
"all_export_count": all_export_cout, "all_export_count": all_export_cout,
@ -187,7 +187,8 @@ def add_tmp_info():
if not tmp_name: if not tmp_name:
tmp_name = f'入库模板_{Utils.getFileName()}' tmp_name = f'入库模板_{Utils.getFileName()}'
if isinstance(tmp_content, str): if isinstance(tmp_content, str):
tmp_content = eval(tmp_content) # tmp_content = eval(tmp_content)
tmp_content = json.loads(tmp_content)
# total_count = 0 # total_count = 0
# for i in tmp_content: # for i in tmp_content:
# total_count += int(i['export_count']) # total_count += int(i['export_count'])
@ -318,10 +319,14 @@ def get_file_list():
@tmp_router.route("/pring_bar_code", methods=["POST"]) @tmp_router.route("/pring_bar_code", methods=["POST"])
@token_auth.login_required @token_auth.login_required
def print_code_data(): def print_code_data():
start = request.values.get("start_code") template_id = request.values.get("template_id")
end = request.values.get("end_code") # start = request.values.get("start_code")
# end = request.values.get("end_code")
# temp_obj_list = BllMedicamentTemplate().findList(EntityMedicamentTemplate.template_id._in(template_id_list)).all()
obj = CreateBarcode() obj = CreateBarcode()
for i in range(int(start), int(end)): print(template_id)
temp = BllMedicamentTemplate().findEntity(EntityMedicamentTemplate.template_id == template_id)
for i in range(int(temp.start_bar_code), int(temp.start_bar_code) + int(temp.bar_code_count)):
obj.create_Code128_img(str(i)) obj.create_Code128_img(str(i))
return jsonify(Utils.true_return(msg="成功")) return jsonify(Utils.true_return(msg="成功"))
@ -343,3 +348,10 @@ def print_code_data():
# return jsonify(Utils.true_return(data=Utils.msyql_table_model(data))) # return jsonify(Utils.true_return(data=Utils.msyql_table_model(data)))
# 获取分组后的试剂列表
@tmp_router.route("/get_drug_group_list", methods=["POST"])
@token_auth.login_required
def drug_group_list():
data = BllMedicament().drug_group_info_list()
data_list = Utils.msyql_table_model(data)
return jsonify(Utils.true_return(data=data_list))

@ -474,6 +474,18 @@ class BllMedicament(Repository):
""" """
return self.execute(sql_all).fetchall() return self.execute(sql_all).fetchall()
# 手动输入入库模板时,获取分组后的试剂信息列表
def drug_group_info_list(self):
sql_all = f"""
select
medicament_id, name as value, english_name,
cas_number, purity, production_date,
expiration_date, manufacturer,distributor,speci,
net_weight_unit, total from rms_medicament
group by `name`, speci, purity
"""
return self.execute(sql_all).fetchall()
def inster_log_shiji(self): def inster_log_shiji(self):
import random import random
name_list = ["", "硫酸", "氧化钠"] name_list = ["", "硫酸", "氧化钠"]

Loading…
Cancel
Save