import{C as w,D as h,F as x}from"./element-plus.8e273e86.js";import{_ as R}from"./picker.033744bc.js";import{P}from"./index.1c24829c.js";import{b as U,e as S}from"./store_branch_product.4417c602.js";import"./lodash.41b9567d.js";import{d as g,s as _,r as F,b as I,Z as f,o as j,c as L,U as r,L as s,u as t}from"./@vue.76ce7aa3.js";const N={class:"edit-popup"},O=g({name:"storeBranchProductEdit"}),K=g({...O,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(T,{expose:C,emit:B}){const m=B,d=_(),i=_(),p=F("add"),E=I(()=>p.value=="edit"?"\u91CD\u7F6E\u95E8\u5E97\u5E93\u5B58":"\u65B0\u589E\u95E8\u5E97\u5546\u54C1"),u=f({id:"",store_name:"",image:"",stock:"",sales:""}),b=f({cate_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u5546\u54C1\u5206\u7C7B",trigger:"blur"}],store_name:[{required:!0,message:"\u8BF7\u8F93\u5165\u95E8\u5E97\u540D\u79F0",trigger:"blur"}],image:[{required:!0,message:"\u8BF7\u8F93\u5165\u5546\u54C1\u56FE\u7247",trigger:"blur"}],price:[{required:!0,message:"\u8BF7\u8F93\u5165\u5546\u54C1\u4EF7\u683C",trigger:"blur"}],cost:[{required:!0,message:"\u8BF7\u8F93\u5165\u5546\u54C1\u6210\u672C",trigger:"blur"}],bar_code:[{required:!0,message:"\u8BF7\u8F93\u5165\u5546\u54C1\u6761\u7801",trigger:"blur"}],unit:[{required:!0,message:"\u8BF7\u8F93\u5165\u5546\u54C1\u5355\u4F4D",trigger:"blur"}],status:[{required:!0,message:"\u8BF7\u8F93\u5165\u5546\u54C1\u72B6\u6001",trigger:"blur"}]});F([]);const c=async o=>{for(const e in u)o[e]!=null&&o[e]!=null&&(u[e]=o[e])},V=async o=>{const e=await U({id:o.id});c(e)},k=async()=>{var e,l;await((e=d.value)==null?void 0:e.validate());const o={...u};await S(o),(l=i.value)==null||l.close(),m("success")},D=(o="add")=>{var e;p.value=o,(e=i.value)==null||e.open()},v=()=>{m("close")};return C({open:D,setFormData:c,getDetail:V}),(o,e)=>{const l=w,n=h,q=R,y=x;return j(),L("div",N,[r(P,{ref_key:"popupRef",ref:i,title:t(E),async:!0,width:"550px",onConfirm:k,onClose:v},{default:s(()=>[r(y,{ref_key:"formRef",ref:d,model:t(u),"label-width":"90px",rules:t(b)},{default:s(()=>[r(n,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name"},{default:s(()=>[r(l,{modelValue:t(u).store_name,"onUpdate:modelValue":e[0]||(e[0]=a=>t(u).store_name=a),placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0"},null,8,["modelValue"])]),_:1}),r(n,{label:"\u5546\u54C1\u56FE\u7247",prop:"image"},{default:s(()=>[r(q,{modelValue:t(u).image,"onUpdate:modelValue":e[1]||(e[1]=a=>t(u).image=a),limit:1},null,8,["modelValue"])]),_:1}),r(n,{label:"\u5546\u54C1\u5E93\u5B58",prop:"stock"},{default:s(()=>[r(l,{modelValue:t(u).stock,"onUpdate:modelValue":e[2]||(e[2]=a=>t(u).stock=a),placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u5E93\u5B58"},null,8,["modelValue"])]),_:1}),r(n,{label:"\u5546\u54C1\u9500\u91CF",prop:"sales"},{default:s(()=>[r(l,{modelValue:t(u).sales,"onUpdate:modelValue":e[3]||(e[3]=a=>t(u).sales=a),placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1\u9500\u91CF"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{K as _};
