1import{_ as N,P as q,D as z,d as L,at as E,H as p,J,a2 as M,r as s,o as d,e as T,c as t,w as n,F as j,f as m,t as c,h as P,L as S,g as w,j as V,k as X,B as G,s as Q,X as W,l as Y,ak as Z,V as $,p as ee,v as te,T as ne,U as ae}from"./app-B2Y0-4Oe.js";import{O as re}from"./OrderTable-DOM9A3DD.js";import{D as oe}from"./DateRangePicker-Y2_EBI8a.js";import{A as le}from"./AdminPageHeader-D4ZmExHN.js";import"./fields-DbY6p1IM.js";import"./datatable-S-x8bdRa.js";import"./filter-D8gtdSsr.js";import"./PaymentStatus-ptCUI0xc.js";import"./OrderDetails--N7PegNf.js";import"./cart-B6RPniZA.js";import"./UserInfo-CQfsfzfr.js";import"./apiAdmin-D0yFZeTH.js";import"./AddButton-B3cfjTJJ.js";import"./AddEdit-Rio7WQQ5.js";import"./SaveOutlined-q68O2Itt.js";import"./Invoice-DsZaqEh0.js";import"./BarcodeGenerator-HmUKNoLg.js";import"./PrinterOutlined-CozDeDGc.js";import"./SendOutlined-DCqepGJ6.js";import"./View-BVuxNstC.js";import"./ArrowUpOutlined-D7OkhYA2.js";import"./WalletOutlined-CGTeby8z.js";import"./ShoppingCartOutlined-DAp38IT1.js";import"./DollarCircleOutlined-CGYgCNTn.js";import"./index-D-LizC8X.js";const se={components:{PlusOutlined:q,DeleteOutlined:z,OrderTable:re,DateRangePicker:oe,AdminPageHeader:le}
1,setup(){const{formatAmountCurrency:r,orderType:o,orderPageObject:h,orderStatus:e,permsArray:D}=L(),O=E(),f=p([]),u=p(null),_=p([]),k=p(null),g=p({payment_status:"all",user_id:void 0,dates:[],searchColumn:"invoice_number",searchString:""});J(()=>{y()});const y=()=>{const l=axiosAdmin.get(`${h.value.userType}?limit=10000`);Promise.all([l]).then(([b])=>{f.value=b.data})};return M(()=>O.meta.orderType,(l,b)=>{(l=="purchases"||l=="purchase-returns"||l=="sales"||l=="sales-returns"||l=="quotations")&&(o.value=O.meta.orderType,g.value={payment_status:"all",user_id:void 0,dates:[],searchColumn:"invoice_number",searchString:""},y(),u.value.resetPicker())}),{orderPageObject:h,permsArray:D,orderStatus:e,formatAmountCurrency:r,users:f,filters:g,orderType:o,serachDateRangePicker:u,selectedRowIds:_,orderTableRef:k}}};function de(r,o,h,e,D,O){const f=V,u=s("router-link"),_=X,k=G,g=s("AdminPageHeader"),y=s("PlusOutlined"),l=Q,b=s("DeleteOutlined"),A=W,i=Y,C=Z,x=ae,K=$,B=s("DateRangePicker"),v=ee,U=s("admin-page-filters"),R=te,H=ne,F=s("OrderTable"),I=s("admin-page-table-content");return d(),T(j,null,[t(g,null,{header:n(()=>[t(f,{title:r.$t(`menu.${e.orderPageObject.menuKey}`),class:"p-0"},null,8,["title"])]),breadcrumb:n(()=>[t(k,{separator:"-",style:{"font-size":"12px"}},{default:n(()=>[t(_,null,{default:n(()=>[t(u,{to:{name:"admin.dashboard.index"}},{default:n(()=>[m(c(r.$t("menu.dashboard")),1)]),_:1})]),_:1}),t(_,null,{default:n(()=>[m(c(e.orderPageObject.type=="sales"||e.orderPageObject.type=="sales-returns"||e.orderPageObject.type=="quotations"?r.$t("menu.sales"):r.$t("menu.purchases")),1)]),_:1}),t(_,null,{default:n(()=>[m(c(r.$t(`menu.${e.orderPageObject.menuKey}`)),1)]),_:1})]),_:1})]),_:1}),t(U,null,{default:n(()=>[t(v,{gutter:[16,16]},{default:n(()=>[t(i,{xs:24,sm:24,md:12,lg:10,xl:10},{default:n(()=>[t(A,null,{default:n(()=>[e.permsArray.includes(`${e.orderPageObject.permission}_create`)||e.permsArray.includes("admin")?(d(),P(u,{key:0,to:{name:`admin.stock.${e.orderPageObject.type}.create`}},{default:n(()=>[t(l,{type:"primary"},{default:n(()=>[t(y),m(" "+c(r.$t(`${e.orderPageObject.langKey}.add`)),1)]),_:1})]),_:1},8,["to"])):S("",!0),e.selectedRowIds.length>0&&(e.permsArray.includes(`${e.orderPageObject.permission}_view`)||e.permsArray.includes("admin"))?(d(),P(l,{key:1,type:"primary",onClick:e.orderTableRef.showSelectedDeleteConfirm,danger:""},{icon:n(()=>[t(b)]),default:n(()=>[m(" "+c(r.$t("common.delete")),1)]),_:1},8,["onClick"])):S("",!0)]),_:1})]),_:1}),t(i,{xs:24,sm:24,md:12,lg:14,xl:14},{default:n(()=>[t(v,{gutter:[16,16],justify:"end"},{default:n(()=>[t(i,{xs:24,sm:24,md:12,lg:8,xl:6},{default:n(()=>[t(C,{style:{width:"100%"},value:e.filters.searchString,"onUpdate:value":o[0]||(o[0]=a=>e.filters.searchString=a),"show-search":"",placeholder:r.$t("common.placeholder_search_text",[r.$t("stock.invoice_number")])},null,8,["value","placeholder"])]),_:1}),t(i,{xs:24,sm:24,md:8,lg:8,xl:6},{default:n(()=>[t(K,{value:e.filters.user_id,"onUpdate:value":o[1]||(o[1]=a=>e.filters.user_id=a),placeholder:r.$t("common.select_default_text",[r.$t(`${e.orderPageObject.langKey}.user`)]),allowClear:!0,style:{width:"100%"},optionFilterProp:"title","show-search":""},{default:n(()=>[(d(!0),T(j,null,w(e.users,a=>(d(),P(x,{key:a.xid,title:a.name,value:a.xid},{default:n(()=>[m(c(a.name),1)]),_:2},1032,["title","value"]))),128))]),_:1},8,["value","placeholder"])]),_:1}),t(i,{xs:24,sm:24,md:8,lg:8,xl:6},{default:n(()=>[t(B,{ref:"serachDateRangePicker",onDateTimeChanged:o[2]||(o[2]=a=>e.filters.dates=a)},null,512)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),t(I,null,{default:n(()=>[t(v,null,{default:n(()=>[t(i,{span:24},{default:n(()=>[t(H,{activeKey:e.filters.payment_status,"onUpdate:activeKey":o[3]||(o[3]=a=>e.filters.payment_status=a)},{default:n(()=>[t(R,{key:"all",tab:`${r.$t("common.all")} ${r.$t("menu."+e.orderPageObject.menuKey)}`},null,8,["tab"]),(d(!0),T(j,null,w(e.orderStatus,a=>(d(),P(R,{key:a.key,tab:`${a.value}`},null,8,["tab"]))),128))]),_:1},8,["activeKey"])]),_:1})]),_:1}),t(F,{ref:"orderTableRef",orderType:e.orderType,filters:e.filters,tableSize:"middle",bordered:!0,selectable:!0,onOnRowSelection:o[4]||(o[4]=a=>e.selectedRowIds=a)},null,8,["orderType","filters"])]),_:1})],64)}const Be=N(se,[["render",de]]);export{Be as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.