PayPanel-903d36bb.js 11.6 KB
var D=(t,v,r)=>new Promise((O,E)=>{var R=c=>{try{k(r.next(c))}catch(h){E(h)}},y=c=>{try{k(r.throw(c))}catch(h){E(h)}},k=c=>c.done?O(c.value):Promise.resolve(c.value).then(R,y);k((r=r.apply(t,v)).next())});import ge from"./MsgModal-761f60f5.js";import{d as we,k as a,e as Ce,a8 as I,_ as f,$ as N,f as H,aa as g,ac as p,a9 as M,F as oe,E as T,a0 as s,a1 as b}from"./vue-5a35c3f5.js";import{B as De}from"./BasicTable-7dbd57c0.js";import{T as Ee}from"./componentMap-4d1c941b.js";import"./TableImg.vue_vue_type_style_index_0_lang-6e828edc.js";import{u as Be}from"./useTable-e28259fb.js";import{B as Pe,u as Fe}from"./index-c1c2669a.js";import{v as Ie}from"./pdfShow-13fe577e.js";import{u as Ne,al as Me,_ as Oe}from"./index.js";import{g as Re,a as Ve,b as ae}from"./approve-063b3195.js";import{R as Se}from"./type.d-d84bce65.js";import Le from"./BaseInfo-0e6fb131.js";import{c as Ue}from"./functional-213c1e18.js";import{g as Te}from"./data-c9ff8af1.js";import{D as $e}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 je=Ne(),We=we({components:{BasicTable:De,BasicModal:Pe,TableAction:Ee,Description:$e,BaseInfo:Le,MsgModal:ge},props:{isApproved:{type:Boolean}},setup(t){const v=a(!1),r=a([]),O=a("1"),[E,{openModal:R,closeModal:y}]=Fe(),k=a({}),c=a({}),h=a(""),B=a(!1),n=a(),m=a([]),P=a(0),V=a(),w=a(),$=a(),j=a(),W=a(),K=a(),z=a(),q=a(""),G=a(""),le=[{field:"actualPayedAmount",label:"生产科实际应付金额汇总"},{field:"payedDate",label:"生产科付款日期"},{field:"actualPayedDate",label:"实际付款日期"},{field:"unPayedAmount",label:"未付金额"},{field:"totalActualPayedAmount",label:"实际付款金额汇总"},{field:"deductAmount",label:"生产科扣款金额汇总"}];let Y=[{title:"申请人",dataIndex:"createBy",width:150,customRender:o=>{var u,l,d;const{record:e}=o||{},i=a();if((e==null?void 0:e.type)===40?i.value=(u=e==null?void 0:e.fieldInfos)==null?void 0:u.producePaymentCheckBillFieldVO:(e==null?void 0:e.type)==50&&(i.value=(l=e==null?void 0:e.fieldInfos)==null?void 0:l.checkBillVO),(e==null?void 0:e.type)===40)return(d=i.value)==null?void 0:d.financePerson;if((e==null?void 0:e.type)==50)return e.createBy}},{title:"内部编号",dataIndex:"innerNo",width:150,customRender:o=>{var u,l,d,A;const{record:e}=o||{},i=a();if((e==null?void 0:e.type)===40)return i.value=(u=e==null?void 0:e.fieldInfos)==null?void 0:u.producePaymentCheckBillFieldVO,a((l=i.value)==null?void 0:l.innerNo.map(C=>C)).value.join(",");if((e==null?void 0:e.type)==50)return(A=(d=e==null?void 0:e.fieldInfos)==null?void 0:d.checkBillVO)==null?void 0:A.innerNo}},{title:"审核类型",dataIndex:"productionDepartment",width:150,customRender:o=>{const{record:e}=o||{};if((e==null?void 0:e.type)===40)return"应付账单申请";if((e==null?void 0:e.type)==50)return"生产科发票申请"}},{title:"生产科",dataIndex:"productionName",width:150,customRender:o=>{var u,l,d;const{record:e}=o||{},i=a();return(e==null?void 0:e.type)===40?i.value=(u=e==null?void 0:e.fieldInfos)==null?void 0:u.producePaymentCheckBillFieldVO:(e==null?void 0:e.type)==50&&(i.value=(l=e==null?void 0:e.fieldInfos)==null?void 0:l.checkBillVO),(d=i.value)==null?void 0:d.productionName}}];t.isApproved&&(Y=Y.concat([{title:"状态",dataIndex:"status",width:150,customRender:o=>{const{record:e}=o||{};return e.status===10?"通过":"拒绝"}},{title:"拒绝原因",dataIndex:"refuseRemark",width:250}]));const[ne,{reload:J}]=Be({api:t.isApproved?Re:Ve,searchInfo:{type:4050},columns:Y,useSearchForm:!0,formConfig:Te("checkNo"),rowKey:"id",actionColumn:{width:160,title:"Action",dataIndex:"action"}});function ie(o,e){e?r.value=[...r.value,o.id]:r.value=r.value.filter(i=>i!==o.id)}function se(o,e,i){const u=i.map(l=>l.id);o?r.value=[...r.value,...u]:r.value=r.value.filter(l=>!u.includes(l))}function ue(o,e){return e==null||e.stopPropagation(),!1}function de(){}function re(o){return D(this,null,function*(){var i,u,l,d,A,F,C,S,L,U,Q,X,Z,x,_,ee,te;o.type==50?(B.value=!0,n.value=o.fieldInfos.checkBillVO):o.type==40&&(B.value=!1,n.value=o.fieldInfos.producePaymentCheckBillFieldVO,q.value=(i=n.value)==null?void 0:i.financePerson,G.value=(u=n.value)==null?void 0:u.trackerUser),R(!0,{data:o}),h.value=o.id,m.value=[],P.value=(d=(l=n.value)==null?void 0:l.actualPayCalculate)==null?void 0:d.toFixed(2),V.value=(A=n.value)==null?void 0:A.checkNo,w.value=(C=(F=n.value)==null?void 0:F.actualPayedAmount)==null?void 0:C.toFixed(2),$.value=(S=n.value)==null?void 0:S.payedDate,j.value="",W.value=(U=(L=n.value)==null?void 0:L.unPayedAmount)==null?void 0:U.toFixed(2),K.value=(X=(Q=n.value)==null?void 0:Q.totalActualPayedAmount)==null?void 0:X.toFixed(2),z.value=(x=(Z=n.value)==null?void 0:Z.deductAmount)==null?void 0:x.toFixed(2);const e=(ee=(_=n.value)==null?void 0:_.invoiceUrl)==null?void 0:ee.match(/aliyuncs\.com\/(.*?)\?/);e&&e[1]?n.value.invoiceName=decodeURIComponent(e[1]):n.value.invoiceName=(te=n.value)==null?void 0:te.invoiceUrl})}function ce(){}function pe(){return D(this,null,function*(){yield ae({status:10,id:h.value}),J(),y()})}function me(){return D(this,null,function*(){v.value=!0})}function fe(){return D(this,null,function*(){Me.post("/basic-api/order/erp/check_bill/exportReceipt",{checkNo:V.value,actualPayedAmount:w.value,deductAmount:z.value,totalActualPayedAmount:K.value,unPayedAmount:W.value,payedDate:$.value,actualPayedDate:j.value,financePerson:q.value,trackerUser:G.value},{responseType:"blob"}).then(o=>{const e=new Blob([o.data],{type:"application/octet-stream"}),u=(()=>{const d=new Date,A=d.getFullYear(),F=String(d.getMonth()+1).padStart(2,"0"),C=String(d.getDate()).padStart(2,"0"),S=String(d.getHours()).padStart(2,"0"),L=String(d.getMinutes()).padStart(2,"0"),U=String(d.getSeconds()).padStart(2,"0");return`${A}-${F}-${C} ${S}:${L}:${U}`})(),l=document.createElement("a");l.href=window.URL.createObjectURL(e),l.download=`付款单${u}.xlsx`,document.body.appendChild(l),l.click(),document.body.removeChild(l)}).catch(o=>{console.error(o)}),y()})}const he=Ce(()=>{var o,e;return(e=(o=je.getUserInfo)==null?void 0:o.roleSmallVO)==null?void 0:e.code}),ve=o=>D(this,null,function*(){o&&(yield ae({status:20,id:h.value,refuseRemark:o}),J(),y()),v.value=!1}),ye=o=>(Ue({imageList:[o],defaultWidth:500}),!1);function be(o){const e=["png","jpg","jpeg","gif","bmp","svg"],i=o.split("?")[0];return e.some(u=>i.toLowerCase().endsWith(u))}function ke(o){return o.toLowerCase().endsWith(".pdf")}function Ae(o){const e=o.split("?")[0];be(e)?window.open("","","").document.write(`<!DOCTYPE html>
      <html>
        <body style="display: flex; justify-content: center; align-items: center;">
          <img src='${o}' width="300px" height="auto"/>
        </body>
      </html>`):ke(e)?Ie(o):console.log("不支持的文件类型")}return{handleProfitModal:de,registerTable:ne,checkedKeys:r,currentKey:O,onSelect:ie,handleEdit:ue,onSelectAll:se,handleDetail:re,registerModal:E,fieldInfos:k,baseInfos:c,handleTrue:pe,handleFalse:me,role:he,ROLE:Se,msgVisible:v,handleMsgModalClose:ve,handlePreview:ye,mockData:n,schema:le,showInvoice:B,openPic:Ae,handleShow:ce,actualPayCalculate:P,checkNo:V,actualPayedAmount:w,payedDate:$,actualPayedDate:j,unPayedAmount:W,totalActualPayedAmount:K,deductAmount:z,handleExport:fe}}}),Ke=["src","onClick"],ze={key:0,style:{width:"100%","border-collapse":"collapse","text-align":"center",border:"1px solid black","font-size":"16px"}},Ye=s("thead",null,[p(` <tr>
          <th colspan="4" style="border: 1px solid black">净利润分析表</th>
        </tr> `)],-1),He=s("tr",null,[s("td",{colspan:"7",style:{"text-align":"center","font-weight":"bold","font-size":"24px"}},"付款单")],-1),qe=s("tr",null,[s("td",{style:{border:"1px solid black",width:"14%"}},"生产科对账单号"),s("td",{style:{border:"1px solid black",width:"14%"}},"实际应付金额"),s("td",{style:{border:"1px solid black",width:"14%"}},"扣款金额"),s("td",{style:{border:"1px solid black",width:"14%"}},"实际付款金额"),s("td",{style:{border:"1px solid black",width:"14%"}},"未付金额"),s("td",{style:{border:"1px solid black",width:"14%"}},"必须付款日期"),s("td",{style:{border:"1px solid black",width:"14%"}},"实际付款日期")],-1),Ge={style:{border:"1px solid black",width:"14%"}},Je={style:{border:"1px solid black",width:"14%"}},Qe={style:{border:"1px solid black",width:"14%"}},Xe={style:{border:"1px solid black",width:"14%"}},Ze={style:{border:"1px solid black",width:"14%"}},xe={style:{border:"1px solid black",width:"14%"}},_e={style:{border:"1px solid black",width:"14%"}};function et(t,v,r,O,E,R){const y=I("TableAction"),k=I("BasicTable"),c=I("a-button"),h=I("BasicModal"),B=I("MsgModal");return f(),N(oe,null,[H(k,{onRegister:t.registerTable,className:"p-0"},{"form-custom":g(()=>[T(" custom-slot ")]),bodyCell:g(({column:n,record:m})=>{var P;return[n.key==="picUrl"?(f(),N("img",{key:0,width:50,height:50,src:(P=m==null?void 0:m.producePaymentCheckBillFieldVO)==null?void 0:P.smallPicUrl,onClick:V=>{var w;return t.handlePreview((w=m==null?void 0:m.producePaymentCheckBillFieldVO)==null?void 0:w.picUrl)}},null,8,Ke)):p("v-if",!0),n.key==="action"?(f(),N(oe,{key:1},[t.isApproved?p("v-if",!0):(f(),M(y,{key:0,actions:[{label:"审核",onClick:t.handleDetail.bind(null,m)}]},null,8,["actions"])),t.isApproved?(f(),M(y,{key:1,actions:[{label:"详情",onClick:t.handleDetail.bind(null,m)}]},null,8,["actions"])):p("v-if",!0)],64)):p("v-if",!0)]}),_:1},8,["onRegister"]),p(' :showFooter="!isApproved && role === ROLE.ADMIN" '),H(h,{formFooter:!t.isApproved&&t.role===t.ROLE.ADMIN||t.showInvoice,onRegister:t.registerModal,title:"申请信息",okText:"通过",width:"900px",onOk:t.handleTrue,onVisibleChange:t.handleShow,showCancelBtn:!t.isApproved&&t.role===t.ROLE.ADMIN||t.showInvoice&&t.role===t.ROLE.FINANCE,showOkBtn:!t.isApproved&&t.role===t.ROLE.ADMIN||t.showInvoice&&t.role===t.ROLE.FINANCE},{appendFooter:g(()=>[!t.isApproved&&(t.role===t.ROLE.ADMIN||t.role===t.ROLE.FINANCE)||!t.isApproved&&t.showInvoice&&t.role===t.ROLE.FINANCE?(f(),M(c,{key:0,onClick:t.handleFalse},{default:g(()=>[T(" 不通过")]),_:1},8,["onClick"])):p("v-if",!0),t.isApproved&&t.role===t.ROLE.ADMIN||t.isApproved&&t.showInvoice&&t.role===t.ROLE.FINANCE?(f(),M(c,{key:1,onClick:t.handleFalse},{default:g(()=>[T(" 驳回重填")]),_:1},8,["onClick"])):p("v-if",!0),H(c,{onClick:t.handleExport},{default:g(()=>[T(" 导出")]),_:1},8,["onClick"])]),default:g(()=>[t.showInvoice?p("v-if",!0):(f(),N("table",ze,[Ye,s("tbody",null,[He,qe,s("tr",null,[s("td",Ge,b(t.checkNo),1),s("td",Je,"¥"+b(t.actualPayedAmount),1),s("td",Qe,"¥"+b(t.deductAmount),1),s("td",Xe,"¥"+b(t.totalActualPayedAmount),1),s("td",Ze,"¥"+b(t.unPayedAmount),1),s("td",xe,b(t.payedDate),1),s("td",_e,b(t.actualPayedDate),1)])])])),t.showInvoice?(f(),N("a",{key:1,onClick:v[0]||(v[0]=n=>t.openPic(t.mockData.invoiceUrl)),rel:"noopener noreferrer"},b(t.mockData.invoiceName),1)):p("v-if",!0)]),_:1},8,["formFooter","onRegister","onOk","onVisibleChange","showCancelBtn","showOkBtn"]),t.msgVisible?(f(),M(B,{key:0,onMsgModalClose:t.handleMsgModalClose},null,8,["onMsgModalClose"])):p("v-if",!0)],64)}const Lt=Oe(We,[["render",et],["__file","E:/allcode/erp/test7901/order-erp-front/src/views/project/approve/PayPanel.vue"]]);export{Lt as default};