From 4d70ee6c83ca54c84ee71ef410c344536b8d077c Mon Sep 17 00:00:00 2001 From: Hyojin Ahn Date: Thu, 30 Apr 2026 13:50:53 -0400 Subject: [PATCH] =?UTF-8?q?v1.2.8=20-=20[INSTALL=20ORDER]=20=EC=88=9C?= =?UTF-8?q?=EC=84=9C=20=EC=9E=AC=EC=A0=95=EB=A0=AC=20=EB=B2=84=EA=B7=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95.=20-=20[INSTALL=20WAIT=20LIST]=20Assign=20?= =?UTF-8?q?=ED=9B=84=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=EC=97=90=20=EB=A7=88?= =?UTF-8?q?=EC=9A=B0=EC=8A=A4=20=EC=98=A4=EB=B2=84=ED=96=88=EC=9D=84=20?= =?UTF-8?q?=EB=95=8C=20=EB=85=B8=ED=8A=B8=20tooltip=20=ED=91=9C=EC=8B=9C.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public_html/assets/api/install.php | 34 ++++++++++++--------------- public_html/assets/css/main.css | 6 +++++ public_html/doc/install_order.php | 2 ++ public_html/doc/install_wait_list.php | 29 ++++++++++++++++++++--- 4 files changed, 49 insertions(+), 22 deletions(-) diff --git a/public_html/assets/api/install.php b/public_html/assets/api/install.php index 9087f0f..d579391 100644 --- a/public_html/assets/api/install.php +++ b/public_html/assets/api/install.php @@ -559,6 +559,9 @@ trait InstallAPI { di.di_lng, di.di_work_type, di.di_status, + di.di_request_note, + di.di_cs_note, + di.di_work_note, c.c_name AS di_customer_name, SUM( CASE @@ -776,12 +779,19 @@ trait InstallAPI { $base_seq = 0; - if (!$has_existing && $has_trial) { + if ($has_existing) { + $seq_values = array_map(function($r){ + return intval($r['di_order_seq'] ?? 0); + }, $existing_rows); + + $min_seq = min(array_filter($seq_values)); + $base_seq = $min_seq - 1; + } else if ($has_trial) { $qr_max = qry(" SELECT MAX(di_order_seq) AS max_seq FROM tbl_daily_install WHERE di_driver_uid = '{$di_driver_uid}' - AND di_install_date = '{$di_install_date}' + AND di_install_date = '{$di_install_date}' "); $row_max = fetch_array($qr_max); @@ -2197,6 +2207,7 @@ trait InstallAPI { public function daily_install_reorder() { $driver_uid = intval($_POST['driver_uid'] ?? 0); + $install_date = trim($_POST['install_date'] ?? ''); $orderJson = $_POST['order_list'] ?? ''; $fail = function($stage, $msg, $extra = []) { @@ -2218,21 +2229,6 @@ trait InstallAPI { $fail('decode', 'invalid order list'); } - // driver의 install_date는 하나라고 가정 (화면 기준) - $qr = qry(" - SELECT di_install_date - FROM tbl_daily_install - WHERE di_driver_uid = '{$driver_uid}' - LIMIT 1 - "); - $row = mysqli_fetch_assoc($qr); - - if(!$row){ - $fail('select_date', 'no install data'); - } - - $install_date = $row['di_install_date']; - qry("START TRANSACTION"); foreach($orderList as $item){ @@ -2249,8 +2245,8 @@ trait InstallAPI { UPDATE tbl_daily_install SET di_order_seq = '{$seq}' WHERE di_uid = '{$di_uid}' - AND di_driver_uid = '{$driver_uid}' - AND di_status = 'A' + AND di_driver_uid = '{$driver_uid}' + AND di_status = 'A' LIMIT 1 "; diff --git a/public_html/assets/css/main.css b/public_html/assets/css/main.css index b00cd72..62df5f0 100644 --- a/public_html/assets/css/main.css +++ b/public_html/assets/css/main.css @@ -2383,3 +2383,9 @@ tr.status-X { border-radius: 0 0 5px 5px; } } + +.tooltip-inner { + text-align: left; + max-width: 300px; + white-space: normal; +} diff --git a/public_html/doc/install_order.php b/public_html/doc/install_order.php index e33e3a4..28fb7e5 100644 --- a/public_html/doc/install_order.php +++ b/public_html/doc/install_order.php @@ -421,6 +421,7 @@ let installData = ; let driverInitialMap = ; let reorderModeDriverUid = null; let reorderSelectedRow = null; // currently selected for reorder +const selectedDate = ""; document.addEventListener("DOMContentLoaded", function () { renderList(); @@ -1697,6 +1698,7 @@ function saveDriverOrder(driverUid){ api('daily_install_reorder', { driver_uid: driverUid, + install_date: selectedDate, order_list: JSON.stringify(orderList) }, (res) => { diff --git a/public_html/doc/install_wait_list.php b/public_html/doc/install_wait_list.php index 8432175..41d21c9 100644 --- a/public_html/doc/install_wait_list.php +++ b/public_html/doc/install_wait_list.php @@ -1285,6 +1285,16 @@ function formatPhone($phone) { ${r.is_trial ? '' : ``} `; + const tooltipHtml = ` + Req note: ${r.di_request_note || '-'}
+ CS note: ${r.di_cs_note || '-'}
+ Work note: ${r.di_work_note || '-'} + `; + + tr.setAttribute('data-bs-toggle', 'tooltip'); + tr.setAttribute('data-bs-html', 'true'); + tr.setAttribute('title', tooltipHtml); + tr.style.cursor = 'pointer'; //tr.onclick = () => focusMapMarker(r.di_uid); tbody.appendChild(tr); @@ -1293,6 +1303,12 @@ function formatPhone($phone) { bindCheckboxEvents(); updateModifyButtonState(); initInstallListSortable(); + initTooltips(); + } + + function initTooltips() { + const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')); + tooltipTriggerList.forEach(el => new bootstrap.Tooltip(el)); } function safeFitBounds(bounds, tryCount = 0) { @@ -1669,14 +1685,21 @@ function formatPhone($phone) { } function applyOrderSeqFromDom() { - const trs = document.querySelectorAll('#iwListBody tr'); + const trs = Array.from(document.querySelectorAll('#iwListBody tr')); + if (!trs.length) return; + + const seqValues = trs + .map(tr => parseInt(tr.dataset.orderSeq || '0', 10)) + .filter(v => v > 0); + + const startSeq = seqValues.length ? Math.min(...seqValues) : 1; trs.forEach((tr, idx) => { - const newSeq = idx + 1; + const newSeq = startSeq + idx; tr.dataset.orderSeq = String(newSeq); const tds = tr.querySelectorAll('td'); - const tdSeq = tds[1]; // 0: checkbox, 1: sequence + const tdSeq = tds[1]; if (tdSeq) tdSeq.textContent = newSeq; });