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