import{a2 as P,V as $,_ as j,W as z,X as L,O as Q,w as S,Q as K,v as W,C as X,G as Z}from"./element-plus.8c800afc.js";import{_ as H}from"./index.vue_vue_type_script_setup_true_lang.7b224fce.js";import{u as J}from"./usePaging.6a6670f9.js";import{a as M,b as Y}from"./opurchaseclass.ade5f034.js";import{u as ee}from"./vue-router.886c5f5a.js";import{d as D,Z as oe,r as V,o as i,c as v,a as F,U as e,L as u,u as a,K as b,R as n,Q as g,j as w,S as _}from"./@vue.18505fe0.js";const ue={key:1},te={key:3,style:{color:"#e6a23c"}},le={class:"flex mt-4 justify-end"},ae={class:"dialog-footer"},se=D({name:"subOrder"}),Ee=D({...se,setup(ne,{expose:k}){const x=ee(),m=oe({id:x.query.id,is_adopt:""}),{pager:c,getLists:f,resetParams:ie,resetPage:pe}=J({fetchFun:Y,params:m});k({getLists:f});const A=d=>{m.is_adopt=d,f()},p=V(!1),t=V({id:"",type:0,notes:"",nums:0,q_nums:0}),y=(d,l)=>{if(t.value=Object.assign({id:"",type:l,notes:"",nums:0},d),l==0)return h();t.value.q_nums=d.nums,p.value=!0},h=()=>{M({id:t.value.id,type:t.value.type,notes:t.value.notes,nums:t.value.nums}).then(d=>{f(),p.value=!1})};return(d,l)=>{const C=P,O=$,s=Q,B=j,E=S,U=K,q=H,r=z,G=W,I=X,N=L,R=Z;return i(),v("div",null,[F("div",null,[e(O,{modelValue:a(m).is_adopt,"onUpdate:modelValue":l[0]||(l[0]=o=>a(m).is_adopt=o),size:"small",onChange:A},{default:u(()=>[e(C,{label:"\u5168\u90E8",value:""}),e(C,{label:"\u672A\u91C7\u7EB3",value:"0"}),e(C,{label:"\u5DF2\u91C7\u7EB3",value:"1"})]),_:1},8,["modelValue"])]),e(U,{data:a(c).lists,border:"",style:{width:"100%","margin-top":"10px"}},{default:u(()=>[e(s,{prop:"id",label:"ID",width:"120"}),e(s,{label:"\u5546\u54C1\u540D\u79F0",prop:"goods_name","show-overflow-tooltip":"",width:"220"}),e(s,{label:"\u9700\u6C42\u6570\u91CF",prop:"need_num","show-overflow-tooltip":"",width:"100"}),e(s,{label:"\u5355\u4F4D",prop:"unit_name",width:"80","show-overflow-tooltip":""}),e(s,{label:"\u4F9B\u5E94\u5546",prop:"supplier_name","show-overflow-tooltip":"",width:"160"}),e(s,{label:"\u63D0\u4F9B\u6570\u91CF",prop:"nums","show-overflow-tooltip":"",width:"100"}),e(s,{label:"\u62A5\u4EF7",prop:"price","show-overflow-tooltip":""}),e(s,{label:"\u662F\u5426\u91C7\u7EB3\u62A5\u4EF7",prop:"is_adopt",width:"120"},{default:u(({row:o})=>[o.is_adopt===1?(i(),b(B,{key:0,type:"success"},{default:u(()=>[n("\u5DF2\u91C7\u7EB3")]),_:1})):(i(),b(B,{key:1,type:"info"},{default:u(()=>[n("\u672A\u91C7\u7EB3")]),_:1}))]),_:1}),e(s,{label:"\u66F4\u65B0\u65F6\u95F4",prop:"update_time","show-overflow-tooltip":"",width:"160"}),e(s,{label:"\u64CD\u4F5C",fixed:"right"},{default:u(({row:o})=>[o.is_adopt===0&&o.price>0?(i(),b(E,{key:0,type:"primary",size:"small",onClick:T=>y(o,0)},{default:u(()=>[n("\u91C7\u7EB3")]),_:2},1032,["onClick"])):g("",!0),o.is_storage?(i(),v("span",ue,"\u5DF2\u5165\u5E93")):o.is_adopt===1&&o.price>0?(i(),b(E,{key:2,type:"success",size:"small",onClick:T=>y(o,1)},{default:u(()=>[n("\u5165\u5E93")]),_:2},1032,["onClick"])):g("",!0),o.is_adopt===0&&o.price==0?(i(),v("span",te,"\u7B49\u5F85\u4F9B\u5E94\u5546\u62A5\u4EF7")):g("",!0)]),_:1})]),_:1},8,["data"]),F("div",le,[e(q,{modelValue:a(c),"onUpdate:modelValue":l[1]||(l[1]=o=>w(c)?c.value=o:null),onChange:a(f)},null,8,["modelValue","onChange"])]),e(R,{modelValue:a(p),"onUpdate:modelValue":l[5]||(l[5]=o=>w(p)?p.value=o:null),title:"\u5165\u5E93",width:"600"},{footer:u(()=>[F("div",ae,[e(E,{onClick:l[4]||(l[4]=o=>p.value=!1)},{default:u(()=>[n("\u53D6\u6D88")]),_:1}),e(E,{type:"primary",onClick:h},{default:u(()=>[n(" \u786E\u8BA4 ")]),_:1})])]),default:u(()=>[e(N,{class:"margin-top",column:1,border:""},{default:u(()=>[e(r,{label:"\u4F9B\u5E94\u5546\u540D\u79F0"},{default:u(()=>[n(_(a(t).supplier_name),1)]),_:1}),e(r,{label:"\u5546\u54C1\u540D\u79F0"},{default:u(()=>[n(_(a(t).goods_name),1)]),_:1}),e(r,{label:"\u5546\u54C1\u62A5\u4EF7"},{default:u(()=>[n(" \xA5 "+_(a(t).price)+" / "+_(a(t).unit_name),1)]),_:1}),e(r,{label:"\u5E94\u5165\u5E93\u6570\u91CF"},{default:u(()=>[n(_(a(t).q_nums),1)]),_:1}),e(r,{label:"\u5B9E\u9645\u5165\u5E93\u6570\u91CF"},{default:u(()=>[e(G,{modelValue:a(t).nums,"onUpdate:modelValue":l[2]||(l[2]=o=>a(t).nums=o),step:1,min:1},null,8,["modelValue"])]),_:1}),e(r,{label:"\u5907\u6CE8"},{default:u(()=>[e(I,{modelValue:a(t).notes,"onUpdate:modelValue":l[3]||(l[3]=o=>a(t).notes=o),type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1},8,["modelValue"])])}}});export{Ee as _};
