<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="创建人名称" prop="createName">
        <el-input
          v-model="queryParams.createName"
          placeholder="请输入创建人名称 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="处置人姓名" prop="createBy">
        <el-input
          v-model="queryParams.createBy"
          placeholder="请输入处置人姓名 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建处置时间" prop="createTime">
        <el-date-picker clearable
          v-model="queryParams.createTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择创建处置时间 ">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="更新人名称" prop="updateName">
        <el-input
          v-model="queryParams.updateName"
          placeholder="请输入更新人名称 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="更新人登录名称" prop="updateBy">
        <el-input
          v-model="queryParams.updateBy"
          placeholder="请输入更新人登录名称 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="更新日期" prop="updateTime">
        <el-date-picker clearable
          v-model="queryParams.updateTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择更新日期 ">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="流量计算标准" prop="dFlowCalbz">
        <el-select v-model="queryParams.dFlowCalbz" placeholder="请选择流量计算标准 " clearable>
          <el-option
            v-for="dict in dict.type.ngtools_lljsbz"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="压缩因子计算标准" prop="dZcalbz">
        <el-select v-model="queryParams.dZcalbz" placeholder="请选择压缩因子计算标准 " clearable>
          <el-option
            v-for="dict in dict.type.ngtools_ysyzjsbz"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="计量参比条件压力" prop="dCbtj">
        <el-select v-model="queryParams.dCbtj" placeholder="请选择计量参比条件压力 " clearable>
          <el-option
            v-for="dict in dict.type.ngtools_cbtj"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="计量参比条件压力" prop="dpbM">
        <el-input
          v-model="queryParams.dpbM"
          placeholder="请输入计量参比条件压力 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="计量参比条件温度" prop="dtbM">
        <el-input
          v-model="queryParams.dtbM"
          placeholder="请输入计量参比条件温度 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="燃烧参比条件压力" prop="dpbE">
        <el-input
          v-model="queryParams.dpbE"
          placeholder="请输入燃烧参比条件压力 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="燃烧参比条件温度" prop="dtbE">
        <el-input
          v-model="queryParams.dtbE"
          placeholder="请输入燃烧参比条件温度 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="当地大气压" prop="dPatm">
        <el-input
          v-model="queryParams.dPatm"
          placeholder="请输入当地大气压 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="当地大气压单位" prop="dPatmUnit">
        <el-input
          v-model="queryParams.dPatmUnit"
          placeholder="请输入当地大气压单位 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="天然气组分" prop="dngCompents">
        <el-input
          v-model="queryParams.dngCompents"
          placeholder="请输入天然气组分 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="流量计类别" prop="dMeterType">
        <el-select v-model="queryParams.dMeterType" placeholder="请选择流量计类别 " clearable>
          <el-option
            v-for="dict in dict.type.ngtools_lljlx"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="节流装置类型" prop="dCoreType">
        <el-select v-model="queryParams.dCoreType" placeholder="请选择节流装置类型 " clearable>
          <el-option
            v-for="dict in dict.type.ngtools_jlzzlx"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="取压方式" prop="dPtmode">
        <el-select v-model="queryParams.dPtmode" placeholder="请选择取压方式 " clearable>
          <el-option
            v-for="dict in dict.type.qyfs"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="管道类型" prop="dPipeType">
        <el-select v-model="queryParams.dPipeType" placeholder="请选择管道类型 " clearable>
          <el-option
            v-for="dict in dict.type.ngtools_gdlx"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="管道内径" prop="dPipeD">
        <el-input
          v-model="queryParams.dPipeD"
          placeholder="请输入管道内径 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="长度单位" prop="dLenUnit">
        <el-input
          v-model="queryParams.dLenUnit"
          placeholder="请输入长度单位 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="管道内径参考温度" prop="dPipeDtemp">
        <el-input
          v-model="queryParams.dPipeDtemp"
          placeholder="请输入管道内径参考温度 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="温度单位" prop="dPileDtempU">
        <el-input
          v-model="queryParams.dPileDtempU"
          placeholder="请输入温度单位 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="管道材料" prop="dPipeMaterial">
        <el-select v-model="queryParams.dPipeMaterial" placeholder="请选择管道材料 " clearable>
          <el-option
            v-for="dict in dict.type.ngtools_gdcz"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="孔板孔径" prop="dOrificeD">
        <el-input
          v-model="queryParams.dOrificeD"
          placeholder="请输入孔板孔径 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="长度单位" prop="dOrificeUnit">
        <el-input
          v-model="queryParams.dOrificeUnit"
          placeholder="请输入长度单位 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="孔板内径参考温度" prop="dOrificeDtemp">
        <el-input
          v-model="queryParams.dOrificeDtemp"
          placeholder="请输入孔板内径参考温度 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="温度单位" prop="dOrificeDtempUnit">
        <el-input
          v-model="queryParams.dOrificeDtempUnit"
          placeholder="请输入温度单位 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="孔板材料" prop="dOrificeMaterial">
        <el-select v-model="queryParams.dOrificeMaterial" placeholder="请选择孔板材料 " clearable>
          <el-option
            v-for="dict in dict.type.ngtools_gdcz"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="锐利度系数计算方法" prop="dOrificeSharpness">
        <el-input
          v-model="queryParams.dOrificeSharpness"
          placeholder="请输入锐利度系数计算方法 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="孔板入口圆弧半径" prop="dOrificeRk">
        <el-input
          v-model="queryParams.dOrificeRk"
          placeholder="请输入孔板入口圆弧半径 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="长度单位" prop="dOrificeRkLenU">
        <el-input
          v-model="queryParams.dOrificeRkLenU"
          placeholder="请输入长度单位 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="输入压力" prop="dPf">
        <el-input
          v-model="queryParams.dPf"
          placeholder="请输入输入压力 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="压力单位" prop="dPfUnit">
        <el-input
          v-model="queryParams.dPfUnit"
          placeholder="请输入压力单位 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="压力类型" prop="dPfType">
        <el-select v-model="queryParams.dPfType" placeholder="请选择压力类型 " clearable>
          <el-option
            v-for="dict in dict.type.ngtools_yllx"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="输入温度" prop="dTf">
        <el-input
          v-model="queryParams.dTf"
          placeholder="请输入输入温度 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="温度单位" prop="dTfUnit">
        <el-input
          v-model="queryParams.dTfUnit"
          placeholder="请输入温度单位 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="输入差压" prop="dDp">
        <el-input
          v-model="queryParams.dDp"
          placeholder="请输入输入差压 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="压力单位" prop="dDpUnit">
        <el-input
          v-model="queryParams.dDpUnit"
          placeholder="请输入压力单位 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="体积流量单位" prop="dVFlowUnit">
        <el-input
          v-model="queryParams.dVFlowUnit"
          placeholder="请输入体积流量单位 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="质量流量单位" prop="dMFlowUnit">
        <el-input
          v-model="queryParams.dMFlowUnit"
          placeholder="请输入质量流量单位 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="能量流量单位" prop="dEFlowUnit">
        <el-input
          v-model="queryParams.dEFlowUnit"
          placeholder="请输入能量流量单位 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="流出系数" prop="dCd">
        <el-input
          v-model="queryParams.dCd"
          placeholder="请输入流出系数 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="流出系数计算方法" prop="dCdCalMethod">
        <el-select v-model="queryParams.dCdCalMethod" placeholder="请选择流出系数计算方法 " clearable>
          <el-option
            v-for="dict in dict.type.ngtools_lcxsjsff"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="仪表系数" prop="dMeterFactor">
        <el-input
          v-model="queryParams.dMeterFactor"
          placeholder="请输入仪表系数 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="脉冲数" prop="dPulseNum">
        <el-input
          v-model="queryParams.dPulseNum"
          placeholder="请输入脉冲数 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="最大体积流量" prop="dVFlowMax">
        <el-input
          v-model="queryParams.dVFlowMax"
          placeholder="请输入最大体积流量 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="最小体积流量" prop="dVFlowMin">
        <el-input
          v-model="queryParams.dVFlowMin"
          placeholder="请输入最小体积流量 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="常用流量" prop="dVFlowCon">
        <el-input
          v-model="queryParams.dVFlowCon"
          placeholder="请输入常用流量 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="压力量程下限" prop="dPfRangeMin">
        <el-input
          v-model="queryParams.dPfRangeMin"
          placeholder="请输入压力量程下限 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="压力量程上限" prop="dPfRangeMax">
        <el-input
          v-model="queryParams.dPfRangeMax"
          placeholder="请输入压力量程上限 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="差压量程下限" prop="dDpRangeMin">
        <el-input
          v-model="queryParams.dDpRangeMin"
          placeholder="请输入差压量程下限 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="差压量程上限" prop="dDpRangeMax">
        <el-input
          v-model="queryParams.dDpRangeMax"
          placeholder="请输入差压量程上限 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="温度计量程下限" prop="dTfRangeMin">
        <el-input
          v-model="queryParams.dTfRangeMin"
          placeholder="请输入温度计量程下限 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="温度计量程上限" prop="dTfRangeMax">
        <el-input
          v-model="queryParams.dTfRangeMax"
          placeholder="请输入温度计量程上限 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="管束车容积" prop="dVGsc">
        <el-input
          v-model="queryParams.dVGsc"
          placeholder="请输入管束车容积 "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="取样编号" prop="sampleno">
        <el-input
          v-model="queryParams.sampleno"
          placeholder="请输入取样编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="仪表编号" prop="meterno">
        <el-input
          v-model="queryParams.meterno"
          placeholder="请输入仪表编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['ngtools:meterpar:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['ngtools:meterpar:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['ngtools:meterpar:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['ngtools:meterpar:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="meterparList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="ID " align="center" prop="id" />
      <el-table-column label="创建人名称 " align="center" prop="createName" />
      <el-table-column label="处置人姓名 " align="center" prop="createBy" />
      <el-table-column label="创建处置时间 " align="center" prop="createTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="更新人名称 " align="center" prop="updateName" />
      <el-table-column label="更新人登录名称 " align="center" prop="updateBy" />
      <el-table-column label="更新日期 " align="center" prop="updateTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="流量计算标准 " align="center" prop="dFlowCalbz">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.ngtools_lljsbz" :value="scope.row.dFlowCalbz"/>
        </template>
      </el-table-column>
      <el-table-column label="压缩因子计算标准 " align="center" prop="dZcalbz">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.ngtools_ysyzjsbz" :value="scope.row.dZcalbz"/>
        </template>
      </el-table-column>
      <el-table-column label="计量参比条件压力 " align="center" prop="dCbtj">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.ngtools_cbtj" :value="scope.row.dCbtj"/>
        </template>
      </el-table-column>
      <el-table-column label="计量参比条件压力 " align="center" prop="dpbM" />
      <el-table-column label="计量参比条件温度 " align="center" prop="dtbM" />
      <el-table-column label="燃烧参比条件压力 " align="center" prop="dpbE" />
      <el-table-column label="燃烧参比条件温度 " align="center" prop="dtbE" />
      <el-table-column label="当地大气压 " align="center" prop="dPatm" />
      <el-table-column label="当地大气压单位 " align="center" prop="dPatmUnit" />
      <el-table-column label="天然气组分 " align="center" prop="dngCompents" />
      <el-table-column label="流量计类别 " align="center" prop="dMeterType">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.ngtools_lljlx" :value="scope.row.dMeterType"/>
        </template>
      </el-table-column>
      <el-table-column label="节流装置类型 " align="center" prop="dCoreType">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.ngtools_jlzzlx" :value="scope.row.dCoreType"/>
        </template>
      </el-table-column>
      <el-table-column label="取压方式 " align="center" prop="dPtmode">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.qyfs" :value="scope.row.dPtmode"/>
        </template>
      </el-table-column>
      <el-table-column label="管道类型 " align="center" prop="dPipeType">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.ngtools_gdlx" :value="scope.row.dPipeType"/>
        </template>
      </el-table-column>
      <el-table-column label="管道内径 " align="center" prop="dPipeD" />
      <el-table-column label="长度单位 " align="center" prop="dLenUnit" />
      <el-table-column label="管道内径参考温度 " align="center" prop="dPipeDtemp" />
      <el-table-column label="温度单位 " align="center" prop="dPileDtempU" />
      <el-table-column label="管道材料 " align="center" prop="dPipeMaterial">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.ngtools_gdcz" :value="scope.row.dPipeMaterial"/>
        </template>
      </el-table-column>
      <el-table-column label="孔板孔径 " align="center" prop="dOrificeD" />
      <el-table-column label="长度单位 " align="center" prop="dOrificeUnit" />
      <el-table-column label="孔板内径参考温度 " align="center" prop="dOrificeDtemp" />
      <el-table-column label="温度单位 " align="center" prop="dOrificeDtempUnit" />
      <el-table-column label="孔板材料 " align="center" prop="dOrificeMaterial">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.ngtools_gdcz" :value="scope.row.dOrificeMaterial"/>
        </template>
      </el-table-column>
      <el-table-column label="锐利度系数计算方法 " align="center" prop="dOrificeSharpness" />
      <el-table-column label="孔板入口圆弧半径 " align="center" prop="dOrificeRk" />
      <el-table-column label="长度单位 " align="center" prop="dOrificeRkLenU" />
      <el-table-column label="输入压力 " align="center" prop="dPf" />
      <el-table-column label="压力单位 " align="center" prop="dPfUnit" />
      <el-table-column label="压力类型 " align="center" prop="dPfType">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.ngtools_yllx" :value="scope.row.dPfType"/>
        </template>
      </el-table-column>
      <el-table-column label="输入温度 " align="center" prop="dTf" />
      <el-table-column label="温度单位 " align="center" prop="dTfUnit" />
      <el-table-column label="输入差压 " align="center" prop="dDp" />
      <el-table-column label="压力单位 " align="center" prop="dDpUnit" />
      <el-table-column label="体积流量单位 " align="center" prop="dVFlowUnit" />
      <el-table-column label="质量流量单位 " align="center" prop="dMFlowUnit" />
      <el-table-column label="能量流量单位 " align="center" prop="dEFlowUnit" />
      <el-table-column label="流出系数 " align="center" prop="dCd" />
      <el-table-column label="流出系数计算方法 " align="center" prop="dCdCalMethod">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.ngtools_lcxsjsff" :value="scope.row.dCdCalMethod"/>
        </template>
      </el-table-column>
      <el-table-column label="仪表系数 " align="center" prop="dMeterFactor" />
      <el-table-column label="脉冲数 " align="center" prop="dPulseNum" />
      <el-table-column label="最大体积流量 " align="center" prop="dVFlowMax" />
      <el-table-column label="最小体积流量 " align="center" prop="dVFlowMin" />
      <el-table-column label="常用流量 " align="center" prop="dVFlowCon" />
      <el-table-column label="压力量程下限 " align="center" prop="dPfRangeMin" />
      <el-table-column label="压力量程上限 " align="center" prop="dPfRangeMax" />
      <el-table-column label="差压量程下限 " align="center" prop="dDpRangeMin" />
      <el-table-column label="差压量程上限 " align="center" prop="dDpRangeMax" />
      <el-table-column label="温度计量程下限 " align="center" prop="dTfRangeMin" />
      <el-table-column label="温度计量程上限 " align="center" prop="dTfRangeMax" />
      <el-table-column label="管束车容积 " align="center" prop="dVGsc" />
      <el-table-column label="取样编号" align="center" prop="sampleno" />
      <el-table-column label="仪表编号" align="center" prop="meterno" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['ngtools:meterpar:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['ngtools:meterpar:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改流量计参数对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="创建人名称" prop="createName">
          <el-input v-model="form.createName" placeholder="请输入创建人名称 " />
        </el-form-item>
        <el-form-item label="更新人名称" prop="updateName">
          <el-input v-model="form.updateName" placeholder="请输入更新人名称 " />
        </el-form-item>
        <el-form-item label="流量计算标准" prop="dFlowCalbz">
          <el-select v-model="form.dFlowCalbz" placeholder="请选择流量计算标准 ">
            <el-option
              v-for="dict in dict.type.ngtools_lljsbz"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="压缩因子计算标准" prop="dZcalbz">
          <el-select v-model="form.dZcalbz" placeholder="请选择压缩因子计算标准 ">
            <el-option
              v-for="dict in dict.type.ngtools_ysyzjsbz"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="计量参比条件压力" prop="dCbtj">
          <el-select v-model="form.dCbtj" placeholder="请选择计量参比条件压力 ">
            <el-option
              v-for="dict in dict.type.ngtools_cbtj"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="计量参比条件压力" prop="dpbM">
          <el-input v-model="form.dpbM" placeholder="请输入计量参比条件压力 " />
        </el-form-item>
        <el-form-item label="计量参比条件温度" prop="dtbM">
          <el-input v-model="form.dtbM" placeholder="请输入计量参比条件温度 " />
        </el-form-item>
        <el-form-item label="燃烧参比条件压力" prop="dpbE">
          <el-input v-model="form.dpbE" placeholder="请输入燃烧参比条件压力 " />
        </el-form-item>
        <el-form-item label="燃烧参比条件温度" prop="dtbE">
          <el-input v-model="form.dtbE" placeholder="请输入燃烧参比条件温度 " />
        </el-form-item>
        <el-form-item label="当地大气压" prop="dPatm">
          <el-input v-model="form.dPatm" placeholder="请输入当地大气压 " />
        </el-form-item>
        <el-form-item label="当地大气压单位" prop="dPatmUnit">
          <el-input v-model="form.dPatmUnit" placeholder="请输入当地大气压单位 " />
        </el-form-item>
        <el-form-item label="天然气组分" prop="dngCompents">
          <el-input v-model="form.dngCompents" placeholder="请输入天然气组分 " />
        </el-form-item>
        <el-form-item label="流量计类别" prop="dMeterType">
          <el-select v-model="form.dMeterType" placeholder="请选择流量计类别 ">
            <el-option
              v-for="dict in dict.type.ngtools_lljlx"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="节流装置类型" prop="dCoreType">
          <el-select v-model="form.dCoreType" placeholder="请选择节流装置类型 ">
            <el-option
              v-for="dict in dict.type.ngtools_jlzzlx"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="取压方式" prop="dPtmode">
          <el-select v-model="form.dPtmode" placeholder="请选择取压方式 ">
            <el-option
              v-for="dict in dict.type.qyfs"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="管道类型" prop="dPipeType">
          <el-select v-model="form.dPipeType" placeholder="请选择管道类型 ">
            <el-option
              v-for="dict in dict.type.ngtools_gdlx"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="管道内径" prop="dPipeD">
          <el-input v-model="form.dPipeD" placeholder="请输入管道内径 " />
        </el-form-item>
        <el-form-item label="长度单位" prop="dLenUnit">
          <el-input v-model="form.dLenUnit" placeholder="请输入长度单位 " />
        </el-form-item>
        <el-form-item label="管道内径参考温度" prop="dPipeDtemp">
          <el-input v-model="form.dPipeDtemp" placeholder="请输入管道内径参考温度 " />
        </el-form-item>
        <el-form-item label="温度单位" prop="dPileDtempU">
          <el-input v-model="form.dPileDtempU" placeholder="请输入温度单位 " />
        </el-form-item>
        <el-form-item label="管道材料" prop="dPipeMaterial">
          <el-select v-model="form.dPipeMaterial" placeholder="请选择管道材料 ">
            <el-option
              v-for="dict in dict.type.ngtools_gdcz"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="孔板孔径" prop="dOrificeD">
          <el-input v-model="form.dOrificeD" placeholder="请输入孔板孔径 " />
        </el-form-item>
        <el-form-item label="长度单位" prop="dOrificeUnit">
          <el-input v-model="form.dOrificeUnit" placeholder="请输入长度单位 " />
        </el-form-item>
        <el-form-item label="孔板内径参考温度" prop="dOrificeDtemp">
          <el-input v-model="form.dOrificeDtemp" placeholder="请输入孔板内径参考温度 " />
        </el-form-item>
        <el-form-item label="温度单位" prop="dOrificeDtempUnit">
          <el-input v-model="form.dOrificeDtempUnit" placeholder="请输入温度单位 " />
        </el-form-item>
        <el-form-item label="孔板材料" prop="dOrificeMaterial">
          <el-select v-model="form.dOrificeMaterial" placeholder="请选择孔板材料 ">
            <el-option
              v-for="dict in dict.type.ngtools_gdcz"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="锐利度系数计算方法" prop="dOrificeSharpness">
          <el-input v-model="form.dOrificeSharpness" placeholder="请输入锐利度系数计算方法 " />
        </el-form-item>
        <el-form-item label="孔板入口圆弧半径" prop="dOrificeRk">
          <el-input v-model="form.dOrificeRk" placeholder="请输入孔板入口圆弧半径 " />
        </el-form-item>
        <el-form-item label="长度单位" prop="dOrificeRkLenU">
          <el-input v-model="form.dOrificeRkLenU" placeholder="请输入长度单位 " />
        </el-form-item>
        <el-form-item label="输入压力" prop="dPf">
          <el-input v-model="form.dPf" placeholder="请输入输入压力 " />
        </el-form-item>
        <el-form-item label="压力单位" prop="dPfUnit">
          <el-input v-model="form.dPfUnit" placeholder="请输入压力单位 " />
        </el-form-item>
        <el-form-item label="压力类型" prop="dPfType">
          <el-select v-model="form.dPfType" placeholder="请选择压力类型 ">
            <el-option
              v-for="dict in dict.type.ngtools_yllx"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="输入温度" prop="dTf">
          <el-input v-model="form.dTf" placeholder="请输入输入温度 " />
        </el-form-item>
        <el-form-item label="温度单位" prop="dTfUnit">
          <el-input v-model="form.dTfUnit" placeholder="请输入温度单位 " />
        </el-form-item>
        <el-form-item label="输入差压" prop="dDp">
          <el-input v-model="form.dDp" placeholder="请输入输入差压 " />
        </el-form-item>
        <el-form-item label="压力单位" prop="dDpUnit">
          <el-input v-model="form.dDpUnit" placeholder="请输入压力单位 " />
        </el-form-item>
        <el-form-item label="体积流量单位" prop="dVFlowUnit">
          <el-input v-model="form.dVFlowUnit" placeholder="请输入体积流量单位 " />
        </el-form-item>
        <el-form-item label="质量流量单位" prop="dMFlowUnit">
          <el-input v-model="form.dMFlowUnit" placeholder="请输入质量流量单位 " />
        </el-form-item>
        <el-form-item label="能量流量单位" prop="dEFlowUnit">
          <el-input v-model="form.dEFlowUnit" placeholder="请输入能量流量单位 " />
        </el-form-item>
        <el-form-item label="流出系数" prop="dCd">
          <el-input v-model="form.dCd" placeholder="请输入流出系数 " />
        </el-form-item>
        <el-form-item label="流出系数计算方法" prop="dCdCalMethod">
          <el-select v-model="form.dCdCalMethod" placeholder="请选择流出系数计算方法 ">
            <el-option
              v-for="dict in dict.type.ngtools_lcxsjsff"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="仪表系数" prop="dMeterFactor">
          <el-input v-model="form.dMeterFactor" placeholder="请输入仪表系数 " />
        </el-form-item>
        <el-form-item label="脉冲数" prop="dPulseNum">
          <el-input v-model="form.dPulseNum" placeholder="请输入脉冲数 " />
        </el-form-item>
        <el-form-item label="最大体积流量" prop="dVFlowMax">
          <el-input v-model="form.dVFlowMax" placeholder="请输入最大体积流量 " />
        </el-form-item>
        <el-form-item label="最小体积流量" prop="dVFlowMin">
          <el-input v-model="form.dVFlowMin" placeholder="请输入最小体积流量 " />
        </el-form-item>
        <el-form-item label="常用流量" prop="dVFlowCon">
          <el-input v-model="form.dVFlowCon" placeholder="请输入常用流量 " />
        </el-form-item>
        <el-form-item label="压力量程下限" prop="dPfRangeMin">
          <el-input v-model="form.dPfRangeMin" placeholder="请输入压力量程下限 " />
        </el-form-item>
        <el-form-item label="压力量程上限" prop="dPfRangeMax">
          <el-input v-model="form.dPfRangeMax" placeholder="请输入压力量程上限 " />
        </el-form-item>
        <el-form-item label="差压量程下限" prop="dDpRangeMin">
          <el-input v-model="form.dDpRangeMin" placeholder="请输入差压量程下限 " />
        </el-form-item>
        <el-form-item label="差压量程上限" prop="dDpRangeMax">
          <el-input v-model="form.dDpRangeMax" placeholder="请输入差压量程上限 " />
        </el-form-item>
        <el-form-item label="温度计量程下限" prop="dTfRangeMin">
          <el-input v-model="form.dTfRangeMin" placeholder="请输入温度计量程下限 " />
        </el-form-item>
        <el-form-item label="温度计量程上限" prop="dTfRangeMax">
          <el-input v-model="form.dTfRangeMax" placeholder="请输入温度计量程上限 " />
        </el-form-item>
        <el-form-item label="管束车容积" prop="dVGsc">
          <el-input v-model="form.dVGsc" placeholder="请输入管束车容积 " />
        </el-form-item>
        <el-form-item label="取样编号" prop="sampleno">
          <el-input v-model="form.sampleno" placeholder="请输入取样编号" />
        </el-form-item>
        <el-form-item label="仪表编号" prop="meterno">
          <el-input v-model="form.meterno" placeholder="请输入仪表编号" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listMeterpar, getMeterpar, delMeterpar, addMeterpar, updateMeterpar } from "@/api/ngtools/meterpar";

