InvoiceAnalysis-44ae8318.js 4.77 KB
var p=(f,y,r)=>new Promise((c,n)=>{var A=a=>{try{s(r.next(a))}catch(u){n(u)}},d=a=>{try{s(r.throw(a))}catch(u){n(u)}},s=a=>a.done?c(a.value):Promise.resolve(a.value).then(A,d);s((r=r.apply(f,y)).next())});import{d as k,k as m,w as P,_,a9 as F,aa as g,a0 as B,f as C,$ as D,ac as M,u as h,ad as N,F as E}from"./vue-5a35c3f5.js";import{b as q,B as L}from"./index-c1c2669a.js";import{i as Q}from"./invoice-f64ec395.js";import{B as U}from"./BasicTable-7dbd57c0.js";import"./componentMap-4d1c941b.js";import"./TableImg.vue_vue_type_style_index_0_lang-6e828edc.js";import{u as j}from"./useTable-e28259fb.js";import{u as z,ad as J,al as W,_ as H}from"./index.js";import{u as Y}from"./order-eff5d778.js";import"./antd-6b087f69.js";import"./useWindowSizeFn-cc2fb57c.js";import"./BasicForm-53100365.js";import"./FormItem-ffc5ecef.js";import"./helper-95474dfc.js";import"./BasicForm.vue_vue_type_style_index_0_lang-3479a052.js";import"./uniqBy-0cd5a663.js";import"./useForm-86d11f60.js";import"./RadioButtonGroup-72b65d2e.js";import"./useFormItem-9ea791b8.js";import"./uuid-31b8b5a4.js";import"./merge-4fa735fa.js";import"./onMountedOrActivated-52afb7a7.js";import"./download-3d468407.js";import"./base64Conver-39fc0d26.js";import"./index-1ca3bd8a.js";import"./IconPicker-6bbd557c.js";import"./index-9a895eb5.js";import"./sortable.esm-4ae27e0b.js";import"./message-c4c6f446.js";const G={class:"p-4"},K=k({__name:"InvoiceAnalysis",setup(f){const y=z(),r=[{title:"客户编码",dataIndex:"actualPayedAmount",width:50,customRender:t=>{var e,o;return(o=(e=t==null?void 0:t.record)==null?void 0:e.exportVOS[0])==null?void 0:o.customerCode}},{title:"客户总金额汇总$",dataIndex:"customerTotalPrice",width:50,customRender:t=>{var e;return(e=t==null?void 0:t.record)==null?void 0:e.customerTotalPrice.toFixed(2)}},{title:"客户扣款金额汇总$",dataIndex:"deductAmount",width:50,customRender:t=>{var e;return(e=t==null?void 0:t.record)==null?void 0:e.deductAmount.toFixed(2)}},{title:"实际应收款$",dataIndex:"otherAmount",width:50,customRender:t=>{var e;return(e=t==null?void 0:t.record)==null?void 0:e.otherAmount.toFixed(2)}},{title:"实际收款金额汇总$",dataIndex:"actualReceivableAmount",width:50,customRender:t=>{var e;return(e=t==null?void 0:t.record)==null?void 0:e.actualReceivableAmount.toFixed(2)}},{title:"其他费用金额汇总$",dataIndex:"otherTotalAmount",width:50,customRender:t=>{var e;return(e=t==null?void 0:t.record)==null?void 0:e.otherTotalAmount.toFixed(2)}},{title:"未收金额合计$",dataIndex:"actualPayedAmount",width:50,customRender:t=>{var e;return(e=t==null?void 0:t.record)==null?void 0:e.actualPayedAmount.toFixed(2)}}],c=m(),n=m();m([]);const A=Y(),d=m();P(()=>J.state,(t,e)=>{d.value=A.getQueryVO},{deep:!0});const[s,{closeModal:a}]=q(t=>p(this,null,function*(){c.value=t.data,n.value=t.id,setTimeout(()=>{v()},50)})),[u,{reload:v}]=j({api:()=>p(this,null,function*(){const t=yield Q({ids:c.value,orderIds:n.value,queryVO:d.value}),e={customerTotalPrice:0,deductAmount:0,otherAmount:0,actualReceivableAmount:0,otherTotalAmount:0,actualPayedAmount:0,exportVOS:t[0].exportVOS?JSON.parse(JSON.stringify(t[0].exportVOS)):[]};return t.forEach(o=>{e.customerTotalPrice+=o.customerTotalPrice||0,e.deductAmount+=o.deductAmount||0,e.otherAmount+=o.otherAmount||0,e.actualReceivableAmount+=o.actualReceivableAmount||0,e.otherTotalAmount+=o.otherTotalAmount||0,e.actualPayedAmount+=o.actualPayedAmount||0}),e.exportVOS&&e.exportVOS[0]&&(e.exportVOS[0].customerCode="合计"),t.push(e),t}),columns:r,bordered:!0});function b(t){v()}m({});function S(){return p(this,null,function*(){const t=c.value,e=y.getToken;W.post("/basic-api/order/erp/invoice_bill/export",{ids:t,orderIds:n.value,queryVO:d.value},{headers:{Authorization:`${e}`},responseType:"blob"}).then(o=>{const x=new Blob([o.data],{type:"application/zip"}),w=(()=>{const i=new Date,O=i.getFullYear(),R=String(i.getMonth()+1).padStart(2,"0"),T=String(i.getDate()).padStart(2,"0"),V=String(i.getHours()).padStart(2,"0"),I=String(i.getMinutes()).padStart(2,"0"),$=String(i.getSeconds()).padStart(2,"0");return`${O}-${R}-${T} ${V}:${I}:${$}`})(),l=document.createElement("a");l.href=window.URL.createObjectURL(x),l.download=`收款单分析${w}.xlsx`,document.body.appendChild(l),l.click(),document.body.removeChild(l)}).catch(o=>{console.error(o)}),a()})}return(t,e)=>(_(),F(h(L),N(t.$attrs,{onRegister:h(s),title:"收款单分析",width:"60%",okText:"导出",isDetail:!0,showDetailBack:!1,onOk:S,onVisibleChange:b}),{default:g(()=>[B("div",G,[C(h(U),{onRegister:h(u)},{bodyCell:g(({column:o,record:x})=>[o.key==="action"?(_(),D(E,{key:0},[],64)):M("v-if",!0)]),_:1},8,["onRegister"])])]),_:1},16,["onRegister"]))}});const It=H(K,[["__scopeId","data-v-c28f4e2b"],["__file","E:/allcode/erp/test7901/order-erp-front/src/views/project/finance/financeList/InvoiceAnalysis.vue"]]);export{It as default};