|
- (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[2097,7975,1322,1793,7005,3042,3721,607,8863,1587,4001],{14633:function(Z){Z.exports={"data-search-card":"data-search-card___22tRu","data-search-box":"data-search-box___1fl3A","search-btn-item":"search-btn-item___3ufuR","table-page":"table-page___331Uq","data-search-left":"data-search-left___29FCy","loading-card":"loading-card___oU1p6"}},87385:function(Z,P,t){"use strict";t.r(P),t.d(P,{default:function(){return ne}});var we=t(14781),U=t(36138),Se=t(66456),B=t(15711),Me=t(58024),R=t(91894),De=t(57663),I=t(71577),m=t(39428),Oe=t(34792),C=t(48086),T=t(3182),u=t(2824),Ze=t(20228),$=t(11382),Pe=t(14965),J=t(91774),Re=t(62999),E=t(54680),s=t(67294),K=t(78009),Q=t(90631),V=t(14633),l=t.n(V),X=t(30381),c=t.n(X),w=t(48971),S={getMarketReportList:function(h){return(0,w.WY)("/kitchen/api/report-statistics/cash-register-report",{method:"Post",data:h})},getOrgTree:function(){return(0,w.WY)("/kitchen/api/report-statistics/org-tree",{method:"GET"})},marketingReportExport:function(h){return(0,w.WY)("/kitchen/api/report-statistics/cash-register-report-export",{method:"Post",data:h})}},q=t(53667),_=t.n(q),n=t(85893),Ee=E.Z.TreeNode,ee=J.Z.RangePicker,te=[{title:"\u65F6\u95F4",dataIndex:"date",key:"date",width:170,align:"center",fixed:"left"},{title:"\u5E97\u94FA",dataIndex:"shopName",key:"shopName",width:170,align:"center",fixed:"left",filters:[{text:"\u56DB\u5DDD\u9ED1\u83E0\u841D\u79D1\u6280",value:"\u56DB\u5DDD\u9ED1\u83E0\u841D\u79D1\u6280"},{text:"\u56DB\u5DDD\u767D\u83E0\u841D\u79D1\u6280",value:"\u56DB\u5DDD\u767D\u83E0\u841D\u79D1\u6280"}],onFilter:function(h,y){return y.shopName.indexOf(h)===0}},{title:"\u8425\u6536",dataIndex:"revenue",key:"revenue",children:[{title:"\u8425\u4E1A\u989D",dataIndex:"turnover",key:"turnover",children:[{title:"\u6D41\u6C34",dataIndex:"revenueFlow",key:"revenueFlow",width:100,align:"center"},{title:"\u5B9E\u6536",dataIndex:"paidAmount",key:"paidAmount",width:100,align:"center"}]},{title:"\u4F18\u60E0\u660E\u7EC6",dataIndex:"discountDetails",key:"discountDetails",children:[{title:"\u4F1A\u5458\u4EF7",dataIndex:"discountMember",key:"discountMember",width:100,align:"center"},{title:"\u4F18\u60E0\u5238",dataIndex:"discountCoupon",key:"discountCoupon",width:100,align:"center"},{title:"\u6D3B\u52A8",dataIndex:"discountActivity",key:"discountActivity",width:100,align:"center"}]}]},{title:"\u5206\u7C7B\u8425\u6536",dataIndex:"classifiedRevenue",key:"classifiedRevenue",children:[{title:"\u5916\u5356\u8425\u4E1A\u989D",dataIndex:"takeOutTurnover",key:"takeOutTurnover",children:[{title:"\u5916\u5356\u8425\u6536",dataIndex:"takeOutRevenue",key:"takeOutRevenue",width:100,align:"center"},{title:"\u7F8E\u56E2\u5916\u5356",dataIndex:"meituanTakeout",key:"meituanTakeout",width:100,align:"center"},{title:"\u997F\u4E86\u4E48\u5916\u5356",dataIndex:"hungryTakeOut",key:"hungryTakeOut",width:100,align:"center"}]},{title:"\u98DF\u5802\u8425\u6536",dataIndex:"canteenRevenue",key:"canteenRevenue",children:[{title:"\u5802\u98DF\u6D41\u6C34",dataIndex:"freshWaterInTheHall",key:"freshWaterInTheHall",width:100,align:"center"},{title:"\u5802\u98DF\u5B9E\u6536",dataIndex:"paidInFood",key:"paidInFood",width:100,align:"center"}]},{title:"\u7B2C\u4E09\u65B9\u5E73\u53F0\u8425\u6536",dataIndex:"thirdPartyPlatformRevenue",key:"thirdPartyPlatformRevenue",children:[{title:"\u5927\u4F17\u70B9\u8BC4",dataIndex:"publicComments",key:"publicComments",width:100,align:"center"},{title:"\u53E3\u7891",dataIndex:"wordOfMouth",key:"wordOfMouth",width:100,align:"center"},{title:"\u6296\u97F3",dataIndex:"tiktok",key:"tiktok",width:100,align:"center"}]}]},{title:"\u5802\u98DF\u5355\u4EF7",dataIndex:"unitPriceCanteenFood",key:"unitPriceCanteenFood",children:[{title:"\u5BA2\u5355\u4EF7",dataIndex:"customerUnitPrice",key:"customerUnitPrice",children:[{title:"\u6D41\u6C34\u5355\u4EF7",dataIndex:"customerRevenueFlow",key:"customerRevenueFlow",width:100,align:"center"},{title:"\u5B9E\u6536\u5355\u4EF7",dataIndex:"customerPaidAmount",key:"customerPaidAmount",width:100,align:"center"}]},{title:"\u5355\u5355\u4EF7",dataIndex:"singleUnitPrice",key:"singleUnitPrice",children:[{title:"\u6D41\u6C34\u5355\u4EF7",dataIndex:"orderRevenueFlow",key:"orderRevenueFlow",width:100,align:"center"},{title:"\u5B9E\u6536\u5355\u4EF7",dataIndex:"orderPaidAmount",key:"orderPaidAmount",width:100,align:"center"}]}]},{title:"\u4EA4\u6613\u7B14\u6570",dataIndex:"numberOfTransactions",key:"numberOfTransactions",children:[{title:"\u73B0\u91D1",dataIndex:"sourceCashCount",key:"sourceCashCount",width:100,align:"center"},{title:"\u5FAE\u4FE1\u652F\u4ED8",dataIndex:"sourceWeChatCount",key:"sourceWeChatCount",width:100,align:"center"},{title:"\u5927\u4F17\u70B9\u8BC4",dataIndex:"numPublicComments",key:"numPublicComments",width:100,align:"center"},{title:"\u53E3\u7891",dataIndex:"numWordOfMouth",key:"numWordOfMouth",width:100,align:"center"},{title:"\u6296\u97F3",dataIndex:"numTiktok",key:"numTiktok",width:100,align:"center"},{title:"\u7F8E\u56E2\u5916\u5356",dataIndex:"numMeituanTakeout",key:"numMeituanTakeout",width:100,align:"center"},{title:"\u997F\u4E86\u4E48\u5916\u5356",dataIndex:"numHungryTakeOut",key:"numHungryTakeOut",width:100,align:"center"}]},{title:"\u6536\u5165\u6784\u6210",dataIndex:"revenueComposition",key:"revenueComposition",children:[{title:"\u6536\u5165\u6765\u6E90",dataIndex:"sourceOfIncome",key:"sourceOfIncome",children:[{title:"\u4F1A\u5458",dataIndex:"memberIncomeMoney",key:"memberIncomeMoney",width:100,align:"center"},{title:"\u975E\u4F1A\u5458",dataIndex:"nonMemberIncomeMoney",key:"nonMemberIncomeMoney",width:100,align:"center"},{title:"\u5916\u5356",dataIndex:"incomeTakeOut",key:"incomeTakeOut",width:100,align:"center"},{title:"\u56E2\u8D2D",dataIndex:"incomeGroupPurchase",key:"incomeGroupPurchase",width:100,align:"center"}]},{title:"\u6536\u5165\u7ED3\u6784",dataIndex:"revenueStructure",key:"revenueStructure",children:[{title:"\u5FAE\u4FE1\u652F\u4ED8",dataIndex:"sourceWeChatMoney",key:"sourceWeChatMoney",width:100,align:"center"},{title:"\u73B0\u91D1\u652F\u4ED8",dataIndex:"sourceCashMoney",key:"sourceCashMoney",width:100,align:"center"},{title:"\u5927\u4F17\u70B9\u8BC4",dataIndex:"incomePublicComments",key:"incomePublicComments",width:100,align:"center"},{title:"\u53E3\u7891",dataIndex:"incomeWordOfMouth",key:"incomeWordOfMouth",width:100,align:"center"},{title:"\u6296\u97F3",dataIndex:"incomeTiktok",key:"incomeTiktok",width:100,align:"center"},{title:"\u7F8E\u56E2\u5916\u5356",dataIndex:"incomeMeituan",key:"incomeMeituan",width:100,align:"center"},{title:"\u997F\u4E86\u4E48\u5916\u5356",dataIndex:"incomeHungry",key:"incomeHungry",width:100,align:"center"}]}]}],ae=function(){return(0,n.jsx)("div",{className:l()["loading-card"],children:(0,n.jsx)($.Z,{size:"large"})})};function ne(){var g=(0,s.useState)([]),h=(0,u.Z)(g,2),y=h[0],N=h[1],re=(0,s.useState)(1),j=(0,u.Z)(re,2),M=j[0],ie=j[1],de=(0,s.useState)(10),Y=(0,u.Z)(de,2),D=Y[0],oe=Y[1],se=(0,s.useState)(0),F=(0,u.Z)(se,2),le=F[0],ue=F[1],ce=(0,s.useState)([]),W=(0,u.Z)(ce,2),he=W[0],me=W[1],ge=(0,s.useState)(!1),A=(0,u.Z)(ge,2),fe=A[0],f=A[1],ve=(0,s.useState)([c()(c()(new Date(Date.now()-24*60*60*1e3*7)).format("YYYY-MM-DD 00:00:00")),c()(c()(new Date(Date.now())).format("YYYY-MM-DD 23:59:59"))]),H=(0,u.Z)(ve,2),v=H[0],ye=H[1],xe=(0,s.useState)(""),L=(0,u.Z)(xe,2),k=L[0],b=L[1];(0,s.useEffect)(function(){z()},[M,D,v]),(0,s.useEffect)(function(){Ie()},[]);var Ne=function(){var i=JSON.parse(JSON.stringify(y)),e={};y.forEach(function(a){Object.keys(a).forEach(function(r){r==="date"?e.date="\u5408\u8BA1":r=="shopName"?e.shopName="":typeof a[r]=="number"?(e[r]&&typeof e[r]=="number"||(e[r]=0),e[r]+=a[r]):e[r]="\u6682\u65E0\u7EDF\u8BA1"})}),i.push(e),N(i)},z=function(){var o=(0,T.Z)((0,m.Z)().mark(function i(){var e,a;return(0,m.Z)().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return e={startTime:v[0],endTime:v[1],current:M,pageSize:D},k.key&&(e.shopId=k.key),f(!0),d.next=5,S.getMarketReportList(e);case 5:a=d.sent,f(!1),a.statusCode===200?(N(a.data.data),ue(a.data.total)):C.default.error(a.errors||"\u83B7\u53D6\u8425\u9500\u62A5\u8868\u5931\u8D25");case 8:case"end":return d.stop()}},i)}));return function(){return o.apply(this,arguments)}}(),ke=function(i,e){ie(i),oe(e)},pe=function(){var o=(0,T.Z)((0,m.Z)().mark(function i(){var e,a,r,d,O,p,G;return(0,m.Z)().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return e={startTime:v[0],endTime:v[1]},k.key&&(e.shopId=k.key),f(!0),x.next=5,S.marketingReportExport(e);case 5:a=x.sent,f(!1),a.statusCode===200?(r={},d=new Date,O="\u8425\u9500\u62A5\u8868-"+d.toLocaleString().replaceAll("/","-"),r.fileName=O,p=[],Object.keys(a.data[0]).forEach(function(Te){p.push(Te)}),console.log("sheetHeader",p),r.datas=[{sheetData:a.data,sheetName:O,sheetFilter:p,sheetHeader:["ID","\u65F6\u95F4","\u5E97\u94FA\u540D\u79F0","\u5E97\u94FAID","\u8425\u6536\u6D41\u6C34","\u5B9E\u9645\u8425\u6536","\u4F1A\u5458\u6298\u6263","\u4F18\u60E0\u5238\u6298\u6263","\u6D3B\u52A8\u6298\u6263","\u5BA2\u5355\u4EF7-\u6D41\u6C34\u5355\u4EF7","\u5BA2\u5355\u4EF7-\u5B9E\u6536\u5355\u4EF7","\u5355\u5355\u4EF7-\u603B\u6D41\u6C34","\u5355\u5355\u4EF7-\u603B\u5B9E\u6536","\u73B0\u91D1-\u4EA4\u6613\u7B14\u6570","\u73B0\u91D1\u6536\u5165","\u5FAE\u4FE1-\u4EA4\u6613\u7B14\u6570","\u5FAE\u4FE1\u6536\u5165","\u4F1A\u5458\u6536\u5165","\u975E\u4F1A\u5458\u6536\u5165"]}],G=new(_())(r),G.saveExcel()):C.default.error(a.errors||"\u5BFC\u51FA\u5931\u8D25");case 8:case"end":return x.stop()}},i)}));return function(){return o.apply(this,arguments)}}(),Ie=function(){var o=(0,T.Z)((0,m.Z)().mark(function i(){var e,a;return(0,m.Z)().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return f(!0),d.next=3,S.getOrgTree();case 3:e=d.sent,f(!1),e.statusCode===200?(a=e.data,Ce(a),me(a)):C.default.error(e.errors||"\u83B7\u53D6\u7EC4\u7EC7\u6811\u51FA\u9519");case 6:case"end":return d.stop()}},i)}));return function(){return o.apply(this,arguments)}}(),Ce=function o(i){i.forEach(function(e){e.children&&e.children.length>0?o(e.children):e.type===2||e.type===3?e.disabled=!1:e.disabled=!0})};return(0,n.jsxs)(K.ZP,{children:[fe?(0,n.jsx)(ae,{}):null,(0,n.jsx)(R.Z,{className:l()["data-search-card"],children:(0,n.jsxs)("div",{className:l()["data-search-box"],children:[(0,n.jsxs)("div",{className:l()["data-search-left"],children:[(0,n.jsx)(ee,{className:l()["my-range-picker"],value:v,onChange:function(i,e){var a=[c()(c()(new Date(e[0])).format("YYYY-MM-DD 00:00:00")),c()(c()(new Date(e[1])).format("YYYY-MM-DD 23:59:59"))];ye(a)}}),(0,n.jsx)(E.Z,{style:{width:"300px",marginLeft:"50px"},dropdownStyle:{maxHeight:400,overflow:"auto"},treeData:he,onSelect:function(i,e){e.type===2||e===3?b(e):b("")},placeholder:"\u8BF7\u9009\u62E9\u7EC4\u7EC7\u67B6\u6784",treeDefaultExpandAll:!0})]}),(0,n.jsxs)("div",{className:l()["data-search-btns"],children:[(0,n.jsx)(I.Z,{type:"primary",icon:(0,n.jsx)(Q.Z,{}),size:"middle",onClick:pe,children:"\u4E0B\u8F7D"}),(0,n.jsx)(I.Z,{className:l()["search-btn-item"],children:"\u91CD\u7F6E"}),(0,n.jsx)(I.Z,{className:l()["search-btn-item"],type:"primary",onClick:z,children:"\u67E5\u8BE2"})]})]})}),(0,n.jsxs)(R.Z,{className:l()["table-card"],children:[(0,n.jsx)(B.Z,{dataSource:y,columns:te,bordered:!0,sticky:!0,scroll:{x:1e3},pagination:!1}),(0,n.jsx)("div",{className:l()["table-page"],children:(0,n.jsx)(U.Z,{current:M,pageSize:D,total:le,onChange:ke})})]})]})}}}]);
|