index.9facfe55.js 5.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. 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.42bf163d.js";import{a as m}from"./calc.1104f430.js";var T=`<style rel="stylesheet">
  2. @page{
  3. margin: 30px;
  4. }
  5. .header{
  6. width:100%;
  7. margin:0px;
  8. display: flex;
  9. font-size: 19px;
  10. flex-wrap:wrap;
  11. flex-direction: column;
  12. }
  13. .header > .first {
  14. border: 1px solid #909399;
  15. border-bottom: none;
  16. text-align: center;
  17. display:flex;
  18. }
  19. .header > .first > .title {
  20. font-weight: 700;
  21. flex:1;
  22. border-right:1px solid #909399;
  23. font-size: 22px;
  24. }
  25. .header > .first > .record {
  26. width:325px;
  27. text-align: left;
  28. padding-left: 10px;
  29. box-sizing:border-box;
  30. }
  31. .header > .column > .create {
  32. width:325px;
  33. text-align: left;
  34. padding-left: 10px;
  35. box-sizing:border-box;
  36. }
  37. .header > .column {
  38. text-align:center;
  39. display:flex;
  40. border:1px solid #909399;
  41. border-bottom:none;
  42. }
  43. .header > .column > .company {
  44. flex: 1;
  45. border-right:1px solid #909399;
  46. }
  47. .header > .column > .supplier {
  48. flex: 1;
  49. border-right:1px solid #909399;
  50. }
  51. .header > .column > .total {
  52. width:325px;
  53. text-align: left;
  54. padding-left: 10px;
  55. box-sizing:border-box;
  56. }
  57. table {
  58. border-collapse: collapse;
  59. width: 100%;
  60. }
  61. tr {
  62. page-break-inside: avoid;
  63. }
  64. td, th {
  65. border: 1px solid #909399;
  66. font-weight: 500;
  67. font-size:12px;
  68. }
  69. </style>
  70. `;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};