Compare commits

..

21 Commits

Author SHA1 Message Date
015d7c4266 Merge pull request '更新' (#470) from projects/ssdl-zwq into projects/ssdl-test
Reviewed-on: #470
2026-01-16 11:10:18 +08:00
zwq
bfd8e04780 更新 2026-01-16 11:09:32 +08:00
471245d5b6 Merge pull request 'projects/ssdl-gtz' (#459) from projects/ssdl-gtz into projects/ssdl-test
Reviewed-on: #459
2025-12-10 15:22:44 +08:00
gtz
8226b45a03 merge 2025-12-10 15:21:00 +08:00
gtz
dde04cf93f 1 2025-12-10 15:11:28 +08:00
63a67e58de Merge pull request '更新' (#454) from projects/ssdl-zwq into projects/ssdl-test
Reviewed-on: #454
2025-11-28 16:28:10 +08:00
zwq
48e9f70625 更新 2025-11-28 16:27:50 +08:00
f5f250cb16 Merge pull request '更新' (#453) from projects/ssdl-zwq into projects/ssdl-test
Reviewed-on: #453
2025-11-20 14:48:36 +08:00
zwq
b6241fe7c4 更新 2025-11-20 14:48:07 +08:00
94edd04a08 Merge pull request '更新' (#452) from projects/ssdl-zwq into projects/ssdl-test
Reviewed-on: #452
2025-11-20 14:45:08 +08:00
zwq
b926559a7d 更新 2025-11-20 14:44:10 +08:00
b2984ed4cf Merge pull request 'projects/ssdl-zhp' (#451) from projects/ssdl-zhp into projects/ssdl-test
Reviewed-on: #451
2025-11-20 13:24:50 +08:00
‘937886381’
4ade2dfcdc Merge branch 'projects/ssdl-test' into projects/ssdl-zhp 2025-11-20 13:23:31 +08:00
‘937886381’
852a3f17a0 修改 2025-11-20 13:22:19 +08:00
cba14b1f61 Merge pull request 'projects/ssdl-zhp' (#450) from projects/ssdl-zhp into projects/ssdl-test
Reviewed-on: #450
2025-11-18 17:02:28 +08:00
‘937886381’
33c00785df 大屏 2025-11-18 17:00:40 +08:00
‘937886381’
d8acff21e3 Merge branch 'projects/ssdl-test' into projects/ssdl-zhp 2025-11-18 09:32:16 +08:00
‘937886381’
c0a38c568f 大屏 2025-11-18 09:31:39 +08:00
gtz
be86cbd9b3 1 2025-11-17 10:58:44 +08:00
6a8a9ed28d Merge pull request '更新' (#449) from projects/ssdl-zwq into projects/ssdl-test
Reviewed-on: #449
2025-11-17 09:24:30 +08:00
zwq
a2213f4f7e 更新 2025-11-17 09:23:55 +08:00
199 changed files with 25979 additions and 22761 deletions

View File

@@ -12,10 +12,10 @@ ENV = 'development'
VUE_APP_TITLE = 智能监控分析系统 VUE_APP_TITLE = 智能监控分析系统
# 芋道管理系统/开发环境 # 芋道管理系统/开发环境
# VUE_APP_BASE_API = 'http://172.16.33.187:48082'
VUE_APP_BASE_API = 'http://line.kszny.picaiba.com'
# VUE_APP_BASE_API = 'http://172.16.32.79:48082'
VUE_APP_BASE_API = 'http://192.168.0.31:48080'
# VUE_APP_BASE_API = 'http://172.16.32.76:48080'
# VUE_APP_BASE_API = 'http://line.kszny.picaiba.com'
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true

BIN
dist.zip

Binary file not shown.

View File

@@ -6,7 +6,7 @@
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"local": "vue-cli-service serve --mode local", "local": "vue-cli-service serve --mode local",
"dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --mode dev", "dev": "vue-cli-service serve --mode dev",
"front": "vue-cli-service serve --mode front", "front": "vue-cli-service serve --mode front",
"build:prod": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode prod", "build:prod": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode prod",
"build:stage": "vue-cli-service build --mode stage", "build:stage": "vue-cli-service build --mode stage",
@@ -49,7 +49,7 @@
"bpmn-js-token-simulation": "0.10.0", "bpmn-js-token-simulation": "0.10.0",
"chinese-lunar": "^0.1.4", "chinese-lunar": "^0.1.4",
"clipboard": "2.0.8", "clipboard": "2.0.8",
"code-brick-zj": "^1.1.1", "code-brick-zj": "^1.0.2",
"core-js": "^3.26.0", "core-js": "^3.26.0",
"crypto-js": "^4.0.0", "crypto-js": "^4.0.0",
"diagram-js": "^12.3.0", "diagram-js": "^12.3.0",

View File

@@ -0,0 +1,49 @@
/*
* @Author: zwq
* @Date: 2025-11-17 09:25:12
* @LastEditors: zwq
* @LastEditTime: 2026-01-14 13:53:22
* @Description:
*/
import request from '@/utils/request'
// 获得巷道分页
export function getLanePage(query) {
return request({
url: '/wms/lane/page',
method: 'get',
params: query
})
}
// 获得巷道
export function getLane(id) {
return request({
url: '/wms/lane/get?id=' + id,
method: 'get'
})
}
// 删除巷道
export function deleteLane(id) {
return request({
url: '/wms/lane/delete?id=' + id,
method: 'delete'
})
}
// 更新
export function updateLane(data) {
return request({
url: '/wms/lane/update',
method: 'put',
data: data
})
}
// 创建
export function createLane(data) {
return request({
url: '/wms/lane/create',
method: 'post',
data: data
})
}

View File

@@ -0,0 +1,66 @@
/*
* @Author: zwq
* @Date: 2025-11-17 09:25:12
* @LastEditors: zwq
* @LastEditTime: 2026-01-14 14:26:15
* @Description:
*/
import request from '@/utils/request'
// 获得线边库分页
export function getLineEdgeLibraryPage(query) {
return request({
url: '/wms/line-edge-library/page',
method: 'get',
params: query
})
}
// 获得线边库
export function getLineEdgeLibrary(id) {
return request({
url: '/wms/line-edge-library/get?id=' + id,
method: 'get'
})
}
// 删除线边库
export function deleteLineEdgeLibrary(id) {
return request({
url: '/wms/line-edge-library/delete?id=' + id,
method: 'delete'
})
}
// 更新
export function updateLineEdgeLibrary(data) {
return request({
url: '/wms/line-edge-library/update',
method: 'put',
data: data
})
}
// 更新线边库实时pc --清空操作
export function QKLineEdgeLibrary(data) {
return request({
url: '/wms/line-edge-library/update/pc',
method: 'put',
data: data
})
}
// 创建
export function createLineEdgeLibrary(data) {
return request({
url: '/wms/line-edge-library/create',
method: 'post',
data: data
})
}
// 获得设备分页
export function getEquipmentPage(query) {
return request({
url: '/wms/equipment/page',
method: 'get',
params: query
})
}

View File

@@ -0,0 +1,79 @@
/*
* @Author: zwq
* @Date: 2026-01-06 15:18:38
* @LastEditors: zwq
* @LastEditTime: 2026-01-15 15:02:04
* @Description:
*/
import request from '@/utils/request'
// 获取区域列表
export function getAreaList(params) {
return request({
url: '/wms/region/page',
method: 'get',
params
})
}
// 获取区域空满数量
export function postAllAreaInfo(data) {
return request({
url: '/wms/region/lsit/count',
method: 'post',
data
})
}
// 获取指定库区库位信息
export function postAreaInfo(params) {
return request({
url: '/wms/line-edge-library/list/region',
method: 'get',
params
})
}
// 获取区域总览
export function postAllAreaOverview(data) {
return request({
url: '/wms/line-edge-library/line/count',
method: 'post',
data
})
}
// 删除能源实时数据库plc相关
export function deleteEnergyPlc(id) {
return request({
url: '/base/energy-plc/delete?id=' + id,
method: 'delete'
})
}
// 获取关联表编码
export function getCode() {
return request({
url: '/base/energy-plc/getCode',
method: 'get'
})
}
// 获得能源实时数据库plc相关分页
export function getEnergyPlcPage(data) {
return request({
url: '/base/energy-plc/page',
method: 'post',
data: data
})
}
// 导出能源实时数据库plc相关 Excel
export function exportEnergyPlcExcel(query) {
return request({
url: '/base/energy-plc/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@@ -0,0 +1,63 @@
import request from '@/utils/request'
// 获取出入库历史任务分页
export function getRecordPage(params) {
return request({
url: '/wms/job-main-task-history/page',
method: 'get',
params
})
}
// 获取巷道列表
export function getLaneList(params) {
return request({
url: '/wms/lane/page',
method: 'get',
params
})
}
// 更新能源实时数据库plc相关
export function updateEnergyPlc(data) {
return request({
url: '/base/energy-plc/update',
method: 'put',
data: data
})
}
// 删除能源实时数据库plc相关
export function deleteEnergyPlc(id) {
return request({
url: '/base/energy-plc/delete?id=' + id,
method: 'delete'
})
}
// 获取关联表编码
export function getCode() {
return request({
url: '/base/energy-plc/getCode',
method: 'get'
})
}
// 获得能源实时数据库plc相关分页
export function getEnergyPlcPage(data) {
return request({
url: '/base/energy-plc/page',
method: 'post',
data: data
})
}
// 导出能源实时数据库plc相关 Excel
export function exportEnergyPlcExcel(query) {
return request({
url: '/base/energy-plc/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@@ -0,0 +1,49 @@
/*
* @Author: zwq
* @Date: 2025-11-17 09:25:12
* @LastEditors: zwq
* @LastEditTime: 2026-01-14 13:35:11
* @Description:
*/
import request from '@/utils/request'
// 获得区域分页
export function getRegionPage(query) {
return request({
url: '/wms/region/page',
method: 'get',
params: query
})
}
// 获得区域
export function getRegion(id) {
return request({
url: '/wms/region/get?id=' + id,
method: 'get'
})
}
// 删除区域
export function deleteRegion(id) {
return request({
url: '/wms/region/delete?id=' + id,
method: 'delete'
})
}
// 更新
export function updateRegion(data) {
return request({
url: '/wms/region/update',
method: 'put',
data: data
})
}
// 创建
export function createRegion(data) {
return request({
url: '/wms/region/create',
method: 'post',
data: data
})
}

View File

@@ -59,34 +59,3 @@ export function getEquipmentAll() {
method: 'get' method: 'get'
}) })
} }
export function getTree(query) {
return request({
url: '/base/factory/getTreeSimple',
method: 'get',
params: query,
});
}
export function getEquipmentOverall(data) {
return request({
url: '/monitoring/equipment-overall/get',
method: 'post',
data: data,
});
}
export function getParamMonitor(data) {
return request({
url: '/monitoring/equipment-monitor/paramMonitor',
method: 'post',
data: data,
});
}
export function getAlarmDet(data) {
return request({
url: 'monitoring/equipment-overall/alarmDet',
method: 'post',
data: data,
});
}

View File

@@ -52,5 +52,3 @@ export function exportEquipmentTypeExcel(query) {
responseType: 'blob' responseType: 'blob'
}) })
} }

View File

@@ -50,15 +50,6 @@ export function getPdlAutoReportNewSearchNow(data) {
}); });
} }
export function getPdlAutoReportNewSearchLastGroup(data) {
return request({
url: '/monitoring/production-monitor/getPdlAutoReportNewSearchLastGroup',
method: 'post',
data: data,
timeout: 60000,
});
}
// 班组自动报表分页 // 班组自动报表分页
export function getTeamReportPage(data) { export function getTeamReportPage(data) {
@@ -102,17 +93,3 @@ export function getProcessAutoReportNew(data) {
data: data, data: data,
}); });
} }
export function getPLlistByFactory(data) {
return request({
url: 'base/production-line/listByFactory',
method: 'post',
data: data,
});
}
export function getProcessAutoReportLastGroup(data) {
return request({
url: '/monitoring/production-monitor/getProcessAutoReportLastGroup',
method: 'post',
data: data,
});
}

View File

@@ -141,13 +141,3 @@ export function getPerView(data) {
data:data data:data
}) })
} }
// 导出 Excel
export function exportExcel(query) {
return request({
url: '/base/group-scheduling-plan/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@@ -26,13 +26,6 @@ export function getGroup(id) {
method: 'get' method: 'get'
}) })
} }
// 检查更新-生产班组
export function updateIsProduction(id) {
return request({
url: '/base/group-team/updateIsProduction?id=' + id,
method: 'get'
})
}
// 获得班组基础信息分页 // 获得班组基础信息分页
export function getGroupPage(query) { export function getGroupPage(query) {

View File

@@ -90,29 +90,3 @@ export function getEnableData() {
method: 'get', method: 'get',
}) })
} }
// 解除继承节假日
export function disExtends(data) {
return request({
url: '/base/group-holiday/disExtends',
method: 'post',
data: data
})
}
// 恢复继承节假日
export function reExtends(data) {
return request({
url: '/base/group-holiday/reExtends',
method: 'post',
data: data
})
}
// 获得部门节假日继承设置信息设置
export function getSet(query) {
return request({
url: '/base/group-holiday-dept-set/getSet',
method: 'get',
params: query
})
}

View File

@@ -1,56 +0,0 @@
import request from '@/utils/request'
// 创建能源监控配置
export function getDefectSummaryTable(data) {
return request({
url: '/extend/check-gaozhun-record/defectSummaryTable',
method: 'post',
data: data,
});
}
export function getTranslucentPage(data) {
return request({
url: '/monitoring/translucent/page',
method: 'get',
params: data,
});
}
export function exportTranslucent(data) {
return request({
url: '/monitoring/translucent/export-excel',
method: 'get',
params: data,
responseType: 'blob',
});
}
export function getDefectAnalysis(data) {
return request({
url: '/extend/check-gaozhun-record/defectAnalysis',
method: 'post',
data: data,
});
}
export function getSectionDefect(data) {
return request({
url: '/extend/check-gaozhun-record/sectionDefect',
method: 'post',
data: data,
});
}
export function getDefectSummaryChart(data) {
return request({
url: '/extend/check-gaozhun-record/defectSummaryChart',
method: 'post',
data: data,
});
}
export function getDefectSummaryDet(data) {
return request({
url: '/extend/check-gaozhun-record/defectSummaryDet',
method: 'post',
data: data,
});
}

View File

@@ -1,63 +0,0 @@
/*
* @Author: zhp
* @Date: 2023-12-08 15:26:59
* @LastEditTime: 2023-12-11 15:21:44
* @LastEditors: zhp
* @Description:
*/
import request from '@/utils/request'
export function getQualityIsraPage(query) {
return request({
url: '/extend/check-isra-statistics/getIsraData',
method: 'get',
params: query,
});
}
export function getQualityIsraDayMap(query) {
return request({
url: '/base/quality-isra-statistics/dayMap',
method: 'get',
params: query
})
}
export function getQualityIsraWeekMap(query) {
return request({
url: '/base/quality-isra-statistics/weekMap',
method: 'get',
params: query
})
}
export function getQualityIsraMonthMap(query) {
return request({
url: '/base/quality-isra-statistics/monthMap',
method: 'get',
params: query
})
}
export function getQualityIsraDayList(query) {
return request({
url: '/base/quality-isra-statistics/dayList',
method: 'get',
params: query
})
}
export function getQualityIsraWeekList(query) {
return request({
url: '/base/quality-isra-statistics/weekList',
method: 'get',
params: query
})
}
export function getQualityIsraMonthList(query) {
return request({
url: '/base/quality-isra-statistics/monthList',
method: 'get',
params: query
})
}

View File

@@ -0,0 +1,162 @@
/*
* @Author: zwq
* @Date: 2025-11-17 09:25:12
* @LastEditors: zwq
* @LastEditTime: 2026-01-13 16:13:53
* @Description:
*/
import request from '@/utils/request'
// 获得原料分页
export function getProductPage(query) {
return request({
url: '/wms/material/page',
method: 'get',
params: query
})
}
// 获得所有原料
export function getAllProductPage(query) {
return request({
url: '/wms/material/list/all/code',
method: 'get',
params: query
})
}
// 获得原料
export function getProduct(id) {
return request({
url: '/wms/material/get?id=' + id,
method: 'get'
})
}
// 删除原料
export function deleteProduct(id) {
return request({
url: '/wms/material/delete?id=' + id,
method: 'delete'
})
}
// 更新
export function updateProduct(data) {
return request({
url: '/wms/material/update',
method: 'put',
data: data
})
}
// 创建
export function createProduct(data) {
return request({
url: '/wms/material/create',
method: 'post',
data: data
})
}
// 获得工艺分页
export function getProcessPage(query) {
return request({
url: '/wms/process/page/group/by',
method: 'get',
params: query
})
}
// 获得工艺点击展开表格
export function getProcessDetailPage(query) {
return request({
url: '/wms/process/page/group/by/detail',
method: 'get',
params: query
})
}
// 删除工艺
export function deleteProcess(id) {
return request({
url: '/wms/process/delete?id=' + id,
method: 'delete'
})
}
// 批量删除工艺
export function deleteProcessList(ids) {
return request({
url: '/wms/process/delete-list?ids=' + ids,
method: 'delete'
})
}
// 更新
export function updateProcess(data) {
return request({
url: '/wms/process/update',
method: 'put',
data: data
})
}
// 创建
export function createProcess(data) {
return request({
url: '/wms/process/create',
method: 'post',
data: data
})
}
// 获得工艺
export function getProcess(id) {
return request({
url: '/wms/process/get?id=' + id,
method: 'get'
})
}
// 工艺设备原料分页
export function getProcessMaterialPage(query) {
return request({
url: '/wms/process-equipment-material/page',
method: 'get',
params: query
})
}
// 删除工艺设备原料
export function deleteProcessMaterial(id) {
return request({
url: '/wms/process-equipment-material/delete?id=' + id,
method: 'delete'
})
}
// 更新
export function updateProcessMaterial(data) {
return request({
url: '/wms/process-equipment-material/update',
method: 'put',
data: data
})
}
// 创建
export function createProcessMaterial(data) {
return request({
url: '/wms/process-equipment-material/create',
method: 'post',
data: data
})
}
// 获得工艺
export function getProcessMaterial(id) {
return request({
url: '/wms/process-equipment-material/get?id=' + id,
method: 'get'
})
}
// 获得设备分页
export function getEquipmentPage(query) {
return request({
url: '/wms/equipment/page',
method: 'get',
params: query
})
}

60
src/api/ssdl/taskList.js Normal file
View File

@@ -0,0 +1,60 @@
/*
* @Author: zwq
* @Date: 2025-11-17 09:25:12
* @LastEditors: zwq
* @LastEditTime: 2025-11-18 15:42:19
* @Description:
*/
import request from '@/utils/request'
// 获得任务分页
export function getTaskPage(query) {
return request({
url: '/wms/job-main-task/page',
method: 'get',
params: query
})
}
// 获得任务
export function getTask(id) {
return request({
url: '/wms/job-main-task/get?id=' + id,
method: 'get'
})
}
// 获得任务日志分页
export function getTaskLogPage(query) {
return request({
url: '/wms/job-main-task-log/page',
method: 'get',
params: query
})
}
// 更新
export function updateTask(data) {
return request({
url: '/wms/job-main-task/update',
method: 'put',
data: data
})
}
// 根据区域id获取该区域下的库位信息
export function getRegion(id) {
return request({
url: '/wms/line-edge-library/get-by-region-id?regionId=' + id,
method: 'get'
})
}
// 创建
export function createPCTask(data) {
return request({
url: '/wms/job-main-task/pc-create-task',
method: 'post',
data: data
})
}

View File

