import{_ as e}from"./index.-io9LVvz.js";import{bI as t,ag as a,bX as o,b6 as l,be as r,c as n,e as s,N as p,w as i,l as c,n as d,t as u,al as _,O as m,E as h,an as g,g as b,bN as v,bu as w,b0 as y}from"./index.Bo3PvGzb.js";import f from"./taobao-order-operate-template.p19VMn2I.js";import j from"./order-taobao-top-info.CZuLfx6B.js";import{n as S,p as C}from"./account.Buw1hI-z.js";import{d as k,e as F,g as N,f as x,h as T}from"./commonOptions.Dy7ZfwN9.js";import"./el-col.Cxr9UVNr.js";import"./el-card.C0JUaEvB.js";import"./el-tab-pane.Bi59_P-m.js";import"./service.DSQXNbnG.js";import"./dropdown.BnEYr7tJ.js";import"./deposit.DBovOLer.js";import"./merchant.C-Q_y8Zh.js";const D={key:0},E={key:1},A={__name:"order-taobao-list",props:{channel_id:{type:[Number,String],default:""}},setup(A){const{copy:z}=t({legacy:!0});let O=[],R=[],U=[],B=[],G=[];const I=A,K=a({seletedCloums:[],columns:[{prop:"channel",label:"通道名称",width:100,align:"center",slot:"channelNameSolt"},{prop:"taobao_id",label:"淘宝单号",width:260,align:"center"},{prop:"recharge_account",label:"充值账号",align:"center"},{prop:"order_no",label:"系统单号/商户单号",width:320,align:"center",slot:"order_no_slot"},{prop:"merchant",label:"商户名称",width:100,align:"center",slot:"merchantNameSolt"},{prop:"service",label:"服务商名称",width:100,align:"center",slot:"serviceNameSolt"},{prop:"product_name",label:"商品名称",width:100,align:"center"},{prop:"order_amount",label:"订单金额",width:90,align:"center"},{prop:"actual_amount",label:"实收金额",width:90,align:"center"},{prop:"status",label:"订单状态",width:100,align:"center",slot:"status_slot"},{prop:"notify_status",label:"通知状态",width:100,align:"center",slot:"notify_status_slot"},{prop:"created_at",label:"下单时间",width:150,align:"center"},{prop:"completed_at",label:"完成时间",width:150,align:"center"},{prop:"notify_time",label:"通知时间",width:150,align:"center"},{prop:"remark",label:"备注",width:100,align:"center"},{prop:"merchant_fee",label:"商户手续费",width:100,align:"center"},{prop:"merchant_actual",label:"商户实收",width:90,align:"center"},{prop:"shop",label:"收款店铺",width:100,align:"center",slot:"shop_name_slot"},{prop:"recharge_account_remark",label:"收款账号备注",width:120,align:"center"},{prop:"service",label:"上级服务商",width:100,align:"center",slot:"parent_service_name_slot"},{prop:"user_ip",label:"用户IP",width:100,align:"center"},{prop:"payment_link",label:"付款链接",width:100,align:"center"},{prop:"operate",label:"操作",width:440,align:"center",slot:"operate",fixed:"right"}],tableData:[],searchFields:[{label:"通道名称",type:"select",prop:"channel_name",value:"",options:O},{label:"商户名称",type:"select",prop:"merchant_id",value:"",options:R},{label:"服务商名称",type:"select",prop:"service_id",value:"",options:U},{prop:"created_at",label:"下单时间",type:"date",dateType:"datetimerange",value:o()},{prop:"completed_at",label:"完成时间",type:"date",dateType:"datetimerange",value:[]},{label:"订单状态",type:"select",prop:"status",value:"",options:B},{label:"通知状态",type:"select",prop:"notify_status",value:"",options:G},{label:"系统单号",prop:"order_no",type:"input",value:""},{label:"商户单号",prop:"merchant_order_no",type:"input",value:""},{label:"淘宝单号",prop:"taobao_id",type:"input",value:""},{label:"商品名称",prop:"product_name",type:"input",value:""},{label:"充值账号",prop:"recharge_account",type:"input",value:""}],total:0,page:1,per_page:10,loading:!1}),q=e=>{K.seletedCloums=e},P=()=>{y.confirm("是否确认批量补发通知?","系统提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{K.loading=!0;const e=K.seletedCloums.map(e=>e.id).filter(e=>void 0!==e);C({id:e}).then(()=>{w.success("批量补发通知成功"),L(),K.loading=!1}).catch(()=>{K.loading=!1})})},X=e=>{z(e).then(()=>{w.success("复制成功")})},H=(e,t)=>{let a="";return(1==t?B:G).some(t=>{if(t.value==e)return a=t.label,!0}),a},J=()=>{K.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value="completed_at"===e.prop?[]:o():e.value=""}),L()};const L=()=>{var e,t;K.loading=!0;let a={per_page:K.per_page,page:K.page,channel_id:I.channel_id},o=function(e){const t={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(t[e.prop]=e.value)}),t}(K.searchFields);(null==(e=o.created_at)?void 0:e.length)>0&&(o.created_from=o.created_at[0]?v(o.created_at[0]):"",o.created_to=o.created_at[1]?v(o.created_at[1]):""),(null==(t=o.completed_at)?void 0:t.length)>0&&(o.completed_from=o.completed_at[0]?v(o.completed_at[0]):"",o.completed_to=o.completed_at[1]?v(o.completed_at[1]):""),delete o.created_at,delete o.completed_at,S(Object.assign(a,o)).then(e=>{Array.isArray(e.data)||(e.data=[]);const t=e.data.some(e=>3==e.status),a=K.columns.find(e=>"operate"==e.prop);a&&(a.width=t?440:180);let o=Array.isArray(e.data)?e.data:[];o.forEach(e=>{e.selectionKey=3==e.status}),K.tableData=o,K.total=e.total,K.loading=!1}).catch(()=>{K.loading=!1})};return l(()=>{K.searchFields.forEach(e=>{"channel_name"===e.prop&&(e.options=O=k()),"merchant_id"===e.prop&&F().then(t=>{e.options=R=t}).catch(()=>{e.options=R=[]}),"service_id"===e.prop&&N().then(t=>{e.options=U=t}).catch(()=>{e.options=U=[]}),"notify_status"===e.prop&&(e.options=G=x()),"status"===e.prop&&(e.options=B=T())}),L()}),(t,a)=>{const o=g,l=r("DocumentCopy"),v=h,w=e;return s(),n("div",null,[p(j),p(w,{type:"export",columns:b(K).columns,searchFields:b(K).searchFields,"onUpdate:searchFields":a[0]||(a[0]=e=>b(K).searchFields=e),data:b(K).tableData,per_page:b(K).per_page,"onUpdate:per_page":a[1]||(a[1]=e=>b(K).per_page=e),page:b(K).page,"onUpdate:page":a[2]||(a[2]=e=>b(K).page=e),total:b(K).total,onGetTableData:L,onResetForm:J,onSelectionChange:q,loading:b(K).loading,showSelection:1==A.channel_id||2==A.channel_id,isSelectionKey:!0,showRightRefreshSlot:!0},{btns:i(()=>[p(o,{disabled:!b(K).seletedCloums.length,size:"small",type:"success",onClick:P},{default:i(()=>a[3]||(a[3]=[m("批量补发通知")])),_:1,__:[3]},8,["disabled"])]),channelNameSolt:i(({row:e})=>{var t;return[c("div",null,u((null==(t=e.channel)?void 0:t.name)||""),1)]}),merchantNameSolt:i(({row:e})=>{var t;return[c("div",null,u((null==(t=e.merchant)?void 0:t.name)||""),1)]}),order_no_slot:i(({row:e})=>[e.order_no?(s(),n("div",D,[p(v,{onClick:t=>X(e.order_no),size:16,color:"#5f80c7"},{default:i(()=>[p(l)]),_:2},1032,["onClick"]),m(" "+u(null==e?void 0:e.order_no),1)])):_("",!0),e.merchant_order_no?(s(),n("div",E,[p(v,{onClick:t=>X(e.merchant_order_no),size:16,color:"#5f80c7"},{default:i(()=>[p(l)]),_:2},1032,["onClick"]),m(" "+u(null==e?void 0:e.merchant_order_no),1)])):_("",!0)]),serviceNameSolt:i(({row:e})=>{var t;return[c("div",null,u(null==(t=null==e?void 0:e.service)?void 0:t.name),1)]}),shop_name_slot:i(({row:e})=>{var t;return[c("div",null,u(null==(t=null==e?void 0:e.shop)?void 0:t.name),1)]}),parent_service_name_slot:i(({row:e})=>{var t,a;return[c("div",null,u(null==(a=null==(t=null==e?void 0:e.service)?void 0:t.parent)?void 0:a.name),1)]}),status_slot:i(({row:e})=>[c("span",{class:d(["table-status-color-"+e.status])},u(H(e.status,1)),3)]),notify_status_slot:i(({row:e})=>[c("span",{class:d(["table-status-color-"+e.notify_status])},u(H(e.notify_status,2)),3)]),operate:i(({row:e})=>[p(f,{rows:e,showNotifyStatusTxt:H,onGetTableData:L},null,8,["rows"])]),_:1},8,["columns","searchFields","data","per_page","page","total","loading","showSelection"])])}}};export{A as default};