import{p as K}from"./paginationMeta-DF6W6vpY.js";import{d as yt,s as ht,q as _t,r as d,H as X,b as xt,B as G,z as bt,f as v,g as h,i as o,w as a,I as D,h as i,E as kt,j as l,D as A,A as b,X as Vt,V as Y,t as u,l as c,x as Z,k as m,m as T,L as k,F as R,C as tt,y as wt,d0 as Ct,a2 as Dt,_ as It}from"./index-N7CMQwFv.js";import{_ as Pt}from"./myImg-B3XMH9SK.js";import{_ as St}from"./AppDateTimePicker.vue_vue_type_style_index_0_lang-DxkjJlWf.js";import{d as Ut}from"./product-C59H-sk9.js";import{a as Nt}from"./shoppingCart-DpE52fOi.js";import{a as Tt}from"./warehouse-HobxTfNK.js";import{C as Bt}from"./createdOrder-DHKgXL4E.js";import{R as At}from"./replenishInventory-DC09iOKe.js";import{N as et}from"./noData-IsWEUHkL.js";import Rt from"./deleteAttachments-D6HBMF-8.js";import{V as $t}from"./VRow-CGgRlzLk.js";import{V as $}from"./VCol-xRADuXqd.js";import{V as jt}from"./VAutocomplete-B-jGSTKg.js";import{a as _,V as ot}from"./VList-BYq4u0VJ.js";import{V as zt}from"./VChip-iaVLrPY0.js";import{V as at}from"./VDataTable-UguPFD5B.js";import{V as lt}from"./VSelect-CAAOHY78.js";import{V as it}from"./VPagination-CN_An-w0.js";import{V as Lt}from"./VTooltip-Ap2rzsdn.js";import{V as nt}from"./VMenu-Dbaxs5uG.js";import"./paypal.vue_vue_type_script_setup_true_lang-CuoOphF2.js";import"./payApi-srUkZfta.js";import"./AppTextField.vue_vue_type_script_setup_true_lang-CWeqm7gc.js";import"./orderAndItemFittings-A_opOYKK.js";import"./styleSelect-BAFL_XSn.js";import"./myProduct-BNmFFulZ.js";import"./order-BliJFPqQ.js";import"./VRadioGroup-Bk91gCKJ.js";import"./file-C2qrOrfI.js";import"./dayjs.min-C4-AB8Gr.js";import"./alioss-D7aFrPDM.js";import"./VFileInput-kaJey9cy.js";import"./VStepper-BmhzrFkQ.js";import"./VSheet-BUpJdv3I.js";import"./VCombobox-Qmm-hhRz.js";import"./filter-D7iDI7IV.js";import"./paymentDialog.vue_vue_type_script_setup_true_lang-Drv7o1Ex.js";import"./currencyPrice.vue_vue_type_script_setup_true_lang-DihHc0nE.js";import"./brandServices-DntPHE2P.js";/* empty css */import"./VSlideGroup-BGEgBoXK.js";import"./VTable-JZ8Hgj7V.js";const Mt={class:"d-flex align-center pa-3 ml-5"},Ot={class:"product-title ml-5"},qt={class:"my-1",style:{"font-weight":"400"}},Ft={style:{width:"150px"}},Wt={key:0},Qt={class:"d-flex align-center pt-5 pb-5",style:{"min-width":"200px"}},Et={class:"ml-5"},Jt={class:"mb-2 product-title"},Ht={class:"mb-2 product-text"},Kt={class:"product-text"},Xt={style:{color:"#000000","font-weight":"500"}},Gt={style:{width:"50px"}},Yt={class:"d-flex flex-wrap justify-center justify-sm-space-between align-center gap-y-2 mt-2"},Zt={class:"d-flex"},te={class:"no-data-box align-content-sm-center mt-5",style:{height:"484px"}},ee={class:"d-flex align-center pt-3"},oe={class:"my-1 ml-3 mt-3",style:{"font-weight":"400"}},ae={key:0},le={class:"product-title pa-2"},ie={class:"d-flex align-center pt-5 pb-5",style:{"min-width":"200px"}},ne={style:{"min-width":"120px","min-height":"120px"}},se={class:"ml-2",style:{color:"#000000","font-weight":"500","min-width":"90px"}},re={class:"mb-5"},de={class:"mb-2 product-title"},ue={class:"d-flex align-center"},ce={class:"product-text"},pe={class:"product-text"},me={class:"ml-5",style:{width:"50px"}},ve={class:"d-flex flex-wrap justify-center justify-sm-space-between align-center gap-y-2 mt-2 pl-5 pr-5",style:{width:"100%"}},fe={class:"d-flex flex-wrap justify-center",style:{width:"100%"}},ge={class:"no-data-box align-content-sm-center mt-5",style:{height:"484px"}},ye=yt({__name:"myWarehouse",setup(he){const st=ht(),rt=_t(),dt=d(rt.query.id),x=d([]),ut=X([{title:"Product",key:"product"},{title:"Total Quantity",key:"totalQuantity"},{title:"Actions",key:"actions"},{title:"",key:"data-table-expand",width:200}]),s=d({keyword:dt.value,typeIds:[],startDate:"",endDate:"",current:1,size:10}),I=d(null),ct=r=>{const t=Ct(I.value);s.value.startDate=t[0],s.value.endDate=t[t.length-1],s.value.current=1,g()},f=d([]),P=d(!1),V=d(1),g=()=>{P.value=!0,Tt(s.value).then(r=>{r.data.records.forEach((t,w)=>{t.id=w,t.totalItem=0,t.variants.forEach(y=>{t.totalItem+=y.inventory}),f.value.push(t)}),V.value=r.data.total}).finally(()=>{P.value=!1})};g();const j=d([]);(()=>{Ut({current:1,size:1e3,category1:1}).then(t=>{j.value=t.data.records})})();const pt=()=>{s.value.current=1,f.value=[],g()},S=d(!1),mt=r=>{f.value=[],g()},z=r=>{f.value=[],g()},L=()=>{s.value.current=1,f.value=[],g()},U=d(!1),vt=r=>{f.value=[],g()},B=d({}),M=d(0),O=(r,t)=>{B.value=JSON.parse(JSON.stringify(r)),B.value.minStockingNum=t.minStockingNum,M.value=t.id,U.value=!0},ft=xt(),q=r=>{ft.push({name:"my-product-inventory-records",query:{id:r.id}})},N=d(!1),F=d(0),W=r=>{F.value=r,N.value=!0},Q=async(r,t)=>{const w={blankProductId:t.id,blankProductSkuId:r.id,quantity:1};Nt(w).then(y=>{st.changeSnackbar({color:"#7367f0",location:"top",variant:"elevated",text:"Added to cart successfully",visible:!0}),Dt()})},E=d({}),J=r=>{E.value=r,S.value=!0};G.RM=3;const H=bt(()=>(r,t)=>new G(r).div(t).round(0).toString()),gt=X([{title:"Product",key:"product"},{title:"",key:"data-table-expand",width:0}]);return(r,t)=>{const w=St,y=Pt;return v(),h(R,null,[o(wt,{class:"my-warehouse-box"},{default:a(()=>[o(D,{class:"pa-5"},{default:a(()=>t[12]||(t[12]=[i("div",{class:"my-warehouse-title"}," Filter ",-1)])),_:1,__:[12]}),o(D,{class:"pa-5"},{default:a(()=>[o($t,null,{default:a(()=>[o($,{md:"4",cols:"12"},{default:a(()=>[o(kt,{modelValue:l(s).keyword,"onUpdate:modelValue":t[0]||(t[0]=e=>l(s).keyword=e),label:"Product Name, SKU, Product Num",variant:"outlined","prepend-inner-icon":"custom-search-2-line"},null,8,["modelValue"])]),_:1}),o($,{md:"4",cols:"12"},{default:a(()=>[o(jt,{modelValue:l(s).typeIds,"onUpdate:modelValue":[t[1]||(t[1]=e=>l(s).typeIds=e),pt],chips:"","closable-chips":"",multiple:"",items:l(j),"item-title":"name","item-value":"id",label:"Product Type",variant:"outlined"},{chip:a(({props:e,item:n})=>[o(zt,A(e,{text:n.raw.name}),null,16,["text"])]),item:a(({props:e,item:n})=>{var p;return[o(_,A(e,{title:(p=n==null?void 0:n.raw)==null?void 0:p.name}),null,16,["title"])]}),_:1},8,["modelValue","items"])]),_:1}),o($,{md:"4",cols:"12"},{default:a(()=>[o(w,{modelValue:l(I),"onUpdate:modelValue":[t[2]||(t[2]=e=>b(I)?I.value=e:null),ct],placeholder:"Time Selection",variant:"outlined",config:{mode:"range"},multiple:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),o(Vt),o(D,{class:"pa-0 mt-5 my-warehouse-table-box"},{default:a(()=>[o(at,{modelValue:l(x),"onUpdate:modelValue":t[5]||(t[5]=e=>b(x)?x.value=e:null),"items-per-page":-1,"disable-sort":"",headers:l(ut),"item-key":"id",items:l(f),loading:l(P),"item-value":"id","expand-on-click":"","hide-default-footer":""},{"expanded-row":a(e=>[(v(!0),h(R,null,tt(e.item.variants,(n,p)=>(v(),h("tr",{key:p,class:"v-data-table__tr"},[i("td",null,[i("div",Mt,[o(y,{src:n.mainImageUrl,height:80,width:80,"is-preview":!0,"no-compress":!0,previewList:[n.mainImageUrl]},null,8,["src","previewList"]),i("div",Ot,u(n.optionInfo),1)])]),i("td",null,[i("p",qt," Inventory: "+u(n.inventory)+" Pics ",1)]),i("td",null,[i("div",Ft,[i("div",null,[o(c,{variant:"text","prepend-icon":"custom-send-plane-line",color:"#686B7C",height:"30px",onClick:k(C=>O(n,e.item.product),["stop"])},{default:a(()=>t[13]||(t[13]=[m(" Add Inventory ")])),_:2,__:[13]},1032,["onClick"])]),e.item.product.category1===1?(v(),h("div",Wt,[o(c,{variant:"text","prepend-icon":"custom-shopping-cart-line",color:"#686B7C",height:"30px",onClick:k(C=>Q(n,e.item.product),["stop"])},{default:a(()=>t[14]||(t[14]=[m(" Add to the cart ")])),_:2,__:[14]},1032,["onClick"])])):T("",!0)])]),t[15]||(t[15]=i("td",null,null,-1))]))),128))]),"item.product":a(({item:e})=>[i("div",Qt,[o(y,{src:e.product.mainImageUrl,height:120,width:120,"no-compress":!0,"is-preview":!0,"preview-list":e.product.imageList},null,8,["src","preview-list"]),i("div",Et,[i("div",Jt,u(e.product.title),1),i("div",Ht,u(e.product.optionInfo),1),i("div",Kt," NO: "+u(e.product.blankProductSeqNo),1)])])]),"item.totalQuantity":a(({item:e})=>[i("div",Xt," Total: "+u(e.totalItem)+" Pics ",1)]),"item.actions":a(({item:e})=>[i("div",Gt,[o(Lt,{text:"More Actions"},{activator:a(({props:n})=>[o(c,A(n,{variant:"text",icon:"custom-more-fill",color:"#686B7C"}),null,16)]),_:1}),o(nt,{activator:"parent",location:"bottom end",offset:"14px",class:"pa-5 sheet-box"},{default:a(()=>[o(ot,null,{default:a(()=>[e.product.category1===1?(v(),Z(_,{key:0,class:"pa-0"},{prepend:a(()=>[o(c,{class:"justify-start",variant:"text",color:"#6D788D",height:"42px",block:"",onClick:n=>W(e.product.blankProductId)},{default:a(()=>t[16]||(t[16]=[m(" Create Order ")])),_:2,__:[16]},1032,["onClick"])]),_:2},1024)):T("",!0),o(_,{class:"pa-0"},{prepend:a(()=>[o(c,{class:"justify-start",variant:"text",color:"#6D788D",height:"42px",block:"",onClick:k(n=>q(e.product),["stop"])},{default:a(()=>t[17]||(t[17]=[m(" Inventory Records ")])),_:2,__:[17]},1032,["onClick"])]),_:2},1024),o(_,{class:"pa-0"},{prepend:a(()=>[o(c,{class:"justify-start",variant:"text",color:"#6D788D",height:"42px",block:"",style:{color:"red"},onClick:n=>J(e)},{default:a(()=>t[18]||(t[18]=[m(" Delete ")])),_:2,__:[18]},1032,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1024)])]),"item.data-table-expand":a(({internalItem:e,isExpanded:n,toggleExpand:p})=>[o(c,{variant:"text",icon:n(e)?"tabler-chevron-up":"tabler-chevron-down",color:"#686B7C",onClick:C=>p(p)},null,8,["icon","onClick"])]),bottom:a(()=>[o(D,{class:"pt-2"},{default:a(()=>[i("div",Yt,[i("div",null,u(("paginationMeta"in r?r.paginationMeta:l(K))({page:l(s).current,itemsPerPage:l(s).size},l(V))),1),i("div",Zt,[o(lt,{class:"mr-5",modelValue:l(s).size,"onUpdate:modelValue":[t[3]||(t[3]=e=>l(s).size=e),L],width:"100px",items:[10,20,40,100],variant:"outlined"},null,8,["modelValue"]),o(it,{modelValue:l(s).current,"onUpdate:modelValue":[t[4]||(t[4]=e=>l(s).current=e),z],"total-visible":5,length:l(H)(l(V),l(s).size),rounded:"circle"},null,8,["modelValue","length"])])])]),_:1})]),"no-data":a(()=>[i("div",te,[o(Y,{width:310,"aspect-ratio":"16/9",cover:"",src:l(et)},null,8,["src"])])]),_:1},8,["modelValue","headers","items","loading"])]),_:1}),o(D,{class:"pa-0 mt-5 my-warehouse-table-box2"},{default:a(()=>[o(at,{modelValue:l(x),"onUpdate:modelValue":t[8]||(t[8]=e=>b(x)?x.value=e:null),"items-per-page":-1,"disable-sort":"",headers:l(gt),"item-key":"id",items:l(f),loading:l(P),"item-value":"id","expand-on-click":"","hide-default-footer":""},{"expanded-row":a(e=>[(v(!0),h(R,null,tt(e.item.variants,(n,p)=>(v(),h("tr",{key:p,class:"v-data-table__tr"},[i("td",null,[i("div",ee,[o(y,{src:n.mainImageUrl,height:80,width:80,"is-preview":!0,"no-compress":!0,previewList:[n.mainImageUrl]},null,8,["src","previewList"]),i("div",null,[i("p",oe," Inventory: "+u(n.inventory)+" Pic ",1),i("div",null,[o(c,{variant:"text","prepend-icon":"custom-send-plane-line",color:"#686B7C",height:"30px",onClick:k(C=>O(n,e.item.product),["stop"])},{default:a(()=>t[19]||(t[19]=[m(" Add Inventory ")])),_:2,__:[19]},1032,["onClick"]),e.item.product.category1===1?(v(),h("div",ae,[o(c,{variant:"text","prepend-icon":"custom-shopping-cart-line",color:"#686B7C",height:"30px",onClick:k(C=>Q(n,e.item.product),["stop"])},{default:a(()=>t[20]||(t[20]=[m(" Add to the cart ")])),_:2,__:[20]},1032,["onClick"])])):T("",!0)])])]),i("div",le,u(n.optionInfo),1)]),t[21]||(t[21]=i("td",null,null,-1))]))),128))]),"item.product":a(({item:e})=>[i("div",ie,[i("div",ne,[o(y,{src:e.product.mainImageUrl,height:120,width:120,"no-compress":!0,"is-preview":!0,"preview-list":e.product.imageList},null,8,["src","preview-list"])]),i("div",se," Total: "+u(e.totalItem)+" Pics ",1)]),i("div",re,[i("div",de,u(e.product.title),1),i("div",ue,[i("div",null,[i("div",ce,u(e.product.optionInfo),1),i("div",pe," NO: "+u(e.product.blankProductSeqNo),1)]),i("div",me,[o(c,{variant:"text",icon:"custom-more-fill",color:"#686B7C"}),o(nt,{activator:"parent",location:"bottom end",offset:"14px",class:"pa-5 sheet-box"},{default:a(()=>[o(ot,null,{default:a(()=>[e.product.category1===1?(v(),Z(_,{key:0,class:"pa-0"},{prepend:a(()=>[o(c,{class:"justify-start",variant:"text",color:"#6D788D",height:"42px",block:"",onClick:n=>W(e.product.blankProductId)},{default:a(()=>t[22]||(t[22]=[m(" Create Order ")])),_:2,__:[22]},1032,["onClick"])]),_:2},1024)):T("",!0),o(_,{class:"pa-0"},{prepend:a(()=>[o(c,{class:"justify-start",variant:"text",color:"#6D788D",height:"42px",block:"",onClick:k(n=>q(e.product),["stop"])},{default:a(()=>t[23]||(t[23]=[m(" Inventory Records ")])),_:2,__:[23]},1032,["onClick"])]),_:2},1024),o(_,{class:"pa-0"},{prepend:a(()=>[o(c,{class:"justify-start",variant:"text",color:"#6D788D",height:"42px",block:"",style:{color:"red"},onClick:n=>J(e)},{default:a(()=>t[24]||(t[24]=[m(" Delete ")])),_:2,__:[24]},1032,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1024)])])])]),"item.data-table-expand":a(({internalItem:e,isExpanded:n,toggleExpand:p})=>[o(c,{variant:"text",icon:n(e)?"tabler-chevron-up":"tabler-chevron-down",color:"#686B7C",onClick:C=>p(p)},null,8,["icon","onClick"])]),bottom:a(()=>[i("div",ve,[i("div",null,u(("paginationMeta"in r?r.paginationMeta:l(K))({page:l(s).current,itemsPerPage:l(s).size},l(V))),1),i("div",fe,[o(lt,{class:"mb-2",modelValue:l(s).size,"onUpdate:modelValue":[t[6]||(t[6]=e=>l(s).size=e),L],width:"100px",items:[10,20,40,100],variant:"outlined"},null,8,["modelValue"]),o(it,{modelValue:l(s).current,"onUpdate:modelValue":[t[7]||(t[7]=e=>l(s).current=e),z],"total-visible":5,length:l(H)(l(V),l(s).size),rounded:"circle"},null,8,["modelValue","length"])])])]),"no-data":a(()=>[i("div",ge,[o(Y,{width:310,"aspect-ratio":"16/9",cover:"",src:l(et)},null,8,["src"])])]),_:1},8,["modelValue","headers","items","loading"])]),_:1})]),_:1}),o(Rt,{"open-or-close-delete-attachments-dialog-visible":l(S),"onUpdate:openOrCloseDeleteAttachmentsDialogVisible":t[9]||(t[9]=e=>b(S)?S.value=e:null),"delete-item":l(E),"onChange:confirmDeleteAttachments":mt},null,8,["open-or-close-delete-attachments-dialog-visible","delete-item"]),o(At,{"open-or-close-replenish-inventory-dialog-visible":l(U),"onUpdate:openOrCloseReplenishInventoryDialogVisible":t[10]||(t[10]=e=>b(U)?U.value=e:null),"item-inventory-data":l(B),"item-inventory-id":l(M),"onChange:confirmReplenishInventory":vt},null,8,["open-or-close-replenish-inventory-dialog-visible","item-inventory-data","item-inventory-id"]),o(Bt,{"created-visible-dialog":l(N),"onUpdate:createdVisibleDialog":t[11]||(t[11]=e=>b(N)?N.value=e:null),"created-id":l(F)},null,8,["created-visible-dialog","created-id"])],64)}}}),uo=It(ye,[["__scopeId","data-v-323f10d0"]]);export{uo as default};