performanceDetailDialog.vue 2.96 KB
<!-- 业绩详情弹窗 -->
<template>
  <d2-dialog
    title="查看明细"
    :is-visible.sync="perDetailVisible"
    width="75%"
    btn-ok-label="关闭"
    @confirmDialog="handleConfirm"
    @closeDialog="handleConfirm"
    :no-cancel="true"
    class="performance-detail">
    <span slot="sub-title">
      <span class="title-staff-name">{{ detailInfoData.updatedBy }}</span><span>{{ detailInfoData.merchantName }}</span>
    </span>
    <el-row class="tableCon">
      <div class="tableBox">
        <d2-table ref="perDetailTable"
                  :has-num="false"
                  :search-form="searchForm"
                  :table-params="tableParams"
                  :get-list-api="getListApi"
                  :before-search-fn="beforeSearchFn">
        </d2-table>
      </div>
    </el-row>
  </d2-dialog>
</template>

<script>
import { getPerDetailListApi } from '@api/businessSchool'
import { Util } from '@/common/util'
export default {
  name: 'PerformanceDetailDialog',
  data() {
    return {
      getListApi: getPerDetailListApi,
      // 表格参数
      tableParams: {
        needUnique: true,
        mutiSelectUniqueKey: 'uniqueVal',
        btnId: new Date().getTime() + parseInt(Math.random() * 1000),
        listName: 'list',
        tableColumns: [{
          label: '序号',
          prop: 'ownSerialNum',
          type: 'ownSerialNum',
          width: '60'
        }, {
          label: '订单编号',
          prop: 'orderCode',
          width: '160'
        }, {
          label: '支付时间',
          prop: 'paySuccessTime',
          width: '160',
          formatter: (cellValue) => {
            return Util.dateFormate(cellValue?.paySuccessTime, 'YYYY-MM-DD HH:mm:ss')
          }
        }, {
          label: '客户名称',
          prop: 'customerName'
        }, {
          label: '客户手机号',
          prop: 'customerPhone',
          width: '120'
        }, {
          label: '订单产值/元',
          prop: 'orderMoney'
        }, {
          label: '产值比例',
          prop: 'averagePriceBonus'
        }, {
          label: '成交率系数',
          prop: 'customerUnitBonus'
        }, {
          label: '均客单系数',
          prop: 'outputBonus'
        }, {
          label: '导师激励提成',
          prop: 'mentorBonus'
        }, {
          label: '订单总提成',
          prop: 'orderBonus'
        }]
      },
      searchForm: {}
    }
  },

  props: {
    perDetailVisible: {
      type: Boolean,
      default: false
    },
    detailInfoData: {
      type: Object
    }
  },

  methods: {
    beforeSearchFn() {
      return new Promise(resolve => {
        this.searchForm = {
          mentorOrStudentStaffUuid: this.detailInfoData?.staffUuid
        }
        resolve()
      })
    },
    handleConfirm() {
      this.$emit('handleConfirm')
    }
  }
}

</script>
<style lang="scss">
.performance-detail .table {
  margin: 0 auto 20px !important;
  width: 98%;
}
.title-staff-name{
  margin: 0 8px;
}
</style>