import{f as e,o as l,c as a,w as o,a as t,u as s,k as u,h as r,t as d,q as i,g as n,d as c}from"./index-3714412c.js";import{_ as m}from"./uv-navbar.31c484ad.js";import{o as p,u as f,r as v}from"./useRouter.f44141c1.js";import{_,a as y}from"./uv-list.9317e3cc.js";import{_ as j}from"./uv-input.5c267c8c.js";import{_ as b}from"./uv-picker.98c08d87.js";import{_ as k}from"./upload-file.f454008f.js";import{_ as C}from"./uv-button.14a976f7.js";import{_ as h}from"./layout.99605750.js";import{q as g,r as V}from"./order.770d13ec.js";import{u as I}from"./useInterface.f3e95e31.js";import{_ as P}from"./_plugin-vue_export-helper.1b428a4d.js";import"./uv-status-bar.b515a02d.js";import"./uv-icon.c593f91d.js";import"./uv-badge.e9560e1c.js";import"./uv-loading-icon.8ba359c8.js";import"./uv-popup.e5d0df45.js";import"./uv-transition.4f5b62a8.js";import"./uv-upload.a36286c2.js";import"./api.966d6934.js";const w=P({__name:"addLogistics",setup(P){const{toast:w}=I(),{getParams:x,goBack:L,push:U}=f(),q=e(null);e(null);const B=e([]),z=e([]),A=e({code:"",name:"",postalCode:"",orderCode:"",id:"",returnPolicy:"",returnVoucher:""}),D=()=>{q.value.open()},E=e=>{console.log(e),A.value.code=e.value[0].code,A.value.name=e.value[0].name,q.value.close()},J=async()=>{A.value.code?A.value.postalCode?(await V({...A.value,returnVoucher:B.value.map((e=>e.url)).join(",")}),w({title:"填写成功"}),U({url:"/pages/refundInfo/refundInfo"},{data:{orderId:A.value.id}})):i({icon:"none",title:"请选择退货说明",duration:2e3}):i({icon:"none",title:"请选择快递公司",duration:2e3})};return p((e=>{const l=x(e);A.value.id=l.id,A.value.orderCode=l.orderCode,g().then((e=>{z.value=[e]}))})),(e,i)=>{const p=v(n("uv-navbar"),m),f=c,g=v(n("uv-list-item"),_),V=v(n("uv-input"),j),I=v(n("uv-list"),y),P=v(n("uv-picker"),b),w=v(n("upload-file"),k),x=v(n("uv-button"),C),U=v(n("layout"),h);return l(),a(U,null,{default:o((()=>[t(p,{fixed:!1,title:"填写物流","left-arrow":"",onLeftClick:s(L)},null,8,["onLeftClick"]),u("div",null,[u("div",{class:"mb-20"}),t(f,{class:"y-list"},{default:o((()=>[t(I,{border:""},{default:o((()=>[t(g,{border:"",clickable:"","right-text":"请选择","show-arrow":"",onClick:i[0]||(i[0]=()=>{})},{default:o((()=>[t(f,{class:"y-list-content"},{default:o((()=>[t(f,{class:"y-list-label"},{default:o((()=>[r("物流公司")])),_:1}),A.value.name?(l(),a(f,{key:1,class:"y-list-select",onClick:D},{default:o((()=>[r(d(A.value.name),1)])),_:1})):(l(),a(f,{key:0,class:"y-list-select-placeholder",onClick:D},{default:o((()=>[r(" 请选择 ")])),_:1}))])),_:1})])),_:1}),t(g,{border:""},{default:o((()=>[t(f,{class:"y-list-content"},{default:o((()=>[t(f,{class:"y-list-label"},{default:o((()=>[r("物流单号")])),_:1}),t(f,{class:"y-list-input"},{default:o((()=>[t(V,{placeholder:"请输入内容",border:"none",modelValue:A.value.postalCode,"onUpdate:modelValue":i[1]||(i[1]=e=>A.value.postalCode=e)},null,8,["modelValue"])])),_:1})])),_:1})])),_:1})])),_:1}),t(P,{ref_key:"logisticsPicker",ref:q,columns:z.value,keyName:"name",onConfirm:E},null,8,["columns"])])),_:1}),t(f,{class:"y-list"},{default:o((()=>[t(I,{border:""},{default:o((()=>[t(g,{border:""},{default:o((()=>[t(f,{class:"y-list-content"},{default:o((()=>[t(f,{class:"y-list-label"},{default:o((()=>[r("退货说明")])),_:1}),t(f,{class:"y-list-input"},{default:o((()=>[t(V,{placeholder:"请输入内容",border:"none",modelValue:A.value.returnPolicy,"onUpdate:modelValue":i[2]||(i[2]=e=>A.value.returnPolicy=e)},null,8,["modelValue"])])),_:1})])),_:1})])),_:1})])),_:1})])),_:1}),t(f,{class:"card noBorder full"},{default:o((()=>[t(f,{class:"card-head"},{default:o((()=>[u("div",{class:"card-title"},"上传凭证")])),_:1}),t(f,{class:"card-content"},{default:o((()=>[t(w,{modelValue:B.value,"onUpdate:modelValue":i[3]||(i[3]=e=>B.value=e)},null,8,["modelValue"])])),_:1})])),_:1})]),u("div",{class:"form-buttons"},[t(x,{round:"",block:"",type:"primary",onClick:J},{default:o((()=>[r(" 提交 ")])),_:1})])])),_:1})}}},[["__scopeId","data-v-e3680f14"]]);export{w as default};
