import{M as q,b as K,w as W,N as J,J as M,K as Q,D as Z,C as G,F as H,I as X}from"./element-plus.4a7d92a3.js";import{_ as Y}from"./index.vue_vue_type_script_setup_true_lang.5d4e738c.js";import{u as ee}from"./usePaging.6a6670f9.js";import{e as E,c as oe}from"./purchase_product_offer.799fbf52.js";import{u as le}from"./vue-router.101084e3.js";import{e as te}from"./delivery_service.1338c735.js";import{_ as ue}from"./warehouseEdit.vue_vue_type_script_setup_true_name_warehouseProductEdit_lang.be739a12.js";import{d as V,s as ae,Z as se,r as f,o as r,c as d,U as o,L as u,R as c,a as C,S as D,u as a,K as g,j as F,Q as B,T as ne,a9 as re,n as ie}from"./@vue.18505fe0.js";const de={key:0},pe={key:1},_e=["onClick"],me={key:1},ce={class:"flex mt-4 justify-end"},fe={class:"dialog-footer"},ye=V({name:"subOrder"}),Ve=V({...ye,setup(be,{expose:x}){const y=ae(),P=le(),$=se({order_id:P.query.id,is_adopt:"",is_mer:1}),{pager:p,getLists:_,resetParams:ve,resetPage:he}=ee({fetchFun:oe,params:$});x({getLists:_});const b=f(!1),i=f(!1),n=f({id:"",type:"",is_buyer:"",buyer_id:"",buyer_nums:""}),R=async s=>{var l,t;console.log(s),b.value=!0,await ie(),(l=y.value)==null||l.open("edit"),s.nums=s.buyer_nums,s.purchase=s.price,(t=y.value)==null||t.setFormData(s)},S=()=>{E(n.value).then(s=>{_(),i.value=!1})},w=f([]),I=()=>{te({type:3}).then(s=>{w.value=s.lists})},v=(s,l)=>{s==1?(n.value.id=l.id,n.value.buyer_nums=l.need_num,n.value.is_buyer="1",n.value.type="buyer",I(),i.value=!0):E({id:l.id,type:"buyer",is_buyer:-1}).then(t=>{_()})};return(s,l)=>{const t=q,U=K,m=W,L=J,N=Y,O=M,T=Q,k=Z,A=G,z=H,j=X;return r(),d("div",null,[o(L,{data:a(p).lists,border:"",style:{width:"100%","margin-top":"10px"}},{default:u(()=>[o(t,{prop:"id",label:"ID",width:"60"}),o(t,{label:"\u5546\u54C1\u56FE\u7247",prop:"image",width:"120"},{default:u(({row:e})=>[o(U,{style:{width:"50px",height:"50px"},src:e.image,"preview-teleported":!0},null,8,["src"])]),_:1}),o(t,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name","show-overflow-tooltip":"",width:"120"}),o(t,{label:"\u5355\u4F4D",prop:"unit_name",width:"80","show-overflow-tooltip":""}),o(t,{label:"\u9700\u6C42\u6570\u91CF",prop:"need_num","show-overflow-tooltip":"",width:"100"}),o(t,{label:"\u4F9B\u5E94\u5546",prop:"supplier_name","show-overflow-tooltip":"",width:"100"}),o(t,{label:"\u91C7\u8D2D\u6570\u91CF",prop:"buyer_nums","show-overflow-tooltip":"",width:"100"}),o(t,{label:"\u662F\u5426\u9700\u91C7\u8D2D",prop:"is_buyer","show-overflow-tooltip":"",width:"100"},{default:u(({row:e})=>[e.is_buyer==0?(r(),d("div",de,[o(m,{type:"danger",round:"",size:"small",onClick:h=>v(-1,e)},{default:u(()=>[c("\u5426")]),_:2},1032,["onClick"]),o(m,{type:"success",round:"",size:"small",onClick:h=>v(1,e)},{default:u(()=>[c("\u662F")]),_:2},1032,["onClick"])])):(r(),d("div",pe,[C("span",null,D(e.is_buyer_name),1)]))]),_:1}),o(t,{label:"\u91C7\u8D2D\u4EBA\u5458",prop:"buyer_name","show-overflow-tooltip":"",width:"100"},{default:u(({row:e})=>[e.buyer_confirm==0?(r(),d("span",{key:0,onClick:h=>v(1,e),style:{color:"#67c23a",cursor:"pointer"}},D(e.buyer_name),9,_e)):(r(),d("span",me,D(e.buyer_name),1))]),_:1}),o(t,{label:"\u91C7\u8D2D\u72B6\u6001",prop:"buyer_confirm_name","show-overflow-tooltip":"",width:"100"}),o(t,{label:"\u662F\u5426\u5165\u5E93",prop:"is_storage_name","show-overflow-tooltip":"",width:"100"}),o(t,{label:"\u64CD\u4F5C",fixed:"right"},{default:u(({row:e})=>[o(m,{type:"primary",link:"",onClick:h=>R(e)},{default:u(()=>[c(" \u5165\u5E93 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),C("div",ce,[a(p).lists?(r(),g(N,{key:0,modelValue:a(p),"onUpdate:modelValue":l[0]||(l[0]=e=>F(p)?p.value=e:null),onChange:a(_)},null,8,["modelValue","onChange"])):B("",!0)]),o(j,{modelValue:a(i),"onUpdate:modelValue":l[4]||(l[4]=e=>F(i)?i.value=e:null),title:"\u8BBE\u7F6E\u91C7\u8D2D",width:"600"},{footer:u(()=>[C("div",fe,[o(m,{onClick:l[3]||(l[3]=e=>i.value=!1)},{default:u(()=>[c("\u53D6\u6D88")]),_:1}),o(m,{type:"primary",onClick:S},{default:u(()=>[c(" \u786E\u8BA4 ")]),_:1})])]),default:u(()=>[o(z,{ref:"formRef",model:a(n),"label-width":"90px"},{default:u(()=>[o(k,{label:"\u91C7\u8D2D\u4EBA\u5458"},{default:u(()=>[o(T,{modelValue:a(n).buyer_id,"onUpdate:modelValue":l[1]||(l[1]=e=>a(n).buyer_id=e),placeholder:"\u8BF7\u9009\u62E9\u91C7\u8D2D\u4EBA\u5458",size:"large",style:{width:"240px"}},{default:u(()=>[(r(!0),d(ne,null,re(a(w),e=>(r(),g(O,{label:e.nickname,value:e.uid},null,8,["label","value"]))),256))]),_:1},8,["modelValue"])]),_:1}),o(k,{label:"\u91C7\u8D2D\u6570\u91CF",prop:"buyer_nums"},{default:u(()=>[o(A,{modelValue:a(n).buyer_nums,"onUpdate:modelValue":l[2]||(l[2]=e=>a(n).buyer_nums=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u91C7\u8D2D\u6570\u91CF",readonly:!1},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"]),a(b)?(r(),g(ue,{key:0,ref_key:"warehouseRef",ref:y,onSuccess:a(_),onClose:l[5]||(l[5]=e=>b.value=!1)},null,8,["onSuccess"])):B("",!0)])}}});export{Ve as _};
