import{_ as k,d as q,w as f,ag as I,bs as _,x as M,r as o,o as i,G as y,C as a,j as s,l,c as U,F as j,D as z,h as R,M as S,aq as O}from"./index.js";import{d as G}from"./index.da6d65fd.js";const L={class:"w-full flex justify-end"},T=q({__name:"modal",props:{data:{type:null,required:!0,default:{companyNo:"",name:"",pid:"",id:""}},visible:{type:Boolean,required:!0},disabledBusiness:{type:Boolean,required:!0}},emits:["submit"],setup(d,{emit:C}){const m=d,F={companyNo:"",name:"",pid:"",id:""},c=f([]),v=I(()=>t.value.id?"\u7F16\u8F91\u7EC4\u7EC7":"\u6DFB\u52A0\u7EC4\u7EC7"),n=_(m,"visible"),t=_(m,"data"),p=f(null),b={companyNo:[{required:!0,message:"\u8BF7\u9009\u62E9\u4E1A\u52A1\u516C\u53F8",trigger:"change"}],name:[{required:!0,message:"\u8BF7\u8F93\u5165\u7EC4\u7EC7\u540D\u79F0",trigger:"blur"},{min:1,max:50,message:"\u957F\u5EA6\u5728 1 \u5230 50 \u4E2A\u5B57\u7B26",trigger:"blur"}]};async function B(){const r=await G({size:100});c.value=r.code===0?r.data.list:[]}function g(){t.value={...F},n.value=!1}async function V(){try{await p.value.validate(),C("submit")}catch{}}return M(B),(r,u)=>{const D=o("ElOption"),N=o("ElSelect"),E=o("ElFormItem"),A=o("ElInput"),w=o("ElButton"),x=o("ElForm"),h=o("ElDialog");return i(),y(h,{modelValue:l(n),"onUpdate:modelValue":u[2]||(u[2]=e=>O(n)?n.value=e:null),title:l(v),center:"",onClose:g},{default:a(()=>[s(x,{model:l(t),rules:b,size:"small",ref_key:"formRef",ref:p},{default:a(()=>[s(E,{label:"\u4E1A\u52A1\u516C\u53F8",prop:"companyNo"},{default:a(()=>[s(N,{modelValue:l(t).companyNo,"onUpdate:modelValue":u[0]||(u[0]=e=>l(t).companyNo=e),style:{width:"100%"},placeholder:"\u4E1A\u52A1\u516C\u53F8",disabled:d.disabledBusiness},{default:a(()=>[(i(!0),U(j,null,z(c.value,e=>(i(),y(D,{label:e.company,value:e.companyNo,key:e.companyNo},null,8,["label","value"]))),128))]),_:1},8,["modelValue","disabled"])]),_:1}),s(E,{label:"\u7EC4\u7EC7\u540D\u79F0",prop:"name"},{default:a(()=>[s(A,{modelValue:l(t).name,"onUpdate:modelValue":u[1]||(u[1]=e=>l(t).name=e),style:{width:"100%"},placeholder:"\u7EC4\u7EC7\u540D\u79F0"},null,8,["modelValue"])]),_:1}),R("div",L,[s(w,{type:"primary",onClick:V},{default:a(()=>[S("\u4FDD\u5B58")]),_:1})])]),_:1},8,["model"])]),_:1},8,["modelValue","title"])}}});var K=k(T,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/views/interest/organize/cpns/modal.vue"]]);export{K as default};
