import{_ as k,d as q,w as _,ag as M,bs as f,x as I,r as a,o as i,G as F,C as t,j as n,l,c as U,F as j,D as R,h as S,M as z,aq as O}from"./index.js";import{d as G}from"./index.da6d65fd.js";const L={class:"w-full flex justify-end"},P=q({__name:"modal",props:{data:{type:null,required:!0,default:{companyNo:"",channel_name:"",id:""}},visible:{type:Boolean,required:!0},disabled:{type:Boolean,required:!0}},emits:["submit"],setup(m,{emit:y}){const d=m,v={companyNo:"",channel_name:"",id:""},c=_([]),b=M(()=>u.value.id?d.disabled?"\u67E5\u770B\u652F\u4ED8\u6E20\u9053":"\u7F16\u8F91\u652F\u4ED8\u6E20\u9053":"\u6DFB\u52A0\u652F\u4ED8\u6E20\u9053"),s=f(d,"visible"),u=f(d,"data"),p=_(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 D(){const r=await G({size:100});c.value=r.code===0?r.data.list:[]}function g(){u.value={...v},s.value=!1}async function C(){try{await p.value.validate(),y("submit")}catch{}}return I(D),(r,o)=>{const h=a("ElOption"),V=a("ElSelect"),E=a("ElFormItem"),N=a("ElInput"),A=a("ElButton"),w=a("ElForm"),x=a("ElDialog");return i(),F(x,{modelValue:l(s),"onUpdate:modelValue":o[2]||(o[2]=e=>O(s)?s.value=e:null),title:l(b),center:"",onClose:g},{default:t(()=>[n(w,{model:l(u),rules:B,size:"small",ref_key:"formRef",ref:p,disabled:m.disabled},{default:t(()=>[n(E,{label:"\u4E1A\u52A1\u516C\u53F8",prop:"companyNo"},{default:t(()=>[n(V,{modelValue:l(u).companyNo,"onUpdate:modelValue":o[0]||(o[0]=e=>l(u).companyNo=e),style:{width:"100%"},placeholder:"\u4E1A\u52A1\u516C\u53F8"},{default:t(()=>[(i(!0),U(j,null,R(c.value,e=>(i(),F(h,{label:e.company,value:e.companyNo,key:e.companyNo},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),n(E,{label:"\u652F\u4ED8\u6E20\u9053\u540D\u79F0",prop:"channel_name"},{default:t(()=>[n(N,{modelValue:l(u).channel_name,"onUpdate:modelValue":o[1]||(o[1]=e=>l(u).channel_name=e),style:{width:"100%"},placeholder:"\u652F\u4ED8\u6E20\u9053\u540D\u79F0"},null,8,["modelValue"])]),_:1}),S("div",L,[n(A,{type:"primary",onClick:C},{default:t(()=>[z("\u4FDD\u5B58")]),_:1})])]),_:1},8,["model","disabled"])]),_:1},8,["modelValue","title"])}}});var J=k(P,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/views/serviceParam/paymentChannelManage/components/modal.vue"]]);export{J as default};
