File: /var/www/html/public/static/js/hookPrePay-legacy-eae1ccc6.js
System.register(["./po-legacy-1db6aa77.js","./employee_company-legacy-6ffe116d.js","./vue-router-legacy-a12307c3.js","./index-legacy-42c17c53.js","./message-legacy-10af7c73.js","./runtime-core.esm-bundler-legacy-c5df00b7.js","./index-legacy-c484260e.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,i,n,c,l,o,s,r,d,u,m,p,y,h;return{setters:[e=>{a=e.AccountListWeb,i=e.prePaidWeb,n=e.payMethodWeb,c=e.yuyueFDF,l=e.deleteCompanyWeb},e=>{o=e.getEmployeeCompanyInfoWeb},e=>{s=e.d,r=e.u},e=>{d=e.o},e=>{u=e.b7},e=>{m=e.r,p=e.A,y=e.w,h=e.o},null,null,null,null,null,null,null,null],execute:function(){e("useEqu",(function(e,t){const{query:g,params:_}=s(),f=r();s();const b=m(),v=m(!1),A=m(!1),C=m(!1),k=m(!1),P=m(!1),j=m(!1),S=m(""),w=m([]),x=m([]),L=m([]),D=p({}),E=p({}),W=p({}),q=p({}),O=m([]),I=m(),M=p({company_id:"",name:"",customer_id:"",pay_amount:"",pay_method:"",cheque_number:"",content:"",service_name:"",duration:"",invoice_price:"",time:"",other:"",account_id:"",files:[],files1:[],pay_id:""}),T=p({tableIndex:0,note:"",str:"",actiontype:""}),N=p({name:"",id:"",clinic_id:""}),H=p({});p({});const R=p({}),z=p({total:0,pageSize:10,currentPage:1,background:!0,currentPage:1,pageSizes:[10,25,50,100]}),B=p({order_key:"",material_key:"",truck_key:"",truck_id:"",comment:"",show:"",searchKey:"",type:"",role:"",clinic_id:""}),F=m([{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"}]);async function K(){B.type=localStorage.getItem("type"),2==B.type&&(B.role="clinic"),1==B.type&&(B.role="therapists"),B.clinic_id=localStorage.getItem("clinicIdOverall"),v.value=!0;const{data:e}=await a(Object.assign(D,{clinic_id:B.clinic_id,role:B.role,searchKey:B.searchKey}));1==e.code&&(w.value=e.data),v.value=!1}async function V(e){const{data:t}=await l(Object.assign(R,{company_id:e.id}));1==t.code?(K(),u({type:"success",message:t.msg})):u({type:"error",message:t.msg})}function X(){g.note&&(T.note=g.note)}async function G(){const{data:e}=await n(Object.assign(E,{searchKey:"",clinic_id:B.clinic_id,role:B.role}));1==e.code&&(x.value=e.data)}function Y(){var e=new Date,t=e.getFullYear(),a=("0"+(e.getMonth()+1)).slice(-2),i=("0"+e.getDate()).slice(-2);M.time=t+"-"+a+"-"+i}function X(){Y(),e.str&&(T.str=e.str,M.name=e.paymentArr.name,M.customer_id=e.paymentArr.id,Y(),M.pay_id="",M.content="",M.files=[],M.files1=[],M.pay_method="",M.pay_amount="",e.paymentArr.pay_id&&(M.time=e.paymentArr.time,M.pay_id=e.paymentArr.pay_id,M.content=e.paymentArr.content,M.files=e.paymentArr.files,M.pay_method=e.paymentArr.pay_method,M.pay_amount=e.paymentArr.pay_amount,e.paymentArr.files&&e.paymentArr.files.forEach(((e,t)=>{e.includes(c+"//images/")?M.files1.push(e.replace(c+"//images/","")):e.includes(c+"/images/")?M.files1.push(e.replace(c+"/images/","")):M.files1.push(e.replace(c+"//images/",""))})),e.paymentArr.actiontype&&(M.company_id=e.paymentArr.id)),3==e.str&&async function(){const{data:e}=await o(Object.assign(q,{page:"",resault:"",Search_key:""}));1==e.code?O.value=e.data:u({type:"error",message:e.msg})}()),e.paymentArr.actiontype&&(T.actiontype=e.paymentArr.actiontype)}return y(e.paymentArr,((e,t)=>{X()})),h((()=>{X(),G()})),{searchDetail:B,btnSearchPart:function(){K()},loading:v,small:j,selectList:["勾选列","Company","HST#","Name","Postal","Phone","Email","Address","Provice","City","Action"],columns:[{type:"selection",width:55,align:"left",hide:({checkList:e})=>!e.includes("勾选列")},{label:"序号列",type:"index",width:70,hide:({checkList:e})=>!e.includes("序号列")},{label:"Company",prop:"company_name",minWidth:100,hide:({checkList:e})=>!e.includes("Company")},{label:"HST#",prop:"hst",minWidth:100,hide:({checkList:e})=>!e.includes("HST#")},{label:"Name",prop:"first_name",minWidth:100,hide:({checkList:e})=>!e.includes("Name")},{label:"Postal",prop:"postal",minWidth:100,hide:({checkList:e})=>!e.includes("Postal")},{label:"Phone",prop:"phone",minWidth:150,slot:"slotAction",hide:({checkList:e})=>!e.includes("Phone")},{label:"Email",prop:"email",minWidth:120,hide:({checkList:e})=>!e.includes("Email")},{label:"Address",prop:"address",minWidth:120,hide:({checkList:e})=>!e.includes("Address")},{label:"Provice",prop:"state",minWidth:120,hide:({checkList:e})=>!e.includes("Provice")},{label:"City",prop:"city",minWidth:120,hide:({checkList:e})=>!e.includes("City")},{label:"Action",fixed:"right",width:120,slot:"operation",hide:({checkList:e})=>!e.includes("Action")}],pagination:z,handleSizeChange:function(e){z.pageSize=e,K()},handleCurrentChange:function(e){z.currentPage=e,K()},PartList:w,order_date:S,deliverDialog:A,selectClick:(e,t)=>{},itemArr:T,addLocationDialog:P,locationArr:H,EditLocation:function(e){Object.keys(e).map((t=>{H[t]=e[t]}))},btnDellocation:e=>{d.confirm("Are you sure you want to delete this location",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{V(e)})).catch((()=>{u({type:"info",message:"Canceled"})}))},singleTableRef:b,collectionArr:M,onSelClient:function(){N.clinic_id=B.clinic_id,C.value=!0},ClientDialog:C,ClientData:N,eventIsNum:function(){M.customer_id=N.id,M.name=N.name},payMethodData:F,AccountData:L,btncollectionConfirm:async function(){v.value=!0;let a="";if(T.actiontype){if("Cheque"!=M.pay_method&&(M.cheque_number=""),"Cheque"==M.pay_method&&""==M.cheque_number)return u({type:"error",message:"Please enter cheque number"}),void(v.value=!1);if("Other"==M.pay_method){if(""==M.other)return u({type:"error",message:"Please enter pay method"}),void(v.value=!1);a=M.other}else a=M.pay_method}else a=M.pay_method;let n="",c="";T.actiontype?(n="",c=3==e.str?M.company_id:M.customer_id):(c="",n=M.customer_id);const{data:l}=await i(Object.assign(W,{customer_id:n,pay_amount:M.pay_amount,pay_method:a,cheque_number:M.cheque_number,content:M.content,collection_time:M.time,account_id:M.account_id,files:M.files,company_id:c,actiontype:T.actiontype,pay_id:M.pay_id}));1==l.code?(""==T.str?u({type:"success",message:l.msg}):(t("update:addCollectionDialog",!1),t("eventPrePay")),Object.keys(M).map((e=>{"time"!=e&&(M[e]=""),M.files=[],M.files1=[]})),v.value=!1):(v.value=!1,u({type:"error",message:l.msg}))},btnGoView:function(){f.push({path:"/crm/yuyue/PayHistories",query:{}})},uploadSlotFile1:function(e,t,a){1==e.code?(M.files.push(c+e.data.file_path.replace("var/www/html/public","")),M.files1.push(e.data.file_name)):u({type:"error",message:e.data.msg})},payMethodData2:x,eventPay:function(){G()},payConfigDialog:k,btnEdit:function(){k.value=!0},itemArr:T,locationData:O,upload:I}}))}}}));