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