v1.2.6
- [ETC] Plant 는 Report 메뉴 숨김. - [INSTALL WAIT LIST] Oil Pickup 필요 옵션 추가. - [INSTALL ORDER] 완료 type 변경해도 노트 수정 안하도록 수정. Container 변경 여부 표시. - [CUSTOMER] Container install 날짜 입력 버그 수정.
This commit is contained in:
parent
a0ebce1a14
commit
25ffdef1a4
|
|
@ -438,6 +438,8 @@ trait InstallAPI {
|
||||||
$cycle = intval($_POST['scheduled_cycle'] ?? 0);
|
$cycle = intval($_POST['scheduled_cycle'] ?? 0);
|
||||||
$lock_date = intval($_POST['lock_date'] ?? 0);
|
$lock_date = intval($_POST['lock_date'] ?? 0);
|
||||||
|
|
||||||
|
$need_oil = $_POST['need_oil'] ?? 0; // 0 or 1
|
||||||
|
|
||||||
// Two-person OFF = NULL
|
// Two-person OFF = NULL
|
||||||
if (!$person_cnt) {
|
if (!$person_cnt) {
|
||||||
$person_cnt = null;
|
$person_cnt = null;
|
||||||
|
|
@ -462,9 +464,9 @@ trait InstallAPI {
|
||||||
|
|
||||||
iw_required_person_cnt = ".($person_cnt !== null ? intval($person_cnt) : "NULL").",
|
iw_required_person_cnt = ".($person_cnt !== null ? intval($person_cnt) : "NULL").",
|
||||||
iw_multi_person_reason = ".($person_reason ? "'".addslashes($person_reason)."'" : "NULL").",
|
iw_multi_person_reason = ".($person_reason ? "'".addslashes($person_reason)."'" : "NULL").",
|
||||||
|
|
||||||
iw_scheduled = '{$scheduled}',
|
iw_scheduled = '{$scheduled}',
|
||||||
iw_scheduled_cycle = '{$cycle}',
|
iw_scheduled_cycle = '{$cycle}',
|
||||||
|
iw_need_oil_pickup = '{$need_oil}',
|
||||||
|
|
||||||
iw_status = 'WAITING'
|
iw_status = 'WAITING'
|
||||||
WHERE iw_uid = '{$iw_uid}'
|
WHERE iw_uid = '{$iw_uid}'
|
||||||
|
|
@ -1107,7 +1109,7 @@ trait InstallAPI {
|
||||||
cc_has_wheel='{$has_wheel}',
|
cc_has_wheel='{$has_wheel}',
|
||||||
cc_has_woodframe='{$has_frame}',
|
cc_has_woodframe='{$has_frame}',
|
||||||
cc_owner_type='{$owner_type}',
|
cc_owner_type='{$owner_type}',
|
||||||
cc_install_date={$install_date},
|
cc_install_date='{$install_date}',
|
||||||
cc_install_at={$install_at_sql},
|
cc_install_at={$install_at_sql},
|
||||||
cc_install_note='{$install_note}',
|
cc_install_note='{$install_note}',
|
||||||
cc_modified_at=NOW(),
|
cc_modified_at=NOW(),
|
||||||
|
|
@ -1198,11 +1200,17 @@ trait InstallAPI {
|
||||||
$this->upsertAdditionalNote($di, $additional_note);
|
$this->upsertAdditionalNote($di, $additional_note);
|
||||||
|
|
||||||
// 3) 컨테이너 반영
|
// 3) 컨테이너 반영
|
||||||
if ($di['di_status'] === 'A' && $newStatus === 'P') {
|
if ($di['di_status'] !== 'P' && $newStatus === 'P') {
|
||||||
|
|
||||||
|
if ($di['di_container_applied'] == 0) {
|
||||||
$this->apply_container_changes_for_di($di_uid, $install_note, intval($di['di_customer_uid']));
|
$this->apply_container_changes_for_di($di_uid, $install_note, intval($di['di_customer_uid']));
|
||||||
|
|
||||||
// 3-1) 컨테이너 반영 후 customer 의 main 볼륨이랑 main 컨테이너 변경
|
// 3-1) 컨테이너 반영 후 customer 의 main 볼륨이랑 main 컨테이너 변경
|
||||||
$this->updateCustomerMainContainer(intval($di['di_customer_uid']), $di['di_install_date']);
|
$this->updateCustomerMainContainer(intval($di['di_customer_uid']), $di['di_install_date']);
|
||||||
|
|
||||||
|
// 실행 완료 기록
|
||||||
|
$this->markContainerApplied($di_uid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4) oil pickup → daily
|
// 4) oil pickup → daily
|
||||||
|
|
@ -1367,6 +1375,25 @@ trait InstallAPI {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function markContainerApplied(
|
||||||
|
int $di_uid
|
||||||
|
)
|
||||||
|
{
|
||||||
|
$conn = $GLOBALS['conn'];
|
||||||
|
|
||||||
|
$sql = "
|
||||||
|
UPDATE tbl_daily_install
|
||||||
|
SET
|
||||||
|
di_container_applied = 1
|
||||||
|
WHERE di_uid = '{$di_uid}'
|
||||||
|
LIMIT 1
|
||||||
|
";
|
||||||
|
|
||||||
|
if (!qry($sql)) {
|
||||||
|
throw new Exception('daily install status update failed');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private function saveDailyFromInstallIfNeeded(int $di_uid, int $oil_qty, int $sludge): void
|
private function saveDailyFromInstallIfNeeded(int $di_uid, int $oil_qty, int $sludge): void
|
||||||
{
|
{
|
||||||
if ($oil_qty <= 0) return;
|
if ($oil_qty <= 0) return;
|
||||||
|
|
|
||||||
|
|
@ -947,11 +947,6 @@ function updateCommentReadonlyByResult(){
|
||||||
}else{
|
}else{
|
||||||
textarea.removeAttribute('readonly');
|
textarea.removeAttribute('readonly');
|
||||||
textarea.classList.remove('bg-light');
|
textarea.classList.remove('bg-light');
|
||||||
|
|
||||||
// 기존 저장값이 있으면 유지, 없을 때만 빈칸
|
|
||||||
if (selectedRow) {
|
|
||||||
textarea.value = selectedRow.di_install_note || '';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1488,6 +1483,11 @@ function renderWorkCell(row){
|
||||||
// 보조 아이콘
|
// 보조 아이콘
|
||||||
const icons = [];
|
const icons = [];
|
||||||
|
|
||||||
|
const applied = String(row.di_container_applied || '0') === '1';
|
||||||
|
if(applied > 0){
|
||||||
|
icons.push(`<i class="bi bi-database-check" title="Container applied"></i>`);
|
||||||
|
}
|
||||||
|
|
||||||
const note = (row.di_additional_note || '').trim();
|
const note = (row.di_additional_note || '').trim();
|
||||||
if(note.length > 0){
|
if(note.length > 0){
|
||||||
icons.push(`<i class="bi bi-journal-text" title="Additional note"></i>`);
|
icons.push(`<i class="bi bi-journal-text" title="Additional note"></i>`);
|
||||||
|
|
|
||||||
|
|
@ -119,15 +119,15 @@ if ($iw_uids) {
|
||||||
* 4) Customer images (install_order)
|
* 4) Customer images (install_order)
|
||||||
* ============================ */
|
* ============================ */
|
||||||
$imageMap = []; // [customer_uid => true]
|
$imageMap = []; // [customer_uid => true]
|
||||||
if ($customer_uids) {
|
if ($iw_uids) {
|
||||||
$in = implode(',', $customer_uids);
|
$in = implode(',', $iw_uids);
|
||||||
|
|
||||||
$sql_img = "
|
$sql_img = "
|
||||||
SELECT DISTINCT i_customeruid
|
SELECT DISTINCT i_customeruid
|
||||||
FROM tbl_customer_image
|
FROM tbl_customer_image
|
||||||
WHERE i_status = 'A'
|
WHERE i_status = 'A'
|
||||||
AND i_type = 'install_order'
|
AND i_type = 'install_order'
|
||||||
AND i_customeruid IN ($in)
|
AND i_sourceuid IN ($in)
|
||||||
";
|
";
|
||||||
|
|
||||||
$ri = $jdb->nQuery($sql_img, "Load customer images error");
|
$ri = $jdb->nQuery($sql_img, "Load customer images error");
|
||||||
|
|
@ -431,6 +431,11 @@ function formatPhone($phone) {
|
||||||
iwRecurringDays.value = data.iw_scheduled_cycle || '';
|
iwRecurringDays.value = data.iw_scheduled_cycle || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Oil-Pickup
|
||||||
|
if (data.iw_need_oil_pickup == 1) {
|
||||||
|
btnNeedOilPickup.classList.add('iw-toggle-on');
|
||||||
|
}
|
||||||
|
|
||||||
// job label 갱신
|
// job label 갱신
|
||||||
document.getElementById('iwStep3Title').innerText = `Step 3 of 3 - ${data.iw_work_type} Detail`;
|
document.getElementById('iwStep3Title').innerText = `Step 3 of 3 - ${data.iw_work_type} Detail`;
|
||||||
|
|
||||||
|
|
@ -671,6 +676,13 @@ function formatPhone($phone) {
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if ($row['iw_need_oil_pickup'] > 0): ?>
|
||||||
|
<span class="badge bg-dark text-white">
|
||||||
|
<i class="bi bi-droplet"></i>
|
||||||
|
Pickup
|
||||||
|
</span>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($row['iw_scheduled']): ?>
|
<?php if ($row['iw_scheduled']): ?>
|
||||||
<div class="d-flex align-items-center gap-2 flex-wrap">
|
<div class="d-flex align-items-center gap-2 flex-wrap">
|
||||||
<span class="badge bg-dark text-white">
|
<span class="badge bg-dark text-white">
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,7 @@ $canExport = in_array($level, [1, 5, 6, 7]);
|
||||||
</li>
|
</li>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if ($canExport || $isUcoDriver): ?>
|
||||||
<li class="dropdown">
|
<li class="dropdown">
|
||||||
<a href="#"><span>REPORT</span> <i class="bi bi-chevron-down dropdown-indicator"></i></a>
|
<a href="#"><span>REPORT</span> <i class="bi bi-chevron-down dropdown-indicator"></i></a>
|
||||||
<ul>
|
<ul>
|
||||||
|
|
@ -95,6 +96,7 @@ $canExport = in_array($level, [1, 5, 6, 7]);
|
||||||
<li><a href="/index_intranet.php?view=report_daily_2024">DAILY(~2023)</a></li>
|
<li><a href="/index_intranet.php?view=report_daily_2024">DAILY(~2023)</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($isAdmin): ?>
|
<?php if ($isAdmin): ?>
|
||||||
<li class="dropdown">
|
<li class="dropdown">
|
||||||
|
|
|
||||||
|
|
@ -278,6 +278,7 @@ function initInstallWaitStep3() {
|
||||||
// set parameter
|
// set parameter
|
||||||
const twoOn = document.getElementById('btnTwoPerson').classList.contains('iw-toggle-on');
|
const twoOn = document.getElementById('btnTwoPerson').classList.contains('iw-toggle-on');
|
||||||
const recOn = document.getElementById('btnRecurring').classList.contains('iw-toggle-on');
|
const recOn = document.getElementById('btnRecurring').classList.contains('iw-toggle-on');
|
||||||
|
const oilOn = document.getElementById('btnNeedOilPickup').classList.contains('iw-toggle-on');
|
||||||
const payload = {
|
const payload = {
|
||||||
iw_uid: InstallWait.iw_uid,
|
iw_uid: InstallWait.iw_uid,
|
||||||
request_at: document.getElementById('iwRequestDate').value || null,
|
request_at: document.getElementById('iwRequestDate').value || null,
|
||||||
|
|
@ -290,7 +291,8 @@ function initInstallWaitStep3() {
|
||||||
person_cnt: twoOn ? 2 : null,
|
person_cnt: twoOn ? 2 : null,
|
||||||
person_reason: twoOn ? document.getElementById('iwTwoPersonReason').value : null,
|
person_reason: twoOn ? document.getElementById('iwTwoPersonReason').value : null,
|
||||||
scheduled: recOn ? 1 : 0,
|
scheduled: recOn ? 1 : 0,
|
||||||
scheduled_cycle: recOn ? document.getElementById('iwRecurringDays').value: 0
|
scheduled_cycle: recOn ? document.getElementById('iwRecurringDays').value: 0,
|
||||||
|
need_oil: oilOn ? 1 : 0
|
||||||
};
|
};
|
||||||
btnStep3Complete.disabled = true;
|
btnStep3Complete.disabled = true;
|
||||||
|
|
||||||
|
|
@ -930,6 +932,11 @@ function bindStep3Toggles() {
|
||||||
days.disabled = !on;
|
days.disabled = !on;
|
||||||
if (!on) days.value = '';
|
if (!on) days.value = '';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const btnOil = document.getElementById('btnNeedOilPickup');
|
||||||
|
btnOil.onclick = () => {
|
||||||
|
btnOil.classList.toggle('iw-toggle-on');
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function getContainerIconByType(type) {
|
function getContainerIconByType(type) {
|
||||||
|
|
|
||||||
|
|
@ -174,12 +174,12 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Row 4 : Two-person job + Recurring -->
|
<!-- Row 4 : Two-person job + Recurring -->
|
||||||
<div class="row g-2 mb-3 align-items-start">
|
<div class="row g-2 align-items-start">
|
||||||
|
|
||||||
<!-- LEFT : Note for Install Driver -->
|
<!-- LEFT : Note for Install Driver -->
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<label class="form-label small">Note for Install Driver</label>
|
<label class="form-label small">Note for Install Driver</label>
|
||||||
<textarea id="iwWorkNote" class="form-control form-control-sm" rows="2"></textarea>
|
<textarea id="iwWorkNote" class="form-control form-control-sm" rows="4"></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- RIGHT : Two-person + Recurring -->
|
<!-- RIGHT : Two-person + Recurring -->
|
||||||
|
|
@ -207,7 +207,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Recurring row -->
|
<!-- Recurring row -->
|
||||||
<div class="row g-2 align-items-center">
|
<div class="row g-2 align-items-center mb-2">
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<button type="button"
|
<button type="button"
|
||||||
id="btnRecurring"
|
id="btnRecurring"
|
||||||
|
|
@ -229,6 +229,17 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Need Oil Pickup row -->
|
||||||
|
<div class="row g-2 align-items-center">
|
||||||
|
<div class="col-md-4">
|
||||||
|
<button type="button"
|
||||||
|
id="btnNeedOilPickup"
|
||||||
|
class="btn btn-sm btn-outline-secondary w-100 d-flex align-items-center justify-content-center gap-2 iw-inline-ctrl">
|
||||||
|
<i class="bi bi-droplet"></i>
|
||||||
|
Need Oil Pickup
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -237,7 +248,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Footer -->
|
<!-- Footer -->
|
||||||
<div class="d-flex justify-content-between mt-4">
|
<div class="d-flex justify-content-between">
|
||||||
<button id="btnStep3Back" class="btn btn-sm btn-outline-secondary d-flex align-items-center gap-1">
|
<button id="btnStep3Back" class="btn btn-sm btn-outline-secondary d-flex align-items-center gap-1">
|
||||||
<i class="bi bi-arrow-left"></i><span>Back</span>
|
<i class="bi bi-arrow-left"></i><span>Back</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue