<template>
    <div class="app-container" id="">
      <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
        <el-form-item label="关键字" prop="keyWord">
            <el-input
              v-model="queryParams.keyWord"
              placeholder="请输入关键字"
              clearable :maxlength="20"
              style="width: 240px"
            />
          </el-form-item>
        <el-form-item label="施工类型" prop="lineTypes">
          <el-select
            v-model="queryParams.lineTypes"
            placeholder="请选择施工类型"
            multiple
            collapse-tags
            style="width: 240px"
            clearable
            @change="handleLineTypeChange"
          >
            <el-option
              v-for="item in lineTypeOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="物资类型" prop="materialType">
          <el-select
            v-model="queryParams.materialType"
            placeholder="请选择物资类型"
            style="width: 240px"
            clearable
            filterable
            @change="handleMaterialTypeChange"
          >
            <el-option
              v-for="item in materialTypeOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </el-form-item>
<!--        <el-form-item prop="typeName">-->
<!--              <el-input-->
<!--                  v-model="queryParams.typeName"-->
<!--                  placeholder="请输入物资名称"-->
<!--                  clearable :maxlength="20"-->
<!--                  style="width: 240px"-->
<!--              />-->
<!--          </el-form-item>-->
        <el-form-item label="物资名称" prop="typeName">
          <el-select
            v-model="queryParams.typeName"
            placeholder="请选择物资名称"
            style="width: 240px"
            clearable
            filterable
            @change="handleTypeNameChange"
          >
            <el-option
              v-for="item in typeNameOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </el-form-item>
<!--          <el-form-item prop="typeModelName">-->
<!--              <el-input-->
<!--                  v-model="queryParams.typeModelName"-->
<!--                  placeholder="请输入规格型号"-->
<!--                  clearable :maxlength="20"-->
<!--                  style="width: 240px"-->
<!--              />-->
<!--          </el-form-item>-->
        <el-form-item label="规格型号" prop="typeModelName">
          <el-select
            v-model="queryParams.typeModelName"
            placeholder="请选择规格型号"
            style="width: 240px"
            clearable
            filterable
          >
            <el-option
              v-for="item in typeModelNameOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="机具类型" prop="jiJuType">
          <el-select
            v-model="queryParams.jiJuType"
            placeholder="请选择机具类型"
            clearable
            style="width: 240px"
          >
            <el-option label="施工机具" :value="1" />
            <el-option label="安全工器具" :value="2" />
          </el-select>
        </el-form-item>
          <el-form-item>
              <el-button
                  type="primary"
                  icon="el-icon-search"
                  size="mini"
                  @click="handleQuery"
                  >查询</el-button
              >
              <el-button
                  icon="el-icon-refresh"
                  size="mini"
                  @click="resetQuery"
                  >重置</el-button
              >
              <el-button
                  type="warning"
                  plain
                  icon="el-icon-download"
                  size="mini"
                  @click="handleExport"
                  >导出</el-button
              >
              <!-- <span style="margin-left: 20px; color: red"
                  >保有量=在库+在用+在修+修试后待入库</span
              > -->
          </el-form-item>
      </el-form>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
      <el-table v-loading="loading" :data="tableList" :span-method="objectSpanMethod" :max-height="650">
          <!-- houseName type typeName typeModelName unitName storeNum manageType usNum  repairNum inputNum repairInputNum allNum-->
          <el-table-column label="序号" align="center" width="80" type="index">
                <template scope="scope">
                    <span v-if="scope.$index==0">合计：</span>
                    <span v-else>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index }}</span>
                </template>
          </el-table-column>
          <!-- <el-table-column label="仓库信息" align="center" prop="whHouseName" :show-overflow-tooltip="true"/>-->
          <el-table-column label="施工类型" align="center" prop="constructionType" :show-overflow-tooltip="true"/>
          <el-table-column label="物资类型" align="center" prop="materialType" :show-overflow-tooltip="true"/>
          <el-table-column label="物资名称" align="center" prop="typeName" :show-overflow-tooltip="true"/>
          <el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true"/>
          <el-table-column label="计量单位" align="center" prop="unit" :show-overflow-tooltip="true"/>
          <el-table-column label="在库数量" align="center" prop="storeNum" :show-overflow-tooltip="true">
            <template slot-scope="scope">
              <!-- 当 manageType 为 '编码' 时，使用可点击的 span -->
              <span class="clickText" v-if="scope.row.manageType=='编码'" @click="openRecords(scope.row)">
                {{ scope.row.storeNum }}
              </span>
              <!-- 否则，直接显示数字 -->
              <span v-else>
              {{ scope.row.storeNum }}
              </span>
            </template>
          </el-table-column>
          <el-table-column label="在用数量" align="center" prop="usNum" :show-overflow-tooltip="true">
            <template slot-scope="scope">
              <span v-if="scope.$index !== 0" class="clickText" @click="openUserRecords(scope.row)">
              {{ scope.row.usNum }}
              </span>
              <!-- 否则，直接显示数字 -->
              <span v-else>
                {{ scope.row.usNum }}
              </span>
            </template>
          </el-table-column>
        <el-table-column label="待修数量" align="center" prop="dsNum" :show-overflow-tooltip="true">
          <template slot-scope="scope">
              <span v-if="scope.$index !== 0" class="clickText" @click="openRepairRecords(scope.row,1)">
              {{ scope.row.dsNum }}
              </span>
            <!-- 否则，直接显示数字 -->
            <span v-else>
                {{ scope.row.dsNum }}
              </span>
          </template>
        </el-table-column>
          <el-table-column label="在修数量" align="center" prop="repairNum" :show-overflow-tooltip="true">
            <template slot-scope="scope">
              <span v-if="scope.$index !== 0" class="clickText" @click="openRepairRecords(scope.row,2)">
              {{ scope.row.repairNum }}
              </span>
              <!-- 否则，直接显示数字 -->
              <span v-else>
                {{ scope.row.repairNum }}
              </span>
            </template>
          </el-table-column>
        <el-table-column label="修试待审核数量" align="center" prop="repairAuditNum" :show-overflow-tooltip="true">
          <template slot-scope="scope">
              <span v-if="scope.$index !== 0" class="clickText" @click="openRepairRecords(scope.row,3)">
              {{ scope.row.repairAuditNum }}
              </span>
            <!-- 否则，直接显示数字 -->
            <span v-else>
                {{ scope.row.repairAuditNum }}
              </span>
          </template>
        </el-table-column>
          <el-table-column label="新购待入库数量" align="center" prop="inputNum" :show-overflow-tooltip="true">
            <template slot-scope="scope">
              <span v-if="scope.$index !== 0" class="clickText" @click="openPurchaseRecords(scope.row)">
              {{ scope.row.inputNum }}
              </span>
              <!-- 否则，直接显示数字 -->
              <span v-else>
                {{ scope.row.inputNum }}
              </span>
                    <!-- <span class="clickText" @click="openPurchaseRecords(scope.row)">{{ scope.row.inputNum }}</span> -->
            </template>
          </el-table-column>
          <el-table-column label="修试后待入库数量" align="center" prop="repairInputNum" :show-overflow-tooltip="true">
            <template slot-scope="scope">
              <span v-if="scope.$index !== 0" class="clickText" @click="openTestedRecords(scope.row)">
              {{ scope.row.repairInputNum }}
              </span>
              <!-- 否则，直接显示数字 -->
              <span v-else>
                {{ scope.row.repairInputNum }}
              </span>
                    <!-- <span class="clickText" @click="openTestedRecords(scope.row)">{{ scope.row.repairInputNum }}</span> -->
            </template>
          </el-table-column>
        <!-- <el-table-column label="待报废数量" align="center" prop="pendingScrapNum" :show-overflow-tooltip="true">
          <template slot-scope="scope">
              <span class="clickText" @click="openToScrapRecords(scope.row)">
              {{ scope.row.pendingScrapNum }}
              </span>
          </template>
        </el-table-column> -->