@@ -0,0 +1,9 @@
import request from '@/utils/request'
export function getLineEdgeLibraryList(data) {
return request({
url: '/wms/line-edge-library/list',
method: 'get',
params: data,
});
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

BIN
src/assets/img/ABN.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 B

BIN
src/assets/img/ABNScale.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

BIN
src/assets/img/DIS.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 B

BIN
src/assets/img/DISScale.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

BIN
src/assets/img/EP.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

BIN
src/assets/img/EPScale.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

BIN
src/assets/img/FP.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

BIN
src/assets/img/FPScale.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

BIN
src/assets/img/IDL.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 929 B

BIN
src/assets/img/IDLScale.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

BIN
src/assets/img/IT.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

BIN
src/assets/img/ITScale.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

BIN
src/assets/img/LCK.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

BIN
src/assets/img/LCKScale.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

BIN
src/assets/img/OCC.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

BIN
src/assets/img/OCCScale.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

BIN
src/assets/img/RES.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 420 B

BIN
src/assets/img/RESScale.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

BIN
src/assets/img/Top1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
src/assets/img/Top2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
src/assets/img/Top3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
src/assets/img/Top4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
src/assets/img/Top5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
src/assets/img/agvCar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
src/assets/img/chargeBg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

BIN
src/assets/img/recycle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

BIN
src/assets/img/runBg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

View File

@@ -54,7 +54,7 @@ export default {
}; };
}, },
created() { created() {
// this.currentMenu = this.menus[0]; this.currentMenu = this.menus[0];
}, },
watch: { watch: {
currentMenu(val) { currentMenu(val) {

View File

@@ -6,48 +6,104 @@
--> -->
<template> <template>
<el-form ref="form" :model="form" :label-width="`${labelWidth}px`" :size="size" :label-position="labelPosition" <el-form
v-loading="formLoading"> ref="form"
<el-row :gutter="20" v-for="(row, rindex) in rows" :key="rindex"> :model="form"
<el-col v-for="col in row" :key="col.label" :span="24 / row.length"> :label-width="`${labelWidth}px`"
<el-form-item :label="col.label" :prop="col.prop" :rules="col.rules"> :size="size"
<el-input v-if="col.input" v-model="form[col.prop]" @change="$emit('update', form)" :label-position="labelPosition"
:placeholder="`请输入${col.label}`" v-bind="col.bind" /> v-loading="formLoading">
<el-input v-if="col.textarea" type="textarea" v-model="form[col.prop]" @change="$emit('update', form)" <el-row :gutter="20" v-for="(row, rindex) in rows" :key="rindex">
:placeholder="`请输入${col.label}`" v-bind="col.bind" /> <el-col v-for="col in row" :key="col.label" :span="24 / row.length">
<el-select v-if="col.select" v-model="form[col.prop]" :placeholder="`请选择${col.label}`" <el-form-item :label="col.label" :prop="col.prop" :rules="col.rules">
@change="$emit('update', form)" v-bind="col.bind"> <el-input
<el-option v-for="opt in optionListOf[col.prop]" :key="opt.value" :label="opt.label" :value="opt.value" /> v-if="col.input"
</el-select> v-model="form[col.prop]"
<el-date-picker v-if="col.datetime" v-model="form[col.prop]" type="datetime" :placeholder="`请选择${col.label}`" @change="$emit('update', form)"
value-format="timestamp" v-bind="col.bind"></el-date-picker> :placeholder="`请输入${col.label}`"
<el-switch v-if="col.switch" v-model="form[col.prop]" active-color="#0b58ff" inactive-color="#e1e1e1" v-bind="col.bind" />
v-bind="col.bind" @change="handleSwitchChange(col.prop)"></el-switch> <el-input
<component v-if="col.subcomponent" :key="col.key" :is="col.subcomponent" :inlineStyle="col.style"></component> v-if="col.textarea"
type="textarea"
v-model="form[col.prop]"
@change="$emit('update', form)"
:placeholder="`请输入${col.label}`"
v-bind="col.bind" />
<el-select
v-if="col.select"
v-model="form[col.prop]"
:placeholder="`请选择${col.label}`"
@change="$emit('update', form)"
v-bind="col.bind">
<el-option
v-for="opt in optionListOf[col.prop]"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
<el-date-picker
v-if="col.datetime"
v-model="form[col.prop]"
type="datetime"
:placeholder="`请选择${col.label}`"
value-format="timestamp"
v-bind="col.bind"></el-date-picker>
<el-switch
v-if="col.switch"
v-model="form[col.prop]"
active-color="#0b58ff"
inactive-color="#e1e1e1"
v-bind="col.bind"></el-switch>
<component
v-if="col.subcomponent"
:key="col.key"
:is="col.subcomponent"
:inlineStyle="col.style"></component>
<div class="upload-area" :class="uploadOpen ? '' : 'height-48'" ref="uploadArea" v-if="col.upload"> <div
<span class="close-icon" :class="uploadOpen ? 'open' : ''"> class="upload-area"
<el-button type="text" icon="el-icon-arrow-right" @click="handleFilesOpen" /> :class="uploadOpen ? '' : 'height-48'"
</span> ref="uploadArea"
<!-- :file-list="uploadedFileList" --> v-if="col.upload">
<el-upload class="upload-in-dialog" v-if="col.upload" :action="uploadUrl" :headers="uploadHeaders" <span class="close-icon" :class="uploadOpen ? 'open' : ''">
:show-file-list="false" icon="el-icon-upload2" :before-upload="beforeUpload" <el-button
:on-success="handleUploadSuccess" v-bind="col.bind"> type="text"
<el-button size="mini" :disabled="col.bind?.disabled || false"> icon="el-icon-arrow-right"
<svg-icon icon-class="icon-upload" style="color: inherit"></svg-icon> @click="handleFilesOpen" />
上传文件 </span>
</el-button> <!-- :file-list="uploadedFileList" -->
<div class="el-upload__tip" slot="tip" v-if="col.uploadTips"> <el-upload
{{ col.uploadTips || '只能上传jpg/png文件, 大小不超过2MB' }} class="upload-in-dialog"
</div> v-if="col.upload"
</el-upload> :action="uploadUrl"
<uploadedFile class="file" v-for="file in form[col.prop] || []" :file="file" :key="file.fileUrl" :headers="uploadHeaders"
@delete="handleDeleteFile(file)" @Preview="handlePreview(file)" /> :show-file-list="false"
</div> icon="el-icon-upload2"
</el-form-item> :before-upload="beforeUpload"
</el-col> :on-success="handleUploadSuccess"
</el-row> v-bind="col.bind">
</el-form> <el-button size="mini" :disabled="col.bind?.disabled || false">
<svg-icon
icon-class="icon-upload"
style="color: inherit"></svg-icon>
上传文件
</el-button>
<div class="el-upload__tip" slot="tip" v-if="col.uploadTips">
{{ col.uploadTips || '只能上传jpg/png文件, 大小不超过2MB' }}
</div>
</el-upload>
<uploadedFile
class="file"
v-for="file in form[col.prop] || []"
:file="file"
:key="file.fileUrl"
@delete="handleDeleteFile(file)"
@Preview="handlePreview(file)" />
</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template> </template>
<script> <script>
@@ -78,8 +134,7 @@ const uploadedFile = {
data() { data() {
return {}; return {};
}, },
methods: { methods: {
handleDelete() { handleDelete() {
this.$emit('delete', this.file); this.$emit('delete', this.file);
}, },
@@ -196,12 +251,7 @@ export default {
// 处理 options // 处理 options
this.handleOptions(); this.handleOptions();
}, },
methods: { methods: {
handleSwitchChange(prop) {
// 触发 update 事件,将最新的 form 数据传递给父组件
this.$emit('update', { ...this.form });
console.log(`switch ${prop} 变化:`, this.form[prop]);
},
/** 模拟透传 ref */ /** 模拟透传 ref */
validate(cb) { validate(cb) {
return this.$refs.form.validate(cb); return this.$refs.form.validate(cb);

View File

@@ -14,7 +14,12 @@
v-if="collapse" v-if="collapse"
key="collapse" key="collapse"
class="sidebar-logo-link" class="sidebar-logo-link"
to="/"> :to="{
path: '/',
query: {
keyword: 'home',
},
}">
<img v-if="logo" :src="logo" class="sidebar-logo" /> <img v-if="logo" :src="logo" class="sidebar-logo" />
<h1 <h1
v-else v-else
@@ -28,7 +33,16 @@
{{ title }} {{ title }}
</h1> </h1>
</router-link> </router-link>
<router-link v-else key="expand" class="sidebar-logo-link" to="/"> <router-link
v-else
key="expand"
class="sidebar-logo-link"
:to="{
path: '/',
query: {
keyword: 'home',
},
}">
<img v-if="logo" :src="logo" class="sidebar-logo" /> <img v-if="logo" :src="logo" class="sidebar-logo" />
<h1 <h1
class="sidebar-title" class="sidebar-title"

View File

@@ -1,3 +1,10 @@
<!--
* @Author: zwq
* @Date: 2026-01-06 15:18:41
* @LastEditors: zwq
* @LastEditTime: 2026-01-15 09:52:23
* @Description:
-->
<template> <template>
<div v-if="!item.hidden"> <div v-if="!item.hidden">
<template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow"> <template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">

View File

@@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2022-08-24 11:19:43 * @Date: 2022-08-24 11:19:43
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2024-04-02 09:33:29 * @LastEditTime: 2025-11-28 09:35:03
* @Description: * @Description:
*/ */
export default { export default {
@@ -69,7 +69,7 @@ export default {
this.$refs.addOrUpdate.init(val.data.id); this.$refs.addOrUpdate.init(val.data.id);
}); });
} else if (val.type === "delete") { } else if (val.type === "delete") {
this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex) this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex,val.data)
} else { } else {
this.otherMethods(val) this.otherMethods(val)
} }

View File

@@ -1,3 +1,10 @@
/*
* @Author: zwq
* @Date: 2026-01-06 15:18:38
* @LastEditors: zwq
* @LastEditTime: 2026-01-15 09:54:44
* @Description:
*/
import router from './router' import router from './router'
import store from './store' import store from './store'
import { Message } from 'element-ui' import { Message } from 'element-ui'
@@ -9,7 +16,7 @@ import { isRelogin } from '@/utils/request'
NProgress.configure({ showSpinner: false }) NProgress.configure({ showSpinner: false })
// 增加三方登陆 update by 芋艿 // 增加三方登陆 update by 芋艿
const whiteList = ['/login', '/social-login', '/auth-redirect', '/bind', '/register', '/oauthLogin/gitee'] const whiteList = ['/login', '/social-login', 'screenbg', '/auth-redirect', '/bind', '/register', '/oauthLogin/gitee']
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
NProgress.start() NProgress.start()
@@ -17,7 +24,12 @@ router.beforeEach((to, from, next) => {
to.meta.title && store.dispatch('settings/setTitle', to.meta.title) to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
/* has token*/ /* has token*/
if (to.path === '/login') { if (to.path === '/login') {
next({ path: '/' }) next({
path: '/',
query: {
keyword: 'home',
},
})
NProgress.done() NProgress.done()
} else { } else {
if (store.getters.roles.length === 0) { if (store.getters.roles.length === 0) {
@@ -25,9 +37,9 @@ router.beforeEach((to, from, next) => {
// 获取字典数据 add by 芋艿 // 获取字典数据 add by 芋艿
store.dispatch('dict/loadDictDatas') store.dispatch('dict/loadDictDatas')
// 判断当前用户是否已拉取完 user_info 信息 // 判断当前用户是否已拉取完 user_info 信息
store.dispatch('GetInfo').then(() => { store.dispatch('GetInfo').then(userInfo => {
isRelogin.show = false isRelogin.show = false
store.dispatch('GenerateRoutes').then(accessRoutes => { store.dispatch('GenerateRoutes', userInfo.menus).then(accessRoutes => {
// 根据 roles 权限生成可访问的路由表 // 根据 roles 权限生成可访问的路由表
router.addRoutes(accessRoutes) // 动态添加可访问路由表 router.addRoutes(accessRoutes) // 动态添加可访问路由表
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
@@ -35,7 +47,12 @@ router.beforeEach((to, from, next) => {
}).catch(err => { }).catch(err => {
store.dispatch('LogOut').then(() => { store.dispatch('LogOut').then(() => {
Message.error(err) Message.error(err)
next({ path: '/' }) next({
path: '/',
query: {
keyword: 'home',
},
})
}) })
}) })
} else { } else {

View File

@@ -28,223 +28,280 @@ Vue.use(Router)
// 公共路由 // 公共路由
export const constantRoutes = [ export const constantRoutes = [
{ {
path: '/redirect', path: '/redirect',
component: Layout, component: Layout,
hidden: true, hidden: true,
children: [ children: [
{ {
path: '/redirect/:path(.*)', path: '/redirect/:path(.*)',
component: (resolve) => require(['@/views/redirect'], resolve) component: (resolve) => require(['@/views/redirect'], resolve),
} },
] ],
}, },
{ {
path: '/login', path: '/login',
component: (resolve) => require(['@/views/login'], resolve), component: (resolve) => require(['@/views/login'], resolve),
hidden: true // hidden: true,
}, },
{
path: '/sso', {
component: (resolve) => require(['@/views/sso'], resolve), path: '/sso',
hidden: true component: (resolve) => require(['@/views/sso'], resolve),
}, hidden: true,
{ },
path: '/social-login', {
component: (resolve) => require(['@/views/socialLogin'], resolve), path: '/social-login',
hidden: true component: (resolve) => require(['@/views/socialLogin'], resolve),
}, hidden: true,
{ },
path: '/404', {
component: (resolve) => require(['@/views/error/404'], resolve), path: '/404',
hidden: true component: (resolve) => require(['@/views/error/404'], resolve),
}, hidden: true,
{ },
path: '/401', {
component: (resolve) => require(['@/views/error/401'], resolve), path: '/401',
hidden: true component: (resolve) => require(['@/views/error/401'], resolve),
}, hidden: true,
{ },
path: '/print-design', {
component: (resolve) => require(['@/views/print/design'], resolve), path: '/print-design',
hidden: true component: (resolve) => require(['@/views/print/design'], resolve),
}, hidden: true,
{ },
path: "", {
component: Layout, path: '',
redirect: "index", component: Layout,
children: [ redirect: 'index',
{ children: [
path: "index", {
component: (resolve) => require(["@/views/home/index"], resolve), path: 'index',
name: "首页", component: (resolve) => require(['@/views/productionVisualization/equipmentBoard'], resolve),
meta: { title: "首页", icon: "dashboard", affix: true }, name: '首页',
hidden: true meta: { title: '首页', icon: 'dashboard', affix: true },
}, hidden: true,
], },
}, ],
{ props: (route) => ({
path: '/user', keyword: 'home',
component: Layout, })
hidden: true, },
redirect: 'noredirect', {
children: [{ path: '/screenbg',
path: 'profile', component: () =>
component: (resolve) => require(['@/views/system/user/profile/index'], resolve), import(
name: 'Profile', /* webpackChunkName: "about" */ '@/views/productionVisualization/equipmentBoard'
meta: { title: '个人中心', icon: 'user' } ),
}, { name: 'screenbg',
path: 'notify-message', meta: { title: '大屏', icon: 'chart' },
component: (resolve) => require(['@/views/system/notify/my/index'], resolve), },
name: 'MyNotifyMessage', {
meta: { title: '我的站内信', icon: 'message' }, path: '/user',
}] component: Layout,
}, hidden: true,
{ redirect: 'noredirect',
path: '/dict', children: [
component: Layout, {
hidden: true, path: 'profile',
children: [{ component: (resolve) =>
path: 'type/data/:dictId(\\d+)', require(['@/views/system/user/profile/index'], resolve),
component: (resolve) => require(['@/views/system/dict/data'], resolve), name: 'Profile',
name: 'SystemDictData', meta: { title: '个人中心', icon: 'user' },
meta: { title: '字典数据', icon: '', activeMenu: '/system/dict' } },
} {
] path: 'notify-message',
}, component: (resolve) =>
{ require(['@/views/system/notify/my/index'], resolve),
path: '/job', name: 'MyNotifyMessage',
component: Layout, meta: { title: '我的站内信', icon: 'message' },
hidden: true, },
children: [{ ],
path: 'log', },
component: (resolve) => require(['@/views/infra/job/log'], resolve), {
name: 'InfraJobLog', path: '/dict',
meta: { title: '调度日志', activeMenu: '/infra/job' } component: Layout,
} hidden: true,
] children: [
}, { {
path: '/codegen', path: 'type/data/:dictId(\\d+)',
component: Layout, component: (resolve) => require(['@/views/system/dict/data'], resolve),
hidden: true, name: 'SystemDictData',
children: [{ meta: { title: '字典数据', icon: '', activeMenu: '/system/dict' },
path: 'edit/:tableId(\\d+)', },
component: (resolve) => require(['@/views/infra/codegen/editTable'], resolve), ],
name: 'InfraCodegenEditTable', },
meta: { title: '修改生成配置', activeMenu: '/infra/codegen' } {
} path: '/job',
] component: Layout,
}, hidden: true,
{ children: [
path: '/bpm', {
component: Layout, path: 'log',
hidden: true, component: (resolve) => require(['@/views/infra/job/log'], resolve),
redirect: 'noredirect', name: 'InfraJobLog',
children: [{ meta: { title: '调度日志', activeMenu: '/infra/job' },
path: 'oa/leave/create', },
component: (resolve) => require(['@/views/bpm/oa/leave/create'], resolve), ],
name: 'BpmOALeaveCreate', },
meta: { title: '发起 OA 请假', icon: 'form', activeMenu: '/bpm/oa/leave' } {
}, { path: '/codegen',
path: 'oa/leave/detail', component: Layout,
component: (resolve) => require(['@/views/bpm/oa/leave/detail'], resolve), hidden: true,
name: 'BpmOALeaveDetail', children: [
meta: { title: '查看 OA 请假', icon: 'view', activeMenu: '/bpm/oa/leave' } {
} path: 'edit/:tableId(\\d+)',
] component: (resolve) =>
}, require(['@/views/infra/codegen/editTable'], resolve),
{ name: 'InfraCodegenEditTable',
path: '/bpm', meta: { title: '修改生成配置', activeMenu: '/infra/codegen' },
component: Layout, },
hidden: true, ],
children: [{ },
path: 'manager/form/edit', {
component: (resolve) => require(['@/views/bpm/form/formEditor'], resolve), path: '/bpm',
name: 'BpmFormEditor', component: Layout,
meta: { title: '流程表单-编辑', activeMenu: '/bpm/manager/form' } hidden: true,
}, { redirect: 'noredirect',
path: 'manager/definition', children: [
component: (resolve) => require(['@/views/bpm/definition/index'], resolve), {
name: 'BpmProcessDefinition', path: 'oa/leave/create',
meta: { title: '流程定义', activeMenu: '/bpm/manager/model' } component: (resolve) =>
}, { require(['@/views/bpm/oa/leave/create'], resolve),
path: 'manager/model/design', name: 'BpmOALeaveCreate',
component: (resolve) => require(['@/views/bpm/model/modelEditor'], resolve), meta: {
name: 'BpmModelEditor', title: '发起 OA 请假',
meta: { title: '设计流程', activeMenu: '/bpm/manager/model' } icon: 'form',
}, { activeMenu: '/bpm/oa/leave',
path: 'process-instance/create', },
component: (resolve) => require(['@/views/bpm/processInstance/create'], resolve), },
name: 'BpmProcessInstanceCreate', {
meta: { title: '发起流程', activeMenu: '/bpm/task/my' } path: 'oa/leave/detail',
}, { component: (resolve) =>
path: 'process-instance/detail', require(['@/views/bpm/oa/leave/detail'], resolve),
component: (resolve) => require(['@/views/bpm/processInstance/detail'], resolve), name: 'BpmOALeaveDetail',
name: 'BpmProcessInstanceDetail', meta: {
meta: { title: '流程详情', activeMenu: '/bpm/task/my' } title: '查看 OA 请假',
} icon: 'view',
] activeMenu: '/bpm/oa/leave',
}, },
{ },
path: '/property', ],
component: Layout, },
hidden: true, {
children: [{ path: '/bpm',
path: 'value/:propertyId(\\d+)', component: Layout,
component: (resolve) => require(['@/views/mall/product/property/value'], resolve), hidden: true,
name: 'ProductPropertyValue', children: [
meta: { title: '商品属性值', icon: '', activeMenu: '/product/property' } {
} path: 'manager/form/edit',
] component: (resolve) =>
}, require(['@/views/bpm/form/formEditor'], resolve),
{ name: 'BpmFormEditor',
path: '/spu', meta: { title: '流程表单-编辑', activeMenu: '/bpm/manager/form' },
component: Layout, },
hidden: true, {
children: [{ path: 'manager/definition',
path: 'edit/:spuId(\\d+)', component: (resolve) =>
component: (resolve) => require(['@/views/mall/product/spu/save'], resolve), require(['@/views/bpm/definition/index'], resolve),
name: 'ProductSpuUpdate', name: 'BpmProcessDefinition',
meta: { title: '修改商品', activeMenu: '/product/spu' } meta: { title: '流程定义', activeMenu: '/bpm/manager/model' },
}, },
{ {
path: 'add', path: 'manager/model/design',
component: (resolve) => require(['@/views/mall/product/spu/save'], resolve), component: (resolve) =>
name: 'ProductSpuCreate', require(['@/views/bpm/model/modelEditor'], resolve),
meta: { title: '添加商品', activeMenu: '/product/spu' } name: 'BpmModelEditor',
} meta: { title: '设计流程', activeMenu: '/bpm/manager/model' },
] },
}, {
{ path: 'process-instance/create',
path: '/trade/order', component: (resolve) =>
component: Layout, require(['@/views/bpm/processInstance/create'], resolve),
hidden: true, name: 'BpmProcessInstanceCreate',
children: [ meta: { title: '发起流程', activeMenu: '/bpm/task/my' },
{ },
path: 'detail', {
name: 'TradeOrderDetail', path: 'process-instance/detail',
hidden: true, component: (resolve) =>
meta: { title: '订单详情' }, require(['@/views/bpm/processInstance/detail'], resolve),
component: (resolve) => require(['@/views/mall/trade/order/detail'], resolve) name: 'BpmProcessInstanceDetail',
} meta: { title: '流程详情', activeMenu: '/bpm/task/my' },
] },
}, ],
{ },
path: '/pay', {
component: Layout, path: '/property',
hidden: true, component: Layout,
children: [{ hidden: true,
path: 'order/submit', children: [
name: 'PayOrderSubmit', {
hidden: true, path: 'value/:propertyId(\\d+)',
meta: { component: (resolve) =>
title: '收银台', require(['@/views/mall/product/property/value'], resolve),
noCache: true name: 'ProductPropertyValue',
}, meta: {
component: (resolve) => require(['@/views/pay/order/submit'], resolve) title: '商品属性值',
}] icon: '',
} activeMenu: '/product/property',
] },
},
],
},
{
path: '/spu',
component: Layout,
hidden: true,
children: [
{
path: 'edit/:spuId(\\d+)',
component: (resolve) =>
require(['@/views/mall/product/spu/save'], resolve),
name: 'ProductSpuUpdate',
meta: { title: '修改商品', activeMenu: '/product/spu' },
},
{
path: 'add',
component: (resolve) =>
require(['@/views/mall/product/spu/save'], resolve),
name: 'ProductSpuCreate',
meta: { title: '添加商品', activeMenu: '/product/spu' },
},
],
},
{
path: '/trade/order',
component: Layout,
hidden: true,
children: [
{
path: 'detail',
name: 'TradeOrderDetail',
hidden: true,
meta: { title: '订单详情' },
component: (resolve) =>
require(['@/views/mall/trade/order/detail'], resolve),
},
],
},
{
path: '/pay',
component: Layout,
hidden: true,
children: [
{
path: 'order/submit',
name: 'PayOrderSubmit',
hidden: true,
meta: {
title: '收银台',
noCache: true,
},
component: (resolve) => require(['@/views/pay/order/submit'], resolve),
},
],
},
];
// 防止连续点击多次路由报错 // 防止连续点击多次路由报错
let routerPush = Router.prototype.push; let routerPush = Router.prototype.push;

View File

@@ -1,5 +1,4 @@
import {constantRoutes} from '@/router' import {constantRoutes} from '@/router'
import {getRouters} from '@/api/menu'
import Layout from '@/layout/index' import Layout from '@/layout/index'
import ParentView from '@/components/ParentView'; import ParentView from '@/components/ParentView';
import {toCamelCase} from "@/utils"; import {toCamelCase} from "@/utils";
@@ -27,22 +26,25 @@ const permission = {
}, },
}, },
actions: { actions: {
// 生成路由 /**
GenerateRoutes({commit}) { * 生成路由
*
* @param commit commit 函数
* @param menus 路由参数
*/
GenerateRoutes({commit}, menus) {
return new Promise(resolve => { return new Promise(resolve => {
// 向后端请求路由数据(菜单) // 将 menus 菜单,转换为 route 路由数组
getRouters().then(res => { const sdata = JSON.parse(JSON.stringify(menus)) // 【重要】用于菜单中的数据
const sdata = JSON.parse(JSON.stringify(res.data)) // 【重要】用于菜单中的数据 const rdata = JSON.parse(JSON.stringify(menus)) // 用于最后添加到 Router 中的数据
const rdata = JSON.parse(JSON.stringify(res.data)) // 用于最后添加到 Router 中的数据 const sidebarRoutes = filterAsyncRouter(sdata)
const sidebarRoutes = filterAsyncRouter(sdata) const rewriteRoutes = filterAsyncRouter(rdata, false, true)
const rewriteRoutes = filterAsyncRouter(rdata, false, true) rewriteRoutes.push({path: '*', redirect: '/404', hidden: true})
rewriteRoutes.push({path: '*', redirect: '/404', hidden: true}) commit('SET_ROUTES', rewriteRoutes)
commit('SET_ROUTES', rewriteRoutes) commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes))
commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes)) commit('SET_DEFAULT_ROUTES', sidebarRoutes)
commit('SET_DEFAULT_ROUTES', sidebarRoutes) commit('SET_TOPBAR_ROUTES', sidebarRoutes)
commit('SET_TOPBAR_ROUTES', sidebarRoutes) resolve(rewriteRoutes)
resolve(rewriteRoutes)
})
}) })
} }
} }

View File

@@ -1,10 +1,10 @@
import axios from 'axios' import axios from 'axios'
import { Message, MessageBox, Notification, Loading } from 'element-ui' import {Message, MessageBox, Notification, Loading} from 'element-ui'
import store from '@/store' import store from '@/store'
import { getAccessToken, getRefreshToken, getTenantId, setToken } from '@/utils/auth' import {getAccessToken, getRefreshToken, getTenantId, setToken} from '@/utils/auth'
import errorCode from '@/utils/errorCode' import errorCode from '@/utils/errorCode'
import { getPath, getTenantEnable } from "@/utils/ruoyi"; import {getPath, getTenantEnable} from "@/utils/ruoyi";
import { refreshToken } from "@/api/login"; import {refreshToken} from "@/api/login";
// 需要忽略的提示。忽略后,自动 Promise.reject('error') // 需要忽略的提示。忽略后,自动 Promise.reject('error')
const ignoreMsgs = [ const ignoreMsgs = [
@@ -86,7 +86,7 @@ service.interceptors.request.use(config => {
for (const propName of Object.keys(config.params)) { for (const propName of Object.keys(config.params)) {
const value = config.params[propName]; const value = config.params[propName];
const part = encodeURIComponent(propName) + '=' const part = encodeURIComponent(propName) + '='
if (value !== null && typeof (value) !== "undefined") { if (value !== null && typeof(value) !== "undefined") {
if (typeof value === 'object') { if (typeof value === 'object') {
for (const key of Object.keys(value)) { for (const key of Object.keys(value)) {
let params = propName + '[' + key + ']'; let params = propName + '[' + key + ']';
@@ -104,9 +104,9 @@ service.interceptors.request.use(config => {
} }
return config return config
}, error => { }, error => {
tryHideFullScreenLoading() tryHideFullScreenLoading()
console.log(error) console.log(error)
Promise.reject(error) Promise.reject(error)
}) })
// 响应拦截器 // 响应拦截器
@@ -176,38 +176,36 @@ service.interceptors.response.use(async res => {
+ '<div>5 分钟搭建本地环境</div>', + '<div>5 分钟搭建本地环境</div>',
}) })
return Promise.reject(new Error(msg)) return Promise.reject(new Error(msg))
} else if (code === 400) {
//【班组管理】【排班计划】提交的校验按照原型图补充完整,排班计划是否重叠code400 有两个不同的返回信息
return res.data
} else if (code !== 200) { } else if (code !== 200) {
if (msg === '无效的刷新令牌') { // hard coding忽略这个提示直接登出 if (msg === '无效的刷新令牌') { // hard coding忽略这个提示直接登出
console.log(msg) console.log(msg)
} else { } else {
//【班组管理】【排班计划】提交的校验按照原型图补充完整,排班计划是否重叠code400 有两个不同的返回信息 Notification.error({
return res.data title: msg
})
} }
return Promise.reject('error') return Promise.reject('error')
} else { } else {
return res.data return res.data
} }
}, error => { }, error => {
tryHideFullScreenLoading() tryHideFullScreenLoading()
console.log('err' + error) console.log('err' + error)
let { message } = error; let {message} = error;
if (message === "Network Error") { if (message === "Network Error") {
message = "后端接口连接异常"; message = "后端接口连接异常";
} else if (message.includes("timeout")) { } else if (message.includes("timeout")) {
message = "系统接口请求超时"; message = "系统接口请求超时";
} else if (message.includes("Request failed with status code")) { } else if (message.includes("Request failed with status code")) {
message = "系统接口" + message.substr(message.length - 3) + "异常"; message = "系统接口" + message.substr(message.length - 3) + "异常";
}
Message({
message: message,
type: 'error',
duration: 5 * 1000
})
return Promise.reject(error)
} }
Message({
message: message,
type: 'error',
duration: 5 * 1000
})
return Promise.reject(error)
}
) )
export function getBaseHeader() { export function getBaseHeader() {
@@ -221,10 +219,10 @@ function handleAuthorized() {
if (!isRelogin.show) { if (!isRelogin.show) {
isRelogin.show = true; isRelogin.show = true;
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
confirmButtonText: '重新登录', confirmButtonText: '重新登录',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
} }
).then(() => { ).then(() => {
isRelogin.show = false; isRelogin.show = false;
store.dispatch('LogOut').then(() => { store.dispatch('LogOut').then(() => {

View File

@@ -0,0 +1,81 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2025-11-28 14:38:31
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="物料编码" prop="materialCode">
<el-input
v-model="dataForm.materialCode"
clearable
placeholder="请输入物料编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物料型号" prop="materialName">
<el-input
v-model="dataForm.materialName"
clearable
placeholder="请输入物料型号" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="物料规格" prop="material">
<el-input
v-model="dataForm.material"
clearable
placeholder="请输入物料规格" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '@/mixins/basic-add';
import { createProduct, updateProduct,getProduct } from '@/api/ssdl/product&recipe';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
createURL: createProduct,
updateURL: updateProduct,
infoURL: getProduct,
},
dataForm: {
id: undefined,
material: undefined,
materialName: undefined,
materialCode: undefined,
},
typeArr: [],
dataRule: {
materialCode: [
{ required: true, message: '物料编码不能为空', trigger: 'blur' },
],
materialName: [
{ required: true, message: '物料型号不能为空', trigger: 'blur' },
],
material: [
{ required: true, message: '规格不能为空', trigger: 'blur' },
],
},
};
},
methods: {},
};
</script>

View File

@@ -0,0 +1,62 @@
<!--
* @Author: zwq
* @Date: 2025-10-11 14:41:12
* @LastEditors: zwq
* @LastEditTime: 2026-01-14 14:15:47
* @Description:
-->
<template>
<el-switch
@change="changeStatus"
size="small"
v-model="injectData.laneState"
:active-value="1"
:inactive-value="2"></el-switch>
</template>
<script>
import { updateLane } from '@/api/areavisual/lane';
export default {
props: {
injectData: {
type: Object,
default: () => ({}),
},
},
data() {
return {};
},
created() {},
methods: {
changeStatus(val) {
const pdata = { ...this.injectData, laneState: val };
this.$confirm(
`是否确认修改${'巷道 [ ' + this.injectData.laneName + ' ] '}的状态?`,
'更新状态',
{
confirmButtonText: '确认修改',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
updateLane(pdata).then((res) => {
if (res.code === 0 || res.code === 200) {
this.$modal.msgSuccess('修改成功');
this.$emit('emitData');
} else {
this.$modal.msg(res.msg);
}
});
})
.catch((res) => {
this.$emit('emitData');
this.$message({
type: 'info',
message: '已取消',
});
});
},
},
};
</script>

View File

@@ -0,0 +1,191 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData"
@emitFun="getDataList">
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '@/mixins/basic-page';
import { parseTime } from '@/filter/code-filter';
import { deleteLane, getLanePage } from '@/api/areavisual/lane';
import changeStatus from './changeStatus.vue';
const lane = [
{
id: '1',
name: 'A巷道',
},
{
id: '2',
name: 'B巷道',
},
{
id: '3',
name: 'C巷道',
},
{
id: '4',
name: 'D巷道',
},
{
id: '5',
name: 'E巷道',
},
{
id: '6',
name: 'F巷道',
},
];
const tableProps = [
{
prop: 'laneCode',
label: '巷道编码',
},
{
prop: 'laneName',
label: '巷道名称',
},
{
prop: 'lane',
label: '巷道',
filter: (val) => {
return lane.find((i) => i.id == val)
? lane.find((i) => i.id == val).name
: '-';
},
},
{
prop: 'laneSort',
label: '巷道排序',
width:90,
},
{
prop: 'laneState',
label: '巷道状态',
width:90,
subcomponent: changeStatus,
},
{
prop: 'createTime',
label: '创建时间',
filter: parseTime,
width: 150,
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getLanePage,
deleteURL: deleteLane,
},
tableProps,
tableBtn: [
{
type: 'edit',
btnName: '编辑',
},
{
type: 'delete',
btnName: '删除',
},
].filter((v) => v),
tableData: [],
formConfig: [
{
type: 'input',
label: '名称',
placeholder: '名称',
param: 'name',
},
{
type: 'input',
label: '编码',
placeholder: '编码',
param: 'code',
},
{
type: 'select',
label: '巷道',
selectOptions: lane,
placeholder: '请选择巷道',
param: 'lane',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 20;
this.listQuery.laneName = val.name;
this.listQuery.laneCode = val.code;
this.listQuery.lane = val.lane;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 20,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@@ -0,0 +1,324 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2026-01-15 09:16:36
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px">
<div class="stat-card">
<div class="stat-icon">
<i class="el-icon-s-grid" style="color: #fff"></i>
</div>
<div class="stat-title">库位信息</div>
<div class="stat-content">
<div class="stat-value">{{ lineInfo.lineEdgeLibraryCode }}</div>
<div class="stat-label">{{ lineInfo.lineEdgeLibraryName }}</div>
</div>
</div>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="物料" prop="materialId">
<el-select
style="width: 100%"
v-model="dataForm.materialId"
filterable
@change="setMaterial"
placeholder="请选择物料">
<el-option
v-for="item in productArr"
:key="item.id"
:label="
item.materialCode +
'-' +
item.materialName +
'-' +
item.material
"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="本盘长度" prop="cableLength">
<el-input-number
v-model="dataForm.cableLength"
:min="0"
:precision="2"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="设备" prop="equipmentId">
<el-select
v-model="dataForm.equipmentId"
@change="setEquipment"
placeholder="请选择绞体">
<el-option
v-for="item in options1"
:key="item.id"
:label="item.equipmentName"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="应用套号" prop="suite">
<el-select v-model="dataForm.suite" placeholder="请选择应用套号">
<el-option
v-for="item in options2"
:key="item.value"
:label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<span v-if="dataForm.suite == 2">
<el-col :span="8">
<el-form-item label="选择套号" prop="time">
<el-date-picker
v-model="dataForm.time"
value-format="yyyy-MM-dd"
type="date"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="" prop="productionLine">
<el-select v-model="dataForm.productionLine">
<el-option
v-for="item in options3"
:key="item.value"
:label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="" prop="numb">
<el-select v-model="dataForm.numb">
<el-option
v-for="item in options4"
:key="item.value"
:label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
</span>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '@/mixins/basic-add';
import { getAllProductPage } from '@/api/ssdl/product&recipe';
import {
QKLineEdgeLibrary,
getEquipmentPage,
} from '@/api/areavisual/lineEdgeLibrary';
import { parseTime } from '@/filter/code-filter';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
createURL: QKLineEdgeLibrary,
},
dataForm: {
id: undefined,
materialId: undefined,
materialName: undefined,
materialCode: undefined,
material: undefined,
cableLength: undefined,
equipmentId: undefined,
equipmentName: undefined,
suite: undefined, //是否成套
suiteCode: undefined, //套号
time: this.parseTime(new Date(), '{y}-{m}-{d}'),
productionLine: undefined,
numb: undefined,
},
lineInfo: {},
productArr: [],
options1: [],
options2: [
{
value: 2,
label: '是',
},
{
value: 1,
label: '否',
},
],
options3: [
{
value: '6#',
label: '6#',
},
{
value: '7#',
label: '7#',
},
{
value: '8#',
label: '8#',
},
],
options4: [
{
value: 0,
label: '0',
},
{
value: 1,
label: '1',
},
{
value: 2,
label: '2',
},
{
value: 3,
label: '3',
},
{
value: 4,
label: '4',
},
{
value: 5,
label: '5',
},
{
value: 6,
label: '6',
},
],
dataRule: {
materialId: [
{ required: true, message: '物料不能为空', trigger: 'change' },
],
time: [{ required: true, message: '不能为空', trigger: 'change' }],
productionLine: [
{ required: true, message: '不能为空', trigger: 'change' },
],
numb: [{ required: true, message: '不能为空', trigger: 'change' }],
},
};
},
methods: {
showLine(val) {
getAllProductPage().then((res) => {
this.productArr = res.data;
});
getEquipmentPage({ pageNo: 1, pageSize: 100, equipmentType: 2 }).then(
(res) => {
this.options1 = res.data.list;
}
);
this.lineInfo = { ...val };
},
setMaterial() {
const data = this.productArr.find(
(i) => i.id === this.dataForm.materialId
);
this.dataForm.materialName = data.materialName;
this.dataForm.material = data.material;
this.dataForm.materialCode = data.materialCode;
},
setEquipment() {
const data = this.options1.find(
(i) => i.id === this.dataForm.equipmentId
);
this.dataForm.equipmentName = data.equipmentName;
},
// 表单提交
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false;
}
if (this.dataForm.suite == 2) {
this.dataForm.suiteCode =
this.dataForm.time +
'-' +
this.dataForm.productionLine +
'-' +
this.dataForm.numb;
}
QKLineEdgeLibrary({
...this.lineInfo,
...this.dataForm,
lineEdgeLibraryState: 1,
id: this.lineInfo.id,
}).then((response) => {
this.$modal.msgSuccess('操作成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
});
},
},
};
</script>
<style scoped>
.stat-card {
display: flex;
align-items: center;
padding: 10px;
background: white;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease;
border-left: 4px solid;
border-color: #1a56db;
margin-bottom: 30px;
}
/* .stat-card:hover {
transform: translateY(-5px);
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
} */
.stat-title {
margin: 0 10px;
color: #0051ff;
font-size: 20px;
}
.stat-icon {
display: flex;
align-items: center;
justify-content: center;
width: 60px;
height: 60px;
border-radius: 12px;
margin-right: 15px;
background: linear-gradient(to right, #1a56db, #0d47a1);
}
.stat-content {
display: flex;
flex-direction: column;
}
.stat-value {
font-size: 28px;
font-weight: 700;
line-height: 1.2;
color: #1a56db;
}
.stat-label {
font-size: 14px;
color: #64748b;
}
</style>

View File

@@ -0,0 +1,318 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData"
@emitFun="getDataList">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="110"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
destroy-on-close
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '@/mixins/basic-page';
import { parseTime } from '@/filter/code-filter';
import {
deleteLineEdgeLibrary,
getLineEdgeLibraryPage,
QKLineEdgeLibrary,
} from '@/api/areavisual/lineEdgeLibrary';
const laneRow = [
{
id: '1',
name: '第一排',
},
{
id: '2',
name: '第二排',
},
{
id: '3',
name: '第三排',
},
{
id: '4',
name: '第四排',
},
{
id: '5',
name: '第五排',
},
{
id: '6',
name: '第六排',
},
];
const tableProps = [
{
prop: 'lineEdgeLibraryCode',
label: '线边库编码',
},
{
prop: 'lineEdgeLibraryName',
label: '线边库名称',
},
{
prop: 'agvGroundCode',
label: 'agv码',
},
{
prop: 'lineEdgeLibraryState',
label: '线边库状态',
width: 90,
filter: (val) => {
return val ? '满位' : '空闲';
},
},
{
prop: 'usableState',
label: '是否可用',
width: 90,
filter: (val) => {
return ['', '可用', '不可用', '锁定'][val];
},
},
{
prop: 'trayType',
label: '托盘类型',
width: 90,
filter: (val) => {
return val ? '笼式' : '盘式';
},
},
{
prop: 'productionLine',
label: '产线',
},
{
prop: 'equipmentName',
label: '设备',
},
{
prop: 'suiteCode',
label: '套号',
},
{
prop: 'laneRow',
label: '巷道排',
filter: (val) => {
return laneRow.find((i) => i.id == val)
? laneRow.find((i) => i.id == val).name
: '-';
},
},
{
prop: 'materialCode',
label: '物料',
},
{
prop: 'batch',
label: '批次',
},
{
prop: 'cableLength',
label: '线缆长度',
},
{
prop: 'createTime',
label: '创建时间',
filter: parseTime,
width: 150,
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getLineEdgeLibraryPage,
deleteURL: deleteLineEdgeLibrary,
},
tableProps,
tableData: [],
tableBtn: [
{
type: 'clear',
btnName: '清空',
},
{
type: 'add',
btnName: '添加',
},
].filter((v) => v),
formConfig: [
{
type: 'input',
label: '线边库名称',
placeholder: '线边库名称',
param: 'name',
},
{
type: 'input',
label: '线边库编码',
placeholder: '线边库编码',
param: 'code',
},
{
type: 'select',
label: '巷道排',
selectOptions: laneRow,
placeholder: '请选择巷道排',
param: 'laneRow',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
// {
// type: 'separate',
// },
// {
// type: 'button',
// btnName: '重置',
// name: 'reset',
// },
// {
// type: 'separate',
// },
// {
// type: 'button',
// btnName: '新增',
// name: 'add',
// color: 'success',
// plain: true,
// },
// {
// type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
// },
// {
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
// btnName: '导出',
// name: 'export',
// color: 'warning',
// },
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 20;
this.listQuery.lineEdgeLibraryName = val.name;
this.listQuery.lineEdgeLibraryCode = val.code;
this.listQuery.laneRow = val.laneRow;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 20,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
otherMethods(val) {
if (val.type == 'clear') {
if (val.data.usableState == 3) {
this.$confirm(
`当前库位为锁定状态,代表该库位有未完成的任务关联,是否确认清空${
'线边库名称为 ' + val.data.lineEdgeLibraryName + ' '
}的数据项?`,
'锁定库位清空提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
QKLineEdgeLibrary({...val.data,lineEdgeLibraryState:0,usableState:1 }).then(({ data }) => {
this.$message({
message: data,
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => {});
} else {
QKLineEdgeLibrary({...val.data,lineEdgeLibraryState:0,usableState:1 }).then(({ data }) => {
this.$message({
message: data,
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
}
} else if (val.type === 'add') {
this.addOrEditTitle = '添加货物';
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init();
this.$refs.addOrUpdate.showLine(val.data);
});
}
},
},
};
</script>

View File

@@ -0,0 +1,324 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2026-01-15 09:16:36
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px">
<div class="stat-card">
<div class="stat-icon">
<i class="el-icon-s-grid" style="color: #fff"></i>
</div>
<div class="stat-title">库位信息</div>
<div class="stat-content">
<div class="stat-value">{{ lineInfo.lineEdgeLibraryCode }}</div>
<div class="stat-label">{{ lineInfo.lineEdgeLibraryName }}</div>
</div>
</div>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="物料" prop="materialId">
<el-select
style="width: 100%"
v-model="dataForm.materialId"
filterable
@change="setMaterial"
placeholder="请选择物料">
<el-option
v-for="item in productArr"
:key="item.id"
:label="
item.materialCode +
'-' +
item.materialName +
'-' +
item.material
"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="本盘长度" prop="cableLength">
<el-input-number
v-model="dataForm.cableLength"
:min="0"
:precision="2"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="设备" prop="equipmentId">
<el-select
v-model="dataForm.equipmentId"
@change="setEquipment"
placeholder="请选择绞体">
<el-option
v-for="item in options1"
:key="item.id"
:label="item.equipmentName"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="应用套号" prop="suite">
<el-select v-model="dataForm.suite" placeholder="请选择应用套号">
<el-option
v-for="item in options2"
:key="item.value"
:label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<span v-if="dataForm.suite == 2">
<el-col :span="8">
<el-form-item label="选择套号" prop="time">
<el-date-picker
v-model="dataForm.time"
value-format="yyyy-MM-dd"
type="date"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="" prop="productionLine">
<el-select v-model="dataForm.productionLine">
<el-option
v-for="item in options3"
:key="item.value"
:label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="" prop="numb">
<el-select v-model="dataForm.numb">
<el-option
v-for="item in options4"
:key="item.value"
:label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
</span>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '@/mixins/basic-add';
import { getAllProductPage } from '@/api/ssdl/product&recipe';
import {
QKLineEdgeLibrary,
getEquipmentPage,
} from '@/api/areavisual/lineEdgeLibrary';
import { parseTime } from '@/filter/code-filter';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
createURL: QKLineEdgeLibrary,
},
dataForm: {
id: undefined,
materialId: undefined,
materialName: undefined,
materialCode: undefined,
material: undefined,
cableLength: undefined,
equipmentId: undefined,
equipmentName: undefined,
suite: undefined, //是否成套
suiteCode: undefined, //套号
time: this.parseTime(new Date(), '{y}-{m}-{d}'),
productionLine: undefined,
numb: undefined,
},
lineInfo: {},
productArr: [],
options1: [],
options2: [
{
value: 2,
label: '是',
},
{
value: 1,
label: '否',
},
],
options3: [
{
value: '6#',
label: '6#',
},
{
value: '7#',
label: '7#',
},
{
value: '8#',
label: '8#',
},
],
options4: [
{
value: 0,
label: '0',
},
{
value: 1,
label: '1',
},
{
value: 2,
label: '2',
},
{
value: 3,
label: '3',
},
{
value: 4,
label: '4',
},
{
value: 5,
label: '5',
},
{
value: 6,
label: '6',
},
],
dataRule: {
materialId: [
{ required: true, message: '物料不能为空', trigger: 'change' },
],
time: [{ required: true, message: '不能为空', trigger: 'change' }],
productionLine: [
{ required: true, message: '不能为空', trigger: 'change' },
],
numb: [{ required: true, message: '不能为空', trigger: 'change' }],
},
};
},
methods: {
showLine(val) {
getAllProductPage().then((res) => {
this.productArr = res.data;
});
getEquipmentPage({ pageNo: 1, pageSize: 100, equipmentType: 2 }).then(
(res) => {
this.options1 = res.data.list;
}
);
this.lineInfo = { ...val };
},
setMaterial() {
const data = this.productArr.find(
(i) => i.id === this.dataForm.materialId
);
this.dataForm.materialName = data.materialName;
this.dataForm.material = data.material;
this.dataForm.materialCode = data.materialCode;
},
setEquipment() {
const data = this.options1.find(
(i) => i.id === this.dataForm.equipmentId
);
this.dataForm.equipmentName = data.equipmentName;
},
// 表单提交
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false;
}
if (this.dataForm.suite == 2) {
this.dataForm.suiteCode =
this.dataForm.time +
'-' +
this.dataForm.productionLine +
'-' +
this.dataForm.numb;
}
QKLineEdgeLibrary({
...this.lineInfo,
...this.dataForm,
lineEdgeLibraryState: 1,
id: this.lineInfo.id,
}).then((response) => {
this.$modal.msgSuccess('操作成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
});
},
},
};
</script>
<style scoped>
.stat-card {
display: flex;
align-items: center;
padding: 10px;
background: white;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease;
border-left: 4px solid;
border-color: #1a56db;
margin-bottom: 30px;
}
/* .stat-card:hover {
transform: translateY(-5px);
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
} */
.stat-title {
margin: 0 10px;
color: #0051ff;
font-size: 20px;
}
.stat-icon {
display: flex;
align-items: center;
justify-content: center;
width: 60px;
height: 60px;
border-radius: 12px;
margin-right: 15px;
background: linear-gradient(to right, #1a56db, #0d47a1);
}
.stat-content {
display: flex;
flex-direction: column;
}
.stat-value {
font-size: 28px;
font-weight: 700;
line-height: 1.2;
color: #1a56db;
}
.stat-label {
font-size: 14px;
color: #64748b;
}
</style>

View File

@@ -0,0 +1,125 @@
<template>
<div
:class="className"
:style="{ height: height, width: width, marginLeft: '10px' }" />
</template>
<script>
import * as echarts from 'echarts';
require('echarts/theme/macarons'); // echarts theme
import resize from '@/utils/chartMixins/resize';
const animationDuration = 1000;
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart',
},
title: {
type: String,
default: '',
},
width: {
type: String,
default: '100%',
},
height: {
type: String,
default: '300px',
},
ringData: {
type: Object,
default: () => {},
},
},
data() {
return {
chart: null,
targetId: '',
};
},
beforeDestroy() {
if (!this.chart) {
return;
}
this.chart.dispose();
this.chart = null;
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons');
const _this = this;
this.chart.setOption({
title: {
text: this.title
? '{space|}{tip|}{space|}{value|' + this.title + '}'
: '',
textStyle: {
rich: {
tip: {
width: 6,
height: 6,
borderRadius: 50,
backgroundColor: '#288AFF',
},
space: {
width: 8,
},
value: {
fontSize: 14,
color: 'black',
},
},
},
},
color: ['#33B36B', '#3A8DFF', '#F59A23'],
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999',
},
},
},
legend: {
data: ['当前满位', '当前空位', '在途'],
},
grid: {
containLabel: true,
},
series: [
{
// name: '投入',
type: 'pie',
radius: '50%',
data: [
{
name: '当前满位',
value: this.ringData.occupiedQuantity
},
{
name: '当前空位',
value: this.ringData.idleQuantity
},
{
name: '在途',
value: this.ringData.transitQuantity
},
],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
],
});
},
},
};
</script>

View File

@@ -0,0 +1,665 @@
<template>
<div class="app-container">
<el-row class="overview-container">
<el-col :span="4" class="overview-container-left">
<el-row style="font-size: 18px; font-weight: bold; line-height: 36px">
库区选择
</el-row>
<el-input
v-model="areaSearchForm.regionName"
placeholder="库区名称"
@blur="getArea"
clearable />
<el-tree
:data="areaList"
:node-key="'id'"
:props="{ label: 'regionName' }"
@node-click="nodeClick" />
</el-col>
<el-col
:span="16"
v-if="changeType === 0"
class="overview-container-main">
<el-row>
<el-col
:span="8"
class="allarea-box"
v-for="item in allAreaList"
:key="item.id">
<div class="areainfo-box">
<div class="areainfo-box-header">
{{ item.regionName }}
</div>
<div class="areainfo-box-line">
<div
class="areainfo-box-line-item"
:style="{
width: `${(
(item.occupiedQuantity /
(item.totalInventory + item.transitQuantity)) *
100
).toFixed(2)}%`,
backgroundColor: '#33B36B',
}"></div>
<div
class="areainfo-box-line-item"
:style="{
width: `${(
(item.idleQuantity /
(item.totalInventory + item.transitQuantity)) *
100
).toFixed(2)}%`,
backgroundColor: '#3A8DFF',
}"></div>
<div
class="areainfo-box-line-item"
:style="{
width: `${(
(item.transitQuantity /
(item.totalInventory + item.transitQuantity)) *
100
).toFixed(2)}%`,
backgroundColor: '#F59A23',
}"></div>
</div>
<el-row class="areainfo-box-info">
<el-col class="areainfo-box-info-item" :span="6">
<p class="areainfo-box-info-item-count">
{{ item.totalInventory }}
</p>
<p class="areainfo-box-info-item-title">库位总数</p>
</el-col>
<el-col class="areainfo-box-info-item" :span="6">
<p
class="areainfo-box-info-item-count"
style="color: #33b36b">
{{ item.occupiedQuantity }}
</p>
<p class="areainfo-box-info-item-title"></p>
</el-col>
<el-col class="areainfo-box-info-item" :span="6">
<p
class="areainfo-box-info-item-count"
style="color: #3a8dff">
{{ item.idleQuantity }}
</p>
<p class="areainfo-box-info-item-title"></p>
</el-col>
<el-col class="areainfo-box-info-item" :span="6">
<p
class="areainfo-box-info-item-count"
style="color: #f59a23">
{{ item.transitQuantity }}
</p>
<p class="areainfo-box-info-item-title">在途</p>
</el-col>
</el-row>
</div>
</el-col>
</el-row>
</el-col>
<el-col
:span="4"
v-if="changeType === 0"
class="overview-container-right">
<el-tabs v-model="activeName" @tab-click="handleClickRight">
<el-tab-pane label="概览" name="first">
<el-row class="overview-container-right-alloverview">
<el-col
class="overview-container-right-alloverview-item"
:span="8">
<p class="overview-container-right-alloverview-item-count">
{{ allAreaInfo.totalInventory }}
</p>
<p class="overview-container-right-alloverview-item-title">
库位总数
</p>
</el-col>
<el-col
class="overview-container-right-alloverview-item"
:span="8">
<p class="overview-container-right-alloverview-item-count">
{{ allAreaInfo.occupiedQuantity }}
</p>
<p class="overview-container-right-alloverview-item-title">
当前满位
</p>
</el-col>
<el-col
class="overview-container-right-alloverview-item"
:span="8">
<p class="overview-container-right-alloverview-item-count">
{{ allAreaInfo.idleQuantity }}
</p>
<p class="overview-container-right-alloverview-item-title">
当前空位
</p>
</el-col>
<el-col
class="overview-container-right-alloverview-item"
:span="8">
<p class="overview-container-right-alloverview-item-count">
{{ allAreaInfo.transitQuantity }}
</p>
<p class="overview-container-right-alloverview-item-title">
在途
</p>
</el-col>
</el-row>
<ringChart :ring-data="allAreaInfo" ref="ringChart" />
</el-tab-pane>
<el-tab-pane label="在途任务" name="second">在途任务</el-tab-pane>
</el-tabs>
</el-col>
<el-col
:span="20"
v-if="changeType === 1"
class="overview-container-main">
<div class="stat-card">
<div class="stat-icon">
<i class="el-icon-s-grid" style="color: #fff"></i>
</div>
<div class="stat-title">库区信息</div>
<div class="stat-content">
<div class="stat-value">{{ getAreaInfoInfo.regionName }}</div>
<div class="stat-label">{{ getAreaInfoInfo.regionCode }}</div>
</div>
</div>
<div class="area-body">
<div v-for="item in Object.keys(areaInfo)" :key="item">
<div class="potTitle">{{ item }}</div>
<div class="potList">
<div v-for="sitem in areaInfo[item]" :key="sitem.id">
<div v-if="sitem.empty" class="area-div-empty" />
<div v-else class="area-div" :title="sitem.lineEdgeLibraryName">
<el-popover
placement="top-start"
:title="sitem.lineEdgeLibraryCode"
width="200"
trigger="hover">
<div class="point" />
<span style="font-weight: 600">名称:</span>
{{ sitem.lineEdgeLibraryName }}
<br />
<div class="point" />
<span style="font-weight: 600">状态:</span>
{{
sitem.usableState == 3
? '锁定'
: sitem.usableState == 2
? '不可用'
: sitem.lineEdgeLibraryState == 1
? '满位'
: '空闲'
}}
<br />
<span
v-if="
sitem.usableState == 1 &&
sitem.lineEdgeLibraryState == 1
">
<span style="font-weight: 600">物料:</span>
{{ sitem.materialCode || '' }}
<br />
<span style="font-weight: 600">设备:</span>
{{ sitem.equipmentName || '' }}
<br />
<span style="font-weight: 600">套号:</span>
{{ sitem.suiteCode || '' }}
<br />
</span>
<el-button type="text" @click="clearLine(sitem)">
清空
</el-button>
<el-button type="text" @click="addLine(sitem)">
添加
</el-button>
<div
class="area-icon"
:style="{
backgroundColor:
sitem.usableState == 3
? '#E6A23C'
: sitem.usableState == 2
? 'gray'
: sitem.lineEdgeLibraryState == 1
? '#67C23A'
: '',
}"
slot="reference">
<i
:class="
sitem.usableState == 3
? 'el-icon-lock'
: 'el-icon-s-grid'
"
style="color: #fff"></i>
</div>
</el-popover>
</div>
</div>
</div>
</div>
</div>
</el-col>
</el-row>
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
destroy-on-close
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
// import basicPage from '@/mixins/basic-page';
import ringChart from './components/ringChart.vue';
import AddOrUpdate from './components/add-or-updata';
import basicPage from '@/mixins/basic-page';
import {
getAreaList,
postAllAreaInfo,
postAllAreaOverview,
postAreaInfo,
} from '@/api/areavisual/overview';
import { QKLineEdgeLibrary } from '@/api/areavisual/lineEdgeLibrary';
export default {
name: 'overview',
mixins: [basicPage],
data() {
return {
areaList: [
{
id: 0,
regionName: '全部库区',
},
],
areaSearchForm: {
pageNo: 1,
pageSize: 100,
regionName: '',
},
changeType: 0,
allAreaList: [],
allAreaInfo: {
totalInventory: 0,
occupiedQuantity: 0,
idleQuantity: 0,
transitQuantity: 0,
},
areaInfo: {},
activeName: 'first',
getAreaInfoInfo: {},
};
},
components: {
ringChart,
AddOrUpdate,
},
async created() {
this.getArea();
this.getAllAreaInfo();
this.getAllAreaOverview();
},
watch: {
activeName: (val) => {
if (val === 'first') {
this.getAllAreaOverview();
} else if (val === 'second') {
this.getNowTaskList();
}
},
},
methods: {
// 获取库区列表
async getArea() {
const res = await getAreaList(this.areaSearchForm);
if (res.code === 0 && res.data) {
(this.areaList = [
{
id: 0,
regionName: '全部库区',
},
]),
this.areaList.push(...res.data.list);
}
},
// 库区选择
nodeClick(data, node, components) {
if (data.id === 0) {
this.changeType = 0;
this.activeName = 'first';
this.getAllAreaInfo();
} else {
this.getAreaInfoInfo = data; //把库区存下,方便刷新
this.changeType = 1;
this.getAreaInfo(data.id);
}
},
// 获取全部库区概览信息
async getAllAreaInfo() {
const res = await postAllAreaInfo([]);
console.log(res);
if (res.code === 0 && res.data) {
this.allAreaList = res.data;
}
},
// 获取库区概览
async getAllAreaOverview() {
const res = await postAllAreaOverview([]);
console.log(res);
if (res.code === 0 && res.data) {
this.allAreaInfo = res.data;
this.$refs.ringChart.initChart();
}
},
// 获取在途任务
async getNowTaskList() {},
// 获取单库区信息
async getAreaInfo(id) {
const res = await postAreaInfo({ id });
if (res.code === 0 && res.data) {
// 按巷道号分组
this.areaInfo = res.data.reduce((result, item) => {
// 提取巷道号
const laneNumber = item.lineEdgeLibraryCode.substring(3, 5) + ' 巷道';
// 如果该巷道还没有分组,创建一个空数组
if (!result[laneNumber]) {
result[laneNumber] = [];
}
// 将当前项添加到对应巷道的数组中
result[laneNumber].push(item);
return result;
}, {});
Object.keys(this.areaInfo).forEach((key) => {
const arr = this.areaInfo[key];
let emptyNum = 0;
let insetEmpty = [];
arr.forEach((item, index) => {
if (
!item.empty &&
item.lineEdgeLibraryCode.substring(5, 7) !=
Math.floor(index / 2) + 1 + emptyNum &&
item.lineEdgeLibraryCode[item.lineEdgeLibraryCode.length - 1] ==
'L'
) {
let num =
Number(item.lineEdgeLibraryCode.substring(5, 7)) -
(Math.floor(index / 2) + 1 + emptyNum);
insetEmpty.push({
index,
num,
});
emptyNum += num;
}
});
insetEmpty.forEach((item) => {
const arrEmpty = Array.from({ length: item.num * 2 }, () => ({
empty: true,
}));
arr.splice(item.index, 0, ...arrEmpty);
});
});
}
},
getDataList() {},
// 全部库区右侧分页点击
handleClickRight(tab, event) {
console.log(tab, event);
},
clearLine(val) {
if (val.usableState == 3) {
this.$confirm(
`当前库位为锁定状态,代表该库位有未完成的任务关联,是否确认清空${
'线边库名称为 ' + val.lineEdgeLibraryName + ' '
}的数据项?`,
'锁定库位清空提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
QKLineEdgeLibrary({
...val,
lineEdgeLibraryState: 0,
usableState: 1,
}).then(({ data }) => {
this.$message({
message: data,
type: 'success',
duration: 1500,
onClose: () => {
this.getAreaInfo(this.getAreaInfoInfo.id);
},
});
});
})
.catch(() => {});
} else {
QKLineEdgeLibrary({
...val,
lineEdgeLibraryState: 0,
usableState: 1,
}).then(({ data }) => {
this.$message({
message: data,
type: 'success',
duration: 1500,
onClose: () => {
this.getAreaInfo(this.getAreaInfoInfo.id);
},
});
});
}
},
addLine(val) {
this.addOrEditTitle = '添加货物';
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init();
this.$refs.addOrUpdate.showLine(val);
});
},
// dialog的父组件方法this.$emit("refreshDataList");
successSubmit() {
this.handleCancel();
this.getAreaInfo(this.getAreaInfoInfo.id);
},
},
};
</script>
<style lang="scss" scoped>
.overview-container {
max-height: calc(100vh - 120px - 8px);
overflow: scroll;
.overview-container-left {
padding-right: 12px;
}
.overview-container-main {
.allarea-box {
padding: 10px;
.areainfo-box {
border: 1px solid #bbb;
border-radius: 5px;
padding: 10px;
.areainfo-box-header {
font-size: 16px;
font-weight: bold;
white-space: nowrap; /* 禁止换行 */
overflow: hidden; /* 隐藏溢出内容 */
text-overflow: ellipsis; /* 溢出部分显示省略号 */
}
.areainfo-box-line {
width: 100%;
.areainfo-box-line-item {
height: 5px;
display: inline-block;
}
}
.areainfo-box-info {
.areainfo-box-info-item {
text-align: center;
font-size: 12px;
.areainfo-box-info-item-count {
font-weight: bold;
font-size: 14px;
}
}
}
}
}
}
.overview-container-right {
.overview-container-right-alloverview {
.overview-container-right-alloverview-item {
text-align: center;
.overview-container-right-alloverview-item-count {
font-size: 14px;
font-weight: bold;
}
}
}
}
}
</style>
<style lang="scss">
.el-tree-node__content {
height: 40px;
line-height: 40px;
}
.el-tree-node__label {
display: block;
width: calc(100% - 24px);
text-align: center;
white-space: nowrap; /* 禁止换行 */
overflow: hidden; /* 隐藏溢出内容 */
text-overflow: ellipsis; /* 溢出部分显示省略号 */
}
</style>
<style scoped>
.area-body {
margin-top: 10px;
margin-left: 10px;
overflow-x: auto;
display: flex;
}
.potTitle {
width: 190px;
background-color: rgb(169, 235, 249);
border-radius: 3px;
margin-right: 5px;
text-align: center;
color: #000000;
letter-spacing: 1px;
margin-bottom: 10px;
font-size: 16px;
}
.potList {
width: 190px;
display: grid;
grid-template-columns: 90px 90px;
gap: 8px;
}
.area-div {
padding: 10px;
background: white;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease;
border: 4px solid #1a56db;
margin-bottom: 30px;
}
.area-div-empty {
background: white;
width: 90px;
height: 88px;
margin-bottom: 30px;
}
.point {
width: 5px;
height: 5px;
border-radius: 50%;
background-color: #409eff;
float: left;
margin-top: 7px;
margin-right: 5px;
}
.area-icon {
display: flex;
align-items: center;
justify-content: center;
margin: auto;
width: 60px;
height: 60px;
border-radius: 12px;
}
</style>
<style scoped>
.stat-card {
margin-top: 10px;
display: flex;
align-items: center;
padding: 10px;
background: white;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease;
border-left: 4px solid;
border-color: #1a56db;
margin-bottom: 30px;
}
/* .stat-card:hover {
transform: translateY(-5px);
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
} */
.stat-title {
margin: 0 10px;
color: #0051ff;
font-size: 20px;
}
.stat-icon {
display: flex;
align-items: center;
justify-content: center;
width: 60px;
height: 60px;
border-radius: 12px;
margin-right: 15px;
background: linear-gradient(to right, #1a56db, #0d47a1);
}
.stat-content {
display: flex;
flex-direction: column;
}
.stat-value {
font-size: 28px;
font-weight: 700;
line-height: 1.2;
color: #1a56db;
}
.stat-label {
font-size: 14px;
color: #64748b;
}
</style>

View File

@@ -0,0 +1,519 @@
<!--
filename: EquipmentDrawer.vue
author: liubin
date: 2023-08-22 14:38:56
description:
-->
<template>
<el-drawer
:visible="visible"
:show-close="false"
:wrapper-closable="false"
class="drawer"
custom-class="mes-drawer"
size="60%"
@closed="$emit('destroy')">
<SmallTitle slot="title">
{{
mode.includes('detail')
? '详情'
: mode.includes('edit')
? '编辑'
: '新增'
}}
</SmallTitle>
<div class="drawer-body flex">
<div class="drawer-body__content">
<section v-for="(section, index) in sections" :key="section.key">
<SmallTitle v-if="index != 0">{{ section.name }}</SmallTitle>
<div
class="form-part"
v-if="section.key == 'base'"
style="margin-bottom: 32px">
<el-skeleton v-if="!showForm" animated />
<!-- <EquipmentInfoForm
key="drawer-dialog-form"
v-if="showForm"
:disabled="mode.includes('detail')"
:sync-filelist="syncFileListFlag"
v-model="form" /> -->
</div>
<div v-if="section.key == 'attrs'" style="margin-top: 12px">
<base-table
v-loading="attrListLoading"
:table-props="section.props"
:page="attrQuery?.params.pageNo || 1"
:limit="attrQuery?.params.pageSize || 10"
:table-data="list"
:add-button-show="mode.includes('detail') ? null : '添加属性'"
@emitButtonClick="handleAddAttr"
@emitFun="handleEmitFun">
<method-btn
v-if="section.tableBtn"
slot="handleBtn"
label="操作"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
<!-- 分页组件 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="attrQuery.params.pageNo"
:limit.sync="attrQuery.params.pageSize"
@pagination="getAttrList" />
</div>
</section>
</div>
<div class="drawer-body__footer">
<el-button style="" @click="handleCancel">取消</el-button>
<el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
编辑
</el-button>
<el-button v-else type="primary" @click="handleConfirm">确定</el-button>
<!-- sections的第二项必须是 属性列表 -->
<!-- <el-button
v-if="sections[1].allowAdd"
type="primary"
@click="handleAddAttr">
添加属性
</el-button> -->
</div>
</div>
</el-drawer>
</template>
<script>
const SmallTitle = {
name: 'SmallTitle',
props: ['size'],
components: {},
data() {
return {};
},
methods: {},
render: function (h) {
return h(
'span',
{
class: 'small-title',
style: {
fontSize: '18px',
lineHeight:
this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
fontWeight: 500,
fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
},
},
this.$slots.default
);
},
};
export default {
components: { SmallTitle },
props: ['sections', 'mode', 'dataId'], // dataId 作为一个通用的存放id的字段
data() {
return {
visible: false,
showForm: false,
btnLoading: false,
total: 0,
form: {},
list: [],
attrTitle: '',
attrForm: {
id: null,
equipmentId: null,
name: '',
value: '',
},
attrFormVisible: false,
attrRows: [
[
{
input: true,
label: '属性名称',
prop: 'name',
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
},
],
[
{
input: true,
label: '属性值',
prop: 'value',
},
],
],
attrQuery: {
params: {
pageNo: 1,
pageSize: 10,
},
}, // 属性列表的请求
infoQuery: null, // 基本信息的请求
attrFormSubmitting: false,
attrListLoading: false,
syncFileListFlag: null,
};
},
computed: {
formRows() {
return this.sections[0].rows.map((row) => {
return row.map((col) => {
if (col.key == 'eq-pics') {
// 重置图片的位置
return {
...col,
bind: {
...col.bind,
},
style: {
left: 0,
right: 'unset',
},
};
}
return {
...col,
bind: {
...col.bind,
// 详情 模式下,禁用各种输入
disabled: this.mode == 'detail',
},
};
});
});
},
tableBtn() {
return this.mode == 'detail' ? [] : this.sections[1].tableBtn;
},
},
mounted() {
for (const section of this.sections) {
// 请求具体信息
if ('url' in section) {
const query = {
url: section.url,
method: section.method || 'get',
params: section.queryParams || null,
data: section.data || null,
};
this.$axios(query).then(({ data }) => {
if (section.key == 'base') {
this.form = data;
// this.form = {
// code: 'gj',
// name: '下片机',
// enName: 'unload',
// abbr: '',
// equipmentTypeId: 21084,
// remark: '备注',
// id: '1712367395052384257',
// createTime: 1697095176000,
// enterTime: 0,
// productionTime: 0,
// files: [
// {
// fileName: '测试.xlsx',
// fileUrl: 'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2022%2F0108%2F0f0c6f30j00r5cle9000sc000hs00gtc.jpg&thumbnail=660x2147483647&quality=80&type=jpg',
// fileType: 1
// },
// {
// fileName: '测试2.xlsx',
// fileUrl: 'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2022%2F0415%2F2cd23619j00racb96000kc000hs00hsc.jpg&thumbnail=660x2147483647&quality=80&type=jpg',
// fileType: 1
// },
// {
// fileName: '测试3.xlsx',
// fileUrl: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2F1fea91a0-d088-409e-b145-e0e61254b28b%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1700031689&t=2e0fe7d1de7f54adff3007efe133d67c',
// fileType: 1
// },
// {
// fileName: '测试4.xlsx',
// fileUrl: 'https://pics5.baidu.com/feed/b7003af33a87e950cdfb4b4546eed044faf2b40d.jpeg?token=1d7484cfe4b014dd201f8c8725cab945',
// fileType: 2
// },
// {
// fileName: '测试5.xlsx',
// fileUrl: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2Fe3500876-9c46-4b70-8d37-4799520cdd13%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1700031689&t=4abc1df930e62730e5361a7d3765e0f2',
// fileType: 2
// },
// ],
// tvalue: 0,
// processingTime: 0,
// manufacturer: '',
// spec: '',
// description: '描述',
// };
this.showForm = true;
this.infoQuery = query;
} else if (section.key == 'attrs') {
this.attrQuery = query;
this.list = data.list;
this.total = data.total;
}
});
}
}
},
methods: {
handleTableBtnClick({ type, data }) {
switch (type) {
case 'edit':
this.handleEditAttr(data.id);
break;
case 'delete':
this.handleDeleteAttr(data.id);
break;
}
},
async handleConfirm() {
this.btnLoading = true;
this.syncFileListFlag = Math.random();
this.$nextTick(async () => {
const { code, data } = await this.$axios({
url: this.sections[0].urlUpdate,
method: 'put',
data: this.form,
});
if (code == 0) {
this.$modal.msgSuccess('更新成功');
this.$emit('refreshDataList');
}
this.btnLoading = false;
this.handleCancel();
});
},
handleEmitFun(val) {
console.log('handleEmitFun', val);
},
init() {
this.visible = true;
},
async getAttrList() {
this.attrListLoading = true;
const res = await this.$axios(this.attrQuery);
if (res.code == 0) {
this.list = res.data.list;
this.total = res.data.total;
}
this.attrListLoading = false;
},
// 保存表单
handleSave() {
this.$refs['form'][0].validate(async (valid) => {
if (valid) {
const isEdit = this.mode == 'edit';
await this.$axios({
url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
method: isEdit ? 'put' : 'post',
data: this.form,
});
this.$modal.msgSuccess(`${isEdit ? '更新' : '创建'}成功`);
this.visible = false;
this.$emit('refreshDataList');
}
});
},
handleCancel() {
this.visible = false;
},
// 开启编辑
toggleEdit() {
this.$emit('update-mode', 'edit');
},
// 新增属性
handleAddAttr() {
if (!this.dataId) return this.$message.warning('请先创建设备信息');
this.attrForm = {
id: null,
equipmentId: this.dataId,
name: '',
value: '',
};
this.attrTitle = '添加设备属性';
this.attrFormVisible = true;
},
// 编辑属性
async handleEditAttr(attrId) {
const res = await this.$axios({
url: this.sections[1].urlDetail,
method: 'get',
params: { id: attrId },
});
if (res.code == 0) {
this.attrForm = res.data;
this.attrTitle = '编辑设备属性';
this.attrFormVisible = true;
}
},
// 删除属性
handleDeleteAttr(attrId) {
this.$confirm('确定删除该属性?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(async () => {
const res = await this.$axios({
url: this.sections[1].urlDelete,
method: 'delete',
params: { id: attrId },
});
if (res.code == 0) {
this.$message({
message: '删除成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getAttrList();
},
});
}
})
.catch(() => {});
},
// 提交属性表
submitAttrForm() {
this.$refs['attrForm'].validate(async (valid) => {
if (!valid) {
return;
}
try {
const isEdit = this.attrForm.id != null;
this.attrFormSubmitting = true;
const res = await this.$axios({
url: isEdit
? this.sections[1].urlUpdate
: this.sections[1].urlCreate,
method: isEdit ? 'put' : 'post',
data: this.attrForm,
});
if (res.code == 0) {
this.closeAttrForm();
this.$message({
message: `${isEdit ? '更新' : '创建'}成功`,
type: 'success',
duration: 1500,
onClose: () => {
this.getAttrList();
},
});
}
this.attrFormSubmitting = false;
} catch (err) {
this.$message({
message: err,
type: 'error',
duration: 1500,
});
this.attrFormSubmitting = false;
}
});
},
closeAttrForm() {
this.attrFormVisible = false;
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定对${
raw.data.name
? '[名称=' + raw.data.name + ']'
: '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
deleteProductAttr(raw.data.id).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getList();
},
});
});
})
.catch(() => {});
} else {
this.addNew(raw.data.id);
}
},
},
};
</script>
<style scoped>
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
margin-bottom: 0px;
}
.small-title::before {
content: '';
display: inline-block;
vertical-align: top;
width: 4px;
height: 22px;
border-radius: 1px;
margin-right: 8px;
background-color: #0b58ff;
}
.drawer-body {
display: flex;
flex-direction: column;
height: 100%;
}
.drawer-body__content {
flex: 1;
/* background: #eee; */
padding: 20px 30px;
overflow-y: auto;
}
.drawer-body__footer {
display: flex;
justify-content: flex-end;
padding: 18px;
}
</style>

