ConsumptionTopUpLogForm-81b2c013.js 6.8 KB

1
  1. import{d as se,y as oe,e as O,r,x as y,z as le,w as ie,o as p,A as g,B as t,f as s,G as x,a,k as ne,ac as re,c as ue,P as me,C,D as _,F as de,E as S,a2 as ce,H as pe,cg as _e,S as fe,J as ge,M as ve,Q as be,R as he,a8 as ye,L as Ce,U as Pe,X as Ue,__tla as Ve}from"./index-3007d289.js";import{_ as xe,__tla as qe}from"./Dialog-17bf1541.js";import{E as Ie,__tla as Me}from"./el-avatar-7f689659.js";import{_ as we,__tla as Re}from"./UploadImg-30f23096.js";import{C as L,__tla as Te}from"./index-f388d288.js";import{b as De,__tla as Fe}from"./index-4aecb753.js";import{g as ke,__tla as Oe}from"./profile-95e667ec.js";import{u as Se,__tla as Le}from"./useMessage-2871558a.js";import{_ as Ne}from"./_plugin-vue_export-helper-1b428a4d.js";import{__tla as ze}from"./index-64e23d44.js";import{__tla as Ee}from"./el-image-viewer-6eac4fa6.js";let N,Je=Promise.all([(()=>{try{return Ve}catch{}})(),(()=>{try{return qe}catch{}})(),(()=>{try{return Me}catch{}})(),(()=>{try{return Re}catch{}})(),(()=>{try{return Te}catch{}})(),(()=>{try{return Fe}catch{}})(),(()=>{try{return Oe}catch{}})(),(()=>{try{return Le}catch{}})(),(()=>{try{return ze}catch{}})(),(()=>{try{return Ee}catch{}})()]).then(async()=>{let q,I,M,w;q={class:"flex items-center"},I={class:"m-l-2"},M={style:{height:"30px","line-height":"30px"}},w={style:{"padding-left":"11px",height:"30px","line-height":"30px"}},N=Ne(se({name:"ConsumptionTopUpLogForm",__name:"ConsumptionTopUpLogForm",emits:["success"],setup(Ae,{expose:z,emit:E}){const J=oe(),A=O(()=>J.getMobile),{t:v}=pe(),R=Se(),f=r(!1),T=r(""),b=r(!1),P=r(!1);r([]);const U=r([]);r([]);const B=r(""),e=y({id:void 0,userId:void 0,attachment:void 0,consumptionPoints:void 0,practicalConsumptionPoints:void 0,userName:void 0,smsCodeUseReqDTO:{mobile:"",scene:"10",code:""}}),G=y({consumptionPoints:[{required:!0,message:"\u6D88\u8D39\u5206\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],userId:[{required:!0,message:"\u7528\u6237\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],attachment:[{required:!0,message:"\u8F6C\u8D26\u51ED\u8BC1\u9644\u4EF6\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],"smsCodeUseReqDTO.code":[{required:!0,message:"\u9A8C\u8BC1\u7801\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),D=r();z({open:async i=>{f.value=!0,T.value=v("action."+i),B.value=i,e.id=void 0,e.userId=void 0,e.attachment=void 0,e.consumptionPoints=void 0,e.practicalConsumptionPoints=void 0,e.userName=void 0,e.smsCodeUseReqDTO={mobile:"",scene:"10",code:""},await W()}});const H=E,Q=async()=>{await D.value.validate(),b.value=!0;try{await L.createConsumptionTopUpLog(e),R.success(v("common.createSuccess")),f.value=!1,H("success")}finally{b.value=!1}},X=le(async i=>{if(i){P.value=!0;try{const o=await De({username:i});U.value=o.map(n=>({value:n.id,label:n.username,mobile:n.mobile,avatar:n.avatar,username:n.username}))}catch{}finally{P.value=!1}}},200),m=y({hide:!0,isFirstConsumption:!1,minimumConsumptionPoints:0,consumptionMagnification:"",triggerMagnificationPoints:""});ie(()=>e.userId,i=>{i&&(async function(o){m.hide=!1;const n=await L.isUserFirstRecharge({userId:o});m.isFirstConsumption=n.isFirstConsumption,m.minimumConsumptionPoints=n.minimumConsumptionPoints,m.consumptionMagnification=n.consumptionMagnification,m.triggerMagnificationPoints=n.triggerMagnificationPoints}(i),e.userName=(o=>{const n=U.value.find(u=>u.value===o);return n?n.username:null})(i))});const j=O(()=>{if(!e.consumptionPoints)return 0;let i;return i=e.consumptionPoints>=parseFloat(m.triggerMagnificationPoints)?(e.consumptionPoints*parseFloat(m.consumptionMagnification)).toFixed(2):e.consumptionPoints,i}),F=y({smsCode:{mobile:"",scene:10}}),d=r(0),K=async()=>{F.smsCode.mobile=e.smsCodeUseReqDTO.mobile,await _e(F.smsCode).then(async()=>{R.success(v("login.SmsSendMsg")),d.value=60;let i=setInterval(()=>{d.value=d.value-1,d.value<=0&&clearInterval(i)},1e3)})},W=async()=>{const i=await ke();e.smsCodeUseReqDTO.mobile=i.mobile};return(i,o)=>{const n=we,u=fe,c=ge,h=ve,Y=Ie,Z=be,$=he,k=ye,V=Ce,ee=Pe,ae=xe,te=Ue;return p(),g(ae,{title:a(T),modelValue:a(f),"onUpdate:modelValue":o[5]||(o[5]=l=>ce(f)?f.value=l:null),width:"70%"},{footer:t(()=>[s(V,{onClick:Q,type:"primary",disabled:a(b)},{default:t(()=>[x("\u786E\u5B9A")]),_:1},8,["disabled"])]),default:t(()=>[ne((p(),g(ee,{ref_key:"formRef",ref:D,model:a(e),rules:a(G),"label-width":"120px",class:re({"mobile-card":a(A)})},{default:t(()=>[s(h,null,{default:t(()=>[s(c,{span:24},{default:t(()=>[s(u,{label:"\u8F6C\u8D26\u51ED\u8BC1\u9644\u4EF6",prop:"attachment"},{default:t(()=>[s(n,{modelValue:a(e).attachment,"onUpdate:modelValue":o[0]||(o[0]=l=>a(e).attachment=l),limit:1},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),s(h,null,{default:t(()=>[s(c,{span:24},{default:t(()=>[s(u,{label:"\u7528\u6237",prop:"userId"},{default:t(()=>[s($,{modelValue:a(e).userId,"onUpdate:modelValue":o[1]||(o[1]=l=>a(e).userId=l),clearable:"",filterable:"",remote:"","reserve-keyword":"",placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D\u79F0","remote-method":a(X),loading:a(P),style:{width:"240px"}},{default:t(()=>[(p(!0),ue(de,null,me(a(U),l=>(p(),g(Z,{key:l.value,label:l.label,value:l.value},{default:t(()=>[C("div",q,[s(Y,{size:28,src:l.avatar},null,8,["src"]),C("span",I,_(l.username)+"\uFF08"+_(l.mobile)+"\uFF09",1)])]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","remote-method","loading"])]),_:1})]),_:1})]),_:1}),s(h,null,{default:t(()=>[s(c,{span:12},{default:t(()=>[s(u,{label:"\u5145\u503C\u91D1\u989D",prop:"consumptionPoints"},{default:t(()=>[s(k,{modelValue:a(e).consumptionPoints,"onUpdate:modelValue":o[2]||(o[2]=l=>a(e).consumptionPoints=l),modelModifiers:{number:!0},placeholder:"\u8BF7\u8F93\u5165\u5145\u503C\u91D1\u989D",disabled:!a(e).userId,onInput:o[3]||(o[3]=l=>a(e).consumptionPoints=l.replace(/[^\d]/g,"")),maxlength:9},null,8,["modelValue","disabled"])]),_:1})]),_:1}),s(c,{span:12},{default:t(()=>[s(u,{label:"\u6D88\u8D39\u5206",prop:""},{default:t(()=>[C("span",M,_(a(j)),1)]),_:1})]),_:1})]),_:1}),s(h,null,{default:t(()=>[s(c,{span:12},{default:t(()=>[s(u,{label:"\u624B\u673A\u53F7",prop:"mobile"},{default:t(()=>[C("span",w,_(a(e).smsCodeUseReqDTO.mobile),1),a(d)<=0?(p(),g(V,{key:0,onClick:K,type:"primary",class:"m-l-2"},{default:t(()=>[x(_(a(v)("login.getSmsCode")),1)]),_:1})):S("",!0),a(d)>0?(p(),g(V,{key:1,disabled:!0,class:"m-l-2"},{default:t(()=>[x(_(a(d))+"\u79D2\u540E\u53EF\u91CD\u65B0\u83B7\u53D6 ",1)]),_:1})):S("",!0)]),_:1})]),_:1}),s(c,{span:12},{default:t(()=>[s(u,{label:"\u9A8C\u8BC1\u7801",prop:"smsCodeUseReqDTO.code"},{default:t(()=>[s(k,{modelValue:a(e).smsCodeUseReqDTO.code,"onUpdate:modelValue":o[4]||(o[4]=l=>a(e).smsCodeUseReqDTO.code=l),modelModifiers:{number:!0},placeholder:"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801",max:"4"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules","class"])),[[te,a(b)]])]),_:1},8,["title","modelValue"])}}}),[["__scopeId","data-v-8c8a9b65"]])});export{Je as __tla,N as default};