p__Transaction__Wallet__index.aea16e07.async.js 13 KB

1
  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[725],{8154:function(S,y,e){"use strict";e.d(y,{Z:function(){return s}});var g=e(85893);function s(O){var a=O.title,l=O.children;return(0,g.jsxs)("div",{className:"min-h-screen min-w",children:[(0,g.jsx)("div",{className:"w-[100%] h-[80px] bg-[#FAFAFA] text-[18px] flex items-center pl-[24px] font-[400]",children:a}),(0,g.jsx)("div",{className:" min-h-[auto] m-[24px] flex flex-col gap-[24px]",children:l})]})}},78843:function(S,y,e){"use strict";e.d(y,{Z:function(){return I}});var g=e(97857),s=e.n(g),O=e(40110),a=e(55102),l=e(83622),n=e(85893);function I(f){var d=f.title,R=f.inputProps,x=f.submitFun;return(0,n.jsxs)("div",{className:"w-auto h-[130px] bg-white p-[24px] rounded-[4px] flex gap-[24px] flex-col",children:[(0,n.jsx)("div",{children:d}),(0,n.jsxs)("div",{className:"flex gap-[16px]",children:[(0,n.jsx)(a.Z,s()({prefix:(0,n.jsx)(O.Z,{className:"mr-[24px]"}),placeholder:"search...",onPressEnter:function(){x&&x()}},R)),(0,n.jsx)(l.ZP,{type:"primary",onClick:function(){x&&x()},style:{width:"48px",height:"48px",borderRadius:6,display:"flex",justifyContent:"center",alignItems:"center",fontSize:"14px",fontWeight:400,padding:16},children:"start"})]})]})}},4710:function(S,y,e){"use strict";e.d(y,{Z:function(){return x}});var g=e(97857),s=e.n(g),O=e(15009),a=e.n(O),l=e(99289),n=e.n(l),I=e(83447),f=e(61362),d=e(27950),R=e(85893);function x(E){var _=E.props,u=E.requestFun,i=E.searchKey,t=(0,d.F)();return(0,R.jsx)("div",{className:"rounded-[4px] bg-white",children:(0,R.jsx)(f.Z,s()({search:!1,pagination:{pageSize:t.md?10:5,showSizeChanger:t.md},scroll:{x:"max-content",y:t.md?600:400},cardProps:{bodyStyle:{padding:t.md?24:12}},request:n()(a()().mark(function p(){var A;return a()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,u().then(function(j){var T=j.detail;return console.log("detail",T),{success:!0,data:T}});case 2:if(A=c.sent,!i){c.next=9;break}return console.log("searchKey",i),A.data=(0,I.Z)({dataSource:A.data,keyWord:i}),c.abrupt("return",A);case 9:return c.abrupt("return",A);case 10:case"end":return c.stop()}},p)}))},_))})}},88307:function(S,y,e){"use strict";e.r(y),e.d(y,{default:function(){return Y}});var g=e(97857),s=e.n(g),O=e(15009),a=e.n(O),l=e(99289),n=e.n(l),I=e(5574),f=e.n(I),d=e(8154),R=e(78843),x=e(4710),E=e(83447),_=e(83622),u=e(67294),i=e(25901),t=e(8215),p=e(69753),A=e(76772),C=e(27484),c=e.n(C),j=e(9783),T=e.n(j),H=e(66309),v=e(85893),b=function(M){return M.WALK_IN="Walk In",M.BOOK="Book a connector",M.WITHDRAWAL="withdrawal",M.PENALTY="Penalty",M.MANUAL_REFUND="manual_refund",M}(b||{}),F=T()(T()(T()(T()(T()({},b.WALK_IN,"\u5373\u6642\u5145\u96FB"),b.BOOK,"\u5373\u6642\u5145\u96FB"),b.WITHDRAWAL,"\u81EA\u52A8\u9000\u6B3E"),b.PENALTY,"\u7F34\u4ED8\u7F70\u6B3E"),b.MANUAL_REFUND,"\u624B\u52D5\u9000\u6B3E"),Z=function($){var N=$.mainTableReload;return[{title:"ID",dataIndex:"id",width:100,ellipsis:{showTitle:!0},onCell:function(){return{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:100}}},copyable:!0},{title:"\u8A02\u55AE\u7DE8\u865F",dataIndex:["reservation","format_order_id"],width:120,ellipsis:{showTitle:!0},onCell:function(){return{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:100}}},copyable:!0},{title:"\u7528\u6236\u4FE1\u606F",dataIndex:["user","nickname"],width:150,render:function(r,o){var L,W,U;return(0,v.jsxs)("div",{children:[(0,v.jsx)("div",{children:((L=o.user)===null||L===void 0?void 0:L.nickname)||"-"}),(0,v.jsx)("div",{children:((W=o.user)===null||W===void 0?void 0:W.phone)||"-"}),(0,v.jsx)("div",{children:((U=o.user)===null||U===void 0?void 0:U.email)||"-"})]})}},{title:"\u4EA4\u6613\u985E\u578B",dataIndex:"goods_name",width:120,render:function(r){return F[r]||r},filters:[{text:"\u5373\u6642\u5145\u96FB",value:b.WALK_IN||b.BOOK},{text:"\u81EA\u52D5\u9000\u6B3E",value:b.WITHDRAWAL},{text:"\u7E73\u4ED8\u7F70\u6B3E",value:b.PENALTY},{text:"\u624B\u52D5\u9000\u6B3E",value:b.MANUAL_REFUND}],onFilter:function(r,o){return o.goods_name===r}},{title:"\u91D1\u984D",dataIndex:"amount",width:90,render:function(r){return"HKD$".concat(r)},sorter:function(r,o){return r.amount-o.amount}},{title:"\u4EA4\u6613\u72C0\u614B",dataIndex:"status_fk",width:90,render:function(r){var o={1:{text:"\u6210\u529F",color:"success"},0:{text:"\u5931\u6557",color:"error"}},L=o[r]||{text:"\u672A\u77E5",color:"default"},W=L.text,U=L.color;return(0,v.jsx)(H.Z,{color:U,children:W})}},{title:"\u9322\u5305\u9918\u984D",dataIndex:["user","wallet"],width:90,render:function(r){return"HKD$".concat(r==null?void 0:r.toFixed(2))}},{title:"\u5145\u96FB\u6642\u9593",dataIndex:["reservation","actual_start_time"],width:220,render:function(r,o){var L,W;return(0,v.jsxs)("div",{children:[(0,v.jsxs)("div",{children:["\u958B\u59CB\uFF1A",(L=o.reservation)!==null&&L!==void 0&&L.actual_start_time?c()(o.reservation.actual_start_time).format("YYYY-MM-DD HH:mm:ss"):"-"]}),(0,v.jsxs)("div",{children:["\u7D50\u675F\uFF1A",(W=o.reservation)!==null&&W!==void 0&&W.actual_end_time?c()(o.reservation.actual_end_time).format("YYYY-MM-DD HH:mm:ss"):"-"]})]})}},{title:"\u5145\u96FB\u91CF",dataIndex:["reservation","actual_total_power"],width:120,render:function(r){return r?"".concat(r,"kWh"):"-"}},{title:"\u5275\u5EFA\u6642\u9593",dataIndex:"createdAt",width:160,sorter:function(r,o){return c()(r.createdAt).valueOf()-c()(o.createdAt).valueOf()},render:function(r){return c()(r).format("YYYY-MM-DD HH:mm:ss")}},{title:"\u66F4\u65B0\u6642\u9593",dataIndex:"updatedAt",width:160,sorter:function(r,o){return c()(r.updatedAt).valueOf()-c()(o.updatedAt).valueOf()},render:function(r){return c()(r).format("YYYY-MM-DD HH:mm:ss")}}]};function Y(){var M,$=(0,u.useState)(""),N=f()($,2),m=N[0],r=N[1],o=(0,u.useRef)(),L=(0,u.useState)(!1),W=f()(L,2),U=W[0],G=W[1],J=(0,A.useLocation)();(0,u.useEffect)(function(){var w=new URLSearchParams(J.search),D=w.get("customerId");D&&r(D)},[J]);var Q=function(){var w=n()(a()().mark(function D(){var B,K;return a()().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return G(!0),h.prev=1,h.next=4,(0,i.ol)();case 4:return B=h.sent,K=B.data,m&&(K=(0,E.Z)({dataSource:K,keyWord:m})),h.next=9,(0,t.p)({filename:"\u9322\u5305\u4EA4\u6613\u8A18\u9304",data:K,columns:[{title:"\u8A02\u55AE\u7DE8\u865F",dataIndex:["reservation","format_order_id"],width:30},{title:"\u7528\u6236\u66B1\u7A31",dataIndex:["user","nickname"],width:15},{title:"\u7528\u6236\u96FB\u8A71",dataIndex:["user","phone"],width:15},{title:"\u4EA4\u6613\u985E\u578B",dataIndex:"goods_name",width:15},{title:"\u91D1\u984D(HKD$)",dataIndex:"amount",width:15},{title:"\u4EA4\u6613\u72C0\u614B",dataIndex:"status_fk",width:15,render:function(P){return P===1?"\u6210\u529F":"\u5931\u6557"}},{title:"\u9322\u5305\u9918\u984D(HKD$)",dataIndex:["user","wallet"],width:15,render:function(P){return P==null?void 0:P.toFixed(2)}},{title:"\u5145\u96FB\u958B\u59CB\u6642\u9593",dataIndex:["reservation","actual_start_time"],width:20,render:function(P){return P?c()(P).format("YYYY-MM-DD HH:mm:ss"):"-"}},{title:"\u5145\u96FB\u7D50\u675F\u6642\u9593",dataIndex:["reservation","actual_end_time"],width:20,render:function(P){return P?c()(P).format("YYYY-MM-DD HH:mm:ss"):"-"}},{title:"\u5145\u96FB\u91CF(kWh)",dataIndex:["reservation","actual_total_power"],width:15},{title:"\u5275\u5EFA\u6642\u9593",dataIndex:"createdAt",width:20,render:function(P){return c()(P).format("YYYY-MM-DD HH:mm:ss")}},{title:"\u66F4\u65B0\u6642\u9593",dataIndex:"updatedAt",width:20,render:function(P){return c()(P).format("YYYY-MM-DD HH:mm:ss")}}]});case 9:return h.prev=9,G(!1),h.finish(9);case 12:case"end":return h.stop()}},D,null,[[1,,9,12]])}));return function(){return w.apply(this,arguments)}}();return(0,v.jsxs)(d.Z,{title:"\u9322\u5305\u4EA4\u6613\u8A18\u9304",children:[(0,v.jsx)(R.Z,{title:"Search bar",submitFun:(M=o.current)===null||M===void 0?void 0:M.reload,inputProps:{value:m,onChange:function(D){var B;r(D.target.value),(B=o.current)===null||B===void 0||B.reload()}}}),(0,v.jsx)(x.Z,{searchKey:m,props:{headerTitle:"\u9322\u5305\u4EA4\u6613\u8A18\u9304",actionRef:o,pagination:{pageSize:16},toolBarRender:function(){var D=[(0,v.jsx)(_.ZP,{type:"primary",onClick:Q,loading:U,icon:(0,v.jsx)(p.Z,{}),children:U?"\u5C0E\u51FA\u4E2D...":"\u532F\u51FA\u8868\u683C"},"export")];return m&&D.push((0,v.jsx)(_.ZP,{type:"primary",onClick:function(){r(""),A.history.push("/customer")},children:"\u8FD4\u56DE\u7528\u6237\u5217\u8868"},"back")),D},columns:Z({mainTableReload:function(){var D;return(D=o.current)===null||D===void 0?void 0:D.reload()}}),request:function(){var w=n()(a()().mark(function B(){var K;return a()().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,(0,i.ol)();case 2:if(K=h.sent,console.log("order transaction dataSource==>",K),!m){h.next=6;break}return h.abrupt("return",s()(s()({},K),{},{data:(0,E.Z)({dataSource:K.data,keyWord:m})}));case 6:return h.abrupt("return",K);case 7:case"end":return h.stop()}},B)}));function D(){return w.apply(this,arguments)}return D}()}})]})}},25901:function(S,y,e){"use strict";e.d(y,{KC:function(){return n},Oh:function(){return R},P0:function(){return I},i6:function(){return f},ol:function(){return x},tC:function(){return d}});var g=e(15009),s=e.n(g),O=e(99289),a=e.n(O),l=e(76772),n=function(){var _=a()(s()().mark(function u(){return s()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,l.request)("/api/v1/admin/order/all",{method:"get"}));case 1:case"end":return t.stop()}},u)}));return function(){return _.apply(this,arguments)}}(),I=function(){var _=a()(s()().mark(function u(i){return s()().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.abrupt("return",(0,l.request)("/api/v1/admin/order/order/leave-time",{method:"get",params:{orderId:i}}));case 1:case"end":return p.stop()}},u)}));return function(i){return _.apply(this,arguments)}}(),f=function(){var _=a()(s()().mark(function u(i){return s()().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.abrupt("return",(0,l.request)("/api/v1/admin/order/unlock",{method:"put",data:{orderId:i}}));case 1:case"end":return p.stop()}},u)}));return function(i){return _.apply(this,arguments)}}(),d=function(){var _=a()(s()().mark(function u(i){var t,p;return s()().wrap(function(C){for(;;)switch(C.prev=C.next){case 0:return t=i.orderId,p=i.remark,C.abrupt("return",(0,l.request)("/api/v1/admin/order/remark",{method:"put",data:{orderId:t,remark:p}}));case 2:case"end":return C.stop()}},u)}));return function(i){return _.apply(this,arguments)}}(),R=function(){var _=a()(s()().mark(function u(){return s()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,l.request)("/api/v1/admin/customer/top-up/all",{method:"get"}));case 1:case"end":return t.stop()}},u)}));return function(){return _.apply(this,arguments)}}(),x=function(){var _=a()(s()().mark(function u(){return s()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,l.request)("/api/v1/admin/order/wallet/all",{method:"get"}));case 1:case"end":return t.stop()}},u)}));return function(){return _.apply(this,arguments)}}(),E=null},8215:function(S,y,e){"use strict";e.d(y,{p:function(){return d}});var g=e(15009),s=e.n(g),O=e(99289),a=e.n(O),l=e(2453),n=e(27484),I=e.n(n),f=e(84105),d=function(){var R=a()(s()().mark(function x(E){var _,u,i,t,p,A,C;return s()().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return _=E.filename,u=E.data,i=E.columns,j.prev=1,t=u.map(function(T){var H={};return i.forEach(function(v){var b=v.title,F=v.dataIndex,Z=v.render,Y;Array.isArray(F)?Y=F.reduce(function(M,$){return M==null?void 0:M[$]},T):Y=T[F],Z&&(Y=Z(Y,T)),H[b]=Y}),H}),p=f.P6.book_new(),A=f.P6.json_to_sheet(t),A["!cols"]=i.map(function(T){var H=T.width;return{wch:H||5}}),f.P6.book_append_sheet(p,A,"Sheet1"),C="".concat(_,"_").concat(I()().format("YYYY-MM-DD_HH-mm-ss"),".xlsx"),f.NC(p,C),l.ZP.success("\u5C0E\u51FA\u6210\u529F"),j.abrupt("return",!0);case 13:return j.prev=13,j.t0=j.catch(1),console.error("Export error:",j.t0),l.ZP.error("\u5C0E\u51FA\u5931\u6557"),j.abrupt("return",!1);case 18:case"end":return j.stop()}},x,null,[[1,13]])}));return function(E){return R.apply(this,arguments)}}()},83447:function(S,y,e){"use strict";e.d(y,{Z:function(){return g}});function g(s){var O=s.dataSource,a=s.keyWord,l=function(I,f){return I.toLowerCase().includes(f.toLowerCase())};return O.filter(function(n){var I=Object.keys(n),f=I.map(function(d){if(n[d]&&typeof n[d]=="string"&&typeof a=="string")return l(n[d],a);if(n[d]&&typeof n[d]=="number"&&typeof a=="number"){var R=n[d].toString(),x=a.toString();return l(R,x)}else if(n[d]&&typeof n[d]=="string"&&typeof a=="number"){var E=a.toString();return l(n[d],E)}else if(n[d]&&typeof n[d]=="number"&&typeof a=="string"){var _=n[d].toString();return l(_,a)}});return f.includes(!0)})}},20067:function(){}}]);