import{_ as w,f as u,o as a,g as r,i as o,t as s,h as _,w as n,l as m,F as f,k as v,p as i,v as p}from"./app-e7b909c6.js";const q={data:()=>({loading:!0,currentPage:1,totalPages:1,refund_requests:[]}),computed:{headers(){return[{title:this.$i18n.t("order_code"),align:"start",sortable:!1,value:"order_code"},{title:this.$i18n.t("shop"),sortable:!1,value:"shop"},{title:this.$i18n.t("products"),sortable:!1,align:"start",value:"products"},{title:this.$i18n.t("amount"),sortable:!1,align:"end",value:"amount"},{title:this.$i18n.t("status"),sortable:!1,align:"end",value:"status"}]}},watch:{currentPage(){this.$router.push({query:{...this.$route.query,page:this.currentPage}}).catch(()=>{})}},methods:{async getList(e){this.loading=!0;const l=await this.call_api("get",`user/refund-requests?page=${e}`);l.data.success?(this.refund_requests=l.data.data,this.totalPages=l.data.meta.last_page,this.currentPage=l.data.meta.current_page):this.snack({message:this.$i18n.t("something_went_wrong"),color:"red"}),this.loading=!1}},created(){let e=this.$route.query.page||this.currentPage;this.getList(e)}},P={class:"ps-lg-7 pt-4"},V={class:"fs-24 fw-700 opacity-80 mb-5 mt-3"},L={class:"d-block fw-600"},B={class:"d-block fw-600"},N={class:"text-truncate-2"},z={key:0,class:""},C={class:"opacity-70"},F={class:"fw-500"},R={class:"opacity-70"},U={class:"fw-500"},j={class:"d-block fw-600"},x={key:0,class:"text-start"};function D(e,l,E,S,T,h){const c=u("v-btn"),y=u("v-data-table"),b=u("v-pagination");return a(),r("div",P,[o("h1",V,s(e.$t("refund_requests")),1),o("div",null,[_(y,{headers:h.headers,items:e.refund_requests,class:"border px-4 pt-3","loading-text":e.$t("loading_please_wait"),"hide-default-footer":"",loading:e.loading},{"item.order_code":n(({item:t})=>[o("span",L,s(t.order_code),1)]),"item.shop":n(({item:t})=>[o("span",B,s(t.shop),1)]),"item.products":n(({item:t})=>[(a(!0),r(f,null,v(t.refunditems,(d,$)=>(a(),r("div",{key:$,class:"mb-3"},[o("div",N,s(d.product.name),1),d.product.combinations.length>0?(a(),r("div",z,[(a(!0),r(f,null,v(d.product.combinations,(g,k)=>(a(),r("span",{key:k,class:"me-4 py-1 fs-12"},[o("span",C,s(g.attribute),1),i(" : "),o("span",F,s(g.value),1)]))),128))])):m("",!0),o("span",R,s(e.$t("quantity")),1),i(" : "),o("span",U,s(d.quantity),1)]))),128))]),"item.amount":n(({item:t})=>[o("span",j,s(e.format_price(t.amount)),1)]),"item.status":n(({item:t})=>[t.status==0?(a(),p(c,{key:0,size:"x-small",color:"info",elevation:"0"},{default:n(()=>[i(s(e.$t("pending")),1)]),_:1})):t.status==1?(a(),p(c,{key:1,size:"x-small",color:"success",elevation:"0"},{default:n(()=>[i(s(e.$t("accepted")),1)]),_:1})):(a(),p(c,{key:2,size:"x-small",color:"error",elevation:"0"},{default:n(()=>[i(s(e.$t("rejected")),1)]),_:1}))]),_:2},1032,["headers","items","loading-text","loading"]),e.totalPages>1?(a(),r("div",x,[_(b,{modelValue:e.currentPage,"onUpdate:modelValue":[l[0]||(l[0]=t=>e.currentPage=t),h.getList],length:e.totalPages,"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"])])):m("",!0)])])}const G=w(q,[["render",D]]);export{G as default};
