import{C as w,D as g,F as x}from"./element-plus.4a7d92a3.js";import{P as R}from"./index.66d65d7d.js";import{f as k}from"./warehouse_order.15c88db0.js";import{f as U}from"./warehouse_product.892355e0.js";import"./lodash.9dc701ad.js";import{d as F,s as f,r as O,b as P,Z as _,o as q,c as A,U as a,L as r,u}from"./@vue.18505fe0.js";const I={class:"edit-popup"},W=F({name:"warehouseOrderEdit"}),G=F({...W,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(j,{expose:C,emit:E}){const p=E,m=f(),d=f(),i=O("add"),b=P(()=>i.value=="edit"?"\u7F16\u8F91\u5546\u54C1":"\u65B0\u589E\u5546\u54C1\u4ED3\u50A8\u8BA2\u5355"),o=_({id:"",oid:"",store_name:"",total_price:"",nums:"",purchase:""}),D=_({warehouse_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u4ED3\u5E93",trigger:["blur"]}],total_price:[{required:!0,message:"\u8BF7\u8F93\u5165\u603B\u4EF7\u683C",trigger:["blur"]}]}),c=async l=>{for(const e in o)l[e]!=null&&l[e]!=null&&(o[e]=l[e])},V=async l=>{const e=await k({id:l.id});c(e)},B=async()=>{var e,t;await((e=m.value)==null?void 0:e.validate());const l={...o};await U(l),(t=d.value)==null||t.close(),p("success")},h=(l="add")=>{var e;i.value=l,(e=d.value)==null||e.open()},y=()=>{p("close")};return C({open:h,setFormData:c,getDetail:V}),(l,e)=>{const t=w,n=g,v=x;return q(),A("div",I,[a(R,{ref_key:"popupRef",ref:d,title:u(b),async:!0,width:"550px",onConfirm:B,onClose:y},{default:r(()=>[a(v,{ref_key:"formRef",ref:m,model:u(o),"label-width":"90px",rules:u(D)},{default:r(()=>[a(n,{label:"\u5546\u54C1\u540D\u79F0",prop:"store_name"},{default:r(()=>[a(t,{modelValue:u(o).store_name,"onUpdate:modelValue":e[0]||(e[0]=s=>u(o).store_name=s),disabled:""},null,8,["modelValue"])]),_:1}),a(n,{label:"\u6570\u91CF",prop:"nums"},{default:r(()=>[a(t,{modelValue:u(o).nums,"onUpdate:modelValue":e[1]||(e[1]=s=>u(o).nums=s),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6570\u91CF",readonly:!1},null,8,["modelValue"])]),_:1}),a(n,{label:"\u91C7\u8D2D\u4EF7",prop:"purchase"},{default:r(()=>[a(t,{modelValue:u(o).purchase,"onUpdate:modelValue":e[2]||(e[2]=s=>u(o).purchase=s),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u91C7\u8D2D\u4EF7",readonly:!1},null,8,["modelValue"])]),_:1}),a(n,{label:"\u603B\u4EF7\u683C",prop:"total_price"},{default:r(()=>[a(t,{modelValue:u(o).total_price,"onUpdate:modelValue":e[3]||(e[3]=s=>u(o).total_price=s),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u603B\u4EF7\u683C",readonly:!1},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{G as _};
