ReceivePanel-498a0da1.js
9.52 KB
var B=(e,g,s)=>new Promise((I,F)=>{var N=u=>{try{y(s.next(u))}catch(m){F(m)}},b=u=>{try{y(s.throw(u))}catch(m){F(m)}},y=u=>u.done?I(u.value):Promise.resolve(u.value).then(N,b);y((s=s.apply(e,g)).next())});import ne from"./MsgModal-761f60f5.js";import{d as ie,k as n,e as se,a8 as M,_ as f,$ as O,f as L,aa as A,a9 as R,ac as h,F as K,E as P,a0 as a,a1 as v}from"./vue-5a35c3f5.js";import{B as re}from"./BasicTable-7dbd57c0.js";import{T as ue}from"./componentMap-4d1c941b.js";import"./TableImg.vue_vue_type_style_index_0_lang-6e828edc.js";import{u as de}from"./useTable-e28259fb.js";import{B as ce,u as pe}from"./index-c1c2669a.js";import{u as me,al as fe,_ as he}from"./index.js";import{g as ve,a as be,b as W}from"./approve-063b3195.js";import{R as ye}from"./type.d-d84bce65.js";import ke from"./BaseInfo-0e6fb131.js";import{c as Ae}from"./functional-213c1e18.js";import{g as ge}from"./data-c9ff8af1.js";import{D as Ce}from"./index-37bee0a2.js";import"./antd-6b087f69.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"./useWindowSizeFn-cc2fb57c.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";const we=me(),De=ie({components:{BasicTable:re,BasicModal:ce,TableAction:ue,Description:Ce,BaseInfo:ke,MsgModal:ne},props:{isApproved:{type:Boolean}},setup(e){const g=n(!1),s=n([]),I=n("1"),[F,{openModal:N,closeModal:b}]=pe(),y=n({}),u=n({}),m=n(""),E=n(),C=n(),d=n(),w=n(),_=n(),D=n(),S=n(),$=n(),U=n(""),x=n(""),c=n(),z=[{field:"totalPayAmount",label:"实际收款金额汇总"},{field:"totalCustomerAmount",label:"客户总价金额汇总"},{field:"deductAmount",label:"发生扣款金额汇总"},{field:"backRefundDate",label:"必须回款日期"},{field:"otherAmount",label:"其他费用汇总"},{field:"actualRefundDate",label:"实际回款日期"}];let T=[{title:"申请人",dataIndex:"createBy",width:150,customRender:t=>{var l,i;const{record:o}=t||{};return(i=(l=o==null?void 0:o.fieldInfos)==null?void 0:l.checkBillOrderDO)==null?void 0:i.financePerson}},{title:"INVOICE编号",dataIndex:"invoiceNo",width:150,customRender:t=>{var l,i;const{record:o}=t||{};return(i=(l=o==null?void 0:o.fieldInfos)==null?void 0:l.invoiceFieldVO)==null?void 0:i.invoiceNo}},{title:"内部编号",dataIndex:"innerNo",width:150,customRender:t=>{var i,r,p,k;const{record:o}=t||{},l=n((p=(r=(i=o==null?void 0:o.fieldInfos)==null?void 0:i.invoiceFieldVO)==null?void 0:r.innerNo)==null?void 0:p.map(V=>V));return(k=l==null?void 0:l.value)==null?void 0:k.join(",")}}];e.isApproved&&(T=T.concat([{title:"状态",dataIndex:"status",width:150,customRender:t=>{const{record:o}=t||{};return o.status===10?"通过":"拒绝"}},{title:"拒绝原因",dataIndex:"refuseRemark",width:250}]));const[H,{reload:j}]=de({api:e.isApproved?ve:be,searchInfo:{type:30},columns:T,useSearchForm:!0,formConfig:ge("invoiceNo"),rowKey:"id",actionColumn:{width:160,title:"Action",dataIndex:"action"}});function Y(t,o){o?s.value=[...s.value,t.id]:s.value=s.value.filter(l=>l!==t.id)}function q(t,o,l){const i=l==null?void 0:l.map(r=>r.id);t?s.value=[...s.value,...i]:s.value=s.value.filter(r=>!i.includes(r))}function G(t,o){return o==null||o.stopPropagation(),!1}function J(){}function Q(t){return B(this,null,function*(){var o,l,i,r,p,k;N(!0,{data:t}),c.value=t.fieldInfos.invoiceFieldVO,m.value=t.id,U.value=(o=c.value)==null?void 0:o.financePerson,x.value=(l=c.value)==null?void 0:l.trackerUser,C.value=(i=c.value.totalPayAmount)==null?void 0:i.toFixed(2),d.value=(r=c.value.totalCustomerAmount)==null?void 0:r.toFixed(2),w.value=(p=c.value.deductAmount)==null?void 0:p.toFixed(2),_.value=c.value.backRefundDate,D.value="",S.value=(k=c.value.otherAmount)==null?void 0:k.toFixed(2),E.value=c.value.invoiceNo,$.value=c.value.payee})}function X(){return B(this,null,function*(){yield W({status:10,id:m.value}),j(),b()})}function Z(){return B(this,null,function*(){g.value=!0})}function ee(t){}const te=se(()=>{var t,o;return(o=(t=we.getUserInfo)==null?void 0:t.roleSmallVO)==null?void 0:o.code});return{handleProfitModal:J,registerTable:H,checkedKeys:s,currentKey:I,onSelect:Y,handleEdit:G,onSelectAll:q,handleDetail:Q,registerModal:F,fieldInfos:y,baseInfos:u,handleTrue:X,handleFalse:Z,role:te,ROLE:ye,msgVisible:g,handleMsgModalClose:t=>B(this,null,function*(){t&&(yield W({status:20,id:m.value,refuseRemark:t}),j(),b()),g.value=!1}),handlePreview:t=>(Ae({imageList:[t],defaultWidth:500}),!1),mockData:c,schema:z,totalPayAmount:C,totalCustomerAmount:d,deductAmount:w,backRefundDate:_,actualRefundDate:D,otherAmount:S,invoiceNo:E,payee:$,handleExport:()=>B(this,null,function*(){try{const t=yield fe.post("/basic-api/order/erp/invoice_bill/exportReceipt",{invoiceNo:E.value,totalPayAmount:C.value,totalCustomerAmount:d.value,deductAmount:w.value,backRefundDate:_.value,actualRefundDate:D.value,otherAmount:S.value,payee:$.value,financePerson:U.value,trackerUser:x.value},{responseType:"blob"}),o=new Blob([t.data],{type:"application/octet-stream"}),i=(()=>{const p=new Date,k=p.getFullYear(),V=String(p.getMonth()+1).padStart(2,"0"),oe=String(p.getDate()).padStart(2,"0"),ae=String(p.getHours()).padStart(2,"0"),le=String(p.getMinutes()).padStart(2,"0");return`${k}-${V}-${oe} ${ae}:${le}`})(),r=document.createElement("a");r.href=window.URL.createObjectURL(o),r.download=`收款单_${i}.xlsx`,document.body.appendChild(r),r.click(),document.body.removeChild(r)}catch(t){console.error("获取收款单时出错:",t)}}),handleShow:ee}}}),Be=["src","onClick"],Fe={key:0,style:{width:"100%","border-collapse":"collapse","text-align":"center",border:"1px solid black","font-size":"16px"}},Ee=a("thead",null,[h(` <tr>
<th colspan="4" style="border: 1px solid black">净利润分析表</th>
</tr> `)],-1),Me=a("tr",null,[a("td",{colspan:"7",style:{"text-align":"center","font-weight":"bold","font-size":"24px"}},"收款单")],-1),Re=a("tr",null,[a("td",{style:{border:"1px solid black",width:"14%"}},"Invoice编号"),a("td",{style:{border:"1px solid black",width:"14%"}},"实际收款金额汇总"),a("td",{style:{border:"1px solid black",width:"14%"}},"客户总价金额汇总"),a("td",{style:{border:"1px solid black",width:"14%"}},"发生扣款金额汇总"),a("td",{style:{border:"1px solid black",width:"14%"}},"其他费用汇总"),a("td",{style:{border:"1px solid black",width:"14%"}},"必须回款日期"),a("td",{style:{border:"1px solid black",width:"14%"}},"实际回款日期")],-1),Ie={style:{border:"1px solid black",width:"14%"}},Ne={style:{border:"1px solid black",width:"14%"}},_e={style:{border:"1px solid black",width:"14%"}},Oe={style:{border:"1px solid black",width:"14%"}},Pe={style:{border:"1px solid black",width:"14%"}},Se={style:{border:"1px solid black",width:"14%"}},$e={style:{border:"1px solid black",width:"14%"}},Te={colspan:"7",style:{border:"1px solid black",padding:"10px"}},Ve={style:{display:"flex","justify-content":"space-between"}},Le=a("span",{style:{width:"20%"}},"收款单位:",-1),Ue={style:{width:"80%"}};function xe(e,g,s,I,F,N){const b=M("TableAction"),y=M("BasicTable"),u=M("a-button"),m=M("BasicModal"),E=M("MsgModal");return f(),O(K,null,[L(y,{onRegister:e.registerTable,className:"p-0"},{"form-custom":A(()=>[P(" custom-slot ")]),bodyCell:A(({column:C,record:d})=>{var w;return[C.key==="picUrl"?(f(),O("img",{key:0,width:50,height:50,src:(w=d==null?void 0:d.invoiceFieldVo)==null?void 0:w.smallPicUrl,onClick:_=>{var D;return e.handlePreview((D=d==null?void 0:d.invoiceFieldVo)==null?void 0:D.picUrl)}},null,8,Be)):h("v-if",!0),C.key==="action"?(f(),O(K,{key:1},[e.isApproved?h("v-if",!0):(f(),R(b,{key:0,actions:[{label:"审核",onClick:e.handleDetail.bind(null,d)}]},null,8,["actions"])),e.isApproved?(f(),R(b,{key:1,actions:[{label:"详情",onClick:e.handleDetail.bind(null,d)}]},null,8,["actions"])):h("v-if",!0)],64)):h("v-if",!0)]}),_:1},8,["onRegister"]),L(m,{formFooter:!e.isApproved&&e.role===e.ROLE.ADMIN,onRegister:e.registerModal,title:"申请信息",okText:"通过",width:"1000px",onOk:e.handleTrue,onVisibleChange:e.handleShow,showCancelBtn:!e.isApproved&&e.role===e.ROLE.ADMIN,showOkBtn:!e.isApproved&&e.role===e.ROLE.ADMIN},{appendFooter:A(()=>[!e.isApproved&&(e.role===e.ROLE.ADMIN||e.role===e.ROLE.FINANCE)?(f(),R(u,{key:0,onClick:e.handleFalse},{default:A(()=>[P(" 不通过")]),_:1},8,["onClick"])):h("v-if",!0),e.isApproved&&e.role===e.ROLE.ADMIN?(f(),R(u,{key:1,onClick:e.handleFalse},{default:A(()=>[P(" 驳回重填")]),_:1},8,["onClick"])):h("v-if",!0),L(u,{onClick:e.handleExport},{default:A(()=>[P(" 导出")]),_:1},8,["onClick"])]),default:A(()=>[e.showInvoice?h("v-if",!0):(f(),O("table",Fe,[Ee,a("tbody",null,[Me,Re,a("tr",null,[a("td",Ie,v(e.invoiceNo),1),a("td",Ne,"$"+v(e.totalPayAmount),1),a("td",_e,"$"+v(e.totalCustomerAmount),1),a("td",Oe,"$"+v(e.deductAmount),1),a("td",Pe,"$"+v(e.otherAmount),1),a("td",Se,v(e.backRefundDate),1),a("td",$e,v(e.actualRefundDate),1)]),a("tr",null,[a("td",Te,[a("div",Ve,[Le,a("span",Ue,v(e.payee),1)])])])])]))]),_:1},8,["formFooter","onRegister","onOk","onVisibleChange","showCancelBtn","showOkBtn"]),e.msgVisible?(f(),R(E,{key:0,onMsgModalClose:e.handleMsgModalClose},null,8,["onMsgModalClose"])):h("v-if",!0)],64)}const Bt=he(De,[["render",xe],["__file","E:/allcode/erp/test7901/order-erp-front/src/views/project/approve/ReceivePanel.vue"]]);export{Bt as default};