From 56bd210f524342075b443a5b59b5bc6c215473f5 Mon Sep 17 00:00:00 2001
From: lSun <15893999301@qq.com>
Date: Tue, 27 Jan 2026 18:50:50 +0800
Subject: [PATCH] =?UTF-8?q?=E8=A3=85=E5=A4=87=E5=AE=9A=E4=BD=8D=E6=A0=B7?=
=?UTF-8?q?=E5=BC=8F=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/iotDevice/index.js | 18 +-
src/views/iotDevice/index.vue | 488 ++++++++++++++++--
src/views/material/ma/supplier/index.vue | 22 +-
src/views/search/category/index.vue | 4 +-
.../toolsManage/codeToolsLedger/index.vue | 36 +-
src/views/toolsManage/toolsLedger/index.vue | 44 +-
vue.config.js | 4 +-
7 files changed, 537 insertions(+), 79 deletions(-)
diff --git a/src/api/iotDevice/index.js b/src/api/iotDevice/index.js
index 81952e6c..f5f92586 100644
--- a/src/api/iotDevice/index.js
+++ b/src/api/iotDevice/index.js
@@ -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
+ })
+}
diff --git a/src/views/iotDevice/index.vue b/src/views/iotDevice/index.vue
index 477fc0c0..d455bb23 100644
--- a/src/views/iotDevice/index.vue
+++ b/src/views/iotDevice/index.vue
@@ -4,35 +4,92 @@
-
+
-
- 重置
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ searchExpanded ? '收起' : '展开' }}
+
+
+
查询
-
-
+
+ 重置
+
+
@@ -48,12 +105,40 @@
height="100%"
>
-
+
+
+
+ 在库
+ 自用
+ 共享
+ 退役
+ 维修
+
+
+ 在线
+ 下线
+
+
+
+ 已绑定
+ 未绑定
+
+
+
-
+
@@ -213,20 +298,20 @@
:model="addOrEditForm"
:rules="addOrEditFormRules"
>
-
+
-
+
-
+
-
-
-
+
+
+
-
+
-
-
+ <!– 新增:隐藏存储iotId,无样式修改 –>
-
+ <!– 仅修改prop为typeName,label/样式完全保留 –>
-
+ <!– 仅修改prop为typeCode,label/样式完全保留 –>
+ -->
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 查询
+ 重置
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ column.dictMap[scope.row[column.prop]] || scope.row[column.prop] }}
+
+
+
+
+
+
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;"
+ >
+
+
+
+
+
+
@@ -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
+ }
+ }
+
}
}
@@ -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;
+}
diff --git a/src/views/material/ma/supplier/index.vue b/src/views/material/ma/supplier/index.vue
index 50e8fab9..d74dcaac 100644
--- a/src/views/material/ma/supplier/index.vue
+++ b/src/views/material/ma/supplier/index.vue
@@ -97,7 +97,7 @@
-
+
{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}
@@ -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: [],
};
diff --git a/src/views/search/category/index.vue b/src/views/search/category/index.vue
index 9f89ab24..8924038b 100644
--- a/src/views/search/category/index.vue
+++ b/src/views/search/category/index.vue
@@ -10,7 +10,7 @@
>
-
+
-
+
重置
查询
diff --git a/src/views/toolsManage/codeToolsLedger/index.vue b/src/views/toolsManage/codeToolsLedger/index.vue
index 3ca01b2b..7817bcf6 100644
--- a/src/views/toolsManage/codeToolsLedger/index.vue
+++ b/src/views/toolsManage/codeToolsLedger/index.vue
@@ -111,7 +111,7 @@
-
+
@@ -132,8 +132,9 @@
/>
导出全部
-
+
@@ -143,8 +143,9 @@
/>
{
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: [],
diff --git a/vue.config.js b/vue.config.js
index d68c67b7..3a67d3a7 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -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`,//