File: /var/www/html/public/static/js/hookReconciliation-legacy-c7ca09a4.js
System.register(["./po-legacy-62cee428.js","./vue-router-legacy-a12307c3.js","./index-legacy-42c17c53.js","./message-legacy-10af7c73.js","./runtime-core.esm-bundler-legacy-c5df00b7.js","./index-legacy-a78e7762.js","./preload-helper-legacy-f8638e03.js","./vue-i18n.runtime.esm-bundler-legacy-720876b1.js","./index-legacy-c9e20962.js","./_commonjsHelpers-legacy-5498c249.js","./utils-legacy-c0023c33.js","./focus-trap-legacy-631b7396.js","./error-legacy-e98f9e58.js"],(function(e,t){"use strict";var a,n,i,o,c,l,s,u,r,d,m,g;return{setters:[e=>{a=e.getScheduleInvoiceWeb,n=e.getCheckMembersWeb,i=e.invoiceBalanceWeb,o=e.prePaidWeb,c=e.deleteCompanyWeb},e=>{l=e.d,s=e.u},e=>{u=e.o},e=>{r=e.b7},e=>{d=e.r,m=e.A,g=e.o},null,null,null,null,null,null,null,null],execute:function(){e("useEqu",(function(){l(),s(),l();const e=d(),t=d(!1),h=d(!1),_=d(!1),p=d(!1),y=d(!1),b=d(!1),v=d(""),C=d([]),f=d([]),j=d([]),k=m({}),A=m({tableIndex:0,note:""}),L=m({Client_name:"",Client_id:""}),I=m({name:"",id:"",clinic_id:""}),W=m({name:"",customer_id:"",pay_amount:"",pay_method:"",cheque_number:"",content:"",invoice_id:"",total_amount1:"",total_amount2:""}),w=m({}),x=m({}),P=m({}),D=m({}),S=m({}),T=m({total:0,pageSize:10,currentPage:1,background:!0,currentPage:1,pageSizes:[10,25,50,100]}),N=m({order_key:"",material_key:"",truck_key:"",truck_id:"",comment:"",show:"",searchKey:""});async function O(){t.value=!0;const{data:e}=await a(Object.assign(k,{customer_id:L.Client_id,searchKey:N.searchKey1}));C.value=e.data,W.total_amount1=e.total_amount,t.value=!1}async function B(e){const{data:t}=await c(Object.assign(P,{company_id:e.id}));1==t.code?(O(),r({type:"success",message:t.msg})):r({type:"error",message:t.msg})}async function F(){const{data:e}=await n(Object.assign(D,{customer_id:L.Client_id}));1==e.code?(j.value=e.data,W.total_amount2=e.total_amount):r({type:"error",message:e.msg})}return g((()=>{})),{searchDetail:N,btnSearchPart:function(){O()},loading:t,small:b,selectList:["Invoice No","Total Charge","Paid Amount","Need Charge","Invoice Time","Charge Amount"],columns:[{type:"selection",width:55,align:"left",hide:({checkList:e})=>!e.includes("勾选列")},{label:"序号列",type:"index",width:70,hide:({checkList:e})=>!e.includes("序号列")},{label:"Invoice No",prop:"invoice_number",minWidth:100,hide:({checkList:e})=>!e.includes("Invoice No")},{label:"Total Charge",prop:"total_amount",minWidth:100,hide:({checkList:e})=>!e.includes("Total Charge")},{label:"Paid Amount",prop:"pay_amount",minWidth:100,hide:({checkList:e})=>!e.includes("Paid Amount")},{label:"Need Charge",prop:"need_charge_amount",minWidth:100,hide:({checkList:e})=>!e.includes("Need Charge")},{label:"Invoice Time",prop:"invoice_date",minWidth:150,hide:({checkList:e})=>!e.includes("Invoice Time")},{label:"Charge Amount",prop:"email",minWidth:150,slot:"operation",hide:({checkList:e})=>!e.includes("Charge Amount")}],pagination:T,handleSizeChange:function(e){T.pageSize=e,O()},handleCurrentChange:function(e){T.currentPage=e,O()},PartList:C,order_date:v,deliverDialog:h,selectClick:(e,t)=>{},itemArr:A,addLocationDialog:p,locationArr:w,EditLocation:function(e){Object.keys(e).map((t=>{w[t]=e[t]}))},btnDellocation:e=>{u.confirm("Are you sure you want to delete this location",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{B(e)})).catch((()=>{r({type:"info",message:"Canceled"})}))},singleTableRef:e,addForm:L,ClientDialog:_,eventIsNum:function(){L.Client_id=I.id,L.Client_name=I.name,O(),F()},ClientData:I,onSelClient:function(){I.clinic_id=localStorage.getItem("clinicIdOverall"),_.value=!0},loadPartList:O,invoiceBalanceData:f,AddCollect:function(){y.value=!0},addCollectionDialog:y,collectionArr:W,CollectionData:j,btncollectionConfirm:async function(){const{data:e}=await o(Object.assign(S,{customer_id:L.Client_id,pay_amount:W.pay_amount,pay_method:W.pay_method,cheque_number:W.cheque_number,content:W.content}));1==e.code?(F(),r({type:"success",message:e.msg}),y.value=!1):r({type:"error",message:e.msg})},invoiceBalanceConfirm:async function(){t.value=!0;const{data:e}=await i(Object.assign(x,{customer_id:L.Client_id,invoice_details:C.value,pay_detail:j.value}));1==e.code?(r({type:"success",message:e.msg}),O(),F()):r({type:"error",message:e.msg}),t.value=!1},AutoBalance:function(){let e=W.total_amount1,t=W.total_amount2,a=Math.min(e,t),n=Math.min(e,t);C.value.forEach(((e,t)=>{let n=e.need_charge_amount,i=Math.min(n,a);i>0&&(e.paid_amount=i,a=parseFloat((a-i).toFixed(2)))})),j.value.forEach(((e,t)=>{let a=Math.min(e.remain_amount,n);a>0&&(e.paid_amount=a,n=parseFloat((n-a).toFixed(2)))}))}}}))}}}));