import{_ as e}from"./index.CVNR2r5r.js";import{ag as t,b6 as a,c as l,e as o,N as s,w as r,bd as n,l as i,t as p,g as c}from"./index.Bz9M-RWj.js";import{f as d}from"./account.jI5zTcuX.js";import{g as u,a as _,b as h,c as g}from"./commonOptions.C1GDoOxE.js";import"./el-col.BVn4d5Ug.js";import"./deposit.Chmw5j5j.js";import"./service.8BglwjgO.js";import"./merchant.CJ3GpTZD.js";const m={style:{color:"red"}},v={__name:"channel-taobao-receipt-account-list-template",props:{channel_id:{type:[Number,String],default:""}},setup(v){let b=[],w=[],f=[],y=[];const F=v,j=t({columns:[{label:"ID",prop:"id",width:90,align:"center"},{label:"服务商编号",prop:"service_code",align:"center",width:140},{label:"服务商名称",prop:"service_name",align:"center",width:110},{label:"通道",prop:"channel_name",align:"center",width:90},{label:"收款码信息",prop:"qrcode_info",align:"center",width:250,slot:"qrcode_info_slot"},{label:"今日收款笔数",prop:"today_success_count",align:"center",width:100},{label:"今日总跑量",prop:"today_count",align:"center",width:90},{label:"昨日收款笔数",prop:"yesterday_success_count",align:"center",width:100},{label:"昨日总跑量",prop:"yesterday_count",align:"center",width:100},{label:"每日限数",prop:"limit_count",align:"center",width:100},{label:"每日限额",prop:"limit_amount",align:"center",width:100},{label:"成功笔数",prop:"success_count",align:"center",width:80},{label:"总跑量",prop:"total_count",align:"center",width:100},{label:"成功率",prop:"success_rate",align:"center",width:80,slot:"success_rate_slot"},{label:"接单状态",prop:"order_status",align:"center",width:140,slot:"order_status_slot"},{label:"有效状态",prop:"status",align:"center",width:140,slot:"status_slot"},{label:"创建时间",prop:"created_at",align:"center"}],tableData:[],searchFields:[{label:"服务商编号",prop:"service_code",type:"input",value:""},{label:"服务商名称",prop:"service_name",type:"select",value:"",options:b},{label:"收款码账号",prop:"shop_name",type:"input",value:""},{label:"接单状态",prop:"order_status",type:"select",value:"",options:f},{label:"有效状态",prop:"status",type:"select",value:"",options:w},{label:"排序",prop:"sort_field",type:"select",value:"",options:y}],total:0,page:1,per_page:10,loading:!1}),x=()=>{j.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=[]:e.value=""}),V()};const V=()=>{var e,t;j.loading=!0;let a={per_page:j.per_page,page:j.page,channel_id:F.channel_id},l=function(e){const t={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(t[e.prop]=e.value)}),t}(j.searchFields);if(l.sort_field){const a=y.find(e=>e.label===l.sort_field);a&&(l.sort_type=null==(e=null==a?void 0:a.data)?void 0:e.type,l.sort_field=null==(t=null==a?void 0:a.data)?void 0:t.field)}d(Object.assign(a,l)).then(e=>{Array.isArray(e.data)||(e.data=[]),j.tableData=e.data,j.total=e.total,j.loading=!1}).catch(()=>{j.loading=!1})};return a(()=>{j.searchFields.forEach(e=>{"service_name"===e.prop&&u(!0).then(t=>{e.options=b=t}).catch(()=>{e.options=b=[]}),"order_status"===e.prop&&(e.options=f=_()),"status"===e.prop&&(e.options=w=h()),"sort_field"===e.prop&&g().then(t=>{e.options=y=t}).catch(()=>{e.options=y=[]})}),V()}),(t,a)=>{const d=n,u=e;return o(),l("div",null,[s(u,{type:"export",columns:c(j).columns,searchFields:c(j).searchFields,"onUpdate:searchFields":a[0]||(a[0]=e=>c(j).searchFields=e),data:c(j).tableData,per_page:c(j).per_page,"onUpdate:per_page":a[1]||(a[1]=e=>c(j).per_page=e),page:c(j).page,"onUpdate:page":a[2]||(a[2]=e=>c(j).page=e),total:c(j).total,onGetTableData:V,onResetForm:x,loading:c(j).loading,showSelection:!1,showRightRefreshSlot:!1},{qrcode_info_slot:r(({row:e})=>[i("div",null," 标识:"+p(e.shop_id),1),i("div",null," 账号:"+p(e.shop_name),1)]),success_rate_slot:r(({row:e})=>[i("div",m,p(e.success_rate),1)]),order_status_slot:r(({row:e})=>[s(d,{modelValue:e.order_status,"onUpdate:modelValue":t=>e.order_status=t,disabled:!0,style:{"--el-switch-on-color":"#337ecc"},"active-value":1,"inactive-value":0,"active-text":"正常","inactive-text":"禁用"},null,8,["modelValue","onUpdate:modelValue"])]),status_slot:r(({row:e})=>[s(d,{modelValue:e.status,"onUpdate:modelValue":t=>e.status=t,disabled:!0,style:{"--el-switch-on-color":"#337ecc"},"active-value":1,"inactive-value":0,"active-text":"有效","inactive-text":"无效"},null,8,["modelValue","onUpdate:modelValue"])]),_:1},8,["columns","searchFields","data","per_page","page","total","loading"])])}}};export{v as default};