(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[2097,1322,8821,3416,3729,2320,2359,858],{14633:function(P){P.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(P,R,t){"use strict";t.r(R),t.d(R,{default:function(){return re}});var we=t(14781),U=t(36138),Me=t(66456),B=t(61128),De=t(58024),Z=t(91894),Oe=t(57663),I=t(71577),Pe=t(34792),C=t(48086),T=t(3182),u=t(2824),Re=t(20228),$=t(11382),Ze=t(14965),J=t(91774),Ee=t(62999),E=t(54680),K=t(94043),m=t.n(K),s=t(67294),Q=t(78009),V=t(90631),X=t(14633),l=t.n(X),q=t(30381),c=t.n(q),S=t(48971),w={getMarketReportList:function(h){return(0,S.WY)("/kitchen/api/report-statistics/cash-register-report",{method:"Post",data:h})},getOrgTree:function(){return(0,S.WY)("/kitchen/api/report-statistics/org-tree",{method:"GET"})},marketingReportExport:function(h){return(0,S.WY)("/kitchen/api/report-statistics/cash-register-report-export",{method:"Post",data:h})}},_=t(53667),ee=t.n(_),n=t(85893),Ne=E.Z.TreeNode,te=J.Z.RangePicker,ae=[{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"}]}]}],ne=function(){return(0,n.jsx)("div",{className:l()["loading-card"],children:(0,n.jsx)($.Z,{size:"large"})})};function re(){var g=(0,s.useState)([]),h=(0,u.Z)(g,2),y=h[0],N=h[1],ie=(0,s.useState)(1),j=(0,u.Z)(ie,2),M=j[0],de=j[1],oe=(0,s.useState)(10),Y=(0,u.Z)(oe,2),D=Y[0],se=Y[1],le=(0,s.useState)(0),F=(0,u.Z)(le,2),ue=F[0],ce=F[1],he=(0,s.useState)([]),W=(0,u.Z)(he,2),me=W[0],ge=W[1],fe=(0,s.useState)(!1),A=(0,u.Z)(fe,2),ve=A[0],f=A[1],ye=(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)(ye,2),v=H[0],xe=H[1],ke=(0,s.useState)(""),L=(0,u.Z)(ke,2),k=L[0],b=L[1];(0,s.useEffect)(function(){z()},[M,D,v]),(0,s.useEffect)(function(){Ce()},[]);var je=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)(m().mark(function i(){var e,a;return m().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,w.getMarketReportList(e);case 5:a=d.sent,f(!1),a.statusCode===200?(N(a.data.data),ce(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)}}(),pe=function(i,e){de(i),se(e)},Ie=function(){var o=(0,T.Z)(m().mark(function i(){var e,a,r,d,O,p,G;return m().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,w.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(Se){p.push(Se)}),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(ee())(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)}}(),Ce=function(){var o=(0,T.Z)(m().mark(function i(){var e,a;return m().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return f(!0),d.next=3,w.getOrgTree();case 3:e=d.sent,f(!1),e.statusCode===200?(a=e.data,Te(a),ge(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)}}(),Te=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)(Q.ZP,{children:[ve?(0,n.jsx)(ne,{}):null,(0,n.jsx)(Z.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)(te,{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"))];xe(a)}}),(0,n.jsx)(E.Z,{style:{width:"300px",marginLeft:"50px"},dropdownStyle:{maxHeight:400,overflow:"auto"},treeData:me,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)(V.Z,{}),size:"middle",onClick:Ie,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)(Z.Z,{className:l()["table-card"],children:[(0,n.jsx)(B.Z,{dataSource:y,columns:ae,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:ue,onChange:pe})})]})]})}}}]);