ViewDialogTable.vue 5.8 KB
<template>
  <GlDialog mode='big' :bigTitle="'true'" :visible.sync='showFuncIntro' :hasFooter='false'>
    <span v-if='selectedData' slot='custombigtitle'>{{ selectedData.merchantName }}-{{ selectedData.activityName
      }}-{{ detailTitle }}</span>
    <div class='dialogEncircle '>
      <glsx-table
        :headerStyle="{ color: '#EB6001',background:'#262525', borderColor: 'black' }"
        ref='renewalListRef'
        :getListApi='getListApi'
        :tableParams='tableParams'
        :searchForm='renewalSearchForm'
        :pageConf='pageConf'>
        <template slot='wechatName' slot-scope='scope'>
          <div class='wechatWrap'>
            <img v-if='scope.scope.wechatimg' class='wechatimg' :src='scope.scope.wechatimg'>
            {{ scope.scope.wechatName }}
          </div>
        </template>

        <template slot='phoneNum' slot-scope='scope'>
          {{ scope.scope.phoneNum == 'null' || !scope.scope.phoneNum ? '-' : scope.scope.phoneNum }}
        </template>

        <template slot='shareName' slot-scope='scope'>
          <div class='wechatWrap'>
            <img v-if="scope.scope.shareimg !== 'null' && scope.scope.shareimg" class='wechatimg'
                 :src='scope.scope.shareimg'>
            {{ scope.scope.shareName == 'null' || !scope.scope.shareName ? '-' : scope.scope.shareName }}
          </div>
        </template>

        <!--        转发明细员工-->
        <template slot='staff' slot-scope='scope'>
          <div class='wechatWrap'>
            <img v-if='scope.scope.wechatimg' class='wechatimg' :src='scope.scope.wechatimg'>
            {{ !scope.scope.staff ? '-' : scope.scope.staff }}
          </div>
        </template>

        <!--        转发明细核销激励-->
        <template slot='writeoffIncentive' slot-scope='scope'>
          {{ scope.scope.writeoffIncentive == 'null' ? '-' : scope.scope.writeoffIncentive }}
        </template>

        <!--        转化率-->
        <template slot='conversionRate' slot-scope='scope'>
          {{ scope.scope.writeoffIncentive == 'null' ? '-' : scope.scope.writeoffIncentive }}
        </template>

        <template slot='userName' slot-scope='scope'>
          {{ scope.scope.userName == 'null' ? '-' : scope.scope.userName }}
        </template>

        <template slot='licensePlate' slot-scope='scope'>
          {{ scope.scope.licensePlate == 'null' ? '-' : scope.scope.licensePlate }}
        </template>


        <template slot='customerName' slot-scope='scope'>
          {{ scope.scope.customerName == 'null' || !scope.scope.customerName ? '-' : scope.scope.customerName }}
        </template>

        <template slot='other' slot-scope='scope'>
          {{ scope.scope.other == 'null' || !scope.scope.other ? '-' : scope.scope.other }}
        </template>

        <template slot='reference' slot-scope='scope'>
          {{ scope.scope.reference == 'null' || !scope.scope.reference ? '-' : scope.scope.reference }}
          <span v-if='scope.scope.referencetype && scope.scope.reference'
                class='referencetype'>@{{ !scope.scope.referencetype || scope.scope.referencetype == 'null' ? '-' : scope.scope.referencetype
            }}</span>
        </template>


        <template slot='lastFollowup' slot-scope='scope'>
          <el-switch
            v-model="scope.scope.lastFollowup == '是'"
            active-color='#EB6001'
            inactive-color='#E8E8EA'>
          </el-switch>
        </template>

      </glsx-table>
    </div>
  </GlDialog>
</template>

<script>
import { tableDetailMixin } from '@/mixins'

export default {
  name: 'ViewDialogTable',
  mixins: [tableDetailMixin],
  props: {
    // showFuncIntro: {
    //   type: Boolean,
    //   default: false
    // },
    selectedData: {
      type: Object,
      default: {}
    }
  },
  data() {
    return {
      showFuncIntro: false,
      getListApi: this.api.renewal.getDetail,
      pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'totalNum' },
      tableParams: null,
      renewalSearchForm: {
        queryItem: '',
        // pagenum: '1',
        merchantId: '',
        activityName: ''
      },
      detailTitle: ''
    }
  },
  methods: {
    switchSelectedType(type) {
      switch (type) {
        case 'viewActivity':
          this.tableParams = this.accessDetailTable
          this.renewalSearchForm.queryItem = 'view'
          return '访问明细'
        case 'forwardActivity':
          this.tableParams = this.forwardingDetailTable
          this.renewalSearchForm.queryItem = 'forward'
          return '转发明细'
        case 'clueActivity':
          this.tableParams = this.lineDetailTable
          this.renewalSearchForm.queryItem = 'clue'
          return '线索明细'
        case 'activationActivity':
          this.tableParams = this.activationDetailTable
          this.renewalSearchForm.queryItem = 'activation'
          return '激活明细'
      }
    }
  },
  watch: {
    selectedData: {
      handler(newValue, oldValue) {
        console.log(newValue)
        this.detailTitle = newValue && this.switchSelectedType(newValue.type)
        this.renewalSearchForm.activityName = newValue.activityName
        // '活动1'
        this.renewalSearchForm.merchantId = newValue.merchantId
        // '4419194XX'
        this.renewalSearchForm.startDate = newValue.params.startDate
        this.renewalSearchForm.endDate = newValue.params.endDate
        setTimeout(() => {
          this.$refs.renewalListRef?.refreshTable()
          this.showFuncIntro = true
        }, 500)
      },
      deep: true,
      immediate: false
    }
  }
}
</script>

<style lang='scss' scoped>
.wechatWrap {
  display: flex;
  align-items: center;

  .wechatimg {
    width: 32px;
    height: 32px;
    margin-right: 5px;
  }
}

.referencetype {
  color: rgb(235, 96, 1);
}

/deep/ .el-table {
  background-color: rgba(38, 38, 38, 0.75);
}

</style>