update - 设备参数

master
yinq 8 months ago
parent 70d3097b2b
commit 087655aea3

@ -51,3 +51,12 @@ export function getDeviceCode(query) {
params: query params: query
}) })
} }
// 查询设备台账列表
export function getDeviceLedgerList(query) {
return request({
url: '/base/deviceLedger/getDeviceLedgerList',
method: 'get',
params: query
})
}

@ -230,7 +230,7 @@
v-for="dict in dict.type.device_type" v-for="dict in dict.type.device_type"
:key="dict.value" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="parseInt(dict.value)" :value="dict.value"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -239,19 +239,32 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="使用部门" prop="usedDepartment"> <el-form-item label="班组">
<el-input v-model="form.usedDepartment" placeholder="请输入使用部门"/> <el-select v-model="form.teamCode" placeholder="请输入班组">
<el-option
v-for="item in teamMemberList"
:key="item.teamCode"
:label="item.teamName"
:value="item.teamCode"
></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="成本中心" prop="costCenter"> <el-form-item label="成本中心" prop="costCenter">
<el-input v-model="form.costCenter" placeholder="请输入成本中心"/> <el-input v-model="form.costCenter" placeholder="请输入成本中心"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="生产厂商" prop="manufacturer"> <el-form-item label="所属产线">
<el-input v-model="form.manufacturer" placeholder="请输入生产厂商"/> <el-select v-model="form.productLineCode" placeholder="请选择所属产线">
<el-option
v-for="item in productLineList"
:key="item.productLineCode"
:label="item.productLineName"
:value="item.productLineCode"
></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="启用日期" prop="enableDate"> <el-form-item label="启用日期" prop="enableDate">
<el-date-picker clearable <el-date-picker clearable
@ -264,25 +277,11 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="所属产线"> <el-form-item label="生产厂商" prop="manufacturer">
<el-select v-model="form.productLineCode" placeholder="请选择所属产线"> <el-input v-model="form.manufacturer" placeholder="请输入生产厂商"/>
<el-option
v-for="item in productLineList"
:key="item.productLineCode"
:label="item.productLineName"
:value="item.productLineCode"
></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="班组"> <el-form-item label="使用部门" prop="usedDepartment">
<el-select v-model="form.teamCode" placeholder="请输入班组"> <el-input v-model="form.usedDepartment" placeholder="请输入使用部门"/>
<el-option
v-for="item in teamMemberList"
:key="item.teamCode"
:label="item.teamName"
:value="item.teamCode"
></el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -296,8 +295,6 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
</el-row>
<el-form-item label="设备状态" prop="deviceStatus"> <el-form-item label="设备状态" prop="deviceStatus">
<el-radio-group v-model="form.deviceStatus"> <el-radio-group v-model="form.deviceStatus">
<el-radio <el-radio
@ -308,6 +305,8 @@
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col>
</el-row>
<!-- <el-form-item label="启用标识" prop="isFlag">--> <!-- <el-form-item label="启用标识" prop="isFlag">-->
<!-- <el-radio-group v-model="form.isFlag">--> <!-- <el-radio-group v-model="form.isFlag">-->
<!-- <el-radio--> <!-- <el-radio-->
@ -450,7 +449,7 @@ export default {
deviceCode: null, deviceCode: null,
deviceName: null, deviceName: null,
deviceModel: null, deviceModel: null,
deviceType: null, deviceType: '1',
deviceAddress: null, deviceAddress: null,
deviceStatus: 0, deviceStatus: 0,
usedDepartment: null, usedDepartment: null,

@ -9,6 +9,16 @@
<!-- @keyup.enter.native="handleQuery"--> <!-- @keyup.enter.native="handleQuery"-->
<!-- />--> <!-- />-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<el-form-item label="设备名称" prop="deviceCode">
<el-select v-model="form.deviceCode" placeholder="请选择设备名称" clearable>
<el-option
v-for="item in deviceLedgerList"
:key="item.deviceCode"
:label="item.productLinedDevice"
:value="item.deviceCode"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="参数名称" prop="paramName"> <el-form-item label="参数名称" prop="paramName">
<el-input <el-input
v-model="queryParams.paramName" v-model="queryParams.paramName"
@ -82,6 +92,8 @@
<el-table v-loading="loading" :data="deviceParamList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="deviceParamList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键标识" align="center" prop="objId" v-if="columns[0].visible"/> <el-table-column label="主键标识" align="center" prop="objId" v-if="columns[0].visible"/>
<el-table-column label="产线" align="center" prop="productLineName" v-if="columns[13].visible"/>
<el-table-column label="设备名称" align="center" prop="deviceName" v-if="columns[6].visible"/>
<el-table-column label="参数编号" align="center" prop="paramCode" v-if="columns[1].visible"/> <el-table-column label="参数编号" align="center" prop="paramCode" v-if="columns[1].visible"/>
<el-table-column label="参数名称" align="center" prop="paramName" v-if="columns[2].visible"/> <el-table-column label="参数名称" align="center" prop="paramName" v-if="columns[2].visible"/>
<el-table-column label="网络地址" align="center" prop="paramNetwork" v-if="columns[3].visible"/> <el-table-column label="网络地址" align="center" prop="paramNetwork" v-if="columns[3].visible"/>
@ -91,9 +103,12 @@
<dict-tag :options="dict.type.param_type" :value="scope.row.paramType"/> <dict-tag :options="dict.type.param_type" :value="scope.row.paramType"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="设备编号" align="center" prop="deviceCode" v-if="columns[6].visible"/>
<el-table-column label="读取频率" align="center" prop="readFrequency" v-if="columns[7].visible"/> <el-table-column label="读取频率" align="center" prop="readFrequency" v-if="columns[7].visible"/>
<el-table-column label="启用标识" align="center" prop="isFlag" v-if="columns[8].visible"/> <el-table-column label="启用标识" align="center" prop="isFlag" v-if="columns[8].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.is_flag" :value="scope.row.isFlag"/>
</template>
</el-table-column>
<el-table-column label="创建人" align="center" prop="createdBy" v-if="columns[9].visible"/> <el-table-column label="创建人" align="center" prop="createdBy" v-if="columns[9].visible"/>
<el-table-column label="创建时间" align="center" prop="createdTime" width="180" v-if="columns[10].visible"> <el-table-column label="创建时间" align="center" prop="createdTime" width="180" v-if="columns[10].visible">
<template slot-scope="scope"> <template slot-scope="scope">
@ -137,6 +152,16 @@
<!-- 添加或修改设备参数对话框 --> <!-- 添加或修改设备参数对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <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 ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备名称" prop="deviceCode">
<el-select v-model="form.deviceCode" placeholder="请选择设备名称">
<el-option
v-for="item in deviceLedgerList"
:key="item.deviceCode"
:label="item.productLinedDevice"
:value="item.deviceCode"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="参数编号" prop="paramCode"> <el-form-item label="参数编号" prop="paramCode">
<el-input v-model="form.paramCode" placeholder="请输入参数编号" /> <el-input v-model="form.paramCode" placeholder="请输入参数编号" />
</el-form-item> </el-form-item>
@ -159,9 +184,6 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="设备编号" prop="deviceCode">
<el-input v-model="form.deviceCode" placeholder="请输入设备编号" />
</el-form-item>
<el-form-item label="读取频率" prop="readFrequency"> <el-form-item label="读取频率" prop="readFrequency">
<el-input v-model="form.readFrequency" placeholder="请输入读取频率" /> <el-input v-model="form.readFrequency" placeholder="请输入读取频率" />
</el-form-item> </el-form-item>
@ -185,6 +207,8 @@
<script> <script>
import { listDeviceParam, getDeviceParam, delDeviceParam, addDeviceParam, updateDeviceParam } from "@/api/base/deviceParam"; import { listDeviceParam, getDeviceParam, delDeviceParam, addDeviceParam, updateDeviceParam } from "@/api/base/deviceParam";
import { getDeviceLedgerList } from '@//api/base/deviceLedger'
import { findFactoryList } from '@//api/base/factory'
export default { export default {
name: "DeviceParam", name: "DeviceParam",
@ -220,6 +244,7 @@ export default {
paramType: null, paramType: null,
deviceCode: null, deviceCode: null,
readFrequency: null, readFrequency: null,
productLinedDevice: null,
isFlag: null, isFlag: null,
createdBy: null, createdBy: null,
createdTime: null, createdTime: null,
@ -245,10 +270,16 @@ export default {
{ key: 10, label: `创建时间`, visible: false }, { key: 10, label: `创建时间`, visible: false },
{ key: 11, label: `更新人`, visible: false }, { key: 11, label: `更新人`, visible: false },
{ key: 12, label: `更新时间`, visible: false }, { key: 12, label: `更新时间`, visible: false },
] { key: 13, label: `产线`, visible: true },
],
//
deviceLedgerList: [],
}; };
}, },
created() { created() {
getDeviceLedgerList().then(response => {
this.deviceLedgerList = response.data
})
this.getList(); this.getList();
}, },
methods: { methods: {

Loading…
Cancel
Save