import{k as c,w as N,G as U,b as I,H as T,C as $,D as O,F as R,L as j}from"./element-plus.8e273e86.js";import{_ as S}from"./index.vue_vue_type_script_setup_true_lang.d6032bc4.js";import{u as q}from"./usePaging.f8c888e4.js";import{k as G}from"./beforehand_order.9a0d8fd3.js";import{a as H}from"./warehouse_order.db2da615.js";import{b as K,a as M}from"./warehouse_product.00706cff.js";import{d as D,r as m,Z as Q,o as E,c as Z,a as F,U as o,L as t,R as f,u as a,K as z,j as g,Q as J,T as X}from"./@vue.76ce7aa3.js";const Y={class:"flex mt-4 justify-end"},ee={class:"dialog-footer"},oe=D({name:"subOrder"}),fe=D({...oe,setup(le,{expose:h}){const b=m({id:0}),_=m(0),n=m(!1),v=Q({id:b.value.id}),{pager:i,getLists:d,resetParams:te,resetPage:ae}=q({fetchFun:G,params:v}),V=()=>{_.value>0?H({id:_.value}).then(s=>{window.open(s.url,"_blank"),c.success("\u5BFC\u51FA\u6210\u529F")}):c.error("\u5165\u5E93id\u4E0D\u80FD\u4E3A\u7A7A")},r=m({id:"",store_name:"",nums:""}),x=s=>{K({id:s}).then(e=>{d()})},y=s=>{if(r.value.id<=0)return c.error("id\u4E0D\u80FD\u4E3A\u7A7A"),!1;M(r.value).then(e=>{n.value=!1,d()})};function k(s,e){b.value.id=s,v.id=s,d(),_.value=e}return h({getList:k}),(s,e)=>{const p=N,u=U,B=I,A=T,W=S,w=$,C=O,P=R,L=j;return E(),Z(X,null,[F("div",null,[o(p,{type:"primary",onClick:e[0]||(e[0]=l=>V())},{default:t(()=>e[6]||(e[6]=[f(" \u6253\u5370\u5165\u5E93\u5355 ")])),_:1}),o(A,{data:a(i).lists,border:"",style:{width:"100%","margin-top":"10px"}},{default:t(()=>[o(u,{prop:"id",label:"ID"}),o(u,{label:"\u4F9B\u5E94\u5546",prop:"supplier_name","show-overflow-tooltip":""}),o(u,{label:"\u5546\u54C1\u56FE\u7247",prop:"image",width:"120"},{default:t(({row:l})=>[o(B,{style:{width:"50px",height:"50px"},src:l.image,"preview-teleported":!0},null,8,["src"])]),_:1}),o(u,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","show-overflow-tooltip":""}),o(u,{label:"\u5355\u4F4D",prop:"unit_name","show-overflow-tooltip":""}),o(u,{label:"\u5165\u5E93\u6570\u91CF",prop:"nums","show-overflow-tooltip":""}),o(u,{label:"\u91C7\u8D2D\u4EF7",prop:"purchase","show-overflow-tooltip":""}),o(u,{label:"\u603B\u4EF7",prop:"total_price","show-overflow-tooltip":""}),o(u,{label:"\u64CD\u4F5C",fixed:"right"},{default:t(({row:l})=>[o(p,{type:"primary",link:"",onClick:ue=>x(l.id)},{default:t(()=>e[7]||(e[7]=[f("\u5220\u9664")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),F("div",Y,[a(i).lists?(E(),z(W,{key:0,modelValue:a(i),"onUpdate:modelValue":e[1]||(e[1]=l=>g(i)?i.value=l:null),onChange:a(d)},null,8,["modelValue","onChange"])):J("",!0)])]),o(L,{modelValue:a(n),"onUpdate:modelValue":e[5]||(e[5]=l=>g(n)?n.value=l:null),title:"\u91CD\u7F6E\u6570\u91CF",width:"600"},{footer:t(()=>[F("div",ee,[o(p,{onClick:e[4]||(e[4]=l=>n.value=!1)},{default:t(()=>e[8]||(e[8]=[f("\u53D6\u6D88")])),_:1}),o(p,{type:"primary",onClick:y},{default:t(()=>e[9]||(e[9]=[f(" \u786E\u8BA4 ")])),_:1})])]),default:t(()=>[o(P,{model:a(r),"label-width":"90px"},{default:t(()=>[o(C,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name"},{default:t(()=>[o(w,{modelValue:a(r).store_name,"onUpdate:modelValue":e[2]||(e[2]=l=>a(r).store_name=l),clearable:"",readonly:!1,disabled:""},null,8,["modelValue"])]),_:1}),o(C,{label:"\u6570\u91CF",prop:"nums"},{default:t(()=>[o(w,{modelValue:a(r).nums,"onUpdate:modelValue":e[3]||(e[3]=l=>a(r).nums=l),clearable:"",readonly:!1,placeholder:"\u8BF7\u8F93\u5165\u6570\u91CF"},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])],64)}}});export{fe as _};
