<!--汽车衡集装箱计量预约管理-->
<template>
  <div class="systemBase">
    <div>
      <el-row>
        <el-col :span="24">
          <div style="margin-top: 10px; border-bottom: 1px solid #d5d5d5">
            <el-form
              ref="searchData2"
              :inline="true"
              :model="search2"
              :rules="ruleValidateSearch2"
              style="padding-left: 12px"
            >
              <el-form-item>
                <div style="font-size: 16px; padding: 0px 20px">
                  通知单号信息
                </div>
              </el-form-item>
              <el-form-item prop="noticeNo" label="通知单号">
                <el-input
                  v-model="search2.noticeNo"
                  clearable
                  size="small"
                  style="width: 120px"
                  placeholder="请输入"
                ></el-input>
              </el-form-item>
              <el-form-item prop="contractNo" label="合同号">
                <el-input
                  v-model="search2.contractNo"
                  clearable
                  size="small"
                  style="width: 120px"
                  placeholder="请输入"
                ></el-input>
              </el-form-item>
              <el-form-item prop="batchNo" label="批次号">
                <el-input
                  v-model="search2.batchNo"
                  clearable
                  size="small"
                  style="width: 120px"
                  placeholder="请输入"
                ></el-input>
              </el-form-item>
              <el-form-item prop="customerSupplierName" label="供应商">
                <el-select
                  v-model="search2.customerSupplierName"
                  clearable
                  filterable
                  collapse-tags
                  size="small"
                  style="width: 120px"
                  :filter-method="filterCust"
                >
                  <el-option
                    v-for="item in customerList"
                    :key="item.customerSupplierNo"
                    :label="item.customerSupplierName"
                    :value="item.customerSupplierName"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item prop="receivingUintName" label="收货单位">
                <el-select
                  v-model="search2.receivingUintName"
                  clearable
                  filterable
                  collapse-tags
                  size="small"
                  style="width: 120px"
                  :filter-method="filterRcv"
                >
                  <el-option
                    v-for="item in receiverList"
                    :key="item.customerSupplierNo"
                    :label="item.customerSupplierName"
                    :value="item.customerSupplierName"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item prop="meterTypeName" label="业务类型">
                <el-select
                  v-model="search2.meterTypeName"
                  clearable
                  filterable
                  collapse-tags
                  size="small"
                  style="width: 120px"
                >
                  <el-option
                    v-for="(item, index) in meterTypeNameItem"
                    :key="index"
                    :label="item.baseName"
                    :value="item.baseName"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item prop="matterNo" label="物资名称">
                <el-select
                  v-model="search2.matterNo"
                  clearable
                  filterable
                  collapse-tags
                  size="small"
                  style="width: 120px"
                  :filter-method="getMatterName2"
                >
                  <el-option
                    v-for="item in matterNameItem2"
                    :key="item.matterNo"
                    :label="item.matterName"
                    :value="item.matterNo"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item prop="valueFlag" label="状态">
                <el-select
                  v-model="search2.valueFlag"
                  clearable
                  filterable
                  collapse-tags
                  size="small"
                  style="width: 120px"
                >
                  <el-option
                    v-for="(item, index) in valueFlagItem2"
                    :key="index"
                    :label="item.valueFlag"
                    :value="item.valueFlag"
                  >
                  </el-option>
                </el-select>
              </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 + 'SEARCH3'"
                  >查询</el-button
                >
              </el-form-item>
            </el-form>
          </div>
          <div class="common-table-div">
            <el-table
              v-loading="dataLoading3"
              @row-click="rowChange3"
              ref="dataTable3"
              highlight-current-row
              border
              :height="tableHeight"
              :data="table.list3"
              :bigDataShow="groupList1"
              @cell-click="getDataList"
              :exchangeFilterMap="{ valueFlag: { '0': '可使用', '1': '关闭' } }"
              :icore-filter-flag="icoreFilterFlag"
            >
              <el-table-column
                type="index"
                label="序号"
                fixed="left"
                align="center"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="noticeNo"
                label="通知单号"
                min-width="110"
                align="center"
              ></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="contractNo"
                label="合同号"
                min-width="100"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="batchNo"
                min-width="110"
                label="批次号"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="customerSupplierName"
                min-width="160"
                label="供应商"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="sourceArea"
                min-width="160"
                label="原产地"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="forwardingUnitName"
                min-width="160"
                label="发货单位"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="receivingUintName"
                min-width="160"
                label="收货单位"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="materialName"
                min-width="100"
                label="材质"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="specName"
                min-width="100"
                label="规格"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="loadPointName"
                min-width="100"
                label="卸货地点"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="carrierUnitName"
                min-width="100"
                label="承运单位"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="meterTypeName"
                min-width="100"
                label="业务类型"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="transportTypeName"
                min-width="100"
                label="运输类型"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="memo"
                min-width="100"
                label="备注"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="valueFlag"
                label="状态"
                width="60"
                min-width="100"
                align="center"
              >
                <template slot-scope="scope">
                  <span v-if="scope.row.valueFlag == 0">可使用</span>
                  <span v-else-if="scope.row.valueFlag == 1">关闭</span>
                </template>
              </el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="createManName"
                min-width="80"
                label="创建人"
                align="left"
              ></el-table-column>
              <el-table-column
                sortable
                :show-overflow-tooltip="true"
                prop="createTime"
                min-width="160"
                label="创建时间"
                align="left"
              ></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="[100, 500, 1000]"
              :page-size="page3.pageSize"
              layout="total, sizes, prev, pager, next, jumper"
              :total="page3.totalPage"
            >
            </el-pagination>
          </div>
        </el-col>
      </el-row>
      <div style="margin-top: 10px; border-bottom: 1px solid #d5d5d5">
        <el-form
          ref="searchData1"
          :inline="true"
          :model="search"
          :rules="ruleValidateSearch"
          style="padding-left: 12px"
        >
          <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="meterTypeName" label="业务类型">
            <el-select
              v-model="search.meterTypeName"
              clearable
              filterable
              collapse-tags
              size="small"
              style="width: 120px"
            >
              <el-option
                v-for="(item, index) in meterTypeNameItem"
                :key="index"
                :label="item.baseName"
                :value="item.baseName"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item prop="matterNo" label="物资名称">
            <el-select
              v-model="search.matterNo"
              clearable
              filterable
              collapse-tags
              size="small"
              style="width: 120px"
              :filter-method="getMatterName3"
            >
              <el-option
                v-for="item in matterNameItem3"
                :key="item.matterNo"
                :label="item.matterName"
                :value="item.matterNo"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item prop="valueFlag" label="预报状态">
            <el-select
              v-model="search.valueFlag"
              clearable
              filterable
              collapse-tags
              size="small"
              style="width: 120px"
            >
              <el-option
                v-for="(item, index) in valueFlagItem"
                :key="index"
                :label="item.valueFlag"
                :value="item.valueFlag"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item prop="startTime" label="开始时间">
            <el-date-picker
              class="measure-self-picker"
              v-model="search.startTime"
              clearable
              type="datetime"
              style="width: 120px"
              placeholder="选择日期"
              @change="dateChange(search.startTime, 'startTime')"
              size="small"
            ></el-date-picker>
          </el-form-item>
          <el-form-item prop="endTime" label="结束时间">
            <el-date-picker
              class="measure-self-picker"
              v-model="search.endTime"
              clearable
              type="datetime"
              style="width: 120px"
              placeholder="选择日期"
              @change="dateChange(search.endTime, 'endTime')"
              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-search"
              type="primary"
              size="mini"
              @click="historySearchData"
              v-loading.fullscreen.lock="operateLoading"
              v-privilege="activeMenu + 'HISTORYSEARCH'"
              >预报历史查询</el-button
            >
          </el-form-item>
        </el-form>
      </div>
      <el-row>
        <el-col :span="24">
          <div style="border-right: 1px solid #d5d5d5">
            <div class="common-title-div">
              计量预报管理
              <div class="common-operation-button-div">
                <el-button
                  icon="el-icon-circle-plus-outline"
                  type="primary"
                  size="mini"
                  @click="addData"
                  v-loading.fullscreen.lock="operateLoading"
                  v-privilege="activeMenu + 'ADD'"
                  >新增</el-button
                >
                <el-button
                  icon="el-icon-edit"
                  type="primary"
                  size="mini"
                  @click="modifyData"
                  v-loading.fullscreen.lock="operateLoading"
                  v-privilege="activeMenu + 'UPDATE'"
                  >修改</el-button
                >
                <el-button
                  size="mini"
                  type="primary"
                  icon="el-icon-check"
                  @click="enableData"
                  v-loading.fullscreen.lock="operateLoading"
                  v-privilege="activeMenu + 'RECOVERY'"
                  >启用</el-button
                >
                <el-button
                  size="mini"
                  type="danger"
                  plain
                  icon="el-icon-remove-outline"
                  @click="discardData"
                  v-loading.fullscreen.lock="operateLoading"
                  v-privilege="activeMenu + 'ABOLISH'"
                  >废除</el-button
                >
              </div>
            </div>
            <div class="common-table-div">
              <el-table
                v-loading="dataLoading"
                @row-click="rowChange"
                :row-class-name="tableRowClassName"
                ref="dataTable"
                highlight-current-row
                border
                :height="tableHeight"
                @row-dblclick="rowDblClick2"
                @selection-change="handleSelectionChange"
                :data="table.list"
                @cell-click="getDataList2"
                :exchangeFilterMap="{
                  valueFlag: {
                    '0': '未配车',
                    '1': '未使用',
                    '2': '已使用',
                    '3': '已作废',
                    '4': '正使用',
                  },
                  predictionType: {
                    '0': '批次预报',
                    '1': '单次预报',
                    '2': '联运预报',
                    '3': '分检预报',
                  },
                  usedType: { '0': '次数', '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"
                  fixed="left"
                  align="center"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="predictionNo"
                  label="预报编号"
                  min-width="120"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="noticeNo"
                  label="通知单号"
                  min-width="110"
                  align="center"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="contractNo"
                  label="合同号"
                  min-width="100"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="batchNo"
                  min-width="110"
                  label="批次号"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="heatNo"
                  min-width="120"
                  label="炉号(检验批次)"
                  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="railwayNo"
                  min-width="160"
                  label="火车车号(集装箱号)"
                  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="shipmentNum"
                  min-width="100"
                  label="发运数量"
                  align="right"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="customerSupplierName"
                  min-width="160"
                  label="供应商"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="forwardingUnitName"
                  min-width="160"
                  label="发货单位"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="receivingUintName"
                  min-width="160"
                  label="收货单位"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="materialName"
                  min-width="100"
                  label="材质"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="specName"
                  min-width="100"
                  label="规格"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="shipmentGrossWeight"
                  min-width="100"
                  label="发运毛重"
                  align="right"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="shipmentNetWeight"
                  min-width="100"
                  label="发运净重"
                  align="right"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="addWeightSum"
                  min-width="100"
                  label="附加重量总和"
                  align="right"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="bindCardNo"
                  min-width="200"
                  label="绑定卡号"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="loadPointName"
                  min-width="100"
                  label="卸货地点"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="sampleNo"
                  min-width="160"
                  label="取样编号"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="sampleVoucher"
                  min-width="100"
                  label="取样凭证"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="carrierUnitName"
                  min-width="100"
                  label="承运单位"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="predictionType"
                  min-width="100"
                  label="预报类型"
                  align="left"
                >
                  <template slot-scope="scope">
                    <span v-if="scope.row.predictionType == 0">批次预报</span>
                    <span v-else-if="scope.row.predictionType == 1"
                      >单次预报</span
                    >
                    <span v-else-if="scope.row.predictionType == 2"
                      >联运预报</span
                    >
                    <span v-else-if="scope.row.predictionType == 3"
                      >分检预报</span
                    >
                    <span v-else-if="scope.row.predictionType == 4"
                      >集装箱预报</span
                    >
                  </template>
                </el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="predictionCombination"
                  min-width="300"
                  label="预报组合"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="meterTypeName"
                  min-width="100"
                  label="业务类型"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="usedType"
                  min-width="100"
                  label="可用类型"
                  align="left"
                >
                  <template slot-scope="scope">
                    <span v-if="scope.row.usedType == 0">次数</span>
                    <span v-else-if="scope.row.usedType == 1">时间</span>
                    <span v-else-if="scope.row.usedType == 2">总量</span>
                  </template>
                </el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="effectiveStartTime"
                  min-width="160"
                  label="有效开始时间"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="effectiveEndTime"
                  min-width="160"
                  label="有效结束时间"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="effectiveWeight"
                  min-width="100"
                  label="有效总量"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="effectiveNum"
                  min-width="100"
                  label="有效次数"
                  align="right"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="meterWeight"
                  min-width="100"
                  label="检斤重量"
                  align="right"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="meterNum"
                  min-width="100"
                  label="检斤次数"
                  align="right"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="carAllocationTime"
                  min-width="160"
                  label="配车时间"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="valueFlag"
                  label="状态"
                  width="60"
                  min-width="100"
                  align="center"
                >
                  <template slot-scope="scope">
                    <span v-if="scope.row.valueFlag == 0">未配车</span>
                    <span v-else-if="scope.row.valueFlag == 1">未使用</span>
                    <span v-else-if="scope.row.valueFlag == 2">已使用</span>
                    <span v-else-if="scope.row.valueFlag == 3">已作废</span>
                    <span v-else-if="scope.row.valueFlag == 4">正使用</span>
                  </template>
                </el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="memo"
                  min-width="200"
                  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="[100, 500, 1000]"
                :page-size="page.pageSize"
                layout="total, sizes, prev, pager, next, jumper"
                :total="page.totalPage"
              >
              </el-pagination>
            </div>
            <div
              ref="editTitle"
              class="common-title-div"
              style="margin-top: 20px; border-top: 1px solid #d5d5d5"
            >
              预报编辑区
            </div>
            <div ref="editDiv" class="commom-edit-div">
              <el-form
                ref="baseData"
                label-width="80px"
                :inline="true"
                :rules="ruleValidateTable1"
                :model="baseData"
              >
                <el-form-item prop="noticeNo" label="通知单号">
                  <el-input
                    v-model="baseData.noticeNo"
                    disabled="disabled"
                    clearable
                    size="small"
                    style="width: 120px"
                    placeholder="请输入"
                  ></el-input>
                </el-form-item>
                <el-form-item prop="shipmentNetWeight" label="发运净重">
                  <el-input
                    v-model="baseData.shipmentNetWeight"
                    clearable
                    size="small"
                    style="width: 120px"
                    placeholder="请输入"
                  ></el-input>
                </el-form-item>
                <el-form-item prop="shipmentNum" label="发运数量">
                  <el-input
                    v-model="baseData.shipmentNum"
                    clearable
                    size="small"
                    style="width: 120px"
                    placeholder="请输入"
                  ></el-input>
                </el-form-item>
                <el-form-item prop="shipmentGrossWeight" label="发运毛重">
                  <el-input
                    v-model="baseData.shipmentGrossWeight"
                    clearable
                    size="small"
                    style="width: 120px"
                    placeholder="请输入"
                  ></el-input>
                </el-form-item>
                <el-form-item prop="materialName" label="材       质">
                  <el-select
                    v-model="baseData.materialName"
                    disabled="disabled"
                    clearable
                    filterable
                    collapse-tags
                    size="small"
                    style="width: 120px"
                  >
                    <el-option
                      v-for="(item, index) in materialNameItem"
                      :key="index"
                      :label="item.baseName"
                      :value="item.baseName"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item prop="specName" label="规       格">
                  <el-select
                    v-model="baseData.specName"
                    disabled="disabled"
                    clearable
                    filterable
                    collapse-tags
                    size="small"
                    style="width: 120px"
                  >
                    <el-option
                      v-for="(item, index) in specNameItem"
                      :key="index"
                      :label="item.baseName"
                      :value="item.baseName"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item prop="usedType" label="可用类型">
                  <el-select
                    v-model="baseData.usedType"
                    :readonly="isUsedType"
                    :disabled="isUsedType"
                    clearable
                    filterable
                    collapse-tags
                    size="small"
                    style="width: 120px"
                    @change="decisionUsedType(baseData.usedType)"
                  >
                    <el-option
                      v-for="(item, index) in usedTypeItem"
                      :key="index"
                      :label="item.usedType"
                      :value="item.usedType"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item prop="forwardingUnitName" label="发货单位">
                  <el-select
                    v-model="baseData.forwardingUnitName"
                    disabled="disabled"
                    clearable
                    filterable
                    collapse-tags
                    size="small"
                    style="width: 120px"
                    :filter-method="filterESdr"
                  >
                    <el-option
                      v-for="item in editProList"
                      :key="item.customerSupplierNo"
                      :label="item.customerSupplierName"
                      :value="item.customerSupplierName"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item
                  prop="loadPointName"
                  label="卸货地点"
                  :rules="typeFlag ? loadRules.loadPointName : {}"
                >
                  <el-select
                    v-model="baseData.loadPointName"
                    clearable
                    filterable
                    collapse-tags
                    size="small"
                    style="width: 120px"
                  >
                    <el-option
                      v-for="(item, index) in loadPointNameItem"
                      :key="index"
                      :label="item.loadPointName"
                      :value="item.loadPointName"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item prop="meterTypeName" label="业务类型">
                  <el-select
                    v-model="baseData.meterTypeName"
                    clearable
                    filterable
                    collapse-tags
                    size="small"
                    style="width: 120px"
                    @change="typeChange"
                  >
                    <el-option
                      v-for="(item, index) in meterTypeNameItem"
                      :key="index"
                      :label="item.baseName"
                      :value="item.baseName"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item prop="effectiveWeight" label="有效总量">
                  <el-input
                    v-model="baseData.effectiveWeight"
                    clearable
                    size="small"
                    :readonly="isEffectiveWeight"
                    :disabled="isEffectiveWeight"
                    style="width: 120px"
                    placeholder="请输入"
                  ></el-input>
                </el-form-item>
                <el-form-item prop="receivingUintName" label="收货单位">
                  <el-select
                    v-model="baseData.receivingUintName"
                    clearable
                    filterable
                    collapse-tags
                    size="small"
                    style="width: 120px"
                    :filter-method="filterERcv"
                  >
                    <el-option
                      v-for="item in editReceList"
                      :key="item.customerSupplierNo"
                      :label="item.customerSupplierName"
                      :value="item.customerSupplierName"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item prop="contractNo" label="合 同  号">
                  <el-input
                    v-model="baseData.contractNo"
                    disabled="disabled"
                    clearable
                    size="small"
                    style="width: 120px"
                    placeholder="请输入"
                  ></el-input>
                </el-form-item>
                <el-form-item prop="matterName" label="物资名称">
                  <el-select
                    v-model="baseData.matterName"
                    clearable
                    filterable
                    collapse-tags
                    size="small"
                    style="width: 120px"
                    :filter-method="getMatterName"
                    disabled="disabled"
                  >
                    <el-option
                      v-for="item in matterNameItem"
                      :key="item.matterNo"
                      :label="item.matterName"
                      :value="item.matterName"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item prop="effectiveNum" label="有效次数">
                  <el-input
                    v-model="baseData.effectiveNum"
                    :disabled="isEffectiveNum ? 'disabled' : false"
                    clearable
                    size="small"
                    style="width: 120px"
                    placeholder="请输入"
                  ></el-input>
                </el-form-item>
                <el-form-item prop="carrierUnitName" label="承运单位">
                  <el-select
                    v-model="baseData.carrierUnitName"
                    clearable
                    filterable
                    collapse-tags
                    size="small"
                    style="width: 120px"
                  >
                    <el-option
                      v-for="(item, index) in carrierUnitNameItem"
                      :key="index"
                      :label="item.carrierUnitName"
                      :value="item.carrierUnitName"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item prop="customerSupplierName" label="供应商">
                  <el-select
                    v-model="baseData.customerSupplierName"
                    disabled="disabled"
                    clearable
                    filterable
                    collapse-tags
                    size="small"
                    style="width: 120px"
                    :filter-method="filterECust"
                  >
                    <el-option
                      v-for="item in editCustList"
                      :key="item.customerSupplierNo"
                      :label="item.customerSupplierName"
                      :value="item.customerSupplierName"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item prop="carNo" label="车      号">
                  <el-input
                    v-model="baseData.carNo"
                    size="small"
                    clearable
                    style="width: 120px"
                    placeholder="请输入"
                  ></el-input>
                </el-form-item>
                <el-form-item prop="trailerNo" label="挂号">
                  <el-input
                    v-model="baseData.trailerNo"
                    clearable
                    size="small"
                    style="width: 120px"
                    placeholder="请输入"
                  ></el-input>
                </el-form-item>
                <el-form-item prop="effectiveStartTime" label="开始时间">
                  <el-date-picker
                    v-model="baseData.effectiveStartTime"
                    clearable
                    type="datetime"
                    style="width: 120px"
                    :readonly="isEffectiveTime"
                    :disabled="isEffectiveTime"
                    placeholder="选择日期"
                    size="small"
                  ></el-date-picker>
                </el-form-item>
                <el-form-item prop="effectiveEndTime" label="结束时间">
                  <el-date-picker
                    v-model="baseData.effectiveEndTime"
                    clearable
                    type="datetime"
                    style="width: 120px"
                    :readonly="isEffectiveTime"
                    :disabled="isEffectiveTime"
                    placeholder="选择日期"
                    size="small"
                  ></el-date-picker>
                </el-form-item>
                <el-form-item prop="memo" label="备注">
                  <el-input
                    v-model="baseData.memo"
                    size="small"
                    clearable
                    style="width: 120px"
                    placeholder="请输入"
                  ></el-input>
                </el-form-item>
                <el-form-item prop="otherSpec" label="分检规格">
                  <el-input
                    :disabeld="checkFlag ? false : 'disabled'"
                    v-model="otherSpec"
                    size="small"
                    clearable
                    style="width: 120px"
                    placeholder="请输入"
                  ></el-input>
                </el-form-item>
                <el-form-item prop="batchNo" label="批次号">
                  <el-input
                    v-model="baseData.batchNo"
                    size="small"
                    clearable
                    style="width: 120px"
                    placeholder="请输入"
                  ></el-input>
                </el-form-item>
                <el-form-item prop="batchNo" label="炉号(检验批次)" label-width="125px">
                  <el-input
                    v-model="baseData.heatNo"
                    size="small"
                    clearable
                    style="width: 120px"
                    placeholder="请输入"
                  ></el-input>
                </el-form-item>
                <el-form-item
                  prop="railwayNo"
                  label="火车车号(集装箱号)"
                  label-width="135px"
                >
                  <el-input
                    v-model="baseData.railwayNo"
                    clearable
                    size="small"
                    style="width: 120px"
                    placeholder="请输入"
                  ></el-input>
                </el-form-item>
              </el-form>
            </div>
          </div>
        </el-col>
      </el-row>
    </div>
  </div>
</template>
<script>
import { formatDate, getCookie } from '@/utils/util.js';
import { cookieUserId, cookieUserName } from '@/config/config.js';
import { recordChange } from '../../../utils/utils'
export default {
  data () {
    return {
      dataLoading: false,
      dataLoading2: false,
      dataLoading3: false,
      operateLoading: false,
      isEffectiveWeight: true,
      isEffectiveNum: true, // 有效次数是否可编辑
      isEffectiveTime: true,
      isUsedType: true,
      flag: 0,
      actualFirst: {},
      firstNotice: {},
      meterTypeNameItem: [],
      matterNameItem: [],
      matterNameItem2: [],
      matterNameItem3: [],
      valueFlagItem: [
        { valueFlag: '未配车' },
        { valueFlag: '未使用' },
        { valueFlag: '已使用' },
        { valueFlag: '已作废' },
        { valueFlag: '正使用' }
      ],
      valueFlagItem2: [
        { valueFlag: '可使用' },
        { valueFlag: '关闭' },
      ],
      predictionTypeItem: [
        { id: '1', predictionType: '单次预报' },
        { id: '3', predictionType: '分检预报' }
      ],//预报类型
      usedTypeItem: [
        { id: '0', usedType: '次数' },
        { id: '1', usedType: '时间' },
        { id: '2', usedType: '总量' },
      ],
      loadPointNameItem: [],//卸货地点
      materialNameItem: [],//材质
      forwardingUnitNameItem: [],//发货单位
      icoreFilterFlag: false,
      specNameItem: [],//规格
      receivingUintNameItem: [],//收货单位
      carrierUnitNameItem: [],//承运单位
      customerSupplierNameItem: [],//供应商
      utensilNameItem: [],//器具名称
      utensilUtensilNameItem: [],//器具属性
      page: {
        pageSize: 100,
        pageNum: 1,
        totalPage: 0
      },
      page2: {
        pageSize: 100,
        pageNum: 1,
        totalPage: 0
      },
      page3: {
        pageSize: 100,
        pageNum: 1,
        totalPage: 0
      },
      table: {
        list: [],
        list2: [],
        list3: [],
      },
      modifyBaseDate: {},
      baseData: {
        loadPointName: '',
        noticeNo: '',
        predictionType: '4',
        shipmentNetWeight: '',
        effectiveWeight: '',
        materialName: '',
        forwardingUnitName: '',
        railwayNo: '',
        carNo: '',
        meterTypeName: '',
        shipmentNum: '',
        effectiveNum: '1',
        specName: '',
        receivingUintName: '',
        contractNo: '',
        matterName: '',
        shipmentGrossWeight: '',
        usedType: '次数',
        carrierUnitName: '',
        customerSupplierName: '',
        trailerNo: '',
        memo: '',
        effectiveStartTime: '',
        effectiveEndTime: '',
        heatNo: ''
      },
      baseDataCache: {
        loadPointName: '',
        noticeNo: '',
        predictionType: '4',
        shipmentNetWeight: '',
        effectiveWeight: '',
        materialName: '',
        forwardingUnitName: '',
        railwayNo: '',
        carNo: '',
        meterTypeName: '',
        shipmentNum: '',
        effectiveNum: '1',
        specName: '',
        receivingUintName: '',
        contractNo: '',
        matterName: '',
        shipmentGrossWeight: '',
        usedType: '次数',
        carrierUnitName: '',
        customerSupplierName: '',
        trailerNo: '',
        memo: '',
        effectiveStartTime: '',
        effectiveEndTime: '',
        heatNo: ''
      },
      baseData2: {
        utensilName: '',
        utensilWeight: '',
        utensilUtensilName: '',
        utensilNo: '',
        memo: ''
      },
      multipleSelection: [],
      tableHeight: 0,
      search: {
        predictionNo: '',
        carNo: '',
        meterTypeName: '',
        matterNo: '',
        valueFlag: '',
        predictionType: '4',
        startTime: '',
        endTime: '',
        contractNo: ''
      },
      search2: {
        noticeNo: '',
        contractNo: '',
        batchNo: '',
        matterNo: '',
        valueFlag: '',
        customerSupplierName: '',
        receivingUintName: '',
        meterTypeName: ''
      },
      ruleValidateSearch: {},
      ruleValidateSearch2: {},
      ruleValidateTable1: {
        effectiveNum: [{ required: true, validator: this.effectiveNumEmpty, trigger: 'change' }],
        railwayNo: [{ required: true, message: '该项不能为空', trigger: 'blur' }],
        receivingUintName: [{ required: true, message: '该项不能为空', trigger: 'blur' }],
        contractNo: [{ required: true, message: '该项不能为空', trigger: 'blur' }],
        matterName: [{ required: true, message: '该项不能为空', trigger: 'change' }],
        meterTypeName: [{ required: true, message: '该项不能为空', trigger: 'change' }],
        customerSupplierName: [{ required: true, message: '该项不能为空', trigger: 'change' }],
        predictionType: [{ required: true, message: '该项不能为空', trigger: 'change' }],
        usedType: [{ required: true, message: '该项不能为空', trigger: 'change' }],
      },
      ruleValidateTable2: {
        utensilWeight: [{ required: true, message: '该项不能为空', trigger: 'change' }],
        utensilNo: [{ required: true, message: '该项不能为空', trigger: 'change' }],
        utensilUtensilName: [{ required: true, message: '该项不能为空', trigger: 'change' }],
        utensilName: [{ required: true, message: '该项不能为空', trigger: 'change' }],
      },
      activeMenu: '',
      typeFlag: true,
      groupList: [8, 1],
      groupList1: [8, 1],
      receivingSUnitNameItem: [],
      customerUnitNameItem: [],
      loadRules: {
        loadPointName: [{ required: true, message: '该项不能为空', trigger: 'blur' }]
      },
      otherSpec: '', // 分检规格
      checkFlag: false, // 分检规格是否允许编辑
      userNo: '', // 登录用户id
      userName: '', // 登录用户名称
      matList: [],
      provideList: [],
      customerList: [],
      rcvList: [],
      receiverList: [],
      editCustList: [],
      editReceList: [],
      editProList: [],
      allList: []
    }
  },
  created () {
    this.tableHeight = (window.innerHeight - 370) / 2 > 150 ? (window.innerHeight - 370) / 2 : 150
    this.activeMenu = window.top.localStorage.getItem('activeMenu')
  },
  mounted () {
    this.getNoticeData()
    this.getLoadPointNameItem();
    this.getMatterNameItem();//物料
    this.getCarrierUnitNameItem();//承运单位
    this.getUtensilNameItem();//器具名称
    // this.getCustomerSupplierNameItem();//供应商
    this.getMeterTypeNameItem();//业务类型
    this.getUtensilUtensilNameItem();//器具属性
    this.getMaterialNameItem();//材质
    this.getSpecNameItem();//规格
    // this.getForwardingUnitNameItem();//发货单位
    // this.getReceivingUintNameItem();//收货单位
    this.getMeterbasecustomersupplier()
  },
  methods: {
    getCode (code, arr, codeKey, nameKey) {
      if (!code) {
        return '';
      }
      let targetRow = arr.find(item => {
        return item[codeKey] === code;
      });
      return targetRow ? targetRow[nameKey] : '';
    },
    getMatterName (val) {
      if (val) {
        this.matterNameItem = this.matList.filter(item => {
          if (item.matterName.indexOf(val) !== -1) {
            return true
          }
        }).slice(0, 300)
      } else {
        this.matterNameItem = [...this.matList].slice(0, 300)
      }
    },
    getMatterName2 (val) {
      if (val) {
        this.matterNameItem2 = this.matList.filter(item => {
          if (item.matterName.indexOf(val) !== -1) {
            return true
          }
        }).slice(0, 300)
      } else {
        this.matterNameItem2 = [...this.matList].slice(0, 300)
      }
    },
    getMatterName3 (val) {
      if (val) {
        this.matterNameItem3 = this.matList.filter(item => {
          if (item.matterName.indexOf(val) !== -1) {
            return true
          }
        }).slice(0, 300)
      } else {
        this.matterNameItem3 = [...this.matList].slice(0, 300)
      }
    },
    getUtensil (val) {
      if (this.baseData2.utensilNo !== '' && val !== '') {
        this.axios.get('pass/systemBase/v1/meterbaseaddweights/' + '?utensilNo=' + this.baseData2.utensilNo + '&utensilName=' + val)
          .then(res => {
            if (res.data.list.length !== 0) {
              this.baseData2.utensilWeight = res.data.list[0].utensilWeight
              this.baseData2.utensilUtensilName = res.data.list[0].utensilUtensilName
              this.baseData2.addWeightNo = res.data.list[0].addWeightNo
            } else {
              this.baseData2.utensilWeight = '',
                this.baseData2.utensilUtensilName = ''
            }
          })
      } else {
        this.baseData2.utensilWeight = '',
          this.baseData2.utensilUtensilName = ''
      }
    },
    dateChange (val, name) {
      if (val) {
        this.search[name] = formatDate(val)
      } else {
        this.search[name] = ''
      }
    },
    effectiveNumEmpty (rule, value, callback) {
      if (this.baseData.usedType === '次数' && (this.baseData.effectiveNum === '' || this.baseData.effectiveNum === null)) {
        return callback(new Error('有效次数不能为空'))
      } else {
        return callback()
      }
    },
    typeChange (val) {
      if (val) {
        if (val === '采购进厂') {
          this.typeFlag = true
        } else if (val === '销售出厂') {
          this.typeFlag = false
        }
      }
    },
    decisionUsedType (val) {
      if (val === '次数') {
        this.baseData.effectiveNum = ''
        this.baseData.effectiveStartTime = ''
        this.baseData.effectiveEndTime = ''
        this.baseData.railwayNo = ''
        this.baseData.effectiveWeight = ''
        this.ruleValidateTable1.effectiveNum[0].required = true
        this.ruleValidateTable1.effectiveStartTime[0].required = false
        this.ruleValidateTable1.effectiveEndTime[0].required = false
        this.ruleValidateTable1.effectiveWeight[0].required = false
        this.isEffectiveWeight = true
        this.isEffectiveNum = false
        this.isEffectiveTime = true
      } else if (val === '时间') {
        this.baseData.effectiveNum = ''
        this.baseData.effectiveStartTime = ''
        this.baseData.effectiveEndTime = ''
        this.baseData.railwayNo = ''
        this.baseData.effectiveWeight = ''
        this.ruleValidateTable1.effectiveNum[0].required = false
        this.ruleValidateTable1.effectiveStartTime[0].required = true
        this.ruleValidateTable1.effectiveEndTime[0].required = true
        this.ruleValidateTable1.railwayNo[0].required = false
        this.ruleValidateTable1.effectiveWeight[0].required = false
        this.isEffectiveWeight = true
        this.isEffectiveNum = true
        this.isEffectiveTime = false
      } else if (val === '总量') {
        this.baseData.effectiveNum = ''
        this.baseData.effectiveStartTime = ''
        this.baseData.effectiveEndTime = ''
        this.baseData.railwayNo = ''
        this.baseData.effectiveWeight = ''
        this.ruleValidateTable1.effectiveNum[0].required = false
        this.ruleValidateTable1.effectiveStartTime[0].required = false
        this.ruleValidateTable1.effectiveEndTime[0].required = false
        this.ruleValidateTable1.railwayNo[0].required = false
        this.ruleValidateTable1.effectiveWeight[0].required = true
        this.isEffectiveWeight = false
        this.isEffectiveNum = true
        this.isEffectiveTime = true
      }
    },
    refresh () {
      this.baseData = {...this.baseDataCache}
    },
    refresh2 () {
      this.baseData2 = {
        utensilName: '',
        utensilWeight: '',
        utensilUtensilName: '',
        utensilNo: '',
        memo: ''
      },
        this.baseData2.utensilName = this.utensilNameItem[0].baseName;
      this.baseData2.utensilUtensilName = this.utensilUtensilNameItem[0].baseName;
      this.$refs['baseData2'].resetFields();
    },
    // 新增预报数据
    async addData () {
      this.$refs['baseData'].validate(async (valid) => {
        if (valid) {
          if (this.typeFlag) {
            if (this.baseData.loadPointName === '') {
              return this.$message.error('请选择卸货地点')
            }
          }
          let confirmFlag = true
          if (confirmFlag === 'cancel') return
          let baseData2 = {}
          this.baseData.predictionNo = ''
          this.baseData.id = ''
          this.baseData.usedType = this.getCode(this.baseData.usedType, this.usedTypeItem, 'usedType', 'id') ? this.getCode(this.baseData.usedType, this.usedTypeItem, 'usedType', 'id') : ''
          this.baseData.meterTypeNo = this.getCode(this.baseData.meterTypeName, this.meterTypeNameItem, 'baseName', 'baseCode') ? this.getCode(this.baseData.meterTypeName, this.meterTypeNameItem, 'baseName', 'baseCode') : ''
          this.baseData.matterNo = this.getCode(this.baseData.matterName, this.matList, 'matterName', 'matterNo') ? this.getCode(this.baseData.matterName, this.matList, 'matterName', 'matterNo') : ''
          this.baseData.loadPointNo = this.getCode(this.baseData.loadPointName, this.loadPointNameItem, 'loadPointName', 'loadPointNo') ? this.getCode(this.baseData.loadPointName, this.loadPointNameItem, 'loadPointName', 'loadPointNo') : ''
          this.baseData.carrierUnitNo = this.getCode(this.baseData.carrierUnitName, this.carrierUnitNameItem, 'carrierUnitName', 'carrierUnitNo') ? this.getCode(this.baseData.carrierUnitName, this.carrierUnitNameItem, 'carrierUnitName', 'carrierUnitNo') : ''
          // console.log(this.getCode(this.baseData.customerSupplierName, this.customerSupplierNameItem, 'customerSupplierName', 'customerSupplierNo'), '根据名称获取编码结果', this.baseData.customerSupplierName)
          this.baseData.customerSupplierNo = this.getCode(this.baseData.customerSupplierName, this.allList, 'customerSupplierName', 'customerSupplierNo') ? this.getCode(this.baseData.customerSupplierName, this.allList, 'customerSupplierName', 'customerSupplierNo') : ''
          this.baseData.materialNo = this.getCode(this.baseData.materialName, this.materialNameItem, 'baseName', 'baseCode') ? this.getCode(this.baseData.materialName, this.materialNameItem, 'baseName', 'baseCode') : ''
          this.baseData.specNo = this.getCode(this.baseData.specName, this.specNameItem, 'baseName', 'baseCode') ? this.getCode(this.baseData.specName, this.specNameItem, 'baseName', 'baseCode') : ''
          this.baseData.forwardingUnitNo = this.getCode(this.baseData.forwardingUnitName, this.allList, 'customerSupplierName', 'customerSupplierNo') ? this.getCode(this.baseData.forwardingUnitName, this.allList, 'customerSupplierName', 'customerSupplierNo') : ''
          this.baseData.receivingUintNo = this.getCode(this.baseData.receivingUintName, this.allList, 'customerSupplierName', 'customerSupplierNo') ? this.getCode(this.baseData.receivingUintName, this.allList, 'customerSupplierName', 'customerSupplierNo') : ''
          baseData2.predictionType = this.baseData.predictionType + ''
          baseData2.usedType = this.baseData.usedType
          baseData2.meterTypeNo = this.baseData.meterTypeNo
          baseData2.batchNo = this.baseData.batchNo
          baseData2.matterNo = this.baseData.matterNo
          baseData2.loadPointNo = this.baseData.loadPointNo
          baseData2.carrierUnitNo = this.baseData.carrierUnitNo
          baseData2.customerSupplierNo = this.baseData.customerSupplierNo
          baseData2.materialNo = this.baseData.materialNo
          baseData2.specNo = this.baseData.specNo
          baseData2.forwardingUnitNo = this.baseData.forwardingUnitNo
          baseData2.receivingUintNo = this.baseData.receivingUintNo
          baseData2.loadPointName = this.baseData.loadPointName
          baseData2.noticeNo = this.baseData.noticeNo
          baseData2.shipmentNetWeight = this.baseData.shipmentNetWeight
          baseData2.effectiveWeight = this.baseData.effectiveWeight
          baseData2.materialName = this.baseData.materialName
          baseData2.forwardingUnitName = this.baseData.forwardingUnitName
          baseData2.railwayNo = this.baseData.railwayNo
          baseData2.carNo = this.baseData.carNo
          baseData2.meterTypeName = this.baseData.meterTypeName
          baseData2.shipmentNum = this.baseData.shipmentNum
          baseData2.effectiveNum = this.baseData.effectiveNum
          // 将分检规格追加拼接到规格字段值后
          baseData2.specName = (this.baseData.specName ? this.baseData.specName : '') + '-' + this.otherSpec
          baseData2.receivingUintName = this.baseData.receivingUintName
          baseData2.contractNo = this.baseData.contractNo
          baseData2.matterName = this.baseData.matterName
          baseData2.shipmentGrossWeight = this.baseData.shipmentGrossWeight
          baseData2.usedType = this.baseData.usedType
          baseData2.carrierUnitName = this.baseData.carrierUnitName
          baseData2.customerSupplierName = this.baseData.customerSupplierName
          baseData2.trailerNo = this.baseData.trailerNo
          baseData2.memo = this.baseData.memo
          baseData2.effectiveStartTime = this.baseData.effectiveStartTime
          baseData2.effectiveEndTime = this.baseData.effectiveEndTime
          baseData2.heatNo = this.baseData.heatNo
          if (this.baseData.effectiveNum === 1) {
            this.axios.post('pass/systemBase/v1/pretrackscales/add', baseData2, { individualType: 'json' }).then(res => {
              if (res.succeed) {
                this.$message.success('新增成功');
                this.getDataList(this.firstNotice);
                this.setParam(baseData2)
                this.searchDatas()
                this.refresh();
              } else {
                this.baseData.usedType = this.getCode(this.baseData.usedType, this.usedTypeItem, 'id', 'usedType')
                this.$message.error(res.message)
              }
            }).catch(e => {
              this.baseData.usedType = this.getCode(this.baseData.usedType, this.usedTypeItem, 'id', 'usedType')
              this.$message.error(e.message)
            })
          } else {
            if (this.baseData.effectiveNum > 6) {
              return this.$message.error('有效次数不能大于6')
            }
            try {
              // 新增预报时填写的有效次数为多少，就新增多少个预报
              for (let i = 0; i < this.baseData.effectiveNum; i++) {
                baseData2.effectiveNum = 1
                const res = await this.axios.post('pass/systemBase/v1/pretrackscales/add', baseData2, { individualType: 'json' })
                if (res.succeed) {
                  if (i === this.baseData.effectiveNum - 1) {
                    this.$message.success('新增成功');
                    this.setParam(baseData2)
                    this.searchDatas()
                    this.refresh();
                  }
                } else {
                  this.baseData.usedType = this.getCode(this.baseData.usedType, this.usedTypeItem, 'id', 'usedType')
                  this.$message.error(res.message)
                  break;
                }
              }
            } catch (e) {
              console.log(e)
            }
          }
          this.checkFlag = false
        }
      })
    },
    setParam (data) {
      this.search.carNo = data.carNo
      this.search.predictionType = data.predictionType + ''
      this.search.meterTypeName = data.meterTypeName
      // this.search.matterNo = data.matterNo
    },
    modifyData () {
      this.baseData.usedType = this.getCode(this.baseData.usedType, this.usedTypeItem, 'usedType', 'id') ? this.getCode(this.baseData.usedType, this.usedTypeItem, 'usedType', 'id') : ''
      this.baseData.meterTypeNo = this.getCode(this.baseData.meterTypeName, this.meterTypeNameItem, 'baseName', 'baseCode') ? this.getCode(this.baseData.meterTypeName, this.meterTypeNameItem, 'baseName', 'baseCode') : ''
      this.baseData.matterNo = this.getCode(this.baseData.matterName, this.matList, 'matterName', 'matterNo') ? this.getCode(this.baseData.matterName, this.matList, 'matterName', 'matterNo') : ''
      this.baseData.loadPointNo = this.getCode(this.baseData.loadPointName, this.loadPointNameItem, 'loadPointName', 'loadPointNo') ? this.getCode(this.baseData.loadPointName, this.loadPointNameItem, 'loadPointName', 'loadPointNo') : ''
      this.baseData.carrierUnitNo = this.getCode(this.baseData.carrierUnitName, this.carrierUnitNameItem, 'carrierUnitName', 'carrierUnitNo') ? this.getCode(this.baseData.carrierUnitName, this.carrierUnitNameItem, 'carrierUnitName', 'carrierUnitNo') : ''
      this.baseData.customerSupplierNo = this.getCode(this.baseData.customerSupplierName, this.allList, 'customerSupplierName', 'customerSupplierNo') ? this.getCode(this.baseData.customerSupplierName, this.allList, 'customerSupplierName', 'customerSupplierNo') : ''
      this.baseData.materialNo = this.getCode(this.baseData.materialName, this.materialNameItem, 'baseName', 'baseCode') ? this.getCode(this.baseData.materialName, this.materialNameItem, 'baseName', 'baseCode') : ''
      this.baseData.specNo = this.getCode(this.baseData.specName, this.specNameItem, 'baseName', 'baseCode') ? this.getCode(this.baseData.specName, this.specNameItem, 'baseName', 'baseCode') : ''
      this.baseData.forwardingUnitNo = this.getCode(this.baseData.forwardingUnitName, this.allList, 'customerSupplierName', 'customerSupplierNo') ? this.getCode(this.baseData.forwardingUnitName, this.allList, 'customerSupplierName', 'customerSupplierNo') : ''
      this.baseData.receivingUintNo = this.getCode(this.baseData.receivingUintName, this.allList, 'customerSupplierName', 'customerSupplierNo') ? this.getCode(this.baseData.receivingUintName, this.allList, 'customerSupplierName', 'customerSupplierNo') : ''
      // 将分检规格追加拼接到规格字段值后
      this.baseData.specName = this.baseData.specName ? this.baseData.specName + '-' + this.otherSpec : '' + this.otherSpec
      this.axios.post('pass/systemBase/v1/pretrackscales/update', this.baseData, { individualType: 'json' }).then(res => {
        if (res.succeed) {
          this.$message.success('修改成功');
          this.searchDatas()
          this.refresh();
        } else {
          this.baseData.usedType = this.getCode(this.baseData.usedType, this.usedTypeItem, 'id', 'usedType')
          this.$message.error(res.message)
        }
      }).catch(e => {
        this.baseData.usedType = this.getCode(this.baseData.usedType, this.usedTypeItem, 'id', 'usedType')
        this.$message.error(e.message)
      })
      this.checkFlag = false
    },
    enableData () {
      if (this.multipleSelection.length < 1) {
        this.$message.warning('请选择您要启用的数据！');
        return;
      }
      this.axios.post('pass/systemBase/v1/pretrackscales/recover', this.multipleSelection, { individualType: 'json' }).then(res => {
        if (res.succeed) {
          this.$message.success('启用成功');
          // this.getDataList(this.firstNotice);
          this.searchDatas()
        } else {
          this.$message.error(res.message)
        }
      }).catch(e => {
        this.$message.error(e.message)
      })
    },
    discardData () {
      if (this.multipleSelection.length < 1) {
        this.$message.warning('请选择您要停用的数据！');
        return;
      }
      this.axios.post('pass/systemBase/v1/pretrackscales/abolish', this.multipleSelection, { individualType: 'json' }).then(res => {
        if (res.succeed) {
          this.$message.success('作废成功');
          // this.getDataList(this.firstNotice);
          this.searchDatas()
        } else {
          this.$message.error(res.message)
        }
      }).catch(e => {
        this.$message.error(e.message)
      })
    },
    combinedData () {
      if (this.multipleSelection.length < 2) {
        this.$message.warning('请选择至少2条您要联运的数据！');
        return;
      }
      this.axios.post('pass/systemBase/v1/pretrackscales/combined', this.multipleSelection, { individualType: 'json' }).then(res => {
        if (res.succeed) {
          this.$message.success('联运成功');
          // this.getDataList(this.firstNotice);
          this.searchDatas()
        } else {
          this.$message.error(res.message)
        }
      }).catch(e => {
        this.$message.error(e.message)
      })
    },//联运
    removeData () {
      if (this.multipleSelection.length < 1) {
        this.$message.warning('请选择您要解除联运的数据！');
        return;
      }
      this.axios.post('pass/systemBase/v1/pretrackscales/remove', this.multipleSelection, { individualType: 'json' }).then(res => {
        if (res.succeed) {
          this.$message.success('解除联运成功');
          // this.getDataList(this.firstNotice);
          this.searchDatas()
        } else {
          this.$message.error(res.message)
        }
      }).catch(e => {
        this.$message.error(e.message)
      })
    },//解除
    addData2 () {
      this.baseData2.predictionNo = this.actualFirst.predictionNo
      this.baseData2.utensilTypeNo = this.getCode(this.baseData2.utensilUtensilName, this.utensilUtensilNameItem, 'baseName', 'baseCode')
      this.baseData2.utensilNameNo = this.getCode(this.baseData2.utensilName, this.utensilNameItem, 'baseName', 'baseCode')
      this.axios.post('pass/systemBase/v1/peraddweights/checkAndAdd', this.baseData2, { individualType: 'json' }).then(res => {
        if (res.succeed) {
          this.$message.success('新增成功');
          this.getDataList(this.firstNotice, 1)
          this.getDataList2(this.actualFirst);
          this.refresh2();
        } else {
          this.$message.error(res.message)
        }
      }).catch(e => {
        this.$message.error(e.message)
      })
    },
    discardData2 () {
      if (this.multipleSelection2.length < 1) {
        this.$message.warning('请选择您要删除的数据！');
        return;
      }
      this.axios.post('pass/systemBase/v1/peraddweights/delete', this.multipleSelection2, { individualType: 'json' }).then(res => {
        if (res.code === '0' || res.code === '200') {
          this.$message.success('删除成功');
          this.getDataList(this.firstNotice, 1)
          this.getDataList2(this.actualFirst);
        } else {
          this.$message.error(res.message)
        }
      }).catch(e => {
        this.$message.error(e.message)
      })

    },
    getMatterName (val) {
      if (val) {
        this.matterNameItem = this.matList.filter(item => {
          if (item.matterName.indexOf(val) !== -1) {
            return true
          }
        }).slice(0, 300)
      } else {
        this.matterNameItem = [...this.matList].slice(0, 300)
      }
    },
    // 预报信息行选中
    rowChange (row, column, event) {
      this.baseData = Object.assign({}, row);
      // 从规格字段中取出规格和分检规格
      if (row.specName) {
        let specList = row.specName.split('-');
        this.baseData.specName = specList[0];
        specList[1] ? this.otherSpec = specList[1] : '';
      }
      // 查询物资信息数据
      this.axios.get('pass/systemBase/v1/meterbasematterinfos/noPage' + '?validFlag=1' + '&matterNo=' + this.baseData.matterNo)
        .then(res => {
          this.matterNameItem = res.data;
        })
      this.baseData.usedType = this.getCode(this.baseData.usedType, this.usedTypeItem, 'id', 'usedType')
    },
    // 合同行选中
    rowChange3 (row, column, event) {
      if (row.valueFlag == 1) {
        this.baseData = {
          loadPointName: '',
          noticeNo: '',
          predictionType: '4',
          shipmentNetWeight: '',
          effectiveWeight: '',
          materialName: '',
          forwardingUnitName: '',
          railwayNo: '',
          carNo: '',
          meterTypeName: '',
          shipmentNum: '',
          effectiveNum: '',
          specName: '',
          receivingUintName: '',
          contractNo: '',
          matterName: '',
          shipmentGrossWeight: '',
          usedType: '次数',
          carrierUnitName: '',
          customerSupplierName: '',
          trailerNo: '',
          memo: '',
          effectiveStartTime: '',
          effectiveEndTime: ''
        }
        this.baseData.loadPointName = this.loadPointNameItem[0].loadPointName ? this.loadPointNameItem[0].loadPointName : ''
        this.baseData.matterName = this.matterNameItem[0].matterName//物料
        this.baseData.carrierUnitName = this.carrierUnitNameItem[0].carrierUnitName//承运单位
        this.baseData.customerSupplierName = this.customerSupplierNameItem[0].customerSupplierName//供应商
        this.baseData.meterTypeName = this.meterTypeNameItem[0].baseName//
        this.baseData.materialName = this.materialNameItem[0].baseName//材质
        this.baseData.specName = this.specNameItem[0].baseName//规格
        this.baseData.receivingUintName = this.receivingUintNameItem[0].companyName//收货单位
        this.baseData.forwardingUnitName = this.forwardingUnitNameItem[0].companyName//发货单位
        return
      }
      //  this.baseData = Object.assign ({}, row);
      this.search.contractNo = row.contractNo
      this.baseData.meterTypeNo = row.meterTypeNo
      this.baseData.matterNo = row.matterNo
      this.baseData.loadPointNo = row.loadPointNo
      this.baseData.carrierUnitNo = row.carrierUnitNo
      this.baseData.customerSupplierNo = row.customerSupplierNo
      this.baseData.materialNo = row.materialName
      this.baseData.specNo = row.specName
      this.baseData.forwardingUnitNo = row.forwardingUnitName
      this.baseData.receivingUintNo = row.receivingUintName
      this.baseData.noticeNo = row.noticeNo
      this.baseData.sourceArea = row.sourceArea
      this.baseData.contractNo = row.contractNo
      this.baseData.batchNo = row.batchNo
      this.baseData.meterTypeName = row.meterTypeName
      this.baseData.matterName = row.matterName
      this.baseData.loadPointName = row.loadPointName
      this.baseData.carrierUnitName = row.carrierUnitName
      this.baseData.customerSupplierName = row.customerSupplierName
      this.baseData.materialName = row.materialName
      this.baseData.specName = row.specName
      this.baseData.forwardingUnitName = row.forwardingUnitName
      this.baseData.receivingUintName = row.receivingUintName
      this.baseData.memo = row.memo
      if (this.baseData.meterTypeName === '采购进厂') {
        this.typeFlag = true
      } else {
        this.typeFlag = false
      }
      this.axios.get('pass/systemBase/v1/meterbasematterinfos/noPage' + '?validFlag=1' + '&matterNo=' + this.baseData.matterNo)
        .then(res => {
          this.matterNameItem = res.data;
        })
    },
    // 预报数据多选回调
    handleSelectionChange (val) {
      this.multipleSelection = val;
      if (val.length > 0) {
        this.$refs.dataTable.setCurrentRow(this.multipleSelection[val.length - 1])
        this.getDataList2(this.multipleSelection[val.length - 1])
        this.rowChange(this.multipleSelection[val.length - 1])
      }
    },
    rowDblClick2 (row, column, event) {
      let rFlag = false
      for (let i = 0; i < this.multipleSelection.length; i++) {
        if (this.multipleSelection[i].predictionNo === row.predictionNo) {
          rFlag = true
          if (row.predictionCombination !== '' && row.predictionCombination !== null) {
            this.table.list.forEach(item => {
              if (item.predictionCombination === row.predictionCombination) {
                this.$refs.dataTable.toggleRowSelection(item, false)
              }
            })
          } else {
            this.$refs.dataTable.toggleRowSelection(row, false)
          }
        }
      }
      if (rFlag === false) {
        this.$refs.dataTable.toggleRowSelection(row, true)
        if (row.predictionCombination !== '' && row.predictionCombination !== null) {
          this.table.list.forEach(item => {
            if (item.predictionCombination === row.predictionCombination) {
              this.$refs.dataTable.toggleRowSelection(item, true)
            }
          })
        }
      }
    },
    pageSizeChange (size) {
      this.page.pageSize = size;
      // this.getDataList(this.firstNotice);
      this.searchDatas()
    },
    pageCurrentChange (index) {
      this.page.pageNum = index;
      // this.getDataList(this.firstNotice);
      this.searchData()
    },
    handleSelectionChange2 (val) {
      this.multipleSelection2 = val;
    },
    pageSizeChange2 (size) {
      this.page2.pageSize = size;
      this.getDataList2(this.actualFirst);
    },
    pageCurrentChange2 (index) {
      this.page2.pageNum = index;
      this.getDataList2(this.actualFirst);
    },
    pageSizeChange3 (size) {
      this.page3.pageSize = size;
      this.searchData2()
    },
    pageCurrentChange3 (index) {
      this.page3.pageNum = index;
      this.searchData2()
    },
    searchDatas () {
      this.page.pageNum = 1;
      this.searchData()
    },
    // 预报数据查询
    searchData () {
      // 将预报表格滚动到顶部
      this.$refs.dataTable.bodyWrapper.scrollTop = 0;
      this.$refs['searchData1'].validate((valid) => {
        if (valid) {
          this.dataLoading = true;
          this.search.valueFlag1 = this.search.valueFlag === '未配车' ? 0 : this.search.valueFlag === '未使用' ? 1 : this.search.valueFlag === '已使用' ? 2 : this.search.valueFlag === '已作废' ? 3 : this.search.valueFlag === '正使用' ? 4 : ''
          this.axios.get('pass/systemBase/v1/pretrackscales/' + '?pageNum=' + this.page.pageNum + '&pageSize=' + this.page.pageSize + '&carNo=' + this.search.carNo + '&predictionNo=' + this.search.predictionNo
            + '&predictionType=4' + '&meterTypeName=' + this.search.meterTypeName + '&matterNo=' + this.search.matterNo + '&valueFlag=' + this.search.valueFlag1 +
            `&startTime=${this.search.startTime}&endTime=${this.search.endTime}&contractNo=${this.search.contractNo}`)
            .then(res => {
              this.dataLoading = false;
              this.table.list = res.data.list;
              this.page.totalPage = res.data.total;
              if (res.data.list.length > 0) {
                let firstRow = res.data.list[0]
                this.$refs.dataTable.setCurrentRow(firstRow)
                this.getDataList2(firstRow)
              }
            }).catch(e => {
              this.dataLoading = false;
            });
        }
      })
    },
    searchData2s () {
      this.page3.pageNum = 1;
      this.searchData2()
    },
    // 合同数据查询
    searchData2 () {
      this.$refs.dataTable3.bodyWrapper.scrollTop = 0;
      this.dataLoading3 = true;
      this.search2.valueFlag1 = this.search2.valueFlag === '可使用' ? 0 : this.search2.valueFlag === '关闭' ? 1 : ''
      this.axios.get('pass/systemBase/v1/pretracknotices/' + '?pageNum=' + this.page3.pageNum + '&pageSize=' + this.page3.pageSize + '&valueFlag=' + this.search2.valueFlag1
        + '&noticeNo=' + this.search2.noticeNo + '&contractNo=' + this.search2.contractNo + '&batchNo=' + this.search2.batchNo + '&matterNo=' + this.search2.matterNo +
        `&customerSupplierName=${this.search2.customerSupplierName}&receivingUintName=${this.search2.receivingUintName}&meterTypeName=${this.search2.meterTypeName}`)
        .then(res => {
          this.dataLoading3 = false;
          if (res.data.list.length < 64) {
            this.groupList1 = [8]
          } else {
            this.groupList1 = [8, 1]
          }
          this.table.list3 = res.data.list;
          this.page3.totalPage = res.data.total;
          if (res.data.list3.length > 0) {
            let firstNotice = res.data.list3[0]
            this.$refs.dataTable3.setCurrentRow(firstNotice)
            this.getDataList(firstNotice)
          }
        }).catch(e => {
          this.dataLoading3 = false;
        });
    },
    getDataList (row, val) {
      this.firstNotice = row
      if (row === undefined || row === null) {
        this.table.list = []
        return
      }
      this.dataLoading = true;
      this.axios.get('pass/systemBase/v1/pretrackscales/' + '?pageNum=' + this.page.pageNum + '&pageSize=' + this.page.pageSize + '&noticeNo=' + row.noticeNo + '&predictionType=4')
        .then(res => {
          this.dataLoading = false;
          this.table.list = res.data.list;
          this.page.totalPage = res.data.total;
          if (!val) {
            if (res.data.list.length > 0) {
              let firstRow = res.data.list[0]
              this.$refs.dataTable.setCurrentRow(firstRow)
              this.getDataList2(firstRow)
            }
          }
        }).catch(e => {
          this.dataLoading = false;
        });
    },
    getNoticeData () {
      this.dataLoading3 = true;
      this.axios.get('pass/systemBase/v1/pretracknotices/' + '?pageNum=' + this.page3.pageNum + '&pageSize=' + this.page3.pageSize + '&valueFlag=0' + '&transportTypeName=汽车检斤')
        .then(res => {
          this.dataLoading3 = false;
          this.table.list3 = res.data.list;
          this.page3.totalPage = res.data.total;
          if (res.data.list3.length > 0) {
            let firstNotice = res.data.list3[0]
            this.$refs.dataTable3.setCurrentRow(firstNotice)
            this.getDataList(firstNotice)
          }
        }).catch(e => {
          this.dataLoading3 = false;
        });
    },
    historySearchData () {
      this.$refs['searchData1'].validate((valid) => {
        if (valid) {
          this.dataLoading = true;
          this.search.valueFlag1 = this.search.valueFlag === '未配车' ? 0 : this.search.valueFlag === '未使用' ? 1 : this.search.valueFlag === '已使用' ? 2 : this.search.valueFlag === '已作废' ? 3 : this.search.valueFlag === '正使用' ? 4 : ''
          this.axios.get('pass/systemBase/v1/pretrackscales/selectView' + '?pageNum=' + this.page.pageNum + '&pageSize=' + this.page.pageSize + '&carNo=' + this.search.carNo + '&predictionNo=' + this.search.predictionNo
            + '&predictionType=4' + '&meterTypeName=' + this.search.meterTypeName + '&matterNo=' + this.search.matterNo + '&valueFlag=' + this.search.valueFlag1 + `&startTime=${this.search.startTime}&endTime=${this.search.endTime}`)
            .then(res => {
              this.dataLoading = false;
              this.table.list = res.data.list;
              this.page.totalPage = res.data.total;
              if (res.data.list.length > 0) {
                let firstRow = res.data.list[0]
                this.$refs.dataTable.setCurrentRow(firstRow)
                this.getDataList2(firstRow)
              }
            }).catch(e => {
              this.dataLoading = false;
            });
        }
      })
    },
    // 查询特定预报的附加重量信息
    getDataList2 (row) {
      this.actualFirst = row
      if (row === undefined || row === null) {
        this.table.list2 = []
        return
      }
      this.dataLoading2 = true;
      this.axios.get('pass/systemBase/v1/peraddweights/' + '?pageNum=' + this.page2.pageNum + '&pageSize=' + this.page2.pageSize + '&predictionNo=' + row.predictionNo)
        .then(res => {
          this.dataLoading2 = false;
          this.table.list2 = res.data.list;
          this.page2.totalPage = res.data.total;
        }).catch(e => {
          this.dataLoading2 = false;
        });
    },
    filterCust (val) {
      if (val) {
        this.customerList = this.allList.filter(item => {
          if (item.customerSupplierName.indexOf(val) !== -1) {
            return true
          }
        }).slice(0, 300)
      } else {
        this.customerList = [...this.allList].slice(0, 300)
      }
    },
    filterRcv (val) {
      if (val) {
        this.receiverList = this.allList.filter(item => {
          if (item.customerSupplierName.indexOf(val) !== -1) {
            return true
          }
        }).slice(0, 300)
      } else {
        this.receiverList = [...this.allList].slice(0, 300)
      }
    },
    filterSdr (val) {
      if (val) {
        this.rcvList = this.allList.filter(item => {
          if (item.customerSupplierName.indexOf(val) !== -1) {
            return true
          }
        }).slice(0, 300)
      } else {
        this.rcvList = [...this.allList].slice(0, 300)
      }
    },
    filterESdr (val) {
      if (val) {
        this.editProList = this.allList.filter(item => {
          if (item.customerSupplierName.indexOf(val) !== -1) {
            return true
          }
        }).slice(0, 300)
      } else {
        this.editProList = [...this.allList].slice(0, 300)
      }
    },
    filterERcv (val) {
      if (val) {
        this.editReceList = this.allList.filter(item => {
          if (item.customerSupplierName.indexOf(val) !== -1) {
            return true
          }
        }).slice(0, 300)
      } else {
        this.editReceList = [...this.allList].slice(0, 300)
      }
    },
    filterECust (val) {
      if (val) {
        this.editCustList = this.allList.filter(item => {
          if (item.customerSupplierName.indexOf(val) !== -1) {
            return true
          }
        }).slice(0, 300)
      } else {
        this.editCustList = [...this.allList].slice(0, 300)
      }
    },
    tableRowClassName ({
      row,
      rowIndex
    }) {
      if (row.valueFlag === '3') {
        return 'error-row2';
      }
      return '';
    },
    getLoadPointNameItem () {
      this.axios.get('pass/systemBase/v1/meterbaseloadpoints/noPage' + '?validFlag=1')
        .then(res => {
          this.loadPointNameItem = res.data;
          this.baseData.loadPointName = res.data.length > 0 ? res.data[0].loadPointName : '';
        })
    },
    getMatterNameItem () {
      this.axios.get('pass/systemBase/v1/meterbasematterinfos/noPage' + '?validFlag=1')
        .then(res => {
          this.matList = [...res.data]
          this.matterNameItem = [...res.data].slice(0, 300);
          this.matterNameItem2 = [...res.data].slice(0, 300);
          this.matterNameItem3 = [...res.data].slice(0, 300);
          this.baseData.matterName = res.data[0].matterName;
        })
    },
    getCarrierUnitNameItem () {
      this.axios.get('pass/systemBase/v1/meterbasecarrierunits/noPage' + '?validFlag=1')
        .then(res => {
          this.carrierUnitNameItem = res.data;
          this.baseData.carrierUnitName = res.data[0].carrierUnitName;
        })
    },
    getUtensilNameItem () {
      this.axios.get('pass/systemBase/v1/combaseinfos/noPage' + '?pBaseCode=001010' + '&validFlag=1')
        .then(res => {
          this.utensilNameItem = res.data;
          this.baseData2.utensilName = res.data[0].baseName;
        })
    },
    getUtensilUtensilNameItem () {
      this.axios.get('pass/systemBase/v1/combaseinfos/noPage' + '?pBaseCode=001009' + '&validFlag=1')
        .then(res => {
          this.utensilUtensilNameItem = res.data;
          // this.baseData2.utensilUtensilName = res.data[0].baseName;
        })
    },
    getCustomerSupplierNameItem () {
      this.axios.get('pass/systemBase/v1/meterbasecustomersuppliers/noPage' + '?validFlag=1')
        .then(res => {
          this.customerSupplierNameItem = res.data;
          this.customerUnitNameItem = [...res.data].slice(0, 300)
          this.baseData.customerSupplierName = res.data[0].customerSupplierName;
        })
    },
    getMeterTypeNameItem () {
      this.axios.get('pass/systemBase/v1/combaseinfos/noPage' + '?pBaseCode=001006' + '&validFlag=1')
        .then(res => {
          this.meterTypeNameItem = res.data;
          this.baseData.meterTypeName = res.data[0].baseName;
        })
    },
    getMaterialNameItem () {
      this.axios.get('pass/systemBase/v1/combaseinfos/noPage' + '?pBaseCode=001017' + '&validFlag=1')
        .then(res => {
          this.matList = [...res.data]
          this.materialNameItem = [...res.data].slice(0, 300);
          this.baseData.materialName = res.data.length > 0 ? res.data[0].baseName : '';
        })
    },
    getSpecNameItem () {
      this.axios.get('pass/systemBase/v1/combaseinfos/noPage' + '?pBaseCode=001018' + '&validFlag=1')
        .then(res => {
          this.specNameItem = res.data;
          this.baseData.specName = res.data.length > 0 ? res.data[0].baseName : '';
        })
    },
    getForwardingUnitNameItem () {
      this.axios.get('pass/systemBase/v1/meterbasecustomersuppliers/selectOut')
        .then(res => {
          this.forwardingUnitNameItem = res.data;
          this.baseData.forwardingUnitName = res.data.length > 0 ? res.data[0].companyName : '';
        })
    },
    getReceivingUintNameItem () {
      this.axios.get('pass/systemBase/v1/meterbasecustomersuppliers/selectIn')
        .then(res => {
          this.receivingUintNameItem = res.data;
          this.receivingSUnitNameItem = [...res.data].slice(0, 300)
          this.baseData.receivingUintName = res.data.length > 0 ? res.data[0].companyName : '';
        })
    },
    // 查询客商表里面的所有有效数据
    async getMeterbasecustomersupplier () {
      const { data: res } = await this.axios.get('pass/systemBase/v1/meterbasecustomersuppliers/like/?pageNum=1&pageSize=100000&checkFlag=1&validFlag=1')
      // 给供应商，发货单位，收货单位赋值
      this.allList = [...res.list];
      this.provideList = [...res.list].slice(0, 300);
      this.rcvList = [...res.list].slice(0, 300);
      this.customerList = [...res.list].slice(0, 300);
      this.receiverList = [...res.list].slice(0, 300);
      this.editCustList = [...res.list].slice(0, 300);
      this.editReceList = [...res.list].slice(0, 300);
      this.editProList = [...res.list].slice(0, 300);
    }
  }
}
</script>
<style>
.measure-self-picker .el-input__inner {
  padding: 0px 0px 0px 4px !important;
}

.measure-self-picker .el-icon-time {
  display: none;
}
</style>