MerchantForm-0a8e68f4.js 5.7 KB

1
  1. import{d as D,h as j,r as c,e as A,o as y,v as x,w as s,f as t,a,n as _,x as B,O as I,V as O,A as R,ah as E,ai as G,B as J,D as K,C as Q,I as W,_ as X,__tla as Y}from"./index-e3afde76.js";import{_ as Z,__tla as $}from"./Dialog-c20523c4.js";import{_ as ee,__tla as ae}from"./Editor-9c92736f.js";import{_ as le,__tla as te}from"./UploadImg-78fd4518.js";import{M as v,__tla as oe}from"./index-e419fb67.js";import{u as se,__tla as ue}from"./useMessage-0b1b25bd.js";import{__tla as de}from"./index-15373756.js";import{__tla as re}from"./el-image-viewer-9d1c7d33.js";let w,ie=Promise.all([(()=>{try{return Y}catch{}})(),(()=>{try{return $}catch{}})(),(()=>{try{return ae}catch{}})(),(()=>{try{return te}catch{}})(),(()=>{try{return oe}catch{}})(),(()=>{try{return ue}catch{}})(),(()=>{try{return de}catch{}})(),(()=>{try{return re}catch{}})()]).then(async()=>{w=X(D({name:"MerchantForm",__name:"MerchantForm",emits:["success"],setup(ne,{expose:U,emit:H}){const{t:m}=j(),f=se(),i=c(!1),V=c(""),n=c(!1),b=c(""),l=c({id:void 0,name:void 0,status:void 0,description:void 0,contact:void 0,address:void 0,contactNumber:void 0,website:void 0,complaintsHotline:void 0,customerServiceHotline:void 0,email:void 0,businessLicensePicture:void 0,expireTime:void 0}),g=A({name:[{required:!0,message:"\u5546\u6237\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],status:[{required:!0,message:"\u5546\u6237\u72B6\u6001",trigger:"blur"}]}),p=c();U({open:async(d,e)=>{if(i.value=!0,V.value=m("action."+d),b.value=d,P(),e){n.value=!0;try{l.value=await v.getMerchant(e)}finally{n.value=!1}}}});const M=H,S=async()=>{await p.value.validate(),n.value=!0;try{const d=l.value;b.value==="create"?(await v.createMerchant(d),f.success(m("common.createSuccess"))):(await v.updateMerchant(d),f.success(m("common.updateSuccess"))),i.value=!1,M("success")}finally{n.value=!1}},P=()=>{var d;l.value={id:void 0,name:void 0,status:void 0,description:void 0,contact:void 0,address:void 0,contactNumber:void 0,website:void 0,complaintsHotline:void 0,customerServiceHotline:void 0,email:void 0,businessLicensePicture:void 0,expireTime:void 0},(d=p.value)==null||d.resetFields()};return(d,e)=>{const r=O,u=R,L=E,N=G,T=J,C=le,F=ee,k=K,h=Q,z=Z,q=W;return y(),x(z,{title:a(V),modelValue:a(i),"onUpdate:modelValue":e[13]||(e[13]=o=>I(i)?i.value=o:null)},{footer:s(()=>[t(h,{onClick:S,type:"primary",disabled:a(n)},{default:s(()=>[_("\u786E \u5B9A")]),_:1},8,["disabled"]),t(h,{onClick:e[12]||(e[12]=o=>i.value=!1)},{default:s(()=>[_("\u53D6 \u6D88")]),_:1})]),default:s(()=>[B((y(),x(k,{ref_key:"formRef",ref:p,model:a(l),rules:a(g),"label-width":"100px"},{default:s(()=>[t(u,{label:"\u5546\u6237\u540D\u79F0",prop:"name"},{default:s(()=>[t(r,{modelValue:a(l).name,"onUpdate:modelValue":e[0]||(e[0]=o=>a(l).name=o),placeholder:"\u8BF7\u8F93\u5165\u5546\u6237\u540D\u79F0"},null,8,["modelValue"])]),_:1}),t(u,{label:"\u5546\u6237\u72B6\u6001",prop:"status"},{default:s(()=>[t(N,{modelValue:a(l).status,"onUpdate:modelValue":e[1]||(e[1]=o=>a(l).status=o)},{default:s(()=>[t(L,{label:"1"},{default:s(()=>[_("\u8BF7\u9009\u62E9\u5B57\u5178\u751F\u6210")]),_:1})]),_:1},8,["modelValue"])]),_:1}),t(u,{label:"\u8D1F\u8D23\u4EBA",prop:"contact"},{default:s(()=>[t(r,{modelValue:a(l).contact,"onUpdate:modelValue":e[2]||(e[2]=o=>a(l).contact=o),placeholder:"\u8BF7\u8F93\u5165\u8D1F\u8D23\u4EBA"},null,8,["modelValue"])]),_:1}),t(u,{label:"\u6240\u5728\u5730",prop:"address"},{default:s(()=>[t(r,{modelValue:a(l).address,"onUpdate:modelValue":e[3]||(e[3]=o=>a(l).address=o),placeholder:"\u8BF7\u8F93\u5165\u6240\u5728\u5730"},null,8,["modelValue"])]),_:1}),t(u,{label:"\u8D1F\u8D23\u4EBA\u7535\u8BDD",prop:"contactNumber"},{default:s(()=>[t(r,{modelValue:a(l).contactNumber,"onUpdate:modelValue":e[4]||(e[4]=o=>a(l).contactNumber=o),placeholder:"\u8BF7\u8F93\u5165\u8D1F\u8D23\u4EBA\u7535\u8BDD"},null,8,["modelValue"])]),_:1}),t(u,{label:"\u5B98\u7F51",prop:"website"},{default:s(()=>[t(r,{modelValue:a(l).website,"onUpdate:modelValue":e[5]||(e[5]=o=>a(l).website=o),placeholder:"\u8BF7\u8F93\u5165\u5B98\u7F51"},null,8,["modelValue"])]),_:1}),t(u,{label:"\u7EF4\u6743\u7535\u8BDD",prop:"complaintsHotline"},{default:s(()=>[t(r,{modelValue:a(l).complaintsHotline,"onUpdate:modelValue":e[6]||(e[6]=o=>a(l).complaintsHotline=o),placeholder:"\u8BF7\u8F93\u5165\u7EF4\u6743\u7535\u8BDD"},null,8,["modelValue"])]),_:1}),t(u,{label:"\u5BA2\u670D\u7535\u8BDD",prop:"customerServiceHotline"},{default:s(()=>[t(r,{modelValue:a(l).customerServiceHotline,"onUpdate:modelValue":e[7]||(e[7]=o=>a(l).customerServiceHotline=o),placeholder:"\u8BF7\u8F93\u5165\u5BA2\u670D\u7535\u8BDD"},null,8,["modelValue"])]),_:1}),t(u,{label:"\u90AE\u7BB1",prop:"email"},{default:s(()=>[t(r,{modelValue:a(l).email,"onUpdate:modelValue":e[8]||(e[8]=o=>a(l).email=o),placeholder:"\u8BF7\u8F93\u5165\u90AE\u7BB1"},null,8,["modelValue"])]),_:1}),t(u,{label:"\u670D\u52A1\u5230\u671F\u65F6\u95F4",prop:"expireTime"},{default:s(()=>[t(T,{modelValue:a(l).expireTime,"onUpdate:modelValue":e[9]||(e[9]=o=>a(l).expireTime=o),type:"date","value-format":"x",placeholder:"\u9009\u62E9\u670D\u52A1\u5230\u671F\u65F6\u95F4"},null,8,["modelValue"])]),_:1}),t(u,{label:"\u8425\u4E1A\u6267\u7167",prop:"businessLicensePicture"},{default:s(()=>[t(C,{modelValue:a(l).businessLicensePicture,"onUpdate:modelValue":e[10]||(e[10]=o=>a(l).businessLicensePicture=o),limit:1},null,8,["modelValue"])]),_:1}),t(u,{label:"\u7B80\u4ECB",prop:"description"},{default:s(()=>[t(F,{modelValue:a(l).description,"onUpdate:modelValue":e[11]||(e[11]=o=>a(l).description=o),height:"150px"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[q,a(n)]])]),_:1},8,["title","modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/system/sale/merchant/components/MerchantForm.vue"]])});export{ie as __tla,w as default};