View File

@@ -0,0 +1,277 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<SearchBar
:formConfigs="searchBarFormConfig"
ref="search-bar"
isFold
@headBtnClick="handleSearchBarBtnClick" />
<!-- 列表 -->
<base-table
:table-props="tableProps"
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-data="list"
@emitFun="handleEmitFun">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
<!-- 分页组件 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 设备 详情 - 编辑 -->
<RecordDrawer
v-if="open"
ref="drawer"
:mode="editMode"
@update-mode="editMode = $event"
:data-id="form.id"
@refreshDataList="getList"
@cancel="cancelEdit"
@destroy="cancelEdit" />
</div>
</template>
<script>
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import RecordDrawer from './components/RecordDrawer';
import { getRecordPage, getLaneList } from '@/api/areavisual/record';
export default {
name: 'Equipment',
components: {
RecordDrawer,
},
mixins: [basicPageMixin],
data() {
return {
searchBarKeys: ['name', 'code'],
// this.$auth.hasPermi(`base:equipment:update`)
tableBtn: [
{
type: 'detail',
btnName: '详情'
}
].filter((v) => v),
tableProps: [
{
prop: 'recordCode',
label: '出/入库单编号',
fixed: true,
width: 180,
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
// showOverflowtooltip: true,
},
{
prop: 'type',
label: '业务类型',
filter: (val) => val === 1 ? '出库' : '入库',
},
{
width: 180,
prop: 'recordTime',
label: '出/入库时间',
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss')
},
{ prop: 'recordArea', label: '出/入库库区' },
{ prop: 'recordLane', label: '出/入库巷道' },
{ prop: 'recordRegion', label: '出/入库库位号' },
{ prop: 'target', label: '搬运对象' },
{ prop: 'productName', label: '产品名称' },
{ prop: 'specification', label: '型号规格' },
{ prop: 'recordMan', label: '出/入库人' },
{ prop: 'remark', label: '备注' }
],
searchBarFormConfig: [
{
type: 'input',
label: '关键字',
placeholder: '请输入出/入库编码、产品名称、规格型号、库位号',
param: 'query',
width: 350
},
{
type: 'select',
label: '业务类型',
selectOptions: [
{
id: '1',
name:'出库'
},
{
id: '2',
name:'入库'
},
],
placeholder: '请选择业务类型',
param: 'type',
},
{
type: 'select',
label: '出/入库巷道',
selectOptions: [],
placeholder: '请选择出/入库巷道',
param: 'recordLane',
},
{
type: 'select',
label: '来源',
selectOptions: [
{
id: '1',
name:'WMS'
},
{
id: '2',
name:'MES'
},
],
placeholder: '请选择来源',
param: 'source',
},
{
type: 'select',
label: '出/入库人',
selectOptions: [],
placeholder: '请选择出/入库人',
param: 'recordMan',
},
{
type: 'datePicker',
label: '出/入库时间',
placeholder: '请选择出/入库时间',
param: 'recordTime',
dateType: 'datetimerange',
rangeSeparator: '至'
},
{
type: 'select',
label: '载具类型',
selectOptions: [
{
id: '1',
name:'AGV'
},
{
id: '2',
name:'人工叉车'
},
],
placeholder: '请选择载具类型',
param: 'vehicleType',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'button',
btnName: '重置',
name: 'reset',
color: 'info',
}
],
editVisible: false,
editMode: 'detail', // 'edit', 'detail'
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 20,
query: '',
type: '',
source: '',
recordLane: '',
recordMan: '',
recordTime: '',
vehicleType: ''
},
form: {}
};
},
created() {
this.getLane()
this.getList();
},
computed: {},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
// 执行查询
getRecordPage(this.queryParams).then((response) => {
console.log(response)
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
async getLane() {
const res = await getLaneList({
pageNo: 1,
pageSize: 100
})
if (res.code === 0 && res.data) {
console.log(res.data)
this.searchBarFormConfig[2].selectOptions = res.data.list.map(item => {
return { id: item.id, name: item.lane }
})
console.log(this.searchBarFormConfig)
}
},
/** 取消按钮 */
cancel() {
this.open = false;
},
// /** 导出按钮操作 */
// handleExport() {
// // 处理查询参数
// let params = { ...this.queryParams };
// params.pageNo = undefined;
// params.pageSize = undefined;
// this.$modal
// .confirm('是否确认导出所有设备数据项?')
// .then(() => {
// this.exportLoading = true;
// return exportEquipmentExcel(params);
// })
// .then((response) => {
// this.$download.excel(response, '设备.xls');
// this.exportLoading = false;
// })
// .catch(() => {});
// },
handleTableBtnClick ({data, type}) {
switch (type) {
case 'detail':
this.viewDetail(data.id)
}
},
// 查看详情
viewDetail(id) {
this.editMode = 'detail';
this.open = true;
this.form.id = id;
this.$nextTick(() => {
this.$refs['drawer'].init();
});
},
},
};
</script>

