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