1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6373],{20900:(e,t,r)=>{"use strict";r.d(t,{Y:()=>n,v:()=>s});let s=e=>new Intl.NumberFormat("ja-JP",{style:"currency",currency:"JPY"}).format(e),n=e=>new Date(e).toLocaleDateString("ja-JP",{year:"numeric",month:"2-digit",day:"2-digit"})},26023:(e,t,r)=>{"use strict";r.d(t,{l:()=>s});let s=(e,t)=>e.map(e=>{var r,s;return null!=(s=null==(r=t.find(t=>t.id===e))?void 0:r.name)?s:String(e)}).join("ã")},43013:(e,t,r)=>{"use strict";r.d(t,{O:()=>s});let s={labelRowsPerPage:"表示件æ°:",labelDisplayedRows:e=>{let{from:t,to:r,count:s}=e;return"".concat(t,"â").concat(r," / ").concat(-1!==s?s:"".concat(r,"+"),"ä»¶")}}},51712:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__N_SSG:()=>ey,default:()=>eb});var s=r(37876),n=r(89099),a=r(46520),l=r(65965),i=r(65657),o=r(34293),c=r(97268),d=r(75656),u=r(81256),x=r(56304),g=r(48230),h=r.n(g),m=r(91284),p=r(35078),_=r(13085),j=r(32643),y=r(82940),b=r(28155),A=r(28175),f=r(20900);let v=e=>{switch(e){case"preparing":return{label:"æºåä¸",bgcolor:"grey.100",textColor:"grey.600"};case"in_progress":return{label:"é²è¡ä¸",bgcolor:"rgba(255, 152, 0, 0.1)",textColor:"warning.main"};case"reconciling":return{label:"ç
§åä¸",bgcolor:"rgba(33, 150, 243, 0.1)",textColor:"info.main"};case"completed":return{label:"å®äº",bgcolor:"rgba(33, 158, 98, 0.1)",textColor:"primary.main"};case"cancelled":return{label:"ãã£ã³ã»ã«",bgcolor:"rgba(239, 68, 68, 0.1)",textColor:"error.main"};default:return{label:"䏿",bgcolor:"grey.100",textColor:"grey.600"}}},k=e=>{let t=(0,n.useRouter)(),r=v(e.status),l="in_progress"===e.status;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(m.A,{separator:(0,s.jsx)(y.A,{fontSize:"small"}),sx:{mb:2},children:[(0,s.jsx)(p.A,{component:h(),href:"/jmtyspot_admin/stocktakes",underline:"hover",color:"text.secondary",sx:{fontSize:"0.875rem"},children:"æ£å¸ãä¸è¦§"}),(0,s.jsx)(c.A,{color:"text.primary",sx:{fontSize:"0.875rem",fontWeight:500},children:e.categoryNames})]}),(0,s.jsxs)(a.A,{sx:{display:"flex",flexWrap:"wrap",justifyContent:"space-between",alignItems:"flex-end",gap:2,mb:4},children:[(0,s.jsxs)(a.A,{children:[(0,s.jsxs)(a.A,{sx:{display:"flex",alignItems:"center",gap:2,mb:1},children:[(0,s.jsx)(c.A,{variant:"h4",component:"h1",sx:{fontWeight:900,letterSpacing:"-0.025em"},children:"æ£å¸ã詳細"}),(0,s.jsx)(_.A,{label:r.label,size:"small",sx:{bgcolor:r.bgcolor,color:r.textColor,fontWeight:700}})]}),(0,s.jsxs)(a.A,{sx:{display:"flex",alignItems:"center",gap:1.5,flexWrap:"wrap"},children:[(0,s.jsx)(_.A,{label:"ã«ãã´ãªã¼: ".concat(e.categoryNames),size:"small",sx:{bgcolor:"rgba(33, 158, 98, 0.1)",color:"primary.main",fontWeight:700,fontSize:"0.75rem"}}),(0,s.jsx)(a.A,{sx:{width:4,height:4,borderRadius:"50%",bgcolor:"grey.300"}}),(0,s.jsxs)(c.A,{variant:"body2",color:"text.secondary",children:["éå§: ",(0,f.Y)(e.createdAt)]})]})]}),(0,s.jsx)(a.A,{sx:{display:"flex",gap:2,alignItems:"center"},children:l&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(j.A,{variant:"outlined",startIcon:(0,s.jsx)(b.A,{}),onClick:()=>t.push("/jmtyspot_admin/stocktakes/store_sections?stocktakeId=".concat(e.stocktakeId)),sx:{borderColor:"divider",color:"text.secondary",fontWeight:700,"&:hover":{borderColor:"primary.main",bgcolor:"rgba(33, 158, 98, 0.04)"}},children:"ã»ã¯ã·ã§ã³ã管çãã"}),(0,s.jsx)(j.A,{variant:"contained",startIcon:(0,s.jsx)(A.A,{}),onClick:e.onReconcile,disabled:e.isReconciling,sx:{fontWeight:700},children:e.isReconciling?"ç
§åä¸...":"ç
§åãã"}),(0,s.jsx)(a.A,{sx:{width:"1px",height:24,bgcolor:"divider",mx:1,flexShrink:0}}),(0,s.jsx)(j.A,{variant:"outlined",onClick:()=>t.push("/jmtyspot_admin/stocktakes/confirm?stocktakeId=".concat(e.stocktakeId)),sx:{borderColor:"divider",color:"text.secondary",fontWeight:700,"&:hover":{borderColor:"text.secondary",bgcolor:"grey.50"}},children:"確å®ç»é¢ã¸"})]})})]})]})};var w=r(14232),C=r(11054),S=r(45898),I=r(98895),R=r(71446),z=r(31181);let W={total_count:0,matched:0,not_scanned:0,closed:0,not_scanned_found:0,not_scanned_not_found:0,not_scanned_pending:0,not_scanned_unconfirmed_missing:0,total_amount:0,matched_amount:0,not_scanned_amount:0,difference_amount:0},P=e=>{var t;return(0,s.jsxs)(C.A,{sx:{p:3,borderRadius:2,border:"1px solid",borderColor:"divider"},children:[(0,s.jsx)(c.A,{variant:"caption",sx:{color:"text.secondary",fontWeight:700,letterSpacing:"0.05em",fontSize:"0.75rem"},children:e.label}),(0,s.jsx)(c.A,{variant:"h4",sx:{fontWeight:700,color:null!=(t=e.color)?t:"text.primary",mt:1},children:e.value})]})},F=e=>{let[t,r]=(0,w.useState)(""),{data:n,isLoading:i}=(0,d.Ay)(""===t?"/web_api/v1/jmty_spot/stocktakes/".concat(e.stocktakeId,"/summary"):"/web_api/v1/jmty_spot/stocktakes/".concat(e.stocktakeId,"/summary?municipality_category_id=").concat(t),async()=>{var r;return null==(r=(await (0,x.zc)("/web_api/v1/jmty_spot/stocktakes/{stocktake_id}/summary",{params:{path:{stocktake_id:e.stocktakeId},...""!==t&&{query:{municipality_category_id:parseInt(t,10)}}}})).data)?void 0:r.summary});if(i)return(0,s.jsx)(a.A,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,s.jsx)(l.A,{size:24})});let o=null!=n?n:W;return(0,s.jsxs)(a.A,{sx:{mb:4},children:[(0,s.jsx)(a.A,{sx:{mb:3},children:(0,s.jsxs)(S.A,{size:"small",children:[(0,s.jsx)(I.A,{id:"category-select-label",children:"ã«ãã´ãªã¼é¸æ"}),(0,s.jsxs)(R.A,{labelId:"category-select-label",id:"category-select",value:t,label:"ã«ãã´ãªã¼é¸æ",onChange:e=>{r(e.target.value)},sx:{minWidth:200},children:[(0,s.jsx)(z.A,{value:"",children:"ãã¹ã¦"}),e.categoryIds.map(t=>{var r;let n=e.categories.find(e=>e.id===t);return(0,s.jsx)(z.A,{value:t.toString(),children:null!=(r=null==n?void 0:n.name)?r:"ã«ãã´ãªã¼".concat(t)},t)})]})]})}),(0,s.jsxs)(a.A,{sx:{display:"grid",gridTemplateColumns:{xs:"repeat(2, 1fr)",md:"repeat(6, 1fr)"},gap:2,mb:2},children:[(0,s.jsx)(P,{label:"åè¨",value:o.total_count}),(0,s.jsx)(P,{label:"ä¸è´",value:o.matched,color:"primary.main"}),(0,s.jsx)(P,{label:"æªã¹ãã£ã³",value:o.not_scanned_pending,color:"warning.main"}),(0,s.jsx)(P,{label:"æªã¹ãã£ã³(æ¿èªå¾
ã¡)",value:o.not_scanned_unconfirmed_missing,color:"warning.dark"}),(0,s.jsx)(P,{label:"è²æ¸¡æ¸ã¿",value:o.closed,color:"text.secondary"}),(0,s.jsx)(P,{label:"å¨åº«ãªã",value:o.not_scanned_not_found,color:"error.main"})]}),(0,s.jsxs)(a.A,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"repeat(3, 1fr)"},gap:2},children:[(0,s.jsx)(P,{label:"æå¾
å¨åº«éé¡",value:(0,f.v)(o.total_amount)}),(0,s.jsx)(P,{label:"å®å¨åº«éé¡ï¼ä¸è´åï¼",value:(0,f.v)(o.matched_amount),color:"primary.main"}),(0,s.jsx)(P,{label:"å·®åéé¡",value:(0,f.v)(o.difference_amount),color:"error.main"})]})]})};var M=r(68474),O=r(451),N=r(78423),E=r(84676),T=r(9858),U=r(1413),D=r(12944),B=r(17366),L=r(78638),q=r(24375),H=r(80479),J=r(10183),Y=r(88537);let X={missing:"åºé ç´å¤±",created_by_mistake:"èª¤ä½æåå",closed:"販売çµäºåå"},G=()=>{let[e,t]=(0,w.useState)(!1),{enqueueSnackbar:r}=(0,J.dh)(),{handleAuthError:s}=(0,Y.M)();return{confirmMissing:async(e,n)=>{if(0===n.length)return r("æ´æ°ããã¢ã¤ãã ãããã¾ãã",{variant:"warning"}),!1;t(!0);try{let t=await (0,x.RF)("/web_api/v1/jmty_spot/stocktakes/{stocktake_id}/missing_report_confirmations",{params:{path:{stocktake_id:e}},body:{items:n.map(e=>
1({stocktake_item_id:e.stocktakeItemId,not_found_reason:e.notFoundReason}))},parseAs:"text"});if(!s(t.response))return!1;if(!t.response.ok){var a,l;let e=t.data,s=null!=(l=null==e||null==(a=e.error)?void 0:a.message)?l:"ã¹ãã¼ã¿ã¹æ´æ°ã«å¤±æãã¾ãã";return r(s,{variant:"error"}),!1}return r("".concat(n.length,"ä»¶ã®ã¹ãã¼ã¿ã¹ãæ´æ°ãã¾ãã"),{variant:"success"}),!0}catch(e){return r("ãããã¯ã¼ã¯ã¨ã©ã¼ãçºçãã¾ãã",{variant:"error"}),!1}finally{t(!1)}},isSubmitting:e}},K=e=>{switch(e){case"matched":return{result_status:"matched"};case"not_scanned":return{result_status:"not_scanned",check_status:"pending"};case"check_unconfirmed_missing":return{result_status:"not_scanned",check_status:"unconfirmed_missing"};case"closed":return{result_status:"closed"};case"check_not_found":return{result_status:"not_scanned",check_status:"not_found"};default:return{}}},Q=e=>{var t,r;let[s,n]=(0,w.useState)("all"),[a,l]=(0,w.useState)(0),[i,o]=(0,w.useState)(50),[c,u]=(0,w.useState)(""),[g,h]=(0,w.useState)("asc"),[m,p]=(0,w.useState)({}),{confirmMissing:_,isSubmitting:j}=G(),{data:y,isLoading:b,error:A,mutate:f}=(0,d.Ay)("/web_api/v1/jmty_spot/stocktakes/".concat(e,"/stocktake_items?filter=").concat(s,"&page=").concat(a+1,"&per_page=").concat(i,"&sort=").concat(c,"&order=").concat(g),async()=>{var t,r,n,l;let o=await (0,x.zc)("/web_api/v1/jmty_spot/stocktakes/{stocktake_id}/stocktake_items",{params:{path:{stocktake_id:e},query:{page:a+1,per_page:i,...K(s),sort_by:c||void 0,order:c?g:void 0}}});if(!o.response.ok)throw Error("Failed to fetch stocktake items");return{items:null!=(n=null==(t=o.data)?void 0:t.stocktake_items)?n:[],totalCount:null!=(l=null==(r=o.data)?void 0:r.total_count)?l:0}}),v=null!=(t=null==y?void 0:y.items)?t:[],k=null!=(r=null==y?void 0:y.totalCount)?r:0,C=v.filter(e=>"not_scanned"===e.result_status&&"unconfirmed_missing"===e.check_status).length,S=v.filter(e=>"not_scanned"===e.result_status&&"unconfirmed_missing"===e.check_status&&!m[e.id]).length,I=async()=>{let t=v.filter(e=>"not_scanned"===e.result_status&&"unconfirmed_missing"===e.check_status).map(e=>{var t;return{stocktakeItemId:e.id,notFoundReason:null!=(t=m[e.id])?t:"missing"}});await _(e,t)&&(p({}),f())};return{items:v,totalCount:k,isLoading:b,error:A,filter:s,sortField:c,sortOrder:g,page:a,rowsPerPage:i,pendingChanges:m,pendingChangeCount:C,bulkUpdateTargetCount:S,handleFilterChange:e=>{n(e),l(0)},handleSortChange:(e,t)=>
1{u(e),h(t),l(0)},handlePageChange:e=>{l(e)},handleRowsPerPageChange:e=>{o(e),l(0)},handleReasonChange:(e,t)=>{if(""===t)return void p(t=>{let r={...t};return delete r[e],r});p(r=>({...r,[e]:t}))},handleBulkSelectMissing:e=>{let t={...m};v.filter(e=>"not_scanned"===e.result_status&&"unconfirmed_missing"===e.check_status).forEach(r=>{t[r.id]=e}),p(t)},handleSubmitChanges:I,isSubmitting:j}},V=e=>{var t,r,s;return null!=(s=null!=(r=e.snapshot_price)?r:null==(t=e.reuse_item)?void 0:t.price)?s:null};var Z=r(97625),$=r(43013),ee=r(94527),et=r(35582);let er=e=>(0,s.jsx)(i.A,{open:e.open,onClose:e.onClose,maxWidth:"md",children:(0,s.jsxs)(o.A,{sx:{p:0,position:"relative"},children:[(0,s.jsx)(ee.A,{onClick:e.onClose,sx:{position:"absolute",top:8,right:8,bgcolor:"rgba(0, 0, 0, 0.5)",color:"white","&:hover":{bgcolor:"rgba(0, 0, 0, 0.7)"}},children:(0,s.jsx)(et.A,{})}),e.imageUrl&&(0,s.jsx)(a.A,{component:"img",src:e.imageUrl,alt:e.title,sx:{display:"block",maxWidth:"100%",maxHeight:"80vh",objectFit:"contain"}})]})});var es=r(63900),en=r(30382),ea=r(69964);let el=e=>{let t=t=>{if(t){let[r,s]=t.split("_");e.onSortChange(r,s)}else e.onSortChange("","asc")},r=e.sortField?"".concat(e.sortField,"_").concat(e.sortOrder):"",n=!e.isReadOnly&&("not_scanned"===e.filter||"check_unconfirmed_missing"===e.filter);return(0,s.jsxs)(C.A,{sx:{p:2,mb:2,borderRadius:2,display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:2},children:[(0,s.jsxs)(a.A,{sx:{display:"flex",alignItems:"center",gap:2,flexWrap:"wrap"},children:[(0,s.jsxs)(es.A,{value:e.filter,exclusive:!0,onChange:(t,r)=>{null!==r&&e.onFilterChange(r)},size:"small",sx:{bgcolor:"grey.100",p:.5,borderRadius:1,"& .MuiToggleButton-root":{border:"none",borderRadius:1,px:2,py:.75,fontSize:"0.75rem",fontWeight:500,"&.Mui-selected":{bgcolor:"white",boxShadow:1,fontWeight:700}}},children:[(0,s.jsx)(en.A,{value:"all",children:"ãã¹ã¦"}),(0,s.jsx)(en.A,{value:"matched",children:"ä¸è´"}),(0,s.jsx)(en.A,{value:"not_scanned",children:"æªã¹ãã£ã³"}),(0,s.jsx)(en.A,{value:"check_unconfirmed_missing",children:"æªã¹ãã£ã³(æ¿èªå¾
ã¡)"}),(0,s.jsx)(en.A,{value:"closed",children:"è²æ¸¡æ¸ã¿"}),(0,s.jsx)(en.A,{value:"check_not_found",children:"å¨åº«ãªã"})]}),(0,s.jsxs)(a.A,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,s.jsx)(c.A,{variant:"body2",color:"text.secondary",sx:{fontSize:"0.75rem"},children:"ä¸¦ã³æ¿ã:"}),(0,s.jsx)(S.A,{size:"small",sx:{minWidth:120},children:(0,s.jsxs)(R.A,{value:r,onChange:e=>t(e.target.value),displayEmpty:!0,sx:{fontSize:"0.75rem","& .MuiSelect-select":{py:.75}},children:[(0,s.jsx)(z.A,{value:"",children:"ããã©ã«ã"}),(0,s.jsx)(z.A,{value:"price_asc",children:"éé¡ï¼å®ãé ï¼"}),(0,s.jsx)(z.A,{value:"price_desc",children:"éé¡ï¼é«ãé ï¼"}),(0,s.jsx)(z.A,{value:"category_asc",children:"ã«ãã´ãªã¼ï¼æé ï¼"}),(0,s.jsx)(z.A,{value:"category_desc",children:"ã«ãã´ãªã¼ï¼éé ï¼"})]})})]})]}),n&&(0,s.jsxs)(j.A,{variant:"outlined",color:"error",size:"small",startIcon:(0,s.jsx)(ea.A,{}),onClick:()=>e.onBulkSelectMissing("missing"),disabled:0===e.bulkUpdateTargetCount,sx:{fontWeight:600,borderColor:"error.main","&:hover":{bgcolor:"error.50",borderColor:"error.dark"},"&.Mui-disabled":{borderColor:"grey.300",color:"grey.400"}},children:["ãã¹ã¦åºé ç´å¤±ã«ããï¼",e.bulkUpdateTargetCount,"ä»¶ï¼"]})]})};var ei=r(81567);let eo=e=>(0,s.jsxs)(a.A,{sx:{...Z.v,display:"flex",justifyContent:"flex-end",alignItems:"center",gap:2},children:[e.pendingChangeCount>0&&(0,s.jsxs)(c.A,{variant:"body2",color:"text.secondary",children:[e.pendingChangeCount,"ä»¶ã®å¤æ´ãããã¾ã"]}),(0,s.jsx)(j.A,{variant:"contained",size:"large",startIcon:(0,s.jsx)(ei.A,{}),onClick:e.onSubmit,disabled:e.isSubmitting,sx:{px:4,py:1.5,fontWeight:700,boxShadow:"0 4px 14px rgba(33, 158, 98, 0.3)"},children:e.isSubmitting?"æ´æ°ä¸...":"ã¹ãã¼ã¿ã¹æ´æ°"})]}),ec=e=>{switch(e){case"matched":return{label:"ä¸è´",color:"success"};case"not_scanned":return{label:"æªã¹ãã£ã³",color:"warning"};case"closed":return{label:"è²æ¸¡æ¸ã¿",color:"default"};
1case"pending":return{label:"ç
§åä¸",color:"default"};default:return{label:"䏿",color:"default"}}},ed=(e,t)=>"matched"===t||"found"===e||"not_found"===e?(0,s.jsx)(B.A,{sx:{color:"primary.main"}}):"unconfirmed_missing"===e?(0,s.jsx)(L.A,{sx:{color:"warning.main"}}):(0,s.jsx)(q.A,{sx:{color:"text.disabled"}}),eu={...Z.r,fontSize:"0.625rem"},ex=e=>{var t,r,n;let[i,o]=(0,w.useState)(null),{items:d,totalCount:u,isLoading:x,error:g,filter:h,sortField:m,sortOrder:p,page:j,rowsPerPage:y,pendingChanges:b,pendingChangeCount:A,bulkUpdateTargetCount:v,handleFilterChange:k,handleSortChange:I,handlePageChange:W,handleRowsPerPageChange:P,handleReasonChange:F,handleBulkSelectMissing:B,handleSubmitChanges:L,isSubmitting:q}=Q(e.stocktakeId);return(0,s.jsxs)(a.A,{children:[(0,s.jsx)(el,{filter:h,sortField:m,sortOrder:p,onFilterChange:k,onSortChange:I,isReadOnly:e.isReadOnly,bulkUpdateTargetCount:v,onBulkSelectMissing:B}),(0,s.jsxs)(C.A,{sx:{borderRadius:2,overflow:"hidden"},children:[x?(0,s.jsx)(a.A,{sx:{display:"flex",justifyContent:"center",py:8},children:(0,s.jsx)(l.A,{})}):g?(0,s.jsx)(a.A,{sx:{py:8,textAlign:"center"},children:(0,s.jsx)(c.A,{color:"error",children:"ãã¼ã¿ã®åå¾ã«å¤±æãã¾ãã"})}):0===d.length?(0,s.jsx)(a.A,{sx:{py:8,textAlign:"center"},children:(0,s.jsx)(c.A,{color:"text.secondary",children:"ã¢ã¤ãã ãããã¾ãã"})}):(0,s.jsx)(M.A,{sx:{maxHeight:600},children:(0,s.jsxs)(O.A,{stickyHeader:!0,size:"small",children:[(0,s.jsx)(N.A,{children:(0,s.jsxs)(E.A,{sx:{bgcolor:"grey.50"},children:[(0,s.jsx)(T.A,{sx:eu,children:"管ççªå·"}),(0,s.jsx)(T.A,{sx:{...eu,textAlign:"center",width:64},children:"ç»å"}),(0,s.jsx)(T.A,{sx:eu,children:"ååå"}),(0,s.jsx)(T.A,{sx:eu,children:"ã«ãã´ãªã¼"}),(0,s.jsx)(T.A,{sx:{...eu,textAlign:"right"},children:"çµéæ¥æ°"}),(0,s.jsx)(T.A,{sx:{...eu,textAlign:"right"},children:"éé¡"}),(0,s.jsx)(T.A,{sx:{...eu,textAlign:"center"},children:"åä»çµäº"}),(0,s.jsx)(T.A,{sx:{...eu,textAlign:"center"},children:"ç
§åçµæ"}),(0,s.jsx)(T.A,{sx:{...eu,textAlign:"center"},children:"確èªç¶æ³"}),(0,s.jsx)(T.A,{sx:{...eu,textAlign:"center"},children:"ã¹ãã¼ã¿ã¹æ´æ°"})]})}),(0,s.jsx)(U.A,{children:d.map(t=>{var r,n,l,i,d,u,x,g,h,m,p,j,y,A;let v="closed"===t.result_status,k="not_scanned"===t.result_status,w="not_found"===t.check_status,C=ec(t.result_status),I=V(t);return(0,s.jsxs)(E.A,{sx:{bgcolor:w?"rgba(239, 68, 68, 0.06)":k?"rgba(255, 152, 0, 0.04)":v?"grey.50":"transparent",opacity:v?.6:1,"&:hover":{bgcolor:w?"rgba(239, 68, 68, 0.1)":k?"rgba(255, 152, 0, 0.08)":"grey.50"}},children:[(0,s.jsx)(T.A,{children:(0,s.jsx)(c.A,{variant:"body2",sx:{fontFamily:"monospace",color:"text.secondary"},children:null!=(h=null==(r=t.reuse_item)?void 0:r.management_code)?h:t.reuse_item_id})}),(0,s.jsx)(T.A,{sx:{textAlign:"center"},children:(0,s.jsx)(a.A,{onClick:()=>{var e,r;(null==(e=t.reuse_item)?void 0:e.image_url)&&o({url:t.reuse_item.image_url,title:null!=(r=t.reuse_item.title)?r:""})},sx:{width:40,height:40,bgcolor:"grey.200",borderRadius:1,display:"flex",alignItems:"center",justifyContent:"center",mx:"auto",overflow:"hidden",cursor:(null==(n=t.reuse_item)?void 0:n.image_url)?"pointer":"default",transition:"transform 0.2s","&:hover":(null==(l=t.reuse_item)?void 0:l.image_url)?{transform:"scale(1.1)"}:{}},children:(null==(i=t.reuse_item)?void 0:i.image_url)?(0,s.jsx)(a.A,{component:"img",src:t.reuse_item.image_url,alt:t.reuse_item.title,sx:{width:"100%",height:"100%",objectFit:"cover"}}):(0,s.jsx)(H.A,{sx:{color:"text.disabled"}})})}),(0,s.jsx)(T.A,{children:(0,s.jsx)(c.A,{variant:"body2",sx:{fontWeight:600},children:null!=(m=null==(d=t.reuse_item)?void 0:d.title)?m:"â"})}),(0,s.jsx)(T.A,{children:(0,s.jsx)(c.A,{variant:"body2",color:"text.secondary",children:null!=(p=null==(u=t.reuse_item)?void 0:u.municipality_category_name)?p:"â"})}),(0,s.jsx)(T.A,{sx:{textAlign:"right"},children:(0,s.jsx)(c.A,{variant:"body2",color:"text.secondary",children:(null==(x=t.reuse_item)?void 0:x.days_since_created)!=null?"".concat(t.reuse_item.days_since_created,"æ¥"):"â"})}),(0,s.jsx)(T.A,{sx:{textAlign:"right"},children:(0,s.jsx)(c.A,{variant:"body2",sx:{fontWeight:500},children:null!=I?(0,f.v)(I):"â"})}),(0,s.jsx)(T.A,{sx:{textAlign:"center"},children:(null==(g=t.reuse_item)?void 0:g.closed_by_owner)&&(0,s.jsx)(_.A,{label:"çµäº",size:"small",sx:{bgcolor:"grey.400",color:"white",fontWeight:600,fontSize:"0.7rem"}})}),(0,s.jsx)(T.A,{sx:{textAlign:"center"},children:(0,s.jsx)(_.A,{label:C.label,color:C.color,size:"small",sx:{fontWeight:600,fontSize:"0.7rem"}})}),(0,s.jsx)(T.A,{sx:{textAlign:"center"},children:ed(t.check_status,t.result_status)}),(0,s.jsxs)(T.A,{sx:{textAlign:"center"},children:[!(null!=(j=e.isReadOnly)&&j)&&k&&"unconfirmed_missing"===t.check_status&&(0,s.jsx)(S.A,{size:"small",sx:{minWidth:120},onClick:e=>e.stopPropagation(),children:(0,s.jsxs)(R.A,{value:null!=(A=null!=(y=b[t.id])?y:t.not_found_reason)?A:"missing",onCh
1ange:e=>F(t.id,e.target.value),onOpen:e=>e.stopPropagation(),sx:{fontSize:"0.75rem","& .MuiSelect-select":{py:.5}},children:[(0,s.jsx)(z.A,{value:"missing",children:X.missing}),(0,s.jsx)(z.A,{value:"created_by_mistake",children:X.created_by_mistake}),(0,s.jsx)(z.A,{value:"closed",children:X.closed})]})}),w&&t.not_found_reason&&(0,s.jsx)(S.A,{size:"small",sx:{minWidth:120},children:(0,s.jsxs)(R.A,{value:t.not_found_reason,disabled:!0,sx:{fontSize:"0.75rem","& .MuiSelect-select":{py:.5},"&.Mui-disabled":{bgcolor:"grey.100"}},children:[(0,s.jsx)(z.A,{value:"missing",children:X.missing}),(0,s.jsx)(z.A,{value:"created_by_mistake",children:X.created_by_mistake}),(0,s.jsx)(z.A,{value:"closed",children:X.closed})]})})]})]},t.id)})})]})}),!x&&!g&&d.length>0&&(0,s.jsx)(D.A,{component:"div",count:u,page:j,onPageChange:(e,t)=>W(t),rowsPerPage:y,onRowsPerPageChange:e=>P(parseInt(e.target.value,10)),rowsPerPageOptions:[10,25,50],labelRowsPerPage:$.O.labelRowsPerPage,labelDisplayedRows:$.O.labelDisplayedRows})]}),!(null!=(t=e.isReadOnly)&&t)&&(0,s.jsx)(eo,{pendingChangeCount:A,isSubmitting:q,onSubmit:L}),(0,s.jsx)(er,{open:null!==i,imageUrl:null!=(r=null==i?void 0:i.url)?r:null,title:null!=(n=null==i?void 0:i.title)?n:"",onClose:()=>o(null)})]})};var eg=r(40652),eh=r(3429),em=r(62558);let ep=e=>{let t=e.isPreparing?{title:"æ£å¸ããæºåä¸...",subtitle:"ç
§åå¦çãå®äºããã¾ã§ãå¾
ã¡ãã ãã",footerLabel:"ãã¼ã¿åæä¸...",footerMessage:"ãªã¢ã«ã¿ã¤ã ã§ãã¼ã¿ãåæä¸ã§ãããã°ãããå¾
ã¡ãã ããã"}:{title:"ç
§åå¦çä¸...",subtitle:"å¨åº«ãã¼ã¿ãç
§åãã¦ãã¾ã",footerLabel:"ç
§åä¸...",footerMessage:"ç
§åãå®äºããã¾ã§ãã°ãããå¾
ã¡ãã ããã"};return(0,s.jsxs)(a.A,{children:[(0,s.jsxs)(m.A,{separator:(0,s.jsx)(y.A,{fontSize:"small"}),sx:{mb:2},children:[(0,s.jsx)(p.A,{component:h(),href:"/jmtyspot_admin/stocktakes",underline:"hover",color:"text.secondary",sx:{fontSize:"0.875rem"},children:"æ£å¸ãä¸è¦§"}),(0,s.jsx)(c.A,{color:"text.primary",sx:{fontSize:"0.875rem",fontWeight:500},children:e.categoryNames})]}),(0,s.jsxs)(a.A,{sx:{mb:4},children:[(0,s.jsx)(c.A,{variant:"h4",component:"h1",sx:{fontWeight:900,letterSpacing:"-0.025em",mb:1},children:"æ£å¸ã詳細"}),(0,s.jsx)(c.A,{color:"text.secondary",children:"ãã¼ã¿ãåæä¸ã§ã..."})]}),(0,s.jsxs)(a.A,{sx:{py:8,textAlign:"center",bgcolor:"background.paper",borderRadius:3,border:"1px solid",borderColor:"divider"},children:[(0,s.jsx)(eh.A,{sx:{fontSize:48,color:"primary.main",animation:"spin 2s linear infinite","@keyframes spin":{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}}}}),(0,s.jsx)(c.A,{variant:"h6",sx:{mt:2,fontWeight:600},children:t.title}),(0,s.jsx)(c.A,{color:"text.secondary",sx:{mt:1},children:t.subtitle})]}),(0,s.jsx)(a.A,{sx:{...Z.v,display:"flex",alignItems:"center",justifyContent:"space-between"},children:(0,s.jsxs)(a.A,{sx:{display:"flex",alignItems:"center",gap:3},children:[(0,s.jsxs)(a.A,{children:[(0,s.jsxs)(a.A,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[(0,s.jsx)(c.A,{variant:"caption",sx:{fontWeight:700,color:"text.secondary",letterSpacing:"0.1em",fontSize:"0.625rem"},children:t.footerLabel}),(0,s.jsx)(a.A,{sx:{width:6,height:6,bgcolor:"primary.main",borderRadius:"50%",animation:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite","@keyframes ping":{"75%, 100%":{transform:"scale(2)",opacity:0}
1}}})]}),(0,s.jsxs)(a.A,{sx:{display:"flex",alignItems:"center",gap:2},children:[(0,s.jsx)(a.A,{sx:{width:256,height:10,bgcolor:"grey.100",borderRadius:5,overflow:"hidden",border:"1px solid",borderColor:"divider"},children:(0,s.jsx)(eg.A,{variant:"indeterminate",sx:{height:"100%",bgcolor:"transparent","& .MuiLinearProgress-bar":{bgcolor:"primary.main"}}})}),(0,s.jsx)(c.A,{variant:"body2",sx:{fontWeight:700,color:"primary.main"},children:e.isPreparing?"æºåä¸...":"ç §åä¸..."})]})]}),(0,s.jsx)(a.A,{sx:{width:1,height:40,bgcolor:"divider"}}),(0,s.jsxs)(a.A,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,s.jsx)(em.A,{sx:{fontSize:20,color:"primary.main"}}),(0,s.jsx)(c.A,{variant:"body2",color:"text.secondary",children:t.footerMessage})]})]})})]})},e_=()=>{let[e,t]=(0,w.useState)(!1),{enqueueSnackbar:r}=(0,J.dh)(),{handleAuthError:s}=(0,Y.M)();return{reconcile:async e=>{t(!0);try{let{data:t,response:l}=await (0,x.RF)("/web_api/v1/jmty_spot/stocktakes/{stocktake_id}/reconciliations",{params:{path:{stocktake_id:e}}});if(!s(l))return!1;if(!l.ok){var n,a;let e=null!=(a=null==t||null==(n=t.error)?void 0:n.message)?a:"ç §åå¦çã«å¤±æãã¾ãã";return r(e,{variant:"error"}),!1}return r("ç §åå¦çãéå§ãã¾ãã",{variant:"success"}),!0}finally{t(!1)}},isReconciling:e}};var ej=r(26023),ey=!0;let eb=()=>{let e=(0,n.useRouter)(),t=e.query.stocktakeId,{data:r}=(0,u.A)("/web_api/v1/jmty_spot/municipality_categories",async()=>{var e,t;return null!=(t=null==(e=(await (0,x.zc)("/web_api/v1/jmty_spot/municipality_categories",{})).data)?void 0:e.categories)?t:[]}),{data:g,isLoading:h,mutate:m}=(0,d.Ay)(e.isReady&&t?"/web_api/v1/jmty_spot/stocktakes/".concat(t):null,async()=>{var e;return null==(e=(await (0,x.zc)("/web_api/v1/jmty_spot/stocktakes/{id}",{params:{path:{id:t}}})).data)?void 0:e.stocktake},{onErrorRetry:()=>{},refreshInterval:e=>{let t=null==e?void 0:e.status;return 3e3*("preparing"===t||"reconciling"===t)}}),{reconcile:p,isReconciling:_}=e_(),j=async()=>{await p(t)&&m()};if(!e.isReady||!t)return null;if(h||!g)return(0,s.jsx)(a.A,{sx:{display:"flex",justifyContent:"center",py:8},children:(0,s.jsx)(l.A,{})});let y=g.status,b=(0,ej.l)(g.category_ids,null!=r?r:[]),A="in_progress"===y,f="preparing"===y,v="reconciling"===y;return f||v?(0,s.jsx)(ep,{categoryNames:b,isPreparing:f}):(0,s.jsxs)(a.A,{sx:{pb:12*!!A},children:[(0,s.jsx)(k,{stocktakeId:t,categoryNames:b,status:y,createdAt:g.created_at,isReconciling:_,onReconcile:j}),(0,s.jsx)(F,{stocktakeId:t,categoryIds:g.category_ids,categories:null!=r?r:[]}),(0,s.jsx)(ex,{stocktakeId:t,isReadOnly:"completed"===y}),(0,s.jsx)(i.A,{open:_,PaperProps:{sx:{borderRadius:3,minWidth:280}},children:(0,s.jsxs)(o.A,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:2.5,py:4,px:5},children:[(0,s.jsx)(l.A,{size:48,thickness:4}),(0,s.jsxs)(a.A,{sx:{textAlign:"center"},children:[(0,s.jsx)(c.A,{variant:"h6",sx:{fontWeight:700,mb:.5},children:"ç §åä¸..."}),(0,s.jsx)(c.A,{variant:"body2",color:"text.secondary",children:"ãã°ãããå¾ ã¡ãã ãã"})]})]})})]})}},56304:(e,t,r)=>{"use strict";r.d(t,{ij:()=>u,zc:()=>o,BW:()=>d,RF:()=>c});let{GET:s,POST:n,PUT:a,PATCH:l,DELETE:i}=(0,r(24235).Ay)({baseUrl:"/",credentials:"include"}),o=s,c=n,d=l,u=i},83290:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/jmtyspot_admin/stocktakes/detail",function(){return r(51712)}])},88537:(e,t,r)=>{"use strict";r.d(t,{M:()=>a});var s=r(89099),n=r(14232);let a=()=>{let e=(0,s.useRouter)();return{handleAuthError:(0,n.useCallback)(t=>401===t.status?(e.push("/login"),!1):403!==t.status||(e.push("/"),!1),[e])}}},97625:(e,t,r)=>{"use strict";r.d(t,{r:()=>s,v:()=>n});let s={fontWeight:700,fontSize:"0.75rem",color:"text.secondary",textTransform:"uppercase",letterSpacing:"0.05em",bgcolor:"grey.50"},n={position:"fixed",bottom:0,left:0,right:0,bgcolor:"background.paper",borderTop:"1px solid",borderColor:"divider",px:4,py:3,boxShadow:"0 -4px 10px rgba(0,0,0,0.05)",zIndex:40}}},e=>{var t=t=>e(e.s=t);e.O(0,[97,5218,5767,9294,9586,4626,506,3560,636,6593,8792],()=>t(83290)),_N_E=e.O()}]); 2//# sourceMappingURL=detail-ca9d0302891cd194.js.map
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.