File: /var/www/html/public/static/js/hook-9c3cdf35.js
import{prePaidWeb as at,invoicePaymentWeb as nt,getEmployeeFormListByCompanyIdWeb as it,submitEmployeeInvoiceWeb as ot,EmployeeInvoiceExportXLS as st,EmployeeInvoiceDetail as ct,CheckEmployeeInvoiceWeb as lt,getCheckMembersWeb as rt}from"./po-4f5ed739.js";import{getList as dt,getOptions as _t}from"./employee_invoice-adc9edf6.js";import{b7 as _}from"./message-2472a54a.js";import{r as n,A as c,o as mt}from"./runtime-core.esm-bundler-6128546f.js";import"./index-74d93170.js";import"./preload-helper-78dc9057.js";import"./vue-i18n.runtime.esm-bundler-6949bcab.js";import"./index-b7f916e1.js";import"./_commonjsHelpers-87174ba5.js";import"./vue-router-a383d220.js";import"./utils-2ab4f76a.js";function At(){const I=n(!1),D=n(!1),N=n(!1),S=n(!1),b=n(!1),F=n([]),M=c({}),ne=c({}),ie=c({}),oe=c({}),se=c({}),ce=c({}),le=c({}),p=n(!1),re=n(0),de=n(0),_e=n(""),L=n(""),W=n(15),C=n([]),j=n([]),q=n([]),x=n([]),w=n([]),R=n([]),H=n([]),V=n([]),B=n(1),z=n(!1),J=c({Invoice_Charge_Number:"",Customer_Name:"",Invoice_Total_Charge:"",Has_Paid_Amount:"",Need_Charge_Amount:"",Total_Paid_Amount:"",customer_id:"",customer_name:""}),i=c({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:""}),f=c({invoice_number:"",invoice_date:"",total_price:"",item_charge:"",new_item_charge:"",new_total_price:"",invoice_id:""}),d=c({total_amount:"",split_rate:"",Amount_Due:"",date:"",name:"",LocationWorked:"",Address:"",Address1:"",HST:"",INVOICE:"",RMT:"",PayPeriod:""}),me=n([{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=n([{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}]),r=c({name:"",customer_id:"",pay_amount:"",pay_method:"",cheque_number:"",content:"",invoice_id:"",time:"",other:""}),X=c({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:""}),y=c({total:0,pageSize:W.value,pageSizes:[10,15,20,50,100],currentPage:1,background:!0}),ue=["模型ID","模型名称","模型表","模型路径","是否可用","添加时间","添加人"],pe=c({uid:"",code:"",name:"",phone:"",email:""}),fe=n(!1),ve=c({fno:"",fname:""}),ge=n([]),Y={},he=(e,t)=>{e&&(Y[t]=e)},ye=n("");async function v(e={}){p.value=!0;const{data:t,meta:a,ext:o}=await dt(Object.assign(A,{page:y.currentPage,resault:y.pageSize},{search:JSON.stringify(e)}));F.value=t,y.total=a.total,Z.value=o.price_config,setTimeout(()=>{p.value=!1,ee.value=!0,O.value=!1},500)}function be(){v()}function Ce(e,t){return t.hasOwnProperty("op_list")?t.op_list.includes(e):!0}function xe(e){v()}const G=n([]);function we(e){G.value=e.map(t=>t.id)}const A=c({company_id:0,begin_time:"",begin_end:"",serve_begin_time:"",serve_begin_end:"",duration:""}),Ae=e=>{e&&(e.resetFields(),Object.assign(A,{begin_time:"",begin_end:"",serve_begin_time:"",serve_begin_end:"",duration:""}),v())},T=n([]),K=n([]),Ie=n([]),De=n([]);function Ne(e){}function Te(e){}const ke=n("Invoice"),k=n(!1),Ee=n(!1),Q=n(!0),U=n("");function Oe(e,t){if(!e||Object.keys(e).length===0)return!0;const a=[];for(let o of t){const m=o.field,h=o.oper,s=o.value;let l="";e.hasOwnProperty(m)&&(l=e[m]);let u;switch(h){case">":u=l>s;break;case"<":u=l<s;break;case">=":u=l>=s;break;case"<=":u=l<=s;break;case"=":u=l===s;break;default:u=!1}a.push(u)}return a.every(o=>o===!0)}const Pe=n(0);k.value=!1;const Se=n([]),E=n([]),Z=n([]);async function $(){var o,m,h;O.value=!0;const{data:e}=await _t({is_used:1});U.value=e.row_key,e.options&&(g.value=JSON.parse(JSON.stringify(e.options.comp_list)),i.is_title_id=g.value[0].id,i.note_begin_date=g.value[0].note_begin_date,i.note_end_date=g.value[0].note_end_date,i.service_date_last=g.value[0].service_date_last),E.value=[],(o=e.options)==null||o.comp_list.forEach((s,l)=>{E.value.push({label:s.company_name,value:s.id})}),((m=e.options)==null?void 0:m.comp_list.length)>0&&(A.company_id=parseInt((h=e.options)==null?void 0:h.comp_list[0].id));let t=[],a=!1;k.value&&(t.push({type:"selection",width:55,align:"left",selectable:(s,l)=>e.exclude?!Oe(s,e.exclude):!0,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}),Q.value&&t.push({label:"Action",fixed:"right",width:430,slot:"operation"});for(let s in e.fields){let l=e.fields[s];t.push(l)}if(T.value=t,T.value.forEach((s,l)=>{s.label=="Status"&&(s.slot="status")}),e.sec_fields.length>0){let s=[];s=[{label:"序号",type:"index",minWidth:40}];for(let l in e.sec_fields){let u=e.sec_fields[l];s.push(u)}K.value=s}if(e.third_fields.length>0){let s=[{label:"序号",type:"index",width:70}];for(let l in e.third_fields){let u=e.sec_fields[l];s.push(u)}Ie.value=s}e.model&&(L.value=e.model.cmt),W.value=e.page_num,y.pageSize=e.page_num,v()}const Fe=c({form_json:{},data:{},field_setup:{},tpl_id:0}),Me=n(!1),ee=n(!1),O=n(!1),Le=n({}),te=c({id:0,company_id:0,invoice_number:"",invoice_date:"",total_price:0,items:[]}),We=()=>{Object.assign(te,{id:0,company_id:0,invoice_number:"",invoice_date:"",total_price:0,items:[]})};function je(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"};B.value=1,J.value=t,z.value=!0}async function qe(){const{data:e}=await rt(Object.assign(M,{customer_id:r.customer_id,actiontype:"employee_company"}));if(e.code==1){C.value=e.data;let t=X.Need_Charge_Amount;C.value.forEach((a,o)=>{let m=Math.min(a.remain_amount,t);m>0&&(a.paid_amount=m,t=parseFloat((t-m).toFixed(2)))}),I.value=!0}else _({type:"error",message:e.msg})}function Re(){et(),D.value=!0}async function He(){if(p.value=!0,r.pay_method!="Cheque"&&(r.cheque_number=""),r.pay_method=="Cheque"&&r.cheque_number==""){_({type:"error",message:"Please enter cheque number"}),p.value=!1;return}let e="";if(r.pay_method=="Other"){if(r.other==""){_({type:"error",message:"Please enter pay method"}),p.value=!1;return}e=r.other}else e=r.pay_method;const{data:t}=await at(Object.assign(ie,{company_id:r.customer_id,pay_amount:r.pay_amount,pay_method:e,cheque_number:r.cheque_number,content:r.content,actiontype:"employee_company",collection_time:r.time}));t.code==1?(qe(),_({type:"success",message:t.msg}),D.value=!1,p.value=!1):(p.value=!1,_({type:"error",message:t.msg}))}async function Ve(){const{data:e}=await nt(Object.assign(ne,{invoice_id:r.invoice_id,pay_amount_details:C.value,actiontype:"employee_company"}));e.code==1?(v(),I.value=!1):_({type:"error",message:e.msg})}function Be(){g.value.forEach((e,t)=>{e.id==i.is_title_id&&(i.is_clinicIndex=t,i.note_begin_date=e.note_begin_date,i.note_end_date=e.note_end_date,i.service_date_last=e.service_date_last)}),P(),Xe(),N.value=!0}function ze(e,t){i.is_title_id=e.id,i.is_clinicIndex=t,i.note_begin_date=e.note_begin_date,i.note_end_date=e.note_end_date,i.service_date_last=e.service_date_last,P()}async function P(){const{data:e}=await it(Object.assign(oe,{company_id:i.is_title_id,service_begin_date:i.note_begin_date,service_end_date:i.note_end_date}));e.code==1?(x.value=e.data.content,q.value=e.data.title,w.value=e.data.total.content,i.table_total=e.data.total.total,i.split_amount=e.data.split_amount,i.split_rate=e.data.split_rate):_({type:"error",message:e.msg})}function Je(e,t){w.value.forEach((o,m)=>{o.val=Number(0)}),i.table_total=0;let a=0;x.value.forEach((o,m)=>{o.is_selected&&(i.table_total=(Number(i.table_total)+Number(o.total)).toFixed(2),o.content.forEach((h,s)=>{w.value.forEach((l,u)=>{s==u&&(l.val=Number(l.val)+Number(h.value))})}))}),a=Number(i.table_total)*(Number(i.split_rate)/100),i.split_amount=a.toFixed(2)}function Xe(){var e=new Date,t=e.getFullYear(),a=("0"+(e.getMonth()+1)).slice(-2),o=("0"+e.getDate()).slice(-2);i.InvoiceDate=t+"-"+a+"-"+o}async function Ye(){const{data:e}=await ot(Object.assign(se,{invoice_date:i.InvoiceDate,company_id:i.is_title_id,items:x.value}));e.code==1?($(),N.value=!1,_({type:"success",message:e.msg})):_({type:"error",message:e.msg})}async function Ge(e){const{data:t}=await st(Object.assign(ce,{invoice_id:e.invoice_id}));t.result==1?(window.open(t.first_name),_({type:"success",message:t.msg})):_({type:"error",message:t.msg})}function Ke(e){var t=new Date(i.note_end_date),a=t.getTime(),o=new Date(i.service_date_last),m=o.getTime();return e.getTime()<m||a<e.getTime()}function Qe(e){var t=new Date(i.note_begin_date),a=t.getTime();return e.getTime()<a}async function ae(e,t){const{data:a}=await ct(Object.assign(le,{invoice_id:e.invoice_id}));if(a.code==1){R.value=a.data.item_conctent.content,H.value=a.data.item_conctent.title,V.value=a.data.item_conctent.total.content,d.total_amount=a.data.item_conctent.total.total_amount,d.LocationWorked=a.data.item_conctent.company.company_name,d.Address=a.data.item_conctent.company.address,d.Address1=a.data.item_conctent.company.address1,d.HST=a.data.item_conctent.company.hst,d.INVOICE=a.data.item_conctent.invoice.invoice_number,d.RMT=a.data.item_conctent.company.licence_number,d.PayPeriod=a.data.item_conctent.invoice.pay_period,d.date=a.data.item_conctent.invoice.english_date,d.name=a.data.item_conctent.company.username,d.split_rate=a.data.item_conctent.company.split_rate;let o=Number(d.total_amount)*(Number(d.split_rate)/100);d.Amount_Due=o.toFixed(2),t=="Check"?(f.invoice_number=a.data.item_conctent.invoice.invoice_number,f.invoice_date=a.data.item_conctent.invoice.invoice_date,f.total_price=a.data.item_conctent.invoice.total_price,f.item_charge=a.data.item_conctent.invoice.item_charge,f.new_item_charge=a.data.item_conctent.invoice.new_item_charge,f.new_total_price=a.data.item_conctent.invoice.new_total_price,j.value=a.data.detail,f.invoice_id=e.invoice_id,b.value=!0):t=="Detail"&&(S.value=!0)}else _({type:"error",message:a.msg})}function Ue(e){const t=new Date;return t.setHours(0,0,0,0),e.getTime()>t.getTime()}function Ze(e,t){ae(e,t),b.value=!0}async function $e(){p.value=!0;const{data:e}=await lt(Object.assign(M,{invoice_id:f.invoice_id}));e.code==1?(v(),b.value=!1,_({type:"success",message:e.msg}),p.value=!1):_({type:"error",message:e.msg}),p.value=!1}function et(){var e=new Date,t=e.getFullYear(),a=("0"+(e.getMonth()+1)).slice(-2),o=("0"+e.getDate()).slice(-2);r.time=t+"-"+a+"-"+o}function tt(){v()}return mt(()=>{$()}),{InvData:te,resetInvForm:We,dur_list:Z,comp_list:E,product_list:Se,show_select_btn:Ee,statusHas:Ce,tpl_item_id:Pe,load_defualt_search:Le,paramString:ye,row_key:U,config_loading:O,search_load:ee,show_operate:Q,select_items:G,handleSelectionChange:we,show_select:k,show_search:Me,search_info:Fe,customOperates:De,model_name:ke,model_id:re,entity_id:de,toEntityList:Ne,handleCurrentChange:xe,handleDesignForm:Te,resetForm:Ae,childColumns:K,columns:T,search_form:A,form_name:_e,form_desc:L,vFormRefMap:Y,setItemRef:he,activeNames:ge,onSearchParams:be,onSearch:v,selectList:ue,editFormDialogVisible:fe,editformData:pe,form:ve,loading:p,dataList:F,pagination:y,btnCollection:je,addForm:X,CollectionDialog:I,CollectionData:C,AddCollect:Re,addCollectionDialog:D,btncollectionConfirm:He,collectionArr:r,bookingPaymentConfirm:Ve,addInvoiceDialog:N,AddInvoiceOpen:Be,clinicList:g,addInvoiceArr:i,btnMune:ze,addInvoiceSearch:P,FormList:x,FormTitle:q,FormTotal:w,checkboxForm:Je,addInvoicConfirm:Ye,btnExport:Ge,disabledBeforeToday1:Ke,disabledBeforeToday2:Qe,disabledBeforeToday3:Ue,btnDetail:ae,detailDialog:S,detailData:R,checkData:j,detailTitle:H,detailtotal:V,InvoiceDetailArr:d,btnCheck:Ze,checkDialog:b,checkArr:f,checkConfirm:$e,payMethodData:me,ChargeDialog:z,eventCharge:tt,str1:B,ChargeArr:J}}export{At as useList};