<!--        <el-table-column label="已审核报废数量" align="center" prop="scrapNum" :show-overflow-tooltip="true">
          <template slot-scope="scope">
              <span v-if="scope.$index !== 0" class="clickText" @click="openAuditedRecords(scope.row)">
              {{ scope.row.scrapNum }}
              </span>
            &lt;!&ndash; 否则，直接显示数字 &ndash;&gt;
            &lt;!&ndash; <span v-else>
            {{ scope.row.repairInputNum }}
            </span>  &ndash;&gt;
            &lt;!&ndash; <span class="clickText" @click="openTestedRecords(scope.row)">{{ scope.row.repairInputNum }}</span> &ndash;&gt;
          </template>
        </el-table-column>-->
          <el-table-column label="总保有量" align="center" prop="allNum" :show-overflow-tooltip="true">
          </el-table-column>
          <el-table-column label="总保有量资产（万元）" align="center" prop="totalPrice" :show-overflow-tooltip="true" />
          <!-- <el-table-column label="成新率" align="center" prop="" :show-overflow-tooltip="true">
            <el-table-column label="五年以内" align="center" prop="fiveReplacementRate" :show-overflow-tooltip="true"></el-table-column>
            <el-table-column label="五年至十年" align="center" prop="tenReplacementRate" :show-overflow-tooltip="true"></el-table-column>
            <el-table-column label="十年以上" align="center" prop="tenPlusReplacementRate" :show-overflow-tooltip="true"></el-table-column>
          </el-table-column> -->



          <el-table-column label="管理模式" align="center" prop="manageType" :show-overflow-tooltip="true"/>
          <el-table-column label="机具类型" align="center" prop="jiJuType" :show-overflow-tooltip="true"/>
      </el-table>
      <pagination
          v-show="total > 0"
          :total="total"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          :page-sizes="[10, 20, 50, 100]"
          @pagination="getList"
      />

      <!-- 在库编码设备弹窗-->
      <el-dialog :title="title" :visible.sync="openRecord" width="1200px" append-to-body>
        <el-form :model="dialogQuery" ref="dialogQuery" size="small" :inline="true" label-width="80px">
          <el-form-item label="关键字" prop="keyWord">
          <el-input
            v-model="dialogQuery.keyWord"
            placeholder="请输入关键字"
            clearable :maxlength="30"
            style="width: 240px"/>
          </el-form-item>
          <el-form-item>
            <el-button type="primary"
              icon="el-icon-search" size="mini"
              @click="handleDialogQuery"
            >查询</el-button>
          </el-form-item>
          <el-form-item>
             <el-button
               icon="el-icon-download"
               size="mini"
               @click="handleDialogStoreExport"
             >导出</el-button>
           </el-form-item>
        </el-form>

        <el-table v-loading="loading" :data="dialogList">
          <el-table-column label="序号" align="center" width="80" type="index" :index="indexContinuation(dialogQuery.pageNum, dialogQuery.pageSize)">
          </el-table-column>
          <el-table-column label="物资名称" align="center" prop="typeName" :show-overflow-tooltip="true"/>
          <el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true"/>
          <el-table-column label="入库数量" align="center" prop="storeNum" :show-overflow-tooltip="true"/>
          <el-table-column label="原值（元）" align="center" prop="buyPrice" :show-overflow-tooltip="true"/>
          <el-table-column label="设备编码" align="center" prop="maCode" :show-overflow-tooltip="true"/>
          <el-table-column label="库管员" align="center" prop="maKeeper" :show-overflow-tooltip="true"/>