View File

@@ -0,0 +1,81 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2025-11-28 14:38:31
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="物料编码" prop="materialCode">
<el-input
v-model="dataForm.materialCode"
clearable
placeholder="请输入物料编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物料型号" prop="materialName">
<el-input
v-model="dataForm.materialName"
clearable
placeholder="请输入物料型号" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="物料规格" prop="material">
<el-input
v-model="dataForm.material"
clearable
placeholder="请输入物料规格" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import basicAdd from '@/mixins/basic-add';
import { createProduct, updateProduct,getProduct } from '@/api/ssdl/product&recipe';
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
createURL: createProduct,
updateURL: updateProduct,
infoURL: getProduct,
},
dataForm: {
id: undefined,
material: undefined,
materialName: undefined,
materialCode: undefined,
},
typeArr: [],
dataRule: {
materialCode: [
{ required: true, message: '物料编码不能为空', trigger: 'blur' },
],
materialName: [
{ required: true, message: '物料型号不能为空', trigger: 'blur' },
],
material: [
{ required: true, message: '规格不能为空', trigger: 'blur' },
],
},
};
},
methods: {},
};
</script>

View File

@@ -0,0 +1,62 @@
<!--
* @Author: zwq
* @Date: 2025-10-11 14:41:12
* @LastEditors: zwq
* @LastEditTime: 2026-01-14 14:13:14
* @Description:
-->
<template>
<el-switch
@change="changeStatus"
size="small"
v-model="injectData.regionState"
:active-value="1"
:inactive-value="2"></el-switch>
</template>
<script>
import { updateRegion } from '@/api/areavisual/region';
export default {
props: {
injectData: {
type: Object,
default: () => ({}),
},
},
data() {
return {};
},
created() {},
methods: {
changeStatus(val) {
const pdata = { ...this.injectData, regionState: val };
this.$confirm(
`是否确认修改${'区域 [ ' + this.injectData.regionName + ' ] '}的状态?`,
'更新状态',
{
confirmButtonText: '确认修改',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
updateRegion(pdata).then((res) => {
if (res.code === 0 || res.code === 200) {
this.$modal.msgSuccess('修改成功');
this.$emit('emitData');
} else {
this.$modal.msg(res.msg);
}
});
})
.catch((res) => {
this.$emit('emitData');
this.$message({
type: 'info',
message: '已取消',
});
});
},
},
};
</script>

