{"id":43,"date":"2026-05-25T15:14:16","date_gmt":"2026-05-25T07:14:16","guid":{"rendered":"http:\/\/supenguin.asuscomm.com:8080\/?page_id=43"},"modified":"2026-05-26T15:22:22","modified_gmt":"2026-05-26T07:22:22","slug":"%e5%a0%b1%e4%bf%ae%e5%96%ae%e9%80%b2%e5%ba%a6%e6%aa%a2%e8%a6%96%e9%a0%81%e9%9d%a2","status":"publish","type":"page","link":"https:\/\/supenguin.com\/?page_id=43","title":{"rendered":"\u5831\u4fee\u55ae\u9032\u5ea6\u6aa2\u8996\u9801\u9762"},"content":{"rendered":"\n<div class=\"repair-view-container\">\n    <div class=\"repair-header\">\n        <h2>\ud83d\udee0\ufe0f \u5831\u4fee\u55ae\u8a73\u7d30\u9032\u5ea6\u770b\u677f<\/h2>\n        <div class=\"ticket-badge\" id=\"view_status\">\u23f3 \u8b80\u53d6\u4e2d&#8230;<\/div>\n    <\/div>\n    \n    <div id=\"loading_view\" class=\"view-status-msg\" style=\"text-align: center; padding: 20px; font-weight: bold; color: #5bc0de;\">\ud83d\udd0d \u6b63\u5728\u8abf\u53d6\u8cc7\u6599\u5eab\u55ae\u64da&#8230;<\/div>\n    \n    <div id=\"repair_content_wrapper\" style=\"display: none;\">\n        <table class=\"repair-table\">\n            <tbody>\n                <tr>\n                    <th>\u670d\u52d9\u7de8\u865f<\/th><td id=\"view_service_id\" style=\"color:#ffb100; font-weight:bold;\">&#8211;<\/td>\n                    <th>\u5efa\u7acb\u6642\u9593<\/th><td id=\"view_created_at\">&#8211;<\/td>\n                <\/tr>\n                <tr>\n                    <th>\u8a2d\u5099\u8ca1\u7de8<\/th><td id=\"view_property_id\">&#8211;<\/td>\n                    <th>\u5831\u4fee\u4eba\u5de5\u865f<\/th><td id=\"view_emp_id\">&#8211;<\/td>\n                <\/tr>\n                <tr>\n                    <th>\u72c0\u6cc1\u63cf\u8ff0<\/th><td id=\"view_issue_desc\" colspan=\"3\" class=\"text-block\">&#8211;<\/td>\n                <\/tr>\n            <\/tbody>\n        <\/table>\n\n        <div class=\"log-section\">\n            <h3>\ud83d\udcdd \u7dad\u4fee\u8655\u7406\u6b77\u7a0b<\/h3>\n            <div id=\"view_process_log\" class=\"log-box\">\u76ee\u524d\u5c1a\u7121\u7dad\u4fee\u8a18\u9304\u3002<\/div>\n        <\/div>\n\n        <div id=\"engineer_panel\" class=\"engineer-panel\" style=\"display: none;\">\n            <h3>\ud83d\udc68\u200d\ud83d\udd27 \u5de5\u7a0b\u5e2b\u7dad\u4fee\u64cd\u4f5c\u9762\u677f<\/h3>\n            <div class=\"form-group\">\n                <label>\u8b8a\u66f4\u9032\u5ea6\u72c0\u614b<\/label>\n                <select id=\"edit_status\">\n                    <option value=\"\u5f85\u8655\u7406\">\ud83d\udd34 \u5f85\u8655\u7406<\/option>\n                    <option value=\"\u8655\u7406\u4e2d\">\ud83d\udfe0 \u8655\u7406\u4e2d<\/option>\n                    <option value=\"\u5df2\u7d50\u6848\">\ud83d\udfe2 \u5df2\u7d50\u6848<\/option>\n                <\/select>\n            <\/div>\n            <div class=\"form-group\">\n                <label>\u65b0\u589e\u8655\u7406\u8a18\u9304 (\u4f8b\u5982\uff1a\u66f4\u63db\u6ed1\u9f20\u3001\u6aa2\u67e5\u4e3b\u6a5f\u677f\u7b49&#8230;)<\/label>\n                <textarea id=\"edit_log\" rows=\"3\" placeholder=\"\u8acb\u8f38\u5165\u672c\u6b21\u8655\u7406\u7684\u52d5\u4f5c\u5167\u5bb9...\"><\/textarea>\n            <\/div>\n            \n            <div class=\"engineer-btn-group\">\n                <button class=\"btn-update\" onclick=\"submitEngineerUpdate()\">\ud83d\udcbe \u5132\u5b58\u7dad\u4fee\u8a18\u9304<\/button>\n                <button class=\"btn-reject\" onclick=\"submitEngineerReject()\">\ud83d\uddd1\ufe0f \u7533\u8acb\u9000\u55ae\/\u4f5c\u5ee2\u6b64\u55ae<\/button>\n            <\/div>\n        <\/div>\n    <\/div>\n    \n    <div id=\"view_error_msg\" class=\"view-status-msg error-box\" style=\"display:none; padding: 15px; background: #f8d7da; color: #721c24; border-radius: 4px; font-weight: bold; text-align: center; margin-top: 20px;\"><\/div>\n<\/div>\n\n<style>\n\/* --- \u4ecb\u9762\u6838\u5fc3\u4f48\u5c40 --- *\/\n.repair-view-container { background: #1e1e1e; color: #fff; padding: 30px; border-radius: 8px; max-width: 800px; margin: 20px auto; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif; border: 1px solid #333; box-shadow: 0 4px 15px rgba(0,0,0,0.3); }\n.repair-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #0073aa; padding-bottom: 15px; margin-bottom: 20px; }\n.repair-header h2 { margin: 0; font-size: 20px; color: #fff; }\n.ticket-badge { padding: 6px 15px; border-radius: 20px; font-weight: bold; font-size: 14px; background: #555; text-shadow: 1px 1px 1px rgba(0,0,0,0.5); }\n\n\/* --- \u72c0\u614b\u5927\u8cbc\u7d19\u667a\u6167\u984f\u8272\u8b8a\u66f4 --- *\/\n.status-wait { background: #d9534f !important; color: #fff !important; } \n.status-process { background: #ffb100 !important; color: #000 !important; font-weight: bold; } \n.status-done { background: #28a745 !important; color: #fff !important; }\n.status-rejected { background: #555555 !important; color: #aaa !important; text-decoration: line-through; border: 1px solid #444; }\n\n\/* --- \u5831\u4fee\u55ae\u8a73\u60c5\u8868\u683c --- *\/\n.repair-table { width: 100%; border-collapse: collapse; margin-bottom: 25px; }\n.repair-table th, .repair-table td { border: 1px solid #444; padding: 12px 15px; font-size: 14px; text-align: left; }\n.repair-table th { background: #2a2a2a; color: #bbb; width: 20%; font-weight: bold; }\n.repair-table td { background: #1a1a1a; color: #fff; }\n.text-block { white-space: pre-wrap; line-height: 1.6; word-break: break-all; color: #ddd !important; }\n\n\/* --- \u9ed1\u5ba2\u98a8\u5de5\u7a0b\u5e2b\u7dad\u4fee\u6b77\u7a0b Log \u6846 --- *\/\n.log-section { margin-top: 25px; }\n.log-section h3 { font-size: 16px; margin-bottom: 10px; color: #ccc; }\n.log-box { background: #0f0f0f; border: 1px solid #3a3a3a; padding: 15px; border-radius: 6px; font-size: 13px; color: #00ff00; line-height: 1.6; max-height: 250px; overflow-y: auto; white-space: pre-wrap; font-family: \"Courier New\", Courier, monospace; box-shadow: inset 0 0 10px rgba(0,0,0,0.8); }\n\n\/* --- \u5de5\u7a0b\u5e2b\u9762\u677f\u63a7\u9375\u5340 --- *\/\n.engineer-panel { margin-top: 35px; padding: 20px; background: #262626; border-radius: 8px; border: 2px solid #0073aa; }\n.engineer-panel h3 { margin-top: 0; color: #0073aa; font-size: 16px; margin-bottom: 15px; font-weight: bold; }\n.engineer-panel label { font-size: 13px; color: #bbb; display: block; margin-bottom: 6px; font-weight: bold; }\n.engineer-panel select, .engineer-panel textarea { width: 100%; padding: 10px; background: #111; border: 1px solid #444; color: #fff; border-radius: 4px; margin-bottom: 15px; box-sizing: border-box; font-size: 14px; }\n.engineer-panel select:focus, .engineer-panel textarea:focus { border-color: #0073aa; outline: none; }\n\n\/* --- \u96d9\u6309\u9215\u5e73\u884c\u4f75\u6392\u6a23\u5f0f --- *\/\n.engineer-btn-group { display: flex; gap: 15px; margin-top: 5px; }\n.btn-update { flex: 2; padding: 12px; background: #0073aa; color: #fff; border: none; border-radius: 4px; font-weight: bold; cursor: pointer; font-size: 15px; transition: background 0.2s ease; display: inline-block; text-align: center; }\n.btn-update:hover { background: #008ec2; }\n.btn-update:disabled, .btn-reject:disabled { opacity: 0.5; cursor: not-allowed; }\n.btn-reject { flex: 1; padding: 12px; background: #a94442; color: #fff; border: none; border-radius: 4px; font-weight: bold; cursor: pointer; font-size: 15px; transition: background 0.2s ease; display: inline-block; text-align: center; }\n.btn-reject:hover { background: #d9534f; }\n<\/style>\n\n<script>\ndocument.addEventListener('DOMContentLoaded', function() {\n    \/\/ 1. \u89e3\u6790\u7db2\u5740\u4e2d\u7684\u670d\u52d9\u55ae\u865f (?ticket=XXXXXXXXXXXXXXXX)\n    const urlParams = new URLSearchParams(window.location.search);\n    const serviceId = urlParams.get('ticket');\n    \n    if (!serviceId) {\n        document.getElementById('loading_view').style.display = 'none';\n        const errBox = document.getElementById('view_error_msg');\n        errBox.innerText = '\u26a0\ufe0f \u7db2\u5740\u53c3\u6578\u932f\u8aa4\uff1a\u7f3a\u5c11\u5831\u4fee\u55ae\u865f\u53c2\u6570 (?ticket=xxxx)\uff0c\u7cfb\u7d71\u7121\u6cd5\u67e5\u8a62\u3002';\n        errBox.style.display = 'block';\n        return;\n    }\n\n    const ajaxUrl = window.location.origin + '\/wp-admin\/admin-ajax.php';\n    const formData = new URLSearchParams();\n    formData.append('action', 'get_single_repair_ticket');\n    formData.append('service_id', serviceId);\n    \n    \/\/ 2. \u900f\u904e\u539f\u751f Fetch API \u5411\u5f8c\u7aef\u6488\u53d6\u55ae\u7b46\u5de5\u55ae\n    fetch(ajaxUrl, {\n        method: 'POST',\n        headers: { 'Content-Type': 'application\/x-www-form-urlencoded; charset=UTF-8' },\n        body: formData.toString()\n    })\n    .then(res => {\n        if (!res.ok) throw new Error('\u7db2\u8def\u901a\u8a0a\u7570\u5e38');\n        return res.json();\n    })\n    .then(response => {\n        document.getElementById('loading_view').style.display = 'none';\n        \n        if(response.success) {\n            const ticket = response.data;\n            \n            \/\/ \u5c07\u81ea\u8a02\u8cc7\u6599\u8868\u7684\u6b04\u4f4d\u5167\u5bb9\u6e32\u67d3\u5230\u5c0d\u61c9\u7684 HTML \u5bb9\u5668\u4e2d\n            document.getElementById('view_service_id').innerText = ticket.service_id || '-';\n            document.getElementById('view_created_at').innerText = ticket.created_at || '-';\n            document.getElementById('view_property_id').innerText = ticket.property_id || '-';\n            document.getElementById('view_emp_id').innerText = ticket.reporter_emp_id || '-';\n            document.getElementById('view_issue_desc').innerText = ticket.issue_desc || '-';\n            \n            \/\/ \u6e32\u67d3\u8655\u7406\u6b77\u7a0b\u7d00\u9304 Log\n            if(ticket.process_log) {\n                document.getElementById('view_process_log').innerText = ticket.process_log;\n            }\n\n            \/\/ \u72c0\u614b\u8cbc\u7d19\u63a7\u5236\u6a5f\u5236\n            const badge = document.getElementById('view_status');\n            const statusStr = ticket.ticket_status || '\u5f85\u8655\u7406';\n            badge.innerText = statusStr;\n            \n            \/\/ \u79fb\u9664\u820a CSS \u985e\u5225\uff0c\u6ce8\u5165\u5c0d\u61c9\u65b0\u72c0\u614b\u6a23\u5f0f\n            badge.classList.remove('status-wait', 'status-process', 'status-done', 'status-rejected');\n            if(statusStr === '\u5f85\u8655\u7406') {\n                badge.classList.add('status-wait');\n            } else if(statusStr === '\u8655\u7406\u4e2d' || statusStr === '\u7dad\u4fee\u4e2d') {\n                badge.classList.add('status-process');\n            } else if(statusStr === '\u5df2\u7d50\u6848') {\n                badge.classList.add('status-done');\n            } else if(statusStr === '\u5df2\u9000\u55ae' || statusStr === '\u5df2\u4f5c\u5ee2') {\n                badge.classList.add('status-rejected');\n            }\n\n            \/\/ \ud83d\udca1 \u6b0a\u9650\u9632\u79a6\u76fe\u724c\uff1a\u5f8c\u7aef\u9a57\u8b49\u78ba\u8a8d\u662f\u767b\u5165\u7684 IT \u5de5\u7a0b\u5e2b\uff0c\u624d\u89e3\u9396\u4e26\u5c55\u958b\u9762\u677f\n            if(ticket.is_engineer) {\n                document.getElementById('engineer_panel').style.display = 'block';\n                \/\/ \u5982\u679c\u76ee\u524d\u7684\u5de5\u55ae\u4e0d\u662f\u9000\u55ae\u72c0\u614b\uff0c\u5c31\u81ea\u52d5\u5c07\u4e0b\u62c9\u9078\u55ae\u5c0d\u9f4a\u8cc7\u6599\u5eab\u72c0\u614b\n                if(statusStr !== '\u5df2\u9000\u55ae') {\n                    document.getElementById('edit_status').value = statusStr;\n                }\n            }\n\n            \/\/ \u986f\u793a\u4e3b\u5305\u88dd\u5340\n            document.getElementById('repair_content_wrapper').style.display = 'block';\n        } else {\n            const errBox = document.getElementById('view_error_msg');\n            errBox.innerText = '\u274c \u67e5\u8a62\u5931\u6557\uff1a' + (response.data || '\u627e\u4e0d\u5230\u8a72\u55ae\u64da');\n            errBox.style.display = 'block';\n        }\n    })\n    .catch(error => {\n        document.getElementById('loading_view').style.display = 'none';\n        const errBox = document.getElementById('view_error_msg');\n        errBox.innerText = '\ud83d\udca5 \u7cfb\u7d71\u7121\u6cd5\u9023\u7dda\u81f3\u5f8c\u7aef\u8cc7\u6599\u5eab\uff0c\u8acb\u91cd\u65b0\u6574\u7406\u7db2\u9801\u3002';\n        errBox.style.display = 'block';\n        console.error('Fetch\u8b80\u53d6\u932f\u8aa4:', error);\n    });\n});\n\n\/\/ =========================================================================\n\/\/ \ud83c\udfaf \u52d5\u4f5c\u4e00\uff1a\u5de5\u7a0b\u5e2b\u9ede\u64ca\u300c\u5132\u5b58\u7dad\u4fee\u8a18\u9304\u300d\uff08\u8b8a\u66f4\u4e00\u822c\u72c0\u614b\u8207\u7d2f\u52a0 Log\uff09\n\/\/ =========================================================================\nfunction submitEngineerUpdate() {\n    const serviceId = document.getElementById('view_service_id').innerText;\n    const newStatus = document.getElementById('edit_status').value;\n    const logContent = document.getElementById('edit_log').value.trim();\n    \n    if(!logContent) { \n        alert('\u26a0\ufe0f \u8acb\u5148\u586b\u5beb\u672c\u6b21\u8655\u7406\u7684\u8a18\u9304\u5167\u5bb9\uff01'); \n        return; \n    }\n\n    const btn = document.querySelector('.btn-update');\n    btn.disabled = true;\n    btn.innerText = '\u23f3 \u6b63\u5728\u5132\u5b58\u8b8a\u66f4...';\n\n    \/\/ \ud83c\udfaf \u547c\u53eb\u4f60\u539f\u672c\u5beb\u597d\u7684\u6838\u5fc3 API\u300cupdate_ticket_status\u300d\n    executeFetchAction('update_ticket_status', {\n        service_id: serviceId,\n        new_status: newStatus,\n        log_content: logContent\n    }, btn, '\ud83d\udcbe \u5132\u5b58\u7dad\u4fee\u8a18\u9304');\n}\n\n\/\/ =========================================================================\n\/\/ \ud83c\udfaf \u52d5\u4f5c\u4e8c\uff1a\u5de5\u7a0b\u5e2b\u9ede\u64ca\u300c\u7533\u8acb\u9000\u55ae\/\u4f5c\u5ee2\u6b64\u55ae\u300d\uff08\u5f37\u5236\u72c0\u614b\u8b8a\u66f4\u70ba\uff1a\u5df2\u9000\u55ae\uff09\n\/\/ =========================================================================\nfunction submitEngineerReject() {\n    const serviceId = document.getElementById('view_service_id').innerText;\n    const logContent = document.getElementById('edit_log').value.trim();\n    \n    \/\/ \ud83d\udca1 \u9632\u5446\u9650\u5236\uff1a\u9000\u55ae\u5c6c\u65bc\u654f\u611f\u64cd\u4f5c\uff0c\u5f37\u5236\u8981\u6c42\u5de5\u7a0b\u5e2b\u5fc5\u9808\u8f38\u5165\u7406\u7531\u624d\u80fd\u57f7\u884c\n    if(!logContent) { \n        alert('\u274c \u9000\u55ae\u5931\u6557\uff1a\u8acb\u5148\u5728\u3010\u65b0\u589e\u8655\u7406\u8a18\u9304\u3011\u8f38\u5165\u6846\u4e2d\uff0c\u586b\u5beb\u60a8\u8981\u9000\u55ae\u6216\u4f5c\u5ee2\u7684\u5177\u9ad4\u539f\u56e0\uff01'); \n        return; \n    }\n\n    if (!confirm(`\u26a0\ufe0f \u60a8\u78ba\u5b9a\u8981\u5c07\u670d\u52d9\u7de8\u865f [${serviceId}] \u9032\u884c\u300c\u9000\u55ae\u4f5c\u5ee2\u300d\u8655\u7f6e\u55ce\uff1f\\n\u6b64\u64cd\u4f5c\u6703\u7559\u4e0b\u7d00\u9304\uff0c\u4e14\u63d0\u5831\u54e1\u5de5\u5c07\u770b\u898b\u9000\u55ae\u901a\u77e5\u3002`)) {\n        return;\n    }\n\n    const btn = document.querySelector('.btn-reject');\n    btn.disabled = true;\n    btn.innerText = '\u23f3 \u9000\u55ae\u8655\u7406\u4e2d...';\n\n    \/\/ \ud83c\udfaf \u72c0\u614b\u53c3\u6578\u76f4\u63a5\u5beb\u6b7b\u5e36\u5165 '\u5df2\u9000\u55ae'\uff0c\u540c\u6a23\u8d70\u300cupdate_ticket_status\u300d\u4e3b\u901a\u9053 API\uff01\n    executeFetchAction('update_ticket_status', {\n        service_id: serviceId,\n        new_status: '\u5df2\u9000\u55ae',\n        log_content: logContent\n    }, btn, '\ud83d\uddd1\ufe0f \u7533\u8acb\u9000\u55ae\/\u4f5c\u5ee2\u6b64\u55ae');\n}\n\n\/\/ =========================================================================\n\/\/ \ud83d\udce6 \u5c01\u88dd\uff1a\u901a\u7528\u539f\u751f\u7684 Fetch POST \u767c\u9001\u5668\n\/\/ =========================================================================\nfunction executeFetchAction(actionName, params, buttonElement, originalText) {\n    const ajaxUrl = window.location.origin + '\/wp-admin\/admin-ajax.php';\n    const formData = new URLSearchParams();\n    formData.append('action', actionName);\n    \n    \/\/ \u81ea\u52d5\u5c07\u7269\u4ef6\u8f49\u5316\u70ba POST \u8868\u55ae\u53c3\u6578\n    for (const key in params) {\n        formData.append(key, params[key]);\n    }\n\n    fetch(ajaxUrl, {\n        method: 'POST',\n        headers: { 'Content-Type': 'application\/x-www-form-urlencoded; charset=UTF-8' },\n        body: formData.toString()\n    })\n    .then(res => res.json())\n    .then(res => {\n        if(res.success) {\n            alert('\u2705 \u64cd\u4f5c\u6210\u529f\uff1a' + res.data);\n            location.reload(); \/\/ \u6210\u529f\u5f8c\u76f4\u63a5\u5237\u65b0\u7db2\u9801\uff0c\u540c\u6b65\u770b\u898b\u6700\u65b0\u72c0\u614b\u8207\u6642\u9593\u6233\u6b77\u7a0b\n        } else {\n            alert('\u274c \u7cfb\u7d71\u56de\u5831\u932f\u8aa4\uff1a' + res.data);\n            buttonElement.disabled = false;\n            buttonElement.innerText = originalText;\n        }\n    })\n    .catch(error => {\n        alert('\u274c \u7db2\u8def\u901a\u8a0a\u7570\u5e38\uff0c\u7121\u6cd5\u6210\u529f\u540c\u6b65\u66f4\u65b0\u8cc7\u6599\u5eab\u3002');\n        buttonElement.disabled = false;\n        buttonElement.innerText = originalText;\n        console.error('Fetch\u63d0\u4ea4\u932f\u8aa4:', error);\n    });\n}\n<\/script>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ud83d\udee0\ufe0f \u5831\u4fee\u55ae\u8a73\u7d30\u9032\u5ea6\u770b\u677f \u23f3 \u8b80\u53d6\u4e2d&#8230; \ud83d\udd0d \u6b63\u5728\u8abf\u53d6\u8cc7\u6599\u5eab\u55ae\u64da&#8230; \u670d\u52d9\u7de8\u865f &#038;#821 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-43","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/supenguin.com\/index.php?rest_route=\/wp\/v2\/pages\/43","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/supenguin.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/supenguin.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/supenguin.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/supenguin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=43"}],"version-history":[{"count":12,"href":"https:\/\/supenguin.com\/index.php?rest_route=\/wp\/v2\/pages\/43\/revisions"}],"predecessor-version":[{"id":83,"href":"https:\/\/supenguin.com\/index.php?rest_route=\/wp\/v2\/pages\/43\/revisions\/83"}],"wp:attachment":[{"href":"https:\/\/supenguin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=43"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}