2 lines
6.5 KiB
JavaScript
2 lines
6.5 KiB
JavaScript
import{_ as e}from"./index.adeDTf70.js";import{bI as t,r as a,ag as o,bW as l,b6 as s,bX as r,cB as n,be as p,c as i,e as d,N as c,w as u,l as _,n as m,t as g,al as h,O as b,E as f,an as y,g as v,bu as w,b0 as j}from"./index.CmGrdvAP.js";import{T as k,E as x}from"./taobao-order-operate-template.XbIjQdj6.js";import C from"./order-taobao-top-info.Cyy8ILy1.js";import{B as F,C as S}from"./service.CiffTCuB.js";import{i as T,h as D}from"./commonOptions.shv58xqW.js";import"./el-col.JOk_BvTM.js";import"./el-card.CmSQpdPS.js";import"./el-tab-pane.7luWZy1M.js";import"./account.CMX6ddUr.js";import"./dropdown.Bbzak-os.js";import"./deposit.BG6BWPvN.js";import"./merchant.BtK5Obkl.js";const E={key:0},A={style:{display:"flex","align-items":"center","justify-content":"center"}},R={key:0},B={key:1},z={__name:"order-taobao-list",props:{channel_id:{type:[Number,String],default:""}},setup(z){const{copy:N}=t({legacy:!0}),O=a(null),U=z;let G=[],I=[];const K=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:G},{label:"通知状态",type:"select",prop:"notify_status",value:"",options:I},{label:"充值账号",prop:"recharge_account",type:"input",value:""}],total:0,page:1,per_page:10,loading:!1,btnLoading:!1,showAddDialog:!1}),W=()=>{O.value&&"function"==typeof O.value.fetchStatistics&&O.value.fetchStatistics()},q=e=>{K.seletedCloums=e},L=()=>{j.confirm("是否确认批量补发通知?","系统提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{K.loading=!0;const e=K.seletedCloums.map(e=>e.id).filter(e=>void 0!==e);S({id:e}).then(()=>{w.success("批量补发通知成功"),M(),K.loading=!1}).catch(()=>{K.loading=!1})})},X=e=>{N(e).then(()=>{w.success("复制成功")})},H=(e,t)=>{let a="";return(1==t?G:I).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?[]:l():e.value=""}),M()};s(()=>{K.searchFields.forEach(e=>{"status"===e.prop&&(e.options=G=T()),"notify_status"===e.prop&&(e.options=I=D())}),M()});const M=()=>{var e,t;K.loading=!0;let a={per_page:K.per_page,page:K.page,channel_id:U.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_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,F(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=K.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,e.notify_time=e.notify_time?n(e.notify_time):""}),K.tableData=l,K.total=e.total,K.loading=!1}).catch(()=>{K.loading=!1})};return(t,a)=>{const o=y,l=p("Warning"),s=f,r=x,n=p("DocumentCopy"),w=e;return d(),i("div",null,[c(C,{ref_key:"topInfoRef",ref:O},null,512),c(w,{type:"export",columns:v(K).columns,searchFields:v(K).searchFields,"onUpdate:searchFields":a[0]||(a[0]=e=>v(K).searchFields=e),data:v(K).tableData,per_page:v(K).per_page,"onUpdate:per_page":a[1]||(a[1]=e=>v(K).per_page=e),page:v(K).page,"onUpdate:page":a[2]||(a[2]=e=>v(K).page=e),total:v(K).total,onGetTableData:M,onResetForm:J,onSelectionChange:q,loading:v(K).loading,showSelection:!0,isSelectionKey:!0,showRightRefreshSlot:!0},{btns:u(()=>[c(o,{disabled:!v(K).seletedCloums.length,size:"small",type:"success",onClick:L},{default:u(()=>a[3]||(a[3]=[b("批量补发通知")])),_:1,__:[3]},8,["disabled"])]),shop_name_slot:u(({row:e})=>{var t;return[_("div",null,g(null==(t=null==e?void 0:e.shop)?void 0:t.name),1)]}),status_slot:u(({row:e})=>[4==e.status?(d(),i("div",E,[c(r,{width:200},{reference:u(()=>[_("div",A,[c(s,{style:{color:"red",margin:"1px"}},{default:u(()=>[c(l)]),_:1}),_("span",{class:m(["table-status-color-"+e.status]),style:{"padding-top":"1px"}},g(H(e.status,1)),3)])]),default:u(()=>[_("div",null,g(e.error_msg),1)]),_:2},1024)])):(d(),i("span",{key:1,class:m(["table-status-color-"+e.status])},g(H(e.status,1)),3))]),order_no_slot:u(({row:e})=>[e.order_no?(d(),i("div",R,[c(s,{onClick:t=>X(e.order_no),size:16,color:"#5f80c7"},{default:u(()=>[c(n)]),_:2},1032,["onClick"]),b(" "+g(null==e?void 0:e.order_no),1)])):h("",!0),e.merchant_order_no?(d(),i("div",B,[c(s,{onClick:t=>X(e.merchant_order_no),size:16,color:"#5f80c7"},{default:u(()=>[c(n)]),_:2},1032,["onClick"]),b(" "+g(null==e?void 0:e.merchant_order_no),1)])):h("",!0)]),notify_status_slot:u(({row:e})=>[_("span",{class:m(["table-status-color-"+e.notify_status])},g(H(e.notify_status,2)),3)]),operate:u(({row:e})=>[c(k,{rows:e,showNotifyStatusTxt:H,onGetTableData:M,onRepairSuccess:W},null,8,["rows"])]),_:1},8,["columns","searchFields","data","per_page","page","total","loading"])])}}};export{z as default};
|