装备定位样式修改
This commit is contained in:
parent
d10a41ef8c
commit
56bd210f52
|
|
@ -44,7 +44,7 @@ export function unbindDeviceApi(data) {
|
|||
export function deleteDeviceApi(id) {
|
||||
return request({
|
||||
url: `/material-mall/iotMachine/deleteById/${id}`,
|
||||
method: 'delete',
|
||||
method: 'POST',
|
||||
|
||||
})
|
||||
}
|
||||
|
|
@ -149,3 +149,19 @@ export function getRecordListAll(params = {}) {
|
|||
params,
|
||||
})
|
||||
}
|
||||
|
||||
export function getCategoryList(query) {
|
||||
return request({
|
||||
url: '/material-mall/iotMachine/getCategoryList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getEquipment(query) {
|
||||
return request({
|
||||
url: '/material-mall/iotMachine/getEquipment',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,35 +4,92 @@
|
|||
<div class="search-wrapper">
|
||||
<el-form
|
||||
:inline="true"
|
||||
label-width="70px"
|
||||
label-width="130px"
|
||||
label-position="right"
|
||||
ref="searchFormRef"
|
||||
:model="searchParams"
|
||||
class="search-form"
|
||||
v-show="showSearch"
|
||||
>
|
||||
<el-form-item prop="keyWord" label="搜索:">
|
||||
<el-form-item prop="keyWord" label="定位设备名称:">
|
||||
<el-input
|
||||
clearable
|
||||
placeholder="请输入关键字"
|
||||
placeholder="请输入定位设备名称"
|
||||
v-model="searchParams.keyWord"
|
||||
style="width: 200px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="onReset" icon="el-icon-refresh" style="margin-left: 8px">重置</el-button>
|
||||
<el-button @click="handleQuery" icon="el-icon-search" type="primary">
|
||||
|
||||
<el-form-item prop="keyWord" label="定位设备编码:">
|
||||
<el-input
|
||||
clearable
|
||||
placeholder="请输入定位设备编码"
|
||||
v-model="searchParams.keyWord"
|
||||
style="width: 200px"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="keyWord" label="装备名称:">
|
||||
<el-input
|
||||
clearable
|
||||
placeholder="请输入装备名称"
|
||||
v-model="searchParams.keyWord"
|
||||
style="width: 200px"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<div v-if="searchExpanded">
|
||||
<el-form-item prop="keyWord" label="装备编码:">
|
||||
<el-input
|
||||
clearable
|
||||
placeholder="请输入装备编码"
|
||||
v-model="searchParams.keyWord"
|
||||
style="width: 200px"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="keyWord" label="装备状态:">
|
||||
<el-input
|
||||
clearable
|
||||
placeholder="请输入装备状态"
|
||||
v-model="searchParams.keyWord"
|
||||
style="width: 200px"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<!-- 状态统计和操作按钮 - 固定定位 -->
|
||||
<div class="status-operation-bar sticky-bar">
|
||||
<div class="operation-buttons">
|
||||
<el-button type="text" size="mini" style="float: right;line-height: 30px;" @click="toggleSearch" class="search-toggle-btn">
|
||||
<i :class="searchExpanded ? 'el-icon-up' : 'el-icon-down'"></i>
|
||||
{{ searchExpanded ? '收起' : '展开' }}
|
||||
</el-button>
|
||||
|
||||
<el-button @click="handleQuery" icon="el-icon-search" type="primary" style="float: right" >
|
||||
查询
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-button @click="onReset" icon="el-icon-refresh" style="margin-left: 8px;float: right">重置</el-button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 数据列表 -->
|
||||
<div class="table-wrapper">
|
||||
<div class="table-header">
|
||||
<el-button @click="addDevice(null)" type="primary" style="float: right">
|
||||
<el-button @click="addDevice(null)" type="primary" style="float: right;margin-right: 10px;">
|
||||
新增
|
||||
</el-button>
|
||||
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getDeviceList"
|
||||
:columns="columns"
|
||||
></right-toolbar>
|
||||
</div>
|
||||
|
||||
<!-- 表格容器:限制高度 + 隐藏滚动条 -->
|
||||
|
|
@ -48,12 +105,40 @@
|
|||
height="100%"
|
||||
>
|
||||
<!--复选列-->
|
||||
<el-table-column type="selection" width="50" align="center"/>
|
||||
<!-- <el-table-column type="selection" width="50" align="center"/>-->
|
||||
<!--序号列-->
|
||||
<el-table-column align="center" label="序号" type="index" width="60"/>
|
||||
|
||||
<el-table-column
|
||||
v-for="(item, index) in columns"
|
||||
v-if="item.visible"
|
||||
:key="index"
|
||||
align="center"
|
||||
:width="item.width || 'auto'"
|
||||
:fixed="item.fixed"
|
||||
:label="item.label"
|
||||
:prop="item.prop"
|
||||
>
|
||||
<template v-slot="{ row }" v-if="item.prop == 'maStatus'">
|
||||
<el-tag v-if="row.maStatus == 1" type="success" size="mini">在库</el-tag>
|
||||
<el-tag v-if="row.maStatus == 2" size="mini">自用</el-tag>
|
||||
<el-tag v-if="row.maStatus == 3" size="mini">共享</el-tag>
|
||||
<el-tag v-if="row.maStatus == 4" size="mini" type="danger">退役</el-tag>
|
||||
<el-tag v-if="row.maStatus == 5" size="mini" type="warning">维修</el-tag>
|
||||
</template>
|
||||
<template v-slot="{ row }" v-else-if="item.prop == 'iotStatus'">
|
||||
<el-tag v-if="row.iotStatus == 0" type="success" size="mini">在线</el-tag>
|
||||
<el-tag v-if="row.iotStatus == 1" size="mini" type="danger">下线</el-tag>
|
||||
</template>
|
||||
|
||||
<template v-slot="{ row }" v-else-if="item.prop == 'bindStatus'">
|
||||
<el-tag v-if="row.bindStatus == 0" type="success" size="mini">已绑定</el-tag>
|
||||
<el-tag v-if="row.bindStatus == 1" size="mini" type="danger">未绑定</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- 核心字段列 - 统一设置换行样式 -->
|
||||
<el-table-column align="center" prop="iotName" label="定位设备名称" width="180">
|
||||
<!-- <el-table-column align="center" prop="iotName" label="定位设备名称" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip
|
||||
:content="scope.row.iotName"
|
||||
|
|
@ -140,7 +225,7 @@
|
|||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" prop="bindTime" label="绑定时间" min-width="110"/>
|
||||
<el-table-column align="center" prop="unBindTime" label="解绑时间" min-width="110"/>
|
||||
<el-table-column align="center" prop="unBindTime" label="解绑时间" min-width="110"/>-->
|
||||
|
||||
<!--操作列:仅修改绑定按钮的传参,其余完全保留-->
|
||||
<el-table-column align="center" label="操作" width="250">
|
||||
|
|
@ -213,20 +298,20 @@
|
|||
:model="addOrEditForm"
|
||||
:rules="addOrEditFormRules"
|
||||
>
|
||||
<el-form-item label="设备名称:" prop="iotName">
|
||||
<el-form-item label="定位设备名称:" prop="iotName">
|
||||
<el-input v-model="addOrEditForm.iotName" placeholder="输入内容" maxlength="50" show-word-limit/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备编码:" prop="iotCode">
|
||||
<el-form-item label="定位设备编码:" prop="iotCode">
|
||||
<el-input v-model="addOrEditForm.iotCode" placeholder="输入内容" maxlength="50" show-word-limit/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备负责人:" prop="iotManager">
|
||||
<el-form-item label="定位设备负责人:" prop="iotManager">
|
||||
<el-input v-model="addOrEditForm.iotManager" placeholder="输入内容" maxlength="50" show-word-limit/>
|
||||
</el-form-item>
|
||||
<el-form-item label="地址:" prop="address">
|
||||
<el-input v-model="addOrEditForm.address" placeholder="输入内容" maxlength="50" show-word-limit/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="地址:" prop="address">-->
|
||||
<!-- <el-input v-model="addOrEditForm.address" placeholder="输入内容" maxlength="50" show-word-limit/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- 设备状态开关 -->
|
||||
<el-form-item label="设备状态:">
|
||||
<el-form-item label="定位设备状态:">
|
||||
<el-switch
|
||||
size="large"
|
||||
v-model="addOrEditForm.iotStatus"
|
||||
|
|
@ -254,13 +339,13 @@
|
|||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="addOrEditDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="handleSubmit" :loading="submitLoading">
|
||||
{{ isAdd ? '新增' : '保存' }}
|
||||
{{ isAdd ? '确定' : '保存' }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!--绑定弹窗:仅修改3处逻辑(prop/取消按钮/隐藏iotId),样式完全保留-->
|
||||
<el-dialog
|
||||
<!-- <el-dialog
|
||||
width="600px"
|
||||
@close="handleBindDialogClose"
|
||||
destroy-on-close
|
||||
|
|
@ -274,27 +359,139 @@
|
|||
:model="bindForm"
|
||||
:rules="bindFormRules"
|
||||
>
|
||||
<!-- 新增:隐藏存储iotId,无样式修改 -->
|
||||
<!– 新增:隐藏存储iotId,无样式修改 –>
|
||||
<el-form-item prop="iotId" style="display: none;">
|
||||
<el-input v-model="bindForm.iotId"/>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 仅修改prop为typeName,label/样式完全保留 -->
|
||||
<!– 仅修改prop为typeName,label/样式完全保留 –>
|
||||
<el-form-item label="装备名称:" prop="typeName">
|
||||
<el-input v-model="bindForm.typeName" placeholder="输入内容" maxlength="50" show-word-limit/>
|
||||
</el-form-item>
|
||||
<!-- 仅修改prop为typeCode,label/样式完全保留 -->
|
||||
<!– 仅修改prop为typeCode,label/样式完全保留 –>
|
||||
<el-form-item label="装备编码:" prop="maCode">
|
||||
<el-input v-model="bindForm.maCode" placeholder="输入内容" maxlength="50" show-word-limit/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<!-- 仅修改这行:取消按钮关闭绑定弹窗,其余完全保留 -->
|
||||
<!– 仅修改这行:取消按钮关闭绑定弹窗,其余完全保留 –>
|
||||
<el-button @click="bindDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="bindSubmit" :loading="submitLoading">
|
||||
绑定
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>-->
|
||||
|
||||
<el-dialog
|
||||
title="设备绑定"
|
||||
@close="handleBindDialogClose"
|
||||
destroy-on-close
|
||||
:title="bindDialogTitle"
|
||||
:visible.sync="bindDialogVisible"
|
||||
width="80%"
|
||||
top="3"
|
||||
>
|
||||
<div class="instance-dialog-container">
|
||||
<!-- 筛选条件 -->
|
||||
<div class="search-form">
|
||||
|
||||
<el-form :inline="true" :model="searchForm" class="demo-form-inline">
|
||||
<el-form-item label="装备名称">
|
||||
<el-input
|
||||
v-model="searchForm.equipmentName"
|
||||
placeholder="请输入装备名称"
|
||||
clearable
|
||||
size="small"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="装备分类">
|
||||
<el-select v-model="searchForm.type" placeholder="请选择分类"
|
||||
style="width: 100%;"
|
||||
clearable filterable @change="handleCategoryChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in categoryList"
|
||||
:key="item.uniqueKey"
|
||||
:label="`${item.equipmentName}(${item.devType})`"
|
||||
:value="item.equipmentName"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格型号">
|
||||
<el-input
|
||||
v-model="searchForm.specModel"
|
||||
placeholder="请输入规格型号"
|
||||
clearable
|
||||
size="small"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="small" @click="handleOwnSearch">查询</el-button>
|
||||
<el-button size="small" @click="resetOwnSearch">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<!-- 表格:支持多选 -->
|
||||
<el-table
|
||||
:data="tableData.own.list"
|
||||
:loading="tableData.own.loading"
|
||||
ref="ownTableRef"
|
||||
height="60vh"
|
||||
@row-click="handleRowClick"
|
||||
v-loading="tableData.own.loading"
|
||||
:highlight-current-row="true"
|
||||
>
|
||||
<el-table-column width="55" align="center">
|
||||
<template slot-scope="scope"> <!-- Element UI 用 slot-scope 而非 v-slot -->
|
||||
<el-radio
|
||||
v-model="selectedRowId"
|
||||
:label="scope.row.id"
|
||||
size="small"
|
||||
class="radio-no-text"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-for="column in tableColumns.instanceDetail"
|
||||
:key="column.prop"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
align="center"
|
||||
:min-width="column.minWidth || 100"
|
||||
>
|
||||
<template v-slot="scope" v-if="column.prop === 'maStatus'">
|
||||
{{ column.dictMap[scope.row[column.prop]] || scope.row[column.prop] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<el-pagination
|
||||
@size-change="(val) => handleOwnSizeChange(val)"
|
||||
@current-change="(val) => handleOwnCurrentChange(val)"
|
||||
:current-page="tableData.own.pageNum"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="tableData.own.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="tableData.own.total"
|
||||
style="margin-top: 15px; text-align: right;"
|
||||
>
|
||||
</el-pagination>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="ownOpen = false">取消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="handleOwnConfirm"
|
||||
:disabled="!selectedRowId"
|
||||
>
|
||||
确认选择
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
|
|
@ -397,6 +594,8 @@ import {
|
|||
addOrUpdate,
|
||||
getIotList,
|
||||
unbindIot,
|
||||
getCategoryList,
|
||||
getEquipment
|
||||
} from '@/api/iotDevice'
|
||||
import { dialogConfig } from './config'
|
||||
import DialogModel from '@/components/DialogModel' // 弹框组件
|
||||
|
|
@ -404,6 +603,7 @@ import TableModel from '@/components/TableModel'
|
|||
import { bindIot } from '../../api/iotDevice' // 表格组件
|
||||
|
||||
import MapDialog from './MapDIalog'
|
||||
import { getOwnEquipmentList } from '@/api/system/equipmentNew'
|
||||
|
||||
export default {
|
||||
name: 'IOTManagement',
|
||||
|
|
@ -460,7 +660,8 @@ export default {
|
|||
bindForm: {
|
||||
iotId:'', // 核心:存储绑定的设备ID
|
||||
typeName:'',
|
||||
maCode: ''
|
||||
maCode: '',
|
||||
maId:''
|
||||
},
|
||||
// 绑定表单校验规则
|
||||
bindFormRules: {
|
||||
|
|
@ -493,6 +694,58 @@ export default {
|
|||
deviceName: '',
|
||||
deviceType: '',
|
||||
iotCode: '',
|
||||
// 搜索区域展开状态
|
||||
searchExpanded: false,
|
||||
showSearch: true,
|
||||
// 表头字段
|
||||
columns:[
|
||||
{ key: 1, label: `定位设备名称`, prop: 'iotName', visible: true, },
|
||||
{ key: 2, label: `定位设备编码`, prop: 'iotCode', visible: true, },
|
||||
{ key: 3, label: `装备类目`, prop: 'type',width: 300, visible: true, },
|
||||
{ key: 4, label: `装备名称`, prop: 'typeName',width: 300, visible: true, },
|
||||
{ key: 5, label: `装备编码`, prop: 'maCode', visible: true, },
|
||||
{ key: 6, label: `使用项目`, prop: 'propertyUnit', visible: true, },
|
||||
{ key: 7, label: `装备状态`, prop: 'maStatus', visible: true, },
|
||||
{ key: 8, label: `设备状态`, prop: 'iotStatus', visible: true, },
|
||||
{ key: 9, label: `绑定状态`, prop: 'bindStatus', visible: true, },
|
||||
{ key: 10, label: `设备地图`, prop: 'address', visible: true, },
|
||||
{ key: 11, label: `设备负责人`, prop: 'iotManager', visible: true, },
|
||||
{ key: 12, label: `绑定时间`, prop: 'bindTime', visible: true, },
|
||||
{ key: 13, label: `解绑时间`, prop: 'unBindTime', visible: true, },
|
||||
],
|
||||
|
||||
|
||||
// 新增:筛选表单数据
|
||||
searchForm: {
|
||||
equipmentName: '',
|
||||
equipmentType: '',
|
||||
specModel: '',
|
||||
type: '',
|
||||
},
|
||||
|
||||
categoryList: [],
|
||||
|
||||
// 所有表格状态:新增自有/共享/外租表格数据
|
||||
tableData: {
|
||||
// 新增
|
||||
own: { list: [], loading: false, total: 0, pageNum: 1, pageSize: 10 },
|
||||
},
|
||||
tableColumns: {
|
||||
// 新增:实例详情表格列(用于弹窗内的表格)
|
||||
instanceDetail: [
|
||||
{ label: '分类', prop: 'type', minWidth: 300 },
|
||||
{ label: '设备编码', prop: 'deviceCode', minWidth: 120 },
|
||||
{ label: '装备名称', prop: 'name', minWidth: 150 },
|
||||
{ label: '原始编码', prop: 'originalEncoding', minWidth: 120 },
|
||||
{ label: '装备状态', prop: 'maStatus', minWidth: 120,
|
||||
dictMap: { 1: '在库', 2: '自用', 3: '共享', 5: '维修' }
|
||||
},
|
||||
|
||||
],
|
||||
},
|
||||
ownOpen: false, // 自有装备弹窗
|
||||
selectedOwnRows: [],
|
||||
selectedRowId: '',
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
|
@ -500,6 +753,25 @@ export default {
|
|||
//this.getDeviceTypeList()
|
||||
},
|
||||
methods: {
|
||||
|
||||
async getCategoryList() {
|
||||
const res = await getCategoryList()
|
||||
if (res.code === 200) {
|
||||
this.categoryList = res.data.map(item => ({
|
||||
...item,
|
||||
uniqueKey: `${item.typeId}-${item.type}`
|
||||
}))
|
||||
}
|
||||
},
|
||||
|
||||
/* async getEquipment(){
|
||||
const res = await getEquipment()
|
||||
if (res.code === 200) {
|
||||
this.tableData.own.list = res.rows
|
||||
this.tableData.own.total = res.total
|
||||
}
|
||||
}, */
|
||||
|
||||
isOverflow(text, line = 2, width = 180) {
|
||||
// 创建一个隐藏的测量节点
|
||||
const div = document.createElement('div')
|
||||
|
|
@ -569,6 +841,8 @@ export default {
|
|||
|
||||
/** 添加/编辑设备 */
|
||||
addDevice(row) {
|
||||
|
||||
this.getCategoryList()
|
||||
// 1. 先清空旧表单(放在最前)
|
||||
this.$refs.addOrEditFormRef?.resetFields()
|
||||
|
||||
|
|
@ -584,7 +858,7 @@ export default {
|
|||
}
|
||||
} else {
|
||||
this.isAdd = true
|
||||
this.dialogTitle = '新增设备' // 用新的标题变量
|
||||
this.dialogTitle = '新增定位设备' // 用新的标题变量
|
||||
// 新增:重置表单默认值
|
||||
this.addOrEditForm = {
|
||||
iotId: '',
|
||||
|
|
@ -605,11 +879,15 @@ export default {
|
|||
|
||||
/** 绑定设备 */
|
||||
handleBind(row){
|
||||
this.selectedRowId ='';
|
||||
this.getCategoryList();
|
||||
this.loadOwnEquipmentData()
|
||||
this.$refs.bindFormRef?.resetFields()
|
||||
this.bindForm = {
|
||||
iotId: row.iotId,
|
||||
typeName: '',
|
||||
maCode: '',
|
||||
maId: '',
|
||||
}
|
||||
this.bindDialogTitle = '设备绑定' // 用新的标题变量
|
||||
this.bindDialogVisible = true;
|
||||
|
|
@ -686,7 +964,8 @@ export default {
|
|||
this.bindForm = {
|
||||
iotId:'',
|
||||
typeName:'',
|
||||
maCode: ''
|
||||
maCode: '',
|
||||
maId: '',
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -715,7 +994,7 @@ export default {
|
|||
}).then(async () => {
|
||||
try {
|
||||
if (type === 1) {
|
||||
const res = await deleteDeviceApi(row.id)
|
||||
const res = await deleteDeviceApi(row.iotId)
|
||||
if (res.code === 200) {
|
||||
this.$message.success(`${title}成功!`)
|
||||
this.getDeviceList()
|
||||
|
|
@ -778,10 +1057,99 @@ export default {
|
|||
|
||||
async handleMap(row) {
|
||||
this.deviceName = row.specificationType
|
||||
this.deviceType = row.maStatusName
|
||||
this.deviceType = row.maStatusName
|
||||
this.iotCode = row.iotCode
|
||||
this.mapDialogVisible = true
|
||||
},
|
||||
|
||||
/**
|
||||
* 切换搜索区域展开/收起状态
|
||||
*/
|
||||
toggleSearch() {
|
||||
this.searchExpanded = !this.searchExpanded
|
||||
this.searchExpanded ? (this.tableHeight = 320) : (this.tableHeight = 500)
|
||||
},
|
||||
|
||||
handleCategoryChange(selectedTypeId) {
|
||||
if (!selectedTypeId) {
|
||||
this.formData.classificationForm.selectedCategory = null
|
||||
this.formData.classificationForm.category = ''
|
||||
return
|
||||
}
|
||||
const selectedItem = this.categoryList.find(
|
||||
item => item.typeId === selectedTypeId
|
||||
)
|
||||
if (selectedItem) {
|
||||
this.formData.classificationForm.matchingName = selectedItem.typeId
|
||||
this.formData.classificationForm.category = selectedItem.type
|
||||
this.formData.classificationForm.name = selectedItem.equipmentName
|
||||
}
|
||||
},
|
||||
|
||||
handleOwnSearch() {
|
||||
this.tableData.own.pageNum = 1
|
||||
this.loadOwnEquipmentData()
|
||||
},
|
||||
resetOwnSearch() {
|
||||
this.searchForm.own = {
|
||||
name: '',
|
||||
type: '',
|
||||
specificationModel: ''
|
||||
}
|
||||
this.tableData.own.pageNum = 1
|
||||
this.loadOwnEquipmentData()
|
||||
},
|
||||
handleOwnSizeChange(val) {
|
||||
this.tableData.own.pageSize = val
|
||||
this.loadOwnEquipmentData()
|
||||
},
|
||||
handleOwnCurrentChange(val) {
|
||||
this.tableData.own.pageNum = val
|
||||
this.loadOwnEquipmentData()
|
||||
},
|
||||
|
||||
// 点击行选中单选框
|
||||
handleRowClick(row) {
|
||||
this.selectedRowId = row.id; // 替换为你行数据的唯一标识(如row.key)
|
||||
|
||||
this.bindForm = {
|
||||
iotId: this.bindForm.iotId,
|
||||
typeName: row.name,
|
||||
maCode: row.deviceCode,
|
||||
maId: this.selectedRowId,
|
||||
}
|
||||
},
|
||||
async handleOwnConfirm() {
|
||||
const res = await bindIot(this.bindForm)
|
||||
if (res.code === 200) {
|
||||
this.$message.success(`绑定成功!`)
|
||||
this.bindDialogVisible = false
|
||||
this.getDeviceList()
|
||||
}
|
||||
},
|
||||
|
||||
async loadOwnEquipmentData() {
|
||||
const tabConfig = this.tableData.own
|
||||
tabConfig.loading = true
|
||||
try {
|
||||
const queryParams = {
|
||||
...this.searchForm.own,
|
||||
pageNum: tabConfig.pageNum,
|
||||
pageSize: tabConfig.pageSize
|
||||
}
|
||||
const res = await getEquipment(queryParams)
|
||||
tabConfig.list = res.rows || []
|
||||
tabConfig.total = res.total || 0
|
||||
} catch (err) {
|
||||
console.error('加载自有装备数据失败:', err)
|
||||
this.$message.error('加载自有装备数据失败,请稍后重试')
|
||||
tabConfig.list = []
|
||||
tabConfig.total = 0
|
||||
} finally {
|
||||
tabConfig.loading = false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -803,7 +1171,7 @@ export default {
|
|||
background: #fff;
|
||||
padding: 16px;
|
||||
border-radius: 4px;
|
||||
margin-bottom: 16px;
|
||||
margin-bottom: 2px;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
flex-shrink: 0; /* 不压缩 */
|
||||
}
|
||||
|
|
@ -913,4 +1281,62 @@ export default {
|
|||
.project-table .el-table__row:hover {
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
|
||||
.status-operation-bar {
|
||||
background-color: #fff;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
|
||||
padding: 15px 20px;
|
||||
margin-bottom: 20px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* 搜索区域收起/展开按钮 */
|
||||
.search-toggle-btn {
|
||||
color: #2CBAB2;
|
||||
padding: 5px 10px;
|
||||
font-size: 16px;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
/* 固定操作栏样式 */
|
||||
.sticky-bar {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.operation-buttons {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-button--text {
|
||||
color: #2CBAB2;
|
||||
}
|
||||
|
||||
.el-button--primary {
|
||||
background-color: #2CBAB2;
|
||||
border-color: #2CBAB2;
|
||||
}
|
||||
|
||||
/* 隐藏el-radio的文本部分 */
|
||||
.radio-no-text .el-radio__label {
|
||||
display: none !important;
|
||||
}
|
||||
/* 可选:微调单选按钮位置,居中显示 */
|
||||
.radio-no-text .el-radio__input {
|
||||
margin: 0 auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.el-radio__input.is-checked+.el-radio__label{
|
||||
display: none;
|
||||
}
|
||||
|
||||
::v-deep .el-radio__label{
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@
|
|||
|
||||
|
||||
</div>
|
||||
<el-table v-loading="loading" :data="houseList" ref="multipleTable" row-key="supplierId" height="546px" stripe>
|
||||
<el-table v-loading="loading" :data="houseList" ref="multipleTable" row-key="supplierId" height="546px" stripe style="width: 100% !important;">
|
||||
<el-table-column label="序号" align="center" width="80" type="index">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
|
||||
|
|
@ -412,16 +412,16 @@
|
|||
|
||||
// 表格所有可选字段配置(key对应表格prop,label是显示名称)
|
||||
columns: [
|
||||
{ key: 1, label: '统一社会信用代码', prop: 'supplierCode', visible: true, width: 220 },
|
||||
{ key: 2, label: '厂家名称', prop: 'supplierName', visible: true, width: 150 },
|
||||
{ key: 3, label: '联系人', prop: 'contactPerson', visible: true, width: 120 },
|
||||
{ key: 4, label: '联系电话', prop: 'contactPhone', visible: true, width: 120 },
|
||||
{ key: 5, label: '厂家地址', prop: 'address', visible: true, width: 200 },
|
||||
{ key: 6, label: '资质/执照编号', prop: 'qualification', visible: true, width: 180 },
|
||||
{ key: 7, label: '状态', prop: 'status', visible: true, width: 100 },
|
||||
{ key: 8, label: '备注', prop: 'remark', visible: true, width: 150 },
|
||||
{ key: 9, label: '创建时间', prop: 'createTime', visible: true, width: 180 },
|
||||
{ key: 10, label: '更新时间', prop: 'updateTime', visible: true, width: 180 }
|
||||
{ key: 1, label: '统一社会信用代码', prop: 'supplierCode', visible: true, },
|
||||
{ key: 2, label: '厂家名称', prop: 'supplierName', visible: true, },
|
||||
{ key: 3, label: '联系人', prop: 'contactPerson', visible: true, },
|
||||
{ key: 4, label: '联系电话', prop: 'contactPhone', visible: true, },
|
||||
{ key: 5, label: '厂家地址', prop: 'address', visible: true, },
|
||||
{ key: 6, label: '资质/执照编号', prop: 'qualification', visible: true, },
|
||||
{ key: 7, label: '状态', prop: 'status', visible: true, },
|
||||
{ key: 8, label: '备注', prop: 'remark', visible: true, },
|
||||
{ key: 9, label: '创建时间', prop: 'createTime', visible: true, },
|
||||
{ key: 10, label: '更新时间', prop: 'updateTime', visible: true, }
|
||||
],
|
||||
columns2: [],
|
||||
};
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
>
|
||||
<el-card class="search-box">
|
||||
<el-row style="height: 32px">
|
||||
<el-col :span="4">
|
||||
<el-col :span="3">
|
||||
<el-form-item prop="keyWord">
|
||||
<el-input
|
||||
v-model="searchParams.keyWord"
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="20" style="text-align: right;">
|
||||
<el-col :span="21" >
|
||||
<el-button icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
|
||||
<el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">查询</el-button>
|
||||
</el-col>
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@
|
|||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"/>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="tableColumns" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
|
@ -132,8 +132,9 @@
|
|||
/>
|
||||
<el-table-column
|
||||
v-for="(column, index) in tableColumns"
|
||||
v-if="column.visible"
|
||||
show-overflow-tooltip
|
||||
:key="index"
|
||||
:key="column.key"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
align="center"
|
||||
|
|
@ -464,21 +465,22 @@ export default {
|
|||
total: 0, // 总条数
|
||||
// 表头
|
||||
tableColumns: [
|
||||
{ label: '产权单位', prop: 'companyName', width: 100 },
|
||||
{ label: '工具专业', prop: 'fourthParentName', width: 100 },
|
||||
{ label: '施工类型', prop: 'greatGrandparentName', width: 100 },
|
||||
{ label: '工具类型', prop: 'grandparentTypeName', width: 100 },
|
||||
{ label: '工具名称', prop: 'parentTypeName', width: 100 },
|
||||
{ label: '规格型号', prop: 'typeName', width: 100 },
|
||||
{ label: '计量单位', prop: 'unitName', width: 100 },
|
||||
{ label: '工具编码', prop: 'toolCode', width: 100 },
|
||||
{ label: '工具状态', prop: 'status', width: 100 },
|
||||
{ label: '下次检验时间', prop: 'nextCheckDate' },
|
||||
{ label: '生产厂家', prop: 'supplierName', width: 100 },
|
||||
{ label: '出厂日期', prop: 'productionDate', width: 100 },
|
||||
{ label: '资产原值', prop: 'originCost', width: 100 },
|
||||
{ label: '原始编码', prop: 'identifyCode', width: 100 },
|
||||
{ key: 1,label: '产权单位', prop: 'companyName', width: 100, visible: true, },
|
||||
{ key: 2,label: '工具专业', prop: 'fourthParentName', width: 100, visible: true, },
|
||||
{ key: 3,label: '施工类型', prop: 'greatGrandparentName', width: 100, visible: true, },
|
||||
{ key: 4,label: '工具类型', prop: 'grandparentTypeName', width: 100, visible: true, },
|
||||
{ key: 5,label: '工具名称', prop: 'parentTypeName', width: 100, visible: true, },
|
||||
{ key: 6,label: '规格型号', prop: 'typeName', width: 100, visible: true, },
|
||||
{ key: 7,label: '计量单位', prop: 'unitName', width: 100, visible: true, },
|
||||
{ key: 8,label: '工具编码', prop: 'toolCode', width: 100, visible: true, },
|
||||
{ key: 9,label: '工具状态', prop: 'status', width: 100, visible: true, },
|
||||
{ key: 10,label: '下次检验时间', prop: 'nextCheckDate', visible: true, },
|
||||
{ key: 11,label: '生产厂家', prop: 'supplierName', width: 100 , visible: true,},
|
||||
{ key: 12,label: '出厂日期', prop: 'productionDate', width: 100 , visible: true,},
|
||||
{ key: 13,label: '资产原值', prop: 'originCost', width: 100, visible: true, },
|
||||
{ key: 14,label: '原始编码', prop: 'identifyCode', width: 100, visible: true, },
|
||||
],
|
||||
columns2: [],
|
||||
// 表格数据
|
||||
tableList: [],
|
||||
isView: false,
|
||||
|
|
@ -540,6 +542,8 @@ export default {
|
|||
this.queryParams.propertyUnitIds = [...ids.map(Number)]
|
||||
this.getList()
|
||||
this.getSelectList()
|
||||
|
||||
this.columns2 = [...this.tableColumns];
|
||||
},
|
||||
methods: {
|
||||
handleUnitChange(value) {
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@
|
|||
<el-dropdown-item command="handleDownloadAll">导出全部</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"/>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="tableColumns" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
|
@ -143,8 +143,9 @@
|
|||
/>
|
||||
<el-table-column
|
||||
v-for="(column, index) in tableColumns"
|
||||
v-if="column.visible"
|
||||
show-overflow-tooltip
|
||||
:key="index"
|
||||
:key="column.key"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
align="center"
|
||||
|
|
@ -286,20 +287,23 @@ export default {
|
|||
total: 0, // 总条数
|
||||
// 表头
|
||||
tableColumns: [
|
||||
{ label: '产权单位', prop: 'companyName' ,width: 200},
|
||||
{ label: '工具专业', prop: 'fourthParentName' },
|
||||
{ label: '施工类型', prop: 'greatGrandparentName' },
|
||||
{ label: '工具类型', prop: 'grandparentTypeName' },
|
||||
{ label: '工具名称', prop: 'parentTypeName' },
|
||||
{ label: '规格型号', prop: 'typeName' },
|
||||
{ key: 1, label: '产权单位', prop: 'companyName', width: 200, visible: true },
|
||||
{ key: 2, label: '工具专业', prop: 'fourthParentName', visible: true },
|
||||
{ key: 3, label: '施工类型', prop: 'greatGrandparentName', visible: true },
|
||||
{ key: 4, label: '工具类型', prop: 'grandparentTypeName', visible: true },
|
||||
{ key: 5, label: '工具名称', prop: 'parentTypeName', visible: true },
|
||||
{ key: 6, label: '规格型号', prop: 'typeName', visible: true },
|
||||
{
|
||||
key: 7,
|
||||
label: '管理模式',
|
||||
prop: 'manageMode',
|
||||
render: (h, { row }) => {
|
||||
return row.manageMode == '1' ? h('span', {}, '数量工具') : h('span', {}, '编码工具')
|
||||
}
|
||||
},
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
key: 8,
|
||||
label: '在库数量',
|
||||
prop: 'availableNum',
|
||||
render: (h, { row }) => {
|
||||
|
|
@ -313,9 +317,11 @@ export default {
|
|||
row.availableNum
|
||||
)
|
||||
: h('span', {}, row.availableNum)
|
||||
}
|
||||
},
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
key: 9,
|
||||
label: '出库数量',
|
||||
prop: 'inNum',
|
||||
render: (h, { row }) => {
|
||||
|
|
@ -329,9 +335,11 @@ export default {
|
|||
row.inNum
|
||||
)
|
||||
: h('span', {}, row.inNum)
|
||||
}
|
||||
},
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
key: 10,
|
||||
label: '共享数量',
|
||||
prop: 'shareNum',
|
||||
render: (h, { row }) => {
|
||||
|
|
@ -345,9 +353,11 @@ export default {
|
|||
row.shareNum
|
||||
)
|
||||
: h('span', {}, row.shareNum)
|
||||
}
|
||||
},
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
key: 11,
|
||||
label: '在修数量',
|
||||
prop: 'repairNum',
|
||||
render: (h, { row }) => {
|
||||
|
|
@ -361,14 +371,16 @@ export default {
|
|||
row.repairNum
|
||||
)
|
||||
: h('span', {}, row.repairNum)
|
||||
}
|
||||
},
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
key: 12,
|
||||
label: '退役数量',
|
||||
prop: 'scrapNum'
|
||||
prop: 'scrapNum',
|
||||
visible: true,
|
||||
},
|
||||
{ label: '工具总数(不含退役数)', prop: 'totalNum' }
|
||||
|
||||
{ key: 13, label: '工具总数(不含退役数)', prop: 'totalNum', visible: true }
|
||||
],
|
||||
// 表格数据
|
||||
tableList: [],
|
||||
|
|
|
|||
|
|
@ -38,9 +38,9 @@ module.exports = {
|
|||
// target: `http://localhost:18080`,
|
||||
// target: `http://192.168.0.96:28080`,//马
|
||||
// target: `http://192.168.0.110:18080`,//洪
|
||||
// target: `http://192.168.0.41:28080`,//蒋
|
||||
target: `http://192.168.0.229:28080`,//蒋
|
||||
// target: `http://36.33.26.201:17788/proxyApi`, //测试
|
||||
target: `http://36.33.26.201:21999/prod-api`, //测试
|
||||
// target: `http://36.33.26.201:21999/prod-api`, //测试
|
||||
// target: `http://192.168.137.1:18080`,//
|
||||
// target: `http://112.29.103.165:21001/prod-api`,//
|
||||
// target: `http://10.125.30.229:28080`,//
|
||||
|
|
|
|||
Loading…
Reference in New Issue