export default {
  name: "Meterpar",
  dicts: ['ngtools_cbtj', 'ngtools_jlzzlx', 'ngtools_lljlx', 'qyfs', 'ngtools_gdcz', 'ngtools_lcxsjsff', 'ngtools_gdlx', 'ngtools_yllx', 'ngtools_lljsbz', 'ngtools_ysyzjsbz'],
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 流量计参数表格数据
      meterparList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        createName: null,
        createBy: null,
        createTime: null,
        updateName: null,
        updateBy: null,
        updateTime: null,
        dFlowCalbz: null,
        dZcalbz: null,
        dCbtj: null,
        dpbM: null,
        dtbM: null,
        dpbE: null,
        dtbE: null,
        dPatm: null,
        dPatmUnit: null,
        dngCompents: null,
        dMeterType: null,
        dCoreType: null,
        dPtmode: null,
        dPipeType: null,
        dPipeD: null,
        dLenUnit: null,
        dPipeDtemp: null,
        dPileDtempU: null,
        dPipeMaterial: null,
        dOrificeD: null,
        dOrificeUnit: null,
        dOrificeDtemp: null,
        dOrificeDtempUnit: null,
        dOrificeMaterial: null,
        dOrificeSharpness: null,
        dOrificeRk: null,
        dOrificeRkLenU: null,
        dPf: null,
        dPfUnit: null,
        dPfType: null,
        dTf: null,
        dTfUnit: null,
        dDp: null,
        dDpUnit: null,
        dVFlowUnit: null,
        dMFlowUnit: null,
        dEFlowUnit: null,
        dCd: null,
        dCdCalMethod: null,
        dMeterFactor: null,
        dPulseNum: null,
        dVFlowMax: null,
        dVFlowMin: null,
        dVFlowCon: null,
        dPfRangeMin: null,
        dPfRangeMax: null,
        dDpRangeMin: null,
        dDpRangeMax: null,
        dTfRangeMin: null,
        dTfRangeMax: null,
        dVGsc: null,
        sampleno: null,
        meterno: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询流量计参数列表 */
    getList() {
      this.loading = true;
      listMeterpar(this.queryParams).then(response => {
        this.meterparList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        createName: null,
        createBy: null,
        createTime: null,
        updateName: null,
        updateBy: null,
        updateTime: null,
        dFlowCalbz: null,
        dZcalbz: null,
        dCbtj: null,
        dpbM: null,
        dtbM: null,
        dpbE: null,
        dtbE: null,
        dPatm: null,
        dPatmUnit: null,
        dngCompents: null,
        dMeterType: null,
        dCoreType: null,
        dPtmode: null,
        dPipeType: null,
        dPipeD: null,
        dLenUnit: null,
        dPipeDtemp: null,
        dPileDtempU: null,
        dPipeMaterial: null,
        dOrificeD: null,
        dOrificeUnit: null,
        dOrificeDtemp: null,
        dOrificeDtempUnit: null,
        dOrificeMaterial: null,
        dOrificeSharpness: null,
        dOrificeRk: null,
        dOrificeRkLenU: null,
        dPf: null,
        dPfUnit: null,
        dPfType: null,
        dTf: null,
        dTfUnit: null,
        dDp: null,
        dDpUnit: null,
        dVFlowUnit: null,
        dMFlowUnit: null,
        dEFlowUnit: null,
        dCd: null,
        dCdCalMethod: null,
        dMeterFactor: null,
        dPulseNum: null,
        dVFlowMax: null,
        dVFlowMin: null,
        dVFlowCon: null,
        dPfRangeMin: null,
        dPfRangeMax: null,
        dDpRangeMin: null,
        dDpRangeMax: null,
        dTfRangeMin: null,
        dTfRangeMax: null,
        dVGsc: null,
        sampleno: null,
        meterno: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加流量计参数";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getMeterpar(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改流量计参数";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateMeterpar(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addMeterpar(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除流量计参数编号为"' + ids + '"的数据项？').then(function() {
        return delMeterpar(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('ngtools/meterpar/export', {
        ...this.queryParams
      }, `meterpar_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
