import{_ as P,d as k,b1 as C,w as m,a0 as D,o as n,c as d,b as e,L as l,u as c,F as h,a as f,D as E,y as B}from"./index.0bc83371.js";import{a as g}from"./calc.1104f430.js";var q=` `;const A={id:"print-template"},I={class:"header"},L={class:"first"},O={class:"column"},R={class:"supplier"},T={class:"record"},U={class:"column"},S={class:"company"},j={key:0,class:"total"},z={key:1,class:"total"},H=e("th",{style:{"text-align":"left"},width:"65px"},"\u5E8F\u53F7",-1),M=e("th",{style:{"text-align":"left"},width:"165px"},"\u91C7\u8D2D\u5355\u7F16\u53F7",-1),V=e("th",{style:{"text-align":"left"},width:"165px"},"\u9500\u552E\u5355\u7F16\u53F7",-1),W=e("th",{style:{"text-align":"left"}},"\u5546\u54C1\u540D\u79F0",-1),G=e("th",{style:{"text-align":"left"},width:"30px"},"\u5355\u4F4D",-1),J=e("th",{style:{"text-align":"left"},width:"70px"},"\u5546\u54C1\u6570\u91CF",-1),K=e("th",{style:{"text-align":"left"},width:"100px"},"\u5546\u54C1\u5355\u4EF7",-1),Q=e("th",{style:{"text-align":"left"},width:"100px"},"\u603B\u8D27\u6B3E",-1),X=e("th",{style:{"text-align":"left"},width:"30px"},"\u7A0E\u7387",-1),Y=k({__name:"index",props:{record:{type:Object,required:!0}},setup(v,{expose:y}){const p=v,_={supplierName:"",companyName:"",totalPrice:0,totalNum:0,payNo:""},u=C(!1),x=m([]),o=m({..._});function N(i){o.value={..._};const{cgdlist:r,payNo:t,companyName:s,supplierName:w}=i;r.forEach((a,F)=>{o.value.totalPrice=g(o.value.totalPrice,a.totalPrice),o.value.totalNum=g(o.value.totalNum,a.goodNum),x.value.push({index:F+1,qrdNo:a.qrdCode,tax:a.tax+"%",goodNum:a.goodNum,cgdNo:a.sequenceNo,goodUnit:a.goodUnit,goodName:a.goodName,goodPrice:a.goodPrice,totalPrice:a.totalPrice})}),o.value.totalPrice=Number(o.value.totalPrice.toFixed(2)),o.value.supplierName=w,o.value.companyName=s,o.value.payNo=t}function b(i=!1){u.value=i,B(()=>{const r=document.getElementById("print-template").innerHTML,t=document.createElement("iframe");t.setAttribute("style","position: absolute; width: 0; height: 0;"),document.body.appendChild(t);const s=t.contentWindow.document;s.write(q),s.write("
"+r+"
"),setTimeout(function(){t.contentWindow.print(),document.body.removeChild(t)},50)})}return D(()=>{!p.record||JSON.stringify(p.record)==="{}"||N(p.record)}),y({print:b}),(i,r)=>(n(),d("div",A,[e("table",null,[e("div",I,[e("div",L,l(c(u)?"\u51FA\u5E93\u5355":"\u5BF9\u8D26\u5355"),1),e("div",O,[e("div",R,"\u4F9B\u8D27\u5546: "+l(o.value.supplierName),1),e("div",T,"\u5BF9\u8D26\u5355\u53F7: "+l(o.value.payNo),1)]),e("div",U,[e("div",S,"\u4E1A\u52A1\u516C\u53F8: "+l(o.value.companyName),1),c(u)?(n(),d("div",j," \u5546\u54C1\u603B\u6570\u91CF: "+l(o.value.totalNum),1)):(n(),d("div",z,"\u603B\u8D27\u6B3E: "+l(o.value.totalPrice),1))])]),e("thead",null,[e("tr",null,[H,M,V,W,G,J,c(u)?f("v-if",!0):(n(),d(h,{key:0},[K,Q,X],64))])]),e("tbody",null,[(n(!0),d(h,null,E(x.value,(t,s)=>(n(),d("tr",{key:s},[e("td",null,l(t.index),1),e("td",null,l(t.cgdNo),1),e("td",null,l(t.qrdNo),1),e("td",null,l(t.goodName),1),e("td",null,l(t.goodUnit),1),e("td",null,l(t.goodNum),1),c(u)?f("v-if",!0):(n(),d(h,{key:0},[e("td",null,l(t.goodPrice),1),e("td",null,l(t.totalPrice),1),e("td",null,l(t.tax),1)],64))]))),128))])])]))}});var ee=P(Y,[["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/components/PrintOrderRecord/src/index.vue"]]);export{ee as P};