import{C as D,D as U,F as v}from"./element-plus.4a7d92a3.js";import{P as k}from"./index.64cadcce.js";import{e as A,b as x,f as R}from"./warehouse_order.5fc43277.js";import"./lodash.9dc701ad.js";import{d as _,s as F,r as O,b as q,Z as c,o as W,c as I,U as a,L as d,u as l}from"./@vue.18505fe0.js";const P={class:"edit-popup"},j=_({name:"warehouseOrderEdit"}),G=_({...j,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(L,{expose:B,emit:b}){const i=b,m=F(),p=F(),n=O("add"),V=q(()=>n.value=="edit"?"\u7F16\u8F91\u5546\u54C1\u4ED3\u50A8\u8BA2\u5355":"\u65B0\u589E\u5546\u54C1\u4ED3\u50A8\u8BA2\u5355"),u=c({id:"",warehouse_id:"",supplier_id:"",store_id:"",code:"",financial_pm:"",admin_id:"",batch:"",mark:"",purchase:"",total_price:"",status:""}),E=c({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"]}]}),f=async t=>{for(const e in u)t[e]!=null&&t[e]!=null&&(u[e]=t[e])},y=async t=>{const e=await A({id:t.id});f(e)},h=async()=>{var e,r;await((e=m.value)==null?void 0:e.validate());const t={...u};n.value=="edit"?await x(t):await R(t),(r=p.value)==null||r.close(),i("success")},w=(t="add")=>{var e;n.value=t,(e=p.value)==null||e.open()},g=()=>{i("close")};return B({open:w,setFormData:f,getDetail:y}),(t,e)=>{const r=D,s=U,C=v;return W(),I("div",P,[a(k,{ref_key:"popupRef",ref:p,title:l(V),async:!0,width:"550px",onConfirm:h,onClose:g},{default:d(()=>[a(C,{ref_key:"formRef",ref:m,model:l(u),"label-width":"90px",rules:l(E)},{default:d(()=>[a(s,{label:"\u4ED3\u5E93",prop:"warehouse_id"},{default:d(()=>[a(r,{modelValue:l(u).warehouse_id,"onUpdate:modelValue":e[0]||(e[0]=o=>l(u).warehouse_id=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4ED3\u5E93",readonly:!1},null,8,["modelValue"])]),_:1}),a(s,{label:"\u4F9B\u5E94\u5546",prop:"supplier_id"},{default:d(()=>[a(r,{modelValue:l(u).supplier_id,"onUpdate:modelValue":e[1]||(e[1]=o=>l(u).supplier_id=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4F9B\u5E94\u5546",readonly:!1},null,8,["modelValue"])]),_:1}),a(s,{label:"\u95E8\u5E97",prop:"store_id"},{default:d(()=>[a(r,{modelValue:l(u).store_id,"onUpdate:modelValue":e[2]||(e[2]=o=>l(u).store_id=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u95E8\u5E97",readonly:!1},null,8,["modelValue"])]),_:1}),a(s,{label:"\u5355\u53F7",prop:"code"},{default:d(()=>[a(r,{modelValue:l(u).code,"onUpdate:modelValue":e[3]||(e[3]=o=>l(u).code=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5355\u53F7",readonly:!1},null,8,["modelValue"])]),_:1}),a(s,{label:"0 = \u51FA\u5E93 1 = \u83B7\u5F97",prop:"financial_pm"},{default:d(()=>[a(r,{modelValue:l(u).financial_pm,"onUpdate:modelValue":e[4]||(e[4]=o=>l(u).financial_pm=o),clearable:"",placeholder:"\u8BF7\u8F93\u51650 = \u51FA\u5E93 1 = \u83B7\u5F97",readonly:!1},null,8,["modelValue"])]),_:1}),a(s,{label:"\u586B\u5199\u4EBA\u5458",prop:"admin_id"},{default:d(()=>[a(r,{modelValue:l(u).admin_id,"onUpdate:modelValue":e[5]||(e[5]=o=>l(u).admin_id=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u586B\u5199\u4EBA\u5458",readonly:!1},null,8,["modelValue"])]),_:1}),a(s,{label:"\u6279\u6B21",prop:"batch"},{default:d(()=>[a(r,{modelValue:l(u).batch,"onUpdate:modelValue":e[6]||(e[6]=o=>l(u).batch=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6279\u6B21",readonly:!1},null,8,["modelValue"])]),_:1}),a(s,{label:"\u5907\u6CE8",prop:"mark"},{default:d(()=>[a(r,{modelValue:l(u).mark,"onUpdate:modelValue":e[7]||(e[7]=o=>l(u).mark=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8",readonly:!1},null,8,["modelValue"])]),_:1}),a(s,{label:"\u4F9B\u8D27\u4EF7",prop:"purchase"},{default:d(()=>[a(r,{modelValue:l(u).purchase,"onUpdate:modelValue":e[8]||(e[8]=o=>l(u).purchase=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4F9B\u8D27\u4EF7",readonly:!1},null,8,["modelValue"])]),_:1}),a(s,{label:"\u603B\u4EF7\u683C",prop:"total_price"},{default:d(()=>[a(r,{modelValue:l(u).total_price,"onUpdate:modelValue":e[9]||(e[9]=o=>l(u).total_price=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u603B\u4EF7\u683C",readonly:!1},null,8,["modelValue"])]),_:1}),a(s,{label:"\u72B6\u6001",prop:"status"},{default:d(()=>[a(r,{modelValue:l(u).status,"onUpdate:modelValue":e[10]||(e[10]=o=>l(u).status=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u72B6\u6001",readonly:!1},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{G as _};
