MerchantStorePaymentFrom-89dd46ed.js 2.9 KB

1
  1. import{d as x,b as F,e as q,B as D,r as o,f as M,z as B,D as P,a as t,o as z,j as E,w as l,i as a,X as J,I as O,E as R,s as X,J as A,M as C,__tla as G}from"./index-1e808f2e.js";import{S as _,__tla as H}from"./index-5a083e96.js";import{u as K,__tla as L}from"./useMessage-5f9e8917.js";import{_ as Q}from"./_plugin-vue_export-helper-1b428a4d.js";let g,T=Promise.all([(()=>{try{return G}catch{}})(),(()=>{try{return H}catch{}})(),(()=>{try{return L}catch{}})()]).then(async()=>{g=Q(x({name:"SystemUserForm",__name:"MerchantStorePaymentFrom",props:{obj:{type:Object,default:()=>({})},isDetail:{type:Boolean,default:!1}},emits:["success"],setup(b,{expose:N,emit:y}){const V=F();q(()=>V.getMobile);const{t:f}=D(),v=K(),S=o(!1);o("");const d=o(!1),k=o(""),e=o({name:"",id:void 0,status:1,merchantId:0,logoUrl:"",website:"",accountName:void 0,accountNumber:void 0,bankName:void 0}),j=M({accountName:[{required:!0,message:"\u8D26\u6237\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],accountNumber:[{required:!0,message:"\u8D26\u6237\u53F7\u7801\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],bankName:[{required:!0,message:"\u5F00\u6237\u94F6\u884C\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),m=b,c=o(),w=y;return N({submitForm:async()=>{if(c&&await c.value.validate()){d.value=!0;try{const s=e.value;return k.value==="create"?(await _.createShop(s),v.success(f("common.createSuccess"))):(await _.updateShop(s),v.success(f("common.updateSuccess"))),S.value=!1,w("success"),!0}finally{d.value=!1}}}}),B(()=>{var s;e.value.merchantId=m.obj.merchantId,e.value.id=m.obj.id,e.value={name:"",id:void 0,status:1,merchantId:0,logoUrl:""},(s=c.value)==null||s.resetFields(),(async()=>_.getShop(m.obj.id).then(u=>{e.value=u}))()}),(s,u)=>{const n=J,i=O,p=R,h=X,I=A,U=C;return P((z(),E(I,{ref_key:"formRef",ref:c,model:t(e),rules:t(j),"label-width":"120px",style:{padding:"10px"},disabled:b.isDetail},{default:l(()=>[a(h,null,{default:l(()=>[a(p,{span:12},{default:l(()=>[a(i,{label:"\u5F00\u6237\u94F6\u884C",prop:"bankName"},{default:l(()=>[a(n,{modelValue:t(e).bankName,"onUpdate:modelValue":u[0]||(u[0]=r=>t(e).bankName=r),placeholder:"\u8BF7\u8F93\u5165\u5F00\u6237\u94F6\u884C"},null,8,["modelValue"])]),_:1})]),_:1}),a(p,{span:12},{default:l(()=>[a(i,{label:"\u8D26\u6237\u540D\u79F0",prop:"accountName"},{default:l(()=>[a(n,{modelValue:t(e).accountName,"onUpdate:modelValue":u[1]||(u[1]=r=>t(e).accountName=r),placeholder:"\u8BF7\u8F93\u5165\u8D26\u6237\u540D\u79F0",maxlength:"11"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),a(h,null,{default:l(()=>[a(p,{span:24},{default:l(()=>[a(i,{label:"\u8D26\u6237\u53F7\u7801",prop:"accountNumber"},{default:l(()=>[a(n,{modelValue:t(e).accountNumber,"onUpdate:modelValue":u[2]||(u[2]=r=>t(e).accountNumber=r),placeholder:"\u8BF7\u8F93\u5165\u8D26\u6237\u53F7\u7801",onkeyup:"value=value.replace(/[^\\d]/g,'')"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules","disabled"])),[[U,t(d)]])}}}),[["__scopeId","data-v-ab48053b"]])});export{T as __tla,g as default};