import{_ as g,d as w,aP as N,w as p,a0 as C,o as i,c as d,b as t,L as u,F as b,D as A,y as B}from"./index.56c69f5a.js";import{a as E}from"./calc.850c7422.js";import{p as T}from"./print-style.0cc9588c.js";const P={id:"print-template"},k={class:"header"},I={class:"first"},L=t("div",{class:"title"},"\u53D1\u8D27\u8FD0\u5355\u5BF9\u8D26\u5355",-1),R={class:"record",style:{width:"338px"}},O={class:"column"},S={class:"supplier"},j={class:"create",style:{width:"338px"}},H={class:"column"},M={class:"company"},W={class:"total",style:{width:"338px"}},q=t("thead",null,[t("tr",null,[t("th",{style:{"text-align":"left"},width:"35px"},"\u5E8F\u53F7"),t("th",{style:{"text-align":"left"},width:"135px"},"\u53D1\u8D27\u8FD0\u5355\u53F7"),t("th",{style:{"text-align":"left"},width:"135px"},"\u53D1\u8D27\u5DE5\u5355\u53F7"),t("th",{style:{"text-align":"left"},width:"135px"},"\u53D1\u8D27\u5355\u7F16\u53F7"),t("th",{style:{"text-align":"left"}},"\u5546\u54C1\u540D\u79F0"),t("th",{style:{"text-align":"left"},width:"135px"},"\u9500\u552E\u5355\u7F16\u53F7"),t("th",{style:{"text-align":"left"},width:"135px"},"\u91C7\u8D2D\u5355\u7F16\u53F7"),t("th",{style:{"text-align":"left"},width:"60px"},"\u7269\u6D41\u8D39\u7528")])],-1),G=w({__name:"index",props:{record:{type:Object,required:!0}},setup(_,{expose:m}){const a=_,c={createTime:"",supplierName:"",companyName:"",totalPrice:0,totalNum:0,payNo:""},h=N(!1),r=p([]),o=p({...c});function F(n){o.value={...c};const{cgdlist:l,payNo:e,companyName:s,supplierName:v,addtime:y}=n;r.value=l,o.value.totalPrice=(l||[]).reduce((D,x)=>Number(E(D,x.post_fee)).toFixed(2),0),o.value.supplierName=v,o.value.companyName=s,o.value.payNo=e,o.value.createTime=y}function f(n=!1){h.value=n,B(()=>{const l=document.getElementById("print-template").innerHTML,e=document.createElement("iframe");e.setAttribute("style","position: absolute; width: 0; height: 0;"),document.body.appendChild(e);const s=e.contentWindow.document;s.write(T),s.write("<div>"+l+"</div>"),setTimeout(function(){e.contentWindow.print(),document.body.removeChild(e)},50)})}return C(()=>{!a.record||JSON.stringify(a.record)==="{}"||F(a.record)}),m({print:f}),(n,l)=>(i(),d("div",P,[t("table",null,[t("div",k,[t("div",I,[L,t("div",R,"\u5BF9\u8D26\u5355\u53F7\uFF1A"+u(o.value.payNo),1)]),t("div",O,[t("div",S,"\u7269\u6D41\u4F9B\u8D27\u5546\uFF1A"+u(o.value.supplierName),1),t("div",j,"\u521B\u5EFA\u65F6\u95F4\uFF1A"+u(o.value.createTime),1)]),t("div",H,[t("div",M,"\u4E1A\u52A1\u516C\u53F8\uFF1A "+u(o.value.companyName),1),t("div",W,"\u8FD0\u8D39\u603B\u989D\uFF1A"+u(o.value.totalPrice),1)])]),q,t("tbody",null,[(i(!0),d(b,null,A(r.value,(e,s)=>(i(),d("tr",{key:s},[t("td",null,u(s+1),1),t("td",null,u(e.TrackCode),1),t("td",null,u(e.outChildCode),1),t("td",null,u(e.outCode),1),t("td",null,u(e.good_name),1),t("td",null,u(e.orderCode),1),t("td",null,u(e.cgdNo),1),t("td",null,u(e.post_fee),1)]))),128))])])]))}});var z=g(G,[["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/components/sendPrintRecord/src/index.vue"]]);export{z as P};
