index.vue 22 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
<template>
  <div class="salary-statistics-page">
    <!-- 搜索区域 -->
    <div class="search-section">
      <el-card class="search-card">
        <div slot="header" class="search-header">
          <span><i class="el-icon-search"></i> 健康师工资统计查询</span>
        </div>
        <el-form :model="queryParams" :inline="true" class="search-form">
          <el-form-item label="统计月份">
            <el-date-picker v-model="queryParams.statisticsMonth" type="month" placeholder="选择月份" format="yyyyMM"
              value-format="yyyyMM" size="small"></el-date-picker>
          </el-form-item>
          <el-form-item label="门店名称">
            <el-input v-model="queryParams.storeName" placeholder="请输入门店名称" size="small" clearable></el-input>
          </el-form-item>
          <el-form-item label="员工姓名">
            <el-input v-model="queryParams.employeeName" placeholder="请输入员工姓名" size="small" clearable></el-input>
          </el-form-item>
          <el-form-item label="岗位">
            <el-select v-model="queryParams.position" placeholder="请选择岗位" size="small" clearable>
              <el-option label="健康师" value="健康师"></el-option>
              <el-option label="店长" value="店长"></el-option>
              <el-option label="主任" value="主任"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="金三角战队">
            <el-input v-model="queryParams.goldTriangleTeam" placeholder="请输入金三角战队" size="small" clearable></el-input>
          </el-form-item>
          <el-form-item label="是否锁定">
            <el-select v-model="queryParams.isLocked" placeholder="请选择锁定状态" size="small" clearable>
              <el-option label="未锁定" :value="0"></el-option>
              <el-option label="已锁定" :value="1"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" size="small" @click="handleSearch">
              <i class="el-icon-search"></i> 搜索
            </el-button>
            <el-button size="small" @click="handleReset">
              <i class="el-icon-refresh"></i> 重置
            </el-button>
          </el-form-item>
        </el-form>
      </el-card>
    </div>

    <!-- 表格区域 -->
    <div class="table-section">
      <el-card class="table-card">
        <div slot="header" class="table-header">
          <span><i class="el-icon-s-data"></i> 健康师工资统计列表</span>
        </div>
        <el-table :data="tableData" v-loading="loading" border stripe style="width: 100%" :height="tableHeight">
          <!-- 基本信息 -->
          <el-table-column prop="StatisticsMonth" label="统计月份" width="100" fixed="left"></el-table-column>
          <el-table-column prop="StoreName" label="门店名称" width="120" fixed="left"></el-table-column>
          <el-table-column prop="EmployeeName" label="员工姓名" width="100" fixed="left"></el-table-column>
          <el-table-column prop="Position" label="岗位" width="100" fixed="left"></el-table-column>
          <el-table-column prop="GoldTriangleTeam" label="金三角战队" fixed="left" width="120"></el-table-column>

          <!-- 业绩相关 -->
          <el-table-column prop="TotalPerformance" label="总业绩" width="100" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.TotalPerformance) }}
            </template>
          </el-table-column>
          <el-table-column prop="BasePerformance" label="基础业绩" width="100" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.BasePerformance) }}
            </template>
          </el-table-column>
          <el-table-column prop="CooperationPerformance" label="合作业绩" width="100" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.CooperationPerformance) }}
            </template>
          </el-table-column>
          <el-table-column prop="RewardPerformance" label="奖励业绩" width="100" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.RewardPerformance) }}
            </template>
          </el-table-column>

          <!-- 新客数据 -->
          <el-table-column label="新客数据" align="center">
            <el-table-column prop="NewCustomerPerformance" label="新客业绩" width="100" align="center">
              <template slot-scope="scope">
                {{ formatMoney(scope.row.NewCustomerPerformance) }}
              </template>
            </el-table-column>
            <el-table-column prop="NewCustomerConversionRate" label="新客成交率" width="100" align="center">
              <template slot-scope="scope">
                {{ formatPercent(scope.row.NewCustomerConversionRate) }}
              </template>
            </el-table-column>
            <el-table-column prop="NewCustomerPoint" label="新客提点" width="100" align="center">
              <template slot-scope="scope">
                {{ formatPercent(scope.row.NewCustomerPoint) }}
              </template>
            </el-table-column>
          </el-table-column>

          <!-- 升单数据 -->
          <el-table-column label="升单数据" align="center">
            <el-table-column prop="UpgradePerformance" label="升单业绩" width="100" align="center">
              <template slot-scope="scope">
                {{ formatMoney(scope.row.UpgradePerformance) }}
              </template>
            </el-table-column>
            <el-table-column prop="UpgradePoint" label="升单提点" width="100" align="center">
              <template slot-scope="scope">
                {{ formatPercent(scope.row.UpgradePoint) }}
              </template>
            </el-table-column>
          </el-table-column>
          <!--消耗数据-->
          <el-table-column label="消耗数据" align="center">
            <el-table-column prop="Consumption" label="消耗业绩" width="100" align="center">
              <template slot-scope="scope">
                {{ formatMoney(scope.row.Consumption) }}
              </template>
            </el-table-column>
            <el-table-column prop="ProjectCount" label="项目数" width="80" align="center"></el-table-column>
          </el-table-column>
          <!-- 其他数据 -->
          <el-table-column prop="StoreTotalPerformance" label="门店总业绩" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.StoreTotalPerformance) }}
            </template>
          </el-table-column>
          <el-table-column prop="TeamPerformance" label="队伍业绩" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.TeamPerformance) }}
            </template>
          </el-table-column>
          <el-table-column prop="Percentage" label="占比" width="100" align="center">
            <template slot-scope="scope">
              {{ scope.row.Percentage }}%
            </template>
          </el-table-column>
          <el-table-column prop="CustomerCount" label="到店人头" width="100" align="center"></el-table-column>
          <el-table-column prop="WorkingDays" label="在店天数" width="100" align="center"></el-table-column>
          <el-table-column prop="LeaveDays" label="请假天数" width="100" align="center"></el-table-column>
          <el-table-column prop="CommissionPoint" label="提点" width="100" align="center">
            <template slot-scope="scope">
              {{ formatPercent(scope.row.CommissionPoint) }}
            </template>
          </el-table-column>
          <el-table-column prop="BasePerformanceCommission" label="基础业绩提成" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.BasePerformanceCommission) }}
            </template>
          </el-table-column>
          <el-table-column prop="CooperationPerformanceCommission" label="合作业绩提成" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.CooperationPerformanceCommission) }}
            </template>
          </el-table-column>
          <el-table-column prop="ConsultantCommission" label="顾问提成" width="100" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.ConsultantCommission) }}
            </template>
          </el-table-column>
          <el-table-column prop="StoreTZoneCommission" label="门店T区提成" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.StoreTZoneCommission) }}
            </template>
          </el-table-column>
          <el-table-column prop="TotalCommission" label="提成合计" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.TotalCommission) }}
            </template>
          </el-table-column>
          <el-table-column prop="HealthCoachBaseSalary" label="健康师底薪" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.HealthCoachBaseSalary) }}
            </template>
          </el-table-column>
          <el-table-column prop="HandworkFee" label="手工费" width="100" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.HandworkFee) }}
            </template>
          </el-table-column>
          <el-table-column prop="OutherHandworkFee" label="额外手工费" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.OutherHandworkFee) }}
            </template>
          </el-table-column>
          <el-table-column prop="TransportationAllowance" label="车补" width="100" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.TransportationAllowance) }}
            </template>
          </el-table-column>
          <el-table-column prop="LessRest" label="少休费" width="100" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.LessRest) }}
            </template>
          </el-table-column>
          <el-table-column prop="FullAttendance" label="全勤奖" width="100" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.FullAttendance) }}
            </template>
          </el-table-column>
          <el-table-column prop="CalculatedGrossSalary" label="核算应发工资" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.CalculatedGrossSalary) }}
            </template>
          </el-table-column>
          <el-table-column prop="GuaranteedSalary" label="保底工资" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.GuaranteedSalary) }}
            </template>
          </el-table-column>
          <el-table-column prop="GuaranteedLeaveDeduction" label="保底请假扣款" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.GuaranteedLeaveDeduction) }}
            </template>
          </el-table-column>
          <el-table-column prop="GuaranteedBaseSalary" label="保底底薪" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.GuaranteedBaseSalary) }}
            </template>
          </el-table-column>
          <el-table-column prop="GuaranteedSupplement" label="保底补差" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.GuaranteedSupplement) }}
            </template>
          </el-table-column>
          <el-table-column prop="FinalGrossSalary" label="最终应发工资" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.FinalGrossSalary) }}
            </template>
          </el-table-column>
          <el-table-column prop="MonthlyTrainingSubsidy" label="当月培训补贴" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.MonthlyTrainingSubsidy) }}
            </template>
          </el-table-column>
          <el-table-column prop="MonthlyTransportSubsidy" label="当月交通补贴" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.MonthlyTransportSubsidy) }}
            </template>
          </el-table-column>
          <el-table-column prop="LastMonthTrainingSubsidy" label="上月培训补贴" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.LastMonthTrainingSubsidy) }}
            </template>
          </el-table-column>
          <el-table-column prop="LastMonthTransportSubsidy" label="上月交通补贴" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.LastMonthTransportSubsidy) }}
            </template>
          </el-table-column>
          <el-table-column prop="TotalSubsidy" label="补贴合计" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.TotalSubsidy) }}
            </template>
          </el-table-column>
          <el-table-column prop="MissingCard" label="缺卡扣款" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.MissingCard) }}
            </template>
          </el-table-column>
          <el-table-column prop="LateArrival" label="迟到扣款" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.LateArrival) }}
            </template>
          </el-table-column>
          <el-table-column prop="LeaveDeduction" label="请假扣款" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.LeaveDeduction) }}
            </template>
          </el-table-column>
          <el-table-column prop="SocialInsuranceDeduction" label="扣社保" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.SocialInsuranceDeduction) }}
            </template>
          </el-table-column>
          <el-table-column prop="RewardDeduction" label="扣除奖励" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.RewardDeduction) }}
            </template>
          </el-table-column>
          <el-table-column prop="AccommodationDeduction" label="扣住宿费" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.AccommodationDeduction) }}
            </template>
          </el-table-column>
          <el-table-column prop="StudyPeriodDeduction" label="扣学习期费用" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.StudyPeriodDeduction) }}
            </template>
          </el-table-column>
          <el-table-column prop="WorkClothesDeduction" label="扣工作服费用" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.WorkClothesDeduction) }}
            </template>
          </el-table-column>
          <el-table-column prop="TotalDeduction" label="扣款合计" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.TotalDeduction) }}
            </template>
          </el-table-column>
          <el-table-column prop="Bonus" label="发奖金" width="100" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.Bonus) }}
            </template>
          </el-table-column>
          <el-table-column prop="ReturnPhoneDeposit" label="退手机押金" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.ReturnPhoneDeposit) }}
            </template>
          </el-table-column>
          <el-table-column prop="ReturnAccommodationDeposit" label="退住宿押金" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.ReturnAccommodationDeposit) }}
            </template>
          </el-table-column>
          <el-table-column prop="ActualSalary" label="实发工资" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.ActualSalary) }}
            </template>
          </el-table-column>
          <el-table-column prop="MonthlyPaymentStatus" label="当月是否发放" width="120" align="center"></el-table-column>
          <el-table-column prop="PaidAmount" label="支付金额" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.PaidAmount) }}
            </template>
          </el-table-column>
          <el-table-column prop="PendingAmount" label="待支付金额" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.PendingAmount) }}
            </template>
          </el-table-column>
          <el-table-column prop="LastMonthSupplement" label="补发上月" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.LastMonthSupplement) }}
            </template>
          </el-table-column>
          <el-table-column prop="MonthlyTotalPayment" label="当月支付总额" width="120" align="center">
            <template slot-scope="scope">
              {{ formatMoney(scope.row.MonthlyTotalPayment) }}
            </template>
          </el-table-column>
          <el-table-column prop="IsLocked" label="锁定状态" width="100" align="center">
            <template slot-scope="scope">
              <el-tag :type="scope.row.IsLocked === 1 ? 'danger' : 'success'" size="mini">
                {{ scope.row.IsLocked === 1 ? '已锁定' : '未锁定' }}
              </el-tag>
            </template>
          </el-table-column>
        </el-table>
        <div class="pagination-section">
          <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
            :current-page="pagination.pageIndex" :page-sizes="[10, 20, 50, 100]" :page-size="pagination.pageSize"
            layout="total, sizes, prev, pager, next, jumper" :total="pagination.total"></el-pagination>
        </div>
      </el-card>

    </div>
  </div>
