index.0f8901bf.js 2.9 KB

1
  1. import{d as g,cc as w,n as p,S as N,o as a,c as d,e as t,G as u,F as C,z as A,_ as B,ct as E,q as b}from"./index.js";import{p as T}from"./print-style.0cc9588c.js";const k={id:"print-template"},P={class:"header"},I={class:"first"},R={class:"record",style:{width:"338px"}},S={class:"column"},L={class:"supplier"},O={class:"create",style:{width:"338px"}},j={class:"column"},q={class:"company"},G={class:"total",style:{width:"338px"}},H=g({__name:"index",props:{record:{type:Object,required:!0}},setup(m,{expose:_}){const i=m,r={createTime:"",supplierName:"",companyName:"",totalPrice:0,totalNum:0,payNo:""},h=w(!1),c=p([]),l=p({...r});function F(s){l.value={...r};const{cgdlist:o,payNo:e,companyName:n,supplierName:f,addtime:y}=s;c.value=o,l.value.totalPrice=(o||[]).reduce((x,D)=>Number(E(x,D.post_fee)).toFixed(2),0),l.value.supplierName=f,l.value.companyName=n,l.value.payNo=e,l.value.createTime=y}function v(s=!1){h.value=s,b(()=>{const o=document.getElementById("print-template").innerHTML,e=document.createElement("iframe");e.setAttribute("style","position: absolute; width: 0; height: 0;"),document.body.appendChild(e);const n=e.contentWindow.document;n.write(T),n.write("<div>"+o+"</div>"),setTimeout(function(){e.contentWindow.print(),document.body.removeChild(e)},50)})}return N(()=>{!i.record||JSON.stringify(i.record)==="{}"||F(i.record)}),_({print:v}),(s,o)=>(a(),d("div",k,[t("table",null,[t("div",P,[t("div",I,[o[0]||(o[0]=t("div",{class:"title"},"\u53D1\u8D27\u8FD0\u5355\u5BF9\u8D26\u5355",-1)),t("div",R,"\u5BF9\u8D26\u5355\u53F7\uFF1A"+u(l.value.payNo),1)]),t("div",S,[t("div",L,"\u7269\u6D41\u4F9B\u8D27\u5546\uFF1A"+u(l.value.supplierName),1),t("div",O,"\u521B\u5EFA\u65F6\u95F4\uFF1A"+u(l.value.createTime),1)]),t("div",j,[t("div",q,"\u4E1A\u52A1\u516C\u53F8\uFF1A "+u(l.value.companyName),1),t("div",G,"\u8FD0\u8D39\u603B\u989D\uFF1A"+u(l.value.totalPrice),1)])]),o[1]||(o[1]=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)),t("tbody",null,[(a(!0),d(C,null,A(c.value,(e,n)=>(a(),d("tr",{key:n},[t("td",null,u(n+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=B(H,[["__file","D:/work/jiesuan/settle-vue3/src/components/sendPrintRecord/src/index.vue"]]);export{z as P};