index.vue 28.3 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012
<template>
  <div class="dashboard-page">
    <!-- 顶部:门店信息 + 快速会员搜索 -->
    <div class="top-bar">
      <div class="store-info">
        <div class="store-name">绿纤门店 · 工作台</div>
        <div class="store-subtitle">今日邀约 · 预约 · 开单,一眼总览</div>
      </div>
      <div class="member-search">
        <el-input
          v-model="memberKeyword"
          class="member-search-input"
          clearable
          placeholder="快速查询会员:手机号 / 姓名 / 会员卡号"
          prefix-icon="el-icon-search"
          @keyup.enter.native="handleMemberSearch"
        >
          <el-button slot="append" type="primary" @click="handleMemberSearch">查询</el-button>
        </el-input>
      </div>
      <div class="top-meta">
        <div class="today-text">{{ todayLabel }}</div>
        <div class="user-info">
          <div class="user-avatar">{{ userInitial }}</div>
          <span class="user-name">{{ userName }}</span>
        </div>
      </div>
    </div>

    <div class="layout-grid">
      <!-- 左侧:概览 + 六大板块 -->
      <div class="left-column">
        <!-- 今日概览 -->
        <div class="overview-row">
          <el-row :gutter="16">
            <el-col v-for="item in overviewStats" :key="item.key" :span="8">
              <el-card shadow="hover" class="overview-card">
                <div class="overview-meta">
                  <span class="label">{{ item.label }}</span>
                  <span class="tag" v-if="item.tag">{{ item.tag }}</span>
                </div>
                <div class="overview-value">{{ item.value }}</div>
                <div class="overview-sub">{{ item.subText }}</div>
              </el-card>
            </el-col>
          </el-row>
        </div>

        <!-- 六大业务板块 -->
        <div class="modules-grid">
          <el-row :gutter="16">
            <el-col
              v-for="module in modules"
              :key="module.key"
              :span="8"
            >
              <el-card
                shadow="hover"
                class="module-card"
                :body-style="{ padding: '18px 18px 16px' }"
                @click.native="goModule(module)"
              >
                <div class="module-header">
                  <div class="module-title-wrap">
                    <div class="module-title">{{ module.title }}</div>
                    <div class="module-subtitle">{{ module.subtitle }}</div>
                  </div>
                  <div class="module-icon" :style="{ background: module.iconBg }">
                    <i :class="module.icon"></i>
                  </div>
                </div>
                <div class="module-meta">
                  <div class="meta-value">{{ module.metricValue }}</div>
                  <div class="meta-label">{{ module.metricLabel }}</div>
                </div>
                <div class="module-actions">
                  <span
                    class="primary-action"
                    @click.stop="handleModulePrimary(module)"
                  >
                    {{ module.primaryAction }}
                  </span>
                  <span class="secondary-text">{{ module.secondaryText }}</span>
                </div>
              </el-card>
            </el-col>
          </el-row>
        </div>
      </div>

      <!-- 右侧:今日邀约 / 预约 -->
      <div class="right-column">
        <el-card shadow="hover" class="today-card" :body-style="{ padding: '16px 16px 12px' }">
          <div slot="header" class="today-header">
            <div class="today-title">今日邀约 / 预约</div>
            <div class="today-badge">门店实时动态</div>
          </div>
          <el-tabs v-model="todayTab">
            <el-tab-pane label="今日邀约" name="invite">
              <div v-if="todayInvite.length" class="timeline-list">
                <div
                  v-for="item in todayInvite"
                  :key="item.id"
                  class="timeline-item"
                >
                  <div class="time">{{ item.time }}</div>
                  <div class="content">
                    <div class="line-main">
                      <span class="name">{{ item.name }}</span>
                      <span class="mobile">{{ item.mobile }}</span>
                    </div>
                    <div class="line-sub">
                      <span class="project">
                        电话是否有效:{{ item.dhsfyx }} · {{ item.lxjl }}
                      </span>
                      <button
                        type="button"
                        class="quick-book-btn"
                        @click="handleQuickBooking(item)"
                      >
                        快速预约
                      </button>
                    </div>
                  </div>
                </div>
              </div>
              <div v-else class="empty-tip">今日暂无邀约记录</div>
            </el-tab-pane>
            <el-tab-pane label="今日预约" name="booking">
              <div v-if="todayBooking.length" class="timeline-list">
                <div v-for="item in todayBooking" :key="item.id" class="timeline-item">
                  <div class="time">{{ item.time }}</div>
                  <div class="content">
                    <div class="line-main">
                      <span class="name">{{ item.name }}</span>
                      <span class="mobile">{{ item.mobile }}</span>
                    </div>
                    <div class="line-sub">
                      <span class="project">
                        预约项目:{{ item.project }} · 预约时间:{{ item.date }} {{ item.timeRange }}
                      </span>
                      <button
                        type="button"
                        class="quick-order-btn"
                        @click="handleQuickBilling(item)"
                      >
                        快速开单
                      </button>
                    </div>
                  </div>
                </div>
              </div>
              <div v-else class="empty-tip">今日暂无预约记录</div>
            </el-tab-pane>
          </el-tabs>
        </el-card>
      </div>
    </div>
    <member-profile-dialog
      :visible.sync="memberDialogVisible"
      :member="activeMember || {}"
    />
    <tuoke-lead-dialog
      :visible.sync="tuokeDialogVisible"
    />
    <invite-add-dialog
      :visible.sync="inviteDialogVisible"
    />
    <booking-dialog
      :visible.sync="bookingDialogVisible"
      :prefill="bookingPrefill"
    />
  </div>
