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