添加模板问题修改

duizhaopin
apan 2 years ago
parent 28695ce47f
commit 978fa494b6

@ -39,6 +39,9 @@ def show_template():
new_data_list = [] new_data_list = []
for i in data: for i in data:
all_export_cout=0 all_export_cout=0
# 添加容错,模板内容为空直接跳过
if i["template_content"] == 'null' or not i["template_content"]:
continue
for a in eval(i["template_content"]): for a in eval(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 = {
@ -156,6 +159,10 @@ def add_tmp_info():
start_bar_code = max_barcode start_bar_code = max_barcode
try: try:
if not tmp_content or tmp_content == 'null':
return jsonify(Utils.false_return(msg="模板内容有误"))
if not tmp_name:
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)
# total_count = 0 # total_count = 0

Loading…
Cancel
Save