<!-- 物品管理 -->
<template>
  <div class="resource">
    <div class="zy-head-search">
      <span>物品类别</span>
      <el-select v-model="search.stuffTypeName" clearable filterable collapse-tags size="small"
        style="width:200px;margin-right: 10px;" placeholder="请选择物品类别">
        <el-option v-for="(item, index) in stuffTypeNameList" :key="index" :label="item.baseName" :value="item.baseName">
        </el-option>
      </el-select>
      <span>物品名称</span>
      <el-input v-model="search.stuffName" size="small" placeholder="请输入物品名称" style="width: 200px"></el-input>
      <!-- <span>时间</span>
        <el-date-picker
          v-model="search.time"
          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-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>
    </div>
    <!-- 物品信息表表头 -->
    <div class="zy-title-div">
      <div class="zy-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-circle-close" type="danger" size="mini" @click="deleteData">停用</el-button>
        <el-button icon="el-icon-check" type="goon" size="mini" @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="height_top" highlight-current-row
        @selection-change="handleSelectionChange" :data="table.list" :icore-filter-flag="icoreFilterFlag"
        :header-cell-style="tableHeaderCellStyle" :summary-method="getSummaries" show-summary
        @row-click="getAllListByEmpNo" :cell-class-name="tableRowClassName"
        :exchangeFilterMap="{ 'validFlag': { '0': '已停用', '1': '已启用' }, }">
        <el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>
        <el-table-column type="selection" width="55" fixed="left" align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="stuffNo" label="物品编码"
          align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="stuffNoUser" label="物品批号 "
          align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="stuffName" label="物品名称 "
          align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="stuffSpec" label="规格说明"
          align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="stuffTypeName" label="物品类别"
          align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="stuffUnit" label="计量单位"
          align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="stkAlarm" label="库存预警"
          align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="unitPrice" label="标准单价（元）"
          align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="totalStuffQty" label="库存数量"
          align="center"></el-table-column>
          <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="memo" label="备注"
          align="center"></el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="validFlag" label="数据状态" align="center">
          <template slot-scope="scope">
            <span v-if="scope.row.validFlag == 1">已启用</span>
            <span v-else-if="scope.row.validFlag == 0">已停用</span>
          </template>
        </el-table-column>
        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" 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="120px" 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="zy-foot-page">
      <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>
    <br>
    <!-- 物品库存信息 -->
    <div style="position: absolute;right:23px;margin-top:7px;z-index: 999;" v-if="activeName === 'first'"></div>
    <!-- 物品入库信息 -->
    <div style="position: absolute;right:23px;margin-top: 7px;z-index: 999;" v-if="activeName === 'second'"></div>
    <!-- 物品出库信息 -->
    <div style="position: absolute;right:23px;margin-top: 7px;z-index: 999;" v-if="activeName === 'third'"></div>
    <!-- 标准液制配信息 -->
    <div style="position: absolute;right:23px;margin-top: 7px;z-index: 999;" v-if="activeName === 'fourth'"></div>
    <!-- 标准液标定信息 -->
    <div style="position: absolute;right:23px;margin-top: 7px;z-index: 999;" v-if="activeName === 'fifth'"></div>
    <!-- tabs切栏 -->
    <div>
      <el-tabs v-model="activeName" type="card">
        <el-tab-pane label="物品库存信息" name="first">
          <div class="zy-title-div">
            <div class="zy-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-circle-close" type="danger" size="mini" @click="deleteData2">停用</el-button>
              <el-button icon="el-icon-check" type="goon" size="mini" @click="recoverData2">启用</el-button>
              <el-button icon="el-icon-circle-plus-outline" type="goon" size="mini" @click="storeStuff">入库</el-button>
              <el-button icon="el-icon-circle-plus-outline" type="goon" size="mini" @click="outbound">出库</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="height_bot" highlight-current-row
              @selection-change="handleSelectionChange2" :data="table.list2" :icore-filter-flag="icoreFilterFlag"
              :header-cell-style="tableHeaderCellStyle" :cell-class-name="tableRowClassName2" @row-click="getRowCheck"
              :exchangeFilterMap="{ 'validFlag': { '0': '已停用', '1': '已启用' },'state':{'0':'未验收','1':'已验收'} }"
              :summary-method="getSummaries3" show-summary>
              <el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>
              <el-table-column type="selection" width="55" fixed="left" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="validFlag" label="数据状态" align="center">
                <template slot-scope="scope">
                  <span v-if="scope.row.validFlag == 1">已启用</span>
                  <span v-else-if="scope.row.validFlag == 0">已停用</span>
                </template>
              </el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="stkId" label="记录编号"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="stuffNo" label="物品编码"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="stuffName" label="物品名称"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="stuffNoUser" label="标样编号"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="strNo" label="库房名称"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="stuffUnit" label="计量单位"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="stuffQty" label="库存数量"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="strLoc" label="存放位置"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="merchName" label="生产厂家"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="certNum" label="证书数量"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="startDate" label="生产日期"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="endDate" label="有效期至"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" 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="120px" 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-column sortable :show-overflow-tooltip="true" min-width="100px" prop="memo" label="备注"
                align="center"></el-table-column>
            </el-table>
          </div>
          <!-- <div class="zy-foot-page">
        <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> -->
        </el-tab-pane>
        <el-tab-pane label="物品入库信息" name="second">
          <div class="zy-title-div">
            <div class="zy-title-name">
              <img style="width: 25px; height: 25px" src='../../../../assets/img/imgScreen/logo.png' />
              物品入库表
            </div>
            <div>
              <el-form :inline='true'>
                <!-- <el-date-picker
            v-model="search.time"
            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-button icon="el-icon-circle-plus-outline" type="goon" size="mini" @click="getDataList31">刷新</el-button> -->
                <el-button icon="el-icon-circle-plus-outline" type="goon" size="mini" @click="addData3">新增</el-button>
                <el-button icon="el-icon-check" type="goon" size="mini" @click="putIn">入库</el-button>
                <el-button icon="el-icon-edit" type="goon" size="mini" @click="modifyData3">修改</el-button>
                <el-button icon="el-icon-circle-close" type="danger" size="mini" @click="deleteData3">停用</el-button>
                <el-button icon="el-icon-check" type="goon" size="mini" @click="recoverData3">启用</el-button>
              </el-form>
            </div>
          </div>
          <!-- 物品入库表表格 -->
          <div class="common-table-div" style="margin-bottom:0;margin-top:0">
            <el-table v-loading="dataLoading3" ref="dataTable3" border :height="height_bot" highlight-current-row 
              @selection-change="handleSelectionChange3" :data="table.list3" :icore-filter-flag="icoreFilterFlag"
              :header-cell-style="tableHeaderCellStyle" :cell-class-name="tableRowClassName3" @row-click="getRowCheck2"
              :exchangeFilterMap="{ 'validFlag': { '0': '已停用', '1': '已启用' },'state':{'0':'未验收','1':'已验收'} }" show-summary :summary-method="getSummaries1">
              <el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>
              <el-table-column type="selection" width="55" fixed="left" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="validFlag" label="数据状态" align="center">
                <template slot-scope="scope">
                  <span v-if="scope.row.validFlag == 1">已启用</span>
                  <span v-else-if="scope.row.validFlag == 0">已停用</span>
                </template>
              </el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="state" label="验收状态" align="center">
                <template slot-scope="scope">
                  <span v-if="scope.row.state == '1'">已验收</span>
                  <span v-else-if="scope.row.state == '0'">未验收</span>
                </template>
              </el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="130px" prop="inId" label="入库记录号"
                align="center"></el-table-column>
              <!-- <el-table-column sortable width="100px" prop="hetongName" label="入库单号" align="center"></el-table-column> -->
              <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="strNo" label="库房名称"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="stuffNo" label="物品编码"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="stuffName" label="物品名称"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="stuffUnit" label="计量单位"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="instkType" label="入库类型"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="110px" prop="qtyInstk" label="入库数量"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="instkApp" label="入库申请人"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="instkHnd" label="入库经办人"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="instkTime" label="入库时间"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="endDate" label="有效期至"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="strLoc" label="存放位置"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="130px" prop="certNum" label="证书数量"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="130px" prop="merchName" label="供应商"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="130px" prop="stkId" label="库存记录号"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="memo" label="备注"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" 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="120px" 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="zy-foot-page">
        <el-pagination
        v-loading="dataLoading3"
        @size-change="pageSizeChange3"
        @current-change="pageCurrentChange3"
        :current-page="page3.pageNum"
        :page-sizes="[10, 20, 50, 100, 200]"
        :page-size="page3.pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="page3.totalPage" background>
        </el-pagination>
    </div> -->
        </el-tab-pane>
        <el-tab-pane label="物品出库信息" name="third">
          <div class="zy-title-div">
            <div class="zy-title-name">
              <img style="width: 25px; height: 25px" src='../../../../assets/img/imgScreen/logo.png' />
              物品出库表
            </div>
            <div>
              <el-form :inline='true'>
                <!-- <el-date-picker
            v-model="search1.time"
            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-button icon="el-icon-circle-plus-outline" type="goon" size="mini" @click="getDataList41">刷新</el-button> -->
                <el-button icon="el-icon-circle-plus-outline" type="goon" size="mini" @click="addData4">申请</el-button>
                <el-button icon="el-icon-circle-plus-outline" type="goon" size="mini"
                  @click="confirmData">审批</el-button>
                <el-button icon="el-icon-circle-plus-outline" type="goon" size="mini" @click="grantData">发放</el-button>
                <el-button icon="el-icon-edit" type="goon" size="mini" @click="modifyData4">修改</el-button>
                <el-button icon="el-icon-check" type="goon" size="mini" @click="recoverData4">启用</el-button>
                <el-button icon="el-icon-circle-close" type="danger" size="mini" @click="deleteData4">停用</el-button>
              </el-form>
            </div>
          </div>
          <!-- 物品出库表表格 -->
          <div class="common-table-div" style="margin-bottom:0;margin-top:0">
            <el-table v-loading="dataLoading4" ref="dataTable4" border :height="height_bot" highlight-current-row
              @selection-change="handleSelectionChange4" :data="table.list4" :icore-filter-flag="icoreFilterFlag"
              :header-cell-style="tableHeaderCellStyle" :cell-class-name="tableRowClassName4" @row-click="getRowCheck3" show-summary :summary-method="getSummaries2"
              :exchangeFilterMap="{ 'validFlag': { '0': '已停用', '1': '已启用' },'state':{'0':'未验收','1':'已验收'} }">
              <el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>
              <el-table-column type="selection" width="55" fixed="left" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="validFlag" label="数据状态" align="center">
                <template slot-scope="scope">
                  <span v-if="scope.row.validFlag == '0'">无效</span>
                  <span v-else-if="scope.row.validFlag == '1'&&scope.row.state == '1'">已审批</span>
                  <span v-else-if="scope.row.validFlag == '1'&&scope.row.state == '0'">待审批</span>
                  <span v-else-if="scope.row.validFlag == '1'&&scope.row.state == '2'">已发放</span>
                </template>
              </el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="130px" prop="outId" label="出库记录号"
                align="center"></el-table-column>
              <!-- <el-table-column sortable width="100px" prop="hetongName" label="出库单号" align="center"></el-table-column> -->
              <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="stuffNo" label="物品编码"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="strNo" label="库房名称"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="stuffName" label="物品名称"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="stuffUnit" label="计量单位"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="outstkType" label="出库类型"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="qtyOutstk" label="出库数量"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="merchName" label="供应商"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="outstkApp" label="出库申请人"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="outstkHnd" label="出库审批人"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="outstkTime" label="出库时间"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="memo1" label="出库发放人"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="memo2" label="出库发放时间"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="130px" prop="stkId" label="库存记录号"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="validFlag" label="是否有效" align="center">
                <template slot-scope="scope">
                  <span v-if="scope.row.validFlag == '1'">已启用</span>
                  <span v-else-if="scope.row.validFlag == '0'">已停用</span>
                </template>
              </el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" 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="120px" 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-column sortable :show-overflow-tooltip="true" min-width="100px" prop="memo" label="备注"
                align="center"></el-table-column>
            </el-table>
          </div>
          <!-- <div class="zy-foot-page">
        <el-pagination
        v-loading="dataLoading4"
        @size-change="pageSizeChange4"
        @current-change="pageCurrentChange4"
        :current-page="page4.pageNum"
        :page-sizes="[10, 20, 50, 100, 200]"
        :page-size="page4.pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="page4.totalPage" background>
        </el-pagination>
    </div> -->
        </el-tab-pane>
        <!--        <el-tab-pane label="标准液制配信息" name="fourth">-->
        <!--     <div class="zy-title-div">-->
        <!--      <div class="zy-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="addData5">新增</el-button>-->
        <!--      <el-button icon="el-icon-edit" type="goon" size="mini" @click="modifyData5">修改</el-button>-->
        <!--      <el-button icon="el-icon-circle-close" type="danger" size="mini" @click="deleteData5">停用</el-button>-->
        <!--       <el-button icon="el-icon-check" type="goon" size="mini" @click="recoverData5">启用</el-button>-->

        <!--      </div>-->
        <!--    </div>-->
        <!--      &lt;!&ndash; 标准液制配表表格 &ndash;&gt;-->
        <!--      <div class="common-table-div" style="margin-bottom:0;margin-top:0">-->
        <!--        <el-table-->
        <!--        v-loading="dataLoading5"-->
        <!--        ref="dataTable5" border-->
        <!--        :height="height_bot" highlight-current-row-->
        <!--        @selection-change="handleSelectionChange5"-->
        <!--        :data="table.list5"-->
        <!--        :icore-filter-flag="icoreFilterFlag"-->
        <!--        :header-cell-style="tableHeaderCellStyle"-->
        <!--        :cell-class-name="tableRowClassName5"-->
        <!--        @row-click="getRowCheck4"-->
        <!--        :exchangeFilterMap="{'validFlag':{'0':'已停用','1':'已启用'},-->
        <!--        'warnFlag':{'0':'否','1':'是'},}">-->
        <!--        <el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>-->
        <!--        <el-table-column type="selection" width="55" fixed="left" align="center"></el-table-column>-->
        <!--        <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="sfId" label="制配编码" align="center"></el-table-column>-->
        <!--        <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="stuffNo" label="物品编码" align="center"></el-table-column>-->
        <!--        <el-table-column sortable :show-overflow-tooltip="true" min-width="130px" prop="stuffName" label="物品名称" align="center"></el-table-column>-->
        <!--        &lt;!&ndash; <el-table-column sortable width="140px" prop="stuffNoUser" label="物品编号" align="center"></el-table-column> &ndash;&gt;-->
        <!--        <el-table-column sortable :show-overflow-tooltip="true" min-width="130px" prop="stuffSpec" label="规格说明" align="center"></el-table-column>-->
        <!--        <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="fabrTime" label="制配时间" align="center"></el-table-column>-->
        <!--        <el-table-column sortable :show-overflow-tooltip="true" min-width="110px" prop="fabrPpm" label="制配浓度(%)" align="center"></el-table-column>-->
        <!--        <el-table-column sortable :show-overflow-tooltip="true" min-width="110px" prop="fabrNum" label="制配数量(ml)" align="center"></el-table-column>-->
        <!--        <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="fabrMethod" label="制配方法" align="center"></el-table-column>-->
        <!--        <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="fabrTime" label="制品时间" align="center"></el-table-column>-->
        <!--        <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="warnFlag" label="到期提醒" align="center">-->
        <!--          <template slot-scope="scope">-->
        <!--              <span v-if="scope.row.warnFlag == 1" >是</span>-->
        <!--              <span v-else-if="scope.row.warnFlag == 0">否</span>-->
        <!--          </template>-->
        <!--        </el-table-column>-->
        <!--          <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" label="数据状态" align="center">-->
        <!--           <template slot-scope="scope">-->
        <!--              <span v-if="scope.row.validFlag == 1" >已启用</span>-->
        <!--              <span v-else-if="scope.row.validFlag == 0">已停用</span>-->
        <!--          </template>-->
        <!--        </el-table-column>-->
        <!--        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" 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="120px" 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-column sortable :show-overflow-tooltip="true" min-width="100px" prop="memo" label="备注" align="center"></el-table-column>-->
        <!--        </el-table>-->
        <!--      </div>-->
        <!--       &lt;!&ndash; <div class="zy-foot-page">-->
        <!--        <el-pagination-->
        <!--        v-loading="dataLoading5"-->
        <!--        @size-change="pageSizeChange5"-->
        <!--        @current-change="pageCurrentChange5"-->
        <!--        :current-page="page5.pageNum"-->
        <!--        :page-sizes="[10, 20, 50, 100, 200]"-->
        <!--        :page-size="page5.pageSize"-->
        <!--        layout="total, sizes, prev, pager, next, jumper"-->
        <!--        :total="page5.totalPage" background>-->
        <!--        </el-pagination>-->
        <!--    </div> &ndash;&gt;-->
        <!--       </el-tab-pane>-->
        <!--       <el-tab-pane label="标准液标定信息" name="fifth">-->
        <!--          <div class="zy-title-div">-->
        <!--      <div class="zy-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="addData6">新增</el-button>-->
        <!--      <el-button icon="el-icon-edit" type="goon" size="mini" @click="modifyData6">修改</el-button>-->
        <!--      <el-button icon="el-icon-circle-close" type="danger" size="mini" @click="deleteData6">停用</el-button>-->
        <!--       <el-button icon="el-icon-check" type="goon" size="mini" @click="recoverData6">启用</el-button>-->
        <!--      </div>-->
        <!--    </div>-->
        <!--    &lt;!&ndash; 标准液标定表表格 &ndash;&gt;-->
        <!--    <div class="common-table-div" style="margin-bottom:0;margin-top:0">-->
        <!--        <el-table-->
        <!--        v-loading="dataLoading6"-->
        <!--        ref="dataTable6" border-->
        <!--        :height="height_bot" highlight-current-row-->
        <!--        @selection-change="handleSelectionChange6"-->
        <!--        :data="table.list6"-->
        <!--        :icore-filter-flag="icoreFilterFlag"-->
        <!--        :header-cell-style="tableHeaderCellStyle"-->
        <!--        :cell-class-name="tableRowClassName6"-->
        <!--        @row-click="getRowCheck5"-->
        <!--        :exchangeFilterMap="{'validFlag':{'0':'已停用','1':'已启用'},}">-->
        <!--        <el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>-->
        <!--        <el-table-column type="selection" width="55" fixed="left" align="center"></el-table-column>-->
        <!--         <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="iId" label="标定编号" align="center"></el-table-column>-->
        <!--         <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="stuffNo" label="物品编码" align="center"></el-table-column>-->
        <!--         <el-table-column sortable :show-overflow-tooltip="true" min-width="130px" prop="stuffName" label="物品名称" align="center"></el-table-column>-->
        <!--         &lt;!&ndash; <el-table-column sortable width="140px" prop="stuffNoUser" label="物品编号" align="center"></el-table-column> &ndash;&gt;-->
        <!--         &lt;!&ndash; <el-table-column sortable width="140px" prop="hetongNo" label="" align="center"></el-table-column> &ndash;&gt;-->
        <!--        <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="calibrValue" label="标定值" align="center"></el-table-column>-->
        <!--        <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="calibrMethod" label="标定方法" align="center"></el-table-column>-->
        <!--        <el-table-column sortable :show-overflow-tooltip="true" min-width="130px" prop="calibrTime" label="标定日期" align="center"></el-table-column>-->
        <!--        <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="calibrMan" label="标定人" align="center"></el-table-column>-->
        <!--        <el-table-column sortable :show-overflow-tooltip="true" min-width="130px" prop="failureDate" label="失效日期" align="center"></el-table-column>-->
        <!--        <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="memo" label="备注" align="center"></el-table-column>-->
        <!--          <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" label="数据状态" align="center">-->
        <!--           <template slot-scope="scope">-->
        <!--              <span v-if="scope.row.validFlag == 1" >已启用</span>-->
        <!--              <span v-else-if="scope.row.validFlag == 0">已停用</span>-->
        <!--          </template>-->
        <!--        </el-table-column>-->
        <!--        <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" 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="120px" 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-column sortable :show-overflow-tooltip="true" min-width="100px" prop="memo" label="备注" align="center"></el-table-column>-->
        <!--        </el-table>-->
        <!--      </div>-->
        <!--       &lt;!&ndash; <div class="zy-foot-page">-->
        <!--        <el-pagination-->
        <!--        v-loading="dataLoading6"-->
        <!--        @size-change="pageSizeChange6"-->
        <!--        @current-change="pageCurrentChange6"-->
        <!--        :current-page="page6.pageNum"-->
        <!--        :page-sizes="[10, 20, 50, 100, 200]"-->
        <!--        :page-size="page6.pageSize"-->
        <!--        layout="total, sizes, prev, pager, next, jumper"-->
        <!--        :total="page6.totalPage" background>-->
        <!--        </el-pagination>-->
        <!--    </div> &ndash;&gt;-->
        <!--       </el-tab-pane>-->
        <el-tab-pane label="标样信息管理" name="seven">
          <div class="zy-title-div">
            <div class="zy-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="addData7">新增</el-button>
              <el-button icon="el-icon-edit" type="goon" size="mini" @click="modifyData7">修改</el-button>
              <el-button icon="el-icon-circle-close" type="danger" size="mini" @click="deleteData7">停用</el-button>
              <el-button icon="el-icon-check" type="goon" size="mini" @click="recoverData7">启用</el-button>
              <el-button icon="el-icon-edit" type="goon" size="mini" @click="batchUpdate7">保存</el-button>
              <el-button icon="el-icon-check" type="goon" size="mini" :loading='buttonLoading'
                @click="confirmDataIn">确认</el-button>
              <el-button icon="el-icon-back" type="danger" size="mini" :loading='buttonLoading'
                @click="confirmDataFo">取消确认</el-button>
              <el-upload class="upload" action="" style="width: 40px; display: inline-block" :multiple="false"
                :show-file-list="false" accept="" :http-request="httpRequest">
                <el-button icon="el-icon-check" type="goon" size="mini" :loading='buttonLoading'>文件上传</el-button>
              </el-upload>
            </div>
          </div>
          <!-- 标样信息管理表格 -->
          <div class="common-table-div" style="margin-bottom:0;margin-top:0">
            <el-table v-loading="dataLoading7" ref="dataTable7" border :height="height_bot" highlight-current-row
              @selection-change="handleSelectionChange7" :data="table.list7" :icore-filter-flag="icoreFilterFlag"
              :header-cell-style="tableHeaderCellStyle" :cell-class-name="tableRowClassName7" @row-click="getRowCheck7"
              :exchangeFilterMap="{ 'validFlag': { '0': '已停用', '1': '已启用' }, }">
              <el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>
              <el-table-column type="selection" width="55" fixed="left" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="iId" label="编号"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="stuffNo" label="物品编码"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="130px" prop="stuffName" label="物品名称"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="anlyItemNo" label="分析项目编号"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="anlyItemName"
                label="分析项目名称" align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="130px" prop="stdValue" label="标准值"
                align="center">
                <template slot-scope="{ row }">
                  <el-input v-model="row.stdValue" :disabled="row.tenantNo == 1" size="small" style="width: 100%">
                  </el-input>
                </template>
              </el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="memo1" label="下载/预览"
                align="center"><template slot-scope="scope">
                  <el-tooltip content="下载" placement="bottom" effect="light">
                    <el-button :disabled="!scope.row.memo1" type="goon" size="mini" icon="el-icon-download" circle
                      @click="
                        imgPreView(
                          scope.row,
                          scope.row.memo1
                        )
                        ">
                    </el-button>
                  </el-tooltip>
                  <el-tooltip content="预览" placement="bottom" effect="light">
                    <el-button :disabled='!scope.row.memo1' type="warning" size="mini" icon="el-icon-view" circle
                      @click="imgPreViewY(scope.row, scope.row.memo1)">
                    </el-button>
                  </el-tooltip>
                </template>
              </el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="130px" prop="memo1" label="文件名称"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="130px" prop="itemTypeName" label="项目类型"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="130px" prop="dspOrder" label="显示顺序"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="130px" prop="dataTypeName" label="数据类型"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="130px" prop="unitName" label="项目数值单位"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" label="确认状态" align="center">
                <template slot-scope="scope">
                  <span v-if="scope.row.tenantNo == 1">已确认</span>
                  <span v-else>未确认</span>
                </template>
              </el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="validFlag" label="数据状态" align="center">
                <template slot-scope="scope">
                  <span v-if="scope.row.validFlag == 1">已启用</span>
                  <span v-else-if="scope.row.validFlag == 0">已停用</span>
                </template>
              </el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" 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="120px" 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-column sortable :show-overflow-tooltip="true" min-width="100px" prop="memo2" label="确认人"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="memo3" label="确认时间"
                align="center"></el-table-column>
              <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="memo" label="备注"
                align="center"></el-table-column>
            </el-table>
          </div>
          <!-- <div class="zy-foot-page">
             <el-pagination
             v-loading="dataLoading6"
             @size-change="pageSizeChange6"
             @current-change="pageCurrentChange6"
             :current-page="page6.pageNum"
             :page-sizes="[10, 20, 50, 100, 200]"
             :page-size="page6.pageSize"
             layout="total, sizes, prev, pager, next, jumper"
             :total="page6.totalPage" background>
             </el-pagination>
         </div> -->
        </el-tab-pane>
      </el-tabs>
    </div>
    <div>
      <div id="docx">
        <div ref="file"></div>
      </div>
      <div id="xlsx">
        <el-tabs v-model="activeName1" v-if="DialogVisible" type="border-card">
          <el-tab-pane v-for="(item, index) in excelSheet" :key="index" :label="item.name" :name="item.name">
            <div class="table" v-html="item.innerHTML"></div>
          </el-tab-pane>
        </el-tabs>
      </div>
    </div>
    <!-- 新增仪器信息弹窗 -->
    <div is="alertComponents" :showFlag="showFlag" :Params="Params" @refresh='refresh(1)'></div>
    <!-- 新增物品入库信息弹窗 -->
    <div is="alertComponents2" :showFlag2="showFlag2" :Params="Params" :Params2="Params2" @refresh='refresh(2)'></div>
    <div is="alertComponents3" :showFlag3="showFlag3" :Params="Params" :Params3="Params3" :opFlag="opFlag"
      @refresh='refresh(3)' @refresh2="refresh(2)"></div>
    <div is="alertComponents31" :showFlag31="showFlag31" :Params="Params" :Params3="Params3" :opFlag="opFlag"
      @refresh='refresh(3)' @refresh2="refresh(2)"></div>
    <div is="alertComponents4" :showFlag4="showFlag4" :Params="Params" :Params4="Params4" @refresh='refresh(4)'
      @refresh2="refresh(2)"></div>
    <div is="alertComponents5" :showFlag5="showFlag5" :Params="Params" :Params5="Params5" @refresh='refresh(5)'></div>
    <div is="alertComponents6" :showFlag6="showFlag6" :Params="Params" :Params6="Params6" @refresh='refresh(6)'></div>
    <div is="alertComponents7" :showFlag7="showFlag7" :Params="Params" :Params7="Params7" @refresh='refresh(7)'></div>
    <div is="alertComponents8" :showFlag8="showFlag8" :Params="Params" :Params8="Params8" @refresh='myRefresh'
      @refresh2="refresh(2)"></div>
    <div is="alertComponents9" :showFlag9="showFlag9" :Params9="Params9" @refresh='refresh(7)'></div>
  </div>
