DeliveryForm-2cd89ff8.js 2.7 KB

1
  1. import{d as S,ar as A,y as N,e as O,r as n,x as v,w as Y,b as B,o as s,C as o,A as d,a,ac as M,V as Q,f as p,c as f,Q as b,D as z,E as C,F as D,a2 as L,dy as X,ao as q,ce as G,U as H,R as J,S as K,__tla as W}from"./index-f4562165.js";import{g as Z,__tla as $}from"./index-9901c4b6.js";import{a as aa,D as ea,__tla as la}from"./dict-880709c0.js";import{D as ta}from"./constants-c811e5ff.js";import{u as ra,__tla as sa}from"./useMessage-ba0339ee.js";import{r as T,__tla as da}from"./formRules-bcc8a150.js";import{_ as oa}from"./_plugin-vue_export-helper-1b428a4d.js";let h,ia=Promise.all([(()=>{try{return W}catch{}})(),(()=>{try{return $}catch{}})(),(()=>{try{return la}catch{}})(),(()=>{try{return sa}catch{}})(),(()=>{try{return da}catch{}})()]).then(async()=>{h=oa(S({name:"ProductDeliveryForm",__name:"DeliveryForm",props:{propFormData:{type:Object,default:()=>{}},isDetail:A.bool.def(!1)},emits:["update:activeName"],setup(i,{expose:w,emit:V}){const E=N(),I=O(()=>E.getMobile),F=ra(),_=i,m=n(),l=v({deliveryTypes:[],deliveryTemplateId:void 0}),R=v({deliveryTypes:[T],deliveryTemplateId:[T]});Y(()=>_.propFormData,t=>{t&&X(l,t)},{immediate:!0});const k=V;w({validate:async()=>{var t;if(m)try{await((t=a(m))==null?void 0:t.validate()),Object.assign(_.propFormData,l)}catch(r){throw F.error("\u3010\u7269\u6D41\u8BBE\u7F6E\u3011\u4E0D\u5B8C\u5584\uFF0C\u8BF7\u586B\u5199\u76F8\u5173\u4FE1\u606F"),k("update:activeName","delivery"),r}}});const u=n([]);return B(async()=>{u.value=await Z()}),(t,r)=>{const x=q,P=G,y=H,U=J,g=K,j=Q;return s(),o(j,{ref_key:"formRef",ref:m,model:a(l),rules:a(R),"label-width":"120px",disabled:i.isDetail,class:M(["noBorder",{view:i.isDetail,"mobile-card":a(I)}])},{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(aa)(a(ea).TRADE_DELIVERY_TYPE),e=>(s(),o(x,{key:e.value,label:e.value},{default:d(()=>[z(C(e.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),(c=a(l).deliveryTypes)!=null&&c.includes(a(ta).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})):L("",!0)]}),_:1},8,["model","rules","disabled","class"])}}}),[["__scopeId","data-v-2750247f"]])});export{ia as __tla,h as default};