From a7dca8c5fae53bbf2635c2adc86a9cf16442b8a7 Mon Sep 17 00:00:00 2001 From: yangsh Date: Mon, 9 Feb 2026 11:00:15 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A7=81=ED=81=AC=EC=9D=B4=EB=8F=99=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Controllers/Article/Receipt.php | 13 +++ app/Models/article/ReceiptModel.php | 13 +++ app/Views/layouts/sidebar.php | 6 +- app/Views/pages/article/receipt/lists.php | 92 +++++++++++++++++++- app/Views/pages/results/assign/stats_a01.php | 4 +- app/Views/pages/results/dept/stats_d01.php | 19 ++-- app/Views/pages/results/person/stats_p01.php | 2 +- 7 files changed, 132 insertions(+), 17 deletions(-) diff --git a/app/Controllers/Article/Receipt.php b/app/Controllers/Article/Receipt.php index fbfbec4..b6b6927 100644 --- a/app/Controllers/Article/Receipt.php +++ b/app/Controllers/Article/Receipt.php @@ -23,18 +23,31 @@ class Receipt extends BaseController public function lists(): string { + $usr_id = $this->request->getGet('usr_id') ?: ''; + $sBonbu = $this->request->getGet('bonbu') ?: ''; + $sTeanm = $this->request->getGet('dept_sq') ?: ''; + $codes = $this->codeModel->getCodeLists(['NHN_DEAL_TYPE', 'CP_ID', 'ARTICLE_TYPE', 'VRFCREQ_WAY', 'STEP_VERIFICATION']); // 코드조회 $sido = $this->model->getAreaList(); // 지역조회 $bonbu = $this->model->getBonbuList(); $team = $this->model->getTeamList(); $user = $this->model->getUserList(); + $this->data['sido'] = $sido; $this->data['bonbu'] = $bonbu; $this->data['team'] = $team; $this->data['user'] = $user; $this->data['codes'] = $codes; + if (!empty($usr_id)) { + $srchUser = $this->model->getSrchUserInfo($usr_id); + $this->data['srchUser'] = $srchUser; + } + + $this->data['sBonbu'] = $sBonbu; + $this->data['sTeanm'] = $sTeanm; + return view("pages/article/receipt/lists", $this->data); } diff --git a/app/Models/article/ReceiptModel.php b/app/Models/article/ReceiptModel.php index 0bb1ece..3ca1bb5 100644 --- a/app/Models/article/ReceiptModel.php +++ b/app/Models/article/ReceiptModel.php @@ -116,6 +116,19 @@ class ReceiptModel extends Model return $query->getResultArray(); } + public function getSrchUserInfo($usr_id) + { + $sql = "SELECT a.usr_sq, a.usr_id, b.dept_sq, b.pdept_sq FROM users a + JOIN departments b ON b.dept_sq = a.dept_sq + WHERE a.usr_id = ? AND a.use_yn = 'Y'"; + + $data = [$usr_id]; + $query = $this->db->query($sql, $data); + $row = $query->getRowArray(); + + return $row; + } + /** * 부서검색(상세) */ diff --git a/app/Views/layouts/sidebar.php b/app/Views/layouts/sidebar.php index 7f04196..c172883 100644 --- a/app/Views/layouts/sidebar.php +++ b/app/Views/layouts/sidebar.php @@ -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 ""; + echo "개발"; } elseif (in_array($serverIp, $dockerServers, true)) { // 도커 @@ -80,8 +80,6 @@ echo "{$serverName}"; } - - ?> diff --git a/app/Views/pages/article/receipt/lists.php b/app/Views/pages/article/receipt/lists.php index 6014ed9..68b2dce 100644 --- a/app/Views/pages/article/receipt/lists.php +++ b/app/Views/pages/article/receipt/lists.php @@ -109,7 +109,6 @@ $usr_nm = session('usr_nm');
-
@@ -404,6 +403,13 @@ $usr_nm = session('usr_nm'); const bonbuArr = ; const teamArr = ; const userArr = ; + + const srchUser = ; + + const srchUser = null; + + const sBonbu = ""; + const sTeam = ""; 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' }, - { data: 'dept_nm' }, + { data: 'dept_nm' }, { data: 'usr_nm' }, { 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 = ``; + 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 += ``; + } + } + } + $("#team").html(teamStr); + + // 3단계: 담당자 목록 로드 및 선택 + if (dept_sq) { + let damdangStr = ``; + 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 += ``; + } + } + } + $("#damdang").html(damdangStr); + } + } + } + + // 검색 파라미터 초기화 (bonbu, dept_sq 파라미터용) + function initSrchParam() { + // 1단계: 본부 선택 + if (sBonbu) { + $("#bonbu").val(sBonbu); + + // 2단계: 팀 목록 로드 및 선택 + let teamStr = ``; + 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 += ``; + } + } + } + $("#team").html(teamStr); + + // 3단계: 팀이 선택되어 있으면 담당자 목록 로드 + if (sTeam) { + let damdangStr = ``; + if (userArr.length > 0) { + for (let i = 0; i < userArr.length; i++) { + if (String(userArr[i].dept_sq) === String(sTeam)) { + damdangStr += ``; + } + } + } + $("#damdang").html(damdangStr); + } + } + } + function atcl_no_enter(event) { if (event.keyCode == 13) { table.ajax.reload() diff --git a/app/Views/pages/results/assign/stats_a01.php b/app/Views/pages/results/assign/stats_a01.php index 555b507..7f68e5b 100644 --- a/app/Views/pages/results/assign/stats_a01.php +++ b/app/Views/pages/results/assign/stats_a01.php @@ -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; }); // [검색] 버튼 눌렀을 때 다시 조회 diff --git a/app/Views/pages/results/dept/stats_d01.php b/app/Views/pages/results/dept/stats_d01.php index 5558c02..0295c04 100644 --- a/app/Views/pages/results/dept/stats_d01.php +++ b/app/Views/pages/results/dept/stats_d01.php @@ -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 ''; + $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 ''; echo '' . $nRow . ''; echo '' . str_replace(' ', ' ', $row['dept_nm']) . ''; echo '' . $row['region_cnt'] . ''; @@ -231,8 +232,8 @@ }); - function tr_onclick() { - location.href = '/article/receipt/lists'; + function tr_onclick(pars) { + location.href = '/article/receipt/lists' + pars; } // 엑셀 다운로드 diff --git a/app/Views/pages/results/person/stats_p01.php b/app/Views/pages/results/person/stats_p01.php index 5cdeb9f..9c18a2d 100644 --- a/app/Views/pages/results/person/stats_p01.php +++ b/app/Views/pages/results/person/stats_p01.php @@ -326,7 +326,7 @@ // myModal.show(); - location.href = '/article/receipt/lists'; + location.href = '/article/receipt/lists?usr_id=' + row.usr_id; }); -- 2.49.1