1"use strict";(self.webpackChunkgatsby_starter_hello_world=self.webpackChunkgatsby_starter_hello_world||[]).push([[7542],{1503:function(t,e,i){var r=i(60436),s=i(81768),n=i(69793),o=i(51772);const a=(0,s.getOutlet)("users"),d=(0,s.getOutlet)("products"),l=(0,s.getOutlet)("companies");let c=function(){function t(t){this.committeeIds=t.committeeIds,this.intExchIds=t.intExchIds,this.moraleIds=t.moraleIds,this.userIds=t.userIds,this.orderItemProductIds=t.orderItemProductIds,this.signFormProductIds=t.signFormProductIds,this.buyerIds=null,this.seniorityUserIds=t.seniorityUserIds,this.postExecutionIds=t.postExecutionIds,this.receiveRelatedIds=t.receiveRelatedIds,this.committeeList=null,this.intExchList=null,this.moraleList=null,this.userList=null,this.orderList=null,this.signFormList=null,this.buyerList=null,this.seniorityList=null,this.postExecutionList=null,this.receiveRelatedList=null,this.userProjection=t.userProjection||null,this.execution_signform_pids=t.execution_signform_pids,this.execution_signform_list=null}var e=t.prototype;return e.fetchAll=async function(){try{if(Array.isArray(this.execution_signform_pids)&&this.execution_signform_pids&&(this.execution_signform_list=await n.kS("sign_form",[{$match:{product_id:{$in:this.execution_signform_pids}}},{$sort:{created:-1}},{$addFields:{is_attend_members:{$filter:{input:"$members",as:"m",cond:{$eq:["$$m.is_attend",!0]}}},is_attend_online_members:{$filter:{input:"$online_members",as:"m",cond:{$eq:["$$m.is_attend",!0]}}}}},{$project:{id:{$toString:"$_id"},product_id:1,is_posted_hours:1,total_members:{$cond:{if:{$isArray:"$is_attend_members"},then:{$size:"$is_attend_members"},else:0}},total_online_members:{$cond:{if:{$isArray:"$is_attend_online_members"},then:{$size:"$is_attend_online_members"},else:0}}}}])),Array.isArray(this.committeeIds)&&this.committeeIds.length>0&&(this.committeeList=await n._o("Committee",{_id:{$in:this.committeeIds.map(t=>({$oid:t}))}},{NAME:1})),Array.isArray(this.intExchIds)&&this.intExchIds.length>0&&(this.intExchList=await n._o("international_exchange",{_id:{$in:this.intExchIds.map(t=>({$oid:t}))}},{title:1})),Array.isArray(this.moraleIds)&&this.moraleIds.length>0&&(this.moraleList=await n._o("morale",{_id:{$in:this.moraleIds.map(t=>({$oid:t}))}},{case_number:1})),Array.isArray(this.userIds)&&this.userIds.length>0&&(this.userList=await n._o("user_profile",{owner:{$in:this.userIds.map(t=>t)}},null,this.userProjection)),Array.isArray(this.orderItemProductIds)&&this.orderItemProductIds.length>0&&(this.orderList=await n._o("order",{"items.0.product.id":{$in:this.orderItemProductIds.map(t=>({$oid:t}))}},null,{order_id:1,owner:1,owner_state:1,owner_substate:1,buyer_name:1,buyer_phone:1,total:1,status:1,payment_status:1,payment_subtype:1,receipt_email_date:1,insurance:1,vegetarians:1,items:1}),this.buyerIds=this.orderList.map(t=>t.owner),Array.isArray(this.buyerIds)&&this.buyerIds.length>0&&(this.buyerList=await n._o("user_profile",{owner:{$in:this.buyerIds.map(t=>t)}},null,{owner:1,SEX:1,INFORM_TO:1,email:1,EMAIL2:1,mail_address_city:1,mail_address_zip_code:1,mail_address_detail:1,company_current:1,company_zip_code:1,company_city:1,company_detail:1,company_phone:1,company_fax:1,id_card_number:1,birthday:1,state:1,substate:1}))),Array.isArray(this.signFormProductIds)&&this.signFormProductIds.length>0&&(this.signFormList=await n._o("sign_form",{product_id:{$in:this.signFormProductIds}},["-created"],null)),Array.isArray(this.seniorityUserIds)&&this.seniorityUserIds.length>0&&(this.seniorityList=await o.getUserSeniorities({users_id:this.seniorityUserIds})),Array.isArray(this.postExecutionIds)&&this.postExecutionIds.length>0&&(this.postExecutionList=await n._o("form",{type:"post",_id:{$in:this.postExecutionIds.map(t=>({$oid:t}))}},["-created"],{text_number:1})),Array.isArray(this.receiveRelatedIds)&&this.receiveRelatedIds.length>0){let t=100;if(this.receiveRelatedIds.length>t){const e=[],i=Math.ceil(this.receiveRelatedIds.length/t);let s=[];for(let r=1;r<i+1;r++){const i=this.receiveRelatedIds.map(t=>({$oid:t})).filter((e,i)=>1===r?i>0&&i<r*t:i>(r-1)*t&&i<r*t);e.push(n.P_("form",{type:"receive",_id:{$in:i}},["-created"],null,{paperwork_id:1}))}const o=await Promise.all(e);for(let t=0;t<o.length;t++)s=[].concat((0,r.A)(s),(0,r.A)(o[t]));this.receiveRelatedList=s}else this.receiveRelatedList=await n._o("form",{type:"receive",_id:{$in:this.receiveRelatedIds.map(t=>({$oid:t}))}},["-created"],{paperwork_id:1})}}catch(t){console.warn(t)}},e.getExecutionSignformByProduct=function(t){const e=this.execution_signform_list.findIndex(e=>e.product_id===t),i=this.execution_signform_list.findIndex(e=>e.product_id===t&&e.is_posted_hours);return i>-1?this.execution_signform_list[i]:this.execution_signform_list[e]},e.getCommittee=function(t){const e=this.committeeList.findIndex(e=>e.id===t);return e>-1?this.committeeList[e]:{}},e.getIntExch=function(t){const e=(this.intExchList||[]).findIndex(e=>e.id===t);return e>-1?this.intExchList[e]:{}},e.getMorale=function(t){const e=this.moraleList.findIndex(e=>e.id===t);return e>-1?this.moraleList[e]:{}},e.getProduct=function(t){return d.getValue().find(e=>e.id===t)||{}},e.getUser=function(t){return a.getValue().find(e=>e.owner===t)||{}},e.getUserFullData=function(t){const e=this.userList.findIndex(e=>e.owner===t);return e>-1?this.userList[e]:{}},e.getUserPartialData=function(t){const e=this.userList.findIndex(e=>e.owner===t);return e>-1?this.userList[e]:{}},e.getCompany=function(t){return l.getValue().find(e=>e.id===t)||{}},e.getOrdersByProductId=function(t){return this.orderList?this.orderList.filter(e=>e.items[0].product.id.$oid===t):[]},e.getOrder=function(t){const e=this.orderList.findIndex(e=>e.id===t);return e>-1?this.orderList[e]:{}},e.getBuyerInfo=function(t){const e=this.buyerList.findIndex(e=>e.owner===t);return e>-1?this.buyerList[e]:{}},e.getLatestSignForm=function(t){const e=this.signFormList.findIndex(e=>e.product_id===t),i=this.signFormList.findIndex(e=>e.product_id===t&&e.is_posted_hours);return-1===i?this.signFormList[e]||{}:this.signFormList[i]||{}},e.getUserSeniority=function(t){const e=this.seniorityList.findIndex(e=>e.owner===t);return e>-1?this.seniorityList[e]:{}},e.getPostExecution=function(t){const e=this.postExecutionList.findIndex(e=>e.id===t);return e>-1?this.postExecutionList[e]:{}},e.getReceiveRelated=function(t){const e=this.receiveRelatedList.findIndex(e=>e.id===t);return e>-1?this.receiveRelatedList[e]:{}},t}();e.A=c}
1,37202:function(t,e,i){i.r(e),i.d(e,{default:function(){return $}});i(52430);var r=i(50400),s=i(96540),n=i(35830),o=i(53289),a=i(60436),d=(i(93155),i(79478)),l=i(68997),c=i.n(l),u=i(30763),h=i(85806),m=i(51165),p=i(1503);const _=t=>{let e="";return Array.isArray(t)&&t.length>0&&(e=t[t.length-1].name),e},g=t=>{let e="";return Array.isArray(t)&&t.length>0&&(e=t[t.length-1].name),e},y=(t,e)=>{let i="";if(Array.isArray(e)&&e.length>0)for(let r=0;r<e.length;r++){const s=t.getPostExecution(e[r]);s&&s.text_number&&(i+=s.text_number+"\n")}return i};const f=n.default.div.withConfig({displayName:"AdminReceiveExport__Wrapper",componentId:"sc-1f12a1n-0"})([""]);var x=function(t){return s.createElement(f,null,s.createElement(c(),{instance:null,schema:{title:"",type:"object",properties:{title:{type:"string",title:"å ±è¡¨å稱",default:"æ¶æç°¿"},start_date:{type:"string",title:"æ¶ææ¥æï¼èµ·ï¼"},end_date:{type:"string",title:"æ¶ææ¥æï¼è¿ï¼"},paperwork_id_start:{type:"string",title:"æ¶æç·¨èï¼èµ·ï¼"},paperwork_id_end:{type:"string",title:"æ¶æç·¨èï¼è¿ï¼"}}},uiSchema:{start_date:{"ui:help":"æ ¼å¼çº yyyy-mm-ddï¼ä¾å¦: 2024-01-01"},end_date:{"ui:help":"æ ¼å¼çº yyyy-mm-ddï¼ä¾å¦: 2024-01-01"}},onSubmit:t=>{let e=function(t){const e={type:"receive"};if(t.start_date){if(!m.NX.test(t.start_date))return void d.Ay.warning("æ¶æéå§æ¥ææ ¼å¼é¯èª¤");e.date={$gte:t.start_date}}if(t.end_date){if(!m.NX.test(t.end_date))return void d.Ay.warning("æ¶æçµææ¥ææ ¼å¼é¯èª¤");e.date?e.date=Object.assign({},e.date,{$lt:t.end_date}):e.date={$lt:t.end_date}}return t.paperwork_id_start&&(e.paperwork_id={$gte:t.paperwork_id_start}),t.paperwork_id_end&&(e.paperwork_id?e.paperwork_id=Object.assign({},e.paperwork_id,{$lt:t.paperwork_id_end}):e.paperwork_id={$lt:t.paperwork_id_end}),e}(t);const i={collection:"form",filename:(t.title||"æ¶æç°¿")+".xlsx",query:e,recordsToAoa:async t=>{const e=new p.A({postExecutionIds:(()=>{const e=[],i=t.map(t=>t.posts_execution);for(const t of i)if(Array.isArray(t)&&t.length>0)for(const i of t)e.push(i);return e})()});return await e.fetchAll(),[["ç¼æå表","","","","","","","","","",""],["æ¶æç·¨è","æ¶ææ¥æ","ç¼ææ©é","æå¥","便åè","主æ¨","çæ
","æ¬è¾¦","ç°½æ ¸","å·è¡","å·è¡ç¼æ"]].concat((0,a.A)(t.map(t=>[""+(t.paperwork_id||""),""+(t.date||""),""+(t.organs||""),""+(t.category||""),""+(t.text_number||""),""+(t.title||""),""+(0,u.VK)(t.stage),""+(t.implement_name||""),""+_(t.history),""+g(t.history_execution),""+y(e,t.posts_execution)])))},updateWorkSheet:t=>{t["!merges"]=[{s:{r:0,c:0},e:{r:0,c:10}}];const e=["A1","B1","C1","D1","E1","F1","G1","H1","I1","J1","K1"];for(let n=0;n<e.length;n++){const i=e[n];t[i].s=0===n?{sz:22,alignment:{horizontal:"center",vertical:"center"},top:{style:"thin",color:{rgb:"000000"}},left:{style:"thin",color:{rgb:"000000"}}}:n+1===e.length?{top:{style:"thin",color:{rgb:"000000"}},right:{style:"thin",color:{rgb:"000000"}}}:{top:{style:"thin",color:{rgb:"000000"}}}}const i=["A2","B2","C2","D2","E2","F2","G2","H2","I2","J2","K2"];for(let n=0;n<i.length;n++){t[i[n]].s={sz:12,bold:!0,alignment:{horizontal:"center"},top:{style:"thin",color:{rgb:"000000"}},bottom:{style:"thin",color:{rgb:"000000"}},left:{style:"thin",color:{rgb:"000000"}},right:{style:"thin",color:{rgb:"000000"}}}}const r=Object.keys(t),s=["!cols","!merges","!ref"].concat(e,i);for(let n=0;n<r.length;n++){const e=r[n];s.includes(e)||(t[e].s=Object.assign({},t[e].s,{sz:12,alignment:{wrapText:!0,vertical:"center"},top:{style:"thin",color:{rgb:"000000"}},bottom:{style:"thin",color:{rgb:"000000"}},left:{style:"thin",color:{rgb:"000000"}},right:{style:"thin",color:{rgb:"000000"}}}))}t["!cols"]=[{wpx:104},{wpx:107},{wpx:115},{wpx:132},{wpx:169},{wpx:184},{wpx:91},{wpx:98},{wpx:99},{wpx:107},{wpx:134}],t["!rows"]=[{hpx:40}],console.log("DBG ws",t)}};(0,h.V)(Object.assign({},i))}}))};const b=(t,e)=>{let i="";if(Array.isArray(e)&&e.length>0)for(let r=0;r<e.length;r++){const s=t.getReceiveRelated(e[r]);s&&s.paperwork_id&&(i+=s.paperwork_id+"\n")}return i};const w=n.default.div.withConfig({displayName:"AdminPostExport__Wrapper",componentId:"sc-u76zud-0"})([""]);var I=function(t){return s.createElement(w,null,s.createElement(c(),{instance:null,schema:{title:"",type:"object",properties:{title:{type:"string",title:"å ±è¡¨å稱",default:"ç¼æç°¿"},start_date:{type:"string",title:"ç¼ææ¥æï¼èµ·ï¼"},end_date:{type:"string",title:"ç¼ææ¥æï¼è¿ï¼"},text_number_start:{type:"string",title:"ç¼æåèï¼èµ·ï¼"},text_number_end:{type:"string",title:"ç¼æåèï¼è¿ï¼"}}},uiSchema:{start_date:{"ui:help":"æ ¼å¼çº yyyy-mm-ddï¼ä¾å¦: 2024-01-01"},end_date:{"ui:help":"æ ¼å¼çº yyyy-mm-ddï¼ä¾å¦: 2024-01-01"}},onSubmit:t=>{let e=function(t){const e={type:"post"};if(t.start_date){if(!m.NX.test(t.start_date))return void d.Ay.warning("ç¼æéå§æ¥ææ ¼å¼é¯èª¤");e.date={$gte:t.start_date}}if(t.end_date){if(!m.NX.test(t.end_date))return void d.Ay.warning("ç¼æçµææ¥ææ ¼å¼é¯èª¤");e.date?e.date=Object.assign({},e.date,{$lt:t.end_date}):e.date={$lt:t.end_date}}return t.text_number_start&&(e.text_number={$gte:t.text_number_start}),t.text_number_end&&(e.text_number?e.text_number=Object.assign({},e.text_number,{$lt:t.text_number_end}):e.text_number={$lt:t.text_number_end}),e}(t);
1const i={collection:"form",filename:(t.title||"ç¼æç°¿")+".xlsx",query:e,recordsToAoa:async t=>{const e=new p.A({receiveRelatedIds:(()=>{const e=[],i=t.map(t=>t.receives_related);for(const t of i)if(Array.isArray(t)&&t.length>0)for(const i of t)null!==i&&""!==i&&e.push(i);return e})()});return await e.fetchAll(),[["ç¼æå表","","","","","","",""],["ç¼æåè","ç¼ææ¥æ","åæè ","æå¥","坿¬","éä»¶","主æ¨","æ¶æç·¨è"]].concat((0,a.A)(t.map(t=>[t.paperwork_id,t.date,t.addressee,t.category,"","",t.title,""+b(e,t.receives_related)])))},updateWorkSheet:t=>{t["!merges"]=[{s:{r:0,c:0},e:{r:0,c:7}}];const e=["A1","B1","C1","D1","E1","F1","G1","H1"];for(let n=0;n<e.length;n++){const i=e[n];t[i].s=0===n?{sz:22,alignment:{horizontal:"center",vertical:"center"},top:{style:"thin",color:{rgb:"000000"}},left:{style:"thin",color:{rgb:"000000"}}}:n+1===e.length?{top:{style:"thin",color:{rgb:"000000"}},right:{style:"thin",color:{rgb:"000000"}}}:{top:{style:"thin",color:{rgb:"000000"}}}}const i=["A2","B2","C2","D2","E2","F2","G2","H2"];for(let n=0;n<i.length;n++){t[i[n]].s={bold:!0,alignment:{horizontal:"center"},top:{style:"thin",color:{rgb:"000000"}},bottom:{style:"thin",color:{rgb:"000000"}},left:{style:"thin",color:{rgb:"000000"}},right:{style:"thin",color:{rgb:"000000"}}}}const r=Object.keys(t),s=["!cols","!merges","!ref"].concat(e,i);for(let n=0;n<r.length;n++){const e=r[n];s.includes(e)||(t[e].s=Object.assign({},t[e].s,{alignment:{wrapText:!0},top:{style:"thin",color:{rgb:"000000"}},bottom:{style:"thin",color:{rgb:"000000"}},left:{style:"thin",color:{rgb:"000000"}},right:{style:"thin",color:{rgb:"000000"}}}))}t["!cols"]=[{wpx:78},{wpx:102},{wpx:133},{wpx:93},{wpx:69},{wpx:69},{wpx:245},{wpx:78}]}};(0,h.V)(Object.assign({},i))}}))};const A=n.default.div.withConfig({displayName:"AdminReportPaperworkList__Wrapper",componentId:"sc-n91usq-0"})(["padding:20px;& > .row{display:flex;align-items:center;& > h1{margin-bottom:10px;font-size:32px;}& > div.buttons-container{margin-left:10px;margin-bottom:10px;& .btn{margin-top:5px;margin-right:10px;margin-bottom:5px;}.selected{background-color:var(--primaryColor);color:#ffffff;}}}& > div.content-container{border-top:1px dashed #868e96;padding-top:20px;}"]);var $=(0,o.A)(function(t){const e=s.useState(0),i=e[0],n=e[1];return s.createElement(A,null,s.createElement("div",{className:"row"},s.createElement("h1",null,"ææ¸å ±è¡¨ç®¡ç"),s.createElement("div",{className:"buttons-container"},s.createElement(r.A,{className:"btn "+(0===i&&"selected"),onClick:()=>n(0)},"æ¶æç°¿"),s.createElement(r.A,{className:"btn "+(1===i&&"selected"),onClick:()=>n(1)},"ç¼æç°¿"))),s.createElement("div",{className:"content-container"},0===i&&s.createElement(x,null),1===i&&s.createElement(I,null)))})},53289:function(t,e,i){var r=i(96540),s=i(65225);e.A=function(t){return function(e){return(0,s.A)(),r.createElement(t,e)}}}}]); 2//# sourceMappingURL=component---src-templates-admin-report-paperwork-list-index-js-e84154f8502c9f65f9b5.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.