2 lines
6.6 KiB
JavaScript
2 lines
6.6 KiB
JavaScript
import{_ as e}from"./index.B539-NRF.js";import{bI as t,ag as a,bX as o,b6 as l,be as r,c as n,e as p,N as s,w as i,l as c,n as d,t as u,al as _,O as m,E as h,g,bN as v,bu as b}from"./index.cWQXKwun.js";import w from"./taobao-order-operate-template.DD65ZpHF.js";import y from"./order-taobao-top-info.BMEVN1Hp.js";import{n as f}from"./account.B7yZqP5O.js";import{d as j,e as F,g as N,f as S,h as k}from"./commonOptions.BZZKMD9F.js";import"./el-col.CVb1fz-S.js";import"./el-card.Bn-Jv3D9.js";import"./el-tab-pane.DFxgvGYK.js";import"./service.BnJgHr6J.js";import"./dropdown.BvniwuoU.js";import"./deposit.DpGq6EQH.js";import"./merchant.D-ZQMN6c.js";const x={key:0},C={key:1},D={__name:"order-taobao-list",props:{channel_id:{type:[Number,String],default:""}},setup(D){const{copy:T}=t({legacy:!0});let E=[],O=[],R=[],U=[],z=[];const A=D,I=a({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:E},{label:"商户名称",type:"select",prop:"merchant_id",value:"",options:O},{label:"服务商名称",type:"select",prop:"service_id",value:"",options:R},{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:U},{label:"通知状态",type:"select",prop:"notify_status",value:"",options:z},{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=>{T(e).then(()=>{b.success("复制成功")})},G=(e,t)=>{let a="";return(1==t?U:z).some(t=>{if(t.value==e)return a=t.label,!0}),a},P=()=>{I.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value="completed_at"===e.prop?[]:o():e.value=""}),X()};const X=()=>{var e,t;I.loading=!0;let a={per_page:I.per_page,page:I.page,channel_id:A.channel_id},o=function(e){const t={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(t[e.prop]=e.value)}),t}(I.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,f(Object.assign(a,o)).then(e=>{Array.isArray(e.data)||(e.data=[]);const t=e.data.some(e=>3==e.status),a=I.columns.find(e=>"operate"==e.prop);a&&(a.width=t?440:180),I.tableData=e.data,I.total=e.total,I.loading=!1}).catch(()=>{I.loading=!1})};return l(()=>{I.searchFields.forEach(e=>{"channel_name"===e.prop&&(e.options=E=j()),"merchant_id"===e.prop&&F().then(t=>{e.options=O=t}).catch(()=>{e.options=O=[]}),"service_id"===e.prop&&N().then(t=>{e.options=R=t}).catch(()=>{e.options=R=[]}),"notify_status"===e.prop&&(e.options=z=S()),"status"===e.prop&&(e.options=U=k())}),X()}),(t,a)=>{const o=r("DocumentCopy"),l=h,v=e;return p(),n("div",null,[s(y),s(v,{type:"export",columns:g(I).columns,searchFields:g(I).searchFields,"onUpdate:searchFields":a[0]||(a[0]=e=>g(I).searchFields=e),data:g(I).tableData,per_page:g(I).per_page,"onUpdate:per_page":a[1]||(a[1]=e=>g(I).per_page=e),page:g(I).page,"onUpdate:page":a[2]||(a[2]=e=>g(I).page=e),total:g(I).total,onGetTableData:X,onResetForm:P,loading:g(I).loading,showSelection:!1,showRightRefreshSlot:!0},{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?(p(),n("div",x,[s(l,{onClick:t=>q(e.order_no),size:16,color:"#5f80c7"},{default:i(()=>[s(o)]),_:2},1032,["onClick"]),m(" "+u(null==e?void 0:e.order_no),1)])):_("",!0),e.merchant_order_no?(p(),n("div",C,[s(l,{onClick:t=>q(e.merchant_order_no),size:16,color:"#5f80c7"},{default:i(()=>[s(o)]),_: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(G(e.status,1)),3)]),notify_status_slot:i(({row:e})=>[c("span",{class:d(["table-status-color-"+e.notify_status])},u(G(e.notify_status,2)),3)]),operate:i(({row:e})=>[s(w,{rows:e,showNotifyStatusTxt:G},null,8,["rows"])]),_:1},8,["columns","searchFields","data","per_page","page","total","loading"])])}}};export{D as default};
|