<template>
  <div class="examination">
    <div class="common-head-search">
      <el-form :inline="true" @submit.native.prevent>
        <el-form-item label="证书类型">
          <el-select v-model="search.cretTypeCode" clearable filterable collapse-tags size="mini" style="width:200px;" placeholder="请选择查询内容">
            <el-option v-for="item in cretTypeNameType" :key="item.baseCode" :label="item.baseName"
              :value="item.baseCode">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="证书名称">
          <el-input v-model="search.cretName" @keyup.enter.native="searchData()" size="mini" placeholder="请输入查询内容" style="width: 200px"></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" :loading='stopLoading' @click="deleteData">停用</el-button>
      <el-button icon="el-icon-remove-outline" type="danger" size="mini" :loading='deleteLoading' @click="deleteList">删除</el-button>
      <el-button icon="el-icon-check" type="goon" size="mini" :loading='startLoading' @click="recoverData">启用</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="theight1" 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="100px" prop="cretNo" label="证书编号" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="cretName" label="证书名称" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="cretTypeName" label="证书类型" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="200px" prop="cretFilePath1" label="证书文件名" align="center">
          <template slot-scope="scope">
             <span>{{scope.row.cretFilePath1}}</span>
             <el-tooltip content="下载文件" placement="bottom" effect="light">
             <el-button
             :disabled='!scope.row.cretFilePath1'
              type="goon" size="mini" icon="el-icon-download" circle
              @click="downloadFile(scope.$index, scope.row.cretNo, scope.row.cretFilePath.fileName, scope.row.cretFilePath.oldFileName, 'LIMS_CRET_TMP')">
            </el-button>
             </el-tooltip>
           </template>
        </el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="200px" prop="memo" label="备注"  align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="90px"  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="140px" prop="createTime" label="创建时间" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="updateMan" label="修改人" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="updateTime" 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-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" :loading='stopLoading2' size="mini" @click="deleteData2">停用</el-button>
      <el-button icon="el-icon-remove-outline" type="danger" :loading='deleteLoading2' size="mini" @click="deleteList2">删除</el-button>
      <el-button icon="el-icon-check" type="goon" size="mini" :loading='startLoading2' @click="recoverData2">启用</el-button>
      </div>
    </div>
    <div class="common-table-div" style="margin-bottom:0;margin-top:0">
       <el-table v-loading="dataLoading2" ref="dataTable2" border :height="theight2" highlight-current-row @selection-change="handleSelectionChange2" :data="table.list2" :icore-filter-flag="icoreFilterFlag"
       :header-cell-style="tableHeaderCellStyle" :cell-class-name="tableRowClassName2" :summary-method="getSummaries" show-summary>
        <el-table-column type="index" label="NO" 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="100px" prop="cretNoM" label="证书项号" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="cretName" label="证书名称" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="cretItemName" label="证书项目" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="cretItemtName" label="项目类型" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="strRowStd" label="标准数据起始行" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="strColStd" label="标准数据起始列" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="strRowD" label="检验数据起始行" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="strColD" label="检验数据起始列" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="rowStep" label="行步长" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="colStep" label="列步长" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="colNo" label="表列名" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="dataTypeName" label="数据类型" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="manySmp" label="多样类型" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="defaultValue" label="默认值" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="cretImg1" label="图片" align="center">
        <template slot-scope="scope">
             <span>{{scope.row.cretImg1}}</span>
           </template>
        </el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" label="下载、预览" align="center">
           <template slot-scope="scope">
             <el-tooltip content="下载文件" placement="bottom" effect="light">
             <el-button
             :disabled='!scope.row.cretImg1'
              type="goon" size="mini" icon="el-icon-download" circle
              @click="downloadFile(scope.$index, scope.row.cretNoM, scope.row.cretImg.fileName,  scope.row.cretImg.oldFileName, 'LIMS_CRET_TMP_M')">
            </el-button>
             </el-tooltip>
            <el-tooltip content="预览照片" placement="bottom" effect="light">
             <el-button
             :disabled='!scope.row.cretImg1'
              type="warning" size="mini" icon="el-icon-view" circle
              @click="imgPreView(scope.$index, scope.row.cretNoM, scope.row.cretImg.fileName, 'LIMS_CRET_TMP_M')">
            </el-button>
            </el-tooltip>
           </template>
         </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="90px" 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="140px" prop="createTime" label="创建时间" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="updateMan" label="修改人" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="updateTime" label="修改时间" align="center"></el-table-column>
       </el-table>
    </div>
    <!-- <div class="common-foot-style">
        <el-pagination v-loading="dataLoading2" @size-change="pageSizeChange2" @current-change="pageCurrentChange2"
          :current-page="page2.pageNum" :page-sizes="[10, 20, 50, 100, 200]" :page-size="page2.pageSize" layout="total, sizes, prev, pager, next, jumper"
          :total="page2.totalPage" background>
        </el-pagination>
    </div> -->
    <div is="alertComponets" :showFlag="showFlag" :Params="Params" @refresh='refresh'></div>
    <div is="alertComponets2" :showFlag2="showFlag2" :Params="Params" :Params2="Params2" @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';
