File: /var/www/html/public/static/js/hook-legacy-a3c39653.js
System.register(["./po-legacy-56fe113f.js","./employee_invoice-legacy-8cdcb193.js","./message-legacy-10af7c73.js","./runtime-core.esm-bundler-legacy-c5df00b7.js","./index-legacy-a6c772a2.js","./preload-helper-legacy-f8638e03.js","./vue-i18n.runtime.esm-bundler-legacy-720876b1.js","./index-legacy-c9e20962.js","./_commonjsHelpers-legacy-5498c249.js","./vue-router-legacy-a12307c3.js","./utils-legacy-c0023c33.js"],(function(e,t){"use strict";var a,i,n,o,c,l,s,_,d,r,m,u,v,p;return{setters:[e=>{a=e.prePaidWeb,i=e.invoicePaymentWeb,n=e.getEmployeeFormListByCompanyIdWeb,o=e.submitEmployeeInvoiceWeb,c=e.EmployeeInvoiceExportXLS,l=e.EmployeeInvoiceDetail,s=e.CheckEmployeeInvoiceWeb,_=e.getCheckMembersWeb},e=>{d=e.getList,r=e.getOptions},e=>{m=e.b7},e=>{u=e.r,v=e.A,p=e.o},null,null,null,null,null,null,null],execute:function(){e("useList",(function(){const e=u(!1),t=u(!1),g=u(!1),h=u(!1),y=u(!1),b=u([]),f=v({}),C=v({}),x=v({}),w=v({}),I=v({}),D=v({}),A=v({}),N=u(!1),j=u(0),k=u(0),T=u(""),O=u(""),E=u(15),S=u([]),P=u([]),F=u([]),M=u([]),W=u([]),L=u([]),q=u([]),H=u([]),R=u(1),B=u(!1),V=v({Invoice_Charge_Number:"",Customer_Name:"",Invoice_Total_Charge:"",Has_Paid_Amount:"",Need_Charge_Amount:"",Total_Paid_Amount:"",customer_id:"",customer_name:""}),z=v({is_clinicIndex:0,note_begin_date:"",note_end_date:"",service_date_last:"",is_title_id:"",table_total:0,split_amount:0,split_rate:0,InvoiceDate:""}),J=v({invoice_number:"",invoice_date:"",total_price:"",item_charge:"",new_item_charge:"",new_total_price:"",invoice_id:""}),X=v({total_amount:"",split_rate:"",Amount_Due:"",date:"",name:"",LocationWorked:"",Address:"",Address1:"",HST:"",INVOICE:"",RMT:"",PayPeriod:""}),Y=u([{id:1,text:"Paypal",value:"Paypal"},{id:2,text:"VISA",value:"VISA"},{id:3,text:"MasterCard",value:"MasterCard"},{id:4,text:"AMERICAN_EXPRESS",value:"AMERICAN_EXPRESS"},{id:5,text:"Cheque",value:"Cheque"},{id:6,text:"BankTransfer",value:"BankTransfer"},{id:7,text:"Cash",value:"Cash"},{id:8,text:"Other",value:"Other"}]),G=u([{id:1,text:"111",value:1,is_selected:0},{id:2,text:"222",value:2,is_selected:0},{id:3,text:"333",value:2,is_selected:0}]),K=v({name:"",customer_id:"",pay_amount:"",pay_method:"",cheque_number:"",content:"",invoice_id:"",time:"",other:""}),Q=v({invoice_type:"normal",loacation_id:"",loacation_name:"",Client_name:"",Client_id:"",date:"",description_type:"Massage",description_type1:"",Invoice_Number:"",hstValue:0,total:0,include_tax:"N",is_tax:"Y",is_tax1:!0,r_ac_name:"",r_ac_register:"",name1:"",rmt_register:"",signal_image:"",signal_desc:"",receive:"",invoice_due_date:"",customArr:"",fileName:"",email_content:"",file_path:"",is_web:1,name:"",licence_number:"",licence_name:"",licence_title:"",description:"",amount1:"",booking_order_no:"",bookingorder_id:"",Invoice_Charge_Number:"",Customer_Name:"",Invoice_Total_Charge:"",Has_Paid_Amount:"",Need_Charge_Amount:""}),U=v({total:0,pageSize:E.value,pageSizes:[10,15,20,50,100],currentPage:1,background:!0}),Z=v({uid:"",code:"",name:"",phone:"",email:""}),$=u(!1),ee=v({fno:"",fname:""}),te=u([]),ae={},ie=u("");async function ne(e={}){N.value=!0;const{data:t,meta:a,ext:i}=await d(Object.assign(ce,{page:U.currentPage,resault:U.pageSize},{search:JSON.stringify(e)}));b.value=t,U.total=a.total,be.value=i.price_config,setTimeout((()=>{N.value=!1,we.value=!0,Ie.value=!1}),500)}const oe=u([]),ce=v({company_id:0,begin_time:"",begin_end:"",serve_begin_time:"",serve_begin_end:"",duration:""}),le=u([]),se=u([]),_e=u([]),de=u([]),re=u("Invoice"),me=u(!1),ue=u(!1),ve=u(!0),pe=u(""),ge=u(0);me.value=!1;const he=u([]),ye=u([]),be=u([]);async function fe(){Ie.value=!0;const{data:e}=await r({is_used:1});pe.value=e.row_key,e.options&&(G.value=JSON.parse(JSON.stringify(e.options.comp_list)),z.is_title_id=G.value[0].id,z.note_begin_date=G.value[0].note_begin_date,z.note_end_date=G.value[0].note_end_date,z.service_date_last=G.value[0].service_date_last),ye.value=[],e.options?.comp_list.forEach(((e,t)=>{ye.value.push({label:e.company_name,value:e.id})})),e.options?.comp_list.length>0&&(ce.company_id=parseInt(e.options?.comp_list[0].id));let t=[],a=!1;me.value&&(t.push({type:"selection",width:55,align:"left",selectable:(t,a)=>!e.exclude||!function(e,t){if(!e||0===Object.keys(e).length)return!0;const a=[];for(let i of t){const t=i.field,n=i.oper,o=i.value;let c,l="";switch(e.hasOwnProperty(t)&&(l=e[t]),n){case">":c=l>o;break;case"<":c=l<o;break;case">=":c=l>=o;break;case"<=":c=l<=o;break;case"=":c=l===o;break;default:c=!1}a.push(c)}return a.every((e=>!0===e))}(t,e.exclude),fixed:!0,reserveSelection:!0}),a=!0),e.sec_fields.length>0?(a?t.push({type:"expand",slot:"expand"}):t.push({type:"expand",slot:"expand",fixed:!0,width:40}),t.push({label:"序号",type:"index",minWidth:60})):a?t.push({label:"Index",type:"index",minWidth:40,width:60}):t.push({label:"序号",type:"index",minWidth:40,width:60,fixed:!0}),ve.value&&t.push({label:"Action",fixed:"right",width:430,slot:"operation"});for(let i in e.fields){let a=e.fields[i];t.push(a)}if(le.value=t,le.value.forEach(((e,t)=>{"Status"==e.label&&(e.slot="status")})),e.sec_fields.length>0){let t=[];t=[{label:"序号",type:"index",minWidth:40}];for(let a in e.sec_fields){let i=e.sec_fields[a];t.push(i)}se.value=t}if(e.third_fields.length>0){let t=[{label:"序号",type:"index",width:70}];for(let a in e.third_fields){let i=e.sec_fields[a];t.push(i)}_e.value=t}e.model&&(O.value=e.model.cmt),E.value=e.page_num,U.pageSize=e.page_num,ne()}const Ce=v({form_json:{},data:{},field_setup:{},tpl_id:0}),xe=u(!1),we=u(!1),Ie=u(!1),De=u({}),Ae=v({id:0,company_id:0,invoice_number:"",invoice_date:"",total_price:0,items:[]});async function Ne(){const{data:t}=await _(Object.assign(f,{customer_id:K.customer_id,actiontype:"employee_company"}));if(1==t.code){S.value=t.data;let a=Q.Need_Charge_Amount;S.value.forEach(((e,t)=>{let i=Math.min(e.remain_amount,a);i>0&&(e.paid_amount=i,a=parseFloat((a-i).toFixed(2)))})),e.value=!0}else m({type:"error",message:t.msg})}async function je(){const{data:e}=await n(Object.assign(w,{company_id:z.is_title_id,service_begin_date:z.note_begin_date,service_end_date:z.note_end_date}));1==e.code?(M.value=e.data.content,F.value=e.data.title,W.value=e.data.total.content,z.table_total=e.data.total.total,z.split_amount=e.data.split_amount,z.split_rate=e.data.split_rate):m({type:"error",message:e.msg})}function ke(){var e=new Date,t=e.getFullYear(),a=("0"+(e.getMonth()+1)).slice(-2),i=("0"+e.getDate()).slice(-2);z.InvoiceDate=t+"-"+a+"-"+i}async function Te(e,t){const{data:a}=await l(Object.assign(A,{invoice_id:e.invoice_id}));if(1==a.code){L.value=a.data.item_conctent.content,q.value=a.data.item_conctent.title,H.value=a.data.item_conctent.total.content,X.total_amount=a.data.item_conctent.total.total_amount,X.LocationWorked=a.data.item_conctent.company.company_name,X.Address=a.data.item_conctent.company.address,X.Address1=a.data.item_conctent.company.address1,X.HST=a.data.item_conctent.company.hst,X.INVOICE=a.data.item_conctent.invoice.invoice_number,X.RMT=a.data.item_conctent.company.licence_number,X.PayPeriod=a.data.item_conctent.invoice.pay_period,X.date=a.data.item_conctent.invoice.english_date,X.name=a.data.item_conctent.company.username,X.split_rate=a.data.item_conctent.company.split_rate;let i=Number(X.total_amount)*(Number(X.split_rate)/100);X.Amount_Due=i.toFixed(2),"Check"==t?(J.invoice_number=a.data.item_conctent.invoice.invoice_number,J.invoice_date=a.data.item_conctent.invoice.invoice_date,J.total_price=a.data.item_conctent.invoice.total_price,J.item_charge=a.data.item_conctent.invoice.item_charge,J.new_item_charge=a.data.item_conctent.invoice.new_item_charge,J.new_total_price=a.data.item_conctent.invoice.new_total_price,P.value=a.data.detail,J.invoice_id=e.invoice_id,y.value=!0):"Detail"==t&&(h.value=!0)}else m({type:"error",message:a.msg})}function Oe(){var e=new Date,t=e.getFullYear(),a=("0"+(e.getMonth()+1)).slice(-2),i=("0"+e.getDate()).slice(-2);K.time=t+"-"+a+"-"+i}return p((()=>{fe()})),{InvData:Ae,resetInvForm:()=>{Object.assign(Ae,{id:0,company_id:0,invoice_number:"",invoice_date:"",total_price:0,items:[]})},dur_list:be,comp_list:ye,product_list:he,show_select_btn:ue,statusHas:function(e,t){return!t.hasOwnProperty("op_list")||t.op_list.includes(e)},tpl_item_id:ge,load_defualt_search:De,paramString:ie,row_key:pe,config_loading:Ie,search_load:we,show_operate:ve,select_items:oe,handleSelectionChange:function(e){oe.value=e.map((e=>e.id))},show_select:me,show_search:xe,search_info:Ce,customOperates:de,model_name:re,model_id:j,entity_id:k,toEntityList:function(e){},handleCurrentChange:function(e){ne()},handleDesignForm:function(e){},resetForm:e=>{e&&(e.resetFields(),Object.assign(ce,{begin_time:"",begin_end:"",serve_begin_time:"",serve_begin_end:"",duration:""}),ne())},childColumns:se,columns:le,search_form:ce,form_name:T,form_desc:O,vFormRefMap:ae,setItemRef:(e,t)=>{e&&(ae[t]=e)},activeNames:te,onSearchParams:function(){ne()},onSearch:ne,selectList:["模型ID","模型名称","模型表","模型路径","是否可用","添加时间","添加人"],editFormDialogVisible:$,editformData:Z,form:ee,loading:N,dataList:b,pagination:U,btnCollection:function(e){let t={Invoice_Charge_Number:e.invoice_number,Customer_Name:e.company,Invoice_Total_Charge:e.total_amount,Has_Paid_Amount:e.pay_amount,Need_Charge_Amount:e.need_charge_amount,Total_Paid_Amount:"",customer_id:e.company_id,customer_name:e.company,invoice_id:e.id,actiontype:"employee_company"};return R.value=1,V.value=t,void(B.value=!0)},addForm:Q,CollectionDialog:e,CollectionData:S,AddCollect:function(){Oe(),t.value=!0},addCollectionDialog:t,btncollectionConfirm:async function(){if(N.value=!0,"Cheque"!=K.pay_method&&(K.cheque_number=""),"Cheque"==K.pay_method&&""==K.cheque_number)return m({type:"error",message:"Please enter cheque number"}),void(N.value=!1);let e="";if("Other"==K.pay_method){if(""==K.other)return m({type:"error",message:"Please enter pay method"}),void(N.value=!1);e=K.other}else e=K.pay_method;const{data:i}=await a(Object.assign(x,{company_id:K.customer_id,pay_amount:K.pay_amount,pay_method:e,cheque_number:K.cheque_number,content:K.content,actiontype:"employee_company",collection_time:K.time}));1==i.code?(Ne(),m({type:"success",message:i.msg}),t.value=!1,N.value=!1):(N.value=!1,m({type:"error",message:i.msg}))},collectionArr:K,bookingPaymentConfirm:async function(){const{data:t}=await i(Object.assign(C,{invoice_id:K.invoice_id,pay_amount_details:S.value,actiontype:"employee_company"}));1==t.code?(ne(),e.value=!1):m({type:"error",message:t.msg})},addInvoiceDialog:g,AddInvoiceOpen:function(){G.value.forEach(((e,t)=>{e.id==z.is_title_id&&(z.is_clinicIndex=t,z.note_begin_date=e.note_begin_date,z.note_end_date=e.note_end_date,z.service_date_last=e.service_date_last)})),je(),ke(),g.value=!0},clinicList:G,addInvoiceArr:z,btnMune:function(e,t){z.is_title_id=e.id,z.is_clinicIndex=t,z.note_begin_date=e.note_begin_date,z.note_end_date=e.note_end_date,z.service_date_last=e.service_date_last,je()},addInvoiceSearch:je,FormList:M,FormTitle:F,FormTotal:W,checkboxForm:function(e,t){W.value.forEach(((e,t)=>{e.val=Number(0)})),z.table_total=0;let a=0;M.value.forEach(((e,t)=>{e.is_selected&&(z.table_total=(Number(z.table_total)+Number(e.total)).toFixed(2),e.content.forEach(((e,t)=>{W.value.forEach(((a,i)=>{t==i&&(a.val=Number(a.val)+Number(e.value))}))})))})),a=Number(z.table_total)*(Number(z.split_rate)/100),z.split_amount=a.toFixed(2)},addInvoicConfirm:async function(){const{data:e}=await o(Object.assign(I,{invoice_date:z.InvoiceDate,company_id:z.is_title_id,items:M.value}));1==e.code?(fe(),g.value=!1,m({type:"success",message:e.msg})):m({type:"error",message:e.msg})},btnExport:async function(e){const{data:t}=await c(Object.assign(D,{invoice_id:e.invoice_id}));1==t.result?(window.open(t.first_name),m({type:"success",message:t.msg})):m({type:"error",message:t.msg})},disabledBeforeToday1:function(e){var t=new Date(z.note_end_date).getTime(),a=new Date(z.service_date_last).getTime();return e.getTime()<a||t<e.getTime()},disabledBeforeToday2:function(e){var t=new Date(z.note_begin_date).getTime();return e.getTime()<t},disabledBeforeToday3:function(e){const t=new Date;return t.setHours(0,0,0,0),e.getTime()>t.getTime()},btnDetail:Te,detailDialog:h,detailData:L,checkData:P,detailTitle:q,detailtotal:H,InvoiceDetailArr:X,btnCheck:function(e,t){Te(e,t),y.value=!0},checkDialog:y,checkArr:J,checkConfirm:async function(){N.value=!0;const{data:e}=await s(Object.assign(f,{invoice_id:J.invoice_id}));1==e.code?(ne(),y.value=!1,m({type:"success",message:e.msg}),N.value=!1):m({type:"error",message:e.msg}),N.value=!1},payMethodData:Y,ChargeDialog:B,eventCharge:function(){ne()},str1:R,ChargeArr:V}}))}}}));