import{r,a as E,o as Q,$ as X,f as N,h as _,i as l,w as t,t as Z,q as ee,s as ae,p as n,v as p,F as te,x as le,m as g,y as d,j as S,k as v,l as z}from"./index-htML_UHV.js";import{a as oe}from"./goodsExchange-B_B0QMhj.js";import{a as ne}from"./setting-BD2OoeWh.js";import{g as se}from"./basicSetting-C4MsdBLE.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(),$=r([]);r([]);const f=r(!1),o=E({page_no:1,page_size:10,company_id:w.state.companId}),s=E({}),c=r("");r(!1);const O=r([]);E({}),r("second"),r([]);const D=r([]),T=r(null),x=()=>{se().then(e=>{$.value=e})},G=()=>{ne({dictType:"out_warehouse_type"}).then(e=>{D.value=e.data})},h=()=>{f.value=!0,oe(o).then(e=>{f.value=!1,c.value=e}).catch(()=>{f.value=!1})},L=e=>{y.push({name:"addOutbound",query:{id:e.id,type:"edit"}})},q=e=>{y.push({name:"addOutbound",query:{id:e.id,type:"view"}})},B=e=>{O.value=e},F=e=>{o.page_size=e,h()},R=e=>{o.page_no=e,h()},j=()=>{y.push({name:"addOutbound"})},I=()=>{Object.assign(o,s),delete o.start_time,delete o.end_time,s.goodsExchange_time_range&&(o.start_time=parseInt(Number(s.goodsExchange_time_range[0])/1e3),o.end_time=parseInt(Number(s.goodsExchange_time_range[1])/1e3)),delete o.goodsExchange_time_range,o.page_no=1,h()},P=e=>{let u="";return $.value.map(m=>{m.id===e&&(u=m.name)}),u},W=e=>{let u="";return D.value.map(m=>{m.value===e&&(u=m.label)}),u};return Q(()=>{h(),G(),x()}),X(()=>{k.query.status&&(o.status=k.query.status,s.status=k.query.status),o.page_no=1,h()}),(e,u)=>{const m=n("el-date-picker"),V=n("el-form-item"),C=n("el-col"),A=n("el-option"),M=n("el-select"),b=n("el-button"),U=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,[_("div",re,[l(Y,{ref_key:"advancedFormRef",ref:T,model:s},{default:t(()=>[l(U,null,{default:t(()=>[l(C,{xs:24,sm:24,md:6,lg:5,xl:6},{default:t(()=>[l(V,{label:e.$t("outBound")},{default:t(()=>[l(m,{modelValue:s.goodsExchange_time_range,"onUpdate:modelValue":u[0]||(u[0]=a=>s.goodsExchange_time_range=a),type:"daterange",align:"center",editable:!1,"unlink-panels":"",clearable:!0,"default-time":["00:00:00","23:59:59"],"range-separator":"-","start-placeholder":e.$t("start_time"),"end-placeholder":e.$t("end_time"),"value-format":"timestamp","picker-options":{disabledDate(a){return a.getTime()-1>=new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate()).getTime()+864e5-1}}},null,8,["modelValue","start-placeholder","end-placeholder","picker-options"])]),_:1},8,["label"])]),_:1}),l(C,{xs:24,sm:24,md:7,lg:3,xl:7,class:"mb-4 mr-3 ml-3"},{default:t(()=>[l(V,{label:e.$t("warechouse")},{default:t(()=>[l(M,{modelValue:s.warehouse_id,"onUpdate:modelValue":u[1]||(u[1]=a=>s.warehouse_id=a),clearable:""},{default:t(()=>[(p(!0),N(te,null,le($.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}),l(C,{xs:24,sm:24,md:12,lg:1,xl:6,class:"mb-4 flex items-end"},{default:t(()=>[l(b,{class:"w-full mt-1",onClick:I},{default:t(()=>[g(d(e.$t("search")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),l(J,{tableData:c.value.data,loading:f.value,onSelectionChange:B},{toolbar:t(()=>[_("div",de,[_("div",ie,[S(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(()=>[l(i,{type:"selection",width:"55"}),l(i,{prop:"sn",label:e.$t("out_sn")},{default:t(a=>[g(d(a.row.sn),1)]),_:1},8,["label"]),l(i,{prop:"warehouse_id",label:e.$t("warechouse_name")},{default:t(a=>[g(d(P(a.row.warehouse_id)),1)]),_:1},8,["label"]),l(i,{label:e.$t("out_type")},{default:t(a=>[_("span",null,d(W(a.row.type)),1)]),_:1},8,["label"]),l(i,{label:e.$t("warehousing_state")},{default:t(a=>[_("span",null,d(a.row.has_submit==="Y"?e.$t("inOut"):e.$t("notOut")),1)]),_:1},8,["label"]),l(i,{label:e.$t("outTime")},{default:t(a=>[_("span",null,d(a.row.create_time),1)]),_:1},8,["label"]),l(i,{label:e.$t("notes")},{default:t(a=>[_("span",null,d(a.row.notes),1)]),_:1},8,["label"]),l(i,{label:e.$t("operate"),fixed:"right",width:"300"},{default:t(a=>[l(b,{size:"small",onClick:K=>q(a.row)},{default:t(()=>[g(d(e.$t("view")),1)]),_:2},1032,["onClick"]),a.row.has_submit==="N"&&S(w).state.user.user.founder!==1?(p(),v(b,{key:0,size:"small",onClick:K=>L(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};
