OrderMobileDeliveryForm-0320feac.js 10 KB

1
  1. import{d as re,r as m,L as de,u as ie,f as z,e as ue,x as me,y as ne,B as x,a as e,o as u,j as n,w as l,k as C,i as o,av as ce,c as pe,A as ve,F as fe,l as V,m as v,Z as O,P as N,t as B,z as ye,aw as be,C as ge,D as _e,G as Ve,V as he,H as we,q as ke,ax as Ce,K as De}from"./index-df709923.js";import{_ as Ue}from"./ContentWrap.vue_vue_type_script_setup_true_lang-e908c5dd.js";import{E as Te}from"./el-tree-select-880d8b15.js";import{_ as xe}from"./SPuUploadImg-8bef2528.js";import{g as Ne}from"./index-ef1d4885.js";import{s as Re,d as Ie,g as qe,u as Ae,a as Oe}from"./index-69e91744.js";import{s as Be}from"./index-014e540e.js";import Ee from"./OrderBaseInfo-129092f2.js";import Me from"./OrderProduct-b3cf4db5.js";import{d as Se}from"./tree-fd3a041e.js";import{g as He}from"./index-51b056b7.js";import{u as Le}from"./useMessage-89e9d1aa.js";import{_ as je}from"./_plugin-vue_export-helper-1b428a4d.js";import"./el-card-91c2276d.js";import"./SPuUploadImg.vue_vue_type_style_index_0_scoped_5dfa4534_lang-2a8cd6e4.js";import"./index-54511734.js";import"./el-image-viewer-90ad41b7.js";import"./formatTime-c6262bd7.js";import"./dict-017bf708.js";import"./el-descriptions-item-cc479a39.js";import"./DictTag.vue_vue_type_script_lang-6753827b.js";import"./color-6e929987.js";const ze={class:"bottom"},Fe={class:"dialog-footer"},Ge={style:{"padding-left":"11px",height:"30px","line-height":"30px"}},Ke={class:"dialog-footer"},Pe=je(re({__name:"OrderMobileDeliveryForm",emits:["success"],setup(We,{emit:F}){const E=m([]),c=m(),M=de(),{push:G}=ie(),{t:w}=ye(),y=Le(),S=z({logisticsId:[{required:!0,message:"\u8BF7\u9009\u62E9\u7269\u6D41\u516C\u53F8"}],logisticsNo:[{required:!0,message:"\u8BF7\u8F93\u5165\u5FEB\u9012\u5355\u53F7"}],attachment:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u53D1\u8D27\u9644\u4EF6"}]}),b=m(null),t=m({id:0,logisticsId:null,logisticsNo:"",deliveryRemark:"",attachment:"",smsCodeUseReqDTO:{mobile:"",scene:"1",code:""}}),H=z({smsCode:{mobile:"",scene:1}}),K=()=>{_.value=!0,t.value.smsCodeUseReqDTO.mobile=b.value.formData.receiverMobile},h=m(0),P=async()=>{H.smsCode.mobile=t.value.smsCodeUseReqDTO.mobile,await Be(H.smsCode).then(async()=>{y.success(w("login.SmsSendMsg")),h.value=60;let i=setInterval(()=>{h.value=h.value-1,h.value<=0&&clearInterval(i)},1e3)})},W=async()=>{d.value=!0;try{await Re(t.value.id,{mobile:t.value.smsCodeUseReqDTO.mobile,code:t.value.smsCodeUseReqDTO.code}),y.success("\u81EA\u63D0\u6210\u529F"),_.value=!1,U("success",!0),q()}finally{d.value=!1}},R=m(""),Z=ue(()=>R.value?I.value.filter(i=>i.name.toLowerCase().includes(R.value.toLowerCase())):I.value),J=i=>{R.value=i},Q=window.innerHeight||document.documentElement.clientHeight,d=m(!1),D=m(0),L=m(""),I=m([]);D.value=M.params.id,c.value=M.params.spuType;const q=()=>{G({name:"Order"})},U=F,X=async()=>{d.value=!0;try{if(c.value!="0"){if(t.value.logisticsId===null)return y.error("\u8BF7\u9009\u62E9\u7269\u6D41\u516C\u53F8"),!1;if(t.value.logisticsNo==="")return y.error("\u8BF7\u8F93\u5165\u7269\u6D41\u5355\u53F7"),!1}else if(!t.value.attachment)return y.error("\u8BF7\u4E0A\u4F20\u53D1\u8D27\u9644\u4EF6"),!1;const i=e(t);await Ie(i),y.success("\u53D1\u8D27\u6210\u529F"),U("success",!0),q()}finally{d.value=!1}},Y=async()=>{const{value:i}=await be.prompt("\u8BF7\u8F93\u5165\u5907\u6CE8","\u5907\u6CE8",{inputValue:L,confirmButtonText:w("common.ok"),cancelButtonText:w("common.cancel")});try{await Ae({id:t.value.id,remark:i}),y.success(w("common.updateSuccess")),b.value.getDetail(),U("success",!0)}finally{d.value=!1}};let g=m(!1),_=m(!1);const r=m({id:0,receiverName:"",receiverMobile:"",receiverAreaId:null,receiverDetailAddress:""}),$=async()=>{g.value=!0,r.value.id=b.value.formData.id,r.value.receiverName=b.value.formData.receiverName,r.value.receiverMobile=b.value.formData.receiverMobile,r.value.receiverAreaId=b.value.formData.receiverAreaId,r.value.receiverDetailAddress=b.value.formData.receiverDetailAddress},ee=async()=>{d.value=!0;try{const i=e(r);await Oe(i),y.success(w("common.updateSuccess")),g.value=!1,b.value.getDetail(),U("success",!0)}finally{d.value=!1}};return me(async()=>{t.value.id=D.value,r.value.id=D.value,await(async i=>{if(i){const a=await qe(i);a||(y.error("\u4EA4\u6613\u8BA2\u5355\u4E0D\u5B58\u5728"),close()),L.value=a.remark}})(t.value.id),I.value=await Ne(),E.value=await He(),document.getElementsByTagName("section")[1].style.padding="0px",document.getElementsByTagName("section")[1].style.width="100%",document.getElementsByTagName("section")[1].style.background="#f5f7f9",document.getElementsByTagName("section")[1].querySelector("div").style.border="none"}),ne(()=>{document.getElementsByTagName("section")[1].style.width="auto",document.getElementsByTagName("section")[1].style.padding="20px",document.getElementsByTagName("section")[1].style.background="var(--el-color-white)"}),(i,a)=>{const ae=ge,le=_e,f=Ve,k=he,se=xe,A=we,p=ke,oe=Te,j=Ce,te=Ue,T=De;return x((u(),n(te,{style:{"overflow-y":"auto"},class:"ContentWrap"},{default:l(()=>[C("div",{class:"top",style:ce([{height:e(Q)-230+"px"},{"overflow-y":"auto"}])},[o(Ee,{ref_key:"baseInfoRef",ref:b,"is-detail":!1,id:e(D)},null,8,["id"]),o(Me,{ref:"infoRef",id:e(D)},null,8,["id"])],4),C("div",ze,[x((u(),n(A,{ref:"formRef",model:e(t),"label-width":"140px",style:{},rules:e(S)},{default:l(()=>[e(c)!="0"?(u(),n(f,{key:0,label:"\u7269\u6D41\u516C\u53F8",prop:"logisticsId",style:{border:"none"}},{default:l(()=>[o(le,{modelValue:e(t).logisticsId,"onUpdate:modelValue":a[0]||(a[0]=s=>e(t).logisticsId=s),style:{width:"90%"},placeholder:"\u8BF7\u9009\u62E9",filterable:"","filter-method":J},{default:l(()=>[(u(!0),pe(fe,null,ve(e(Z),s=>(u(),n(ae,{key:s.id,label:s.name,value:s.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):V("",!0),e(c)!="0"?(u(),n(f,{key:1,label:"\u7269\u6D41\u5355\u53F7",prop:"logisticsNo",style:{border:"none"}},{default:l(()=>[o(k,{modelValue:e(t).logisticsNo,"onUpdate:modelValue":a[1]||(a[1]=s=>e(t).logisticsNo=s),style:{width:"90%"},placeholder:"\u8BF7\u5F55\u5165\u5FEB\u9012\u5355\u53F7"},null,8,["modelValue"])]),_:1})):V("",!0),e(c)=="0"?(u(),n(f,{key:2,label:"\u53D1\u8D27\u5907\u6CE8",prop:"deliveryRemark",style:{border:"none"}},{default:l(()=>[o(k,{modelValue:e(t).deliveryRemark,"onUpdate:modelValue":a[2]||(a[2]=s=>e(t).deliveryRemark=s)},null,8,["modelValue"])]),_:1})):V("",!0),e(c)=="0"?(u(),n(f,{key:3,label:"\u9644\u4EF6",prop:"attachment",style:{border:"none",display:"flex","align-items":"center"}},{default:l(()=>[o(se,{modelValue:e(t).attachment,"onUpdate:modelValue":a[3]||(a[3]=s=>e(t).attachment=s),fileSize:1},null,8,["modelValue"])]),_:1})):V("",!0)]),_:1},8,["model","rules"])),[[T,e(d)]]),C("div",null,[o(p,{onClick:q,class:O({"w-17":e(c)=="0"})},{default:l(()=>a[13]||(a[13]=[v("\u8FD4 \u56DE")])),_:1},8,["class"]),o(p,{disabled:e(d),type:"primary",onClick:Y,class:O({"w-20":e(c)=="0"})},{default:l(()=>a[14]||(a[14]=[v("\u5546\u5BB6\u5907\u6CE8")])),_:1},8,["disabled","class"]),e(c)!="0"?(u(),n(p,{key:0,disabled:e(d),type:"primary",onClick:$},{default:l(()=>a[15]||(a[15]=[v("\u4FEE\u6539\u5730\u5740")])),_:1},8,["disabled"])):V("",!0),e(c)!="0"?(u(),n(p,{key:1,disabled:e(d),type:"primary",onClick:K},{default:l(()=>a[16]||(a[16]=[v("\u81EA \u63D0")])),_:1},8,["disabled"])):V("",!0),o(p,{disabled:e(d),type:"primary",onClick:X,class:O({"w-20":e(c)=="0"})},{default:l(()=>a[17]||(a[17]=[v("\u53D1 \u8D27")])),_:1},8,["disabled","class"])])]),o(j,{modelValue:e(g),"onUpdate:modelValue":a[9]||(a[9]=s=>N(g)?g.value=s:g=s),title:"\u4FEE\u6539\u5730\u5740",width:"90%"},{footer:l(()=>[C("div",Fe,[o(p,{onClick:a[8]||(a[8]=s=>N(g)?g.value=!1:g=!1)},{default:l(()=>a[18]||(a[18]=[v("\u53D6\u6D88")])),_:1}),o(p,{type:"primary",onClick:ee},{default:l(()=>a[19]||(a[19]=[v(" \u786E\u8BA4 ")])),_:1})])]),default:l(()=>[x((u(),n(A,{ref:"formRef",model:e(r),"label-width":"80"},{default:l(()=>[o(f,{label:"\u6536\u4EF6\u4EBA",style:{border:"none"}},{default:l(()=>[o(k,{modelValue:e(r).receiverName,"onUpdate:modelValue":a[4]||(a[4]=s=>e(r).receiverName=s),placeholder:"\u8BF7\u8F93\u5165\u6536\u4EF6\u4EBA\u540D\u79F0"},null,8,["modelValue"])]),_:1}),o(f,{label:"\u624B\u673A\u53F7",style:{border:"none"}},{default:l(()=>[o(k,{modelValue:e(r).receiverMobile,"onUpdate:modelValue":a[5]||(a[5]=s=>e(r).receiverMobile=s),placeholder:"\u8BF7\u8F93\u5165\u6536\u4EF6\u4EBA\u624B\u673A\u53F7"},null,8,["modelValue"])]),_:1}),o(f,{label:"\u6240\u5728\u5730",style:{border:"none"}},{default:l(()=>[o(oe,{modelValue:e(r).receiverAreaId,"onUpdate:modelValue":a[6]||(a[6]=s=>e(r).receiverAreaId=s),data:e(E),props:e(Se),"render-after-expand":!0},null,8,["modelValue","data","props"])]),_:1}),o(f,{label:"\u8BE6\u7EC6\u5730\u5740",style:{border:"none"}},{default:l(()=>[o(k,{modelValue:e(r).receiverDetailAddress,"onUpdate:modelValue":a[7]||(a[7]=s=>e(r).receiverDetailAddress=s),rows:3,placeholder:"\u8BF7\u8F93\u5165\u6536\u4EF6\u4EBA\u8BE6\u7EC6\u5730\u5740",type:"textarea"},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])),[[T,e(d)]])]),_:1},8,["modelValue"]),o(j,{modelValue:e(_),"onUpdate:modelValue":a[12]||(a[12]=s=>N(_)?_.value=s:_=s),title:"\u81EA\u63D0",width:"90%"},{footer:l(()=>[C("div",Ke,[o(p,{onClick:a[11]||(a[11]=s=>N(_)?_.value=!1:_=!1)},{default:l(()=>a[20]||(a[20]=[v("\u53D6\u6D88")])),_:1}),o(p,{type:"primary",onClick:W},{default:l(()=>a[21]||(a[21]=[v(" \u786E\u8BA4 ")])),_:1})])]),default:l(()=>[x((u(),n(A,{model:e(t),rules:e(S),"label-width":"60px"},{default:l(()=>[o(f,{label:"\u624B\u673A\u53F7",prop:"mobile",style:{border:"none"}},{default:l(()=>[C("span",Ge,B(e(t).smsCodeUseReqDTO.mobile),1),e(h)<=0?(u(),n(p,{key:0,onClick:P,type:"primary",class:"m-l-2"},{default:l(()=>[v(B(e(w)("login.getSmsCode")),1)]),_:1})):V("",!0),e(h)>0?(u(),n(p,{key:1,disabled:!0,class:"m-l-2"},{default:l(()=>[v(B(e(h))+"\u79D2\u540E\u53EF\u91CD\u65B0\u83B7\u53D6 ",1)]),_:1})):V("",!0)]),_:1}),o(f,{label:"\u9A8C\u8BC1\u7801",prop:"smsCodeUseReqDTO.code",style:{border:"none"}},{default:l(()=>[o(k,{modelValue:e(t).smsCodeUseReqDTO.code,"onUpdate:modelValue":a[10]||(a[10]=s=>e(t).smsCodeUseReqDTO.code=s),modelModifiers:{number:!0},placeholder:"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801",max:"4"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[T,e(d)]])]),_:1},8,["modelValue"])]),_:1})),[[T,e(d)]])}}}),[["__scopeId","data-v-4315cf25"]]);export{Pe as default};