Compare commits
34 Commits
bfd8e04780
...
projects/l
| Author | SHA1 | Date | |
|---|---|---|---|
| b46e09e8ec | |||
| 00393f76c7 | |||
|
|
35fb0d8bfb | ||
|
|
0c52306cc6 | ||
| a5fba28ff7 | |||
|
|
1f8b994218 | ||
|
|
ccfa73f3bc | ||
|
|
89ff79bfd7 | ||
| 70a0fbb170 | |||
|
|
c86d94ac92 | ||
|
|
484ba6ca53 | ||
|
|
f403375594 | ||
| 1cd0b13aae | |||
|
|
d2b0565cd1 | ||
|
|
7661dc5691 | ||
| 1d698848c2 | |||
|
|
6d367b121c | ||
|
|
e2385cf813 | ||
| 552b1e6d6a | |||
| 4383067eb1 | |||
| f80644e07c | |||
|
|
1e12b653d6 | ||
|
|
b7ba173ca3 | ||
| c203f1e1dd | |||
|
|
ccb925003e | ||
|
|
b9f286005c | ||
| 0e343279ac | |||
| 00ac3dec45 | |||
| a84f765e73 | |||
| ffa0b2e8dd | |||
| 1e6c6c5656 | |||
| 0e76fe7dbf | |||
| 399e2bc965 | |||
| 7bee1f7863 |
6
.env.dev
@@ -12,10 +12,10 @@ ENV = 'development'
|
||||
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.19.12: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
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"local": "vue-cli-service serve --mode local",
|
||||
"dev": "vue-cli-service serve --mode dev",
|
||||
"dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --mode dev",
|
||||
"front": "vue-cli-service serve --mode front",
|
||||
"build:prod": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode prod",
|
||||
"build:stage": "vue-cli-service build --mode stage",
|
||||
@@ -49,7 +49,7 @@
|
||||
"bpmn-js-token-simulation": "0.10.0",
|
||||
"chinese-lunar": "^0.1.4",
|
||||
"clipboard": "2.0.8",
|
||||
"code-brick-zj": "^1.0.2",
|
||||
"code-brick-zj": "^1.1.1",
|
||||
"core-js": "^3.26.0",
|
||||
"crypto-js": "^4.0.0",
|
||||
"diagram-js": "^12.3.0",
|
||||
|
||||
35
src/api/analysis/exception.js
Normal file
@@ -0,0 +1,35 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获得设备健康分析周期报表list
|
||||
export function getReportPage(query) {
|
||||
return request({
|
||||
url: '/analysis/equipment-health-auto-report/reportList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}// 获得设备健康分析累计
|
||||
export function getQueryPage(query) {
|
||||
return request({
|
||||
url: '/analysis/equipment-health-auto-report/queryList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 导出
|
||||
export function exportReportExcel(query) {
|
||||
return request({
|
||||
url: '/analysis/equipment-health-auto-report/export-excel-report',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
export function exportQueryExcel(query) {
|
||||
return request({
|
||||
url: '/analysis/equipment-health-auto-report/export-excel-query',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* @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
|
||||
})
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
* @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
|
||||
})
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
/*
|
||||
* @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'
|
||||
})
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
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'
|
||||
})
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* @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
|
||||
})
|
||||
}
|
||||
@@ -59,3 +59,34 @@ export function getEquipmentAll() {
|
||||
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,
|
||||
});
|
||||
}
|
||||
|
||||
64
src/api/base/equipmentSectionShutdownLog.js
Normal file
@@ -0,0 +1,64 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建计划停机配置
|
||||
export function createPlan(data) {
|
||||
return request({
|
||||
url: '/base/equipment-section-shutdown-log/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新计划停机配置
|
||||
export function updatePlan(data) {
|
||||
return request({
|
||||
url: '/base/equipment-section-shutdown-log/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获得计划停机配置
|
||||
export function getPlan(id) {
|
||||
return request({
|
||||
url: '/base/equipment-section-shutdown-log/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 计划停机配置list
|
||||
export function planList(query) {
|
||||
return request({
|
||||
url: '/base/equipment-section-shutdown-log/planList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 停机记录list
|
||||
export function errorList(query) {
|
||||
return request({
|
||||
url: '/base/equipment-section-shutdown-log/errorList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出计划停机配置list
|
||||
export function exportPlanList(query) {
|
||||
return request({
|
||||
url: '/base/equipment-section-shutdown-log/exportPlanList',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
// 导出停机记录list
|
||||
export function exportErrorList(query) {
|
||||
return request({
|
||||
url: '/base/equipment-section-shutdown-log/exportErrorList',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
@@ -52,3 +52,5 @@ export function exportEquipmentTypeExcel(query) {
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2023-09-12 14:07:04
|
||||
* @LastEditTime: 2025-01-08 15:47:17
|
||||
* @LastEditTime: 2026-04-28 11:13:17
|
||||
* @LastEditors: zwq
|
||||
* @Description:
|
||||
*/
|
||||
@@ -14,6 +14,13 @@ export function getYieldAnalysisPageData(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
export function getYieldAnalysisHandlePageData(data) {
|
||||
return request({
|
||||
url: '/analysis/production-analysis/getOutputManual',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function getCT(data) {
|
||||
return request({
|
||||
@@ -46,3 +53,40 @@ export function getNewCTDet(data) {
|
||||
data:data
|
||||
});
|
||||
}
|
||||
|
||||
// 获得产线累计oee与teep
|
||||
export function listHeader() {
|
||||
return request({
|
||||
url: '/analysis/production-oee-auto-report/listHeader',
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
// 获得产线报表oee与teep
|
||||
export function listLineReport(query) {
|
||||
return request({
|
||||
url: '/analysis/production-oee-auto-report/listLineReport',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
// 导出生产分析teepExcel
|
||||
export function exportTeepExcel(query) {
|
||||
return request({
|
||||
url: '/analysis/production-oee-auto-report/export-excel-teep',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出生产分析oeeExcel
|
||||
export function exportOeeExcel(query) {
|
||||
return request({
|
||||
url: '/analysis/production-oee-auto-report/export-excel-oee',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -50,6 +50,15 @@ 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) {
|
||||
@@ -93,3 +102,17 @@ export function getProcessAutoReportNew(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,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-09-12 09:44:53
|
||||
* @LastEditTime: 2023-09-15 14:12:26
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
* @LastEditTime: 2026-03-30 15:01:38
|
||||
* @LastEditors: zwq
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
@@ -15,3 +15,12 @@ export function getPdlDataOneDay(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获得近24小时产线生产数据-新版
|
||||
export function getSectionDataOneDay(data) {
|
||||
return request({
|
||||
url: '/monitoring/production-monitor/getSectionDataOneDay',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -141,3 +141,13 @@ export function getPerView(data) {
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
// 导出 Excel
|
||||
export function exportExcel(query) {
|
||||
return request({
|
||||
url: '/base/group-scheduling-plan/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -26,6 +26,13 @@ export function getGroup(id) {
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 检查更新-生产班组
|
||||
export function updateIsProduction(id) {
|
||||
return request({
|
||||
url: '/base/group-team/updateIsProduction?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得班组基础信息分页
|
||||
export function getGroupPage(query) {
|
||||
|
||||
@@ -90,3 +90,29 @@ export function getEnableData() {
|
||||
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
|
||||
})
|
||||
}
|
||||
|
||||
56
src/api/monitoring/defectSummary.js
Normal file
@@ -0,0 +1,56 @@
|
||||
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,
|
||||
});
|
||||
}
|
||||
63
src/api/monitoring/qualityIsra.js
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* @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
|
||||
})
|
||||
}
|
||||
@@ -1,162 +0,0 @@
|
||||
/*
|
||||
* @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
|
||||
})
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
/*
|
||||
* @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
|
||||
})
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function getLineEdgeLibraryList(data) {
|
||||
return request({
|
||||
url: '/wms/line-edge-library/list',
|
||||
method: 'get',
|
||||
params: data,
|
||||
});
|
||||
}
|
||||
BIN
src/assets/images/equipmentNum.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
src/assets/images/equipmentNumImg.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
src/assets/images/runNum.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
src/assets/images/runNumImg.png
Normal file
|
After Width: | Height: | Size: 51 KiB |
BIN
src/assets/images/stopNum.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
src/assets/images/stopNumImg.png
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 461 B |
|
Before Width: | Height: | Size: 321 B |
|
Before Width: | Height: | Size: 312 B |
|
Before Width: | Height: | Size: 244 B |
|
Before Width: | Height: | Size: 137 B |
|
Before Width: | Height: | Size: 165 B |
|
Before Width: | Height: | Size: 139 B |
|
Before Width: | Height: | Size: 170 B |
|
Before Width: | Height: | Size: 929 B |
|
Before Width: | Height: | Size: 321 B |
|
Before Width: | Height: | Size: 320 B |
|
Before Width: | Height: | Size: 261 B |
|
Before Width: | Height: | Size: 416 B |
|
Before Width: | Height: | Size: 305 B |
|
Before Width: | Height: | Size: 325 B |
|
Before Width: | Height: | Size: 259 B |
|
Before Width: | Height: | Size: 420 B |
|
Before Width: | Height: | Size: 321 B |
|
Before Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 326 B |
|
Before Width: | Height: | Size: 622 B |
|
Before Width: | Height: | Size: 220 B |
|
Before Width: | Height: | Size: 379 B |
|
Before Width: | Height: | Size: 355 B |
|
Before Width: | Height: | Size: 325 B |
|
Before Width: | Height: | Size: 562 B |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 611 B |
|
Before Width: | Height: | Size: 1.9 MiB |
@@ -1,10 +1,3 @@
|
||||
<!--
|
||||
filename: index.vue
|
||||
author: liubin
|
||||
date: 2024-04-02 09:49:36
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<!-- 按钮切换 -->
|
||||
<div v-if="buttonMode" class="button-nav">
|
||||
@@ -54,7 +47,7 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.currentMenu = this.menus[0];
|
||||
// this.currentMenu = this.menus[0];
|
||||
},
|
||||
watch: {
|
||||
currentMenu(val) {
|
||||
|
||||
@@ -6,104 +6,48 @@
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:label-width="`${labelWidth}px`"
|
||||
:size="size"
|
||||
:label-position="labelPosition"
|
||||
v-loading="formLoading">
|
||||
<el-row :gutter="20" v-for="(row, rindex) in rows" :key="rindex">
|
||||
<el-col v-for="col in row" :key="col.label" :span="24 / row.length">
|
||||
<el-form-item :label="col.label" :prop="col.prop" :rules="col.rules">
|
||||
<el-input
|
||||
v-if="col.input"
|
||||
v-model="form[col.prop]"
|
||||
@change="$emit('update', form)"
|
||||
:placeholder="`请输入${col.label}`"
|
||||
v-bind="col.bind" />
|
||||
<el-input
|
||||
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>
|
||||
<el-form ref="form" :model="form" :label-width="`${labelWidth}px`" :size="size" :label-position="labelPosition"
|
||||
v-loading="formLoading">
|
||||
<el-row :gutter="20" v-for="(row, rindex) in rows" :key="rindex">
|
||||
<el-col v-for="col in row" :key="col.label" :span="24 / row.length">
|
||||
<el-form-item :label="col.label" :prop="col.prop" :rules="col.rules">
|
||||
<el-input v-if="col.input" v-model="form[col.prop]" @change="$emit('update', form)"
|
||||
:placeholder="`请输入${col.label}`" v-bind="col.bind" />
|
||||
<el-input 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" @change="handleSwitchChange(col.prop)"></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">
|
||||
<span class="close-icon" :class="uploadOpen ? 'open' : ''">
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-arrow-right"
|
||||
@click="handleFilesOpen" />
|
||||
</span>
|
||||
<!-- :file-list="uploadedFileList" -->
|
||||
<el-upload
|
||||
class="upload-in-dialog"
|
||||
v-if="col.upload"
|
||||
:action="uploadUrl"
|
||||
:headers="uploadHeaders"
|
||||
:show-file-list="false"
|
||||
icon="el-icon-upload2"
|
||||
:before-upload="beforeUpload"
|
||||
:on-success="handleUploadSuccess"
|
||||
v-bind="col.bind">
|
||||
<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>
|
||||
<div class="upload-area" :class="uploadOpen ? '' : 'height-48'" ref="uploadArea" v-if="col.upload">
|
||||
<span class="close-icon" :class="uploadOpen ? 'open' : ''">
|
||||
<el-button type="text" icon="el-icon-arrow-right" @click="handleFilesOpen" />
|
||||
</span>
|
||||
<!-- :file-list="uploadedFileList" -->
|
||||
<el-upload class="upload-in-dialog" v-if="col.upload" :action="uploadUrl" :headers="uploadHeaders"
|
||||
:show-file-list="false" icon="el-icon-upload2" :before-upload="beforeUpload"
|
||||
:on-success="handleUploadSuccess" v-bind="col.bind">
|
||||
<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>
|
||||
|
||||
<script>
|
||||
@@ -134,7 +78,8 @@ const uploadedFile = {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
methods: {
|
||||
|
||||
handleDelete() {
|
||||
this.$emit('delete', this.file);
|
||||
},
|
||||
@@ -251,7 +196,12 @@ export default {
|
||||
// 处理 options
|
||||
this.handleOptions();
|
||||
},
|
||||
methods: {
|
||||
methods: {
|
||||
handleSwitchChange(prop) {
|
||||
// 触发 update 事件,将最新的 form 数据传递给父组件
|
||||
this.$emit('update', { ...this.form });
|
||||
console.log(`switch ${prop} 变化:`, this.form[prop]);
|
||||
},
|
||||
/** 模拟透传 ref */
|
||||
validate(cb) {
|
||||
return this.$refs.form.validate(cb);
|
||||
|
||||
@@ -14,12 +14,7 @@
|
||||
v-if="collapse"
|
||||
key="collapse"
|
||||
class="sidebar-logo-link"
|
||||
:to="{
|
||||
path: '/',
|
||||
query: {
|
||||
keyword: 'home',
|
||||
},
|
||||
}">
|
||||
to="/">
|
||||
<img v-if="logo" :src="logo" class="sidebar-logo" />
|
||||
<h1
|
||||
v-else
|
||||
@@ -33,16 +28,7 @@
|
||||
{{ title }}
|
||||
</h1>
|
||||
</router-link>
|
||||
<router-link
|
||||
v-else
|
||||
key="expand"
|
||||
class="sidebar-logo-link"
|
||||
:to="{
|
||||
path: '/',
|
||||
query: {
|
||||
keyword: 'home',
|
||||
},
|
||||
}">
|
||||
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
|
||||
<img v-if="logo" :src="logo" class="sidebar-logo" />
|
||||
<h1
|
||||
class="sidebar-title"
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2026-01-06 15:18:41
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2026-01-15 09:52:23
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div v-if="!item.hidden">
|
||||
<template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2022-08-24 11:19:43
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-28 09:35:03
|
||||
* @LastEditTime: 2024-04-02 09:33:29
|
||||
* @Description:
|
||||
*/
|
||||
export default {
|
||||
@@ -69,7 +69,7 @@ export default {
|
||||
this.$refs.addOrUpdate.init(val.data.id);
|
||||
});
|
||||
} else if (val.type === "delete") {
|
||||
this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex,val.data)
|
||||
this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex)
|
||||
} else {
|
||||
this.otherMethods(val)
|
||||
}
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2026-01-06 15:18:38
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2026-01-15 09:54:44
|
||||
* @Description:
|
||||
*/
|
||||
import router from './router'
|
||||
import store from './store'
|
||||
import { Message } from 'element-ui'
|
||||
@@ -16,7 +9,7 @@ import { isRelogin } from '@/utils/request'
|
||||
NProgress.configure({ showSpinner: false })
|
||||
|
||||
// 增加三方登陆 update by 芋艿
|
||||
const whiteList = ['/login', '/social-login', 'screenbg', '/auth-redirect', '/bind', '/register', '/oauthLogin/gitee']
|
||||
const whiteList = ['/login', '/social-login', '/auth-redirect', '/bind', '/register', '/oauthLogin/gitee']
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
NProgress.start()
|
||||
@@ -24,12 +17,7 @@ router.beforeEach((to, from, next) => {
|
||||
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
|
||||
/* has token*/
|
||||
if (to.path === '/login') {
|
||||
next({
|
||||
path: '/',
|
||||
query: {
|
||||
keyword: 'home',
|
||||
},
|
||||
})
|
||||
next({ path: '/' })
|
||||
NProgress.done()
|
||||
} else {
|
||||
if (store.getters.roles.length === 0) {
|
||||
@@ -37,9 +25,9 @@ router.beforeEach((to, from, next) => {
|
||||
// 获取字典数据 add by 芋艿
|
||||
store.dispatch('dict/loadDictDatas')
|
||||
// 判断当前用户是否已拉取完 user_info 信息
|
||||
store.dispatch('GetInfo').then(userInfo => {
|
||||
store.dispatch('GetInfo').then(() => {
|
||||
isRelogin.show = false
|
||||
store.dispatch('GenerateRoutes', userInfo.menus).then(accessRoutes => {
|
||||
store.dispatch('GenerateRoutes').then(accessRoutes => {
|
||||
// 根据 roles 权限生成可访问的路由表
|
||||
router.addRoutes(accessRoutes) // 动态添加可访问路由表
|
||||
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
|
||||
@@ -47,12 +35,7 @@ router.beforeEach((to, from, next) => {
|
||||
}).catch(err => {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
Message.error(err)
|
||||
next({
|
||||
path: '/',
|
||||
query: {
|
||||
keyword: 'home',
|
||||
},
|
||||
})
|
||||
next({ path: '/' })
|
||||
})
|
||||
})
|
||||
} else {
|
||||
|
||||
@@ -28,280 +28,223 @@ Vue.use(Router)
|
||||
|
||||
// 公共路由
|
||||
export const constantRoutes = [
|
||||
{
|
||||
path: '/redirect',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: '/redirect/:path(.*)',
|
||||
component: (resolve) => require(['@/views/redirect'], resolve),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
component: (resolve) => require(['@/views/login'], resolve),
|
||||
// hidden: true,
|
||||
},
|
||||
|
||||
{
|
||||
path: '/sso',
|
||||
component: (resolve) => require(['@/views/sso'], resolve),
|
||||
hidden: true,
|
||||
},
|
||||
{
|
||||
path: '/social-login',
|
||||
component: (resolve) => require(['@/views/socialLogin'], resolve),
|
||||
hidden: true,
|
||||
},
|
||||
{
|
||||
path: '/404',
|
||||
component: (resolve) => require(['@/views/error/404'], resolve),
|
||||
hidden: true,
|
||||
},
|
||||
{
|
||||
path: '/401',
|
||||
component: (resolve) => require(['@/views/error/401'], resolve),
|
||||
hidden: true,
|
||||
},
|
||||
{
|
||||
path: '/print-design',
|
||||
component: (resolve) => require(['@/views/print/design'], resolve),
|
||||
hidden: true,
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
component: Layout,
|
||||
redirect: 'index',
|
||||
children: [
|
||||
{
|
||||
path: 'index',
|
||||
component: (resolve) => require(['@/views/productionVisualization/equipmentBoard'], resolve),
|
||||
name: '首页',
|
||||
meta: { title: '首页', icon: 'dashboard', affix: true },
|
||||
hidden: true,
|
||||
},
|
||||
],
|
||||
props: (route) => ({
|
||||
keyword: 'home',
|
||||
})
|
||||
},
|
||||
{
|
||||
path: '/screenbg',
|
||||
component: () =>
|
||||
import(
|
||||
/* webpackChunkName: "about" */ '@/views/productionVisualization/equipmentBoard'
|
||||
),
|
||||
name: 'screenbg',
|
||||
meta: { title: '大屏', icon: 'chart' },
|
||||
},
|
||||
{
|
||||
path: '/user',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
redirect: 'noredirect',
|
||||
children: [
|
||||
{
|
||||
path: 'profile',
|
||||
component: (resolve) =>
|
||||
require(['@/views/system/user/profile/index'], resolve),
|
||||
name: 'Profile',
|
||||
meta: { title: '个人中心', icon: 'user' },
|
||||
},
|
||||
{
|
||||
path: 'notify-message',
|
||||
component: (resolve) =>
|
||||
require(['@/views/system/notify/my/index'], resolve),
|
||||
name: 'MyNotifyMessage',
|
||||
meta: { title: '我的站内信', icon: 'message' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/dict',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: 'type/data/:dictId(\\d+)',
|
||||
component: (resolve) => require(['@/views/system/dict/data'], resolve),
|
||||
name: 'SystemDictData',
|
||||
meta: { title: '字典数据', icon: '', activeMenu: '/system/dict' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/job',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: 'log',
|
||||
component: (resolve) => require(['@/views/infra/job/log'], resolve),
|
||||
name: 'InfraJobLog',
|
||||
meta: { title: '调度日志', activeMenu: '/infra/job' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/codegen',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: 'edit/:tableId(\\d+)',
|
||||
component: (resolve) =>
|
||||
require(['@/views/infra/codegen/editTable'], resolve),
|
||||
name: 'InfraCodegenEditTable',
|
||||
meta: { title: '修改生成配置', activeMenu: '/infra/codegen' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/bpm',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
redirect: 'noredirect',
|
||||
children: [
|
||||
{
|
||||
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: 'oa/leave/detail',
|
||||
component: (resolve) =>
|
||||
require(['@/views/bpm/oa/leave/detail'], resolve),
|
||||
name: 'BpmOALeaveDetail',
|
||||
meta: {
|
||||
title: '查看 OA 请假',
|
||||
icon: 'view',
|
||||
activeMenu: '/bpm/oa/leave',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/bpm',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: 'manager/form/edit',
|
||||
component: (resolve) =>
|
||||
require(['@/views/bpm/form/formEditor'], resolve),
|
||||
name: 'BpmFormEditor',
|
||||
meta: { title: '流程表单-编辑', activeMenu: '/bpm/manager/form' },
|
||||
},
|
||||
{
|
||||
path: 'manager/definition',
|
||||
component: (resolve) =>
|
||||
require(['@/views/bpm/definition/index'], resolve),
|
||||
name: 'BpmProcessDefinition',
|
||||
meta: { title: '流程定义', activeMenu: '/bpm/manager/model' },
|
||||
},
|
||||
{
|
||||
path: 'manager/model/design',
|
||||
component: (resolve) =>
|
||||
require(['@/views/bpm/model/modelEditor'], resolve),
|
||||
name: 'BpmModelEditor',
|
||||
meta: { title: '设计流程', activeMenu: '/bpm/manager/model' },
|
||||
},
|
||||
{
|
||||
path: 'process-instance/create',
|
||||
component: (resolve) =>
|
||||
require(['@/views/bpm/processInstance/create'], resolve),
|
||||
name: 'BpmProcessInstanceCreate',
|
||||
meta: { title: '发起流程', activeMenu: '/bpm/task/my' },
|
||||
},
|
||||
{
|
||||
path: 'process-instance/detail',
|
||||
component: (resolve) =>
|
||||
require(['@/views/bpm/processInstance/detail'], resolve),
|
||||
name: 'BpmProcessInstanceDetail',
|
||||
meta: { title: '流程详情', activeMenu: '/bpm/task/my' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/property',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: 'value/:propertyId(\\d+)',
|
||||
component: (resolve) =>
|
||||
require(['@/views/mall/product/property/value'], resolve),
|
||||
name: 'ProductPropertyValue',
|
||||
meta: {
|
||||
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),
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
{
|
||||
path: '/redirect',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: '/redirect/:path(.*)',
|
||||
component: (resolve) => require(['@/views/redirect'], resolve)
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
component: (resolve) => require(['@/views/login'], resolve),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/sso',
|
||||
component: (resolve) => require(['@/views/sso'], resolve),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/social-login',
|
||||
component: (resolve) => require(['@/views/socialLogin'], resolve),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/404',
|
||||
component: (resolve) => require(['@/views/error/404'], resolve),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/401',
|
||||
component: (resolve) => require(['@/views/error/401'], resolve),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/print-design',
|
||||
component: (resolve) => require(['@/views/print/design'], resolve),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: "",
|
||||
component: Layout,
|
||||
redirect: "index",
|
||||
children: [
|
||||
{
|
||||
path: "index",
|
||||
component: (resolve) => require(["@/views/home/index"], resolve),
|
||||
name: "首页",
|
||||
meta: { title: "首页", icon: "dashboard", affix: true },
|
||||
hidden: true
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/user',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
redirect: 'noredirect',
|
||||
children: [{
|
||||
path: 'profile',
|
||||
component: (resolve) => require(['@/views/system/user/profile/index'], resolve),
|
||||
name: 'Profile',
|
||||
meta: { title: '个人中心', icon: 'user' }
|
||||
}, {
|
||||
path: 'notify-message',
|
||||
component: (resolve) => require(['@/views/system/notify/my/index'], resolve),
|
||||
name: 'MyNotifyMessage',
|
||||
meta: { title: '我的站内信', icon: 'message' },
|
||||
}]
|
||||
},
|
||||
{
|
||||
path: '/dict',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [{
|
||||
path: 'type/data/:dictId(\\d+)',
|
||||
component: (resolve) => require(['@/views/system/dict/data'], resolve),
|
||||
name: 'SystemDictData',
|
||||
meta: { title: '字典数据', icon: '', activeMenu: '/system/dict' }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/job',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [{
|
||||
path: 'log',
|
||||
component: (resolve) => require(['@/views/infra/job/log'], resolve),
|
||||
name: 'InfraJobLog',
|
||||
meta: { title: '调度日志', activeMenu: '/infra/job' }
|
||||
}
|
||||
]
|
||||
}, {
|
||||
path: '/codegen',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [{
|
||||
path: 'edit/:tableId(\\d+)',
|
||||
component: (resolve) => require(['@/views/infra/codegen/editTable'], resolve),
|
||||
name: 'InfraCodegenEditTable',
|
||||
meta: { title: '修改生成配置', activeMenu: '/infra/codegen' }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/bpm',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
redirect: 'noredirect',
|
||||
children: [{
|
||||
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: 'oa/leave/detail',
|
||||
component: (resolve) => require(['@/views/bpm/oa/leave/detail'], resolve),
|
||||
name: 'BpmOALeaveDetail',
|
||||
meta: { title: '查看 OA 请假', icon: 'view', activeMenu: '/bpm/oa/leave' }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/bpm',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [{
|
||||
path: 'manager/form/edit',
|
||||
component: (resolve) => require(['@/views/bpm/form/formEditor'], resolve),
|
||||
name: 'BpmFormEditor',
|
||||
meta: { title: '流程表单-编辑', activeMenu: '/bpm/manager/form' }
|
||||
}, {
|
||||
path: 'manager/definition',
|
||||
component: (resolve) => require(['@/views/bpm/definition/index'], resolve),
|
||||
name: 'BpmProcessDefinition',
|
||||
meta: { title: '流程定义', activeMenu: '/bpm/manager/model' }
|
||||
}, {
|
||||
path: 'manager/model/design',
|
||||
component: (resolve) => require(['@/views/bpm/model/modelEditor'], resolve),
|
||||
name: 'BpmModelEditor',
|
||||
meta: { title: '设计流程', activeMenu: '/bpm/manager/model' }
|
||||
}, {
|
||||
path: 'process-instance/create',
|
||||
component: (resolve) => require(['@/views/bpm/processInstance/create'], resolve),
|
||||
name: 'BpmProcessInstanceCreate',
|
||||
meta: { title: '发起流程', activeMenu: '/bpm/task/my' }
|
||||
}, {
|
||||
path: 'process-instance/detail',
|
||||
component: (resolve) => require(['@/views/bpm/processInstance/detail'], resolve),
|
||||
name: 'BpmProcessInstanceDetail',
|
||||
meta: { title: '流程详情', activeMenu: '/bpm/task/my' }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/property',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [{
|
||||
path: 'value/:propertyId(\\d+)',
|
||||
component: (resolve) => require(['@/views/mall/product/property/value'], resolve),
|
||||
name: 'ProductPropertyValue',
|
||||
meta: { 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;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import {constantRoutes} from '@/router'
|
||||
import {getRouters} from '@/api/menu'
|
||||
import Layout from '@/layout/index'
|
||||
import ParentView from '@/components/ParentView';
|
||||
import {toCamelCase} from "@/utils";
|
||||
@@ -26,25 +27,22 @@ const permission = {
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
/**
|
||||
* 生成路由
|
||||
*
|
||||
* @param commit commit 函数
|
||||
* @param menus 路由参数
|
||||
*/
|
||||
GenerateRoutes({commit}, menus) {
|
||||
// 生成路由
|
||||
GenerateRoutes({commit}) {
|
||||
return new Promise(resolve => {
|
||||
// 将 menus 菜单,转换为 route 路由数组
|
||||
const sdata = JSON.parse(JSON.stringify(menus)) // 【重要】用于菜单中的数据
|
||||
const rdata = JSON.parse(JSON.stringify(menus)) // 用于最后添加到 Router 中的数据
|
||||
const sidebarRoutes = filterAsyncRouter(sdata)
|
||||
const rewriteRoutes = filterAsyncRouter(rdata, false, true)
|
||||
rewriteRoutes.push({path: '*', redirect: '/404', hidden: true})
|
||||
commit('SET_ROUTES', rewriteRoutes)
|
||||
commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes))
|
||||
commit('SET_DEFAULT_ROUTES', sidebarRoutes)
|
||||
commit('SET_TOPBAR_ROUTES', sidebarRoutes)
|
||||
resolve(rewriteRoutes)
|
||||
// 向后端请求路由数据(菜单)
|
||||
getRouters().then(res => {
|
||||
const sdata = JSON.parse(JSON.stringify(res.data)) // 【重要】用于菜单中的数据
|
||||
const rdata = JSON.parse(JSON.stringify(res.data)) // 用于最后添加到 Router 中的数据
|
||||
const sidebarRoutes = filterAsyncRouter(sdata)
|
||||
const rewriteRoutes = filterAsyncRouter(rdata, false, true)
|
||||
rewriteRoutes.push({path: '*', redirect: '/404', hidden: true})
|
||||
commit('SET_ROUTES', rewriteRoutes)
|
||||
commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes))
|
||||
commit('SET_DEFAULT_ROUTES', sidebarRoutes)
|
||||
commit('SET_TOPBAR_ROUTES', sidebarRoutes)
|
||||
resolve(rewriteRoutes)
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
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 {getAccessToken, getRefreshToken, getTenantId, setToken} from '@/utils/auth'
|
||||
import { getAccessToken, getRefreshToken, getTenantId, setToken } from '@/utils/auth'
|
||||
import errorCode from '@/utils/errorCode'
|
||||
import {getPath, getTenantEnable} from "@/utils/ruoyi";
|
||||
import {refreshToken} from "@/api/login";
|
||||
import { getPath, getTenantEnable } from "@/utils/ruoyi";
|
||||
import { refreshToken } from "@/api/login";
|
||||
|
||||
// 需要忽略的提示。忽略后,自动 Promise.reject('error')
|
||||
const ignoreMsgs = [
|
||||
@@ -86,7 +86,7 @@ service.interceptors.request.use(config => {
|
||||
for (const propName of Object.keys(config.params)) {
|
||||
const value = config.params[propName];
|
||||
const part = encodeURIComponent(propName) + '='
|
||||
if (value !== null && typeof(value) !== "undefined") {
|
||||
if (value !== null && typeof (value) !== "undefined") {
|
||||
if (typeof value === 'object') {
|
||||
for (const key of Object.keys(value)) {
|
||||
let params = propName + '[' + key + ']';
|
||||
@@ -104,9 +104,9 @@ service.interceptors.request.use(config => {
|
||||
}
|
||||
return config
|
||||
}, error => {
|
||||
tryHideFullScreenLoading()
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
tryHideFullScreenLoading()
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
})
|
||||
|
||||
// 响应拦截器
|
||||
@@ -176,36 +176,38 @@ service.interceptors.response.use(async res => {
|
||||
+ '<div>5 分钟搭建本地环境</div>',
|
||||
})
|
||||
return Promise.reject(new Error(msg))
|
||||
} else if (code === 400) {
|
||||
//【班组管理】【排班计划】提交的校验按照原型图补充完整,排班计划是否重叠code400 有两个不同的返回信息
|
||||
return res.data
|
||||
} else if (code !== 200) {
|
||||
if (msg === '无效的刷新令牌') { // hard coding:忽略这个提示,直接登出
|
||||
console.log(msg)
|
||||
} else {
|
||||
Notification.error({
|
||||
title: msg
|
||||
})
|
||||
//【班组管理】【排班计划】提交的校验按照原型图补充完整,排班计划是否重叠code400 有两个不同的返回信息
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject('error')
|
||||
} else {
|
||||
return res.data
|
||||
}
|
||||
}, error => {
|
||||
tryHideFullScreenLoading()
|
||||
console.log('err' + error)
|
||||
let {message} = error;
|
||||
if (message === "Network Error") {
|
||||
message = "后端接口连接异常";
|
||||
} else if (message.includes("timeout")) {
|
||||
message = "系统接口请求超时";
|
||||
} else if (message.includes("Request failed with status code")) {
|
||||
message = "系统接口" + message.substr(message.length - 3) + "异常";
|
||||
}
|
||||
Message({
|
||||
message: message,
|
||||
type: 'error',
|
||||
duration: 5 * 1000
|
||||
})
|
||||
return Promise.reject(error)
|
||||
tryHideFullScreenLoading()
|
||||
console.log('err' + error)
|
||||
let { message } = error;
|
||||
if (message === "Network Error") {
|
||||
message = "后端接口连接异常";
|
||||
} else if (message.includes("timeout")) {
|
||||
message = "系统接口请求超时";
|
||||
} else if (message.includes("Request failed with status code")) {
|
||||
message = "系统接口" + message.substr(message.length - 3) + "异常";
|
||||
}
|
||||
Message({
|
||||
message: message,
|
||||
type: 'error',
|
||||
duration: 5 * 1000
|
||||
})
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
export function getBaseHeader() {
|
||||
@@ -219,10 +221,10 @@ function handleAuthorized() {
|
||||
if (!isRelogin.show) {
|
||||
isRelogin.show = true;
|
||||
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
|
||||
confirmButtonText: '重新登录',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}
|
||||
confirmButtonText: '重新登录',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}
|
||||
).then(() => {
|
||||
isRelogin.show = false;
|
||||
store.dispatch('LogOut').then(() => {
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
<!--
|
||||
* @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>
|
||||
@@ -1,62 +0,0 @@
|
||||
<!--
|
||||
* @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>
|
||||
@@ -1,191 +0,0 @@
|
||||
<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>
|
||||
@@ -1,324 +0,0 @@
|
||||
<!--
|
||||
* @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>
|
||||
@@ -1,318 +0,0 @@
|
||||
<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>
|
||||
@@ -1,324 +0,0 @@
|
||||
<!--
|
||||
* @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>
|
||||
@@ -1,125 +0,0 @@
|
||||
<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>
|
||||
@@ -1,665 +0,0 @@
|
||||
<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>
|
||||
@@ -1,519 +0,0 @@
|
||||
<!--
|
||||
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>
|
||||
@@ -1,277 +0,0 @@
|
||||
<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>
|
||||
@@ -1,81 +0,0 @@
|
||||
<!--
|
||||
* @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>
|
||||
@@ -1,62 +0,0 @@
|
||||
<!--
|
||||
* @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>
|
||||
@@ -1,221 +0,0 @@
|
||||
<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>
|
||||
@@ -6,35 +6,27 @@
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="false"
|
||||
class="drawer"
|
||||
custom-class="mes-drawer"
|
||||
:size="size || '50%'"
|
||||
@closed="$emit('destroy')">
|
||||
<SmallTitle slot="title">
|
||||
{{
|
||||
mode.includes('detail')
|
||||
? '详情'
|
||||
: mode.includes('edit')
|
||||
? '编辑'
|
||||
: '新增'
|
||||
}}
|
||||
</SmallTitle>
|
||||
<el-drawer :visible="visible" :show-close="false" :wrapper-closable="false" class="drawer" custom-class="mes-drawer"
|
||||
:size="size || '50%'" @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="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="border-bottom: 1px solid #dfdfdf; margin-bottom: 24px">
|
||||
<el-skeleton v-if="!showForm" animated />
|
||||
<!-- <BaseInfoForm
|
||||
<div class="form-part" v-if="section.key == 'base'"
|
||||
style="border-bottom: 1px solid #dfdfdf; margin-bottom: 24px">
|
||||
<el-skeleton v-if="!showForm" animated />
|
||||
<!-- <BaseInfoForm
|
||||
key="drawer-dialog-form"
|
||||
v-if="showForm"
|
||||
ref="form"
|
||||
@@ -42,141 +34,87 @@
|
||||
v-model="form"
|
||||
:rows="formRows" /> -->
|
||||
|
||||
<!-- if -->
|
||||
<el-row v-if="mode.includes('detail')" style="margin-bottom: 24px">
|
||||
<el-col :span="8">
|
||||
<div
|
||||
class="title"
|
||||
style="font-weight: 700; font-size: 16px; margin: 8px 0">
|
||||
设备名
|
||||
</div>
|
||||
<div class="value" style="font-size: 14px">
|
||||
{{ form.equipmentName }}
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div
|
||||
class="title"
|
||||
style="font-weight: 700; font-size: 16px; margin: 8px 0">
|
||||
关联表名
|
||||
</div>
|
||||
<div class="value" style="font-size: 14px">
|
||||
{{ form.plcName }}
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- else -->
|
||||
<el-row v-else style="margin-bottom: 24px" :gutter="20">
|
||||
<el-form ref="form" :model="form">
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
class="title"
|
||||
label="设备名"
|
||||
style="font-size: 16px; margin: 8px 0">
|
||||
<el-select
|
||||
v-model="form.equipmentId"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择设备">
|
||||
<el-option
|
||||
v-for="eq in eqList"
|
||||
:key="eq.id"
|
||||
: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>
|
||||
<!-- if -->
|
||||
<el-row v-if="mode.includes('detail')" style="margin-bottom: 24px">
|
||||
<el-col :span="8">
|
||||
<div class="title" style="font-weight: 700; font-size: 16px; margin: 8px 0">
|
||||
设备名
|
||||
</div>
|
||||
<div class="value" style="font-size: 14px">
|
||||
{{ form.equipmentName }}
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="title" style="font-weight: 700; font-size: 16px; margin: 8px 0">
|
||||
关联表名
|
||||
</div>
|
||||
<div class="value" style="font-size: 14px">
|
||||
{{ form.plcName }}
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- else -->
|
||||
<el-row v-else style="margin-bottom: 24px" :gutter="20">
|
||||
<el-form ref="form" :model="form">
|
||||
<el-col :span="8">
|
||||
<el-form-item class="title" label="设备名" style="font-size: 16px; margin: 8px 0">
|
||||
<el-select v-model="form.equipmentId" filterable clearable placeholder="请选择设备">
|
||||
<el-option v-for="eq in eqList" :key="eq.id" :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
|
||||
v-if="!mode.includes('detail')"
|
||||
style="position: absolute; top: -40px; right: 0">
|
||||
<el-button @click="handleAddAttr" type="text">
|
||||
<i class="el-icon-plus"></i>
|
||||
添加参数
|
||||
</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 : '添加属性'"
|
||||
<div v-if="section.key == 'attrs'" style="position: relative; margin-top: 12px">
|
||||
<div v-if="!mode.includes('detail')" style="position: absolute; top: -40px; right: 0">
|
||||
<el-button @click="handleAddAttr" type="text">
|
||||
<i class="el-icon-plus"></i>
|
||||
添加参数
|
||||
</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" -->
|
||||
<method-btn
|
||||
v-if="section.tableBtn && !mode.includes('detail')"
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
<method-btn v-if="section.tableBtn && !mode.includes('detail')" 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>
|
||||
<!-- 分页组件 -->
|
||||
<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
|
||||
type="primary"
|
||||
v-if="!mode.includes('detail')"
|
||||
@click="handleSave">
|
||||
保存
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="handleCancel">取消</el-button>
|
||||
<el-button type="primary" v-if="!mode.includes('detail')" @click="handleSave">
|
||||
保存
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 属性对话框 -->
|
||||
<base-dialog
|
||||
v-if="sections[1].allowAdd"
|
||||
:dialogTitle="attrTitle"
|
||||
:dialogVisible="attrFormVisible"
|
||||
width="45%"
|
||||
:append-to-body="true"
|
||||
custom-class="baseDialog"
|
||||
@close="closeAttrForm"
|
||||
@cancel="closeAttrForm"
|
||||
@confirm="submitAttrForm">
|
||||
<!-- :disabled="mode.includes('detail')" -->
|
||||
<DialogForm
|
||||
v-if="attrFormVisible"
|
||||
ref="attrForm"
|
||||
v-model="attrForm"
|
||||
:rows="attrRows" />
|
||||
</base-dialog>
|
||||
</el-drawer>
|
||||
<!-- 属性对话框 -->
|
||||
<base-dialog v-if="sections[1].allowAdd" :dialogTitle="attrTitle" :dialogVisible="attrFormVisible" width="45%"
|
||||
:append-to-body="true" custom-class="baseDialog" @close="closeAttrForm" @cancel="closeAttrForm"
|
||||
@confirm="submitAttrForm">
|
||||
<!-- :disabled="mode.includes('detail')" -->
|
||||
<DialogForm v-if="attrFormVisible" ref="attrForm" v-model="attrForm" :data-form="attrForm"
|
||||
:rows="attrRows"
|
||||
@update="handleAttrFormUpdate"/>
|
||||
</base-dialog>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -232,7 +170,9 @@ export default {
|
||||
defaultValue: '',
|
||||
description: '',
|
||||
remark: '',
|
||||
alarmContent: '',
|
||||
alarmContent: '',
|
||||
displayTip: false,
|
||||
alarmTip: false,
|
||||
},
|
||||
attrFormVisible: false,
|
||||
attrRows: [
|
||||
@@ -342,7 +282,27 @@ 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,
|
||||
@@ -436,7 +396,24 @@ 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 }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
@@ -502,7 +479,8 @@ export default {
|
||||
name: '',
|
||||
plcParamName: '',
|
||||
unit: '',
|
||||
collection: 1,
|
||||
collection: 1,
|
||||
|
||||
minValue: '',
|
||||
maxValue: '',
|
||||
defaultValue: '',
|
||||
@@ -510,7 +488,9 @@ export default {
|
||||
remark: '',
|
||||
equipmentParamType: '',
|
||||
productionParamType: '',
|
||||
alarmContent: '',
|
||||
alarmContent: '',
|
||||
displayTip: false,
|
||||
alarmTip: false,
|
||||
};
|
||||
this.attrTitle = '添加参数绑定信息';
|
||||
this.attrFormVisible = true;
|
||||
@@ -523,8 +503,15 @@ export default {
|
||||
method: 'get',
|
||||
params: { id: attrId },
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.attrForm = res.data;
|
||||
if (res.code == 0) {
|
||||
console.log('res.data', res.data);
|
||||
|
||||
this.attrForm = {
|
||||
...res.data,
|
||||
// // 强制转为数字类型,避免字符串类型导致绑定失败
|
||||
// displayTip: Number(res.data.displayTip) || 0,
|
||||
// alarmTip: Number(res.data.alarmTip) || 0
|
||||
};
|
||||
this.attrTitle = '编辑参数绑定信息';
|
||||
this.attrFormVisible = true;
|
||||
}
|
||||
@@ -563,7 +550,8 @@ export default {
|
||||
this.$refs['attrForm'].validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
console.log('this.attrForm', this.attrForm);
|
||||
|
||||
const isEdit = this.attrForm.id != null;
|
||||
this.attrFormSubmitting = true;
|
||||
@@ -583,8 +571,9 @@ export default {
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getAttrList();
|
||||
this.shouldRefreshPageView = true;
|
||||
this.shouldRefreshPageView = true;
|
||||
this.getAttrList();
|
||||
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
189
src/views/base/equipmentSectionShutdownLog/add-or-updata.vue
Normal file
@@ -0,0 +1,189 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-01 13:52:10
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2026-04-16 15:13:53
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
v-if="visible"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="150px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="产线" prop="lineId">
|
||||
<el-select
|
||||
v-model="dataForm.lineId"
|
||||
filterable
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
placeholder="请选择产线">
|
||||
<el-option
|
||||
v-for="item in lineOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="计划停机起止时间" prop="timeRange">
|
||||
<el-date-picker
|
||||
v-model="dataForm.timeRange"
|
||||
type="datetimerange"
|
||||
:style="{ width: '100%' }"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
value-format="timestamp"
|
||||
@change="handleTimeRangeChange"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="停机时长" prop="timeStopVal">
|
||||
<span>{{ timeStopText }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="原因" prop="reason">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
placeholder="请输入原因"
|
||||
v-model="dataForm.reason"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from '@/mixins/basic-add';
|
||||
import {
|
||||
createPlan,
|
||||
updatePlan,
|
||||
getPlan,
|
||||
} from '@/api/base/equipmentSectionShutdownLog';
|
||||
import { getProductionLinePage } from '@/api/core/base/productionLine';
|
||||
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
createURL: createPlan,
|
||||
updateURL: updatePlan,
|
||||
infoURL: getPlan,
|
||||
optionArrUrl: [getProductionLinePage],
|
||||
},
|
||||
setData: true,
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
lineId: undefined,
|
||||
timeRange: undefined,
|
||||
reason: '',
|
||||
timeStopVal: undefined, // 存储分钟数或秒数
|
||||
},
|
||||
lineOptions: [],
|
||||
timeStopText: '', // 显示文本:x天x小时x分钟
|
||||
dataRule: {
|
||||
lineId: [
|
||||
{ required: true, message: '产线不能为空', trigger: 'change' },
|
||||
],
|
||||
timeRange: [
|
||||
{
|
||||
required: true,
|
||||
message: '计划停机起止时间不能为空',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
getArr() {
|
||||
getProductionLinePage({
|
||||
page: 1,
|
||||
limit: 500,
|
||||
}).then((response) => {
|
||||
this.lineOptions = response.data.list;
|
||||
});
|
||||
},
|
||||
setDataForm() {
|
||||
this.dataForm.timeRange =
|
||||
this.dataForm.startTime && this.dataForm.endTime
|
||||
? [this.dataForm.startTime, this.dataForm.endTime]
|
||||
: undefined;
|
||||
this.handleTimeRangeChange(this.dataForm.timeRange);
|
||||
},
|
||||
// 时间范围改变时计算停机时长
|
||||
handleTimeRangeChange(val) {
|
||||
if (!val || val.length < 2) {
|
||||
this.timeStopText = '';
|
||||
this.dataForm.timeStopVal = undefined;
|
||||
return;
|
||||
}
|
||||
|
||||
const start = new Date(val[0]).getTime();
|
||||
const end = new Date(val[1]).getTime();
|
||||
|
||||
if (end <= start) {
|
||||
this.timeStopText = '结束时间必须大于开始时间';
|
||||
this.dataForm.timeStopVal = undefined;
|
||||
return;
|
||||
}
|
||||
|
||||
// 总毫秒数 → 总分钟数
|
||||
const totalMinutes = (end - start) / 1000 / 60;
|
||||
|
||||
// 计算天、小时、剩余分钟
|
||||
const days = Math.floor(totalMinutes / 1440);
|
||||
const hours = Math.floor((totalMinutes % 1440) / 60);
|
||||
const minutes = Math.round(totalMinutes % 60);
|
||||
|
||||
// 拼接显示文本
|
||||
let text = '';
|
||||
if (days > 0) text += `${days}天`;
|
||||
if (hours > 0) text += `${hours}小时`;
|
||||
if (minutes > 0 || text === '') text += `${minutes}分钟`;
|
||||
|
||||
this.timeStopText = text;
|
||||
this.dataForm.timeStopVal = totalMinutes; // 提交时可传总分钟数
|
||||
},
|
||||
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
this.dataForm.startTime = this.dataForm.timeRange
|
||||
? this.dataForm.timeRange[0]
|
||||
: undefined;
|
||||
this.dataForm.endTime = this.dataForm.timeRange
|
||||
? this.dataForm.timeRange[1]
|
||||
: undefined;
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.updateURL(this.dataForm).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
this.urlOptions.createURL(this.dataForm).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
470
src/views/base/equipmentSectionShutdownLog/index.vue
Normal file
@@ -0,0 +1,470 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2026-04-16 14:03:22
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2026-04-17 15:50:29
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div style="background: #f2f4f9">
|
||||
<div style="background: #f2f4f9; height: 38px; width: 100%">
|
||||
<ButtonNav
|
||||
ref="buttonNav"
|
||||
:menus="['计划停机配置', '停机记录']"
|
||||
@change="currentMenu">
|
||||
<template v-slot:tab1>
|
||||
<div>计划停机配置</div>
|
||||
</template>
|
||||
<template v-slot:tab2>
|
||||
<div>停机记录</div>
|
||||
</template>
|
||||
</ButtonNav>
|
||||
</div>
|
||||
<div
|
||||
style="
|
||||
background: #ffffff;
|
||||
width: 100%;
|
||||
margin-bottom: 8px;
|
||||
padding: 10px 10px 0 10px;
|
||||
">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
v-if="activeName === '计划停机配置'"
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
|
||||
<div v-else class="searchBarBox">
|
||||
<el-form
|
||||
:inline="true"
|
||||
ref="searchBarForm"
|
||||
:model="formInline"
|
||||
class="searchBar">
|
||||
<span class="blue-block"></span>
|
||||
<el-form-item label="产线/工段" prop="lineIds">
|
||||
<el-cascader size="small"
|
||||
v-model="formInline.lineIds"
|
||||
:options="options"
|
||||
:props="{
|
||||
value: 'id',
|
||||
label: 'name',
|
||||
checkStrictly: true,
|
||||
multiple: true,
|
||||
emitPath: false,
|
||||
}"></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="时间范围" prop="times">
|
||||
<el-date-picker size="small"
|
||||
v-model="formInline.times"
|
||||
type="daterange"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
range-separator="-"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="停机时长" prop="duration">
|
||||
<el-select size="small"
|
||||
v-model="durationJudge"
|
||||
@change="handleCompareChange"
|
||||
style="width: 100px; margin-right: 8px">
|
||||
<el-option label="大于" value="1"></el-option>
|
||||
<el-option label="大于等于" value="2"></el-option>
|
||||
<el-option label="小于" value="3"></el-option>
|
||||
<el-option label="小于等于" value="4"></el-option>
|
||||
<el-option label="等于" value="5"></el-option>
|
||||
<el-option label="介于" value="6"></el-option>
|
||||
</el-select>
|
||||
<el-input size="small"
|
||||
v-model.number="duration1"
|
||||
type="number"
|
||||
placeholder="输入整数"
|
||||
min="0"
|
||||
style="width: 100px; margin-right: 8px"
|
||||
@keydown="preventNonInteger"></el-input>
|
||||
<span v-if="durationJudge === '6'" style="margin-right: 8px">
|
||||
~
|
||||
</span>
|
||||
|
||||
<el-input size="small"
|
||||
v-if="durationJudge === '6'"
|
||||
v-model.number="duration2"
|
||||
type="number"
|
||||
placeholder="输入整数"
|
||||
min="0"
|
||||
style="width: 100px; margin-right: 8px"
|
||||
@keydown="preventNonInteger"></el-input>
|
||||
<!-- 时间单位下拉 -->
|
||||
<el-select size="small" v-model="timeUnit" style="width: 100px">
|
||||
<el-option label="分钟" value="minute"></el-option>
|
||||
<el-option label="小时" value="hour"></el-option>
|
||||
<el-option label="天" value="day"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button size="small" type="primary" @click="handleRecordSearch">
|
||||
查询
|
||||
</el-button>
|
||||
<el-button size="small" type="warning" @click="handleExport1">
|
||||
导出
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="app-container"
|
||||
v-if="activeName === '计划停机配置'"
|
||||
style="background: #ffffff">
|
||||
<!-- 表 -->
|
||||
<div>
|
||||
<base-table
|
||||
:page="1"
|
||||
:limit="100"
|
||||
:table-props="tableProps1"
|
||||
:table-data="list"
|
||||
:max-height="500">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="90"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="app-container"
|
||||
v-else-if="activeName === '停机记录'"
|
||||
style="background: #ffffff">
|
||||
<!-- 表 -->
|
||||
<div>
|
||||
<base-table
|
||||
:page="1"
|
||||
:limit="100"
|
||||
:table-props="tableProps2"
|
||||
:table-data="list"
|
||||
:max-height="500"></base-table>
|
||||
</div>
|
||||
</div>
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="40%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import ButtonNav from '@/components/ButtonNav';
|
||||
import { getProductionLinePage } from '@/api/core/base/productionLine';
|
||||
import {
|
||||
planList,
|
||||
errorList,
|
||||
exportPlanList,
|
||||
exportErrorList,
|
||||
} from '@/api/base/equipmentSectionShutdownLog';
|
||||
import subDiv from './subDiv.vue';
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
import basicPage from '@/mixins/basic-page';
|
||||
import { getGroupPlanTree } from '@/api/group/Schedule';
|
||||
|
||||
const tableProps1 = [
|
||||
{
|
||||
prop: 'lineName',
|
||||
label: '产线名称',
|
||||
},
|
||||
{
|
||||
prop: 'timeVal',
|
||||
label: '停机起止时间',
|
||||
subcomponent: subDiv,
|
||||
},
|
||||
{
|
||||
prop: 'durationStr',
|
||||
label: '停机时长',
|
||||
},
|
||||
{
|
||||
prop: 'reason',
|
||||
label: '原因',
|
||||
},
|
||||
];
|
||||
const tableProps2 = [
|
||||
{
|
||||
prop: 'lineName',
|
||||
label: '产线名称',
|
||||
},
|
||||
{
|
||||
prop: 'sectionName',
|
||||
label: '工段名称',
|
||||
},
|
||||
{
|
||||
prop: 'timeVal',
|
||||
label: '停机起止时间',
|
||||
subcomponent: subDiv,
|
||||
},
|
||||
{
|
||||
prop: 'duration',
|
||||
label: '停机时长',
|
||||
},
|
||||
];
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
name: '',
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
exportURL: exportPlanList,
|
||||
},
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '产线',
|
||||
selectOptions: [],
|
||||
param: 'lineIds',
|
||||
collapseTags: true,
|
||||
multiple: true,
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间范围',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'timeVal',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true,
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'warning',
|
||||
},
|
||||
],
|
||||
tableBtn: [
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
},
|
||||
].filter((v) => v),
|
||||
activeName: '计划停机配置',
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
lineIds: null,
|
||||
times: null,
|
||||
},
|
||||
tableProps1,
|
||||
tableProps2,
|
||||
list: [],
|
||||
lineList: [],
|
||||
formInline: {
|
||||
lineIds: null,
|
||||
times: null,
|
||||
durationJudge: '1',
|
||||
duration: 0,
|
||||
},
|
||||
options: [], // 产线/工段选项
|
||||
// 停机时长筛选相关
|
||||
durationJudge: '1',
|
||||
duration1: 0,
|
||||
duration2: '',
|
||||
timeUnit: 'minute',
|
||||
};
|
||||
},
|
||||
components: { ButtonNav, AddOrUpdate },
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
getProductionLinePage({
|
||||
page: 1,
|
||||
limit: 500,
|
||||
}).then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data.list;
|
||||
});
|
||||
if (this.$refs.buttonNav) {
|
||||
this.$refs.buttonNav.currentMenu = '计划停机配置';
|
||||
}
|
||||
this.getDataList();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
currentMenu(val) {
|
||||
this.activeName = val;
|
||||
if (this.activeName == '计划停机配置') {
|
||||
this.urlOptions.exportURL = exportPlanList;
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.urlOptions.exportURL = exportErrorList;
|
||||
getGroupPlanTree().then((res) => {
|
||||
this.options = res.data;
|
||||
});
|
||||
this.getErrorList();
|
||||
}
|
||||
},
|
||||
//计划停机配置list
|
||||
getDataList() {
|
||||
planList(this.queryParams).then((response) => {
|
||||
this.list = response.data;
|
||||
});
|
||||
},
|
||||
//停机记录list
|
||||
getErrorList() {
|
||||
errorList(this.formInline).then((response) => {
|
||||
this.list = response.data;
|
||||
});
|
||||
},
|
||||
// 查询
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.queryParams.lineIds = val.lineIds;
|
||||
this.queryParams.type = val.type;
|
||||
this.queryParams.times = val.timeVal;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'add':
|
||||
this.addOrEditTitle = '新增';
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle();
|
||||
break;
|
||||
case 'export':
|
||||
this.handleExport();
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
//tableBtn点击
|
||||
handleClick(val) {
|
||||
if (val.type === 'edit') {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle = '编辑';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data.id);
|
||||
});
|
||||
}
|
||||
},
|
||||
handleCompareChange() {
|
||||
// 切换为非between时清空第二个输入框
|
||||
if (this.durationJudge !== '6') {
|
||||
this.duration2 = '';
|
||||
}
|
||||
},
|
||||
|
||||
// * 禁止输入非数字字符
|
||||
preventNonInteger(e) {
|
||||
// 允许数字、退格、删除、方向键
|
||||
const keyCode = e.keyCode;
|
||||
if (
|
||||
!(keyCode >= 48 && keyCode <= 57) && // 0-9
|
||||
!(keyCode >= 96 && keyCode <= 105) && // 小键盘0-9
|
||||
keyCode !== 8 && // Backspace
|
||||
keyCode !== 46 && // Delete
|
||||
!(keyCode >= 37 && keyCode <= 40) // 方向键
|
||||
) {
|
||||
e.preventDefault();
|
||||
}
|
||||
},
|
||||
handleRecordSearch() {
|
||||
this.formInline.durationJudge = this.durationJudge;
|
||||
// 构建停机时长筛选条件
|
||||
if (this.durationJudge === '6') {
|
||||
if (this.duration1 !== '' && this.duration2 !== '') {
|
||||
this.formInline.duration = undefined;
|
||||
// 转分钟
|
||||
let start = Number(this.duration1);
|
||||
let end = Number(this.duration2);
|
||||
if (this.timeUnit === 'hour') {
|
||||
start *= 60;
|
||||
end *= 60;
|
||||
} else if (this.timeUnit === 'day') {
|
||||
start *= 60 * 24;
|
||||
end *= 60 * 24;
|
||||
} //minute 则不处理
|
||||
this.formInline.betweenDurationStart = start;
|
||||
this.formInline.betweenDurationEnd = end;
|
||||
}
|
||||
} else {
|
||||
if (this.duration1 !== '') {
|
||||
let val = Number(this.duration1);
|
||||
if (this.timeUnit === 'hour') {
|
||||
val *= 60;
|
||||
} else if (this.timeUnit === 'day') {
|
||||
val *= 60 * 24;
|
||||
}
|
||||
this.formInline.duration = val;
|
||||
}
|
||||
}
|
||||
// 调用接口查询数据
|
||||
|
||||
this.getErrorList();
|
||||
},
|
||||
handleExport1() {
|
||||
this.handleRecordSearch()
|
||||
// 处理查询参数
|
||||
let params = { ...this.formInline };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return this.urlOptions.exportURL(params);
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '报表.xls');
|
||||
this.exportLoading = false;
|
||||
}).catch(() => { });
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.searchBarBox {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.searchBarBox::after {
|
||||
content: '';
|
||||
display: block;
|
||||
clear: both;
|
||||
}
|
||||
.searchBar .blue-block {
|
||||
display: inline-block;
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
background-color: #0b58ff;
|
||||
border-radius: 1px;
|
||||
margin-right: 8px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
.searchBar .el-form-item {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,18 +1,20 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-13 16:18:41
|
||||
* @Date: 2024-07-01 14:53:55
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-06 15:19:24
|
||||
* @LastEditTime: 2026-03-18 14:32:19
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<span>
|
||||
{{
|
||||
(injectData.val2
|
||||
? ['满盘搬运', '空盘搬运', '备料搬运', '临时搬运'][injectData.val2]
|
||||
: '-')
|
||||
}}
|
||||
</span>
|
||||
<div>
|
||||
<span>
|
||||
{{
|
||||
parseTime(injectData.startTime, '{y}年{m}月{d}日') +
|
||||
'-' +
|
||||
parseTime(injectData.endTime, '{y}年{m}月{d}日')
|
||||
}}
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -26,6 +28,7 @@ export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {},
|
||||
created() {},
|
||||
methods: {},
|
||||
};
|
||||
@@ -88,7 +88,32 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
methods: {
|
||||
dataFormSubmit() {
|
||||
this.$refs["dataForm"].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.updateURL(this.dataForm).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
this.urlOptions.createURL(this.dataForm).then(response => {
|
||||
if (response.code === 1001033 || response.code === 1001034) {
|
||||
return this.$modal.msgError(response.msg);
|
||||
}
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
style="width: 75%"
|
||||
v-model="dataForm.price"
|
||||
clearable
|
||||
placeholder="请输入允许留存时间" />
|
||||
placeholder="请输入单价" />
|
||||
{{ unit }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -103,7 +103,7 @@ export default {
|
||||
id: null,
|
||||
code: '',
|
||||
materialId: '',
|
||||
price: '',
|
||||
price: undefined,
|
||||
startTime: new Date().getTime(),
|
||||
endTime: null,
|
||||
remark: '',
|
||||
@@ -140,17 +140,42 @@ export default {
|
||||
setTimeout(this.setCode(), 1000);
|
||||
}
|
||||
},
|
||||
setCode() {
|
||||
setCode() {
|
||||
console.log('this.MaterialList', this.urlOptions.dictArr.dict0);
|
||||
|
||||
this.MaterialList.forEach((item) => {
|
||||
if (item.id === this.dataForm.materialId) {
|
||||
this.dataForm.code = item.code;
|
||||
this.unit =
|
||||
'元/' +
|
||||
this.urlOptions.dictArr.dict0.find((d) => d.value === item.unit)
|
||||
this.urlOptions.dictArr.dict0.find((d) => d.value == item.unit)
|
||||
.label;
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
dataFormSubmit() {
|
||||
this.$refs["dataForm"].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.updateURL(this.dataForm).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
this.urlOptions.createURL(this.dataForm).then(response => {
|
||||
// console.log('response',);
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -47,15 +47,15 @@ const tableProps = [
|
||||
prop: 'equipmentName',
|
||||
label: '设备',
|
||||
},
|
||||
{
|
||||
prop: 'size',
|
||||
label: '规格',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'process',
|
||||
label: '产品工艺',
|
||||
},
|
||||
// {
|
||||
// prop: 'size',
|
||||
// label: '规格',
|
||||
// showOverflowtooltip: true,
|
||||
// },
|
||||
// {
|
||||
// prop: 'process',
|
||||
// label: '产品工艺',
|
||||
// },
|
||||
{
|
||||
prop: 'standardCt',
|
||||
label: '标准节拍pcs/min',
|
||||
@@ -128,7 +128,7 @@ export default {
|
||||
this.tableData = response.data;
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
},
|
||||
handleClick(val) {
|
||||
const data = {
|
||||
...this.time,
|
||||
|
||||
295
src/views/core/analysis/balanceAnalysis/index-jiepai.vue
Normal file
@@ -0,0 +1,295 @@
|
||||
<!--
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-08-29 14:59:29
|
||||
* @LastEditTime: 2026-04-16 13:14:29
|
||||
* @LastEditors: zwq
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@select-changed="handleSearchBarChanged"
|
||||
@headBtnClick="buttonClick" />
|
||||
<div v-if="showData.length">
|
||||
<base-table
|
||||
class="right-aside"
|
||||
v-loading="dataListLoading"
|
||||
:table-props="tableProps"
|
||||
:page="1"
|
||||
:limit="999"
|
||||
:table-data="showData">
|
||||
<method-btn
|
||||
v-if="showData.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<barChart
|
||||
v-for="item in chartData"
|
||||
:key="item.name + 'echart'"
|
||||
style="margin-top: 50px"
|
||||
height="600px"
|
||||
:id="item.name + 'echart'"
|
||||
:title="item.name + ' 节拍趋势图'"
|
||||
:bar-data="item" />
|
||||
</div>
|
||||
<div v-else class="no-data-bg"></div>
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
close-on-click-modal
|
||||
top="0"
|
||||
width="50%">
|
||||
<eq-detail ref="eqDetail" />
|
||||
<slot name="footer">
|
||||
<el-row slot="footer" type="flex" justify="end">
|
||||
<el-col :span="24">
|
||||
<el-button size="small" class="btnTextStyle" @click="handleCancel">
|
||||
取消
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</slot>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import eqDetail from './eq-detail';
|
||||
import { parseTime } from '../../mixins/code-filter';
|
||||
import { getPLlistByFactory } from '@/api/core/monitoring/auto';
|
||||
import { getNewCTNow, getNewCTCharts } from '@/api/core/analysis/index';
|
||||
import { getFactoryPage } from '@/api/core/base/factory';
|
||||
// import codeFilter from '../../mixins/code-filter'
|
||||
import * as XLSX from 'xlsx';
|
||||
import FileSaver from 'file-saver';
|
||||
import barChart from './BarChart.vue';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'factoryName',
|
||||
label: '工厂',
|
||||
},
|
||||
{
|
||||
prop: 'lineName',
|
||||
label: '产线',
|
||||
},
|
||||
{
|
||||
prop: 'size',
|
||||
label: '规格',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'process',
|
||||
label: '产品工艺',
|
||||
},
|
||||
{
|
||||
prop: 'edgeCt',
|
||||
label: '磨边当前节拍pcs/min',
|
||||
},
|
||||
{
|
||||
prop: 'temperCt',
|
||||
label: '钢化当前节拍pcs/min',
|
||||
},
|
||||
{
|
||||
prop: 'downCt',
|
||||
label: '下片当前节拍pcs/min',
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
components: {
|
||||
barChart,
|
||||
eqDetail,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getNewCTNow,
|
||||
},
|
||||
listQuery: {
|
||||
lineId: [],
|
||||
},
|
||||
fileName: '',
|
||||
dataListLoading: false,
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
{
|
||||
type: 'eq',
|
||||
btnName: '详情',
|
||||
},
|
||||
].filter((v) => v),
|
||||
showData: [],
|
||||
tableData: [],
|
||||
chartData: [],
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '工厂',
|
||||
selectOptions: [],
|
||||
param: 'factoryId',
|
||||
collapseTags: true,
|
||||
multiple: true,
|
||||
onchange: true,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '产线',
|
||||
selectOptions: [],
|
||||
param: 'lineId',
|
||||
collapseTags: true,
|
||||
multiple: true,
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间范围',
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'timestamp',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
defaultTime: ['00:00:00', '23:59:59'],
|
||||
param: 'timeVal',
|
||||
width: 350,
|
||||
clearable: false,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
],
|
||||
addOrEditTitle: '',
|
||||
addOrUpdateVisible: false,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// 获取当前时间
|
||||
const now = new Date();
|
||||
// 获取前一天的同一时间
|
||||
const yesterday = new Date(now.getTime());
|
||||
// 设置为00:00:00
|
||||
yesterday.setHours(0, 0, 0, 0);
|
||||
// 设置为23:59:59
|
||||
const end = new Date(yesterday.getTime());
|
||||
end.setHours(23, 59, 59, 59);
|
||||
this.listQuery.startTime = yesterday.getTime();
|
||||
this.listQuery.endTime = end.getTime();
|
||||
this.$nextTick(() => {
|
||||
this.$refs.searchBarForm.formInline.timeVal = [
|
||||
yesterday.getTime(),
|
||||
end.getTime(),
|
||||
];
|
||||
});
|
||||
this.getDataList();
|
||||
this.getPdLineList();
|
||||
},
|
||||
methods: {
|
||||
handleExport() {
|
||||
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 {
|
||||
FileSaver.saveAs(
|
||||
new Blob([exportTableOut], {
|
||||
type: 'application/octet-stream',
|
||||
}),
|
||||
this.fileName + '产线自动报表.xlsx'
|
||||
);
|
||||
} catch (e) {
|
||||
if (typeof console !== 'undefined') console.log(e, exportTableOut);
|
||||
}
|
||||
return exportTableOut;
|
||||
},
|
||||
getPdLineList() {
|
||||
// getPLlistByFactory().then((res) => {
|
||||
// this.formConfig[1].selectOptions = res.data || [];
|
||||
// });
|
||||
const params = {
|
||||
pageSize: 100,
|
||||
pageNo: 1,
|
||||
};
|
||||
getFactoryPage(params).then((res) => {
|
||||
this.formConfig[0].selectOptions = res.data.list || [];
|
||||
});
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.factoryId = val.factoryId || undefined;
|
||||
this.listQuery.lineId = val.lineId ? val.lineId : [];
|
||||
this.listQuery.startTime = val.timeVal ? val.timeVal[0] : undefined;
|
||||
this.listQuery.endTime = val.timeVal ? val.timeVal[1] : undefined;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'export':
|
||||
this.handleExport();
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
this.urlOptions.getDataListURL(this.listQuery).then((response) => {
|
||||
this.tableData = response.data;
|
||||
this.dataListLoading = false;
|
||||
this.showData = this.tableData;
|
||||
});
|
||||
getNewCTCharts(this.listQuery).then((response) => {
|
||||
this.chartData = response.data;
|
||||
});
|
||||
},
|
||||
handleSearchBarChanged({ param, value }) {
|
||||
this.listQuery.lineId = [];
|
||||
this.$refs.searchBarForm.formInline.lineId = undefined;
|
||||
getPLlistByFactory({ factoryIds: this.$refs.searchBarForm.formInline.factoryId }).then((res) => {
|
||||
this.formConfig[1].selectOptions = res.data || [];
|
||||
});
|
||||
},
|
||||
handleClick(val) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle =
|
||||
val.data?.factoryName + '-' + val.data?.lineName + ' 详情';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.eqDetail.init(
|
||||
val.data.lineId,
|
||||
this.listQuery.startTime,
|
||||
this.listQuery.endTime
|
||||
);
|
||||
});
|
||||
},
|
||||
handleCancel() {
|
||||
this.addOrUpdateVisible = false;
|
||||
this.addOrEditTitle = '';
|
||||
},
|
||||
handleConfirm() {
|
||||
this.handleCancel();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -1,296 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<div v-if="tableData.length">
|
||||
<base-table
|
||||
v-loading="dataListLoading"
|
||||
:span-method="mergeColumnHandler"
|
||||
:max-height="tableH"
|
||||
:table-props="tableProps"
|
||||
:table-data="tableData" />
|
||||
<SearchBar :formConfigs="[{ label: '产线平衡分析图', type: 'title' }]" />
|
||||
<balance-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>
|
||||
|
||||
<script>
|
||||
// import basicPage from '../../mixins/basic-page';
|
||||
import { parseTime } from '../../mixins/code-filter';
|
||||
import { getCT } from '@/api/core/analysis/index';
|
||||
import { getProductionLinePage } from '@/api/core/base/productionLine';
|
||||
import BalanceChart from '../balanceChart';
|
||||
import { time } from 'echarts';
|
||||
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 {
|
||||
components: {
|
||||
BalanceChart,
|
||||
},
|
||||
mixins: [tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getCT,
|
||||
},
|
||||
tableProps: [],
|
||||
dataListLoading: false,
|
||||
tableData: [],
|
||||
listQuery: {
|
||||
// time: ''
|
||||
endTime: undefined,
|
||||
lineId: undefined,
|
||||
startTime: undefined,
|
||||
},
|
||||
timeList: [],
|
||||
spanArr: [],
|
||||
xData: [],
|
||||
yData: [],
|
||||
optionArrUrl: [getProductionLinePage],
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '产线',
|
||||
selectOptions: [],
|
||||
param: 'lineIds',
|
||||
defaultSelect: '',
|
||||
multiple: false,
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间',
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
width: 350,
|
||||
param: 'time',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getArr();
|
||||
},
|
||||
methods: {
|
||||
getArr() {
|
||||
const params = {
|
||||
page: 1,
|
||||
limit: 500,
|
||||
};
|
||||
this.optionArrUrl.forEach((item, index) => {
|
||||
item(params).then((response) => {
|
||||
this.formConfig[index].selectOptions = response.data.list;
|
||||
});
|
||||
});
|
||||
},
|
||||
setRowSpan(arr) {
|
||||
let count = 0;
|
||||
arr.forEach((item, index) => {
|
||||
if (index === 0) {
|
||||
this.spanArr.push(1);
|
||||
} else {
|
||||
if (item === arr[index - 1]) {
|
||||
this.spanArr[count] += 1;
|
||||
this.spanArr.push(0);
|
||||
} else {
|
||||
count = index;
|
||||
this.spanArr.push(1);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 合并table列的规则 */
|
||||
mergeColumnHandler({ row, column, rowIndex, columnIndex }) {
|
||||
if (columnIndex == 0) {
|
||||
if (this.spanArr[rowIndex]) {
|
||||
return [
|
||||
this.spanArr[rowIndex], // row span
|
||||
1, // col span
|
||||
];
|
||||
} else {
|
||||
return [0, 0];
|
||||
}
|
||||
}
|
||||
},
|
||||
getData() {
|
||||
// this.listQuery.lineId = '1672847052717821953'
|
||||
// this.listQuery.startTime = '1693497600000';
|
||||
// this.listQuery.endTime = '1693843200000';
|
||||
this.urlOptions.getDataListURL(this.listQuery).then((res) => {
|
||||
console.log(res);
|
||||
let arr = [
|
||||
{
|
||||
prop: 'sectionName',
|
||||
label: '工段',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
prop: 'equName',
|
||||
label: '设备',
|
||||
align: 'center',
|
||||
width: 150
|
||||
},
|
||||
];
|
||||
let sectionArr = [];
|
||||
res.data.data.forEach((ele, index) => {
|
||||
let tempData = [];
|
||||
let ggData = [];
|
||||
let sbluData = [];
|
||||
let sbsjData = [];
|
||||
let cxluData = [];
|
||||
let cxsjData = [];
|
||||
ele.data.forEach((item, index) => {
|
||||
item.children.forEach((params) => {
|
||||
if (params.dynamicName === '生产规格') {
|
||||
tempData[item.dynamicName + '_gg'] = params.dynamicValue;
|
||||
ggData[index] = params.dynamicValue;
|
||||
} else if (params.dynamicName === '设备理论速度') {
|
||||
tempData[item.dynamicName + '_sblu'] = params.dynamicValue;
|
||||
sbluData[index] = params.dynamicValue;
|
||||
} else if (params.dynamicName === '设备实际速度') {
|
||||
tempData[item.dynamicName + '_sbsj'] = params.dynamicValue;
|
||||
sbsjData[index] = params.dynamicValue;
|
||||
} else if (params.dynamicName === '产线理论速度') {
|
||||
tempData[item.dynamicName + '_cxlu'] = params.dynamicValue;
|
||||
cxluData[index] = params.dynamicValue;
|
||||
} else if(params.dynamicName === '产线实际速度') {
|
||||
tempData[item.dynamicName + '_cxsj'] = params.dynamicValue;
|
||||
cxsjData[index] = params.dynamicValue;
|
||||
}
|
||||
});
|
||||
});
|
||||
const equipment = {
|
||||
name: ele.equName,
|
||||
ggData: ggData,
|
||||
sbluData: sbluData,
|
||||
sbsjData: sbsjData,
|
||||
cxluData: cxluData,
|
||||
cxsjData: cxsjData,
|
||||
};
|
||||
tempData['equName'] = ele.equName;
|
||||
tempData['sectionName'] = ele.sectionName;
|
||||
this.tableData.push(tempData);
|
||||
const { sectionName } = tempData;
|
||||
sectionArr.push(sectionName);
|
||||
this.yData.push(equipment);
|
||||
});
|
||||
this.setRowSpan(sectionArr);
|
||||
res.data.nameData.forEach((item) => {
|
||||
this.timeList.push(item.name);
|
||||
});
|
||||
const timeArray = Array.from(new Set(this.timeList));
|
||||
console.log(timeArray)
|
||||
for (const times of timeArray) {
|
||||
if (times !== '生产规格' && times !== '设备理论速度' && times !== '设备实际速度'
|
||||
&& times !== '产线理论速度' && times !== '产线实际速度'
|
||||
) {
|
||||
const subprop = {
|
||||
label: times,
|
||||
align: 'center',
|
||||
children: [
|
||||
{ prop: times + '_gg', label: '生产规格', align: 'center' },
|
||||
{ prop: times + '_sblu', label: '设备理论速度[片/min]', align: 'center' },
|
||||
{ prop: times + '_sbsj', label: '设备实际速度[片/min]', align: 'center' },
|
||||
{ prop: times + '_cxlu', label: '产线理论速度[片/min]', align: 'center' },
|
||||
{ prop: times + '_cxsj', label: '产线实际速度[片/min]', align: 'center' },
|
||||
],
|
||||
};
|
||||
arr.push(subprop);
|
||||
this.xData.push(times);
|
||||
}
|
||||
}
|
||||
this.tableProps = arr;
|
||||
|
||||
console.log(this.$refs)
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.lineChart.initChart(this.xData, this.yData);
|
||||
})
|
||||
// this.total = response.data.total;
|
||||
// this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
buttonClick(val) {
|
||||
// console.log(val)
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
// this.listQuery.pageNo = 1;
|
||||
// this.listQuery.pageSize = 10;
|
||||
this.listQuery.lineId = val.lineIds;
|
||||
this.listQuery.startTime = val.time
|
||||
? String(new Date(val.time[0]).getTime())
|
||||
: undefined;
|
||||
this.listQuery.endTime = val.time
|
||||
? String(new Date(val.time[1]).getTime())
|
||||
: undefined;
|
||||
if (val.time && val.lineIds) {
|
||||
this.tableData = [];
|
||||
this.xData = [];
|
||||
this.yData = [];
|
||||
this.tableProps = [];
|
||||
this.spanArr = [];
|
||||
this.timeList = [];
|
||||
this.getData();
|
||||
} else {
|
||||
this.$message({
|
||||
message: '请选择产线和时间',
|
||||
type: 'warning',
|
||||
});
|
||||
}
|
||||
break;
|
||||
case 'reset':
|
||||
this.$refs.searchBarForm.resetForm();
|
||||
this.listQuery = {
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
total: 1,
|
||||
};
|
||||
this.getDataList();
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -1,162 +1,223 @@
|
||||
<!--
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-08-29 14:59:29
|
||||
* @LastEditTime: 2025-01-09 10:27:53
|
||||
* @LastEditors: zwq
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@select-changed="handleSearchBarChanged"
|
||||
@headBtnClick="buttonClick" />
|
||||
<div v-if="showData.length">
|
||||
<base-table
|
||||
class="right-aside"
|
||||
v-loading="dataListLoading"
|
||||
:table-props="tableProps"
|
||||
:page="1"
|
||||
:limit="999"
|
||||
:table-data="showData">
|
||||
<method-btn
|
||||
v-if="showData.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<barChart
|
||||
v-for="item in chartData"
|
||||
:key="item.name + 'echart'"
|
||||
style="margin-top: 50px"
|
||||
height="600px"
|
||||
:id="item.name + 'echart'"
|
||||
:title="item.name + ' 节拍趋势图'"
|
||||
:bar-data="item" />
|
||||
<div style="background: #f2f4f9">
|
||||
<div style="background: #f2f4f9; height: 38px; width: 100%">
|
||||
<ButtonNav
|
||||
ref="buttonNav"
|
||||
:menus="['OEE分析', 'TEEP分析', '节拍分析']"
|
||||
@change="currentMenu">
|
||||
<template v-slot:tab1>
|
||||
<div>OEE分析</div>
|
||||
</template>
|
||||
<template v-slot:tab2>
|
||||
<div>TEEP分析</div>
|
||||
</template>
|
||||
<template v-slot:tab3>
|
||||
<div>节拍分析</div>
|
||||
</template>
|
||||
</ButtonNav>
|
||||
</div>
|
||||
<div class="scroll-container" v-if="activeName !== '节拍分析'">
|
||||
<!-- 外层滚动容器 -->
|
||||
<div class="card-scroll-wrapper">
|
||||
<!-- 卡片列表 -->
|
||||
<div
|
||||
v-for="(item, index) in lineList"
|
||||
:key="index"
|
||||
class="efficiency-card">
|
||||
<div class="card-label">
|
||||
{{ item[activeName === 'OEE分析' ? 'oeename' : 'teepname'] }}
|
||||
</div>
|
||||
<div class="card-value">
|
||||
{{ item[activeName === 'OEE分析' ? 'oeevalue' : 'teepvalue'] }}%
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
style="
|
||||
background: #ffffff;
|
||||
width: 100%;
|
||||
margin-bottom: 8px;
|
||||
padding: 10px 10px 0 10px;
|
||||
">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
v-if="activeName !== '节拍分析'"
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="app-container"
|
||||
v-if="activeName === 'OEE分析'"
|
||||
style="background: #ffffff">
|
||||
<!-- 表 -->
|
||||
<div>
|
||||
<base-table
|
||||
:page="1"
|
||||
:limit="100"
|
||||
:table-props="tableProps1"
|
||||
:table-data="list"
|
||||
:max-height="500"></base-table>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="app-container"
|
||||
v-else-if="activeName === 'TEEP分析'"
|
||||
style="background: #ffffff">
|
||||
<!-- 表 -->
|
||||
<div>
|
||||
<base-table
|
||||
:page="1"
|
||||
:limit="100"
|
||||
:table-props="tableProps2"
|
||||
:table-data="list"
|
||||
:max-height="500"></base-table>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else style="background: #ffffff">
|
||||
<indexJiepai />
|
||||
</div>
|
||||
<div v-else class="no-data-bg"></div>
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
close-on-click-modal
|
||||
top="0"
|
||||
width="50%">
|
||||
<eq-detail ref="eqDetail" />
|
||||
<slot name="footer">
|
||||
<el-row slot="footer" type="flex" justify="end">
|
||||
<el-col :span="24">
|
||||
<el-button size="small" class="btnTextStyle" @click="handleCancel">
|
||||
取消
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</slot>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import eqDetail from './eq-detail';
|
||||
import { parseTime } from '../../mixins/code-filter';
|
||||
import { getPdList } from '@/api/core/monitoring/auto';
|
||||
import { getNewCTNow, getNewCTCharts } from '@/api/core/analysis/index';
|
||||
import { getFactoryPage } from '@/api/core/base/factory';
|
||||
// import codeFilter from '../../mixins/code-filter'
|
||||
import * as XLSX from 'xlsx';
|
||||
import FileSaver from 'file-saver';
|
||||
import barChart from './BarChart.vue';
|
||||
import ButtonNav from '@/components/ButtonNav';
|
||||
import indexJiepai from './index-jiepai.vue';
|
||||
import { getProductionLinePage } from '@/api/core/base/productionLine';
|
||||
import {
|
||||
listHeader,
|
||||
listLineReport,
|
||||
exportTeepExcel,
|
||||
exportOeeExcel,
|
||||
} from '@/api/core/analysis/index';
|
||||
import subDiv from './subDiv.vue';
|
||||
|
||||
const tableProps = [
|
||||
const tableProps1 = [
|
||||
{
|
||||
prop: 'factoryName',
|
||||
label: '工厂',
|
||||
prop: 'name',
|
||||
label: '名称',
|
||||
},
|
||||
{
|
||||
prop: 'lineName',
|
||||
label: '产线',
|
||||
prop: 'timeVal',
|
||||
label: '时间段',
|
||||
subcomponent: subDiv,
|
||||
},
|
||||
{
|
||||
prop: 'size',
|
||||
label: '规格',
|
||||
showOverflowtooltip: true,
|
||||
prop: 'plannedProductionHours',
|
||||
label: '计划生产时长',
|
||||
},
|
||||
{
|
||||
prop: 'process',
|
||||
label: '产品工艺',
|
||||
prop: 'actualRunningHours',
|
||||
label: '实际运行时长',
|
||||
},
|
||||
{
|
||||
prop: 'edgeCt',
|
||||
label: '磨边当前节拍pcs/min',
|
||||
prop: 'actualDowntimeHours',
|
||||
label: '实际停机时长',
|
||||
},
|
||||
{
|
||||
prop: 'temperCt',
|
||||
label: '钢化当前节拍pcs/min',
|
||||
prop: 'inputQuantity',
|
||||
label: '上片数量(片)',
|
||||
},
|
||||
{
|
||||
prop: 'downCt',
|
||||
label: '下片当前节拍pcs/min',
|
||||
prop: 'outputQuantity',
|
||||
label: '下片数量',
|
||||
},
|
||||
{
|
||||
prop: 'qualityRate',
|
||||
label: '良品率',
|
||||
},
|
||||
{
|
||||
prop: 'availabilityRate',
|
||||
label: '可用率',
|
||||
},
|
||||
{
|
||||
prop: 'performanceRate',
|
||||
label: '性能',
|
||||
},
|
||||
{
|
||||
prop: 'oee',
|
||||
label: 'OEE',
|
||||
//filter: (val) => (val ? val.join(',') : ''),
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
components: {
|
||||
barChart,
|
||||
eqDetail,
|
||||
const tableProps2 = [
|
||||
{
|
||||
prop: 'name',
|
||||
label: '产线名称',
|
||||
},
|
||||
{
|
||||
prop: 'timeVal',
|
||||
label: '时间段',
|
||||
subcomponent: subDiv,
|
||||
},
|
||||
{
|
||||
prop: 'teep',
|
||||
label: 'TEEP',
|
||||
},
|
||||
{
|
||||
prop: 'oee',
|
||||
label: 'OEE',
|
||||
},
|
||||
{
|
||||
prop: 'useRate',
|
||||
label: '设备使用率',
|
||||
},
|
||||
{
|
||||
prop: 'capacityUtilization',
|
||||
label: '产能利用率',
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: '',
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getNewCTNow,
|
||||
},
|
||||
listQuery: {
|
||||
lineId: [],
|
||||
},
|
||||
fileName: '',
|
||||
dataListLoading: false,
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
{
|
||||
type: 'eq',
|
||||
btnName: '详情',
|
||||
},
|
||||
].filter((v) => v),
|
||||
showData: [],
|
||||
tableData: [],
|
||||
chartData: [],
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '工厂',
|
||||
selectOptions: [],
|
||||
param: 'factoryId',
|
||||
onchange: true,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '产线',
|
||||
selectOptions: [],
|
||||
param: 'lineId',
|
||||
collapseTags: true,
|
||||
multiple: true,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '报表类型',
|
||||
selectOptions: [
|
||||
{
|
||||
id: 0,
|
||||
name: '班',
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
name: '日',
|
||||
},
|
||||
// {
|
||||
// id: 2,
|
||||
// name: '周',
|
||||
// },
|
||||
{
|
||||
id: 3,
|
||||
name: '月',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: '年',
|
||||
},
|
||||
],
|
||||
param: 'type',
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间范围',
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'timestamp',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
defaultTime: ['00:00:00', '23:59:59'],
|
||||
param: 'timeVal',
|
||||
width: 350,
|
||||
clearable: false,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@@ -164,139 +225,163 @@ export default {
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
// {
|
||||
// type: 'separate',
|
||||
// },
|
||||
// {
|
||||
// // type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
|
||||
// type: 'button',
|
||||
// btnName: '导出',
|
||||
// name: 'export',
|
||||
// color: 'warning',
|
||||
// },
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'warning',
|
||||
},
|
||||
],
|
||||
addOrEditTitle: '',
|
||||
addOrUpdateVisible: false,
|
||||
activeName: 'OEE分析',
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
lineId: null,
|
||||
type: null,
|
||||
createTime: null,
|
||||
},
|
||||
tableProps1,
|
||||
tableProps2,
|
||||
list: [],
|
||||
lineList: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// 获取当前时间
|
||||
const now = new Date();
|
||||
// 获取前一天的同一时间
|
||||
const yesterday = new Date(now.getTime());
|
||||
// 设置为00:00:00
|
||||
yesterday.setHours(0, 0, 0, 0);
|
||||
// 设置为23:59:59
|
||||
const end = new Date(yesterday.getTime());
|
||||
end.setHours(23, 59, 59, 59);
|
||||
this.listQuery.startTime = yesterday.getTime();
|
||||
this.listQuery.endTime = end.getTime();
|
||||
this.$nextTick(() => {
|
||||
this.$refs.searchBarForm.formInline.timeVal = [
|
||||
yesterday.getTime(),
|
||||
end.getTime(),
|
||||
];
|
||||
components: { ButtonNav, indexJiepai },
|
||||
mounted() {
|
||||
listHeader().then((response) => {
|
||||
this.lineList = response.data.map((item) => ({
|
||||
oeename: `${item.name}累计OEE综合效率`,
|
||||
teepname: `${item.name}累计TEEP综合效率`,
|
||||
oeevalue: item.oee.toFixed(2),
|
||||
teepvalue: item.teep.toFixed(2),
|
||||
}));
|
||||
});
|
||||
this.$nextTick(() => {
|
||||
getProductionLinePage({
|
||||
page: 1,
|
||||
limit: 500,
|
||||
}).then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data.list;
|
||||
});
|
||||
if (this.$refs.buttonNav) {
|
||||
this.$refs.buttonNav.currentMenu = 'OEE分析';
|
||||
}
|
||||
this.getPage();
|
||||
});
|
||||
this.getDataList();
|
||||
this.getPdLineList();
|
||||
},
|
||||
methods: {
|
||||
handleExport() {
|
||||
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'));
|
||||
currentMenu(val) {
|
||||
this.activeName = val;
|
||||
if (this.activeName !== '节拍分析') {
|
||||
this.getPage();
|
||||
}
|
||||
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 {
|
||||
FileSaver.saveAs(
|
||||
new Blob([exportTableOut], {
|
||||
type: 'application/octet-stream',
|
||||
}),
|
||||
this.fileName + '产线自动报表.xlsx'
|
||||
);
|
||||
} catch (e) {
|
||||
if (typeof console !== 'undefined') console.log(e, exportTableOut);
|
||||
}
|
||||
return exportTableOut;
|
||||
},
|
||||
getPdLineList() {
|
||||
getPdList().then((res) => {
|
||||
this.formConfig[1].selectOptions = res.data || [];
|
||||
});
|
||||
const params = {
|
||||
pageSize: 100,
|
||||
pageNo: 1,
|
||||
};
|
||||
getFactoryPage(params).then((res) => {
|
||||
this.formConfig[0].selectOptions = res.data.list || [];
|
||||
getPage() {
|
||||
listLineReport(this.queryParams).then((response) => {
|
||||
this.list = response.data;
|
||||
});
|
||||
},
|
||||
// 查询
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.factoryId = val.factoryId || undefined;
|
||||
this.listQuery.lineId = val.lineId ? val.lineId : [];
|
||||
this.listQuery.startTime = val.timeVal ? val.timeVal[0] : undefined;
|
||||
this.listQuery.endTime = val.timeVal ? val.timeVal[1] : undefined;
|
||||
this.getDataList();
|
||||
this.queryParams.lineId = val.lineId;
|
||||
this.queryParams.type = val.type;
|
||||
this.queryParams.createTime = val.timeVal;
|
||||
this.getPage();
|
||||
break;
|
||||
case 'export':
|
||||
this.queryParams.lineId = val.lineId;
|
||||
this.queryParams.type = val.type;
|
||||
this.queryParams.createTime = val.timeVal;
|
||||
this.handleExport();
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
this.urlOptions.getDataListURL(this.listQuery).then((response) => {
|
||||
this.tableData = response.data;
|
||||
this.dataListLoading = false;
|
||||
this.showData = this.tableData;
|
||||
});
|
||||
getNewCTCharts(this.listQuery).then((response) => {
|
||||
this.chartData = response.data;
|
||||
});
|
||||
},
|
||||
handleSearchBarChanged({ param, value }) {
|
||||
this.listQuery.lineId = [];
|
||||
this.$refs.searchBarForm.formInline.lineId = undefined;
|
||||
getPdList(value).then((res) => {
|
||||
this.formConfig[1].selectOptions = res.data || [];
|
||||
});
|
||||
},
|
||||
handleClick(val) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle =
|
||||
val.data?.factoryName + '-' + val.data?.lineName + ' 详情';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.eqDetail.init(
|
||||
val.data.lineId,
|
||||
this.listQuery.startTime,
|
||||
this.listQuery.endTime
|
||||
);
|
||||
});
|
||||
},
|
||||
handleCancel() {
|
||||
this.addOrUpdateVisible = false;
|
||||
this.addOrEditTitle = '';
|
||||
},
|
||||
handleConfirm() {
|
||||
this.handleCancel();
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
const params = { ...this.queryParams };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal
|
||||
.confirm('是否确认导出所有数据项?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return this.activeName == 'OEE分析'
|
||||
? exportOeeExcel(params)
|
||||
: exportTeepExcel(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '报表.xls');
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
/* 外层容器:限制高度,提供背景 */
|
||||
.scroll-container {
|
||||
width: 100%;
|
||||
padding: 10px 0;
|
||||
background-color: #f5f5f5; /* 背景色,可根据UI调整 */
|
||||
}
|
||||
|
||||
/* 核心样式:横向滚动 */
|
||||
.card-scroll-wrapper {
|
||||
/* 重要:开启Flex,让子元素横向排列 */
|
||||
display: flex;
|
||||
/* 重要:不换行,强制排在一行 */
|
||||
flex-wrap: nowrap;
|
||||
/* 重要:添加横向滚动条 */
|
||||
overflow-x: auto;
|
||||
padding: 10px 15px;
|
||||
/* 对齐方式 */
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* 卡片样式:圆角、白色背景、阴影 */
|
||||
.efficiency-card {
|
||||
/* 固定宽度,也可以用 flex: 0 0 200px; 固定宽度 */
|
||||
min-width: 200px;
|
||||
height: 120px;
|
||||
margin: 0 10px; /* 卡片之间的间距 */
|
||||
padding: 20px 16px;
|
||||
background-color: #ffffff;
|
||||
border-radius: 12px; /* 圆角 */
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); /* 轻微阴影 */
|
||||
/* 卡片内部文字布局 */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
/* 防止文字挤压 */
|
||||
flex-shrink: 0;
|
||||
text-align: center;
|
||||
}
|
||||
.efficiency-card:hover {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
/* 标签文字 */
|
||||
.card-label {
|
||||
font-size: 14px;
|
||||
color: #666666;
|
||||
margin-bottom: 8px;
|
||||
white-space: nowrap; /* 确保文字也不换行 */
|
||||
}
|
||||
|
||||
/* 数值文字(加粗放大) */
|
||||
.card-value {
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
line-height: 1.2;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-13 16:18:41
|
||||
* @Date: 2024-07-01 14:53:55
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-17 09:28:31
|
||||
* @LastEditTime: 2026-03-18 14:32:19
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<span>
|
||||
{{
|
||||
(injectData.mainTaskType
|
||||
? ['','满盘搬运', '空盘搬运', '备料搬运', '临时搬运'][injectData.mainTaskType]
|
||||
: '-')
|
||||
}}
|
||||
</span>
|
||||
<div>
|
||||
<span>
|
||||
{{
|
||||
parseTime(injectData.startTime, '{y}年{m}月{d}日') +
|
||||
'-' +
|
||||
parseTime(injectData.endTime, '{y}年{m}月{d}日')
|
||||
}}
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -26,6 +28,7 @@ export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {},
|
||||
created() {},
|
||||
methods: {},
|
||||
};
|
||||
103
src/views/core/analysis/yieldAnalysis-handle/LineChart.vue
Normal file
@@ -0,0 +1,103 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-09-13 09:02:25
|
||||
* @LastEditTime: 2026-03-18 14:45:07
|
||||
* @LastEditors: zwq
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div :class="className" :style="{ height: height, width: width }" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as echarts from 'echarts';
|
||||
require('echarts/theme/macarons'); // echarts theme
|
||||
// import resize from './mixins/resize'
|
||||
|
||||
export default {
|
||||
// mixins: [resize],
|
||||
props: {
|
||||
className: {
|
||||
type: String,
|
||||
default: 'chart',
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: '100%',
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: '350px',
|
||||
},
|
||||
// autoResize: {
|
||||
// type: Boolean,
|
||||
// default: true
|
||||
// }
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
chart: null,
|
||||
};
|
||||
},
|
||||
// watch: {
|
||||
// chartData: {
|
||||
// deep: true,
|
||||
// handler(val) {
|
||||
// this.setOptions(val)
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
mounted() {
|
||||
// this.$nextTick(() => {
|
||||
// this.initChart()
|
||||
// })
|
||||
},
|
||||
// beforeDestroy() {
|
||||
// if (!this.chart) {
|
||||
// return
|
||||
// }
|
||||
// this.chart.dispose()
|
||||
// this.chart = null
|
||||
// },
|
||||
methods: {
|
||||
initChart(xData, yData, lineName) {
|
||||
this.chart = echarts.init(this.$el, 'macarons');
|
||||
this.setOptions(xData, yData, lineName);
|
||||
},
|
||||
setOptions(xData, yData, lineName) {
|
||||
let seriesData = [];
|
||||
lineName.forEach((item, index) => {
|
||||
seriesData.push(
|
||||
{
|
||||
name: item + '白班',
|
||||
data: yData[index].map(item => item.day),
|
||||
type: 'line',
|
||||
},
|
||||
{
|
||||
name: item + '夜班',
|
||||
data: yData[index].map(item => item.night),
|
||||
type: 'line',
|
||||
}
|
||||
);
|
||||
});
|
||||
const result = lineName.flatMap((item) => [item + '白班', item + '夜班']);
|
||||
this.chart.setOption(
|
||||
{
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: xData,
|
||||
},
|
||||
legend: {
|
||||
data: result,
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
},
|
||||
series: seriesData,
|
||||
},
|
||||
true
|
||||
);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||