import{_ as D,d as E,aP as A,w as f,a0 as B,o as i,c as d,b as e,L as l,u as c,F as h,a as g,D as C,y as k}from"./index.1d1a5ecb.js";import{a as m}from"./calc.1104f430.js";var T=`<style rel="stylesheet">
      @page{
        margin: 30px;
      }

      .header{
        width:100%;
        margin:0px;
        display: flex;
        font-size: 19px;
        flex-wrap:wrap;
        flex-direction: column;
      }

      .header > .first {
          border: 1px solid #909399;
          border-bottom: none;
          text-align: center;
          display:flex;
      }

      .header > .first > .title {
        font-weight: 700;
        flex:1;
        border-right:1px solid #909399;
        font-size: 22px;
      }

      .header > .first > .record {
        width:325px;
        text-align: left;
        padding-left: 10px;
        box-sizing:border-box;
      }

      .header > .column > .create {
        width:325px;
        text-align: left;
        padding-left: 10px;
        box-sizing:border-box;
      }

      .header > .column {
        text-align:center;
        display:flex;
        border:1px solid #909399;
        border-bottom:none;

      }

      .header > .column > .company {
        flex: 1;
        border-right:1px solid #909399;
      }

      .header > .column > .supplier {
        flex: 1;
        border-right:1px solid #909399;
      }



      .header > .column > .total {
        width:325px;
        text-align: left;
        padding-left: 10px;
        box-sizing:border-box;
      }

      table {
        border-collapse: collapse;
        width: 100%;
      }
         
      
      tr {
        page-break-inside: avoid;
      }

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