</template>
<script>
import {
  getCookie,
  formatDate
} from '@/utils/util.js';
import {
  cookieUserId,
  cookieUserName
} from '@/config/config.js';
import alertComponents from './alertComponents';
import alertComponents2 from './alertComponents2';
import alertComponents3 from './alertComponents3';
import alertComponents31 from './alertComponents3-1';
import alertComponents4 from './alertComponents4';
import alertComponents5 from './alertComponents5';
import alertComponents6 from './alertComponents6';
import alertComponents7 from './alertComponents7';
import alertComponents8 from './alertComponents8';
import alertComponents9 from './alertComponents9';
import pdf from 'vue-pdf'
import XLSX from 'xlsx';
let userName = getCookie(cookieUserName);
let userId = getCookie(cookieUserId);
export default {
  components: { alertComponents, alertComponents2, alertComponents3, alertComponents31, alertComponents4, alertComponents5, alertComponents6, alertComponents7, alertComponents8, alertComponents9 },
  data() {
    return {
      table: {
        list: [],
        list2: [],
        list3: [],
        list4: [],
        list5: [],
        list6: [],
        list7: []
      },
      buttonLoading: false,
      icoreFilterFlag: true,
      dataLoading: false,
      dataLoading2: false,
      dataLoading3: false,
      dataLoading4: false,
      dataLoading5: false,
      dataLoading6: false,
      dataLoading7: false,
      DialogVisible: false,
      page: {
        pageSize: 50,
        pageNum: 1,
        totalPage: 0
      },
      page2: {
        pageSize: 50,
        pageNum: 1,
        totalPage: 0
      },
      page3: {
        pageSize: 50,
        pageNum: 1,
        totalPage: 0
      },
      page4: {
        pageSize: 50,
        pageNum: 1,
        totalPage: 0
      },
      page5: {
        pageSize: 50,
        pageNum: 1,
        totalPage: 0
      },
      page6: {
        pageSize: 50,
        pageNum: 1,
        totalPage: 0
      },
      page7: {
        pageSize: 50,
        pageNum: 1,
        totalPage: 0
      },
      showFlag: false,
      Params: {},
      showFlag2: false,
      Params2: {},
      showFlag3: false,
      showFlag31: false,
      Params3: {},
      opFlag: '',
      showFlag4: false,
      Params4: {},
      showFlag5: false,
      Params5: {},
      showFlag6: false,
      showFlag7: false,
      showFlag8: false,
      showFlag9: false,
      Params6: {},
      Params7: {},
      Params8: {},
      Params9: {},
      stuffNo: '',
      multipleSelection3: [],
      multipleSelection4: [],
      multipleSelection5: [],
      multipleSelection6: [],
      multipleSelection7: [],
      multipleSelection8: [],
      multipleSelectionSeven: [],
      stuffTypeNameList: [],//物品类别
      tableClick: {},
      search: {
        stuffName: '',
        stuffTypeName: '',
        time: []
      },
      search1: {
        stuffName: '',
        stuffTypeName: '',
        time1: []
      },
      height_top: 0,
      height_bot: 0,
      activeName: 'first',
    }
  },
  created() {
    this.height_top = window.innerHeight / 2 - 130 < 250 ? 250 : window.innerHeight / 2 - 110;
    this.height_bot = window.innerHeight / 2 - 130 < 250 ? 250 : window.innerHeight / 2 - 110;
    let timestamp = new Date().getTime() - (7 * 24 * 60 * 60 * 1000) // 默认前一周
    this.search.time = [this.getYNM(new Date(timestamp)) + ' 00:00:00', this.getYNM(new Date()) + ' 23:59:59']
  },
  mounted() {
    this.getDataList();
    this.addScreen();
    this.addScreen2();
    this.addScreen3();
    this.addScreen4();
    this.addScreen5();
    this.addScreen6();
    this.getStuffTypeNameList()
  },
  methods: {
    getStuffTypeNameList() {
      this.axios.post('pass/baseManagement/v1/limsbaseinfos/queryBaseInfoByBaseCode', { validFlag: 1, baseCode: 4813 }, { individualType: 'json' })
        .then(res => {
          res.data.forEach(item => {
            if (item.baseCode !== '481311') { // 只查看非标准液类型的物料,标准液物料仅限在标准液界面查看
              this.stuffTypeNameList.push(item)
            }
          })
        })
    },
    // qtyOutstk
     getSummaries3(param) {
      let unit=null;
            const { columns, data } = param;
            const sums = [];
            columns.forEach((column, index) => {
              
                if (index === 0) {
                    sums[index] = '合计';
                    return;
                }
                if(column.property==='stuffUnit') {
                  console.log('unit column ',column)
                  console.log('unit data ',data)
                  unit=data[0].stuffUnit;
                }
                if (column.property && column.property === 'stuffQty') {
                    console.log('getSummaries stuffQty column:', column)
                    const values = data.map(item => {
                        const num = Number(item[column.property]);
                        return isNaN(num) ? NaN : num;
                    });
                    console.log('getSummaries  values:', values)
                    if (!values.every(value => {
                      console.log('getSummaries value:',value)
                      isNaN(value)
                    })) {
                        const total = values.reduce((prev, curr) => {
                            return isNaN(curr) ? prev : prev + curr; 
                        }, 0);
                        sums[index] = total + unit;
                    } else {
                        sums[index] = 'N/A'; 
                    }
                } else {
                    sums[index] = '';
                }
            });
            return sums;
        },
    // qtyOutstk
     getSummaries2(param) {
      let unit=null;
            const { columns, data } = param;
            const sums = [];
            columns.forEach((column, index) => {
              
                if (index === 0) {
                    sums[index] = '合计';
                    return;
                }
                if(column.property==='stuffUnit') {
                  console.log('unit column ',column)
                  console.log('unit data ',data)
                  unit=data[0].stuffUnit;
                }
                if (column.property && column.property === 'qtyOutstk') {
                    console.log('getSummaries qtyOutstk column:', column)
                    const values = data.map(item => {
                        const num = Number(item[column.property]);
                        return isNaN(num) ? NaN : num;
                    });
                    console.log('getSummaries  values:', values)
                    if (!values.every(value => {
                      console.log('getSummaries value:',value)
                      isNaN(value)
                    })) {
                        const total = values.reduce((prev, curr) => {
                            return isNaN(curr) ? prev : prev + curr; 
                        }, 0);
                        sums[index] = total + unit;
                    } else {
                        sums[index] = 'N/A'; 
                    }
                } else {
                    sums[index] = '';
                }
            });
            return sums;
        },
     getSummaries1(param) {
      let unit=null;
            const { columns, data } = param;
            const sums = [];
            columns.forEach((column, index) => {
              
                if (index === 0) {
                    sums[index] = '合计';
                    return;
                }
                if(column.property==='stuffUnit') {
                  console.log('unit column ',column)
                  console.log('unit data ',data)
                  unit=data[0].stuffUnit;
                }
                if (column.property && column.property === 'qtyInstk') {
                    console.log('getSummaries qtyInstk column:', column)
                    const values = data.map(item => {
                        const num = Number(item[column.property]);
                        return isNaN(num) ? NaN : num;
                    });
                    console.log('getSummaries  values:', values)
                    if (!values.every(value => {
                      console.log('getSummaries value:',value)
                      isNaN(value)
                    })) {
                        const total = values.reduce((prev, curr) => {
                            return isNaN(curr) ? prev : prev + curr; 
                        }, 0);
                        sums[index] = total + unit;
                    } else {
                        sums[index] = 'N/A'; 
                    }
                } else {
                    sums[index] = '';
                }
            });
            return sums;
        },
    getSummaries(param) {
      // totalStuffQty
      const { columns, data } = param;
      const sums = [];
      const unitGroups = {}; 
      data.forEach(item => {
        const unit = item.stuffUnit; 
        const qty = Number(item.totalStuffQty); 
        if (!isNaN(qty) && unit) { 
          if (unitGroups[unit]) {
            unitGroups[unit] += qty; 
          } else {
            unitGroups[unit] = qty;
          }
        }
      });
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = '合计';
          return;
        }
        if (index === 1) {
          sums[index] = data.length;
        }
        if (column.property === 'totalStuffQty') {
          const unitSummary = Object.entries(unitGroups).map(([unit, total]) => {
            return `${total} ${unit}`; // 拼接单位和总和
          }).join(', '); // 用逗号分隔多个单位
          sums[index] = unitSummary || 'N/A'; // 无数据时显示 N/A
        } 
      });
      return sums;
    },
    // 页面刷新，重新加载表格数据
    refresh(number) {
      switch (number) {
        case 1:
          this.getDataList();
          break
        case 2:
          this.getDataList2(this.stuffNo);
          break
        case 3:
          this.getDataList3(this.stuffNo);
          break
        case 4:
          this.getDataList4(this.stuffNo);
          break
        case 5:
          this.getDataList5(this.stuffNo);
          break
        case 6:
          this.getDataList6(this.stuffNo);
          break
        case 7:
          this.getDataList7(this.stuffNo)
      }
    },
    myRefresh() {
      this.getDataList2(this.stuffNo);
      this.getDataList4(this.stuffNo);
    },
    // 物品信息表新增
    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[0]
      }
    },
    // 物品信息表删除
    deleteData() {
      if (this.multipleSelection3.length < 1) {
        this.$message.warning('请勾选您要停用的数据！')
      } else {
        this.dialogTableVisible = false;
        for (var i = 0; i < this.multipleSelection3.length; i++) {
          this.multipleSelection3[i].updateMan = userName;
          this.multipleSelection3[i].updateNo = userId
        }
        this.axios.post('pass/baseManagement/v1/limslrcstuffs/abolish', this.multipleSelection3, { individualType: 'json' }).then(res => {
          if (res.succeed) {
            this.$message.success('停用操作成功');
            this.refresh(1)
          } else {
            this.$message.error(res.message)
          }
        }).catch(e => {
          this.$message.error(e.message)
        })
      }
    },
    // 信息表恢复
    recoverData() {
      if (this.multipleSelection3.length < 1) {
        this.$message.warning('请勾选您要启用的数据！')
      } else {
        this.dialogTableVisible2 = false;
        for (var i = 0; i < this.multipleSelection3.length; i++) {
          this.multipleSelection3[i].evaMan = userName;
          this.multipleSelection3[i].evaNo = userId
        }
        this.axios.post('pass/baseManagement/v1/limslrcstuffs/recover', this.multipleSelection3, { individualType: 'json' }).then(res => {
          if (res.succeed) {
            this.$message.success('启用成功');
            this.refresh(1)
          } else {
            this.$message.error(res.message)
          }
        }).catch(e => {
          this.$message.error(e.message)
        })
      }
    },
    // 人员查询
    searchData() {
      this.dataLoading = true;
      let startTime = ''
      let endTime = ''
      if (!this.search.time) {
        this.$message.error('请选择时间范围！')
        return;
      } else {
        startTime = this.search.time[0] + ' 00:00:00'
        endTime = this.search.time[1] + ' 23:59:59'
      }
      this.page.pageNum = 1;
      this.axios.get('pass/baseManagement/v1/limslrcstuffs/queryLimsLrcStuffPage' + '?pageNum=' + this.page.pageNum +
        '&pageSize=' + this.page.pageSize + '&stuffTypeName=' + this.search.stuffTypeName + '&stuffName=' + this.search.stuffName +
        '&startTime=' + startTime + '&endTime=' + endTime + '&searchData=' + '1')
        .then(res => {
          console.log('searchData   res:',res)
          this.dataLoading = false;
          this.table.list = res.data.list;
          this.page.totalPage = res.data.total;
        }).catch(e => {
          this.dataLoading = false;
        });
    },
    // 重置
    reset() {
      this.search.stuffTypeName = '';
      this.search.stuffName = '';
      let timestamp = new Date().getTime() - 7 * 24 * 60 * 60 * 1000; // 默认前一周

      this.search.times = [
        this.getYNM(new Date(timestamp)) + " 00:00:00",
        this.getYNM(new Date()) + " 23:59:59",
      ];
      this.searchData();
    },
    // 库存
    addData2() {
      if (this.multipleSelection3.length != 1) {
        this.$message.warning('请在设备信息表中勾选您要新增的一条数据！')
      } else {
        this.showFlag2 = !this.showFlag2;
        this.Params2 = null;
        this.Params = this.multipleSelection3[0];
        console.log(this.Params)
      }
    },
    // 修改
    modifyData2() {
      if (this.multipleSelection4.length !== 1) {
        this.$message.warning('请勾选您要修改的一条数据！')
      } else {
        this.showFlag2 = !this.showFlag2;
        this.Params2 = this.multipleSelection4[0];
        this.Params = null
      }
    },
    // 停用
    deleteData2() {
      if (this.multipleSelection4.length < 1) {
        this.$message.warning('请勾选您要停用的数据！')
      } else {
        this.dialogTableVisible = false;
        for (var i = 0; i < this.multipleSelection4.length; i++) {
          this.multipleSelection4[i].updateMan = userName;
          this.multipleSelection4[i].updateNo = userId
        }
        this.axios.post('pass/baseManagement/v1/limslrcstuffstks/abolish', this.multipleSelection4, { individualType: 'json' }).then(res => {
          if (res.succeed) {
            this.$message.success('停用操作成功');
            this.refresh(2)
          } else {
            this.$message.error(res.message)
          }
        }).catch(e => {
          this.$message.error(e.message)
        })
      }
    },
    // 入库
    storeStuff() {
      if (this.multipleSelection4.length === 1) {
        this.showFlag3 = !this.showFlag3;
        this.Params3 = null;
        this.Params = this.multipleSelection4[0];
        this.opFlag = '1'
      } else {
        return this.$message.warning('请勾选一条库存信息')
      }
    },
    // 出库
    outbound() {
      if (this.multipleSelection4.length < 1) {
        this.$message.warning('请在物品库存表中勾选您要新增的一条数据！')
      } else {
        this.showFlag8 = !this.showFlag8;
        this.Params8 = null;
        this.Params = this.multipleSelection4[0];
      }
    },
    // 启用按钮
    recoverData2() {
      if (this.multipleSelection4.length < 1) {
        this.$message.warning('请勾选您要启用的数据！')
      } else {
        this.dialogTableVisible2 = false;
        for (var i = 0; i < this.multipleSelection4.length; i++) {
          this.multipleSelection4[i].evaMan = userName;
          this.multipleSelection4[i].evaNo = userId
        }
        this.axios.post('pass/baseManagement/v1/limslrcstuffstks/recover', this.multipleSelection4, { individualType: 'json' }).then(res => {
          if (res.succeed) {
            this.$message.success('启用成功');
            this.refresh(2)
          } else {
            this.$message.error(res.message)
          }
        }).catch(e => {
          this.$message.error(e.message)
        })
      }
    },
    // 入库
    addData3() {
      if (this.multipleSelection3.length != 1) {
        this.$message.warning('请在设备信息表中勾选您要新增的一条数据！')
      } else {
        this.showFlag3 = !this.showFlag3;
        this.Params3 = null;
        this.Params = this.multipleSelection3[0];
      }
    },
    putIn() {
      if (this.multipleSelection5.length < 1) {
        this.$message.warning('请勾选您要验收的数据！')
        return;
      }
      let tt = false;
      let userVilidate = false;
      this.multipleSelection5.forEach(s => {
        if (s.state == '1') {
          tt = true;
        }
        if(userName === s.createMan) {
          userVilidate = true;
        }
      })
      if(userVilidate) {
        this.$message.warning('存在数据的创建人与当前用户一致,请重新勾选！')
        return;
      }
      if (tt) {
        this.$message.warning('请勾选未验收的数据！')
        return;
      }
      this.axios.post('pass/baseManagement/v1/limslrcstuffis/putIn', this.multipleSelection5, { individualType: 'json' }).then(res => {
        if (res.succeed) {
          this.$message.success('验收成功');
          this.refresh(3)
        } else {
          this.$message.error(res.message)
        }
      }).catch(e => {
        this.$message.error(e.message)
      })
    },
    //下载文件
    imgPreView(row, fileName) {
      this.axios.get('pass/baseManagement/v1/file/download/' + fileName, { responseType: 'blob' }, { headers: { 'content-type': 'application/x-www-form-urlencoded' } }).then(res => {
        let blob = new Blob([res]);
        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);
      }).catch(e => {
        return this.$message.error(e.message)
      })
    },
    imgPreViewY(row, fileName) {
      let aaa = fileName.substr(fileName.indexOf(".") + 1);
      if (aaa == "pdf") {
        this.axios.get('pass/baseManagement/v1/file/download/' + fileName, { responseType: 'blob' }, { headers: { 'content-type': 'application/x-www-form-urlencoded' } }).then(res => {
          const binaryData = [];
          binaryData.push(res);
          this.srcUrl = window.URL.createObjectURL(new Blob(binaryData, { type: 'application/pdf' }))
          window.open(this.srcUrl, fileName);
        }).catch(e => {
          return this.$message.error(e.message)
        })
      } else if (aaa == "xlsx") {
        this.axios.get('pass/baseManagement/v1/file/download/' + fileName, { responseType: 'arraybuffer' }, { headers: { 'content-type': 'application/x-www-form-urlencoded' } }).then(res => {
          this.excelSheet = [];
          this.showFlag(false);
          let workbook = XLSX.read(new Uint8Array(res), { type: "array" });
          this.tableToHtml(workbook);
        }).catch(e => {
          return this.$message.error(e.message)
        })
      } else {
        return this.$message.error("不支持这个类型的文件展示！")
      }
    },
    tableToHtml(workbook) {
      const sheetList = workbook.SheetNames.filter(v => v.indexOf('数据源') === -1);
      this.activeName1 = sheetList[0];
      sheetList.forEach(sheet => {
        const worksheet = workbook.Sheets[sheet];
        if (worksheet) {
          const innerHTML = XLSX.utils.sheet_to_html(worksheet);
          this.excelSheet.push({
            name: sheet,
            innerHTML: innerHTML
          });
        } else {
          this.excelSheet.push({
            name: sheet,
            innerHTML: '暂无数据',
          });
        }
      });
      this.DialogVisible = true;
    },
    showFlag(docx) {
      if (docx) {
        document.getElementById("docx").style.display = "block";
        document.getElementById("xlsx").style.display = "none";
      } else {
        document.getElementById("docx").style.display = "none";
        document.getElementById("xlsx").style.display = "block";
      }
    },
    // 修改
    modifyData3() {
      if (this.multipleSelection5.length !== 1) {
        this.$message.warning('请勾选您要修改的一条数据！')
      } else {
        let tt = false;
        this.multipleSelection5.forEach(s => {
          if (s.state == '1') {
            tt = true;
          }
        })
        if (tt) {
          this.$message.warning('请勾选未验收的数据！')
          return;
        } else {
          this.showFlag31 = !this.showFlag31;
          this.Params3 = this.multipleSelection5[0];
          this.Params = null
        }
      }
    },
    // 停用
    deleteData3() {
      if (this.multipleSelection5.length < 1) {
        this.$message.warning('请勾选您要停用的数据！')
      } else {
        this.dialogTableVisible = false;
        for (var i = 0; i < this.multipleSelection5.length; i++) {
          this.multipleSelection5[i].updateMan = userName;
          this.multipleSelection5[i].updateNo = userId
        }
        this.axios.post('pass/baseManagement/v1/limslrcstuffis/abolish', this.multipleSelection5, { individualType: 'json' }).then(res => {
          if (res.succeed) {
            this.$message.success('停用操作成功');
            this.refresh(3)
          } else {
            this.$message.error(res.message)
          }
        }).catch(e => {
          this.$message.error(e.message)
        })
      }
    },
    // 启用
    recoverData3() {
      if (this.multipleSelection5.length < 1) {
        this.$message.warning('请勾选您要启用的数据！')
      } else {
        this.dialogTableVisible2 = false;
        for (var i = 0; i < this.multipleSelection5.length; i++) {
          this.multipleSelection5[i].evaMan = userName;
          this.multipleSelection5[i].evaNo = userId
        }
        this.axios.post('pass/baseManagement/v1/limslrcstuffis/recover', this.multipleSelection5, { individualType: 'json' }).then(res => {
          if (res.succeed) {
            this.$message.success('启用成功');
            this.refresh(3)
          } else {
            this.$message.error(res.message)
          }
        }).catch(e => {
          this.$message.error(e.message)
        })
      }
    },
    // 确认出库
    confirmData() {
      if (this.multipleSelection6.length < 1) {
        this.$message.warning("请勾选您需要确认的出库信息！");
        return;
      }
      let tt = false;
      for (let i = 0; i < this.multipleSelection6.length; i++) {
        if (userId == this.multipleSelection6[i].createNo) {
          tt = true;
        }
        if (this.multipleSelection6[i].state == '1') {
          return this.$message.warning("请选中为待确认信息！");
        }
      }
      if (tt) {
        this.$message.warning("审批人不能是申请人，请重试！");
        return;
      }
      this.axios.post('pass/baseManagement/v1/limslrcstuffos/confirmData', this.multipleSelection6, { individualType: 'json' }).then(res => {
        if (res.succeed) {
          this.$message.success(res.message);
          this.getDataList4(this.stuffNo)
        } else {
          this.$message.warning(res.message)
        }
      }).catch(e => {
        return this.$message.error(e.message)
      })
    },

    // 出库发放
    grantData() {
      if (this.multipleSelection6.length < 1) {
        this.$message.warning("请勾选您需要发放的出库信息！");
        return;
      }
      for (let i = 0; i < this.multipleSelection6.length; i++) {
        if (this.multipleSelection6[i].state == '2') {
          return this.$message.warning("已发放，请选择待发放申请！");
        }
        if (this.multipleSelection6[i].state == '0') {
          return this.$message.warning("未审批，请选择待发放申请！");
        }
      }
      this.axios.post('pass/baseManagement/v1/limslrcstuffos/grantData', this.multipleSelection6, { individualType: 'json' }).then(res => {
        if (res.succeed) {
          this.$message.success(res.message);
          this.getDataList4(this.stuffNo)
        } else {
          this.$message.warning(res.message)
        }
      }).catch(e => {
        return this.$message.error(e.message)
      })
    },

    // 申请出库
    addData4() {
      if (this.multipleSelection3.length != 1) {
        this.$message.warning('请在设备信息表中勾选您要新增的一条数据！')
      } else {
        this.showFlag4 = !this.showFlag4;
        this.Params4 = null;
        this.Params = this.multipleSelection3[0];
      }
    },
    // 修改
    modifyData4() {
      let tt = true;
      this.multipleSelection6.forEach(aa => {
        if (aa.state == "1") {
          tt = false;
          this.$message.warning("请选中为待确认信息！");
        }
        if (aa.state == "2") {
          tt = false;
          this.$message.warning("请选中为待确认信息！");
        }
      })
      if (tt) {
        if (this.multipleSelection6.length !== 1) {
          this.$message.warning('请勾选您要修改的一条数据！')
        } else {
          this.showFlag4 = !this.showFlag4;
          this.Params4 = this.multipleSelection6[0];
          this.Params = null
        }
      }
    },
    // 停用
    deleteData4() {
      if (this.multipleSelection6.length < 1) {
        this.$message.warning('请勾选您要停用的数据！')
      } else {
        this.dialogTableVisible = false;
        for (var i = 0; i < this.multipleSelection6.length; i++) {
          this.multipleSelection6[i].updateMan = userName;
          this.multipleSelection6[i].updateNo = userId
        }
        this.axios.post('pass/baseManagement/v1/limslrcstuffos/abolish', this.multipleSelection6, { individualType: 'json' }).then(res => {
          if (res.succeed) {
            this.$message.success('停用操作成功');
            this.refresh(4)
          } else {
            this.$message.error(res.message)
          }
        }).catch(e => {
          this.$message.error(e.message)
        })
      }
    },
    // 启用
    recoverData4() {
      if (this.multipleSelection6.length < 1) {
        this.$message.warning('请勾选您要启用的数据！')
      } else {
        this.dialogTableVisible2 = false;
        for (var i = 0; i < this.multipleSelection6.length; i++) {
          this.multipleSelection6[i].evaMan = userName;
          this.multipleSelection6[i].evaNo = userId
        }
        this.axios.post('pass/baseManagement/v1/limslrcstuffos/recover', this.multipleSelection6, { individualType: 'json' }).then(res => {
          if (res.succeed) {
            this.$message.success('启用成功');
            this.refresh(4)
          } else {
            this.$message.error(res.message)
          }
        }).catch(e => {
          this.$message.error(e.message)
        })
      }
    },
    // 标准液配制
    addData5() {
      if (this.multipleSelection3.length != 1) {
        this.$message.warning('请在设备信息表中勾选您要新增的一条数据！')
      } else {
        this.showFlag5 = !this.showFlag5;
        this.Params5 = null;
        this.Params = this.multipleSelection3[0];
        console.log(this.Params)
      }
    },
    // 修改
    modifyData5() {
      if (this.multipleSelection7.length !== 1) {
        this.$message.warning('请勾选您要修改的一条数据！')
      } else {
        this.showFlag5 = !this.showFlag5;
        this.Params5 = this.multipleSelection7[0];
        this.Params = null
      }
    },
    //停用
    deleteData5() {
      if (this.multipleSelection7.length < 1) {
        this.$message.warning('请勾选您要停用的数据！')
      } else {
        this.dialogTableVisible = false;
        for (var i = 0; i < this.multipleSelection7.length; i++) {
          this.multipleSelection7[i].updateMan = userName;
          this.multipleSelection7[i].updateNo = userId
        }
        this.axios.post('pass/baseManagement/v1/limslrcstufffabrs/abolish', this.multipleSelection7, { individualType: 'json' }).then(res => {
          if (res.succeed) {
            this.$message.success('停用操作成功');
            this.refresh(5)
          } else {
            this.$message.error(res.message)
          }
        }).catch(e => {
          this.$message.error(e.message)
        })
      }
    },
    // 启用
    recoverData5() {
      if (this.multipleSelection7.length < 1) {
        this.$message.warning('请勾选您要启用的数据！')
      } else {
        this.dialogTableVisible2 = false;
        for (var i = 0; i < this.multipleSelection7.length; i++) {
          this.multipleSelection7[i].evaMan = userName;
          this.multipleSelection7[i].evaNo = userId
        }
        this.axios.post('pass/baseManagement/v1/limslrcstufffabrs/recover', this.multipleSelection7, { individualType: 'json' }).then(res => {
          if (res.succeed) {
            this.$message.success('启用成功');
            this.refresh(5)
          } else {
            this.$message.error(res.message)
          }
        }).catch(e => {
          this.$message.error(e.message)
        })
      }
    },
    // 标定
    addData6() {
      if (this.multipleSelection3.length != 1) {
        this.$message.warning('请在设备信息表中勾选您要新增的一条数据！')
      } else {
        this.showFlag6 = !this.showFlag6;
        this.Params6 = null;
        this.Params = this.multipleSelection3[0];
        console.log(this.Params)
      }
    },
    // 修改
    modifyData6() {
      if (this.multipleSelection8.length !== 1) {
        this.$message.warning('请勾选您要修改的一条数据！')
      } else {
        this.showFlag6 = !this.showFlag6;
        this.Params6 = this.multipleSelection8[0];
        this.Params = null
      }
    },
    // 停用
    deleteData6() {
      if (this.multipleSelection8.length < 1) {
        this.$message.warning('请勾选您要停用的数据！')
      } else {
        this.dialogTableVisible = false;
        for (var i = 0; i < this.multipleSelection8.length; i++) {
          this.multipleSelection8[i].updateMan = userName;
          this.multipleSelection8[i].updateNo = userId
        }
        this.axios.post('pass/baseManagement/v1/limslrcstuffcalibrs/abolish', this.multipleSelection8, { individualType: 'json' }).then(res => {
          if (res.succeed) {
            this.$message.success('停用操作成功');
            this.refresh(6)
          } else {
            this.$message.error(res.message)
          }
        }).catch(e => {
          this.$message.error(e.message)
        })
      }
    },
    // 启用
    recoverData6() {
      if (this.multipleSelection8.length < 1) {
        this.$message.warning('请勾选您要启用的数据！')
      } else {
        this.dialogTableVisible2 = false;
        for (var i = 0; i < this.multipleSelection8.length; i++) {
          this.multipleSelection8[i].evaMan = userName;
          this.multipleSelection8[i].evaNo = userId
        }
        this.axios.post('pass/baseManagement/v1/limslrcstuffcalibrs/recover', this.multipleSelection8, { individualType: 'json' }).then(res => {
          if (res.succeed) {
            this.$message.success('启用成功');
            this.refresh(6)
          } else {
            this.$message.error(res.message)
          }
        }).catch(e => {
          this.$message.error(e.message)
        })
      }
    },
    addData7() {
      if (this.multipleSelection3.length != 1) {
        this.$message.warning('请在物品信息表中勾选您要新增的一条数据！')
      } else {
        this.showFlag7 = !this.showFlag7;
        this.Params7 = null;
        this.Params = this.multipleSelection3[0];
        console.log(this.Params)
      }

    },
    modifyData7() {
      if (this.multipleSelectionSeven.length !== 1) {
        this.$message.warning('请勾选您要修改的一条数据！')
      } else {
        let bool = false;
        this.multipleSelectionSeven.forEach(s => {
          if (s.tenantNo == '1') {
            bool = true;
          }
        })
        if (bool) {
          this.$message.warning('请勾选未确认的数据！')
          return
        }
        this.showFlag9 = !this.showFlag9;
        this.Params9 = this.multipleSelectionSeven[0];
      }
    },
    httpRequest(e) {
      if (this.multipleSelectionSeven.length == 0) {
        this.$message.warning('请勾选您要上传文件对应的数据！')
        return
      }
      if (!e.file) {
        return false
      }
      let file = new FormData()
      file.append('file', e.file)
      let config = {
        headers: {
          'Content-Type': 'multipart/form-data'
        }
      }
      this.axios.post('pass/baseManagement/v1/file/upload', file, config).then(res => {
        if (res.code === '0' || res.code === '200') {
          console.log(list)
          console.log(res.data[0].fileName)
          let list = []
          this.multipleSelectionSeven.forEach(ss => {
            list.push(ss.iId)
          })
          let Cdata = {
            list: list,
            fileName: res.data[0].fileName
          }
          this.axios.post('pass/baseManagement/v1/limslrcstuffinfos/fileMemo1', Cdata, { individualType: 'json' }).then(res1 => {
            if (res1.code === '0' || res1.code === '200') {
              this.$message.success('上传成功')
            }
          }).catch(e1 => {
            this.$message.error(e1.message)
          })
        } else {
          this.$message.error(res.message)
        }
      }).catch(e => {
        return this.$message.error(e.message)
      })
    },
    confirmDataIn() {
      let bool = false;
      if (this.multipleSelectionSeven.length == 0) {
        this.$message.warning('请勾选您要确认的数据！')
        return
      }
      this.multipleSelectionSeven.forEach(s => {
        if (s.createMan == userName) {
          bool = true;
        }
      })
      if (bool) {
        this.$message.warning('确认人与录入人一致，无法确认')
        return
      }
      let arrList = []
      this.multipleSelectionSeven.forEach(s => {
        s.memo2 = userName,
          s.tenantNo = '1'
      })
      this.buttonLoading = true;
      this.axios.post('pass/baseManagement/v1/limslrcstuffinfos/confirmData', this.multipleSelectionSeven, { individualType: 'json' }).then(res => {
        if (res.succeed) {
          this.$message.success('操作成功');
          this.getDataList7(this.tableClick.stuffNo)
        } else {
          this.$message.error(res.message)
        }
        this.buttonLoading = false;
      }).catch(e => {
        this.buttonLoading = false;
        this.$message.error(e.message)
      })
    },
    confirmDataFo() {
      if (this.multipleSelectionSeven.length == 0) {
        this.$message.warning('请勾选您要取消确认的数据！')
        return
      }
      let bool = false;
      this.multipleSelectionSeven.forEach(s => {
        if (s.memo2 != userName) {
          bool = true;
        }
      })
      if (bool) {
        this.$message.warning('确认人与取消确认人不一致，无法取消')
        return
      }
      let arrList = []
      this.multipleSelectionSeven.forEach(s => {
        arrList.push(s.iId)
      })
      this.buttonLoading = true;
      this.axios.post('pass/baseManagement/v1/limslrcstuffinfos/confirmDataFo', arrList, { individualType: 'json' }).then(res => {
        if (res.succeed) {
          this.$message.success('操作成功');
          this.getDataList7(this.tableClick.stuffNo)
        } else {
          this.$message.error(res.message)
        }
        this.buttonLoading = false;
      }).catch(e => {
        this.buttonLoading = false;
        this.$message.error(e.message)
      })
    },
    batchUpdate7() {
      if (this.multipleSelectionSeven.length == 0) {
        this.$message.warning('请勾选您要保存的数据！')
        return
      }
      let bool = false;
      this.multipleSelectionSeven.forEach(s => {
        if (s.tenantNo == '1') {
          bool = true;
        }
      })
      if (bool) {
        this.$message.warning('请勾选未确认的数据！')
        return
      }
      this.axios.post('pass/baseManagement/v1/limslrcstuffinfos/batchUpdate', this.multipleSelectionSeven, { individualType: 'json' }).then(res => {
        if (res.succeed) {
          this.$message.success('操作成功');
          this.getDataList7(this.tableClick.stuffNo)
        } else {
          this.$message.error(res.message)
        }
      }).catch(e => {
        this.$message.error(e.message)
      })
    },
    deleteData7() {
      if (this.multipleSelectionSeven.length < 1) {
        this.$message.warning('请勾选您要停用的数据！')
      } else {
        this.axios.post('pass/baseManagement/v1/limslrcstuffinfos/abolish', this.multipleSelectionSeven, { individualType: 'json' }).then(res => {
          if (res.succeed) {
            this.$message.success('停用操作成功');
            this.refresh(7)
          } else {
            this.$message.error(res.message)
          }
        }).catch(e => {
          this.$message.error(e.message)
        })
      }
    },
    recoverData7() {
      if (this.multipleSelectionSeven.length < 1) {
        this.$message.warning('请勾选您要启用的数据！')
      } else {
        this.axios.post('pass/baseManagement/v1/limslrcstuffinfos/recover', this.multipleSelectionSeven, { individualType: 'json' }).then(res => {
          if (res.succeed) {
            this.$message.success('启用成功');
            this.refresh(7)
          } else {
            this.$message.error(res.message)
          }
        }).catch(e => {
          this.$message.error(e.message)
        })
      }
    },
    // 一个
    pageSizeChange(size) {
      this.page.pageSize = size;
      this.getDataList();
    },
    pageCurrentChange(index) {
      this.page.pageNum = index;
      this.getDataList();
    },
    handleSelectionChange(val) {
      this.multipleSelection3 = val;
      if (val.length > 0) {
        this.stuffNo = val[val.length - 1].stuffNo
        this.$refs.dataTable.setCurrentRow(val[val.length - 1])
        this.getAllListByEmpNo(val[val.length - 1])
      }
    },
    getAllListByEmpNo(val) {
      // console.log('click   ....',val)
      // this.$refs.dataTable.toggleRowSelection(val,true)
      this.getDataList2(val.stuffNo)
      this.getDataList3(val.stuffNo)
      this.getDataList4(val.stuffNo)
      this.getDataList5(val.stuffNo)
      this.getDataList6(val.stuffNo)
      this.getDataList7(val.stuffNo)
      this.tableClick = val;
    },
    getRowCheck(val) {
      this.$refs.dataTable2.toggleRowSelection(val, true)
    },
    getRowCheck2(val) {
      this.$refs.dataTable3.toggleRowSelection(val, true)
    },
    getRowCheck3(val) {
      this.$refs.dataTable4.toggleRowSelection(val, true)
    },
    getRowCheck4(val) {
      this.$refs.dataTable5.toggleRowSelection(val, true)
    },
    getRowCheck5(val) {
      this.$refs.dataTable6.toggleRowSelection(val, true)
    },
    getRowCheck7(val) {
      this.$refs.dataTable7.toggleRowSelection(val, true)
    },
    // 二个
    pageSizeChange2(size) {
      this.page2.pageSize = size;
      this.getDataList2();
    },
    pageCurrentChange2(index) {
      this.page2.pageNum = index;
      this.getDataList2();
    },
    handleSelectionChange2(val) {
      this.multipleSelection4 = val;
    },
    // 第三
    pageSizeChange3(size) {
      this.page3.pageSize = size;
      this.getDataList3();
    },
    pageCurrentChange3(index) {
      this.page3.pageNum = index;
      this.getDataList3();
    },
    handleSelectionChange3(val) {
      this.multipleSelection5 = val;
    },
    //第四
    pageSizeChange4(size) {
      this.page4.pageSize = size;
      this.getDataList4();
    },
    pageCurrentChange4(index) {
      this.page4.pageNum = index;
      this.getDataList4();
    },
    handleSelectionChange4(val) {
      this.multipleSelection6 = val;
    },
    //第五
    pageSizeChange5(size) {
      this.page5.pageSize = size;
      this.getDataList5();
    },
    pageCurrentChange5(index) {
      this.page5.pageNum = index;
      this.getDataList5();
    },
    handleSelectionChange5(val) {
      this.multipleSelection7 = val;
    },
    //第六
    pageSizeChange6(size) {
      this.page6.pageSize = size;
      this.getDataList6();
    },
    pageCurrentChange6(index) {
      this.page6.pageNum = index;
      this.getDataList6();
    },
    handleSelectionChange6(val) {
      this.multipleSelection8 = val;
    },
    handleSelectionChange7(val) {
      this.multipleSelectionSeven = val;
    },
    getDataListruku(val) {
      this.getDataList3(val.stuffNo)
    },
    getDataListchuku(val) {
      this.getDataList4(val.stuffNo)
    },
    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);
      });
    },
    addScreen3() {
      this.$nextTick(() => {
        let ss = document.createElement('div');
        ss.innerHTML = '筛选';
        ss.style = 'text-align: center;'
        this.$refs.dataTable3.$el.getElementsByClassName('el-table__fixed')[0].getElementsByTagName('td')[0].appendChild(ss);
      });
    },
    addScreen4() {
      this.$nextTick(() => {
        let ss = document.createElement('div');
        ss.innerHTML = '筛选';
        ss.style = 'text-align: center;'
        this.$refs.dataTable4.$el.getElementsByClassName('el-table__fixed')[0].getElementsByTagName('td')[0].appendChild(ss);
      });
    },
    addScreen5() {
      this.$nextTick(() => {
        let ss = document.createElement('div');
        ss.innerHTML = '筛选';
        ss.style = 'text-align: center;'
        this.$refs.dataTable5.$el.getElementsByClassName('el-table__fixed')[0].getElementsByTagName('td')[0].appendChild(ss);
      });
    },
    addScreen6() {
      this.$nextTick(() => {
        let ss = document.createElement('div');
        ss.innerHTML = '筛选';
        ss.style = 'text-align: center;'
        this.$refs.dataTable6.$el.getElementsByClassName('el-table__fixed')[0].getElementsByTagName('td')[0].appendChild(ss);
      });
    },
    getDataList() {
      this.dataLoading = true;
      this.axios.get('pass/baseManagement/v1/limslrcstuffs/' + '?pageNum=' + this.page.pageNum + '&pageSize=' + this.page.pageSize)
        .then(res => {
          this.dataLoading = false;
          this.table.list = res.data.list;
          this.page.totalPage = res.data.total;
        }).catch(e => {
          this.dataLoading = false;
        });
    },
    getDataList2(stuffNo) {
      console.log
      this.dataLoading2 = true;
      if (stuffNo === null || stuffNo === '') {
        this.table.list2 = [];
        this.dataLoading2 = false;
        return 0
      } else {
        this.axios.get('pass/baseManagement/v1/limslrcstuffstks/' + '?pageNum=' + this.page2.pageNum + '&pageSize=' + this.page2.pageSize + '&stuffNo=' + stuffNo)
          .then(res => {
            this.dataLoading2 = false;
            this.table.list2 = res.data.list;
            this.page2.totalPage = res.data.total;
          }).catch(e => {
            this.dataLoading2 = false;
          });
      }
    },
    getDataList3(stuffNo) {
      this.dataLoading3 = true;
      let startTime = ''
      let endTime = ''
      if (!this.search.time) {
        startTime = null
        endTime = null
      } else {
        startTime = this.search.time[0] + ' 00:00:00'
        endTime = this.search.time[1] + ' 23:59:59'
      }
      if (stuffNo === null || stuffNo === '') {
        this.table.list3 = [];
        this.dataLoading3 = false;
        return 0
      } else {
        this.axios.get('pass/baseManagement/v1/limslrcstuffis/' + '?pageNum=' + this.page3.pageNum + '&pageSize=' + this.page3.pageSize + '&stuffNo=' + stuffNo + '&startTime=' + startTime + '&endTime=' + endTime)
          .then(res => {
            this.dataLoading3 = false;
            this.table.list3 = res.data.list;
            this.page3.totalPage = res.data.total;
          }).catch(e => {
            this.dataLoading3 = false;
          });
      }
    },
    getDataList4(stuffNo) {
      this.dataLoading4 = true;
      let startTime = ''
      let endTime = ''
      if (!this.search1.time) {
        startTime = null
        endTime = null
      } else {
        startTime = this.search.time[0] + ' 00:00:00'
        endTime = this.search.time[1] + ' 23:59:59'
      }
      if (stuffNo === null || stuffNo === '') {
        this.table.list4 = [];
        this.dataLoading4 = false;
        return 0
      } else {
        this.axios.get('pass/baseManagement/v1/limslrcstuffos/' + '?pageNum=' + this.page4.pageNum + '&pageSize=' + this.page4.pageSize + '&stuffNo=' + stuffNo + '&startTime=' + startTime + '&endTime=' + endTime)
          .then(res => {
            this.dataLoading4 = false;
            this.table.list4 = res.data.list;
            this.page4.totalPage = res.data.total;
          }).catch(e => {
            this.dataLoading4 = false;
          });
      }
    },
    getDataList5(stuffNo) {
      this.dataLoading5 = true;
      if (stuffNo === null || stuffNo === '') {
        this.table.list5 = [];
        this.dataLoading5 = false;
        return 0
      } else {
        this.axios.get('pass/baseManagement/v1/limslrcstufffabrs/' + '?pageNum=' + this.page5.pageNum + '&pageSize=' + this.page5.pageSize + '&stuffNo=' + stuffNo)
          .then(res => {
            this.dataLoading5 = false;
            this.table.list5 = res.data.list;
            this.page5.totalPage = res.data.total;
          }).catch(e => {
            this.dataLoading5 = false;
          });
      }
    },
    getDataList6(stuffNo) {
      this.dataLoading6 = true;
      if (stuffNo === null || stuffNo === '') {
        this.table.list6 = [];
        this.dataLoading6 = false;
        return 0
      } else {
        this.axios.get('pass/baseManagement/v1/limslrcstuffcalibrs/' + '?pageNum=' + this.page6.pageNum + '&pageSize=' + this.page6.pageSize + '&stuffNo=' + stuffNo)
          .then(res => {
            this.dataLoading6 = false;
            this.table.list6 = res.data.list;
            this.table.list6.forEach(item => {
              item.calibrTime = formatDate(item.calibrTime, "yyyy-MM-dd")
              item.failureDate = formatDate(item.failureDate, "yyyy-MM-dd")
            })
            this.page6.totalPage = res.data.total;
          }).catch(e => {
            this.dataLoading6 = false;
          });
      }
    },
    getDataList7(stuffNo) {
      this.dataLoading7 = true;
      if (stuffNo === null || stuffNo === '') {
        this.table.list7 = [];
        this.dataLoading7 = false;
        return 0
      } else {
        this.axios.get('pass/baseManagement/v1/limslrcstuffinfos/' + '?pageNum=' + this.page7.pageNum + '&pageSize=' + this.page7.pageSize + '&stuffNo=' + stuffNo)
          .then(res => {
            this.dataLoading7 = false;
            this.table.list7 = res.data.list;
            this.page7.totalPage = res.data.total;
          }).catch(e => {
            this.dataLoading7 = false;
          });
      }
    },
    tableRowClassName({
      row, column, rowIndex, columnIndex
    }) {
      if (columnIndex === 10) {
        if (row.validFlag === '0') {
          return 'error-row';
        }
        return '';
      }
    },
    tableRowClassName2({
      row, column, rowIndex, columnIndex
    }) {
      if (columnIndex === 2) {
        if (row.validFlag === '0') {
          return 'error-row';
        }
        return '';
      }
    },
    tableRowClassName3({
      row, column, rowIndex, columnIndex
    }) {
      if (columnIndex === 2) {
        if (row.validFlag === '0') {
          return 'error-row';
        }
        return '';
      }
    },
    tableRowClassName4({
      row, column, rowIndex, columnIndex
    }) {
      if (columnIndex === 2) {
        if (row.validFlag === '0') {
          return 'error-row';
        }
        if (row.state === '1') {
          return 'error-blue';
        }
        if (row.state === '2') {
          return 'error-green';
        }
        return '';
      }
    },
    tableRowClassName5({
      row, column, rowIndex, columnIndex
    }) {
      if (columnIndex === 12) {
        if (row.validFlag === '0') {
          return 'error-row';
        }
        return '';
      }
    },
    tableRowClassName6({
      row, column, rowIndex, columnIndex
    }) {
      if (columnIndex === 11) {
        if (row.validFlag === '0') {
          return 'error-row';
        }
        return '';
      }
    },
    tableRowClassName7({
      row, column, rowIndex, columnIndex
    }) {

      if (row.validFlag === '0') {
        return 'error-row';
      }
      return '';
    },
    // 切栏
    //   handleClick (tab, event) {
    //   console.log(tab, event);
    //   if (tab.name === 'first') {
    //     this.doSearch()
    //   } else if (tab.name === 'second') {
    //     this.doSearch2()
    //   } else if (tab.name === 'third') {
    //     this.doSearch3()
    //   } else if (tab.name ==='fourth') {
    //     this.doSearch4()
    //   } else if (tab.name ==='fifth') {
    //     this.doSearch5()
    //   }
    // },
    // 表格上横线
    tableHeaderCellStyle() {
      return 'color: rgb(255,255,255);border-bottom: 1px solid #DCDFE7;'
    }
  },
}
</script>
<style lang="less"></style>
