import{G as k,H as x,D as B,C as R,F as g}from"./element-plus.fa1aa32c.js";import{P as N}from"./index.082aefea.js";import{f as F}from"./index.0abf9e5c.js";import{d as q,s as C,a0 as A,e as I,w as D,o as U,L as j,M as a,a as G,V as o,T as r,U as b,u as M}from"./@vue.cab01781.js";const P={class:"pr-8"},S=r("\u589E\u52A0\u4F59\u989D"),T=r("\u6263\u51CF\u4F59\u989D"),K=q({__name:"account-adjust",props:{show:{type:Boolean,required:!0},value:{type:[Number,String],required:!0}},emits:["update:show","confirm"],setup(d,{emit:p}){const i=d,n=C(),u=A({action:1,num:"",remark:""}),s=C(),c=I(()=>Number(i.value)+Number(u.num)*(u.action==1?1:-1)),E={num:[{required:!0,message:"\u8BF7\u8F93\u5165\u8C03\u6574\u7684\u91D1\u989D"}]},w=e=>{if(e.includes("-"))return F.msgError("\u8BF7\u8F93\u5165\u6B63\u6574\u6570");u.num=e},h=async()=>{var e;await((e=n.value)==null?void 0:e.validate()),p("confirm",u)},v=()=>{var e;p("update:show",!1),(e=n.value)==null||e.resetFields()};return D(()=>i.show,e=>{var l,t;e?(l=s.value)==null||l.open():(t=s.value)==null||t.close()}),D(c,e=>{e<0&&(F.msgError("\u8C03\u6574\u540E\u4F59\u989D\u9700\u5927\u4E8E0"),u.num="")}),(e,l)=>{const t=B,f=k,V=x,_=R,y=g;return U(),j(N,{ref_key:"popupRef",ref:s,title:"\u4F59\u989D\u8C03\u6574",width:"500px",onConfirm:h,async:!0,onClose:v},{default:a(()=>[G("div",P,[o(y,{ref_key:"formRef",ref:n,model:u,"label-width":"120px",rules:E},{default:a(()=>[o(t,{label:"\u5F53\u524D\u4F59\u989D"},{default:a(()=>[r("\xA5 "+b(d.value),1)]),_:1}),o(t,{label:"\u4F59\u989D\u589E\u51CF",required:"",prop:"action"},{default:a(()=>[o(V,{modelValue:u.action,"onUpdate:modelValue":l[0]||(l[0]=m=>u.action=m)},{default:a(()=>[o(f,{label:1},{default:a(()=>[S]),_:1}),o(f,{label:2},{default:a(()=>[T]),_:1})]),_:1},8,["modelValue"])]),_:1}),o(t,{label:"\u8C03\u6574\u4F59\u989D",prop:"num"},{default:a(()=>[o(_,{"model-value":u.num,placeholder:"\u8BF7\u8F93\u5165\u8C03\u6574\u7684\u91D1\u989D",type:"number",onInput:w},null,8,["model-value"])]),_:1}),o(t,{label:"\u8C03\u6574\u540E\u4F59\u989D"},{default:a(()=>[r(" \xA5 "+b(M(c)),1)]),_:1}),o(t,{label:"\u5907\u6CE8",prop:"remark"},{default:a(()=>[o(_,{modelValue:u.remark,"onUpdate:modelValue":l[1]||(l[1]=m=>u.remark=m),type:"textarea",rows:4},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])])]),_:1},512)}}});export{K as _};
