import{F as x}from"./element-plus.8c800afc.js";import{P as R}from"./index.d0a14c5a.js";import{e as k,g as B,h as E}from"./opurchaseclass.ade5f034.js";import"./lodash.be6e4bb5.js";import{d as m,s as i,r as F,b,Z as p,o as O,c as A,U as d,L as g,u as n}from"./@vue.18505fe0.js";const P={class:"edit-popup"},j=m({name:"opurchaseclassEdit"}),Z=m({...j,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(L,{expose:f,emit:_}){const u=_,l=i(),a=i(),c=F("add"),h=b(()=>c.value=="edit"?"\u7F16\u8F91\u91C7\u8D2D\u8BA2\u5355":"\u65B0\u589E\u91C7\u8D2D\u8BA2\u5355"),t=p({id:""}),v=p({}),r=async s=>{for(const e in t)s[e]!=null&&s[e]!=null&&(t[e]=s[e])},D=async s=>{const e=await k({id:s.id});r(e)},w=async()=>{var e,o;await((e=l.value)==null?void 0:e.validate());const s={...t};c.value=="edit"?await B(s):await E(s),(o=a.value)==null||o.close(),u("success")},y=(s="add")=>{var e;c.value=s,(e=a.value)==null||e.open()},C=()=>{u("close")};return f({open:y,setFormData:r,getDetail:D}),(s,e)=>{const o=x;return O(),A("div",P,[d(R,{ref_key:"popupRef",ref:a,title:n(h),async:!0,width:"550px",onConfirm:w,onClose:C},{default:g(()=>[d(o,{ref_key:"formRef",ref:l,model:n(t),"label-width":"90px",rules:n(v)},null,8,["model","rules"])]),_:1},8,["title"])])}}});export{Z as _};
