selectOtherMembrt.vue 4.68 KB
<template>
  <div class="">
    <div class="wrap">
      <div class="search-wrap">
        <glsxCombiForm ref="showSearch" labelWidth="105px" defaultWidth="215px" :formObj="batchListSearch" :formData="productFormData">
          <span slot="footer" class="footer-btns">
            <!-- <el-button :size="size" class="resetBtn" @click="handleReset">重置</el-button> -->
            <el-button type="primary" :size="size" @click="handleSearch">查询</el-button>
          </span>
        </glsxCombiForm>
      </div>
      <GLTable ref="productTable" :hasNum="false" :hasPage="false" :tableData="tableData" :searchForm="searchForm" :tableParams="batchTableParams" @row-click="rowClick">
        <div slot="radio" slot-scope="scope">
          <el-radio v-model="personal" :label="scope.scope">&nbsp;</el-radio>
        </div>
        <div slot="qrCode" slot-scope="scope">
          <el-popover placement="bottom" width="240" trigger="click">
            <img :src="scope.scope.qrCode" style="width: 200px; height: 200px" />
            <img :src="scope.scope.qrCode" style="width: 36px; height: 36px" slot="reference" />
          </el-popover>
        </div>
      </GLTable>
      <div class="member-checked">
        <span class="name">
          <img :src="tips" alt="" />
          <span style="color:#666;">选择一个渠道活码,将该员工设定为客户加微对象。</span>
        </span>
      </div>
    </div>
  </div>
</template>
<script type="text/ecmascript-6">
import util from '@/util/util'
import glsxCombiForm from '@/components/glsx-combi-form'
import { converterApi } from '@/api/modules/converter'
import tips from '@/assets/tips.png'
export default {
  name: 'writeOffList',
  components: {
    glsxCombiForm
  },
  model: {
    prop: 'personal',
    event: 'changePerson'
  },
  props:['personal'],
  data() {
    return {
      tips,
      size:'small',
      tableData: [],
      getListApi: this.$apis.expert.getOtherNumber,
      batchListSearch: {
        staffName: '',
        merchant:''
      },
      searchForm: {},
      productFormData: [
        {
          label: '所在门店/部门',
          name: 'merchant',
          type: 'select',
          optionList: [],
          optionId: 'merchantId',
          optionLabel: 'merchantName',
          isClear:true
        },
        {
          label: '姓名',
          name: 'staffName',
          type: 'input',
          isClear: true
        }
      ],
      batchTableParams: {
        listName: 'list',
        tableOption: false,
        tableColumns: [
          {
            label: '',
            prop: 'radio',
            addHtml: 'radio',
            width: '50'
          },
          {
            label: '渠道活码',
            prop: '',
            addHtml: 'qrCode'
          },
          {
            label: '渠道名称',
            prop: 'codeName'
          },
          {
            label: '员工姓名',
            prop: 'staffName'
          },
          {
            label: '所在部门',
            prop: 'departmentName'
          },
          {
            label: '所属企业微信',
            prop: 'entmicroName'
          }
        ]
      }
    }
  },
  created(){
  },
  mounted() {
      this.getPersonList()
      this.getTableData()
  },
  methods: {
    rowClick(row) {
      this.personal = row
      this.$emit('changePerson',this.personal)
    },
    getPersonList(){
        const params = {routerMethod:'dj.smartcarlife.api.partnerMerchant.listYqAndShop'}
        converterApi(params).then(res => {
          if(res){
            let target  = this.productFormData.find(item => item.name =='merchant')
            target.optionList = res
          }
        })
    },
    getParams() {
      let params = {...this.batchListSearch}
      return params
    },
    getTableData(){
        this.$apis.expert.getOtherNumber(this.getParams()).then(res=>{
            if(res){
                this.tableData = res
            }
        })
    },
    handleSearch() {
      this.getTableData()
    },
    handleReset(type) {
      this.batchListSearch = {
        packageCode: '',
        createTime: '',
        updatedTime:''
      }
      this.$refs.productTable.refreshTable()
    },
  }
}
</script>
<style lang="scss" scoped>
.wrap {
  margin-top: 20px;
  /deep/ .combi-form-label {
    white-space: nowrap;
  }
  /deep/ #merchant {
    margin-right: 0 !important;
  }
}
.member-checked {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-top: 12px;
  height: 20px;
  .name {
    display: flex;
    align-items: center;
    color: #5850ff;
  }
  img {
    width: 14px;
    height: 14px;
    margin-right: 8px;
  }
  /deep/ .el-checkbox__label {
    font-size: 14px;
    color: #333333;
  }
}
</style>