RevenueReport.razor 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  1. @page "/report/revenueReport"
  2. @attribute [ReuseTabsPage(Title = "营收报表")]
  3. <style>
  4. .revenue-report-container {
  5. padding: 16px;
  6. background-color: #f5f7fa;
  7. min-height: 100vh;
  8. box-sizing: border-box;
  9. overflow: hidden;
  10. }
  11. .filter-section {
  12. margin-bottom: 16px;
  13. padding: 16px !important;
  14. background: white;
  15. border: 1px solid #ebeef5;
  16. border-radius: 4px;
  17. }
  18. .filter-content .filter-row {
  19. display: flex;
  20. align-items: center;
  21. gap: 16px;
  22. flex-wrap: wrap;
  23. }
  24. .filter-content .filter-row .filter-item {
  25. display: flex;
  26. align-items: center;
  27. }
  28. .filter-content .filter-row .filter-item .filter-label {
  29. margin-right: 8px;
  30. font-size: 14px;
  31. color: #606266;
  32. min-width: 32px;
  33. }
  34. .filter-content .filter-row .filter-actions {
  35. display: flex;
  36. gap: 8px;
  37. margin-left: auto;
  38. }
  39. .report-section {
  40. margin-bottom: 16px;
  41. padding: 16px;
  42. background: white;
  43. border: 1px solid #ebeef5;
  44. border-radius: 4px;
  45. }
  46. .report-section:last-child {
  47. margin-bottom: 0;
  48. }
  49. .section-header {
  50. margin-bottom: 16px;
  51. padding: 0 16px;
  52. }
  53. .section-header h3 {
  54. color: #303133;
  55. font-size: 16px;
  56. border-left: 4px solid #1890ff;
  57. padding-left: 10px;
  58. margin: 0;
  59. }
  60. .summary-section {
  61. padding: 16px;
  62. }
  63. .summary-section h3 {
  64. color: #303133;
  65. font-size: 16px;
  66. margin-bottom: 16px;
  67. border-left: 4px solid #1890ff;
  68. padding-left: 10px;
  69. }
  70. .summary-content {
  71. display: flex;
  72. justify-content: space-around;
  73. }
  74. .summary-item {
  75. display: flex;
  76. flex-direction: column;
  77. align-items: center;
  78. }
  79. .summary-value {
  80. font-size: 24px;
  81. font-weight: 600;
  82. color: #1890ff;
  83. margin-bottom: 8px;
  84. }
  85. .summary-label {
  86. font-size: 14px;
  87. color: #909399;
  88. }
  89. .table-container {
  90. padding: 0 16px 16px;
  91. }
  92. /* Div表格样式 */
  93. .div-table {
  94. display: flex;
  95. flex-direction: column;
  96. border: 1px solid #ebeef5;
  97. border-radius: 4px;
  98. overflow: hidden;
  99. font-size: 14px;
  100. }
  101. .div-table-header {
  102. display: flex;
  103. background-color: #f5f7fa;
  104. font-weight: 600;
  105. color: #606266;
  106. border-bottom: 1px solid #ebeef5;
  107. }
  108. .div-table-row {
  109. display: flex;
  110. border-bottom: 1px solid #ebeef5;
  111. }
  112. .div-table-row:last-child {
  113. border-bottom: none;
  114. }
  115. .div-table-row.total-row {
  116. font-weight: 600;
  117. background-color: #f0f9ff;
  118. }
  119. .div-table-row:nth-child(even) {
  120. background-color: #fafafa;
  121. }
  122. .div-table-cell {
  123. padding: 12px 8px;
  124. text-align: center;
  125. overflow: hidden;
  126. text-overflow: ellipsis;
  127. white-space: nowrap;
  128. display: flex;
  129. align-items: center;
  130. justify-content: center;
  131. }
  132. .cell-left-align {
  133. justify-content: flex-start;
  134. text-align: left;
  135. }
  136. .cell-right-align {
  137. justify-content: flex-end;
  138. text-align: right;
  139. }
  140. .highlight-cell {
  141. color: #1890ff !important;
  142. font-weight: 500;
  143. }
  144. /* 响应式设计 */
  145. @@media (max-width: 768px) {
  146. .revenue-report-container {
  147. padding: 12px;
  148. }
  149. .filter-section {
  150. padding: 12px !important;
  151. }
  152. .filter-content .filter-row {
  153. flex-direction: column;
  154. align-items: flex-start;
  155. }
  156. .filter-content .filter-row .filter-actions {
  157. margin-left: 0;
  158. width: 100%;
  159. display: flex;
  160. justify-content: center;
  161. margin-top: 8px;
  162. }
  163. .summary-content {
  164. flex-wrap: wrap;
  165. }
  166. .summary-item {
  167. width: 50%;
  168. margin-bottom: 16px;
  169. }
  170. .div-table {
  171. overflow-x: auto;
  172. }
  173. .div-table-header,
  174. .div-table-row {
  175. min-width: 800px;
  176. }
  177. .div-table-cell {
  178. padding: 8px 4px;
  179. font-size: 12px;
  180. }
  181. }
  182. </style>
  183. <div class="revenue-report-container">
  184. <!-- 筛选条件 -->
  185. <div class="filter-section">
  186. <div class="filter-content">
  187. <div class="filter-row">
  188. <div class="filter-item">
  189. <span class="filter-label">日期</span>
  190. <DatePicker @bind-Value="ViewModel.Filter.Date"
  191. Format="yyyy-MM-dd"
  192. Style="width: 150px" />
  193. </div>
  194. <div class="filter-item">
  195. <span class="filter-label">日期</span>
  196. <DatePicker @bind-Value="ViewModel.Filter.EDate"
  197. Format="yyyy-MM-dd"
  198. Style="width: 150px" />
  199. </div>
  200. <div class="filter-item">
  201. <span class="filter-label">设备编号</span>
  202. <Input @bind-Value="ViewModel.Filter.CarNumber"
  203. Placeholder="请输入车编号"
  204. Style="width: 150px" />
  205. </div>
  206. <div class="filter-item">
  207. <span class="filter-label">车牌号</span>
  208. <Input @bind-Value="ViewModel.Filter.PlateNumber"
  209. Placeholder="请输入车牌号"
  210. Style="width: 150px" />
  211. </div>
  212. <div class="filter-actions">
  213. <Button Icon="search" OnClick="HandleQuery">查询</Button>
  214. <Button Icon="reload" OnClick="HandleReset">重置</Button>
  215. </div>
  216. </div>
  217. </div>
  218. </div>
  219. <!-- 统计摘要 -->
  220. <div class="report-section">
  221. <div class="summary-section">
  222. <h3>统计摘要</h3>
  223. <div class="summary-content">
  224. <div class="summary-item">
  225. <div class="summary-value">@ViewModel.Summary.TotalOrders</div>
  226. <div class="summary-label">总订单量</div>
  227. </div>
  228. <div class="summary-item">
  229. <div class="summary-value">@FormatCurrency(ViewModel.Summary.TotalReceivable)</div>
  230. <div class="summary-label">总应收金额</div>
  231. </div>
  232. <div class="summary-item">
  233. <div class="summary-value">@FormatCurrency(ViewModel.Summary.TotalActual)</div>
  234. <div class="summary-label">总实收金额</div>
  235. </div>
  236. <div class="summary-item">
  237. <div class="summary-value">@FormatCurrency(ViewModel.Summary.TotalRecharge)</div>
  238. <div class="summary-label">总充值金额</div>
  239. </div>
  240. </div>
  241. </div>
  242. </div>
  243. <!-- 营业收入(车) -->
  244. <div class="report-section">
  245. <div class="section-header">
  246. <h3>营业收入(车)</h3>
  247. </div>
  248. <div class="table-container">
  249. <div class="div-table">
  250. <!-- 表头 -->
  251. <div class="div-table-header">
  252. <div class="div-table-cell cell-left-align" style="width: 15%;">车牌号</div>
  253. <div class="div-table-cell cell-right-align" style="width: 10%;">单价(元)</div>
  254. <div class="div-table-cell cell-right-align" style="width: 10%;">订单量</div>
  255. <div class="div-table-cell cell-right-align" style="width: 15%;">销售升数</div>
  256. <div class="div-table-cell cell-right-align" style="width: 15%;">应收金额</div>
  257. <div class="div-table-cell cell-right-align highlight-cell" style="width: 15%;">实收金额</div>
  258. <div class="div-table-cell cell-left-align" style="width: 20%;">油品</div>
  259. </div>
  260. <!-- 表格内容 -->
  261. @foreach (var item in ViewModel.CarRevenue)
  262. {
  263. <div class="div-table-row">
  264. <div class="div-table-cell cell-left-align" style="width: 15%;">@item.CarNumber</div>
  265. <div class="div-table-cell cell-right-align" style="width: 10%;">@FormatCurrency(item.UnitPrice, true)</div>
  266. <div class="div-table-cell cell-right-align" style="width: 10%;">@item.OrderCount</div>
  267. <div class="div-table-cell cell-right-align" style="width: 15%;">@FormatNumber(item.SalesLiters)</div>
  268. <div class="div-table-cell cell-right-align" style="width: 15%;">@FormatCurrency(item.ReceivableAmount)</div>
  269. <div class="div-table-cell cell-right-align highlight-cell" style="width: 15%;">@FormatCurrency(item.ActualAmount)</div>
  270. <div class="div-table-cell cell-left-align" style="width: 20%;">@item.OilType</div>
  271. </div>
  272. }
  273. <!-- 合计行 -->
  274. <div class="div-table-row total-row">
  275. <div class="div-table-cell cell-left-align" style="width: 25%;">合计</div>
  276. <div class="div-table-cell cell-right-align" style="width: 10%;">@ViewModel.CarRevenueTotalResult.OrderCount</div>
  277. <div class="div-table-cell cell-right-align" style="width: 15%;">@FormatNumber(ViewModel.CarRevenueTotalResult.SalesLiters)</div>
  278. <div class="div-table-cell cell-right-align" style="width: 15%;">@FormatCurrency(ViewModel.CarRevenueTotalResult.ReceivableAmount)</div>
  279. <div class="div-table-cell cell-right-align highlight-cell" style="width: 15%;">@FormatCurrency(ViewModel.CarRevenueTotalResult.ActualAmount)</div>
  280. <div class="div-table-cell cell-left-align" style="width: 20%;">-</div>
  281. </div>
  282. </div>
  283. </div>
  284. </div>
  285. <!-- 营业收入(油品) -->
  286. <div class="report-section">
  287. <div class="section-header">
  288. <h3>营业收入(油品)</h3>
  289. </div>
  290. <div class="table-container">
  291. <div class="div-table">
  292. <!-- 表头 -->
  293. <div class="div-table-header">
  294. <div class="div-table-cell cell-left-align" style="width: 15%;">油品</div>
  295. <div class="div-table-cell cell-right-align" style="width: 10%;">单价(元)</div>
  296. <div class="div-table-cell cell-right-align" style="width: 10%;">订单量</div>
  297. <div class="div-table-cell cell-right-align" style="width: 15%;">销售升数</div>
  298. <div class="div-table-cell cell-right-align" style="width: 15%;">应收金额</div>
  299. <div class="div-table-cell cell-right-align highlight-cell" style="width: 35%;">实收金额</div>
  300. </div>
  301. <!-- 表格内容 -->
  302. @foreach (var item in ViewModel.OilRevenue)
  303. {
  304. <div class="div-table-row">
  305. <div class="div-table-cell cell-left-align" style="width: 15%;">@item.OilType</div>
  306. <div class="div-table-cell cell-right-align" style="width: 10%;">@FormatCurrency(item.UnitPrice, true)</div>
  307. <div class="div-table-cell cell-right-align" style="width: 10%;">@item.OrderCount</div>
  308. <div class="div-table-cell cell-right-align" style="width: 15%;">@FormatNumber(item.SalesLiters)</div>
  309. <div class="div-table-cell cell-right-align" style="width: 15%;">@FormatCurrency(item.ReceivableAmount)</div>
  310. <div class="div-table-cell cell-right-align highlight-cell" style="width: 35%;">@FormatCurrency(item.ActualAmount)</div>
  311. </div>
  312. }
  313. <!-- 合计行 -->
  314. <div class="div-table-row total-row">
  315. <div class="div-table-cell cell-left-align" style="width: 15%;">合计</div>
  316. <div class="div-table-cell" style="width: 10%;">-</div>
  317. <div class="div-table-cell cell-right-align" style="width: 10%;">@ViewModel.OilRevenueTotalResult.OrderCount</div>
  318. <div class="div-table-cell cell-right-align" style="width: 15%;">@FormatNumber(ViewModel.OilRevenueTotalResult.SalesLiters)</div>
  319. <div class="div-table-cell cell-right-align" style="width: 15%;">@FormatCurrency(ViewModel.OilRevenueTotalResult.ReceivableAmount)</div>
  320. <div class="div-table-cell cell-right-align highlight-cell" style="width: 35%;">@FormatCurrency(ViewModel.OilRevenueTotalResult.ActualAmount)</div>
  321. </div>
  322. </div>
  323. </div>
  324. </div>
  325. <!-- 营业收入(充值) -->
  326. <div class="report-section">
  327. <div class="section-header">
  328. <h3>营业收入(充值)</h3>
  329. </div>
  330. <div class="table-container">
  331. <div class="div-table">
  332. <!-- 表头 -->
  333. <div class="div-table-header">
  334. <div class="div-table-cell cell-left-align" style="width: 45%;">充值类型</div>
  335. <div class="div-table-cell cell-right-align" style="width: 20%;">充值次数</div>
  336. <div class="div-table-cell cell-right-align highlight-cell" style="width: 35%;">充值金额</div>
  337. </div>
  338. <!-- 表格内容 -->
  339. @foreach (var item in ViewModel.RechargeRevenue)
  340. {
  341. <div class="div-table-row">
  342. <div class="div-table-cell cell-left-align" style="width: 45%;">@item.RechargeType</div>
  343. <div class="div-table-cell cell-right-align" style="width: 20%;">@item.RechargeCount</div>
  344. <div class="div-table-cell cell-right-align highlight-cell" style="width: 35%;">@FormatCurrency(item.RechargeAmount)</div>
  345. </div>
  346. }
  347. <!-- 合计行 -->
  348. <div class="div-table-row total-row">
  349. <div class="div-table-cell cell-left-align" style="width: 45%;">合计</div>
  350. <div class="div-table-cell cell-right-align" style="width: 20%;">@ViewModel.RechargeRevenueTotalResult.RechargeCount</div>
  351. <div class="div-table-cell cell-right-align highlight-cell" style="width: 35%;">@FormatCurrency(ViewModel.RechargeRevenueTotalResult.RechargeAmount)</div>
  352. </div>
  353. </div>
  354. </div>
  355. </div>
  356. <!-- 营业收支款项明细 -->
  357. <div class="report-section">
  358. <div class="section-header">
  359. <h3>营业收支款项明细</h3>
  360. </div>
  361. <div class="table-container">
  362. <div class="div-table">
  363. <!-- 表头 -->
  364. <div class="div-table-header">
  365. <div class="div-table-cell cell-left-align" style="width: 20%;">支付方式</div>
  366. <div class="div-table-cell cell-left-align" style="width: 15%;">品类</div>
  367. <div class="div-table-cell cell-right-align" style="width: 10%;">订单量</div>
  368. <div class="div-table-cell cell-right-align" style="width: 15%;">销售升数</div>
  369. <div class="div-table-cell cell-right-align" style="width: 15%;">应收金额</div>
  370. <div class="div-table-cell cell-right-align highlight-cell" style="width: 25%;">实收金额</div>
  371. </div>
  372. <!-- 表格内容 -->
  373. @foreach (var item in ViewModel.PaymentDetails)
  374. {
  375. <div class="div-table-row">
  376. <div class="div-table-cell cell-left-align" style="width: 20%;">@item.PaymentMethod</div>
  377. <div class="div-table-cell cell-left-align" style="width: 15%;">@item.Category</div>
  378. <div class="div-table-cell cell-right-align" style="width: 10%;">@item.OrderCount</div>
  379. <div class="div-table-cell cell-right-align" style="width: 15%;">@FormatNumber(item.SalesLiters)</div>
  380. <div class="div-table-cell cell-right-align" style="width: 15%;">@FormatCurrency(item.ReceivableAmount)</div>
  381. <div class="div-table-cell cell-right-align highlight-cell" style="width: 25%;">@FormatCurrency(item.ActualAmount)</div>
  382. </div>
  383. }
  384. <!-- 合计行 -->
  385. <div class="div-table-row total-row">
  386. <div class="div-table-cell cell-left-align" style="width: 35%;">合计</div>
  387. <div class="div-table-cell cell-right-align" style="width: 10%;">@ViewModel.PaymentDetailsTotalResult.OrderCount</div>
  388. <div class="div-table-cell cell-right-align" style="width: 15%;">@FormatNumber(ViewModel.PaymentDetailsTotalResult.SalesLiters)</div>
  389. <div class="div-table-cell cell-right-align" style="width: 15%;">@FormatCurrency(ViewModel.PaymentDetailsTotalResult.ReceivableAmount)</div>
  390. <div class="div-table-cell cell-right-align highlight-cell" style="width: 25%;">@FormatCurrency(ViewModel.PaymentDetailsTotalResult.ActualAmount)</div>
  391. </div>
  392. </div>
  393. </div>
  394. </div>
  395. </div>