import{_ as g,f as i,o as u,g as m,i as s,t as n,h as r,w as l,p as _}from"./app-ff872a97.js";const f={data:()=>({loading:!0,currentPage:1,lastPage:1,collectionsList:[]}),computed:{headers(){return[{title:this.$i18n.t("code"),align:"start",sortable:!1,value:"code"},{title:this.$i18n.t("date"),sortable:!1,align:"start",value:"date"},{title:this.$i18n.t("amount"),sortable:!1,align:"start",value:"amount"},{title:this.$i18n.t("options"),sortable:!1,align:"center",value:"options"}]}},methods:{async getCollectionsList(t){this.loading=!0;const a=await this.call_api("get",`delivery-boy/collections-list?page=${t}`);a.status==200?(this.collectionsList=a.data.data,this.lastPage=a.data.meta.last_page,this.currentPage=a.data.meta.current_page):this.snack({message:this.$i18n.t("something_went_wrong"),color:"red"}),this.loading=!1},openOrderDetails(t){this.$router.push({name:"DeliveryboyOrderDetails",params:{code:t}})}},created(){let t=this.$route.query.page||this.currentPage;this.getCollectionsList(t)}},v={class:"ps-lg-7 pt-4"},b={class:"fs-24 fw-700 opacity-80 mb-5 mt-3"},y={class:"d-block fw-600"},$=["onClick"],C=s("i",{class:"las la-bars"},null,-1),k=[C],w={class:"text-start"};function P(t,a,L,V,D,o){const c=i("v-btn"),d=i("v-data-table"),p=i("v-pagination");return u(),m("div",v,[s("h1",b,n(t.$t("collection_history")),1),s("div",null,[r(d,{headers:o.headers,items:t.collectionsList,class:"border px-4 pt-3","hide-default-footer":"","item-class":"c-pointer"},{"item.code":l(({item:e})=>[r(c,{onClick:h=>o.openOrderDetails(e.code),variant:"flat",class:"px-2 text-primary"},{default:l(()=>[_(n(e.code),1)]),_:2},1032,["onClick"])]),"item.amount":l(({item:e})=>[s("span",y,n(t.format_price(e.amount)),1)]),"item.options":l(({item:e})=>[s("a",{onClick:h=>o.openOrderDetails(e.code),class:"px-2 btn btn-soft-info btn-icon btn-circle btn-sm hov-svg-white"},k,8,$)]),_:2},1032,["headers","items"])]),s("div",w,[r(p,{modelValue:t.currentPage,"onUpdate:modelValue":[a[0]||(a[0]=e=>t.currentPage=e),o.getCollectionsList],length:t.lastPage,"prev-icon":"las la-angle-left","next-icon":"las la-angle-right","total-visible":7,elevation:"0",class:"my-4"},null,8,["modelValue","onUpdate:modelValue","length"])])])}const O=g(f,[["render",P]]);export{O as default};
