<template>
  <div class="app-container">
    <div style="margin-bottom:10px">
      <el-button type="success" @click="addBtn">新增</el-button>
      <el-button type="success" @click="importBtn">导入</el-button>
      <el-button type="success" @click="exportTempBtn">模版下载</el-button>
    </div>
    <!--搜索-->
    <el-form class="mt_15" ref="form" inline size="small">
      <el-form-item label="买家账号">
        <el-input v-model.trim="searchParm.buyerName" clearable placeholder="账号"></el-input>
      </el-form-item>
      <el-form-item label="订单号">
        <el-input v-model.trim="searchParm.orderId" clearable></el-input>
      </el-form-item>
      <el-form-item label="状态">
        <el-select v-model.trim="searchParm.status" placeholder="请选择">
          <el-option
            v-for="item in statusList"
            :key="item.name"
            :label="item.name"
            :value="item.id"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="goSearch">搜索</el-button>
        <el-button type="warning" @click="resetForm">重置</el-button>
      </el-form-item>
    </el-form>
    <!--表格渲染-->
    <el-table
      ref="table"
      border
      size="small"
      :data="list"
      :header-cell-style="{textAlign:'center'}"
    >
      <el-table-column label="序号" type="index" width="50" align="center" />
      <el-table-column label="买家账号" prop="buyerName" align="center" />
      <el-table-column label="订单ID" prop="orderId" align="center" />
      <el-table-column label="状态" prop="status" align="center">
        <template slot-scope="scope">{{ scope.row.status | getStatus}}</template>
      </el-table-column>
      <el-table-column label="创建时间" prop="createdAt" align="center" />
      <el-table-column label="修改时间" prop="updatedAt" align="center" />
      <el-table-column label="操作" width="270" align="left">
        <template slot-scope="scope">
          <el-button type="info" @click="getBtnById(scope.row.id)">查看</el-button>
          <el-button type="danger" @click="delById(scope.row.id)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <!--分页-->
    <div class="mt_15">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="searchParm.page"
        :page-sizes="[10, 20, 30, 40, 50]"
        :page-size="searchParm.pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total"
      ></el-pagination>
    </div>

    <!--新增弹窗-->
    <el-dialog :visible.sync="dialogAddVisible" :title="dialogAddTitle" center width="45%">
      <div class="dialog-content">
        <el-form ref="addParm" size="small" :model="addParm" :rules="rules" label-width="100px">
        	
          <el-form-item label="买家账号" prop="buyerName">
            <el-input v-model.trim="addParm.buyerName" disabled="true" clearable style="width:270px"></el-input>
            <el-button
              type="primary"
              icon="el-icon-search"
              @click="goSearchBuyer"
              style="width:130px"
            >请选择买家</el-button>
          </el-form-item>
          <el-form-item label="订单ID" prop="buyerId" hiddle>
            <el-input v-model.trim="addParm.buyerId" clearable></el-input>
          </el-form-item>
        </el-form>
      </div>
      <span slot="footer">
        <el-button type="info" @click="sureAddCancle('addParm')">取消</el-button>
        <el-button type="primary" @click="sureAdd('addParm')">确认</el-button>
      </span>
    </el-dialog>
    <!--导入  importBtn-->
    <el-dialog :visible.sync="dialogImportVisible" :title="dialogImportTitle" center width="22%">
      <div class="dialog-content">
        <el-upload
          class="upload-demo"
          drag
          ref="upload"
          :action="uploadFileUrl"
          :headers="uploadHeaders"
          :show-file-list="false"
          :on-success="uploadSuccess"
          :before-upload="beforeAvatarUpload"
          multiple
        >
          <i class="el-icon-upload"></i>
          <div class="el-upload__text">
            将文件拖到此处，或
            <em>点击上传</em>
          </div>
          <div class="el-upload__tip" slot="tip">只能上传xlsl文件，且不超过10M</div>
        </el-upload>
      </div>
    </el-dialog>

    <!--详情弹窗-->
    <el-dialog :visible.sync="dialogDetailVisible" :title="dialogDetailTitle" center width="45%">
      <div class="dialog-content">
        <el-form ref="form" size="small" label-width="100px">
          <el-form-item label="买家账号" prop="buyerName">
            <el-input v-model.trim="detailParm.buyerName" :disabled="true"></el-input>
          </el-form-item>
          <el-form-item label="订单ID" prop="orderId">
            <el-input v-model.trim="detailParm.orderId" :disabled="true"></el-input>
          </el-form-item>
          <el-form-item label="状态" disabled prop="status">
            <el-select v-model.trim="detailParm.status" disabled placeholder="请选择">
              <el-option
                v-for="item in addStatusList"
                :key="item.name"
                :label="item.name"
                :value="item.id"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-form>
      </div>
    </el-dialog>

    <!-- 买家弹窗 -->
    <el-dialog :visible.sync="dialogBuyerVisible" :title="dialogBuyerTitle" center width="75%">
      <div class="dialog-content">
        <!--搜索-->
        <el-form class="mt_15" ref="form" inline size="small">
          <el-form-item label="账号">
            <el-input v-model.trim="searchBuyerParm.account" clearable placeholder="账号"></el-input>
          </el-form-item>
          <el-form-item label="昵称">
            <el-input v-model.trim="searchBuyerParm.nickName" clearable></el-input>
          </el-form-item>
          <el-form-item label="密码">
            <el-input v-model.trim="searchBuyerParm.pwd" clearable></el-input>
          </el-form-item>
          <el-form-item label="公司">
            <el-select v-model.trim="searchBuyerParm.companyId" placeholder="请选择">
              <el-option
                v-for="item in companys"
                :key="item.name"
                :label="item.name"
                :value="item.id"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="平台">
            <el-select v-model.trim="searchBuyerParm.platformId" placeholder="请选择">
              <el-option
                v-for="item in platformList"
                :key="item.id"
                :label="item.name"
                :value="item.id"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" @click="goSearchBuyer">搜索</el-button>
            <el-button type="warning" @click="resetBuyerForm">重置</el-button>
          </el-form-item>
        </el-form>
        <!--表格渲染-->
        <el-table
          ref="table"
          border
          size="small"
          :data="buyerList"
          :header-cell-style="{textAlign:'center'}"
          :cell-style="{textAlign:'center'}"
        >
          <el-table-column label="序号" type="index" width="50" />
          <el-table-column label="账号" prop="account" />
          <el-table-column label="昵称" prop="nickName" />
          <el-table-column label="密码" prop="pwd" />
          <el-table-column label="公司" prop="companyName" />
          <el-table-column label="平台" prop="platformName" />
          <el-table-column label="VPNIP" prop="ipAddress" />
          <el-table-column label="信用卡卡号" prop="number" />
          <el-table-column label="州" prop="state" />
          <el-table-column label="国家" prop="country" />
          <el-table-column label="地址1" prop="addressline1" />
          <el-table-column label="状态" prop="status">
            <template slot-scope="scope">{{ scope.row.status | getStatus}}</template>
          </el-table-column>
          <el-table-column label="创建时间" prop="createdAt" />
          <el-table-column label="修改时间" prop="updatedAt" />
          <el-table-column label="操作" width="220">
            <template slot-scope="scope">
              <el-button type="info" @click="getBuyerBtnById(scope.row.id)">查看</el-button>
			  <el-button type="success" @click="getBuyerById(scope.row)">选中</el-button>
            </template>
          </el-table-column>
        </el-table>
        <!--分页-->
        <div class="mt_15">
          <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="searchBuyerParm.page"
            :page-sizes="[10, 20, 30, 40, 50]"
            :page-size="searchBuyerParm.pageSize"
            layout="total, sizes, prev, pager, next, jumper"
            :total="searchTotal"
          ></el-pagination>
        </div>
      </div>
    </el-dialog>

	<!--详情弹窗-->
    <el-dialog :visible.sync="dialogBuyerDetailVisible" :title="dialogBuyerDetailTitle" center width="45%">
      <div class="dialog-content">
        <el-form ref="form" size="small" label-width="120px">
          <el-form-item label="账号" prop="account">
            <el-input v-model.trim="detailBuyerParm.account" :disabled="true"></el-input>
          </el-form-item>
          <el-form-item label="昵称" prop="nickName">
            <el-input v-model.trim="detailBuyerParm.nickName" :disabled="true"></el-input>
          </el-form-item>
          <el-form-item label="密码" prop="pwd">
            <el-input v-model.trim="detailBuyerParm.pwd" :disabled="true"></el-input>
          </el-form-item>
          <el-form-item label="公司" prop="companyId">
            <el-select v-model.trim="detailBuyerParm.companyId" disabled placeholder="请选择">
              <el-option
                v-for="item in companys"
                :key="item.name"
                :label="item.name"
                :value="item.id"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="平台" prop="platformId">
            <el-select v-model.trim="detailBuyerParm.platformId" disabled placeholder="请选择">
              <el-option
                v-for="item in platformList"
                :key="item.name"
                :label="item.name"
                :value="item.id"
              ></el-option>
            </el-select>
          </el-form-item>

          <!--国家-->
          <el-form-item label="国家" prop="contntryShort">
            <el-input v-model.trim="detailBuyerParm.contntryShort" disabled clearable></el-input>
          </el-form-item>
          <!--VPN vpnId -->
          <el-form-item label="VPNIP" prop="vpnIp">
            <el-input v-model.trim="detailBuyerParm.vpnIp" disabled clearable></el-input>
          </el-form-item>
          <!--信用卡ID  cardId -->
          <el-form-item label="信用卡卡号" prop="cardNumber">
            <el-input v-model.trim="detailBuyerParm.cardNumber" disabled clearable></el-input>
          </el-form-item>
          <!--用户等级    level -->
          <el-form-item label="用户等级" prop="level">
            <el-select v-model.trim="detailBuyerParm.level" disabled placeholder="请选择">
              <el-option
                v-for="item in levelList"
                :key="item.name"
                :label="item.name"
                :value="item.id"
              ></el-option>
            </el-select>
          </el-form-item>
          <!--占用状态 occupyStatus -->
          <el-form-item label="占用状态" prop="occupyStatus">
            <el-select v-model.trim="detailBuyerParm.occupyStatus" disabled placeholder="请选择">
              <el-option
                v-for="item in occupyStatusList"
                :key="item.name"
                :label="item.name"
                :value="item.id"
              ></el-option>
            </el-select>
          </el-form-item>
          <!--状态 status -->
          <el-form-item label="状态" prop="status">
            <el-select v-model.trim="detailBuyerParm.status" disabled placeholder="请选择">
              <el-option
                v-for="item in statusList"
                :key="item.name"
                :label="item.name"
                :value="item.id"
              ></el-option>
            </el-select>
          </el-form-item>
          <!--占用账户-->
          <el-form-item label="占用账户" prop="occupyAccount">
            <el-input v-model.trim="detailBuyerParm.occupyAccount" :disabled="true" clearable></el-input>
          </el-form-item>
          <!--账户余额-->
          <el-form-item label="账户余额" prop="balance">
            <el-input v-model.trim="detailBuyerParm.balance" :disabled="true" clearable></el-input>
          </el-form-item>
          <!--购买总金额-->
          <el-form-item label="账户购买总金额" prop="buyTotalMoney">
            <el-input v-model.trim="detailBuyerParm.buyTotalMoney" :disabled="true" clearable></el-input>
          </el-form-item>
          <!--地址1-->
          <el-form-item label="地址1" prop="addressline1">
            <el-input v-model.trim="detailBuyerParm.addressline1" :disabled="true" clearable></el-input>
          </el-form-item>
          <!--国家-->
          <el-form-item label="国家" prop="country">
            <el-input v-model.trim="detailBuyerParm.country" :disabled="true" clearable></el-input>
          </el-form-item>
          <!--州-->
          <el-form-item label="州" prop="state">
            <el-input v-model.trim="detailBuyerParm.state" :disabled="true" clearable></el-input>
          </el-form-item>
          <!--电话-->
          <el-form-item label="电话" prop="tel">
            <el-input v-model.trim="detailBuyerParm.tel" :disabled="true" clearable></el-input>
          </el-form-item>
          <!--lastname-->
          <el-form-item label="lastname" prop="lastname">
            <el-input v-model.trim="detailBuyerParm.lastname" :disabled="true" clearable></el-input>
          </el-form-item>
          <!--税号-->
          <el-form-item label="税号" prop="vatNumber">
            <el-input v-model.trim="detailBuyerParm.vatNumber" :disabled="true" clearable></el-input>
          </el-form-item>
          <!--城市-->
          <el-form-item label="城市" prop="city">
            <el-input v-model.trim="detailBuyerParm.city" :disabled="true" clearable></el-input>
          </el-form-item>
          <!--地址2-->
          <el-form-item label="地址2" prop="addressline2">
            <el-input v-model.trim="detailBuyerParm.addressline2" :disabled="true" clearable></el-input>
          </el-form-item>
          <!--firstname-->
          <el-form-item label="firstname" prop="firstname">
            <el-input v-model.trim="detailBuyerParm.firstname" :disabled="true" clearable></el-input>
          </el-form-item>
          <!--邮政编码-->
          <el-form-item label="邮政编码" prop="postalcode">
            <el-input v-model.trim="detailBuyerParm.postalcode" :disabled="true" clearable></el-input>
          </el-form-item>
        </el-form>
      </div>
    </el-dialog>

  </div>
