DeliveryForm-56c630ab.js 2.7 KB

1
  1. import{d as Y,ag as j,Y as A,K as L,r as n,e as v,L as N,l as O,o as s,v as o,w as d,a,Z as S,D as q,f as p,c as f,q as b,n as M,t as B,F as D,P as K,aR as X,ad as Z,aU as C,A as G,y as H,z as J,_ as Q,__tla as W}from"./index-6d7b82ba.js";import{g as $,__tla as aa}from"./index-51575069.js";import{a as ea,D as la,__tla as ta}from"./dict-efb5f3b6.js";import{D as ra}from"./constants-a3c69b57.js";import{u as sa,__tla as da}from"./useMessage-be161634.js";import{r as T,__tla as oa}from"./formRules-7ebbbdb0.js";let w,ia=Promise.all([(()=>{try{return W}catch{}})(),(()=>{try{return aa}catch{}})(),(()=>{try{return ta}catch{}})(),(()=>{try{return da}catch{}})(),(()=>{try{return oa}catch{}})()]).then(async()=>{w=Q(Y({name:"ProductDeliveryForm",__name:"DeliveryForm",props:{propFormData:{type:Object,default:()=>{}},isDetail:j.bool.def(!1)},emits:["update:activeName"],setup(i,{expose:h,emit:F}){const I=A(),V=L(()=>I.getMobile),E=sa(),_=i,m=n(),l=v({deliveryTypes:[],deliveryTemplateId:void 0}),x=v({deliveryTypes:[T],deliveryTemplateId:[T]});N(()=>_.propFormData,t=>{t&&X(l,t)},{immediate:!0});const P=F;h({validate:async()=>{var t;if(m)try{await((t=a(m))==null?void 0:t.validate()),Object.assign(_.propFormData,l)}catch(r){throw E.error("\u3010\u7269\u6D41\u8BBE\u7F6E\u3011\u4E0D\u5B8C\u5584\uFF0C\u8BF7\u586B\u5199\u76F8\u5173\u4FE1\u606F"),P("update:activeName","delivery"),r}}});const u=n([]);return O(async()=>{u.value=await $()}),(t,r)=>{const R=Z,g=C,y=G,k=H,U=J,z=q;return s(),o(z,{ref_key:"formRef",ref:m,model:a(l),rules:a(x),"label-width":"120px",disabled:i.isDetail,class:S(["noBorder",{view:i.isDetail,"mobile-card":a(V)}])},{default:d(()=>{var c;return[p(y,{label:"\u914D\u9001\u65B9\u5F0F",prop:"deliveryTypes"},{default:d(()=>[p(g,{modelValue:a(l).deliveryTypes,"onUpdate:modelValue":r[0]||(r[0]=e=>a(l).deliveryTypes=e),class:"w-80"},{default:d(()=>[(s(!0),f(D,null,b(a(ea)(a(la).TRADE_DELIVERY_TYPE),e=>(s(),o(R,{key:e.value,label:e.value},{default:d(()=>[M(B(e.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),(c=a(l).deliveryTypes)!=null&&c.includes(a(ra).EXPRESS.type)?(s(),o(y,{key:0,label:"\u8FD0\u8D39\u6A21\u677F",prop:"deliveryTemplateId"},{default:d(()=>[p(U,{placeholder:"\u8BF7\u9009\u62E9\u8FD0\u8D39\u6A21\u677F",modelValue:a(l).deliveryTemplateId,"onUpdate:modelValue":r[1]||(r[1]=e=>a(l).deliveryTemplateId=e),class:"w-80"},{default:d(()=>[(s(!0),f(D,null,b(a(u),e=>(s(),o(k,{key:e.id,label:e.name,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):K("",!0)]}),_:1},8,["model","rules","disabled","class"])}}}),[["__scopeId","data-v-75cf19f9"],["__file","D:/zx/mall-newfeifan-zx-admin/src/views/mall/product/spu/form/DeliveryForm.vue"]])});export{ia as __tla,w as default};