PageSourceSearch

https://www.kingstone.com.tw/coredist/OrderManager_index.5f7bc1d3.js

js kingstone.com.tw collected 2026-09-24 09:12:47 UTC 6,203 bytes, 1 lines download raw bytes

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.