import{C as w,D as g,F as x}from"./element-plus.73c9e9a6.js";import{P as R}from"./index.fa58e261.js";import{b as k,c as A,d as W}from"./warehouse.72d94fe4.js";import"./lodash.403d4198.js";import{d as c,s as E,r as h,b as q,Z as f,o as I,c as P,U as a,L as d,u as l}from"./@vue.663bc523.js";const j={class:"edit-popup"},L=c({name:"warehouseEdit"}),G=c({...L,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(N,{expose:b,emit:V}){const m=V,F=E(),n=E(),s=h("add"),B=q(()=>s.value=="edit"?"\u7F16\u8F91\u4ED3\u5E93\u4FE1\u606F\u8868":"\u65B0\u589E\u4ED3\u5E93\u4FE1\u606F\u8868"),u=f({id:"",name:"",py:"",dept_id:"",number:"",contacts:"",tel:"",add:"",data:"",more:"",sort:""}),D=f({name:[{required:!0,message:"\u8BF7\u8F93\u5165\u4ED3\u5E93\u540D\u79F0",trigger:["blur"]}],py:[{required:!0,message:"\u8BF7\u8F93\u5165\u9996\u62FC\u4FE1\u606F",trigger:["blur"]}]}),i=async r=>{for(const e in u)r[e]!=null&&r[e]!=null&&(u[e]=r[e])},C=async r=>{const e=await k({id:r.id});i(e)},_=async()=>{var e,t;await((e=F.value)==null?void 0:e.validate());const r={...u};s.value=="edit"?await A(r):await W(r),(t=n.value)==null||t.close(),m("success")},y=(r="add")=>{var e;s.value=r,(e=n.value)==null||e.open()},U=()=>{m("close")};return b({open:y,setFormData:i,getDetail:C}),(r,e)=>{const t=w,p=g,v=x;return I(),P("div",j,[a(R,{ref_key:"popupRef",ref:n,title:l(B),async:!0,width:"550px",onConfirm:_,onClose:U},{default:d(()=>[a(v,{ref_key:"formRef",ref:F,model:l(u),"label-width":"90px",rules:l(D)},{default:d(()=>[a(p,{label:"\u4ED3\u5E93\u540D\u79F0",prop:"name"},{default:d(()=>[a(t,{modelValue:l(u).name,"onUpdate:modelValue":e[0]||(e[0]=o=>l(u).name=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4ED3\u5E93\u540D\u79F0"},null,8,["modelValue"])]),_:1}),a(p,{label:"\u9996\u62FC\u4FE1\u606F",prop:"py"},{default:d(()=>[a(t,{modelValue:l(u).py,"onUpdate:modelValue":e[1]||(e[1]=o=>l(u).py=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u9996\u62FC\u4FE1\u606F"},null,8,["modelValue"])]),_:1}),a(p,{label:"\u7EC4\u7EC7\u67B6\u6784",prop:"dept_id"},{default:d(()=>[a(t,{modelValue:l(u).dept_id,"onUpdate:modelValue":e[2]||(e[2]=o=>l(u).dept_id=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7EC4\u7EC7\u67B6\u6784"},null,8,["modelValue"])]),_:1}),a(p,{label:"\u4ED3\u5E93\u7F16\u53F7",prop:"number"},{default:d(()=>[a(t,{modelValue:l(u).number,"onUpdate:modelValue":e[3]||(e[3]=o=>l(u).number=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4ED3\u5E93\u7F16\u53F7"},null,8,["modelValue"])]),_:1}),a(p,{label:"\u8054\u7CFB\u4EBA\u5458",prop:"contacts"},{default:d(()=>[a(t,{modelValue:l(u).contacts,"onUpdate:modelValue":e[4]||(e[4]=o=>l(u).contacts=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8054\u7CFB\u4EBA\u5458"},null,8,["modelValue"])]),_:1}),a(p,{label:"\u8054\u7CFB\u7535\u8BDD",prop:"tel"},{default:d(()=>[a(t,{modelValue:l(u).tel,"onUpdate:modelValue":e[5]||(e[5]=o=>l(u).tel=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8054\u7CFB\u7535\u8BDD"},null,8,["modelValue"])]),_:1}),a(p,{label:"\u4ED3\u5E93\u5730\u5740",prop:"add"},{default:d(()=>[a(t,{modelValue:l(u).add,"onUpdate:modelValue":e[6]||(e[6]=o=>l(u).add=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4ED3\u5E93\u5730\u5740"},null,8,["modelValue"])]),_:1}),a(p,{label:"\u5907\u6CE8\u4FE1\u606F",prop:"data"},{default:d(()=>[a(t,{modelValue:l(u).data,"onUpdate:modelValue":e[7]||(e[7]=o=>l(u).data=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8\u4FE1\u606F"},null,8,["modelValue"])]),_:1}),a(p,{label:"\u6269\u5C55\u4FE1\u606F",prop:"more"},{default:d(()=>[a(t,{modelValue:l(u).more,"onUpdate:modelValue":e[8]||(e[8]=o=>l(u).more=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6269\u5C55\u4FE1\u606F"},null,8,["modelValue"])]),_:1}),a(p,{label:"\u6392\u5E8F",prop:"sort"},{default:d(()=>[a(t,{modelValue:l(u).sort,"onUpdate:modelValue":e[9]||(e[9]=o=>l(u).sort=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6392\u5E8F"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{G as _};
