import{C as S,D as x,F as D}from"./element-plus.8e273e86.js";import{P}from"./index.1c24829c.js";import{a as R,b as h,c as L}from"./store_product_low_stock.b23f9e46.js";import"./lodash.41b9567d.js";import{d as F,s as f,r as U,b as A,Z as _,o as I,c as g,U as u,L as d,u as a}from"./@vue.76ce7aa3.js";const j={class:"edit-popup"},N=F({name:"storeProductLowStockEdit"}),H=F({...N,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(O,{expose:E,emit:w}){const i=w,c=f(),r=f(),n=U("add"),b=A(()=>n.value=="edit"?"\u7F16\u8F91\u5546\u54C1\u7F3A\u5E93\u5B58\u8868":"\u65B0\u589E\u5546\u54C1\u7F3A\u5E93\u5B58\u8868"),t=_({id:"",product_id:"",store_id:"",status:""}),y=_({}),m=async o=>{for(const e in t)o[e]!=null&&o[e]!=null&&(t[e]=o[e])},v=async o=>{const e=await R({id:o.id});m(e)},B=async()=>{var e,l;await((e=c.value)==null?void 0:e.validate());const o={...t};n.value=="edit"?await h(o):await L(o),(l=r.value)==null||l.close(),i("success")},C=(o="add")=>{var e;n.value=o,(e=r.value)==null||e.open()},V=()=>{i("close")};return E({open:C,setFormData:m,getDetail:v}),(o,e)=>{const l=S,p=x,k=D;return I(),g("div",j,[u(P,{ref_key:"popupRef",ref:r,title:a(b),async:!0,width:"550px",onConfirm:B,onClose:V},{default:d(()=>[u(k,{ref_key:"formRef",ref:c,model:a(t),"label-width":"90px",rules:a(y)},{default:d(()=>[u(p,{label:"\u5546\u54C1id",prop:"product_id"},{default:d(()=>[u(l,{modelValue:a(t).product_id,"onUpdate:modelValue":e[0]||(e[0]=s=>a(t).product_id=s),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1id",readonly:!1},null,8,["modelValue"])]),_:1}),u(p,{label:"\u95E8\u5E97id",prop:"store_id"},{default:d(()=>[u(l,{modelValue:a(t).store_id,"onUpdate:modelValue":e[1]||(e[1]=s=>a(t).store_id=s),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u95E8\u5E97id",readonly:!1},null,8,["modelValue"])]),_:1}),u(p,{label:"\u72B6\u6001",prop:"status"},{default:d(()=>[u(l,{modelValue:a(t).status,"onUpdate:modelValue":e[2]||(e[2]=s=>a(t).status=s),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u72B6\u6001",readonly:!1},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{H as _};
