<!--结净计量数据维护-->
<template>
  <div class="systemBase">
    <div>
      <div class="isScreen">
        <el-checkbox v-model="icoreFilterFlag">是否筛选</el-checkbox>
      </div>
      <div style="margin-top: 10px; border-bottom: 1px solid #d5d5d5">
        <el-form
          ref="searchData"
          :inline="true"
          :model="search"
          :rules="ruleValidateSearch"
        >
          <el-form-item label-width="80px">
            <div style="font-size: 16px; padding: 0px 20px">
              结净计量数据维护
            </div>
          </el-form-item>
          <el-form-item prop="carNo" label="车号">
            <el-input
              v-model="search.carNo"
              clearable
              size="small"
              style="width: 120px"
              placeholder="请输入"
            ></el-input>
          </el-form-item>
          <el-form-item prop="strDate" label="开始时间">
            <el-date-picker
              v-model="search.strDate"
              clearable
              type="datetime"
              style="width: 180px"
              placeholder="选择日期"
              size="small"
            ></el-date-picker>
          </el-form-item>
          <el-form-item prop="envDate" label="结束时间">
            <el-date-picker
              v-model="search.envDate"
              clearable
              type="datetime"
              style="width: 180px"
              placeholder="选择日期"
              size="small"
            ></el-date-picker>
          </el-form-item>
          <el-form-item label-width="20px">
            <el-button
              icon="el-icon-search"
              type="primary"
              size="mini"
              @click="searchDatas"
              v-loading.fullscreen.lock="operateLoading"
              v-privilege="activeMenu + 'SEARCH'"
              >查询</el-button
            >
          </el-form-item>
          <el-form-item label-width="20px">
            <el-button
              icon="el-icon-check"
              type="primary"
              size="mini"
              @click="cleanData"
              v-loading.fullscreen.lock="operateLoading"
              v-privilege="activeMenu + 'CLEAN'"
              >结净</el-button
            >
          </el-form-item>
          <!-- <el-form-item label-width="20px">
                   <el-checkbox v-model="icoreFilterFlag">是否筛选</el-checkbox>
                   </el-form-item> -->
        </el-form>
      </div>
      <el-row>
        <el-col :span="12">
          <div style="border-right: 1px solid #d5d5d5">
            <div class="common-title-div">
              毛重数据<span style="color: red"
                >(只会查询出进行了审核的数据)</span
              >
            </div>
            <div class="common-table-div">
              <el-table
                v-loading="dataLoading"
                ref="dataTable"
                highlight-current-row
                border
                :height="tableHeight3"
                @current-change="handleCurrentChange"
                :icore-filter-flag="icoreFilterFlag"
                @row-click="getAllList"
                :data="table.list"
              >
                <el-table-column
                  type="index"
                  label="序号"
                  fixed="left"
                  align="center"
                ></el-table-column>
                <!-- <el-table-column type="selection" width="55" align="center"></el-table-column> -->
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="actualFirstNo"
                  label="作业编号"
                  min-width="110"
                  align="center"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="predictionNo"
                  label="预报编号"
                  min-width="80"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="carNo"
                  label="车号"
                  min-width="80"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="trailerNo"
                  label="挂号"
                  min-width="80"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="matterName"
                  label="物资名称"
                  min-width="120"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="meterWeight"
                  label="重量"
                  min-width="100"
                  align="left"
                >
                  <template slot-scope="scope">
                    {{ Math.floor((scope.row.meterWeight - 0) / 10) / 100 }}
                  </template>
                </el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="meterNum"
                  min-width="110"
                  label="数量"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="addWeight"
                  min-width="100"
                  label="附加重量"
                  align="left"
                >
                  <template slot-scope="scope">
                    {{ Math.floor((scope.row.addWeight - 0) / 10) / 100 }}
                  </template>
                </el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  min-width="100"
                  prop="baseSpotName"
                  label="计量点"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  min-width="160"
                  prop="createTime"
                  label="计量时间"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  min-width="100"
                  prop="createManName"
                  label="计量员"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  min-width="100"
                  prop="meterClass"
                  label="班次"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  min-width="100"
                  prop="meterGroup"
                  label="班组"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  min-width="100"
                  prop="contractNo"
                  label="合同号"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  min-width="100"
                  prop="batchNo"
                  label="批次号"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  min-width="200"
                  prop="customerSupplierName"
                  label="供应商"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  min-width="200"
                  prop="forwardingUnitName"
                  label="发货单位"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  min-width="200"
                  prop="receivingUintName"
                  label="收货单位"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  min-width="100"
                  prop="materialName"
                  label="材质"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  min-width="160"
                  prop="specName"
                  label="规格"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  min-width="100"
                  prop="bindCardNo"
                  label="绑定卡号"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  min-width="100"
                  prop="loadPointName"
                  label="卸货地点"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  min-width="200"
                  prop="carrierUnitName"
                  label="承运单位"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  min-width="100"
                  prop="meterTypeName"
                  label="业务类型"
                  align="left"
                ></el-table-column>
              </el-table>
            </div>
            <div class="common-foot-style">
              <el-pagination
                v-loading="dataLoading"
                @size-change="pageSizeChange"
                @current-change="pageCurrentChange"
                :current-page="page.pageNum"
                :page-sizes="[50, 100, 200, 400]"
                :page-size="page.pageSize"
                layout="total, sizes, prev, pager, next, jumper"
                :total="page.totalPage"
              >
              </el-pagination>
            </div>
          </div>
        </el-col>
        <el-col :span="12">
          <div class="common-title-div">皮重数据</div>
          <div class="common-table-div">
            <el-table
              v-loading="dataLoading2"
              ref="dataTable2"
              highlight-current-row
              border
              :height="tableHeight2"
              @current-change="handleCurrentChange2"
              :icore-filter-flag="icoreFilterFlag"
              :data="table.list2"
            >
              <el-table-column
                type="index"
                label="序号"
                fixed="left"
                align="center"
              ></el-table-column>
              <!-- <el-table-column type="selection" width="55" align="center"></el-table-column> -->
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="actualFirstNo"
                label="作业编号"
                min-width="110"
                align="center"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="predictionNo"
                label="预报编号"
                min-width="80"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="carNo"
                label="车号"
                min-width="110"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="trailerNo"
                label="挂号"
                min-width="80"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="110"
                prop="meterWeight"
                label="重量"
                align="left"
              >
                <template slot-scope="scope">
                  {{ Math.floor((scope.row.meterWeight - 0) / 10) / 100 }}
                </template>
              </el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="110"
                prop="meterNum"
                label="数量"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="110"
                prop="addWeight"
                label="附加重量"
                align="left"
              >
                <template slot-scope="scope">
                  {{ Math.floor((scope.row.addWeight - 0) / 10) / 100 }}
                </template>
              </el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="110"
                prop="baseSpotName"
                label="计量点"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="160"
                prop="createTime"
                label="计量时间"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="110"
                prop="createManName"
                label="计量员"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="110"
                prop="meterClass"
                label="班次"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="110"
                prop="meterGroup"
                label="班组"
                align="left"
              ></el-table-column>
            </el-table>
          </div>
          <div class="common-foot-style">
            <el-pagination
              v-loading="dataLoading2"
              @size-change="pageSizeChange2"
              @current-change="pageCurrentChange2"
              :current-page="page2.pageNum"
              :page-sizes="[50, 100, 200, 400]"
              :page-size="page2.pageSize"
              layout="total, sizes, prev, pager, next, jumper"
              :total="page2.totalPage"
            >
            </el-pagination>
          </div>
          <div class="common-title-div">期限皮重数据</div>
          <div class="common-table-div">
            <el-table
              v-loading="dataLoading4"
              ref="dataTable2"
              highlight-current-row
              border
              :height="tableHeight2"
              @current-change="handleCurrentChange4"
              :data="table.list4"
              :icore-filter-flag="icoreFilterFlag"
            >
              <el-table-column
                type="index"
                label="序号"
                fixed="left"
                align="center"
              ></el-table-column>
              <!-- <el-table-column type="selection" width="55" align="center"></el-table-column> -->
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="dataNo"
                label="数据编号"
                min-width="110"
                align="center"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="carNo"
                label="车号"
                min-width="80"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="110"
                prop="upWeight"
                label="上一次皮重/t"
                align="left"
              >
                <template slot-scope="scope">
                  {{ Math.floor((scope.row.upWeight - 0) / 10) / 100 }}
                </template>
              </el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="110"
                prop="avgWeight"
                label="平均皮重/t"
                align="left"
              >
                <template slot-scope="scope">
                  {{ Math.floor((scope.row.avgWeight - 0) / 10) / 100 }}
                </template>
              </el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="110"
                prop="meterNum"
                label="皮重次数"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="110"
                prop="meterName"
                label="皮重计量员"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="160"
                prop="meterTime"
                label="皮重计量时间"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="160"
                prop="startTime"
                label="有效开始时间"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="160"
                prop="endTime"
                label="有效结束时间"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="160"
                prop="warnTime"
                label="提醒留皮时间"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="baseSpotNo"
                label="皮重计量点编号"
                min-width="110"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="baseSpotName"
                label="皮重计量点名称"
                min-width="110"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="110"
                prop="meterWeight"
                label="皮重数据/t"
                align="left"
              >
                <template slot-scope="scope">
                  {{ Math.floor((scope.row.meterWeight - 0) / 10) / 100 }}
                </template>
              </el-table-column>
            </el-table>
          </div>
          <div class="common-foot-style">
            <el-pagination
              v-loading="dataLoading4"
              @size-change="pageSizeChange4"
              @current-change="pageCurrentChange4"
              :current-page="page4.pageNum"
              :page-sizes="[50, 100, 200, 400]"
              :page-size="page4.pageSize"
              layout="total, sizes, prev, pager, next, jumper"
              :total="page4.totalPage"
            >
            </el-pagination>
          </div>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <div
            style="
              margin-top: 10px;
              padding-top: 10px;
              border-bottom: 1px solid #d5d5d5;
              border-top: 1px solid #d5d5d5;
            "
          >
            <el-form
              ref="search2"
              :inline="true"
              :model="search2"
              :rules="ruleValidateSearch2"
            >
              <el-form-item label-width="80px">
                <div style="font-size: 16px; padding: 0px 20px; display: flex">
                  净重数据 （
                  <div
                    style="
                      width: 12px;
                      height: 12px;
                      background-color: #000000;
                      color: #000000;
                      margin-top: 8px;
                    "
                  ></div>
                  待审核
                  <div
                    style="
                      width: 12px;
                      height: 12px;
                      background-color: rgb(0, 116, 10);
                      color: rgb(0, 116, 10);
                      margin-left: 5px;
                      margin-top: 8px;
                    "
                  ></div>
                  待上传
                  <div
                    style="
                      width: 12px;
                      height: 12px;
                      background-color: red;
                      color: red;
                      margin-left: 5px;
                      margin-top: 8px;
                    "
                  ></div>
                  已上传）
                </div>
              </el-form-item>
              <el-form-item prop="carNo" label="车号">
                <el-input
                  v-model="search2.carNo"
                  size="small"
                  clearable
                  style="width: 120px"
                  placeholder="请输入"
                ></el-input>
              </el-form-item>
              <el-form-item prop="strDate" label="开始时间">
                <el-date-picker
                  v-model="search2.strDate"
                  type="datetime"
                  clearable
                  style="width: 180px"
                  placeholder="选择日期"
                  size="small"
                ></el-date-picker>
              </el-form-item>
              <el-form-item prop="envDate" label="结束时间">
                <el-date-picker
                  v-model="search2.envDate"
                  type="datetime"
                  clearable
                  style="width: 180px"
                  placeholder="选择日期"
                  size="small"
                ></el-date-picker>
              </el-form-item>
              <el-form-item label-width="20px">
                <el-button
                  icon="el-icon-search"
                  type="primary"
                  size="mini"
                  @click="searchData2s"
                  v-loading.fullscreen.lock="operateLoading"
                  v-privilege="activeMenu + 'SEARCH2'"
                  >查询</el-button
                >
              </el-form-item>
              <el-form-item label-width="20px">
                <el-button
                  type="danger"
                  plain
                  icon="el-icon-remove-outline"
                  size="mini"
                  @click="unCleanData"
                  v-loading.fullscreen.lock="operateLoading"
                  v-privilege="activeMenu + 'RELIEVE2'"
                  >解除</el-button
                >
              </el-form-item>
              <el-form-item label-width="20px">
                <el-button
                  type="primary"
                  size="mini"
                  @click="showBatchDialog"
                  v-privilege="activeMenu + 'BATCHEDIT'"
                  >批量修改</el-button
                >
              </el-form-item>
            </el-form>
          </div>
          <div class="common-table-div">
            <el-table
              v-loading="dataLoading3"
              ref="dataTable3"
              highlight-current-row
              border
              :height="tableHeight"
              @selection-change="handleSelectionChange"
              :data="table.list3"
              :row-class-name="tableRowClassName"
              :exchangeFilterMap="{
                uploadFlag: { '0': '待审核', '1': '待上传', '2': '已上传' },
                grossMode: {
                  '1': '远程计量',
                  '2': '智能计量',
                  '3': '手工录入',
                  '4': '放行智能计量',
                  '5': '滞后匹配',
                },
                tareMode: {
                  '1': '远程计量',
                  '2': '智能计量',
                  '3': '手工录入',
                  '4': '放行智能计量',
                  '5': '滞后匹配',
                },
                netMode: { '1': '正常结净', '2': '匹配结净' },
              }"
              :icore-filter-flag="icoreFilterFlag"
            >
              <el-table-column
                type="index"
                label="序号"
                fixed="left"
                align="center"
              ></el-table-column>
              <el-table-column
                type="selection"
                width="55"
                align="center"
                fixed="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="predictionNo"
                label="预报编号"
                min-width="80"
                align="left"
                fixed="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="carNo"
                label="车号"
                min-width="80"
                align="left"
                fixed="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="trailerNo"
                label="挂号"
                min-width="80"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="matterName"
                label="物资名称"
                min-width="120"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="100"
                prop="contractNo"
                label="合同号"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="100"
                prop="batchNo"
                label="批次号"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="100"
                prop="customerSupplierName"
                label="供应商"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="100"
                prop="forwardingUnitName"
                label="发货单位"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="100"
                prop="receivingUintName"
                label="收货单位"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="grossWeight"
                label="毛重/t"
                min-width="100"
                align="right"
              >
                <template slot-scope="scope">
                  {{ Math.floor((scope.row.grossWeight - 0) / 10) / 100 }}
                </template>
              </el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="tareWeight"
                label="皮重/t"
                min-width="100"
                align="right"
              >
                <template slot-scope="scope">
                  {{ Math.floor((scope.row.tareWeight - 0) / 10) / 100 }}
                </template>
              </el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="netWeight"
                label="净重/t"
                min-width="100"
                align="right"
              >
                <template slot-scope="scope">
                  {{ Math.floor((scope.row.netWeight - 0) / 10) / 100 }}
                </template>
              </el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="addWeight"
                label="附加重量/t"
                min-width="100"
                align="right"
              >
                <template slot-scope="scope">
                  {{ Math.floor((scope.row.addWeight - 0) / 10) / 100 }}
                </template>
              </el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="meterNum"
                min-width="110"
                label="数量"
                align="right"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="actualFirst1No"
                min-width="100"
                label="毛重作业编号"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="100"
                prop="baseSpot1Name"
                label="毛重计量点"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="160"
                prop="grossTime"
                label="毛重计量时间"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="100"
                prop="grossManName"
                label="毛重计量员"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="100"
                prop="grossClass"
                label="毛重班次"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="100"
                prop="grossGroup"
                label="毛重班组"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="100"
                prop="grossMode"
                label="毛重计量方式"
                align="left"
              >
                <template slot-scope="scope">
                  <span v-if="scope.row.grossMode == 1">远程计量</span>
                  <span v-else-if="scope.row.grossMode == 2">智能计量</span>
                  <span v-else-if="scope.row.grossMode == 3">手工录入</span>
                  <span v-else-if="scope.row.grossMode == 4">放行智能计量</span>
                  <span v-else-if="scope.row.grossMode == 5">滞后匹配</span>
                </template>
              </el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="100"
                prop="actualFirst2No"
                label="皮重作业编号"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="100"
                prop="baseSpot2Name"
                label="皮重计量点"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="160"
                prop="tareTime"
                label="皮重计量时间"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="100"
                prop="tareManName"
                label="皮重计量员"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="100"
                prop="netClass"
                label="皮重班次"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="100"
                prop="tareGroup"
                label="皮重班组"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="100"
                prop="tareMode"
                label="皮重计量方式"
                align="left"
              >
                <template slot-scope="scope">
                  <span v-if="scope.row.tareMode == 1">远程计量</span>
                  <span v-else-if="scope.row.tareMode == 2">智能计量</span>
                  <span v-else-if="scope.row.tareMode == 3">手工录入</span>
                  <span v-else-if="scope.row.tareMode == 4">放行智能计量</span>
                  <span v-else-if="scope.row.tareMode == 5">滞后匹配</span>
                </template>
              </el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="100"
                prop="netSpot3Name"
                label="净重计量点"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="160"
                prop="netTime"
                label="净重计量时间"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="100"
                prop="netManName"
                label="净重计量员"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="100"
                prop="netClass"
                label="净重班次"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="100"
                prop="netGroup"
                label="净重班组"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="80"
                prop="netMode"
                label="结净方式"
                align="left"
              >
                <template slot-scope="scope">
                  <span v-if="scope.row.netMode == 1">正常结净</span>
                  <span v-else-if="scope.row.netMode == 2">匹配结净</span>
                </template>
              </el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="100"
                prop="materialName"
                label="材质"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="100"
                prop="specName"
                label="规格"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="100"
                prop="loadPointName"
                label="卸货地点"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="100"
                prop="sampleNo"
                label="取样编号"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="100"
                prop="sampleVoucher"
                label="取样凭证"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="100"
                prop="carrierUnitName"
                label="承运单位"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="100"
                prop="meterTypeName"
                label="业务类型"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                min-width="80"
                prop="uploadFlag"
                label="状态"
                align="center"
              >
                <template slot-scope="scope">
                  <span v-if="scope.row.uploadFlag == 0">待审核</span>
                  <span v-else-if="scope.row.uploadFlag == 1">待上传</span>
                  <span v-else-if="scope.row.uploadFlag == 2">已上传</span>
                </template>
              </el-table-column>
            </el-table>
          </div>
          <div class="common-foot-style">
            <el-pagination
              v-loading="dataLoading3"
              @size-change="pageSizeChange3"
              @current-change="pageCurrentChange3"
              :current-page="page3.pageNum"
              :page-sizes="[50, 100, 200, 400]"
              :page-size="page3.pageSize"
              layout="total, sizes, prev, pager, next, jumper"
              :total="page3.totalPage"
            >
            </el-pagination>
          </div>
        </el-col>
      </el-row>
    </div>
    <!-- 批量编辑弹窗 -->
    <batch-edit-dialog
      type="clean"
      :showFlag="editDialogVisible"
      :baseData="batchEditData"
      :dataList="batchEditList"
      @close="closeDialog"
    >
    </batch-edit-dialog>
  </div>
