<!--到厂检测计量数据管理-->
<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"
              style="padding-left: 12px"
            >
              <el-form-item>
                <div style="font-size: 16px; padding: 0px 20px">合同信息</div>
              </el-form-item>
              <el-form-item prop="contractNo" label="合同号">
                <el-input
                  v-model="search2.contractNo"
                  clearable
                  size="small"
                  style="width: 180px"
                  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 htMeterTypeNameItem"
                    :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-actualSearchForm"
                  type="primary"
                  size="mini"
                  @click="searchContractData"
                  v-loading.fullscreen.lock="operateLoading"
                  v-privilege="activeMenu + 'QUERY'"
                  >合同查询</el-button
                >
                <el-button
                  icon="el-icon-circle-plus-outline"
                  type="primary"
                  size="mini"
                  @click="showAddDialog"
                  v-loading.fullscreen.lock="operateLoading"
                  v-privilege="activeMenu + 'INPUTWGT'"
                  >录入重量</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="contractTableHeight"
              :data="table.list3"
              :exchangeFilterMap="{ valueFlag: { '0': '可使用', '1': '关闭' } }"
              :icore-filter-flag="false"
            >
              <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="180"
                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="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="actualSearchForm"
          :rules="ruleValidateSearch"
          style="padding-left: 12px"
        >
          <el-form-item prop="carNo" label="车号">
            <el-input
              v-model="actualSearchForm.carNo"
              clearable
              size="small"
              style="width: 120px"
              placeholder="请输入"
            ></el-input>
          </el-form-item>
          <el-form-item prop="meterTypeName" label="业务类型">
            <el-select
              v-model="actualSearchForm.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="actualSearchForm.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="startTime" label="开始时间">
            <el-date-picker
              class="measure-self-picker"
              v-model="actualSearchForm.startTime"
              clearable
              type="datetime"
              style="width: 120px"
              placeholder="选择日期"
              @change="dateChange(actualSearchForm.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="actualSearchForm.endTime"
              clearable
              type="datetime"
              style="width: 120px"
              placeholder="选择日期"
              @change="dateChange(actualSearchForm.endTime, 'endTime')"
              size="small"
            ></el-date-picker>
          </el-form-item>
          <el-form-item label-width="20px">
            <el-button
              icon="el-icon-actualSearchForm"
              type="primary"
              size="mini"
              @click="searchActualData"
              v-loading.fullscreen.lock="operateLoading"
              v-privilege="activeMenu + 'QUERY1'"
              >实绩查询</el-button
            >
            <el-button
              type="danger"
              size="mini"
              @click="dropData"
              v-loading.fullscreen.lock="operateLoading"
              >作废</el-button
            >
            <!-- <el-button
              type="primary"
              size="mini"
              @click="recoverData"
              v-loading.fullscreen.lock="operateLoading"
              >启用</el-button
            > -->
            <!-- <el-button
              icon="el-icon-edit"
              type="primary"
              size="mini"
              @click="showEditDialog('single')"
              v-loading.fullscreen.lock="operateLoading"
              v-privilege="activeMenu + 'UPDATE'"
              >修改</el-button
            > -->
            <el-button
              size="mini"
              type="primary"
              icon="el-icon-check"
              @click="showEditDialog('batch')"
              v-loading.fullscreen.lock="operateLoading"
              v-privilege="activeMenu + 'BATCHEDIT'"
              >批量修改</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">
              </div> -->
            </div>
            <div class="common-table-div">
              <el-table
                v-loading="dataLoading"
                ref="dataTable"
                highlight-current-row
                @selection-change="selectionChange"
                border
                show-summary
                :summary-method="getSum"
                :height="tableHeight"
                :row-class-name="tableRowClassName"
                :data="actualList"
                :exchangeFilterMap="{
                  valueFlag: {
                    '0': '未配车',
                    '1': '未使用',
                    '2': '已使用',
                    '3': '已作废',
                    '4': '正使用',
                  },
                  predictionType: {
                    '0': '批次预报',
                    '1': '单次预报',
                    '2': '联运预报',
                    '3': '分检预报',
                  },
                  usedType: { '0': '次数', '1': '时间', '2': '总量' },
                }"
                :icore-filter-flag="true"
              >
                <el-table-column
                  type="index"
                  label="序号"
                  fixed="left"
                  align="center"
                ></el-table-column>
                <el-table-column
                  type="selection"
                  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="contractNo"
                  label="合同号"
                  min-width="160"
                  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="carNo"
                  label="车号"
                  min-width="110"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="grossWeight"
                  label="毛重/kg"
                  min-width="80"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="tareWeight"
                  label="皮重/kg"
                  min-width="80"
                  align="left"
                ></el-table-column>
                <el-table-column
                  sortable
                  :show-overflow-tooltip="true"
                  prop="netWeight"
                  label="净重/kg"
                  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="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="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="loadPointName"
                  min-width="100"
                  label="卸货地点"
                  align="left"
                ></el-table-column>
                <el-table-column
                  fixed="right"
                  :show-overflow-tooltip="true"
                  min-width="100"
                  label="操作"
                  align="center"
                >
                  <template slot-scope="scope">
                    <el-button
                      type="primary"
                      size="mini"
                      @click="showEditDialog('single', scope.row)"
                      v-privilege="activeMenu + 'UPDATE'"
                      >修改</el-button
                    >
                  </template>
                </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>
        </el-col>
      </el-row>
      <el-dialog
        @close="closeDialog"
        :visible.sync="showFlag"
        customClass="weight-input-wrap"
        :title="dialogTitle"
        width="700px"
        :close-on-click-modal="false"
      >
        <el-form
          ref="formObj"
          label-width="70px"
          :inline="true"
          :model="formObj"
          :rules="rules"
        >
          <el-form-item prop="contractNo" label="合 同  号">
            <el-input
              v-model="formObj.contractNo"
              clearable
              size="small"
              style="width: 160px"
              placeholder="请输入"
              :disabled="editFlag === 'add' ? 'disabled' : false"
            ></el-input>
          </el-form-item>
          <el-form-item prop="batchNo" label="批次号" class="edit-row-wrap">
            <el-input
              style="width: 160px"
              v-model="formObj.batchNo"
              size="small"
              clearable
              placeholder="请输入"
              :disabled="editFlag === 'add' ? 'disabled' : false"
            ></el-input>
          </el-form-item>
          <el-form-item prop="matterName" label="物资名称">
            <el-select
              size="mini"
              style="width: 160px"
              filterable
              v-model="formObj.matterName"
              :disabled="editFlag === 'add' ? 'disabled' : false"
            >
              <el-option
                v-for="item in matList"
                :key="item.matterNo"
                :label="item.matterName"
                :value="item.matterName"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item prop="customerSupplierName" label="供应商">
            <el-select
              size="mini"
              style="width: 160px"
              filterable
              v-model="formObj.customerSupplierName"
              :disabled="editFlag === 'add' ? 'disabled' : false"
              :filter-method="filterECust"
              @change="custChange"
            >
              <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="forwardingUnitName" label="发货单位">
            <el-select
              size="mini"
              style="width: 160px"
              filterable
              v-model="formObj.forwardingUnitName"
              :disabled="editFlag === 'add' ? 'disabled' : false"
              :filter-method="filterESdr"
              @change="sdrChange"
            >
              <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="receivingUintName" label="收货单位">
            <el-select
              size="mini"
              style="width: 160px"
              filterable
              v-model="formObj.receivingUintName"
              :disabled="editFlag === 'add' ? 'disabled' : false"
              :filter-method="filterERcv"
              @change="rcvChange"
            >
              <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="meterTypeName" label="业务类型">
            <el-select
              v-model="formObj.meterTypeName"
              clearable
              filterable
              size="small"
              style="width: 160px"
              @change="meterTypeChange"
            >
              <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="carNo" label="车号" v-if="wgtFlag === 'single'">
            <el-input
              v-model="formObj.carNo"
              size="small"
              type="text"
              style="width: 160px"
            ></el-input>
          </el-form-item>
          <el-form-item prop="heatNo" label="炉号" v-if="wgtFlag === 'single'">
            <el-input
              v-model="formObj.heatNo"
              size="small"
              type="text"
              style="width: 160px"
            ></el-input>
          </el-form-item>
          <el-form-item
            prop="grossWeight"
            label="毛重"
            v-if="wgtFlag === 'single'"
          >
            <el-input
              v-model="formObj.grossWeight"
              size="small"
              type="text"
              style="width: 160px"
            ></el-input>
          </el-form-item>
          <el-form-item
            prop="tareWeight"
            label="皮重"
            v-if="wgtFlag === 'single'"
          >
            <el-input
              v-model="formObj.tareWeight"
              size="small"
              type="text"
              style="width: 160px"
            ></el-input>
          </el-form-item>
          <el-form-item
            prop="netWeight"
            label="净重"
            v-if="wgtFlag === 'single'"
          >
            <el-input
              v-model="formObj.netWeight"
              size="small"
              type="text"
              style="width: 160px"
            ></el-input>
          </el-form-item>
          <el-form-item
            prop="shipmentNum"
            label="发运数量"
            v-if="wgtFlag === 'single'"
          >
            <el-input
              v-model="formObj.shipmentNum"
              size="small"
              type="text"
              style="width: 160px"
            ></el-input>
          </el-form-item>
          <el-form-item label="重量单位" v-if="wgtFlag === 'single'">
            <el-select v-model="unitFlag" size="small">
              <el-option
                v-for="item in wgtUnitList"
                :key="item.id"
                :value="item.id"
                :label="item.name"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-form>
        <span slot="footer" class="dialog-footer" style="text-align: center">
          <el-button type="primary" size="mini" @click="createData"
            >确定</el-button
          >
          <el-button size="mini" type="default" @click="closeDialog"
            >取消</el-button
          >
        </span>
      </el-dialog>
    </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 () {
    let numberCheck = (rule, value, callback) => {
      if (/^(-?\d+)(\.\d+)?$/.test(value) == false) {
        callback(new Error("重量需要为数值"));
      } else {
        callback();
      }
    }
    return {
      dataLoading: false,
      dataLoading2: false,
      dataLoading3: false,
      operateLoading: false,
      isEffectiveWeight: true,
      isEffectiveNum: true, // 有效次数是否可编辑
      isEffectiveTime: true,
      isUsedType: true,
      flag: 0,
      actualFirst: {},
      firstNotice: {},
      meterTypeNameItem: [],
      htMeterTypeNameItem: [],
      matterNameItem: [],
      matterNameItem2: [],
      matterNameItem3: [],
      valueFlagItem: [
        { valueFlag: '未配车' },
        { valueFlag: '未使用' },
        { valueFlag: '已使用' },
        { valueFlag: '已作废' },
        { valueFlag: '正使用' }
      ],
      valueFlagItem2: [
        { valueFlag: '可使用' },
        { valueFlag: '关闭' },
      ],
      predictionTypeItem: [
        { id: '1', predictionType: '单次预报' },
        // { id: '2', 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: {},
      multipleSelection: [],
      tableHeight: 0,
      contractTableHeight: 0,
      actualSearchForm: {
        predictionNo: '',
        carNo: '',
        meterTypeName: '',
        matterNo: '',
        predictionType: '',
        startTime: formatDate(new Date(), 'yyyy-MM-dd') + ' 00:00:00',
        endTime: formatDate(new Date(), 'yyyy-MM-dd') + ' 23:59:59',
        contractNo: ''
      },
      search2: {
        noticeNo: '',
        contractNo: '',
        batchNo: '',
        matterNo: '',
        valueFlag: '可使用',
        customerSupplierName: '',
        receivingUintName: '',
        meterTypeName: ''
      },
      ruleValidateSearch: {},
      ruleValidateSearch2: {},
      activeMenu: '',
      typeFlag: true,
      groupList: [8, 1],
      groupList1: [8, 1],
      receivingSUnitNameItem: [],
      customerUnitNameItem: [],
      loadRules: {
        loadPointName: [{ required: true, message: '该项不能为空', trigger: 'blur' }]
      },
      matList: [],
      otherSpec: '', // 分检规格
      checkFlag: false, // 分检规格是否允许编辑
      userNo: '', // 登录用户id
      userName: '', // 登录用户名称
      matList: [],
      provideList: [],
      customerList: [],
      rcvList: [],
      receiverList: [],
      editCustList: [],
      editReceList: [],
      editProList: [],
      allList: [],
      showFlag: false,
      contractRow: {},
      actualRow: {},
      formObj: {
        forwardingUnitName: '',
        forwardingUnitNo: '',
        meterTypeName: '',
        meterTypeNo: '',
        receivingUintName: '',
        receivingUintNo: '',
        contractNo: '',
        matterName: '',
        matterNo: '',
        carNo: '',
        heatNo: '',
        customerSupplierName: '',
        customerSupplierNo: '',
        batchNo: '',
        grossWeight: 0,
        tareWeight: 0,
        netWeight: 0,
        shipmentNum: ''
      },
      formObjCache: {
        forwardingUnitName: '',
        forwardingUnitNo: '',
        meterTypeName: '',
        meterTypeNo: '',
        receivingUintName: '',
        receivingUintNo: '',
        contractNo: '',
        matterName: '',
        matterNo: '',
        carNo: '',
        heatNo: '',
        customerSupplierName: '',
        customerSupplierNo: '',
        batchNo: '',
        grossWeight: 0,
        tareWeight: 0,
        netWeight: 0
      },
      wgtObj: {
        grossWeight: 0,
        tareWeight: 0,
        netWeight: 0
      },
      rules: {
        grossWeight: [{ required: true, message: '毛重不能为空', trigger: 'blur' }],
        tareWeight: [{ required: true, message: '皮重不能为空', trigger: 'blur' }],
        netWeight: [{ required: true, message: '净重不能为空', trigger: 'blur' }],
        contractNo: [{ required: true, message: '合同号不能为空', trigger: 'blur' }],
        matterName: [{ required: true, message: '物资不能为空', trigger: 'blur' }],
        forwardingUnitName: [{ required: true, message: '发货单位不能为空', trigger: 'blur' }],
        receivingUintName: [{ required: true, message: '收货单位不能为空', trigger: 'blur' }],
        meterTypeName: [{ required: true, message: '业务类型不能为空', trigger: 'blur' }]
      },
      unitFlag: 'kg',
      wgtUnitList: [{ id: 'kg', name: '千克' }, { id: 't', name: '吨' }],
      actualList: [],
      editFlag: 'add',
      wgtFlag: 'single',
      batchList: [],
      dialogTitle: '到厂检测计量新增',
      matList: [],
      unitList: [],
      editCustList: [],
      editReceList: [],
      editProList: []
    }
  },
  created () {
    this.tableHeight = '420'
    this.contractTableHeight = '130'
    this.activeMenu = window.top.localStorage.getItem('activeMenu')
  },
  mounted () {
    this.getMatterNameItem();//物料
    this.getMeterTypeNameItem();//业务类型
    this.getMeterTypeNameItem1();//业务类型
    this.getMeterbasecustomersupplier();
    this.init();
  },
  methods: {
    init () {
      this.searchContractData()
      this.searchActualData()
    },
    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)
      }
    },
    async recoverData (row) {
      if (this.batchList.length <= 0) return this.$message.error('请勾选要进行启用的数据')
      let stateFlag = true
      this.batchList.forEach(item => {
        if (item.valueFlag - 0 !== 1) {
          stateFlag = false
        }
      })
      if (row.valueFlag - 0 !== 1) return this.$message.error('选中数据中存在有效数据，无法进行启用操作')
      let confirm = await this.$confirm('确认要启用这些数据吗？').catch(() => 'cancel')
      if (confirm === 'cancel') return
      this.batchList.forEach(item => {
        item.valueFlag = '0'
      })
      const data = await this.axios.post('pass/systemBase/v1/meterworkcaractuals/updateByZhuWai', [...this.batchList], {individualType: 'json'})
      if (data.status === 'succeed') {
        this.$message.success('启用成功')
        this.init()
      } else {
        this.$message.error(data.message)
      }
    },
    async dropData (row) {
      if (this.batchList.length <= 0) return this.$message.error('请勾选要进行废除的数据')
      let stateFlag = true
      this.batchList.forEach(item => {
        if (item.valueFlag - 0 !== 0) {
          stateFlag = false
        }
      })
      if (!stateFlag) return this.$message.error('选中数据中存在已作废数据，无法进行作废操作')
      let confirm = await this.$confirm('确认要作废这些记录吗？').catch(() => 'cancel')
      if (confirm === 'cancel') return
      this.batchList.forEach(item => {
        item.valueFlag = '1'
      })
      const data = await this.axios.post('pass/systemBase/v1/meterworkcaractuals/updateByZhuWai', [...this.batchList], {individualType: 'json'})
      if (data.status === 'succeed') {
        this.$message.success('作废成功')
        this.init()
      } else {
        this.$message.error(data.message)
      }
    },
    dateChange (val, name) {
      if (val) {
        this.actualSearchForm[name] = formatDate(val)
      } else {
        this.actualSearchForm[name] = ''
      }
    },
    setParam (data) {
      this.actualSearchForm.carNo = data.carNo
      this.actualSearchForm.meterTypeName = data.meterTypeName
    },
    getMeterTypeNameItem1 () {
      this.axios.get('pass/systemBase/v1/combaseinfos/noPage' + '?pBaseCode=001006' + '&validFlag=1')
        .then(res => {
          this.htMeterTypeNameItem = res.data;
        })
    },
    getSum ({ columns, data }) {
      const sums = [];
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = "合计";
        }
        const values = data.map(item => Number(item[column.property]));
        if (!values.every(value => isNaN(value))) {
          if (column.property === 'grossWeight' | column.property === 'tareWeight' | column.property === 'netWeight' | column.property === 'shipmentNum') {
            sums[index] = values.reduce((prev, curr) => {
              const value = Number(curr);
              if (!isNaN(value) && value - 0 !== 0) {
                return this.floatComputed1(prev, curr, '+');
              } else {
                return prev;
              }
            }, 0);
          }
        }
      });
      return sums;
    },
    floatComputed1 (arg1, arg2, sign) {
      if (!arg1) {
        arg1 = 0;
      }
      if (!arg2) {
        arg2 = 0;
      }
      let val1 = arg1 + '';
      let val2 = arg2 + '';
      let rate = 1;
      let rate1 = 1;
      let rate2 = 1;
      if (val1.indexOf('.') < 0) {
        rate1 = 0;
      } else {
        rate1 = val1.length - val1.indexOf('.') - 1;
      }
      if (val2.indexOf('.') < 0) {
        rate2 = 0;
      } else {
        rate2 = val2.length - val2.indexOf('.') - 1;
      }
      rate = rate2;
      val2 = val2.replace('.', '');
      val1 = val1.replace('.', '');
      if (rate1 > rate2) {
        rate = rate1;
        for (let i = 0; i < rate1 - rate2; i++) {
          val2 = val2 + '0'
        }
      } else {
        for (let i = 0; i < rate2 - rate1; i++) {
          val1 = val1 + '0';
        }
      }
      let rateNum = Math.pow(10, rate);
      if (sign === '-') {
        return (Number(val1) - Number(val2)) / rateNum
      }
      if (sign === '+') {
        return (Number(val1) + Number(val2)) / rateNum
      }
      if (sign === '*') {
        return (Number(val1) * Number(val2)) / (rateNum * rateNum)
      }
      if (sign === '/') { // 默认保留4位
        let num = 0;
        if (Number(val1) - 0 !== 0 && Number(val2) - 0 !== 0) {
          num = (Number(val1) / Number(val2)) + '';
          if (num.split('.').length > 0) {
            if (num[1].length > 4) {
              num = num.toFixed(4);
            }
          }
        }
        return num;
      }
      return null;
    },
    // 新增到厂检测计量数据
    async createData () {
      let msg = this.editFlag === 'add' ? '新增' : '修改'
      if (this.unitFlag === 'kg') {
        if (this.formObj.netWeight < 150) {
          let confirmFlag = await this.$confirm(`当前输入净重小于150千克，确定要进行${msg}吗？`).catch(() => 'cancel');
          if (confirmFlag === 'cancel') return false;
        }
      } else {
        if (this.formObj.netWeight > 150) {
          let confirmFlag = await this.$confirm(`当前输入净重大于150吨，确定要进行${msg}吗？`).catch(() => 'cancel');
          if (confirmFlag === 'cancel') return false;
        }
      }
      if (this.editFlag === 'add') {
        const validFlag = await this.$refs.formObj.validate().catch(() => 'error');
        if (validFlag === 'error') return this.$message.error('请规范填写数据');
        if (this.unitFlag !== 'kg') {
          this.formObj.grossWeight *= 1000
          this.formObj.tareWeight *= 1000
          this.formObj.netWeight *= 1000
        }
        const data = await this.axios.post('pass/systemBase/v1/meterworkcaractuals/insertByNotice', this.formObj, { individualType: 'json' })
        if (data.status === 'succeed') {
          this.$message.success('新增成功')
          this.init()
          this.closeDialog()
        } else {
          this.$message.error(data.message)
          if (this.unitFlag !== 'kg') {
            this.formObj.grossWeight = Math.floor((this.formObj.grossWeight - 0) / 10) / 100
            this.formObj.tareWeight = Math.floor((this.formObj.tareWeight - 0) / 10) / 100
            this.formObj.netWeight = Math.floor((this.formObj.netWeight - 0) / 10) / 100
          }
        }
      } else {
        // 修改
        let paramList = []
        if (this.wgtFlag === 'single') {
          // 校验必填项
          paramList = [
            {
              ...this.formObj
            }
          ]
        } else if (this.wgtFlag === 'batch') {
          this.rules['grossWeight'].required = false
          this.rules['tareWeight'].required = false
          this.rules['netWeight'].required = false
          paramList = []
          this.batchList.forEach(item => {
            paramList.push({
              ...item,
              contractNo: this.formObj.contractNo,
              batchNo: this.formObj.batchNo,
              matterName: this.formObj.matterName,
              matterNo: this.formObj.matterNo,
              customerSupplierName: this.formObj.customerSupplierName,
              customerSupplierNo: this.formObj.customerSupplierNo,
              forwardingUnitName: this.formObj.forwardingUnitName,
              forwardingUnitNo: this.formObj.forwardingUnitNo,
              receivingUintName: this.formObj.receivingUintName,
              receivingUintNo: this.formObj.receivingUintNo,
              meterTypeName: this.formObj.meterTypeName,
              meterTypeNo: this.formObj.meterTypeNo
            })
          })
        }
        let valid = await this.$refs.formObj.validate().catch(() => false)
        if (!valid) return this.$message.error('请规范填写数据')
        if (this.unitFlag !== 'kg') {
          this.formObj.grossWeight *= 1000
          this.formObj.tareWeight *= 1000
          this.formObj.netWeight *= 1000
        }
        const data = await this.axios.post('pass/systemBase/v1/meterworkcaractuals/updateByZhuWai', paramList, { individualType: 'json' })
        if (data.status === 'succeed') {
          this.$message.success('修改成功')
          this.searchContractData()
          this.searchActualData()
          this.closeDialog()
        } else {
          this.$message.error(data.message)
          if (this.unitFlag !== 'kg') {
            this.formObj.grossWeight = Math.floor((this.formObj.grossWeight - 0) / 10) / 100
            this.formObj.tareWeight = Math.floor((this.formObj.tareWeight - 0) / 10) / 100
            this.formObj.netWeight = Math.floor((this.formObj.netWeight - 0) / 10) / 100
          }
        }
      }
    },
    // 合同数据查询
    searchContractData (flag = 1) {
      if (flag === 1) {
        this.page3.pageNum = 1;
      }
      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 +
        '&transportTypeName=汽车检斤' + `&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)
          }
        }).catch(e => {
          this.dataLoading3 = false;
        });
    },
    // 实绩表格多选
    selectionChange (val) {
      this.batchList = [...val]
    },
    // 实绩数据查询
    async searchActualData (flag = 1) {
      if (flag === 1) {
        this.page.pageNum = 1
      }
      this.dataLoading = true
      let meterTypeName = this.actualSearchForm.meterTypeName === '' ? '到厂检测' : this.actualSearchForm.meterTypeName
      let paramStr = `pageNum=${this.page.pageNum}&pageSize=${this.page.pageSize}&carNo=${this.actualSearchForm.carNo}&meterTypeName=${meterTypeName}&matterNo=${this.actualSearchForm.matterNo}&netTime1=${this.actualSearchForm.startTime}&netTime2=${this.actualSearchForm.endTime}&valueFlag=0`
      const { data: res } = await this.axios.get(`pass/systemBase/v1/meterworkcaractuals/selectView?${paramStr}`)
      if (res && res.list) {
        this.actualList = [...res.list];
        this.page.totalPage = res.total - 0
      } else {
        this.actualList = [];
        this.page.totalPage = 0;
      }
      this.dataLoading = false
    },
    // 物资选中
    matChange (val) {
      if (val) {
        let item = this.matList.find(item => item.matterName === val)
        if (item) {
          this.formObj.matterNo = item.matterNo
        }
      }
    },
    // 发货单位筛选
    filterESdr (val) {
      if (val) {
        this.editProList = this.unitList.filter(item => {
          if (item.customerSupplierName.indexOf(val) !== -1) {
            return true
          }
        }).slice(0, 300)
      } else {
        this.editProList = [...this.unitList].slice(0, 300)
      }
    },
    // 收货单位筛选
    filterERcv (val) {
      if (val) {
        this.editReceList = this.unitList.filter(item => {
          if (item.customerSupplierName.indexOf(val) !== -1) {
            return true
          }
        }).slice(0, 300)
      } else {
        this.editReceList = [...this.unitList].slice(0, 300)
      }
    },
    // 供应商筛选
    filterECust (val) {
      if (val) {
        this.editCustList = this.unitList.filter(item => {
          if (item.customerSupplierName.indexOf(val) !== -1) {
            return true
          }
        }).slice(0, 300)
      } else {
        this.editCustList = [...this.unitList].slice(0, 300)
      }
    },
    // 供应商选中
    custChange (val) {
      if (val) {
        let item = this.unitList.find(item => item.customerSupplierName === val)
        if (item) {
          this.formObj.customerSupplierNo = item.customerSupplierNo
        }
      }
    },
    // 发货单位选中
    sdrChange (val) {
      if (val) {
        let item = this.unitList.find(item => item.customerSupplierName === val)
        if (item) {
          this.formObj.forwardingUnitNo = item.customerSupplierNo
        }
      }
    },
    // 收货单位选中
    rcvChange (val) {
      if (val) {
        let item = this.unitList.find(item => item.customerSupplierName === val)
        if (item) {
          this.formObj.receivingUintNo = item.customerSupplierNo
        }
      }
    },
    // 显示重量录入弹窗
    showAddDialog () {
      if (JSON.stringify(this.contractRow) === "{}") {
        return this.$message.error('请先点选要进行重量录入的合同信息')
      }
      this.showFlag = true
      this.formObj = { ...this.contractRow, ...this.wgtObj }
      if (this.formObj.meterTypeName && this.formObj.meterTypeName.indexOf('采购') != -1) {
        let item = this.meterTypeNameItem.find(i => i.baseName.indexOf('采购') != -1)
        if (item) {
          this.formObj.meterTypeName = item.baseName
          this.formObj.meterTypeNo = item.baseCode
        }
      } else if (this.formObj.meterTypeName && this.formObj.meterTypeName.indexOf('销售') != -1) {
        let item = this.meterTypeNameItem.find(i => i.baseName.indexOf('销售') != -1)
        if (item) {
          this.formObj.meterTypeName = item.baseName
          this.formObj.meterTypeNo = item.baseCode
        }
      }
    },
    // 实绩数据行选中
    rowChange (row, column, event) {

    },
    // 合同行选中
    rowChange3 (row, column, event) {
      this.contractRow = { ...row }
    },
    tableRowClassName ({
      row,
      rowIndex
    }) {
      if (row.valueFlag === '3') {
        return 'error-row2';
      }
      return '';
    },
    showEditDialog (flag, row) {
      if (flag === 'single') {
        this.actualRow = { ...row }
        if (JSON.stringify(this.actualRow) === "{}") {
          return this.$message.error('请点选要进行修改的实绩数据')
        }
      } else {
        if (this.batchList.length === 0) {
          return this.$message.error('请勾选要进行批量修改的实绩数据')
        }
        this.actualRow = { ...this.batchList[0] }
      }
      this.dialogTitle = '到厂检测计量修改'
      this.editFlag = 'edit'
      this.wgtFlag = flag
      this.formObj = { ...this.actualRow }
      this.showFlag = true
    },
    // 业务类型下拉改变
    meterTypeChange (val) {
      if (val) {
        let item = this.meterTypeNameItem.find(o => o.baseName === val)
        if (item) {
          this.formObj.meterTypeNo = item.baseCode;
        }
      } else {
        this.formObj.meterTypeNo = '';
      }
    },
    closeDialog () {
      console.log('进来了')
      this.showFlag = false
      this.$refs.dataTable3.setCurrentRow(this.contractRow, false)
      this.contractRow = {}
      this.formObj = { ...this.formObjCache }
      // this.$refs.forecastTable.clearSelection()
    },
    pageSizeChange (size) {
      this.page.pageSize = size;
      this.searchActualData()
    },
    pageCurrentChange (index) {
      this.page.pageNum = index;
      this.searchActualData(2)
    },
    handleSelectionChange2 (val) {
      this.multipleSelection2 = val;
    },
    pageSizeChange3 (size) {
      this.page3.pageSize = size;
      this.searchContractData()
    },
    pageCurrentChange3 (index) {
      this.page3.pageNum = index;
      this.searchContractData(2)
    },
    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)
      }
    },
    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);
        })
    },
    getCustomerSupplierNameItem () {
      this.axios.get('pass/systemBase/v1/meterbasecustomersuppliers/noPage' + '?validFlag=1')
        .then(res => {
          this.customerSupplierNameItem = res.data;
          this.customerUnitNameItem = [...res.data].slice(0, 300)
        })
    },
    // 获取到厂检测计量类型
    getMeterTypeNameItem () {
      this.axios.get('pass/systemBase/v1/combaseinfos/noPage' + '?pBaseCode=001040' + '&validFlag=1')
        .then(res => {
          this.meterTypeNameItem = res.data;
        })
    },
    // 查询客商表里面的所有有效数据
    async getMeterbasecustomersupplier () {
      const { data: res } = await this.axios.get('pass/systemBase/v1/meterbasecustomersuppliers/like/?pageNum=1&pageSize=100000&checkFlag=1&validFlag=1')
      // 给供应商，发货单位，收货单位赋值
      this.unitList = [...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);
    }
  },
  watch: {
    'formObj.grossWeight': {
      handler: function (val) {
        let reg = /^(-?\d+)(\.\d+)?$/
        if (!reg.test(val - 0)) {
          this.formObj.grossWeight = 0
          return this.$message.error('毛重需要为数值')
        }
        if (val - 0 !== 0) {
          this.formObj.netWeight = this.floatComputed(this.formObj.grossWeight - 0, this.formObj.tareWeight - 0, '-')
        }
      }
    },
    'formObj.tareWeight': {
      handler: function (val) {
        let reg = /^(-?\d+)(\.\d+)?$/
        if (!reg.test(val - 0)) {
          this.formObj.tareWeight = 0
          return this.$message.error('皮重需要为数值')
        }
        if (val - 0 !== 0) {
          this.formObj.netWeight = this.floatComputed(this.formObj.grossWeight - 0, this.formObj.tareWeight - 0, '-')
        }
      }
    },
    unitFlag (val) {
      switch (val) {
        case 'kg':
          // 分别判断三个值是否大于1000
          // 小于1000乘以1000
          if (this.formObj.grossWeight && this.formObj.grossWeight - 0 !== 0 && this.formObj.grossWeight - 0 < 1000) {
            this.formObj.grossWeight = this.floatComputed(this.formObj.grossWeight, 1000, '*')
          }
          if (this.formObj.tareWeight && this.formObj.tareWeight - 0 !== 0 && this.formObj.tareWeight - 0 < 1000) {
            this.formObj.tareWeight = this.floatComputed(this.formObj.tareWeight, 1000, '*')
          }
          if (this.formObj.netWeight && this.formObj.netWeight - 0 !== 0 && this.formObj.netWeight - 0 < 1000) {
            this.formObj.netWeight = this.floatComputed(this.formObj.netWeight, 1000, '*')
          }
          break;
        case 't':
          // 分别判断三个值是否大于1000
          // 大于1000除以1000
          if (this.formObj.grossWeight && this.formObj.grossWeight - 0 !== 0 && this.formObj.grossWeight - 0 > 1000) {
            this.formObj.grossWeight = this.floatComputed(this.formObj.grossWeight, 1000, '/')
          }
          if (this.formObj.tareWeight && this.formObj.tareWeight - 0 !== 0 && this.formObj.tareWeight - 0 > 1000) {
            this.formObj.tareWeight = this.floatComputed(this.formObj.tareWeight, 1000, '/')
          }
          if (this.formObj.netWeight && this.formObj.netWeight - 0 !== 0 && this.formObj.netWeight - 0 > 1000) {
            this.formObj.netWeight = this.floatComputed(this.formObj.netWeight, 1000, '/')
          }
          break;
      }
    }
  }
}
</script>
<style>
.measure-self-picker .el-input__inner {
  padding: 0px 0px 0px 4px !important;
}

.measure-self-picker .el-icon-time {
  display: none;
}

.weight-input-wrap.el-dialog .el-dialog__header {
  background-color: #409eff;
  border-radius: 4px 4px 0 0;
  color: #fff;
  padding: 14px;
}
</style>