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