import{h as B,i as g}from"./index.2e41469c.js";import{f as V,h as C}from"./index.9af1606c.js";import{h as I,i as b}from"./index.8af0c514.js";import{d as k,a6 as N,r as E,p as O,c as p,e as v,k as S,i as m,f as y,g as u,h as o,A as D,m as x,E as n,R as U,S as w,_ as j}from"./index.0308b213.js";const r=c=>(U("data-v-7ff87ceb"),c=c(),w(),c),P={key:0},L={class:"san"},M=r(()=>u("div",{style:{flex:"1"}},"\u9001\u4EF6\u4EBA\u59D3\u540D",-1)),R={style:{flex:"2"}},T={class:"san"},q=r(()=>u("div",{style:{flex:"1"}},"\u9001\u4EF6\u4EBA\u7535\u8BDD",-1)),z={style:{flex:"2"}},G={class:"san"},H=r(()=>u("div",{style:{flex:"1"}},"\u9001\u4EF6\u4EBA\u5730\u5740",-1)),J={style:{flex:"2"}},K={style:{"margin-top":"10px",display:"flex","justify-content":"flex-end"}},Q=x("\u786E\u8BA4"),W={key:1},X={class:"san"},Y=r(()=>u("div",{style:{flex:"1"}},"\u53D6\u4EF6\u4EBA\u59D3\u540D",-1)),Z={style:{flex:"2"}},$={class:"san"},ee=r(()=>u("div",{style:{flex:"1"}},"\u53D6\u4EF6\u4EBA\u7535\u8BDD",-1)),se={style:{flex:"2"}},ue={class:"san"},te=r(()=>u("div",{style:{flex:"1"}},"\u53D6\u4EF6\u4EBA\u5730\u5740",-1)),le={style:{flex:"2"}},ae={style:{"margin-top":"10px",display:"flex","justify-content":"flex-end"}},de=x("\u786E\u8BA4"),oe=k({props:{editAddressOpen:Boolean,currentAddressId:Number,currentOrderId:Number,type:Number},emits:["handleCancel"],setup(c,{emit:_}){const d=c,{OpPlatform:i}=N(),e=E({}),F=(l,s)=>{i.value=="shangpu"?g({order_id:l,address_id:s}).then(t=>{console.log(t),e.value=t}):i.value=="agent"?C({order_id:l,address_id:s}).then(t=>{console.log(t),e.value=t}):b({order_id:l,address_id:s}).then(t=>{console.log(t),e.value=t})},h=()=>{console.log("baocun",e.value),e.value.order_id=d.currentOrderId,e.value.address_id=d.currentAddressId;let l=E({});d.type==1?l.value={send_name:e.value.send_name,send_phone:e.value.send_phone,send_address:e.value.send_address,order_id:e.value.order_id,address_id:e.value.address_id}:l.value={accept_name:e.value.accept_name,accept_phone:e.value.accept_phone,accept_address:e.value.accept_address,order_id:e.value.order_id,address_id:e.value.address_id},i.value=="shangpu"?B(l.value).then(s=>{n({message:"\u63D0\u4EA4\u6210\u529F",type:"success"}),_("handleCancel")}).catch(s=>{n.error("\u63D0\u4EA4\u5931\u8D25")}):i.value=="agent"?V(l.value).then(s=>{n({message:"\u63D0\u4EA4\u6210\u529F",type:"success"}),_("handleCancel")}).catch(s=>{n.error("\u63D0\u4EA4\u5931\u8D25")}):I(l.value).then(s=>{n({message:"\u63D0\u4EA4\u6210\u529F",type:"success"}),_("handleCancel")}).catch(s=>{n.error("\u63D0\u4EA4\u5931\u8D25")})};return O(()=>d.editAddressOpen,l=>{l&&F(d.currentOrderId,d.currentAddressId)}),(l,s)=>{const t=p("el-input"),f=p("el-button"),A=p("el-dialog");return v(),S(A,{width:"800",title:"\u7F16\u8F91\u4FE1\u606F"},{default:m(()=>[d.type==2?(v(),y("div",P,[u("div",L,[M,u("div",R,[o(t,{modelValue:e.value.accept_name,"onUpdate:modelValue":s[0]||(s[0]=a=>e.value.accept_name=a),placeholder:"\u8BF7\u8F93\u5165\u9001\u4EF6\u4EBA\u59D3\u540D"},null,8,["modelValue"])])]),u("div",T,[q,u("div",z,[o(t,{modelValue:e.value.accept_phone,"onUpdate:modelValue":s[1]||(s[1]=a=>e.value.accept_phone=a),placeholder:"\u8BF7\u8F93\u5165\u9001\u4EF6\u4EBA\u7535\u8BDD"},null,8,["modelValue"])])]),u("div",G,[H,u("div",J,[o(t,{modelValue:e.value.accept_address,"onUpdate:modelValue":s[2]||(s[2]=a=>e.value.accept_address=a),type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u9001\u4EF6\u4EBA\u5730\u5740"},null,8,["modelValue"])])]),u("div",K,[o(f,{type:"primary",onClick:h},{default:m(()=>[Q]),_:1})])])):D("",!0),d.type==1?(v(),y("div",W,[u("div",X,[Y,u("div",Z,[o(t,{modelValue:e.value.send_name,"onUpdate:modelValue":s[3]||(s[3]=a=>e.value.send_name=a),placeholder:"\u8BF7\u8F93\u5165\u53D6\u4EF6\u4EBA\u59D3\u540D"},null,8,["modelValue"])])]),u("div",$,[ee,u("div",se,[o(t,{modelValue:e.value.send_phone,"onUpdate:modelValue":s[4]||(s[4]=a=>e.value.send_phone=a),placeholder:"\u8BF7\u8F93\u5165\u53D6\u4EF6\u4EBA\u7535\u8BDD"},null,8,["modelValue"])])]),u("div",ue,[te,u("div",le,[o(t,{modelValue:e.value.send_address,"onUpdate:modelValue":s[5]||(s[5]=a=>e.value.send_address=a),type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u53D6\u4EF6\u4EBA\u5730\u5740"},null,8,["modelValue"])])]),u("div",ae,[o(f,{type:"primary",onClick:h},{default:m(()=>[de]),_:1})])])):D("",!0)]),_:1})}}});const _e=j(oe,[["__scopeId","data-v-7ff87ceb"]]);export{_e as default};