View File

@@ -0,0 +1,221 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData"
@emitFun="getDataList">
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '@/mixins/basic-page';
import { parseTime } from '@/filter/code-filter';
import { deleteRegion, getRegionPage } from '@/api/areavisual/region';
import changeStatus from './changeStatus.vue';
const region = [
{
id: '1',
name: 'A区域',
},
{
id: '2',
name: 'B区域',
},
{
id: '3',
name: 'C区域',
},
{
id: '4',
name: 'D区域',
},
{
id: '5',
name: 'E区域',
},
{
id: '6',
name: 'F区域',
},
{
id: '7',
name: 'G区域',
},
{
id: '8',
name: 'H区域',
},
];
const regionType = [
{
id: '1',
name: '拉丝缓存区',
},
{
id: '2',
name: '满盘存储区',
},
{
id: '3',
name: '空盘存储区',
},
{
id: '4',
name: '复绕区',
},
];
const tableProps = [
{
prop: 'regionCode',
label: '区域编码',
},
{
prop: 'regionName',
label: '区域名称',
},
{
prop: 'region',
label: '区域',
filter: (val) => {
return region.find((i) => i.id == val)
? region.find((i) => i.id == val).name
: '-';
},
},
{
prop: 'regionType',
label: '区域类型',
filter: (val) => {
return regionType.find((i) => i.id == val)
? regionType.find((i) => i.id == val).name
: '-';
},
},
{
prop: 'rowNum',
label: '行数',
width:90,
},
{
prop: 'columnNum',
label: '列数',
width:90,
},
{
prop: 'regionState',
label: '区域状态',
width:90,
subcomponent: changeStatus,
},
{
prop: 'createTime',
label: '创建时间',
filter: parseTime,
width: 150,
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getRegionPage,
deleteURL: deleteRegion,
},
tableProps,
tableData: [],
formConfig: [
{
type: 'input',
label: '名称',
placeholder: '名称',
param: 'name',
},
{
type: 'input',
label: '编码',
placeholder: '编码',
param: 'code',
},
{
type: 'select',
label: '区域',
selectOptions: region,
placeholder: '请选择区域',
param: 'region',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
],
};
},
components: {
AddOrUpdate,
},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 20;
this.listQuery.regionName = val.name;
this.listQuery.regionCode = val.code;
this.listQuery.region = val.region;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 20,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.addOrUpdateHandle();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@@ -6,27 +6,35 @@
--> -->
<template> <template>
<el-drawer :visible="visible" :show-close="false" :wrapper-closable="false" class="drawer" custom-class="mes-drawer" <el-drawer
:size="size || '50%'" @closed="$emit('destroy')"> :visible="visible"
<SmallTitle slot="title"> :show-close="false"
{{ :wrapper-closable="false"
mode.includes('detail') class="drawer"
? '详情' custom-class="mes-drawer"
: mode.includes('edit') :size="size || '50%'"
? '编辑' @closed="$emit('destroy')">
: '新增' <SmallTitle slot="title">
}} {{
</SmallTitle> mode.includes('detail')
? '详情'
: mode.includes('edit')
? '编辑'
: '新增'
}}
</SmallTitle>
<div class="drawer-body flex"> <div class="drawer-body flex">
<div class="drawer-body__content"> <div class="drawer-body__content">
<section v-for="(section, index) in sections" :key="section.key"> <section v-for="(section, index) in sections" :key="section.key">
<SmallTitle v-if="index != 0">{{ section.name }}</SmallTitle> <SmallTitle v-if="index != 0">{{ section.name }}</SmallTitle>
<div class="form-part" v-if="section.key == 'base'" <div
style="border-bottom: 1px solid #dfdfdf; margin-bottom: 24px"> class="form-part"
<el-skeleton v-if="!showForm" animated /> v-if="section.key == 'base'"
<!-- <BaseInfoForm style="border-bottom: 1px solid #dfdfdf; margin-bottom: 24px">
<el-skeleton v-if="!showForm" animated />
<!-- <BaseInfoForm
key="drawer-dialog-form" key="drawer-dialog-form"
v-if="showForm" v-if="showForm"
ref="form" ref="form"
@@ -34,87 +42,141 @@
v-model="form" v-model="form"
:rows="formRows" /> --> :rows="formRows" /> -->
<!-- if --> <!-- if -->
<el-row v-if="mode.includes('detail')" style="margin-bottom: 24px"> <el-row v-if="mode.includes('detail')" style="margin-bottom: 24px">
<el-col :span="8"> <el-col :span="8">
<div class="title" style="font-weight: 700; font-size: 16px; margin: 8px 0"> <div
设备名 class="title"
</div> style="font-weight: 700; font-size: 16px; margin: 8px 0">
<div class="value" style="font-size: 14px"> 设备名
{{ form.equipmentName }} </div>
</div> <div class="value" style="font-size: 14px">
</el-col> {{ form.equipmentName }}
<el-col :span="8"> </div>
<div class="title" style="font-weight: 700; font-size: 16px; margin: 8px 0"> </el-col>
关联表名 <el-col :span="8">
</div> <div
<div class="value" style="font-size: 14px"> class="title"
{{ form.plcName }} style="font-weight: 700; font-size: 16px; margin: 8px 0">
</div> 关联表名
</el-col> </div>
</el-row> <div class="value" style="font-size: 14px">
<!-- else --> {{ form.plcName }}
<el-row v-else style="margin-bottom: 24px" :gutter="20"> </div>
<el-form ref="form" :model="form"> </el-col>
<el-col :span="8"> </el-row>
<el-form-item class="title" label="设备名" style="font-size: 16px; margin: 8px 0"> <!-- else -->
<el-select v-model="form.equipmentId" filterable clearable placeholder="请选择设备"> <el-row v-else style="margin-bottom: 24px" :gutter="20">
<el-option v-for="eq in eqList" :key="eq.id" :label="eq.name" :value="eq.id"></el-option> <el-form ref="form" :model="form">
</el-select> <el-col :span="8">
</el-form-item> <el-form-item
</el-col> class="title"
<el-col :span="8"> label="设备名"
<el-form-item class="title" label="设备关联表名" style="font-size: 16px; margin: 8px 0"> style="font-size: 16px; margin: 8px 0">
<el-select v-model="form.plcId" filterable clearable placeholder="请选择关联表"> <el-select
<el-option v-for="plc in plcList" :key="plc.id" :label="plc.plcTableName" v-model="form.equipmentId"
:value="plc.id"></el-option> filterable
</el-select> clearable
</el-form-item> placeholder="请选择设备">
</el-col> <el-option
</el-form> v-for="eq in eqList"
</el-row> :key="eq.id"
</div> :label="eq.name"
:value="eq.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item
class="title"
label="设备关联表名"
style="font-size: 16px; margin: 8px 0">
<el-select
v-model="form.plcId"
filterable
clearable
placeholder="请选择关联表">
<el-option
v-for="plc in plcList"
:key="plc.id"
:label="plc.plcTableName"
:value="plc.id"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-form>
</el-row>
</div>
<div v-if="section.key == 'attrs'" style="position: relative; margin-top: 12px"> <div
<div v-if="!mode.includes('detail')" style="position: absolute; top: -40px; right: 0"> v-if="section.key == 'attrs'"
<el-button @click="handleAddAttr" type="text"> style="position: relative; margin-top: 12px">
<i class="el-icon-plus"></i> <div
添加参数 v-if="!mode.includes('detail')"
</el-button> style="position: absolute; top: -40px; right: 0">
</div> <el-button @click="handleAddAttr" type="text">
<base-table v-loading="attrListLoading" :table-props="section.props" :page="attrQuery?.params.pageNo || 1" <i class="el-icon-plus"></i>
:limit="attrQuery?.params.pageSize || 10" :table-data="list" @emitFun="handleEmitFun"> 添加参数
<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'" </el-button>
</div>
<base-table
v-loading="attrListLoading"
:table-props="section.props"
:page="attrQuery?.params.pageNo || 1"
:limit="attrQuery?.params.pageSize || 10"
:table-data="list"
@emitFun="handleEmitFun">
<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'"
@emitButtonClick="handleAddAttr" --> @emitButtonClick="handleAddAttr" -->
<method-btn v-if="section.tableBtn && !mode.includes('detail')" slot="handleBtn" label="操作" <method-btn
:method-list="tableBtn" @clickBtn="handleTableBtnClick" /> v-if="section.tableBtn && !mode.includes('detail')"
</base-table> slot="handleBtn"
label="操作"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
<!-- 分页组件 --> <!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="attrQuery.params.pageNo" <pagination
:limit.sync="attrQuery.params.pageSize" @pagination="getAttrList" /> v-show="total > 0"
</div> :total="total"
</section> :page.sync="attrQuery.params.pageNo"
</div> :limit.sync="attrQuery.params.pageSize"
@pagination="getAttrList" />
</div>
</section>
</div>
<div class="drawer-body__footer"> <div class="drawer-body__footer">
<el-button style="" @click="handleCancel">取消</el-button> <el-button style="" @click="handleCancel">取消</el-button>
<el-button type="primary" v-if="!mode.includes('detail')" @click="handleSave"> <el-button
保存 type="primary"
</el-button> v-if="!mode.includes('detail')"
</div> @click="handleSave">
</div> 保存
</el-button>
</div>
</div>
<!-- 属性对话框 --> <!-- 属性对话框 -->
<base-dialog v-if="sections[1].allowAdd" :dialogTitle="attrTitle" :dialogVisible="attrFormVisible" width="45%" <base-dialog
:append-to-body="true" custom-class="baseDialog" @close="closeAttrForm" @cancel="closeAttrForm" v-if="sections[1].allowAdd"
@confirm="submitAttrForm"> :dialogTitle="attrTitle"
<!-- :disabled="mode.includes('detail')" --> :dialogVisible="attrFormVisible"
<DialogForm v-if="attrFormVisible" ref="attrForm" v-model="attrForm" :data-form="attrForm" width="45%"
:rows="attrRows" :append-to-body="true"
@update="handleAttrFormUpdate"/> custom-class="baseDialog"
</base-dialog> @close="closeAttrForm"
</el-drawer> @cancel="closeAttrForm"
@confirm="submitAttrForm">
<!-- :disabled="mode.includes('detail')" -->
<DialogForm
v-if="attrFormVisible"
ref="attrForm"
v-model="attrForm"
:rows="attrRows" />
</base-dialog>
</el-drawer>
</template> </template>
<script> <script>
@@ -170,9 +232,7 @@ export default {
defaultValue: '', defaultValue: '',
description: '', description: '',
remark: '', remark: '',
alarmContent: '', alarmContent: '',
displayTip: false,
alarmTip: false,
}, },
attrFormVisible: false, attrFormVisible: false,
attrRows: [ attrRows: [
@@ -282,27 +342,7 @@ export default {
}, },
], ],
}, },
], ],
[
{
switch: true,
label: '是否展示',
prop: 'displayTip',
bind: {
'active-value': true,
'inactive-value': false,
},
},
{
switch: true,
label: '超出阈值是否报警',
prop: 'alarmTip',
bind: {
'active-value': true,
'inactive-value': false,
},
},
],
[ [
{ {
input: true, input: true,
@@ -396,24 +436,7 @@ export default {
} }
} }
}, },
methods: { methods: {
handleAttrFormUpdate(updatedForm) {
console.log('updatedForm', updatedForm);
// 只同步需要的字段,避免覆盖其他数据
this.attrForm = {
...this.attrForm,
...updatedForm,
// 确保开关值是布尔类型(双重保险)
displayTip: Boolean(updatedForm.displayTip),
alarmTip: Boolean(updatedForm.alarmTip),
collection: Number(updatedForm.collection) // 采集开关保持数字类型
};
console.log('开关值同步:', {
displayTip: this.attrForm.displayTip,
alarmTip: this.attrForm.alarmTip
});
},
handleTableBtnClick({ type, data }) { handleTableBtnClick({ type, data }) {
switch (type) { switch (type) {
case 'edit': case 'edit':
@@ -479,8 +502,7 @@ export default {
name: '', name: '',
plcParamName: '', plcParamName: '',
unit: '', unit: '',
collection: 1, collection: 1,
minValue: '', minValue: '',
maxValue: '', maxValue: '',
defaultValue: '', defaultValue: '',
@@ -488,9 +510,7 @@ export default {
remark: '', remark: '',
equipmentParamType: '', equipmentParamType: '',
productionParamType: '', productionParamType: '',
alarmContent: '', alarmContent: '',
displayTip: false,
alarmTip: false,
}; };
this.attrTitle = '添加参数绑定信息'; this.attrTitle = '添加参数绑定信息';
this.attrFormVisible = true; this.attrFormVisible = true;
@@ -503,15 +523,8 @@ export default {
method: 'get', method: 'get',
params: { id: attrId }, params: { id: attrId },
}); });
if (res.code == 0) { if (res.code == 0) {
console.log('res.data', res.data); this.attrForm = res.data;
this.attrForm = {
...res.data,
// // 强制转为数字类型,避免字符串类型导致绑定失败
// displayTip: Number(res.data.displayTip) || 0,
// alarmTip: Number(res.data.alarmTip) || 0
};
this.attrTitle = '编辑参数绑定信息'; this.attrTitle = '编辑参数绑定信息';
this.attrFormVisible = true; this.attrFormVisible = true;
} }
@@ -550,8 +563,7 @@ export default {
this.$refs['attrForm'].validate(async (valid) => { this.$refs['attrForm'].validate(async (valid) => {
if (!valid) { if (!valid) {
return; return;
} }
console.log('this.attrForm', this.attrForm);
const isEdit = this.attrForm.id != null; const isEdit = this.attrForm.id != null;
this.attrFormSubmitting = true; this.attrFormSubmitting = true;
@@ -571,9 +583,8 @@ export default {
type: 'success', type: 'success',
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {
this.shouldRefreshPageView = true; this.getAttrList();
this.getAttrList(); this.shouldRefreshPageView = true;
}, },
}); });
} }

View File

@@ -63,7 +63,7 @@
style="width: 75%" style="width: 75%"
v-model="dataForm.price" v-model="dataForm.price"
clearable clearable
placeholder="请输入单价" /> placeholder="请输入允许留存时间" />
{{ unit }} {{ unit }}
</el-form-item> </el-form-item>
</el-col> </el-col>
@@ -103,7 +103,7 @@ export default {
id: null, id: null,
code: '', code: '',
materialId: '', materialId: '',
price: undefined, price: '',
startTime: new Date().getTime(), startTime: new Date().getTime(),
endTime: null, endTime: null,
remark: '', remark: '',
@@ -140,15 +140,13 @@ export default {
setTimeout(this.setCode(), 1000); setTimeout(this.setCode(), 1000);
} }
}, },
setCode() { setCode() {
console.log('this.MaterialList', this.urlOptions.dictArr.dict0);
this.MaterialList.forEach((item) => { this.MaterialList.forEach((item) => {
if (item.id === this.dataForm.materialId) { if (item.id === this.dataForm.materialId) {
this.dataForm.code = item.code; this.dataForm.code = item.code;
this.unit = this.unit =
'元/' + '元/' +
this.urlOptions.dictArr.dict0.find((d) => d.value == item.unit) this.urlOptions.dictArr.dict0.find((d) => d.value === item.unit)
.label; .label;
} }
}); });

View File

@@ -47,15 +47,15 @@ const tableProps = [
prop: 'equipmentName', prop: 'equipmentName',
label: '设备', label: '设备',
}, },
// { {
// prop: 'size', prop: 'size',
// label: '规格', label: '规格',
// showOverflowtooltip: true, showOverflowtooltip: true,
// }, },
// { {
// prop: 'process', prop: 'process',
// label: '产品工艺', label: '产品工艺',
// }, },
{ {
prop: 'standardCt', prop: 'standardCt',
label: '标准节拍pcs/min', label: '标准节拍pcs/min',
@@ -128,7 +128,7 @@ export default {
this.tableData = response.data; this.tableData = response.data;
this.dataListLoading = false; this.dataListLoading = false;
}); });
}, },
handleClick(val) { handleClick(val) {
const data = { const data = {
...this.time, ...this.time,

View File

@@ -141,8 +141,7 @@ export default {
type: 'select', type: 'select',
label: '产线', label: '产线',
selectOptions: [], selectOptions: [],
param: 'lineId', param: 'lineId',
collapseTags: true,
multiple: true, multiple: true,
}, },
{ {

View File

@@ -1,261 +1,273 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> <search-bar
<div v-if="tableData.length"> :formConfigs="formConfig"
<base-table v-loading="dataListLoading" :table-props="tableProps" :max-height="tableH" :table-data="tableData" /> ref="searchBarForm"
<SearchBar :formConfigs="[{ label: '产品产量对比图', type: 'title' }]" /> @headBtnClick="buttonClick" />
<line-chart ref="lineChart" /> <div v-if="tableData.length">
</div> <base-table
<div v-else class="no-data-bg"></div> v-loading="dataListLoading"
</div> :table-props="tableProps"
:max-height="tableH"
:table-data="tableData" />
<SearchBar :formConfigs="[{ label: '产品产量对比图', type: 'title' }]" />
<line-chart ref="lineChart" />
</div>
<div v-else class="no-data-bg"></div>
<!-- <pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" /> -->
</div>
</template> </template>
<script> <script>
// import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter'; import { parseTime } from '../../mixins/code-filter';
import { getYieldAnalysisPageData } from '@/api/core/analysis/index'; import { getYieldAnalysisPageData } from '@/api/core/analysis/index';
import { getProductionLinePage } from '@/api/core/base/productionLine'; import { getProductionLinePage } from '@/api/core/base/productionLine';
import lineChart from '../LineChart'; import lineChart from '../LineChart';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin'; import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
// import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
// const tableProps = [
// // {
// // prop: 'lineName',
// // label: '产线',
// // align: 'center',
// // },
// // {
// // prop: 'sum',
// // label: '合计',
// // align: 'center',
// // },
// // {
// // prop: 'dynamicValue',
// // label: 'dynamicName',
// // align: 'center',
// // children:[
// // ]
// // }
// ];
export default { export default {
components: { components: {
lineChart, lineChart,
}, },
mixins: [tableHeightMixin], mixins: [tableHeightMixin],
data() { data() {
return { return {
urlOptions: { urlOptions: {
getDataListURL: getYieldAnalysisPageData, getDataListURL: getYieldAnalysisPageData,
}, },
tableProps: [], tableProps: [],
dataListLoading: false, dataListLoading: false,
tableData: [], tableData: [],
listQuery: { listQuery: {
lineIds: [], lineIds: [],
time: '', // 存储时间选择器的选中值(时间戳/格式化字符串,根据接口要求调整) time: '',
}, },
dateLabelList: [], dateLabelList: [],
optionArrUrl: [getProductionLinePage], optionArrUrl: [getProductionLinePage],
formConfig: [ formConfig: [
{ {
type: 'datePicker', type: 'select',
label: '时间', label: '产线',
dateType: 'month', // 单个月份选择 selectOptions: [],
format: 'yyyy-MM', // 显示格式 param: 'lineIds',
valueFormat: 'yyyy-MM-dd HH:mm:ss', // 绑定值的格式 defaultSelect: [],
param: 'time', multiple: true,
defaultSelect: '', // 新增:默认月份值 filterable: true,
}, width: 200,
{ },
type: 'select', {
label: '产线', type: 'datePicker',
selectOptions: [], label: '时间',
param: 'lineIds', dateType: 'month',
defaultSelect: [], // 产线默认选择值(多选数组) format: 'yyyy-MM',
multiple: true, valueFormat: 'yyyy-MM-dd HH:mm:ss',
collapseTags: true, rangeSeparator: '-',
filterable: true, startPlaceholder: '开始时间',
width: 300, endPlaceholder: '结束时间',
}, param: 'time',
{ },
type: 'button', {
btnName: '查询', type: 'button',
name: 'search', btnName: '查询',
color: 'primary', name: 'search',
}, color: 'primary',
], },
}; ],
}, };
mounted() { },
// 1. 初始化默认当月时间 created() {
this.initDefaultMonth(); this.getArr();
// 2. 获取产线数据 },
this.getArr(); methods: {
}, getArr() {
methods: { const params = {
/** page: 1,
* 初始化默认当月时间(单个月份) limit: 500,
*/ };
initDefaultMonth() { this.optionArrUrl.forEach((item, index) => {
const now = new Date(); item(params).then((response) => {
const year = now.getFullYear(); this.formConfig[index].selectOptions = response.data.list;
const month = now.getMonth(); // 月份从0开始直接使用取当月1号 // this.formConfig[0].defaultSelect = response.data.list[0].id
// 创建当月1号0点0分0秒的日期对象 // this.$set(this.formConfig[0], 'defaultSelect', response.data.list[0].id)
const firstDayOfMonth = new Date(year, month, 1, 0, 0, 0); });
// 转换为时间戳(毫秒级) });
const defaultTimeStamp = firstDayOfMonth.getTime(); },
// 给时间选择器赋值默认值 getData() {
this.formConfig[0].defaultSelect = firstDayOfMonth; // this.listQuery.lineIds = ['1672847052717821953']
// this.listQuery.time = defaultTimeStamp; // this.listQuery.productId = val.productId;
}, // this.listQuery.time = '1694486098000';
/** this.urlOptions.getDataListURL(this.listQuery).then((res) => {
* 获取产线数据 let arr = [
*/ {
getArr() { prop: 'lineName',
const params = { label: '产线',
page: 1, fixed: 'left',
limit: 500, },
}; {
// 原代码forEach遍历冗余直接调用第一个方法即可 prop: 'sum',
this.optionArrUrl[0](params) label: '合计[片]',
.then((response) => { fixed: 'left',
const lineList = response.data.list; },
this.formConfig[1].selectOptions = lineList; {
// 产线默认选择第一条数据(多选需用数组格式) prop: res.data ? res.data.nameData[0].name : undefined,
if (lineList.length > 0) { label: res.data ? res.data.nameData[0].name : undefined,
const firstLineId = lineList[0].id; align: 'center',
this.formConfig[1].defaultSelect = [firstLineId]; children: [],
// 给查询参数赋值 },
this.listQuery.lineIds = [firstLineId]; ];
} // console.log(res.data.nameData.slice(1))
}) let xData = [];
.catch((err) => { let yAllData = [];
console.error('获取产线数据失败:', err); let lineName = [];
}); if (res.data) {
}, let tempDateList = [];
/** res.data.nameData.forEach((date) => {
* 获取产量分析数据 tempDateList.push(date.name);
*/ });
getData() { this.dateLabelList = Array.from(new Set(tempDateList));
this.dataListLoading = true; // 开启加载状态
this.urlOptions.getDataListURL(this.listQuery)
.then((res) => {
let arr = [
{
prop: 'lineName',
label: '产线',
fixed: 'left',
},
{
prop: 'sum',
label: '合计[片]',
fixed: 'left',
},
{
prop: res.data ? res.data.nameData[0].name : undefined,
label: res.data ? res.data.nameData[0].name : undefined,
align: 'center',
children: [],
},
];
let xData = []; this.dateLabelList.forEach((item) => {
let yAllData = []; if (item.indexOf('年') === -1) {
let lineName = []; // 构造表头
if (res.data) { const props = {
// 处理日期标签去重 prop: item,
let tempDateList = []; label: item,
res.data.nameData.forEach((date) => { };
tempDateList.push(date.name); arr[2].children.push(props);
});
this.dateLabelList = Array.from(new Set(tempDateList));
// 构造表头children和echarts横坐标 // 构造echarts横坐标
this.dateLabelList.forEach((item) => { xData.push(item);
if (item.indexOf('年') === -1) { }
arr[2].children.push({ });
prop: item, // res.data.nameData.slice(1).forEach(item => {
label: item, // const props = {
}); // 'prop': item.name,
xData.push(item); // 'label': item.name,
} // 'align': 'center'
}); // }
// arr[2].children.push(props)
// })
let tableDataArr = [];
res.data.data.forEach((item) => {
let obj = {};
(obj.lineName = item.lineName),
(obj.sum = item.sum),
item.data.forEach((ele, index) => {
// console.log(ele)
ele.children.forEach((e) => {
console.log(e.dynamicName);
obj['' + e.dynamicName + ''] = e.dynamicValue;
console.log(obj['' + e.dynamicName + '']);
});
});
tableDataArr.push(obj);
});
this.tableData = tableDataArr;
this.tableProps = arr;
// 构造表格数据 // let tempList = []
let tableDataArr = []; // res.data.nameData.slice(1).forEach(item => {
res.data.data.forEach((item) => { // tempList.push(item.name)
let obj = { // // arr[2].children.push(props)
lineName: item.lineName, // })
sum: item.sum, // xData = Array.from(new Set(tempList))
};
item.data.forEach((ele) => {
ele.children.forEach((e) => {
obj[e.dynamicName] = e.dynamicValue;
});
});
tableDataArr.push(obj);
});
this.tableData = tableDataArr;
this.tableProps = arr;
// 构造图表数据 res.data.data.forEach((item) => {
res.data.data.forEach((item) => { let yData = [];
let yData = []; lineName.push(item.lineName);
lineName.push(item.lineName); // let obj = {}
item.data.forEach((ele) => { // obj.lineName = item.lineName,
ele.children.forEach((e) => { // obj.sum = item.sum,
yData.push(e.dynamicValue); item.data.forEach((ele, index) => {
}); // console.log(ele)
}); ele.children.forEach((e) => {
yAllData.push(yData); // let yData = []
}); yData.push(e.dynamicValue);
} else { });
this.tableProps = arr; });
this.tableData = []; yAllData.push(yData);
xData = []; });
yAllData = []; console.log(lineName);
lineName = []; } else {
} this.tableProps = arr;
this.tableData = [];
// 初始化图表 xData = [];
this.$nextTick(() => { yAllData = [];
this.$refs.lineChart.initChart(xData, yAllData, lineName); lineName = [];
}); }
}) // res.data.data[0].data[0].children.forEach((item, index) => {
.catch((err) => { // // console.log(item)
console.error('获取产量数据失败:', err); // yData.push(item.dynamicValue)
this.tableData = []; // // let data = 'data' + Number(index+1)
}) // // obj['' + item.dynamicName + ''] = item.dynamicValue
.finally(() => { // })
this.dataListLoading = false; // 关闭加载状态 // console.log(this.yData)
}); this.$nextTick(() => {
}, this.$refs.lineChart.initChart(xData, yAllData, lineName);
/** });
* 搜索栏按钮点击事件 // this.total = response.data.total;
* @param {Object} val - 按钮/表单传递的参数 // this.dataListLoading = false;
*/ });
buttonClick(val) { },
switch (val.btnName) { buttonClick(val) {
case 'search': switch (val.btnName) {
// 处理产线参数避免undefined空值设为空数组 case 'search':
this.listQuery.lineIds = val.lineIds || []; this.listQuery.lineIds = val.lineIds ? val.lineIds : undefined;
// 处理时间参数:如果是时间字符串,可转换为时间戳(根据接口要求调整) // this.listQuery.productId = val.productId;
if (val.time) { this.listQuery.time = val.time
// this.listQuery.time = val.time; ? new Date(val.time).getTime()
// 若接口需要时间戳,取消下面注释: : undefined;
this.listQuery.time = new Date(val.time).getTime(); // this.listQuery.pageNo = 1;
} else { // this.listQuery.pageSize = 10;
this.$message({ if (val.time) {
message: '请选择时间', this.getData();
type: 'warning', } else {
}); this.$message({
return; message: '请选择时间',
} type: 'warning',
});
// 验证产线是否选择(可选,根据业务需求调整) }
if (this.listQuery.lineIds.length === 0) { break;
this.$message({ case 'reset':
message: '请选择至少一条产线', this.$refs.searchBarForm.resetForm();
type: 'warning', this.listQuery = {
}); pageSize: 10,
return; pageNo: 1,
} total: 1,
};
this.getData(); this.getDataList();
break; break;
case 'reset': default:
// 重置表单 console.log(val);
this.$refs.searchBarForm.resetForm(); }
// 恢复默认值 },
this.listQuery = { },
lineIds: this.formConfig[1].defaultSelect || [],
time: this.formConfig[0].defaultValue || '',
};
break;
default:
console.log(val);
}
},
},
}; };
</script> </script>

View File

@@ -279,8 +279,7 @@ export default {
filterable: true, filterable: true,
clearable: true, clearable: true,
}, },
}, },
// { // {
// select: true, // select: true,
// label: '设备分组', // label: '设备分组',

View File

@@ -92,7 +92,7 @@ export default {
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
}, },
{ prop: 'name', label: '设备类型名称' }, { prop: 'name', label: '设备类型名称' },
{ prop: 'code', label: '设备类型编码' }, { prop: 'code', label: '检测类型编码' },
{ prop: 'remark', label: '备注' }, { prop: 'remark', label: '备注' },
], ],
searchBarFormConfig: [ searchBarFormConfig: [

View File

@@ -66,30 +66,20 @@
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="完成单位产品用时(S)" prop="processTime"> <el-form-item label="完成单位产品用时" prop="processTime">
<el-input :disabled="isdetail" v-model="dataForm.processTime" placeholder="请输入完成单位产品用时(S)" /> <el-input :disabled="isdetail" v-model="dataForm.processTime" placeholder="请输入完成单位产品用时" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label=" 产品工艺" prop="processTypes"> <el-form-item label=" 加工属性" prop="processType">
<el-select :disabled="isdetail" collapse-tags multiple v-model="dataForm.processTypes" clearable <el-select v-model="dataForm.processType" clearable style="width: 100%" :disabled="isdetail"
style="width: 100%" placeholder="请选择产品工艺"> placeholder="请选择加工属性">
<el-option v-for="dict in processTypeList" :key="dict.value" :label="dict.label" <el-option v-for="dict in processTypeList" :key="dict.id" :label="dict.label"
:value="dict.value" /> :value="dict.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!-- <el-row :gutter="20">
<el-col :span="12">
<el-form-item label=" 基板类型" prop="typeDictValue">
<el-select :disabled="isdetail" v-model="dataForm.typeDictValue" clearable
style="width: 100%" placeholder="请选择基板类型">
<el-option v-for="dict in typeList" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
</el-col>
</el-row> -->
</el-form> </el-form>
<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true"> <small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
@@ -141,361 +131,317 @@
<script> <script>
import { import {
deleteProductAttr, deleteProductAttr,
getProductAttrPage, getProductAttrPage,
} from '@/api/core/base/productAttr'; } from '@/api/core/base/productAttr';
import { import {
createProduct, createProduct,
updateProduct, updateProduct,
getProduct, getProduct,
getCode, getCode,
} from '@/api/core/base/product'; } from '@/api/core/base/product';
import productAttrAdd from './attr-add'; import productAttrAdd from './attr-add';
import { parseTime } from '../../mixins/code-filter'; import { parseTime } from '../../mixins/code-filter';
import SmallTitle from './SmallTitle'; import SmallTitle from './SmallTitle';
import { listData } from "@/api/system/dict/data"; //数据字典接口
const tableBtn = [ const tableBtn = [
{ {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑',
}, },
{ {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',
}, },
]; ];
const tableProps = [ const tableProps = [
{ {
prop: 'createTime', prop: 'createTime',
label: '添加时间', label: '添加时间',
filter: parseTime, filter: parseTime,
}, },
{ {
prop: 'name', prop: 'name',
label: '属性名', label: '属性名',
}, },
{ {
prop: 'value', prop: 'value',
label: '属性值', label: '属性值',
}, },
]; ];
export default { export default {
components: { productAttrAdd, SmallTitle }, components: { productAttrAdd, SmallTitle },
data() { data() {
return { return {
visible: false, visible: false,
addOrUpdateVisible: false, addOrUpdateVisible: false,
tableBtn, tableBtn,
tableProps, tableProps,
productAttributeList: [], productAttributeList: [],
dataForm: { dataForm: {
id: null, id: null,
name: '', // 产品名称 name: '', // 产品名称
code: '', // 产品编码 code: '', // 产品编码
area: 0, // 深加工单位平方数(float only) area: 0, // 深加工单位平方数(float only)
typeDictValue: null, // 产品类型id typeDictValue: null, // 产品类型id
processTime: null, // 单位产品用时 (s) processTime: null, // 单位产品用时 (s)
specifications: '', // 深加工规格 specifications: '', // 深加工规格
unitDictValue: '', // 单位id unitDictValue: '', // 单位id
originalSpecifications: '', // 原片规格 originalSpecifications: '', // 原片规格
originalArea: 0, // 原片单位平方数 originalArea: 0, // 原片单位平方数
processTypes: [], processType:undefined,
typeDictValue: null, },
}, listQuery: {
typeList:[], pageSize: 10,
listQuery: { pageNo: 1,
pageSize: 10, total: 0,
pageNo: 1,
total: 0,
}, },
processTypeList: [ processTypeList: [
// { {
// value: '1', id: '0',
// label: '压花丝印' label:'压花丝印'
// }, },
// { {
// value: '2', id: '1',
// label: '无印打孔' label: '无印打孔'
// }, },
// { {
// value: '3', id: '2',
// label: '单层镀膜' label: '单层镀膜'
// }, { }, {
// value: '4', id: '3',
// label: '双层镀膜' label: '双层镀膜'
// } }
], ],
dataRule: { dataRule: {
code: [ code: [
{ {
required: true, required: true,
message: '产品编码不能为空', message: '产品编码不能为空',
trigger: 'blur', trigger: 'blur',
}, },
// { // {
// type: 'number', // type: 'number',
// message: '产品编码为数字类型', // message: '产品编码为数字类型',
// trigger: 'blur', // trigger: 'blur',
// transfom: 'val => Number(val)', // transfom: 'val => Number(val)',
// }, // },
], ],
name: [ name: [
{ {
required: true, required: true,
message: '产品名称不能为空', message: '产品名称不能为空',
trigger: 'blur', trigger: 'blur',
}, },
], ],
typeDictValue: [ typeDictValue: [
{ {
required: true, required: true,
message: '产品类型不能为空', message: '产品类型不能为空',
trigger: 'blur', trigger: 'blur',
}, },
], ],
area: [ area: [
{ {
type: 'number', type: 'number',
message: '请输入正确的数值', message: '请输入正确的数值',
trigger: 'change', trigger: 'change',
transform: (val) => Number(val), transform: (val) => Number(val),
}, },
], ],
processTime: [ processTime: [
{ {
required: true, required: true,
message: '完成单位产品用时不能为空', message: '完成单位产品用时不能为空',
trigger: 'blur', trigger: 'blur',
}, },
{ {
type: 'number', type: 'number',
message: '请输入正确的数值', message: '请输入正确的数值',
trigger: 'blur', trigger: 'blur',
transform: (val) => Number(val), transform: (val) => Number(val),
}, },
], ],
}, },
isdetail: false, isdetail: false,
}; };
}, },
methods: { methods: {
async initData() { initData() {
this.productAttributeList.splice(0); this.productAttributeList.splice(0);
this.listQuery.total = 0; this.listQuery.total = 0;
const typeRes = await listData({ },
pageNo: init(id, isdetail) {
1, this.initData();
pageSize this.isdetail = isdetail || false;
: 10, this.dataForm.id = id || null;
dictType this.visible = true;
: 'product_type'
})
this.typeList = typeRes.data.list this.$nextTick(() => {
console.log('typeRes', this.typeList); this.$refs['dataForm'].resetFields();
const processTypeRes = await listData({
pageNo:
1,
pageSize
: 10,
dictType
: 'process_type'
})
this.processTypeList = processTypeRes.data.list if (this.dataForm.id) {
console.log('typeRes', this.typeList); // 获取产品详情
}, getProduct(id).then((response) => {
init(id, isdetail) { this.dataForm = response.data;
this.initData(); });
this.isdetail = isdetail || false; // 获取产品的属性列表
this.dataForm.id = id || null; this.getList();
// this.dataForm.processTypes = [] // 清空工艺选择 } else {
this.visible = true; getCode().then((res) => {
this.dataForm.code = res.data;
});
}
});
},
this.$nextTick(() => { getList() {
this.$refs['dataForm'].resetFields(); // 获取产品的属性列表
getProductAttrPage({
if (this.dataForm.id) { ...this.listQuery,
// 获取产品详情 productId: this.dataForm.id,
getProduct(id).then((res) => { }).then((response) => {
const resData = res.data || {}; this.productAttributeList = response.data.list;
// 逐个字段赋值(保留响应式) this.listQuery.total = response.data.total;
this.dataForm.name = resData.name || ''; });
this.dataForm.code = resData.code || ''; },
this.dataForm.area = resData.area || 0; handleClick(raw) {
this.dataForm.typeDictValue = resData.typeDictValue || null; if (raw.type === 'delete') {
this.dataForm.processTime = resData.processTime || null; this.$confirm(
this.dataForm.specifications = resData.specifications || ''; `确定对${
this.dataForm.unitDictValue = resData.unitDictValue || ''; raw.data.name
this.dataForm.originalSpecifications = resData.originalSpecifications || ''; ? '[名称=' + raw.data.name + ']'
this.dataForm.originalArea = resData.originalArea || 0; : '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
// 处理工艺列表:确保是数组,过滤空值 '提示',
this.dataForm.processTypes = resData.processType {
? resData.processType.split(',').filter(Boolean) confirmButtonText: '确定',
: []; cancelButtonText: '取消',
type: 'warning',
console.log('工艺列表(编辑时):', this.dataForm.processTypes); // 验证是否为 ["1","2"] 格式 }
}); )
// 获取产品的属性列表 .then(() => {
this.getList(); deleteProductAttr(raw.data.id).then(({ data }) => {
} else { this.$message({
getCode().then((res) => { message: '操作成功',
this.dataForm.code = res.data; type: 'success',
}); duration: 1500,
} onClose: () => {
}); this.getList();
}, },
});
getList() { });
// 获取产品的属性列表 })
getProductAttrPage({ .catch(() => {});
...this.listQuery, } else {
productId: this.dataForm.id, this.addNew(raw.data.id);
}).then((response) => { }
this.productAttributeList = response.data.list; },
this.listQuery.total = response.data.total; // 表单提交
}); dataFormSubmit() {
}, this.$refs['dataForm'].validate((valid) => {
handleClick(raw) { if (valid) {
if (raw.type === 'delete') { // 修改的提交
this.$confirm( if (this.dataForm.id) {
`确定对${raw.data.name updateProduct(this.dataForm).then((response) => {
? '[名称=' + raw.data.name + ']' this.$modal.msgSuccess('修改成功');
: '[序号=' + raw.data._pageIndex + ']' this.visible = false;
}进行删除操作?`, this.$emit('refreshDataList');
'提示', });
{ return;
confirmButtonText: '确定', }
cancelButtonText: '取消', // 添加的提交
type: 'warning', createProduct(this.dataForm).then((response) => {
} this.$modal.msgSuccess('新增成功');
) this.$confirm(`是否新增产品属性?`, '系统提示', {
.then(() => { confirmButtonText: '确定',
deleteProductAttr(raw.data.id).then(({ data }) => { cancelButtonText: '取消',
this.$message({ type: 'warning',
message: '操作成功', })
type: 'success', .then(() => {
duration: 1500,
onClose: () => {
this.getList();
},
});
});
})
.catch(() => { });
} else {
this.addNew(raw.data.id);
}
},
// 表单提交
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
// 修改的提交
if (this.dataForm.id) {
updateProduct(this.dataForm).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
// 添加的提交
createProduct(this.dataForm).then((response) => {
this.$modal.msgSuccess('新增成功');
this.$confirm(`是否新增产品属性?`, '系统提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
this.dataForm.id = response.data this.dataForm.id = response.data
this.addNew(); this.addNew();
}) })
.catch(() => { .catch(() => {
this.visible = false; this.visible = false;
this.$emit('refreshDataList'); this.$emit('refreshDataList');
}); });
}); });
} }
}); });
}, },
goEdit() { goEdit() {
this.isdetail = false; this.isdetail = false;
}, },
// 新增 / 修改 // 新增 / 修改
addNew(id) { addNew(id) {
if (this.dataForm.id) { if (this.dataForm.id) {
this.addOrUpdateVisible = true; this.addOrUpdateVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id); this.$refs.addOrUpdate.init(id);
}); });
} else { } else {
this.$message('请先创建产品!'); this.$message('请先创建产品!');
} }
}, },
goback() { goback() {
this.$emit('refreshDataList'); this.$emit('refreshDataList');
this.visible = false; this.visible = false;
this.initData(); this.initData();
}, },
}, },
}; };
</script> </script>
<style scoped> <style scoped>
.drawer>>>.el-drawer { .drawer >>> .el-drawer {
border-radius: 8px 0 0 8px; border-radius: 8px 0 0 8px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.drawer>>>.el-form-item__label { .drawer >>> .el-form-item__label {
padding: 0; padding: 0;
} }
.drawer>>>.el-drawer__header { .drawer >>> .el-drawer__header {
margin: 0; margin: 0;
padding: 32px 32px 24px; padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6; border-bottom: 1px solid #dcdfe6;
}
.drawer >>> .el-drawer__body {
flex: 1;
height: 1px;
display: flex;
flex-direction: column;
} }
.drawer>>>.el-drawer__body { .drawer >>> .content {
flex: 1; padding: 30px 24px;
height: 1px; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
/* height: 100%; */
} }
.drawer>>>.content { .drawer >>> .visual-part {
padding: 30px 24px; flex: 1 auto;
flex: 1; max-height: 76vh;
display: flex; overflow: hidden;
flex-direction: column; overflow-y: scroll;
/* height: 100%; */ padding-right: 10px; /* 调整滚动条样式 */
} }
.drawer>>>.visual-part { .drawer >>> .el-form,
flex: 1 auto; .drawer >>> .attr-list {
max-height: 76vh; padding: 0 16px;
overflow: hidden;
overflow-y: scroll;
padding-right: 10px;
/* 调整滚动条样式 */
}
.drawer>>>.el-form,
.drawer>>>.attr-list {
padding: 0 16px;
} }
.drawer-body__footer { .drawer-body__footer {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
padding: 18px; padding: 18px;
} }
</style> </style>

View File

@@ -1,142 +1,139 @@
<template> <template>
<el-dialog v-loading="isLoading" loading-text="处理中..." loading-spinner="el-icon-loading" <el-dialog
loading-background="rgba(255, 255, 255, 0.7)" :visible.sync="visible" :width="'35%'" :append-to-body="true" :visible.sync="visible"
:close-on-click-modal="false" class="dialog"> :width="'35%'"
<template #title> :append-to-body="true"
<slot name="title"> :close-on-click-modal="false"
<div class="titleStyle"> class="dialog">
{{ !dataForm.id ? '新增' : '编辑' }} <template #title>
</div> <slot name="title">
</slot> <div class="titleStyle">
</template> {{ !dataForm.id ? '新增' : '编辑' }}
</div>
</slot>
</template>
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px" <el-form
@keyup.enter.native="dataFormSubmit()"> ref="dataForm"
<el-form-item label="属性名" prop="name"> :model="dataForm"
<el-input v-model="dataForm.name" placeholder="请输入属性名" clearable /> :rules="dataRule"
</el-form-item> label-width="100px"
<el-form-item label="属性值" prop="value"> @keyup.enter.native="dataFormSubmit()">
<el-input v-model="dataForm.value" placeholder="请输入属性" clearable /> <el-form-item label="属性" prop="name">
</el-form-item> <el-input
</el-form> v-model="dataForm.name"
placeholder="请输入属性名"
clearable />
</el-form-item>
<el-form-item label="属性值" prop="value">
<el-input
v-model="dataForm.value"
placeholder="请输入属性值"
clearable />
</el-form-item>
</el-form>
<el-row style="text-align: right"> <el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button> <el-button @click="visible = false">取消</el-button>
<el-button :loading="isLoading" type="primary" @click="dataFormSubmit()">确定</el-button> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row> </el-row>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { import {
createProductAttr, createProductAttr,
updateProductAttr, updateProductAttr,
getProductAttr, getProductAttr,
} from '@/api/core/base/productAttr'; } from '@/api/core/base/productAttr';
export default { export default {
props: { props: {
productId: { productId: {
type: String, type: String,
default: '', default: '',
}, },
}, },
data() { data() {
return { return {
visible: false, visible: false,
isLoading: false, dataForm: {
dataForm: { id: 0,
id: 0, name: '',
name: '', value: '',
value: '', },
}, dataRule: {
dataRule: { name: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
name: [{ required: true, message: '名称不能为空', trigger: 'blur' }], },
}, };
}; },
}, methods: {
methods: { init(id) {
init(id) { this.dataForm.id = id || '';
this.dataForm.id = id || ''; this.visible = true;
this.visible = true; this.$nextTick(() => {
this.$nextTick(() => { this.$refs['dataForm'].resetFields();
this.$refs['dataForm'].resetFields(); if (this.dataForm.id) {
if (this.dataForm.id) { getProductAttr(this.dataForm.id).then((res) => {
getProductAttr(this.dataForm.id).then((res) => { const { name, value } = res.data;
const { name, value } = res.data; this.dataForm.name = name;
this.dataForm.name = name; this.dataForm.value = value;
this.dataForm.value = value; });
}).catch(err => { }
console.error('获取属性详情失败:', err); });
this.$modal.msgError('获取数据失败,请重试'); },
}); // 表单提交
} dataFormSubmit() {
}); this.$refs['dataForm'].validate((valid) => {
}, if (valid) {
// 表单提交(优化加载状态和错误处理) // 修改的提交
async dataFormSubmit() { if (this.dataForm.id) {
// 先验证表单 updateProductAttr({
const valid = await new Promise((resolve) => { ...this.dataForm,
this.$refs['dataForm'].validate((isValid) => resolve(isValid)); productId: this.productId,
}); }).then((response) => {
this.$modal.msgSuccess('修改成功');
if (!valid) return; this.visible = false;
this.$emit('refreshDataList');
this.isLoading = true; // 开始加载 });
return;
try { }
if (this.dataForm.id) { // 添加的提交
// 编辑操作 createProductAttr({
await updateProductAttr({ ...this.dataForm,
...this.dataForm, productId: this.productId,
productId: this.productId, }).then((response) => {
}); this.$modal.msgSuccess('新增成功');
this.$modal.msgSuccess('修改成功'); this.visible = false;
} else { this.$emit('refreshDataList');
// 新增操作 });
await createProductAttr({ }
...this.dataForm, });
productId: this.productId, },
}); },
this.$modal.msgSuccess('新增成功');
}
this.visible = false;
this.$emit('refreshDataList');
} catch (error) {
// 错误处理
console.error('提交失败:', error);
this.$modal.msgError('操作失败,请重试');
} finally {
// 无论成功失败,都关闭加载状态
this.isLoading = false;
}
},
},
}; };
</script> </script>
<style scoped> <style scoped>
.dialog>>>.el-dialog__body { .dialog >>> .el-dialog__body {
padding: 30px 24px; padding: 30px 24px;
} }
.dialog >>> .el-dialog__header {
.dialog>>>.el-dialog__header { font-size: 16px;
font-size: 16px; color: rgba(0, 0, 0, 0.85);
color: rgba(0, 0, 0, 0.85); font-weight: 500;
font-weight: 500; padding: 13px 24px;
padding: 13px 24px; border-bottom: 1px solid #e9e9e9;
border-bottom: 1px solid #e9e9e9;
} }
.dialog >>> .el-dialog__header .titleStyle::before {
.dialog>>>.el-dialog__header .titleStyle::before { content: '';
content: ''; display: inline-block;
display: inline-block; width: 4px;
width: 4px; height: 16px;
height: 16px; background-color: #0b58ff;
background-color: #0b58ff; border-radius: 1px;
border-radius: 1px; margin-right: 8px;
margin-right: 8px; position: relative;
position: relative; top: 2px;
top: 2px;
} }
</style> </style>

View File

@@ -104,11 +104,7 @@ export default {
getDataListURL: getProductionLinePage, getDataListURL: getProductionLinePage,
deleteURL: deleteProductionLine, deleteURL: deleteProductionLine,
exportURL: exportProductionLineExcel, exportURL: exportProductionLineExcel,
}, },
listQuery: {
pageSize: 20,
pageNo:1
},
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi(`base:production-line:update`) this.$auth.hasPermi(`base:production-line:update`)
@@ -216,7 +212,7 @@ export default {
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':
this.listQuery.pageNo = 1; this.listQuery.pageNo = 1;
this.listQuery.pageSize = 20; this.listQuery.pageSize = 10;
this.listQuery.factoryId = val.factoryId || undefined; this.listQuery.factoryId = val.factoryId || undefined;
this.listQuery.name = val.name; this.listQuery.name = val.name;
this.getDataList(); this.getDataList();
@@ -224,7 +220,7 @@ export default {
case 'reset': case 'reset':
this.$refs.searchBarForm.resetForm(); this.$refs.searchBarForm.resetForm();
this.listQuery = { this.listQuery = {
pageSize: 20, pageSize: 10,
pageNo: 1, pageNo: 1,
total: 1, total: 1,
}; };

View File

@@ -262,14 +262,6 @@ export default {
tooltip: { tooltip: {
valueFormatter: (value) => `${value} %`, valueFormatter: (value) => `${value} %`,
}, },
label: {
show: true,
position: 'top',
distance: 6,
fontSize: 11,
color: '#333333',
formatter: (params) => `${params.value}` // 显示单位
},
data: this.barData.map((item) => item.processingRatio), data: this.barData.map((item) => item.processingRatio),
}, },
], ],

View File

@@ -34,9 +34,9 @@
<el-tabs v-model="activeLabel" :stretch="true" @tab-click="handleTabClick"> <el-tabs v-model="activeLabel" :stretch="true" @tab-click="handleTabClick">
<el-tab-pane :label="'全部数据'" name="table"> <el-tab-pane :label="'全部数据'" name="table">
<base-table-s ref="lineCurrentShiftTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'" <base-table-s ref="lineCurrentShiftTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'"
:page="1" :limit="100" :table-props="tableProps" :table-data="tableData" :max-height="220" /> :page="1" :limit="100" :table-props="tableProps" :table-data="tableData" :max-height="210" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="'\u3000生产折线图\u3000'" name="graph"> <el-tab-pane :label="'\u3000当天生产折线图\u3000'" name="graph">
<div style="height: 230px;" v-if="activeLabel == 'graph'" class="graph"> <div style="height: 230px;" v-if="activeLabel == 'graph'" class="graph">
<barChart v-if="tableData && tableData.length > 0" ref="barChart" height="230px" <barChart v-if="tableData && tableData.length > 0" ref="barChart" height="230px"
:bar-data="tableData" /> :bar-data="tableData" />
@@ -57,9 +57,9 @@
<el-tabs v-model="activeLabelDay" :stretch="true" @tab-click="handleTabClick"> <el-tabs v-model="activeLabelDay" :stretch="true" @tab-click="handleTabClick">
<el-tab-pane :label="'全部数据'" name="table"> <el-tab-pane :label="'全部数据'" name="table">
<base-table-s ref="lineTodayTable" style="margin-bottom: 16px;" v-if="activeLabelDay == 'table'" <base-table-s ref="lineTodayTable" style="margin-bottom: 16px;" v-if="activeLabelDay == 'table'"
:page="1" :limit="100" :table-props="tableProps" :table-data="tableData2" :max-height="300" /> :page="1" :limit="100" :table-props="tableProps" :table-data="tableData2" :max-height="210" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="'\u3000生产折线图\u3000'" name="graph"> <el-tab-pane :label="'\u3000当天生产折线图\u3000'" name="graph">
<div style="height: 230px;" v-if="activeLabelDay == 'graph'" class="graph"> <div style="height: 230px;" v-if="activeLabelDay == 'graph'" class="graph">
<barChart v-if="tableData2 && tableData2.length > 0" ref="barChart" height="230px" <barChart v-if="tableData2 && tableData2.length > 0" ref="barChart" height="230px"
:bar-data="tableData2" /> :bar-data="tableData2" />
@@ -71,7 +71,9 @@
</el-row> </el-row>
</div> </div>
</div> </div>
<div class="content-inner" v-if="listQuery.timeType === 3">
<!-- 3.2 时间维度为自定义时的内容两个平分高度的div -->
<div class="content-inner" v-else>
<div class="content-card energyOverlimitLog"> <div class="content-card energyOverlimitLog">
<span class="blue-block"></span> <span class="blue-block"></span>
<span class="tip" v-if="listQuery.startTime && listQuery.endTime"> <span class="tip" v-if="listQuery.startTime && listQuery.endTime">
@@ -81,38 +83,10 @@
parseTime(listQuery.endTime) }} parseTime(listQuery.endTime) }}
</span> </span>
</span> </span>
<span class="tip" v-else>生产数据 </span> <span class="tip" v-else>生产表格数据 </span>
<div class="graph"> <div class="graph">
<base-table-s ref="lineCustomTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'" :page="1" <base-table-s ref="lineCustomTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'" :page="1"
:limit="100" :table-props="tableProps" :max-height="300" :table-data="tableDataCustom" /> :limit="100" :table-props="tableProps" :max-height="210" :table-data="tableDataCustom" />
</div>
</div>
<div class="content-card energyOverlimitLog">
<span class="blue-block"></span>
<span class="tip">生产折线图</span>
<div style="width: 100%;height: 100%;" class="graph">
<barChart v-if="tableDataCustom && tableDataCustom.length > 0" ref="barChart"
:bar-data="tableDataCustom" />
<div v-else class="no-data-bg"></div>
</div>
</div>
</div>
<!-- 3.2 时间维度为自定义时的内容两个平分高度的div -->
<div class="content-inner" v-if="listQuery.timeType === 2">
<div class="content-card energyOverlimitLog">
<span class="blue-block"></span>
<span class="tip" v-if="listQuery.startTime && listQuery.endTime">
<span>{{ reportTypeMap[listQuery.reportType] }}</span>
<span>
{{ parseTime(listQuery.startTime) }} {{
parseTime(listQuery.endTime) }}
</span>
</span>
<span class="tip" v-else>生产数据 </span>
<div class="graph">
<base-table-s ref="lineCustomTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'" :page="1"
:limit="100" :table-props="tableProps" :max-height="300" :table-data="tableDataCustom" />
</div> </div>
</div> </div>
@@ -139,7 +113,7 @@
<span class="tip">当班数据</span> <span class="tip">当班数据</span>
<base-table-s ref="productCurrentShiftTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'" <base-table-s ref="productCurrentShiftTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'"
:page="1" :limit="100" :table-props="productTableProps" :table-data="productTableData" :page="1" :limit="100" :table-props="productTableProps" :table-data="productTableData"
:max-height="300" /> :max-height="210" />
</div> </div>
<!-- 当天数据占1/2剩余高度 --> <!-- 当天数据占1/2剩余高度 -->
@@ -148,7 +122,7 @@
<span class="tip">当天数据</span> <span class="tip">当天数据</span>
<base-table-s ref="productTodayTable" style="margin-bottom: 16px;" v-if="activeLabelDay == 'table'" <base-table-s ref="productTodayTable" style="margin-bottom: 16px;" v-if="activeLabelDay == 'table'"
:page="1" :limit="100" :table-props="productTablePropsDay" :table-data="productTableDataDay" :page="1" :limit="100" :table-props="productTablePropsDay" :table-data="productTableDataDay"
:max-height="300" /> :max-height="210" />
</div> </div>
</div> </div>
</div> </div>
@@ -163,12 +137,12 @@
<span>{{ reportTypeMap[listQuery.reportType] }}</span> <span>{{ reportTypeMap[listQuery.reportType] }}</span>
<span> <span>
{{ parseTime(listQuery.startTime) }} {{ {{ parseTime(listQuery.startTime) }} {{
parseTime(listQuery.endTime) }} parseTime(listQuery.endTime) }}
</span> </span>
</span> </span>
<span class="tip" v-else>生产数据 </span> <span class="tip" v-else>生产表格数据 </span>
<base-table-s ref="productCustomTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'" :page="1" <base-table-s ref="productCustomTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'" :page="1"
:limit="100" :table-props="productTableProps" :table-data="productTableData" :max-height="300" /> :limit="100" :table-props="productTableProps" :table-data="productTableData" :max-height="210" />
</div> </div>
</div> </div>
</div> </div>
@@ -179,8 +153,8 @@
<script> <script>
import { parseTime } from '@/filter/code-filter'; import { parseTime } from '@/filter/code-filter';
import { import {
getLineAuto, getPLlistByFactory, getPdlAutoReportNewSearchNow, getProcessAutoReportLastGroup, getLineAuto, getPdList, getPdlAutoReportNewSearchNow, getProductAuto,
getProcessAutoReportGroup, getProcessAutoReportDay, getProcessAutoReportNew, getPdlAutoReportNewSearchLastGroup getProcessAutoReportGroup, getProcessAutoReportDay, getProcessAutoReportNew
} from '@/api/core/monitoring/auto'; } from '@/api/core/monitoring/auto';
import { getFactoryPage } from '@/api/core/base/factory'; import { getFactoryPage } from '@/api/core/base/factory';
import * as XLSX from 'xlsx'; import * as XLSX from 'xlsx';
@@ -191,11 +165,11 @@ import ButtonNav from '@/components/ButtonNav';
import { listData } from '@/api/system/dict/data'; import { listData } from '@/api/system/dict/data';
// 表格列配置 // 表格列配置
const tableProps = [ const tableProps = [
{ // {
prop: 'factoryName', // prop: 'factoryName',
label: '工厂', // label: '工厂',
fixed: true // fixed: true
}, // },
{ {
prop: 'lineName', prop: 'lineName',
label: '产线', label: '产线',
@@ -381,7 +355,6 @@ export default {
activeLabel: 'table', // 当班数据tab activeLabel: 'table', // 当班数据tab
activeLabelDay: 'table', // 当天数据tab activeLabelDay: 'table', // 当天数据tab
fileName: '', fileName: '',
headFormValue:{},
dataListLoading: false, dataListLoading: false,
tableProps, tableProps,
factoryColumns: [], factoryColumns: [],
@@ -395,28 +368,15 @@ export default {
productTableDataDay: [], productTableDataDay: [],
tableDataCustom: [], tableDataCustom: [],
list: [], // 折线图数据 list: [], // 折线图数据
timeTypeOptions: {
productLine: [ // 按产线监控(包含上一班)
{ id: 1, name: '当天' },
{ id: 2, name: '自定义' },
{ id: 3, name: '上一班' }
],
product: [ // 按产品监控(不含上一班)
{ id: 1, name: '当天' },
{ id: 2, name: '自定义' },
{ id: 3, name: '上一班' }
]
},
formConfig: [ formConfig: [
{ {
type: 'select', type: 'select',
label: '时间维度', label: '时间维度',
selectOptions: [ selectOptions: [
{ id: 1, name: '当天' }, { id: 1, name: '当天' },
{ id: 2, name: '自定义' }, { id: 2, name: '自定义' }
{ id: 3, name: '上一班' }
], ],
width: 100, width: 80,
onchange: true, onchange: true,
// defaultSelect: 1, // defaultSelect: 1,
clearable: false, clearable: false,
@@ -477,7 +437,6 @@ export default {
{ id: 3, name: '月' }, { id: 3, name: '月' },
{ id: 4, name: '年' } { id: 4, name: '年' }
], ],
onchange: true,
width: 80, width: 80,
param: 'reportType' param: 'reportType'
}, },
@@ -501,12 +460,6 @@ export default {
btnName: '重置', btnName: '重置',
name: 'reset', name: 'reset',
}, },
// {
// type: 'label', // 初始隐藏
// label: '刷新时间', // 自定义标识
// // slot: 'currentTimeSlot', // 自定义插槽名
// // width: 200, // 宽度适配
// },
] ]
}; };
}, },
@@ -514,13 +467,6 @@ export default {
productTableProps() { productTableProps() {
// 当班数据的完整表头(基础列 + 当班动态表头) // 当班数据的完整表头(基础列 + 当班动态表头)
const baseColumns = [ const baseColumns = [
{
prop: 'sizes',
label: '规格',
width: 105,
showOverflowtooltip: true,
fixed: true
},
{ {
prop: 'process', prop: 'process',
label: '产品工艺', label: '产品工艺',
@@ -529,9 +475,8 @@ export default {
{ {
prop: 'processType', prop: 'processType',
label: '产品类型', label: '产品类型',
filter: (val) => (val === 1 ? '面板' : '背板'), filter: (val) => (val != 1 ? '面板' : '背板'),
fixed: true, fixed: true
sortable: true,
}, },
{ {
prop: 'factoryName', prop: 'factoryName',
@@ -544,13 +489,6 @@ export default {
productTablePropsDay() { productTablePropsDay() {
// 当天数据的完整表头(基础列 + 当天动态表头) // 当天数据的完整表头(基础列 + 当天动态表头)
const baseColumns = [ const baseColumns = [
{
prop: 'sizes',
label: '规格',
width: 105,
showOverflowtooltip: true,
fixed: true
},
{ {
prop: 'process', prop: 'process',
label: '产品工艺', label: '产品工艺',
@@ -559,8 +497,7 @@ export default {
{ {
prop: 'processType', prop: 'processType',
label: '产品类型', label: '产品类型',
filter: (val) => (val === 1 ? '面板' : '背板'), filter: (val) => (val != 1 ? '面板' : '背板'),
sortable: true,
fixed: true fixed: true
}, },
{ {
@@ -576,20 +513,17 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.buttonNav) { if (this.$refs.buttonNav) {
this.$refs.buttonNav.currentMenu = '按产线监控'; this.$refs.buttonNav.currentMenu = '按产线监控';
this.formConfig[0].selectOptions = this.timeTypeOptions.productLine;
} }
if (this.$refs.searchBarForm) { if (this.$refs.searchBarForm) {
// this.$refs.searchBarForm.formInline.timeVal = [ // this.$refs.searchBarForm.formInline.timeVal = [
// yesterday.getTime(), // yesterday.getTime(),
// end.getTime() // end.getTime()
// ]; // ];
this.$refs.searchBarForm.formInline.timeType = 1
this.$refs.searchBarForm.formInline.timeType = 3
} }
}); });
// this.getLastDayDataList(); this.getDayDataList();
this.getPdLineList(); this.getPdLineList();
const queryParams = { const queryParams = {
pageNo: 1, pageNo: 1,
@@ -638,69 +572,22 @@ export default {
this.formConfig[1].type = ''; // 隐藏查询类型 this.formConfig[1].type = ''; // 隐藏查询类型
this.formConfig[6].type = ''; // 隐藏报表类型 this.formConfig[6].type = ''; // 隐藏报表类型
this.formConfig[7].type = ''; // 隐藏时间范围 this.formConfig[7].type = ''; // 隐藏时间范围
const timeItemIndex = this.formConfig.findIndex(item =>
item.label?.includes('刷新时间')
);
if (timeItemIndex > -1) {
this.formConfig.splice(timeItemIndex, 1);
}
}; };
// 3. 执行公共重置 // 3. 执行公共重置
resetCommon(); resetCommon();
// if (this.activeName === 'productLine') {
// } else {
// }
// 4. 根据类型设置差异化的表单配置(仅处理不同的部分) // 4. 根据类型设置差异化的表单配置(仅处理不同的部分)
if (isProductLine) { if (isProductLine) {
// 按产线监控:显示产线,隐藏产品工艺和类型,时间维度包含上一班 // 按产线监控:显示产线,隐藏产品工艺和类型
this.formConfig[0].selectOptions = this.timeTypeOptions.productLine; // 恢复上一班选项
this.formConfig[3].type = 'select'; // 显示产线 this.formConfig[3].type = 'select'; // 显示产线
this.formConfig[4].type = ''; // 隐藏产品工艺 this.formConfig[4].type = ''; // 隐藏产品工艺
this.formConfig[5].type = ''; // 隐藏产品类型 this.formConfig[5].type = ''; // 隐藏产品类型
this.listQuery.timeType = 3;
if (this.$refs.searchBarForm) {
this.$refs.searchBarForm.formInline.timeType = 3;
}
// 主动调用上一班数据接口
this.getLastDayDataList();
const timeItemIndex = this.formConfig.findIndex(item =>
item.label?.includes('刷新时间')
);
const timeLabel = {
type: 'label',
label: `刷新时间: ${this.formatCurrentTime()}`,
};
if (timeItemIndex > -1) {
this.formConfig.splice(timeItemIndex, 1, timeLabel);
} else {
this.formConfig.push(timeLabel);
}
} else { } else {
// 按产品监控:显示产品工艺和类型,隐藏产线
// 按产品监控:显示产品工艺和类型,隐藏产线,时间维度移除上一班
this.formConfig[0].selectOptions = this.timeTypeOptions.product; // 不含上一班
this.formConfig[3].type = ''; // 隐藏产线 this.formConfig[3].type = ''; // 隐藏产线
this.formConfig[4].type = 'select'; // 显示产品工艺 this.formConfig[4].type = 'select'; // 显示产品工艺
this.formConfig[5].type = 'select'; // 显示产品类型 this.formConfig[5].type = 'select'; // 显示产品类型
const timeItemIndex = this.formConfig.findIndex(item =>
item.label?.includes('刷新时间')
);
const timeLabel = {
type: 'label',
label: `刷新时间: ${this.formatCurrentTime()}`,
};
this.listQuery.timeType = 3;
if (this.$refs.searchBarForm) {
this.$refs.searchBarForm.formInline.timeType = 3;
}
if (timeItemIndex > -1) {
this.formConfig.splice(timeItemIndex, 1, timeLabel);
} else {
this.formConfig.push(timeLabel);
}
this.getProductLastList();
} }
}, },
@@ -714,12 +601,6 @@ export default {
{ ref: 'lineCurrentShiftTable', name: '产线监控_当班数据' }, { ref: 'lineCurrentShiftTable', name: '产线监控_当班数据' },
{ ref: 'lineTodayTable', name: '产线监控_当天数据' } { ref: 'lineTodayTable', name: '产线监控_当天数据' }
], '产线监控_当班及当天数据汇总'); // 传入自定义汇总文件名 ], '产线监控_当班及当天数据汇总'); // 传入自定义汇总文件名
} else if (this.listQuery.timeType === 1) {
// 产线-当天:导出当班 + 当天两个表格(自定义汇总文件名)
this.exportMultipleTables([
{ ref: 'lineCurrentShiftTable', name: '产线监控_上一班数据' },
{ ref: 'lineTodayTable', name: '产线监控_当天数据' }
], '产线监控_当班及当天数据汇总'); // 传入自定义汇总文件名
} else { } else {
// 产线-自定义:导出一个表格(自定义文件名) // 产线-自定义:导出一个表格(自定义文件名)
this.exportSingleTable('lineCustomTable', '产线监控_自定义时间数据'); this.exportSingleTable('lineCustomTable', '产线监控_自定义时间数据');
@@ -912,9 +793,7 @@ export default {
}, },
// 获取产线和工厂列表 // 获取产线和工厂列表
getPdLineList() { getPdLineList() {
getPLlistByFactory({ getPdList().then(res => {
factoryIds:this.listQuery.factoryIds
}).then(res => {
this.formConfig[3].selectOptions = res.data || []; this.formConfig[3].selectOptions = res.data || [];
}); });
@@ -922,151 +801,31 @@ export default {
this.formConfig[2].selectOptions = res.data.list || []; this.formConfig[2].selectOptions = res.data.list || [];
}); });
}, },
getWeekTimeRange(date) {
const targetDate = new Date(date);
const day = targetDate.getDay() || 7; // 周日转为7
const year = targetDate.getFullYear();
const month = targetDate.getMonth();
const dateNum = targetDate.getDate();
// 本周一 00:00:00
const startDate = new Date(year, month, dateNum - day + 1);
startDate.setHours(0, 0, 0, 0);
// 本周日 23:59:59
const endDate = new Date(year, month, dateNum - day + 7);
endDate.setHours(23, 59, 59, 999);
return {
startTime: startDate.getTime(),
endTime: endDate.getTime()
};
},
// 辅助函数获取本年的开始和结束时间戳1月1日00:00:00 到 12月31日23:59:59
getYearTimeRange(date) {
const targetDate = new Date(date);
const year = targetDate.getFullYear();
// 本年1月1日 00:00:00
const startDate = new Date(year, 0, 1);
startDate.setHours(0, 0, 0, 0);
// 本年12月31日 23:59:59
const endDate = new Date(year, 11, 31);
endDate.setHours(23, 59, 59, 999);
return {
startTime: startDate.getTime(),
endTime: endDate.getTime()
};
},
// 搜索/导出按钮点击 // 搜索/导出按钮点击
buttonClick(val) { buttonClick(val) {
this.headFormValue = val
if (this.activeName === 'productLine') {
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.factoryId = this.headFormValue.factoryId || undefined;
this.listQuery.process = this.headFormValue.process ? this.headFormValue.process : [];
this.listQuery.lineId = this.headFormValue.lineId ? this.headFormValue.lineId : [];
this.listQuery.processType = this.headFormValue.processType ? this.headFormValue.processType : [];
this.listQuery.reportType = this.headFormValue.reportType || undefined;
this.listQuery.timeType = this.headFormValue.timeType || undefined;
this.listQuery.searchType = this.headFormValue.searchType || undefined;
// 处理不同时间选择类型
if (this.headFormValue.timeVal) {
this.listQuery.startTime = this.headFormValue.timeVal[0];
this.listQuery.endTime = this.headFormValue.timeVal[1];
} else if (this.headFormValue.timeValWeek) {
// 周选择器
const { startTime, endTime } = this.getWeekTimeRange(this.headFormValue.timeValWeek);
this.listQuery.startTime = startTime;
this.listQuery.endTime = endTime;
} else if (this.headFormValue.timeValMonth) {
// 月选择器
this.listQuery.startTime = this.headFormValue.timeValMonth[0];
this.listQuery.endTime = this.headFormValue.timeValMonth[1];
} else if (this.headFormValue.timeValYear) {
// 年选择器
const { startTime, endTime } = this.getYearTimeRange(this.headFormValue.timeValYear);
this.listQuery.startTime = startTime;
this.listQuery.endTime = endTime;
} else {
this.listQuery.startTime = undefined;
this.listQuery.endTime = undefined;
}
} else {
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.factoryId = this.headFormValue.factoryId || []
this.listQuery.process = this.headFormValue.process ? this.headFormValue.process : [];
this.listQuery.lineId = undefined;
this.listQuery.processType = this.headFormValue.processType ? this.headFormValue.processType : [];
this.listQuery.reportType = this.headFormValue.reportType || undefined;
this.listQuery.timeType = this.headFormValue.timeType || undefined;
this.listQuery.searchType = this.headFormValue.searchType || undefined;
// 处理不同时间选择类型
if (this.headFormValue.timeVal) {
this.listQuery.startTime = this.headFormValue.timeVal[0];
this.listQuery.endTime = this.headFormValue.timeVal[1];
} else if (this.headFormValue.timeValWeek) {
// 周选择器
const { startTime, endTime } = this.getWeekTimeRange(this.headFormValue.timeValWeek);
this.listQuery.startTime = startTime;
this.listQuery.endTime = endTime;
} else if (this.headFormValue.timeValMonth) {
// 月选择器
this.listQuery.startTime = this.headFormValue.timeValMonth[0];
this.listQuery.endTime = this.headFormValue.timeValMonth[1];
} else if (this.headFormValue.timeValYear) {
// 年选择器
const { startTime, endTime } = this.getYearTimeRange(this.headFormValue.timeValYear);
this.listQuery.startTime = startTime;
this.listQuery.endTime = endTime;
} else {
this.listQuery.startTime = undefined;
this.listQuery.endTime = undefined;
}
}
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':
const timeItemIndex = this.formConfig.findIndex(item => this.listQuery.pageNo = 1;
item.label?.includes('刷新时间') this.listQuery.pageSize = 10;
); this.listQuery.factoryId = val.factoryId || undefined;
this.listQuery.process = val.process ? val.process : [];
// 仅当时间维度为【当天】时,添加/更新刷新时间 this.listQuery.lineId = val.lineId ? val.lineId : [];
if (this.listQuery.timeType === 1 || this.listQuery.timeType === 3) { this.listQuery.processType = val.processType ? val.processType : [];
const timeLabel = { this.listQuery.reportType = val.reportType || undefined;
type: 'label', this.listQuery.timeType = val.timeType || undefined;
label: `刷新时间: ${this.formatCurrentTime()}`, this.listQuery.searchType = val.searchType || undefined;
}; this.listQuery.startTime = val.timeVal ? val.timeVal[0] : undefined;
if (timeItemIndex > -1) { this.listQuery.endTime = val.timeVal ? val.timeVal[1] : undefined;
this.formConfig.splice(timeItemIndex, 1, timeLabel);
} else {
this.formConfig.push(timeLabel);
}
} else if (timeItemIndex > -1) {
// 非当天时,移除刷新时间
this.formConfig.splice(timeItemIndex, 1);
}
if (this.activeName === 'productLine') { if (this.activeName === 'productLine') {
if (this.listQuery.timeType === 1) { if (this.listQuery.timeType === 1) {
this.getDayDataList(); this.getDayDataList();
} else if (this.listQuery.timeType === 3) {
this.getLastDayDataList();
} else { } else {
this.getDataList(); this.getDataList();
} }
} else { } else {
if (this.listQuery.timeType === 3) { this.getProductList();
this.getProductLastList();
} else {
this.getProductList();
}
} }
break; break;
case 'export': case 'export':
@@ -1074,34 +833,21 @@ export default {
break; break;
case 'reset': case 'reset':
this.$refs.searchBarForm.resetForm(); this.$refs.searchBarForm.resetForm();
this.$refs.searchBarForm.formInline.timeType = 3; this.$refs.searchBarForm.formInline.timeType = 1;
this.formConfig[0].selectOptions = this.activeName === 'productLine'
? this.timeTypeOptions.productLine
: this.timeTypeOptions.product;
this.listQuery = { this.listQuery = {
pageSize: 100, pageSize: 100,
pageNo: 1, pageNo: 1,
total: 0, total: 0,
timeType: this.activeName === 'productLine' ? 3 : 1, timeType: 1,
}; };
// 重置后默认是当天,添加刷新时间
const resetTimeIndex = this.formConfig.findIndex(item =>
item.label?.includes('刷新时间')
);
const resetTimeLabel = {
type: 'label',
label: `刷新时间: ${this.formatCurrentTime()}`,
};
if (resetTimeIndex > -1) {
this.formConfig.splice(resetTimeIndex, 1, resetTimeLabel);
} else {
this.formConfig.push(resetTimeLabel);
}
if (this.activeName === 'productLine') { if (this.activeName === 'productLine') {
this.getLastDayDataList(); this.getDayDataList();
} else { } else {
this.getProductList(); this.getProductList();
} }
break; break;
default: default:
console.log(val); console.log(val);
@@ -1141,24 +887,13 @@ export default {
}, },
async getProductList() { async getProductList() {
this.listQuery.pageNo = 1; console.log('resGroup');
this.listQuery.pageSize = 10;
this.listQuery.factoryId = this.headFormValue.factoryId || []
this.listQuery.process = this.headFormValue.process ? this.headFormValue.process : [];
this.listQuery.lineId = undefined;
this.listQuery.processType = this.headFormValue.processType ? this.headFormValue.processType : [];
this.listQuery.reportType = this.headFormValue.reportType || undefined;
this.listQuery.timeType = this.headFormValue.timeType ? this.headFormValue.timeType : this.listQuery.timeType;
this.listQuery.searchType = this.headFormValue.searchType || undefined
if (this.listQuery.timeType === 2) { if (this.listQuery.timeType === 2) {
const resGroup = await getProcessAutoReportNew(this.listQuery); const resGroup = await getProcessAutoReportNew(this.listQuery);
console.log('resGroup', resGroup); console.log('resGroup', resGroup);
// 格式化数据lineDetList提取到外层键名加lineId前缀 // 格式化数据lineDetList提取到外层键名加lineId前缀
const formatData = (rawList) => { const formatData = (rawList) => {
if (!Array.isArray(rawList) || rawList.length === 0) {
return [];
}
return rawList.map(item => { return rawList.map(item => {
// 解构出 lineDetList 和其他字段rest // 解构出 lineDetList 和其他字段rest
const { lineDetList = [], ...rest } = item; const { lineDetList = [], ...rest } = item;
@@ -1207,9 +942,6 @@ export default {
// 格式化数据lineDetList提取到外层键名加lineId前缀 // 格式化数据lineDetList提取到外层键名加lineId前缀
const formatData = (rawList) => { const formatData = (rawList) => {
if (!Array.isArray(rawList) || rawList.length === 0) {
return [];
}
return rawList.map(item => { return rawList.map(item => {
// 解构出 lineDetList 和其他字段rest // 解构出 lineDetList 和其他字段rest
const { lineDetList = [], ...rest } = item; const { lineDetList = [], ...rest } = item;
@@ -1270,72 +1002,7 @@ export default {
} }
}, },
async getProductLastList() {
console.log('last');
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.factoryId = this.headFormValue.factoryId || []
this.listQuery.process = this.headFormValue.process ? this.headFormValue.process : [];
this.listQuery.lineId = undefined;
this.listQuery.processType = this.headFormValue.processType ? this.headFormValue.processType : [];
this.listQuery.reportType = this.headFormValue.reportType || undefined;
this.listQuery.timeType = this.headFormValue.timeType ? this.headFormValue.timeType : this.listQuery.timeType;
this.listQuery.searchType = this.headFormValue.searchType || undefined
if (this.listQuery.timeType === 3) {
const resGroup = await getProcessAutoReportLastGroup(this.listQuery);
console.log('resGroup', resGroup);
// 格式化数据lineDetList提取到外层键名加lineId前缀
const formatData = (rawList) => {
if (!Array.isArray(rawList) || rawList.length === 0) {
return [];
}
return rawList.map(item => {
// 解构出 lineDetList 和其他字段rest
const { lineDetList = [], ...rest } = item;
// 遍历 lineDetList 中的每一项,逐个格式化并合并
const formattedLineData = lineDetList.reduce((acc, lineData) => {
// 取当前 lineData 的 lineId 作为前缀(确保存在,否则用空字符串)
const lineIdPrefix = lineData.lineId ? String(lineData.lineId) : '';
// 为当前 lineData 的每个字段添加 lineId 前缀,合并到累加器中
Object.entries(lineData).forEach(([key, value]) => {
const newKey = lineIdPrefix ? `${lineIdPrefix}${key}` : key;
acc[newKey] = value;
});
return acc;
}, {}); // 初始值为空对象
// 合并外层字段和所有格式化后的 lineDetList 字段
return { ...rest, ...formattedLineData };
});
};
// 处理当班和当天数据(分别存储)
this.productTableData = formatData(resGroup.data.list); // 当班数据
console.log(this.productTableData, 'productTableData');
// --------------------------
// 生成当班数据的动态表头
// --------------------------
const groupLineDatas = [];
resGroup.data.list.forEach(item => {
if (item.lineDetList && item.lineDetList.length) {
groupLineDatas.push(...item.lineDetList);
}
});
// 去重当班数据的产线按lineId
const uniqueGroupLines = Array.from(
new Map(groupLineDatas.map(line => [line.lineId, line])).values()
);
// 生成当班数据的表头(一级:产线名,二级:指标)
this.factoryColumns = this.generateLineColumns(uniqueGroupLines);
}
},
// 生成动态表头:一级为产线名,二级为产线数据指标 // 生成动态表头:一级为产线名,二级为产线数据指标
generateLineColumns(lines) { generateLineColumns(lines) {
// lines为去重后的产线列表单个元素为一条产线数据 // lines为去重后的产线列表单个元素为一条产线数据
@@ -1430,30 +1097,8 @@ export default {
return [...lineColumns, totalColumn]; return [...lineColumns, totalColumn];
}, },
// 为当天时调用的接口 // 为当天时调用的接口
getLastDayDataList() {
getPdlAutoReportNewSearchLastGroup(this.listQuery).then((response) => {
this.tableDataCustom = response.data.classData.map((item, index) => {
item.originalLossNum = item.original?.lossNum;
item.originalLossArea = item.original?.lossArea;
item.edgeLossNum = item.edge?.lossNum;
item.edgeLossArea = item.edge?.lossArea;
item.drillLossNum = item.drill?.lossNum;
item.drillLossArea = item.drill?.lossArea;
item.coatingLossNum = item.coating?.lossNum;
item.coatingLossArea = item.coating?.lossArea;
item.silkLossNum = item.silk?.lossNum;
item.silkLossArea = item.silk?.lossArea;
item.temperingLossNum = item.tempering?.lossNum;
item.temperingLossArea = item.tempering?.lossArea;
item.packingLossNum = item.packing?.lossNum;
item.packingLossArea = item.packing?.lossArea;
return item;
});
// console.log(this.tableData, this.tableData2);
});
},
getDayDataList() { getDayDataList() {
getPdlAutoReportNewSearchNow(this.listQuery).then((response) => { getPdlAutoReportNewSearchNow().then((response) => {
this.tableData = response.data.classData.map((item, index) => { this.tableData = response.data.classData.map((item, index) => {
item.originalLossNum = item.original?.lossNum; item.originalLossNum = item.original?.lossNum;
item.originalLossArea = item.original?.lossArea; item.originalLossArea = item.original?.lossArea;
@@ -1504,85 +1149,32 @@ export default {
this.listQuery.pageNo = val; this.listQuery.pageNo = val;
this.getDataList(); this.getDataList();
}, },
formatCurrentTime() {
const date = new Date();
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${hours}:${minutes}:${seconds} ${year}.${month}.${day}`;
},
// 搜索栏下拉选择变化 // 搜索栏下拉选择变化
handleSearchBarChanged({ param, value }) { handleSearchBarChanged({ param, value }) {
if (param === 'timeType') { if (param === 'timeType') {
this.tableData2 = [] console.log(value);
this.tableDataCustom = []
this.tableData = []
const resetCommon = () => {
// 重置搜索表单的筛选条件
if (this.$refs.searchBarForm) {
const form = this.$refs.searchBarForm.formInline;
form.timeVal = undefined;
form.timeType = 1;
form.reportType = undefined;
form.searchType = undefined;
form.lineId = undefined;
form.factoryId = undefined;
form.process = undefined;
form.processType = undefined;
}
// 重置查询参数
this.listQuery = {
...this.listQuery, // 保留分页等基础参数
factoryId: undefined,
process: undefined,
lineId: undefined,
processType: undefined,
reportType: undefined,
timeType: 1,
searchType: undefined,
startTime: undefined,
endTime: undefined
};
// 重置表单配置中公共隐藏的项
this.formConfig[1].type = ''; // 隐藏查询类型
this.formConfig[6].type = ''; // 隐藏报表类型
this.formConfig[7].type = ''; // 隐藏时间范围
};
// 3. 执行公共重置
resetCommon();
this.listQuery.timeType = value; this.listQuery.timeType = value;
const timeItemIndex = this.formConfig.findIndex(item =>
item.label?.includes('刷新时间')
);
// 仅移除,不添加(查询时才添加)
if (value !== 1 && value !== 3 && timeItemIndex > -1) {
this.formConfig.splice(timeItemIndex, 1);
}
this.$refs.searchBarForm.formInline.timeType = value;
this.$refs.searchBarForm.formInline.searchType = undefined;
this.$refs.searchBarForm.formInline.reportType = undefined;
this.$refs.searchBarForm.formInline.timeVal = undefined;
if (value === 1) { if (value === 1) {
// 切换为“当天”:隐藏查询类型、报表类型、时间范围
this.formConfig[1].type = ''; this.formConfig[1].type = '';
this.formConfig[6].type = ''; this.formConfig[6].type = '';
this.formConfig[7].type = ''; this.formConfig[7].type = '';
} else if (value === 2) { this.$refs.searchBarForm.formInline.timeType = value;
this.formConfig[1].type = 'select'; this.listQuery.timeType = value;
this.$refs.searchBarForm.formInline.searchType = 1;
this.formConfig[7].type = 'datePicker';
} else {
this.formConfig[1].type = '';
this.formConfig[6].type = '';
this.formConfig[7].type = '';
}
this.$refs.searchBarForm.formInline.searchType = undefined;
this.$refs.searchBarForm.formInline.reportType = undefined;
this.$refs.searchBarForm.formInline.timeVal = undefined;
} else {
// 切换为“自定义”:显示查询类型和时间范围
this.formConfig[1].type = 'select';
this.$refs.searchBarForm.formInline.timeType = value;
this.listQuery.timeType = value;
this.formConfig[7].type = 'datePicker';
}
} else if (param === 'searchType') { } else if (param === 'searchType') {
if (value === 1) { if (value === 1) {
// 统计数据:显示时间范围,隐藏报表类型 // 统计数据:显示时间范围,隐藏报表类型
@@ -1595,84 +1187,12 @@ export default {
this.formConfig[7].type = 'datePicker'; this.formConfig[7].type = 'datePicker';
} }
} else if (param === 'reportType') { } else if (param === 'reportType') {
if (this.$refs.searchBarForm && this.$refs.searchBarForm.formInline) { this.$refs.searchBarForm.formInline.timeVal = undefined;
const formInline = this.$refs.searchBarForm.formInline;
// 精准判断只有字段存在时才置为undefined不存在则不处理
if ('timeVal' in formInline) {
formInline.timeVal = undefined;
}
if ('timeValWeek' in formInline) {
formInline.timeValWeek = undefined;
}
if ('timeValMonth' in formInline) {
formInline.timeValMonth = undefined;
}
if ('timeValYear' in formInline) {
formInline.timeValYear = undefined;
}
}
this.listQuery.startTime = undefined;
this.listQuery.endTime = undefined;
if (value === 1) {
this.formConfig[7] = {
type: 'datePicker',
label: '时间范围',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
width: 350
};
} else if (value === 2) {
this.formConfig[7] = {
type: 'datePicker',
label: '时间范围',
dateType: 'week',
placeholder: '选择日期',
format: 'yyyy 第 WW 周',
pickerOptions: {
firstDayOfWeek: 1 // 数字1表示周一作为周的第一天0=周日1=周一,依此类推)
},
valueFormat: 'yyyy-MM-dd',
param: 'timeValWeek',
width: 250,
};
} else if (value === 3) {
this.formConfig[7] = {
type: 'datePicker',
label: '时间范围',
dateType: 'monthrange',
format: 'yyyy-MM-dd',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeValMonth',
defaultTime: ['00:00:00', '23:59:59'],
width: 250,
};
} else if (value === 4) {
this.formConfig[7] = {
type: 'datePicker',
label: '时间范围',
dateType: 'year',
placeholder: '选择年份',
format: 'yyyy',
valueFormat: 'timestamp',
param: 'timeValYear',
width: 250,
};
}
} else if (param === 'factoryId') { } else if (param === 'factoryId') {
// 切换工厂时刷新产线列表 // 切换工厂时刷新产线列表
this.listQuery.lineId = []; this.listQuery.lineId = [];
this.$refs.searchBarForm.formInline.lineId = undefined; this.$refs.searchBarForm.formInline.lineId = undefined;
getPLlistByFactory({ getPdList(value).then(res => {
factoryIds:value
}).then(res => {
this.formConfig[3].selectOptions = res.data || []; this.formConfig[3].selectOptions = res.data || [];
}); });
} }
@@ -1714,7 +1234,7 @@ export default {
.content-wrapper { .content-wrapper {
// flex: 1; // flex: 1;
width: 100%; width: 100%;
height: calc(100vh - 280px); height: calc(100vh - 303px);
// overflow: hidden; // overflow: hidden;
} }

View File

@@ -77,7 +77,7 @@ const tableProps = [
}, },
{ {
prop: 'palletNum', prop: 'palletNum',
label: '一托玻璃数量/片' label: '下片托数'
}, },
{ {
prop: 'startTime', prop: 'startTime',
@@ -92,7 +92,7 @@ const tableProps = [
width: 160 width: 160
}, },
{ {
prop: 'length', prop: 'outputNum',
label: '玻璃长度/mm' label: '玻璃长度/mm'
}, },
{ {
@@ -101,7 +101,7 @@ const tableProps = [
}, },
{ {
prop: 'thick', prop: 'thick',
label: '玻璃度/mm' label: '玻璃度/mm'
}, },
]; ];
@@ -204,88 +204,94 @@ export default {
); );
}); });
}, },
exportXlsx() { test() {
if (!this.showData.length) { var target = document.getElementsByClassName("right-aside")[0]
this.$message.warning('暂无数据可导出'); target.style.background = '#FFFFFF'
return; var that = this
} setTimeout(() => {
html2canvas(target).then(function(canvas) {
var contentWidth = canvas.width
var contentHeight = canvas.height
this.exportLoading = true; // 一页pdf显示html页面生成的canvas高度
var pageHeight = contentHeight / 592.28 * 841.89
// 未生成pdf的html页面高度
var leftHeight = contentHeight
// 页面偏移
var position = 0
// a4纸的尺寸[595.28,841.89]html页面生成的canvas在pdf中图片的高度
var imgWidth = 595.28
var imgHeight = 592.28 / contentWidth * contentHeight
var pageData = canvas.toDataURL('image/jpeg', 1.0)
console.log('nihc URL', leftHeight, pageHeight)
var pdf = new jsPDF('', 'pt', 'a4')
if (leftHeight < pageHeight) {
pdf.addImage(pageData, 'JPEG', 0, 20, imgWidth, imgHeight)
} else {
while(leftHeight > 0) {
pdf.addImage(pageData, 'JPEG', 0, position, imgWidth, imgHeight)
leftHeight -= pageHeight
position -= 841.89
// 避免空白页
if (leftHeight > 0) {
pdf.addPage()
}
}
}
pdf.save(that.fileName + '工段统计.pdf')
})
}, 300)
},
exportECL() {
let tables = document.querySelector('.el-table').cloneNode(true)
const fix = tables.querySelector('.el-table__fixed')
const fixRight = tables.querySelector('.el-table__fixed-right')
if (fix) {
tables.removeChild(tables.querySelector('.el-table__fixed'))
}
if (fixRight) {
tables.removeChild(tables.querySelector('.el-table__fixed-right'))
}
let exportTable = XLSX.utils.table_to_book(tables)
var exportTableOut = XLSX.write(exportTable, {
bookType: 'xlsx', bookSST: true, type: 'array'
})
// sheetjs.xlsx为导出表格的标题名称
try { try {
// 1. 处理导出数据(格式化时间字段) FileSaver.saveAs(new Blob([exportTableOut], {
const exportData = this.showData.map(item => { type: 'application/octet-stream'
const formatItem = { ...item }; }), this.fileName + '工段统计.xlsx')
// 格式化时间字段 } catch (e) {
if (formatItem.startTime) formatItem.startTime = parseTime(formatItem.startTime); if (typeof console !== 'undefined') console.log(e, exportTableOut)
if (formatItem.endTime) formatItem.endTime = parseTime(formatItem.endTime);
return formatItem;
});
// 2. 构建表头映射:{ prop: label },只保留表格配置中存在的列
const headerMap = {};
this.tableProps.forEach(col => {
if (col.prop && col.label) {
headerMap[col.prop] = col.label;
}
});
// 3. 转换数据将prop键名替换为label按tableProps顺序排列列
const formattedData = exportData.map(item => {
const newItem = {};
// 按表格配置顺序遍历列确保Excel列顺序与表格一致
this.tableProps.forEach(col => {
const prop = col.prop;
const label = col.label;
if (prop && label) {
// 处理可能的undefined值避免导出为空字符串
newItem[label] = item[prop] ?? '';
}
});
return newItem;
});
// 4. 创建工作表使用处理后的带label表头的数据
const worksheet = XLSX.utils.json_to_sheet(formattedData);
// 5. 创建工作簿并添加工作表
const workbook = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(workbook, worksheet, '下片日志数据');
// 6. 生成Excel文件
const excelBuffer = XLSX.write(workbook, {
bookType: 'xlsx',
type: 'array'
});
// 7. 保存文件
const blob = new Blob([excelBuffer], {
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
});
// 8. 生成文件名(包含查询条件信息)
let fileName = '下片历史';
if (this.listQuery.productionLineId) {
const lineItem = this.formConfig[0].selectOptions.find(
item => item.id === this.listQuery.productionLineId
);
if (lineItem) fileName += lineItem.name + '_';
}
if (this.listQuery.thick) {
fileName += this.listQuery.thick + '_';
}
// 添加时间戳避免文件名重复
fileName + '.xlsx';
FileSaver.saveAs(blob, fileName);
this.$message.success('导出成功');
} catch (error) {
console.error('导出失败:', error);
this.$message.error('导出失败,请重试');
} finally {
this.exportLoading = false;
} }
return exportTableOut
}, },
exportPdf() {
this.test()
setTimeout(() =>{
this.dialogVisible = false
this.showData = this.tableData
}, 600)
},
exportXlsx() {
this.exportECL()
this.dialogVisible = false
this.showData = this.tableData
},
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {});
},
getPdLineList() { getPdLineList() {
getPdList().then((res) => { getPdList().then((res) => {
this.formConfig[0].selectOptions = res.data || [] this.formConfig[0].selectOptions = res.data || []
@@ -308,16 +314,15 @@ export default {
case 'search': case 'search':
this.listQuery.pageNo = 1; this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10; this.listQuery.pageSize = 10;
this.listQuery.productionLineId = val.productionLineId ? val.productionLineId : undefined; this.listQuery.productId = val.productId ? val.productId : undefined;
this.listQuery.thick = val.thick ? val.thick : undefined; this.listQuery.startTime = val.timeVal ? val.timeVal[0]: undefined;
this.listQuery.startTime = val.timeVal ? val.timeVal[0] : undefined; this.listQuery.endTime = val.timeVal ? val.timeVal[1]: undefined;
this.listQuery.endTime = val.timeVal ? val.timeVal[1] : undefined;
//this.listQuery.reportEndTime = val.timeVal ? [new Date(val.timeVal[1]).getTime()] : undefined; //this.listQuery.reportEndTime = val.timeVal ? [new Date(val.timeVal[1]).getTime()] : undefined;
this.getDataList(); this.getDataList();
break; break;
case 'export': case 'export':
this.exportXlsx(); this.handleExport();
break; break;
default: default:
console.log(val); console.log(val);
@@ -345,6 +350,12 @@ export default {
this.listQuery.pageNo = val; this.listQuery.pageNo = val;
this.getDataList(); this.getDataList();
}, },
handleExport() {
if (this.selectedList.length > 0) {
this.showData = this.selectedList
}
this.dialogVisible = true
}
}, },
}; };
</script> </script>

View File

@@ -77,7 +77,7 @@ const tableProps = [
}, },
{ {
prop: 'palletNum', prop: 'palletNum',
label: '一托玻璃数量/片' label: '下片托数'
}, },
{ {
prop: 'startTime', prop: 'startTime',
@@ -92,7 +92,7 @@ const tableProps = [
width: 160 width: 160
}, },
{ {
prop: 'length', prop: 'outputNum',
label: '玻璃长度/mm' label: '玻璃长度/mm'
}, },
{ {
@@ -358,6 +358,8 @@ export default {
handleExport() { handleExport() {
// 处理查询参数 // 处理查询参数
let params = { ...this.listQuery }; let params = { ...this.listQuery };
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出下片日志?').then(() => { this.$modal.confirm('是否确认导出下片日志?').then(() => {
this.exportLoading = true; this.exportLoading = true;
return exportDownLogData(params); return exportDownLogData(params);

View File

@@ -262,14 +262,6 @@ export default {
tooltip: { tooltip: {
valueFormatter: (value) => `${value} %`, valueFormatter: (value) => `${value} %`,
}, },
label: {
show: true,
position: 'top',
distance: 6,
fontSize: 11,
color: '#333333',
formatter: (params) => `${params.value}` // 显示单位
},
data: this.barData.map((item) => item.processingRatio), data: this.barData.map((item) => item.processingRatio),
}, },
], ],

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More