File: /var/www/html/public/static/js/hookWithdrawList-323775e7.js
import{NoteWithdrawListWeb as me,getClinicsListByTherapistWeb as pe,schNoteWithdrawListWeb as _e,NoteWithdrawApplyWeb as he,getClinicsDetailWeb as fe,NoteWithdrawDetailWeb as ye,NoteWithdrawCheckWeb as ge,NoteWithdrawPaymentWeb as be,NoteWithdrawDetailEditWeb as ve,deleteNoteWithdrawWeb as we}from"./po-7a0a44a1.js";import{d as A,u as Ae}from"./vue-router-a383d220.js";import{o as We}from"./index-81e4a901.js";import{b7 as d}from"./message-2472a54a.js";import{r as a,A as i,o as De}from"./runtime-core.esm-bundler-6128546f.js";import"./index-3e40fd7d.js";import"./preload-helper-78dc9057.js";import"./vue-i18n.runtime.esm-bundler-6949bcab.js";import"./index-b7f916e1.js";import"./_commonjsHelpers-87174ba5.js";import"./utils-2ab4f76a.js";import"./focus-trap-53f1c6ab.js";import"./error-78e43d3e.js";function Be(){A(),Ae(),A();const W=a(),n=a(!1),D=a(!1),p=a(!1),N=a(!1),r=a(!1),k=a(!1),x=a(""),f=a(""),y=a([]);a([]);const u=a([]),g=a([]),b=a([]),m=a([]),C=i({}),P=i({tableIndex:0,note:""}),v=i({}),S=i({}),T=i({}),O=i({}),j=i({}),L=i({}),E=i({}),I=i({}),z=i({}),B=i({}),o=i({total:0,pageSize:10,currentPage:1,background:!0,currentPage:1,pageSizes:[10,25,50,100]}),t=i({order_key:"",material_key:"",truck_key:"",truck_id:"",comment:"",show:"",searchKey:"",clinic_id:"",split_total:0,role:"",clinic_id1:"",therapists_id:"",is_detail:"",payment_amount:"",payment_comment:"",check_result:"",check_comment:"",withdraw_id:"",edit_amount:0,begin_date:"",last_date:"",last_searvice_date:"",status:""}),K=a([{id:1,text:"Approvel",value:"approvel",is_selected:0},{id:2,text:"disApprovel",value:"disapprovel",is_selected:0}]),R=a([{id:1,text:"Pending",value:"pending",is_selected:0},{id:2,text:"Approvel",value:"approvel",is_selected:0},{id:3,text:"Disapprovel",value:"disapprovel",is_selected:0},{id:4,text:"Edit",value:"edit",is_selected:0},{id:5,text:"Payment",value:"payment",is_selected:0},{id:6,text:"Close",value:"close",is_selected:0},{id:7,text:"All",value:"all",is_selected:0}]),M=[{type:"selection",width:55,align:"left",hide:({checkList:e})=>!e.includes("勾选列")},{label:"Idx",type:"index",width:70,hide:({checkList:e})=>!e.includes("Idx")},{label:"Apply Number",prop:"apply_number",minWidth:100,hide:({checkList:e})=>!e.includes("Apply Number")},{label:"Apply Date",prop:"approvel_data",minWidth:100,hide:({checkList:e})=>!e.includes("Apply Date")},{label:"Clinic Name",prop:"clinic_name",minWidth:100,hide:({checkList:e})=>!e.includes("Clinic Name")},{label:"Therapist Name",prop:"Therapist_name",minWidth:100,hide:({checkList:e})=>!e.includes("Therapist Name")},{label:"Apply Amount",prop:"received_amount",minWidth:150,slot:"slotAction",hide:({checkList:e})=>!e.includes("Apply Amount")},{label:"Pay Amount",prop:"payment_amount",minWidth:120,hide:({checkList:e})=>!e.includes("Pay Amount")},{label:"Date Period",prop:"date_period",minWidth:120,hide:({checkList:e})=>!e.includes("Date Period")},{label:"Status",prop:"status",minWidth:120,hide:({checkList:e})=>!e.includes("Status")},{label:"Action",fixed:"right",width:300,slot:"operation",hide:({checkList:e})=>!e.includes("Action")}],F=["Idx","Apply Number","Apply Date ","Clinic Name","Therapist Name","Apply Amount","Pay Amount","Date Period","Status","Action"];function q(){c()}function G(e){o.pageSize=e,c()}function H(e){o.currentPage=e,c()}async function c(){n.value=!0;const{data:e}=await me(Object.assign(C,{role:t.role,clinic_id:t.clinic_id1,therapists_id:t.therapists_id,status:t.status,searchKey:t.searchKey,pageSize:o.pageSize,page:o.currentPage}));y.value=e.data,o.total=e.total,n.value=!1}const J=(e,s)=>{};function Q(e){Object.keys(e).map(s=>{v[s]=e[s]})}function U(){t.clinic_id="",u.value=[],_(),p.value=!0}async function V(){n.value=!0;const{data:e}=await pe(Object.assign(S,{searchKey:""}));e.code==1&&(g.value=e.data),n.value=!1}function X(e){e==null&&(t.clinic_id=""),_()}async function _(){const{data:e}=await _e(Object.assign(O,{clinic_id:t.clinic_id,last_date:t.last_date,page:1,pagesize:1e3}));e.code==1&&(u.value=e.data,t.begin_date=e.data_limit.begin_date,t.last_date=e.data_limit.last_date,t.last_searvice_date=e.data_limit.last_searvice_date,h())}async function Y(){n.value=!0;const{data:e}=await he(Object.assign(j,{clinic_id:t.clinic_id,data_row:u.value}));e.code==1&&(c(),p.value=!1),n.value=!1}function Z(e){h()}function $(e){e==null&&(t.clinic_id1="")}function ee(){c()}async function te(){const{data:e}=await fe(Object.assign(L,{searchKey:"",clinic_id:t.clinic_id1}));e.code==1&&(b.value=e.data.therapists_user)}function ae(e){e==null&&(t.therapists_id="")}function h(){t.split_total=0,u.value.forEach((e,s)=>{e.is_selected==!0&&(t.split_total=(Number(t.split_total)+Number(e.split_amount)).toFixed(4))})}async function ie(e){const{data:s}=await we(Object.assign(T,{withdraw_id:e.id}));s.code==1?(c(),d({type:"success",message:s.msg})):d({type:"error",message:s.msg})}const ne=e=>{We.confirm("Are you sure to delete it ? ",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then(()=>{ie(e)}).catch(()=>{d({type:"info",message:"Canceled"})})};async function se(e,s){t.check_comment="",t.check_result="",t.payment_amount="",t.payment_comment="",t.is_detail=s,t.withdraw_id=e.id;const{data:l}=await ye(Object.assign(E,{withdraw_id:e.id}));l.code==1&&(f.value=l.data.info,m.value=l.data.details,t.edit_amount=l.data.info.received_amount,r.value=!0)}async function ce(){n.value=!0;const{data:e}=await ge(Object.assign(I,{check_result:t.check_result,check_comment:t.check_comment,withdraw_id:t.withdraw_id}));e.code==1?(r.value=!1,c()):d({type:"error",message:e.msg}),n.value=!1}async function oe(){n.value=!0;const{data:e}=await be(Object.assign(z,{payment_amount:t.payment_amount,payment_comment:t.payment_comment,withdraw_id:t.withdraw_id}));e.code==1?(r.value=!1,c()):d({type:"error",message:e.msg}),n.value=!1}function le(e){t.check_result==e.value?t.check_result="":t.check_result=e.value}function de(e){w()}function w(){t.edit_amount=0,m.value.forEach((e,s)=>{e.is_selected==!0&&(t.edit_amount=(Number(t.edit_amount)+Number(e.received_amount)).toFixed(4))})}async function re(){n.value=!0;const{data:e}=await ve(Object.assign(B,{data_row:m.value,withdraw_id:t.withdraw_id}));e.code==1?(r.value=!1,c()):d({type:"error",message:e.msg}),n.value=!1}function ue(e){const l=new Date(t.begin_date).getTime();return e.getTime()<l}return De(()=>{t.type=localStorage.getItem("type"),t.type==2&&(t.clinic_id1=localStorage.getItem("clinicIdOverall"),t.role="clinic",t.therapists_id="",te()),t.type==1&&(t.clinic_id1="",t.role="therapists",V()),c()}),{searchDetail:t,btnSearchPart:q,loading:n,small:k,selectList:F,columns:M,pagination:o,handleSizeChange:G,handleCurrentChange:H,PartList:y,order_date:x,deliverDialog:D,selectClick:J,itemArr:P,addLocationDialog:N,locationArr:v,EditLocation:Q,singleTableRef:W,onWithDrawApplyDialog:p,onWithDrawApply:U,WithDrawData:u,onClinicData:X,clinicData:g,SchNoteWithdConfirm:Y,selectClick3:Z,onClinicData1:$,btnSearch:ee,Therapists:b,onTherapists:ae,btnSplit_amount:h,btnDelete:ne,detailDialog:r,btnDetail:se,detailInfo:f,detailList:m,isData:K,selectedTr:le,checkConfirm:ce,paymentConfirm:oe,selectClick5:de,btnReceivedAmount:w,btnEditConfirm:re,disabledBeforeToday:ue,loadSchNoteWithdraw:_,statusData:R}}export{Be as useEqu};