<!--          <el-table-column label="操作人" align="center" prop="inputUser" :show-overflow-tooltip="true"/>
          <el-table-column label="入库时间" align="center" prop="inputTime" :show-overflow-tooltip="true"/>
          <el-table-column label="入库方式" align="center" prop="inputType" :show-overflow-tooltip="true"/>-->
        </el-table>
          <pagination
            v-show="dialogTotal > 0"
            :total="dialogTotal"
            :page.sync="dialogQuery.pageNum"
            :limit.sync="dialogQuery.pageSize"
            @pagination="getStoreCodeList"
          />
      </el-dialog>
      <!-- 在用编码设备弹窗-->
      <el-dialog :title="title" :visible.sync="openUseRecord" width="1200px" append-to-body>
         <el-form :model="dialogUseQuery" ref="dialogUseQuery" size="small" :inline="true" label-width="80px">
          <el-form-item label="关键字" prop="keyWord">
             <el-input
               v-model="dialogUseQuery.keyWord"
               placeholder="请输入关键字"
               clearable :maxlength="20"
               style="width: 240px"/>
           </el-form-item>

           <el-form-item>
             <el-button
               type="primary"
               icon="el-icon-search"
               size="mini"
               @click="handleDialogUseQuery"
             >查询</el-button>
           </el-form-item>
           <el-form-item>
             <el-button
               icon="el-icon-download"
               size="mini"
               @click="handleDialogUserExport"
             >导出</el-button>
           </el-form-item>
         </el-form>

        <el-table v-loading="loading" :data="useRecordList">
          <el-table-column label="序号" align="center" width="80" type="index"
            :index="indexContinuation(dialogUseQuery.pageNum, dialogUseQuery.pageSize)">
          </el-table-column>
          <el-table-column label="物资名称" align="center" prop="typeName" :show-overflow-tooltip="true"/>
          <el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true"/>
          <el-table-column label="在用数量" align="center" prop="usNum" :show-overflow-tooltip="true"/>
          <el-table-column label="原值（元）" align="center" prop="buyPrice" :show-overflow-tooltip="true"/>
          <el-table-column label="设备编码" align="center" prop="maCode" :show-overflow-tooltip="true"/>
          <el-table-column label="库管员" align="center" prop="maKeeper" :show-overflow-tooltip="true"/>
          <el-table-column label="操作人" align="center" prop="creator" :show-overflow-tooltip="true"/>
          <el-table-column label="出库时间" align="center" prop="outTime" :show-overflow-tooltip="true"/>
          <el-table-column label="工程名称" align="center" prop="projectName" width="200" :show-overflow-tooltip="true">
            <!-- <template slot-scope="scope">
              <span class="clickText" @click="jumpLease(scope.row.code)">
              {{ scope.row.code }}
              </span>
            </template>  -->
          </el-table-column>
        </el-table>

        <pagination
          v-show="dialogUserTotal > 0"
          :total="dialogUserTotal"
          :page.sync="dialogUseQuery.pageNum"
          :limit.sync="dialogUseQuery.pageSize"
          @pagination="getUserRecords"
        />
      </el-dialog>
      <!-- 在修编码设备弹窗-->
      <el-dialog :title="title" :visible.sync="openRepairRecord" width="1200px" append-to-body>
         <el-form :model="dialogRepairQuery" ref="dialogRepairQuery" size="small" :inline="true" label-width="80px">
          <el-form-item label="关键字" prop="keyWord">
             <el-input
               v-model="dialogRepairQuery.keyWord"
               placeholder="请输入关键字"
               clearable :maxlength="20"
               style="width: 240px"/>
           </el-form-item>

           <el-form-item>
             <el-button
               type="primary"
               icon="el-icon-search"
               size="mini"
               @click="handleDialogRepairQuery"
             >查询</el-button>
           </el-form-item>
           <el-form-item>
             <el-button
               icon="el-icon-download"
               size="mini"
               @click="handleDialogRepairExport"
             >导出</el-button>
           </el-form-item>
         </el-form>

        <el-table v-loading="loading" :data="repairRecordList">
          <el-table-column label="序号" align="center" width="80" type="index"
            :index="indexContinuation(dialogRepairQuery.pageNum, dialogRepairQuery.pageSize)">
          </el-table-column>
          <el-table-column label="物资名称" align="center" prop="typeName" :show-overflow-tooltip="true"/>
          <el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true"/>
          <el-table-column label="数量" align="center" prop="repairNum" :show-overflow-tooltip="true"/>
          <el-table-column label="原值（元）" align="center" prop="buyPrice" :show-overflow-tooltip="true"/>
          <el-table-column label="设备编码" align="center" prop="maCode" :show-overflow-tooltip="true"/>
          <el-table-column label="操作员" align="center" prop="repairer" :show-overflow-tooltip="true"/>
          <el-table-column label="退料人" align="center" prop="creator" :show-overflow-tooltip="true"/>
          <el-table-column label="退料时间" align="center" prop="leaseTime" :show-overflow-tooltip="true"/>
          <el-table-column label="维修单号" align="center" prop="repairCode" :show-overflow-tooltip="true">
            <template slot-scope="scope">
                <span class="clickText" @click="jumpRepair(scope.row.repairCode)">
                {{ scope.row.repairCode }}
                </span>
              </template>
          </el-table-column>
        </el-table>

        <pagination
          v-show="dialogRepairTotal > 0"
          :total="dialogRepairTotal"
          :page.sync="dialogRepairQuery.pageNum"
          :limit.sync="dialogRepairQuery.pageSize"
          @pagination="getRepairRecords"
        />
      </el-dialog>
      <!-- 新购待入库设备弹窗-->
      <el-dialog :title="title" :visible.sync="openPurchaseRecord" width="1200px" append-to-body>
         <el-form :model="dialogPurchaseQuery" ref="dialogPurchaseQuery" size="small" :inline="true" label-width="80px">
          <el-form-item label="关键字" prop="keyWord">
             <el-input
               v-model="dialogPurchaseQuery.keyWord"
               placeholder="请输入关键字"
               clearable :maxlength="20"
               style="width: 240px"/>
           </el-form-item>

           <el-form-item>
             <el-button
               type="primary"
               icon="el-icon-search"
               size="mini"
               @click="handleDialogPurchaseQuery"
             >查询</el-button>
           </el-form-item>
           <el-form-item>
             <el-button
               icon="el-icon-download"
               size="mini"
               @click="handleDialogPurchaseExport"
             >导出</el-button>
           </el-form-item>
         </el-form>

        <el-table v-loading="loading" :data="purchaseRecordList">
          <el-table-column label="序号" align="center" width="80" type="index"
            :index="indexContinuation(dialogPurchaseQuery.pageNum, dialogPurchaseQuery.pageSize)">
          </el-table-column>
          <el-table-column label="物资名称" align="center" prop="typeName" :show-overflow-tooltip="true"/>
          <el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true"/>
          <el-table-column label="新购待入库数量" align="center" prop="inputNum" :show-overflow-tooltip="true"/>
          <el-table-column label="原值（元）" align="center" prop="buyPrice" :show-overflow-tooltip="true"/>
          <el-table-column label="设备编码" align="center" prop="maCode" :show-overflow-tooltip="true"/>
          <el-table-column label="库管员" align="center" prop="maKeeper" :show-overflow-tooltip="true"/>
          <!-- <el-table-column label="操作人" align="center" prop="" :show-overflow-tooltip="true"/> -->
          <el-table-column label="验收完成时间" align="center" prop="checkTime" :show-overflow-tooltip="true"/>
          <el-table-column label="新购待入库单号" align="center" prop="code" :show-overflow-tooltip="true">
            <template slot-scope="scope">
                <span class="clickText" @click="jumpInput(scope.row.code)">
                {{ scope.row.code }}
                </span>
              </template>
          </el-table-column>
        </el-table>

        <pagination
          v-show="dialogPurchaseTotal > 0"
          :total="dialogPurchaseTotal"
          :page.sync="dialogPurchaseQuery.pageNum"
          :limit.sync="dialogPurchaseQuery.pageSize"
          @pagination="getPurchaseRecords"
        />
      </el-dialog>
      <!-- 修试后待入库设备弹窗-->
      <el-dialog :title="title" :visible.sync="openTestedRecord" width="1200px" append-to-body>
         <el-form :model="dialogTestedQuery" ref="dialogTestedQuery" size="small" :inline="true" label-width="80px">
          <el-form-item label="关键字" prop="keyWord">
             <el-input
               v-model="dialogTestedQuery.keyWord"
               placeholder="请输入关键字"
               clearable :maxlength="20"
               style="width: 240px"/>
           </el-form-item>

           <el-form-item>
             <el-button
               type="primary"
               icon="el-icon-search"
               size="mini"
               @click="handleDialogTestedQuery"
             >查询</el-button>
           </el-form-item>
           <el-form-item>
             <el-button
               icon="el-icon-download"
               size="mini"
               @click="handleDialogTestedExport"
             >导出</el-button>
           </el-form-item>
         </el-form>

        <el-table v-loading="loading" :data="testedRecordList">
          <el-table-column label="序号" align="center" width="80" type="index"
            :index="indexContinuation(dialogTestedQuery.pageNum, dialogTestedQuery.pageSize)">
          </el-table-column>
          <el-table-column label="物资名称" align="center" prop="typeName" :show-overflow-tooltip="true"/>
          <el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true"/>
          <el-table-column label="修试待入库数量" align="center" prop="repairInputNum" :show-overflow-tooltip="true"/>
          <el-table-column label="原值（元）" align="center" prop="buyPrice" :show-overflow-tooltip="true"/>
          <el-table-column label="设备编码" align="center" prop="maCode" :show-overflow-tooltip="true"/>
          <el-table-column label="库管员" align="center" prop="maKeeper" :show-overflow-tooltip="true"/>
          <el-table-column label="操作员" align="center" prop="repairer" :show-overflow-tooltip="true"/>
          <el-table-column label="修试提交时间" align="center" prop="repairInputTime" :show-overflow-tooltip="true"/>
          <el-table-column label="修试待入库单号" align="center" prop="inputCode" :show-overflow-tooltip="true">
            <template slot-scope="scope">
                <span class="clickText" @click="jumpRepairInput(scope.row.inputCode)">
                {{ scope.row.inputCode }}
                </span>
              </template>
          </el-table-column>
        </el-table>

        <pagination
          v-show="dialogTestedTotal > 0"
          :total="dialogTestedTotal"
          :page.sync="dialogTestedQuery.pageNum"
          :limit.sync="dialogTestedQuery.pageSize"
          @pagination="getTestedRecords"
        />
      </el-dialog>


      <!-- 待报废设备弹窗-->
      <el-dialog :title="title" :visible.sync="openToScrapRecord" width="1200px" append-to-body>
         <el-form :model="dialogToScrapQuery" ref="dialogToScrapQuery" size="small" :inline="true" label-width="80px">
          <el-form-item label="关键字" prop="keyWord">
             <el-input
               v-model="dialogToScrapQuery.keyWord"
               placeholder="请输入关键字"
               clearable :maxlength="20"
               style="width: 240px"/>
           </el-form-item>

           <el-form-item>
             <el-button
               type="primary"
               icon="el-icon-search"
               size="mini"
               @click="handleDialogToScrapQuery"
             >查询</el-button>
           </el-form-item>
           <el-form-item>
             <el-button
               icon="el-icon-download"
               size="mini"
               @click="handleDialogToScrapExport"
             >导出</el-button>
           </el-form-item>
         </el-form>

        <el-table v-loading="loading" :data="toScrapRecordList">
          <el-table-column label="序号" align="center" width="80" type="index"
            :index="indexContinuation(dialogToScrapQuery.pageNum, dialogToScrapQuery.pageSize)">
          </el-table-column>
          <el-table-column label="物资名称" align="center" prop="typeName" :show-overflow-tooltip="true"/>
          <el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true"/>
          <el-table-column label="报废数量" align="center" prop="scrapNum" :show-overflow-tooltip="true"/>
          <el-table-column label="原值（元）" align="center" prop="buyPrice" :show-overflow-tooltip="true"/>
          <el-table-column label="设备编码" align="center" prop="maCode" :show-overflow-tooltip="true"/>
          <el-table-column label="报废人员" align="center" prop="scrapBy" :show-overflow-tooltip="true"/>
          <el-table-column label="审核人员" align="center" prop="auditBy" :show-overflow-tooltip="true"/>
          <el-table-column label="报废时间" align="center" prop="scrapTime" :show-overflow-tooltip="true"/>
          <el-table-column label="报废类型" align="center" prop="scrapType" :show-overflow-tooltip="true"/>
        </el-table>

        <pagination
          v-show="dialogToScrapTotal > 0"
          :total="dialogToScrapTotal"
          :page.sync="dialogToScrapQuery.pageNum"
          :limit.sync="dialogToScrapQuery.pageSize"
          @pagination="getToScrapRecords"
        />
      </el-dialog>

      <!-- 已审核报废设备弹窗-->
      <el-dialog :title="title" :visible.sync="openAuditedRecord" width="1200px" append-to-body>
         <el-form :model="dialogAuditedQuery" ref="dialogAuditedQuery" size="small" :inline="true" label-width="80px">
          <el-form-item label="关键字" prop="keyWord">
             <el-input
               v-model="dialogAuditedQuery.keyWord"
               placeholder="请输入关键字"
               clearable :maxlength="20"
               style="width: 240px"/>
           </el-form-item>

           <el-form-item>
             <el-button
               type="primary"
               icon="el-icon-search"
               size="mini"
               @click="handleDialogAuditedQuery"
             >查询</el-button>
           </el-form-item>
           <el-form-item>
             <el-button
               icon="el-icon-download"
               size="mini"
               @click="handleDialogAuditedExport"
             >导出</el-button>
           </el-form-item>
         </el-form>

        <el-table v-loading="loading" :data="auditedRecordList">
          <el-table-column label="序号" align="center" width="80" type="index"
            :index="indexContinuation(dialogAuditedQuery.pageNum, dialogAuditedQuery.pageSize)">
          </el-table-column>
          <el-table-column label="物资名称" align="center" prop="typeName" :show-overflow-tooltip="true"/>
          <el-table-column label="规格型号" align="center" prop="typeModelName" :show-overflow-tooltip="true"/>
          <el-table-column label="报废数量" align="center" prop="scrapNum" :show-overflow-tooltip="true"/>
          <el-table-column label="原值（元）" align="center" prop="buyPrice" :show-overflow-tooltip="true"/>
          <el-table-column label="设备编码" align="center" prop="maCode" :show-overflow-tooltip="true"/>
          <el-table-column label="报废人员" align="center" prop="scrapBy" :show-overflow-tooltip="true"/>
          <el-table-column label="审核人员" align="center" prop="auditBy" :show-overflow-tooltip="true"/>
          <el-table-column label="审核时间" align="center" prop="auditTime" :show-overflow-tooltip="true"/>
          <el-table-column label="报废类型" align="center" prop="scrapType" :show-overflow-tooltip="true"/>
        </el-table>

        <pagination
          v-show="dialogAuditedTotal > 0"
          :total="dialogAuditedTotal"
          :page.sync="dialogAuditedQuery.pageNum"
          :limit.sync="dialogAuditedQuery.pageSize"
          @pagination="getAuditedRecords"
        />
      </el-dialog>
    </div>
