import{G as U,H as A,C as q,D as I,F as T}from"./element-plus.4a7d92a3.js";import{P as G}from"./index.a19e7573.js";import{a as L,b as N,c as P}from"./delivery_service.1338c735.js";import{d as v,s as _,r as j,b as H,Z as F,o as p,c as D,U as t,L as s,u as l,T as K,a9 as O,K as Z,R as z,S as J}from"./@vue.18505fe0.js";import"./lodash.9dc701ad.js";const M={class:"edit-popup"},Q=v({name:"deliveryServiceEdit"}),ue=v({...Q,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(b,{expose:y,emit:B}){const m=B,c=_(),d=_(),i=j("add"),V=H(()=>i.value=="edit"?"\u7F16\u8F91\u914D\u9001\u5458\u8868":"\u65B0\u589E\u914D\u9001\u5458\u8868"),u=F({id:"",uid:"",nickname:"",phone:"",status:""}),g=F({uid:[{required:!0,message:"\u8BF7\u8F93\u5165\u914D\u9001\u5458uid",trigger:["blur"]}],nickname:[{required:!0,message:"\u8BF7\u8F93\u5165\u914D\u9001\u5458\u540D\u79F0",trigger:["blur"]}],phone:[{required:!0,message:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7\u7801",trigger:["blur"]}]}),f=async a=>{for(const e in u)a[e]!=null&&a[e]!=null&&(u[e]=a[e])},k=async a=>{const e=await L({id:a.id});f(e)},h=async()=>{var e,r;await((e=c.value)==null?void 0:e.validate());const a={...u};i.value=="edit"?await N(a):await P(a),(r=d.value)==null||r.close(),m("success")},E=(a="add")=>{var e;i.value=a,(e=d.value)==null||e.open()},w=()=>{m("close")};return y({open:E,setFormData:f,getDetail:k}),(a,e)=>{const r=q,n=I,R=U,x=A,S=T;return p(),D("div",M,[t(G,{ref_key:"popupRef",ref:d,title:l(V),async:!0,width:"550px",onConfirm:h,onClose:w},{default:s(()=>[t(S,{ref_key:"formRef",ref:c,model:l(u),"label-width":"90px",rules:l(g)},{default:s(()=>[t(n,{label:"\u914D\u9001\u5458uid",prop:"uid"},{default:s(()=>[t(r,{modelValue:l(u).uid,"onUpdate:modelValue":e[0]||(e[0]=o=>l(u).uid=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u914D\u9001\u5458uid",readonly:!1},null,8,["modelValue"])]),_:1}),t(n,{label:"\u914D\u9001\u5458\u540D\u79F0",prop:"nickname"},{default:s(()=>[t(r,{modelValue:l(u).nickname,"onUpdate:modelValue":e[1]||(e[1]=o=>l(u).nickname=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u914D\u9001\u5458\u540D\u79F0",readonly:!1},null,8,["modelValue"])]),_:1}),t(n,{label:"\u624B\u673A\u53F7\u7801",prop:"phone"},{default:s(()=>[t(r,{modelValue:l(u).phone,"onUpdate:modelValue":e[2]||(e[2]=o=>l(u).phone=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7\u7801",readonly:!1},null,8,["modelValue"])]),_:1}),t(n,{label:"\u72B6\u6001",prop:"status"},{default:s(()=>[t(x,{modelValue:l(u).status,"onUpdate:modelValue":e[3]||(e[3]=o=>l(u).status=o),placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",disabled:!1},{default:s(()=>[(p(!0),D(K,null,O(b.dictData.show_status,(o,C)=>(p(),Z(R,{key:C,label:parseInt(o.value)},{default:s(()=>[z(J(o.name),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{ue as _};
