update - 设备参数

master
yinq 8 months ago
parent 70d3097b2b
commit 087655aea3

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

@ -9,6 +9,16 @@
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </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-input
v-model="queryParams.paramName"
@ -82,6 +92,8 @@
<el-table v-loading="loading" :data="deviceParamList" @selection-change="handleSelectionChange">
<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="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="paramName" v-if="columns[2].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"/>
</template>
</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="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="createdTime" width="180" v-if="columns[10].visible">
<template slot-scope="scope">
@ -137,6 +152,16 @@
<!-- 添加或修改设备参数对话框 -->
<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="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-input v-model="form.paramCode" placeholder="请输入参数编号" />
</el-form-item>
@ -159,9 +184,6 @@
></el-option>
</el-select>
</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-input v-model="form.readFrequency" placeholder="请输入读取频率" />
</el-form-item>
@ -185,6 +207,8 @@
<script>
import { listDeviceParam, getDeviceParam, delDeviceParam, addDeviceParam, updateDeviceParam } from "@/api/base/deviceParam";
import { getDeviceLedgerList } from '@//api/base/deviceLedger'
import { findFactoryList } from '@//api/base/factory'
export default {
name: "DeviceParam",
@ -220,6 +244,7 @@ export default {
paramType: null,
deviceCode: null,
readFrequency: null,
productLinedDevice: null,
isFlag: null,
createdBy: null,
createdTime: null,
@ -245,10 +270,16 @@ export default {
{ key: 10, label: `创建时间`, visible: false },
{ key: 11, label: `更新人`, visible: false },
{ key: 12, label: `更新时间`, visible: false },
]
{ key: 13, label: `产线`, visible: true },
],
//
deviceLedgerList: [],
};
},
created() {
getDeviceLedgerList().then(response => {
this.deviceLedgerList = response.data
})
this.getList();
},
methods: {

Loading…
Cancel
Save