chenwei 1 month ago
parent
commit
5d1b846b37

+ 3 - 3
VMMB.Blazor.Web-master/EasyTemplate.Blazor.Web/Properties/launchSettings.json

@@ -7,7 +7,7 @@
         "ASPNETCORE_ENVIRONMENT": "Development"
       },
       "dotnetRunMessages": true,
-      "applicationUrl": "http://10.153.140.14:5076"
+      "applicationUrl": "http://localhost:5076"
     },
     "IIS Express": {
       "commandName": "IISExpress",
@@ -19,10 +19,10 @@
     "WSL": {
       "commandName": "WSL2",
       "launchBrowser": true,
-      "launchUrl": "http://10.153.140.14:5076",
+      "launchUrl": "http://localhost:5076",
       "environmentVariables": {
         "ASPNETCORE_ENVIRONMENT": "Development",
-        "ASPNETCORE_URLS": "http://10.153.140.14:5076"
+        "ASPNETCORE_URLS": "http://localhost:5076"
       },
       "distributionName": ""
     }

+ 304 - 0
VMMB.Blazor.Web-master/EasyTemplate.Page/Pages/CardManagement/CancellationRecords.razor

@@ -0,0 +1,304 @@
+@page "/cardManagement/cancellationRecords"
+@attribute [ReuseTabsPage(Title = "查询注销记录")]
+
+
+<style>
+    .fuel-report-container {
+        padding: 16px;
+        background-color: #f5f7fa;
+        min-height: 100vh;
+        box-sizing: border-box;
+        overflow: hidden;
+    }
+
+    .filter-section {
+        margin-bottom: 16px;
+        padding: 16px !important;
+        background: white;
+        border: 1px solid #ebeef5;
+        border-radius: 4px;
+    }
+
+    .filter-content .filter-row {
+        display: flex;
+        align-items: center;
+        gap: 16px;
+        flex-wrap: wrap;
+    }
+
+        .filter-content .filter-row .filter-item {
+            display: flex;
+            align-items: center;
+        }
+
+            .filter-content .filter-row .filter-item .filter-label {
+                margin-right: 8px;
+                font-size: 14px;
+                color: #606266;
+                min-width: 32px;
+            }
+
+        .filter-content .filter-row .filter-actions {
+            display: flex;
+            gap: 8px;
+            margin-left: auto;
+        }
+
+    .table-section {
+        margin-top: 16px;
+        padding: 16px;
+        background: white;
+        border: 1px solid #ebeef5;
+        border-radius: 4px;
+    }
+
+    /* Div表格样式 */
+    .div-table {
+        display: flex;
+        flex-direction: column;
+        border: 1px solid #ebeef5;
+        border-radius: 4px;
+        overflow: hidden;
+        font-size: 14px;
+    }
+
+    .div-table-header {
+        display: flex;
+        background-color: #f5f7fa;
+        font-weight: 600;
+        color: #606266;
+        border-bottom: 1px solid #ebeef5;
+    }
+
+    .div-table-row {
+        display: flex;
+        border-bottom: 1px solid #ebeef5;
+    }
+
+        .div-table-row:last-child {
+            border-bottom: none;
+        }
+
+        .div-table-row:nth-child(even) {
+            background-color: #fafafa;
+        }
+
+    .div-table-cell {
+        padding: 12px 8px;
+        text-align: center;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+    }
+
+    .cell-left-align {
+        justify-content: flex-start;
+        text-align: left;
+    }
+
+    .cell-right-align {
+        justify-content: flex-end;
+        text-align: right;
+    }
+
+    .highlight-cell {
+        color: #1890ff !important;
+        font-weight: 500;
+    }
+
+    /* 表单样式 */
+    .filter-form {
+        display: flex;
+        flex-wrap: wrap;
+        gap: 16px;
+    }
+
+    .form-item {
+        display: flex;
+        align-items: center;
+    }
+
+        .form-item .form-label {
+            margin-right: 8px;
+            font-size: 14px;
+            color: #606266;
+            min-width: 80px;
+            text-align: right;
+        }
+
+    .form-actions {
+        display: flex;
+        gap: 8px;
+        margin-left: auto;
+    }
+
+    /* 响应式设计 */
+    @@media (max-width: 768px) {
+        .fuel-report-container {
+            padding: 12px;
+        }
+
+        .filter-section {
+            padding: 12px !important;
+        }
+
+        .filter-form {
+            flex-direction: column;
+            align-items: flex-start;
+        }
+
+        .form-item {
+            width: 100%;
+        }
+
+        .form-actions {
+            margin-left: 0;
+            width: 100%;
+            display: flex;
+            justify-content: center;
+            margin-top: 8px;
+        }
+
+        .div-table {
+            overflow-x: auto;
+        }
+
+        .div-table-header,
+        .div-table-row {
+            min-width: 1200px;
+        }
+
+        .div-table-cell {
+            padding: 8px 4px;
+            font-size: 12px;
+        }
+    }
+</style>
+
+<div class="fuel-report-container">
+    <!-- 筛选条件 -->
+    <div class="filter-section">
+        <div class="filter-form">
+            <!-- 设备编号 -->
+            <div class="form-item">
+                <span class="form-label">所属单位</span>
+                <Input @bind-Value="@DeviceId"
+                       Placeholder="所属单位"
+                       Style="width: 150px" />
+            </div>
+
+            <!-- 车牌号 -->
+            <div class="form-item">
+                <span class="form-label">用户名</span>
+                <Input @bind-Value="@PlateNumber"
+                       Placeholder="用户名"
+                       Style="width: 150px" />
+            </div>
+
+            <!-- 油品 -->
+            <div class="form-item">
+                <span class="form-label">卡号</span>
+                <Input @bind-Value="@OilType"
+                       Placeholder="卡号"
+                       Style="width: 150px" />
+            </div>
+
+            <!-- 支付方式 -->
+            <div class="form-item">
+                <span class="form-label">卡类型</span>
+                <Select TItemValue="string" TItem="string"
+                        DataSource="@PaymentMethodOptions"
+                        @bind-Value="@PaymentMethod"
+                        Style="width: 120px"
+                        Placeholder="请选择"
+                        AllowClear />
+            </div>
+
+
+
+            <!-- 发卡时间 -->
+            <div class="form-item">
+                <span class="form-label">操作时间</span>
+                <div style="display: flex; gap: 8px; align-items: center;">
+                    <DatePicker @bind-Value="@StartTime"
+                                Format="yyyy-MM-dd"
+                                Style="width: 110px" />
+                    <span>至</span>
+                    <DatePicker @bind-Value="@EndTime"
+                                Format="yyyy-MM-dd"
+                                Style="width: 110px" />
+                </div>
+            </div>
+
+            <!-- 操作按钮 -->
+            <div class="form-actions">
+                <Button Type="@ButtonType.Primary" Icon="search" OnClick="HandleQuery">
+                    查询
+                </Button>
+                <Button Icon="reload" OnClick="HandleReset">
+                    重置
+                </Button>
+            </div>
+        </div>
+    </div>
+
+    <!-- 数据表格 -->
+    <div class="table-section">
+        <Spin Spinning="@Loading">
+            <div class="div-table">
+                <!-- 表头 -->
+                <div class="div-table-header">
+                    <div class="div-table-cell cell-left-align" style="width: 30%;">单位</div>
+                    <div class="div-table-cell cell-left-align" style="width: 10%;">用户</div>
+                    <div class="div-table-cell cell-left-align" style="width: 20%;">卡号</div>
+                    <div class="div-table-cell cell-left-align" style="width: 10%;">卡类型</div>
+                    <div class="div-table-cell cell-right-align" style="width: 10%;">操作人</div>
+                    <div class="div-table-cell cell-right-align" style="width: 10%;">操作时间</div>
+                    <div class="div-table-cell cell-left-align" style="width: 10%;">备注</div>
+                </div>
+
+                <!-- 表格内容 -->
+                @if (TransactionData?.Any() == false)//true
+                {
+                    @foreach (var item in TransactionData)
+                    {
+                        <div class="div-table-row">
+                            <div class="div-table-cell cell-left-align" style="width: 30%;"></div>
+                            <div class="div-table-cell cell-left-align" style="width: 10%;"></div>
+                            <div class="div-table-cell cell-left-align" style="width: 20%;"></div>
+                            <div class="div-table-cell cell-left-align" style="width: 10%;"></div>
+                            <div class="div-table-cell cell-right-align" style="width: 10%;"></div>
+                            <div class="div-table-cell cell-right-align" style="width: 10%;"></div>
+                            <div class="div-table-cell cell-left-align" style="width: 10%;"></div>
+                        </div>
+                    }
+                }
+                else if (!Loading)
+                {
+                    <div class="div-table-row">
+                        <div class="div-table-cell" style="width: 100%; padding: 40px; text-align: center; color: #999;">
+                            暂无数据
+                        </div>
+                    </div>
+                }
+            </div>
+
+            <!-- 分页 -->
+            @if (TotalCount > 0)
+            {
+                <div style="margin-top: 16px; text-align: right;">
+                    <Pagination Total="@TotalCount"
+                                PageSize="@PageSize"
+                                Current="@CurrentPage"
+                                OnChange="@HandlePageChange"
+                                OnShowSizeChange="@HandlePageSizeChange"
+                                ShowSizeChanger
+                                ShowQuickJumper />
+                </div>
+            }
+        </Spin>
+    </div>
+</div>

+ 303 - 0
VMMB.Blazor.Web-master/EasyTemplate.Page/Pages/CardManagement/CancellationRecords.razor.cs

@@ -0,0 +1,303 @@
+using EasyTemplate.Tool;
+using Microsoft.AspNetCore.Components;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using ZhonTai.Admin.Contracts.Domain.VehicleTerminal.Device;
+using ZhonTai.Admin.Contracts.Domain.VehicleTerminal.Driver;
+using ZhonTai.Admin.Contracts.Domain.VehicleTerminal.Payment;
+using ZhonTai.Admin.Contracts.Domain.VehicleTerminal.Transaction;
+using ZhonTai.Admin.Contracts.Domain.VehicleTerminal.UserInfo;
+
+namespace EasyTemplate.Page.Pages.CardManagement
+{
+    public partial class CancellationRecords : ComponentBase
+    {
+        [Inject] private SqlSugarRepository<TransactionEntity> _TransactionPository { get; set; }
+        // ========== 数据模型 ==========
+
+        // 筛选条件模型
+        public class FilterModel
+        {
+            public string DeviceId { get; set; } = "";
+            public string PlateNumber { get; set; } = "";
+            public string OilType { get; set; } = "";
+            public string PaymentMethod { get; set; } = "";
+            public string PaymentStatus { get; set; } = "";
+            public string OrderStatus { get; set; } = "";
+            public string Driver { get; set; } = "";
+            public string OrderNo { get; set; } = "";
+            public string Mobile { get; set; } = "";
+            public DateTime? StartTime { get; set; }
+            public DateTime? EndTime { get; set; }
+        }
+
+        // 交易数据模型
+        public class TransactionItem
+        {
+            public string Id { get; set; } = "";
+            public string DeviceId { get; set; } = "";
+            public string PlateNumber { get; set; } = "";
+            public DateTime TransactionTime { get; set; }
+            public string OilProductName { get; set; } = "";
+            public decimal OilPrice { get; set; }
+            public decimal OilVolume { get; set; }
+            public string PaymentMethod { get; set; } = "";
+            public string DriverName { get; set; } = "";
+            public string OrderNo { get; set; } = "";
+            public decimal PayableAmount { get; set; }
+            public string Mobile { get; set; } = "";
+            public string UserName { get; set; } = "";
+            public string WxName { get; set; } = "";
+            public string PaymentStatus { get; set; }
+            public string OrderStatus { get; set; } = "";
+        }
+
+        // ========== 公共属性 ==========
+
+        protected FilterModel Filter { get; set; } = new();
+        protected List<TransactionItem> TransactionData { get; set; } = new();
+
+        protected bool Loading { get; set; }
+        protected int TotalCount { get; set; }
+        protected int CurrentPage { get; set; } = 1;
+        protected int PageSize { get; set; } = 20;
+
+        // ========== 选项数据 ==========
+
+        protected List<string> DeviceOptions { get; set; } = new();
+        protected List<string> PlateNumberOptions { get; set; } = new();
+        protected List<string> OilTypeOptions { get; set; } = new();
+        protected List<string> PaymentMethodOptions { get; set; } = new();
+        protected List<string> PaymentStatusOptions { get; set; } = new();
+        protected List<string> OrderStatusOptions { get; set; } = new();
+        protected List<string> DriverOptions { get; set; } = new();
+
+
+        public string DeviceId { get; set; } = "";
+        public string PlateNumber { get; set; } = "";
+        public string OilType { get; set; } = "";
+        public string PaymentMethod { get; set; } = "";
+        public string PaymentStatus { get; set; } = "";
+        public string OrderStatus { get; set; } = "";
+        public string Driver { get; set; } = "";
+        public string OrderNo { get; set; } = "";
+        public string Mobile { get; set; } = "";
+        public DateTime? StartTime { get; set; }
+        public DateTime? EndTime { get; set; }
+
+        // ========== 生命周期方法 ==========
+
+        protected override void OnInitialized()
+        {
+            base.OnInitialized();
+            InitializeData();
+            _ = LoadDataAsync();
+        }
+
+        // ========== 初始化方法 ==========
+
+        private void InitializeData()
+        {
+            // 初始化选项数据
+            DeviceOptions = new List<string> { "粤B67890" };
+            PlateNumberOptions = new List<string> { "粤ACD0045", "粤ACD0046", "粤ACD0047", "粤ACD0048" };
+            OilTypeOptions = new List<string> { "92#", "95#", "0#" };
+            PaymentMethodOptions = new List<string> { "车队卡", "用户卡", "司机卡" };
+            PaymentStatusOptions = new List<string> { "待支付", "支付成功", "支付失败" };
+            OrderStatusOptions = new List<string> { "未支付", "已完成", "已取消" };
+            DriverOptions = new List<string> { "张三", "李四", "王五" };
+
+            // 设置默认时间范围(最近7天)
+            Filter.StartTime = DateTime.Today.AddDays(-7);
+            Filter.EndTime = DateTime.Today;
+        }
+
+        // ========== 数据操作 ==========
+
+        // 重置筛选条件
+        protected void ResetFilter()
+        {
+            Filter = new FilterModel
+            {
+                StartTime = DateTime.Today.AddDays(-7),
+                EndTime = DateTime.Today
+            };
+            CurrentPage = 1;
+        }
+
+        // 加载数据
+        protected async Task LoadDataAsync()
+        {
+            Loading = true;
+
+            try
+            {
+
+                // 生成模拟数据
+                TransactionData = await GenerateMockData();
+                //TotalCount = TransactionData.Count(); // 模拟总记录数
+            }
+            finally
+            {
+                Loading = false;
+                StateHasChanged();
+            }
+        }
+
+
+        private async Task<List<TransactionItem>> GenerateMockData()
+        {
+            try
+            {
+                var payStatus = PaymentStatus == "待支付" ? 0 :
+                                   PaymentStatus == "支付成功" ? 1 :
+                                   PaymentStatus == "支付失败" ? 2 : 3;
+                var OStatus = OrderStatus == "未支付" ? 0 :
+                              OrderStatus == "已完成" ? 1 :
+                               OrderStatus == "已取消" ? 2 : 3;
+                var query = _TransactionPository.AsQueryable()
+                            .LeftJoin<DeviceEntity>((a, b) => a.DeviceId == b.DeviceId)
+                            .LeftJoin<PayTypeEntity>((a, b, c) => a.PaymentMethod == c.Id)
+                            .LeftJoin<DriverEntity>((a, b, c, e) => a.EmployeeId == e.Id)
+                            .LeftJoin<UserInfoEntity>((a, b, c, e, f) => a.UserId == f.Id);
+
+                // 使用条件判断代替三元运算符
+                if (!string.IsNullOrEmpty(DeviceId))
+                    query = query.Where((a, b, c, e, f) => b.DeviceId == DeviceId);
+
+                if (!string.IsNullOrEmpty(PlateNumber))
+                    query = query.Where((a, b, c, e, f) => a.LicencePlate == PlateNumber);
+
+                if (!string.IsNullOrEmpty(OilType))
+                    query = query.Where((a, b, c, e, f) => a.OilProduct == OilType);
+
+                if (!string.IsNullOrEmpty(PaymentMethod))
+                    query = query.Where((a, b, c, e, f) => c.Name == PaymentMethod);
+
+                if (payStatus != 3)
+                    query = query.Where((a, b, c, e, f) => a.PaymentStatus == payStatus);
+
+                if (OStatus != 3)
+                    query = query.Where((a, b, c, e, f) => a.OrderStatus == OStatus);
+
+                if (!string.IsNullOrEmpty(Driver))
+                    query = query.Where((a, b, c, e, f) => e.Name == Driver);
+
+                if (!string.IsNullOrEmpty(OrderNo))
+                    query = query.Where((a, b, c, e, f) => a.BillNumber == OrderNo);
+
+                if (!string.IsNullOrEmpty(Mobile))
+                    query = query.Where((a, b, c, e, f) => a.Mobile == Mobile);
+
+                if (StartTime != null)
+                    query = query.Where((a, b, c, e, f) =>
+                        a.TransactionTime > StartTime && a.TransactionTime < EndTime);
+
+                var baseQuery = query
+                    .OrderByDescending((a, b, c, e, f) => a.TransactionTime)
+                    .Select((a, b, c, e, f) => new TransactionItem
+                    {
+                        Id = a.Id.ToString(),
+                        DeviceId = b.DeviceId,
+                        PlateNumber = a.LicencePlate,
+                        TransactionTime = a.TransactionTime,
+                        OilProductName = a.OilProduct,
+                        OilPrice = a.OilPrice,
+                        OilVolume = a.OilVolume,
+                        PaymentMethod = c.Name,
+                        DriverName = e.Name,
+                        OrderNo = a.BillNumber,
+                        PayableAmount = a.PayableAmount,
+                        Mobile = a.Mobile,
+                        UserName = f.UserName,
+                        WxName = f.WxName,
+                        PaymentStatus = a.PaymentStatus == 0 ? "待支付" :
+                                       a.PaymentStatus == 1 ? "支付成功" :
+                                       a.PaymentStatus == 2 ? "支付失败" : "",
+                        OrderStatus = a.OrderStatus == 0 ? "未支付" :
+                                     a.OrderStatus == 1 ? "已完成" : ""
+                    });
+                TotalCount = await baseQuery.CountAsync();
+                return await baseQuery
+                            .Skip((CurrentPage - 1) * PageSize)
+                            .Take(PageSize)
+                            .ToListAsync();
+            }
+            catch (Exception ex)
+            {
+
+            }
+            return null;
+
+        }
+
+        // ========== 格式化方法 ==========
+
+        // 格式化货币显示
+        protected string FormatCurrency(decimal? value)
+        {
+            if (value == null) return "-";
+            return value.Value.ToString("C", CultureInfo.CreateSpecificCulture("zh-CN"));
+        }
+
+        // 格式化数字显示
+        protected string FormatNumber(decimal? value)
+        {
+            if (value == null) return "-";
+            return value.Value.ToString("N2", CultureInfo.CreateSpecificCulture("zh-CN"));
+        }
+
+        // 格式化日期时间
+        protected string FormatDateTime(DateTime? value)
+        {
+            if (value == null) return "-";
+            return value.Value.ToString("yyyy-MM-dd HH:mm:ss");
+        }
+
+        // 格式化支付状态
+        protected string FormatPaymentStatus(bool? status)
+        {
+            if (status == null) return "-";
+            return status.Value ? "成功" : "失败";
+        }
+
+        // 格式化订单状态
+        protected string FormatOrderStatus(string status)
+        {
+            return string.IsNullOrEmpty(status) ? "-" : status;
+        }
+
+        // ========== 事件处理方法 ==========
+
+        // 查询处理
+        protected async Task HandleQuery()
+        {
+            CurrentPage = 1;
+            await LoadDataAsync();
+        }
+
+        // 重置处理
+        protected async Task HandleReset()
+        {
+            ResetFilter();
+            await LoadDataAsync();
+        }
+
+        // 页码变化
+        protected async Task HandlePageChange(PaginationEventArgs args)
+        {
+            CurrentPage = args.Page;
+            await LoadDataAsync();
+        }
+
+        // 每页大小变化 - 使用 PaginationEventArgs
+        protected async Task HandlePageSizeChange(PaginationEventArgs args)
+        {
+            PageSize = args.PageSize;
+            CurrentPage = 1;
+            await LoadDataAsync();
+        }
+    }
+}

+ 306 - 0
VMMB.Blazor.Web-master/EasyTemplate.Page/Pages/CardManagement/CardBlockUnblockRecords.razor

@@ -0,0 +1,306 @@
+@page "/cardManagement/cardBlockUnblockRecords"
+@attribute [ReuseTabsPage(Title = "查询挂失/解挂")]
+
+
+<style>
+    .fuel-report-container {
+        padding: 16px;
+        background-color: #f5f7fa;
+        min-height: 100vh;
+        box-sizing: border-box;
+        overflow: hidden;
+    }
+
+    .filter-section {
+        margin-bottom: 16px;
+        padding: 16px !important;
+        background: white;
+        border: 1px solid #ebeef5;
+        border-radius: 4px;
+    }
+
+    .filter-content .filter-row {
+        display: flex;
+        align-items: center;
+        gap: 16px;
+        flex-wrap: wrap;
+    }
+
+        .filter-content .filter-row .filter-item {
+            display: flex;
+            align-items: center;
+        }
+
+            .filter-content .filter-row .filter-item .filter-label {
+                margin-right: 8px;
+                font-size: 14px;
+                color: #606266;
+                min-width: 32px;
+            }
+
+        .filter-content .filter-row .filter-actions {
+            display: flex;
+            gap: 8px;
+            margin-left: auto;
+        }
+
+    .table-section {
+        margin-top: 16px;
+        padding: 16px;
+        background: white;
+        border: 1px solid #ebeef5;
+        border-radius: 4px;
+    }
+
+    /* Div表格样式 */
+    .div-table {
+        display: flex;
+        flex-direction: column;
+        border: 1px solid #ebeef5;
+        border-radius: 4px;
+        overflow: hidden;
+        font-size: 14px;
+    }
+
+    .div-table-header {
+        display: flex;
+        background-color: #f5f7fa;
+        font-weight: 600;
+        color: #606266;
+        border-bottom: 1px solid #ebeef5;
+    }
+
+    .div-table-row {
+        display: flex;
+        border-bottom: 1px solid #ebeef5;
+    }
+
+        .div-table-row:last-child {
+            border-bottom: none;
+        }
+
+        .div-table-row:nth-child(even) {
+            background-color: #fafafa;
+        }
+
+    .div-table-cell {
+        padding: 12px 8px;
+        text-align: center;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+    }
+
+    .cell-left-align {
+        justify-content: flex-start;
+        text-align: left;
+    }
+
+    .cell-right-align {
+        justify-content: flex-end;
+        text-align: right;
+    }
+
+    .highlight-cell {
+        color: #1890ff !important;
+        font-weight: 500;
+    }
+
+    /* 表单样式 */
+    .filter-form {
+        display: flex;
+        flex-wrap: wrap;
+        gap: 16px;
+    }
+
+    .form-item {
+        display: flex;
+        align-items: center;
+    }
+
+        .form-item .form-label {
+            margin-right: 8px;
+            font-size: 14px;
+            color: #606266;
+            min-width: 80px;
+            text-align: right;
+        }
+
+    .form-actions {
+        display: flex;
+        gap: 8px;
+        margin-left: auto;
+    }
+
+    /* 响应式设计 */
+    @@media (max-width: 768px) {
+        .fuel-report-container {
+            padding: 12px;
+        }
+
+        .filter-section {
+            padding: 12px !important;
+        }
+
+        .filter-form {
+            flex-direction: column;
+            align-items: flex-start;
+        }
+
+        .form-item {
+            width: 100%;
+        }
+
+        .form-actions {
+            margin-left: 0;
+            width: 100%;
+            display: flex;
+            justify-content: center;
+            margin-top: 8px;
+        }
+
+        .div-table {
+            overflow-x: auto;
+        }
+
+        .div-table-header,
+        .div-table-row {
+            min-width: 1200px;
+        }
+
+        .div-table-cell {
+            padding: 8px 4px;
+            font-size: 12px;
+        }
+    }
+</style>
+
+<div class="fuel-report-container">
+    <!-- 筛选条件 -->
+    <div class="filter-section">
+        <div class="filter-form">
+            <!-- 设备编号 -->
+            <div class="form-item">
+                <span class="form-label">所属单位</span>
+                <Input @bind-Value="@DeviceId"
+                       Placeholder="所属单位"
+                       Style="width: 150px" />
+            </div>
+
+            <!-- 车牌号 -->
+            <div class="form-item">
+                <span class="form-label">用户名</span>
+                <Input @bind-Value="@PlateNumber"
+                       Placeholder="用户名"
+                       Style="width: 150px" />
+            </div>
+
+            <!-- 油品 -->
+            <div class="form-item">
+                <span class="form-label">卡号</span>
+                <Input @bind-Value="@OilType"
+                       Placeholder="卡号"
+                       Style="width: 150px" />
+            </div>
+
+            <!-- 支付方式 -->
+            <div class="form-item">
+                <span class="form-label">卡类型</span>
+                <Select TItemValue="string" TItem="string"
+                        DataSource="@PaymentMethodOptions"
+                        @bind-Value="@PaymentMethod"
+                        Style="width: 120px"
+                        Placeholder="请选择"
+                        AllowClear />
+            </div>
+
+
+
+            <!-- 发卡时间 -->
+            <div class="form-item">
+                <span class="form-label">开始结束时间</span>
+                <div style="display: flex; gap: 8px; align-items: center;">
+                    <DatePicker @bind-Value="@StartTime"
+                                Format="yyyy-MM-dd"
+                                Style="width: 110px" />
+                    <span>至</span>
+                    <DatePicker @bind-Value="@EndTime"
+                                Format="yyyy-MM-dd"
+                                Style="width: 110px" />
+                </div>
+            </div>
+
+            <!-- 操作按钮 -->
+            <div class="form-actions">
+                <Button Type="@ButtonType.Primary" Icon="search" OnClick="HandleQuery">
+                    查询
+                </Button>
+                <Button Icon="reload" OnClick="HandleReset">
+                    重置
+                </Button>
+            </div>
+        </div>
+    </div>
+
+    <!-- 数据表格 -->
+    <div class="table-section">
+        <Spin Spinning="@Loading">
+            <div class="div-table">
+                <!-- 表头 -->
+                <div class="div-table-header">
+                    <div class="div-table-cell cell-left-align" style="width: 20%;">单位</div>
+                    <div class="div-table-cell cell-left-align" style="width: 10%;">用户</div>
+                    <div class="div-table-cell cell-left-align" style="width: 20%;">卡号</div>
+                    <div class="div-table-cell cell-left-align" style="width: 10%;">卡余额</div>
+                    <div class="div-table-cell cell-left-align" style="width: 10%;">卡类型</div>
+                    <div class="div-table-cell cell-right-align" style="width: 10%;">操作人</div>
+                    <div class="div-table-cell cell-right-align" style="width: 10%;">操作时间</div>
+                    <div class="div-table-cell cell-left-align" style="width: 10%;">备注</div>
+                </div>
+
+                <!-- 表格内容 -->
+                @if (TransactionData?.Any() == false)//true
+                {
+                    @foreach (var item in TransactionData)
+                    {
+                        <div class="div-table-row">
+                            <div class="div-table-cell cell-left-align" style="width: 20%;"></div>
+                            <div class="div-table-cell cell-left-align" style="width: 10%;"></div>
+                            <div class="div-table-cell cell-left-align" style="width: 20%;"></div>
+                            <div class="div-table-cell cell-left-align" style="width: 10%;"></div>
+                            <div class="div-table-cell cell-right-align" style="width: 10%;"></div>
+                            <div class="div-table-cell cell-right-align" style="width: 10%;"></div>
+                            <div class="div-table-cell cell-right-align" style="width: 10%;"></div>
+                            <div class="div-table-cell cell-left-align" style="width: 10%;"></div>
+                        </div>
+                    }
+                }
+                else if (!Loading)
+                {
+                    <div class="div-table-row">
+                        <div class="div-table-cell" style="width: 100%; padding: 40px; text-align: center; color: #999;">
+                            暂无数据
+                        </div>
+                    </div>
+                }
+            </div>
+
+            <!-- 分页 -->
+            @if (TotalCount > 0)
+            {
+                <div style="margin-top: 16px; text-align: right;">
+                    <Pagination Total="@TotalCount"
+                                PageSize="@PageSize"
+                                Current="@CurrentPage"
+                                OnChange="@HandlePageChange"
+                                OnShowSizeChange="@HandlePageSizeChange"
+                                ShowSizeChanger
+                                ShowQuickJumper />
+                </div>
+            }
+        </Spin>
+    </div>
+</div>

+ 303 - 0
VMMB.Blazor.Web-master/EasyTemplate.Page/Pages/CardManagement/CardBlockUnblockRecords.razor.cs

@@ -0,0 +1,303 @@
+using EasyTemplate.Tool;
+using Microsoft.AspNetCore.Components;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using ZhonTai.Admin.Contracts.Domain.VehicleTerminal.Device;
+using ZhonTai.Admin.Contracts.Domain.VehicleTerminal.Driver;
+using ZhonTai.Admin.Contracts.Domain.VehicleTerminal.Payment;
+using ZhonTai.Admin.Contracts.Domain.VehicleTerminal.Transaction;
+using ZhonTai.Admin.Contracts.Domain.VehicleTerminal.UserInfo;
+
+namespace EasyTemplate.Page.Pages.CardManagement
+{
+    public partial class CardBlockUnblockRecords : ComponentBase
+    {
+        [Inject] private SqlSugarRepository<TransactionEntity> _TransactionPository { get; set; }
+        // ========== 数据模型 ==========
+
+        // 筛选条件模型
+        public class FilterModel
+        {
+            public string DeviceId { get; set; } = "";
+            public string PlateNumber { get; set; } = "";
+            public string OilType { get; set; } = "";
+            public string PaymentMethod { get; set; } = "";
+            public string PaymentStatus { get; set; } = "";
+            public string OrderStatus { get; set; } = "";
+            public string Driver { get; set; } = "";
+            public string OrderNo { get; set; } = "";
+            public string Mobile { get; set; } = "";
+            public DateTime? StartTime { get; set; }
+            public DateTime? EndTime { get; set; }
+        }
+
+        // 交易数据模型
+        public class TransactionItem
+        {
+            public string Id { get; set; } = "";
+            public string DeviceId { get; set; } = "";
+            public string PlateNumber { get; set; } = "";
+            public DateTime TransactionTime { get; set; }
+            public string OilProductName { get; set; } = "";
+            public decimal OilPrice { get; set; }
+            public decimal OilVolume { get; set; }
+            public string PaymentMethod { get; set; } = "";
+            public string DriverName { get; set; } = "";
+            public string OrderNo { get; set; } = "";
+            public decimal PayableAmount { get; set; }
+            public string Mobile { get; set; } = "";
+            public string UserName { get; set; } = "";
+            public string WxName { get; set; } = "";
+            public string PaymentStatus { get; set; }
+            public string OrderStatus { get; set; } = "";
+        }
+
+        // ========== 公共属性 ==========
+
+        protected FilterModel Filter { get; set; } = new();
+        protected List<TransactionItem> TransactionData { get; set; } = new();
+
+        protected bool Loading { get; set; }
+        protected int TotalCount { get; set; }
+        protected int CurrentPage { get; set; } = 1;
+        protected int PageSize { get; set; } = 20;
+
+        // ========== 选项数据 ==========
+
+        protected List<string> DeviceOptions { get; set; } = new();
+        protected List<string> PlateNumberOptions { get; set; } = new();
+        protected List<string> OilTypeOptions { get; set; } = new();
+        protected List<string> PaymentMethodOptions { get; set; } = new();
+        protected List<string> PaymentStatusOptions { get; set; } = new();
+        protected List<string> OrderStatusOptions { get; set; } = new();
+        protected List<string> DriverOptions { get; set; } = new();
+
+
+        public string DeviceId { get; set; } = "";
+        public string PlateNumber { get; set; } = "";
+        public string OilType { get; set; } = "";
+        public string PaymentMethod { get; set; } = "";
+        public string PaymentStatus { get; set; } = "";
+        public string OrderStatus { get; set; } = "";
+        public string Driver { get; set; } = "";
+        public string OrderNo { get; set; } = "";
+        public string Mobile { get; set; } = "";
+        public DateTime? StartTime { get; set; }
+        public DateTime? EndTime { get; set; }
+
+        // ========== 生命周期方法 ==========
+
+        protected override void OnInitialized()
+        {
+            base.OnInitialized();
+            InitializeData();
+            _ = LoadDataAsync();
+        }
+
+        // ========== 初始化方法 ==========
+
+        private void InitializeData()
+        {
+            // 初始化选项数据
+            DeviceOptions = new List<string> { "粤B67890" };
+            PlateNumberOptions = new List<string> { "粤ACD0045", "粤ACD0046", "粤ACD0047", "粤ACD0048" };
+            OilTypeOptions = new List<string> { "92#", "95#", "0#" };
+            PaymentMethodOptions = new List<string> { "车队卡", "用户卡", "司机卡" };
+            PaymentStatusOptions = new List<string> { "待支付", "支付成功", "支付失败" };
+            OrderStatusOptions = new List<string> { "未支付", "已完成", "已取消" };
+            DriverOptions = new List<string> { "张三", "李四", "王五" };
+
+            // 设置默认时间范围(最近7天)
+            Filter.StartTime = DateTime.Today.AddDays(-7);
+            Filter.EndTime = DateTime.Today;
+        }
+
+        // ========== 数据操作 ==========
+
+        // 重置筛选条件
+        protected void ResetFilter()
+        {
+            Filter = new FilterModel
+            {
+                StartTime = DateTime.Today.AddDays(-7),
+                EndTime = DateTime.Today
+            };
+            CurrentPage = 1;
+        }
+
+        // 加载数据
+        protected async Task LoadDataAsync()
+        {
+            Loading = true;
+
+            try
+            {
+
+                // 生成模拟数据
+                TransactionData = await GenerateMockData();
+                //TotalCount = TransactionData.Count(); // 模拟总记录数
+            }
+            finally
+            {
+                Loading = false;
+                StateHasChanged();
+            }
+        }
+
+
+        private async Task<List<TransactionItem>> GenerateMockData()
+        {
+            try
+            {
+                var payStatus = PaymentStatus == "待支付" ? 0 :
+                                   PaymentStatus == "支付成功" ? 1 :
+                                   PaymentStatus == "支付失败" ? 2 : 3;
+                var OStatus = OrderStatus == "未支付" ? 0 :
+                              OrderStatus == "已完成" ? 1 :
+                               OrderStatus == "已取消" ? 2 : 3;
+                var query = _TransactionPository.AsQueryable()
+                            .LeftJoin<DeviceEntity>((a, b) => a.DeviceId == b.DeviceId)
+                            .LeftJoin<PayTypeEntity>((a, b, c) => a.PaymentMethod == c.Id)
+                            .LeftJoin<DriverEntity>((a, b, c, e) => a.EmployeeId == e.Id)
+                            .LeftJoin<UserInfoEntity>((a, b, c, e, f) => a.UserId == f.Id);
+
+                // 使用条件判断代替三元运算符
+                if (!string.IsNullOrEmpty(DeviceId))
+                    query = query.Where((a, b, c, e, f) => b.DeviceId == DeviceId);
+
+                if (!string.IsNullOrEmpty(PlateNumber))
+                    query = query.Where((a, b, c, e, f) => a.LicencePlate == PlateNumber);
+
+                if (!string.IsNullOrEmpty(OilType))
+                    query = query.Where((a, b, c, e, f) => a.OilProduct == OilType);
+
+                if (!string.IsNullOrEmpty(PaymentMethod))
+                    query = query.Where((a, b, c, e, f) => c.Name == PaymentMethod);
+
+                if (payStatus != 3)
+                    query = query.Where((a, b, c, e, f) => a.PaymentStatus == payStatus);
+
+                if (OStatus != 3)
+                    query = query.Where((a, b, c, e, f) => a.OrderStatus == OStatus);
+
+                if (!string.IsNullOrEmpty(Driver))
+                    query = query.Where((a, b, c, e, f) => e.Name == Driver);
+
+                if (!string.IsNullOrEmpty(OrderNo))
+                    query = query.Where((a, b, c, e, f) => a.BillNumber == OrderNo);
+
+                if (!string.IsNullOrEmpty(Mobile))
+                    query = query.Where((a, b, c, e, f) => a.Mobile == Mobile);
+
+                if (StartTime != null)
+                    query = query.Where((a, b, c, e, f) =>
+                        a.TransactionTime > StartTime && a.TransactionTime < EndTime);
+
+                var baseQuery = query
+                    .OrderByDescending((a, b, c, e, f) => a.TransactionTime)
+                    .Select((a, b, c, e, f) => new TransactionItem
+                    {
+                        Id = a.Id.ToString(),
+                        DeviceId = b.DeviceId,
+                        PlateNumber = a.LicencePlate,
+                        TransactionTime = a.TransactionTime,
+                        OilProductName = a.OilProduct,
+                        OilPrice = a.OilPrice,
+                        OilVolume = a.OilVolume,
+                        PaymentMethod = c.Name,
+                        DriverName = e.Name,
+                        OrderNo = a.BillNumber,
+                        PayableAmount = a.PayableAmount,
+                        Mobile = a.Mobile,
+                        UserName = f.UserName,
+                        WxName = f.WxName,
+                        PaymentStatus = a.PaymentStatus == 0 ? "待支付" :
+                                       a.PaymentStatus == 1 ? "支付成功" :
+                                       a.PaymentStatus == 2 ? "支付失败" : "",
+                        OrderStatus = a.OrderStatus == 0 ? "未支付" :
+                                     a.OrderStatus == 1 ? "已完成" : ""
+                    });
+                TotalCount = await baseQuery.CountAsync();
+                return await baseQuery
+                            .Skip((CurrentPage - 1) * PageSize)
+                            .Take(PageSize)
+                            .ToListAsync();
+            }
+            catch (Exception ex)
+            {
+
+            }
+            return null;
+
+        }
+
+        // ========== 格式化方法 ==========
+
+        // 格式化货币显示
+        protected string FormatCurrency(decimal? value)
+        {
+            if (value == null) return "-";
+            return value.Value.ToString("C", CultureInfo.CreateSpecificCulture("zh-CN"));
+        }
+
+        // 格式化数字显示
+        protected string FormatNumber(decimal? value)
+        {
+            if (value == null) return "-";
+            return value.Value.ToString("N2", CultureInfo.CreateSpecificCulture("zh-CN"));
+        }
+
+        // 格式化日期时间
+        protected string FormatDateTime(DateTime? value)
+        {
+            if (value == null) return "-";
+            return value.Value.ToString("yyyy-MM-dd HH:mm:ss");
+        }
+
+        // 格式化支付状态
+        protected string FormatPaymentStatus(bool? status)
+        {
+            if (status == null) return "-";
+            return status.Value ? "成功" : "失败";
+        }
+
+        // 格式化订单状态
+        protected string FormatOrderStatus(string status)
+        {
+            return string.IsNullOrEmpty(status) ? "-" : status;
+        }
+
+        // ========== 事件处理方法 ==========
+
+        // 查询处理
+        protected async Task HandleQuery()
+        {
+            CurrentPage = 1;
+            await LoadDataAsync();
+        }
+
+        // 重置处理
+        protected async Task HandleReset()
+        {
+            ResetFilter();
+            await LoadDataAsync();
+        }
+
+        // 页码变化
+        protected async Task HandlePageChange(PaginationEventArgs args)
+        {
+            CurrentPage = args.Page;
+            await LoadDataAsync();
+        }
+
+        // 每页大小变化 - 使用 PaginationEventArgs
+        protected async Task HandlePageSizeChange(PaginationEventArgs args)
+        {
+            PageSize = args.PageSize;
+            CurrentPage = 1;
+            await LoadDataAsync();
+        }
+    }
+}

+ 304 - 0
VMMB.Blazor.Web-master/EasyTemplate.Page/Pages/CardManagement/CardIssuanceRecords.razor

@@ -0,0 +1,304 @@
+@page "/cardManagement/cardIssuanceRecords"
+@attribute [ReuseTabsPage(Title = "发卡记录")]
+
+
+<style>
+    .fuel-report-container {
+        padding: 16px;
+        background-color: #f5f7fa;
+        min-height: 100vh;
+        box-sizing: border-box;
+        overflow: hidden;
+    }
+
+    .filter-section {
+        margin-bottom: 16px;
+        padding: 16px !important;
+        background: white;
+        border: 1px solid #ebeef5;
+        border-radius: 4px;
+    }
+
+    .filter-content .filter-row {
+        display: flex;
+        align-items: center;
+        gap: 16px;
+        flex-wrap: wrap;
+    }
+
+        .filter-content .filter-row .filter-item {
+            display: flex;
+            align-items: center;
+        }
+
+            .filter-content .filter-row .filter-item .filter-label {
+                margin-right: 8px;
+                font-size: 14px;
+                color: #606266;
+                min-width: 32px;
+            }
+
+        .filter-content .filter-row .filter-actions {
+            display: flex;
+            gap: 8px;
+            margin-left: auto;
+        }
+
+    .table-section {
+        margin-top: 16px;
+        padding: 16px;
+        background: white;
+        border: 1px solid #ebeef5;
+        border-radius: 4px;
+    }
+
+    /* Div表格样式 */
+    .div-table {
+        display: flex;
+        flex-direction: column;
+        border: 1px solid #ebeef5;
+        border-radius: 4px;
+        overflow: hidden;
+        font-size: 14px;
+    }
+
+    .div-table-header {
+        display: flex;
+        background-color: #f5f7fa;
+        font-weight: 600;
+        color: #606266;
+        border-bottom: 1px solid #ebeef5;
+    }
+
+    .div-table-row {
+        display: flex;
+        border-bottom: 1px solid #ebeef5;
+    }
+
+        .div-table-row:last-child {
+            border-bottom: none;
+        }
+
+        .div-table-row:nth-child(even) {
+            background-color: #fafafa;
+        }
+
+    .div-table-cell {
+        padding: 12px 8px;
+        text-align: center;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+    }
+
+    .cell-left-align {
+        justify-content: flex-start;
+        text-align: left;
+    }
+
+    .cell-right-align {
+        justify-content: flex-end;
+        text-align: right;
+    }
+
+    .highlight-cell {
+        color: #1890ff !important;
+        font-weight: 500;
+    }
+
+    /* 表单样式 */
+    .filter-form {
+        display: flex;
+        flex-wrap: wrap;
+        gap: 16px;
+    }
+
+    .form-item {
+        display: flex;
+        align-items: center;
+    }
+
+        .form-item .form-label {
+            margin-right: 8px;
+            font-size: 14px;
+            color: #606266;
+            min-width: 80px;
+            text-align: right;
+        }
+
+    .form-actions {
+        display: flex;
+        gap: 8px;
+        margin-left: auto;
+    }
+
+    /* 响应式设计 */
+    @@media (max-width: 768px) {
+        .fuel-report-container {
+            padding: 12px;
+        }
+
+        .filter-section {
+            padding: 12px !important;
+        }
+
+        .filter-form {
+            flex-direction: column;
+            align-items: flex-start;
+        }
+
+        .form-item {
+            width: 100%;
+        }
+
+        .form-actions {
+            margin-left: 0;
+            width: 100%;
+            display: flex;
+            justify-content: center;
+            margin-top: 8px;
+        }
+
+        .div-table {
+            overflow-x: auto;
+        }
+
+        .div-table-header,
+        .div-table-row {
+            min-width: 1200px;
+        }
+
+        .div-table-cell {
+            padding: 8px 4px;
+            font-size: 12px;
+        }
+    }
+</style>
+
+<div class="fuel-report-container">
+    <!-- 筛选条件 -->
+    <div class="filter-section">
+        <div class="filter-form">
+            <!-- 设备编号 -->
+            <div class="form-item">
+                <span class="form-label">所属单位</span>
+                <Input @bind-Value="@DeviceId"
+                       Placeholder="所属单位"
+                       Style="width: 150px" />
+            </div>
+
+            <!-- 车牌号 -->
+            <div class="form-item">
+                <span class="form-label">用户名</span>
+                <Input @bind-Value="@PlateNumber"
+                       Placeholder="用户名"
+                       Style="width: 150px" />
+            </div>
+
+            <!-- 油品 -->
+            <div class="form-item">
+                <span class="form-label">卡号</span>
+                <Input @bind-Value="@OilType"
+                       Placeholder="卡号"
+                       Style="width: 150px" />
+            </div>
+
+            <!-- 支付方式 -->
+            <div class="form-item">
+                <span class="form-label">卡类型</span>
+                <Select TItemValue="string" TItem="string"
+                        DataSource="@PaymentMethodOptions"
+                        @bind-Value="@PaymentMethod"
+                        Style="width: 120px"
+                        Placeholder="请选择"
+                        AllowClear />
+            </div>
+
+            
+
+            <!-- 发卡时间 -->
+            <div class="form-item">
+                <span class="form-label">开始结束时间</span>
+                <div style="display: flex; gap: 8px; align-items: center;">
+                    <DatePicker @bind-Value="@StartTime"
+                                Format="yyyy-MM-dd"
+                                Style="width: 110px" />
+                    <span>至</span>
+                    <DatePicker @bind-Value="@EndTime"
+                                Format="yyyy-MM-dd"
+                                Style="width: 110px" />
+                </div>
+            </div>
+
+            <!-- 操作按钮 -->
+            <div class="form-actions">
+                <Button Type="@ButtonType.Primary" Icon="search" OnClick="HandleQuery">
+                    查询
+                </Button>
+                <Button Icon="reload" OnClick="HandleReset">
+                    重置
+                </Button>
+            </div>
+        </div>
+    </div>
+
+    <!-- 数据表格 -->
+    <div class="table-section">
+        <Spin Spinning="@Loading">
+            <div class="div-table">
+                <!-- 表头 -->
+                <div class="div-table-header">
+                    <div class="div-table-cell cell-left-align" style="width: 30%;">单位</div>
+                    <div class="div-table-cell cell-left-align" style="width: 10%;">用户</div>
+                    <div class="div-table-cell cell-left-align" style="width: 20%;">卡号</div>
+                    <div class="div-table-cell cell-left-align" style="width: 10%;">卡类型</div>
+                    <div class="div-table-cell cell-right-align" style="width: 10%;">发卡人</div>
+                    <div class="div-table-cell cell-right-align" style="width: 10%;">发卡时间</div>
+                    <div class="div-table-cell cell-left-align" style="width: 10%;">备注</div>
+                </div>
+
+                <!-- 表格内容 -->
+                @if (TransactionData?.Any() == false)//true
+                {
+                    @foreach (var item in TransactionData)
+                    {
+                        <div class="div-table-row">
+                            <div class="div-table-cell cell-left-align" style="width: 30%;"></div>
+                            <div class="div-table-cell cell-left-align" style="width: 10%;"></div>
+                            <div class="div-table-cell cell-left-align" style="width: 20%;"></div>
+                            <div class="div-table-cell cell-left-align" style="width: 10%;"></div>
+                            <div class="div-table-cell cell-right-align" style="width: 10%;"></div>
+                            <div class="div-table-cell cell-right-align" style="width: 10%;"></div>
+                            <div class="div-table-cell cell-left-align" style="width: 10%;"></div>
+                        </div>
+                    }
+                }
+                else if (!Loading)
+                {
+                    <div class="div-table-row">
+                        <div class="div-table-cell" style="width: 100%; padding: 40px; text-align: center; color: #999;">
+                            暂无数据
+                        </div>
+                    </div>
+                }
+            </div>
+
+            <!-- 分页 -->
+            @if (TotalCount > 0)
+            {
+                <div style="margin-top: 16px; text-align: right;">
+                    <Pagination Total="@TotalCount"
+                                PageSize="@PageSize"
+                                Current="@CurrentPage"
+                                OnChange="@HandlePageChange"
+                                OnShowSizeChange="@HandlePageSizeChange"
+                                ShowSizeChanger
+                                ShowQuickJumper />
+                </div>
+            }
+        </Spin>
+    </div>
+</div>

+ 303 - 0
VMMB.Blazor.Web-master/EasyTemplate.Page/Pages/CardManagement/CardIssuanceRecords.razor.cs

@@ -0,0 +1,303 @@
+using EasyTemplate.Tool;
+using Microsoft.AspNetCore.Components;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using ZhonTai.Admin.Contracts.Domain.VehicleTerminal.Device;
+using ZhonTai.Admin.Contracts.Domain.VehicleTerminal.Driver;
+using ZhonTai.Admin.Contracts.Domain.VehicleTerminal.Payment;
+using ZhonTai.Admin.Contracts.Domain.VehicleTerminal.Transaction;
+using ZhonTai.Admin.Contracts.Domain.VehicleTerminal.UserInfo;
+
+namespace EasyTemplate.Page.Pages.CardManagement
+{
+    public partial class CardIssuanceRecords : ComponentBase
+    {
+        [Inject] private SqlSugarRepository<TransactionEntity> _TransactionPository { get; set; }
+        // ========== 数据模型 ==========
+
+        // 筛选条件模型
+        public class FilterModel
+        {
+            public string DeviceId { get; set; } = "";
+            public string PlateNumber { get; set; } = "";
+            public string OilType { get; set; } = "";
+            public string PaymentMethod { get; set; } = "";
+            public string PaymentStatus { get; set; } = "";
+            public string OrderStatus { get; set; } = "";
+            public string Driver { get; set; } = "";
+            public string OrderNo { get; set; } = "";
+            public string Mobile { get; set; } = "";
+            public DateTime? StartTime { get; set; }
+            public DateTime? EndTime { get; set; }
+        }
+
+        // 交易数据模型
+        public class TransactionItem
+        {
+            public string Id { get; set; } = "";
+            public string DeviceId { get; set; } = "";
+            public string PlateNumber { get; set; } = "";
+            public DateTime TransactionTime { get; set; }
+            public string OilProductName { get; set; } = "";
+            public decimal OilPrice { get; set; }
+            public decimal OilVolume { get; set; }
+            public string PaymentMethod { get; set; } = "";
+            public string DriverName { get; set; } = "";
+            public string OrderNo { get; set; } = "";
+            public decimal PayableAmount { get; set; }
+            public string Mobile { get; set; } = "";
+            public string UserName { get; set; } = "";
+            public string WxName { get; set; } = "";
+            public string PaymentStatus { get; set; }
+            public string OrderStatus { get; set; } = "";
+        }
+
+        // ========== 公共属性 ==========
+
+        protected FilterModel Filter { get; set; } = new();
+        protected List<TransactionItem> TransactionData { get; set; } = new();
+
+        protected bool Loading { get; set; }
+        protected int TotalCount { get; set; }
+        protected int CurrentPage { get; set; } = 1;
+        protected int PageSize { get; set; } = 20;
+
+        // ========== 选项数据 ==========
+
+        protected List<string> DeviceOptions { get; set; } = new();
+        protected List<string> PlateNumberOptions { get; set; } = new();
+        protected List<string> OilTypeOptions { get; set; } = new();
+        protected List<string> PaymentMethodOptions { get; set; } = new();
+        protected List<string> PaymentStatusOptions { get; set; } = new();
+        protected List<string> OrderStatusOptions { get; set; } = new();
+        protected List<string> DriverOptions { get; set; } = new();
+
+
+        public string DeviceId { get; set; } = "";
+        public string PlateNumber { get; set; } = "";
+        public string OilType { get; set; } = "";
+        public string PaymentMethod { get; set; } = "";
+        public string PaymentStatus { get; set; } = "";
+        public string OrderStatus { get; set; } = "";
+        public string Driver { get; set; } = "";
+        public string OrderNo { get; set; } = "";
+        public string Mobile { get; set; } = "";
+        public DateTime? StartTime { get; set; }
+        public DateTime? EndTime { get; set; }
+
+        // ========== 生命周期方法 ==========
+
+        protected override void OnInitialized()
+        {
+            base.OnInitialized();
+            InitializeData();
+            _ = LoadDataAsync();
+        }
+
+        // ========== 初始化方法 ==========
+
+        private void InitializeData()
+        {
+            // 初始化选项数据
+            DeviceOptions = new List<string> { "粤B67890" };
+            PlateNumberOptions = new List<string> { "粤ACD0045", "粤ACD0046", "粤ACD0047", "粤ACD0048" };
+            OilTypeOptions = new List<string> { "92#", "95#", "0#" };
+            PaymentMethodOptions = new List<string> { "车队卡", "用户卡", "司机卡" };
+            PaymentStatusOptions = new List<string> { "待支付", "支付成功", "支付失败" };
+            OrderStatusOptions = new List<string> { "未支付", "已完成", "已取消" };
+            DriverOptions = new List<string> { "张三", "李四", "王五" };
+
+            // 设置默认时间范围(最近7天)
+            Filter.StartTime = DateTime.Today.AddDays(-7);
+            Filter.EndTime = DateTime.Today;
+        }
+
+        // ========== 数据操作 ==========
+
+        // 重置筛选条件
+        protected void ResetFilter()
+        {
+            Filter = new FilterModel
+            {
+                StartTime = DateTime.Today.AddDays(-7),
+                EndTime = DateTime.Today
+            };
+            CurrentPage = 1;
+        }
+
+        // 加载数据
+        protected async Task LoadDataAsync()
+        {
+            Loading = true;
+
+            try
+            {
+
+                // 生成模拟数据
+                TransactionData = await GenerateMockData();
+                //TotalCount = TransactionData.Count(); // 模拟总记录数
+            }
+            finally
+            {
+                Loading = false;
+                StateHasChanged();
+            }
+        }
+
+
+        private async Task<List<TransactionItem>> GenerateMockData()
+        {
+            try
+            {
+                var payStatus = PaymentStatus == "待支付" ? 0 :
+                                   PaymentStatus == "支付成功" ? 1 :
+                                   PaymentStatus == "支付失败" ? 2 : 3;
+                var OStatus = OrderStatus == "未支付" ? 0 :
+                              OrderStatus == "已完成" ? 1 :
+                               OrderStatus == "已取消" ? 2 : 3;
+                var query = _TransactionPository.AsQueryable()
+                            .LeftJoin<DeviceEntity>((a, b) => a.DeviceId == b.DeviceId)
+                            .LeftJoin<PayTypeEntity>((a, b, c) => a.PaymentMethod == c.Id)
+                            .LeftJoin<DriverEntity>((a, b, c, e) => a.EmployeeId == e.Id)
+                            .LeftJoin<UserInfoEntity>((a, b, c, e, f) => a.UserId == f.Id);
+
+                // 使用条件判断代替三元运算符
+                if (!string.IsNullOrEmpty(DeviceId))
+                    query = query.Where((a, b, c, e, f) => b.DeviceId == DeviceId);
+
+                if (!string.IsNullOrEmpty(PlateNumber))
+                    query = query.Where((a, b, c, e, f) => a.LicencePlate == PlateNumber);
+
+                if (!string.IsNullOrEmpty(OilType))
+                    query = query.Where((a, b, c, e, f) => a.OilProduct == OilType);
+
+                if (!string.IsNullOrEmpty(PaymentMethod))
+                    query = query.Where((a, b, c, e, f) => c.Name == PaymentMethod);
+
+                if (payStatus != 3)
+                    query = query.Where((a, b, c, e, f) => a.PaymentStatus == payStatus);
+
+                if (OStatus != 3)
+                    query = query.Where((a, b, c, e, f) => a.OrderStatus == OStatus);
+
+                if (!string.IsNullOrEmpty(Driver))
+                    query = query.Where((a, b, c, e, f) => e.Name == Driver);
+
+                if (!string.IsNullOrEmpty(OrderNo))
+                    query = query.Where((a, b, c, e, f) => a.BillNumber == OrderNo);
+
+                if (!string.IsNullOrEmpty(Mobile))
+                    query = query.Where((a, b, c, e, f) => a.Mobile == Mobile);
+
+                if (StartTime != null)
+                    query = query.Where((a, b, c, e, f) =>
+                        a.TransactionTime > StartTime && a.TransactionTime < EndTime);
+
+                var baseQuery = query
+                    .OrderByDescending((a, b, c, e, f) => a.TransactionTime)
+                    .Select((a, b, c, e, f) => new TransactionItem
+                    {
+                        Id = a.Id.ToString(),
+                        DeviceId = b.DeviceId,
+                        PlateNumber = a.LicencePlate,
+                        TransactionTime = a.TransactionTime,
+                        OilProductName = a.OilProduct,
+                        OilPrice = a.OilPrice,
+                        OilVolume = a.OilVolume,
+                        PaymentMethod = c.Name,
+                        DriverName = e.Name,
+                        OrderNo = a.BillNumber,
+                        PayableAmount = a.PayableAmount,
+                        Mobile = a.Mobile,
+                        UserName = f.UserName,
+                        WxName = f.WxName,
+                        PaymentStatus = a.PaymentStatus == 0 ? "待支付" :
+                                       a.PaymentStatus == 1 ? "支付成功" :
+                                       a.PaymentStatus == 2 ? "支付失败" : "",
+                        OrderStatus = a.OrderStatus == 0 ? "未支付" :
+                                     a.OrderStatus == 1 ? "已完成" : ""
+                    });
+                TotalCount = await baseQuery.CountAsync();
+                return await baseQuery
+                            .Skip((CurrentPage - 1) * PageSize)
+                            .Take(PageSize)
+                            .ToListAsync();
+            }
+            catch (Exception ex)
+            {
+
+            }
+            return null;
+
+        }
+
+        // ========== 格式化方法 ==========
+
+        // 格式化货币显示
+        protected string FormatCurrency(decimal? value)
+        {
+            if (value == null) return "-";
+            return value.Value.ToString("C", CultureInfo.CreateSpecificCulture("zh-CN"));
+        }
+
+        // 格式化数字显示
+        protected string FormatNumber(decimal? value)
+        {
+            if (value == null) return "-";
+            return value.Value.ToString("N2", CultureInfo.CreateSpecificCulture("zh-CN"));
+        }
+
+        // 格式化日期时间
+        protected string FormatDateTime(DateTime? value)
+        {
+            if (value == null) return "-";
+            return value.Value.ToString("yyyy-MM-dd HH:mm:ss");
+        }
+
+        // 格式化支付状态
+        protected string FormatPaymentStatus(bool? status)
+        {
+            if (status == null) return "-";
+            return status.Value ? "成功" : "失败";
+        }
+
+        // 格式化订单状态
+        protected string FormatOrderStatus(string status)
+        {
+            return string.IsNullOrEmpty(status) ? "-" : status;
+        }
+
+        // ========== 事件处理方法 ==========
+
+        // 查询处理
+        protected async Task HandleQuery()
+        {
+            CurrentPage = 1;
+            await LoadDataAsync();
+        }
+
+        // 重置处理
+        protected async Task HandleReset()
+        {
+            ResetFilter();
+            await LoadDataAsync();
+        }
+
+        // 页码变化
+        protected async Task HandlePageChange(PaginationEventArgs args)
+        {
+            CurrentPage = args.Page;
+            await LoadDataAsync();
+        }
+
+        // 每页大小变化 - 使用 PaginationEventArgs
+        protected async Task HandlePageSizeChange(PaginationEventArgs args)
+        {
+            PageSize = args.PageSize;
+            CurrentPage = 1;
+            await LoadDataAsync();
+        }
+    }
+}

+ 37 - 0
VMMB.Blazor.Web-master/EasyTemplate.Page/Pages/Report/ShiftSettlementDailyReport.razor

@@ -382,4 +382,41 @@
             </div>
         </div>
     </div>
+
+    <!-- 油罐统计 -->
+    <div class="report-section">
+        <div class="section-header">
+            <h3>油罐统计</h3>
+        </div>
+        <div class="table-container">
+            <div class="div-table">
+                <!-- 表头 -->
+                <div class="div-table-header">
+                    <div class="div-table-cell" style="width: 20%;">设备编号</div>
+                    <div class="div-table-cell" style="width: 20%;">油品名称</div>
+                    <div class="div-table-cell" style="width: 20%;">油品编号</div>
+                    <div class="div-table-cell" style="width: 20%;">班前存量</div>
+                    <div class="div-table-cell" style="width: 20%;">班后存量</div>
+                </div>
+                <div class="div-table-row">
+                    <div class="div-table-cell" style="width: 20%;">A001</div>
+                    <div class="div-table-cell" style="width: 20%;">92#</div>
+                    <div class="div-table-cell" style="width: 20%;">92</div>
+                    <div class="div-table-cell" style="width: 20%;">10000</div>
+                    <div class="div-table-cell" style="width: 20%;">9820</div>
+                </div>
+                <!-- 表格内容 -->
+@*                 @foreach (var item in OilSalesData)
+                {
+                    <div class="div-table-row">
+                        <div class="div-table-cell" style="width: 20%;"></div>
+                        <div class="div-table-cell" style="width: 20%;"></div>
+                        <div class="div-table-cell" style="width: 20%;"></div>
+                        <div class="div-table-cell" style="width: 20%;"></div>
+                        <div class="div-table-cell" style="width: 20%;"></div>
+                    </div>
+                } *@
+            </div>
+        </div>
+    </div>
 </div>

+ 22 - 3
VMMB.Blazor.Web-master/EasyTemplate.Page/Pages/SiteConfiguration/Device.razor

@@ -85,8 +85,12 @@
                                             <col style="width: 100px;" />
                                             <col style="width: 100px;" />
                                             <col style="width: 140px;" />
+                                            <col style="width: 100px;" />
+                                            <col style="width: 100px;" />
+                                            <col style="width: 100px;" />
+                                            <col style="width: 100px;" />
                                             <col style="width: 150px;" />
-                                            <col style="width: 130px;" />
+                                            <col style="width: 180px;" />
                                         </colgroup>
                                         <thead class="ant-table-thead">
                                             <tr>
@@ -95,6 +99,10 @@
                                                 <th class="ant-table-cell">油品名称</th>
                                                 <th class="ant-table-cell">罐容量</th>
                                                 <th class="ant-table-cell">当前容量</th>
+                                                <th class="ant-table-cell">泵码</th>
+                                                <th class="ant-table-cell">油高</th>
+                                                <th class="ant-table-cell">水高</th>
+                                                <th class="ant-table-cell">温度</th>
                                                 <th class="ant-table-cell">最后更新时间</th>
                                                 <th class="ant-table-cell">操作</th>
                                             </tr>
@@ -111,8 +119,12 @@
                                             <col style="width: 100px;" />
                                             <col style="width: 100px;" />
                                             <col style="width: 140px;" />
+                                            <col style="width: 100px;" />
+                                            <col style="width: 100px;" />
+                                            <col style="width: 100px;" />
+                                            <col style="width: 100px;" />
                                             <col style="width: 150px;" />
-                                            <col style="width: 130px;" />
+                                            <col style="width: 180px;" />
                                         </colgroup>
                                         <tbody class="ant-table-tbody">
                                             @if (_loading)
@@ -157,6 +169,10 @@
                                                                 </div>
                                                             </div>
                                                         </td>
+                                                        <td class="ant-table-cell"></td>
+                                                         <td class="ant-table-cell"></td>
+                                                          <td class="ant-table-cell"></td>
+                                                        <td class="ant-table-cell"></td>
                                                         <td class="ant-table-cell">@FormatDateTime(device.LastUpdatedTime)</td>
                                                         <td class="ant-table-cell">
                                                             <div class="action-buttons">
@@ -168,6 +184,10 @@
                                                                     <span role="img" class="anticon anticon-delete"></span>
                                                                     <span>删除</span>
                                                                 </button>
+                                                                <button type="button" class="ant-btn ant-btn-link ant-btn-sm ant-btn-dangerous" @onclick="@(() => OnDeleteDevice(device))">
+                                                                    <span role="img" class="anticon anticon-delete"></span>
+                                                                    <span>下发单价</span>
+                                                                </button>
                                                             </div>
                                                         </td>
                                                     </tr>
@@ -1002,7 +1022,6 @@
 
     .ant-btn-sm {
         height: 28px;
-        padding: 0 11px;
         font-size: 13px;
         border-radius: 4px;
     }