/* empty css *//* empty css */import{_ as e}from"./index-529a1bfe.js";import{_ as a}from"./index.vue_vue_type_script_setup_true_lang-99203439.js";/* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css */import{_ as l}from"./search.vue_vue_type_script_setup_true_lang-5a45fe57.js";import{_ as t}from"./index.vue_vue_type_script_setup_true_lang-565836d1.js";import{h as o}from"./moment-19b77ecd.js";/* empty css *//* empty css *//* empty css */import{s as r}from"./shortcuts-45ce8eab.js";import{d as s,W as i,aG as n,q as p,aH as d,n as u,z as m,ao as _,o as c,c as h,a as b,w as v,f,F as y,p as w,l as V,A as j,e as x,Z as g,t as k,b as D,a9 as U,as as Y,a5 as M,a6 as P,B as I,D as C,ax as z,aa as A,aI as R,X as T,ab as q,a2 as F,S as L,U as O,_ as B}from"./index-09bec398.js";import{u as E}from"./useGetList-8f2a88e4.js";import G from"./index-656dde35.js";import{_ as N}from"./create.vue_vue_type_script_setup_true_lang-34c3a582.js";import{c as H,a as K,b as Q,d as S,e as W}from"./index-4c33abcd.js";/* empty css *//* empty css */import"./index-76652288.js";import"./exportExcel-331c8441.js";/* empty css *//* empty css *//* empty css */import"./recharge.vue_vue_type_script_setup_true_lang-4d24f7ea.js";import"./consume.vue_vue_type_script_setup_true_lang-cd0a77b3.js";import"./readLog.vue_vue_type_script_setup_true_lang-d11ae7b6.js";import"./http-96de4f32.js";const X={"商户名称":"company_name","商户ID":"puser_id","优化师":"username","小程序":"play_name","用户ID":"uid","订单号":"trade_no","订单时间":"created_at","染色注册时间":"ranse_created_at","累计充值成功次数":"total_count","充值金额":"price","推广名称":"promotion_title","充值类型":"tip_text","支付方式":"pay_name","订单状态":"status_txt"},Z=e=>(L("data-v-52df5d42"),e=e(),O(),e),J={class:"table-default"},$={class:"wrapper"},ee={class:"text-lg font-bold content"},ae=Z((()=>x("br",null,null,-1))),le=Z((()=>x("br",null,null,-1))),te=B(s({__name:"index",setup(s){o().startOf("month").format("YYYY-MM-DD"),o().endOf("month").format("YYYY-MM-DD");i(),n();const{data:L,query:O,search:B,reset:Z,loading:te}=E("channel/order_list"),oe=p(!1),re=p(!1),se=p({}),ie=p({}),ne=p({}),pe=p([]),de=p([]),ue=p([]),me=p([]),_e=p([]),ce=d("rolesIdentify"),he=e=>{switch(e.status){case"PAID":return"success";case"REFUND":return"default";case"UNPAID":return"danger"}},be=e=>{if(O.value.orderTime){const a=Y(e);O.value.created_at_start=a[0],O.value.created_at_end=a[1]}else delete O.value.created_at_start,delete O.value.created_at_end},ve=(e,a)=>{switch(a){case"channelPromotionsUsers":fe("channelPromotionsUsers",{name:e});break;case"channelMiniprogram":fe("channelMiniprogram",{name:e});break;case"channelPromotions":fe("channelPromotions",{name:e})}},fe=(e,a)=>{switch(e){case"channelPromotionsUsers":Q({limit:30,...a}).then((e=>{pe.value=e.data}));break;case"channelMiniprogram":K({limit:30,...a}).then((e=>{de.value=e.data}));break;case"channelPromotions":H({limit:30,...a}).then((e=>{ue.value=e.data}))}},ye=()=>{Z()},we=(e,a)=>{switch(ne.value=a,e){case"userDetailVisible":oe.value=!0,se.value=a;break;case"applyVisible":re.value=!0,ie.value=a}},Ve=e=>{switch(e){case"userDetailVisible":oe.value=!1;break;case"applyVisible":re.value=!1}B()},je=u((()=>{var e;return null==(e=L.value)?void 0:e.data}));return m((()=>{fe("channelPromotionsUsers"),fe("channelMiniprogram"),fe("channelPromotions"),S().then((e=>{me.value=e.data})),W().then((e=>{_e.value=e.data})),B()})),(o,s)=>{const i=M,n=P,p=I,d=C,u=z,m=t,Y=l,L=A,E=R,H=T,K=q,Q=a,S=e,W=_("action"),Z=F;return c(),h("div",null,[b(Y,{search:f(B),reset:ye},{body:v((()=>[b(n,{label:"订单号",prop:"trade_no"},{default:v((()=>[b(i,{modelValue:f(O).trade_no,"onUpdate:modelValue":s[0]||(s[0]=e=>f(O).trade_no=e),placeholder:"请输入订单号",clearable:""},null,8,["modelValue"])])),_:1}),b(n,{label:"用户ID",prop:"uid"},{default:v((()=>[b(i,{modelValue:f(O).uid,"onUpdate:modelValue":s[1]||(s[1]=e=>f(O).uid=e),placeholder:"请输入用户ID",clearable:""},null,8,["modelValue"])])),_:1}),b(n,{label:"充值类型",prop:"order_type"},{default:v((()=>[b(d,{modelValue:f(O).order_type,"onUpdate:modelValue":s[2]||(s[2]=e=>f(O).order_type=e),filterable:"",clearable:"",placeholder:"选择充值类型"},{default:v((()=>[(c(!0),h(y,null,w(f(_e),(e=>(c(),V(p,{key:e.value,label:e.name,value:e.value},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),b(n,{label:"订单状态",prop:"status"},{default:v((()=>[b(d,{modelValue:f(O).status,"onUpdate:modelValue":s[3]||(s[3]=e=>f(O).status=e),filterable:"",clearable:"",placeholder:"选择订单状态"},{default:v((()=>[(c(!0),h(y,null,w(f(me),(e=>(c(),V(p,{key:e.value,label:e.name,value:e.value},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),b(n,{label:"推广名称",prop:"promotion_id"},{default:v((()=>[b(d,{modelValue:f(O).promotion_id,"onUpdate:modelValue":s[4]||(s[4]=e=>f(O).promotion_id=e),filterable:"",remote:"",clearable:"","remote-method":e=>{ve(e,"channelPromotions")},placeholder:"选择推广名称"},{default:v((()=>[(c(!0),h(y,null,w(f(ue),(e=>(c(),V(p,{key:e.promotion_id,label:e.name,value:e.promotion_id},null,8,["label","value"])))),128))])),_:1},8,["modelValue","remote-method"])])),_:1}),f(O).promotion_id?j("",!0):(c(),V(n,{key:0,label:"小程序",prop:"miniprogram_id"},{default:v((()=>[b(d,{modelValue:f(O).miniprogram_id,"onUpdate:modelValue":s[5]||(s[5]=e=>f(O).miniprogram_id=e),filterable:"",remote:"","remote-method":e=>{ve(e,"channelMiniprogram")},clearable:"",placeholder:"选择小程序"},{default:v((()=>[(c(!0),h(y,null,w(f(de),(e=>(c(),V(p,{key:e.miniprogram_id,label:e.name,value:e.miniprogram_id},null,8,["label","value"])))),128))])),_:1},8,["modelValue","remote-method"])])),_:1})),f(O).promotion_id||f(ce).includes("optimizer")?j("",!0):(c(),V(n,{key:1,label:"优化师",prop:"user_id"},{default:v((()=>[b(d,{modelValue:f(O).user_id,"onUpdate:modelValue":s[6]||(s[6]=e=>f(O).user_id=e),filterable:"",remote:"",clearable:"","remote-method":e=>{ve(e,"channelPromotionsUsers")},placeholder:"选择优化师"},{default:v((()=>[(c(!0),h(y,null,w(f(pe),(e=>(c(),V(p,{key:e.user_id,label:e.name,value:e.user_id},null,8,["label","value"])))),128))])),_:1},8,["modelValue","remote-method"])])),_:1})),b(n,{label:"订单时间"},{default:v((()=>[b(u,{"unlink-panels":"",clearable:"",onChange:be,format:"YYYY/MM/DD","value-format":"YYYY-MM-DD",modelValue:f(O).orderTime,"onUpdate:modelValue":s[7]||(s[7]=e=>f(O).orderTime=e),type:"daterange",shortcuts:f(r),"range-separator":"To","start-placeholder":"开始时间","end-placeholder":"结束时间"},null,8,["modelValue","shortcuts"])])),_:1})])),extra_button:v((()=>[b(m,{api:"channel/order_list",sheet_name:"订单列表",title_obj:f(X),extro_params:{is_export:!0,...f(O)}},null,8,["title_obj","extro_params"])])),_:1},8,["search"]),x("div",J,[g((c(),V(K,{data:f(je),class:"mt-3"},{default:v((()=>[f(ce).includes("optimizer")||f(ce).includes("company")?j("",!0):(c(),V(L,{key:0,prop:"company_name",label:"商户名称","min-width":"200px"},{default:v((e=>[x("div",null,k(e.row.company_name),1),x("div",null,"ID:"+k(e.row.puser_id),1)])),_:1})),f(ce).includes("optimizer")?j("",!0):(c(),V(L,{key:1,prop:"username",label:"优化师","show-overflow-tooltip":"","min-width":"200px"})),b(L,{prop:"play_name","show-overflow-tooltip":"",label:"小程序","min-width":"200px"}),b(L,{prop:"uid",label:"用户ID","show-overflow-tooltip":""}),b(L,{prop:"trade_no",label:"订单号","show-overflow-tooltip":"","min-width":"200px"}),b(L,{prop:"created_at",label:"订单时间","show-overflow-tooltip":"","min-width":"200px"}),b(L,{prop:"ranse_created_at",label:"染色注册时间","show-overflow-tooltip":"","min-width":"200px"}),b(L,{prop:"total_count",label:"累计充值成功次数","show-overflow-tooltip":"","min-width":"150px"}),b(L,{prop:"price",label:"充值金额","show-overflow-tooltip":""}),b(L,{prop:"promotion_title",label:"推广名称","show-overflow-tooltip":"","min-width":"200px"}),b(L,{prop:"tip_text",label:"充值类型","show-overflow-tooltip":"","min-width":"150px"}),b(L,{prop:"pay_name",label:"支付方式","show-overflow-tooltip":"","min-width":"150px"}),b(L,{prop:"status_txt",label:"订单状态","show-overflow-tooltip":"","min-width":"150px"},{default:v((e=>[x("div",$,[x("span",ee,[b(E,{class:"mx-1",type:he(e.row)},{default:v((()=>[D(k(e.row.status_txt),1)])),_:2},1032,["type"])])])])),_:1}),b(L,{label:"操作",fixed:"right"},{default:v((e=>[g((c(),V(H,{link:"",type:"primary",size:"small",onClick:a=>we("userDetailVisible",e.row)},{default:v((()=>[D("用户详情")])),_:2},1032,["onClick"])),[[W,"channel.orders.userDetails"]]),ae,"PAID"==e.row.status?g((c(),V(H,{key:0,link:"",type:"primary",size:"small",onClick:a=>we("applyVisible",e.row)},{default:v((()=>[D("申请退款")])),_:2},1032,["onClick"])),[[W,"orderRefund.RefundOrder.applyRefund"]]):j("",!0),le])),_:1})])),_:1},8,["data"])),[[Z,f(te)]]),b(Q)]),b(S,{modelValue:f(oe),"onUpdate:modelValue":s[9]||(s[9]=e=>U(oe)?oe.value=e:null),width:"50%",title:"用户详情","destroy-on-close":""},{default:v((()=>[b(G,{onClose:s[8]||(s[8]=e=>Ve("applyVisible")),primary:f(se)},null,8,["primary"])])),_:1},8,["modelValue"]),b(S,{modelValue:f(re),"onUpdate:modelValue":s[11]||(s[11]=e=>U(re)?re.value=e:null),width:"50%",title:"申请退款","destroy-on-close":""},{default:v((()=>[b(N,{onClose:s[10]||(s[10]=e=>Ve("applyVisible")),primary:f(ie)},null,8,["primary"])])),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-52df5d42"]]);export{te as default};