<template>
  <div class="examination">
    <div class="common-head-search">
      <el-form :inline='true'>
        <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 label="创建日期">
          <el-date-picker
            v-model="search.times"
            type="daterange"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            size="small"
            style="width:300px"
            format="yyyy-MM-dd"
            value-format="yyyy-MM-dd">
          </el-date-picker>
        </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>
    <el-row>
        <el-col :span='10'>
          <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" style="vertical-align:middle;" @click="addData" >新增</el-button>
              <el-button icon="el-icon-edit" type="danger" size="mini" style="vertical-align:middle;" @click="deleteData" >删除</el-button>
            </div>
          </div>
          <div class="common-table-div" style="margin-top: 15px;">
            <el-table ref="dataTable2" :height="height_top"
                      v-loading="dataLoading2"
                      :data="table.list"
                      @current-change="handleCurrentChange"
                      highlight-current-row
                      @selection-change="searchFollow2"
                      :header-cell-style="tableHeaderCellStyle"
                      :summary-method="getSummaries2"
                      show-summary
                      border
                      style="width: 100%"
                      :icorePanelShown="100"
                      :icore-filter-flag="icoreFilterFlag"
            >
              <el-table-column type="index" label="NO" fixed="left" align="center" width="45"></el-table-column>
              <el-table-column type="selection" width="45" fixed="left" align="center"></el-table-column>
              <el-table-column sortable show-overflow-tooltip align="center" min-width="100" prop="stateFlag" label="状态"></el-table-column>
              <el-table-column sortable show-overflow-tooltip align="center" min-width="100" prop="isoName" label="投诉名称"></el-table-column>
              <el-table-column sortable show-overflow-tooltip align="center" min-width="100" prop="isoTypeName" label="投诉类型"></el-table-column>
              <el-table-column sortable show-overflow-tooltip align="center" min-width="100" prop="companyName" label="管理单位"></el-table-column>
              <el-table-column sortable show-overflow-tooltip align="center" min-width="100" prop="deptName" label="管理车间"></el-table-column>
              <el-table-column sortable show-overflow-tooltip align="center" min-width="100" prop="sectionName" label="管理班组"></el-table-column>
              <el-table-column sortable show-overflow-tooltip align="center" min-width="100" prop="memo" label="备注"></el-table-column>
              <el-table-column sortable show-overflow-tooltip align="center" min-width="100" prop="createMan" label="创建人"></el-table-column>
              <el-table-column sortable show-overflow-tooltip align="center" min-width="100" prop="createTime" label="创建时间"></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>
      </el-col>
      <el-col :span="14">
        <el-tabs v-model="activeName" type="card">
          <el-tab-pane label="投诉编辑" name="first">
            <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" :loading="saveLoading" size="mini" @click="addData2">保存</el-button>
                  <el-button icon="el-icon-edit" type="goon" :loading="submitLoading" size="mini" @click="submit">提交</el-button>
                  <el-button icon="el-icon-remove-outline" type="danger" size="mini" :loading="cancelSubmitLoading" @click="cancelSubmit">取消提交</el-button>
                </div>
              </div>
              <div class="common-table-div" style="margin-bottom:0;">
                <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="isoItemName" label="体系项目名称" align="center"></el-table-column>
                  <el-table-column sortable :show-overflow-tooltip="true" min-width="200px" prop="isoItemDesc" label="体系项目描述" align="center"></el-table-column>
                  <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="valueSit" label="赋值位置" align="center">
                    <template slot-scope="row">
                      <el-input
                        type="number"
                        :controls="false"
                        v-model="row.valueSit"
                        @keyup.enter.native="addData2"
                        size="small"
                        style="width: 100%"
                      >
                      </el-input>
                    </template>
                  </el-table-column>
                  <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="valueNum" label="赋值大小" align="center">
                    <template slot-scope="row">
                      <el-input
                        type="number"
                        :controls="false"
                        v-model="row.valueNum"
                        @keyup.enter.native="addData2"
                        size="small"
                        style="width: 100%"
                      >
                      </el-input>
                    </template>
                  </el-table-column>
                  <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="doValue" label="处理值" align="center">
                    <template slot-scope="row">
                      <el-input
                        type="number"
                        :controls="false"
                        v-model="row.doValue"
                        @keyup.enter.native="addData2"
                        size="small"
                        style="width: 100%"
                      >
                      </el-input>
                    </template>
                  </el-table-column>
                  <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="memo" label="备注" align="center">
                    <template slot-scope="row">
                      <el-input
                        type="number"
                        :controls="false"
                        v-model="row.memo"
                        @keyup.enter.native="addData2"
                        size="small"
                        style="width: 100%"
                      >
                      </el-input>
                    </template>
                  </el-table-column>
                  <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="memo1" label="备注1" align="center">
                    <template slot-scope="row">
                      <el-input
                        type="number"
                        :controls="false"
                        v-model="row.memo1"
                        @keyup.enter.native="addData2"
                        size="small"
                        style="width: 100%"
                      >
                      </el-input>
                    </template>
                  </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>
            </div>
          </el-tab-pane>
          <el-tab-pane label="投诉审核" name="second">
            <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" :loading="saveLoading" size="mini" @click="audit">审核</el-button>
                </div>
              </div>
              <div class="common-table-div" style="margin-bottom:0;">
                <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>
            </div>
          </el-tab-pane>
        </el-tabs>
      </el-col>
    </el-row>
        <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 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',
      activeName1:'first',
      dataLoading: false,
      dataLoading2: false,
      icoreFilterFlag: true,
      orgList:{},
      saveLoading:false,
      submitLoading:false,
      cancelSubmitLoading:false,
      page: {
        pageSize: 50,
        pageNum: 1,
        totalPage: 0
      },
      page2: {
        pageSize: 999,
        pageNum: 1,
        totalPage: 0
      },
      showFlag: false,
      Params: {},
      merchNo: '',
      showFlag2: false,
      Params2: {},
      Params3:{},
      labelName:'',
      merchType: [
        //   {ruleTypeCode: '483801', merchTypeName: '组批'},
        //   {ruleTypeCode: '483802', merchTypeName: '抽签'},
        //   {ruleTypeCode: '483803', merchTypeName: '批号'}
      ],
      multipleSelection2:[],
      multipleSelection3: [],
      // multipleSelection3: {},
      // multipleSelection4: {},
      multipleSelection4: [],
      search: {
        merchName: '',
        merchTypeName: ''
      },
      height_top:0,
      height_bot:0
    }
  },
  created() {
    this.height_top = window.innerHeight - 230;
    this.height_bot = window.innerHeight - 230;
  },
 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
        });
      },
    //选中数据2
    searchFollow2 (val){
      this.multipleSelection2 = val
    },
    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;
    },
    deleteData () {
       if (this.multipleSelection2.length < 1) {
         this.$message.warning('请勾选您要删除的数据！')
         return
       }
      this.$confirm('确认是否删除勾选的数据?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        let ids = ''
        this.multipleSelection2.forEach(item =>{
          ids = ids + ',' + item.id
        })
        ids = ids.substr(1,ids.length)
        this.dialogTableVisible = false;
        this.axios.delete('pass/baseManagement/v1/limsisodatas/'+ ids).then(res => {
          if (res.succeed) {
            this.open('删除成功', 'success', 1200)
            this.refresh()
          } else {
            this.$message.error(res.message)
          }
        }).catch(e => {
          this.$message.error(e.message)
        })
      }).catch(e => {
        this.$message.warning('取消删除')
      });
    },
    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 () {
      if (this.multipleSelection2.length <1){
        this.$message.warning('请勾选一条数据！')
        return
      }
      this.saveLoading = true
      let params = {

      }
      this.axios.put('pass/baseManagement/v1/limsisodatas/update'+ this.multipleSelection2.id,params,{individual:'json'}).then(res => {
        if (res.code == 0 || res.code == 200){
          this.saveLoading = false
          this.$message.success('保存成功');
        }else {
          this.saveLoading = false
          this.$message.error(res.message)
        }
      }).catch(e => {
        this.saveLoading = false
        this.$message.error(e.message)
      })
    },
    audit(){
      return
    },
    submit () {
      if (this.multipleSelection2.length < 1){
        this.$message.error('请勾选一条数据');
        return
      }
      this.submitLoading = true
      this.axios.post('pass/baseManagement/v1/limsisodatas/submit',this.multipleSelection2,{individualType: 'json'}).then(res => {
        if (res.code == 0 || res.code == 200){
          this.$message.success('成功提交'+res.data + "条，"+ (this.multipleSelection2.length - res.data) +"条提交失败！")
          this.submitLoading = false
          this.searchData();
        }else {
          this.$message.warning('提交失败！')
          this.submitLoading = false
        }
      }).catch(e => {
        this.$message.error(e.message)
        this.submitLoading = false
      })
    },
    cancelSubmit(){
      if (this.multipleSelection2.length < 1){
        this.$message.warning('请勾选一条数据');
      }
      this.cancelSubmitLoading = true;
      this.axios.post('pass/baseManagement/v1/limsisodatas/cancelSubmit',this.multipleSelection2,{individualType: 'json'}).then(res => {
        if (res.code == 0 || res.code == 200){
          this.$message.success('成功撤回'+res.data + "条，"+ (this.multipleSelection2.length - res.data) +"条撤回失败！")
          this.cancelSubmitLoading = false
          this.searchData();
        }else {
          this.$message.warning('提交失败！')
          this.cancelSubmitLoading = false
        }
      }).catch(e => {
        this.$message.error(e.message)
        this.cancelSubmitLoading = false
      })
    },
    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;
        let startTime = ''
        let endTime = ''
        if (!this.search.times) {
          startTime = ''
          endTime = ''
        } else {
          startTime = this.search.times[0] + ' 00:00:00'
          endTime = this.search.times[1] + ' 23:59:59'
        }
        let obj = {
          pageSize:this.page.pageSize,
          pageNum:_this.page.pageNum,
          startTime:startTime,
          endTime:endTime,
          isoName:this.search.isoName
        }
        _this.axios.post('pass/baseManagement/v1/limsisodatas/queryLimsIsoDataPages',obj,{individualType: 'json'}).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].stateFlag === '0') {
               this.table.list[i].stateFlag = '编辑'
             } else if (this.table.list[i].stateFlag === '1') {
               this.table.list[i].stateFlag = '已提交'
             }else if (this.table.list[i].stateFlag === '2'){
               this.table.list[i].stateFlag = '已审核'
             }
           }
          _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.multipleSelection4 = val;
    },
    pageSizeChange2 (size) {
      this.page2.pageSize = size;
      this.getDataList2(this.merchNo);
    },
    pageCurrentChange2 (index) {
      this.page2.pageNum = index;
      this.getDataList2(this.merchNo);
    },
    handleCurrentChange (val) {
      this.searchDataDUnSubmited(val);
      this.searchDataDSubmited(val);
    },
    searchDataDUnSubmited(val){
      let params = {
        sdId:val.id,
        stateFlags:['0','1']
      }
      this.axios.post('pass/baseManagement/v1/limsisodatads/queryLimsIsoDataDsBySdId',params,{individualType: 'json'}).then(res => {
        if (res.code == 0 || res.code == 200){
          this.table.list2 = res.data;
        }else {
          this.$message.warning(res.message)
        }
      }).catch(e => {
        this.$message.error('发生错误！请重试')
      })
    },
    searchDataDSubmited(val){
      let params = {
        sdId:val.id,
        stateFlag:['2']
      }
      this.axios.post('pass/baseManagement/v1/limsisodatads/queryLimsIsoDataDsBySdId',params,{individualType: 'json'}).then(res => {
        if (res.code == 0 || res.code == 200){
          this.table.list3 = res.data;
        }else {
          this.$message.warning(res.message)
        }
      }).catch(e => {
        this.$message.error('发生错误！请重试')
      })
    },
    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);
       });
    },
     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>
/*.common-title-div-mydefine {*/
/*  font-size: 14px;*/
/*  padding: 10px 10px;*/
/*  border-bottom: 1px solid #d5d5d5;*/
/*  position: relative;*/
/*  height: 100px;*/
/*}*/

/*.common-title-name-mydefine {*/
/*  font-size: 18px;*/
/*  font-family: '宋体';*/
/*  margin-right: 80px;*/
/*  margin-top: 15px;*/
/*}*/
</style>
