MerchantStorePaymentFrom-5759cd72.js 2.8 KB

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