</template>

<script>
import MemberProfileDialog from '@/components/MemberProfileDialog.vue'
import TuokeLeadDialog from '@/components/TuokeLeadDialog.vue'
import InviteAddDialog from '@/components/InviteAddDialog.vue'
import BookingDialog from '@/components/BookingDialog.vue'

export default {
  name: 'Dashboard',
  components: {
    MemberProfileDialog,
    TuokeLeadDialog,
    InviteAddDialog,
    BookingDialog
  },
  data() {
    return {
      memberKeyword: '',
      memberDialogVisible: false,
      activeMember: null,
      todayTab: 'invite',
      overviewStats: [
        {
          key: 'invite',
          label: '今日邀约',
          value: 0,
          subText: '待联系 0 · 已到店 0',
          tag: '潜客'
        },
        {
          key: 'booking',
          label: '今日预约',
          value: 0,
          subText: '进行中 0 · 已完成 0',
          tag: '到店'
        },
        {
          key: 'order',
          label: '今日业绩',
          value: '¥0',
          subText: '开单 0 · 客次 0',
          tag: '收银'
        }
      ],
      modules: [
        {
          key: 'tuoke',
          title: '拓客管理',
          subtitle: '',
          icon: 'el-icon-connection',
          iconBg: 'linear-gradient(135deg, #6366f1, #a855f7)',
          metricValue: 0,
          metricLabel: '今日新增潜客',
          primaryAction: '录入拓客信息',
          secondaryText: '查看拓客数据',
          route: '/tuoke'
        },
        {
          key: 'invite',
          title: '邀约管理',
          subtitle: '',
          icon: 'el-icon-phone-outline',
          iconBg: 'linear-gradient(135deg, #0ea5e9, #22c55e)',
          metricValue: 0,
          metricLabel: '待跟进邀约',
          primaryAction: '去邀约',
          secondaryText: '查看邀约记录',
          route: '/invite'
        },
        {
          key: 'booking',
          title: '预约管理',
          subtitle: '',
          icon: 'el-icon-date',
          iconBg: 'linear-gradient(135deg, #f97316, #facc15)',
          metricValue: 0,
          metricLabel: '今日预约',
          primaryAction: '新建预约',
          secondaryText: '打开预约日历',
          route: '/booking'
        },
        {
          key: 'order',
          title: '开单管理',
          subtitle: '',
          icon: 'el-icon-s-order',
          iconBg: 'linear-gradient(135deg, #3b82f6, #2563eb)',
          metricValue: 0,
          metricLabel: '今日开单',
          primaryAction: '快速开单',
          secondaryText: '查看开单记录',
          route: '/orders'
        },
        {
          key: 'consume',
          title: '消耗管理',
          subtitle: '',
          icon: 'el-icon-magic-stick',
          iconBg: 'linear-gradient(135deg, #22c55e, #16a34a)',
          metricValue: 0,
          metricLabel: '今日消耗人次',
          primaryAction: '记录消耗',
          secondaryText: '查看消耗记录',
          route: '/consume'
        },
        {
          key: 'refund',
          title: '退卡管理',
          subtitle: '',
          icon: 'el-icon-refresh-left',
          iconBg: 'linear-gradient(135deg, #f97316, #ef4444)',
          metricValue: 0,
          metricLabel: '今日退卡',
          primaryAction: '发起退卡',
          secondaryText: '查看售后记录',
          route: '/refund'
        }
      ],
      todayInvite: [
        {
          id: 'TI202603020001',
          time: '09:10',
          name: '林小纤',
          mobile: '13800138000',
          dhsfyx: '是',
          lxjl: '邀约周末面部深层护理体验,客户有兴趣。'
        },
        {
          id: 'TI202603020002',
          time: '09:35',
          name: '王丽',
          mobile: '13800138001',
          dhsfyx: '是',
          lxjl: '介绍肩颈调理活动,已确认可到店。'
        },
        {
          id: 'TI202603020003',
          time: '10:05',
          name: '张敏',
          mobile: '13800138002',
          dhsfyx: '否',
          lxjl: '电话无人接听,准备稍后再次联系。'
        },
        {
          id: 'TI202603020004',
          time: '10:40',
          name: '赵云',
          mobile: '13800138003',
          dhsfyx: '是',
          lxjl: '邀约身体舒缓护理体验,客户需与家人确认时间。'
        },
        {
          id: 'TI202603020005',
          time: '11:20',
          name: '刘芳',
          mobile: '13800138004',
          dhsfyx: '是',
          lxjl: '眼周护理体验回访,客户反馈效果不错。'
        },
        {
          id: 'TI202603020006',
          time: '13:15',
          name: '陈洁',
          mobile: '13800138005',
          dhsfyx: '是',
          lxjl: '面部护理加购邀约,客户考虑本周安排。'
        },
        {
          id: 'TI202603020007',
          time: '14:00',
          name: '周雪',
          mobile: '13800138006',
          dhsfyx: '否',
          lxjl: '电话为空号,准备核实客户信息。'
        },
        {
          id: 'TI202603020008',
          time: '15:10',
          name: '李楠',
          mobile: '13800138007',
          dhsfyx: '是',
          lxjl: '身体护理活动邀约,客户希望下班后再联系。'
        },
        {
          id: 'TI202603020009',
          time: '16:25',
          name: '何倩',
          mobile: '13800138008',
          dhsfyx: '是',
          lxjl: '生日关怀邀约,初步定周末到店。'
        },
        {
          id: 'TI202603020010',
          time: '17:40',
          name: '孙悦',
          mobile: '13800138009',
          dhsfyx: '是',
          lxjl: '眼周护理复查邀约,客户暂不方便到店。'
        }
      ],
      todayBooking: [
        {
          id: 'TB202603020001',
          time: '09:30',
          date: '2026-03-02',
          timeRange: '09:30-10:00',
          name: '林小纤',
          mobile: '13800138000',
          project: '面部深层护理',
          staffName: '小李',
          status: 'pending',
          statusText: '待服务'
        },
        {
          id: 'TB202603020002',
          time: '10:00',
          date: '2026-03-02',
          timeRange: '10:00-10:30',
          name: '王丽',
          mobile: '13800138001',
          project: '肩颈调理',
          staffName: '小王',
          status: 'pending',
          statusText: '待服务'
        },
        {
          id: 'TB202603020003',
          time: '10:45',
          date: '2026-03-02',
          timeRange: '10:45-11:15',
          name: '张敏',
          mobile: '13800138002',
          project: '春季补水套餐',
          staffName: '小李',
          status: 'done',
          statusText: '已完成'
        },
        {
          id: 'TB202603020004',
          time: '11:30',
          date: '2026-03-02',
          timeRange: '11:30-12:00',
          name: '赵云',
          mobile: '13800138003',
          project: '身体舒缓护理',
          staffName: '小王',
          status: 'pending',
          statusText: '待服务'
        },
        {
          id: 'TB202603020005',
          time: '13:00',
          date: '2026-03-02',
          timeRange: '13:00-13:30',
          name: '刘芳',
          mobile: '13800138004',
          project: '眼周护理套餐',
          staffName: '小李',
          status: 'cancel',
          statusText: '已取消'
        },
        {
          id: 'TB202603020006',
          time: '14:20',
          date: '2026-03-02',
          timeRange: '14:20-14:50',
          name: '陈洁',
          mobile: '13800138005',
          project: '面部深层护理',
          staffName: '小李',
          status: 'pending',
          statusText: '待服务'
        },
        {
          id: 'TB202603020007',
          time: '15:10',
          date: '2026-03-02',
          timeRange: '15:10-15:40',
          name: '周雪',
          mobile: '13800138006',
          project: '肩颈调理',
          staffName: '小王',
          status: 'done',
          statusText: '已完成'
        },
        {
          id: 'TB202603020008',
          time: '16:00',
          date: '2026-03-02',
          timeRange: '16:00-16:30',
          name: '李楠',
          mobile: '13800138007',
          project: '身体舒缓护理',
          staffName: '小王',
          status: 'pending',
          statusText: '待服务'
        },
        {
          id: 'TB202603020009',
          time: '16:45',
          date: '2026-03-02',
          timeRange: '16:45-17:15',
          name: '何倩',
          mobile: '13800138008',
          project: '眼周护理套餐',
          staffName: '小李',
          status: 'pending',
          statusText: '待服务'
        },
        {
          id: 'TB202603020010',
          time: '17:30',
          date: '2026-03-02',
          timeRange: '17:30-18:00',
          name: '孙悦',
          mobile: '13800138009',
          project: '面部深层护理',
          staffName: '小李',
          status: 'pending',
          statusText: '待服务'
        }
      ],
      tuokeDialogVisible: false,
      inviteDialogVisible: false,
      bookingDialogVisible: false,
      bookingPrefill: {
        name: '',
        phone: ''
      }
    }
  },
  computed: {
    todayLabel() {
      const d = new Date()
      const year = d.getFullYear()
      const month = `${d.getMonth() + 1}`.padStart(2, '0')
      const day = `${d.getDate()}`.padStart(2, '0')
      return `${year}-${month}-${day}`
    },
    userName() {
      return (this.$store && this.$store.state && this.$store.state.user && this.$store.state.user.realName) || '门店前台'
    },
    userInitial() {
      return this.userName ? this.userName[0] : '店'
    }
  },
  methods: {
    handleModulePrimary(module) {
      if (module.key === 'tuoke') {
        this.tuokeDialogVisible = true
        return
      }
      if (module.key === 'invite') {
        this.inviteDialogVisible = true
        return
      }
      if (module.key === 'booking') {
        this.bookingPrefill = { name: '', phone: '' }
        this.bookingDialogVisible = true
        return
      }
      this.goModule(module)
    },
    handleMemberSearch() {
      const keyword = (this.memberKeyword || '').trim()
      if (!keyword) return
      this.activeMember = {
        id: '10001',
        dah: 'LX202603010001',
        khmc: '林小纤',
        sjh: keyword || '13800138000',
        xb: '女',
        gsmdName: this.$store.state.storeInfo?.storeName || '绿纤门店',
        khlxName: '散客',
        zcsj: '2024-08-15 15:32',
        jdqd: '小程序拓客',
        tjrName: '老客户-王女士',
        mainHealthUserName: '—',
        subHealthUserName: '赵美美',
        expandUserName: '—',
        lxdz: '杭州市 · 西湖区 · 文三路',
        bz: '偏好安静包间,对香味略敏感',
        totalConsumeAmount: 12000,
        totalBillingAmount: 15280,
        remainingRightsAmount: 3280,
        visitDays: 18,
        sleepDays: 5,
        lastVisitTime: '2026-03-02 16:20',
        lastConsumeTime: '2026-03-02 16:20',
        consumeLevelName: '金卡会员',
        yanglsr: '08-18',
        yinlsr: '七月初五',
        isBeautyMember: 1,
        isMedicalMember: 0,
        isTechMember: 0,
        isEducationMember: 0,
        RemainingItems: [
          { ItemName: '面部深层护理(次卡)', ItemPrice: 380, SourceType: '购买', TotalPurchased: 10, ConsumedCount: 4, RemainingCount: 6 },
          { ItemName: '肩颈调理(疗程)', ItemPrice: 268, SourceType: '购买', TotalPurchased: 5, ConsumedCount: 2, RemainingCount: 3 },
          { ItemName: '身体舒缓护理', ItemPrice: 498, SourceType: '购买', TotalPurchased: 3, ConsumedCount: 1, RemainingCount: 2 },
          { ItemName: '眼周护理套餐', ItemPrice: 198, SourceType: '赠送', TotalPurchased: 4, ConsumedCount: 1, RemainingCount: 3 },
          { ItemName: '颈肩放松体验', ItemPrice: 168, SourceType: '活动', TotalPurchased: 2, ConsumedCount: 0, RemainingCount: 2 }
        ],
        billingRecords: [
          { orderNo: 'BD202603020001', billingTime: '2026-03-02 14:30', productName: '面部深层护理(次卡)', amount: 2280, operator: '赵美美' },
          { orderNo: 'BD202602150002', billingTime: '2026-02-15 10:20', productName: '肩颈调理(疗程)', amount: 1340, operator: '赵美美' },
          { orderNo: 'BD202601300003', billingTime: '2026-01-30 16:05', productName: '身体舒缓护理', amount: 1494, operator: '李丽' },
          { orderNo: 'BD202601120004', billingTime: '2026-01-12 11:20', productName: '眼周护理套餐', amount: 792, operator: '李丽' },
          { orderNo: 'BD202512250005', billingTime: '2025-12-25 19:30', productName: '颈肩放松体验', amount: 336, operator: '王芳' }
        ],
        consumeRecords: [
          { consumeTime: '2026-03-02 16:20', itemName: '面部深层护理', count: 1, operator: '小李' },
          { consumeTime: '2026-02-28 15:00', itemName: '肩颈调理', count: 1, operator: '小李' },
          { consumeTime: '2026-02-20 18:30', itemName: '身体舒缓护理', count: 1, operator: '小王' },
          { consumeTime: '2026-02-10 13:40', itemName: '眼周护理套餐', count: 1, operator: '小王' },
          { consumeTime: '2026-01-30 10:15', itemName: '颈肩放松体验', count: 1, operator: '小李' }
        ],
        inviteRecords: [
          { inviteTime: '2026-03-01 09:00', inviteContent: '周末护理体验邀约', inviter: '赵美美', status: '已到店' },
          { inviteTime: '2026-02-25 14:00', inviteContent: '春季护肤专场', inviter: '赵美美', status: '已到店' },
          { inviteTime: '2026-02-18 10:30', inviteContent: '肩颈调理舒缓活动', inviter: '李丽', status: '待跟进' },
          { inviteTime: '2026-02-05 16:20', inviteContent: '身体舒缓护理体验', inviter: '李丽', status: '未接通' },
          { inviteTime: '2026-01-28 11:10', inviteContent: '生日关怀邀约', inviter: '王芳', status: '已到店' }
        ],
        bookingRecords: [
          { bookingTime: '2026-03-05 14:00', projectName: '面部深层护理', staffName: '小李', status: '待服务' },
          { bookingTime: '2026-03-02 16:00', projectName: '面部深层护理', staffName: '小李', status: '已完成' },
          { bookingTime: '2026-02-26 10:30', projectName: '肩颈调理', staffName: '小王', status: '已取消' },
          { bookingTime: '2026-02-15 19:00', projectName: '身体舒缓护理', staffName: '小王', status: '已完成' },
          { bookingTime: '2026-01-31 11:20', projectName: '眼周护理套餐', staffName: '小李', status: '待确认' }
        ],
        refundRecords: [
          { refundTime: '2026-02-20 11:30', orderNo: 'TK202602200001', projectName: '肩颈调理(疗程)', amount: 536, operator: '赵美美' },
          { refundTime: '2026-02-10 15:10', orderNo: 'TK202602100002', projectName: '面部深层护理(次卡)', amount: 760, operator: '赵美美' },
          { refundTime: '2026-01-28 17:40', orderNo: 'TK202601280003', projectName: '身体舒缓护理', amount: 498, operator: '李丽' },
          { refundTime: '2026-01-15 13:05', orderNo: 'TK202601150004', projectName: '眼周护理套餐', amount: 198, operator: '李丽' },
          { refundTime: '2025-12-30 16:25', orderNo: 'TK202512300005', projectName: '颈肩放松体验', amount: 168, operator: '王芳' }
        ]
      }
      this.memberDialogVisible = true
    },
    handleQuickBooking(item) {
      this.bookingPrefill = {
        name: item.name,
        phone: item.mobile
      }
      this.bookingDialogVisible = true
    },
    handleQuickBilling(item) {
      this.$router.push('/orders')
    },
    goModule(module) {
      if (module.route) {
        this.$router.push(module.route)
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard-page {
  min-height: 100%;
  padding: 20px 24px;
  background: radial-gradient(circle at 10% 20%, #eef2ff 0, #eef2ff 26%, #fdf2ff 60%, #fff7ed 100%);
  box-sizing: border-box;
}

.top-bar {
  display: grid;
  grid-template-columns: minmax(200px, 1.2fr) minmax(260px, 2fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.store-info {
  .store-name {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    letter-spacing: 0.5px;
  }
  .store-subtitle {
    margin-top: 4px;
    font-size: 13px;
    color: #6b7280;
  }
}

.member-search-input {
  ::v-deep .el-input-group__append {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    padding: 0 20px;
    border-radius: 0 999px 999px 0;
  }
  ::v-deep .el-input__inner {
    border-radius: 999px 0 0 999px;
    padding-left: 40px;
  }
}

.top-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: flex-end;
}

.today-text {
  font-size: 13px;
  color: #6b7280;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #22c55e);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.user-name {
  font-size: 13px;
  color: #374151;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.1fr);
  gap: 16px;
}

.left-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modules-grid {
  margin-top: 4px;
}

.modules-grid .el-col {
  margin-bottom: 16px;
}

.overview-row {
  .overview-card {
    border-radius: 16px;
    border: none;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  }
}

.overview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  .label {
    font-size: 13px;
    color: #6b7280;
  }
  .tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eff6ff;
    color: #2563eb;
  }
}

.overview-value {
  font-size: 24px;
  font-weight: 600;
  color: #111827;
}

.overview-sub {
  margin-top: 4px;
  font-size: 12px;
  color: #9ca3af;
}

.modules-grid .module-card {
  border-radius: 18px;
  border: none;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

.modules-grid .module-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}

.module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.module-title-wrap {
  .module-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
  }
  .module-subtitle {
    margin-top: 2px;
    font-size: 12px;
    color: #6b7280;
  }
}

.module-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  i {
    font-size: 20px;
  }
}

.module-meta {
  margin-top: 8px;
  .meta-value {
    font-size: 22px;
    font-weight: 600;
    color: #111827;
  }
  .meta-label {
    margin-top: 2px;
    font-size: 12px;
    color: #9ca3af;
  }
}

.module-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  .primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    height: 30px;
    padding: 0 14px;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
  }
  .secondary-text {
    font-size: 12px;
    color: #9ca3af;
  }
}

