StaffApplyDialog.vue 5.89 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="merchantName"
             slot-scope="scope">
          <el-popover placement="top"
                      popper-class="base-popper"
                      trigger="hover"
                      :content="scope.scope.merchantName">
            <span slot="reference">
              {{ scope.scope.merchantName }}
            </span>
          </el-popover>
        </div>
        <div class="tb-ellipsis"
             slot="merchantAddress"
             slot-scope="scope">
          <el-popover placement="top"
                      popper-class="base-popper"
                      trigger="hover"
                      :content="scope.scope.merchantAddress">
            <span slot="reference">
              {{ scope.scope.merchantAddress }}
            </span>
          </el-popover>
        </div>
        <div slot="brand"
             slot-scope="scope">
          <el-popover placement="top"
                      popper-class="base-popper"
                      trigger="hover"
                      :content="scope.scope.merchantBrandNameList ? scope.scope.merchantBrandNameList.join('/') : '--'">
            <span slot="reference"
                  class="one-line-ellipsis">
              {{ scope.scope.merchantBrandNameList ? scope.scope.merchantBrandNameList.join('/') : '--' }}
            </span>
          </el-popover>
        </div>
        <div class="tb-ellipsis"
             slot="yqMerchantName"
             slot-scope="scope">
          <el-popover placement="top"
                      popper-class="base-popper"
                      trigger="hover"
                      :content="scope.scope.yqMerchantName">
            <span slot="reference">
              {{ scope.scope.yqMerchantName }}
            </span>
          </el-popover>
        </div>
        <div slot="applyStatus"
             slot-scope="scope"
             class="flex">
          <div :class="['dot', statusClass[scope.scope.reviewStatus]]"></div>
          {{ reviewStatusObj[scope.scope.reviewStatus] }}
        </div>
      </GLTable>
    </div>
  </GLDialog>
</template>

<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
export default {
  name: 'StaffApplyDialog',
  data() {
    return {
      // 表格组件
      userInfo: {},
      tableSearchForm: {},
      url: url,
      getListApi: this.$apis.staff.staffAuditPage,
      // 表格参数
      tableParams: {
        listName: 'list',
        tableColumns: [
          {
            label: '服务中心名称',
            prop: 'serviceMerchantName',
            minWidth: 200
          },
          {
            label: '员工姓名',
            prop: 'staffName',
            width: 150,
            line: 1
          },
          {
            label: '员工手机号',
            prop: 'staffPhone',
            width: 130
          },
          {
            label: '新员工姓名',
            prop: 'staffNameNew',
            width: 150,
            line: 1
          },
          {
            label: '新员工手机号',
            prop: 'staffPhoneNew',
            width: 130
          },
          {
            label: '类型',
            prop: 'auditType',
            formatter: (cellValue) => {
              return this.baseData.auditTypeList.find(item => item.confId === cellValue.auditType)?.confValue
            }
          },
          {
            label: '申请时间',
            prop: 'applyTime',
            width: '180px',
            formatter: cellValue => {
              return cellValue.applyTime ? dayjs(cellValue.applyTime).format('YYYY/MM/DD HH:mm:ss') : '--'
            }
          },
          {
            label: '申请状态',
            prop: 'auditStatus',
            width: '100px',
            formatter: (cellValue) => {
              return this.baseData.auditStatusList.find(item => item.confId === cellValue.auditStatus)?.confValue
            }
          },
          {
            label: '说明',
            prop: 'auditRemark',
            width: 200,
            line: 1
          }
        ]
      },
      pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
      statusClass: {
        1: '',
        2: 'green',
        3: 'red'
      },
      reviewStatusObj: {
        1: '审核中',
        2: '已通过',
        3: '已驳回'
      },
      baseData: {
        auditStatusList: [
          { confId: 0, confValue: "待审核" },
          { confId: 1, confValue: "已审核" },
          { confId: 2, confValue: "已驳回" }
        ],
        auditTypeList: [
          { confId: 0, confValue: "变更" },
          { confId: 1, confValue: "新增" },
          { confId: 2, confValue: "删除" }
        ],
      },
    }
  },

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

  methods: {
    beforeSearchFn() {
      return new Promise(resolve => {
        resolve()
      })
    },
    handleClose() {
      this.$emit('handleClose')
    }
  }
}
</script>
<style scoped>
.flex {
  display: flex;
  align-items: center;
}
.dot {
  width: 6px;
  height: 6px;
  background: #5850ff;
  border-radius: 4px;
  margin-right: 6px;
}
.green {
  background: #4aca74;
}
.red {
  background: #eb4e4e;
}
</style>