From 642f286bf49bb40a224b45cc18be5d25dc62eba8 Mon Sep 17 00:00:00 2001 From: 13507605001 Date: Wed, 30 Nov 2022 11:24:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/drug_template/views.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/apps/drug_template/views.py b/apps/drug_template/views.py index 0273803..d2ea949 100644 --- a/apps/drug_template/views.py +++ b/apps/drug_template/views.py @@ -23,6 +23,7 @@ from db_logic.meidcament_variety import BllMedicamentVariety from models.client_models import EntityClient from models.medicament_models import EntityMedicament, EntityMedicamentTemplate from Common.auth import token_auth +from Common.create_barcode import CreateBarcode tmp_router = Blueprint("drug_tmplate", __name__) @@ -314,15 +315,15 @@ def get_file_list(): # return jsonify(Utils.true_return(data=os.listdir(file_path))) -# @tmp_router.route("/pring_bar_code", methods=["POST"]) -# @token_auth.login_required -# def print_code_data(): -# start = request.values.get("start_code") -# end = request.values.get("end_code") -# obj = CreateBarcode() -# for i in range(int(start), int(end)): -# obj.create_Code128_img(str(i)) -# return jsonify(Utils.true_return(msg="成功")) +@tmp_router.route("/pring_bar_code", methods=["POST"]) +@token_auth.login_required +def print_code_data(): + start = request.values.get("start_code") + end = request.values.get("end_code") + obj = CreateBarcode() + for i in range(int(start), int(end)): + obj.create_Code128_img(str(i)) + return jsonify(Utils.true_return(msg="成功")) # # 获取所有导入模板信息 # @tmp_router.route("/all_tmp", methods=["GET"])