terminationLog.vue 3.19 KB
<template>
  <div class="report-components">
    <div class="title">终止记录</div>
    <div class="termination-log">
      <GLTable ref="mutiProRef" :hasPage="false" :tableData="terminationLogList" :tableParams="logTableParams">
        <div slot="projectDetails" slot-scope="scope">
          <div class="service_name">{{ `${scope.scope.serviceName}${scope.scope.serviceGrade}` }}</div>
          <div class="service_Info">{{ `服务年限${scope.scope.servicePeriod}年,有效期${scope.scope.startDate} 至 ${scope.scope.endDate}` }}</div>
        </div>
        <div slot="reason" slot-scope="scope" style="width: 240px;">
          <el-popover v-if="scope.scope.periodDetail.reason && scope.scope.periodDetail.reason.length >= Math.ceil((200 - 36) / 14) * 2" placement="top" popper-class="base-popper" trigger="hover" :content="scope.scope.periodDetail.reason">
            <span slot="reference" class="line-ellipsis">
              {{ scope.scope.periodDetail.reason }}
            </span>
          </el-popover>
          <span v-else class="line-ellipsis">
            {{ scope.scope.periodDetail.reason }}
          </span>
        </div>
      </GLTable>
    </div>
  </div>
</template>

<script>
import * as dayjs from 'dayjs'
export default {
  name: 'TerminationLog',
  props: {
    terminationLogList: Array
  },
  data() {
    return {
      logTableParams: {
        listName: 'list',
        tableColumns: [
          {
            label: '终止项目明细',
            prop: '',
            addHtml: 'projectDetails'
          },
          {
            label: '终止时间',
            prop: '',
            formatter: cellValue => {
              return `${cellValue.periodDetail.startDate} 至 ${cellValue.periodDetail.endDate}`
            }
          },
          {
            label: '终止原因',
            width: 260,
            addHtml: 'reason'
          },
          {
            label: '状态',
            prop: '',
            width: 80,
            formatter: cellValue => {
              return cellValue.periodDetail?.operationType == 0 ? '终止' : cellValue.periodDetail?.operationType == 1 ? '取消' : '-'
            }
          },
          {
            label: '操作人',
            prop: '',
            width: 150,
            formatter: cellValue => {
              return cellValue.periodDetail?.updatedBy
            }
          },
          {
            label: '操作时间',
            prop: '',
            formatter: cellValue => {
              return cellValue.periodDetail?.updatedDate ? dayjs(cellValue.periodDetail?.updatedDate).format('YYYY-MM-DD HH:mm:ss') : '--'
            }
          }
        ]
      },
    }
  },
  methods: {
    
  }
}
</script>
<style lang="scss" scoped>
.report-components {
  background: white;
  margin: 20px 0 0;
  .title {
    padding: 0 20px;
    font-size: 16px;
    font-weight: 500;
    height: 58px;
    line-height: 58px;
    border-bottom: 1px solid #d8d8d8;
    margin: 0 0;
    color: #333333;
  }
  .termination-log{
    margin: 20px;
    padding-bottom: 30px;
  }
  .line-ellipsis{
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 2 ;
  }
}
</style>