PageSourceSearch

https://trandx.zeabur.app/_next/static/chunks/pages/vendor/inventory-system/clock-records-e97645c53b10578f.js

js trandx.zeabur.app collected 2026-10-03 16:37:08 UTC 28,594 bytes, 16 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5212],{91373:function(e,t,s){"use strict";s.d(t,{Z:function(){return u}});var a=s(67294);/**
2 * @license lucide-react v0.562.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */ let n=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),r=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,s)=>s?s.toUpperCase():t.toLowerCase()),c=e=>{let t=r(e);return t.charAt(0).toUpperCase()+t.slice(1)},l=(...e)=>e.filter((e,t,s)=>Boolean(e)&&""!==e.trim()&&s.indexOf(e)===t).join(" ").trim(),i=e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};/**
7 * @license lucide-react v0.562.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */ var d={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
12 * @license lucide-react v0.562.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */ let o=(0,a.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:n,className:r="",children:c,iconNode:o,...u},x)=>(0,a.createElement)("svg",{ref:x,...d,width:t,height:t,stroke:e,strokeWidth:n?24*Number(s)/Number(t):s,className:l("lucide",r),...!c&&!i(u)&&{"aria-hidden":"true"},...u},[...o.map(([e,t])=>(0,a.createElement)(e,t)),...Array.isArray(c)?c:[c]])),u=(e,t)=>{let s=(0,a.forwardRef)(({className:s,...r},i)=>(0,a.createElement)(o,{ref:i,iconNode:t,className:l(`lucide-${n(c(e))}`,`lucide-${e}`,s),...r}));return s.displayName=c(e),s}},53219:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});var a=s(91373);let n=(0,a.Z)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},56583:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});var a=s(91373);let n=(0,a.Z)("award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]])},31864:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});var a=s(91373);let n=(0,a.Z)("boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]])},34622:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});var a=s(91373);let n=(0,a.Z)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]])},31222:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});var a=s(91373);let n=(0,a.Z)("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]])},8971:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});var a=s(91373);let n=(0,a.Z)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},84979:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});var a=s(91373);let n=(0,a.Z)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},50868:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});var a=s(91373);
16let n=(0,a.Z)("clipboard-check",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]])},45077:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});var a=s(91373);let n=(0,a.Z)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},66942:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});var a=s(91373);let n=(0,a.Z)("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]])},13766:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});var a=s(91373);let n=(0,a.Z)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},39530:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});var a=s(91373);let n=(0,a.Z)("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]])},26330:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});var a=s(91373);let n=(0,a.Z)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]])},77232:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});var a=s(91373);let n=(0,a.Z)("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]])},91846:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});var a=s(91373);let n=(0,a.Z)("package-plus",[["path",{d:"M16 16h6",key:"100bgy"}],["path",{d:"M19 13v6",key:"85cyf1"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]])},69539:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});var a=s(91373);let n=(0,a.Z)("shopping-cart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]])},55392:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});var a=s(91373);let n=(0,a.Z)("store",[["path",{d:"M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5",key:"slp6dd"}],["path",{d:"M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244",key:"o0xfot"}],["path",{d:"M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05",key:"wn3emo"}]])},19858:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});var a=s(91373);let n=(0,a.Z)("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]])},87966:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});var a=s(91373);let n=(0,a.Z)("user-check",[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]])},49525:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});var a=s(91373);let n=(0,a.Z)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]])},18910:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});var a=s(91373);let n=(0,a.Z)("wallet",[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]])},41352:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});var a=s(91373);let n=(0,a.Z)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
16],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},20168:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/vendor/inventory-system/clock-records",function(){return s(20384)}])},20384:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return y}});var a=s(47568),n=s(97582),r=s(85893),c=s(67294),l=s(11163),i=s(16779),d=s(34622),o=s(45077),u=s(66942),x=s(19858),h=s(39530),m=s(84979),p=s(8971),f=s(41352);function y(){var e,t,s=(0,l.useRouter)(),y=(0,c.useState)([]),j=y[0],g=y[1],v=(0,c.useState)([]),N=v[0],k=v[1],b=(0,c.useState)(!0),w=b[0],Z=b[1],M=(0,c.useState)(!1),O=M[0],C=M[1],S=(0,c.useState)(""),D=S[0],_=S[1],z=(0,c.useState)(""),H=z[0],A=z[1],I=(0,c.useState)(""),L=I[0],E=I[1],R=(0,c.useState)(""),V=R[0],q=R[1],F=(0,c.useState)(!1),T=F[0],W=F[1],P=(0,c.useState)(null),B=P[0],$=P[1],U=(0,c.useState)(!1),X=U[0],G=U[1],J=(0,c.useState)(1),K=J[0],Q=J[1];(0,c.useEffect)(function(){C(!0)},[]),(0,c.useEffect)(function(){O&&(ee(),et())},[O,D,H,L,V]);var Y,ee=(t=(0,a.Z)(function(){var e,t,a,r;return(0,n.__generator)(this,function(a){switch(a.label){case 0:if(a.trys.push([0,4,,5]),!(e=localStorage.getItem("token")))return s.push("/vendor/login"),[2];return[4,fetch("/api/employees/employees",{headers:{Authorization:"Bearer ".concat(e)}})];case 1:if(!(t=a.sent()).ok)return[3,3];return[4,t.json()];case 2:k(a.sent().data||[]),a.label=3;case 3:return[3,5];case 4:return r=a.sent(),console.error("Failed to fetch employees:",r),[3,5];case 5:return[2]}})}),function(){return t.apply(this,arguments)}),et=(Y=(0,a.Z)(function(){var e,t,a,r,c;return(0,n.__generator)(this,function(n){switch(n.label){case 0:if(n.trys.push([0,4,5,6]),Z(!0),!(e=localStorage.getItem("token")))return s.push("/vendor/login"),[2];return t=new URLSearchParams,D&&t.append("employeeId",D),H&&t.append("status",H),L&&t.append("startDate",L),V&&t.append("endDate",V),[4,fetch("/api/employees/clock/records?".concat(t.toString()),{headers:{Authorization:"Bearer ".concat(e)}})];case 1:if(!(a=n.sent()).ok)return[3,3];return[4,a.json()];case 2:g(n.sent().data||[]),n.label=3;case 3:return[3,6];case 4:return c=n.sent(),console.error("Failed to fetch records:",c),[3,6];case 5:return Z(!1),[7];case 6:return[2]}})}),function(){return Y.apply(this,arguments)}),es=function(e){return new Intl.NumberFormat("zh-TW",{style:"currency",currency:"TWD",minimumFractionDigits:0}).format(e)},ea=function(e){return new Date(e).toLocaleString("zh-TW",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})},en=function(e){return new Date(e).toLocaleDateString("zh-TW",{year:"numeric",month:"2-digit",day:"2-digit"})},er=function(e){var t=N.find(function(t){return t._id===e});return t?t.name:"未知員工"},ec=function(){_(""),A(""),E(""),q(""),Q(1)};if(!O)return(0,r.jsx)(i.Z,{children:(0,r.jsx)("div",{className:"flex items-center justify-center min-h-screen",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"}),(0,r.jsx)("p",{className:"mt-4 text-gray-600",children:"載入中..."})]})})});var el,ei=(el=j.filter(function(e){return"completed"===e.status}),{totalRecords:j.length,completedRecords:el.length,inProgressRecords:j.filter(function(e){return"in_progress"===e.status}).length,totalSales:el.reduce(function(e,t){return e+(t.totalSales||0)},0),totalHours:el.reduce(function(e,t){return e+(t.workingHours||0)},0),totalCashDifference:el.reduce(function(e,t){var s;return e+((null===(s=t.clockOut)||void 0===s?void 0:s.cashDifference)||0)},0)}),ed=20*K,eo=ed-20,eu=j.slice(eo,ed),ex=Math.ceil(j.length/20);return(0,r.jsx)(i.Z,{children:(0,r.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,r.jsxs)("div",{className:"mb-6",children:[(0,r.jsx)("h1",{className:"text-2xl font-bold text-gray-900",children:"打卡記錄查詢"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"查看所有員工的打卡記錄與統計"})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6",children:[(0,r.jsxs)("div",{className:"bg-white rounded-lg shadow p-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm text-gray-500",children:"總記錄數"}),(0,r.jsx)("p",{className:"text-2xl font-bold text-gray-900",children:ei.totalRecords})]}),(0,r.jsx)(d.Z,{className:"w-8 h-8 text-blue-500"})]}),(0,r.jsxs)("div",{className:"mt-2 text-xs text-gray-500",children:["進行中: ",ei.inProgressRecords," / 已完成: ",ei.completedRecords]})]}),(0,r.jsxs)("div",{className:"bg-white rounded-lg shadow p-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm text-gray-500",children:"總工作時數"}),(0,r.jsx)("p",{className:"text-2xl font-bold text-gray-900",children:ei.totalHours.toFixed(1)})]}),(0,r.jsx)(o.Z,{className:"w-8 h-8 text-green-500"})]}),(0,r.jsx)("div",{className:"mt-2 text-xs text-gray-500",children:"已完成班次的總時數"})]}),(0,r.jsxs)("div",{className:"bg-white rounded-lg shadow p-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm text-gray-500",children:"總銷售額"}),(0,r.jsx)("p",{className:"text-2xl font-bold text-gray-900",children:es(ei.totalSales)})]}),(0,r.jsx)(u.Z,{className:"w-8 h-8 text-purple-500"})]}),(0,r.jsx)("div",{className:"mt-2 text-xs text-gray-500",children:"已完成班次的總業績"})]}),(0,r.jsxs)("div",{className:"bg-white rounded-lg shadow p-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm text-gray-500",children:"現金差異"}),(0,r.jsxs)("p",{className:"text-2xl font-bold ".concat(0===ei.totalCashDifference?"text-green-600":ei.totalCashDifference>0?"text-blue-600":"text-red-600"),children:[ei.totalCashDifference>0?"+":"",es(ei.totalCashDifference)]})]}),(0,r.jsx)(x.Z,{className:"w-8 h-8 text-orange-500"})]}),(0,r.jsx)("div",{className:"mt-2 text-xs text-gray-500",children:"累計現金差異總額"})]})]}),(0,r.jsxs)("div",{className:"bg-white rounded-lg shadow mb-6",children:[(0,r.jsx)("div",{className:"p-4 border-b",children:(0,r.jsxs)("button",{onClick:function(){return W(!T)},className:"flex items-center justify-between w-full text-left",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(h.Z,{className:"w-5 h-5"}),(0,r.jsx)("span",{className:"font-semibold",children:"篩選條件"})]}),T?(0,r.jsx)(m.Z,{className:"w-5 h-5"}):(0,r.jsx)(p.Z,{className:"w-5 h-5"})]})}),T&&(0,r.jsxs)("div",{className:"p-4",children:[(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"員工"}),(0,r.jsxs)("select",{value:D,onChange:function(e){_(e.target.value),Q(1)},className:"w-full px-3 py-2 border rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[(0,r.jsx)("option",{value:"",children:"全部員工"}),N.map(function(e){return(0,r.jsxs)("option",{value:e._id,children:[e.name," (",e.employeeCode,")"]},e._id)})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"狀態"}),(0,r.jsxs)("select",{value:H,onChange:function(e){A(e.target.value),Q(1)},className:"w-full px-3 py-2 border rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[(0,r.jsx)("option",{value:"",children:"全部狀態"}),(0,r.jsx)("option",{value:"in_progress",children:"進行中"}),(0,r.jsx)("option",{value:"completed",children:"已完成"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"開始日期"}),(0,r.jsx)("input",{type:"date",value:L,onChange:function(e){E(e.target.value),Q(1)},className:"w-full px-3 py-2 border rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"結束日期"}),(0,r.jsx)("input",{type:"date",value:V,onChange:function(e){q(e.target.value),Q(1)},className:"w-full px-3 py-2 border rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"})]})]}),(0,r.jsx)("div",{className:"mt-4 flex justify-end",children:(0,r.jsx)("button",{onClick:ec,className:"px-4 py-2 text-sm text-gray-600 hover:text-gray-800 hover:bg-gray-100 rounded-lg transition-colors",children:"清除篩選"})})]})]}),(0,r.jsxs)("div",{className:"bg-white rounded-lg shadow overflow-hidden",children:[(0,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsxs)("table",{className:"w-full",children:[(0,r.jsx)("thead",{className:"bg-gray-50 border-b",children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"日期"}),(0,r.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"員工"}),(0,r.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"上班時間"}),(0,r.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"下班時間"}),(0,r.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"工時"}),(0,r.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"銷售額"}),(0,r.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"現金差異"}),(0,r.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"狀態"}),(0,r.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"操作"})]})}),(0,r.jsx)("tbody",{className:"divide-y divide-gray-200",children:w?(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:9,className:"px-6 py-4 text-center text-gray-500",children:"載入中..."})}):0===eu.length?(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:9,className:"px-6 py-4 text-center text-gray-500",children:"沒有找到打卡記錄"})}):eu.map(function(e){var t,s;return(0,r.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,r.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:en(e.date)}),(0,r.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:er(e.employeeId)}),(0,r.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:e.clockIn?ea(e.clockIn.time):"-"}),(0,r.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:(null===(t=e.clockOut)||void 0===t?void 0:t.t
16ime)?ea(e.clockOut.time):"-"}),(0,r.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:e.workingHours?"".concat(e.workingHours.toFixed(1),"h"):"-"}),(0,r.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:e.totalSales?es(e.totalSales):"-"}),(0,r.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:(null===(s=e.clockOut)||void 0===s?void 0:s.cashDifference)!==void 0?(0,r.jsxs)("span",{className:"font-medium ".concat(0===e.clockOut.cashDifference?"text-green-600":e.clockOut.cashDifference>0?"text-blue-600":"text-red-600"),children:[e.clockOut.cashDifference>0?"+":"",es(e.clockOut.cashDifference)]}):"-"}),(0,r.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,r.jsx)("span",{className:"px-2 py-1 text-xs rounded-full ".concat("completed"===e.status?"bg-green-100 text-green-800":"bg-blue-100 text-blue-800"),children:"completed"===e.status?"已完成":"進行中"})}),(0,r.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:(0,r.jsx)("button",{onClick:function(){$(e),G(!0)},className:"text-blue-600 hover:text-blue-800",children:"查看詳情"})})]},e._id)})})]})}),ex>1&&(0,r.jsxs)("div",{className:"px-6 py-4 border-t flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"text-sm text-gray-500",children:["顯示 ",eo+1," - ",Math.min(ed,j.length)," / 共 ",j.length," 筆"]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("button",{onClick:function(){return Q(function(e){return Math.max(1,e-1)})},disabled:1===K,className:"px-3 py-1 border rounded-lg disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50",children:"上一頁"}),(0,r.jsxs)("span",{className:"px-3 py-1",children:["第 ",K," / ",ex," 頁"]}),(0,r.jsx)("button",{onClick:function(){return Q(function(e){return Math.min(ex,e+1)})},disabled:K===ex,className:"px-3 py-1 border rounded-lg disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50",children:"下一頁"})]})]})]}),X&&B&&(0,r.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:(0,r.jsxs)("div",{className:"bg-white rounded-lg max-w-2xl w-full max-h-[90vh] overflow-y-auto",children:[(0,r.jsxs)("div",{className:"p-6 border-b flex items-center justify-between sticky top-0 bg-white",children:[(0,r.jsx)("h3",{className:"text-xl font-bold",children:"打卡記錄詳情"}),(0,r.jsx)("button",{onClick:function(){return G(!1)},className:"p-2 hover:bg-gray-100 rounded-lg",children:(0,r.jsx)(f.Z,{className:"w-5 h-5"})})]}),(0,r.jsxs)("div",{className:"p-6 space-y-6",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-gray-700 mb-3",children:"基本資訊"}),(0,r.jsxs)("div",{className:"bg-gray-50 rounded-lg p-4 space-y-2",children:[(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{className:"text-gray-600",children:"員工"}),(0,r.jsx)("span",{className:"font-medium",children:er(B.employeeId)})]}),(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{className:"text-gray-600",children:"日期"}),(0,r.jsx)("span",{className:"font-medium",children:en(B.date)})]}),(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{className:"text-gray-600",children:"狀態"}),(0,r.jsx)("span",{className:"font-medium ".concat("completed"===B.status?"text-green-600":"text-blue-600"),children:"completed"===B.status?"已完成":"進行中"})]})]})]}),B.clockIn&&(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-gray-700 mb-3",children:"上班打卡"}),(0,r.jsxs)("div",{className:"bg-gray-50 rounded-lg p-4 space-y-2",children:[(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{className:"text-gray-600",children:"打卡時間"}),(0,r.jsx)("span",{className:"font-medium",children:ea(B.clockIn.time)})]}),(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{className:"text-gray-600",children:"起始現金"}),(0,r.jsx)("span",{className:"font-medium",children:es(B.clockIn.startCash)})]}),B.clockIn.scratchOffCount&&(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{className:"text-gray-600",children:"刮刮樂數量"}),(0,r.jsxs)("span",{className:"font-medium",children:[B.clockIn.scratchOffCount.books," 本 / ",B.clockIn.scratchOffCount.sheets," 張"]})]}),B.clockIn.notes&&(0,r.jsxs)("div",{className:"pt-2 border-t",children:[(0,r.jsx)("span",{className:"text-gray-600 block mb-1",children:"備註"}),(0,r.jsx)("span",{className:"font-medium",children:B.clockIn.notes})]})]})]}),B.clockOut&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-gray-700 mb-3",children:"下班打卡"}),(0,r.jsxs)("div",{className:"bg-gray-50 rounded-lg p-4 space-y-2",children:[(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{className:"text-gray-600",children:"打卡時間"}),(0,r.jsx)("span",{className:"font-medium",children:ea(B.clockOut.time)})]}),(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{className:"text-gray-600",children:"工作時數"}),(0,r.jsxs)("span",{className:"font-medium",children:[null===(e=B.workingHours)||void 0===e?void 0:e.toFixed(1)," 小時"]})]}),B.clockOut.scratchOffCount&&(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{className:"text-gray-600",children:"刮刮樂數量"}),(0,r.jsxs)("span",{className:"font-medium",children:[B.clockOut.scratchOffCount.books," 本 / ",B.clockOut.scratchOffCount.sheets," 張"]})]}),B.clockOut.notes&&(0,r.jsxs)("div",{className:"pt-2 border-t",children:[(0,r.jsx)("span",{className:"text-gray-600 block mb-1",children:"備註"}),(0,r.jsx)("span",{className:"font-medium",children:B.clockOut.notes})]})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-gray-700 mb-3",children:"業績統計"}),(0,r.jsxs)("div",{className:"bg-gray-50 rounded-lg p-4 space-y-2",children:[(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{className:"text-gray-600",children:"總銷售額"}),(0,r.jsx)("span",{className:"font-medium",children:es(B.totalSales||0)})]}),(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{className:"text-gray-600",children:"刮刮樂銷售"}),(0,r.jsx)("span",{className:"font-medium",children:es(B.scratchOffSales||0)})]}),(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{className:"text-gray-600",children:"彩券銷售"}),(0,r.jsx)("span",{className:"font-medium",children:es(B.lottoSales||0)})]}),(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{className:"text-gray-600",children:"總票數"}),(0,r.jsxs)("span",{className:"font-medium",children:[B.totalTickets||0," 張"]})]}),(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{className:"text-gray-600",children:"獎金支出"}),(0,r.jsx)("span",{className:"font-medium",children:es(B.prizePayout||0)})]})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"font-semibold text-gray-700 mb-3",children:"現金對帳"}),(0,r.jsxs)("div",{className:"bg-gray-50 rounded-lg p-4 space-y-2",children:[(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{className:"text-gray-600",children:"應有現金"}),(0,r.jsx)("span",{className:"font-medium",children:es(B.clockOut.endCash||0)})]}),(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{className:"text-gray-600",children:"實際現金"}),(0,r.jsx)("span",{className:"font-medium",children:es(B.clockOut.actualCash||0)})]}),(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{className:"text-gray-600",children:"現金差異"}),(0,r.jsxs)("span",{className:"font-bold ".concat(0===B.clockOut.cashDifference?"text-green-600":100>=Math.abs(B.clockOut.cashDifference||0)?"text-yellow-600":"text-red-600"),children:[B.clockOut.cashDifference>0?"+":"",es(B.clockOut.cashDifference||0)]})]}),B.clockOut.differenceCause&&(0,r.jsxs)("div",{className:"pt-2 border-t",children:[(0,r.jsx)("span",{className:"text-gray-600 block mb-1",children:"差異原因"}),(0,r.jsx)("span",{className:"font-medium",children:B.clockOut.differenceCause})]}),void 0!==B.clockOut.acceptDifference&&(0,r.jsxs)("div",{className:"pt-2 border-t",children:[(0,r.jsx)("span",{className:"text-gray-600 block mb-1",children:"員工承諾"}),(0,r.jsx)("span",{className:"font-medium ".concat(B.clockOut.acceptDifference?"text-green-600":"text-red-600"),children:B.clockOut.acceptDifference?"✓ 已承諾承擔差異":"✗ 未承諾"})]})]})]})]})]})]})})]})})}}},function(e){e.O(0,[3996,8791,9774,2888,179],function(){return e(e.s=20168)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.