1 line
5.9 KiB
JSON
1 line
5.9 KiB
JSON
{"content": "<div class=\"load-detail-container\">\n<style>\n.load-detail-container { padding: 20px; }\n.load-header { background: #f8f9fa; padding: 15px; border-radius: 8px; margin-bottom: 20px; }\n.load-header h2 { margin: 0 0 10px 0; }\n.tracking-table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 13px; }\n.tracking-table th { background: #37474f; color: white; padding: 8px; text-align: left; }\n.tracking-table td { padding: 6px 8px; border-bottom: 1px solid #e0e0e0; }\n.tracking-table .numeric { text-align: right; font-family: monospace; }\n.print-btn { background: #455a64; color: white; border: none; padding: 8px 20px; border-radius: 4px; cursor: pointer; margin-bottom: 20px; }\n.dept-badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; margin-right: 4px; }\n.badge-receiving { background: #e3f2fd; color: #1565c0; }\n.badge-hdr { background: #fff3e0; color: #e65100; }\n.badge-test { background: #e8f5e9; color: #2e7d32; }\n.badge-r2 { background: #f3e5f5; color: #7b1fa2; }\n.badge-destruction { background: #ffebee; color: #c62828; }\n</style>\n\n<div class=\"load-header\">\n <h2>Load: <span id=\"load-name\"></span></h2>\n <div>In Date: <span id=\"incoming-date\"></span> | Customer: <span id=\"customer-name\"></span> | Devices: <span id=\"total-devices\"></span> | Weight: <span id=\"total-weight\"></span> lbs</div>\n</div>\n\n<div style=\"margin-bottom: 15px;\">\n <span class=\"dept-badge badge-receiving\">Receiving</span>\n <span class=\"dept-badge badge-hdr\">HDR / Disassembly</span>\n <span class=\"dept-badge badge-test\">Test</span>\n <span class=\"dept-badge badge-r2\">R2 Downstream</span>\n <span class=\"dept-badge badge-destruction\">Destruction</span>\n</div>\n\n<button class=\"print-btn\" onclick=\"window.print()\">Print Data Tracking Worksheet</button>\n<a id=\"edit-link\" href=\"#\" style=\"margin-left: 15px;\"><button class=\"print-btn\" style=\"background: #1976d2;\">Edit Load</button></a>\n\n<table class=\"tracking-table\" id=\"tracking-table\">\n <thead>\n <tr>\n <th rowspan=\"2\">Material Type</th>\n <th colspan=\"3\" style=\"text-align:center; background:#1565c0;\">Receiving</th>\n <th colspan=\"3\" style=\"text-align:center; background:#e65100;\">HDR / Disassembly</th>\n <th colspan=\"3\" style=\"text-align:center; background:#2e7d32;\">Test</th>\n <th style=\"text-align:center; background:#7b1fa2;\">R2</th>\n <th colspan=\"4\" style=\"text-align:center; background:#c62828;\">Destruction</th>\n </tr>\n <tr>\n <th>Count</th><th>Status</th><th>Send To</th>\n <th>Recv'd</th><th>HDD Out</th><th>Send To</th>\n <th>Sanitized</th><th>Status</th><th>Send To</th>\n <th>Sent</th>\n <th>Phys</th><th>HDD Need</th><th>HDD Phys</th><th>HDD Logic</th>\n </tr>\n </thead>\n <tbody id=\"tracking-body\"></tbody>\n</table>\n\n<script>\nfrappe.ready(function() {\n const params = new URLSearchParams(window.location.search);\n const loadName = params.get('load');\n if (!loadName) {\n document.querySelector('.load-detail-container').innerHTML = '<div style=\"padding:40px;text-align:center;\"><h2>No load specified</h2><p>Use ?load=MMDDYYYY-XXXX</p></div>';\n return;\n }\n document.getElementById('edit-link').href = '/app/load/' + loadName;\n frappe.call({\n method: 'frappe.client.get',\n args: { doctype: 'Load', name: loadName },\n callback: function(r) {\n if (r.message) { renderLoad(r.message); }\n else { document.querySelector('.load-detail-container').innerHTML = '<div style=\"padding:40px;text-align:center;\"><h2>Load not found</h2></div>'; }\n }\n });\n});\n\nfunction renderLoad(load) {\n document.getElementById('load-name').textContent = load.name;\n document.getElementById('incoming-date').textContent = load.incoming_date || 'N/A';\n document.getElementById('customer-name').textContent = load.customer_name || load.customer_number || 'N/A';\n document.getElementById('total-devices').textContent = load.total_devices || 0;\n document.getElementById('total-weight').textContent = load.total_weight || 0;\n const tbody = document.getElementById('tracking-body');\n tbody.innerHTML = '';\n if (load.material_items && load.material_items.length > 0) {\n load.material_items.forEach(function(item) {\n const row = document.createElement('tr');\n row.innerHTML = '<td><strong>' + (item.material_type || '') + '</strong></td>' +\n '<td class=\"numeric\">' + (item.total_count || '') + '</td>' +\n '<td>' + (item.initial_data_status || '') + '</td>' +\n '<td>' + (item.send_to || '') + '</td>' +\n '<td class=\"numeric\">' + (item.devices_received || '') + '</td>' +\n '<td class=\"numeric\">' + (item.hdd_removed || '') + '</td>' +\n '<td>' + (item.disassembly_send_to || '') + '</td>' +\n '<td class=\"numeric\">' + (item.units_sanitized_software || '') + '</td>' +\n '<td>' + (item.test_data_status || '') + '</td>' +\n '<td>' + (item.test_send_to || '') + '</td>' +\n '<td class=\"numeric\">' + (item.r2_units_sent || '') + '</td>' +\n '<td class=\"numeric\">' + (item.units_physical_destruction || '') + '</td>' +\n '<td class=\"numeric\">' + (item.hdd_needs_sanitize || '') + '</td>' +\n '<td class=\"numeric\">' + (item.hdd_physical_destruction || '') + '</td>' +\n '<td class=\"numeric\">' + (item.hdd_logical_sanitization || '') + '</td>';\n tbody.appendChild(row);\n });\n } else {\n tbody.innerHTML = '<tr><td colspan=\"15\" style=\"text-align:center;padding:20px;\">No material items</td></tr>';\n }\n}\n</script>\n</div>\n", "title": "Load Detail", "route": "load-detail"} |