<template>
  <div class="examination">
    <div class="common-head-search">
      <el-form :inline='true'>
        <el-form-item label='客商类型'>
          <el-select v-model="search.merchTypeName" clearable filterable collapse-tags size="small" style="width:200px;margin-right: 10px;" placeholder="请选择查询内容">
            <el-option v-for="item in merchType" :key="item.baseName" :label="item.baseName"
              :value="item.baseName">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label='客商名称'>
          <el-input v-model="search.merchName" size="small" placeholder="请输入查询内容" style="width: 200px" @keyup.enter.native="searchData"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button icon="el-icon-search" type="goon" size="mini" @click="searchData">查询</el-button>
          <el-button icon="el-icon-refresh" type="info" plain size="mini" @click="reset">重置</el-button>
        </el-form-item>
      </el-form>
    </div>
    <div class="common-title-div">
      <div class="common-title-name">
        <img style="width: 25px; height: 25px" src='../../../../assets/img/imgScreen/logo.png' />
        供应商信息表
      </div>
      <div>
      <el-button icon="el-icon-circle-plus-outline" type="goon" size="mini" @click="addData">新增</el-button>
      <el-button icon="el-icon-edit" type="goon" size="mini" @click="modifyData">修改</el-button>
      <el-button icon="el-icon-remove-outline" type="danger" size="mini" @click="deleteData">停用</el-button>
      <el-button icon="el-icon-check" type="goon" size="mini" @click="recoverData">恢复</el-button>
      <el-button icon="el-icon-download" type="goon" size="mini" :loading='createFileLoading' @click="createFile">生成客商文件</el-button>
      <el-button icon="el-icon-download" type="goon" size="mini" :loading='createEvaluationFileLoading' @click="createEvaluationFile">生成客商评价文件</el-button>
      </div>
    </div>
    <div class="common-table-div" style="margin-bottom:0;margin-top:0">
       <el-table v-loading="dataLoading" ref="dataTable" border 
       :height="height_top" 
       highlight-current-row 
       @selection-change="handleSelectionChange" 
       @current-change="handleCurrentChange" 
       :data="table.list" 
       :icore-filter-flag="icoreFilterFlag"
       :header-cell-style="tableHeaderCellStyle" 
       :cell-class-name="tableRowClassName" 
       :summary-method="getSummaries" show-summary>
        <el-table-column type="index" label="NO" fixed="left" align="center">
        </el-table-column>
        <el-table-column type="selection" width="55" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="180px" prop="merchName" label="供应商名称" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="merchChnAbbr" label="客商简称" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="200px" prop="merchIndustry" label="主要经营范围" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="merchLinkman" label="联系人"  align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="merchTel" label="电话"  align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="merchFax" label="传真"  align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="merchAddress" label="地址" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="registeredAddress" label="主要资质证明"  align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="merchStrDate" label="证明有效时间"  align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="merchEndDate" label="证明失效时间"  align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="merchTypeName" label="客商类型" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="merchAtrrName" label="客商属性" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="80px"  prop="validFlag1" label="数据状态" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="createMan" label="创建人" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="createTime" label="创建时间" align="center"></el-table-column>
      </el-table>
    </div>
    <div class="common-foot-style">
        <el-pagination v-loading="dataLoading" @size-change="pageSizeChange" @current-change="pageCurrentChange"
          :current-page="page.pageNum" :page-sizes="[10, 20, 50, 100, 200]" :page-size="page.pageSize" layout="total, sizes, prev, pager, next, jumper"
          :total="page.totalPage" background>
        </el-pagination>
    </div>
    <div class="common-table-div" style="margin-bottom:0;margin-top:30px;">
      <el-tabs v-model="activeName" type="card" >
        <el-tab-pane label="客商资料" name="first" margin-top="40px">
          <div>
            <div class="common-title-div">
              <div class="common-title-name">
                <img style="width: 25px; height: 25px" src='../../../../assets/img/imgScreen/logo.png' />
                客商资料
              </div>
              <div>
                <el-button icon="el-icon-circle-plus-outline" type="goon" size="mini" @click="addData2">新增</el-button>
                <el-button icon="el-icon-edit" type="goon" size="mini" @click="modifyData2">修改</el-button>
                <el-button icon="el-icon-remove-outline" type="danger" size="mini" @click="abolish()">停用</el-button>
                <el-button icon="el-icon-check" type="goon" size="mini" @click="recover()">恢复</el-button>
              </div>
            </div>
            <el-table v-loading="dataLoading2" ref="dataTable2" border :height="height_bot" highlight-current-row @selection-change="handleSelectionChange2" :data="table.list2" :icore-filter-flag="icoreFilterFlag"
                      :header-cell-style="tableHeaderCellStyle" :cell-class-name="tableRowClassName2" :summary-method="getSummaries2" show-summary>
              <el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>
              <el-table-column type="selection" width="55" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="200px" prop="merchNoD" label="客商信息编号" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="200px" prop="merchNo" label="客商编号" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="merchItemName" label="客商信息名称" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="merchItemDesc" label="客商项目描述" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="filePath" label="附件路径" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="80px"  prop="validFlag1" label="数据状态" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="memo" label="备注" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="memo1" label="备注1" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="createMan" label="创建人" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="createTime" label="创建时间" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="updateMan" label="修改人" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="updateTime" label="修改时间" align="center"></el-table-column>
            </el-table>
          </div>
        </el-tab-pane>
        <el-tab-pane label="客商评价" name="second" margin-top="40px">
          <div>
            <div class="common-title-div">
              <div class="common-title-name">
                <img style="width: 25px; height: 25px" src='../../../../assets/img/imgScreen/logo.png' />
                客商评价
              </div>
              <div>
                <el-button icon="el-icon-circle-plus-outline" type="goon" size="mini" @click="addData2">新增</el-button>
                <el-button icon="el-icon-edit" type="goon" size="mini" @click="modifyData2">修改</el-button>
                <el-button icon="el-icon-remove-outline" type="danger" size="mini" @click="abolish">停用</el-button>
                <el-button icon="el-icon-check" type="goon" size="mini" @click="recover">恢复</el-button>
              </div>
            </div>
            <el-table v-loading="dataLoading2" ref="dataTable2" border :height="height_bot" highlight-current-row @selection-change="handleSelectionChange2" :data="table.list3" :icore-filter-flag="icoreFilterFlag"
                      :header-cell-style="tableHeaderCellStyle" :cell-class-name="tableRowClassName2" :summary-method="getSummaries2" show-summary>
              <el-table-column type="index" label="NO" fixed="left" align="center">
              </el-table-column>
              <el-table-column type="selection" width="55" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="180px" prop="evaName" label="评价名称" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="180px" prop="merchNo" label="客商代码" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="evaLevelCode" label="评价等级编号" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="evaLevelName" label="评价等级名称" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="memo" label="备注" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="80px"  prop="validFlag1" label="数据状态" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="evaMan" label="评价人" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="evaTime" label="评价时间" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="createMan" label="创建人" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="createTime" label="创建时间" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="updateMan" label="更新人" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="updateTime" label="更新时间" align="center"></el-table-column>
            </el-table>
          </div>
        </el-tab-pane>
      </el-tabs>
    </div>
    <div is="alertComponets" :showFlag="showFlag" :Params="Params" @refresh='refresh'></div>
    <div is="alertComponets2" :showFlag2="showFlag2" :Params="Params" :Params2="Params2" :Params3="Params3" @refresh='refresh2'></div>
  </div>
