import{C as x,D as R,F as k}from"./element-plus.a63a26dd.js";import{P as U}from"./index.da3823b2.js";import{a as h,b as B,c as S}from"./store_product_price.d18b86ad.js";import"./lodash.2473fc51.js";import{d as F,s as f,r as I,b as g,Z as _,o as j,c as A,U as l,L as r,u as t}from"./@vue.18505fe0.js";const L={class:"edit-popup"},N=F({name:"storeProductPriceEdit"}),H=F({...N,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(O,{expose:b,emit:E}){const c=E,i=f(),d=f(),p=I("add"),V=g(()=>p.value=="edit"?"\u7F16\u8F91\u5546\u54C1\u4EF7\u683C\u66F4\u6539":"\u65B0\u589E\u5546\u54C1\u4EF7\u683C\u66F4\u6539"),o=_({id:"",store_name:"",purchase:"",cost:"",price:""}),y=_({}),m=async a=>{for(const e in o)a[e]!=null&&a[e]!=null&&(o[e]=a[e])},C=async a=>{const e=await h({id:a.id});m(e)},v=async()=>{var e,u;await((e=i.value)==null?void 0:e.validate());const a={...o};p.value=="edit"?await B(a):await S(a),(u=d.value)==null||u.close(),c("success")},P=(a="add")=>{var e;p.value=a,(e=d.value)==null||e.open()},w=()=>{c("close")};return b({open:P,setFormData:m,getDetail:C}),(a,e)=>{const u=x,n=R,D=k;return j(),A("div",L,[l(U,{ref_key:"popupRef",ref:d,title:t(V),async:!0,width:"550px",onConfirm:v,onClose:w},{default:r(()=>[l(D,{ref_key:"formRef",ref:i,model:t(o),"label-width":"90px",rules:t(y)},{default:r(()=>[l(n,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name"},{default:r(()=>[l(u,{modelValue:t(o).store_name,"onUpdate:modelValue":e[0]||(e[0]=s=>t(o).store_name=s),clearable:"",readonly:!1,disabled:""},null,8,["modelValue"])]),_:1}),l(n,{label:"\u4F9B\u8D27\u4EF7",prop:"purchase"},{default:r(()=>[l(u,{modelValue:t(o).purchase,"onUpdate:modelValue":e[1]||(e[1]=s=>t(o).purchase=s),clearable:"",readonly:!1},null,8,["modelValue"])]),_:1}),l(n,{label:"\u5546\u6237\u4EF7",prop:"cost"},{default:r(()=>[l(u,{modelValue:t(o).cost,"onUpdate:modelValue":e[2]||(e[2]=s=>t(o).cost=s),clearable:"",readonly:!1},null,8,["modelValue"])]),_:1}),l(n,{label:"\u96F6\u552E\u4EF7",prop:"price"},{default:r(()=>[l(u,{modelValue:t(o).price,"onUpdate:modelValue":e[3]||(e[3]=s=>t(o).price=s),clearable:"",readonly:!1},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{H as _};
