import{r,a as $,o as Q,a1 as X,f as N,h as m,i as o,w as t,v as Z,q as ee,s as ae,p as n,x as p,F as te,y as oe,k as v,m as g,t as d,j as x,l as z}from"./index-GCZD4BFP.js";import{a as le}from"./goodsExchange-CxLOr8W3.js";import{a as ne}from"./setting-CjsMgkQh.js";import{g as se}from"./basicSetting-B0Aq66-n.js";const ue={class:"dark:!bg-[#060818] bg-white p-3"},re={class:"search bg-white p-3"},de={class:"inner-toolbar"},ie={class:"toolbar-btns"},he={__name:"outbound",setup(ce){const w=Z(),y=ee(),k=ae(),E=r([]);r([]);const f=r(!1),l=$({page_no:1,page_size:10,company_id:w.state.companId}),s=$({}),c=r("");r(!1);const O=r([]);$({}),r("second"),r([]);const S=r([]),G=r(null),L=()=>{se().then(e=>{E.value=e})},q=()=>{ne({dictType:"out_warehouse_type"}).then(e=>{S.value=e.data})},h=()=>{f.value=!0,le(l).then(e=>{f.value=!1,c.value=e}).catch(()=>{f.value=!1})},B=e=>{y.push({name:"addOutbound",query:{id:e.id,type:"edit"}})},T=e=>{y.push({name:"addOutbound",query:{id:e.id,type:"view"}})},D=e=>{O.value=e},F=e=>{l.page_size=e,h()},R=e=>{l.page_no=e,h()},j=()=>{y.push({name:"addOutbound"})},I=()=>{Object.assign(l,s),delete l.start_time,delete l.end_time,s.goodsExchange_time_range&&(l.start_time=parseInt(Number(s.goodsExchange_time_range[0])/1e3),l.end_time=parseInt(Number(s.goodsExchange_time_range[1])/1e3)),delete l.goodsExchange_time_range,l.page_no=1,h()},P=e=>{let u="";return E.value.map(_=>{_.id===e&&(u=_.name)}),u},W=e=>{let u="";return S.value.map(_=>{_.value===e&&(u=_.label)}),u};return Q(()=>{h(),q(),L()}),X(()=>{k.query.status&&(l.status=k.query.status,s.status=k.query.status),l.page_no=1,h()}),(e,u)=>{const _=n("el-date-picker"),V=n("el-form-item"),C=n("el-col"),A=n("el-option"),U=n("el-select"),b=n("el-button"),M=n("el-row"),Y=n("el-form"),i=n("el-table-column"),H=n("el-pagination"),J=n("en-table-layout");return p(),N("div",ue,[m("div",re,[o(Y,{ref_key:"advancedFormRef",ref:G,model:s},{default:t(()=>[o(M,null,{default:t(()=>[o(C,{xs:24,sm:24,md:6,lg:5,xl:6},{default:t(()=>[o(V,{label:e.$t("outBound")},{default:t(()=>[o(_,{modelValue:s.goodsExchange_time_range,"onUpdate:modelValue":u[0]||(u[0]=a=>s.goodsExchange_time_range=a),type:"daterange",shortcuts:e.shortcuts,"range-separator":"-","start-placeholder":"Start date","end-placeholder":"End date"},null,8,["modelValue","shortcuts"])]),_:1},8,["label"])]),_:1}),o(C,{xs:24,sm:24,md:7,lg:3,xl:7,class:"mb-4 mr-3 ml-3"},{default:t(()=>[o(V,{label:e.$t("warechouse")},{default:t(()=>[o(U,{modelValue:s.warehouse_id,"onUpdate:modelValue":u[1]||(u[1]=a=>s.warehouse_id=a),clearable:""},{default:t(()=>[(p(!0),N(te,null,oe(E.value,a=>(p(),v(A,{key:a.id,label:a.name,value:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label"])]),_:1}),o(C,{xs:24,sm:24,md:12,lg:1,xl:6,class:"mb-4 flex items-end"},{default:t(()=>[o(b,{class:"w-full mt-1",onClick:I},{default:t(()=>[g(d(e.$t("search")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),o(J,{tableData:c.value.data,loading:f.value,onSelectionChange:D},{toolbar:t(()=>[m("div",de,[m("div",ie,[x(w).state.user.user.founder!==1?(p(),v(b,{key:0,size:"small",type:"primary",onClick:j},{default:t(()=>[g(d(e.$t("addOut")),1)]),_:1})):z("",!0)])])]),"table-columns":t(()=>[o(i,{type:"selection",width:"55"}),o(i,{prop:"sn",label:e.$t("out_sn")},{default:t(a=>[g(d(a.row.sn),1)]),_:1},8,["label"]),o(i,{prop:"warehouse_id",label:e.$t("warechouse_name")},{default:t(a=>[g(d(P(a.row.warehouse_id)),1)]),_:1},8,["label"]),o(i,{label:e.$t("out_type")},{default:t(a=>[m("span",null,d(W(a.row.type)),1)]),_:1},8,["label"]),o(i,{label:e.$t("warehousing_state")},{default:t(a=>[m("span",null,d(a.row.has_submit==="Y"?e.$t("inOut"):e.$t("notOut")),1)]),_:1},8,["label"]),o(i,{label:e.$t("outTime")},{default:t(a=>[m("span",null,d(a.row.create_time),1)]),_:1},8,["label"]),o(i,{label:e.$t("notes")},{default:t(a=>[m("span",null,d(a.row.notes),1)]),_:1},8,["label"]),o(i,{label:e.$t("operate"),fixed:"right",width:"300"},{default:t(a=>[o(b,{size:"small",onClick:K=>T(a.row)},{default:t(()=>[g(d(e.$t("view")),1)]),_:2},1032,["onClick"]),a.row.has_submit==="N"&&x(w).state.user.user.founder!==1?(p(),v(b,{key:0,size:"small",onClick:K=>B(a.row)},{default:t(()=>[g(d(e.$t("outBound")),1)]),_:2},1032,["onClick"])):z("",!0)]),_:1},8,["label"])]),default:t(()=>[c.value.data&&c.value.data.length?(p(),v(H,{key:0,onSizeChange:F,onCurrentChange:R,"current-page":c.value.page_no,"page-sizes":[10,20,50,100],"page-size":c.value.page_size,layout:"total, sizes, prev, pager, next, jumper",total:c.value.data_total},null,8,["current-page","page-size","total"])):z("",!0)]),_:1},8,["tableData","loading"])])}}};export{he as default};