</template>
<script>
import {
  getCookie
} from '@/utils/util.js';
import {
  cookieUserId,
  cookieUserName
} from '@/config/config.js';
import alertComponets from './alertComponents';
import alertComponets2 from './alertComponents2';
let userName = getCookie(cookieUserName);
let userId = getCookie(cookieUserId);
export default {
  components: {alertComponets, alertComponets2},
  data () {
    return {
      table: {
        list: [],
        list2: [],
        list3:[]
      },
      activeName:'first',
      dataLoading: false,
      dataLoading2: false,
      createFileLoading: false,
      createEvaluationFileLoading: false,
      icoreFilterFlag: true,
      page: {
        pageSize: 50,
        pageNum: 1,
        totalPage: 0
      },
      page2: {
        pageSize: 999,
        pageNum: 1,
        totalPage: 0
      },
      showFlag: false,
      Params: {},
      merchNo: '',
      showFlag2: false,
      Params2: {},
      Params3:{},
      merchType: [
        //   {ruleTypeCode: '483801', merchTypeName: '组批'},
        //   {ruleTypeCode: '483802', merchTypeName: '抽签'},
        //   {ruleTypeCode: '483803', merchTypeName: '批号'}
      ],
      multipleSelection3: [],
      // multipleSelection3: {},
      // multipleSelection4: {},
      multipleSelection4: [],
      search: {
        merchName: '',
        merchTypeName: ''
      },
      height_top:0,
      height_bot:0
    }
  },
  created() {
    this.height_top = window.innerHeight / 2 - 130 < 249 ? 249 : window.innerHeight / 2 - 100;
    this.height_bot =  window.innerHeight / 2 - 130 < 249 ? 249 : window.innerHeight / 2 - 100;
  },
  //TODO mounted
 mounted () {
    this.searchData();
    // this.getDataList2(this.merchNo);
    this.addScreen();
    this.addScreen2();
    this.getMerchTypeList ()
  },
  methods: {
    getSummaries (param) {
      const { columns, data } = param;
      const sums = [];
       columns.forEach((column, index) => {
          if (index === 0) {
            sums[index] = '合计';
            return;
          }
          if (index === 2) {
            sums[index] = this.page.totalPage;
          }
       });
        return sums;
    },
    getSummaries2 (param) {
      const { columns, data } = param;
      const sums = [];
       columns.forEach((column, index) => {
          if (index === 0) {
            sums[index] = '合计';
            return;
          }
          if (index === 2) {
            sums[index] = this.page2.totalPage;
          }
       });
        return sums;
    },
     open(mag, typ, time) {
        this.$message({
          showClose: true,
          message: mag,
          type: typ,
          duration: time
        });
      },
    refresh () {
      let _this = this;
      this.searchData();
    },
    refresh2 () {
      this.getDataList2(this.merchNo);
      this.getDataList3(this.merchNo)
    },
    addData () {
      let _this = this;
      _this.showFlag = !_this.showFlag;
      _this.Params = null;
    },
    modifyData () {
      let _this = this;
      if (_this.multipleSelection3.length !== 1) {
        this.$message.warning('请勾选您要修改的一条数据！')
      } else {
        _this.showFlag = !_this.showFlag;
        _this.Params = _this.multipleSelection3
      }
    },
    deleteData () {
       let _this = this;
        if (_this.multipleSelection3.length < 1) {
        this.$message.warning('请勾选您要停用的数据！')
       } else {
        _this.dialogTableVisible = false;
        _this.axios.post('pass/baseManagement/v1/limsisomerchs/abolish', _this.multipleSelection3, {individualType: 'json'}).then(res => {
        if (res.succeed) {
         this.open('停用操作成功', 'success', 1200)
         _this.refresh()
        } else {
         this.$message.error(res.message)
        }
        }).catch(e => {
         this.$message.error(e.message)
       })
      }
    },
    createEvaluationFile(){
      if(this.multipleSelection3.length == 0){
        this.$message.warning('请勾选您要导出的数据！')
        return
      }
      let list = []
      this.multipleSelection3.forEach(s=>{
        list.push(s.id)
      })
      this.createEvaluationFileLoading = true
      this.axios.post('pass/baseManagement/v1/limsisomerchs/createEvaluationFile',list,{individualType: 'json'}).then(res=>{
        if(res.succeed){
          this.$message.success('操作成功,请到供应商管理审核！');
        }
        this.createEvaluationFileLoading = false
      }).catch(e=>{
        this.createEvaluationFileLoading = false
        this.$message.error(e.message)
      })
    },
    createFile(){
      if(this.multipleSelection3.length == 0){
        this.$message.warning('请勾选您要导出的数据！')
        return
      }
      let list = []
      this.multipleSelection3.forEach(s=>{
        list.push(s.id)
      })
      this.createFileLoading = true
      this.axios.post('pass/baseManagement/v1/limsisomerchs/createFile',list,{individualType: 'json'}).then(res=>{
        if(res.succeed){
          this.$message.success('操作成功,请到供应商管理审核！');
        }
        this.createFileLoading = false
      }).catch(e=>{
        this.createFileLoading = false
        this.$message.error(e.message)
      })
    },
    recoverData () {
       let _this = this;
        if (_this.multipleSelection3.length < 1) {
        this.$message.warning('请勾选您要恢复的数据！')
        } else {
        _this.dialogTableVisible = false;
        _this.axios.post('pass/baseManagement/v1/limsisomerchs/recover', _this.multipleSelection3, {individualType: 'json'}).then(res => {
        if (res.succeed) {
         this.open('恢复成功', 'success', 1200)
         _this.refresh()
        } else {
         this.$message.error(res.message)
        }
        }).catch(e => {
         this.$message.error(e.message)
       })
      }
    },
    addData2 () {
      let _this = this;
     if (_this.multipleSelection3.length !== 1) {
       this.$message.warning('只能选择一条客商信息数据！')
     } else {
       _this.showFlag2 = !_this.showFlag2;
       _this.Params2 = null;
       _this.Params3 = {activeName:this.activeName};
       _this.Params = _this.multipleSelection3[0]
     }
    },
    //TODO modifyData2
    modifyData2 () {
      let _this = this;
     if (_this.multipleSelection4.length !== 1) {
        this.$message.warning('请勾选您要修改的一条数据！')
      } else {
        _this.showFlag2 = !_this.showFlag2;
        _this.Params2 = _this.multipleSelection4[0];
        _this.Params3 = {activeName: this.activeName}
        _this.Params = null
      }
    },
    abolish(){
      if (this.activeName === 'first'){
        this.deleteData2();
      } else if (this.activeName === 'second'){
        this.deleteData3();
      }
    },
    recover(){
      if (this.activeName ==='first'){
        this.recoverData2()
      }else if (this.activeName === 'second'){
        this.recoverData3()
      }
    },
    deleteData2 () {
       let _this = this;
       if (_this.multipleSelection4.length < 1) {
        this.$message.warning('请勾选您要停用的数据！')
       } else {
        _this.dialogTableVisible = false;
        _this.axios.post('pass/baseManagement/v1/limsisomerchds/abolish', _this.multipleSelection4, {individualType: 'json'}).then(res => {
        if (res.succeed) {
         this.open('停用操作成功', 'success', 1200)
         _this.refresh2()
        } else {
         this.$message.error(res.message)
        }
        }).catch(e => {
         this.$message.error(e.message)
       })
      }
    },
    deleteData3 () {
      let _this = this;
      if (_this.multipleSelection4.length < 1) {
        this.$message.warning('请勾选您要停用的数据！')
      } else {
        _this.dialogTableVisible2 = false;
        _this.axios.post('pass/baseManagement/v1/limsisomerchevas/abolish', _this.multipleSelection4, {individualType: 'json'}).then(res => {
          if (res.succeed) {
            this.open('停用操作成功', 'success', 1200)
            _this.refresh2()
          } else {
            this.$message.error(res.message)
          }
        }).catch(e => {
          this.$message.error(e.message)
        })
      }
    },
    recoverData2 () {
       let _this = this;
        if (_this.multipleSelection4.length < 1) {
        this.$message.warning('请勾选您要恢复的数据！')
        } else {
          _this.dialogTableVisible2 = false;
          _this.axios.post('pass/baseManagement/v1/limsisomerchds/recover', _this.multipleSelection4, {individualType: 'json'}).then(res => {
            if (res.succeed) {
              this.open('恢复成功', 'success', 1200)
              _this.refresh2()
            } else {
              this.$message.error(res.message)
            }
        }).catch(e => {
         this.$message.error(e.message)
       })
      }
    },
    recoverData3(){
      let _this = this;
      if (_this.multipleSelection4.length < 1) {
        this.$message.warning('请勾选您要恢复的数据！')
      } else {
        _this.dialogTableVisible2 = false;
        _this.axios.post('pass/baseManagement/v1/limsisomerchevas/recover', _this.multipleSelection4, {individualType: 'json'}).then(res => {
          if (res.succeed) {
            this.open('恢复成功', 'success', 1200)
            _this.refresh2()
          } else {
            this.$message.error(res.message)
          }
        }).catch(e => {
          this.$message.error(e.message)
        })
      }
    },
    searchData () {
        let _this = this;
        _this.dataLoading = true;
        _this.page.pageNum = 1;
        _this.axios.get('pass/baseManagement/v1/limsisomerchs/' + 'like/?pageNum=' + _this.page.pageNum + '&pageSize=' + _this.page.pageSize +
          '&merchName=' + _this.search.merchName + '&merchTypeName=' + _this.search.merchTypeName)
        .then(res => {
          _this.dataLoading = false;
          _this.table.list = res.data.list;
           for (let i = 0; i < this.table.list.length; i++) {
           if (this.table.list[i].validFlag === '0') {
             this.table.list[i].validFlag1 = '无效'
           } else if (this.table.list[i].validFlag === '1') {
             this.table.list[i].validFlag1 = '有效'
           }
           }
          _this.page.totalPage = res.data.total;
        }).catch(e => {
          _this.dataLoading = false;
        });
      },
    reset () {
      let _this = this;
      _this.search.merchName = '';
      _this.search.merchTypeName = '';
      _this.searchData();
      _this.getMerchTypeList ()
    },
    handleSelectionChange (val) {
      this.multipleSelection3 = val;
       if(val.length > 0) {
         this.merchNo = val[val.length-1].merchNo;
         this.getDataList2 (this.merchNo);
       }
      // if (val.length === 1) {
      //    this.merchNo = '';
      //    this.merchNo = val[0].merchNo;
      //    this.getDataList2 (this.merchNo);
      // } else {
      //    this.merchNo = '';
      //    this.getDataList2 (this.merchNo);
      // }

    },
    pageSizeChange (size) {
      this.page.pageSize = size;
      this.getDataList();
    },
    pageCurrentChange (index) {
      this.page.pageNum = index;
      this.getDataList();
    },
    handleSelectionChange2 (val) {
      // this.multipleSelection2 = [];
      // this.multipleSelection2.push(val);
      this.multipleSelection4 = val;
    },
    pageSizeChange2 (size) {
      this.page2.pageSize = size;
      this.getDataList2(this.merchNo);
    },
    pageCurrentChange2 (index) {
      this.page2.pageNum = index;
      this.getDataList2(this.merchNo);
    },
    handleCurrentChange (val) {
      if (val.merchNo === null) {
        this.merchNo = '';
      } else {
        this.merchNo = val.merchNo;
      }
      this.getDataList2 (this.merchNo);
      this.getDataList3(this.merchNo);
    },
    addScreen () {
      this.$nextTick(() => {
          let ss = document.createElement('div');
          ss.innerHTML = '筛选';
          ss.style = 'text-align: center;'
          this.$refs.dataTable.$el.getElementsByClassName('el-table__fixed')[0].getElementsByTagName('td')[0].appendChild(ss);
       });
    },
    addScreen2 () {
     this.$nextTick(() => {
          let ss = document.createElement('div');
          ss.innerHTML = '筛选';
          ss.style = 'text-align: center;'
          this.$refs.dataTable2.$el.getElementsByClassName('el-table__fixed')[0].getElementsByTagName('td')[0].appendChild(ss);
       });
    },
    // TODO getDataList2
     getDataList2 (merchNo) {
      this.dataLoading2 = true;
      if (merchNo === null || merchNo === '') {
        this.table.list2 = []
        this.dataLoading2 = false;
        return 0
      } else {
         this.axios.get('pass/baseManagement/v1/limsisomerchds/queryLimsMerchDByMerchNo' + '?merchNo=' + merchNo).then(res => {
              this.dataLoading2 = false;
              this.table.list2 = res.data;
              for (let i = 0; i < this.table.list2.length; i++) {
                if (this.table.list2[i].validFlag === '0') {
                  this.table.list2[i].validFlag1 = '无效'
                } else if (this.table.list2[i].validFlag === '1') {
                  this.table.list2[i].validFlag1 = '有效'
                }
              }
              this.page2.totalPage = res.data.total;
            }).catch(e => {
              this.dataLoading2 = false;
            });
      }
    },
    getDataList3(merchNo){
      this.dataLoading2 = true;
      if (merchNo === null || merchNo === '') {
        this.table.list3 = []
        this.dataLoading2 = false;
        return 0
      } else {
        this.axios.get('pass/baseManagement/v1/limsisomerchevas/queryLimsMerchEvaByMerchNo' + '?merchNo=' + merchNo).then(res => {
          this.dataLoading2 = false;
          this.table.list3 = res.data;
          for (let i = 0; i < this.table.list3.length; i++) {
            if (this.table.list3[i].validFlag === '0') {
              this.table.list3[i].validFlag1 = '无效'
            } else if (this.table.list3[i].validFlag === '1') {
              this.table.list3[i].validFlag1 = '有效'
            }
          }
          this.page2.totalPage = res.data.total;
        }).catch(e => {
          this.dataLoading2 = false;
        });
      }
    },
   getMerchTypeList () {
    this.axios.post("pass/baseManagement/v1/limsbaseinfos/queryBaseInfoByBaseCode",{validFlag:1,baseCode:4832}, {individualType: 'json'}).then(res => {
      this.dataLoading = false;
      this.merchType = res.data;
    })
   },
   tableRowClassName ({
        row, column, rowIndex, columnIndex
      }) {
        if (columnIndex === 8) {
        if (row.validFlag !== '1') {
          return 'error-row';
        }
        return '';
        }
      },
    tableRowClassName2 ({
        row, column, rowIndex, columnIndex
      }) {
        if (columnIndex === 7) {
        if (row.validFlag !== '1') {
          return 'error-row';
        }
        return '';
        }
      },
    tableHeaderCellStyle () {
      return 'color: rgb(255,255,255);border-bottom: 1px solid #DCDFE7;'
    }
  }
}
</script>
<style  scoped>
</style>
