TmallWeb-dist/js/order-taobao-list.BsUjVYad.js
2025-08-12 19:25:40 +08:00

2 lines
6.4 KiB
JavaScript

import{_ as e}from"./index.jIRxhgtO.js";import{bI as t,r as a,ag as o,bW as l,b6 as s,bX as r,be as n,c as p,e as i,N as d,w as c,l as u,n as _,t as m,al as g,O as h,E as b,an as f,g as y,bu as v,b0 as w}from"./index.B15cfAC-.js";import{T as j,E as k}from"./taobao-order-operate-template.DnCeFXFE.js";import x from"./order-taobao-top-info.CC3lJVSg.js";import{B as C,C as F}from"./service.C5-0HxTQ.js";import{i as S,h as T}from"./commonOptions.Bg5eYzS6.js";import"./el-col.BihFfJBL.js";import"./el-card.BP-nyCiW.js";import"./el-tab-pane.D0NkwZcG.js";import"./account.CkkGrZ3x.js";import"./dropdown.C3slpOpD.js";import"./deposit.DtrRvojR.js";import"./merchant.EQxlzML3.js";const D={key:0},E={style:{display:"flex","align-items":"center","justify-content":"center"}},A={key:0},R={key:1},z={__name:"order-taobao-list",props:{channel_id:{type:[Number,String],default:""}},setup(z){const{copy:B}=t({legacy:!0}),N=a(null),O=z;let U=[],G=[];const I=o({seletedCloums:[],columns:[{prop:"recharge_account_remark",label:"收款账号备注",width:120,align:"center"},{prop:"id",label:"唯一标识",width:90,align:"center"},{prop:"shop",label:"店铺名称",width:90,align:"center",slot:"shop_name_slot"},{prop:"taobao_id",label:"淘宝id",width:260,align:"center"},{prop:"recharge_account",label:"充值账号",align:"center"},{prop:"product_name",label:"商品名称",width:90,align:"center"},{prop:"sku_id",label:"商品编码",width:110,align:"center"},{prop:"order_amount",label:"订单金额",width:90,align:"center"},{prop:"order_no",label:"系统单号/商户单号",width:300,align:"center",slot:"order_no_slot"},{prop:"created_at",label:"下单时间",align:"center"},{prop:"completed_at",label:"完成时间",align:"center"},{prop:"expire_time",label:"付款倒计时",align:"center"},{prop:"status",label:"订单状态",width:90,align:"center",slot:"status_slot"},{prop:"notify_status",label:"通知状态",width:90,align:"center",slot:"notify_status_slot"},{prop:"notify_time",label:"通知时间",align:"center"},{prop:"operate",label:"操作",width:440,align:"center",slot:"operate",fixed:"right"}],tableData:[],searchFields:[{label:"系统单号",prop:"order_no",type:"input",value:""},{label:"商户单号",prop:"merchant_order_no",type:"input",value:""},{label:"淘宝单号",prop:"taobao_id",type:"input",value:""},{prop:"created_at",label:"下单时间",type:"date",dateType:"datetimerange",value:l()},{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:G},{label:"充值账号",prop:"recharge_account",type:"input",value:""}],total:0,page:1,per_page:10,loading:!1,btnLoading:!1,showAddDialog:!1}),K=()=>{N.value&&"function"==typeof N.value.fetchStatistics&&N.value.fetchStatistics()},W=e=>{I.seletedCloums=e},q=()=>{w.confirm("是否确认批量补发通知?","系统提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{I.loading=!0;const e=I.seletedCloums.map(e=>e.id).filter(e=>void 0!==e);F({id:e}).then(()=>{v.success("批量补发通知成功"),J(),I.loading=!1}).catch(()=>{I.loading=!1})})},L=e=>{B(e).then(()=>{v.success("复制成功")})},X=(e,t)=>{let a="";return(1==t?U:G).some(t=>{if(t.value==e)return a=t.label,!0}),a},H=()=>{I.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value="completed_at"===e.prop?[]:l():e.value=""}),J()};s(()=>{I.searchFields.forEach(e=>{"status"===e.prop&&(e.options=U=S()),"notify_status"===e.prop&&(e.options=G=T())}),J()});const J=()=>{var e,t;I.loading=!0;let a={per_page:I.per_page,page:I.page,channel_id:O.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_at_start=o.created_at[0]?r(o.created_at[0]):"",o.created_at_end=o.created_at[1]?r(o.created_at[1]):""),(null==(t=o.completed_at)?void 0:t.length)>0&&(o.completed_at_start=o.completed_at[0]?r(o.completed_at[0]):"",o.completed_at_end=o.completed_at[1]?r(o.completed_at[1]):""),delete o.created_at,delete o.completed_at,C(Object.assign(a,o)).then(e=>{Array.isArray(e.data)||(e.data=[]);const t=e.data.some(e=>3==e.status),a=e.data.some(e=>4==e.status||2==e.status),o=I.columns.find(e=>"operate"==e.prop);o&&(o.width=t?440:a?250:180);let l=Array.isArray(e.data)?e.data:[];l.forEach(e=>{e.selectionKey=3==e.status}),I.tableData=l,I.total=e.total,I.loading=!1}).catch(()=>{I.loading=!1})};return(t,a)=>{const o=f,l=n("Warning"),s=b,r=k,v=n("DocumentCopy"),w=e;return i(),p("div",null,[d(x,{ref_key:"topInfoRef",ref:N},null,512),d(w,{type:"export",columns:y(I).columns,searchFields:y(I).searchFields,"onUpdate:searchFields":a[0]||(a[0]=e=>y(I).searchFields=e),data:y(I).tableData,per_page:y(I).per_page,"onUpdate:per_page":a[1]||(a[1]=e=>y(I).per_page=e),page:y(I).page,"onUpdate:page":a[2]||(a[2]=e=>y(I).page=e),total:y(I).total,onGetTableData:J,onResetForm:H,onSelectionChange:W,loading:y(I).loading,showSelection:!0,isSelectionKey:!0,showRightRefreshSlot:!0},{btns:c(()=>[d(o,{disabled:!y(I).seletedCloums.length,size:"small",type:"success",onClick:q},{default:c(()=>a[3]||(a[3]=[h("批量补发通知")])),_:1,__:[3]},8,["disabled"])]),shop_name_slot:c(({row:e})=>{var t;return[u("div",null,m(null==(t=null==e?void 0:e.shop)?void 0:t.name),1)]}),status_slot:c(({row:e})=>[4==e.status?(i(),p("div",D,[d(r,{width:200},{reference:c(()=>[u("div",E,[d(s,{style:{color:"red",margin:"1px"}},{default:c(()=>[d(l)]),_:1}),u("span",{class:_(["table-status-color-"+e.status]),style:{"padding-top":"1px"}},m(X(e.status,1)),3)])]),default:c(()=>[u("div",null,m(e.error_msg),1)]),_:2},1024)])):(i(),p("span",{key:1,class:_(["table-status-color-"+e.status])},m(X(e.status,1)),3))]),order_no_slot:c(({row:e})=>[e.order_no?(i(),p("div",A,[d(s,{onClick:t=>L(e.order_no),size:16,color:"#5f80c7"},{default:c(()=>[d(v)]),_:2},1032,["onClick"]),h(" "+m(null==e?void 0:e.order_no),1)])):g("",!0),e.merchant_order_no?(i(),p("div",R,[d(s,{onClick:t=>L(e.merchant_order_no),size:16,color:"#5f80c7"},{default:c(()=>[d(v)]),_:2},1032,["onClick"]),h(" "+m(null==e?void 0:e.merchant_order_no),1)])):g("",!0)]),notify_status_slot:c(({row:e})=>[u("span",{class:_(["table-status-color-"+e.notify_status])},m(X(e.notify_status,2)),3)]),operate:c(({row:e})=>[d(j,{rows:e,showNotifyStatusTxt:X,onGetTableData:J,onRepairSuccess:K},null,8,["rows"])]),_:1},8,["columns","searchFields","data","per_page","page","total","loading"])])}}};export{z as default};