import{C as w,D as V,F as A}from"./element-plus.a63a26dd.js";import{P as x}from"./index.c69e7fd7.js";import{f as R,g as k,h as O}from"./warehouse_order.e72dd6ae.js";import"./lodash.2473fc51.js";import{d as F,s as _,r as U,b as q,Z as f,o as W,c as I,U as a,L as s,u as o}from"./@vue.18505fe0.js";const P={class:"edit-popup"},j=F({name:"warehouseOrderEdit"}),G=F({...j,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(L,{expose:D,emit:g}){const i=g,m=_(),n=_(),d=U("add"),B=q(()=>d.value=="edit"?"\u7F16\u8F91\u5546\u54C1\u4ED3\u50A8\u8BA2\u5355":"\u65B0\u589E\u5546\u54C1\u4ED3\u50A8\u8BA2\u5355"),t=f({id:"",total_price:"",outstanding_amount:"",completed_amount:""}),E=f({warehouse_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u4ED3\u5E93",trigger:["blur"]}],batch:[{required:!0,message:"\u8BF7\u8F93\u5165\u6279\u6B21",trigger:["blur"]}],total_price:[{required:!0,message:"\u8BF7\u8F93\u5165\u603B\u4EF7\u683C",trigger:["blur"]}],status:[{required:!0,message:"\u8BF7\u8F93\u5165\u72B6\u6001",trigger:["blur"]}]}),c=async u=>{for(const e in t)u[e]!=null&&u[e]!=null&&(t[e]=u[e])},b=async u=>{const e=await R({id:u.id});c(e)},h=async()=>{var e,l;await((e=m.value)==null?void 0:e.validate());const u={...t};d.value=="edit"?await k(u):await O(u),(l=n.value)==null||l.close(),i("success")},C=(u="add")=>{var e;d.value=u,(e=n.value)==null||e.open()},y=()=>{i("close")};return D({open:C,setFormData:c,getDetail:b}),(u,e)=>{const l=w,p=V,v=A;return W(),I("div",P,[a(x,{ref_key:"popupRef",ref:n,title:o(B),async:!0,width:"550px",onConfirm:h,onClose:y},{default:s(()=>[a(v,{ref_key:"formRef",ref:m,model:o(t),"label-width":"90px",rules:o(E)},{default:s(()=>[a(p,{label:"\u5DF2\u7ED3\u91D1\u989D",prop:"completed_amount"},{default:s(()=>[a(l,{modelValue:o(t).completed_amount,"onUpdate:modelValue":e[0]||(e[0]=r=>o(t).completed_amount=r),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u603B\u4EF7\u683C",readonly:!1},null,8,["modelValue"])]),_:1}),a(p,{label:"\u672A\u7ED3\u91D1\u989D",prop:"outstanding_amount"},{default:s(()=>[a(l,{modelValue:o(t).outstanding_amount,"onUpdate:modelValue":e[1]||(e[1]=r=>o(t).outstanding_amount=r),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u672A\u7ED3\u91D1\u989D",readonly:!1},null,8,["modelValue"])]),_:1}),a(p,{label:"\u603B\u4EF7\u683C",prop:"total_price"},{default:s(()=>[a(l,{modelValue:o(t).total_price,"onUpdate:modelValue":e[2]||(e[2]=r=>o(t).total_price=r),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u603B\u4EF7\u683C",readonly:!1},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{G as _};
