import{_ as E,d as A,aP as B,w as v,a0 as C,o as s,c as l,b as t,L as u,u as r,F as p,a as f,D as b,y as k}from"./index.56c69f5a.js";import{a as y}from"./calc.850c7422.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"},G=t("th",{style:{"text-align":"left"},width:"35px"},"\u5E8F\u53F7",-1),J=t("th",{style:{"text-align":"left"},width:"135px"},"\u91C7\u8D2D\u5355\u7F16\u53F7",-1),z=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=A({__name:"index",props:{record:{type:Object,required:!0}},setup(F,{expose:g}){const _=F,h={createTime:"",supplierName:"",companyName:"",totalPrice:0,totalNum:0,payNo:""},i=B(!1),m=v([]),e=v({...h});function N(d){e.value={...h};const{cgdlist:c,payNo:o,companyName:n,supplierName:P,addtime:w}=d;c.forEach((a,D)=>{e.value.totalPrice=y(e.value.totalPrice,a.totalPrice),e.value.totalNum=y(e.value.totalNum,a.goodNum),m.value.push({index:D+1,qrdNo:a.qrdCode,tax:Number(a.tax)+"%",goodNum:a.goodNum,cgdNo:a.sequenceNo,goodUnit:a.goodUnit,goodName:a.goodName,goodPrice:a.goodPrice,totalPrice:a.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(d=!1){i.value=d,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)}),g({print:x}),(d,c)=>(s(),l("div",q,[t("table",null,[t("div",I,[t("div",L,[t("div",O,u(r(i)?"\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(i)?(s(),l("div",V," \u6570\u91CF\u5408\u8BA1\uFF1A"+u(e.value.totalNum),1)):(s(),l("div",W,"\u8D27\u6B3E\u603B\u989D\uFF1A"+u(e.value.totalPrice),1))])]),t("thead",null,[t("tr",null,[G,J,z,K,Q,X,r(i)?f("v-if",!0):(s(),l(p,{key:0},[Y,Z,$],64))])]),t("tbody",null,[(s(!0),l(p,null,b(m.value,(o,n)=>(s(),l("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(i)?f("v-if",!0):(s(),l(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 at=E(tt,[["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/components/PrintOrderRecord/src/index.vue"]]);export{at as P};
