import{d as E,cc as A,n as f,S as B,o as a,c as s,e as t,G as l,F as p,a as F,z as D,_ as C,ct as g,q as b}from"./index.js";import{p as k}from"./print-style.0cc9588c.js";const T={id:"print-template"},q={class:"header"},I={class:"first"},O={class:"title"},R={class:"record"},S={class:"column"},L={class:"supplier"},U={class:"create"},j={class:"column"},G={class:"company"},H={key:0,class:"total"},M={key:1,class:"total"},V=E({__name:"index",props:{record:{type:Object,required:!0}},setup(y,{expose:N}){const c=y,v={createTime:"",supplierName:"",companyName:"",totalPrice:0,totalNum:0,payNo:""},i=A(!1),m=f([]),o=f({...v});function x(r){o.value={...v};const{cgdlist:e,payNo:u,companyName:d,supplierName:h,addtime:w}=r;e.forEach((n,P)=>{o.value.totalPrice=g(o.value.totalPrice,n.totalPrice),o.value.totalNum=g(o.value.totalNum,n.goodNum),m.value.push({index:P+1,qrdNo:n.qrdCode,tax:Number(n.tax)+"%",goodNum:n.goodNum,cgdNo:n.sequenceNo,goodUnit:n.goodUnit,goodName:n.goodName,goodPrice:n.goodPrice,totalPrice:n.totalPrice})}),o.value.totalPrice=Number(o.value.totalPrice.toFixed(2)),o.value.supplierName=h,o.value.companyName=d,o.value.payNo=u,o.value.createTime=w}function _(r=!1){i.value=r,b(()=>{const e=document.getElementById("print-template").innerHTML,u=document.createElement("iframe");u.setAttribute("style","position: absolute; width: 0; height: 0;"),document.body.appendChild(u);const d=u.contentWindow.document;d.write(k),d.write("<div>"+e+"</div>"),setTimeout(function(){u.contentWindow.print(),document.body.removeChild(u)},50)})}return B(()=>{!c.record||JSON.stringify(c.record)==="{}"||x(c.record)}),N({print:_}),(r,e)=>(a(),s("div",T,[t("table",null,[t("div",q,[t("div",I,[t("div",O,l(i.value?"\u51FA\u5E93\u5355":"\u5BF9\u8D26\u5355"),1),t("div",R,"\u5BF9\u8D26\u5355\u53F7\uFF1A"+l(o.value.payNo),1)]),t("div",S,[t("div",L,"\u4F9B\u8D27\u5546\uFF1A"+l(o.value.supplierName),1),t("div",U,"\u521B\u5EFA\u65F6\u95F4\uFF1A"+l(o.value.createTime),1)]),t("div",j,[t("div",G,"\u4E1A\u52A1\u516C\u53F8\uFF1A "+l(o.value.companyName),1),i.value?(a(),s("div",H," \u6570\u91CF\u5408\u8BA1\uFF1A"+l(o.value.totalNum),1)):(a(),s("div",M,"\u8D27\u6B3E\u603B\u989D\uFF1A"+l(o.value.totalPrice),1))])]),t("thead",null,[t("tr",null,[e[3]||(e[3]=t("th",{style:{"text-align":"left"},width:"35px"},"\u5E8F\u53F7",-1)),e[4]||(e[4]=t("th",{style:{"text-align":"left"},width:"135px"},"\u91C7\u8D2D\u5355\u7F16\u53F7",-1)),e[5]||(e[5]=t("th",{style:{"text-align":"left"},width:"135px"},"\u9500\u552E\u5355\u7F16\u53F7",-1)),e[6]||(e[6]=t("th",{style:{"text-align":"left"}},"\u5546\u54C1\u540D\u79F0",-1)),e[7]||(e[7]=t("th",{style:{"text-align":"left"},width:"25px"},"\u5355\u4F4D",-1)),e[8]||(e[8]=t("th",{style:{"text-align":"left"},width:"95px"},"\u6570\u91CF",-1)),i.value?F("v-if",!0):(a(),s(p,{key:0},[e[0]||(e[0]=t("th",{style:{"text-align":"left"},width:"95px"},"\u5546\u54C1\u5355\u4EF7",-1)),e[1]||(e[1]=t("th",{style:{"text-align":"left"},width:"95px"},"\u603B\u8D27\u6B3E",-1)),e[2]||(e[2]=t("th",{style:{"text-align":"left"},width:"30px"},"\u7A0E\u7387",-1))],64))])]),t("tbody",null,[(a(!0),s(p,null,D(m.value,(u,d)=>(a(),s("tr",{key:d},[t("td",null,l(u.index),1),t("td",null,l(u.cgdNo),1),t("td",null,l(u.qrdNo),1),t("td",null,l(u.goodName),1),t("td",null,l(u.goodUnit),1),t("td",null,l(u.goodNum),1),i.value?F("v-if",!0):(a(),s(p,{key:0},[t("td",null,l(u.goodPrice),1),t("td",null,l(u.totalPrice),1),t("td",null,l(u.tax),1)],64))]))),128))])])]))}});var J=C(V,[["__file","D:/work/jiesuan/settle-vue3/src/components/PrintOrderRecord/src/index.vue"]]);export{J as P};
