technicianDetailDialog.vue 3.94 KB
<!-- 技师绩效-查看明细弹窗 -->
<template>
  <GLDialog class="apply-store"
            bigTitle="查看明细"
            mode="big"
            :visible.sync="isVisible"
            :before-close="handleClose"
            v-loading="loading"
            :hasFooter="false">
    <div>
      <slot name="search"></slot>
      <GLTable ref="storeRef"
               :getListApi="getListApi"
               :noDataImg="url"
               :searchForm="tableSearchForm"
               :tableParams="tableParams"
               :pageConf="pageConf"
               :beforeSearchFn="beforeSearchFn"
               @setTableFinishFun="setTableFinishFun">
        <div class="tb-ellipsis"
             slot="customerName"
             slot-scope="scope">
          <el-popover placement="top"
                      popper-class="base-popper"
                      trigger="hover"
                      :content="scope.scope.customerName">
            <span slot="reference">
              {{ scope.scope.customerName }}
            </span>
          </el-popover>
        </div>
      </GLTable>
    </div>
  </GLDialog>
</template>

<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
export default {
  name: 'TechnicianDetailDialog',
  data() {
    return {
      // 表格组件
      userInfo: {},
      tableSearchForm: {},
      url: url,
      getListApi: this.$apis.performanceManage.getDetailApi,
      // 表格参数
      tableParams: {
        listName: 'list',
        tableColumns: [
          {
            label: '订单编码',
            prop: 'orderCode',
            width: 180
          },
          {
            label: '订单类型',
            prop: 'upgradeFlag',
            width: 100,
            formatter: cellValue => {
              return this.baseData.upgradeFlagList.find((item) => item.confId === cellValue.upgradeFlag).confName || "-"
            }
          },
          {
            label: '支付时间',
            prop: 'orderTime',
            width: '180px',
            formatter: cellValue => {
              return cellValue.orderTime ? dayjs(cellValue.orderTime).format('YYYY-MM-DD HH:mm:ss') : '--'
            }
          },
          {
            label: '客户名称',
            prop: 'customerName',
            addHtml: 'customerName',
            minWidth: 120
          },
          {
            label: '客户手机号',
            prop: 'customerPhone',
            width: 130
          },
          {
            label: '订单产值',
            prop: 'orderMoney',
            width: 100,
            formatter: cellValue => {
              return cellValue.orderMoney || cellValue.orderMoney == 0 ? cellValue.orderMoney.toFixed(2) : '-'
            }
          },
          {
            label: '施工奖励',
            prop: 'constructionBonus',
            width: 100,
            formatter: cellValue => {
              return cellValue.constructionBonus || cellValue.constructionBonus == 0 ? cellValue.constructionBonus.toFixed(2) : '-'
            }
          }
        ],
      },
      pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
      // 基本数据
      baseData: {
        upgradeFlagList: [{
          confId: 'Y',
          confName: '升级'
        },
        {
          confId: 'N',
          confName: '战败'
        }]
      },
    }
  },

  props: {
    isVisible: {
      type: Boolean,
      default: false
    },
    searchForm: {
      type: Object,
      default: () => { }
    },
    recordInfo: {
      type: Object,
      default: () => { }
    }
  },

  methods: {
    beforeSearchFn() {
      return new Promise(resolve => {
        // this.tableSearchForm.staffUuid = this.recordInfo.staffUuid
        // this.tableSearchForm.performanceMonth = this.recordInfo.performanceMonth
        this.tableSearchForm.id = this.recordInfo.id
        resolve()
      })
    },
    handleClose() {
      this.$emit('handleClose')
    }
  }
}
</script>
<style scoped>
</style>