This repository has been archived on 2025-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
Files
RIS/App/Waybill/__init__.py

24 lines
767 B
Python

from flask import request, Blueprint, render_template, session, current_app, redirect, url_for
from checker import check_auth
from .model import workpiece_list, clear
waybill_bp = Blueprint('waybill_bp', __name__, template_folder='templates', static_folder='static')
@waybill_bp.route('/', methods=['GET'])
@check_auth
def index():
lst = workpiece_list()
if lst.status:
return render_template('waybill.html', items=lst.result)
else:
return render_template('error.html', error_message=lst.error_message)
@waybill_bp.route('/clear', methods=['GET'])
@check_auth
def clear_basket():
clear()
return redirect(url_for('waybill_bp.index'))
@waybill_bp.route('/', methods=['POST'])
def waybill():
print(request.form)
return 'OK'