|
@@ -0,0 +1,1295 @@
|
|
|
+<template>
|
|
|
+<!-- 计量点信息维护 -->
|
|
|
+ <div class="measurementPlace">
|
|
|
+ <div class="box">
|
|
|
+ <div class="box-top">
|
|
|
+ <el-form
|
|
|
+ style="overflow: hidden;"
|
|
|
+ :style="filterForm.show ? null : { height: '0px' }"
|
|
|
+ size="mini"
|
|
|
+ label-width="80px"
|
|
|
+ >
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="能介类型">
|
|
|
+ <el-select
|
|
|
+ filterable clearable
|
|
|
+ v-model="filterForm.data.energytypeid"
|
|
|
+ multiple
|
|
|
+ collapse-tags
|
|
|
+ placeholder="能介类型"
|
|
|
+ style="width: 100%;"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item of nameObj.energytypeid.arr"
|
|
|
+ :key="item.id"
|
|
|
+ :value="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="能介">
|
|
|
+ <el-select
|
|
|
+ filterable clearable
|
|
|
+ v-model="filterForm.data.energyid"
|
|
|
+ multiple
|
|
|
+ collapse-tags
|
|
|
+ placeholder="能介"
|
|
|
+ style="width: 100%;"
|
|
|
+ >
|
|
|
+ <template v-for="item of nameObj.energyid.arr">
|
|
|
+ <el-option
|
|
|
+ v-if="filterForm.data.energytypeid.indexOf(item.energytypeid) !== -1 || Object.keys(filterForm.data.energytypeid).length === 0"
|
|
|
+ :key="item.id"
|
|
|
+ :value="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ ></el-option>
|
|
|
+ </template>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="用能属性">
|
|
|
+ <el-select
|
|
|
+ filterable clearable
|
|
|
+ v-model="filterForm.data.propertyid"
|
|
|
+ placeholder="用能属性"
|
|
|
+ multiple
|
|
|
+ collapse-tags
|
|
|
+ style="width: 100%;"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item of nameObj.propertyid.arr"
|
|
|
+ :key="item.id"
|
|
|
+ :value="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="手抄或自动">
|
|
|
+ <el-select
|
|
|
+ filterable clearable
|
|
|
+ v-model="filterForm.data.itemtype"
|
|
|
+ placeholder="手抄或自动"
|
|
|
+ style="width: 100%;"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item of nameObj.itemtype.arr"
|
|
|
+ :key="item.id"
|
|
|
+ :value="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="工序">
|
|
|
+ <el-select
|
|
|
+ filterable clearable
|
|
|
+ v-model="filterForm.data.costid"
|
|
|
+ placeholder="工序"
|
|
|
+ multiple
|
|
|
+ collapse-tags
|
|
|
+ style="width: 100%;"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item of nameObj.workprocid.arr"
|
|
|
+ :key="item.id"
|
|
|
+ :value="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="站所">
|
|
|
+ <el-select
|
|
|
+ filterable clearable
|
|
|
+ v-model="filterForm.data.networkid"
|
|
|
+ placeholder="站所"
|
|
|
+ multiple
|
|
|
+ collapse-tags
|
|
|
+ style="width: 100%;"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item of nameObj.networkid.arr"
|
|
|
+ :key="item.id"
|
|
|
+ :value="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="计量点编号">
|
|
|
+ <el-input clearable
|
|
|
+ v-model.trim="filterForm.data.itemid"
|
|
|
+ placeholder="计量点编号"
|
|
|
+ style="width: 100%;"
|
|
|
+ @keyup.enter.native="getTableData(1)"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="计量点名称">
|
|
|
+ <el-input clearable
|
|
|
+ v-model.trim="filterForm.data.itemname"
|
|
|
+ placeholder="计量点名称"
|
|
|
+ style="width: 100%;"
|
|
|
+ @keyup.enter.native="getTableData(1)"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="计量层级">
|
|
|
+ <el-select
|
|
|
+ filterable clearable
|
|
|
+ v-model="filterForm.data.hierarchy"
|
|
|
+ placeholder="计量层级"
|
|
|
+ style="width: 100%;"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item of nameObj.hierarchy.arr"
|
|
|
+ :key="item.id"
|
|
|
+ :value="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="位置">
|
|
|
+ <el-select
|
|
|
+ filterable clearable
|
|
|
+ v-model="filterForm.data.locateid"
|
|
|
+ placeholder="位置"
|
|
|
+ multiple
|
|
|
+ collapse-tags
|
|
|
+ style="width: 100%;"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item of nameObj.locateid.arr"
|
|
|
+ :key="item.id"
|
|
|
+ :value="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="TAG点别名">
|
|
|
+ <el-input clearable
|
|
|
+ v-model.trim="filterForm.data.tagAlias"
|
|
|
+ placeholder="TAG点别名"
|
|
|
+ style="width: 100%;"
|
|
|
+ @keyup.enter.native="getTableData(1)"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="数据表">
|
|
|
+ <el-input clearable
|
|
|
+ v-model.trim="filterForm.data.tagTable"
|
|
|
+ placeholder="小时数据表"
|
|
|
+ style="width: 100%;"
|
|
|
+ @keyup.enter.native="getTableData(1)"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="数据列">
|
|
|
+ <el-input clearable
|
|
|
+ v-model.trim="filterForm.data.tagCol"
|
|
|
+ placeholder="小时表列(TAG)"
|
|
|
+ style="width: 100%;"
|
|
|
+ @keyup.enter.native="getTableData(1)"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <!-- <div style="text-align: right;margin-bottom: 13px;">
|
|
|
+ </div> -->
|
|
|
+ </el-form>
|
|
|
+ <div class="box-top-gjl">
|
|
|
+ <el-button
|
|
|
+ class="button"
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ icon="el-icon-plus"
|
|
|
+ v-if="butPrivilege.PUT"
|
|
|
+ @click="but_edit_plural"
|
|
|
+ >保存</el-button>
|
|
|
+ <div style="float:right; text-align: right;">
|
|
|
+ <el-button
|
|
|
+ class="button"
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-search"
|
|
|
+ size="mini"
|
|
|
+ v-if="butPrivilege.QUERY"
|
|
|
+ @click="filterForm.useflag='1';getTableData(1)"
|
|
|
+ >查询</el-button>
|
|
|
+ <el-button
|
|
|
+ class="button"
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-refresh"
|
|
|
+ size="mini"
|
|
|
+ v-if="butPrivilege.QUERY"
|
|
|
+ @click="tableDataCancel();"
|
|
|
+ >重置</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ :icon="filterForm.show ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"
|
|
|
+ :title="filterForm.show ? '收起搜索区' : '展开搜索区'"
|
|
|
+ @click="filterForm.show = !filterForm.show;
|
|
|
+ $nextTick(() => {
|
|
|
+ singleTableHeight = getRoleHeight($refs['singleTable'].$el) - 45;
|
|
|
+ }
|
|
|
+ );"
|
|
|
+ >{{ filterForm.show ? '收起' : '展开' }}</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="box-bottom">
|
|
|
+ <el-form
|
|
|
+ size="mini"
|
|
|
+ ref="dialog_form_arr"
|
|
|
+ label-width="0px"
|
|
|
+ :model="tableFormDataObj"
|
|
|
+ >
|
|
|
+ <el-table
|
|
|
+ stripe
|
|
|
+ id="singleTable"
|
|
|
+ ref="singleTable"
|
|
|
+ :data="tableData"
|
|
|
+ v-loading="tableLoading"
|
|
|
+ style="width: 100%;"
|
|
|
+ :height="singleTableHeight"
|
|
|
+ border
|
|
|
+ size="mini"
|
|
|
+ highlight-current-row
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ >
|
|
|
+ <!-- @current-change="handleCurrentChange"
|
|
|
+ :row-class-name="rowClassName"-->
|
|
|
+ <el-table-column
|
|
|
+ type="selection"
|
|
|
+ width="40"
|
|
|
+ align="center"
|
|
|
+ fixed="left"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ sortable
|
|
|
+ prop="itemid"
|
|
|
+ label="计量点编号"
|
|
|
+ min-width="150px"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ sortable
|
|
|
+ prop="energytypeid"
|
|
|
+ label="能介类型"
|
|
|
+ width="75px"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ nameObj.energytypeid.obj[scope.row.energytypeid] ? nameObj.energytypeid.obj[scope.row.energytypeid] : scope.row.energytypeid }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ sortable
|
|
|
+ prop="energyid"
|
|
|
+ label="能介"
|
|
|
+ width="85px"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ nameObj.energyid.obj[scope.row.energyid] ? nameObj.energyid.obj[scope.row.energyid].name : scope.row.energyid }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ sortable
|
|
|
+ prop="costid"
|
|
|
+ label="工序"
|
|
|
+ min-width="100px"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ nameObj.workprocid.obj[scope.row.costid] ? nameObj.workprocid.obj[scope.row.costid] : scope.row.costid }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ sortable
|
|
|
+ prop="itemname"
|
|
|
+ label="计量点描述"
|
|
|
+ min-width="150px"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ sortable
|
|
|
+ prop="locateid"
|
|
|
+ label="位置"
|
|
|
+ min-width="100px"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ nameObj.locateid.obj[scope.row.locateid] ? nameObj.locateid.obj[scope.row.locateid] : scope.row.locateid }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ sortable
|
|
|
+ prop="networkid"
|
|
|
+ label="站所"
|
|
|
+ min-width="100px"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ nameObj.networkid.obj[scope.row.networkid] ? nameObj.networkid.obj[scope.row.networkid] : scope.row.networkid }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ sortable
|
|
|
+ prop="propertyid"
|
|
|
+ label="用能属性"
|
|
|
+ width="80px"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ nameObj.propertyid.obj[scope.row.propertyid] ? nameObj.propertyid.obj[scope.row.propertyid] : scope.row.propertyid }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ sortable
|
|
|
+ prop="maxVal"
|
|
|
+ label="小时累计上限"
|
|
|
+ min-width="150px"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-form-item
|
|
|
+ v-if="scope.row.isSelection"
|
|
|
+ :prop="scope.row.itemid + '.maxVal'"
|
|
|
+ :rules="dialog.editorBox.form.rules.maxVal"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ style="width: 100%;"
|
|
|
+ v-model="tableFormDataObj[scope.row.itemid].maxVal"
|
|
|
+ ></el-input>
|
|
|
+ <template
|
|
|
+ slot="error"
|
|
|
+ slot-scope="scope"
|
|
|
+ >
|
|
|
+ <p
|
|
|
+ class="error"
|
|
|
+ :title="scope.error"
|
|
|
+ >{{ scope.error }}</p>
|
|
|
+ </template>
|
|
|
+ </el-form-item>
|
|
|
+ <span v-else>{{scope.row.maxVal}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ sortable
|
|
|
+ prop="minVal"
|
|
|
+ label="小时累计下限"
|
|
|
+ min-width="150px"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-form-item
|
|
|
+ v-if="scope.row.isSelection"
|
|
|
+ :prop="scope.row.itemid + '.minVal'"
|
|
|
+ :rules="dialog.editorBox.form.rules.minVal"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ style="width: 100%;"
|
|
|
+ v-model="tableFormDataObj[scope.row.itemid].minVal"
|
|
|
+ ></el-input>
|
|
|
+ <template
|
|
|
+ slot="error"
|
|
|
+ slot-scope="scope"
|
|
|
+ >
|
|
|
+ <p
|
|
|
+ class="error"
|
|
|
+ :title="scope.error"
|
|
|
+ >{{ scope.error }}</p>
|
|
|
+ </template>
|
|
|
+ </el-form-item>
|
|
|
+ <span v-else>{{scope.row.minVal}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ sortable
|
|
|
+ prop="unitid"
|
|
|
+ label="计量单位"
|
|
|
+ min-width="80px"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ nameObj.unitid.obj[scope.row.unitid] ? nameObj.unitid.obj[scope.row.unitid] : scope.row.unitid }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ sortable
|
|
|
+ prop="tagTable"
|
|
|
+ label="对应数据表"
|
|
|
+ width="200px"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ sortable
|
|
|
+ prop="tagCol"
|
|
|
+ label="对应数据列"
|
|
|
+ width="90px"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ ></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-form>
|
|
|
+ <el-pagination
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total="total"
|
|
|
+ :page-sizes="[10, 20, 50, 100, 500, 1000]"
|
|
|
+ :page-size="pageSize"
|
|
|
+ :current-page.sync="pageNum"
|
|
|
+ @size-change="tableSizeChange"
|
|
|
+ @current-change="getTableData()"
|
|
|
+ style="text-align: right;margin-top: 10px;"
|
|
|
+ ></el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ :title="'计量仪表小时标准值维护 - ' + (dialog.editorBox.type === 'add' ? '新增' : '修改')"
|
|
|
+ :visible.sync="dialog.editorBox.show"
|
|
|
+ width="600px"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :show-close="!loading"
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ <el-form
|
|
|
+ ref="dialog_form"
|
|
|
+ :model="dialog.editorBox.form.data"
|
|
|
+ :rules="dialog.editorBox.form.rules"
|
|
|
+ size="mini"
|
|
|
+ label-width="85px"
|
|
|
+ >
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item
|
|
|
+ label="小时累计上限"
|
|
|
+ prop="maxVal"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ style="width: 100%;"
|
|
|
+ v-model="dialog.editorBox.form.data.maxVal"
|
|
|
+ disabled
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item
|
|
|
+ label="小时累计下限"
|
|
|
+ prop="minVal"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ style="width: 100%;"
|
|
|
+ v-model="dialog.editorBox.form.data.minVal"
|
|
|
+ disabled
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <span
|
|
|
+ slot="footer"
|
|
|
+ class="dialog-footer"
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ @click="dialog.editorBox.show = false"
|
|
|
+ :loading="loading"
|
|
|
+ >取 消</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="dataSave"
|
|
|
+ :loading="loading"
|
|
|
+ >保 存</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { formatDate } from '@/utils/util.js';
|
|
|
+export default {
|
|
|
+ name: 'measurementPlaceWater',
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ multipleSelection: [],
|
|
|
+ tableFormDataObj: {},
|
|
|
+ activeMenu: '',
|
|
|
+ filterForm: {
|
|
|
+ show: true,
|
|
|
+ useflag: '1',
|
|
|
+ data: {
|
|
|
+ energytypeid: '',
|
|
|
+ energyid: '',
|
|
|
+ propertyid: '',
|
|
|
+ itemtype: '',
|
|
|
+ locateid: '',
|
|
|
+ itemid: '',
|
|
|
+ itemname: '',
|
|
|
+ networkid: '',
|
|
|
+ costid: '',
|
|
|
+ hierarchy: '',
|
|
|
+ tagAlias: '',
|
|
|
+ version: formatDate(new Date(), 'yyyyMM00'),
|
|
|
+ tagTable: '',
|
|
|
+ tagCol: ''
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ total: 0,
|
|
|
+ singleTableHeight: 100,
|
|
|
+ tableData: [],
|
|
|
+ nameObj: {
|
|
|
+ workprocid: {
|
|
|
+ obj: {},
|
|
|
+ arr: []
|
|
|
+ },
|
|
|
+ energytypeid: {
|
|
|
+ obj: {},
|
|
|
+ arr: []
|
|
|
+ },
|
|
|
+ energyid: {
|
|
|
+ obj: {},
|
|
|
+ arr: []
|
|
|
+ },
|
|
|
+ propertyid: {
|
|
|
+ obj: {},
|
|
|
+ arr: []
|
|
|
+ },
|
|
|
+ locateid: {
|
|
|
+ obj: {},
|
|
|
+ arr: []
|
|
|
+ },
|
|
|
+ networkid: {
|
|
|
+ obj: {},
|
|
|
+ arr: []
|
|
|
+ },
|
|
|
+ unitid: {
|
|
|
+ obj: {},
|
|
|
+ arr: []
|
|
|
+ },
|
|
|
+ hierarchy: {
|
|
|
+ obj: {},
|
|
|
+ arr: []
|
|
|
+ },
|
|
|
+ itemtype: {
|
|
|
+ obj: {
|
|
|
+ 'AUTO': '自动上传',
|
|
|
+ 'MANUAL': '手抄',
|
|
|
+ 'VIRTUAL': '虚拟'
|
|
|
+ },
|
|
|
+ arr: [
|
|
|
+ {
|
|
|
+ id: 'AUTO',
|
|
|
+ name: '自动上传'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 'MANUAL',
|
|
|
+ name: '手抄'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 'VIRTUAL',
|
|
|
+ name: '虚拟'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ mintimegranid: {
|
|
|
+ obj: {
|
|
|
+ 'SHIFT': '班',
|
|
|
+ 'DAY': '日',
|
|
|
+ 'MONTH': '月',
|
|
|
+ 'YEAR': '年'
|
|
|
+ },
|
|
|
+ arr: [
|
|
|
+ // {
|
|
|
+ // id: 'SHIFT',
|
|
|
+ // name: '班'
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ id: 'DAY',
|
|
|
+ name: '日'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 'MONTH',
|
|
|
+ name: '月'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 'YEAR',
|
|
|
+ name: '年'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ loading: false,
|
|
|
+ tableLoading: false,
|
|
|
+ butPrivilege: {
|
|
|
+ QUERY: false,
|
|
|
+ PUT: false
|
|
|
+ },
|
|
|
+ dialog: {
|
|
|
+ editorBox: {
|
|
|
+ show: false,
|
|
|
+ type: '',
|
|
|
+ form: {
|
|
|
+ data: {
|
|
|
+ maxVal: '',
|
|
|
+ minVal: ''
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ // 获取按钮权限
|
|
|
+ this.activeMenu = window.localStorage.getItem('activeMenu');
|
|
|
+ for (let key in this.butPrivilege) {
|
|
|
+ this.butPrivilege[key] = this.checkPrivilege(this.activeMenu + key);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ let that = this;
|
|
|
+ window.PEDataObj = {
|
|
|
+ // 将数据绑定到window上,供main页面使用
|
|
|
+ vm: that,
|
|
|
+ // tableArr:用于导出成Excel的表格的信息
|
|
|
+ tableArr: [
|
|
|
+ {
|
|
|
+ name: '',
|
|
|
+ id: 'singleTable'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ };
|
|
|
+ that.$nextTick(() => {
|
|
|
+ // 立即获取的height有一定偏差,通过setTimeout延迟来解决
|
|
|
+ setTimeout(() => {
|
|
|
+ that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 45;
|
|
|
+ }, 1);
|
|
|
+ });
|
|
|
+ that.getEnergyTypeIdData();
|
|
|
+ that.getEnergyIdData();
|
|
|
+ that.getPropertyIdData();
|
|
|
+ that.getLocateIdData();
|
|
|
+ that.getNetworkIdData();
|
|
|
+ that.getworkprocidData();
|
|
|
+ that.getUnitIdData();
|
|
|
+ that.getHierarchyData();
|
|
|
+ that.getTableData();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 表格中多选按钮的相关方法
|
|
|
+ handleSelectionChange (val) {
|
|
|
+ let that = this;
|
|
|
+ let tableFormDataObj = {};
|
|
|
+ for (let item of that.tableData) {
|
|
|
+ item.isSelection = false;
|
|
|
+ }
|
|
|
+ for (let item of val) {
|
|
|
+ let obj = {};
|
|
|
+ let xId = item.itemid;
|
|
|
+ if (that.tableFormDataObj[xId]) {
|
|
|
+ tableFormDataObj[xId] = that.tableFormDataObj[xId];
|
|
|
+ } else {
|
|
|
+ for (let key in item) {
|
|
|
+ obj[key] = item[key];
|
|
|
+ }
|
|
|
+ tableFormDataObj[xId] = obj;
|
|
|
+ }
|
|
|
+ item.isSelection = true;
|
|
|
+ }
|
|
|
+ that.tableFormDataObj = tableFormDataObj;
|
|
|
+ that.multipleSelection = val;
|
|
|
+ },
|
|
|
+ but_edit_plural () {
|
|
|
+ let that = this;
|
|
|
+ if (that.multipleSelection.length > 0) {
|
|
|
+ that.$refs['dialog_form_arr'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ let SubmitData = [];
|
|
|
+ for (let key in that.tableFormDataObj) {
|
|
|
+ SubmitData.push({
|
|
|
+ itemid: that.tableFormDataObj[key].itemid,
|
|
|
+ maxVal: that.tableFormDataObj[key].maxVal,
|
|
|
+ minVal: that.tableFormDataObj[key].minVal
|
|
|
+ });
|
|
|
+ }
|
|
|
+ that.loading = true;
|
|
|
+ that.axios.put('pass/ems/v1/trmcalpoints/', SubmitData)
|
|
|
+ .then(function (res) {
|
|
|
+ if (res.code === '0') {
|
|
|
+ that.$message({
|
|
|
+ message: '修改成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ that.getTableData();
|
|
|
+ that.dialog.editorBox.show = false;
|
|
|
+ } else {
|
|
|
+ that.$message.error(res.message);
|
|
|
+ }
|
|
|
+ that.loading = false;
|
|
|
+ }).catch(function () {
|
|
|
+ that.loading = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message.error('至少要选择一条数据');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 计算树区域高度
|
|
|
+ getRoleHeight (dom) {
|
|
|
+ return window.innerHeight - dom.offsetTop;
|
|
|
+ },
|
|
|
+ // 获取工序
|
|
|
+ getworkprocidData () {
|
|
|
+ let that = this
|
|
|
+ let url = 'pass/ems/v1/trmworkprocs/getIdAndName';
|
|
|
+ that.axios.get(url)
|
|
|
+ .then(function (res) {
|
|
|
+ if (res.code === '0') {
|
|
|
+ let arr = [];
|
|
|
+ let obj = {};
|
|
|
+ for (let item of res.data) {
|
|
|
+ arr.push({
|
|
|
+ id: item.id,
|
|
|
+ name: item.name
|
|
|
+ })
|
|
|
+ obj[item.id] = item.name;
|
|
|
+ }
|
|
|
+ that.nameObj.workprocid.arr = arr;
|
|
|
+ that.nameObj.workprocid.obj = obj;
|
|
|
+ } else {
|
|
|
+ that.$message.error(res.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 获取能介类型
|
|
|
+ getEnergyTypeIdData () {
|
|
|
+ let that = this
|
|
|
+ let url = 'pass/ems/v1/trmenergytypes/selectNameAndId/';
|
|
|
+ that.axios.get(url)
|
|
|
+ .then(function (res) {
|
|
|
+ if (res.code === '0') {
|
|
|
+ let arr = [];
|
|
|
+ let obj = {};
|
|
|
+ for (let item of res.data) {
|
|
|
+ arr.push({
|
|
|
+ id: item.id,
|
|
|
+ name: item.name
|
|
|
+ })
|
|
|
+ obj[item.id] = item.name;
|
|
|
+ }
|
|
|
+ that.nameObj.energytypeid.arr = arr;
|
|
|
+ that.nameObj.energytypeid.obj = obj;
|
|
|
+ } else {
|
|
|
+ that.$message.error(res.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ connn () {
|
|
|
+ // this.filterForm.data.energytypeid = this.filterForm.data.energytypeid.join(',')
|
|
|
+ // console.log(this.filterForm.data.energytypeid)
|
|
|
+ // console.log(111)
|
|
|
+ // let that = this;
|
|
|
+ // let set = new Set();
|
|
|
+ // console.log(that.filterForm.data.energytypeid)
|
|
|
+ // if (!that.filterForm.data.energytypeid || that.filterForm.data.energytypeid.length === 0) {
|
|
|
+ // that.nameObj.energytypeid.showDataArr = that.nameObj.energytypeid.arr;
|
|
|
+ // } else {
|
|
|
+ // for (let key of that.filterForm.data.energytypeid) {
|
|
|
+ // if (that.nameObj.energytypeid.obj[key]) {
|
|
|
+ // for (let name of that.nameObj.energytypeid.obj[key]) {
|
|
|
+ // set.add(name);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // that.nameObj.energytypeid.showDataArr = [...set];
|
|
|
+ // // console.log(that.nameObj.energytypeid.showDataArr)
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ // 获取能介
|
|
|
+ getEnergyIdData () {
|
|
|
+ let that = this;
|
|
|
+ let url = 'pass/ems/v1/trmenergys/selectNameAndId/';
|
|
|
+ that.axios.get(url)
|
|
|
+ .then(function (res) {
|
|
|
+ if (res.code === '0') {
|
|
|
+ let arr = [];
|
|
|
+ let obj = {};
|
|
|
+ for (let item of res.data) {
|
|
|
+ arr.push({
|
|
|
+ id: item.id,
|
|
|
+ name: item.name,
|
|
|
+ energytypeid: item.energytypeid,
|
|
|
+ unitid: item.unitid
|
|
|
+ })
|
|
|
+ obj[item.id] = {
|
|
|
+ name: item.name,
|
|
|
+ unitid: item.unitid
|
|
|
+ }
|
|
|
+ }
|
|
|
+ that.nameObj.energyid.arr = arr;
|
|
|
+ that.nameObj.energyid.obj = obj;
|
|
|
+ } else {
|
|
|
+ that.$message.error(res.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 获取属性
|
|
|
+ getPropertyIdData () {
|
|
|
+ let that = this
|
|
|
+ let url = 'pass/ems/v1/trmenergypropertys/getidandname/';
|
|
|
+ that.axios.get(url)
|
|
|
+ .then(function (res) {
|
|
|
+ if (res.code === '0') {
|
|
|
+ let arr = [];
|
|
|
+ let obj = {};
|
|
|
+ for (let item of res.data) {
|
|
|
+ arr.push({
|
|
|
+ id: item.id,
|
|
|
+ name: item.name
|
|
|
+ })
|
|
|
+ obj[item.id] = item.name;
|
|
|
+ }
|
|
|
+ that.nameObj.propertyid.arr = arr;
|
|
|
+ that.nameObj.propertyid.obj = obj;
|
|
|
+ } else {
|
|
|
+ that.$message.error(res.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 获取位置
|
|
|
+ getLocateIdData () {
|
|
|
+ let that = this
|
|
|
+ let url = 'pass/ems/v1/trmlocations/getidandname/';
|
|
|
+ that.axios.get(url)
|
|
|
+ .then(function (res) {
|
|
|
+ if (res.code === '0') {
|
|
|
+ let arr = [];
|
|
|
+ let obj = {};
|
|
|
+ for (let item of res.data) {
|
|
|
+ arr.push({
|
|
|
+ id: item.id,
|
|
|
+ name: item.name
|
|
|
+ })
|
|
|
+ obj[item.id] = item.name;
|
|
|
+ }
|
|
|
+ that.nameObj.locateid.arr = arr;
|
|
|
+ that.nameObj.locateid.obj = obj;
|
|
|
+ } else {
|
|
|
+ that.$message.error(res.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 获取站所
|
|
|
+ getNetworkIdData () {
|
|
|
+ let that = this
|
|
|
+ let url = 'pass/ems/v1/trmstations/getidandname/';
|
|
|
+ that.axios.get(url)
|
|
|
+ .then(function (res) {
|
|
|
+ if (res.code === '0') {
|
|
|
+ let arr = [];
|
|
|
+ let obj = {};
|
|
|
+ for (let item of res.data) {
|
|
|
+ arr.push({
|
|
|
+ id: item.id,
|
|
|
+ name: item.name
|
|
|
+ })
|
|
|
+ obj[item.id] = item.name;
|
|
|
+ }
|
|
|
+ that.nameObj.networkid.arr = arr;
|
|
|
+ that.nameObj.networkid.obj = obj;
|
|
|
+ } else {
|
|
|
+ that.$message.error(res.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // // 获取数据来源
|
|
|
+ // getSourceTypeData () {
|
|
|
+ // let that = this
|
|
|
+ // let url = 'pass/ems/v1/trml1sources/getidandname/';
|
|
|
+ // that.axios.get(url)
|
|
|
+ // .then(function (res) {
|
|
|
+ // if (res.code === '0') {
|
|
|
+ // let arr = [];
|
|
|
+ // let obj = {};
|
|
|
+ // for (let item of res.data) {
|
|
|
+ // arr.push({
|
|
|
+ // id: item.id,
|
|
|
+ // name: item.name
|
|
|
+ // })
|
|
|
+ // obj[item.id] = item.name;
|
|
|
+ // }
|
|
|
+ // that.nameObj.sourceType.arr = arr;
|
|
|
+ // that.nameObj.sourceType.obj = obj;
|
|
|
+ // } else {
|
|
|
+ // that.$message.error(res.message);
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ // 获取标准计量单位
|
|
|
+ getUnitIdData () {
|
|
|
+ let that = this
|
|
|
+ let url = 'pass/ems/v1/trmunits/getIdAndName';
|
|
|
+ that.axios.get(url)
|
|
|
+ .then(function (res) {
|
|
|
+ if (res.code === '0') {
|
|
|
+ let arr = [];
|
|
|
+ let obj = {};
|
|
|
+ for (let item of res.data) {
|
|
|
+ arr.push({
|
|
|
+ id: item.id,
|
|
|
+ name: item.name
|
|
|
+ })
|
|
|
+ obj[item.id] = item.name;
|
|
|
+ // if (item.name === '吨') {
|
|
|
+ // that.nameObj.unitid.defaults = that.nameObj.unitid.defaults ? that.nameObj.unitid.defaults : item.id;
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ that.nameObj.unitid.arr = arr;
|
|
|
+ that.nameObj.unitid.obj = obj;
|
|
|
+ } else {
|
|
|
+ that.$message.error(res.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 获取计量层级
|
|
|
+ getHierarchyData () {
|
|
|
+ let that = this
|
|
|
+ let url = 'pass/ems/v1/trmcalpoints/getRmCalpoint/';
|
|
|
+ that.axios.get(url)
|
|
|
+ .then(function (res) {
|
|
|
+ if (res.code === '0') {
|
|
|
+ let arr = [];
|
|
|
+ let obj = {};
|
|
|
+ for (let item of res.data) {
|
|
|
+ arr.push({
|
|
|
+ id: item.id,
|
|
|
+ name: item.name
|
|
|
+ })
|
|
|
+ obj[item.id] = item.name;
|
|
|
+ }
|
|
|
+ that.nameObj.hierarchy.arr = arr;
|
|
|
+ that.nameObj.hierarchy.obj = obj;
|
|
|
+ } else {
|
|
|
+ that.$message.error(res.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 获取表格中的数据
|
|
|
+ getTableData (pageNum) {
|
|
|
+ let that = this,
|
|
|
+ params = {
|
|
|
+ energytypeid: that.filterForm.data.energytypeid.join(','),
|
|
|
+ energyid: that.filterForm.data.energyid.join(','),
|
|
|
+ propertyid: that.filterForm.data.propertyid.join(','),
|
|
|
+ itemtype: 'AUTO',
|
|
|
+ locateid: that.filterForm.data.locateid.join(','),
|
|
|
+ itemid: that.filterForm.data.itemid,
|
|
|
+ itemname: that.filterForm.data.itemname,
|
|
|
+ networkid: that.filterForm.data.networkid.join(','),
|
|
|
+ costid: that.filterForm.data.costid.join(','),
|
|
|
+ node: that.filterForm.data.hierarchy,
|
|
|
+ tagAlias: that.filterForm.data.tagAlias,
|
|
|
+ version: that.filterForm.data.version,
|
|
|
+ tagTable: that.filterForm.data.tagTable,
|
|
|
+ tagCol: that.filterForm.data.tagCol,
|
|
|
+ useflag: that.filterForm.useflag
|
|
|
+ };
|
|
|
+ that.pageNum = pageNum || that.pageNum;
|
|
|
+ that.tableLoading = true;
|
|
|
+ let url = 'pass/ems/v1/trmcalpoints/like/?pageNum=' + that.pageNum + '&pageSize=' + that.pageSize;
|
|
|
+ that.axios.get(url, {
|
|
|
+ params: params
|
|
|
+ })
|
|
|
+ .then(function (res) {
|
|
|
+ if (res.code === '0') {
|
|
|
+ let arr = [];
|
|
|
+ for (let item of res.data.list) {
|
|
|
+ arr.push({
|
|
|
+ itemid: item.itemid,
|
|
|
+ itemname: item.itemname,
|
|
|
+ tagAlias: item.tagAlias,
|
|
|
+ itemdesc: item.itemdesc,
|
|
|
+ itemtype: item.itemtype,
|
|
|
+ locateid: item.locateid,
|
|
|
+ networkid: item.networkid,
|
|
|
+ energytypeid: item.energytypeid,
|
|
|
+ energyid: item.energyid,
|
|
|
+ propertyid: item.propertyid,
|
|
|
+ unitid: item.unitid,
|
|
|
+ isschedule: item.isschedule,
|
|
|
+ // issettle: item.issettle,
|
|
|
+ costid: item.costid,
|
|
|
+ sourceType: item.sourceType,
|
|
|
+ mintimegranid: item.mintimegranid,
|
|
|
+ // 基础
|
|
|
+ defaultvalue: item.defaultvalue,
|
|
|
+ digits: item.digits,
|
|
|
+ node: item.node,
|
|
|
+ showno: item.showno,
|
|
|
+ parentid: item.parentid,
|
|
|
+ recTime: item.recTime,
|
|
|
+ useflag: item.useflag,
|
|
|
+ status: item.status,
|
|
|
+ // 扩展
|
|
|
+ tagid: item.tagid,
|
|
|
+ tagname: item.tagname,
|
|
|
+ rangeVal: item.rangeVal,
|
|
|
+ tagBadSymbol: item.tagBadSymbol,
|
|
|
+ tagModulus: item.tagModulus,
|
|
|
+ tagIdMap: item.tagIdMap,
|
|
|
+ calcMod: item.calcMod,
|
|
|
+ dataType: item.dataType,
|
|
|
+ meterType: item.meterType,
|
|
|
+ meterScale: item.meterScale,
|
|
|
+ meterLoc: item.meterLoc,
|
|
|
+ // 特殊
|
|
|
+ tagTable: item.tagTable,
|
|
|
+ tagCol: item.tagCol,
|
|
|
+ maxVal: item.maxVal,
|
|
|
+ minVal: item.minVal,
|
|
|
+ avgVal: item.avgVal,
|
|
|
+ sumVal: item.sumVal,
|
|
|
+ bcode: item.bcode,
|
|
|
+ bdesc1: item.bdesc1,
|
|
|
+ bdesc2: item.bdesc2,
|
|
|
+ btype1: item.btype1,
|
|
|
+ btype2: item.btype2
|
|
|
+ })
|
|
|
+ }
|
|
|
+ that.tableData = arr;
|
|
|
+ that.total = res.data.total;
|
|
|
+ } else {
|
|
|
+ that.$message.error(res.message);
|
|
|
+ }
|
|
|
+ that.tableLoading = false;
|
|
|
+ }).catch(function () {
|
|
|
+ that.tableLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 改变表格显示条数
|
|
|
+ tableSizeChange (val) {
|
|
|
+ let that = this;
|
|
|
+ that.pageSize = val;
|
|
|
+ that.getTableData(1);
|
|
|
+ },
|
|
|
+ // 重置搜索
|
|
|
+ tableDataCancel () {
|
|
|
+ let that = this;
|
|
|
+ for (let key in that.filterForm.data) {
|
|
|
+ if (that.filterForm.data[key] instanceof Array) {
|
|
|
+ that.filterForm.data[key] = [];
|
|
|
+ } else {
|
|
|
+ that.filterForm.data[key] = '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ that.getTableData(1);
|
|
|
+ },
|
|
|
+ // 选择添加时的模板
|
|
|
+ handleCurrentChange (row) {
|
|
|
+ let that = this;
|
|
|
+ that.dialog.editorBox.addRow = row;
|
|
|
+ },
|
|
|
+ dataSave () {
|
|
|
+ let that = this;
|
|
|
+ let SubmitData = {
|
|
|
+ itemid: that.dialog.editorBox.form.data.itemid,
|
|
|
+ itemname: that.dialog.editorBox.form.data.itemname,
|
|
|
+ tagAlias: that.dialog.editorBox.form.data.tagAlias,
|
|
|
+ itemdesc: that.dialog.editorBox.form.data.itemdesc,
|
|
|
+ itemtype: that.dialog.editorBox.form.data.itemtype,
|
|
|
+ locateid: that.dialog.editorBox.form.data.locateid,
|
|
|
+ networkid: that.dialog.editorBox.form.data.networkid,
|
|
|
+ energytypeid: that.dialog.editorBox.form.data.energytypeid,
|
|
|
+ energyid: that.dialog.editorBox.form.data.energyid,
|
|
|
+ propertyid: that.dialog.editorBox.form.data.propertyid,
|
|
|
+ unitid: that.dialog.editorBox.form.data.unitid,
|
|
|
+ isschedule: that.dialog.editorBox.form.data.isschedule,
|
|
|
+ costid: that.dialog.editorBox.form.data.costid,
|
|
|
+ sourceType: that.dialog.editorBox.form.data.sourceType,
|
|
|
+ mintimegranid: that.dialog.editorBox.form.data.mintimegranid,
|
|
|
+ // 基础
|
|
|
+ defaultvalue: that.dialog.editorBox.form1.data.defaultvalue,
|
|
|
+ digits: that.dialog.editorBox.form1.data.digits,
|
|
|
+ node: that.dialog.editorBox.form1.data.node,
|
|
|
+ showno: that.dialog.editorBox.form1.data.showno,
|
|
|
+ parentid: that.dialog.editorBox.form1.data.parentid,
|
|
|
+ recTime: that.dialog.editorBox.form1.data.recTime,
|
|
|
+ useflag: that.dialog.editorBox.form1.data.useflag,
|
|
|
+ status: that.dialog.editorBox.form1.data.status,
|
|
|
+ // 扩展
|
|
|
+ tagid: that.dialog.editorBox.form1.data.tagid,
|
|
|
+ tagname: that.dialog.editorBox.form1.data.tagname,
|
|
|
+ rangeVal: that.dialog.editorBox.form1.data.rangeVal,
|
|
|
+ tagBadSymbol: that.dialog.editorBox.form1.data.tagBadSymbol,
|
|
|
+ tagModulus: that.dialog.editorBox.form1.data.tagModulus,
|
|
|
+ tagIdMap: that.dialog.editorBox.form1.data.tagIdMap,
|
|
|
+ calcMod: that.dialog.editorBox.form1.data.calcMod,
|
|
|
+ dataType: that.dialog.editorBox.form1.data.dataType,
|
|
|
+ meterType: that.dialog.editorBox.form1.data.meterType,
|
|
|
+ meterScale: that.dialog.editorBox.form1.data.meterScale,
|
|
|
+ meterLoc: that.dialog.editorBox.form1.data.meterLoc,
|
|
|
+ // 特殊
|
|
|
+ tagTable: that.dialog.editorBox.form1.data.tagTable,
|
|
|
+ tagCol: that.dialog.editorBox.form1.data.tagCol,
|
|
|
+ maxVal: that.dialog.editorBox.form1.data.maxVal,
|
|
|
+ minVal: that.dialog.editorBox.form1.data.minVal,
|
|
|
+ avgVal: that.dialog.editorBox.form1.data.avgVal,
|
|
|
+ sumVal: that.dialog.editorBox.form1.data.sumVal,
|
|
|
+ bcode: that.dialog.editorBox.form1.data.bcode,
|
|
|
+ bdesc1: that.dialog.editorBox.form1.data.bdesc1,
|
|
|
+ bdesc2: that.dialog.editorBox.form1.data.bdesc2,
|
|
|
+ btype1: that.dialog.editorBox.form1.data.btype1,
|
|
|
+ btype2: that.dialog.editorBox.form1.data.btype2
|
|
|
+ };
|
|
|
+ that.$refs['dialog_form'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ that.$refs['dialog_form1'].validate((valid1) => {
|
|
|
+ if (valid1) {
|
|
|
+ if (that.dialog.editorBox.type === 'add') {
|
|
|
+ let foorData = new FormData();
|
|
|
+ for (let key in SubmitData) {
|
|
|
+ foorData.append(key, SubmitData[key]);
|
|
|
+ }
|
|
|
+ that.loading = true;
|
|
|
+ that.axios.post('pass/ems/v1/trmcalpoints/', foorData, {
|
|
|
+ headers: {
|
|
|
+ 'Content-Type': 'multipart/form-data'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .then(function (res) {
|
|
|
+ if (res.code === '0') {
|
|
|
+ that.$message({
|
|
|
+ message: '新增成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ that.getTableData();
|
|
|
+ that.dialog.editorBox.show = false;
|
|
|
+ } else {
|
|
|
+ that.$message.error(res.message);
|
|
|
+ }
|
|
|
+ that.loading = false;
|
|
|
+ }).catch(function () {
|
|
|
+ that.loading = false;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ that.loading = true;
|
|
|
+ that.axios.put('pass/ems/v1/trmcalpoints/' + SubmitData.itemid, SubmitData)
|
|
|
+ .then(function (res) {
|
|
|
+ if (res.code === '0') {
|
|
|
+ let msg = res.message
|
|
|
+ if (!msg || msg === '操作成功') {
|
|
|
+ that.$message({
|
|
|
+ message: '修改成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ that.$message.warning('修改成功,注意:' + msg);
|
|
|
+ }
|
|
|
+ that.getTableData();
|
|
|
+ that.dialog.editorBox.show = false;
|
|
|
+ } else {
|
|
|
+ that.$message.error(res.message);
|
|
|
+ }
|
|
|
+ that.loading = false;
|
|
|
+ }).catch(function () {
|
|
|
+ that.loading = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ that.dialog.editorBox.activeName = '2';
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ that.dialog.editorBox.activeName = '1';
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ rowClassName ({row, rowIndex}) {
|
|
|
+ return row.useflag !== '1' ? 'rowDisable' : ''
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less">
|
|
|
+.measurementPlace {
|
|
|
+ min-width: 700px;
|
|
|
+ height: 100%;
|
|
|
+ .box {
|
|
|
+ height: 100%;
|
|
|
+ padding: 15px 15px 0 15px;
|
|
|
+ .box-top {
|
|
|
+ .el-form-item {
|
|
|
+ margin-bottom: 7px;
|
|
|
+ }
|
|
|
+ .box-top-gjl {
|
|
|
+ overflow: hidden;
|
|
|
+ // margin-top: -7px;
|
|
|
+ padding: 7px 0;
|
|
|
+ border-top: 1px solid #ccc;
|
|
|
+ // border-bottom: 1px solid #ccc;
|
|
|
+ // margin-bottom: 6px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .rowDisable td {
|
|
|
+ background-color: #dfdfdf !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .attribute-box {
|
|
|
+ .item {
|
|
|
+ border: #ccc 1px solid;
|
|
|
+ padding: 5px;
|
|
|
+ margin-bottom: 6px;
|
|
|
+ .bt {
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 600;
|
|
|
+ color: #000;
|
|
|
+ padding-left: 10px;
|
|
|
+ border-left: #008fe0 5px solid;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .color_no {
|
|
|
+ color: #7a7a7a;
|
|
|
+ }
|
|
|
+ .color_yes {
|
|
|
+ color: #1a9f17;
|
|
|
+ }
|
|
|
+ .el-button--mini {
|
|
|
+ padding: 7px 12px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|