import{u as w}from"./useInstance.233fbdde.js";import{g as C,e as h,a as k}from"./index.289eb9c3.js";import{d as A,a6 as U,s as N,b as m,r as V,p as R,c as r,e as I,k as M,i as u,h as o,u as t,a2 as P,m as p,E as D}from"./index.0308b213.js";const T=p("%"),$=p("%"),j=p("\u63D0\u4EA4"),q=p("\u53D6\u6D88"),J=A({props:{modelValue:{type:Boolean,default:!1},id:null},emits:["update:modelValue","onClose"],setup(b,{emit:c}){const i=b;U();const{global:v}=w();let g=N(()=>Number(i.id)>0);m({list:[]}),m({list:[]});const _=V(!1),E=V(),e=m({id:"",customer_number:"",weixin_feilv:"",alipay_feilv:""}),y=()=>{e.id>0?h(e).then(l=>{D({message:"\u7F16\u8F91\u6210\u529F",type:"success"}),n()}):k(e).then(l=>{D({message:"\u65B0\u589E\u6210\u529F",type:"success"}),n()})};R(()=>i.modelValue,l=>{_.value=l,l&&i.id&&(e.id=i.id,B())}),m({list:[]});const B=()=>{C({id:i.id}).then(l=>{l=l.data,e.customer_number=l.customer_number,e.weixin_feilv=l.weixin_feilv,e.alipay_feilv=l.alipay_feilv})},n=()=>{c("update:modelValue",!1),c("onClose"),v.$resetForm(E.value,e)};return(l,a)=>{const f=r("el-input"),d=r("el-form-item"),F=r("el-button"),x=r("el-dialog");return I(),M(x,{modelValue:_.value,"onUpdate:modelValue":a[3]||(a[3]=s=>_.value=s),title:t(g)?"\u67E5\u770B\u8D39\u7387\u8BBE\u7F6E":"\u65B0\u589E\u8D39\u7387\u8BBE\u7F6E",width:"70%","destroy-on-close":"",onClose:n},{default:u(()=>[o(t(P),{ref_key:"formRef",ref:E,model:t(e),"inline-message":!0,"label-width":"160px"},{default:u(()=>[o(d,{label:"\u5546\u6237\u7F16\u53F7"},{default:u(()=>[o(f,{modelValue:t(e).customer_number,"onUpdate:modelValue":a[0]||(a[0]=s=>t(e).customer_number=s),placeholder:"\u5546\u6237\u7F16\u53F7"},null,8,["modelValue"])]),_:1}),o(d,{label:"\u5FAE\u4FE1\u8D39\u7387"},{default:u(()=>[o(f,{modelValue:t(e).weixin_feilv,"onUpdate:modelValue":a[1]||(a[1]=s=>t(e).weixin_feilv=s),placeholder:"\u5FAE\u4FE1\u8D39\u7387"},{append:u(()=>[T]),_:1},8,["modelValue"])]),_:1}),o(d,{label:"\u652F\u4ED8\u5B9D\u8D39\u7387"},{default:u(()=>[o(f,{modelValue:t(e).alipay_feilv,"onUpdate:modelValue":a[2]||(a[2]=s=>t(e).alipay_feilv=s),placeholder:"\u652F\u4ED8\u5B9D\u8D39\u7387"},{append:u(()=>[$]),_:1},8,["modelValue"])]),_:1}),o(d,null,{default:u(()=>[o(F,{type:"primary",onClick:y},{default:u(()=>[j]),_:1}),o(F,{onClick:n},{default:u(()=>[q]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue","title"])}}});export{J as _};