</template>

<script>
import { getSalaryStatisticsList } from '@/api/extend/statistics'

export default {
  name: 'SalaryStatistics',
  data() {
    return {
      loading: false,
      tableData: [],
      tableHeight: 890,
      queryParams: {
        statisticsMonth: '',
        storeName: '',
        employeeName: '',
        position: '',
        goldTriangleTeam: '',
        isLocked: null
      },
      pagination: {
        pageIndex: 1,
        pageSize: 20,
        total: 0
      }
    }
  },
  created() {
    this.getList()
  },
  methods: {

    // 获取列表数据
    async getList() {
      this.loading = true
      try {
        const params = {
          currentPage: this.pagination.pageIndex,
          pageSize: this.pagination.pageSize,
          ...this.queryParams
        }

        const response = await getSalaryStatisticsList(params)

        if (response.code === 200) {
          this.tableData = response.data.list || []
          this.pagination.total = response.data.pagination.total || 0
        } else {
          this.$message.error(response.msg || '获取数据失败')
        }
      } catch (error) {
        console.error('获取工资统计数据失败:', error)
        this.$message.error('获取数据失败')
      } finally {
        this.loading = false
      }
    },

    // 搜索
    handleSearch() {
      this.pagination.pageIndex = 1
      this.getList()
    },

    // 重置
    handleReset() {
      this.queryParams = {
        statisticsMonth: '',
        storeName: '',
        employeeName: '',
        position: '',
        goldTriangleTeam: '',
        isLocked: null
      }
      this.pagination.pageIndex = 1
      this.getList()
    },

    // 分页大小改变
    handleSizeChange(val) {
      this.pagination.pageSize = val
      this.pagination.pageIndex = 1
      this.getList()
    },

    // 当前页改变
    handleCurrentChange(val) {
      this.pagination.pageIndex = val
      this.getList()
    },

    // 格式化金额
    formatMoney(value) {
      if (value === null || value === undefined || value === '') {
        return '0.00'
      }
      return Number(value).toFixed(2)
    },

    // 格式化百分比
    formatPercent(value) {
      if (value === null || value === undefined || value === '') {
        return '0.00%'
      }
      return (Number(value) * 100).toFixed(2) + '%'
    }
  }
}
</script>

<style lang="scss" scoped>
.salary-statistics-page {
  padding: 20px;
  height: calc(100vh - 150px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.search-section {
  flex-shrink: 0;
  margin-bottom: 20px;
}

.search-card {
  .search-header {
    font-weight: 600;
    color: #303133;
  }

  .search-form {
    .el-form-item {
      margin-bottom: 18px;
    }
  }
}

.table-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.table-card {
  height: 100%;

  .table-header {
    font-weight: 600;
    color: #303133;
  }

  .el-card__body {
    padding: 20px;
  }
}

.pagination-section {
  flex-shrink: 0;
  margin-top: 20px;
  text-align: right;
  padding-top: 20px;
  border-top: 1px solid #ebeef5;
}

// 表格样式优化
.el-table {
  overflow: auto;

  .el-table__header-wrapper {
    th {
      background-color: #f5f7fa;
      color: #606266;
      font-weight: 600;
    }
  }

  .el-table__body-wrapper {
    .el-table__row {
      &:hover {
        background-color: #f5f7fa;
      }
    }
  }
}

// 搜索表单样式
.search-form {
  .el-form-item {
    margin-right: 20px;

    &:last-child {
      margin-right: 0;
    }
  }
}
</style>