.right-column .today-card {
  border-radius: 18px;
  border: none;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.today-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.today-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.today-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
}

.timeline-list {
}

.timeline-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  column-gap: 8px;
  padding: 6px 0;
  font-size: 12px;
}

.timeline-item + .timeline-item {
  border-top: 1px dashed #e5e7eb;
}

.timeline-item .time {
  color: #6b7280;
  padding-top: 2px;
}

.timeline-item .content {
  .line-main {
    display: flex;
    align-items: center;
    gap: 6px;
    .name {
      color: #111827;
      font-weight: 500;
    }
    .mobile {
      color: #6b7280;
    }
  }
  .line-sub {
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    .project {
      color: #6b7280;
      flex: 1;
    }
  }
}

.quick-book-btn {
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  padding: 0 12px;
  height: 26px;
  line-height: 26px;
  font-size: 12px;
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.3);
  cursor: pointer;
}

.quick-book-btn:hover {
  background: #1d4ed8;
}

.quick-order-btn {
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  padding: 0 12px;
  height: 26px;
  line-height: 26px;
  font-size: 12px;
  background: #f97316;
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(248, 113, 22, 0.3);
  cursor: pointer;
}

.quick-order-btn:hover {
  background: #ea580c;
}

.status {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
}

.status--pending {
  background: #fef3c7;
  color: #92400e;
}

.status--done {
  background: #dcfce7;
  color: #166534;
}

.status--cancel {
  background: #fee2e2;
  color: #b91c1c;
}

.empty-tip {
  padding: 16px 0;
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
}

@media (max-width: 1024px) {
  .layout-grid {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.1fr);
  }
}

@media (max-width: 768px) {
  .dashboard-page {
    padding: 16px;
  }
  .top-bar {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 12px;
  }
  .layout-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
</style>