1(self.rspackChunkdksasp=self.rspackChunkdksasp||[]).push([[9112],{28988:function(e){function t(e){var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=function(){return[]},t.resolve=t,t.id=28988,e.exports=t},42270:function(e,t,n){"use strict";n(36883),n(33768),n(67622),n(38660),n(33969),n(80746),n(29833),n(36967),n(91482),n(11207),n(84160),n(31511),n(19675),n(4514),n(77911),n(71119),n(74495);var r=n(69001),o=n.n(r),i=n(4972),l=n(92236),a=n.n(l),d=n(53653),c=n.n(d),s=n(71757);let m=document.getElementById("orderNumbers"),u=document.getElementById("orderCount"),p=document.getElementById("btnValidate"),y=document.getElementById("btnGenerate"),g=document.getElementById("btnRetry"),h=document.getElementById("validationResult"),f=document.getElementById("validationList"),v=document.getElementById("progressSection"),E=document.getElementById("progressFill"),C=document.getElementById("progressText"),b=document.getElementById("progressLog"),k=document.getElementById("finalResult"),w=document.getElementById("successInfo"),x=document.getElementById("failList"),I=document.getElementById("iframeContainer"),B=[],S=[];function T(e){return e instanceof Error?e.message:String(e)}function N(e){return[...new Set(e.split(/[\r\n]+/).map(e=>e.trim()).filter(e=>e.length>0))]}function L(e,t=!1){let n=document.createElement("div");n.className=t?"om-log-error":"om-log-success",n.textContent=e,b.appendChild(n),b.scrollTop=b.scrollHeight}function O(e,t){let n=t>0?Math.round(e/t*100):0;E.style.width=`${n}%`,C.textContent=`${e} / ${t}`}m.addEventListener("input",()=>{u.textContent=N(m.value).length,B=[],y.disabled=!0,g.style.display="none"}),p.addEventListener("click",async()=>{let e=N(m.value);if(0===e.length)return void alert("è«è¼¸å
¥è³å°ä¸çè¨å®è碼");let t=[];try{p.disabled=!0,p.textContent="é©èä¸...";let n=s("input[name='__RequestVerificationToken']").val(),r=await fetch("/api/OrderManager/validate",{method:"POST",headers:{"Content-Type":"application/json",RequestVerificationToken:n},body:JSON.stringify({orderNumbers:e})});if(!r.ok)throw Error(`API åæé¯èª¤: ${r.status}`);t=await r.json()}catch(e){alert(`é©è失æ: ${T(e)}`);return}finally{p.disabled=!1,p.textContent="é©èè¨å®"}let n=t.map(e=>({ordNo:e.ordNo,valid:e.valid,message:e.message}));f.innerHTML="",n.forEach(e=>{let t=document.createElement("div");t.className=`om-validation-item ${e.valid?"valid":"invalid"}`;let n=document.createElement("span");n.textContent=e.ordNo;let r=document.createElement("span");r.className="om-validation-msg",r.textContent=e.valid?"â ææ":`â ${e.message||"ç¡æ"}`,t.appendChild(n),t.appendChild(r),f.appendChild(t)}),h.style.display="block",y.disabled=0===(B=n.filter(e=>e.valid).map(e=>e.ordNo)).length}),y.addEventListener("click",async()=>{if(0===B.length)return void alert("æ²æææçè¨å®å¯ç¢ç");let e=document.querySelector('input[name="docType"]:checked').value,t=document.querySelector('input[name="fileFormat"]:checked').value,n="invoice"===e?".einPaperArea":"#print_block",r="invoice"===e?"inv":"evd",l=B.length;p.disabled=!0,y.disabled=!0,b.innerHTML="",x.innerHTML="",w.innerHTML="",k.style.display="none",v.style.display="block",O(0,l),S=[];let d=new(o()),s=0;for(let o=0;o<B.length;o++){let i=B[o],m="invoice"===e?`/invoice/einvoiceAdmin/${i}`:`/orderlist/OrderEvidenceAdmin/${i}`,u="pdf"===t?"pdf":t,p=`${r}_${i}.${u}`;try{let e;L(`[${o+1}/${l}] è¼å
¥ ${i}...`);let r=await function(e){return new Promise((t,n)=>{let r=document.createElement("iframe");r.style.width="1200px",r.style.height="2000px",r.style.border="none";let o=setTimeout(()=>{n(Error("iframe è¼å
¥é¾æ"))},3e4);r.onload=()=>{clearTimeout(o),setTimeout(()=>t(r),1500)},r.onerror=()=>{clearTimeout(o),n(Error("iframe è¼å
¥å¤±æ"))},r.src=e,I.appendChild(r)})}(m);e="pdf"===t?await function(e,t){return new Promise((n,r)=>{try{let o=e.contentDocument||e.contentWindow.document,i=o.querySelector(t);if(!i)return void r(Error(`æ¾ä¸å°ç®æ¨å
ç´ ${t}`));let l=i.cloneNode(!0),d=Array.from(o.styleSheets).map(e=>{try{return Array.from(e.cssRules).map(e=>e.cssText).join("\n")}catch(e){return""}}).join("\n"),c=document.createElement("div");c.style.position="fixed",c.style.left="-9999px",c.style.top="0",c.style.width="1100px";let s=document.createElement("style");s.textContent=d,c.appendChild(s),c.appendChild(l),document.body.appendChild(c),a()().from(l).set({margin:.5,image:{type:"jpeg",quality:.98},html2canvas:{scale:2,useCORS:!0},jsPDF:{unit:"in",format:"letter",orientation:"portrait"}}).outputPdf("blob").then(e=>{document.body.removeChild(c),n(e)}).catch(e=>{document.body.removeChild(c),r(e)})}catch(e){r(e)}})}(r,n):await function(e,t,n){return new Promise((r,o)=>{try{let i=(e.contentDocument||e.contentWindow.document).querySelector(t);if(!i)return void o(Error(`æ¾ä¸å°ç®æ¨å
ç´ ${t}`));c()(i,{scale:2,useCORS:!0,logging:!1}).then(e=>{e.toBlob(e=>{e?r(e):o(Error("canvas.toBlob åå³ null"))},"jpg"===n?"image/jpeg":"image/png","jpg"===n?.95:void 0)}).catch(o)}catch(e){o(e)}})}(r,n,t),d.file(p,e),s++,L(`[${o+1}/${l}] â ${i} â ${p}`),I.removeChild(r)}catch(n){let e=T(n);L(`[${o+1}/${l}] â ${i}: ${e}`,!0),S.push({ordno:i,error:e});let t=I.querySelector("iframe");t&&I.removeChild(t)}O(o+1,l)}if(s>0)try{let n,r,o,l,a,c;L("æ£å¨æå
ZIP...");let s=await d.generateAsync({type:"blob"}),m=(n=t.toUpperCase(),o=(r=new Date).getFullYear(),l=String(r.getMonth()+1).padStart(2,"0"),a=String(r.getDate()).padStart(2,"0"),c=`${o}${l}${a}`,`${"invoice"===e?"inv":"evd"}${n}_${c}.zip`);(0,i.saveAs)(s,m),L(`â å·²ä¸è¼ ${m}`)}catch(e){L(`â ZIP æå
失æ: ${T(e)}`,!0)}w.textContent=`æåç¢ç ${s} / ${l}
1 ç`,S.length>0&&(S.forEach(e=>{let t=document.createElement("div");t.className="om-fail-item",t.textContent=`â ${e.ordno}: ${e.error}`,x.appendChild(t)}),g.style.display="inline-block"),k.style.display="block",p.disabled=!1,y.disabled=0===B.length}),g.addEventListener("click",()=>{0!==S.length&&(B=S.map(e=>e.ordno),y.disabled=!1,g.style.display="none",y.click())})},71757:function(e){"use strict";e.exports=$}},function(e){e.O(0,[4050,7800,8781,9398,9596],function(){return e(e.s=42270)}),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.