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