import{b as w,c as I}from"./list.5526c7ef.js";import{d as U,r as C,b as c,p as N,c as r,e as S,k as R,i as t,h as e,g as f,t as g,u as l,a2 as T,m,E as q,_ as z}from"./index.0308b213.js";const M={class:"agent-info"},j={class:"data"},G={class:"agent-amount"},H=m("\u589E\u52A0"),J=m("\u51CF\u5C11"),K=m("\u6700\u7EC8\u4F59\u989D"),L=m("\u63D0\u4EA4"),O=m("\u53D6\u6D88"),P=U({props:{modelValue:{type:Boolean,default:!1},id:{default:0}},emits:["update:modelValue","onClose"],setup(h,{emit:D}){const b=h,i=C(!1),B=(u,o,a)=>{o?[1,2,3].includes(o)?a():a(new Error("\u9009\u62E9\u53D8\u52A8\u7C7B\u578B\u4E0D\u6B63\u786E")):a(new Error("\u8BF7\u9009\u62E9\u53D8\u52A8\u7C7B\u578B"))},A=C(),d=c({id:0,realname:"",mobile:"",amount:""}),n=c({id2:0,change_type:1,amount:0,remark:""}),F=c({change_type:[{required:!0,message:"\u7C7B\u578B\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"},{validator:B,trigger:"blur"}]}),y=()=>{w(b.id).then(u=>{n.id2=u.agent.id,d.realname=u.agent.realname,d.mobile=u.agent.mobile,d.amount=u.agent.amount})};N(()=>b.modelValue,u=>{i.value=u,u&&y()});const v=()=>{var u;(u=A.value)==null||u.validate(o=>{o&&I(n).then(a=>{q({message:a.msg,type:"success"}),_()})})},_=()=>{D("update:modelValue",!1),D("onClose")};return(u,o)=>{const a=r("el-form-item"),p=r("el-radio"),k=r("el-radio-group"),V=r("el-input"),E=r("el-button"),x=r("el-dialog");return S(),R(x,{modelValue:i.value,"onUpdate:modelValue":o[3]||(o[3]=s=>i.value=s),title:"\u8D26\u6237\u53D8\u52A8",width:"50%",onClose:_},{default:t(()=>[e(l(T),{ref_key:"amountFormRef",ref:A,model:l(n),rules:l(F),"label-width":"140px"},{default:t(()=>[e(a,{class:"tn-el-form-item",label:"\u4EE3\u7406\u4FE1\u606F"},{default:t(()=>[f("div",M,[f("div",j,g(l(d).realname)+"/"+g(l(d).mobile),1)])]),_:1}),e(a,{label:"\u5F53\u524D\u4F59\u989D"},{default:t(()=>[f("div",G,g(l(d).amount)+"\u5143 ",1)]),_:1}),e(a,{label:"\u53D8\u52A8\u7C7B\u578B",prop:"change_type"},{default:t(()=>[e(k,{modelValue:l(n).change_type,"onUpdate:modelValue":o[0]||(o[0]=s=>l(n).change_type=s),size:"small"},{default:t(()=>[e(p,{label:1,border:!0},{default:t(()=>[H]),_:1}),e(p,{label:2,border:!0},{default:t(()=>[J]),_:1}),e(p,{label:3,border:!0},{default:t(()=>[K]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(a,{label:"\u53D8\u52A8\u91D1\u989D",prop:"changeValue"},{default:t(()=>[e(V,{modelValue:l(n).amount,"onUpdate:modelValue":o[1]||(o[1]=s=>l(n).amount=s),placeholder:"\u8BF7\u8F93\u5165\u53D8\u52A8\u91D1\u989D"},null,8,["modelValue"])]),_:1}),e(a,{label:"\u5907\u6CE8",prop:"remark"},{default:t(()=>[e(V,{modelValue:l(n).remark,"onUpdate:modelValue":o[2]||(o[2]=s=>l(n).remark=s),placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8",type:"textarea",row:3},null,8,["modelValue"])]),_:1}),e(a,null,{default:t(()=>[e(E,{type:"primary",onClick:v},{default:t(()=>[L]),_:1}),e(E,{onClick:_},{default:t(()=>[O]),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue"])}}});const X=z(P,[["__scopeId","data-v-e74fa81a"]]);export{X as default};
