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