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