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.a63a26dd.js";import{_ as ee}from"./index.vue_vue_type_script_setup_true_lang.ecb80feb.js";import{u as le}from"./usePaging.6a6670f9.js";import{b as oe,c as ae}from"./beforehand_order.c61ce065.js";import{a as te}from"./warehouse.c4720cc0.js";import{a as ue}from"./system_store.82c0fcfd.js";import{a as re}from"./warehouse_order.e72dd6ae.js";import{d as O,r as d,Z as se,o as i,c as b,a as F,U as l,L as a,R as _,u as t,K as w,j as B,Q as ne,T as g,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 n=d(!1),y=d([]),h=d([]),c=d({id:0}),E=d(0),u=d({bhoid:c.value.id,warehouse_id:"",remark:"",delivery_time:"",store_id:""}),L=()=>{oe(u.value).then(r=>{n.value=!1,v()})},I=()=>{n.value=!0,te({}).then(r=>{y.value=r.lists}),ue({}).then(r=>{h.value=r.lists})},k=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")},C=se({id:c.value.id}),{pager:p,getLists:v,resetParams:_e,resetPage:fe}=le({fetchFun:ae,params:C});function N(r,o){E.value=o.outbound_id,c.value.id=r,u.value.bhoid=r,C.id=r,v()}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 i(),b(g,null,[F("div",null,[l(m,{type:"primary",onClick:I},{default:a(()=>[_(" \u4E00\u952E\u51FA\u5E93 ")]),_:1}),l(m,{type:"primary",onClick:o[0]||(o[0]=e=>k(1))},{default:a(()=>[_(" \u6253\u5370\u91C7\u8D2D\u5355 ")]),_:1}),l(m,{type:"primary",onClick:o[1]||(o[1]=e=>k(4))},{default:a(()=>[_(" \u6253\u5370\u96F6\u552E\u5355 ")]),_:1}),l(M,{data:t(p).lists,border:"",style:{width:"100%","margin-top":"10px"}},{default:a(()=>[l(s,{prop:"id",label:"ID",width:"60"}),l(s,{label:"\u5546\u54C1\u56FE\u7247",prop:"image",width:"120"},{default:a(({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"]),F("div",de,[t(p).lists?(i(),w(S,{key:0,modelValue:t(p),"onUpdate:modelValue":o[2]||(o[2]=e=>B(p)?p.value=e:null),onChange:t(v)},null,8,["modelValue","onChange"])):ne("",!0)])]),l(R,{modelValue:t(n),"onUpdate:modelValue":o[8]||(o[8]=e=>B(n)?n.value=e:null),title:"\u51FA\u5E93\u5E93\u8BBE\u7F6E",width:"600"},{footer:a(()=>[F("div",ie,[l(m,{onClick:o[7]||(o[7]=e=>n.value=!1)},{default:a(()=>[_("\u53D6\u6D88")]),_:1}),l(m,{type:"primary",onClick:L},{default:a(()=>[_(" \u786E\u8BA4 ")]),_:1})])]),default:a(()=>[l($,{ref:"formRef",model:t(u),"label-width":"90px"},{default:a(()=>[l(f,{label:"\u4ED3\u5E93"},{default:a(()=>[l(D,{modelValue:t(u).warehouse_id,"onUpdate:modelValue":o[3]||(o[3]=e=>t(u).warehouse_id=e),placeholder:"\u8BF7\u9009\u62E9\u4ED3\u5E93",size:"large",style:{width:"240px"}},{default:a(()=>[(i(!0),b(g,null,A(t(y),e=>(i(),w(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:a(()=>[l(T,{readonly:!1,class:"flex-1 !flex",modelValue:t(u).delivery_time,"onUpdate:modelValue":o[4]||(o[4]=e=>t(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:a(()=>[l(D,{modelValue:t(u).store_id,"onUpdate:modelValue":o[5]||(o[5]=e=>t(u).store_id=e),placeholder:"\u8BF7\u9009\u62E9\u95E8\u5E97",size:"large",style:{width:"240px"}},{default:a(()=>[(i(!0),b(g,null,A(t(h),e=>(i(),w(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:a(()=>[l(Y,{modelValue:t(u).remark,"onUpdate:modelValue":o[6]||(o[6]=e=>t(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 _};
