import{U as j,k as x,w as z,M as K,b as W,N as q,J,K as Q,D as Z,C as G,F as H,I as X}from"./element-plus.4a7d92a3.js";import{_ as ee}from"./index.vue_vue_type_script_setup_true_lang.5d4e738c.js";import{u as le}from"./usePaging.6a6670f9.js";import{b as oe,c as te}from"./beforehand_order.8d40cf80.js";import{a as ae}from"./warehouse.f33b826b.js";import{a as ue}from"./system_store.c7d57ffd.js";import{a as re}from"./warehouse_order.39753a00.js";import{d as O,r as n,Z as se,o as d,c as v,a as b,U as l,L as t,R as _,u as a,K as F,j as B,Q as ne,T as w,a9 as A}from"./@vue.18505fe0.js";const de={class:"flex mt-4 justify-end"},ie={class:"dialog-footer"},pe=O({name:"subOrder"}),he=O({...pe,setup(me,{expose:U}){const i=n(!1),g=n([]),y=n([]),c=n({id:0}),E=n(0),u=n({bhoid:c.value.id,warehouse_id:"",remark:"",delivery_time:"",store_id:""}),L=()=>{oe(u.value).then(r=>{location.reload()})},I=()=>{i.value=!0,ae({}).then(r=>{g.value=r.lists}),ue({}).then(r=>{y.value=r.lists})},h=r=>{E.value>0?re({id:E.value,type:r}).then(o=>{window.open(o.url,"_blank"),x.success("\u5BFC\u51FA\u6210\u529F")}):x.error("\u51FA\u5E93id\u4E0D\u80FD\u4E3A\u7A7A")},k=se({id:c.value.id}),{pager:p,getLists:C,resetParams:_e,resetPage:fe}=le({fetchFun:te,params:k});function N(r,o){E.value=o.outbound_id,c.value.id=r,u.value.bhoid=r,k.id=r,C()}return U({getList:N}),(r,o)=>{const m=z,s=K,P=W,M=q,S=ee,V=J,D=Q,f=Z,T=j,Y=G,$=H,R=X;return d(),v(w,null,[b("div",null,[l(m,{type:"primary",onClick:I},{default:t(()=>[_(" \u4E00\u952E\u51FA\u5E93 ")]),_:1}),l(m,{type:"primary",onClick:o[0]||(o[0]=e=>h(1))},{default:t(()=>[_(" \u6253\u5370\u91C7\u8D2D\u5355 ")]),_:1}),l(m,{type:"primary",onClick:o[1]||(o[1]=e=>h(4))},{default:t(()=>[_(" \u6253\u5370\u96F6\u552E\u5355 ")]),_:1}),l(M,{data:a(p).lists,border:"",style:{width:"100%","margin-top":"10px"}},{default:t(()=>[l(s,{prop:"id",label:"ID",width:"60"}),l(s,{label:"\u5546\u54C1\u56FE\u7247",prop:"image",width:"120"},{default:t(({row:e})=>[l(P,{style:{width:"50px",height:"50px"},src:e.image,"preview-teleported":!0},null,8,["src"])]),_:1}),l(s,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","show-overflow-tooltip":""}),l(s,{label:"\u5355\u4F4D",prop:"unit_name","show-overflow-tooltip":""}),l(s,{label:"\u51FA\u5E93\u6570\u91CF",prop:"nums","show-overflow-tooltip":""}),l(s,{label:"\u91C7\u8D2D\u4EF7",prop:"purchase","show-overflow-tooltip":""}),l(s,{label:"\u603B\u4EF7",prop:"total_price","show-overflow-tooltip":""})]),_:1},8,["data"]),b("div",de,[a(p).lists?(d(),F(S,{key:0,modelValue:a(p),"onUpdate:modelValue":o[2]||(o[2]=e=>B(p)?p.value=e:null),onChange:a(C)},null,8,["modelValue","onChange"])):ne("",!0)])]),l(R,{modelValue:a(i),"onUpdate:modelValue":o[8]||(o[8]=e=>B(i)?i.value=e:null),title:"\u51FA\u5E93\u5E93\u8BBE\u7F6E",width:"600"},{footer:t(()=>[b("div",ie,[l(m,{onClick:o[7]||(o[7]=e=>i.value=!1)},{default:t(()=>[_("\u53D6\u6D88")]),_:1}),l(m,{type:"primary",onClick:L},{default:t(()=>[_(" \u786E\u8BA4 ")]),_:1})])]),default:t(()=>[l($,{ref:"formRef",model:a(u),"label-width":"90px"},{default:t(()=>[l(f,{label:"\u4ED3\u5E93"},{default:t(()=>[l(D,{modelValue:a(u).warehouse_id,"onUpdate:modelValue":o[3]||(o[3]=e=>a(u).warehouse_id=e),placeholder:"\u8BF7\u9009\u62E9\u4ED3\u5E93",size:"large",style:{width:"240px"}},{default:t(()=>[(d(!0),v(w,null,A(a(g),e=>(d(),F(V,{label:e.name,value:e.id,key:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(f,{label:"\u9001\u8D27\u65F6\u95F4"},{default:t(()=>[l(T,{readonly:!1,class:"flex-1 !flex",modelValue:a(u).delivery_time,"onUpdate:modelValue":o[4]||(o[4]=e=>a(u).delivery_time=e),clearable:"",type:"date","value-format":"YYYY-MM-DD",placeholder:"\u9009\u62E9\u751F\u4EA7\u65E5\u671F"},null,8,["modelValue"])]),_:1}),l(f,{label:"\u95E8\u5E97",prop:"store_id"},{default:t(()=>[l(D,{modelValue:a(u).store_id,"onUpdate:modelValue":o[5]||(o[5]=e=>a(u).store_id=e),placeholder:"\u8BF7\u9009\u62E9\u95E8\u5E97",size:"large",style:{width:"240px"}},{default:t(()=>[(d(!0),v(w,null,A(a(y),e=>(d(),F(V,{label:e.name,value:e.id,key:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(f,{label:"\u5907\u6CE8",prop:"remark"},{default:t(()=>[l(Y,{modelValue:a(u).remark,"onUpdate:modelValue":o[6]||(o[6]=e=>a(u).remark=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8",readonly:!1},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])],64)}}});export{he as _};
