import{_ as E,d as A,aP as B,w as v,a0 as C,o as l,c as s,b as t,L as u,u as r,F as p,a as f,D as b,y as k}from"./index.88f7d256.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"},S={class:"column"},U={class:"supplier"},H={class:"create"},M={class:"column"},V={class:"company"},W={key:0,class:"total"},j={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:w,addtime:P}=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=w,e.value.companyName=n,e.value.payNo=o,e.value.createTime=P}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("
"+c+"
"),setTimeout(function(){o.contentWindow.print(),document.body.removeChild(o)},50)})}return C(()=>{!_.record||JSON.stringify(_.record)==="{}"||N(_.record)}),g({print:x}),(d,c)=>(l(),s("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",S,[t("div",U,"\u4F9B\u8D27\u5546\uFF1A"+u(e.value.supplierName),1),t("div",H,"\u521B\u5EFA\u65F6\u95F4\uFF1A"+u(e.value.createTime),1)]),t("div",M,[t("div",V,"\u4E1A\u52A1\u516C\u53F8\uFF1A "+u(e.value.companyName),1),r(i)?(l(),s("div",W," \u6570\u91CF\u5408\u8BA1\uFF1A"+u(e.value.totalNum),1)):(l(),s("div",j,"\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):(l(),s(p,{key:0},[Y,Z,$],64))])]),t("tbody",null,[(l(!0),s(p,null,b(m.value,(o,n)=>(l(),s("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):(l(),s(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","D:/work/accout-vue3-ui2/settle-vue3/src/components/PrintOrderRecord/src/index.vue"]]);export{at as P};