import{l as C}from"./category-c9a07555.js";import{d as U}from"./coupon-a6db8847.js";import{d as F}from"./index-8db2df2c.js";import{M as k,d as w,F as G,X as I,R as N,I as R,e as T,f as B}from"./ui-ba7aaa7e.js";import{e as E,l as M,r,P as _,a3 as f,a4 as o,f as a,H as i,a9 as P}from"./vue-bf422dc1.js";const S={name:"ExportCoupon"},J=E({...S,setup(X,{expose:c}){const t=M({cate_id:0,status:"1",range:"0",file_type:2,number:""}),v=r(!0),u=r(!1),V=async()=>{const n={...t},e=await U(n);e.code===1&&(k.success(e.msg),u.value=!1,F(e.data.url))},p=r([]);return(async()=>{const{data:n}=await C();n.list.unshift({value:0,label:"全部分类"}),p.value=n.list})(),c({init:()=>{u.value=!0}}),(n,e)=>{const b=w,s=G,d=I,m=N,g=R,y=T,x=B;return _(),f(x,{visible:u.value,"onUpdate:visible":e[5]||(e[5]=l=>u.value=l),loading:v.value,"destroy-on-close":!0,"close-on-overlay-click":!0,header:"导出优惠券","on-confirm":V},{default:o(()=>[a(y,{"label-align":"left"},{default:o(()=>[a(s,{label:"商品分类",name:"cate_id"},{default:o(()=>[a(b,{modelValue:t.cate_id,"onUpdate:modelValue":e[0]||(e[0]=l=>t.cate_id=l),placeholder:"请选择分类",help:"不选择时则表示全部分类",options:p.value},null,8,["modelValue","options"])]),_:1}),a(s,{label:"使用状态",name:"status"},{default:o(()=>[a(m,{modelValue:t.status,"onUpdate:modelValue":e[1]||(e[1]=l=>t.status=l)},{default:o(()=>[a(d,{value:"1"},{default:o(()=>[i("暂未使用")]),_:1}),a(d,{value:"2"},{default:o(()=>[i("已经使用")]),_:1})]),_:1},8,["modelValue"])]),_:1}),a(s,{label:"导出范围",name:"range"},{default:o(()=>[a(m,{modelValue:t.range,"onUpdate:modelValue":e[2]||(e[2]=l=>t.range=l)},{default:o(()=>[a(d,{value:"0"},{default:o(()=>[i("全部库存")]),_:1}),a(d,{value:"1"},{default:o(()=>[i("导出数量")]),_:1})]),_:1},8,["modelValue"])]),_:1}),t.range=="1"?(_(),f(s,{key:0,label:"导出数量",name:"number"},{default:o(()=>[a(g,{modelValue:t.number,"onUpdate:modelValue":e[3]||(e[3]=l=>t.number=l)},null,8,["modelValue"])]),_:1})):P("",!0),a(s,{label:"导出格式",name:"file_type"},{default:o(()=>[a(m,{modelValue:t.file_type,"onUpdate:modelValue":e[4]||(e[4]=l=>t.file_type=l),options:[{label:"Excel格式",value:2},{label:"TXT格式",value:1}]},null,8,["modelValue"])]),_:1})]),_:1})]),_:1},8,["visible","loading"])}}});export{J as _};
