import{u as U}from"./useInstance.233fbdde.js";import{d as P,e as R,a as j}from"./maintenance.e221e847.js";import{o as I}from"./list.bf3a7bdf.js";import{A as M}from"./index.1d26a072.js";import{d as O,a6 as S,s as T,r as E,b as F,p as V,c as i,e as r,k as c,i as a,h as u,u as l,A as $,f as q,j as z,F as G,a2 as H,m as A,E as b}from"./index.0308b213.js";import"./install.524ae6f2.js";import"./useAgent.c0cb1751.js";import"./list.5526c7ef.js";const J=A("\u63D0\u4EA4"),K=A("\u53D6\u6D88"),oe=O({props:{modelValue:{type:Boolean,default:!1},id:null},emits:["update:modelValue","onClose"],setup(v,{emit:f}){const d=v,{OpPlatform:C}=S(),{global:h}=U();let k=T(()=>Number(d.id)>0);const m=E(!1),_=E(),t=F({id:"",agentid:"",deliveryer_ids:[]}),B=()=>{t.id>0?R(t).then(e=>{e.data&&(b({message:"\u7F16\u8F91\u9501\u63A7\u677F\u6210\u529F",type:"success"}),n())}):j(t).then(e=>{e.data&&(b({message:"\u65B0\u589E\u9501\u63A7\u677F\u6210\u529F",type:"success"}),n())})};V(()=>d.modelValue,e=>{m.value=e,e&&d.id&&(t.id=d.id,x())});const g=F({list:[]}),D=()=>{I({agentid:t.agentid}).then(e=>{console.log("rrrr",e),g.list=e})};V(()=>t.agentid,e=>{e&&D()},{immediate:!0});const x=()=>{P({id:d.id}).then(e=>{t.agentid=e.data.agentid,t.deliveryer_ids=e.data.deliveryer_ids})},n=()=>{f("update:modelValue",!1),f("onClose"),h.$resetForm(_.value,t)};return(e,s)=>{const p=i("el-form-item"),w=i("el-option"),N=i("el-select"),y=i("el-button"),L=i("el-dialog");return r(),c(L,{modelValue:m.value,"onUpdate:modelValue":s[2]||(s[2]=o=>m.value=o),title:l(k)?"\u67E5\u770B\u9501\u63A7\u677F\u4FE1\u606F":"\u65B0\u589E\u9501\u63A7\u677F\u4FE1\u606F",width:"70%","destroy-on-close":"",onClose:n},{default:a(()=>[u(l(H),{ref_key:"formRef",ref:_,model:l(t),"inline-message":!0,"label-width":"160px"},{default:a(()=>[l(C)==="shangpu"?(r(),c(p,{key:0,label:"\u6240\u5C5E\u4EE3\u7406"},{default:a(()=>[u(l(M),{modelValue:l(t).agentid,"onUpdate:modelValue":s[0]||(s[0]=o=>l(t).agentid=o)},null,8,["modelValue"])]),_:1})):$("",!0),u(p,{label:"\u7ED1\u5B9A\u914D\u9001\u5458","label-width":"140px"},{default:a(()=>[u(N,{modelValue:l(t).deliveryer_ids,"onUpdate:modelValue":s[1]||(s[1]=o=>l(t).deliveryer_ids=o),multiple:"",placeholder:"\u9009\u62E9\u914D\u9001\u5458",style:{width:"240px"},filterable:"",clearable:""},{default:a(()=>[(r(!0),q(G,null,z(l(g).list,o=>(r(),c(w,{key:o.id,label:o.title,value:o.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),u(p,null,{default:a(()=>[u(y,{type:"primary",onClick:B},{default:a(()=>[J]),_:1}),u(y,{onClick:n},{default:a(()=>[K]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue","title"])}}});export{oe as default};
