<!--
  @description: 抽取申请-添加采购方代表-弹框
  @author: qrf
  @routerPath:
  @date: 2020-10-30 13:35:58
-->
<template>
  <el-dialog :visible.sync="dialogData.dialog" title="添加采购方代表">
    <el-form ref="purchaseSearchs" :model="purchaseSearchs" inline>
      <el-form-item label="姓名">
        <el-input v-model="purchaseSearchs.name" />
      </el-form-item>
      <el-form-item label="身份证号">
        <el-input v-model="purchaseSearchs.idCard" />
      </el-form-item>
      <div class="fr">
        <el-button
          type="primary"
          @click="getPurchaseList"
        >
          搜索
        </el-button>
        <el-button
          plain
          type="info"
          @click="resetPc"
        >
          重置
        </el-button>
      </div>
    </el-form>
    <!--录入采购方代表弹框表格-->
    <el-table :data="purchaserListData" @selection-change="handleSelectionChangePurchaser">
      <el-table-column type="selection" />
      <el-table-column label="序号" type="index" />
      <el-table-column label="姓名" prop="name" />
      <el-table-column label="身份证号" prop="idCard" />
      <el-table-column label="手机号" prop="mobilePhone" />
      <el-table-column label="性别" prop="sex">
        <template slot-scope="scope">
          <span
            v-if="scope.row.sex==='00'"
            type="primary"
          >
            男
          </span>
          <span
            v-if="scope.row.sex==='01'"
            type="primary"
          >
            女
          </span>
        </template>
      </el-table-column>
    </el-table>

    <el-row class="pagination p16">
      <div
        class="page-number fl"
      >
        共{{ Math.ceil(purchaseTotal/purchaseSearchs.pageSize) }}页 {{ purchaseTotal }}条
      </div>
      <el-pagination
        :current-page="purchaseSearchs.page"
        :page-size="purchaseSearchs.pageSize"
        :total="purchaseTotal"
        layout="prev, pager, next, sizes"
        class="fr"
        background
        @current-change="pickHandlePc"
        @size-change="handleSizeProjectChangePc"
      />
    </el-row>
    <div slot="footer" class="dialog-footer" style="text-align: center">
      <el-button type="primary" @click="ensure">
        确 定
      </el-button>
      <el-button @click="dialogData.dialog=false">
        取 消
      </el-button>
    </div>
  </el-dialog>
</template>
<script>
export default {
  name: 'BuyerRepresentativeAddDialog',
  props: {
    // 弹框展示状态
    dialogData: {
      type: Object,
      default: function() {
        return {
          dialog: false
        }
      }
    }
  },
  watch: {
    // 弹框打开状态
    'dialogData.dialog'(val) {
    }
  }
}
</script>
