updated to scan module

This commit is contained in:
2025-10-09 01:10:05 +03:00
parent b8e85180c7
commit e257f6be18
7 changed files with 89 additions and 32 deletions

View File

@@ -7,7 +7,6 @@ from .models import User
from . import db
from reportlab.lib.pagesizes import letter
from reportlab.pdfgen import canvas
from flask import Blueprint, render_template, request, redirect, url_for, flash
import csv
from .warehouse import add_location
from app.settings import (
@@ -27,6 +26,12 @@ from .print_module import get_unprinted_orders_data
bp = Blueprint('main', __name__)
warehouse_bp = Blueprint('warehouse', __name__)
@bp.route('/main_scan')
def main_scan():
if 'role' not in session or session['role'] not in ['superadmin', 'admin', 'administrator', 'scan']:
flash('Access denied: Scan users only.')
return redirect(url_for('main.dashboard'))
return render_template('main_page_scan.html')
@bp.route('/', methods=['GET', 'POST'])
def login():
@@ -1143,8 +1148,6 @@ For support, contact your system administrator.
except Exception as e:
print(f"Error creating extension package: {e}")
import traceback
traceback.print_exc()
return jsonify({
'success': False,
'error': str(e)
@@ -1365,7 +1368,6 @@ Installation Time: ~5 minutes
Maintenance Required: Zero (auto-starts with Windows)
Ready to use immediately after installation!"""
zipf.writestr('INSTALLATION_README.txt', installation_readme)
files_added += 1
@@ -1425,7 +1427,7 @@ def create_zero_dependency_service_package():
if not os.path.exists(service_dir):
return jsonify({
'success': False,
'error': f'Windows service directory not found: {service_dir}'
'error': f'Windows service directory not found: {service_dir}'
}), 500
# Create static directory if it doesn't exist
@@ -1715,6 +1717,9 @@ This package contains EVERYTHING needed to run the Quality Print Service:
Quality Web App → Chrome Extension → Windows Service → Printer
```
**Printing Methods (automatic fallback):**
1. Adobe Reader (silent printing)
**Printing Methods (automatic fallback):**
1. Adobe Reader (silent printing)
2. SumatraPDF (if Adobe unavailable)

View File

@@ -0,0 +1,50 @@
/* Scan Module Specific Styles */
.scan-form-card {
width: 380px;
max-width: 380px;
margin: 0 auto 20px auto;
max-height: 660px;
overflow-y: auto;
padding: 18px 18px 12px 18px;
}
.scan-form-card form {
display: flex;
flex-direction: column;
gap: 4px;
}
.scan-form-card label {
font-weight: 500;
margin-bottom: 1px;
font-size: 13px;
}
.scan-form-card input[type="text"] {
padding: 5px 10px;
font-size: 13px;
margin-bottom: 2px;
}
.scan-table-card {
overflow-x: auto;
}
.scan-table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
font-size: 11px;
}
.scan-table th, .scan-table td {
border: 1px solid #ddd;
padding: 8px;
text-align: center;
}
.scan-table th {
background-color: #f4f4f4;
font-weight: bold;
}

View File

@@ -367,32 +367,6 @@ html, body {
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.scan-form-card {
max-width: 600px;
margin: 0 auto 20px auto;
}
.scan-table-card {
overflow-x: auto;
}
.scan-table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
font-size: 11px;
}
.scan-table th, .scan-table td {
border: 1px solid #ddd;
padding: 8px;
text-align: center;
}
.scan-table th {
background-color: #f4f4f4;
font-weight: bold;
}
/* Location row selection styles */
.location-row {

View File

@@ -9,7 +9,7 @@
<div class="dashboard-card">
<h3>Access Scanning Module</h3>
<p>Final scanning module for production orders</p>
<a href="{{ url_for('main.scan') }}" class="btn">Launch Scanning Module</a>
<a href="{{ url_for('main.main_scan') }}" class="btn">Launch Scanning Module</a>
</div>
<div class="dashboard-card">

View File

@@ -0,0 +1,25 @@
{% extends "base.html" %}
{% block title %}Main Scanning Module{% endblock %}
{% block content %}
<div class="etichete-container">
<h1>Main Scanning Module</h1>
<p>This is the main page for accessing scanning features.</p>
<div class="dashboard-container">
<!-- Card 1: Finish goods scanning -->
<div class="dashboard-card">
<h3>Finish goods scanning</h3>
<p>Access the scanning module for production orders.</p>
<a href="{{ url_for('main.scan') }}" class="btn">Finish goods scanning</a>
</div>
<!-- Card 2: View Scan History -->
<div class="dashboard-card">
<h3>View Scan History</h3>
<p>Review previous scan records and results.</p>
<a href="#" class="btn" disabled>Coming Soon</a>
</div>
</div>
</div>
{% endblock %}

View File

@@ -1,5 +1,8 @@
{% extends "base.html" %}
{% block title %}Scan Module{% endblock %}
{% block head %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/scan.css') }}">
{% endblock %}
{% block content %}
<div class="scan-container">
<!-- Input Form Card -->