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