</template>
<script>
import {
  add,
  editById,
  delById,
  abMormal,
  getList,
  getBuyerList,
  getById,
  getBuyerById,
  downLoadFile
} from "@/api/group/dhPay";
import { getAll } from "@/api/group/company";
export default {
  filters: {
    getStatus: function(value) {
      if (value == 0) {
        return "待支付";
      } else if (value == 1) {
        return "支付成功";
      } else if (value == 2) {
        return "支付失败";
      } else {
        return "删除";
      }
    }
  },
  //	数据
  data() {
    return {
      platformList: [
        {
          id: 1,
          name: "敦煌"
        }
      ],
      searchParm: {
        page: 1,
        pageSize: 10,
        sort: "created_at",
        order: "desc",
        cardDealer: "",
        type: "",
        status: "",
        holderName: null,
        number: null,
        pinNumber: null
      },
      searchBuyerParm: {
        page: 1,
        pageSize: 10,
        account: null,
        sort: "created_at",
        order: "desc",
        nickName: null,
        pwd: null,
        companyId: null,
        platformId: null
      },
      total: 0,
      searchTotal: 0,
      list: [],
      buyerList: [],
      companys: [],
      uploadHeaders:{ Authorization: this.$store.getters.token },
      dialogAddVisible: false,
      dialogAddTitle: "新增",
      dialogDetailVisible: false,
      dialogDetailTitle: "详情",
      dialogEditVisible: false,
      dialogEditTitle: "修改",
      dialogImportVisible: false,
      dialogImportTitle: "导入",
      dialogBuyerVisible: false,
      dialogBuyerTitle: "买家列表",
	  dialogBuyerDetailVisible: false,
	  dialogBuyerDetailTitle: "买家详情",
      uploadFileUrl: process.env.VUE_APP_BASE_API + "/api/dhPay/import",
      updateBoolean: false,
      tempUrl: process.env.VUE_APP_BASE_API + "/api/dhPay/exportTemp",
      addStatusList: [
        {
          id: 0,
          name: "待处理"
        },
        {
          id: 1,
          name: "支付成功"
        },
        {
          id: 2,
          name: "支付失败"
        },
        {
          id: 3,
          name: "删除"
        }
      ],
      statusList: [
        {
          id: null,
          name: "全部"
        },
        {
          id: 0,
          name: "待处理"
        },
        {
          id: 1,
          name: "支付成功"
        },
        {
          id: 2,
          name: "支付失败"
        },
        {
          id: 3,
          name: "删除"
        }
      ],
	  statusList: [
        {
          id: 1,
          name: "待注册"
        },
        {
          id: 2,
          name: "待验证"
        },
        {
          id: 3,
          name: "待完善"
        },
        {
          id: 4,
          name: "正常"
        },
        {
          id: 5,
          name: "异常"
        },
        {
          id: 6,
          name: "可用但已用"
        },
        {
          id: 7,
          name: "删除"
        }
      ],
      occupyStatusList: [
        {
          id: 1,
          name: "已占用"
        },
        {
          id: 2,
          name: "未占用"
        }
      ],
      levelList: [
        {
          id: 1,
          name: "普通"
        },
        {
          id: 2,
          name: "精品"
        },
        {
          id: 3,
          name: "压力"
        },
        {
          id: 4,
          name: "内部账号"
        }
      ],
      addParm: {
        id: null,
        number: "",
        pinNumber: "",
        holderSurname: "",
        holderName: "",
        contntryShort: "",
        remarks: "",
        type: null,
        cardDealer: null
      },
      detailParm: {
        id: null,
        buyerName: "",
        orderId: "",
        status: null
      },
	  detailBuyerParm: {
      	id: null,
      	nickName:'',
    		pwd:'',
    		account: '',
    		companyId:null,
    		platformId:null,
    		contntryShort:'',
    		vpnId:null,
			vpnIp:'',
  			cardId:null,
			cardNumber:'',
  			level:null,
  			occupyStatus:null,
  			addressline1:'',
  			country:'',
  			state:'',
  			tel:'',
  			lastname:'',
  			vatNumber:'',
  			city:'',
  			addressline2:'',
  			firstname:'',
  			postalcode:'',
  			status:null
      },
      rules: {
        buyerName: [
          { required: true, message: "请输入买家账号", trigger: "blur" }
        ],
        orderId: [
          { required: true, message: "请输入支付订单ID", trigger: "blur" }
        ]
      }
    };
  },
  // 调用
  created() {
    this.goSearch();
    this.getCompanyAll();
  },
  //方法
  methods: {
    //重置
    resetForm() {
      this.searchParm.orderId = "";
      this.searchParm.buyerName = "";
      this.searchParm.status = "";
      this.goSearch();
    },
    resetBuyerForm() {
      this.searchBuyerParm.account = null;
      this.searchBuyerParm.pwd = null;
      this.searchBuyerParm.nickName = null;
      this.searchBuyerParm.companyId = null;
      this.searchBuyerParm.platformId = null;
      this.goSearchBuyer();
    },
    //查询
    goSearch() {
      this.searchParm.page = 1;
      this.getDataList();
    },
    goSearchBuyer() {
      this.dialogBuyerVisible = true;
      this.searchBuyerParm.page = 1;
      this.getBuyerDataList();
    },
    beforeAvatarUpload(file) {
      console.log(file);
      //  const isXlsl = file.type === 'xlsl';
      const isLt10M = file.size / 1024 / 1024 < 10;
      //  if (!isXlsl) {
      //    this.$message.error('上传头像图片只能是 xlsl 格式!');
      //  }
      if (!isLt10M) {
        this.$message.error("上传头像图片大小不能超过 10MB!");
      }
      //  return isXlsl && isLt10M;
      return isLt10M;
    },
    //导入成功
    uploadSuccess(res, file) {
      this.dialogImportVisible = false;
      console.log(res)
      if (res.code == 200) {  
        if(res.data == null){
            console.log(res.data);
            this.$message.success("导入成功!");
        }else{
          this.$message.error("导入失败")
          console.log(res.message);
          //window.location.href = res.message;
        }
      }
      this.getDataList();
    },
    // 新增
    addBtn() {
      this.addParm = {
        id: null,
        orderId: "",
        buyerName: ""
      };
      this.dialogAddVisible = true;
      this.$refs.addParm.clearValidate();
    },
    // 导入
    importBtn() {
      this.dialogImportVisible = true;
    },
    exportTempBtn() {
      console.log(this.tempUrl);
      window.location.href = this.tempUrl;
    },
    //	根据id删除
    delById(id) {
      this.$confirm("确认删除?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          delById({ id })
            .then(res => {
              if (res.code == 200) {
                this.$message.success("删除成功!");
                this.getDataList();
              }
            })
            .catch(err => {
              console.log(err);
            });
        })
        .catch(() => {
          this.$message.info("取消删除");
        });
    },
    // 确认新增
    sureAdd(addParm) {
    	this.$refs[addParm].validate((valid) => {
		  if (valid) {
			  	this.$refs.addParm.clearValidate();
					add(this.addParm)
	        .then(res => {
	          if (res.code == 200) {
	            this.dialogAddVisible = false;
	            this.$message.success("新增成功!");
	            this.getDataList();
	          }
	        }).catch(err => {
	          console.log(err);
	        })
			  } else {
					console.log('error submit!!');
					return false;
			  }
			});
    },
    sureAddCancle(addParm) {
			this.dialogAddVisible=false
			this.$refs.addParm.clearValidate();
    },
    // 查看根据id
    getBtnById(id) {
      getById({ id })
        .then(res => {
          if (res.code == 200) {
            this.detailParm.id = res.data.id;
            this.detailParm.orderId = res.data.orderId;
            this.detailParm.buyerName = res.data.buyerName;
            this.detailParm.number = res.data.number;
            this.detailParm.pinNumber = res.data.pinNumber;
            this.detailParm.type = res.data.type;
            this.detailParm.contntryShort = res.data.contntryShort;
            this.detailParm.status = res.data.status;
            this.detailParm.cardDealer = res.data.cardDealer;
            this.dialogDetailVisible = true;
            this.$refs.ruleForm.clearValidate();
          }
        })
        .catch(err => {
          console.log(err);
        });
    },
    // 查看买家信息根据id
    getBuyerBtnById(id) {
      getBuyerById({ id })
        .then(res => {
          if (res.code == 200) {
            this.detailBuyerParm.id = res.data.id;
            this.detailBuyerParm.nickName = res.data.nickName;
            this.detailBuyerParm.pwd = res.data.pwd;
            this.detailBuyerParm.account = res.data.account;
            this.detailBuyerParm.companyId = res.data.companyId;
            this.detailBuyerParm.platformId = res.data.platformId;
            this.detailBuyerParm.contntryShort = res.data.contntryShort;
            this.detailBuyerParm.vpnId = res.data.vpnId;
            this.detailBuyerParm.vpnIp = res.data.ipAddress;
            this.detailBuyerParm.cardNumber = res.data.number;
            this.detailBuyerParm.cardId = res.data.cardId;
            this.detailBuyerParm.level = res.data.level;
            this.detailBuyerParm.occupyStatus = res.data.occupyStatus;
            this.detailBuyerParm.occupyAccount = res.data.occupyAccount;
            this.detailBuyerParm.balance = res.data.balance;
            this.detailBuyerParm.buyTotalMoney = res.data.buyTotalMoney;
            this.detailBuyerParm.addressline1 = res.data.addressline1;
            this.detailBuyerParm.country = res.data.country;
            this.detailBuyerParm.state = res.data.state;
            this.detailBuyerParm.tel = res.data.tel;
            this.detailBuyerParm.lastname = res.data.lastname;
            this.detailBuyerParm.vatNumber = res.data.vatNumber;
            this.detailBuyerParm.city = res.data.city;
            this.detailBuyerParm.addressline2 = res.data.addressline2;
            this.detailBuyerParm.firstname = res.data.firstname;
            this.detailBuyerParm.postalcode = res.data.postalcode;
            this.detailBuyerParm.status = res.data.status;

            this.dialogBuyerDetailVisible = true;
            this.$refs.ruleForm.clearValidate();
          }
        })
        .catch(err => {
          console.log(err);
        });
    },
    // 分页获取表格数据
    getDataList() {
      getList(this.searchParm)
        .then(res => {
          if (res.code == 200) {
            this.list = res.data.list;
            this.total = res.data.total;
          }
        })
        .catch(err => {
          console.log(err);
        });
    },
    getBuyerDataList() {
      getBuyerList(this.searchBuyerParm)
        .then(res => {
          console.log(res);
          if (res.code == 200) {
            this.buyerList = res.data.list;
            this.buyerTotal = res.data.total;
          }
        })
        .catch(err => {
          console.log(err);
        });
    },
    getCompanyAll() {
      getAll()
        .then(res => {
          if (res.code == 200) {
            this.companys = res.data;
            console.log(this.companys);
          }
        })
        .catch(() => {});
    },
	getBuyerById(data){
		this.addParm.buyerName = data.account;
		this.dialogBuyerVisible = false;
		console.log(data);
		this.$message.success("选择成功");
	},
    //	分页
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
      this.searchParm.pageSize = val;
      this.getDataList();
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
      this.searchParm.page = val;
      this.getDataList();
    }
  }
};
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
</style>
