링크이동 수정
Some checks failed
Close Pull Request / main (pull_request_target) Has been cancelled

This commit is contained in:
yangsh
2026-02-09 11:00:15 +09:00
parent 9a27018922
commit a7dca8c5fa
7 changed files with 132 additions and 17 deletions

View File

@@ -39,7 +39,7 @@
$serverIp = $_SERVER['SERVER_ADDR'] ?? '';
// 개발 서버
$devServers = ['192.168.200.8', '192.168.10.231'];
$devServers = ['192.168.200.8', '192.168.10.231', '172.18.0.5'];
// 도커 테스트 서버
$dockerServers = ['172.18.0.2'];
@@ -58,7 +58,7 @@
if (in_array($serverIp, $devServers, true)) {
// 개발
echo "<img src='/img/gnb_dev_00.png' alt='' />";
echo "개발";
} elseif (in_array($serverIp, $dockerServers, true)) {
// 도커
@@ -80,8 +80,6 @@
echo "{$serverName}";
}
?>
</li>

View File

@@ -109,7 +109,6 @@ $usr_nm = session('usr_nm');
<div class="main-card mb-3 card">
<div class="card-body">
<form id="frm_srch_info" method="get" onsubmit="return false;">
<!-- 검색 폼 -->
<div class="row g-3">
<div class="col-md-1">
@@ -404,6 +403,13 @@ $usr_nm = session('usr_nm');
const bonbuArr = <?= json_encode($bonbu, JSON_UNESCAPED_UNICODE); ?>;
const teamArr = <?= json_encode($team, JSON_UNESCAPED_UNICODE); ?>;
const userArr = <?= json_encode($user, JSON_UNESCAPED_UNICODE); ?>;
<?php if (isset($srchUser) && !empty($srchUser)): ?>
const srchUser = <?= json_encode($srchUser, JSON_UNESCAPED_UNICODE); ?>;
<?php else: ?>
const srchUser = null;
<?php endif; ?>
const sBonbu = "<?= $sBonbu ?? '' ?>";
const sTeam = "<?= $sTeanm ?? '' ?>";
const date = new Date();
var table;
@@ -412,6 +418,15 @@ $usr_nm = session('usr_nm');
initReceiptDate();
// srchUser 데이터가 있으면 초기값 설정 (usr_id 파라미터)
if (srchUser) {
initSrchUser();
}
// bonbu, dept_sq 파라미터가 있으면 초기값 설정
else if (sBonbu || sTeam) {
initSrchParam();
}
$("#srcSido, #srcGugun, #srcSido2, #srcGugun2").on("change", function (e) {
const targetId = this.id;
@@ -640,7 +655,7 @@ $usr_nm = session('usr_nm');
{ data: null, render: fn_prd_render },
{ data: 'rcpt_product_info1' },
<?php if ($usr_level != "45"): ?>
{ data: 'dept_nm' },
{ data: 'dept_nm' },
{ data: 'usr_nm' },
<?php endif; ?>
{ data: 'parcel_out_yn' },
@@ -710,6 +725,79 @@ $usr_nm = session('usr_nm');
}
// 검색 사용자 초기화 (usr_id 파라미터용)
function initSrchUser() {
if (!srchUser) return;
const pdept_sq = srchUser.pdept_sq;
const dept_sq = srchUser.dept_sq;
const usr_id = srchUser.usr_id;
// 1단계: 본부 선택
if (pdept_sq) {
$("#bonbu").val(pdept_sq);
// 2단계: 팀 목록 로드 및 선택
let teamStr = `<option value="">-팀-</option>`;
if (teamArr.length > 0) {
for (let i = 0; i < teamArr.length; i++) {
if (String(teamArr[i].pdept_sq) === String(pdept_sq)) {
const selected = String(teamArr[i].dept_sq) === String(dept_sq) ? 'selected' : '';
teamStr += `<option value="${teamArr[i].dept_sq}" ${selected}>${teamArr[i].dept_nm}</option>`;
}
}
}
$("#team").html(teamStr);
// 3단계: 담당자 목록 로드 및 선택
if (dept_sq) {
let damdangStr = `<option value="">-담당자-</option>`;
if (userArr.length > 0) {
for (let i = 0; i < userArr.length; i++) {
if (String(userArr[i].dept_sq) === String(dept_sq)) {
const selected = String(userArr[i].usr_id) === String(usr_id) ? 'selected' : '';
damdangStr += `<option value="${userArr[i].usr_id}" ${selected}>${userArr[i].usr_nm}</option>`;
}
}
}
$("#damdang").html(damdangStr);
}
}
}
// 검색 파라미터 초기화 (bonbu, dept_sq 파라미터용)
function initSrchParam() {
// 1단계: 본부 선택
if (sBonbu) {
$("#bonbu").val(sBonbu);
// 2단계: 팀 목록 로드 및 선택
let teamStr = `<option value="">-팀-</option>`;
if (teamArr.length > 0) {
for (let i = 0; i < teamArr.length; i++) {
if (String(teamArr[i].pdept_sq) === String(sBonbu)) {
const selected = String(teamArr[i].dept_sq) === String(sTeam) ? 'selected' : '';
teamStr += `<option value="${teamArr[i].dept_sq}" ${selected}>${teamArr[i].dept_nm}</option>`;
}
}
}
$("#team").html(teamStr);
// 3단계: 팀이 선택되어 있으면 담당자 목록 로드
if (sTeam) {
let damdangStr = `<option value="">-담당자-</option>`;
if (userArr.length > 0) {
for (let i = 0; i < userArr.length; i++) {
if (String(userArr[i].dept_sq) === String(sTeam)) {
damdangStr += `<option value="${userArr[i].usr_id}">${userArr[i].usr_nm}</option>`;
}
}
}
$("#damdang").html(damdangStr);
}
}
}
function atcl_no_enter(event) {
if (event.keyCode == 13) {
table.ajax.reload()

View File

@@ -337,7 +337,9 @@
const row = table.row(this).data()
if (!row) return
location.href = '/article/receipt/lists';
location.href = '/article/receipt/lists?usr_id=' + row.usr_id;
});
// [검색] 버튼 눌렀을 때 다시 조회

View File

@@ -144,13 +144,14 @@
$nRow = 1;
foreach ($st_list as $row) {
// if ($row['depth'] == '1') {
// $rowPars = array_merge($pars, array('bonbu' => $row['dept_sq']));
// } else {
// $rowPars = array_merge($pars, array('bonbu' => $row['pdept_sq'], 'dept_sq' => $row['dept_sq']));
// }
echo '<tr onmouseover="this.className=\'highlight\'" onmouseout="this.className=\'normal\'" style="cursor:pointer" onclick="tr_onclick();">';
$pars = [];
if ($row['depth'] == '1') {
$rowPars = array_merge($pars, array('bonbu' => $row['dept_sq']));
} else {
$rowPars = array_merge($pars, array('bonbu' => $row['pdept_sq'], 'dept_sq' => $row['dept_sq']));
}
echo '<tr onmouseover="this.className=\'highlight\'" onmouseout="this.className=\'normal\'" style="cursor:pointer" onclick="tr_onclick(\'' . make_query_string($rowPars) . '\');">';
echo '<td>' . $nRow . '</td>';
echo '<td style="text-align:left">' . str_replace(' ', '&nbsp;', $row['dept_nm']) . '</td>';
echo '<td>' . $row['region_cnt'] . '</td>';
@@ -231,8 +232,8 @@
});
function tr_onclick() {
location.href = '/article/receipt/lists';
function tr_onclick(pars) {
location.href = '/article/receipt/lists' + pars;
}
// 엑셀 다운로드

View File

@@ -326,7 +326,7 @@
// myModal.show();
location.href = '/article/receipt/lists';
location.href = '/article/receipt/lists?usr_id=' + row.usr_id;
});