</template>

<script>
// import {
//   statusList,
//   exportList,
//   getUnitData,getUseMaCode,
//   getProData, getTypeKeeper,
//   getUserRecords,getAllRecords,
// } from '@/api/stquery/deviceStatusRecord'
// import {getRecords} from "@/api/claimAndRefund/secondStore";
import {
  getRetainedEquipmentListApi,
  getRetainedEquipmentListNoPageApi,
  getStorageInfoListApi,
  getUserRecordListApi,
  getRepairRecordListApi,
  getPurchaseRecordListApi,
  getRepairInputListApi,
  getToScrapInputListApi,
  getAuditInputListApi,
  getLintTypeList, getMaterialTypeList,
} from '@/api/stquery/stquery';
import {getListProject} from "@/api/materialsStation";
import {getDeviceType} from "@/api/ma/device";
export default {
    name: 'DeviceStatusRecord',
    dicts: [],
    data() {
        return {
            // 遮罩层
            loading: false,
            // 选中数组
            ids: [],
            // 弹出层标题
            title: '查看',
            // 非单个禁用
            single: true,
            // 非多个禁用
            multiple: true,
            // 显示搜索条件
            showSearch: true,
            // 总条数
            total: 0,
            // 主表格数据
            tableList: [],
            // 查询参数
            queryParams: {
                pageNum: 1,
                pageSize: 10,
                keyWord: null,
                typeName: null, //物资名称
                typeModelName: null, //规格型号
                lineTypes: [], //线路类型多选数组
                materialType: null,
                jiJuType:null
            },
            lineTypeOptions: [], // 线路类型选项
            materialTypeOptions: [], // 物资类型选项
            typeNameOptions:[],
            typeModelNameOptions:[],
            //在库弹窗
            openRecord: false,
            dialogList: [], //在库编码设备列表
            dialogQuery: {
              pageNum: 1,
              pageSize: 10,
              keyWord: undefined,
            },
            dialogTotal: 0,
            //在用弹窗
            openUseRecord: false,
            dialogUseQuery: {
              pageNum: 1,
              pageSize: 10,
              keyWord: undefined,
            },
            useRecordList: [], //在用设备列表
            dialogUserTotal: 0,
            //在修弹窗
            openRepairRecord: false,
            dialogRepairQuery: {
              pageNum: 1,
              pageSize: 10,
              keyWord: undefined,
            },
            repairRecordList: [], //在修设备列表
            dialogRepairTotal: 0,

            //新购待入库弹窗
            openPurchaseRecord: false,
            dialogPurchaseQuery: {
              pageNum: 1,
              pageSize: 10,
              keyWord: undefined,
            },
            purchaseRecordList: [], //新购待入库设备列表
            dialogPurchaseTotal: 0,

            //修试待入库弹窗
            openTestedRecord: false,
            dialogTestedQuery: {
              pageNum: 1,
              pageSize: 10,
              keyWord: undefined,
            },
            testedRecordList: [], //修试待入库设备列表
            dialogTestedTotal: 0,

            //待报废弹窗
            openToScrapRecord: false,
            dialogToScrapQuery: {
              pageNum: 1,
              pageSize: 10,
              keyWord: undefined,
            },
            toScrapRecordList: [], //待报废设备列表
            dialogToScrapTotal: 0,

            //已审核弹窗
            openAuditedRecord: false,
            dialogAuditedQuery: {
              pageNum: 1,
              pageSize: 10,
              keyWord: undefined,
            },
            auditedRecordList: [], //已审核设备列表
            dialogAuditedTotal: 0,

        }
    },
  created() {
    this.getList()
    //线路类型下拉
    this.getLintTypeList()
    this.getMaterialTypeList()
    this.getDeviceType()
  },
    methods: {
      // 获取列表
      async getList() {
          this.loading = true
          const params = {
              keyWord: this.queryParams.keyWord,
              typeNameId: this.queryParams.typeName,
              typeModelNameId: this.queryParams.typeModelName,
              constructionTypes:this.queryParams.lineTypes,
              materialTypeId:this.queryParams.materialType,
              jiJuType:this.queryParams.jiJuType,
              pageSize: this.queryParams.pageSize,
              pageNum: this.queryParams.pageNum
          }
          const res = await getRetainedEquipmentListApi(params)
          if(res.data.rows.length>0){
            this.tableList = res.data.rows;
          }else{
            this.tableList=[]
          }
          this.total = res.data.total;
          console.log(this.tableList)
          let param = {
            keyWord: this.queryParams.keyWord,
            typeNameId: this.queryParams.typeName,
            typeModelNameId: this.queryParams.typeModelName,
            constructionTypes:this.queryParams.lineTypes,
            materialTypeId:this.queryParams.materialType,
            jiJuType:this.queryParams.jiJuType
          }
          const response = await getRetainedEquipmentListNoPageApi(param)
            let obj = {
              // storeNum manageType usNum  repairNum inputNum repairInputNum allNum
              storeNum: response.data.storeNum||0,
              usNum: response.data.usNum||0,
              dsNum:response.data.dsNum||0,
              repairNum: response.data.repairNum||0,
              repairAuditNum:response.data.repairAuditNum||0,
              inputNum: response.data.inputNum||0,
              repairInputNum: response.data.repairInputNum||0,
              pendingScrapNum: response.data.pendingScrapNum||0,
              scrapNum: response.data.scrapNum||0,
              allNum: response.data.allNum||0,
              totalPrice: response.data.totalPrice||0,
              fiveReplacementRate: response.data.fiveReplacementRate||0,
              tenReplacementRate: response.data.tenReplacementRate||0,
              tenPlusReplacementRate: response.data.tenPlusReplacementRate||0,
              manageType:response.data.manageType||"",
            }
            this.tableList.unshift(obj)
            console.log(this.tableList)
            this.loading = false
      },
      async getLintTypeList() {
        try {
          const res = await getLintTypeList()
          if (res.code === 200 && res.data) {
            // 根据后端返回的数据结构进行调整
            this.lineTypeOptions = res.data.map(item => {
              // 如果返回的是对象数组，根据实际字段调整
              return {
                value: item.typeId,
                label: item.typeName
              }
            })
          } else {
            this.$message.error('获取施工类型下拉失败')
            this.lineTypeOptions = [] // 失败时设置为空数组
          }
        } catch (error) {
          console.error('获取施工类型下拉列表失败:', error)
          this.$message.error('获取施工类型下拉列表失败')
          this.lineTypeOptions = [] // 异常时设置为空数组
        }
      },
      // 线路类型变化处理
      async handleLineTypeChange(selectedLineTypes) {
        // 清空物资类型选择
        this.queryParams.materialType = null
        this.materialTypeOptions=[]
        this.queryParams.typeName=null
        this.typeNameOptions=[]
        this.queryParams.typeModelName=null
        this.typeModelNameOptions=[]

        if (!selectedLineTypes || selectedLineTypes.length === 0) {
          this.materialTypeOptions = []
        }

        // 获取物资类型数据
        await this.getMaterialTypeList(selectedLineTypes)
      },
      async getMaterialTypeList(lineTypes) {
        const params = {
          constructionType:lineTypes
        }
        try {
          // 调用接口获取物资类型数据
          const res = await getMaterialTypeList(params)

          if (res.code === 200 && res.data) {
            // 处理返回的物资类型数据
            const materialTypes = res.data.map(item => ({
              value: item.typeId,
              label: item.typeName
            }))

            // 更新选项并缓存
            this.materialTypeOptions = materialTypes
          } else {
            this.$message.error('获取物资类型失败')
            this.materialTypeOptions = []
          }
        } catch (error) {
          console.error('获取物资类型列表失败:', error)
          this.$message.error('获取物资类型列表失败')
          this.materialTypeOptions = []
        }
      },
      async handleMaterialTypeChange(e){
        this.queryParams.typeName=null
        this.typeNameOptions=[]
        this.queryParams.typeModelName=null
        this.typeModelNameOptions=[]
        getDeviceType({ level: 3, typeId:e }).then(response => {
          let matNameRes = response.data
          this.typeNameOptions = matNameRes.map((item) => {
            return {
              label: item.typeName,
              value: item.typeId
            }
          })
        })
      },
      async handleTypeNameChange(e){
        this.queryParams.typeModelName=null
        this.typeModelNameOptions=[]
        getDeviceType({ level: 4, typeId:e }).then(response => {
          let matNameRes = response.data
          this.typeModelNameOptions = matNameRes.map((item) => {
            return {
              label: item.typeName,
              value: item.typeId
            }
          })
        })
      },
      getDeviceType() {
        getDeviceType({ level: 3 }).then(response => {
          let matNameRes = response.data
          this.typeNameOptions = matNameRes.map((item) => {
            return {
              label: item.typeName,
              value: item.typeId
            }
          })
        })
        getDeviceType({ level: 4 }).then(response => {
          let matModelRes = response.data
          this.typeModelNameOptions = matModelRes.map((item) => {
            return {
              label: item.typeName,
              value: item.typeId
            }
          })
        })
      },
      indexContinuationForTable(num, size) {
        let number = (num - 1) * size
        console.log(number)
        if(number==0){
          return "合计"
        }else{
          return number
        }
      },
      // 合并单元格 rowIndex=行数  columnIndex=列数
      // 这里是合并table的除表头外的第一行的第二列 + 除表头外的第二行的第二列
      // 注意列数和行数从 0 开始
      objectSpanMethod ({ row, column, rowIndex, columnIndex }) {
        if (rowIndex === 0 && columnIndex == 0) {
          let rowspan = 1
          let colspan = 6
          return { rowspan, colspan }
        }
        // 解决偏移的重要代码
        // 重点在 else if 判断必须加因为合并单元格数据会出现偏移、
        // 否则如果是 第二行 的 第二列 那么隐藏原有第二行 的 第二列的数据使他隐藏
        else if (rowIndex === 0 && columnIndex < 6) {
          return {
            rowspan: 0,
            colspan: 0
          }
        }
      },
      /** 搜索按钮操作 */
      handleQuery() {
          this.queryParams.pageNum = 1
          this.getList()
      },
      /** 重置按钮操作 */
      resetQuery() {
          this.resetForm('queryForm')
          this.handleQuery()
      },
      /** 导出按钮操作 */
      handleExport() {
        const formatTime = (date) => {
          const year = date.getFullYear();
          const month = String(date.getMonth() + 1).padStart(2, '0');
          const day = String(date.getDate()).padStart(2, '0');
          const hours = String(date.getHours()).padStart(2, '0');
          const minutes = String(date.getMinutes()).padStart(2, '0');
          const seconds = String(date.getSeconds()).padStart(2, '0');
          return `${year}${month}${day}_${hours}${minutes}${seconds}`;
        };

        const currentTime = formatTime(new Date());
        let param = {
          keyWord: this.queryParams.keyWord,
          typeNameId: this.queryParams.typeName,
          typeModelNameId: this.queryParams.typeModelName,
          constructionTypes:this.queryParams.lineTypes,
          materialTypeId:this.queryParams.materialType,
          jiJuType:this.queryParams.jiJuType
        }
          this.download(
              'material/complex_query/exportRetainedEquipmentList',
                param,
              `综合查询_保有设备总量_${currentTime}.xlsx`,
          )
      },
      //跳转领料
      jumpLease(code){
        this.$router.push({ path: "/lease/outBound", query: {'code':code} });
      },
      //跳转维修
      jumpRepair(code){
        this.$router.push({ path: "/repair/repairManage", query: {'code':code} });
      },
      // 跳转新购待入库
      jumpInput(code){
        this.$router.push({ path: "/purchase/goodsEntry", query: {'code':code} });
      },
       // 跳转修试后入库
      jumpRepairInput(code){
        this.$router.push({ path: "/repair/testedInBound", query: {'code':code} });
      },
// ------------------
      //查看在库编码数据
      openRecords(row) {
        this.openRecord = true
        this.dialogQuery.keyWord = ""
        this.dialogQuery.typeId = row.typeId;
        this.dialogQuery.pageNum = 1
        this.dialogQuery.pageSize = 10
        this.dialogList = []
        this.getStoreCodeList()
      },
      /** 查询在库编码列表 */
      getStoreCodeList() {
        getStorageInfoListApi(this.dialogQuery).then((response) => {
          this.dialogList = response.data.rows
          this.dialogTotal = response.data.total
        })
      },
      /** 搜索在库按钮操作 */
      handleDialogQuery() {
          this.dialogQuery.pageNum = 1
          this.getStoreCodeList()
      },
      handleDialogStoreExport() {
        const formatTime = (date) => {
          const year = date.getFullYear();
          const month = String(date.getMonth() + 1).padStart(2, '0');
          const day = String(date.getDate()).padStart(2, '0');
          const hours = String(date.getHours()).padStart(2, '0');
          const minutes = String(date.getMinutes()).padStart(2, '0');
          const seconds = String(date.getSeconds()).padStart(2, '0');
          return `${year}${month}${day}_${hours}${minutes}${seconds}`;
        };

        const currentTime = formatTime(new Date());
          this.download(
              'material/complex_query/exportStorageInfoList',
              { ...this.dialogQuery},
              `综合查询_在库设备_${currentTime}.xlsx`,
          )
      },
// ------------------
      //查看在用设备
      openUserRecords(row) {
        this.openUseRecord = true
        this.dialogUseQuery.typeId= row.typeId
        this.dialogUseQuery.keyWord = "";
        this.dialogUseQuery.pageNum = 1
        this.dialogUseQuery.pageSize = 10
        this.useRecordList = []
        this.getUserRecords()
      },
      /** 查询在用设备列表 */
      getUserRecords() {
        getUserRecordListApi(this.dialogUseQuery).then((response) => {
          this.useRecordList = response.data.rows
          this.dialogUserTotal = response.data.total
        })
      },
       /** 搜索在用按钮操作 */
      handleDialogUseQuery() {
          this.dialogUseQuery.pageNum = 1
          this.getUserRecords()
      },
      handleDialogUserExport() {
        const formatTime = (date) => {
          const year = date.getFullYear();
          const month = String(date.getMonth() + 1).padStart(2, '0');
          const day = String(date.getDate()).padStart(2, '0');
          const hours = String(date.getHours()).padStart(2, '0');
          const minutes = String(date.getMinutes()).padStart(2, '0');
          const seconds = String(date.getSeconds()).padStart(2, '0');
          return `${year}${month}${day}_${hours}${minutes}${seconds}`;
        };

        const currentTime = formatTime(new Date());
          this.download(
              'material/complex_query/exportUserRecordList',
              { ...this.dialogUseQuery},
              `综合查询_在用设备_${currentTime}.xlsx`,
          )
      },
// ------------------
      //查看在修设备
      openRepairRecords(row,type) {
        this.openRepairRecord = true
        this.dialogRepairQuery.typeId= row.typeId
        this.dialogRepairQuery.pageNum = 1;
        this.dialogRepairQuery.keyWord = "";
        this.dialogRepairQuery.pageNum = 1
        this.dialogRepairQuery.pageSize = 10
        this.repairRecordList = []
        this.dialogRepairQuery.type=type
        this.getRepairRecords()
      },
      /** 查询在修设备列表 */
      getRepairRecords() {
        getRepairRecordListApi(this.dialogRepairQuery).then((response) => {
          this.repairRecordList = response.data.rows
          this.dialogRepairTotal = response.data.total
        })
      },
       /** 搜索在修按钮操作 */
      handleDialogRepairQuery() {
          this.dialogRepairQuery.pageNum = 1
          this.getRepairRecords()
      },
      handleDialogRepairExport() {
        const formatTime = (date) => {
          const year = date.getFullYear();
          const month = String(date.getMonth() + 1).padStart(2, '0');
          const day = String(date.getDate()).padStart(2, '0');
          const hours = String(date.getHours()).padStart(2, '0');
          const minutes = String(date.getMinutes()).padStart(2, '0');
          const seconds = String(date.getSeconds()).padStart(2, '0');
          return `${year}${month}${day}_${hours}${minutes}${seconds}`;
        };

        const currentTime = formatTime(new Date());
          this.download(
              'material/complex_query/exportRepairRecordList',
              { ...this.dialogRepairQuery},
              `综合查询_在修设备_${currentTime}.xlsx`,
          )
      },
// ------------------
      //查看新购入库设备
      openPurchaseRecords(row) {
        this.openPurchaseRecord = true
        this.dialogPurchaseQuery.typeId= row.typeId
        this.dialogPurchaseQuery.pageNum = 1;
        this.dialogPurchaseQuery.pageSize = 10
        this.dialogPurchaseQuery.keyWord = "";
        this.purchaseRecordList = []
        this.getPurchaseRecords()
      },
      /** 查询新购入库设备列表 */
      getPurchaseRecords() {
        getPurchaseRecordListApi(this.dialogPurchaseQuery).then((response) => {
          this.purchaseRecordList = response.data.rows
          this.dialogPurchaseTotal = response.data.total
        })
      },
       /** 搜索新购入库按钮操作 */
      handleDialogPurchaseQuery() {
          this.dialogPurchaseQuery.pageNum = 1
          this.getPurchaseRecords()
      },
      handleDialogPurchaseExport() {
        const formatTime = (date) => {
          const year = date.getFullYear();
          const month = String(date.getMonth() + 1).padStart(2, '0');
          const day = String(date.getDate()).padStart(2, '0');
          const hours = String(date.getHours()).padStart(2, '0');
          const minutes = String(date.getMinutes()).padStart(2, '0');
          const seconds = String(date.getSeconds()).padStart(2, '0');
          return `${year}${month}${day}_${hours}${minutes}${seconds}`;
        };

        const currentTime = formatTime(new Date());
          this.download(
              'material/complex_query/exportPurchaseRecordList',
              { ...this.dialogPurchaseQuery},
              `综合查询_新购入库设备_${currentTime}.xlsx`,
          )
      },
// ------------------
      //查看修试入库设备
      openTestedRecords(row) {
        this.openTestedRecord = true
        this.dialogTestedQuery.typeId= row.typeId
        this.dialogTestedQuery.pageNum = 1;
        this.dialogTestedQuery.pageSize = 10
        this.dialogTestedQuery.keyWord = "";
        this.testedRecordList = []
        this.getTestedRecords()
      },
      /** 查询修试入库设备列表 */
      getTestedRecords() {
        getRepairInputListApi(this.dialogTestedQuery).then((response) => {
          this.testedRecordList = response.data.rows
          this.dialogTestedTotal = response.data.total
        })
      },
       /** 搜索修试入库按钮操作 */
      handleDialogTestedQuery() {
          this.dialogTestedQuery.pageNum = 1
          this.getTestedRecords()
      },
      handleDialogTestedExport() {
        const formatTime = (date) => {
          const year = date.getFullYear();
          const month = String(date.getMonth() + 1).padStart(2, '0');
          const day = String(date.getDate()).padStart(2, '0');
          const hours = String(date.getHours()).padStart(2, '0');
          const minutes = String(date.getMinutes()).padStart(2, '0');
          const seconds = String(date.getSeconds()).padStart(2, '0');
          return `${year}${month}${day}_${hours}${minutes}${seconds}`;
        };

        const currentTime = formatTime(new Date());
          this.download(
              'material/complex_query/exportRepairInputList',
              { ...this.dialogTestedQuery},
              `综合查询_修试后入库设备_${currentTime}.xlsx`,
          )
      },


      //查看待报废设备
      openToScrapRecords(row) {
        this.openToScrapRecord = true
        this.dialogToScrapQuery.typeId= row.typeId
        this.dialogToScrapQuery.pageNum = 1;
        this.dialogToScrapQuery.pageSize = 10
        this.dialogToScrapQuery.keyWord = "";
        this.toScrapRecordList = []
        this.getToScrapRecords()
      },
      /** 查询待报废设备列表 */
      getToScrapRecords() {
        getToScrapInputListApi(this.dialogToScrapQuery).then((response) => {
          this.toScrapRecordList = response.data.rows
          this.dialogToScrapTotal = response.data.total
        })
      },
       /** 搜索待报废按钮操作 */
      handleDialogToScrapQuery() {
          this.dialogToScrapQuery.pageNum = 1
          this.getToScrapRecords()
      },
      handleDialogToScrapExport() {
        const formatTime = (date) => {
          const year = date.getFullYear();
          const month = String(date.getMonth() + 1).padStart(2, '0');
          const day = String(date.getDate()).padStart(2, '0');
          const hours = String(date.getHours()).padStart(2, '0');
          const minutes = String(date.getMinutes()).padStart(2, '0');
          const seconds = String(date.getSeconds()).padStart(2, '0');
          return `${year}${month}${day}_${hours}${minutes}${seconds}`;
        };

        const currentTime = formatTime(new Date());
          this.download(
             'material/complex_query/exportScrapList',
              {...this.dialogToScrapQuery},
              `综合查询_待报废设备_${currentTime}.xlsx`,
          )
      },

      //查看已审核报废设备
      openAuditedRecords(row) {
        this.openAuditedRecord = true
        this.dialogAuditedQuery.typeId= row.typeId
        this.dialogAuditedQuery.pageNum = 1;
        this.dialogAuditedQuery.pageSize = 10
        this.dialogAuditedQuery.keyWord = "";
        this.auditedRecordList = []
        this.getAuditedRecords()
      },
      /** 查询已审核报废设备列表 */
      getAuditedRecords() {
        getAuditInputListApi(this.dialogAuditedQuery).then((response) => {
          this.auditedRecordList = response.data.rows
          this.dialogAuditedTotal = response.data.total
        })
      },
       /** 搜索已审核报废按钮操作 */
      handleDialogAuditedQuery() {
          this.dialogAuditedQuery.pageNum = 1
          this.getAuditedRecords()
      },
      handleDialogAuditedExport() {
        const formatTime = (date) => {
          const year = date.getFullYear();
          const month = String(date.getMonth() + 1).padStart(2, '0');
          const day = String(date.getDate()).padStart(2, '0');
          const hours = String(date.getHours()).padStart(2, '0');
          const minutes = String(date.getMinutes()).padStart(2, '0');
          const seconds = String(date.getSeconds()).padStart(2, '0');
          return `${year}${month}${day}_${hours}${minutes}${seconds}`;
        };

        const currentTime = formatTime(new Date());
          this.download(
             'material/complex_query/exportScrapAuditList',
              {...this.dialogAuditedQuery},
              `综合查询_已审核报废设备_${currentTime}.xlsx`,
          )
      },
    },
}
</script>
<style lang="scss" scoped>
::v-deep.el-table .fixed-width .el-button--mini {
    width: 60px !important;
    margin-bottom: 10px;
}
.clickText {
  color: #02a7f0;
  cursor: pointer;
}
</style>
