import{F as x}from"./element-plus.73c9e9a6.js";import{P as R}from"./index.fa58e261.js";import{a as b,b as k,c as B}from"./opurchaseclass.471d3d36.js";import"./lodash.403d4198.js";import{d as m,s as i,r as E,b as F,Z as p,o as O,c as A,U as d,L as P,u as n}from"./@vue.663bc523.js";const g={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(),o=i(),c=E("add"),h=F(()=>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 b({id:s.id});r(e)},w=async()=>{var e,a;await((e=l.value)==null?void 0:e.validate());const s={...t};c.value=="edit"?await k(s):await B(s),(a=o.value)==null||a.close(),u("success")},y=(s="add")=>{var e;c.value=s,(e=o.value)==null||e.open()},C=()=>{u("close")};return f({open:y,setFormData:r,getDetail:D}),(s,e)=>{const a=x;return O(),A("div",g,[d(R,{ref_key:"popupRef",ref:o,title:n(h),async:!0,width:"550px",onConfirm:w,onClose:C},{default:P(()=>[d(a,{ref_key:"formRef",ref:l,model:n(t),"label-width":"90px",rules:n(v)},null,8,["model","rules"])]),_:1},8,["title"])])}}});export{Z as _};