import { ajaxCtx } from '@/config/config.js';
let userName = getCookie(cookieUserName);
let userId = getCookie(cookieUserId);
export default {
  components: {alertComponets, alertComponets2},
  data () {
    return {
      table: {
        list: [
          // {cretFilePath: {objFileName: '', fileName: ''}}
        ],
        list2: []
      },
      dataLoading: false,
      dataLoading2: false,
      stopLoading:false,
      startLoading:false,
      stopLoading2:false,
      startLoading2:false,
      icoreFilterFlag: true,
      deleteLoading: false,
      deleteLoading2: false,
      page: {
        pageSize: 50,
        pageNum: 1,
        totalPage: 0
      },
      page2: {
        pageSize: 50,
        pageNum: 1,
        totalPage: 0
      },
      cretNo: '',
      showFlag: false,
      Params: {},
      showFlag2: false,
      Params2: {},
      cretTypeNameType: [],
      multipleSelection3: [],
      multipleSelection4: [],
      search: {
        cretName: '',
        cretTypeCode: ''
      },
      theight1:0,
      theight2:0,
      //action_prod: 'http://192.168.3.66:9002',
      action_prod:ajaxCtx
    }
  },
  created(){
    this.theight1 = window.innerHeight / 2 - 130 <249 ? 249 : window.innerHeight / 2 - 100;
    this.theight2 = window.innerHeight / 2 - 130 <249 ? 249 : window.innerHeight / 2 - 100;
  },
  mounted () {
    this.axios.post("pass/baseManagement/v1/limsbaseinfos/queryBaseInfoByBaseCode",{validFlag:1,baseCode:4820}, {individualType: 'json'}).then(res => {
      this.cretTypeNameType = res.data;
    })
    this.getDataList();
    // this.getDataList2();
    this.addScreen();
    this.addScreen2();
  },
  methods: {
    getSummaries(param) {
      const { columns, data } = param;
      const sums = [];
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = "合计";
        }
        if (index === 1) {
          sums[index] = data.length;
        } 
      });
      return sums;   
    },
    refresh () {
      this.getDataList();
      this.getDataList2(this.cretNo);
      // this.multipleSelection.splice(0, 1);
      // this.multipleSelection2 = []
      // console.log(this.multipleSelection)
    },
    refresh2 () {
      this.getDataList2(this.cretNo);
    },
    addData () {
      this.showFlag = !this.showFlag;
      this.Params = null;
    },
    modifyData () {
      if (this.multipleSelection3.length !== 1) {
        this.$message.warning('请勾选您要修改的一条数据！')
      } else {
        this.showFlag = !this.showFlag;
        this.Params = this.multipleSelection3
      }
    },
    deleteList(){
      if (this.multipleSelection3.length < 1) {
        this.$message.warning('请勾选您要删除的数据！')
      } else {
        this.dataLoading = true
        this.axios.post('pass/baseManagement/v1/limscrettmps/deleteList', this.multipleSelection3, {individualType: 'json'}).then(res => {
        if (res.code == 0 || res.code == 200) {
          this.$message.success(res.message);
          this.refresh()
        } else {
         this.$message.error(res.message)
        }
        this.dataLoading = false
        }).catch(e => {
          this.dataLoading = false
         this.$message.error(e.message)
       })
      }
    },
    deleteData () {
      if (this.multipleSelection3.length < 1) {
        this.$message.warning('请勾选您要停用的数据！')
      } else {
        for (var j= 0; j < this.multipleSelection3.length; j++) {
          if (this.multipleSelection3[j].validFlag === '0') {
          this.$message.warning('请勾选状态为已启用的数据！')  
          return 
          }
        }
        this.stopLoading = true
        this.axios.post('pass/baseManagement/v1/limscrettmps/abolishrecover', this.multipleSelection3, {individualType: 'json'}).then(res => {
        if (res.code == 0 || res.code == 200) {
          this.$message.success(res.message);
          this.refresh()
        } else {
         this.$message.error(res.message)
        }
        this.stopLoading = false
        }).catch(e => {
          this.stopLoading = false
         this.$message.error(e.message)
       })
      }
    },
    recoverData () {
      if (this.multipleSelection3.length < 1) {
        this.$message.warning('请勾选您要启用的数据！')
      } else {
          for (var j= 0; j < this.multipleSelection3.length; j++) {
          if (this.multipleSelection3[j].validFlag === '1') {
          this.$message.warning('请勾选状态为已停用的数据！')  
          return 
          }
        }
        this.startLoading = true
        this.axios.post('pass/baseManagement/v1/limscrettmps/abolishrecover', this.multipleSelection3, {individualType: 'json'}).then(res => {
        if (res.code == 0 || res.code == 200) {
          this.$message.success(res.message);
          this.refresh()
        } else {
         this.$message.error(res.message)
        }
        this.startLoading = false
        }).catch(e => {
          this.startLoading = false
         this.$message.error(e.message)
       })
      }
    },
    addData2 () {
     if (this.multipleSelection3.length !== 1) {
       this.$message.warning('请选择一条证书信息数据！')
     } else {
      this.showFlag2 = !this.showFlag2;
      this.Params2 = null;
      this.Params = this.multipleSelection3[0]
      }
      //  if (this.multipleSelection.length !== 1) {
      //   this.$message.warning('请选择一条业务规则信息数据！')
      // } else {
      // this.showFlag2 = !this.showFlag2;
      // this.Params2 = null;
      // this.Params = this.multipleSelection
      // }
    },
    modifyData2 () {
     if (this.multipleSelection4.length !== 1) {
        this.$message.warning('请勾选您要修改的一条数据！')
      } else {
        this.showFlag2 = !this.showFlag2;
        this.Params2 = this.multipleSelection4[0];
        this.Params = null
      }
    },
    deleteList2(){
      if (this.multipleSelection4.length < 1) {
        this.$message.warning('请勾选您要删除的数据！')
      } else {
        this.dataLoading2 = true
        this.axios.post('pass/baseManagement/v1/limscrettmpms/deleteList', this.multipleSelection4, {individualType: 'json'}).then(res => {
        if (res.code == 0 || res.code == 200) {
          this.$message.success(res.message);
          this.refresh2()
        } else {
         this.$message.error(res.message)
        }
        this.dataLoading2 = false
        }).catch(e => {
          this.dataLoading2 = false
         this.$message.error(e.message)
       })
      }
    },
    deleteData2 () {
      if (this.multipleSelection4.length < 1) {
        this.$message.warning('请勾选您要停用的数据！')
      } else {
        for (var j= 0; j < this.multipleSelection4.length; j++) {
          if (this.multipleSelection4[j].validFlag === '0') {
          this.$message.warning('请勾选状态为已启用的数据！')  
          return 
          }
        }
        this.stopLoading2 = true
        this.axios.post('pass/baseManagement/v1/limscrettmpms/abolishrecover', this.multipleSelection4, {individualType: 'json'}).then(res => {
        if (res.code == 0 || res.code == 200) {
          this.$message.success(res.message);
          this.refresh2()
        } else {
         this.$message.error(res.message)
        }
        this.stopLoading2 = false
        }).catch(e => {
          this.stopLoading2 = false
         this.$message.error(e.message)
       })
      }
    },
    recoverData2 () {
      if (this.multipleSelection4.length < 1) {
        this.$message.warning('请勾选您要启用的数据！')
      } else {
        for (var j= 0; j < this.multipleSelection4.length; j++) {
          if (this.multipleSelection4[j].validFlag === '1') {
          this.$message.warning('请勾选状态为已停用的数据！')  
          return 
          }
        }
        this.startLoading = true
        this.axios.post('pass/baseManagement/v1/limscrettmpms/abolishrecover', this.multipleSelection4, {individualType: 'json'}).then(res => {
        if (res.code == 0 || res.code == 200) {
          this.$message.success(res.message);
          this.refresh2()
        } else {
         this.$message.error(res.message)
        }
        this.startLoading = false
        }).catch(e => {
          this.startLoading = false
         this.$message.error(e.message)
       })
      }
    },
    searchData () {
      this.page.pageNum = 1;
      this.page.pageSize = 50
      this.getDataList()
    },
    reset () {
      this.search.cretName = '';
      this.search.cretTypeCode = '';
      this.searchData();
    },
    handleSelectionChange (val) {
      this.multipleSelection3 = val;
      if (val.length > 0) {
        this.cretNo = val[val.length-1].cretNo;
        this.getDataList2(this.cretNo);
      }
    },
    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.cretNo);
    },
    pageCurrentChange2 (index) {
      this.page2.pageNum = index;
      this.getDataList2(this.cretNo);
    },
    handleCurrentChange (val) {
      if (val.cretNo === null) {
        this.cretNo = '';
      } else {
        this.cretNo = val.cretNo;
      }
      this.getDataList2 (this.cretNo)
    },
    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);
       });
    },
    //请求证书信息表
    getDataList () {
      let obj = {
        'object':{
          'cretName':this.search.cretName,
          'cretTypeCode':this.search.cretTypeCode
        },
        pageIndex:this.page.pageNum,
        pageSize:this.page.pageSize
      }
      this.dataLoading = true;
      this.axios.post('pass/baseManagement/v1/limscrettmps/queryLimsCretTmpPage',obj,{individualType: 'json'}).then(res => {
        if (res.code == 0 || res.code == 200) {
          this.table.list = res.data.list;
          this.table.list.forEach(item =>{
            item.validFlag1 = item.validFlag == 0 ? '无效' : item.validFlag == 1 ? '有效' : ''
            item.cretFilePath = JSON.parse(item.cretFilePath) 
            item.cretFilePath1 = item.cretFilePath.oldFileName ? item.cretFilePath.oldFileName : ''
          })
          this.page.totalPage = res.data.total;
        }else{
          this.$message.error(res.message)
        }
        this.dataLoading = false;
      }).catch(e => {
        this.dataLoading = false;
        this.$message.error(e.message)
      });
    },
    //查询证书项目配置表
    getDataList2 (cretNo) {
      this.cretNo = cretNo
      let cretNos = cretNo ? cretNo : ''
      this.dataLoading2 = true;
      let obj = {
        object:{
          cretNo:cretNos
        },
        pageIndex:this.page2.pageNum,
        pageSize:this.page2.pageSize
      }
      this.axios.post('pass/baseManagement/v1/limscrettmpms/queryLimsCretTmpMPage',obj,{individualType: 'json'}).then(res => {
        if (res.code == 0 || res.code == 200) {
          this.table.list2 = res.data.list;
          this.table.list2.forEach(item =>{
            item.validFlag1 = item.validFlag == 0 ? '无效' : item.validFlag == 1 ? '有效' : ''
            item.isSon1 = item.isSon == 0 ? '否' : item.isSon == 1 ? '是' : ''
            item.isMerge1 = item.isMerge == 0 ? '否' : item.isMerge == 1 ? '是' : ''
            item.cretImg = JSON.parse(item.cretImg) 
            item.cretImg1 = item.cretImg.oldFileName ? item.cretImg.oldFileName : ''
          })
          this.page2.totalPage = res.data.total;
        }else{
          this.$message.error(res.message)
        }
        this.dataLoading2 = false;
      }).catch(e => {
        this.dataLoading2 = false;
        this.$message.error(e.message)
      });
    },
    downloadFile (index, objId, objFileName, oldFileName, objType) {
      let obj = {
        objId: objId,
        objName: objType,
        fileName: objFileName//文件新名字
      }
      let fileRow = {}
      this.axios.post('pass/baseManagement/v1/limslrcfilesaves/queryListLrcFileSave', obj, {individualType: 'json'}).then(res => {
        if (res.code == 0 || res.code == 200) {
          fileRow = res.data[0]
          this.axios.get('pass/baseManagement/v1/file/download/'+ fileRow.fileName ,{responseType: 'blob'},{headers: {'content-type': 'application/x-www-form-urlencoded'}}).then(res => {
            let blob = new Blob([res]);
            let fileName = oldFileName;
            let elink = document.createElement('a');
            elink.download = fileName;
            elink.style.display = 'none';
            elink.target = "_blank";
            elink.href = URL.createObjectURL(blob);
            document.body.appendChild(elink);
            elink.click();
            URL.revokeObjectURL(elink.href); // 释放URL对象
            document.body.removeChild(elink);
        })  
          // this.download(this.action_prod + fileRow.fileUrl, 'download.txt', 'text/plain', fileRow.oldFileName);
        } else {
          this.$message.error(res.message)
        }
      }).catch(err =>{
        this.$message.error(err.message)
      })
    },
    imgPreView (index,objId, objFileName, objType) {
       let obj = {
        objId: objId,
        objName: objType,
        fileName: objFileName
      }
      let fileRow = {}
      this.axios.post('pass/baseManagement/v1/limslrcfilesaves/queryListLrcFileSave', obj, {individualType: 'json'}).then(res => {
        if (res.code == 0 || res.code == 200) {
          console.log(this.action_prod,'this.action_prod');
          fileRow = res.data[0]
          var form = $('<form>'); // 定义一个form表单
          form.attr('id', 'downloadform');
          form.attr('style', 'display:none');
          form.attr('target', '_blank');
          form.attr('method', 'get');
          form.attr('action', this.action_prod + fileRow.fileUrl);
          var input1 = $('<input>');
          input1.attr('type', 'hidden');
          form.append(input1);
          $('body').append(form); // 将表单放置在web中
          form.submit(); // 表单提交
          $('#downloadform').remove();
        }else{
          this.$message.error(res.message)
        }
      }).catch(err =>{
        this.$message.error(err.message)
      })
      },
    tableRowClassName ({ row, column, rowIndex, columnIndex}) {
      if (columnIndex === 7) {
      if (row.validFlag == '0') {
        return 'error-row';
      }
      return '';
      }
    },
    tableRowClassName2 ({row, column, rowIndex, columnIndex}) {
      if (columnIndex === 18) {
      if (row.validFlag !== '1') {
        return 'error-row';
      }
      return '';
      }
    },
    tableHeaderCellStyle () {
      return 'color: rgb(255,255,255);border-bottom: 1px solid #DCDFE7;'
    }
  }
}
</script>
<style  scoped>
</style>
