import{r as s}from"./request.eff82867.js";import{a as i}from"./axios.06b5038b.js";const o="/shipping-order",h="https://api.buzhiyushu.cn",u="https://print.buzhiyushu.cn",g=e=>{const t=e==null?void 0:e.data;return t?Array.isArray(t)?{list:t,total:t.length}:{list:Array.isArray(t.list)?t.list:[],total:typeof t.total=="number"?t.total:0}:{list:[],total:0}},_=async({check_no:e,status:t,customer_id:a,warehouse_id:r,sales_order_id:n,wave_task_id:p,page:c,pageSize:d})=>{const l={check_no:e||void 0,status:t,customer_id:a,warehouse_id:r,sales_order_id:n,wave_task_id:p,page:c,page_size:d},y=await s.get(`${o}/list`,{params:l});return g(y)},w=async({status:e,page:t,pageSize:a,customer_id:r,shipping_no:n,start_date:p,end_date:c})=>{const d={status:e,page:t,page_size:a,customer_id:r,shipping_no:n||void 0,start_date:p,end_date:c},l=await s.get(`${o}/detaillist`,{params:d});return g(l)},S=async e=>{const t=await s.get(`${o}/detail`,{params:{id:e}});return(t==null?void 0:t.data)||null},D=async({total:e,outbound_order_ids:t})=>{const a=new FormData;return a.append("total",String(e)),t.forEach((r,n)=>{a.append(`order_ids[${n}]`,String(r))}),s.post(`${o}/create`,a)},O=async({shipping_order_id:e,sales_order_item_id:t,logistics_company:a,logistics_no:r})=>{const n=new FormData;return n.append("shipping_order_id",String(e)),n.append("total","1"),n.append("sales_order_item_id",String(t)),n.append("logistics_company",a),n.append("logistics_no",r),s.post(`${o}/update`,n)},b=async e=>(await i.get(`${h}/zhishu/fastMail/listApi`,{params:{shopId:e}})).data,A=async e=>{const t=new FormData;return t.append("type",e.type),t.append("partnerId",e.partnerId),t.append("secret",e.secret),t.append("orderSn",e.orderSn),t.append("contact",e.contact),t.append("phoneNumber",e.phoneNumber),t.append("province",e.province),t.append("city",e.city),t.append("area",e.area),t.append("town",e.town),t.append("remark",e.remark||""),console.log("\u8BF7\u6C42\u53C2\u6570:",Object.fromEntries(t.entries())),(await i.post(`${u}/api/print/createOrderBatch`,t)).data},$=async e=>(await i.get(`${u}/api/print/createBmOrderDaYin`,{params:e})).data,B=async e=>(await i.post(`${h}/zhishu/orderExternalGoods/submitCompanyOrder`,e,{headers:{"Content-Type":"application/json"}})).data,z=async e=>(await i.get(`${u}/api/print/printViewByWaybillNo`,{params:{waybillNo:e}})).data,E=async({user_id:e,logistics_no:t})=>{const a=new FormData;return a.append("user_id",String(e)),a.append("logistics_no",t),(await s.post("/logistics/cancel",a)).data};export{S as a,z as b,D as c,$ as d,_ as e,b as f,A as g,w as h,E as r,B as s,O as u};