diff --git a/data.db b/data.db deleted file mode 100644 index 8373e6c..0000000 Binary files a/data.db and /dev/null differ diff --git a/data.xlsx b/data.xlsx deleted file mode 100644 index bcd0d65..0000000 Binary files a/data.xlsx and /dev/null differ diff --git a/inventory_check/static/css/style.css b/inventory_check/static/css/style.css index 3df316d..01ec2d7 100644 --- a/inventory_check/static/css/style.css +++ b/inventory_check/static/css/style.css @@ -1,3 +1,6 @@ +body { + background-color: azure; +} main { text-align: center; vertical-align: middle; diff --git a/inventory_check/views.py b/inventory_check/views.py index 2982634..dfde9da 100644 --- a/inventory_check/views.py +++ b/inventory_check/views.py @@ -21,9 +21,16 @@ def index(): @app.route('/check', methods=['GET']) def check(): inventory = Inventory.query.filter_by(checked=False).first() - print(inventory) if not inventory: - return "All checked" + js_code = ''' + + ''' + response = make_response(js_code) + response.headers['Content-Type'] = 'application/javascript' + return response return render_template('check.html',inventory=inventory) @app.route('/get_inventory', methods=['POST']) @@ -90,7 +97,15 @@ def import_file(): file_path = 'data.xlsx' file.save(file_path) import_from_xlsx(file_path) - return '' + js_code = ''' + + ''' + response = make_response(js_code) + response.headers['Content-Type'] = 'application/javascript' + return response return redirect(url_for('upload_form')) @@ -108,7 +123,7 @@ def download_xlsx(): # 设置工作表名称 ws.title = "Inventory" # 设置工作表列名 - ws.append(["sort", "location", "tag", "amount", "checked"]) + ws.append(["序号", "位置", "标签", "数量", "已确认"]) # 写入数据 for inventory in inventorys: ws.append([inventory.sort, inventory.location, inventory.tag, inventory.amount, inventory.checked])