import{_ as e,r as a,a2 as l,E as s,bx as o,by as t,d,e as r,f as i,k as p,h as m,n as u,w as n,j as c,g as f,cK as b,F as v,l as _,an as j,q as h,bf as x,t as g,v as V}from"./index.286e9b79.js";import{v as y}from"./loading.c49775a6.js";import{E as k}from"./dialog.ec9503d2.js";import"./overlay.2c1583ac.js";import{E as w,a as E}from"./form.ad10dcd5.js";import{E as C}from"./input.31de1b37.js";import{E as q}from"./progress.27d0e11c.js";import"./form-item.9355e6dc.js";/* empty css            */import{E as B,a as I}from"./select.297a82d5.js";import{g as U,p as z}from"./http.f588794f.js";import"./event.776e7e11.js";import"./scroll.a50153b5.js";import"./_initCloneObject.fb8fbaea.js";import"./index.ed3ed02e.js";import"./cloneDeep.15b627aa.js";import"./isEqual.57d72c4a.js";import"./index.27150c7e.js";import"./token.34cb8214.js";import"./strings.8c60bfae.js";import"./_baseIteratee.9ead53a1.js";import"./debounce.caafe00b.js";const A={key:0,class:"detail-box"},D=(e=>(g("data-v-41aa629f"),e=e(),V(),e))((()=>m("div",{class:"form-item-tips"},"请上传发货模板",-1))),F={class:"dialog-footer"},K=e({__name:"detail",props:{modelValue:Boolean},emits:["update:modelValue","change","close"],setup(e,{emit:g}){const V=e,K=g;let O=a(!1),T=a({});l((()=>V.modelValue),((e,a)=>{e?(O.value=!0,U("order.shipping/detail",{id:V.id}).then((e=>{O.value=!1,e.code?T.value=e.data:s.error(e.msg)}))):T.value={}}));let G=a({express_id:"0",file:""});const H=()=>{if(G.value.express_id<=0)return s.error("请选择物流公司"),!1;z("order.shipping/import",{id:P.value.id,express_id:G.value.express_id}).then((e=>{e.code?(K("update:modelValue",!1),s.success("执行成功")):s.error(e.msg)}))},J=()=>{K("update:modelValue",!1),K("close")};let L=a(!1),M=a(o.base_url+"/order.shipping/upload"),N=a({Authorization:"Bearer "+t().getToken()}),P=a({id:0});const Q=e=>{L.value=!0,O.value=!0},R=(e,a)=>{L.value=!1,O.value=!1,1==e.code?(P.value.id=e.data.id,G.value.file=e.data.path):s.error(e.msg)},S=(e,a,l)=>{L.value=!1};return(e,a)=>{const l=B,s=I,o=w,t=h,g=q,U=C,z=E,K=x,W=k,X=y;return d(),r("div",null,[i(W,{"model-value":V.modelValue,title:"批量发货",width:"1100",center:"","align-center":"",onClose:J},{footer:p((()=>[m("span",F,[i(t,{onClick:J},{default:p((()=>[u("取消")])),_:1}),i(t,{onClick:H,type:"primary"},{default:p((()=>[u("确认")])),_:1})])])),default:p((()=>[n((d(),c(K,{height:"500px"},{default:p((()=>[f(b)(f(T))?j("",!0):(d(),r("div",A,[i(z,{model:f(G),style:{"margin-top":"20px","margin-bottom":"50px"}},{default:p((()=>[i(o,{label:"物流公司","label-width":"100px"},{default:p((()=>[i(s,{modelValue:f(G).express_id,"onUpdate:modelValue":a[0]||(a[0]=e=>f(G).express_id=e),placeholder:"请选择",style:{width:"100%"}},{default:p((()=>[i(l,{label:"请选择",value:"0"}),(d(!0),r(v,null,_(f(T),((e,a)=>(d(),c(l,{key:a,label:e.title,value:e.id},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),i(o,{label:"上传文件","label-width":"100px"},{default:p((()=>[i(U,{modelValue:f(G).file,"onUpdate:modelValue":a[1]||(a[1]=e=>f(G).file=e),placeholder:"请选择文件",readonly:!0,style:{width:"400px"}},{append:p((()=>[i(g,{disabled:f(L),headers:f(N),data:f(P),action:f(M),accept:".csv,.xls,.xlsx","show-file-list":!1,"on-success":R,"on-error":S,"before-upload":Q},{default:p((()=>[i(t,null,{default:p((()=>[u("选择文件")])),_:1})])),_:1},8,["disabled","headers","data","action"])])),_:1},8,["modelValue"]),D])),_:1})])),_:1},8,["model"])]))])),_:1})),[[X,f(O)]])])),_:1},8,["model-value"])])}}},[["__scopeId","data-v-41aa629f"]]);export{K as default};
