import{b as v}from"./index.74b837d9.js";import{u as x}from"./useInstance.233fbdde.js";import{d as C,r as f,b as k,p as y,c as _,e as w,k as I,i as a,h as o,u as l,a2 as U,m as q,E as g}from"./index.0308b213.js";const N=q("\u63D0\u4EA4"),j=C({props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue","close"],setup(V,{emit:D}){const E=V,{global:b}=x(),i=f(!1);let p=f(),e=k({account_no_out:"",account_no_in:"",allocate_scale:0});const F=f({account_no_out:[{required:!0,message:"\u51FA\u8D26\u65B9\u4E00\u8D26\u901A\u8D26\u53F7\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],account_no_in:[{required:!0,message:"\u5165\u8D26\u7684\u4E00\u8D26\u901A\u8D26\u53F7\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],allocate_scale:[{required:!0,message:"\u5206\u8D26\u6700\u5927\u6BD4\u4F8B\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]});y(()=>E.modelValue,n=>{n&&(i.value=n)});const B=()=>{var n;(n=p.value)==null||n.validate((u,c)=>{var r,m,d;u?v({account_no_out:e.account_no_out,account_rule:JSON.stringify({account_no_in:e.account_no_in,allocate_scale:e.allocate_scale})}).then(s=>{s.return_code==="02"||s.result_code==="02"?g.error(s.return_msg):A()}):c&&g.error(((d=(m=(r=Object.values(c))==null?void 0:r[0])==null?void 0:m[0])==null?void 0:d.message)||"\u672A\u77E5\u9519\u8BEF")})},A=()=>{D("update:modelValue",!1),D("close"),b.$resetForm(p.value,e)};return(n,u)=>{const c=_("el-input"),r=_("el-form-item"),m=_("el-input-number"),d=_("el-button"),s=_("el-dialog");return w(),I(s,{modelValue:i.value,"onUpdate:modelValue":u[3]||(u[3]=t=>i.value=t),title:"\u65B0\u589E\u5206\u8D26\u8D26\u6237",width:"80%",top:"20px",onClose:A},{footer:a(()=>[o(d,{type:"primary",onClick:B},{default:a(()=>[N]),_:1})]),default:a(()=>[o(l(U),{ref_key:"formRef",ref:p,model:l(e),rules:F.value,"label-width":"160px"},{default:a(()=>[o(r,{label:"\u51FA\u8D26\u65B9\u4E00\u8D26\u901A\u8D26\u53F7",prop:"account_no_out"},{default:a(()=>[o(c,{modelValue:l(e).account_no_out,"onUpdate:modelValue":u[0]||(u[0]=t=>l(e).account_no_out=t)},null,8,["modelValue"])]),_:1}),o(r,{label:"\u5165\u8D26\u7684\u4E00\u8D26\u901A\u8D26\u53F7",prop:"account_no_in"},{default:a(()=>[o(c,{modelValue:l(e).account_no_in,"onUpdate:modelValue":u[1]||(u[1]=t=>l(e).account_no_in=t)},null,8,["modelValue"])]),_:1}),o(r,{label:"\u5206\u8D26\u6700\u5927\u6BD4\u4F8B",prop:"allocate_scale"},{default:a(()=>[o(m,{modelValue:l(e).allocate_scale,"onUpdate:modelValue":u[2]||(u[2]=t=>l(e).allocate_scale=t),min:0,max:1e4},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue"])}}});export{j as _};
