import{B as w,C as h,D as I}from"./element-plus.2acb577d.js";import{P as A}from"./index.f292cd50.js";import{b as x,c as R,d as U}from"./warehouse_storege.3c4c7710.js";import"./lodash.6bfd3540.js";import{d as F,s as f,r as k,b as P,Z as _,o as S,c as q,U as r,L as i,u as o}from"./@vue.821a47ec.js";import"./lodash-es.df44a280.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.81e2759c.js";import"./@element-plus.dabbc398.js";import"./dayjs.d2a77ee0.js";import"./axios.9e996410.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./index.81df6f20.js";import"./vue-router.4c04f9b6.js";import"./pinia.fefed778.js";import"./css-color-function.8ff67959.js";import"./color.bfa08e9a.js";import"./clone.660f80c4.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./ms.564e106c.js";import"./nprogress.dcb32030.js";import"./vue-clipboard3.e681583f.js";import"./clipboard.3ad9b20b.js";import"./echarts.42bea269.js";import"./tslib.60310f1a.js";import"./zrender.2cb48b70.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.8864a4be.js";const W={class:"edit-popup"},j=F({name:"psiWarehouseStoregeEdit"}),Ce=F({...j,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(L,{expose:E,emit:b}){const m=b,n=f(),p=f(),d=k("add"),C=P(()=>d.value=="edit"?"\u7F16\u8F91\u4ED3\u5E93\u5B58\u50A8":"\u65B0\u589E\u4ED3\u5E93\u5B58\u50A8"),u=_({id:"",warehouse_id:"",product_id:"",nums:"",is_verify:"",price:""}),D=_({warehouse_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u4ED3\u5E93ID",trigger:["blur"]}],product_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u5546\u54C1ID",trigger:["blur"]}],nums:[{required:!0,message:"\u8BF7\u8F93\u5165\u6570\u91CF",trigger:["blur"]}],price:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EF7\u683C",trigger:["blur"]}]}),c=async t=>{for(const e in u)t[e]!=null&&t[e]!=null&&(u[e]=t[e])},g=async t=>{const e=await x({id:t.id});c(e)},y=async()=>{var e,a;await((e=n.value)==null?void 0:e.validate());const t={...u};d.value=="edit"?await R(t):await U(t),(a=p.value)==null||a.close(),m("success")},V=(t="add")=>{var e;d.value=t,(e=p.value)==null||e.open()},B=()=>{m("close")};return E({open:V,setFormData:c,getDetail:g}),(t,e)=>{const a=w,s=h,v=I;return S(),q("div",W,[r(A,{ref_key:"popupRef",ref:p,title:o(C),async:!0,width:"550px",onConfirm:y,onClose:B},{default:i(()=>[r(v,{ref_key:"formRef",ref:n,model:o(u),"label-width":"90px",rules:o(D)},{default:i(()=>[r(s,{label:"\u4ED3\u5E93ID",prop:"warehouse_id"},{default:i(()=>[r(a,{modelValue:o(u).warehouse_id,"onUpdate:modelValue":e[0]||(e[0]=l=>o(u).warehouse_id=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4ED3\u5E93ID",readonly:!1},null,8,["modelValue"])]),_:1}),r(s,{label:"\u5546\u54C1ID",prop:"product_id"},{default:i(()=>[r(a,{modelValue:o(u).product_id,"onUpdate:modelValue":e[1]||(e[1]=l=>o(u).product_id=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5546\u54C1ID",readonly:!1},null,8,["modelValue"])]),_:1}),r(s,{label:"\u6570\u91CF",prop:"nums"},{default:i(()=>[r(a,{modelValue:o(u).nums,"onUpdate:modelValue":e[2]||(e[2]=l=>o(u).nums=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6570\u91CF",readonly:!1},null,8,["modelValue"])]),_:1}),r(s,{label:"0\u4E0D\u6821\u9A8C1\u6821\u9A8C",prop:"is_verify"},{default:i(()=>[r(a,{modelValue:o(u).is_verify,"onUpdate:modelValue":e[3]||(e[3]=l=>o(u).is_verify=l),clearable:"",placeholder:"\u8BF7\u8F93\u51650\u4E0D\u6821\u9A8C1\u6821\u9A8C",readonly:!1},null,8,["modelValue"])]),_:1}),r(s,{label:"\u4EF7\u683C",prop:"price"},{default:i(()=>[r(a,{modelValue:o(u).price,"onUpdate:modelValue":e[4]||(e[4]=l=>o(u).price=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4EF7\u683C",readonly:!1},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{Ce as default};