ApplyStoreDialog.vue 4.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="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: 'ApplyStoreDialog',
  data() {
    return {
      // 表格组件
      userInfo: {},
      tableSearchForm: {},
      url: url,
      getListApi: this.$apis.customer.getReviewList,
      // 表格参数
      tableParams: {
        listName: 'list',
        tableColumns: [
          {
            label: '客户名称',
            prop: 'merchantName',
            addHtml: 'merchantName',
            minWidth: 120
          },
          {
            label: '联系人',
            prop: 'contactName',
            width: 120,
            line: 1
          },
          {
            label: '联系电话',
            prop: 'phone',
            width: 130
          },
          {
            label: '地址',
            prop: 'merchantAddress',
            addHtml: 'merchantAddress',
            minWidth: 120
          },
          {
            label: '主营品牌',
            prop: '',
            width: 140,
            line: 1,
            addHtml: 'brand'
          },
          {
            label: '所属服务中心',
            prop: 'yqMerchantName',
            addHtml: 'yqMerchantName',
            minWidth: 120
          },
          {
            label: '申请时间',
            prop: 'createdDate',
            width: '180px',
            formatter: cellValue => {
              return cellValue.createdDate ? dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss') : '--'
            }
          },
          {
            label: '申请状态',
            prop: 'reviewStatus',
            width: '100px',
            addHtml: 'applyStatus'
          },
          {
            label: '说明',
            prop: 'rejectedReason',
            width: 100,
            line: 1
          }
        ]
      },
      pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
      statusClass: {
        1: '',
        2: 'green',
        3: 'red'
      },
      reviewStatusObj: {
        1: '审核中',
        2: '已通过',
        3: '已驳回'
      }
    }
  },

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

  methods: {
    beforeSearchFn() {
      return new Promise(resolve => {
        this.tableSearchForm.merchantType = 2
        this.tableSearchForm.partnerMerchantId = this.$globalState.session.merchantId
        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>