import{a3 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.bccb9376.js";import{_ as H}from"./index.vue_vue_type_script_setup_true_lang.120de7ce.js";import{u as J}from"./usePaging.6a6670f9.js";import{a as M,b as Y}from"./opurchaseclass.4d142976.js";import{u as ee}from"./vue-router.101084e3.js";import{d as k,Z as oe,r as V,o as i,c as F,a as g,U as e,L as u,u as t,K as m,R as n,Q as C,j as w,S as c}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=k({name:"subOrder"}),Ee=k({...se,setup(ne,{expose:D}){const x=ee(),f=oe({id:x.query.id,is_adopt:"",is_mer:1}),{pager:_,getLists:E,resetParams:ie,resetPage:pe}=J({fetchFun:Y,params:f});D({getLists:E});const A=d=>{f.is_adopt=d,E()},p=V(!1),l=V({id:"",type:0,notes:"",nums:0,q_nums:0}),y=(d,a)=>{if(l.value=Object.assign({id:"",type:a,notes:"",nums:0},d),a==0)return h();l.value.q_nums=d.nums,p.value=!0},h=()=>{M({id:l.value.id,type:l.value.type,notes:l.value.notes,nums:l.value.nums}).then(d=>{E(),p.value=!1})};return(d,a)=>{const v=P,O=$,s=Q,B=j,b=S,U=K,q=H,r=z,G=W,I=X,N=L,R=Z;return i(),F("div",null,[g("div",null,[e(O,{modelValue:t(f).is_adopt,"onUpdate:modelValue":a[0]||(a[0]=o=>t(f).is_adopt=o),size:"small",onChange:A},{default:u(()=>[e(v,{label:"\u5168\u90E8",value:""}),e(v,{label:"\u672A\u91C7\u7EB3",value:"0"}),e(v,{label:"\u5DF2\u91C7\u7EB3",value:"1"})]),_:1},8,["modelValue"])]),e(U,{data:t(_).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(),m(B,{key:0,type:"success"},{default:u(()=>[n("\u5DF2\u91C7\u7EB3")]),_:1})):(i(),m(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(),m(b,{key:0,type:"primary",size:"small",onClick:T=>y(o,0)},{default:u(()=>[n("\u91C7\u7EB3")]),_:2},1032,["onClick"])):C("",!0),o.is_storage?(i(),F("span",ue,"\u5DF2\u5165\u5E93")):o.is_adopt===1&&o.price>0?(i(),m(b,{key:2,type:"success",size:"small",onClick:T=>y(o,1)},{default:u(()=>[n("\u5165\u5E93")]),_:2},1032,["onClick"])):C("",!0),o.is_adopt===0&&o.price==0?(i(),F("span",te,"\u7B49\u5F85\u4F9B\u5E94\u5546\u62A5\u4EF7")):C("",!0)]),_:1})]),_:1},8,["data"]),g("div",le,[t(_).lists?(i(),m(q,{key:0,modelValue:t(_),"onUpdate:modelValue":a[1]||(a[1]=o=>w(_)?_.value=o:null),onChange:t(E)},null,8,["modelValue","onChange"])):C("",!0)]),e(R,{modelValue:t(p),"onUpdate:modelValue":a[5]||(a[5]=o=>w(p)?p.value=o:null),title:"\u5165\u5E93",width:"600"},{footer:u(()=>[g("div",ae,[e(b,{onClick:a[4]||(a[4]=o=>p.value=!1)},{default:u(()=>[n("\u53D6\u6D88")]),_:1}),e(b,{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(c(t(l).supplier_name),1)]),_:1}),e(r,{label:"\u5546\u54C1\u540D\u79F0"},{default:u(()=>[n(c(t(l).goods_name),1)]),_:1}),e(r,{label:"\u5546\u54C1\u62A5\u4EF7"},{default:u(()=>[n(" \xA5 "+c(t(l).price)+" / "+c(t(l).unit_name),1)]),_:1}),e(r,{label:"\u5E94\u5165\u5E93\u6570\u91CF"},{default:u(()=>[n(c(t(l).q_nums),1)]),_:1}),e(r,{label:"\u5B9E\u9645\u5165\u5E93\u6570\u91CF"},{default:u(()=>[e(G,{modelValue:t(l).nums,"onUpdate:modelValue":a[2]||(a[2]=o=>t(l).nums=o),step:1,min:1},null,8,["modelValue"])]),_:1}),e(r,{label:"\u5907\u6CE8"},{default:u(()=>[e(I,{modelValue:t(l).notes,"onUpdate:modelValue":a[3]||(a[3]=o=>t(l).notes=o),type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1},8,["modelValue"])])}}});export{Ee as _};
