Compare commits
2 Commits
0211889636
...
bf9254170b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf9254170b | ||
|
|
2fc4179052 |
@@ -6,7 +6,7 @@
|
||||
<title>협력업체 포털 - TK 구매관리</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
<link rel="stylesheet" href="/static/css/tkpurchase.css?v=20260313">
|
||||
<link rel="stylesheet" href="/static/css/tkpurchase.css?v=20260313a">
|
||||
</head>
|
||||
<body>
|
||||
<!-- Header -->
|
||||
@@ -81,8 +81,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/static/js/tkpurchase-core.js?v=20260313"></script>
|
||||
<script src="/static/js/tkpurchase-partner-portal.js?v=20260313"></script>
|
||||
<script src="/static/js/tkpurchase-core.js?v=20260313a"></script>
|
||||
<script src="/static/js/tkpurchase-partner-portal.js?v=20260313a"></script>
|
||||
<script>initPartnerPortal();</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<title>작업일정 - TK 구매관리</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
<link rel="stylesheet" href="/static/css/tkpurchase.css?v=20260312">
|
||||
<link rel="stylesheet" href="/static/css/tkpurchase.css?v=20260313aa">
|
||||
</head>
|
||||
<body>
|
||||
<!-- Header -->
|
||||
@@ -271,8 +271,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/static/js/tkpurchase-core.js?v=20260313"></script>
|
||||
<script src="/static/js/tkpurchase-schedule.js?v=20260313"></script>
|
||||
<script src="/static/js/tkpurchase-core.js?v=20260313a"></script>
|
||||
<script src="/static/js/tkpurchase-schedule.js?v=20260313a"></script>
|
||||
<script>initSchedulePage();</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -10,8 +10,8 @@ async function loadMySchedules() {
|
||||
try {
|
||||
const r = await api('/schedules/my');
|
||||
const data = r.data || {};
|
||||
portalSchedules = data.schedules || [];
|
||||
portalRequests = data.requests || [];
|
||||
portalSchedules = Array.isArray(data) ? data : (data.schedules || []);
|
||||
portalRequests = Array.isArray(data) ? [] : (data.requests || []);
|
||||
} catch(e) {
|
||||
console.warn('Load schedules error:', e);
|
||||
portalSchedules = [];
|
||||
|
||||
@@ -46,7 +46,7 @@ async function deleteCheck(checkId) {
|
||||
// Get weather conditions
|
||||
async function getWeatherConditions() {
|
||||
const db = getPool();
|
||||
const [rows] = await db.query('SELECT * FROM tbm_weather_conditions ORDER BY display_order, condition_code');
|
||||
const [rows] = await db.query('SELECT * FROM weather_conditions ORDER BY display_order, condition_code');
|
||||
return rows;
|
||||
}
|
||||
|
||||
|
||||
@@ -97,13 +97,13 @@ const getAllVisitRequests = async (filters = {}) => {
|
||||
wc.category_name, w.workplace_name,
|
||||
vpt.purpose_name,
|
||||
approver.username as approver_name,
|
||||
d.name as department_name
|
||||
d.department_name
|
||||
FROM workplace_visit_requests vr
|
||||
INNER JOIN users u ON vr.requester_id = u.user_id
|
||||
INNER JOIN sso_users u ON vr.requester_id = u.user_id
|
||||
INNER JOIN workplace_categories wc ON vr.category_id = wc.category_id
|
||||
INNER JOIN workplaces w ON vr.workplace_id = w.workplace_id
|
||||
INNER JOIN visit_purpose_types vpt ON vr.purpose_id = vpt.purpose_id
|
||||
LEFT JOIN users approver ON vr.approved_by = approver.user_id
|
||||
LEFT JOIN sso_users approver ON vr.approved_by = approver.user_id
|
||||
LEFT JOIN departments d ON vr.department_id = d.department_id
|
||||
WHERE 1=1
|
||||
`;
|
||||
@@ -157,13 +157,13 @@ const getVisitRequestById = async (requestId) => {
|
||||
wc.category_name, w.workplace_name,
|
||||
vpt.purpose_name,
|
||||
approver.username as approver_name,
|
||||
d.name as department_name
|
||||
d.department_name
|
||||
FROM workplace_visit_requests vr
|
||||
INNER JOIN users u ON vr.requester_id = u.user_id
|
||||
INNER JOIN sso_users u ON vr.requester_id = u.user_id
|
||||
INNER JOIN workplace_categories wc ON vr.category_id = wc.category_id
|
||||
INNER JOIN workplaces w ON vr.workplace_id = w.workplace_id
|
||||
INNER JOIN visit_purpose_types vpt ON vr.purpose_id = vpt.purpose_id
|
||||
LEFT JOIN users approver ON vr.approved_by = approver.user_id
|
||||
LEFT JOIN sso_users approver ON vr.approved_by = approver.user_id
|
||||
LEFT JOIN departments d ON vr.department_id = d.department_id
|
||||
WHERE vr.request_id = ?`,
|
||||
[requestId]
|
||||
@@ -318,7 +318,7 @@ const getTrainingRecordByRequestId = async (requestId) => {
|
||||
str.signature_data, str.completed_at, str.created_at, str.updated_at,
|
||||
u.username as trainer_name, u.name as trainer_full_name
|
||||
FROM safety_training_records str
|
||||
INNER JOIN users u ON str.trainer_id = u.user_id
|
||||
INNER JOIN sso_users u ON str.trainer_id = u.user_id
|
||||
WHERE str.request_id = ?`,
|
||||
[requestId]
|
||||
);
|
||||
@@ -360,7 +360,7 @@ const getTrainingRecords = async (filters = {}) => {
|
||||
u.username as trainer_name, u.name as trainer_full_name,
|
||||
vr.visitor_company, vr.visitor_count, vr.visit_date
|
||||
FROM safety_training_records str
|
||||
INNER JOIN users u ON str.trainer_id = u.user_id
|
||||
INNER JOIN sso_users u ON str.trainer_id = u.user_id
|
||||
INNER JOIN workplace_visit_requests vr ON str.request_id = vr.request_id
|
||||
WHERE 1=1
|
||||
`;
|
||||
@@ -470,7 +470,7 @@ const getEntryDashboard = async (date) => {
|
||||
FROM workplace_visit_requests vr
|
||||
LEFT JOIN workplace_categories wc ON vr.category_id = wc.category_id
|
||||
LEFT JOIN workplaces w ON vr.workplace_id = w.workplace_id
|
||||
LEFT JOIN users u ON vr.requester_id = u.user_id
|
||||
LEFT JOIN sso_users u ON vr.requester_id = u.user_id
|
||||
LEFT JOIN visit_purpose_types vpt ON vr.purpose_id = vpt.purpose_id
|
||||
WHERE vr.visit_date = ? AND vr.status NOT IN ('pending','rejected')
|
||||
|
||||
@@ -478,14 +478,14 @@ const getEntryDashboard = async (date) => {
|
||||
|
||||
SELECT 'tbm' as source, 'internal' as request_type, NULL as visitor_company, wk.worker_name as visitor_name,
|
||||
1 as visitor_count, NULL as category_name, ts.work_location as workplace_name,
|
||||
ts.session_date as entry_date, ts.start_time as entry_time,
|
||||
ts.start_time as check_in_time, ts.end_time as check_out_time,
|
||||
ts.session_date as entry_date, TIME(ts.created_at) as entry_time,
|
||||
ts.created_at as check_in_time, ts.end_time as check_out_time,
|
||||
CASE WHEN ta.is_present=1 THEN 'checked_in' ELSE 'absent' END as status,
|
||||
leader.worker_name as reporter_name, '작업(TBM)' as purpose_name, 'TBM 세션 기준' as source_note
|
||||
FROM tbm_team_assignments ta
|
||||
JOIN tbm_sessions ts ON ta.session_id = ts.session_id
|
||||
JOIN workers wk ON ta.user_id = wk.worker_id
|
||||
LEFT JOIN workers leader ON ts.leader_user_id = leader.worker_id
|
||||
JOIN workers wk ON ta.worker_id = wk.worker_id
|
||||
LEFT JOIN workers leader ON ts.leader_user_id = leader.user_id
|
||||
WHERE ts.session_date = ? AND ts.status != 'cancelled'
|
||||
|
||||
UNION ALL
|
||||
@@ -554,7 +554,7 @@ const getEntryStats = async (date) => {
|
||||
const getAllDepartments = async () => {
|
||||
const db = getPool();
|
||||
const [rows] = await db.query(
|
||||
'SELECT department_id, name FROM departments WHERE is_active = 1 ORDER BY name'
|
||||
'SELECT department_id, department_name FROM departments WHERE is_active = 1 ORDER BY department_name'
|
||||
);
|
||||
return rows;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user