import{d as J,r as u,o as K,f as V,h as b,i as a,w as t,v as Q,p as n,q as X,s as Y,x as p,F as Z,y as ee,k as y,m as c,t as i,j as z,l as L}from"./index-GCZD4BFP.js";import{g as ae}from"./goodsInventoryLoss-DaDtQv6q.js";import{a as te}from"./setting-CjsMgkQh.js";import{g as le}from"./basicSetting-B0Aq66-n.js";const oe={class:"dark:!bg-[#060818] bg-white p-3"},ne={class:"search bg-white p-3"},se={class:"inner-toolbar"},re={class:"toolbar-btns"},pe=J({__name:"goodsInventoryLoss",setup(ue){const w=Q(),I=X();Y();const C=u([]);u([]);const v=u(!1),s=u({page_no:1,page_size:10,company_id:w.state.companId}),r=u({goodsInventory_time_range:[]}),m=u([]),S=u([]),$=u([]),g=()=>{v.value=!0,ae(s.value).then(e=>{v.value=!1,m.value=e}).catch(()=>{v.value=!1})},N=()=>{le().then(e=>{C.value=e}),te({dictType:"inventory_status"}).then(e=>{$.value=e.data})},G=e=>{I.push({name:"goodsInventoryLossAdd",query:{id:e.id,type:"view"}})},A=e=>{let o="";return C.value.map(d=>{d.id==e&&(o=d.name)}),o},D=e=>{I.push({name:"goodsInventoryLossAdd",query:{id:e.id,type:"examine"}})},E=()=>{I.push({name:"goodsInventoryLossAdd"})},T=e=>{let o="";return $.value.map(d=>{d.value==e&&(o=d.label)}),o},x=e=>{S.value=e},B=e=>{s.value.page_size=e,g()},F=e=>{s.value.page_no=e,g()},q=()=>{s.value={...s.value,...r.value},delete s.value.start_time,delete s.value.end_time,r.value.goodsInventory_time_range&&(s.value.start_time=parseInt(String(Number(r.value.goodsInventory_time_range[0])/1e3)),s.value.end_time=parseInt(String(Number(r.value.goodsInventory_time_range[1])/1e3))),delete s.value.goodsInventory_time_range,s.value.page_no=1,g()};return K(()=>{g(),N()}),(e,o)=>{const d=n("el-date-picker"),k=n("el-form-item"),f=n("el-col"),P=n("el-option"),U=n("el-select"),j=n("el-input"),h=n("el-button"),R=n("el-row"),W=n("el-form"),_=n("el-table-column"),H=n("el-pagination"),M=n("en-table-layout");return p(),V("div",oe,[b("div",ne,[a(W,{model:r.value},{default:t(()=>[a(R,null,{default:t(()=>[a(f,{xs:24,sm:24,md:6,lg:5,xl:6},{default:t(()=>[a(k,{label:e.$t("loss_date")},{default:t(()=>[a(d,{modelValue:r.value.goodsInventory_time_range,"onUpdate:modelValue":o[0]||(o[0]=l=>r.value.goodsInventory_time_range=l),type:"daterange","range-separator":"-","start-placeholder":"Start date","end-placeholder":"End date"},null,8,["modelValue"])]),_:1},8,["label"])]),_:1}),a(f,{xs:24,sm:24,md:7,lg:3,xl:7,class:"mb-4 mr-3 ml-3"},{default:t(()=>[a(k,{label:e.$t("warechouse")},{default:t(()=>[a(U,{modelValue:r.value.warehouse_id,"onUpdate:modelValue":o[1]||(o[1]=l=>r.value.warehouse_id=l)},{default:t(()=>[(p(!0),V(Z,null,ee(C.value,l=>(p(),y(P,{key:l.id,label:l.name,value:l.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label"])]),_:1}),a(f,{xs:24,sm:24,md:7,lg:3,xl:7,class:"mb-4 mr-3 ml-3"},{default:t(()=>[a(k,{label:e.$t("loss_people")},{default:t(()=>[a(j,{modelValue:r.value.creator,"onUpdate:modelValue":o[2]||(o[2]=l=>r.value.creator=l),placeholder:e.$t("place")+e.$t("loss_people"),width:"200px"},null,8,["modelValue","placeholder"])]),_:1},8,["label"])]),_:1}),a(f,{xs:24,sm:24,md:12,lg:1,xl:6,class:"mb-4 flex items-end"},{default:t(()=>[a(h,{class:"w-full mt-1",onClick:q},{default:t(()=>[c(i(e.$t("search")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),a(M,{tableData:m.value.data,loading:v.value,onSelectionChange:x},{toolbar:t(()=>[b("div",se,[b("div",re,[z(w).state.user.user.founder!==1?(p(),y(h,{key:0,size:"small",type:"primary",onClick:E},{default:t(()=>[c(i(e.$t("add")),1)]),_:1})):L("",!0)])])]),"table-columns":t(()=>[a(_,{type:"selection",width:"55"}),a(_,{prop:"sn",label:e.$t("loss_sn")},{default:t(l=>[b("span",null,i(l.row.sn),1)]),_:1},8,["label"]),a(_,{label:e.$t("warechouse")},{default:t(l=>[c(i(A(l.row.warehouse_id)),1)]),_:1},8,["label"]),a(_,{prop:"status",label:e.$t("warehousing_state")},{default:t(l=>[c(i(T(l.row.status)),1)]),_:1},8,["label"]),a(_,{prop:"report_desc",label:e.$t("loss_desc")},null,8,["label"]),a(_,{label:e.$t("operate"),fixed:"right",width:"450"},{default:t(l=>[a(h,{type:"mini",size:"small",onClick:O=>G(l.row)},{default:t(()=>[c(i(e.$t("view")),1)]),_:2},1032,["onClick"]),l.row.status=="NOT_HANDLE"&&z(w).state.user.user.founder!==1?(p(),y(h,{key:0,type:"mini",size:"small",onClick:O=>D(l.row)},{default:t(()=>[c(i(e.$t("review")),1)]),_:2},1032,["onClick"])):L("",!0)]),_:1},8,["label"])]),pagination:t(()=>[m.value?(p(),y(H,{key:0,onSizeChange:B,onCurrentChange:F,"current-page":m.value.page_no,"page-sizes":[10,20,50,100],"page-size":m.value.page_size,layout:"total, sizes, prev, pager, next, jumper",total:m.value.data_total},null,8,["current-page","page-size","total"])):L("",!0)]),_:1},8,["tableData","loading"])])}}});export{pe as default};
