import{r as u,a as C,o as X,Y as Z,f as S,h as i,i as o,w as a,t as ee,q as te,s as ae,p as l,v as m,F as oe,x as ne,m as p,j as V,k as v,l as E,y as g}from"./index-ByQGGPf6.js";import{a as le}from"./goodsExchange-BXbyTc-5.js";import{a as se}from"./setting-nWDj4rDN.js";import{g as re}from"./basicSetting-BFYAi9Sk.js";const ue={class:"search bg-white p-3"},de={class:"flex justify-end"},ie={class:"inner-toolbar"},ce={class:"toolbar-btns"},fe={__name:"outbound",setup(_e){const w=ee(),y=te(),k=ae(),x=u([]);u([]);const f=u(!1),n=C({page_no:1,page_size:10,company_id:w.state.companId}),s=C({}),c=u("");u(!1);const G=u([]);C({});const L=u("second");u([]);const z=u([]),T=u(null),q=()=>{re().then(t=>{x.value=t})},F=()=>{se({dictType:"out_warehouse_type"}).then(t=>{z.value=t.data})},h=()=>{f.value=!0,le(n).then(t=>{f.value=!1,c.value=t}).catch(()=>{f.value=!1})},O=t=>{y.push({name:"addOutbound",query:{id:t.id,type:"edit"}})},j=t=>{y.push({name:"addOutbound",query:{id:t.id,type:"view"}})},B=t=>{G.value=t},P=t=>{n.page_size=t,h()},R=t=>{n.page_no=t,h()},I=()=>{y.push({name:"addOutbound"})},M=()=>{Object.assign(n,s),delete n.start_time,delete n.end_time,s.goodsExchange_time_range&&(n.start_time=parseInt(Number(s.goodsExchange_time_range[0])/1e3),n.end_time=parseInt(Number(s.goodsExchange_time_range[1])/1e3)),delete n.goodsExchange_time_range,n.page_no=1,h()},W=t=>{let r="";return x.value.map(_=>{_.id===t&&(r=_.name)}),r},Y=t=>{let r="";return z.value.map(_=>{_.value===t&&(r=_.label)}),r};return X(()=>{h(),F(),q()}),Z(()=>{k.query.status&&(n.status=k.query.status,s.status=k.query.status),n.page_no=1,h()}),(t,r)=>{const _=l("el-date-picker"),D=l("el-form-item"),N=l("el-col"),A=l("el-option"),U=l("el-select"),$=l("el-row"),H=l("el-form"),b=l("el-button"),d=l("el-table-column"),J=l("el-pagination"),K=l("en-table-layout");return m(),S("div",null,[i("div",ue,[o(H,{ref_key:"advancedFormRef",ref:T,model:s,"label-width":"160px"},{default:a(()=>[o($,null,{default:a(()=>[o(N,{span:L.value==="first"?12:8},{default:a(()=>[o(D,{label:"出库时间"},{default:a(()=>[o(_,{modelValue:s.goodsExchange_time_range,"onUpdate:modelValue":r[0]||(r[0]=e=>s.goodsExchange_time_range=e),type:"daterange",align:"center",editable:!1,"unlink-panels":"",clearable:!0,"default-time":["00:00:00","23:59:59"],"range-separator":"-","start-placeholder":"开始日期","end-placeholder":"结束日期","value-format":"timestamp","picker-options":{disabledDate(e){return e.getTime()-1>=new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate()).getTime()+864e5-1},shortcuts:t.MixinPickerShortcuts}},null,8,["modelValue","picker-options"])]),_:1})]),_:1},8,["span"]),o(N,{span:8},{default:a(()=>[o(D,{label:"仓库"},{default:a(()=>[o(U,{modelValue:s.warehouse_id,"onUpdate:modelValue":r[1]||(r[1]=e=>s.warehouse_id=e),clearable:""},{default:a(()=>[(m(!0),S(oe,null,ne(x.value,e=>(m(),v(A,{key:e.id,label:e.name,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),i("div",de,[o(b,{class:"mr-3",onClick:M},{default:a(()=>[p(" 搜索 ")]),_:1})])]),o(K,{tableData:c.value.data,loading:f.value,onSelectionChange:B},{toolbar:a(()=>[i("div",ie,[i("div",ce,[V(w).state.user.user.founder!==1?(m(),v(b,{key:0,size:"mini",type:"primary",onClick:I},{default:a(()=>[p("新增出库")]),_:1})):E("",!0)])])]),"table-columns":a(()=>[o(d,{type:"selection",width:"55"}),o(d,{prop:"sn",label:"出库单号"},{default:a(e=>[p(g(e.row.sn),1)]),_:1}),o(d,{prop:"warehouse_id",label:"仓库名称"},{default:a(e=>[p(g(W(e.row.warehouse_id)),1)]),_:1}),o(d,{prop:"memo",label:"出库类型"},{default:a(e=>[i("span",null,g(Y(e.row.type)),1)]),_:1}),o(d,{label:"状态"},{default:a(e=>[i("span",null,g(e.row.has_submit==="Y"?"已出库":"未出库"),1)]),_:1}),o(d,{prop:"memo",label:"出库时间"},{default:a(e=>[i("span",null,g(e.row.create_time),1)]),_:1}),o(d,{prop:"memo",label:"备注"},{default:a(e=>[i("span",null,g(e.row.notes),1)]),_:1}),o(d,{label:"操作",width:"300"},{default:a(e=>[o(b,{size:"mini",onClick:Q=>j(e.row)},{default:a(()=>[p("查看")]),_:2},1032,["onClick"]),e.row.has_submit==="N"&&V(w).state.user.user.founder!==1?(m(),v(b,{key:0,size:"mini",onClick:Q=>O(e.row)},{default:a(()=>[p("出库")]),_:2},1032,["onClick"])):E("",!0)]),_:1})]),default:a(()=>[c.value.data&&c.value.data.length?(m(),v(J,{key:0,onSizeChange:P,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"])):E("",!0)]),_:1},8,["tableData","loading"])])}}};export{fe as default};