</template>
<script>
import { formatDate, getCookie } from '@/utils/util.js';
import { cookieUserId, cookieUserName } from '@/config/config.js';
import batchEditDialog from './common/batchEditDialog';
export default {
  data () {
    return {
      dataLoading: false,
      dataLoading2: false,
      dataLoading3: false,
      dataLoading4: false,
      operateLoading: false,
      icoreFilterFlag: false,
      page: {
        pageSize: 100,
        pageNum: 1,
        totalPage: 0
      },
      page2: {
        pageSize: 100,
        pageNum: 1,
        totalPage: 0
      },
      page3: {
        pageSize: 100,
        pageNum: 1,
        totalPage: 0
      },
      page4: {
        pageSize: 100,
        pageNum: 1,
        totalPage: 0
      },
      table: {
        list: [],
        list2: [],
        list3: [],
        list4: []
      },
      multipleSelection3: [],
      multipleSelection: {},
      multipleSelection2: {},
      multipleSelection4: {},
      tableHeight: 0,
      tableHeight2: 0,
      tableHeight3: 0,
      dataList: {},
      search: {
        carNo: '',
        strDate: '',
        envDate: ''
      },
      search2: {
        carNo: '',
        strDate: '',
        envDate: ''
      },
      ruleValidateSearch: {
        envDate: [{
          required: true,
          validator: this.endTimeVerify,
          trigger: 'blur'
        }],
        strDate: [{
          required: true,
          validator: this.strTimeVerify,
          trigger: 'blur'
        }]
      },
      ruleValidateSearch2: {
        envDate: [{
          required: true,
          validator: this.endTimeVerify2,
          trigger: 'blur'
        }],
        strDate: [{
          required: true,
          validator: this.strTimeVerify2,
          trigger: 'blur'
        }]
      },
      activeMenu: '',
      userNo: '',
      userName: '',
      editDialogVisible: false,
      batchEditData: {},
      batchEditList: []
    }
  },
  created () {
    this.tableHeight = window.innerHeight - 550;
    this.tableHeight2 = '80px';
    this.tableHeight3 = '210px';
    this.search.envDate = new Date()
    this.search.strDate = new Date(new Date().setDate(new Date().getDate() - 7))
    this.search2.envDate = new Date()
    this.search2.strDate = new Date(new Date().setDate(new Date().getDate() - 7))
    this.activeMenu = window.top.localStorage.getItem('activeMenu')
    this.userNo = getCookie(cookieUserId)
    this.userName = getCookie(cookieUserName)
  },
  mounted () {
    this.init()
  },
  methods: {
    init () {
      this.searchDatas()
      this.searchData2s()
    },
    endTimeVerify (rule, value, callback) {
      if (this.search.strDate && !this.search.envDate) {
        callback(new Error('结束时间不能为空！'));
      } else if (this.search.envDate) {
        if (Date.parse(this.search.envDate) > Date.parse(this.search.strDate)) {
          callback();
        } else {
          callback(new Error('结束时间不得早于开始时间！'));
        }
      } else {
        callback();
      }
    },
    strTimeVerify (rule, value, callback) {
      if (this.search.envDate && !this.search.strDate) {
        callback(new Error('开始时间不能为空！'));
      } else {
        callback()
      }
    },
    endTimeVerify2 (rule, value, callback) {
      if (this.search2.strDate !== '' && this.search2.envDate === '') {
        callback(new Error('结束时间不能为空！'));
      } else if (this.search2.envDate) {
        if (Date.parse(this.search2.envDate) > Date.parse(this.search2.strDate)) {
          callback();
        } else {
          callback(new Error('结束时间不得早于开始时间！'));
        }
      } else {
        callback();
      }
    },
    strTimeVerify2 (rule, value, callback) {
      if (this.search2.envDate !== '' && this.search2.strDate === '') {
        callback(new Error('开始时间不能为空！'));
      } else {
        callback()
      }
    },
    getDataList () {//毛重
      this.table.list2 = [];
      this.table.list4 = [];
      this.dataLoading = true;
      this.axios.get('pass/systemBase/v1/meterworkcaractualfirsts/selectTa' + '?pageNum=' + this.page.pageNum + '&pageSize=' + this.page.pageSize + '&weightType=0')
        .then(res => {
          this.dataLoading = false;
          this.table.list = res.data.list;
          this.page.totalPage = res.data.total;
          if (this.table.list.length > 0) {
            this.$refs.dataTable.setCurrentRow(this.table.list[0])
            this.getDataList2(this.table.list[0])
            this.getDataList4(this.table.list[0])
          }
        }).catch(e => {
          this.dataLoading = false;
        });
    },
    getAllList (val) {
      this.getDataList2(val)
      this.getDataList4(val)
    },
    getDataList2 (row) {//皮重
      this.dataLoading2 = true;
      this.dataList = row
      this.axios.get('pass/systemBase/v1/meterworkcaractualfirsts/selectNet' + '?pageNum=' + this.page2.pageNum + '&pageSize=' + this.page2.pageSize + '&weightType=1' + '&carNo=' + row.carNo)
        .then(res => {
          this.dataLoading2 = false;
          this.table.list2 = res.data.list;
          this.page2.totalPage = res.data.total;
        }).catch(e => {
          this.dataLoading2 = false;
        });
    },
    // 关闭批量修改弹窗
    closeDialog () {
      this.editDialogVisible = false
      this.multipleSelection3 = []
      this.batchEditList = []
      this.$refs.dataTable3.clearSelection();
      this.init()
    },
    getDataList3 () {//净重
      this.dataLoading3 = true;
      this.axios.get('pass/systemBase/v1/meterworkcaractuals/' + '?pageNum=' + this.page3.pageNum + '&pageSize=' + this.page3.pageSize + '&uploadFlag=0')
        .then(res => {
          this.dataLoading3 = false;
          this.table.list3 = res.data.list;
          this.page3.totalPage = res.data.total;
        }).catch(e => {
          this.dataLoading3 = false;
        });
    },
    getDataList4 (row) {//期限皮重
      this.dataLoading4 = true;
      this.axios.get('pass/systemBase/v1/meterbasetermtaredatas/selectBy' + '?pageNum=' + this.page4.pageNum + '&pageSize=' + this.page4.pageSize + '&carNo=' + row.carNo)
        .then(res => {
          this.dataLoading4 = false;
          this.table.list4 = res.data.list;
          this.page4.totalPage = res.data.total;
        }).catch(e => {
          this.dataLoading4 = false;
        });
    },
    // 显示批量修改弹窗
    showBatchDialog () {
      try {
        this.multipleSelection3.forEach(item => {
          if (item.valueFlag - 0 !== 0) {
            if (item.valueFlag - 0 === 1) {
              throw new Error(`选中数据中存在已作废的数据，不能进行批量修改`)
            }
          }
        })
      } catch (e) {
        return this.$message.error(e.message)
      }
      if (this.multipleSelection3.length === 0) {
        return this.$message.error('请选择要进行批量修改的数据')
      }
      this.batchEditList = [...this.multipleSelection3]
      this.editDialogVisible = true;
    },
    searchData2s () {
      this.page3.pageNum = 1;
      this.searchData2()
    },
    searchData2 () {//查询净重
      this.$refs['search2'].validate((valid) => {
        if (valid) {
          this.dataLoading3 = true;
          this.search2.strDate = formatDate(this.search2.strDate, 'yyyy-MM-dd HH:mm:ss')
          this.search2.envDate = formatDate(this.search2.envDate, 'yyyy-MM-dd HH:mm:ss')
          this.axios.get('pass/systemBase/v1/meterworkcaractuals/' + '?pageNum=' + this.page3.pageNum + '&pageSize=' + this.page3.pageSize + '&carNo=' + this.search2.carNo
            + '&netTime1=' + this.search2.strDate + '&netTime2=' + this.search2.envDate + '&uploadFlag=0')
            .then(res => {
              this.dataLoading3 = false;
              this.table.list3 = res.data.list;
              this.page3.totalPage = res.data.total;
            }).catch(e => {
              this.dataLoading3 = false;
            });
        }
      })
    },
    searchDatas () {
      this.page.pageNum = 1;
      this.searchData()
    },
    searchData () {//查询毛重
      this.table.list2 = [];
      this.table.list4 = [];
      this.$refs['searchData'].validate((valid) => {
        if (valid) {
          this.dataLoading = true;
          this.search.strDate = formatDate(this.search.strDate, 'yyyy-MM-dd HH:mm:ss')
          this.search.envDate = formatDate(this.search.envDate, 'yyyy-MM-dd HH:mm:ss')
          this.axios.get('pass/systemBase/v1/meterworkcaractualfirsts/selectTa' + '?pageNum=' + this.page.pageNum + '&pageSize=' + this.page.pageSize + '&carNo=' + this.search.carNo
            + '&createTime1=' + this.search.strDate + '&createTime2=' + this.search.envDate + '&weightType=0')
            .then(res => {
              this.dataLoading = false;
              this.table.list = res.data.list;
              this.page.totalPage = res.data.total;
              if (this.table.list.length > 0) {
                this.$refs.dataTable.setCurrentRow(this.table.list[0])
                this.getDataList2(this.table.list[0])
                this.getDataList4(this.table.list[0])
              }
            }).catch(e => {
              this.dataLoading = false;
            });
        }
      })
    },
    //洁净
    cleanData () {
      console.log(this.multipleSelection, '选中的毛重数据')
      console.log(this.multipleSelection2, '选中的皮重数据')
      console.log(this.multipleSelection4, '选中的期限皮重数据')
      if (JSON.stringify(this.multipleSelection2) == "{}" && JSON.stringify(this.multipleSelection4) == "{}") {
        return this.$message.warning('请选择皮重数据！');
      } else if (JSON.stringify(this.multipleSelection4) == "{}" || JSON.stringify(this.multipleSelection4) == 'null') {
        const param = {
          createManNo: this.userNo,
          createManName: this.userName,
          operationPage: '结净计量数据维护',
          operationFunction: "洁净",
          operationId: '',
          operationPredictionNo: this.multipleSelection.predictionNo,
          operationCarnNo: this.multipleSelection.carNo,
          operationBeforeFix: this.multipleSelection.actualFirstNo,
          operationAfterFix: this.multipleSelection2.actualFirstNo
        }
        let obj = {}
        obj.actualFirstNo = this.multipleSelection.actualFirstNo
        obj.dataNo = this.multipleSelection2.actualFirstNo
        this.axios.post('pass/systemBase/v1/meterworkcaractuals/clean' + '?actualFirstNo=' + obj.actualFirstNo + '&dataNo=' + obj.dataNo, { individualType: 'json' }).then(async res => {
          if (res.succeed) {
            console.log('结净接口的返回结果', res.data)
            param.operationId = res.data.id
            const log = await this.axios.post('pass/systemBase/v1/meterbaseoperationlogs/addList', [param], { individualType: 'json' })
            if (!log.succeed) {
              this.$message.error('洁净操作日志保存失败')
            }
            this.$message.success('洁净成功');
            this.getDataList()
            this.getDataList3()
            // } catch (e) {
            //   console.log(e)
            // }
          } else {
            this.$message.error(res.message)
          }
        }).catch(e => {
          console.log(e)
          this.$message.error(e.message)
        })
      } else if (JSON.stringify(this.multipleSelection2) == "{}" || JSON.stringify(this.multipleSelection2) == 'null') {
        const param = {
          createManNo: this.userNo,
          createManName: this.userName,
          operationPage: '结净计量数据维护',
          operationFunction: "洁净",
          operationId: '',
          operationPredictionNo: this.multipleSelection.predictionNo,
          operationCarnNo: this.multipleSelection.carNo,
          operationBeforeFix: this.multipleSelection.actualFirstNo, // 毛重编号
          operationAfterFix: this.multipleSelection4.actualFirstNo // 皮重编号
        }
        let obj = {}
        obj.actualFirstNo = this.multipleSelection.actualFirstNo
        obj.dataNo = this.multipleSelection4.dataNo
        this.axios.post('pass/systemBase/v1/meterworkcaractuals/termclean' + '?actualFirstNo=' + obj.actualFirstNo + '&dataNo=' + obj.dataNo, { individualType: 'json' }).then(async res => {
          if (res.succeed) {
            param.operationId = res.data.id
            const res1 = await this.axios.post('pass/systemBase/v1/meterbaseoperationlogs/addList', [param], { individualType: 'json' })
            if (!res1.succeed) {
              this.$message.error('洁净操作日志保存失败')
            }
            this.$message.success('洁净成功');
            this.getDataList()
            this.getDataList3()
          } else {
            this.$message.error(res.message)
          }
        }).catch(e => {
          this.$message.error(e.message)
        })
      }
    },
    //解除
    unCleanData () {
      if (this.multipleSelection3.length < 1) {
        this.$message.warning('请选择您要解除结净的数据！');
        return false;
      }
      const param = {
        createManNo: this.userNo,
        createManName: this.userName,
        operationPage: '结净计量数据维护',
        operationFunction: "解除",
        operationId: this.multipleSelection3[0].id,
        operationPredictionNo: this.multipleSelection3[0].predictionNo,
        operationCarnNo: this.multipleSelection3[0].carNo,
        operationBeforeFix: this.multipleSelection3[0].actualFirst1No,
        operationAfterFix: this.multipleSelection3[0].actualFirst2No
      }
      this.axios.post('pass/systemBase/v1/meterworkcaractuals/remove', this.multipleSelection3, { individualType: 'json' }).then(async res => {
        if (res.code == '0' || res.code == '200') {
          const res1 = await this.axios.post('pass/systemBase/v1/meterbaseoperationlogs/addList', [param], { individualType: 'json' })
          if (!res1.succeed) {
            this.$message.error('解除日志保存失败')
          }
          this.$message.success('解除成功');
          this.getDataList();
          this.getDataList3();
        } else {
          this.$message.error(res.message)
        }
      }).catch(e => {
        this.$message.error(e.message)
      })
    },
    tableRowClassName ({
      row,
      rowIndex
    }) {
      if (row.uploadFlag === '2') {
        return 'error-row2';
      } else if (row.uploadFlag === '1') {
        return 'wait-row'
      }
      return '';
    },
    handleCurrentChange (val) {//毛重
      this.multipleSelection = val;
    },
    pageSizeChange (size) {
      this.page.pageSize = size;
      this.searchData()
    },
    pageCurrentChange (index) {
      this.page.pageNum = index;
      this.searchData()
    },
    handleCurrentChange2 (val) {//皮重
      this.multipleSelection2 = val;
    },
    pageSizeChange2 (size) {
      this.page2.pageSize = size;
      this.getDataList2(this.dataList);
    },
    pageCurrentChange2 (index) {
      this.page2.pageNum = index;
      this.getDataList2(this.dataList);
    },
    handleSelectionChange (val) {//净重
      this.multipleSelection3 = val;
      if (this.multipleSelection3.length > 0) {
        this.batchEditData = { ...val[0] }
        this.$refs.dataTable3.setCurrentRow(val[val.length - 1])
      }
    },
    pageSizeChange3 (size) {
      this.page3.pageSize = size;
      this.searchData2()
    },
    pageCurrentChange3 (index) {
      this.page3.pageNum = index;
      this.searchData2()
    },
    handleCurrentChange4 (val) {//期限皮重
      this.multipleSelection4 = val;
    },
    pageSizeChange4 (size) {
      this.page4.pageSize = size;
      this.getDataList4(this.dataList);
    },
    pageCurrentChange4 (index) {
      this.page4.pageNum = index;
      this.getDataList4(this.dataList);
    },
  },
  components: {
    batchEditDialog
  }
}
</script>

<style scoped>
</style>