DeliveryForm-7af8de8d.js 2.7 KB

1
  1. import{d as j,as as z,y as A,e as N,r as n,x as v,w as O,b as Y,o as s,C as o,A as d,a,ad as B,W as C,f as p,c as f,R as b,D as M,E as L,F as D,a3 as W,dy as X,ap as q,cf as G,V as H,S as J,U as K,_ as Q,__tla as Z}from"./index-286756b9.js";import{g as $,__tla as aa}from"./index-bbc7fb57.js";import{a as ea,D as la,__tla as ta}from"./dict-82dca549.js";import{D as ra}from"./constants-637baed6.js";import{u as sa,__tla as da}from"./useMessage-084b1e70.js";import{r as T,__tla as oa}from"./formRules-b40a428a.js";let w,ia=Promise.all([(()=>{try{return Z}catch{}})(),(()=>{try{return aa}catch{}})(),(()=>{try{return ta}catch{}})(),(()=>{try{return da}catch{}})(),(()=>{try{return oa}catch{}})()]).then(async()=>{w=Q(j({name:"ProductDeliveryForm",__name:"DeliveryForm",props:{propFormData:{type:Object,default:()=>{}},isDetail:z.bool.def(!1)},emits:["update:activeName"],setup(i,{expose:h,emit:V}){const E=A(),F=N(()=>E.getMobile),I=sa(),_=i,m=n(),l=v({deliveryTypes:[],deliveryTemplateId:void 0}),x=v({deliveryTypes:[T],deliveryTemplateId:[T]});O(()=>_.propFormData,t=>{t&&X(l,t)},{immediate:!0});const R=V;h({validate:async()=>{var t;if(m)try{await((t=a(m))==null?void 0:t.validate()),Object.assign(_.propFormData,l)}catch(r){throw I.error("\u3010\u7269\u6D41\u8BBE\u7F6E\u3011\u4E0D\u5B8C\u5584\uFF0C\u8BF7\u586B\u5199\u76F8\u5173\u4FE1\u606F"),R("update:activeName","delivery"),r}}});const u=n([]);return Y(async()=>{u.value=await $()}),(t,r)=>{const k=q,P=G,y=H,U=J,g=K,S=C;return s(),o(S,{ref_key:"formRef",ref:m,model:a(l),rules:a(x),"label-width":"120px",disabled:i.isDetail,class:B(["noBorder",{view:i.isDetail,"mobile-card":a(F)}])},{default:d(()=>{var c;return[p(y,{label:"\u914D\u9001\u65B9\u5F0F",prop:"deliveryTypes"},{default:d(()=>[p(P,{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(k,{key:e.value,label:e.value},{default:d(()=>[M(L(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(g,{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(U,{key:e.id,label:e.name,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):W("",!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};