Compare commits
18 Commits
projects/l
...
projects/s
| Author | SHA1 | Date | |
|---|---|---|---|
| 8226b45a03 | |||
| dde04cf93f | |||
| 63a67e58de | |||
| 48e9f70625 | |||
| f5f250cb16 | |||
| b6241fe7c4 | |||
| 94edd04a08 | |||
| b926559a7d | |||
| b2984ed4cf | |||
|
|
4ade2dfcdc | ||
|
|
852a3f17a0 | ||
| cba14b1f61 | |||
|
|
33c00785df | ||
|
|
d8acff21e3 | ||
|
|
c0a38c568f | ||
| be86cbd9b3 | |||
| 6a8a9ed28d | |||
| a2213f4f7e |
6
.env.dev
@@ -12,10 +12,10 @@ ENV = 'development'
|
|||||||
VUE_APP_TITLE = 智能监控分析系统
|
VUE_APP_TITLE = 智能监控分析系统
|
||||||
|
|
||||||
# 芋道管理系统/开发环境
|
# 芋道管理系统/开发环境
|
||||||
# VUE_APP_BASE_API = 'http://172.16.33.187:48082'
|
|
||||||
VUE_APP_BASE_API = 'http://line.kszny.picaiba.com'
|
|
||||||
# VUE_APP_BASE_API = 'http://172.16.32.79:48082'
|
|
||||||
|
|
||||||
|
VUE_APP_BASE_API = 'http://192.168.0.31:48080'
|
||||||
|
# VUE_APP_BASE_API = 'http://172.16.32.76:48080'
|
||||||
|
# VUE_APP_BASE_API = 'http://line.kszny.picaiba.com'
|
||||||
|
|
||||||
# 路由懒加载
|
# 路由懒加载
|
||||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"local": "vue-cli-service serve --mode local",
|
"local": "vue-cli-service serve --mode local",
|
||||||
"dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --mode dev",
|
"dev": "vue-cli-service serve --mode dev",
|
||||||
"front": "vue-cli-service serve --mode front",
|
"front": "vue-cli-service serve --mode front",
|
||||||
"build:prod": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode prod",
|
"build:prod": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode prod",
|
||||||
"build:stage": "vue-cli-service build --mode stage",
|
"build:stage": "vue-cli-service build --mode stage",
|
||||||
|
|||||||
72
src/api/areavisual/overview.js
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
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(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/line-edge-library/list/region',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取区域总览
|
||||||
|
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'
|
||||||
|
})
|
||||||
|
}
|
||||||
63
src/api/areavisual/record.js
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 获取出入库历史任务分页
|
||||||
|
export function getRecordPage(params) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/job-main-task-history/page',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取巷道列表
|
||||||
|
export function getLaneList(params) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/lane/page',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新能源实时数据库plc相关
|
||||||
|
export function updateEnergyPlc(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/energy-plc/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除能源实时数据库plc相关
|
||||||
|
export function deleteEnergyPlc(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/energy-plc/delete?id=' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取关联表编码
|
||||||
|
export function getCode() {
|
||||||
|
return request({
|
||||||
|
url: '/base/energy-plc/getCode',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得能源实时数据库plc相关分页
|
||||||
|
export function getEnergyPlcPage(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/energy-plc/page',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出能源实时数据库plc相关 Excel
|
||||||
|
export function exportEnergyPlcExcel(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/energy-plc/export-excel',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -59,34 +59,3 @@ export function getEquipmentAll() {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getTree(query) {
|
|
||||||
return request({
|
|
||||||
url: '/base/factory/getTreeSimple',
|
|
||||||
method: 'get',
|
|
||||||
params: query,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getEquipmentOverall(data) {
|
|
||||||
return request({
|
|
||||||
url: '/monitoring/equipment-overall/get',
|
|
||||||
method: 'post',
|
|
||||||
data: data,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getParamMonitor(data) {
|
|
||||||
return request({
|
|
||||||
url: '/monitoring/equipment-monitor/paramMonitor',
|
|
||||||
method: 'post',
|
|
||||||
data: data,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
export function getAlarmDet(data) {
|
|
||||||
return request({
|
|
||||||
url: 'monitoring/equipment-overall/alarmDet',
|
|
||||||
method: 'post',
|
|
||||||
data: data,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -52,5 +52,3 @@ export function exportEquipmentTypeExcel(query) {
|
|||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -50,15 +50,6 @@ export function getPdlAutoReportNewSearchNow(data) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getPdlAutoReportNewSearchLastGroup(data) {
|
|
||||||
return request({
|
|
||||||
url: '/monitoring/production-monitor/getPdlAutoReportNewSearchLastGroup',
|
|
||||||
method: 'post',
|
|
||||||
data: data,
|
|
||||||
timeout: 60000,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 班组自动报表分页
|
// 班组自动报表分页
|
||||||
export function getTeamReportPage(data) {
|
export function getTeamReportPage(data) {
|
||||||
|
|||||||
@@ -141,13 +141,3 @@ export function getPerView(data) {
|
|||||||
data:data
|
data:data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导出 Excel
|
|
||||||
export function exportExcel(query) {
|
|
||||||
return request({
|
|
||||||
url: '/base/group-scheduling-plan/export-excel',
|
|
||||||
method: 'get',
|
|
||||||
params: query,
|
|
||||||
responseType: 'blob'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -26,13 +26,6 @@ export function getGroup(id) {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 检查更新-生产班组
|
|
||||||
export function updateIsProduction(id) {
|
|
||||||
return request({
|
|
||||||
url: '/base/group-team/updateIsProduction?id=' + id,
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获得班组基础信息分页
|
// 获得班组基础信息分页
|
||||||
export function getGroupPage(query) {
|
export function getGroupPage(query) {
|
||||||
|
|||||||
@@ -90,29 +90,3 @@ export function getEnableData() {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 解除继承节假日
|
|
||||||
export function disExtends(data) {
|
|
||||||
return request({
|
|
||||||
url: '/base/group-holiday/disExtends',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 恢复继承节假日
|
|
||||||
export function reExtends(data) {
|
|
||||||
return request({
|
|
||||||
url: '/base/group-holiday/reExtends',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获得部门节假日继承设置信息设置
|
|
||||||
export function getSet(query) {
|
|
||||||
return request({
|
|
||||||
url: '/base/group-holiday-dept-set/getSet',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,56 +0,0 @@
|
|||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
// 创建能源监控配置
|
|
||||||
export function getDefectSummaryTable(data) {
|
|
||||||
return request({
|
|
||||||
url: '/extend/check-gaozhun-record/defectSummaryTable',
|
|
||||||
method: 'post',
|
|
||||||
data: data,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
export function getTranslucentPage(data) {
|
|
||||||
return request({
|
|
||||||
url: '/monitoring/translucent/page',
|
|
||||||
method: 'get',
|
|
||||||
params: data,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function exportTranslucent(data) {
|
|
||||||
return request({
|
|
||||||
url: '/monitoring/translucent/export-excel',
|
|
||||||
method: 'get',
|
|
||||||
params: data,
|
|
||||||
responseType: 'blob',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getDefectAnalysis(data) {
|
|
||||||
return request({
|
|
||||||
url: '/extend/check-gaozhun-record/defectAnalysis',
|
|
||||||
method: 'post',
|
|
||||||
data: data,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getSectionDefect(data) {
|
|
||||||
return request({
|
|
||||||
url: '/extend/check-gaozhun-record/sectionDefect',
|
|
||||||
method: 'post',
|
|
||||||
data: data,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
export function getDefectSummaryChart(data) {
|
|
||||||
return request({
|
|
||||||
url: '/extend/check-gaozhun-record/defectSummaryChart',
|
|
||||||
method: 'post',
|
|
||||||
data: data,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
export function getDefectSummaryDet(data) {
|
|
||||||
return request({
|
|
||||||
url: '/extend/check-gaozhun-record/defectSummaryDet',
|
|
||||||
method: 'post',
|
|
||||||
data: data,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
/*
|
|
||||||
* @Author: zhp
|
|
||||||
* @Date: 2023-12-08 15:26:59
|
|
||||||
* @LastEditTime: 2023-12-11 15:21:44
|
|
||||||
* @LastEditors: zhp
|
|
||||||
* @Description:
|
|
||||||
*/
|
|
||||||
import request from '@/utils/request'
|
|
||||||
export function getQualityIsraPage(query) {
|
|
||||||
return request({
|
|
||||||
url: '/extend/check-isra-statistics/getIsraData',
|
|
||||||
method: 'get',
|
|
||||||
params: query,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getQualityIsraDayMap(query) {
|
|
||||||
return request({
|
|
||||||
url: '/base/quality-isra-statistics/dayMap',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getQualityIsraWeekMap(query) {
|
|
||||||
return request({
|
|
||||||
url: '/base/quality-isra-statistics/weekMap',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getQualityIsraMonthMap(query) {
|
|
||||||
return request({
|
|
||||||
url: '/base/quality-isra-statistics/monthMap',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getQualityIsraDayList(query) {
|
|
||||||
return request({
|
|
||||||
url: '/base/quality-isra-statistics/dayList',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getQualityIsraWeekList(query) {
|
|
||||||
return request({
|
|
||||||
url: '/base/quality-isra-statistics/weekList',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getQualityIsraMonthList(query) {
|
|
||||||
return request({
|
|
||||||
url: '/base/quality-isra-statistics/monthList',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
154
src/api/ssdl/product&recipe.js
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2025-11-17 09:25:12
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2025-11-28 09:29:14
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
|
||||||
|
// 获得原料分页
|
||||||
|
export function getProductPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/material/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 获得原料
|
||||||
|
export function getProduct(id) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/material/get?id=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 删除原料
|
||||||
|
export function deleteProduct(id) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/material/delete?id=' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 更新
|
||||||
|
export function updateProduct(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/material/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建
|
||||||
|
export function createProduct(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/material/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 获得工艺分页
|
||||||
|
export function getProcessPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/process/page/group/by',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 获得工艺点击展开表格
|
||||||
|
export function getProcessDetailPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/process/page/group/by/detail',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 删除工艺
|
||||||
|
export function deleteProcess(id) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/process/delete?id=' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 批量删除工艺
|
||||||
|
export function deleteProcessList(ids) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/process/delete-list?ids=' + ids,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 更新
|
||||||
|
export function updateProcess(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/process/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建
|
||||||
|
export function createProcess(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/process/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 获得工艺
|
||||||
|
export function getProcess(id) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/process/get?id=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 工艺设备原料分页
|
||||||
|
export function getProcessMaterialPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/process-equipment-material/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 删除工艺设备原料
|
||||||
|
export function deleteProcessMaterial(id) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/process-equipment-material/delete?id=' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新
|
||||||
|
export function updateProcessMaterial(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/process-equipment-material/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建
|
||||||
|
export function createProcessMaterial(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/process-equipment-material/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 获得工艺
|
||||||
|
export function getProcessMaterial(id) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/process-equipment-material/get?id=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得设备分页
|
||||||
|
export function getEquipmentPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/equipment/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
60
src/api/ssdl/taskList.js
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2025-11-17 09:25:12
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2025-11-18 15:42:19
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
|
||||||
|
// 获得任务分页
|
||||||
|
export function getTaskPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/job-main-task/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 获得任务
|
||||||
|
export function getTask(id) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/job-main-task/get?id=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得任务日志分页
|
||||||
|
export function getTaskLogPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/job-main-task-log/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新
|
||||||
|
export function updateTask(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/job-main-task/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据区域id获取该区域下的库位信息
|
||||||
|
export function getRegion(id) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/line-edge-library/get-by-region-id?regionId=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建
|
||||||
|
export function createPCTask(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/job-main-task/pc-create-task',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
9
src/api/visualization/visualization.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function getLineEdgeLibraryList(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/line-edge-library/list',
|
||||||
|
method: 'get',
|
||||||
|
params: data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 9.1 KiB |
BIN
src/assets/img/ABN.png
Normal file
|
After Width: | Height: | Size: 461 B |
BIN
src/assets/img/ABNScale.png
Normal file
|
After Width: | Height: | Size: 321 B |
BIN
src/assets/img/DIS.png
Normal file
|
After Width: | Height: | Size: 312 B |
BIN
src/assets/img/DISScale.png
Normal file
|
After Width: | Height: | Size: 244 B |
BIN
src/assets/img/EP.png
Normal file
|
After Width: | Height: | Size: 137 B |
BIN
src/assets/img/EPScale.png
Normal file
|
After Width: | Height: | Size: 165 B |
BIN
src/assets/img/FP.png
Normal file
|
After Width: | Height: | Size: 139 B |
BIN
src/assets/img/FPScale.png
Normal file
|
After Width: | Height: | Size: 170 B |
BIN
src/assets/img/IDL.png
Normal file
|
After Width: | Height: | Size: 929 B |
BIN
src/assets/img/IDLScale.png
Normal file
|
After Width: | Height: | Size: 321 B |
BIN
src/assets/img/IT.png
Normal file
|
After Width: | Height: | Size: 320 B |
BIN
src/assets/img/ITScale.png
Normal file
|
After Width: | Height: | Size: 261 B |
BIN
src/assets/img/LCK.png
Normal file
|
After Width: | Height: | Size: 416 B |
BIN
src/assets/img/LCKScale.png
Normal file
|
After Width: | Height: | Size: 305 B |
BIN
src/assets/img/OCC.png
Normal file
|
After Width: | Height: | Size: 325 B |
BIN
src/assets/img/OCCScale.png
Normal file
|
After Width: | Height: | Size: 259 B |
BIN
src/assets/img/RES.png
Normal file
|
After Width: | Height: | Size: 420 B |
BIN
src/assets/img/RESScale.png
Normal file
|
After Width: | Height: | Size: 321 B |
BIN
src/assets/img/Top1.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
src/assets/img/Top2.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
src/assets/img/Top3.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
src/assets/img/Top4.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
src/assets/img/Top5.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
src/assets/img/agvCar.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
src/assets/img/agvItemBg.png
Normal file
|
After Width: | Height: | Size: 8.9 KiB |
BIN
src/assets/img/alarmItemBg.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
src/assets/img/chargeBg.png
Normal file
|
After Width: | Height: | Size: 326 B |
BIN
src/assets/img/chargeCircle.png
Normal file
|
After Width: | Height: | Size: 622 B |
BIN
src/assets/img/leftTable.png
Normal file
|
After Width: | Height: | Size: 220 B |
BIN
src/assets/img/recycle.png
Normal file
|
After Width: | Height: | Size: 379 B |
BIN
src/assets/img/rightTable.png
Normal file
|
After Width: | Height: | Size: 355 B |
BIN
src/assets/img/runBg.png
Normal file
|
After Width: | Height: | Size: 325 B |
BIN
src/assets/img/runCircle.png
Normal file
|
After Width: | Height: | Size: 562 B |
BIN
src/assets/img/ssdlLeftTitle.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
src/assets/img/ssdlTitle.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
src/assets/img/standbyCircle.png
Normal file
|
After Width: | Height: | Size: 611 B |
BIN
src/assets/img/threeDimensionalChartBg.png
Normal file
|
After Width: | Height: | Size: 1.9 MiB |
@@ -54,7 +54,7 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
// this.currentMenu = this.menus[0];
|
this.currentMenu = this.menus[0];
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
currentMenu(val) {
|
currentMenu(val) {
|
||||||
|
|||||||
@@ -6,43 +6,99 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-form ref="form" :model="form" :label-width="`${labelWidth}px`" :size="size" :label-position="labelPosition"
|
<el-form
|
||||||
|
ref="form"
|
||||||
|
:model="form"
|
||||||
|
:label-width="`${labelWidth}px`"
|
||||||
|
:size="size"
|
||||||
|
:label-position="labelPosition"
|
||||||
v-loading="formLoading">
|
v-loading="formLoading">
|
||||||
<el-row :gutter="20" v-for="(row, rindex) in rows" :key="rindex">
|
<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-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-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)"
|
<el-input
|
||||||
:placeholder="`请输入${col.label}`" v-bind="col.bind" />
|
v-if="col.input"
|
||||||
<el-input v-if="col.textarea" type="textarea" v-model="form[col.prop]" @change="$emit('update', form)"
|
v-model="form[col.prop]"
|
||||||
:placeholder="`请输入${col.label}`" v-bind="col.bind" />
|
@change="$emit('update', form)"
|
||||||
<el-select v-if="col.select" v-model="form[col.prop]" :placeholder="`请选择${col.label}`"
|
:placeholder="`请输入${col.label}`"
|
||||||
@change="$emit('update', form)" v-bind="col.bind">
|
v-bind="col.bind" />
|
||||||
<el-option v-for="opt in optionListOf[col.prop]" :key="opt.value" :label="opt.label" :value="opt.value" />
|
<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-select>
|
||||||
<el-date-picker v-if="col.datetime" v-model="form[col.prop]" type="datetime" :placeholder="`请选择${col.label}`"
|
<el-date-picker
|
||||||
value-format="timestamp" v-bind="col.bind"></el-date-picker>
|
v-if="col.datetime"
|
||||||
<el-switch v-if="col.switch" v-model="form[col.prop]" active-color="#0b58ff" inactive-color="#e1e1e1"
|
v-model="form[col.prop]"
|
||||||
v-bind="col.bind" @change="handleSwitchChange(col.prop)"></el-switch>
|
type="datetime"
|
||||||
<component v-if="col.subcomponent" :key="col.key" :is="col.subcomponent" :inlineStyle="col.style"></component>
|
:placeholder="`请选择${col.label}`"
|
||||||
|
value-format="timestamp"
|
||||||
|
v-bind="col.bind"></el-date-picker>
|
||||||
|
<el-switch
|
||||||
|
v-if="col.switch"
|
||||||
|
v-model="form[col.prop]"
|
||||||
|
active-color="#0b58ff"
|
||||||
|
inactive-color="#e1e1e1"
|
||||||
|
v-bind="col.bind"></el-switch>
|
||||||
|
<component
|
||||||
|
v-if="col.subcomponent"
|
||||||
|
:key="col.key"
|
||||||
|
:is="col.subcomponent"
|
||||||
|
:inlineStyle="col.style"></component>
|
||||||
|
|
||||||
<div class="upload-area" :class="uploadOpen ? '' : 'height-48'" ref="uploadArea" v-if="col.upload">
|
<div
|
||||||
|
class="upload-area"
|
||||||
|
:class="uploadOpen ? '' : 'height-48'"
|
||||||
|
ref="uploadArea"
|
||||||
|
v-if="col.upload">
|
||||||
<span class="close-icon" :class="uploadOpen ? 'open' : ''">
|
<span class="close-icon" :class="uploadOpen ? 'open' : ''">
|
||||||
<el-button type="text" icon="el-icon-arrow-right" @click="handleFilesOpen" />
|
<el-button
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-arrow-right"
|
||||||
|
@click="handleFilesOpen" />
|
||||||
</span>
|
</span>
|
||||||
<!-- :file-list="uploadedFileList" -->
|
<!-- :file-list="uploadedFileList" -->
|
||||||
<el-upload class="upload-in-dialog" v-if="col.upload" :action="uploadUrl" :headers="uploadHeaders"
|
<el-upload
|
||||||
:show-file-list="false" icon="el-icon-upload2" :before-upload="beforeUpload"
|
class="upload-in-dialog"
|
||||||
:on-success="handleUploadSuccess" v-bind="col.bind">
|
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">
|
<el-button size="mini" :disabled="col.bind?.disabled || false">
|
||||||
<svg-icon icon-class="icon-upload" style="color: inherit"></svg-icon>
|
<svg-icon
|
||||||
|
icon-class="icon-upload"
|
||||||
|
style="color: inherit"></svg-icon>
|
||||||
上传文件
|
上传文件
|
||||||
</el-button>
|
</el-button>
|
||||||
<div class="el-upload__tip" slot="tip" v-if="col.uploadTips">
|
<div class="el-upload__tip" slot="tip" v-if="col.uploadTips">
|
||||||
{{ col.uploadTips || '只能上传jpg/png文件, 大小不超过2MB' }}
|
{{ col.uploadTips || '只能上传jpg/png文件, 大小不超过2MB' }}
|
||||||
</div>
|
</div>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<uploadedFile class="file" v-for="file in form[col.prop] || []" :file="file" :key="file.fileUrl"
|
<uploadedFile
|
||||||
@delete="handleDeleteFile(file)" @Preview="handlePreview(file)" />
|
class="file"
|
||||||
|
v-for="file in form[col.prop] || []"
|
||||||
|
:file="file"
|
||||||
|
:key="file.fileUrl"
|
||||||
|
@delete="handleDeleteFile(file)"
|
||||||
|
@Preview="handlePreview(file)" />
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -79,7 +135,6 @@ const uploadedFile = {
|
|||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
handleDelete() {
|
handleDelete() {
|
||||||
this.$emit('delete', this.file);
|
this.$emit('delete', this.file);
|
||||||
},
|
},
|
||||||
@@ -197,11 +252,6 @@ export default {
|
|||||||
this.handleOptions();
|
this.handleOptions();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleSwitchChange(prop) {
|
|
||||||
// 触发 update 事件,将最新的 form 数据传递给父组件
|
|
||||||
this.$emit('update', { ...this.form });
|
|
||||||
console.log(`switch ${prop} 变化:`, this.form[prop]);
|
|
||||||
},
|
|
||||||
/** 模拟透传 ref */
|
/** 模拟透传 ref */
|
||||||
validate(cb) {
|
validate(cb) {
|
||||||
return this.$refs.form.validate(cb);
|
return this.$refs.form.validate(cb);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2022-08-24 11:19:43
|
* @Date: 2022-08-24 11:19:43
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2024-04-02 09:33:29
|
* @LastEditTime: 2025-11-28 09:35:03
|
||||||
* @Description:
|
* @Description:
|
||||||
*/
|
*/
|
||||||
export default {
|
export default {
|
||||||
@@ -69,7 +69,7 @@ export default {
|
|||||||
this.$refs.addOrUpdate.init(val.data.id);
|
this.$refs.addOrUpdate.init(val.data.id);
|
||||||
});
|
});
|
||||||
} else if (val.type === "delete") {
|
} else if (val.type === "delete") {
|
||||||
this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex)
|
this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex,val.data)
|
||||||
} else {
|
} else {
|
||||||
this.otherMethods(val)
|
this.otherMethods(val)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { isRelogin } from '@/utils/request'
|
|||||||
NProgress.configure({ showSpinner: false })
|
NProgress.configure({ showSpinner: false })
|
||||||
|
|
||||||
// 增加三方登陆 update by 芋艿
|
// 增加三方登陆 update by 芋艿
|
||||||
const whiteList = ['/login', '/social-login', '/auth-redirect', '/bind', '/register', '/oauthLogin/gitee']
|
const whiteList = ['/login', '/social-login','screenbg', '/auth-redirect', '/bind', '/register', '/oauthLogin/gitee']
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
NProgress.start()
|
NProgress.start()
|
||||||
@@ -25,9 +25,9 @@ router.beforeEach((to, from, next) => {
|
|||||||
// 获取字典数据 add by 芋艿
|
// 获取字典数据 add by 芋艿
|
||||||
store.dispatch('dict/loadDictDatas')
|
store.dispatch('dict/loadDictDatas')
|
||||||
// 判断当前用户是否已拉取完 user_info 信息
|
// 判断当前用户是否已拉取完 user_info 信息
|
||||||
store.dispatch('GetInfo').then(() => {
|
store.dispatch('GetInfo').then(userInfo => {
|
||||||
isRelogin.show = false
|
isRelogin.show = false
|
||||||
store.dispatch('GenerateRoutes').then(accessRoutes => {
|
store.dispatch('GenerateRoutes', userInfo.menus).then(accessRoutes => {
|
||||||
// 根据 roles 权限生成可访问的路由表
|
// 根据 roles 权限生成可访问的路由表
|
||||||
router.addRoutes(accessRoutes) // 动态添加可访问路由表
|
router.addRoutes(accessRoutes) // 动态添加可访问路由表
|
||||||
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
|
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
|
||||||
|
|||||||
@@ -35,185 +35,236 @@ export const constantRoutes = [
|
|||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '/redirect/:path(.*)',
|
path: '/redirect/:path(.*)',
|
||||||
component: (resolve) => require(['@/views/redirect'], resolve)
|
component: (resolve) => require(['@/views/redirect'], resolve),
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/login',
|
path: '/login',
|
||||||
component: (resolve) => require(['@/views/login'], resolve),
|
component: (resolve) => require(['@/views/login'], resolve),
|
||||||
hidden: true
|
// hidden: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: '/sso',
|
path: '/sso',
|
||||||
component: (resolve) => require(['@/views/sso'], resolve),
|
component: (resolve) => require(['@/views/sso'], resolve),
|
||||||
hidden: true
|
hidden: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/social-login',
|
path: '/social-login',
|
||||||
component: (resolve) => require(['@/views/socialLogin'], resolve),
|
component: (resolve) => require(['@/views/socialLogin'], resolve),
|
||||||
hidden: true
|
hidden: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/404',
|
path: '/404',
|
||||||
component: (resolve) => require(['@/views/error/404'], resolve),
|
component: (resolve) => require(['@/views/error/404'], resolve),
|
||||||
hidden: true
|
hidden: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/401',
|
path: '/401',
|
||||||
component: (resolve) => require(['@/views/error/401'], resolve),
|
component: (resolve) => require(['@/views/error/401'], resolve),
|
||||||
hidden: true
|
hidden: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/print-design',
|
path: '/print-design',
|
||||||
component: (resolve) => require(['@/views/print/design'], resolve),
|
component: (resolve) => require(['@/views/print/design'], resolve),
|
||||||
hidden: true
|
hidden: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "",
|
path: '',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: "index",
|
redirect: 'index',
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: "index",
|
path: 'index',
|
||||||
component: (resolve) => require(["@/views/home/index"], resolve),
|
component: (resolve) => require(['@/views/home/index'], resolve),
|
||||||
name: "首页",
|
name: '首页',
|
||||||
meta: { title: "首页", icon: "dashboard", affix: true },
|
meta: { title: '首页', icon: 'dashboard', affix: true },
|
||||||
hidden: true
|
hidden: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/screenbg',
|
||||||
|
component: () =>
|
||||||
|
import(
|
||||||
|
/* webpackChunkName: "about" */ '@/views/productionVisualization/equipmentBoard'
|
||||||
|
),
|
||||||
|
name: 'screenbg',
|
||||||
|
meta: { title: '大屏', icon: 'chart' },
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/user',
|
path: '/user',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
redirect: 'noredirect',
|
redirect: 'noredirect',
|
||||||
children: [{
|
children: [
|
||||||
|
{
|
||||||
path: 'profile',
|
path: 'profile',
|
||||||
component: (resolve) => require(['@/views/system/user/profile/index'], resolve),
|
component: (resolve) =>
|
||||||
|
require(['@/views/system/user/profile/index'], resolve),
|
||||||
name: 'Profile',
|
name: 'Profile',
|
||||||
meta: { title: '个人中心', icon: 'user' }
|
meta: { title: '个人中心', icon: 'user' },
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
path: 'notify-message',
|
path: 'notify-message',
|
||||||
component: (resolve) => require(['@/views/system/notify/my/index'], resolve),
|
component: (resolve) =>
|
||||||
|
require(['@/views/system/notify/my/index'], resolve),
|
||||||
name: 'MyNotifyMessage',
|
name: 'MyNotifyMessage',
|
||||||
meta: { title: '我的站内信', icon: 'message' },
|
meta: { title: '我的站内信', icon: 'message' },
|
||||||
}]
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/dict',
|
path: '/dict',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
children: [{
|
children: [
|
||||||
|
{
|
||||||
path: 'type/data/:dictId(\\d+)',
|
path: 'type/data/:dictId(\\d+)',
|
||||||
component: (resolve) => require(['@/views/system/dict/data'], resolve),
|
component: (resolve) => require(['@/views/system/dict/data'], resolve),
|
||||||
name: 'SystemDictData',
|
name: 'SystemDictData',
|
||||||
meta: { title: '字典数据', icon: '', activeMenu: '/system/dict' }
|
meta: { title: '字典数据', icon: '', activeMenu: '/system/dict' },
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/job',
|
path: '/job',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
children: [{
|
children: [
|
||||||
|
{
|
||||||
path: 'log',
|
path: 'log',
|
||||||
component: (resolve) => require(['@/views/infra/job/log'], resolve),
|
component: (resolve) => require(['@/views/infra/job/log'], resolve),
|
||||||
name: 'InfraJobLog',
|
name: 'InfraJobLog',
|
||||||
meta: { title: '调度日志', activeMenu: '/infra/job' }
|
meta: { title: '调度日志', activeMenu: '/infra/job' },
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
path: '/codegen',
|
path: '/codegen',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
children: [{
|
children: [
|
||||||
|
{
|
||||||
path: 'edit/:tableId(\\d+)',
|
path: 'edit/:tableId(\\d+)',
|
||||||
component: (resolve) => require(['@/views/infra/codegen/editTable'], resolve),
|
component: (resolve) =>
|
||||||
|
require(['@/views/infra/codegen/editTable'], resolve),
|
||||||
name: 'InfraCodegenEditTable',
|
name: 'InfraCodegenEditTable',
|
||||||
meta: { title: '修改生成配置', activeMenu: '/infra/codegen' }
|
meta: { title: '修改生成配置', activeMenu: '/infra/codegen' },
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/bpm',
|
path: '/bpm',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
redirect: 'noredirect',
|
redirect: 'noredirect',
|
||||||
children: [{
|
children: [
|
||||||
|
{
|
||||||
path: 'oa/leave/create',
|
path: 'oa/leave/create',
|
||||||
component: (resolve) => require(['@/views/bpm/oa/leave/create'], resolve),
|
component: (resolve) =>
|
||||||
|
require(['@/views/bpm/oa/leave/create'], resolve),
|
||||||
name: 'BpmOALeaveCreate',
|
name: 'BpmOALeaveCreate',
|
||||||
meta: { title: '发起 OA 请假', icon: 'form', activeMenu: '/bpm/oa/leave' }
|
meta: {
|
||||||
}, {
|
title: '发起 OA 请假',
|
||||||
|
icon: 'form',
|
||||||
|
activeMenu: '/bpm/oa/leave',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
path: 'oa/leave/detail',
|
path: 'oa/leave/detail',
|
||||||
component: (resolve) => require(['@/views/bpm/oa/leave/detail'], resolve),
|
component: (resolve) =>
|
||||||
|
require(['@/views/bpm/oa/leave/detail'], resolve),
|
||||||
name: 'BpmOALeaveDetail',
|
name: 'BpmOALeaveDetail',
|
||||||
meta: { title: '查看 OA 请假', icon: 'view', activeMenu: '/bpm/oa/leave' }
|
meta: {
|
||||||
}
|
title: '查看 OA 请假',
|
||||||
]
|
icon: 'view',
|
||||||
|
activeMenu: '/bpm/oa/leave',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/bpm',
|
path: '/bpm',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
children: [{
|
children: [
|
||||||
|
{
|
||||||
path: 'manager/form/edit',
|
path: 'manager/form/edit',
|
||||||
component: (resolve) => require(['@/views/bpm/form/formEditor'], resolve),
|
component: (resolve) =>
|
||||||
|
require(['@/views/bpm/form/formEditor'], resolve),
|
||||||
name: 'BpmFormEditor',
|
name: 'BpmFormEditor',
|
||||||
meta: { title: '流程表单-编辑', activeMenu: '/bpm/manager/form' }
|
meta: { title: '流程表单-编辑', activeMenu: '/bpm/manager/form' },
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
path: 'manager/definition',
|
path: 'manager/definition',
|
||||||
component: (resolve) => require(['@/views/bpm/definition/index'], resolve),
|
component: (resolve) =>
|
||||||
|
require(['@/views/bpm/definition/index'], resolve),
|
||||||
name: 'BpmProcessDefinition',
|
name: 'BpmProcessDefinition',
|
||||||
meta: { title: '流程定义', activeMenu: '/bpm/manager/model' }
|
meta: { title: '流程定义', activeMenu: '/bpm/manager/model' },
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
path: 'manager/model/design',
|
path: 'manager/model/design',
|
||||||
component: (resolve) => require(['@/views/bpm/model/modelEditor'], resolve),
|
component: (resolve) =>
|
||||||
|
require(['@/views/bpm/model/modelEditor'], resolve),
|
||||||
name: 'BpmModelEditor',
|
name: 'BpmModelEditor',
|
||||||
meta: { title: '设计流程', activeMenu: '/bpm/manager/model' }
|
meta: { title: '设计流程', activeMenu: '/bpm/manager/model' },
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
path: 'process-instance/create',
|
path: 'process-instance/create',
|
||||||
component: (resolve) => require(['@/views/bpm/processInstance/create'], resolve),
|
component: (resolve) =>
|
||||||
|
require(['@/views/bpm/processInstance/create'], resolve),
|
||||||
name: 'BpmProcessInstanceCreate',
|
name: 'BpmProcessInstanceCreate',
|
||||||
meta: { title: '发起流程', activeMenu: '/bpm/task/my' }
|
meta: { title: '发起流程', activeMenu: '/bpm/task/my' },
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
path: 'process-instance/detail',
|
path: 'process-instance/detail',
|
||||||
component: (resolve) => require(['@/views/bpm/processInstance/detail'], resolve),
|
component: (resolve) =>
|
||||||
|
require(['@/views/bpm/processInstance/detail'], resolve),
|
||||||
name: 'BpmProcessInstanceDetail',
|
name: 'BpmProcessInstanceDetail',
|
||||||
meta: { title: '流程详情', activeMenu: '/bpm/task/my' }
|
meta: { title: '流程详情', activeMenu: '/bpm/task/my' },
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/property',
|
path: '/property',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
children: [{
|
children: [
|
||||||
|
{
|
||||||
path: 'value/:propertyId(\\d+)',
|
path: 'value/:propertyId(\\d+)',
|
||||||
component: (resolve) => require(['@/views/mall/product/property/value'], resolve),
|
component: (resolve) =>
|
||||||
|
require(['@/views/mall/product/property/value'], resolve),
|
||||||
name: 'ProductPropertyValue',
|
name: 'ProductPropertyValue',
|
||||||
meta: { title: '商品属性值', icon: '', activeMenu: '/product/property' }
|
meta: {
|
||||||
}
|
title: '商品属性值',
|
||||||
]
|
icon: '',
|
||||||
|
activeMenu: '/product/property',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/spu',
|
path: '/spu',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
children: [{
|
children: [
|
||||||
|
{
|
||||||
path: 'edit/:spuId(\\d+)',
|
path: 'edit/:spuId(\\d+)',
|
||||||
component: (resolve) => require(['@/views/mall/product/spu/save'], resolve),
|
component: (resolve) =>
|
||||||
|
require(['@/views/mall/product/spu/save'], resolve),
|
||||||
name: 'ProductSpuUpdate',
|
name: 'ProductSpuUpdate',
|
||||||
meta: { title: '修改商品', activeMenu: '/product/spu' }
|
meta: { title: '修改商品', activeMenu: '/product/spu' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'add',
|
path: 'add',
|
||||||
component: (resolve) => require(['@/views/mall/product/spu/save'], resolve),
|
component: (resolve) =>
|
||||||
|
require(['@/views/mall/product/spu/save'], resolve),
|
||||||
name: 'ProductSpuCreate',
|
name: 'ProductSpuCreate',
|
||||||
meta: { title: '添加商品', activeMenu: '/product/spu' }
|
meta: { title: '添加商品', activeMenu: '/product/spu' },
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/trade/order',
|
path: '/trade/order',
|
||||||
@@ -225,26 +276,29 @@ export const constantRoutes = [
|
|||||||
name: 'TradeOrderDetail',
|
name: 'TradeOrderDetail',
|
||||||
hidden: true,
|
hidden: true,
|
||||||
meta: { title: '订单详情' },
|
meta: { title: '订单详情' },
|
||||||
component: (resolve) => require(['@/views/mall/trade/order/detail'], resolve)
|
component: (resolve) =>
|
||||||
}
|
require(['@/views/mall/trade/order/detail'], resolve),
|
||||||
]
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/pay',
|
path: '/pay',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
children: [{
|
children: [
|
||||||
|
{
|
||||||
path: 'order/submit',
|
path: 'order/submit',
|
||||||
name: 'PayOrderSubmit',
|
name: 'PayOrderSubmit',
|
||||||
hidden: true,
|
hidden: true,
|
||||||
meta: {
|
meta: {
|
||||||
title: '收银台',
|
title: '收银台',
|
||||||
noCache: true
|
noCache: true,
|
||||||
},
|
},
|
||||||
component: (resolve) => require(['@/views/pay/order/submit'], resolve)
|
component: (resolve) => require(['@/views/pay/order/submit'], resolve),
|
||||||
}]
|
},
|
||||||
}
|
],
|
||||||
]
|
},
|
||||||
|
];
|
||||||
|
|
||||||
// 防止连续点击多次路由报错
|
// 防止连续点击多次路由报错
|
||||||
let routerPush = Router.prototype.push;
|
let routerPush = Router.prototype.push;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import {constantRoutes} from '@/router'
|
import {constantRoutes} from '@/router'
|
||||||
import {getRouters} from '@/api/menu'
|
|
||||||
import Layout from '@/layout/index'
|
import Layout from '@/layout/index'
|
||||||
import ParentView from '@/components/ParentView';
|
import ParentView from '@/components/ParentView';
|
||||||
import {toCamelCase} from "@/utils";
|
import {toCamelCase} from "@/utils";
|
||||||
@@ -27,13 +26,17 @@ const permission = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
// 生成路由
|
/**
|
||||||
GenerateRoutes({commit}) {
|
* 生成路由
|
||||||
|
*
|
||||||
|
* @param commit commit 函数
|
||||||
|
* @param menus 路由参数
|
||||||
|
*/
|
||||||
|
GenerateRoutes({commit}, menus) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
// 向后端请求路由数据(菜单)
|
// 将 menus 菜单,转换为 route 路由数组
|
||||||
getRouters().then(res => {
|
const sdata = JSON.parse(JSON.stringify(menus)) // 【重要】用于菜单中的数据
|
||||||
const sdata = JSON.parse(JSON.stringify(res.data)) // 【重要】用于菜单中的数据
|
const rdata = JSON.parse(JSON.stringify(menus)) // 用于最后添加到 Router 中的数据
|
||||||
const rdata = JSON.parse(JSON.stringify(res.data)) // 用于最后添加到 Router 中的数据
|
|
||||||
const sidebarRoutes = filterAsyncRouter(sdata)
|
const sidebarRoutes = filterAsyncRouter(sdata)
|
||||||
const rewriteRoutes = filterAsyncRouter(rdata, false, true)
|
const rewriteRoutes = filterAsyncRouter(rdata, false, true)
|
||||||
rewriteRoutes.push({path: '*', redirect: '/404', hidden: true})
|
rewriteRoutes.push({path: '*', redirect: '/404', hidden: true})
|
||||||
@@ -43,7 +46,6 @@ const permission = {
|
|||||||
commit('SET_TOPBAR_ROUTES', sidebarRoutes)
|
commit('SET_TOPBAR_ROUTES', sidebarRoutes)
|
||||||
resolve(rewriteRoutes)
|
resolve(rewriteRoutes)
|
||||||
})
|
})
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { Message, MessageBox, Notification, Loading } from 'element-ui'
|
import {Message, MessageBox, Notification, Loading} from 'element-ui'
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { getAccessToken, getRefreshToken, getTenantId, setToken } from '@/utils/auth'
|
import {getAccessToken, getRefreshToken, getTenantId, setToken} from '@/utils/auth'
|
||||||
import errorCode from '@/utils/errorCode'
|
import errorCode from '@/utils/errorCode'
|
||||||
import { getPath, getTenantEnable } from "@/utils/ruoyi";
|
import {getPath, getTenantEnable} from "@/utils/ruoyi";
|
||||||
import { refreshToken } from "@/api/login";
|
import {refreshToken} from "@/api/login";
|
||||||
|
|
||||||
// 需要忽略的提示。忽略后,自动 Promise.reject('error')
|
// 需要忽略的提示。忽略后,自动 Promise.reject('error')
|
||||||
const ignoreMsgs = [
|
const ignoreMsgs = [
|
||||||
@@ -86,7 +86,7 @@ service.interceptors.request.use(config => {
|
|||||||
for (const propName of Object.keys(config.params)) {
|
for (const propName of Object.keys(config.params)) {
|
||||||
const value = config.params[propName];
|
const value = config.params[propName];
|
||||||
const part = encodeURIComponent(propName) + '='
|
const part = encodeURIComponent(propName) + '='
|
||||||
if (value !== null && typeof (value) !== "undefined") {
|
if (value !== null && typeof(value) !== "undefined") {
|
||||||
if (typeof value === 'object') {
|
if (typeof value === 'object') {
|
||||||
for (const key of Object.keys(value)) {
|
for (const key of Object.keys(value)) {
|
||||||
let params = propName + '[' + key + ']';
|
let params = propName + '[' + key + ']';
|
||||||
@@ -176,15 +176,13 @@ service.interceptors.response.use(async res => {
|
|||||||
+ '<div>5 分钟搭建本地环境</div>',
|
+ '<div>5 分钟搭建本地环境</div>',
|
||||||
})
|
})
|
||||||
return Promise.reject(new Error(msg))
|
return Promise.reject(new Error(msg))
|
||||||
} else if (code === 400) {
|
|
||||||
//【班组管理】【排班计划】提交的校验按照原型图补充完整,排班计划是否重叠code400 有两个不同的返回信息
|
|
||||||
return res.data
|
|
||||||
} else if (code !== 200) {
|
} else if (code !== 200) {
|
||||||
if (msg === '无效的刷新令牌') { // hard coding:忽略这个提示,直接登出
|
if (msg === '无效的刷新令牌') { // hard coding:忽略这个提示,直接登出
|
||||||
console.log(msg)
|
console.log(msg)
|
||||||
} else {
|
} else {
|
||||||
//【班组管理】【排班计划】提交的校验按照原型图补充完整,排班计划是否重叠code400 有两个不同的返回信息
|
Notification.error({
|
||||||
return res.data
|
title: msg
|
||||||
|
})
|
||||||
}
|
}
|
||||||
return Promise.reject('error')
|
return Promise.reject('error')
|
||||||
} else {
|
} else {
|
||||||
@@ -193,7 +191,7 @@ service.interceptors.response.use(async res => {
|
|||||||
}, error => {
|
}, error => {
|
||||||
tryHideFullScreenLoading()
|
tryHideFullScreenLoading()
|
||||||
console.log('err' + error)
|
console.log('err' + error)
|
||||||
let { message } = error;
|
let {message} = error;
|
||||||
if (message === "Network Error") {
|
if (message === "Network Error") {
|
||||||
message = "后端接口连接异常";
|
message = "后端接口连接异常";
|
||||||
} else if (message.includes("timeout")) {
|
} else if (message.includes("timeout")) {
|
||||||
@@ -207,7 +205,7 @@ service.interceptors.response.use(async res => {
|
|||||||
duration: 5 * 1000
|
duration: 5 * 1000
|
||||||
})
|
})
|
||||||
return Promise.reject(error)
|
return Promise.reject(error)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
export function getBaseHeader() {
|
export function getBaseHeader() {
|
||||||
|
|||||||
125
src/views/areavisual/overview/components/ringChart.vue
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
<template>
|
||||||
|
<div
|
||||||
|
:class="className"
|
||||||
|
:style="{ height: height, width: width, marginLeft: '10px' }" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import * as echarts from 'echarts';
|
||||||
|
require('echarts/theme/macarons'); // echarts theme
|
||||||
|
import resize from '@/utils/chartMixins/resize';
|
||||||
|
|
||||||
|
const animationDuration = 1000;
|
||||||
|
export default {
|
||||||
|
mixins: [resize],
|
||||||
|
props: {
|
||||||
|
className: {
|
||||||
|
type: String,
|
||||||
|
default: 'chart',
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
width: {
|
||||||
|
type: String,
|
||||||
|
default: '100%',
|
||||||
|
},
|
||||||
|
height: {
|
||||||
|
type: String,
|
||||||
|
default: '300px',
|
||||||
|
},
|
||||||
|
ringData: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
chart: null,
|
||||||
|
targetId: '',
|
||||||
|
};
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
if (!this.chart) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.chart.dispose();
|
||||||
|
this.chart = null;
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
initChart() {
|
||||||
|
this.chart = echarts.init(this.$el, 'macarons');
|
||||||
|
const _this = this;
|
||||||
|
this.chart.setOption({
|
||||||
|
title: {
|
||||||
|
text: this.title
|
||||||
|
? '{space|}{tip|}{space|}{value|' + this.title + '}'
|
||||||
|
: '',
|
||||||
|
textStyle: {
|
||||||
|
rich: {
|
||||||
|
tip: {
|
||||||
|
width: 6,
|
||||||
|
height: 6,
|
||||||
|
borderRadius: 50,
|
||||||
|
backgroundColor: '#288AFF',
|
||||||
|
},
|
||||||
|
space: {
|
||||||
|
width: 8,
|
||||||
|
},
|
||||||
|
value: {
|
||||||
|
fontSize: 14,
|
||||||
|
color: 'black',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
color: ['#33B36B', '#3A8DFF', '#F59A23'],
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'axis',
|
||||||
|
axisPointer: {
|
||||||
|
type: 'cross',
|
||||||
|
crossStyle: {
|
||||||
|
color: '#999',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
data: ['当前满位', '当前空位', '在途'],
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
containLabel: true,
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
// name: '投入',
|
||||||
|
type: 'pie',
|
||||||
|
radius: '50%',
|
||||||
|
data: [
|
||||||
|
{
|
||||||
|
name: '当前满位',
|
||||||
|
value: this.ringData.occupiedQuantity
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '当前空位',
|
||||||
|
value: this.ringData.idleQuantity
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '在途',
|
||||||
|
value: this.ringData.transitQuantity
|
||||||
|
},
|
||||||
|
],
|
||||||
|
emphasis: {
|
||||||
|
itemStyle: {
|
||||||
|
shadowBlur: 10,
|
||||||
|
shadowOffsetX: 0,
|
||||||
|
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
262
src/views/areavisual/overview/index.vue
Normal file
@@ -0,0 +1,262 @@
|
|||||||
|
<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"></el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// import basicPage from '@/mixins/basic-page';
|
||||||
|
import ringChart from './components/ringChart.vue';
|
||||||
|
import { getAreaList, postAllAreaInfo, postAllAreaOverview, postAreaInfo } from '@/api/areavisual/overview';
|
||||||
|
|
||||||
|
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'
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
ringChart
|
||||||
|
},
|
||||||
|
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.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})
|
||||||
|
console.log(res)
|
||||||
|
if (res.code === 0 && res.data) {
|
||||||
|
this.areaInfo = res.data
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 全部库区右侧分页点击
|
||||||
|
handleClickRight (tab, event) {
|
||||||
|
console.log(tab, event)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</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>
|
||||||
519
src/views/areavisual/record/components/RecordDrawer.vue
Normal file
@@ -0,0 +1,519 @@
|
|||||||
|
<!--
|
||||||
|
filename: EquipmentDrawer.vue
|
||||||
|
author: liubin
|
||||||
|
date: 2023-08-22 14:38:56
|
||||||
|
description:
|
||||||
|
-->
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<el-drawer
|
||||||
|
:visible="visible"
|
||||||
|
:show-close="false"
|
||||||
|
:wrapper-closable="false"
|
||||||
|
class="drawer"
|
||||||
|
custom-class="mes-drawer"
|
||||||
|
size="60%"
|
||||||
|
@closed="$emit('destroy')">
|
||||||
|
<SmallTitle slot="title">
|
||||||
|
{{
|
||||||
|
mode.includes('detail')
|
||||||
|
? '详情'
|
||||||
|
: mode.includes('edit')
|
||||||
|
? '编辑'
|
||||||
|
: '新增'
|
||||||
|
}}
|
||||||
|
</SmallTitle>
|
||||||
|
|
||||||
|
<div class="drawer-body flex">
|
||||||
|
<div class="drawer-body__content">
|
||||||
|
<section v-for="(section, index) in sections" :key="section.key">
|
||||||
|
<SmallTitle v-if="index != 0">{{ section.name }}</SmallTitle>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="form-part"
|
||||||
|
v-if="section.key == 'base'"
|
||||||
|
style="margin-bottom: 32px">
|
||||||
|
<el-skeleton v-if="!showForm" animated />
|
||||||
|
<!-- <EquipmentInfoForm
|
||||||
|
key="drawer-dialog-form"
|
||||||
|
v-if="showForm"
|
||||||
|
:disabled="mode.includes('detail')"
|
||||||
|
:sync-filelist="syncFileListFlag"
|
||||||
|
v-model="form" /> -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="section.key == 'attrs'" style="margin-top: 12px">
|
||||||
|
<base-table
|
||||||
|
v-loading="attrListLoading"
|
||||||
|
:table-props="section.props"
|
||||||
|
:page="attrQuery?.params.pageNo || 1"
|
||||||
|
:limit="attrQuery?.params.pageSize || 10"
|
||||||
|
:table-data="list"
|
||||||
|
:add-button-show="mode.includes('detail') ? null : '添加属性'"
|
||||||
|
@emitButtonClick="handleAddAttr"
|
||||||
|
@emitFun="handleEmitFun">
|
||||||
|
<method-btn
|
||||||
|
v-if="section.tableBtn"
|
||||||
|
slot="handleBtn"
|
||||||
|
label="操作"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleTableBtnClick" />
|
||||||
|
</base-table>
|
||||||
|
|
||||||
|
<!-- 分页组件 -->
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="attrQuery.params.pageNo"
|
||||||
|
:limit.sync="attrQuery.params.pageSize"
|
||||||
|
@pagination="getAttrList" />
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="drawer-body__footer">
|
||||||
|
<el-button style="" @click="handleCancel">取消</el-button>
|
||||||
|
<el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button v-else type="primary" @click="handleConfirm">确定</el-button>
|
||||||
|
<!-- sections的第二项必须是 属性列表 -->
|
||||||
|
<!-- <el-button
|
||||||
|
v-if="sections[1].allowAdd"
|
||||||
|
type="primary"
|
||||||
|
@click="handleAddAttr">
|
||||||
|
添加属性
|
||||||
|
</el-button> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-drawer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
const SmallTitle = {
|
||||||
|
name: 'SmallTitle',
|
||||||
|
props: ['size'],
|
||||||
|
components: {},
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
methods: {},
|
||||||
|
render: function (h) {
|
||||||
|
return h(
|
||||||
|
'span',
|
||||||
|
{
|
||||||
|
class: 'small-title',
|
||||||
|
style: {
|
||||||
|
fontSize: '18px',
|
||||||
|
lineHeight:
|
||||||
|
this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
|
||||||
|
fontWeight: 500,
|
||||||
|
fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
this.$slots.default
|
||||||
|
);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { SmallTitle },
|
||||||
|
props: ['sections', 'mode', 'dataId'], // dataId 作为一个通用的存放id的字段
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
visible: false,
|
||||||
|
showForm: false,
|
||||||
|
btnLoading: false,
|
||||||
|
total: 0,
|
||||||
|
form: {},
|
||||||
|
list: [],
|
||||||
|
attrTitle: '',
|
||||||
|
attrForm: {
|
||||||
|
id: null,
|
||||||
|
equipmentId: null,
|
||||||
|
name: '',
|
||||||
|
value: '',
|
||||||
|
},
|
||||||
|
attrFormVisible: false,
|
||||||
|
attrRows: [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '属性名称',
|
||||||
|
prop: 'name',
|
||||||
|
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '属性值',
|
||||||
|
prop: 'value',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
|
attrQuery: {
|
||||||
|
params: {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
},
|
||||||
|
}, // 属性列表的请求
|
||||||
|
infoQuery: null, // 基本信息的请求
|
||||||
|
attrFormSubmitting: false,
|
||||||
|
attrListLoading: false,
|
||||||
|
syncFileListFlag: null,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
formRows() {
|
||||||
|
return this.sections[0].rows.map((row) => {
|
||||||
|
return row.map((col) => {
|
||||||
|
if (col.key == 'eq-pics') {
|
||||||
|
// 重置图片的位置
|
||||||
|
return {
|
||||||
|
...col,
|
||||||
|
bind: {
|
||||||
|
...col.bind,
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
left: 0,
|
||||||
|
right: 'unset',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
...col,
|
||||||
|
bind: {
|
||||||
|
...col.bind,
|
||||||
|
// 详情 模式下,禁用各种输入
|
||||||
|
disabled: this.mode == 'detail',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
tableBtn() {
|
||||||
|
return this.mode == 'detail' ? [] : this.sections[1].tableBtn;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
for (const section of this.sections) {
|
||||||
|
// 请求具体信息
|
||||||
|
if ('url' in section) {
|
||||||
|
const query = {
|
||||||
|
url: section.url,
|
||||||
|
method: section.method || 'get',
|
||||||
|
params: section.queryParams || null,
|
||||||
|
data: section.data || null,
|
||||||
|
};
|
||||||
|
this.$axios(query).then(({ data }) => {
|
||||||
|
if (section.key == 'base') {
|
||||||
|
this.form = data;
|
||||||
|
// this.form = {
|
||||||
|
// code: 'gj',
|
||||||
|
// name: '下片机',
|
||||||
|
// enName: 'unload',
|
||||||
|
// abbr: '',
|
||||||
|
// equipmentTypeId: 21084,
|
||||||
|
// remark: '备注',
|
||||||
|
// id: '1712367395052384257',
|
||||||
|
// createTime: 1697095176000,
|
||||||
|
// enterTime: 0,
|
||||||
|
// productionTime: 0,
|
||||||
|
// files: [
|
||||||
|
// {
|
||||||
|
// fileName: '测试.xlsx',
|
||||||
|
// fileUrl: 'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2022%2F0108%2F0f0c6f30j00r5cle9000sc000hs00gtc.jpg&thumbnail=660x2147483647&quality=80&type=jpg',
|
||||||
|
// fileType: 1
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// fileName: '测试2.xlsx',
|
||||||
|
// fileUrl: 'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2022%2F0415%2F2cd23619j00racb96000kc000hs00hsc.jpg&thumbnail=660x2147483647&quality=80&type=jpg',
|
||||||
|
// fileType: 1
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// fileName: '测试3.xlsx',
|
||||||
|
// fileUrl: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2F1fea91a0-d088-409e-b145-e0e61254b28b%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1700031689&t=2e0fe7d1de7f54adff3007efe133d67c',
|
||||||
|
// fileType: 1
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// fileName: '测试4.xlsx',
|
||||||
|
// fileUrl: 'https://pics5.baidu.com/feed/b7003af33a87e950cdfb4b4546eed044faf2b40d.jpeg?token=1d7484cfe4b014dd201f8c8725cab945',
|
||||||
|
// fileType: 2
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// fileName: '测试5.xlsx',
|
||||||
|
// fileUrl: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2Fe3500876-9c46-4b70-8d37-4799520cdd13%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1700031689&t=4abc1df930e62730e5361a7d3765e0f2',
|
||||||
|
// fileType: 2
|
||||||
|
// },
|
||||||
|
// ],
|
||||||
|
// tvalue: 0,
|
||||||
|
// processingTime: 0,
|
||||||
|
// manufacturer: '',
|
||||||
|
// spec: '',
|
||||||
|
// description: '描述',
|
||||||
|
// };
|
||||||
|
this.showForm = true;
|
||||||
|
this.infoQuery = query;
|
||||||
|
} else if (section.key == 'attrs') {
|
||||||
|
this.attrQuery = query;
|
||||||
|
this.list = data.list;
|
||||||
|
this.total = data.total;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleTableBtnClick({ type, data }) {
|
||||||
|
switch (type) {
|
||||||
|
case 'edit':
|
||||||
|
this.handleEditAttr(data.id);
|
||||||
|
break;
|
||||||
|
case 'delete':
|
||||||
|
this.handleDeleteAttr(data.id);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async handleConfirm() {
|
||||||
|
this.btnLoading = true;
|
||||||
|
this.syncFileListFlag = Math.random();
|
||||||
|
|
||||||
|
this.$nextTick(async () => {
|
||||||
|
const { code, data } = await this.$axios({
|
||||||
|
url: this.sections[0].urlUpdate,
|
||||||
|
method: 'put',
|
||||||
|
data: this.form,
|
||||||
|
});
|
||||||
|
if (code == 0) {
|
||||||
|
this.$modal.msgSuccess('更新成功');
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
}
|
||||||
|
|
||||||
|
this.btnLoading = false;
|
||||||
|
this.handleCancel();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
handleEmitFun(val) {
|
||||||
|
console.log('handleEmitFun', val);
|
||||||
|
},
|
||||||
|
|
||||||
|
init() {
|
||||||
|
this.visible = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
async getAttrList() {
|
||||||
|
this.attrListLoading = true;
|
||||||
|
const res = await this.$axios(this.attrQuery);
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.list = res.data.list;
|
||||||
|
this.total = res.data.total;
|
||||||
|
}
|
||||||
|
this.attrListLoading = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
// 保存表单
|
||||||
|
handleSave() {
|
||||||
|
this.$refs['form'][0].validate(async (valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const isEdit = this.mode == 'edit';
|
||||||
|
await this.$axios({
|
||||||
|
url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
|
||||||
|
method: isEdit ? 'put' : 'post',
|
||||||
|
data: this.form,
|
||||||
|
});
|
||||||
|
this.$modal.msgSuccess(`${isEdit ? '更新' : '创建'}成功`);
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
handleCancel() {
|
||||||
|
this.visible = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
// 开启编辑
|
||||||
|
toggleEdit() {
|
||||||
|
this.$emit('update-mode', 'edit');
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增属性
|
||||||
|
handleAddAttr() {
|
||||||
|
if (!this.dataId) return this.$message.warning('请先创建设备信息');
|
||||||
|
this.attrForm = {
|
||||||
|
id: null,
|
||||||
|
equipmentId: this.dataId,
|
||||||
|
name: '',
|
||||||
|
value: '',
|
||||||
|
};
|
||||||
|
this.attrTitle = '添加设备属性';
|
||||||
|
this.attrFormVisible = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
// 编辑属性
|
||||||
|
async handleEditAttr(attrId) {
|
||||||
|
const res = await this.$axios({
|
||||||
|
url: this.sections[1].urlDetail,
|
||||||
|
method: 'get',
|
||||||
|
params: { id: attrId },
|
||||||
|
});
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.attrForm = res.data;
|
||||||
|
this.attrTitle = '编辑设备属性';
|
||||||
|
this.attrFormVisible = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除属性
|
||||||
|
handleDeleteAttr(attrId) {
|
||||||
|
this.$confirm('确定删除该属性?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
const res = await this.$axios({
|
||||||
|
url: this.sections[1].urlDelete,
|
||||||
|
method: 'delete',
|
||||||
|
params: { id: attrId },
|
||||||
|
});
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.$message({
|
||||||
|
message: '删除成功',
|
||||||
|
type: 'success',
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getAttrList();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 提交属性表
|
||||||
|
submitAttrForm() {
|
||||||
|
this.$refs['attrForm'].validate(async (valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const isEdit = this.attrForm.id != null;
|
||||||
|
this.attrFormSubmitting = true;
|
||||||
|
const res = await this.$axios({
|
||||||
|
url: isEdit
|
||||||
|
? this.sections[1].urlUpdate
|
||||||
|
: this.sections[1].urlCreate,
|
||||||
|
method: isEdit ? 'put' : 'post',
|
||||||
|
data: this.attrForm,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.closeAttrForm();
|
||||||
|
this.$message({
|
||||||
|
message: `${isEdit ? '更新' : '创建'}成功`,
|
||||||
|
type: 'success',
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getAttrList();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.attrFormSubmitting = false;
|
||||||
|
} catch (err) {
|
||||||
|
this.$message({
|
||||||
|
message: err,
|
||||||
|
type: 'error',
|
||||||
|
duration: 1500,
|
||||||
|
});
|
||||||
|
this.attrFormSubmitting = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
closeAttrForm() {
|
||||||
|
this.attrFormVisible = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
handleClick(raw) {
|
||||||
|
if (raw.type === 'delete') {
|
||||||
|
this.$confirm(
|
||||||
|
`确定对${
|
||||||
|
raw.data.name
|
||||||
|
? '[名称=' + raw.data.name + ']'
|
||||||
|
: '[序号=' + raw.data._pageIndex + ']'
|
||||||
|
}进行删除操作?`,
|
||||||
|
'提示',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
deleteProductAttr(raw.data.id).then(({ data }) => {
|
||||||
|
this.$message({
|
||||||
|
message: '操作成功',
|
||||||
|
type: 'success',
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
} else {
|
||||||
|
this.addNew(raw.data.id);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.drawer >>> .el-drawer {
|
||||||
|
border-radius: 8px 0 0 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawer >>> .el-drawer__header {
|
||||||
|
margin: 0;
|
||||||
|
padding: 32px 32px 24px;
|
||||||
|
border-bottom: 1px solid #dcdfe6;
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.small-title::before {
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: top;
|
||||||
|
width: 4px;
|
||||||
|
height: 22px;
|
||||||
|
border-radius: 1px;
|
||||||
|
margin-right: 8px;
|
||||||
|
background-color: #0b58ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawer-body {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawer-body__content {
|
||||||
|
flex: 1;
|
||||||
|
/* background: #eee; */
|
||||||
|
padding: 20px 30px;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawer-body__footer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
padding: 18px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
277
src/views/areavisual/record/index.vue
Normal file
@@ -0,0 +1,277 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<SearchBar
|
||||||
|
:formConfigs="searchBarFormConfig"
|
||||||
|
ref="search-bar"
|
||||||
|
isFold
|
||||||
|
@headBtnClick="handleSearchBarBtnClick" />
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<base-table
|
||||||
|
:table-props="tableProps"
|
||||||
|
:page="queryParams.pageNo"
|
||||||
|
:limit="queryParams.pageSize"
|
||||||
|
:table-data="list"
|
||||||
|
@emitFun="handleEmitFun">
|
||||||
|
<method-btn
|
||||||
|
v-if="tableBtn.length"
|
||||||
|
slot="handleBtn"
|
||||||
|
:width="120"
|
||||||
|
label="操作"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleTableBtnClick" />
|
||||||
|
</base-table>
|
||||||
|
|
||||||
|
<!-- 分页组件 -->
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNo"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList" />
|
||||||
|
|
||||||
|
<!-- 设备 详情 - 编辑 -->
|
||||||
|
<RecordDrawer
|
||||||
|
v-if="open"
|
||||||
|
ref="drawer"
|
||||||
|
:mode="editMode"
|
||||||
|
@update-mode="editMode = $event"
|
||||||
|
:data-id="form.id"
|
||||||
|
@refreshDataList="getList"
|
||||||
|
@cancel="cancelEdit"
|
||||||
|
@destroy="cancelEdit" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import moment from 'moment';
|
||||||
|
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||||
|
import RecordDrawer from './components/RecordDrawer';
|
||||||
|
import { getRecordPage, getLaneList } from '@/api/areavisual/record';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'Equipment',
|
||||||
|
components: {
|
||||||
|
RecordDrawer,
|
||||||
|
},
|
||||||
|
mixins: [basicPageMixin],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
searchBarKeys: ['name', 'code'],
|
||||||
|
// this.$auth.hasPermi(`base:equipment:update`)
|
||||||
|
tableBtn: [
|
||||||
|
{
|
||||||
|
type: 'detail',
|
||||||
|
btnName: '详情'
|
||||||
|
}
|
||||||
|
].filter((v) => v),
|
||||||
|
tableProps: [
|
||||||
|
{
|
||||||
|
prop: 'recordCode',
|
||||||
|
label: '出/入库单编号',
|
||||||
|
fixed: true,
|
||||||
|
width: 180,
|
||||||
|
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||||
|
// showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'type',
|
||||||
|
label: '业务类型',
|
||||||
|
filter: (val) => val === 1 ? '出库' : '入库',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
width: 180,
|
||||||
|
prop: 'recordTime',
|
||||||
|
label: '出/入库时间',
|
||||||
|
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss')
|
||||||
|
},
|
||||||
|
{ prop: 'recordArea', label: '出/入库库区' },
|
||||||
|
{ prop: 'recordLane', label: '出/入库巷道' },
|
||||||
|
{ prop: 'recordRegion', label: '出/入库库位号' },
|
||||||
|
{ prop: 'target', label: '搬运对象' },
|
||||||
|
{ prop: 'productName', label: '产品名称' },
|
||||||
|
{ prop: 'specification', label: '型号规格' },
|
||||||
|
{ prop: 'recordMan', label: '出/入库人' },
|
||||||
|
{ prop: 'remark', label: '备注' }
|
||||||
|
],
|
||||||
|
searchBarFormConfig: [
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: '关键字',
|
||||||
|
placeholder: '请输入出/入库编码、产品名称、规格型号、库位号',
|
||||||
|
param: 'query',
|
||||||
|
width: 350
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '业务类型',
|
||||||
|
selectOptions: [
|
||||||
|
{
|
||||||
|
id: '1',
|
||||||
|
name:'出库'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '2',
|
||||||
|
name:'入库'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
placeholder: '请选择业务类型',
|
||||||
|
param: 'type',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '出/入库巷道',
|
||||||
|
selectOptions: [],
|
||||||
|
placeholder: '请选择出/入库巷道',
|
||||||
|
param: 'recordLane',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '来源',
|
||||||
|
selectOptions: [
|
||||||
|
{
|
||||||
|
id: '1',
|
||||||
|
name:'WMS'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '2',
|
||||||
|
name:'MES'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
placeholder: '请选择来源',
|
||||||
|
param: 'source',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '出/入库人',
|
||||||
|
selectOptions: [],
|
||||||
|
placeholder: '请选择出/入库人',
|
||||||
|
param: 'recordMan',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'datePicker',
|
||||||
|
label: '出/入库时间',
|
||||||
|
placeholder: '请选择出/入库时间',
|
||||||
|
param: 'recordTime',
|
||||||
|
dateType: 'datetimerange',
|
||||||
|
rangeSeparator: '至'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '载具类型',
|
||||||
|
selectOptions: [
|
||||||
|
{
|
||||||
|
id: '1',
|
||||||
|
name:'AGV'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '2',
|
||||||
|
name:'人工叉车'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
placeholder: '请选择载具类型',
|
||||||
|
param: 'vehicleType',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '查询',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '重置',
|
||||||
|
name: 'reset',
|
||||||
|
color: 'info',
|
||||||
|
}
|
||||||
|
],
|
||||||
|
editVisible: false,
|
||||||
|
editMode: 'detail', // 'edit', 'detail'
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
query: '',
|
||||||
|
type: '',
|
||||||
|
source: '',
|
||||||
|
recordLane: '',
|
||||||
|
recordMan: '',
|
||||||
|
recordTime: '',
|
||||||
|
vehicleType: ''
|
||||||
|
},
|
||||||
|
form: {}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getLane()
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
methods: {
|
||||||
|
/** 查询列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
// 执行查询
|
||||||
|
getRecordPage(this.queryParams).then((response) => {
|
||||||
|
console.log(response)
|
||||||
|
this.list = response.data.list;
|
||||||
|
this.total = response.data.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async getLane() {
|
||||||
|
const res = await getLaneList({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 100
|
||||||
|
})
|
||||||
|
if (res.code === 0 && res.data) {
|
||||||
|
console.log(res.data)
|
||||||
|
this.searchBarFormConfig[2].selectOptions = res.data.list.map(item => {
|
||||||
|
return { id: item.id, name: item.lane }
|
||||||
|
})
|
||||||
|
console.log(this.searchBarFormConfig)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 取消按钮 */
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
},
|
||||||
|
// /** 导出按钮操作 */
|
||||||
|
// handleExport() {
|
||||||
|
// // 处理查询参数
|
||||||
|
// let params = { ...this.queryParams };
|
||||||
|
// params.pageNo = undefined;
|
||||||
|
// params.pageSize = undefined;
|
||||||
|
// this.$modal
|
||||||
|
// .confirm('是否确认导出所有设备数据项?')
|
||||||
|
// .then(() => {
|
||||||
|
// this.exportLoading = true;
|
||||||
|
// return exportEquipmentExcel(params);
|
||||||
|
// })
|
||||||
|
// .then((response) => {
|
||||||
|
// this.$download.excel(response, '设备.xls');
|
||||||
|
// this.exportLoading = false;
|
||||||
|
// })
|
||||||
|
// .catch(() => {});
|
||||||
|
// },
|
||||||
|
handleTableBtnClick ({data, type}) {
|
||||||
|
switch (type) {
|
||||||
|
case 'detail':
|
||||||
|
this.viewDetail(data.id)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 查看详情
|
||||||
|
viewDetail(id) {
|
||||||
|
this.editMode = 'detail';
|
||||||
|
this.open = true;
|
||||||
|
this.form.id = id;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['drawer'].init();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -6,8 +6,14 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-drawer :visible="visible" :show-close="false" :wrapper-closable="false" class="drawer" custom-class="mes-drawer"
|
<el-drawer
|
||||||
:size="size || '50%'" @closed="$emit('destroy')">
|
:visible="visible"
|
||||||
|
:show-close="false"
|
||||||
|
:wrapper-closable="false"
|
||||||
|
class="drawer"
|
||||||
|
custom-class="mes-drawer"
|
||||||
|
:size="size || '50%'"
|
||||||
|
@closed="$emit('destroy')">
|
||||||
<SmallTitle slot="title">
|
<SmallTitle slot="title">
|
||||||
{{
|
{{
|
||||||
mode.includes('detail')
|
mode.includes('detail')
|
||||||
@@ -23,7 +29,9 @@
|
|||||||
<section v-for="(section, index) in sections" :key="section.key">
|
<section v-for="(section, index) in sections" :key="section.key">
|
||||||
<SmallTitle v-if="index != 0">{{ section.name }}</SmallTitle>
|
<SmallTitle v-if="index != 0">{{ section.name }}</SmallTitle>
|
||||||
|
|
||||||
<div class="form-part" v-if="section.key == 'base'"
|
<div
|
||||||
|
class="form-part"
|
||||||
|
v-if="section.key == 'base'"
|
||||||
style="border-bottom: 1px solid #dfdfdf; margin-bottom: 24px">
|
style="border-bottom: 1px solid #dfdfdf; margin-bottom: 24px">
|
||||||
<el-skeleton v-if="!showForm" animated />
|
<el-skeleton v-if="!showForm" animated />
|
||||||
<!-- <BaseInfoForm
|
<!-- <BaseInfoForm
|
||||||
@@ -37,7 +45,9 @@
|
|||||||
<!-- if -->
|
<!-- if -->
|
||||||
<el-row v-if="mode.includes('detail')" style="margin-bottom: 24px">
|
<el-row v-if="mode.includes('detail')" style="margin-bottom: 24px">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<div class="title" style="font-weight: 700; font-size: 16px; margin: 8px 0">
|
<div
|
||||||
|
class="title"
|
||||||
|
style="font-weight: 700; font-size: 16px; margin: 8px 0">
|
||||||
设备名
|
设备名
|
||||||
</div>
|
</div>
|
||||||
<div class="value" style="font-size: 14px">
|
<div class="value" style="font-size: 14px">
|
||||||
@@ -45,7 +55,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<div class="title" style="font-weight: 700; font-size: 16px; margin: 8px 0">
|
<div
|
||||||
|
class="title"
|
||||||
|
style="font-weight: 700; font-size: 16px; margin: 8px 0">
|
||||||
关联表名
|
关联表名
|
||||||
</div>
|
</div>
|
||||||
<div class="value" style="font-size: 14px">
|
<div class="value" style="font-size: 14px">
|
||||||
@@ -57,16 +69,37 @@
|
|||||||
<el-row v-else style="margin-bottom: 24px" :gutter="20">
|
<el-row v-else style="margin-bottom: 24px" :gutter="20">
|
||||||
<el-form ref="form" :model="form">
|
<el-form ref="form" :model="form">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item class="title" label="设备名" style="font-size: 16px; margin: 8px 0">
|
<el-form-item
|
||||||
<el-select v-model="form.equipmentId" filterable clearable placeholder="请选择设备">
|
class="title"
|
||||||
<el-option v-for="eq in eqList" :key="eq.id" :label="eq.name" :value="eq.id"></el-option>
|
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-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item class="title" label="设备关联表名" style="font-size: 16px; margin: 8px 0">
|
<el-form-item
|
||||||
<el-select v-model="form.plcId" filterable clearable placeholder="请选择关联表">
|
class="title"
|
||||||
<el-option v-for="plc in plcList" :key="plc.id" :label="plc.plcTableName"
|
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>
|
:value="plc.id"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -75,44 +108,73 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="section.key == 'attrs'" style="position: relative; margin-top: 12px">
|
<div
|
||||||
<div v-if="!mode.includes('detail')" style="position: absolute; top: -40px; right: 0">
|
v-if="section.key == 'attrs'"
|
||||||
|
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">
|
<el-button @click="handleAddAttr" type="text">
|
||||||
<i class="el-icon-plus"></i>
|
<i class="el-icon-plus"></i>
|
||||||
添加参数
|
添加参数
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<base-table v-loading="attrListLoading" :table-props="section.props" :page="attrQuery?.params.pageNo || 1"
|
<base-table
|
||||||
:limit="attrQuery?.params.pageSize || 10" :table-data="list" @emitFun="handleEmitFun">
|
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 : '添加属性'"
|
<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'"
|
||||||
@emitButtonClick="handleAddAttr" -->
|
@emitButtonClick="handleAddAttr" -->
|
||||||
<method-btn v-if="section.tableBtn && !mode.includes('detail')" slot="handleBtn" label="操作"
|
<method-btn
|
||||||
:method-list="tableBtn" @clickBtn="handleTableBtnClick" />
|
v-if="section.tableBtn && !mode.includes('detail')"
|
||||||
|
slot="handleBtn"
|
||||||
|
label="操作"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleTableBtnClick" />
|
||||||
</base-table>
|
</base-table>
|
||||||
|
|
||||||
<!-- 分页组件 -->
|
<!-- 分页组件 -->
|
||||||
<pagination v-show="total > 0" :total="total" :page.sync="attrQuery.params.pageNo"
|
<pagination
|
||||||
:limit.sync="attrQuery.params.pageSize" @pagination="getAttrList" />
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="attrQuery.params.pageNo"
|
||||||
|
:limit.sync="attrQuery.params.pageSize"
|
||||||
|
@pagination="getAttrList" />
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="drawer-body__footer">
|
<div class="drawer-body__footer">
|
||||||
<el-button style="" @click="handleCancel">取消</el-button>
|
<el-button style="" @click="handleCancel">取消</el-button>
|
||||||
<el-button type="primary" v-if="!mode.includes('detail')" @click="handleSave">
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
v-if="!mode.includes('detail')"
|
||||||
|
@click="handleSave">
|
||||||
保存
|
保存
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 属性对话框 -->
|
<!-- 属性对话框 -->
|
||||||
<base-dialog v-if="sections[1].allowAdd" :dialogTitle="attrTitle" :dialogVisible="attrFormVisible" width="45%"
|
<base-dialog
|
||||||
:append-to-body="true" custom-class="baseDialog" @close="closeAttrForm" @cancel="closeAttrForm"
|
v-if="sections[1].allowAdd"
|
||||||
|
:dialogTitle="attrTitle"
|
||||||
|
:dialogVisible="attrFormVisible"
|
||||||
|
width="45%"
|
||||||
|
:append-to-body="true"
|
||||||
|
custom-class="baseDialog"
|
||||||
|
@close="closeAttrForm"
|
||||||
|
@cancel="closeAttrForm"
|
||||||
@confirm="submitAttrForm">
|
@confirm="submitAttrForm">
|
||||||
<!-- :disabled="mode.includes('detail')" -->
|
<!-- :disabled="mode.includes('detail')" -->
|
||||||
<DialogForm v-if="attrFormVisible" ref="attrForm" v-model="attrForm" :data-form="attrForm"
|
<DialogForm
|
||||||
:rows="attrRows"
|
v-if="attrFormVisible"
|
||||||
@update="handleAttrFormUpdate"/>
|
ref="attrForm"
|
||||||
|
v-model="attrForm"
|
||||||
|
:rows="attrRows" />
|
||||||
</base-dialog>
|
</base-dialog>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
</template>
|
</template>
|
||||||
@@ -171,8 +233,6 @@ export default {
|
|||||||
description: '',
|
description: '',
|
||||||
remark: '',
|
remark: '',
|
||||||
alarmContent: '',
|
alarmContent: '',
|
||||||
displayTip: false,
|
|
||||||
alarmTip: false,
|
|
||||||
},
|
},
|
||||||
attrFormVisible: false,
|
attrFormVisible: false,
|
||||||
attrRows: [
|
attrRows: [
|
||||||
@@ -282,26 +342,6 @@ 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,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -397,23 +437,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleAttrFormUpdate(updatedForm) {
|
|
||||||
console.log('updatedForm', updatedForm);
|
|
||||||
|
|
||||||
// 只同步需要的字段,避免覆盖其他数据
|
|
||||||
this.attrForm = {
|
|
||||||
...this.attrForm,
|
|
||||||
...updatedForm,
|
|
||||||
// 确保开关值是布尔类型(双重保险)
|
|
||||||
displayTip: Boolean(updatedForm.displayTip),
|
|
||||||
alarmTip: Boolean(updatedForm.alarmTip),
|
|
||||||
collection: Number(updatedForm.collection) // 采集开关保持数字类型
|
|
||||||
};
|
|
||||||
console.log('开关值同步:', {
|
|
||||||
displayTip: this.attrForm.displayTip,
|
|
||||||
alarmTip: this.attrForm.alarmTip
|
|
||||||
});
|
|
||||||
},
|
|
||||||
handleTableBtnClick({ type, data }) {
|
handleTableBtnClick({ type, data }) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'edit':
|
case 'edit':
|
||||||
@@ -480,7 +503,6 @@ export default {
|
|||||||
plcParamName: '',
|
plcParamName: '',
|
||||||
unit: '',
|
unit: '',
|
||||||
collection: 1,
|
collection: 1,
|
||||||
|
|
||||||
minValue: '',
|
minValue: '',
|
||||||
maxValue: '',
|
maxValue: '',
|
||||||
defaultValue: '',
|
defaultValue: '',
|
||||||
@@ -489,8 +511,6 @@ export default {
|
|||||||
equipmentParamType: '',
|
equipmentParamType: '',
|
||||||
productionParamType: '',
|
productionParamType: '',
|
||||||
alarmContent: '',
|
alarmContent: '',
|
||||||
displayTip: false,
|
|
||||||
alarmTip: false,
|
|
||||||
};
|
};
|
||||||
this.attrTitle = '添加参数绑定信息';
|
this.attrTitle = '添加参数绑定信息';
|
||||||
this.attrFormVisible = true;
|
this.attrFormVisible = true;
|
||||||
@@ -504,14 +524,7 @@ export default {
|
|||||||
params: { id: attrId },
|
params: { id: attrId },
|
||||||
});
|
});
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
console.log('res.data', res.data);
|
this.attrForm = res.data;
|
||||||
|
|
||||||
this.attrForm = {
|
|
||||||
...res.data,
|
|
||||||
// // 强制转为数字类型,避免字符串类型导致绑定失败
|
|
||||||
// displayTip: Number(res.data.displayTip) || 0,
|
|
||||||
// alarmTip: Number(res.data.alarmTip) || 0
|
|
||||||
};
|
|
||||||
this.attrTitle = '编辑参数绑定信息';
|
this.attrTitle = '编辑参数绑定信息';
|
||||||
this.attrFormVisible = true;
|
this.attrFormVisible = true;
|
||||||
}
|
}
|
||||||
@@ -551,7 +564,6 @@ export default {
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log('this.attrForm', this.attrForm);
|
|
||||||
|
|
||||||
const isEdit = this.attrForm.id != null;
|
const isEdit = this.attrForm.id != null;
|
||||||
this.attrFormSubmitting = true;
|
this.attrFormSubmitting = true;
|
||||||
@@ -571,9 +583,8 @@ export default {
|
|||||||
type: 'success',
|
type: 'success',
|
||||||
duration: 1500,
|
duration: 1500,
|
||||||
onClose: () => {
|
onClose: () => {
|
||||||
this.shouldRefreshPageView = true;
|
|
||||||
this.getAttrList();
|
this.getAttrList();
|
||||||
|
this.shouldRefreshPageView = true;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
style="width: 75%"
|
style="width: 75%"
|
||||||
v-model="dataForm.price"
|
v-model="dataForm.price"
|
||||||
clearable
|
clearable
|
||||||
placeholder="请输入单价" />
|
placeholder="请输入允许留存时间" />
|
||||||
{{ unit }}
|
{{ unit }}
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -103,7 +103,7 @@ export default {
|
|||||||
id: null,
|
id: null,
|
||||||
code: '',
|
code: '',
|
||||||
materialId: '',
|
materialId: '',
|
||||||
price: undefined,
|
price: '',
|
||||||
startTime: new Date().getTime(),
|
startTime: new Date().getTime(),
|
||||||
endTime: null,
|
endTime: null,
|
||||||
remark: '',
|
remark: '',
|
||||||
@@ -141,14 +141,12 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
setCode() {
|
setCode() {
|
||||||
console.log('this.MaterialList', this.urlOptions.dictArr.dict0);
|
|
||||||
|
|
||||||
this.MaterialList.forEach((item) => {
|
this.MaterialList.forEach((item) => {
|
||||||
if (item.id === this.dataForm.materialId) {
|
if (item.id === this.dataForm.materialId) {
|
||||||
this.dataForm.code = item.code;
|
this.dataForm.code = item.code;
|
||||||
this.unit =
|
this.unit =
|
||||||
'元/' +
|
'元/' +
|
||||||
this.urlOptions.dictArr.dict0.find((d) => d.value == item.unit)
|
this.urlOptions.dictArr.dict0.find((d) => d.value === item.unit)
|
||||||
.label;
|
.label;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -47,15 +47,15 @@ const tableProps = [
|
|||||||
prop: 'equipmentName',
|
prop: 'equipmentName',
|
||||||
label: '设备',
|
label: '设备',
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// prop: 'size',
|
prop: 'size',
|
||||||
// label: '规格',
|
label: '规格',
|
||||||
// showOverflowtooltip: true,
|
showOverflowtooltip: true,
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// prop: 'process',
|
prop: 'process',
|
||||||
// label: '产品工艺',
|
label: '产品工艺',
|
||||||
// },
|
},
|
||||||
{
|
{
|
||||||
prop: 'standardCt',
|
prop: 'standardCt',
|
||||||
label: '标准节拍pcs/min',
|
label: '标准节拍pcs/min',
|
||||||
|
|||||||
@@ -72,6 +72,16 @@ export default {
|
|||||||
dateLabelList: [],
|
dateLabelList: [],
|
||||||
optionArrUrl: [getProductionLinePage],
|
optionArrUrl: [getProductionLinePage],
|
||||||
formConfig: [
|
formConfig: [
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '产线',
|
||||||
|
selectOptions: [],
|
||||||
|
param: 'lineIds',
|
||||||
|
defaultSelect: [],
|
||||||
|
multiple: true,
|
||||||
|
filterable: true,
|
||||||
|
width: 200,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: 'datePicker',
|
type: 'datePicker',
|
||||||
label: '时间',
|
label: '时间',
|
||||||
@@ -82,17 +92,6 @@ export default {
|
|||||||
startPlaceholder: '开始时间',
|
startPlaceholder: '开始时间',
|
||||||
endPlaceholder: '结束时间',
|
endPlaceholder: '结束时间',
|
||||||
param: 'time',
|
param: 'time',
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'select',
|
|
||||||
label: '产线',
|
|
||||||
selectOptions: [],
|
|
||||||
param: 'lineIds',
|
|
||||||
defaultSelect: [],
|
|
||||||
multiple: true,
|
|
||||||
collapseTags: true,
|
|
||||||
filterable: true,
|
|
||||||
width: 300,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'button',
|
type: 'button',
|
||||||
@@ -114,7 +113,7 @@ export default {
|
|||||||
};
|
};
|
||||||
this.optionArrUrl.forEach((item, index) => {
|
this.optionArrUrl.forEach((item, index) => {
|
||||||
item(params).then((response) => {
|
item(params).then((response) => {
|
||||||
this.formConfig[1].selectOptions = response.data.list;
|
this.formConfig[index].selectOptions = response.data.list;
|
||||||
// this.formConfig[0].defaultSelect = response.data.list[0].id
|
// this.formConfig[0].defaultSelect = response.data.list[0].id
|
||||||
// this.$set(this.formConfig[0], 'defaultSelect', response.data.list[0].id)
|
// this.$set(this.formConfig[0], 'defaultSelect', response.data.list[0].id)
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -280,7 +280,6 @@ export default {
|
|||||||
clearable: true,
|
clearable: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
// {
|
// {
|
||||||
// select: true,
|
// select: true,
|
||||||
// label: '设备分组',
|
// label: '设备分组',
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ export default {
|
|||||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||||
},
|
},
|
||||||
{ prop: 'name', label: '设备类型名称' },
|
{ prop: 'name', label: '设备类型名称' },
|
||||||
{ prop: 'code', label: '设备类型编码' },
|
{ prop: 'code', label: '检测类型编码' },
|
||||||
{ prop: 'remark', label: '备注' },
|
{ prop: 'remark', label: '备注' },
|
||||||
],
|
],
|
||||||
searchBarFormConfig: [
|
searchBarFormConfig: [
|
||||||
|
|||||||
@@ -66,26 +66,16 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="完成单位产品用时(S)" prop="processTime">
|
<el-form-item label="完成单位产品用时" prop="processTime">
|
||||||
<el-input :disabled="isdetail" v-model="dataForm.processTime" placeholder="请输入完成单位产品用时(S)" />
|
<el-input :disabled="isdetail" v-model="dataForm.processTime" placeholder="请输入完成单位产品用时" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label=" 产品工艺" prop="processTypes">
|
<el-form-item label=" 加工属性" prop="processType">
|
||||||
<el-select :disabled="isdetail" collapse-tags multiple v-model="dataForm.processTypes" clearable
|
<el-select v-model="dataForm.processType" clearable style="width: 100%" :disabled="isdetail"
|
||||||
style="width: 100%" placeholder="请选择产品工艺">
|
placeholder="请选择加工属性">
|
||||||
<el-option v-for="dict in processTypeList" :key="dict.value" :label="dict.label"
|
<el-option v-for="dict in processTypeList" :key="dict.id" :label="dict.label"
|
||||||
:value="dict.value" />
|
:value="dict.id" />
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label=" 基板类型" prop="typeDictValue">
|
|
||||||
<el-select :disabled="isdetail" v-model="dataForm.typeDictValue" clearable
|
|
||||||
style="width: 100%" placeholder="请选择基板类型">
|
|
||||||
<el-option v-for="dict in typeList" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -154,7 +144,7 @@ import {
|
|||||||
import productAttrAdd from './attr-add';
|
import productAttrAdd from './attr-add';
|
||||||
import { parseTime } from '../../mixins/code-filter';
|
import { parseTime } from '../../mixins/code-filter';
|
||||||
import SmallTitle from './SmallTitle';
|
import SmallTitle from './SmallTitle';
|
||||||
import { listData } from "@/api/system/dict/data"; //数据字典接口
|
|
||||||
const tableBtn = [
|
const tableBtn = [
|
||||||
{
|
{
|
||||||
type: 'edit',
|
type: 'edit',
|
||||||
@@ -201,31 +191,29 @@ export default {
|
|||||||
unitDictValue: '', // 单位id
|
unitDictValue: '', // 单位id
|
||||||
originalSpecifications: '', // 原片规格
|
originalSpecifications: '', // 原片规格
|
||||||
originalArea: 0, // 原片单位平方数
|
originalArea: 0, // 原片单位平方数
|
||||||
processTypes: [],
|
processType:undefined,
|
||||||
typeDictValue: null,
|
|
||||||
},
|
},
|
||||||
typeList:[],
|
|
||||||
listQuery: {
|
listQuery: {
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
total: 0,
|
total: 0,
|
||||||
},
|
},
|
||||||
processTypeList: [
|
processTypeList: [
|
||||||
// {
|
{
|
||||||
// value: '1',
|
id: '0',
|
||||||
// label: '压花丝印'
|
label:'压花丝印'
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// value: '2',
|
id: '1',
|
||||||
// label: '无印打孔'
|
label: '无印打孔'
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// value: '3',
|
id: '2',
|
||||||
// label: '单层镀膜'
|
label: '单层镀膜'
|
||||||
// }, {
|
}, {
|
||||||
// value: '4',
|
id: '3',
|
||||||
// label: '双层镀膜'
|
label: '双层镀膜'
|
||||||
// }
|
}
|
||||||
],
|
],
|
||||||
dataRule: {
|
dataRule: {
|
||||||
code: [
|
code: [
|
||||||
@@ -281,37 +269,14 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async initData() {
|
initData() {
|
||||||
this.productAttributeList.splice(0);
|
this.productAttributeList.splice(0);
|
||||||
this.listQuery.total = 0;
|
this.listQuery.total = 0;
|
||||||
const typeRes = await listData({
|
|
||||||
pageNo:
|
|
||||||
1,
|
|
||||||
pageSize
|
|
||||||
: 10,
|
|
||||||
dictType
|
|
||||||
: 'product_type'
|
|
||||||
})
|
|
||||||
|
|
||||||
this.typeList = typeRes.data.list
|
|
||||||
console.log('typeRes', this.typeList);
|
|
||||||
const processTypeRes = await listData({
|
|
||||||
pageNo:
|
|
||||||
1,
|
|
||||||
pageSize
|
|
||||||
: 10,
|
|
||||||
dictType
|
|
||||||
: 'process_type'
|
|
||||||
})
|
|
||||||
|
|
||||||
this.processTypeList = processTypeRes.data.list
|
|
||||||
console.log('typeRes', this.typeList);
|
|
||||||
},
|
},
|
||||||
init(id, isdetail) {
|
init(id, isdetail) {
|
||||||
this.initData();
|
this.initData();
|
||||||
this.isdetail = isdetail || false;
|
this.isdetail = isdetail || false;
|
||||||
this.dataForm.id = id || null;
|
this.dataForm.id = id || null;
|
||||||
// this.dataForm.processTypes = [] // 清空工艺选择
|
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
@@ -319,25 +284,8 @@ export default {
|
|||||||
|
|
||||||
if (this.dataForm.id) {
|
if (this.dataForm.id) {
|
||||||
// 获取产品详情
|
// 获取产品详情
|
||||||
getProduct(id).then((res) => {
|
getProduct(id).then((response) => {
|
||||||
const resData = res.data || {};
|
this.dataForm = response.data;
|
||||||
// 逐个字段赋值(保留响应式)
|
|
||||||
this.dataForm.name = resData.name || '';
|
|
||||||
this.dataForm.code = resData.code || '';
|
|
||||||
this.dataForm.area = resData.area || 0;
|
|
||||||
this.dataForm.typeDictValue = resData.typeDictValue || null;
|
|
||||||
this.dataForm.processTime = resData.processTime || null;
|
|
||||||
this.dataForm.specifications = resData.specifications || '';
|
|
||||||
this.dataForm.unitDictValue = resData.unitDictValue || '';
|
|
||||||
this.dataForm.originalSpecifications = resData.originalSpecifications || '';
|
|
||||||
this.dataForm.originalArea = resData.originalArea || 0;
|
|
||||||
|
|
||||||
// 处理工艺列表:确保是数组,过滤空值
|
|
||||||
this.dataForm.processTypes = resData.processType
|
|
||||||
? resData.processType.split(',').filter(Boolean)
|
|
||||||
: [];
|
|
||||||
|
|
||||||
console.log('工艺列表(编辑时):', this.dataForm.processTypes); // 验证是否为 ["1","2"] 格式
|
|
||||||
});
|
});
|
||||||
// 获取产品的属性列表
|
// 获取产品的属性列表
|
||||||
this.getList();
|
this.getList();
|
||||||
@@ -362,7 +310,8 @@ export default {
|
|||||||
handleClick(raw) {
|
handleClick(raw) {
|
||||||
if (raw.type === 'delete') {
|
if (raw.type === 'delete') {
|
||||||
this.$confirm(
|
this.$confirm(
|
||||||
`确定对${raw.data.name
|
`确定对${
|
||||||
|
raw.data.name
|
||||||
? '[名称=' + raw.data.name + ']'
|
? '[名称=' + raw.data.name + ']'
|
||||||
: '[序号=' + raw.data._pageIndex + ']'
|
: '[序号=' + raw.data._pageIndex + ']'
|
||||||
}进行删除操作?`,
|
}进行删除操作?`,
|
||||||
@@ -385,7 +334,7 @@ export default {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(() => { });
|
.catch(() => {});
|
||||||
} else {
|
} else {
|
||||||
this.addNew(raw.data.id);
|
this.addNew(raw.data.id);
|
||||||
}
|
}
|
||||||
@@ -394,7 +343,6 @@ export default {
|
|||||||
dataFormSubmit() {
|
dataFormSubmit() {
|
||||||
this.$refs['dataForm'].validate((valid) => {
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|
||||||
// 修改的提交
|
// 修改的提交
|
||||||
if (this.dataForm.id) {
|
if (this.dataForm.id) {
|
||||||
updateProduct(this.dataForm).then((response) => {
|
updateProduct(this.dataForm).then((response) => {
|
||||||
@@ -448,30 +396,29 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.drawer>>>.el-drawer {
|
.drawer >>> .el-drawer {
|
||||||
border-radius: 8px 0 0 8px;
|
border-radius: 8px 0 0 8px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.drawer>>>.el-form-item__label {
|
.drawer >>> .el-form-item__label {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.drawer>>>.el-drawer__header {
|
.drawer >>> .el-drawer__header {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 32px 32px 24px;
|
padding: 32px 32px 24px;
|
||||||
border-bottom: 1px solid #dcdfe6;
|
border-bottom: 1px solid #dcdfe6;
|
||||||
}
|
}
|
||||||
|
.drawer >>> .el-drawer__body {
|
||||||
.drawer>>>.el-drawer__body {
|
|
||||||
flex: 1;
|
flex: 1;
|
||||||
height: 1px;
|
height: 1px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.drawer>>>.content {
|
.drawer >>> .content {
|
||||||
padding: 30px 24px;
|
padding: 30px 24px;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -479,17 +426,16 @@ export default {
|
|||||||
/* height: 100%; */
|
/* height: 100%; */
|
||||||
}
|
}
|
||||||
|
|
||||||
.drawer>>>.visual-part {
|
.drawer >>> .visual-part {
|
||||||
flex: 1 auto;
|
flex: 1 auto;
|
||||||
max-height: 76vh;
|
max-height: 76vh;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
padding-right: 10px;
|
padding-right: 10px; /* 调整滚动条样式 */
|
||||||
/* 调整滚动条样式 */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.drawer>>>.el-form,
|
.drawer >>> .el-form,
|
||||||
.drawer>>>.attr-list {
|
.drawer >>> .attr-list {
|
||||||
padding: 0 16px;
|
padding: 0 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog v-loading="isLoading" loading-text="处理中..." loading-spinner="el-icon-loading"
|
<el-dialog
|
||||||
loading-background="rgba(255, 255, 255, 0.7)" :visible.sync="visible" :width="'35%'" :append-to-body="true"
|
:visible.sync="visible"
|
||||||
:close-on-click-modal="false" class="dialog">
|
:width="'35%'"
|
||||||
|
:append-to-body="true"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
class="dialog">
|
||||||
<template #title>
|
<template #title>
|
||||||
<slot name="title">
|
<slot name="title">
|
||||||
<div class="titleStyle">
|
<div class="titleStyle">
|
||||||
@@ -10,19 +13,29 @@
|
|||||||
</slot>
|
</slot>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px"
|
<el-form
|
||||||
|
ref="dataForm"
|
||||||
|
:model="dataForm"
|
||||||
|
:rules="dataRule"
|
||||||
|
label-width="100px"
|
||||||
@keyup.enter.native="dataFormSubmit()">
|
@keyup.enter.native="dataFormSubmit()">
|
||||||
<el-form-item label="属性名" prop="name">
|
<el-form-item label="属性名" prop="name">
|
||||||
<el-input v-model="dataForm.name" placeholder="请输入属性名" clearable />
|
<el-input
|
||||||
|
v-model="dataForm.name"
|
||||||
|
placeholder="请输入属性名"
|
||||||
|
clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="属性值" prop="value">
|
<el-form-item label="属性值" prop="value">
|
||||||
<el-input v-model="dataForm.value" placeholder="请输入属性值" clearable />
|
<el-input
|
||||||
|
v-model="dataForm.value"
|
||||||
|
placeholder="请输入属性值"
|
||||||
|
clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row style="text-align: right">
|
<el-row style="text-align: right">
|
||||||
<el-button @click="visible = false">取消</el-button>
|
<el-button @click="visible = false">取消</el-button>
|
||||||
<el-button :loading="isLoading" type="primary" @click="dataFormSubmit()">确定</el-button>
|
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
@@ -44,7 +57,6 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
visible: false,
|
visible: false,
|
||||||
isLoading: false,
|
|
||||||
dataForm: {
|
dataForm: {
|
||||||
id: 0,
|
id: 0,
|
||||||
name: '',
|
name: '',
|
||||||
@@ -66,69 +78,54 @@ export default {
|
|||||||
const { name, value } = res.data;
|
const { name, value } = res.data;
|
||||||
this.dataForm.name = name;
|
this.dataForm.name = name;
|
||||||
this.dataForm.value = value;
|
this.dataForm.value = value;
|
||||||
}).catch(err => {
|
|
||||||
console.error('获取属性详情失败:', err);
|
|
||||||
this.$modal.msgError('获取数据失败,请重试');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 表单提交(优化加载状态和错误处理)
|
// 表单提交
|
||||||
async dataFormSubmit() {
|
dataFormSubmit() {
|
||||||
// 先验证表单
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
const valid = await new Promise((resolve) => {
|
if (valid) {
|
||||||
this.$refs['dataForm'].validate((isValid) => resolve(isValid));
|
// 修改的提交
|
||||||
});
|
|
||||||
|
|
||||||
if (!valid) return;
|
|
||||||
|
|
||||||
this.isLoading = true; // 开始加载
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (this.dataForm.id) {
|
if (this.dataForm.id) {
|
||||||
// 编辑操作
|
updateProductAttr({
|
||||||
await updateProductAttr({
|
|
||||||
...this.dataForm,
|
...this.dataForm,
|
||||||
productId: this.productId,
|
productId: this.productId,
|
||||||
});
|
}).then((response) => {
|
||||||
this.$modal.msgSuccess('修改成功');
|
this.$modal.msgSuccess('修改成功');
|
||||||
} else {
|
|
||||||
// 新增操作
|
|
||||||
await createProductAttr({
|
|
||||||
...this.dataForm,
|
|
||||||
productId: this.productId,
|
|
||||||
});
|
|
||||||
this.$modal.msgSuccess('新增成功');
|
|
||||||
}
|
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
this.$emit('refreshDataList');
|
this.$emit('refreshDataList');
|
||||||
} catch (error) {
|
});
|
||||||
// 错误处理
|
return;
|
||||||
console.error('提交失败:', error);
|
|
||||||
this.$modal.msgError('操作失败,请重试');
|
|
||||||
} finally {
|
|
||||||
// 无论成功失败,都关闭加载状态
|
|
||||||
this.isLoading = false;
|
|
||||||
}
|
}
|
||||||
|
// 添加的提交
|
||||||
|
createProductAttr({
|
||||||
|
...this.dataForm,
|
||||||
|
productId: this.productId,
|
||||||
|
}).then((response) => {
|
||||||
|
this.$modal.msgSuccess('新增成功');
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.dialog>>>.el-dialog__body {
|
.dialog >>> .el-dialog__body {
|
||||||
padding: 30px 24px;
|
padding: 30px 24px;
|
||||||
}
|
}
|
||||||
|
.dialog >>> .el-dialog__header {
|
||||||
.dialog>>>.el-dialog__header {
|
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
color: rgba(0, 0, 0, 0.85);
|
color: rgba(0, 0, 0, 0.85);
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
padding: 13px 24px;
|
padding: 13px 24px;
|
||||||
border-bottom: 1px solid #e9e9e9;
|
border-bottom: 1px solid #e9e9e9;
|
||||||
}
|
}
|
||||||
|
.dialog >>> .el-dialog__header .titleStyle::before {
|
||||||
.dialog>>>.el-dialog__header .titleStyle::before {
|
|
||||||
content: '';
|
content: '';
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 4px;
|
width: 4px;
|
||||||
|
|||||||
@@ -104,10 +104,6 @@ export default {
|
|||||||
getDataListURL: getProductionLinePage,
|
getDataListURL: getProductionLinePage,
|
||||||
deleteURL: deleteProductionLine,
|
deleteURL: deleteProductionLine,
|
||||||
exportURL: exportProductionLineExcel,
|
exportURL: exportProductionLineExcel,
|
||||||
},
|
|
||||||
listQuery: {
|
|
||||||
pageSize: 20,
|
|
||||||
pageNo:1
|
|
||||||
},
|
},
|
||||||
tableProps,
|
tableProps,
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
@@ -216,7 +212,7 @@ export default {
|
|||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 20;
|
this.listQuery.pageSize = 10;
|
||||||
this.listQuery.factoryId = val.factoryId || undefined;
|
this.listQuery.factoryId = val.factoryId || undefined;
|
||||||
this.listQuery.name = val.name;
|
this.listQuery.name = val.name;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
@@ -224,7 +220,7 @@ export default {
|
|||||||
case 'reset':
|
case 'reset':
|
||||||
this.$refs.searchBarForm.resetForm();
|
this.$refs.searchBarForm.resetForm();
|
||||||
this.listQuery = {
|
this.listQuery = {
|
||||||
pageSize: 20,
|
pageSize: 10,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
total: 1,
|
total: 1,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -262,14 +262,6 @@ export default {
|
|||||||
tooltip: {
|
tooltip: {
|
||||||
valueFormatter: (value) => `${value} %`,
|
valueFormatter: (value) => `${value} %`,
|
||||||
},
|
},
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: 'top',
|
|
||||||
distance: 6,
|
|
||||||
fontSize: 11,
|
|
||||||
color: '#333333',
|
|
||||||
formatter: (params) => `${params.value}` // 显示单位
|
|
||||||
},
|
|
||||||
data: this.barData.map((item) => item.processingRatio),
|
data: this.barData.map((item) => item.processingRatio),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
<el-tabs v-model="activeLabel" :stretch="true" @tab-click="handleTabClick">
|
<el-tabs v-model="activeLabel" :stretch="true" @tab-click="handleTabClick">
|
||||||
<el-tab-pane :label="'全部数据'" name="table">
|
<el-tab-pane :label="'全部数据'" name="table">
|
||||||
<base-table-s ref="lineCurrentShiftTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'"
|
<base-table-s ref="lineCurrentShiftTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'"
|
||||||
:page="1" :limit="100" :table-props="tableProps" :table-data="tableData" :max-height="300" />
|
:page="1" :limit="100" :table-props="tableProps" :table-data="tableData" :max-height="210" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane :label="'\u3000当天生产折线图\u3000'" name="graph">
|
<el-tab-pane :label="'\u3000当天生产折线图\u3000'" name="graph">
|
||||||
<div style="height: 230px;" v-if="activeLabel == 'graph'" class="graph">
|
<div style="height: 230px;" v-if="activeLabel == 'graph'" class="graph">
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
<el-tabs v-model="activeLabelDay" :stretch="true" @tab-click="handleTabClick">
|
<el-tabs v-model="activeLabelDay" :stretch="true" @tab-click="handleTabClick">
|
||||||
<el-tab-pane :label="'全部数据'" name="table">
|
<el-tab-pane :label="'全部数据'" name="table">
|
||||||
<base-table-s ref="lineTodayTable" style="margin-bottom: 16px;" v-if="activeLabelDay == 'table'"
|
<base-table-s ref="lineTodayTable" style="margin-bottom: 16px;" v-if="activeLabelDay == 'table'"
|
||||||
:page="1" :limit="100" :table-props="tableProps" :table-data="tableData2" :max-height="300" />
|
:page="1" :limit="100" :table-props="tableProps" :table-data="tableData2" :max-height="210" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane :label="'\u3000当天生产折线图\u3000'" name="graph">
|
<el-tab-pane :label="'\u3000当天生产折线图\u3000'" name="graph">
|
||||||
<div style="height: 230px;" v-if="activeLabelDay == 'graph'" class="graph">
|
<div style="height: 230px;" v-if="activeLabelDay == 'graph'" class="graph">
|
||||||
@@ -71,55 +71,9 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-inner" v-if="listQuery.timeType === 3">
|
|
||||||
<!-- 当班数据(占1/2剩余高度) -->
|
|
||||||
<div class="content-card energyOverlimitLog">
|
|
||||||
<span class="blue-block"></span>
|
|
||||||
<span class="tip">上一班数据</span>
|
|
||||||
<el-row style="margin-top: 10px;">
|
|
||||||
<el-col class="custom-tabs">
|
|
||||||
<el-tabs v-model="activeLabel" :stretch="true" @tab-click="handleTabClick">
|
|
||||||
<el-tab-pane :label="'全部数据'" name="table">
|
|
||||||
<base-table-s ref="lineCurrentShiftTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'"
|
|
||||||
:page="1" :limit="100" :table-props="tableProps" :table-data="tableData" :max-height="300" />
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane :label="'\u3000当天生产折线图\u3000'" name="graph">
|
|
||||||
<div style="height: 230px;" v-if="activeLabel == 'graph'" class="graph">
|
|
||||||
<barChart v-if="tableData && tableData.length > 0" ref="barChart" height="230px"
|
|
||||||
:bar-data="tableData" />
|
|
||||||
<div v-else class="no-data-bg"></div>
|
|
||||||
</div>
|
|
||||||
</el-tab-pane>
|
|
||||||
</el-tabs>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 当天数据(占1/2剩余高度) -->
|
|
||||||
<div class="content-card energyOverlimitLog">
|
|
||||||
<span class="blue-block"></span>
|
|
||||||
<span class="tip">当天数据</span>
|
|
||||||
<el-row style="margin-top: 10px;">
|
|
||||||
<el-col class="custom-tabs">
|
|
||||||
<el-tabs v-model="activeLabelDay" :stretch="true" @tab-click="handleTabClick">
|
|
||||||
<el-tab-pane :label="'全部数据'" name="table">
|
|
||||||
<base-table-s ref="lineTodayTable" style="margin-bottom: 16px;" v-if="activeLabelDay == 'table'"
|
|
||||||
:page="1" :limit="100" :table-props="tableProps" :table-data="tableData2" :max-height="300" />
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane :label="'\u3000当天生产折线图\u3000'" name="graph">
|
|
||||||
<div style="height: 230px;" v-if="activeLabelDay == 'graph'" class="graph">
|
|
||||||
<barChart v-if="tableData2 && tableData2.length > 0" ref="barChart" height="230px"
|
|
||||||
:bar-data="tableData2" />
|
|
||||||
<div v-else class="no-data-bg"></div>
|
|
||||||
</div>
|
|
||||||
</el-tab-pane>
|
|
||||||
</el-tabs>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- 3.2 时间维度为“自定义”时的内容(两个平分高度的div) -->
|
<!-- 3.2 时间维度为“自定义”时的内容(两个平分高度的div) -->
|
||||||
<div class="content-inner" v-if="listQuery.timeType === 2">
|
<div class="content-inner" v-else>
|
||||||
<div class="content-card energyOverlimitLog">
|
<div class="content-card energyOverlimitLog">
|
||||||
<span class="blue-block"></span>
|
<span class="blue-block"></span>
|
||||||
<span class="tip" v-if="listQuery.startTime && listQuery.endTime">
|
<span class="tip" v-if="listQuery.startTime && listQuery.endTime">
|
||||||
@@ -132,7 +86,7 @@
|
|||||||
<span class="tip" v-else>生产表格数据 </span>
|
<span class="tip" v-else>生产表格数据 </span>
|
||||||
<div class="graph">
|
<div class="graph">
|
||||||
<base-table-s ref="lineCustomTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'" :page="1"
|
<base-table-s ref="lineCustomTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'" :page="1"
|
||||||
:limit="100" :table-props="tableProps" :max-height="300" :table-data="tableDataCustom" />
|
:limit="100" :table-props="tableProps" :max-height="210" :table-data="tableDataCustom" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -159,7 +113,7 @@
|
|||||||
<span class="tip">当班数据</span>
|
<span class="tip">当班数据</span>
|
||||||
<base-table-s ref="productCurrentShiftTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'"
|
<base-table-s ref="productCurrentShiftTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'"
|
||||||
:page="1" :limit="100" :table-props="productTableProps" :table-data="productTableData"
|
:page="1" :limit="100" :table-props="productTableProps" :table-data="productTableData"
|
||||||
:max-height="300" />
|
:max-height="210" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 当天数据(占1/2剩余高度) -->
|
<!-- 当天数据(占1/2剩余高度) -->
|
||||||
@@ -168,7 +122,7 @@
|
|||||||
<span class="tip">当天数据</span>
|
<span class="tip">当天数据</span>
|
||||||
<base-table-s ref="productTodayTable" style="margin-bottom: 16px;" v-if="activeLabelDay == 'table'"
|
<base-table-s ref="productTodayTable" style="margin-bottom: 16px;" v-if="activeLabelDay == 'table'"
|
||||||
:page="1" :limit="100" :table-props="productTablePropsDay" :table-data="productTableDataDay"
|
:page="1" :limit="100" :table-props="productTablePropsDay" :table-data="productTableDataDay"
|
||||||
:max-height="300" />
|
:max-height="210" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -188,7 +142,7 @@
|
|||||||
</span>
|
</span>
|
||||||
<span class="tip" v-else>生产表格数据 </span>
|
<span class="tip" v-else>生产表格数据 </span>
|
||||||
<base-table-s ref="productCustomTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'" :page="1"
|
<base-table-s ref="productCustomTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'" :page="1"
|
||||||
:limit="100" :table-props="productTableProps" :table-data="productTableData" :max-height="300" />
|
:limit="100" :table-props="productTableProps" :table-data="productTableData" :max-height="210" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -200,7 +154,7 @@
|
|||||||
import { parseTime } from '@/filter/code-filter';
|
import { parseTime } from '@/filter/code-filter';
|
||||||
import {
|
import {
|
||||||
getLineAuto, getPdList, getPdlAutoReportNewSearchNow, getProductAuto,
|
getLineAuto, getPdList, getPdlAutoReportNewSearchNow, getProductAuto,
|
||||||
getProcessAutoReportGroup, getProcessAutoReportDay, getProcessAutoReportNew, getPdlAutoReportNewSearchLastGroup
|
getProcessAutoReportGroup, getProcessAutoReportDay, getProcessAutoReportNew
|
||||||
} from '@/api/core/monitoring/auto';
|
} from '@/api/core/monitoring/auto';
|
||||||
import { getFactoryPage } from '@/api/core/base/factory';
|
import { getFactoryPage } from '@/api/core/base/factory';
|
||||||
import * as XLSX from 'xlsx';
|
import * as XLSX from 'xlsx';
|
||||||
@@ -211,11 +165,11 @@ import ButtonNav from '@/components/ButtonNav';
|
|||||||
import { listData } from '@/api/system/dict/data';
|
import { listData } from '@/api/system/dict/data';
|
||||||
// 表格列配置
|
// 表格列配置
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
// {
|
||||||
prop: 'factoryName',
|
// prop: 'factoryName',
|
||||||
label: '工厂',
|
// label: '工厂',
|
||||||
fixed: true
|
// fixed: true
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
prop: 'lineName',
|
prop: 'lineName',
|
||||||
label: '产线',
|
label: '产线',
|
||||||
@@ -401,7 +355,6 @@ export default {
|
|||||||
activeLabel: 'table', // 当班数据tab
|
activeLabel: 'table', // 当班数据tab
|
||||||
activeLabelDay: 'table', // 当天数据tab
|
activeLabelDay: 'table', // 当天数据tab
|
||||||
fileName: '',
|
fileName: '',
|
||||||
headFormValue:{},
|
|
||||||
dataListLoading: false,
|
dataListLoading: false,
|
||||||
tableProps,
|
tableProps,
|
||||||
factoryColumns: [],
|
factoryColumns: [],
|
||||||
@@ -415,27 +368,15 @@ export default {
|
|||||||
productTableDataDay: [],
|
productTableDataDay: [],
|
||||||
tableDataCustom: [],
|
tableDataCustom: [],
|
||||||
list: [], // 折线图数据
|
list: [], // 折线图数据
|
||||||
timeTypeOptions: {
|
|
||||||
productLine: [ // 按产线监控(包含上一班)
|
|
||||||
{ id: 1, name: '当天' },
|
|
||||||
{ id: 2, name: '自定义' },
|
|
||||||
{ id: 3, name: '上一班' }
|
|
||||||
],
|
|
||||||
product: [ // 按产品监控(不含上一班)
|
|
||||||
{ id: 1, name: '当天' },
|
|
||||||
{ id: 2, name: '自定义' }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
formConfig: [
|
formConfig: [
|
||||||
{
|
{
|
||||||
type: 'select',
|
type: 'select',
|
||||||
label: '时间维度',
|
label: '时间维度',
|
||||||
selectOptions: [
|
selectOptions: [
|
||||||
{ id: 1, name: '当天' },
|
{ id: 1, name: '当天' },
|
||||||
{ id: 2, name: '自定义' },
|
{ id: 2, name: '自定义' }
|
||||||
{ id: 3, name: '上一班' }
|
|
||||||
],
|
],
|
||||||
width: 100,
|
width: 80,
|
||||||
onchange: true,
|
onchange: true,
|
||||||
// defaultSelect: 1,
|
// defaultSelect: 1,
|
||||||
clearable: false,
|
clearable: false,
|
||||||
@@ -496,7 +437,6 @@ export default {
|
|||||||
{ id: 3, name: '月' },
|
{ id: 3, name: '月' },
|
||||||
{ id: 4, name: '年' }
|
{ id: 4, name: '年' }
|
||||||
],
|
],
|
||||||
onchange: true,
|
|
||||||
width: 80,
|
width: 80,
|
||||||
param: 'reportType'
|
param: 'reportType'
|
||||||
},
|
},
|
||||||
@@ -520,12 +460,6 @@ export default {
|
|||||||
btnName: '重置',
|
btnName: '重置',
|
||||||
name: 'reset',
|
name: 'reset',
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// type: 'label', // 初始隐藏
|
|
||||||
// label: '刷新时间', // 自定义标识
|
|
||||||
// // slot: 'currentTimeSlot', // 自定义插槽名
|
|
||||||
// // width: 200, // 宽度适配
|
|
||||||
// },
|
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -533,13 +467,6 @@ export default {
|
|||||||
productTableProps() {
|
productTableProps() {
|
||||||
// 当班数据的完整表头(基础列 + 当班动态表头)
|
// 当班数据的完整表头(基础列 + 当班动态表头)
|
||||||
const baseColumns = [
|
const baseColumns = [
|
||||||
{
|
|
||||||
prop: 'sizes',
|
|
||||||
label: '规格',
|
|
||||||
width: 105,
|
|
||||||
showOverflowtooltip: true,
|
|
||||||
fixed: true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
prop: 'process',
|
prop: 'process',
|
||||||
label: '产品工艺',
|
label: '产品工艺',
|
||||||
@@ -548,9 +475,8 @@ export default {
|
|||||||
{
|
{
|
||||||
prop: 'processType',
|
prop: 'processType',
|
||||||
label: '产品类型',
|
label: '产品类型',
|
||||||
filter: (val) => (val === 1 ? '面板' : '背板'),
|
filter: (val) => (val != 1 ? '面板' : '背板'),
|
||||||
fixed: true,
|
fixed: true
|
||||||
sortable: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'factoryName',
|
prop: 'factoryName',
|
||||||
@@ -572,7 +498,6 @@ export default {
|
|||||||
prop: 'processType',
|
prop: 'processType',
|
||||||
label: '产品类型',
|
label: '产品类型',
|
||||||
filter: (val) => (val != 1 ? '面板' : '背板'),
|
filter: (val) => (val != 1 ? '面板' : '背板'),
|
||||||
sortable: true,
|
|
||||||
fixed: true
|
fixed: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -588,20 +513,17 @@ export default {
|
|||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (this.$refs.buttonNav) {
|
if (this.$refs.buttonNav) {
|
||||||
this.$refs.buttonNav.currentMenu = '按产线监控';
|
this.$refs.buttonNav.currentMenu = '按产线监控';
|
||||||
this.formConfig[0].selectOptions = this.timeTypeOptions.productLine;
|
|
||||||
}
|
}
|
||||||
if (this.$refs.searchBarForm) {
|
if (this.$refs.searchBarForm) {
|
||||||
// this.$refs.searchBarForm.formInline.timeVal = [
|
// this.$refs.searchBarForm.formInline.timeVal = [
|
||||||
// yesterday.getTime(),
|
// yesterday.getTime(),
|
||||||
// end.getTime()
|
// end.getTime()
|
||||||
// ];
|
// ];
|
||||||
|
this.$refs.searchBarForm.formInline.timeType = 1
|
||||||
this.$refs.searchBarForm.formInline.timeType = 3
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// this.getLastDayDataList();
|
this.getDayDataList();
|
||||||
this.getPdLineList();
|
this.getPdLineList();
|
||||||
const queryParams = {
|
const queryParams = {
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
@@ -650,65 +572,22 @@ export default {
|
|||||||
this.formConfig[1].type = ''; // 隐藏查询类型
|
this.formConfig[1].type = ''; // 隐藏查询类型
|
||||||
this.formConfig[6].type = ''; // 隐藏报表类型
|
this.formConfig[6].type = ''; // 隐藏报表类型
|
||||||
this.formConfig[7].type = ''; // 隐藏时间范围
|
this.formConfig[7].type = ''; // 隐藏时间范围
|
||||||
const timeItemIndex = this.formConfig.findIndex(item =>
|
|
||||||
item.label?.includes('刷新时间')
|
|
||||||
);
|
|
||||||
if (timeItemIndex > -1) {
|
|
||||||
this.formConfig.splice(timeItemIndex, 1);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 3. 执行公共重置
|
// 3. 执行公共重置
|
||||||
resetCommon();
|
resetCommon();
|
||||||
// if (this.activeName === 'productLine') {
|
|
||||||
// } else {
|
|
||||||
// }
|
|
||||||
// 4. 根据类型设置差异化的表单配置(仅处理不同的部分)
|
// 4. 根据类型设置差异化的表单配置(仅处理不同的部分)
|
||||||
if (isProductLine) {
|
if (isProductLine) {
|
||||||
// 按产线监控:显示产线,隐藏产品工艺和类型,时间维度包含上一班
|
// 按产线监控:显示产线,隐藏产品工艺和类型
|
||||||
this.formConfig[0].selectOptions = this.timeTypeOptions.productLine; // 恢复上一班选项
|
|
||||||
this.formConfig[3].type = 'select'; // 显示产线
|
this.formConfig[3].type = 'select'; // 显示产线
|
||||||
this.formConfig[4].type = ''; // 隐藏产品工艺
|
this.formConfig[4].type = ''; // 隐藏产品工艺
|
||||||
this.formConfig[5].type = ''; // 隐藏产品类型
|
this.formConfig[5].type = ''; // 隐藏产品类型
|
||||||
this.listQuery.timeType = 3;
|
|
||||||
if (this.$refs.searchBarForm) {
|
|
||||||
this.$refs.searchBarForm.formInline.timeType = 3;
|
|
||||||
}
|
|
||||||
// 主动调用上一班数据接口
|
|
||||||
this.getLastDayDataList();
|
|
||||||
const timeItemIndex = this.formConfig.findIndex(item =>
|
|
||||||
item.label?.includes('刷新时间')
|
|
||||||
);
|
|
||||||
const timeLabel = {
|
|
||||||
type: 'label',
|
|
||||||
label: `刷新时间: ${this.formatCurrentTime()}`,
|
|
||||||
};
|
|
||||||
if (timeItemIndex > -1) {
|
|
||||||
this.formConfig.splice(timeItemIndex, 1, timeLabel);
|
|
||||||
} else {
|
} else {
|
||||||
this.formConfig.push(timeLabel);
|
// 按产品监控:显示产品工艺和类型,隐藏产线
|
||||||
}
|
|
||||||
} else {
|
|
||||||
|
|
||||||
// 按产品监控:显示产品工艺和类型,隐藏产线,时间维度移除上一班
|
|
||||||
this.formConfig[0].selectOptions = this.timeTypeOptions.product; // 不含上一班
|
|
||||||
this.formConfig[3].type = ''; // 隐藏产线
|
this.formConfig[3].type = ''; // 隐藏产线
|
||||||
this.formConfig[4].type = 'select'; // 显示产品工艺
|
this.formConfig[4].type = 'select'; // 显示产品工艺
|
||||||
this.formConfig[5].type = 'select'; // 显示产品类型
|
this.formConfig[5].type = 'select'; // 显示产品类型
|
||||||
const timeItemIndex = this.formConfig.findIndex(item =>
|
|
||||||
item.label?.includes('刷新时间')
|
|
||||||
);
|
|
||||||
const timeLabel = {
|
|
||||||
type: 'label',
|
|
||||||
label: `刷新时间: ${this.formatCurrentTime()}`,
|
|
||||||
};
|
|
||||||
if (timeItemIndex > -1) {
|
|
||||||
this.formConfig.splice(timeItemIndex, 1, timeLabel);
|
|
||||||
} else {
|
|
||||||
this.formConfig.push(timeLabel);
|
|
||||||
}
|
|
||||||
this.getProductList();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -722,12 +601,6 @@ export default {
|
|||||||
{ ref: 'lineCurrentShiftTable', name: '产线监控_当班数据' },
|
{ ref: 'lineCurrentShiftTable', name: '产线监控_当班数据' },
|
||||||
{ ref: 'lineTodayTable', name: '产线监控_当天数据' }
|
{ ref: 'lineTodayTable', name: '产线监控_当天数据' }
|
||||||
], '产线监控_当班及当天数据汇总'); // 传入自定义汇总文件名
|
], '产线监控_当班及当天数据汇总'); // 传入自定义汇总文件名
|
||||||
} else if (this.listQuery.timeType === 1) {
|
|
||||||
// 产线-当天:导出当班 + 当天两个表格(自定义汇总文件名)
|
|
||||||
this.exportMultipleTables([
|
|
||||||
{ ref: 'lineCurrentShiftTable', name: '产线监控_上一班数据' },
|
|
||||||
{ ref: 'lineTodayTable', name: '产线监控_当天数据' }
|
|
||||||
], '产线监控_当班及当天数据汇总'); // 传入自定义汇总文件名
|
|
||||||
} else {
|
} else {
|
||||||
// 产线-自定义:导出一个表格(自定义文件名)
|
// 产线-自定义:导出一个表格(自定义文件名)
|
||||||
this.exportSingleTable('lineCustomTable', '产线监控_自定义时间数据');
|
this.exportSingleTable('lineCustomTable', '产线监控_自定义时间数据');
|
||||||
@@ -928,147 +801,31 @@ export default {
|
|||||||
this.formConfig[2].selectOptions = res.data.list || [];
|
this.formConfig[2].selectOptions = res.data.list || [];
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getWeekTimeRange(date) {
|
|
||||||
const targetDate = new Date(date);
|
|
||||||
const day = targetDate.getDay() || 7; // 周日转为7
|
|
||||||
const year = targetDate.getFullYear();
|
|
||||||
const month = targetDate.getMonth();
|
|
||||||
const dateNum = targetDate.getDate();
|
|
||||||
|
|
||||||
// 本周一 00:00:00
|
|
||||||
const startDate = new Date(year, month, dateNum - day + 1);
|
|
||||||
startDate.setHours(0, 0, 0, 0);
|
|
||||||
|
|
||||||
// 本周日 23:59:59
|
|
||||||
const endDate = new Date(year, month, dateNum - day + 7);
|
|
||||||
endDate.setHours(23, 59, 59, 999);
|
|
||||||
|
|
||||||
return {
|
|
||||||
startTime: startDate.getTime(),
|
|
||||||
endTime: endDate.getTime()
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
// 辅助函数:获取本年的开始和结束时间戳(1月1日00:00:00 到 12月31日23:59:59)
|
|
||||||
getYearTimeRange(date) {
|
|
||||||
const targetDate = new Date(date);
|
|
||||||
const year = targetDate.getFullYear();
|
|
||||||
|
|
||||||
// 本年1月1日 00:00:00
|
|
||||||
const startDate = new Date(year, 0, 1);
|
|
||||||
startDate.setHours(0, 0, 0, 0);
|
|
||||||
|
|
||||||
// 本年12月31日 23:59:59
|
|
||||||
const endDate = new Date(year, 11, 31);
|
|
||||||
endDate.setHours(23, 59, 59, 999);
|
|
||||||
|
|
||||||
return {
|
|
||||||
startTime: startDate.getTime(),
|
|
||||||
endTime: endDate.getTime()
|
|
||||||
};
|
|
||||||
},
|
|
||||||
// 搜索/导出按钮点击
|
// 搜索/导出按钮点击
|
||||||
buttonClick(val) {
|
buttonClick(val) {
|
||||||
this.headFormValue = val
|
|
||||||
if (this.activeName === 'productLine') {
|
|
||||||
this.listQuery.pageNo = 1;
|
|
||||||
this.listQuery.pageSize = 10;
|
|
||||||
this.listQuery.factoryId = this.headFormValue.factoryId || undefined;
|
|
||||||
this.listQuery.process = this.headFormValue.process ? this.headFormValue.process : [];
|
|
||||||
this.listQuery.lineId = this.headFormValue.lineId ? this.headFormValue.lineId : [];
|
|
||||||
this.listQuery.processType = this.headFormValue.processType ? this.headFormValue.processType : [];
|
|
||||||
this.listQuery.reportType = this.headFormValue.reportType || undefined;
|
|
||||||
this.listQuery.timeType = this.headFormValue.timeType || undefined;
|
|
||||||
this.listQuery.searchType = this.headFormValue.searchType || undefined;
|
|
||||||
|
|
||||||
// 处理不同时间选择类型
|
|
||||||
if (this.headFormValue.timeVal) {
|
|
||||||
this.listQuery.startTime = this.headFormValue.timeVal[0];
|
|
||||||
this.listQuery.endTime = this.headFormValue.timeVal[1];
|
|
||||||
} else if (this.headFormValue.timeValWeek) {
|
|
||||||
// 周选择器
|
|
||||||
const { startTime, endTime } = this.getWeekTimeRange(this.headFormValue.timeValWeek);
|
|
||||||
this.listQuery.startTime = startTime;
|
|
||||||
this.listQuery.endTime = endTime;
|
|
||||||
} else if (this.headFormValue.timeValMonth) {
|
|
||||||
// 月选择器
|
|
||||||
this.listQuery.startTime = this.headFormValue.timeValMonth[0];
|
|
||||||
this.listQuery.endTime = this.headFormValue.timeValMonth[1];
|
|
||||||
} else if (this.headFormValue.timeValYear) {
|
|
||||||
// 年选择器
|
|
||||||
const { startTime, endTime } = this.getYearTimeRange(this.headFormValue.timeValYear);
|
|
||||||
this.listQuery.startTime = startTime;
|
|
||||||
this.listQuery.endTime = endTime;
|
|
||||||
} else {
|
|
||||||
this.listQuery.startTime = undefined;
|
|
||||||
this.listQuery.endTime = undefined;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.listQuery.pageNo = 1;
|
|
||||||
this.listQuery.pageSize = 10;
|
|
||||||
this.listQuery.factoryId = this.headFormValue.factoryId || []
|
|
||||||
this.listQuery.process = this.headFormValue.process ? this.headFormValue.process : [];
|
|
||||||
this.listQuery.lineId = undefined;
|
|
||||||
this.listQuery.processType = this.headFormValue.processType ? this.headFormValue.processType : [];
|
|
||||||
this.listQuery.reportType = this.headFormValue.reportType || undefined;
|
|
||||||
this.listQuery.timeType = this.headFormValue.timeType || undefined;
|
|
||||||
this.listQuery.searchType = this.headFormValue.searchType || undefined;
|
|
||||||
|
|
||||||
// 处理不同时间选择类型
|
|
||||||
if (this.headFormValue.timeVal) {
|
|
||||||
this.listQuery.startTime = this.headFormValue.timeVal[0];
|
|
||||||
this.listQuery.endTime = this.headFormValue.timeVal[1];
|
|
||||||
} else if (this.headFormValue.timeValWeek) {
|
|
||||||
// 周选择器
|
|
||||||
const { startTime, endTime } = this.getWeekTimeRange(this.headFormValue.timeValWeek);
|
|
||||||
this.listQuery.startTime = startTime;
|
|
||||||
this.listQuery.endTime = endTime;
|
|
||||||
} else if (this.headFormValue.timeValMonth) {
|
|
||||||
// 月选择器
|
|
||||||
this.listQuery.startTime = this.headFormValue.timeValMonth[0];
|
|
||||||
this.listQuery.endTime = this.headFormValue.timeValMonth[1];
|
|
||||||
} else if (this.headFormValue.timeValYear) {
|
|
||||||
// 年选择器
|
|
||||||
const { startTime, endTime } = this.getYearTimeRange(this.headFormValue.timeValYear);
|
|
||||||
this.listQuery.startTime = startTime;
|
|
||||||
this.listQuery.endTime = endTime;
|
|
||||||
} else {
|
|
||||||
this.listQuery.startTime = undefined;
|
|
||||||
this.listQuery.endTime = undefined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
const timeItemIndex = this.formConfig.findIndex(item =>
|
this.listQuery.pageNo = 1;
|
||||||
item.label?.includes('刷新时间')
|
this.listQuery.pageSize = 10;
|
||||||
);
|
this.listQuery.factoryId = val.factoryId || undefined;
|
||||||
|
this.listQuery.process = val.process ? val.process : [];
|
||||||
// 仅当时间维度为【当天】时,添加/更新刷新时间
|
this.listQuery.lineId = val.lineId ? val.lineId : [];
|
||||||
if (this.listQuery.timeType === 1 || this.listQuery.timeType === 3) {
|
this.listQuery.processType = val.processType ? val.processType : [];
|
||||||
const timeLabel = {
|
this.listQuery.reportType = val.reportType || undefined;
|
||||||
type: 'label',
|
this.listQuery.timeType = val.timeType || undefined;
|
||||||
label: `刷新时间: ${this.formatCurrentTime()}`,
|
this.listQuery.searchType = val.searchType || undefined;
|
||||||
};
|
this.listQuery.startTime = val.timeVal ? val.timeVal[0] : undefined;
|
||||||
if (timeItemIndex > -1) {
|
this.listQuery.endTime = val.timeVal ? val.timeVal[1] : undefined;
|
||||||
this.formConfig.splice(timeItemIndex, 1, timeLabel);
|
|
||||||
} else {
|
|
||||||
this.formConfig.push(timeLabel);
|
|
||||||
}
|
|
||||||
} else if (timeItemIndex > -1) {
|
|
||||||
// 非当天时,移除刷新时间
|
|
||||||
this.formConfig.splice(timeItemIndex, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.activeName === 'productLine') {
|
if (this.activeName === 'productLine') {
|
||||||
if (this.listQuery.timeType === 1) {
|
if (this.listQuery.timeType === 1) {
|
||||||
this.getDayDataList();
|
this.getDayDataList();
|
||||||
} else if (this.listQuery.timeType === 3) {
|
|
||||||
this.getLastDayDataList();
|
|
||||||
} else {
|
} else {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.getProductList();
|
this.getProductList();
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'export':
|
case 'export':
|
||||||
@@ -1076,34 +833,21 @@ export default {
|
|||||||
break;
|
break;
|
||||||
case 'reset':
|
case 'reset':
|
||||||
this.$refs.searchBarForm.resetForm();
|
this.$refs.searchBarForm.resetForm();
|
||||||
this.$refs.searchBarForm.formInline.timeType = 3;
|
this.$refs.searchBarForm.formInline.timeType = 1;
|
||||||
this.formConfig[0].selectOptions = this.activeName === 'productLine'
|
|
||||||
? this.timeTypeOptions.productLine
|
|
||||||
: this.timeTypeOptions.product;
|
|
||||||
this.listQuery = {
|
this.listQuery = {
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
total: 0,
|
total: 0,
|
||||||
timeType: this.activeName === 'productLine' ? 3 : 1,
|
timeType: 1,
|
||||||
};
|
};
|
||||||
// 重置后默认是当天,添加刷新时间
|
|
||||||
const resetTimeIndex = this.formConfig.findIndex(item =>
|
|
||||||
item.label?.includes('刷新时间')
|
|
||||||
);
|
|
||||||
const resetTimeLabel = {
|
|
||||||
type: 'label',
|
|
||||||
label: `刷新时间: ${this.formatCurrentTime()}`,
|
|
||||||
};
|
|
||||||
if (resetTimeIndex > -1) {
|
|
||||||
this.formConfig.splice(resetTimeIndex, 1, resetTimeLabel);
|
|
||||||
} else {
|
|
||||||
this.formConfig.push(resetTimeLabel);
|
|
||||||
}
|
|
||||||
if (this.activeName === 'productLine') {
|
if (this.activeName === 'productLine') {
|
||||||
this.getLastDayDataList();
|
this.getDayDataList();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.getProductList();
|
this.getProductList();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
console.log(val);
|
console.log(val);
|
||||||
@@ -1143,15 +887,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async getProductList() {
|
async getProductList() {
|
||||||
this.listQuery.pageNo = 1;
|
console.log('resGroup');
|
||||||
this.listQuery.pageSize = 10;
|
|
||||||
this.listQuery.factoryId = this.headFormValue.factoryId || []
|
|
||||||
this.listQuery.process = this.headFormValue.process ? this.headFormValue.process : [];
|
|
||||||
this.listQuery.lineId = undefined;
|
|
||||||
this.listQuery.processType = this.headFormValue.processType ? this.headFormValue.processType : [];
|
|
||||||
this.listQuery.reportType = this.headFormValue.reportType || undefined;
|
|
||||||
this.listQuery.timeType = this.headFormValue.timeType || undefined;
|
|
||||||
this.listQuery.searchType = this.headFormValue.searchType || undefined
|
|
||||||
if (this.listQuery.timeType === 2) {
|
if (this.listQuery.timeType === 2) {
|
||||||
const resGroup = await getProcessAutoReportNew(this.listQuery);
|
const resGroup = await getProcessAutoReportNew(this.listQuery);
|
||||||
console.log('resGroup', resGroup);
|
console.log('resGroup', resGroup);
|
||||||
@@ -1361,28 +1097,6 @@ export default {
|
|||||||
return [...lineColumns, totalColumn];
|
return [...lineColumns, totalColumn];
|
||||||
},
|
},
|
||||||
// 为当天时调用的接口
|
// 为当天时调用的接口
|
||||||
getLastDayDataList() {
|
|
||||||
getPdlAutoReportNewSearchLastGroup().then((response) => {
|
|
||||||
this.tableData = response.data.classData.map((item, index) => {
|
|
||||||
item.originalLossNum = item.original?.lossNum;
|
|
||||||
item.originalLossArea = item.original?.lossArea;
|
|
||||||
item.edgeLossNum = item.edge?.lossNum;
|
|
||||||
item.edgeLossArea = item.edge?.lossArea;
|
|
||||||
item.drillLossNum = item.drill?.lossNum;
|
|
||||||
item.drillLossArea = item.drill?.lossArea;
|
|
||||||
item.coatingLossNum = item.coating?.lossNum;
|
|
||||||
item.coatingLossArea = item.coating?.lossArea;
|
|
||||||
item.silkLossNum = item.silk?.lossNum;
|
|
||||||
item.silkLossArea = item.silk?.lossArea;
|
|
||||||
item.temperingLossNum = item.tempering?.lossNum;
|
|
||||||
item.temperingLossArea = item.tempering?.lossArea;
|
|
||||||
item.packingLossNum = item.packing?.lossNum;
|
|
||||||
item.packingLossArea = item.packing?.lossArea;
|
|
||||||
return item;
|
|
||||||
});
|
|
||||||
// console.log(this.tableData, this.tableData2);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
getDayDataList() {
|
getDayDataList() {
|
||||||
getPdlAutoReportNewSearchNow().then((response) => {
|
getPdlAutoReportNewSearchNow().then((response) => {
|
||||||
this.tableData = response.data.classData.map((item, index) => {
|
this.tableData = response.data.classData.map((item, index) => {
|
||||||
@@ -1435,48 +1149,32 @@ export default {
|
|||||||
this.listQuery.pageNo = val;
|
this.listQuery.pageNo = val;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
formatCurrentTime() {
|
|
||||||
const date = new Date();
|
|
||||||
const year = date.getFullYear();
|
|
||||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
||||||
const day = String(date.getDate()).padStart(2, '0');
|
|
||||||
const hours = String(date.getHours()).padStart(2, '0');
|
|
||||||
const minutes = String(date.getMinutes()).padStart(2, '0');
|
|
||||||
const seconds = String(date.getSeconds()).padStart(2, '0');
|
|
||||||
return `${hours}:${minutes}:${seconds} ${year}.${month}.${day}`;
|
|
||||||
},
|
|
||||||
// 搜索栏下拉选择变化
|
// 搜索栏下拉选择变化
|
||||||
handleSearchBarChanged({ param, value }) {
|
handleSearchBarChanged({ param, value }) {
|
||||||
if (param === 'timeType') {
|
if (param === 'timeType') {
|
||||||
|
console.log(value);
|
||||||
|
|
||||||
this.listQuery.timeType = value;
|
this.listQuery.timeType = value;
|
||||||
const timeItemIndex = this.formConfig.findIndex(item =>
|
if (value === 1) {
|
||||||
item.label?.includes('刷新时间')
|
// 切换为“当天”:隐藏查询类型、报表类型、时间范围
|
||||||
);
|
this.formConfig[1].type = '';
|
||||||
|
this.formConfig[6].type = '';
|
||||||
// 仅移除,不添加(查询时才添加)
|
this.formConfig[7].type = '';
|
||||||
if (value !== 1 && value !== 3 && timeItemIndex > -1) {
|
|
||||||
this.formConfig.splice(timeItemIndex, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$refs.searchBarForm.formInline.timeType = value;
|
this.$refs.searchBarForm.formInline.timeType = value;
|
||||||
|
this.listQuery.timeType = value;
|
||||||
|
|
||||||
this.$refs.searchBarForm.formInline.searchType = undefined;
|
this.$refs.searchBarForm.formInline.searchType = undefined;
|
||||||
this.$refs.searchBarForm.formInline.reportType = undefined;
|
this.$refs.searchBarForm.formInline.reportType = undefined;
|
||||||
this.$refs.searchBarForm.formInline.timeVal = undefined;
|
this.$refs.searchBarForm.formInline.timeVal = undefined;
|
||||||
|
|
||||||
if (value === 1) {
|
|
||||||
this.formConfig[1].type = '';
|
|
||||||
this.formConfig[6].type = '';
|
|
||||||
this.formConfig[7].type = '';
|
|
||||||
} else if (value === 2) {
|
|
||||||
this.formConfig[1].type = 'select';
|
|
||||||
this.$refs.searchBarForm.formInline.searchType = 1;
|
|
||||||
this.formConfig[7].type = 'datePicker';
|
|
||||||
} else {
|
} else {
|
||||||
this.formConfig[1].type = '';
|
// 切换为“自定义”:显示查询类型和时间范围
|
||||||
this.formConfig[6].type = '';
|
this.formConfig[1].type = 'select';
|
||||||
this.formConfig[7].type = '';
|
this.$refs.searchBarForm.formInline.timeType = value;
|
||||||
}
|
this.listQuery.timeType = value;
|
||||||
|
|
||||||
|
this.formConfig[7].type = 'datePicker';
|
||||||
|
}
|
||||||
} else if (param === 'searchType') {
|
} else if (param === 'searchType') {
|
||||||
if (value === 1) {
|
if (value === 1) {
|
||||||
// 统计数据:显示时间范围,隐藏报表类型
|
// 统计数据:显示时间范围,隐藏报表类型
|
||||||
@@ -1489,77 +1187,7 @@ export default {
|
|||||||
this.formConfig[7].type = 'datePicker';
|
this.formConfig[7].type = 'datePicker';
|
||||||
}
|
}
|
||||||
} else if (param === 'reportType') {
|
} else if (param === 'reportType') {
|
||||||
if (this.$refs.searchBarForm && this.$refs.searchBarForm.formInline) {
|
this.$refs.searchBarForm.formInline.timeVal = undefined;
|
||||||
const formInline = this.$refs.searchBarForm.formInline;
|
|
||||||
// 精准判断:只有字段存在时,才置为undefined(不存在则不处理)
|
|
||||||
if ('timeVal' in formInline) {
|
|
||||||
formInline.timeVal = undefined;
|
|
||||||
}
|
|
||||||
if ('timeValWeek' in formInline) {
|
|
||||||
formInline.timeValWeek = undefined;
|
|
||||||
}
|
|
||||||
if ('timeValMonth' in formInline) {
|
|
||||||
formInline.timeValMonth = undefined;
|
|
||||||
}
|
|
||||||
if ('timeValYear' in formInline) {
|
|
||||||
formInline.timeValYear = undefined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.listQuery.startTime = undefined;
|
|
||||||
this.listQuery.endTime = undefined;
|
|
||||||
if (value === 1) {
|
|
||||||
this.formConfig[7] = {
|
|
||||||
type: 'datePicker',
|
|
||||||
label: '时间范围',
|
|
||||||
dateType: 'datetimerange',
|
|
||||||
format: 'yyyy-MM-dd HH:mm:ss',
|
|
||||||
valueFormat: 'timestamp',
|
|
||||||
rangeSeparator: '-',
|
|
||||||
startPlaceholder: '开始时间',
|
|
||||||
endPlaceholder: '结束时间',
|
|
||||||
param: 'timeVal',
|
|
||||||
width: 350
|
|
||||||
};
|
|
||||||
} else if (value === 2) {
|
|
||||||
this.formConfig[7] = {
|
|
||||||
type: 'datePicker',
|
|
||||||
label: '时间范围',
|
|
||||||
dateType: 'week',
|
|
||||||
placeholder: '选择日期',
|
|
||||||
format: 'yyyy 第 WW 周',
|
|
||||||
pickerOptions: {
|
|
||||||
firstDayOfWeek: 1 // 数字1表示周一作为周的第一天(0=周日,1=周一,依此类推)
|
|
||||||
},
|
|
||||||
valueFormat: 'yyyy-MM-dd',
|
|
||||||
param: 'timeValWeek',
|
|
||||||
width: 250,
|
|
||||||
};
|
|
||||||
} else if (value === 3) {
|
|
||||||
this.formConfig[7] = {
|
|
||||||
type: 'datePicker',
|
|
||||||
label: '时间范围',
|
|
||||||
dateType: 'monthrange',
|
|
||||||
format: 'yyyy-MM-dd',
|
|
||||||
valueFormat: 'timestamp',
|
|
||||||
rangeSeparator: '-',
|
|
||||||
startPlaceholder: '开始时间',
|
|
||||||
endPlaceholder: '结束时间',
|
|
||||||
param: 'timeValMonth',
|
|
||||||
defaultTime: ['00:00:00', '23:59:59'],
|
|
||||||
width: 250,
|
|
||||||
};
|
|
||||||
} else if (value === 4) {
|
|
||||||
this.formConfig[7] = {
|
|
||||||
type: 'datePicker',
|
|
||||||
label: '时间范围',
|
|
||||||
dateType: 'year',
|
|
||||||
placeholder: '选择年份',
|
|
||||||
format: 'yyyy',
|
|
||||||
valueFormat: 'timestamp',
|
|
||||||
param: 'timeValYear',
|
|
||||||
width: 250,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
} else if (param === 'factoryId') {
|
} else if (param === 'factoryId') {
|
||||||
// 切换工厂时刷新产线列表
|
// 切换工厂时刷新产线列表
|
||||||
this.listQuery.lineId = [];
|
this.listQuery.lineId = [];
|
||||||
@@ -1606,7 +1234,7 @@ export default {
|
|||||||
.content-wrapper {
|
.content-wrapper {
|
||||||
// flex: 1;
|
// flex: 1;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: calc(100vh - 280px);
|
height: calc(100vh - 303px);
|
||||||
// overflow: hidden;
|
// overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ const tableProps = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'palletNum',
|
prop: 'palletNum',
|
||||||
label: '一托玻璃数量/片'
|
label: '下片托数'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'startTime',
|
prop: 'startTime',
|
||||||
@@ -92,7 +92,7 @@ const tableProps = [
|
|||||||
width: 160
|
width: 160
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'length',
|
prop: 'outputNum',
|
||||||
label: '玻璃长度/mm'
|
label: '玻璃长度/mm'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -204,87 +204,93 @@ export default {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
exportXlsx() {
|
test() {
|
||||||
if (!this.showData.length) {
|
var target = document.getElementsByClassName("right-aside")[0]
|
||||||
this.$message.warning('暂无数据可导出');
|
target.style.background = '#FFFFFF'
|
||||||
return;
|
var that = this
|
||||||
|
setTimeout(() => {
|
||||||
|
html2canvas(target).then(function(canvas) {
|
||||||
|
var contentWidth = canvas.width
|
||||||
|
var contentHeight = canvas.height
|
||||||
|
|
||||||
|
// 一页pdf显示html页面生成的canvas高度
|
||||||
|
var pageHeight = contentHeight / 592.28 * 841.89
|
||||||
|
// 未生成pdf的html页面高度
|
||||||
|
var leftHeight = contentHeight
|
||||||
|
// 页面偏移
|
||||||
|
var position = 0
|
||||||
|
// a4纸的尺寸[595.28,841.89],html页面生成的canvas在pdf中图片的高度
|
||||||
|
var imgWidth = 595.28
|
||||||
|
var imgHeight = 592.28 / contentWidth * contentHeight
|
||||||
|
|
||||||
|
var pageData = canvas.toDataURL('image/jpeg', 1.0)
|
||||||
|
|
||||||
|
console.log('nihc URL', leftHeight, pageHeight)
|
||||||
|
|
||||||
|
var pdf = new jsPDF('', 'pt', 'a4')
|
||||||
|
|
||||||
|
if (leftHeight < pageHeight) {
|
||||||
|
pdf.addImage(pageData, 'JPEG', 0, 20, imgWidth, imgHeight)
|
||||||
|
} else {
|
||||||
|
while(leftHeight > 0) {
|
||||||
|
pdf.addImage(pageData, 'JPEG', 0, position, imgWidth, imgHeight)
|
||||||
|
leftHeight -= pageHeight
|
||||||
|
position -= 841.89
|
||||||
|
// 避免空白页
|
||||||
|
if (leftHeight > 0) {
|
||||||
|
pdf.addPage()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.exportLoading = true;
|
pdf.save(that.fileName + '工段统计.pdf')
|
||||||
|
})
|
||||||
|
}, 300)
|
||||||
|
},
|
||||||
|
exportECL() {
|
||||||
|
let tables = document.querySelector('.el-table').cloneNode(true)
|
||||||
|
const fix = tables.querySelector('.el-table__fixed')
|
||||||
|
const fixRight = tables.querySelector('.el-table__fixed-right')
|
||||||
|
if (fix) {
|
||||||
|
tables.removeChild(tables.querySelector('.el-table__fixed'))
|
||||||
|
}
|
||||||
|
if (fixRight) {
|
||||||
|
tables.removeChild(tables.querySelector('.el-table__fixed-right'))
|
||||||
|
}
|
||||||
|
let exportTable = XLSX.utils.table_to_book(tables)
|
||||||
|
|
||||||
|
var exportTableOut = XLSX.write(exportTable, {
|
||||||
|
bookType: 'xlsx', bookSST: true, type: 'array'
|
||||||
|
})
|
||||||
|
// sheetjs.xlsx为导出表格的标题名称
|
||||||
try {
|
try {
|
||||||
// 1. 处理导出数据(格式化时间字段)
|
FileSaver.saveAs(new Blob([exportTableOut], {
|
||||||
const exportData = this.showData.map(item => {
|
type: 'application/octet-stream'
|
||||||
const formatItem = { ...item };
|
}), this.fileName + '工段统计.xlsx')
|
||||||
// 格式化时间字段
|
} catch (e) {
|
||||||
if (formatItem.startTime) formatItem.startTime = parseTime(formatItem.startTime);
|
if (typeof console !== 'undefined') console.log(e, exportTableOut)
|
||||||
if (formatItem.endTime) formatItem.endTime = parseTime(formatItem.endTime);
|
|
||||||
return formatItem;
|
|
||||||
});
|
|
||||||
|
|
||||||
// 2. 构建表头映射:{ prop: label },只保留表格配置中存在的列
|
|
||||||
const headerMap = {};
|
|
||||||
this.tableProps.forEach(col => {
|
|
||||||
if (col.prop && col.label) {
|
|
||||||
headerMap[col.prop] = col.label;
|
|
||||||
}
|
}
|
||||||
});
|
return exportTableOut
|
||||||
|
},
|
||||||
|
exportPdf() {
|
||||||
|
this.test()
|
||||||
|
setTimeout(() =>{
|
||||||
|
this.dialogVisible = false
|
||||||
|
this.showData = this.tableData
|
||||||
|
}, 600)
|
||||||
|
|
||||||
// 3. 转换数据:将prop键名替换为label,按tableProps顺序排列列
|
},
|
||||||
const formattedData = exportData.map(item => {
|
exportXlsx() {
|
||||||
const newItem = {};
|
this.exportECL()
|
||||||
// 按表格配置顺序遍历列,确保Excel列顺序与表格一致
|
this.dialogVisible = false
|
||||||
this.tableProps.forEach(col => {
|
this.showData = this.tableData
|
||||||
const prop = col.prop;
|
},
|
||||||
const label = col.label;
|
handleClose(done) {
|
||||||
if (prop && label) {
|
this.$confirm('确认关闭?')
|
||||||
// 处理可能的undefined值,避免导出为空字符串
|
.then(_ => {
|
||||||
newItem[label] = item[prop] ?? '';
|
done();
|
||||||
}
|
})
|
||||||
});
|
.catch(_ => {});
|
||||||
return newItem;
|
|
||||||
});
|
|
||||||
|
|
||||||
// 4. 创建工作表(使用处理后的带label表头的数据)
|
|
||||||
const worksheet = XLSX.utils.json_to_sheet(formattedData);
|
|
||||||
|
|
||||||
// 5. 创建工作簿并添加工作表
|
|
||||||
const workbook = XLSX.utils.book_new();
|
|
||||||
XLSX.utils.book_append_sheet(workbook, worksheet, '下片日志数据');
|
|
||||||
|
|
||||||
// 6. 生成Excel文件
|
|
||||||
const excelBuffer = XLSX.write(workbook, {
|
|
||||||
bookType: 'xlsx',
|
|
||||||
type: 'array'
|
|
||||||
});
|
|
||||||
|
|
||||||
// 7. 保存文件
|
|
||||||
const blob = new Blob([excelBuffer], {
|
|
||||||
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
|
|
||||||
});
|
|
||||||
|
|
||||||
// 8. 生成文件名(包含查询条件信息)
|
|
||||||
let fileName = '下片历史';
|
|
||||||
if (this.listQuery.productionLineId) {
|
|
||||||
const lineItem = this.formConfig[0].selectOptions.find(
|
|
||||||
item => item.id === this.listQuery.productionLineId
|
|
||||||
);
|
|
||||||
if (lineItem) fileName += lineItem.name + '_';
|
|
||||||
}
|
|
||||||
if (this.listQuery.thick) {
|
|
||||||
fileName += this.listQuery.thick + '_';
|
|
||||||
}
|
|
||||||
// 添加时间戳避免文件名重复
|
|
||||||
fileName += + '.xlsx';
|
|
||||||
|
|
||||||
FileSaver.saveAs(blob, fileName);
|
|
||||||
this.$message.success('导出成功');
|
|
||||||
} catch (error) {
|
|
||||||
console.error('导出失败:', error);
|
|
||||||
this.$message.error('导出失败,请重试');
|
|
||||||
} finally {
|
|
||||||
this.exportLoading = false;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
getPdLineList() {
|
getPdLineList() {
|
||||||
getPdList().then((res) => {
|
getPdList().then((res) => {
|
||||||
@@ -308,16 +314,15 @@ export default {
|
|||||||
case 'search':
|
case 'search':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 10;
|
||||||
this.listQuery.productionLineId = val.productionLineId ? val.productionLineId : undefined;
|
this.listQuery.productId = val.productId ? val.productId : undefined;
|
||||||
this.listQuery.thick = val.thick ? val.thick : undefined;
|
this.listQuery.startTime = val.timeVal ? val.timeVal[0]: undefined;
|
||||||
this.listQuery.startTime = val.timeVal ? val.timeVal[0] : undefined;
|
this.listQuery.endTime = val.timeVal ? val.timeVal[1]: undefined;
|
||||||
this.listQuery.endTime = val.timeVal ? val.timeVal[1] : undefined;
|
|
||||||
|
|
||||||
//this.listQuery.reportEndTime = val.timeVal ? [new Date(val.timeVal[1]).getTime()] : undefined;
|
//this.listQuery.reportEndTime = val.timeVal ? [new Date(val.timeVal[1]).getTime()] : undefined;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
break;
|
break;
|
||||||
case 'export':
|
case 'export':
|
||||||
this.exportXlsx();
|
this.handleExport();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
console.log(val);
|
console.log(val);
|
||||||
@@ -345,6 +350,12 @@ export default {
|
|||||||
this.listQuery.pageNo = val;
|
this.listQuery.pageNo = val;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
|
handleExport() {
|
||||||
|
if (this.selectedList.length > 0) {
|
||||||
|
this.showData = this.selectedList
|
||||||
|
}
|
||||||
|
this.dialogVisible = true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ const tableProps = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'palletNum',
|
prop: 'palletNum',
|
||||||
label: '一托玻璃数量/片'
|
label: '下片托数'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'startTime',
|
prop: 'startTime',
|
||||||
@@ -92,7 +92,7 @@ const tableProps = [
|
|||||||
width: 160
|
width: 160
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'length',
|
prop: 'outputNum',
|
||||||
label: '玻璃长度/mm'
|
label: '玻璃长度/mm'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -262,14 +262,6 @@ export default {
|
|||||||
tooltip: {
|
tooltip: {
|
||||||
valueFormatter: (value) => `${value} %`,
|
valueFormatter: (value) => `${value} %`,
|
||||||
},
|
},
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: 'top',
|
|
||||||
distance: 6,
|
|
||||||
fontSize: 11,
|
|
||||||
color: '#333333',
|
|
||||||
formatter: (params) => `${params.value}` // 显示单位
|
|
||||||
},
|
|
||||||
data: this.barData.map((item) => item.processingRatio),
|
data: this.barData.map((item) => item.processingRatio),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
<el-tabs v-model="activeLabel" :stretch="true" @tab-click="handleTabClick">
|
<el-tabs v-model="activeLabel" :stretch="true" @tab-click="handleTabClick">
|
||||||
<el-tab-pane :label="'全部数据'" name="table">
|
<el-tab-pane :label="'全部数据'" name="table">
|
||||||
<base-table-s ref="lineCurrentShiftTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'"
|
<base-table-s ref="lineCurrentShiftTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'"
|
||||||
:page="1" :limit="100" :table-props="tableProps" :table-data="tableData" :max-height="300" />
|
:page="1" :limit="100" :table-props="tableProps" :table-data="tableData" :max-height="210" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane :label="'\u3000当天生产折线图\u3000'" name="graph">
|
<el-tab-pane :label="'\u3000当天生产折线图\u3000'" name="graph">
|
||||||
<div style="height: 230px;" v-if="activeLabel == 'graph'" class="graph">
|
<div style="height: 230px;" v-if="activeLabel == 'graph'" class="graph">
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
<el-tabs v-model="activeLabelDay" :stretch="true" @tab-click="handleTabClick">
|
<el-tabs v-model="activeLabelDay" :stretch="true" @tab-click="handleTabClick">
|
||||||
<el-tab-pane :label="'全部数据'" name="table">
|
<el-tab-pane :label="'全部数据'" name="table">
|
||||||
<base-table-s ref="lineTodayTable" style="margin-bottom: 16px;" v-if="activeLabelDay == 'table'"
|
<base-table-s ref="lineTodayTable" style="margin-bottom: 16px;" v-if="activeLabelDay == 'table'"
|
||||||
:page="1" :limit="100" :table-props="tableProps" :table-data="tableData2" :max-height="300" />
|
:page="1" :limit="100" :table-props="tableProps" :table-data="tableData2" :max-height="210" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane :label="'\u3000当天生产折线图\u3000'" name="graph">
|
<el-tab-pane :label="'\u3000当天生产折线图\u3000'" name="graph">
|
||||||
<div style="height: 230px;" v-if="activeLabelDay == 'graph'" class="graph">
|
<div style="height: 230px;" v-if="activeLabelDay == 'graph'" class="graph">
|
||||||
@@ -71,55 +71,9 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-inner" v-if="listQuery.timeType === 3">
|
|
||||||
<!-- 当班数据(占1/2剩余高度) -->
|
|
||||||
<div class="content-card energyOverlimitLog">
|
|
||||||
<span class="blue-block"></span>
|
|
||||||
<span class="tip">上一班数据</span>
|
|
||||||
<el-row style="margin-top: 10px;">
|
|
||||||
<el-col class="custom-tabs">
|
|
||||||
<el-tabs v-model="activeLabel" :stretch="true" @tab-click="handleTabClick">
|
|
||||||
<el-tab-pane :label="'全部数据'" name="table">
|
|
||||||
<base-table-s ref="lineCurrentShiftTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'"
|
|
||||||
:page="1" :limit="100" :table-props="tableProps" :table-data="tableData" :max-height="300" />
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane :label="'\u3000当天生产折线图\u3000'" name="graph">
|
|
||||||
<div style="height: 230px;" v-if="activeLabel == 'graph'" class="graph">
|
|
||||||
<barChart v-if="tableData && tableData.length > 0" ref="barChart" height="230px"
|
|
||||||
:bar-data="tableData" />
|
|
||||||
<div v-else class="no-data-bg"></div>
|
|
||||||
</div>
|
|
||||||
</el-tab-pane>
|
|
||||||
</el-tabs>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 当天数据(占1/2剩余高度) -->
|
|
||||||
<div class="content-card energyOverlimitLog">
|
|
||||||
<span class="blue-block"></span>
|
|
||||||
<span class="tip">当天数据</span>
|
|
||||||
<el-row style="margin-top: 10px;">
|
|
||||||
<el-col class="custom-tabs">
|
|
||||||
<el-tabs v-model="activeLabelDay" :stretch="true" @tab-click="handleTabClick">
|
|
||||||
<el-tab-pane :label="'全部数据'" name="table">
|
|
||||||
<base-table-s ref="lineTodayTable" style="margin-bottom: 16px;" v-if="activeLabelDay == 'table'"
|
|
||||||
:page="1" :limit="100" :table-props="tableProps" :table-data="tableData2" :max-height="300" />
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane :label="'\u3000当天生产折线图\u3000'" name="graph">
|
|
||||||
<div style="height: 230px;" v-if="activeLabelDay == 'graph'" class="graph">
|
|
||||||
<barChart v-if="tableData2 && tableData2.length > 0" ref="barChart" height="230px"
|
|
||||||
:bar-data="tableData2" />
|
|
||||||
<div v-else class="no-data-bg"></div>
|
|
||||||
</div>
|
|
||||||
</el-tab-pane>
|
|
||||||
</el-tabs>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- 3.2 时间维度为“自定义”时的内容(两个平分高度的div) -->
|
<!-- 3.2 时间维度为“自定义”时的内容(两个平分高度的div) -->
|
||||||
<div class="content-inner" v-if="listQuery.timeType === 2">
|
<div class="content-inner" v-else>
|
||||||
<div class="content-card energyOverlimitLog">
|
<div class="content-card energyOverlimitLog">
|
||||||
<span class="blue-block"></span>
|
<span class="blue-block"></span>
|
||||||
<span class="tip" v-if="listQuery.startTime && listQuery.endTime">
|
<span class="tip" v-if="listQuery.startTime && listQuery.endTime">
|
||||||
@@ -132,7 +86,7 @@
|
|||||||
<span class="tip" v-else>生产表格数据 </span>
|
<span class="tip" v-else>生产表格数据 </span>
|
||||||
<div class="graph">
|
<div class="graph">
|
||||||
<base-table-s ref="lineCustomTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'" :page="1"
|
<base-table-s ref="lineCustomTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'" :page="1"
|
||||||
:limit="100" :table-props="tableProps" :max-height="300" :table-data="tableDataCustom" />
|
:limit="100" :table-props="tableProps" :max-height="210" :table-data="tableDataCustom" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -159,7 +113,7 @@
|
|||||||
<span class="tip">当班数据</span>
|
<span class="tip">当班数据</span>
|
||||||
<base-table-s ref="productCurrentShiftTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'"
|
<base-table-s ref="productCurrentShiftTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'"
|
||||||
:page="1" :limit="100" :table-props="productTableProps" :table-data="productTableData"
|
:page="1" :limit="100" :table-props="productTableProps" :table-data="productTableData"
|
||||||
:max-height="300" />
|
:max-height="210" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 当天数据(占1/2剩余高度) -->
|
<!-- 当天数据(占1/2剩余高度) -->
|
||||||
@@ -168,7 +122,7 @@
|
|||||||
<span class="tip">当天数据</span>
|
<span class="tip">当天数据</span>
|
||||||
<base-table-s ref="productTodayTable" style="margin-bottom: 16px;" v-if="activeLabelDay == 'table'"
|
<base-table-s ref="productTodayTable" style="margin-bottom: 16px;" v-if="activeLabelDay == 'table'"
|
||||||
:page="1" :limit="100" :table-props="productTablePropsDay" :table-data="productTableDataDay"
|
:page="1" :limit="100" :table-props="productTablePropsDay" :table-data="productTableDataDay"
|
||||||
:max-height="300" />
|
:max-height="210" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -188,7 +142,7 @@
|
|||||||
</span>
|
</span>
|
||||||
<span class="tip" v-else>生产表格数据 </span>
|
<span class="tip" v-else>生产表格数据 </span>
|
||||||
<base-table-s ref="productCustomTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'" :page="1"
|
<base-table-s ref="productCustomTable" style="margin-bottom: 16px;" v-if="activeLabel == 'table'" :page="1"
|
||||||
:limit="100" :table-props="productTableProps" :table-data="productTableData" :max-height="300" />
|
:limit="100" :table-props="productTableProps" :table-data="productTableData" :max-height="210" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -200,7 +154,7 @@
|
|||||||
import { parseTime } from '@/filter/code-filter';
|
import { parseTime } from '@/filter/code-filter';
|
||||||
import {
|
import {
|
||||||
getLineAuto, getPdList, getPdlAutoReportNewSearchNow, getProductAuto,
|
getLineAuto, getPdList, getPdlAutoReportNewSearchNow, getProductAuto,
|
||||||
getProcessAutoReportGroup, getProcessAutoReportDay, getProcessAutoReportNew, getPdlAutoReportNewSearchLastGroup
|
getProcessAutoReportGroup, getProcessAutoReportDay, getProcessAutoReportNew
|
||||||
} from '@/api/core/monitoring/auto';
|
} from '@/api/core/monitoring/auto';
|
||||||
import { getFactoryPage } from '@/api/core/base/factory';
|
import { getFactoryPage } from '@/api/core/base/factory';
|
||||||
import * as XLSX from 'xlsx';
|
import * as XLSX from 'xlsx';
|
||||||
@@ -211,11 +165,11 @@ import ButtonNav from '@/components/ButtonNav';
|
|||||||
import { listData } from '@/api/system/dict/data';
|
import { listData } from '@/api/system/dict/data';
|
||||||
// 表格列配置
|
// 表格列配置
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
// {
|
||||||
prop: 'factoryName',
|
// prop: 'factoryName',
|
||||||
label: '工厂',
|
// label: '工厂',
|
||||||
fixed: true
|
// fixed: true
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
prop: 'lineName',
|
prop: 'lineName',
|
||||||
label: '产线',
|
label: '产线',
|
||||||
@@ -406,7 +360,6 @@ export default {
|
|||||||
factoryColumns: [],
|
factoryColumns: [],
|
||||||
factoryColumnsDay: [],
|
factoryColumnsDay: [],
|
||||||
activeName: 'product',
|
activeName: 'product',
|
||||||
headFormValue:{},
|
|
||||||
tableBtn: [],
|
tableBtn: [],
|
||||||
showData: [],
|
showData: [],
|
||||||
tableData: [],
|
tableData: [],
|
||||||
@@ -415,27 +368,15 @@ export default {
|
|||||||
productTableDataDay: [],
|
productTableDataDay: [],
|
||||||
tableDataCustom: [],
|
tableDataCustom: [],
|
||||||
list: [], // 折线图数据
|
list: [], // 折线图数据
|
||||||
timeTypeOptions: {
|
|
||||||
productLine: [ // 按产线监控(包含上一班)
|
|
||||||
{ id: 1, name: '当天' },
|
|
||||||
{ id: 2, name: '自定义' },
|
|
||||||
{ id: 3, name: '上一班' }
|
|
||||||
],
|
|
||||||
product: [ // 按产品监控(不含上一班)
|
|
||||||
{ id: 1, name: '当天' },
|
|
||||||
{ id: 2, name: '自定义' }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
formConfig: [
|
formConfig: [
|
||||||
{
|
{
|
||||||
type: 'select',
|
type: 'select',
|
||||||
label: '时间维度',
|
label: '时间维度',
|
||||||
selectOptions: [
|
selectOptions: [
|
||||||
{ id: 1, name: '当天' },
|
{ id: 1, name: '当天' },
|
||||||
{ id: 2, name: '自定义' },
|
{ id: 2, name: '自定义' }
|
||||||
{ id: 3, name: '上一班' }
|
|
||||||
],
|
],
|
||||||
width: 100,
|
width: 80,
|
||||||
onchange: true,
|
onchange: true,
|
||||||
// defaultSelect: 1,
|
// defaultSelect: 1,
|
||||||
clearable: false,
|
clearable: false,
|
||||||
@@ -497,7 +438,6 @@ export default {
|
|||||||
{ id: 4, name: '年' }
|
{ id: 4, name: '年' }
|
||||||
],
|
],
|
||||||
width: 80,
|
width: 80,
|
||||||
onchange: true,
|
|
||||||
param: 'reportType'
|
param: 'reportType'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -536,7 +476,6 @@ export default {
|
|||||||
prop: 'processType',
|
prop: 'processType',
|
||||||
label: '产品类型',
|
label: '产品类型',
|
||||||
filter: (val) => (val != 1 ? '面板' : '背板'),
|
filter: (val) => (val != 1 ? '面板' : '背板'),
|
||||||
sortable: true,
|
|
||||||
fixed: true
|
fixed: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -559,7 +498,6 @@ export default {
|
|||||||
prop: 'processType',
|
prop: 'processType',
|
||||||
label: '产品类型',
|
label: '产品类型',
|
||||||
filter: (val) => (val != 1 ? '面板' : '背板'),
|
filter: (val) => (val != 1 ? '面板' : '背板'),
|
||||||
sortable: true,
|
|
||||||
fixed: true
|
fixed: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -573,34 +511,18 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
// 1. 强制设置当前激活标签为 按产品监控
|
|
||||||
this.activeName = 'product';
|
|
||||||
if (this.$refs.buttonNav) {
|
if (this.$refs.buttonNav) {
|
||||||
this.$refs.buttonNav.currentMenu = '按产品监控';
|
this.$refs.buttonNav.currentMenu = '按产品监控';
|
||||||
// 时间维度选项只显示 当天/自定义(无 上一班)
|
|
||||||
this.formConfig[0].selectOptions = this.timeTypeOptions.product;
|
|
||||||
}
|
}
|
||||||
if (this.$refs.searchBarForm) {
|
if (this.$refs.searchBarForm) {
|
||||||
// 2. 强制设置搜索表单的 timeType 为 1(当天)
|
// this.$refs.searchBarForm.formInline.timeVal = [
|
||||||
this.$refs.searchBarForm.formInline.timeType = 1;
|
// yesterday.getTime(),
|
||||||
// 同步查询参数的 timeType
|
// end.getTime()
|
||||||
this.listQuery.timeType = 1;
|
// ];
|
||||||
}
|
this.$refs.searchBarForm.formInline.timeType = 1
|
||||||
const timeItemIndex = this.formConfig.findIndex(item =>
|
|
||||||
item.label?.includes('刷新时间')
|
|
||||||
);
|
|
||||||
const timeLabel = {
|
|
||||||
type: 'label',
|
|
||||||
label: `刷新时间: ${this.formatCurrentTime()}`,
|
|
||||||
};
|
|
||||||
if (timeItemIndex > -1) {
|
|
||||||
this.formConfig.splice(timeItemIndex, 1, timeLabel);
|
|
||||||
} else {
|
|
||||||
this.formConfig.push(timeLabel);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 3. 初始化直接调用 按产品监控 的接口
|
|
||||||
this.getProductList();
|
this.getProductList();
|
||||||
this.getPdLineList();
|
this.getPdLineList();
|
||||||
const queryParams = {
|
const queryParams = {
|
||||||
@@ -613,22 +535,11 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
formatCurrentTime() {
|
|
||||||
const date = new Date();
|
|
||||||
const year = date.getFullYear();
|
|
||||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
||||||
const day = String(date.getDate()).padStart(2, '0');
|
|
||||||
const hours = String(date.getHours()).padStart(2, '0');
|
|
||||||
const minutes = String(date.getMinutes()).padStart(2, '0');
|
|
||||||
const seconds = String(date.getSeconds()).padStart(2, '0');
|
|
||||||
return `${hours}:${minutes}:${seconds} ${year}.${month}.${day}`;
|
|
||||||
},
|
|
||||||
// 切换按产线/按产品监控
|
// 切换按产线/按产品监控
|
||||||
currentMenu(val) {
|
currentMenu(val) {
|
||||||
// 1. 确定当前激活的类型(产线/产品)
|
// 1. 确定当前激活的类型(产线/产品)
|
||||||
const isProductLine = val === '按产线监控';
|
const isProductLine = val === '按产线监控';
|
||||||
this.activeName = isProductLine ? 'productLine' : 'product';
|
this.activeName = isProductLine ? 'productLine' : 'product';
|
||||||
console.log('isProductLine', isProductLine);
|
|
||||||
|
|
||||||
// 2. 提取公共重置逻辑(无论切换到哪个标签,都需要执行的操作)
|
// 2. 提取公共重置逻辑(无论切换到哪个标签,都需要执行的操作)
|
||||||
const resetCommon = () => {
|
const resetCommon = () => {
|
||||||
@@ -661,61 +572,19 @@ export default {
|
|||||||
this.formConfig[1].type = ''; // 隐藏查询类型
|
this.formConfig[1].type = ''; // 隐藏查询类型
|
||||||
this.formConfig[6].type = ''; // 隐藏报表类型
|
this.formConfig[6].type = ''; // 隐藏报表类型
|
||||||
this.formConfig[7].type = ''; // 隐藏时间范围
|
this.formConfig[7].type = ''; // 隐藏时间范围
|
||||||
const timeItemIndex = this.formConfig.findIndex(item =>
|
|
||||||
item.label?.includes('刷新时间')
|
|
||||||
);
|
|
||||||
if (timeItemIndex > -1) {
|
|
||||||
this.formConfig.splice(timeItemIndex, 1);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 3. 执行公共重置
|
// 3. 执行公共重置
|
||||||
resetCommon();
|
resetCommon();
|
||||||
// if (this.activeName === 'productLine') {
|
|
||||||
// } else {
|
|
||||||
// }
|
|
||||||
// 4. 根据类型设置差异化的表单配置(仅处理不同的部分)
|
// 4. 根据类型设置差异化的表单配置(仅处理不同的部分)
|
||||||
if (isProductLine) {
|
if (isProductLine) {
|
||||||
// 按产线监控:显示产线,隐藏产品工艺和类型,时间维度包含上一班
|
// 按产线监控:显示产线,隐藏产品工艺和类型
|
||||||
this.formConfig[0].selectOptions = this.timeTypeOptions.productLine; // 恢复上一班选项
|
|
||||||
this.formConfig[3].type = 'select'; // 显示产线
|
this.formConfig[3].type = 'select'; // 显示产线
|
||||||
this.formConfig[4].type = ''; // 隐藏产品工艺
|
this.formConfig[4].type = ''; // 隐藏产品工艺
|
||||||
this.formConfig[5].type = ''; // 隐藏产品类型
|
this.formConfig[5].type = ''; // 隐藏产品类型
|
||||||
this.listQuery.timeType = 3;
|
|
||||||
if (this.$refs.searchBarForm) {
|
|
||||||
this.$refs.searchBarForm.formInline.timeType = 3;
|
|
||||||
}
|
|
||||||
const timeItemIndex = this.formConfig.findIndex(item =>
|
|
||||||
item.label?.includes('刷新时间')
|
|
||||||
);
|
|
||||||
const timeLabel = {
|
|
||||||
type: 'label',
|
|
||||||
label: `刷新时间: ${this.formatCurrentTime()}`,
|
|
||||||
};
|
|
||||||
if (timeItemIndex > -1) {
|
|
||||||
this.formConfig.splice(timeItemIndex, 1, timeLabel);
|
|
||||||
} else {
|
} else {
|
||||||
this.formConfig.push(timeLabel);
|
// 按产品监控:显示产品工艺和类型,隐藏产线
|
||||||
}
|
|
||||||
// 主动调用上一班数据接口
|
|
||||||
this.getLastDayDataList();
|
|
||||||
|
|
||||||
} else {
|
|
||||||
this.getProductList();
|
|
||||||
const timeItemIndex = this.formConfig.findIndex(item =>
|
|
||||||
item.label?.includes('刷新时间')
|
|
||||||
);
|
|
||||||
const timeLabel = {
|
|
||||||
type: 'label',
|
|
||||||
label: `刷新时间: ${this.formatCurrentTime()}`,
|
|
||||||
};
|
|
||||||
if (timeItemIndex > -1) {
|
|
||||||
this.formConfig.splice(timeItemIndex, 1, timeLabel);
|
|
||||||
} else {
|
|
||||||
this.formConfig.push(timeLabel);
|
|
||||||
}
|
|
||||||
// 按产品监控:显示产品工艺和类型,隐藏产线,时间维度移除上一班
|
|
||||||
this.formConfig[0].selectOptions = this.timeTypeOptions.product; // 不含上一班
|
|
||||||
this.formConfig[3].type = ''; // 隐藏产线
|
this.formConfig[3].type = ''; // 隐藏产线
|
||||||
this.formConfig[4].type = 'select'; // 显示产品工艺
|
this.formConfig[4].type = 'select'; // 显示产品工艺
|
||||||
this.formConfig[5].type = 'select'; // 显示产品类型
|
this.formConfig[5].type = 'select'; // 显示产品类型
|
||||||
@@ -727,52 +596,48 @@ export default {
|
|||||||
// 按产线监控
|
// 按产线监控
|
||||||
if (this.activeName === 'productLine') {
|
if (this.activeName === 'productLine') {
|
||||||
if (this.listQuery.timeType === 1) {
|
if (this.listQuery.timeType === 1) {
|
||||||
// 产线-当天:导出当班 + 当天两个表格(自定义汇总文件名)
|
// 产线-当天:导出当班 + 当天两个表格
|
||||||
this.exportMultipleTables([
|
this.exportMultipleTables([
|
||||||
{ ref: 'lineCurrentShiftTable', name: '产线监控_当班数据' },
|
{ ref: 'lineCurrentShiftTable', name: '产线监控_当班数据' },
|
||||||
{ ref: 'lineTodayTable', name: '产线监控_当天数据' }
|
{ ref: 'lineTodayTable', name: '产线监控_当天数据' }
|
||||||
], '产线监控_当班及当天数据汇总'); // 传入自定义汇总文件名
|
]);
|
||||||
} else if (this.listQuery.timeType === 1) {
|
|
||||||
// 产线-当天:导出当班 + 当天两个表格(自定义汇总文件名)
|
|
||||||
this.exportMultipleTables([
|
|
||||||
{ ref: 'lineCurrentShiftTable', name: '产线监控_上一班数据' },
|
|
||||||
{ ref: 'lineTodayTable', name: '产线监控_当天数据' }
|
|
||||||
], '产线监控_当班及当天数据汇总'); // 传入自定义汇总文件名
|
|
||||||
} else {
|
} else {
|
||||||
// 产线-自定义:导出一个表格(自定义文件名)
|
// 产线-自定义:导出一个表格
|
||||||
this.exportSingleTable('lineCustomTable', '产线监控_自定义时间数据');
|
this.exportSingleTable('lineCustomTable', '产线监控_自定义时间数据');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 按产品监控
|
// 按产品监控
|
||||||
else {
|
else {
|
||||||
if (this.listQuery.timeType === 1) {
|
if (this.listQuery.timeType === 1) {
|
||||||
// 产品-当天:导出当班 + 当天两个表格(自定义汇总文件名)
|
// 产品-当天:导出当班 + 当天两个表格
|
||||||
this.exportMultipleTables([
|
this.exportMultipleTables([
|
||||||
{ ref: 'productCurrentShiftTable', name: '产品监控_当班数据' },
|
{ ref: 'productCurrentShiftTable', name: '产品监控_当班数据' },
|
||||||
{ ref: 'productTodayTable', name: '产品监控_当天数据' }
|
{ ref: 'productTodayTable', name: '产品监控_当天数据' }
|
||||||
], '产品监控_当班及当天数据汇总'); // 传入自定义汇总文件名
|
]);
|
||||||
} else {
|
} else {
|
||||||
// 产品-自定义:导出一个表格(自定义文件名)
|
// 产品-自定义:导出一个表格
|
||||||
this.exportSingleTable('productCustomTable', '产品监控_自定义时间数据');
|
this.exportSingleTable('productCustomTable', '产品监控_自定义时间数据');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 导出单个表格(保持原有逻辑,文件名由调用方传入,已区分不同场景)
|
// 导出单个表格
|
||||||
exportSingleTable(refName, fileName) {
|
exportSingleTable(refName, fileName) {
|
||||||
const table = this.getTableDom(refName);
|
const table = this.getTableDom(refName);
|
||||||
if (!table) return;
|
if (!table) return;
|
||||||
|
|
||||||
|
// 克隆表格并移除固定列
|
||||||
const clonedTable = table.cloneNode(true);
|
const clonedTable = table.cloneNode(true);
|
||||||
this.adjustTableForExport(clonedTable);
|
this.removeFixedColumns(clonedTable);
|
||||||
|
|
||||||
|
// 转换为工作簿并导出
|
||||||
const workbook = XLSX.utils.table_to_book(clonedTable);
|
const workbook = XLSX.utils.table_to_book(clonedTable);
|
||||||
const fullName = `${fileName}_${this.formatDate()}.xlsx`;
|
const fullName = `${fileName}_${this.formatDate()}.xlsx`;
|
||||||
XLSX.writeFile(workbook, fullName);
|
XLSX.writeFile(workbook, fullName);
|
||||||
},
|
},
|
||||||
|
|
||||||
// 导出多个表格(新增自定义汇总文件名参数,适配不同选项卡)
|
// 导出多个表格(同一个Excel的不同sheet)
|
||||||
exportMultipleTables(tables, customSummaryName) {
|
exportMultipleTables(tables) {
|
||||||
const workbook = XLSX.utils.book_new();
|
const workbook = XLSX.utils.book_new();
|
||||||
let hasValidTable = false;
|
let hasValidTable = false;
|
||||||
|
|
||||||
@@ -781,9 +646,11 @@ export default {
|
|||||||
if (!table) return;
|
if (!table) return;
|
||||||
|
|
||||||
hasValidTable = true;
|
hasValidTable = true;
|
||||||
|
// 克隆表格并移除固定列
|
||||||
const clonedTable = table.cloneNode(true);
|
const clonedTable = table.cloneNode(true);
|
||||||
this.adjustTableForExport(clonedTable);
|
this.removeFixedColumns(clonedTable);
|
||||||
|
|
||||||
|
// 转换为sheet并添加到工作簿
|
||||||
const worksheet = XLSX.utils.table_to_sheet(clonedTable);
|
const worksheet = XLSX.utils.table_to_sheet(clonedTable);
|
||||||
XLSX.utils.book_append_sheet(workbook, worksheet, name);
|
XLSX.utils.book_append_sheet(workbook, worksheet, name);
|
||||||
});
|
});
|
||||||
@@ -793,128 +660,31 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 动态生成汇总文件名:自定义名称 + 日期
|
// 导出包含多个sheet的Excel
|
||||||
const fullName = `${customSummaryName}_${this.formatDate()}.xlsx`;
|
const fullName = `生产监控数据汇总_${this.formatDate()}.xlsx`;
|
||||||
XLSX.writeFile(workbook, fullName);
|
XLSX.writeFile(workbook, fullName);
|
||||||
},
|
},
|
||||||
// 辅助方法:获取表格DOM元素(包含表头)
|
|
||||||
|
// 辅助方法:获取表格DOM元素
|
||||||
getTableDom(refName) {
|
getTableDom(refName) {
|
||||||
const tableComponent = this.$refs[refName];
|
const tableComponent = this.$refs[refName];
|
||||||
if (!tableComponent) {
|
if (!tableComponent) {
|
||||||
this.$message.warning(`未找到${refName}表格`);
|
this.$message.warning(`未找到${refName}表格`);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
// 获取完整表格容器(包含表头和表体)
|
// 获取表格组件内部的el-table DOM
|
||||||
const tableContainer = tableComponent.$el.querySelector('.el-table');
|
const tableDom = tableComponent.$el.querySelector('.el-table__body-wrapper table');
|
||||||
if (!tableContainer) {
|
if (!tableDom) {
|
||||||
this.$message.warning(`${refName}表格数据为空`);
|
this.$message.warning(`${refName}表格数据为空`);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return tableContainer;
|
return tableDom;
|
||||||
},
|
},
|
||||||
|
|
||||||
// 重点修复:调整表格结构(解决表头重复问题)
|
// 辅助方法:移除固定列(避免重复导出)
|
||||||
adjustTableForExport(tableContainer) {
|
removeFixedColumns(table) {
|
||||||
// 1. 移除空表格提示和分页等无关元素
|
const fixedColumns = table.querySelectorAll('.el-table__fixed, .el-table__fixed-right');
|
||||||
const emptyCells = tableContainer.querySelectorAll('.el-table__empty-block, .el-pagination');
|
fixedColumns.forEach(col => col.remove());
|
||||||
emptyCells.forEach(cell => cell.remove());
|
|
||||||
|
|
||||||
// 2. 定位核心元素
|
|
||||||
const mainTable = tableContainer.querySelector('.el-table__body-wrapper table'); // 主表体
|
|
||||||
const fixedLeft = tableContainer.querySelector('.el-table__fixed'); // 左固定列容器
|
|
||||||
const fixedRight = tableContainer.querySelector('.el-table__fixed-right'); // 右固定列容器
|
|
||||||
|
|
||||||
// 3. 提取所有表头行(支持多级表头,按层级收集)
|
|
||||||
const allHeaderRows = []; // 存储所有层级的表头行(每行是一个单元格数组)
|
|
||||||
|
|
||||||
// 辅助函数:提取某个容器内的所有表头行(处理多级表头)
|
|
||||||
const extractHeaderRows = (container) => {
|
|
||||||
const headerWrapper = container?.querySelector('.el-table__header-wrapper table');
|
|
||||||
if (!headerWrapper) return [];
|
|
||||||
const thead = headerWrapper.querySelector('thead');
|
|
||||||
if (!thead) return [];
|
|
||||||
// 多级表头可能有多个tr(行)
|
|
||||||
const headerRows = Array.from(thead.querySelectorAll('tr'));
|
|
||||||
return headerRows.map(row => Array.from(row.querySelectorAll('th'))); // 每行的单元格数组
|
|
||||||
};
|
|
||||||
|
|
||||||
// 收集左固定列的表头行(可能有多层)
|
|
||||||
const fixedLeftHeaderRows = extractHeaderRows(fixedLeft);
|
|
||||||
// 收集主表头的表头行(可能有多层)
|
|
||||||
const mainHeaderRows = extractHeaderRows(tableContainer);
|
|
||||||
// 收集右固定列的表头行(可能有多层)
|
|
||||||
const fixedRightHeaderRows = extractHeaderRows(fixedRight);
|
|
||||||
|
|
||||||
// 4. 合并表头行(按层级对齐,左固定列 → 主表头 → 右固定列)
|
|
||||||
// 确定最大表头层级(多级表头的行数)
|
|
||||||
const maxLevel = Math.max(
|
|
||||||
fixedLeftHeaderRows.length,
|
|
||||||
mainHeaderRows.length,
|
|
||||||
fixedRightHeaderRows.length
|
|
||||||
);
|
|
||||||
|
|
||||||
// 按层级合并每行的单元格
|
|
||||||
for (let i = 0; i < maxLevel; i++) {
|
|
||||||
const rowCells = [];
|
|
||||||
// 左固定列当前层级的单元格(不足则补空)
|
|
||||||
rowCells.push(...(fixedLeftHeaderRows[i] || []));
|
|
||||||
// 主表头当前层级的单元格(不足则补空)
|
|
||||||
rowCells.push(...(mainHeaderRows[i] || []));
|
|
||||||
// 右固定列当前层级的单元格(不足则补空)
|
|
||||||
rowCells.push(...(fixedRightHeaderRows[i] || []));
|
|
||||||
allHeaderRows.push(rowCells);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 5. 清理所有原有表头和固定列容器(避免干扰)
|
|
||||||
tableContainer.querySelectorAll('thead').forEach(thead => thead.remove());
|
|
||||||
tableContainer.querySelectorAll('.el-table__header-wrapper').forEach(wrapper => wrapper.remove());
|
|
||||||
[fixedLeft, fixedRight].forEach(container => container?.remove());
|
|
||||||
|
|
||||||
// 6. 构建唯一表头并添加到主表体(支持多级表头)
|
|
||||||
if (mainTable && allHeaderRows.length > 0) {
|
|
||||||
const newThead = document.createElement('thead');
|
|
||||||
// 按层级添加表头行
|
|
||||||
allHeaderRows.forEach(cells => {
|
|
||||||
const newTr = document.createElement('tr');
|
|
||||||
cells.forEach(cell => {
|
|
||||||
// 复制单元格(避免DOM残留引用问题)
|
|
||||||
const clonedCell = cell.cloneNode(true);
|
|
||||||
newTr.appendChild(clonedCell);
|
|
||||||
});
|
|
||||||
newThead.appendChild(newTr);
|
|
||||||
});
|
|
||||||
// 将新表头插入主表体最前面
|
|
||||||
mainTable.insertBefore(newThead, mainTable.firstChild);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 7. 合并固定列数据到主表体(仅处理tbody数据)
|
|
||||||
// 合并左固定列数据
|
|
||||||
if (fixedLeft && mainTable) {
|
|
||||||
const fixedLeftRows = fixedLeft.querySelectorAll('.el-table__body-wrapper tbody tr');
|
|
||||||
const mainRows = mainTable.querySelectorAll('tbody tr');
|
|
||||||
fixedLeftRows.forEach((fixedRow, index) => {
|
|
||||||
if (mainRows[index]) {
|
|
||||||
const fixedCells = Array.from(fixedRow.querySelectorAll('td'));
|
|
||||||
fixedCells.forEach(cell => {
|
|
||||||
mainRows[index].insertBefore(cell.cloneNode(true), mainRows[index].firstChild);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 合并右固定列数据
|
|
||||||
if (fixedRight && mainTable) {
|
|
||||||
const fixedRightRows = fixedRight.querySelectorAll('.el-table__body-wrapper tbody tr');
|
|
||||||
const mainRows = mainTable.querySelectorAll('tbody tr');
|
|
||||||
fixedRightRows.forEach((fixedRow, index) => {
|
|
||||||
if (mainRows[index]) {
|
|
||||||
const fixedCells = Array.from(fixedRow.querySelectorAll('td'));
|
|
||||||
fixedCells.forEach(cell => {
|
|
||||||
mainRows[index].appendChild(cell.cloneNode(true));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 辅助方法:格式化日期(用于文件名)
|
// 辅助方法:格式化日期(用于文件名)
|
||||||
@@ -928,6 +698,7 @@ export default {
|
|||||||
String(date.getMinutes()).padStart(2, '0')
|
String(date.getMinutes()).padStart(2, '0')
|
||||||
].join('');
|
].join('');
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取产线和工厂列表
|
// 获取产线和工厂列表
|
||||||
getPdLineList() {
|
getPdLineList() {
|
||||||
getPdList().then(res => {
|
getPdList().then(res => {
|
||||||
@@ -941,105 +712,28 @@ export default {
|
|||||||
|
|
||||||
// 搜索/导出按钮点击
|
// 搜索/导出按钮点击
|
||||||
buttonClick(val) {
|
buttonClick(val) {
|
||||||
this.headFormValue = val
|
|
||||||
if (this.activeName === 'productLine') {
|
|
||||||
this.listQuery.pageNo = 1;
|
|
||||||
this.listQuery.pageSize = 10;
|
|
||||||
this.listQuery.factoryId = this.headFormValue.factoryId || undefined;
|
|
||||||
this.listQuery.process = this.headFormValue.process ? this.headFormValue.process : [];
|
|
||||||
this.listQuery.lineId = this.headFormValue.lineId ? this.headFormValue.lineId : [];
|
|
||||||
this.listQuery.processType = this.headFormValue.processType ? this.headFormValue.processType : [];
|
|
||||||
this.listQuery.reportType = this.headFormValue.reportType || undefined;
|
|
||||||
this.listQuery.timeType = this.headFormValue.timeType || undefined;
|
|
||||||
this.listQuery.searchType = this.headFormValue.searchType || undefined;
|
|
||||||
|
|
||||||
// 处理不同时间选择类型
|
|
||||||
if (this.headFormValue.timeVal) {
|
|
||||||
this.listQuery.startTime = this.headFormValue.timeVal[0];
|
|
||||||
this.listQuery.endTime = this.headFormValue.timeVal[1];
|
|
||||||
} else if (this.headFormValue.timeValWeek) {
|
|
||||||
// 周选择器
|
|
||||||
const { startTime, endTime } = this.getWeekTimeRange(this.headFormValue.timeValWeek);
|
|
||||||
this.listQuery.startTime = startTime;
|
|
||||||
this.listQuery.endTime = endTime;
|
|
||||||
} else if (this.headFormValue.timeValMonth) {
|
|
||||||
// 月选择器
|
|
||||||
this.listQuery.startTime = this.headFormValue.timeValMonth[0];
|
|
||||||
this.listQuery.endTime = this.headFormValue.timeValMonth[1];
|
|
||||||
} else if (this.headFormValue.timeValYear) {
|
|
||||||
// 年选择器
|
|
||||||
const { startTime, endTime } = this.getYearTimeRange(this.headFormValue.timeValYear);
|
|
||||||
this.listQuery.startTime = startTime;
|
|
||||||
this.listQuery.endTime = endTime;
|
|
||||||
} else {
|
|
||||||
this.listQuery.startTime = undefined;
|
|
||||||
this.listQuery.endTime = undefined;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.listQuery.pageNo = 1;
|
|
||||||
this.listQuery.pageSize = 10;
|
|
||||||
this.listQuery.factoryId = this.headFormValue.factoryId || []
|
|
||||||
this.listQuery.process = this.headFormValue.process ? this.headFormValue.process : [];
|
|
||||||
this.listQuery.lineId = undefined;
|
|
||||||
this.listQuery.processType = this.headFormValue.processType ? this.headFormValue.processType : [];
|
|
||||||
this.listQuery.reportType = this.headFormValue.reportType || undefined;
|
|
||||||
this.listQuery.timeType = this.headFormValue.timeType || undefined;
|
|
||||||
this.listQuery.searchType = this.headFormValue.searchType || undefined;
|
|
||||||
|
|
||||||
// 处理不同时间选择类型
|
|
||||||
if (this.headFormValue.timeVal) {
|
|
||||||
this.listQuery.startTime = this.headFormValue.timeVal[0];
|
|
||||||
this.listQuery.endTime = this.headFormValue.timeVal[1];
|
|
||||||
} else if (this.headFormValue.timeValWeek) {
|
|
||||||
// 周选择器
|
|
||||||
const { startTime, endTime } = this.getWeekTimeRange(this.headFormValue.timeValWeek);
|
|
||||||
this.listQuery.startTime = startTime;
|
|
||||||
this.listQuery.endTime = endTime;
|
|
||||||
} else if (this.headFormValue.timeValMonth) {
|
|
||||||
// 月选择器
|
|
||||||
this.listQuery.startTime = this.headFormValue.timeValMonth[0];
|
|
||||||
this.listQuery.endTime = this.headFormValue.timeValMonth[1];
|
|
||||||
} else if (this.headFormValue.timeValYear) {
|
|
||||||
// 年选择器
|
|
||||||
const { startTime, endTime } = this.getYearTimeRange(this.headFormValue.timeValYear);
|
|
||||||
this.listQuery.startTime = startTime;
|
|
||||||
this.listQuery.endTime = endTime;
|
|
||||||
} else {
|
|
||||||
this.listQuery.startTime = undefined;
|
|
||||||
this.listQuery.endTime = undefined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
const timeItemIndex = this.formConfig.findIndex(item =>
|
this.listQuery.pageNo = 1;
|
||||||
item.label?.includes('刷新时间')
|
this.listQuery.pageSize = 10;
|
||||||
);
|
this.listQuery.factoryId = val.factoryId || undefined;
|
||||||
|
this.listQuery.process = val.process ? val.process : [];
|
||||||
// 仅当时间维度为【当天】时,添加/更新刷新时间
|
this.listQuery.lineId = val.lineId ? val.lineId : [];
|
||||||
if (this.listQuery.timeType === 1 || this.listQuery.timeType === 3) {
|
this.listQuery.processType = val.processType ? val.processType : [];
|
||||||
const timeLabel = {
|
this.listQuery.reportType = val.reportType || undefined;
|
||||||
type: 'label',
|
this.listQuery.timeType = val.timeType || undefined;
|
||||||
label: `刷新时间: ${this.formatCurrentTime()}`,
|
this.listQuery.searchType = val.searchType || undefined;
|
||||||
};
|
this.listQuery.startTime = val.timeVal ? val.timeVal[0] : undefined;
|
||||||
if (timeItemIndex > -1) {
|
this.listQuery.endTime = val.timeVal ? val.timeVal[1] : undefined;
|
||||||
this.formConfig.splice(timeItemIndex, 1, timeLabel);
|
|
||||||
} else {
|
|
||||||
this.formConfig.push(timeLabel);
|
|
||||||
}
|
|
||||||
} else if (timeItemIndex > -1) {
|
|
||||||
// 非当天时,移除刷新时间
|
|
||||||
this.formConfig.splice(timeItemIndex, 1);
|
|
||||||
}
|
|
||||||
if (this.activeName === 'productLine') {
|
if (this.activeName === 'productLine') {
|
||||||
if (this.listQuery.timeType === 1) {
|
if (this.listQuery.timeType === 1) {
|
||||||
this.getDayDataList();
|
this.getDayDataList();
|
||||||
} else if (this.listQuery.timeType === 3) {
|
|
||||||
this.getLastDayDataList();
|
|
||||||
} else {
|
} else {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.getProductList();
|
this.getProductList();
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'export':
|
case 'export':
|
||||||
@@ -1048,32 +742,20 @@ export default {
|
|||||||
case 'reset':
|
case 'reset':
|
||||||
this.$refs.searchBarForm.resetForm();
|
this.$refs.searchBarForm.resetForm();
|
||||||
this.$refs.searchBarForm.formInline.timeType = 1;
|
this.$refs.searchBarForm.formInline.timeType = 1;
|
||||||
this.formConfig[0].selectOptions = this.activeName === 'product'
|
|
||||||
? this.timeTypeOptions.productLine
|
|
||||||
: this.timeTypeOptions.product;
|
|
||||||
this.listQuery = {
|
this.listQuery = {
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
total: 0,
|
total: 0,
|
||||||
timeType: this.activeName === 'productLine' ? 3 : 1,
|
timeType: 1,
|
||||||
};
|
};
|
||||||
const resetTimeIndex = this.formConfig.findIndex(item =>
|
|
||||||
item.label?.includes('刷新时间')
|
|
||||||
);
|
|
||||||
const resetTimeLabel = {
|
|
||||||
type: 'label',
|
|
||||||
label: `刷新时间: ${this.formatCurrentTime()}`,
|
|
||||||
};
|
|
||||||
if (resetTimeIndex > -1) {
|
|
||||||
this.formConfig.splice(resetTimeIndex, 1, resetTimeLabel);
|
|
||||||
} else {
|
|
||||||
this.formConfig.push(resetTimeLabel);
|
|
||||||
}
|
|
||||||
if (this.activeName === 'productLine') {
|
if (this.activeName === 'productLine') {
|
||||||
this.getDayDataList();
|
this.getDayDataList();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.getProductList();
|
this.getProductList();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
console.log(val);
|
console.log(val);
|
||||||
@@ -1081,7 +763,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
getDataList() {
|
getDataList() {
|
||||||
if (!this.listQuery.startTime && !this.listQuery.endTime) {
|
if(!this.listQuery.startTime &&!this.listQuery.endTime ){
|
||||||
return this.$modal.msgError('请选择时间');
|
return this.$modal.msgError('请选择时间');
|
||||||
}
|
}
|
||||||
this.dataListLoading = true;
|
this.dataListLoading = true;
|
||||||
@@ -1113,18 +795,10 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async getProductList() {
|
async getProductList() {
|
||||||
this.listQuery.pageNo = 1;
|
console.log('resGroup');
|
||||||
this.listQuery.pageSize = 10;
|
|
||||||
this.listQuery.factoryId = this.headFormValue.factoryId || []
|
|
||||||
this.listQuery.process = this.headFormValue.process ? this.headFormValue.process : [];
|
|
||||||
this.listQuery.lineId = undefined;
|
|
||||||
this.listQuery.processType = this.headFormValue.processType ? this.headFormValue.processType : [];
|
|
||||||
this.listQuery.reportType = this.headFormValue.reportType || undefined;
|
|
||||||
this.listQuery.timeType = this.headFormValue.timeType || undefined;
|
|
||||||
this.listQuery.searchType = this.headFormValue.searchType || undefined
|
|
||||||
if (this.listQuery.timeType === 2) {
|
if (this.listQuery.timeType === 2) {
|
||||||
const resGroup = await getProcessAutoReportNew(this.listQuery);
|
const resGroup = await getProcessAutoReportNew(this.listQuery);
|
||||||
console.log('resGroup', resGroup);
|
console.log('resGroup',resGroup);
|
||||||
|
|
||||||
// 格式化数据:lineDetList提取到外层,键名加lineId前缀
|
// 格式化数据:lineDetList提取到外层,键名加lineId前缀
|
||||||
const formatData = (rawList) => {
|
const formatData = (rawList) => {
|
||||||
@@ -1153,7 +827,7 @@ export default {
|
|||||||
|
|
||||||
// 处理当班和当天数据(分别存储)
|
// 处理当班和当天数据(分别存储)
|
||||||
this.productTableData = formatData(resGroup.data.list); // 当班数据
|
this.productTableData = formatData(resGroup.data.list); // 当班数据
|
||||||
console.log(this.productTableData, 'productTableData');
|
console.log(this.productTableData,'productTableData');
|
||||||
|
|
||||||
// --------------------------
|
// --------------------------
|
||||||
// 生成当班数据的动态表头
|
// 生成当班数据的动态表头
|
||||||
@@ -1331,28 +1005,6 @@ export default {
|
|||||||
return [...lineColumns, totalColumn];
|
return [...lineColumns, totalColumn];
|
||||||
},
|
},
|
||||||
// 为当天时调用的接口
|
// 为当天时调用的接口
|
||||||
getLastDayDataList() {
|
|
||||||
getPdlAutoReportNewSearchLastGroup().then((response) => {
|
|
||||||
this.tableData = response.data.classData.map((item, index) => {
|
|
||||||
item.originalLossNum = item.original?.lossNum;
|
|
||||||
item.originalLossArea = item.original?.lossArea;
|
|
||||||
item.edgeLossNum = item.edge?.lossNum;
|
|
||||||
item.edgeLossArea = item.edge?.lossArea;
|
|
||||||
item.drillLossNum = item.drill?.lossNum;
|
|
||||||
item.drillLossArea = item.drill?.lossArea;
|
|
||||||
item.coatingLossNum = item.coating?.lossNum;
|
|
||||||
item.coatingLossArea = item.coating?.lossArea;
|
|
||||||
item.silkLossNum = item.silk?.lossNum;
|
|
||||||
item.silkLossArea = item.silk?.lossArea;
|
|
||||||
item.temperingLossNum = item.tempering?.lossNum;
|
|
||||||
item.temperingLossArea = item.tempering?.lossArea;
|
|
||||||
item.packingLossNum = item.packing?.lossNum;
|
|
||||||
item.packingLossArea = item.packing?.lossArea;
|
|
||||||
return item;
|
|
||||||
});
|
|
||||||
// console.log(this.tableData, this.tableData2);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
getDayDataList() {
|
getDayDataList() {
|
||||||
getPdlAutoReportNewSearchNow().then((response) => {
|
getPdlAutoReportNewSearchNow().then((response) => {
|
||||||
this.tableData = response.data.classData.map((item, index) => {
|
this.tableData = response.data.classData.map((item, index) => {
|
||||||
@@ -1408,35 +1060,28 @@ export default {
|
|||||||
|
|
||||||
// 搜索栏下拉选择变化
|
// 搜索栏下拉选择变化
|
||||||
handleSearchBarChanged({ param, value }) {
|
handleSearchBarChanged({ param, value }) {
|
||||||
console.log(value, param);
|
|
||||||
if (param === 'timeType') {
|
if (param === 'timeType') {
|
||||||
|
console.log(value);
|
||||||
|
|
||||||
this.listQuery.timeType = value;
|
this.listQuery.timeType = value;
|
||||||
const timeItemIndex = this.formConfig.findIndex(item =>
|
if (value === 1) {
|
||||||
item.label?.includes('刷新时间')
|
// 切换为“当天”:隐藏查询类型、报表类型、时间范围
|
||||||
);
|
this.formConfig[1].type = '';
|
||||||
|
this.formConfig[6].type = '';
|
||||||
// 仅移除,不添加(查询时才添加)
|
this.formConfig[7].type = '';
|
||||||
if (value !== 1 && value !== 3 && timeItemIndex > -1) {
|
|
||||||
this.formConfig.splice(timeItemIndex, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$refs.searchBarForm.formInline.timeType = value;
|
this.$refs.searchBarForm.formInline.timeType = value;
|
||||||
|
this.listQuery.timeType = value;
|
||||||
|
|
||||||
this.$refs.searchBarForm.formInline.searchType = undefined;
|
this.$refs.searchBarForm.formInline.searchType = undefined;
|
||||||
this.$refs.searchBarForm.formInline.reportType = undefined;
|
this.$refs.searchBarForm.formInline.reportType = undefined;
|
||||||
this.$refs.searchBarForm.formInline.timeVal = undefined;
|
this.$refs.searchBarForm.formInline.timeVal = undefined;
|
||||||
|
|
||||||
if (value === 1) {
|
|
||||||
this.formConfig[1].type = '';
|
|
||||||
this.formConfig[6].type = '';
|
|
||||||
this.formConfig[7].type = '';
|
|
||||||
} else if (value === 2) {
|
|
||||||
this.formConfig[1].type = 'select';
|
|
||||||
this.$refs.searchBarForm.formInline.searchType = 1;
|
|
||||||
this.formConfig[7].type = 'datePicker';
|
|
||||||
} else {
|
} else {
|
||||||
this.formConfig[1].type = '';
|
// 切换为“自定义”:显示查询类型和时间范围
|
||||||
this.formConfig[6].type = '';
|
this.formConfig[1].type = 'select';
|
||||||
this.formConfig[7].type = '';
|
this.$refs.searchBarForm.formInline.timeType = value;
|
||||||
|
this.listQuery.timeType = value;
|
||||||
|
|
||||||
|
this.formConfig[7].type = 'datePicker';
|
||||||
}
|
}
|
||||||
} else if (param === 'searchType') {
|
} else if (param === 'searchType') {
|
||||||
if (value === 1) {
|
if (value === 1) {
|
||||||
@@ -1450,77 +1095,7 @@ export default {
|
|||||||
this.formConfig[7].type = 'datePicker';
|
this.formConfig[7].type = 'datePicker';
|
||||||
}
|
}
|
||||||
} else if (param === 'reportType') {
|
} else if (param === 'reportType') {
|
||||||
if (this.$refs.searchBarForm && this.$refs.searchBarForm.formInline) {
|
this.$refs.searchBarForm.formInline.timeVal = undefined;
|
||||||
const formInline = this.$refs.searchBarForm.formInline;
|
|
||||||
// 精准判断:只有字段存在时,才置为undefined(不存在则不处理)
|
|
||||||
if ('timeVal' in formInline) {
|
|
||||||
formInline.timeVal = undefined;
|
|
||||||
}
|
|
||||||
if ('timeValWeek' in formInline) {
|
|
||||||
formInline.timeValWeek = undefined;
|
|
||||||
}
|
|
||||||
if ('timeValMonth' in formInline) {
|
|
||||||
formInline.timeValMonth = undefined;
|
|
||||||
}
|
|
||||||
if ('timeValYear' in formInline) {
|
|
||||||
formInline.timeValYear = undefined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.listQuery.startTime = undefined;
|
|
||||||
this.listQuery.endTime = undefined;
|
|
||||||
if (value === 1) {
|
|
||||||
this.formConfig[7] = {
|
|
||||||
type: 'datePicker',
|
|
||||||
label: '时间范围',
|
|
||||||
dateType: 'datetimerange',
|
|
||||||
format: 'yyyy-MM-dd HH:mm:ss',
|
|
||||||
valueFormat: 'timestamp',
|
|
||||||
rangeSeparator: '-',
|
|
||||||
startPlaceholder: '开始时间',
|
|
||||||
endPlaceholder: '结束时间',
|
|
||||||
param: 'timeVal',
|
|
||||||
width: 350
|
|
||||||
};
|
|
||||||
} else if (value === 2) {
|
|
||||||
this.formConfig[7] = {
|
|
||||||
type: 'datePicker',
|
|
||||||
label: '时间范围',
|
|
||||||
dateType: 'week',
|
|
||||||
placeholder: '选择日期',
|
|
||||||
format: 'yyyy 第 WW 周',
|
|
||||||
pickerOptions: {
|
|
||||||
firstDayOfWeek: 1 // 数字1表示周一作为周的第一天(0=周日,1=周一,依此类推)
|
|
||||||
},
|
|
||||||
valueFormat: 'yyyy-MM-dd',
|
|
||||||
param: 'timeValWeek',
|
|
||||||
width: 250,
|
|
||||||
};
|
|
||||||
} else if (value === 3) {
|
|
||||||
this.formConfig[7] = {
|
|
||||||
type: 'datePicker',
|
|
||||||
label: '时间范围',
|
|
||||||
dateType: 'monthrange',
|
|
||||||
format: 'yyyy-MM-dd',
|
|
||||||
valueFormat: 'timestamp',
|
|
||||||
rangeSeparator: '-',
|
|
||||||
startPlaceholder: '开始时间',
|
|
||||||
endPlaceholder: '结束时间',
|
|
||||||
param: 'timeValMonth',
|
|
||||||
defaultTime: ['00:00:00', '23:59:59'],
|
|
||||||
width: 250,
|
|
||||||
};
|
|
||||||
} else if (value === 4) {
|
|
||||||
this.formConfig[7] = {
|
|
||||||
type: 'datePicker',
|
|
||||||
label: '时间范围',
|
|
||||||
dateType: 'year',
|
|
||||||
placeholder: '选择年份',
|
|
||||||
format: 'yyyy',
|
|
||||||
valueFormat: 'timestamp',
|
|
||||||
param: 'timeValYear',
|
|
||||||
width: 250,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
} else if (param === 'factoryId') {
|
} else if (param === 'factoryId') {
|
||||||
// 切换工厂时刷新产线列表
|
// 切换工厂时刷新产线列表
|
||||||
this.listQuery.lineId = [];
|
this.listQuery.lineId = [];
|
||||||
@@ -1567,7 +1142,7 @@ export default {
|
|||||||
.content-wrapper {
|
.content-wrapper {
|
||||||
// flex: 1;
|
// flex: 1;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: calc(100vh - 280px);
|
height: calc(100vh - 303px);
|
||||||
// overflow: hidden;
|
// overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,14 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: Do not edit
|
||||||
|
* @Date: 2023-08-29 14:59:29
|
||||||
|
* @LastEditTime: 2024-12-02 13:44:47
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<!-- :isFold="true" 控制展开 -->
|
<!-- :isFold="true" 控制展开 -->
|
||||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick"
|
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||||
@select-changed="selectType" />
|
|
||||||
<base-table v-if="tableData.length" class="right-aside" v-loading="dataListLoading" :table-props="tableProps"
|
<base-table v-if="tableData.length" class="right-aside" v-loading="dataListLoading" :table-props="tableProps"
|
||||||
:page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="tableData">
|
:page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="tableData">
|
||||||
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
|
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
|
||||||
@@ -11,47 +17,34 @@
|
|||||||
<div v-else class="no-data-bg"></div>
|
<div v-else class="no-data-bg"></div>
|
||||||
<pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
|
<pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
|
||||||
@pagination="getDataList" />
|
@pagination="getDataList" />
|
||||||
|
<!-- <el-dialog
|
||||||
|
title="提示"
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
width="30%"
|
||||||
|
:before-close="handleClose">
|
||||||
|
<el-button type="primary" @click="exportXlsx">xlsx</el-button>
|
||||||
|
<el-button type="success" @click="exportPdf">pdf</el-button>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog> -->
|
||||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" />
|
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Vue from 'vue';
|
|
||||||
import AddOrUpdate from './add-or-updata';
|
import AddOrUpdate from './add-or-updata';
|
||||||
|
|
||||||
import { parseTime } from '../../mixins/code-filter';
|
import { parseTime } from '../../mixins/code-filter';
|
||||||
import { getCostOriginRadioHisData, getPdList } from '@/api/core/monitoring/index';
|
import { getCostOriginRadioHisData, getPdList } from '@/api/core/monitoring/index'
|
||||||
|
import * as XLSX from 'xlsx'
|
||||||
|
import FileSaver from 'file-saver'
|
||||||
|
import jsPDF from 'jspdf'
|
||||||
|
import html2canvas from 'html2canvas'
|
||||||
import { exportCostOriginRadioHisData } from '../../../../api/core/monitoring';
|
import { exportCostOriginRadioHisData } from '../../../../api/core/monitoring';
|
||||||
|
|
||||||
// Vue2 中注册全局方法(如果需要)
|
|
||||||
Vue.prototype.$download = Vue.prototype.$download || {
|
|
||||||
excel: (response, fileName) => {
|
|
||||||
const blob = new Blob([response.data], { type: 'application/vnd.ms-excel' });
|
|
||||||
const url = window.URL.createObjectURL(blob);
|
|
||||||
const aLink = document.createElement('a');
|
|
||||||
aLink.style.display = 'none';
|
|
||||||
aLink.href = url;
|
|
||||||
aLink.setAttribute('download', fileName);
|
|
||||||
document.body.appendChild(aLink);
|
|
||||||
aLink.click();
|
|
||||||
document.body.removeChild(aLink);
|
|
||||||
window.URL.revokeObjectURL(url);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Vue.prototype.$modal = Vue.prototype.$modal || {
|
|
||||||
confirm: (message) => {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
if (window.confirm(message)) {
|
|
||||||
resolve();
|
|
||||||
} else {
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
|
|
||||||
{
|
{
|
||||||
prop: 'reportType',
|
prop: 'reportType',
|
||||||
label: '报表类型'
|
label: '报表类型'
|
||||||
@@ -59,6 +52,7 @@ const tableProps = [
|
|||||||
{
|
{
|
||||||
prop: 'time',
|
prop: 'time',
|
||||||
label: '日期',
|
label: '日期',
|
||||||
|
// filter: parseTime,
|
||||||
width: 160
|
width: 160
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -87,72 +81,10 @@ const tableProps = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'ratio',
|
prop: 'ratio',
|
||||||
label: '良品率/%'
|
label: '良品率'
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
|
||||||
* 工具函数:获取选择时间所在周的起始和结束时间(Vue2 兼容)
|
|
||||||
* @param {String|Date} selectTime - 选择的时间(支持格式:yyyy-MM-dd、yyyy-MM-dd HH:mm:ss 或 Date 对象)
|
|
||||||
* @returns {Array} [startDate, endDate] - 所在周周一 00:00:00 至 周日 23:59:59(Date 对象)
|
|
||||||
*/
|
|
||||||
function getSelectedWeekRange(selectTime) {
|
|
||||||
// 兼容 String 类型时间和 Date 对象,统一转为 Date 实例
|
|
||||||
const targetDate = new Date(selectTime);
|
|
||||||
// 处理无效日期(若传入非法时间,返回当前时间的本周范围)
|
|
||||||
// if (isNaN(targetDate.getTime())) {
|
|
||||||
// console.warn('传入的时间格式无效,将使用当前时间计算本周范围');
|
|
||||||
// return getCurrentWeekRange(); // 可根据需求改为抛出错误或返回空
|
|
||||||
// }
|
|
||||||
|
|
||||||
const day = targetDate.getDay() || 7; // 周日为 7(避免周日 -0 天仍为周日)
|
|
||||||
const start = new Date(targetDate);
|
|
||||||
start.setDate(targetDate.getDate() - day + 1); // 计算所在周的周一
|
|
||||||
start.setHours(0, 0, 0, 0); // 重置时分秒为 00:00:00.000
|
|
||||||
|
|
||||||
const end = new Date(start);
|
|
||||||
end.setDate(start.getDate() + 6); // 周一 +6 天 = 周日
|
|
||||||
end.setHours(23, 59, 59, 999); // 重置时分秒为 23:59:59.999
|
|
||||||
|
|
||||||
return [start, end];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 工具函数:获取选择时间所在年的起始和结束时间(Vue2 兼容)
|
|
||||||
* @param {String|Date} selectTime - 选择的时间(支持格式:yyyy-MM-dd、yyyy-MM-dd HH:mm:ss 或 Date 对象)
|
|
||||||
* @returns {Array} [startDate, endDate] - 所在年 1月1日 00:00:00 至 12月31日 23:59:59(Date 对象)
|
|
||||||
*/
|
|
||||||
function getSelectedYearRange(selectTime) {
|
|
||||||
// 兼容 String 类型时间和 Date 对象,统一转为 Date 实例
|
|
||||||
const targetDate = new Date(selectTime);
|
|
||||||
// 处理无效日期(若传入非法时间,返回当前时间的本年范围)
|
|
||||||
// if (isNaN(targetDate.getTime())) {
|
|
||||||
// console.warn('传入的时间格式无效,将使用当前时间计算本年范围');
|
|
||||||
// return getCurrentYearRange(); // 可根据需求改为抛出错误或返回空
|
|
||||||
// }
|
|
||||||
|
|
||||||
const year = targetDate.getFullYear(); // 获取选择时间的年份
|
|
||||||
const start = new Date(year, 0, 1); // 所在年 1月1日(月份从 0 开始)
|
|
||||||
start.setHours(0, 0, 0, 0); // 重置时分秒为 00:00:00.000
|
|
||||||
|
|
||||||
const end = new Date(year, 11, 31); // 所在年 12月31日(11 代表 12 月)
|
|
||||||
end.setHours(23, 59, 59, 999); // 重置时分秒为 23:59:59.999
|
|
||||||
|
|
||||||
return [start, end];
|
|
||||||
}
|
|
||||||
|
|
||||||
// 格式化时间为 yyyy-MM-dd HH:mm:ss(Vue2 兼容)
|
|
||||||
function formatDateTime(date) {
|
|
||||||
const year = date.getFullYear();
|
|
||||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
||||||
const day = String(date.getDate()).padStart(2, '0');
|
|
||||||
const hours = String(date.getHours()).padStart(2, '0');
|
|
||||||
const minutes = String(date.getMinutes()).padStart(2, '0');
|
|
||||||
const seconds = String(date.getSeconds()).padStart(2, '0');
|
|
||||||
|
|
||||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
AddOrUpdate
|
AddOrUpdate
|
||||||
@@ -169,10 +101,8 @@ export default {
|
|||||||
total: 1,
|
total: 1,
|
||||||
bindObjectId: undefined,
|
bindObjectId: undefined,
|
||||||
statisticType: undefined,
|
statisticType: undefined,
|
||||||
startTime: undefined,
|
|
||||||
endTime: undefined
|
|
||||||
},
|
},
|
||||||
pdLineList: [],
|
pdLineList:[],
|
||||||
exportLoading: false,
|
exportLoading: false,
|
||||||
dataListLoading: false,
|
dataListLoading: false,
|
||||||
selectedList: [],
|
selectedList: [],
|
||||||
@@ -185,107 +115,36 @@ export default {
|
|||||||
type: 'edit',
|
type: 'edit',
|
||||||
btnName: '编辑',
|
btnName: '编辑',
|
||||||
},
|
},
|
||||||
].filter(v => v),
|
].filter((v) => v),
|
||||||
|
tableData: [],
|
||||||
fileName: '',
|
fileName: '',
|
||||||
formConfig: [
|
formConfig: [
|
||||||
{
|
{
|
||||||
type: 'select',
|
type: 'select',
|
||||||
label: '报表类型',
|
label: '维度',
|
||||||
onchange: true,
|
|
||||||
selectOptions: [
|
selectOptions: [
|
||||||
{ id: '0', name: '班组' },
|
|
||||||
{ id: '1', name: '日' },
|
|
||||||
{ id: '2', name: '周' },
|
|
||||||
{ id: '3', name: '月' },
|
|
||||||
{ id: '4', name: '年' }
|
|
||||||
],
|
|
||||||
param: 'statisticType',
|
|
||||||
index: 1,
|
|
||||||
extraOptions: [
|
|
||||||
{
|
{
|
||||||
parent: 'statisticType',
|
id: '0',
|
||||||
type: 'datePicker',
|
name:'班组'
|
||||||
label: '统计时间',
|
|
||||||
dateType: 'daterange',
|
|
||||||
format: 'yyyy-MM-dd',
|
|
||||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
|
||||||
rangeSeparator: '-',
|
|
||||||
startPlaceholder: '开始时间',
|
|
||||||
endPlaceholder: '结束时间',
|
|
||||||
param: 'timeVal',
|
|
||||||
defaultTime: ['00:00:00', '23:59:59'],
|
|
||||||
defaultSelect: [],
|
|
||||||
width: 250,
|
|
||||||
key: 'datePicker-0', // 唯一 key,触发重新渲染
|
|
||||||
appendToBody: true // 优化定位:挂载到 body 下
|
|
||||||
},
|
},
|
||||||
// 日 - 日期范围选择
|
|
||||||
{
|
{
|
||||||
parent: 'statisticType',
|
id: '1',
|
||||||
type: 'datePicker',
|
name: '日'
|
||||||
label: '统计时间',
|
|
||||||
dateType: 'daterange',
|
|
||||||
format: 'yyyy-MM-dd',
|
|
||||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
|
||||||
rangeSeparator: '-',
|
|
||||||
startPlaceholder: '开始时间',
|
|
||||||
endPlaceholder: '结束时间',
|
|
||||||
param: 'timeValDay',
|
|
||||||
defaultTime: ['00:00:00', '23:59:59'],
|
|
||||||
defaultSelect: [],
|
|
||||||
width: 250,
|
|
||||||
key: 'datePicker-1', // 唯一 key,触发重新渲染
|
|
||||||
appendToBody: true // 优化定位:挂载到 body 下
|
|
||||||
},
|
},
|
||||||
// 周 - 单个日期选择(自动获取本周范围)
|
|
||||||
{
|
{
|
||||||
parent: 'statisticType',
|
id: '2',
|
||||||
type: 'datePicker',
|
name: '周'
|
||||||
label: '统计时间',
|
|
||||||
dateType: 'week',
|
|
||||||
placeholder: '选择日期',
|
|
||||||
format: 'yyyy 第 WW 周',
|
|
||||||
pickerOptions: {
|
|
||||||
firstDayOfWeek: 1 // 数字1表示周一作为周的第一天(0=周日,1=周一,依此类推)
|
|
||||||
},
|
},
|
||||||
valueFormat: 'yyyy-MM-dd',
|
|
||||||
param: 'timeValWeek',
|
|
||||||
width: 250,
|
|
||||||
key: 'datePicker-2', // 唯一 key,触发重新渲染
|
|
||||||
appendToBody: true // 优化定位:挂载到 body 下
|
|
||||||
},
|
|
||||||
// 月 - 日期范围选择
|
|
||||||
{
|
{
|
||||||
parent: 'statisticType',
|
id: '3',
|
||||||
type: 'datePicker',
|
name: '月'
|
||||||
label: '统计时间',
|
|
||||||
dateType: 'monthrange',
|
|
||||||
format: 'yyyy-MM-dd',
|
|
||||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
|
||||||
rangeSeparator: '-',
|
|
||||||
startPlaceholder: '开始时间',
|
|
||||||
endPlaceholder: '结束时间',
|
|
||||||
param: 'timeValMonth',
|
|
||||||
defaultTime: ['00:00:00', '23:59:59'],
|
|
||||||
width: 250,
|
|
||||||
key: 'datePicker-3', // 唯一 key,触发重新渲染
|
|
||||||
appendToBody: true // 优化定位:挂载到 body 下
|
|
||||||
},
|
},
|
||||||
// 年 - 单个日期选择(自动获取本年范围)
|
|
||||||
{
|
{
|
||||||
parent: 'statisticType',
|
id: '4',
|
||||||
type: 'datePicker',
|
name: '年'
|
||||||
label: '统计时间',
|
|
||||||
dateType: 'year',
|
|
||||||
placeholder: '选择年份',
|
|
||||||
format: 'yyyy-MM-dd',
|
|
||||||
valueFormat: 'yyyy-MM-dd',
|
|
||||||
param: 'timeValYear',
|
|
||||||
width: 250,
|
|
||||||
key: 'datePicker-4', // 唯一 key,触发重新渲染
|
|
||||||
appendToBody: true // 优化定位:挂载到 body 下
|
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
param: 'statisticType'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'select',
|
type: 'select',
|
||||||
@@ -293,6 +152,20 @@ export default {
|
|||||||
selectOptions: [],
|
selectOptions: [],
|
||||||
param: 'bindObjectId'
|
param: 'bindObjectId'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
type: 'datePicker',
|
||||||
|
label: '统计开始时间',
|
||||||
|
dateType: 'daterange',
|
||||||
|
format: 'yyyy-MM-dd',
|
||||||
|
valueFormat: "yyyy-MM-dd HH:mm:ss",
|
||||||
|
rangeSeparator: '-',
|
||||||
|
startPlaceholder: '开始时间',
|
||||||
|
endPlaceholder: '结束时间',
|
||||||
|
param: 'timeVal',
|
||||||
|
defaultTime: ['00:00:00', '23:59:59'],
|
||||||
|
defaultSelect: []
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: 'button',
|
type: 'button',
|
||||||
btnName: '查询',
|
btnName: '查询',
|
||||||
@@ -303,6 +176,7 @@ export default {
|
|||||||
type: 'separate',
|
type: 'separate',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
|
||||||
type: 'button',
|
type: 'button',
|
||||||
btnName: '导出',
|
btnName: '导出',
|
||||||
name: 'export',
|
name: 'export',
|
||||||
@@ -311,226 +185,97 @@ export default {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
|
||||||
// 监听报表类型变化,强制刷新日期选择器
|
|
||||||
'listQuery.statisticType'(newVal, oldVal) {
|
|
||||||
if (newVal !== oldVal && this.$refs.searchBarForm) {
|
|
||||||
// 触发 search-bar 组件重新渲染(如果 search-bar 支持)
|
|
||||||
if (this.$refs.searchBarForm.$forceUpdate) {
|
|
||||||
this.$refs.searchBarForm.$forceUpdate();
|
|
||||||
}
|
|
||||||
// 延迟重置定位,确保 DOM 已更新
|
|
||||||
setTimeout(() => {
|
|
||||||
const datePickerEl = this.$refs.searchBarForm.$el.querySelector('.el-date-picker');
|
|
||||||
if (datePickerEl) {
|
|
||||||
// 触发 Element UI 日期选择器重新计算定位(内部方法)
|
|
||||||
const datePickerInstance = datePickerEl.__vue__;
|
|
||||||
if (datePickerInstance && datePickerInstance.updatePopper) {
|
|
||||||
datePickerInstance.updatePopper();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, 100);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
mounted() {
|
||||||
// Vue2 中 $refs 需在 $nextTick 中访问(确保 DOM 渲染完成)
|
|
||||||
this.$nextTick(() => {
|
|
||||||
if (this.$refs.searchBarForm) {
|
|
||||||
this.$refs.searchBarForm.formInline.statisticType = '1';
|
this.$refs.searchBarForm.formInline.statisticType = '1';
|
||||||
}
|
|
||||||
});
|
|
||||||
this.listQuery.statisticType = '1';
|
this.listQuery.statisticType = '1';
|
||||||
this.getDataList();
|
this.getDataList()
|
||||||
this.getPdLineList();
|
this.getPdLineList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
selectType(val) {
|
|
||||||
// 报表类型切换时的回调(如需扩展可在此添加逻辑)
|
|
||||||
console.log('报表类型切换:', val);
|
|
||||||
},
|
|
||||||
handleClick(val) {
|
handleClick(val) {
|
||||||
console.log('操作按钮点击:', val);
|
console.log(val);
|
||||||
if (val.type === 'edit') {
|
if (val.type === 'edit') {
|
||||||
this.addOrUpdateVisible = true;
|
this.addOrUpdateVisible= true
|
||||||
// Vue2 中 $nextTick 确保子组件已渲染
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.addOrUpdate.init(val.data);
|
this.$refs.addOrUpdate.init(val.data);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getPdLineList() {
|
getPdLineList() {
|
||||||
getPdList().then(res => {
|
getPdList().then((res) => {
|
||||||
// Vue2 中数组赋值需确保响应式
|
this.formConfig[1].selectOptions = res.data || []
|
||||||
this.$set(this.formConfig[1], 'selectOptions', res.data || []);
|
this.pdLineList = res.data || []; // 保存产线数据
|
||||||
this.pdLineList = res.data || [];
|
})
|
||||||
}).catch(err => {
|
|
||||||
console.error('获取产线列表失败:', err);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
selectChange(val) {
|
selectChange(val) {
|
||||||
console.log('选择变更:', val);
|
console.log(val)
|
||||||
this.selectedList = val;
|
this.selectedList = val
|
||||||
},
|
},
|
||||||
buttonClick(val) {
|
buttonClick(val) {
|
||||||
console.log('头部按钮点击:', val);
|
console.log('val', val);
|
||||||
|
|
||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 10;
|
||||||
this.listQuery.bindObjectId = val.bindObjectId ? val.bindObjectId : undefined;
|
this.listQuery.bindObjectId = val.bindObjectId ? val.bindObjectId : undefined;
|
||||||
this.listQuery.statisticType = val.statisticType ? val.statisticType : undefined;
|
this.listQuery.statisticType = val.statisticType ? val.statisticType : undefined;
|
||||||
|
this.listQuery.startTime = val.timeVal ? val.timeVal[0]: undefined;
|
||||||
|
this.listQuery.endTime = val.timeVal ? val.timeVal[1]: undefined;
|
||||||
|
|
||||||
// 处理不同时间维度的时间范围
|
//this.listQuery.reportEndTime = val.timeVal ? [new Date(val.timeVal[1]).getTime()] : undefined;
|
||||||
this.handleTimeRange(val);
|
|
||||||
|
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
break;
|
break;
|
||||||
case 'export':
|
case 'export':
|
||||||
this.handleExport();
|
this.handleExport();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
console.log('未知按钮:', val);
|
console.log(val);
|
||||||
}
|
|
||||||
},
|
|
||||||
// 处理不同时间维度的时间范围
|
|
||||||
handleTimeRange(val) {
|
|
||||||
const statisticType = val.statisticType;
|
|
||||||
const timeVal = val.timeVal;
|
|
||||||
|
|
||||||
const timeValDay = val.timeValDay;
|
|
||||||
|
|
||||||
const timeValWeek = val.timeValWeek;
|
|
||||||
const timeValMonth = val.timeValMonth;
|
|
||||||
const timeValYear = val.timeValYear;
|
|
||||||
|
|
||||||
|
|
||||||
// 重置时间参数
|
|
||||||
this.listQuery.startTime = undefined;
|
|
||||||
this.listQuery.endTime = undefined;
|
|
||||||
|
|
||||||
switch (statisticType) {
|
|
||||||
case '0': // 班组 - 沿用原时间范围
|
|
||||||
if (timeVal && timeVal.length === 2) {
|
|
||||||
this.listQuery.startTime = timeVal[0];
|
|
||||||
this.listQuery.endTime = timeVal[1];
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case '1': // 日 - 沿用原时间范围
|
|
||||||
if (timeValDay && timeValDay.length === 2) {
|
|
||||||
this.listQuery.startTime = timeValDay[0];
|
|
||||||
this.listQuery.endTime = timeValDay[1];
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case '3': // 月 - 沿用原时间范围
|
|
||||||
if (timeValMonth && timeValMonth.length === 2) {
|
|
||||||
this.listQuery.startTime = timeValMonth[0];
|
|
||||||
this.listQuery.endTime = timeValMonth[1];
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case '2': // 周 - 自动计算本周范围
|
|
||||||
if (timeValWeek) {
|
|
||||||
const [start, end] = getSelectedWeekRange(timeValWeek);
|
|
||||||
this.listQuery.startTime = formatDateTime(start);
|
|
||||||
this.listQuery.endTime = formatDateTime(end);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case '4': // 年 - 自动计算本年范围
|
|
||||||
if (timeValYear) {
|
|
||||||
const [start, end] = getSelectedYearRange(timeValYear);
|
|
||||||
this.listQuery.startTime = formatDateTime(start);
|
|
||||||
this.listQuery.endTime = formatDateTime(end);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
getDataList() {
|
getDataList() {
|
||||||
this.dataListLoading = true;
|
this.dataListLoading = true;
|
||||||
this.urlOptions.getDataListURL(this.listQuery)
|
this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
||||||
.then(response => {
|
const arr = ['班组','日', '周', '月', '年'];
|
||||||
const arr = ['班组', '日', '周', '月', '年'];
|
this.tableData = response.data?.list?.map((item) => {
|
||||||
// Vue2 中数组赋值确保响应式
|
item.reportType = arr[this.listQuery.statisticType];
|
||||||
this.tableData = (response.data?.list || []).map(item => {
|
item.statisticType = this.listQuery.statisticType
|
||||||
item.reportType = arr[this.listQuery.statisticType] || '';
|
|
||||||
item.statisticType = this.listQuery.statisticType;
|
|
||||||
|
|
||||||
// 匹配产线名称
|
// 匹配 bindObjectName
|
||||||
// const targetLine = this.pdLineList.find(line => line.id === item.bindObjectId);
|
const targetLine = this.pdLineList.find(line => line.id === item.bindObjectId);
|
||||||
// item.bindObjectName = targetLine ? targetLine.name : ''
|
item.bindObjectName = targetLine ? targetLine.name : ''; // 赋值名称,无匹配则为空
|
||||||
return item;
|
return item;
|
||||||
})
|
});
|
||||||
this.listQuery.total = response.data?.total || 0;
|
this.listQuery.total = response.data.total;
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
console.error('获取数据失败:', err);
|
|
||||||
this.tableData = [];
|
|
||||||
this.listQuery.total = 0;
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
this.dataListLoading = false;
|
this.dataListLoading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 每页数变更
|
// 每页数
|
||||||
sizeChangeHandle(val) {
|
sizeChangeHandle(val) {
|
||||||
this.listQuery.pageSize = val;
|
this.listQuery.pageSize = val;
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
// 当前页变更
|
// 当前页
|
||||||
currentChangeHandle(val) {
|
currentChangeHandle(val) {
|
||||||
this.listQuery.pageNo = val;
|
this.listQuery.pageNo = val;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
// 导出处理
|
|
||||||
handleExport() {
|
handleExport() {
|
||||||
const params = { ...this.listQuery };
|
// 处理查询参数
|
||||||
// 移除分页参数
|
let params = { ...this.listQuery };
|
||||||
delete params.pageNo;
|
params.pageNo = undefined;
|
||||||
delete params.pageSize;
|
params.pageSize = undefined;
|
||||||
delete params.total;
|
this.$modal.confirm('是否确认导出原片报表?').then(() => {
|
||||||
|
|
||||||
this.$modal.confirm('是否确认导出原片报表?')
|
|
||||||
.then(() => {
|
|
||||||
this.exportLoading = true;
|
this.exportLoading = true;
|
||||||
return exportCostOriginRadioHisData(params);
|
return exportCostOriginRadioHisData(params);
|
||||||
})
|
}).then(response => {
|
||||||
.then(response => {
|
|
||||||
this.$download.excel(response, '原片报表.xls');
|
this.$download.excel(response, '原片报表.xls');
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
console.error('导出失败:', err);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
this.exportLoading = false;
|
this.exportLoading = false;
|
||||||
});
|
}).catch(() => { });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// Vue2 中监听数据变化(如需)
|
|
||||||
watch: {
|
|
||||||
'listQuery.statisticType'(newVal) {
|
|
||||||
console.log('报表类型变更:', newVal);
|
|
||||||
// 可添加类型变更后的额外逻辑
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.app-container {
|
|
||||||
padding: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.no-data-bg {
|
|
||||||
height: 400px;
|
|
||||||
background-color: #f5f7fa;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.right-aside {
|
|
||||||
margin-bottom: 16px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -1,274 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="searchBarBox divHeight" ref="searchBarRef" :style="{ paddingRight: isFold ? '55px' : '0px' }">
|
|
||||||
<el-form :inline="true" ref="searchBarForm" :model="formInline" class="searchBar">
|
|
||||||
<span class="blue-block" v-if="removeBlue ? false : true"></span>
|
|
||||||
<template v-for="item in formConfig">
|
|
||||||
<el-form-item v-if="item.type !== ''" :key="item.param" :label="item.label ? item.label : ''"
|
|
||||||
:required="item.required ? item.required : false">
|
|
||||||
<el-input v-if="item.type === 'input'" v-model="formInline[item.param]"
|
|
||||||
:size="item.size ? item.size : 'small'" clearable :disabled="item.disabled ? item.disabled : false"
|
|
||||||
:style="item.width ? 'width:' + item.width + 'px' : 'width:200px'"
|
|
||||||
:placeholder="item.placeholder ? item.placeholder : ''" />
|
|
||||||
<el-select v-if="item.type === 'select'" v-model="formInline[item.param]"
|
|
||||||
:size="item.size ? item.size : 'small'" :filterable="item.filterable ? item.filterable : false"
|
|
||||||
:multiple="item.multiple ? item.multiple : false" :clearable="item.clearable === false ? false : true"
|
|
||||||
:style="item.width ? 'width:' + item.width + 'px' : 'width:200px'" :placeholder="item.label" @change="
|
|
||||||
item.onchange
|
|
||||||
? $emit('select-changed', {
|
|
||||||
param: item.param,
|
|
||||||
value: formInline[item.param]
|
|
||||||
})
|
|
||||||
: null
|
|
||||||
">
|
|
||||||
<el-option v-for="(sub, i) in item.selectOptions" :key="i"
|
|
||||||
:label="item.labelField ? sub[item.labelField] : sub['name']"
|
|
||||||
:value="item.valueField ? sub[item.valueField] : sub['id']" />
|
|
||||||
</el-select>
|
|
||||||
<el-date-picker v-if="item.type === 'datePicker'" :key="item.param" :size="item.size ? item.size : 'small'"
|
|
||||||
v-model="formInline[item.param]" :type="item.dateType" :format="item.format ? item.format : 'yyyy-MM-dd'"
|
|
||||||
:value-format="item.valueFormat ? item.valueFormat : null" :default-time="item.defaultTime || null"
|
|
||||||
:range-separator="item.rangeSeparator || null" :start-placeholder="item.startPlaceholder || null"
|
|
||||||
:end-placeholder="item.endPlaceholder || null" :placeholder="item.placeholder"
|
|
||||||
:picker-options="item.pickerOptions ? item.pickerOptions : null"
|
|
||||||
:clearable="item.clearable === false ? false : true"
|
|
||||||
:style="item.width ? 'width:' + item.width + 'px' : (item.dateType === 'datetimerange' ? 'width:340px' : (item.dateType === 'daterange' ? 'width:220px' : 'width:140px'))" />
|
|
||||||
<el-autocomplete v-if="item.type === 'autocomplete'" v-model="formInline[item.param]"
|
|
||||||
:value-key="item.valueKey ? item.valueKey : 'value'" :size="item.size ? item.size : 'small'"
|
|
||||||
:fetch-suggestions="item.querySearch" :placeholder="item.placeholder"
|
|
||||||
:clearable="item.clearable === false ? false : true"
|
|
||||||
:style="item.width ? 'width:' + item.width + 'px' : 'width:200px'" filterable />
|
|
||||||
<el-cascader v-if="item.type === 'cascader'" v-model="formInline[item.param]" :options="item.selectOptions"
|
|
||||||
:props="item.cascaderProps" :size="item.size ? item.size : 'small'"
|
|
||||||
:clearable="item.clearable === false ? false : true"
|
|
||||||
:show-all-levels="item.showAllLevels === false ? false : true"
|
|
||||||
:collapse-tags="item.collapseTags === true ? true : false"
|
|
||||||
:style="item.width ? 'width:' + item.width + 'px' : 'width:200px'" @change="
|
|
||||||
item.onChange
|
|
||||||
? $emit('cascader-change', {
|
|
||||||
param: item.param,
|
|
||||||
value: formInline[item.param]
|
|
||||||
})
|
|
||||||
: null
|
|
||||||
"></el-cascader>
|
|
||||||
<el-button v-if="item.type === 'button'" :type="item.color" :size="item.size ? item.size : 'small'"
|
|
||||||
:plain="item.plain ? item.plain : false" :round="item.round ? item.round : false"
|
|
||||||
@click="headBtnClick(item.name)">{{ item.btnName }}</el-button>
|
|
||||||
<span v-if="item.type === 'separate'" class="separateStyle"></span>
|
|
||||||
<!-- 可用于显示其他按钮 -->
|
|
||||||
</el-form-item>
|
|
||||||
</template>
|
|
||||||
<el-form-item>
|
|
||||||
<slot></slot>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<span v-if="isFold" class="foldClass" @click='switchMode'>
|
|
||||||
{{ isExpand ? '收起' : '展开' }}
|
|
||||||
<i class="iconfont" :class="isExpand ? 'icon-upward' : 'icon-downward'"></i>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'SearchBar',
|
|
||||||
props: {
|
|
||||||
formConfigs: {
|
|
||||||
type: Array,
|
|
||||||
default: () => {
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
removeBlue: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
isFold: {// 多行模式(默认否)
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
const formInline = {}
|
|
||||||
const formConfig = this.formConfigs
|
|
||||||
let hasExtraOptions = false
|
|
||||||
for (const obj of formConfig) {
|
|
||||||
if (obj.type !== 'button') {
|
|
||||||
if (obj.defaultSelect === false || obj.defaultSelect === 0) {
|
|
||||||
formInline[obj.param] = obj.defaultSelect
|
|
||||||
} else {
|
|
||||||
formInline[obj.param] = obj.defaultSelect || '' // defaultSelect下拉框默认选中项
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (obj.extraOptions) {
|
|
||||||
hasExtraOptions = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
formInline,
|
|
||||||
formConfig,
|
|
||||||
hasExtraOptions,
|
|
||||||
isExpand: false // 是否展开(默认否)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
formConfig: {
|
|
||||||
handler() {
|
|
||||||
for (const obj of this.formConfig) {
|
|
||||||
if (obj.defaultSelect) {
|
|
||||||
this.formInline[obj.param] = obj.defaultSelect
|
|
||||||
} else if (obj.defaultSelect === null) {
|
|
||||||
// 需要手动从外部清除选项缓存的情况,确保在外部配置项中可直接设置null
|
|
||||||
this.formInline[obj.param] = ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
deep: true,
|
|
||||||
immediate: true
|
|
||||||
},
|
|
||||||
formInline: {
|
|
||||||
handler: function () {
|
|
||||||
this.$forceUpdate()
|
|
||||||
},
|
|
||||||
deep: true,
|
|
||||||
immediate: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.init()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
init() {
|
|
||||||
if (this.hasExtraOptions) {
|
|
||||||
// 如果有额外参数就处理,如果没有就算了
|
|
||||||
for (const obj of this.formConfig) {
|
|
||||||
if (obj.extraOptions) {
|
|
||||||
// 注: 对obj.extraOptions的选择是互斥的!
|
|
||||||
this.$watch(
|
|
||||||
`formInline.${obj.param}`,
|
|
||||||
function (newVal) {
|
|
||||||
let deleteCount = 0
|
|
||||||
if (obj.index + 1 < this.formConfig.length) {
|
|
||||||
// 如果obj不是最后一个配置
|
|
||||||
const nextConfig = this.formConfig[obj.index + 1]
|
|
||||||
if (nextConfig.parent && nextConfig.parent === obj.param)
|
|
||||||
deleteCount = 1
|
|
||||||
}
|
|
||||||
const currentConfig = Object.assign(
|
|
||||||
{},
|
|
||||||
obj.extraOptions[newVal]
|
|
||||||
)
|
|
||||||
this.formConfig.splice(
|
|
||||||
obj.index + 1,
|
|
||||||
deleteCount,
|
|
||||||
currentConfig
|
|
||||||
)
|
|
||||||
// 修改 formInline
|
|
||||||
this.$set(this.formInline, currentConfig.param, '')
|
|
||||||
},
|
|
||||||
{ immediate: true }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
headBtnClick(btnName) {
|
|
||||||
this.formInline.btnName = btnName
|
|
||||||
this.$emit('headBtnClick', this.formInline)
|
|
||||||
},
|
|
||||||
resetForm() {
|
|
||||||
this.$refs.searchBarForm.resetFields()
|
|
||||||
const formInline = {}
|
|
||||||
const formConfig = this.formConfigs
|
|
||||||
for (const obj of formConfig) {
|
|
||||||
if (obj.type !== 'button') {
|
|
||||||
if (obj.defaultSelect === false || obj.defaultSelect === 0) {
|
|
||||||
formInline[obj.param] = obj.defaultSelect
|
|
||||||
} else {
|
|
||||||
formInline[obj.param] = obj.defaultSelect || '' // defaultSelect下拉框默认选中项
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.formInline = formInline
|
|
||||||
},
|
|
||||||
switchMode() {// 展开和收起切换
|
|
||||||
this.isExpand = !this.isExpand
|
|
||||||
const element = this.$refs.searchBarRef
|
|
||||||
if (this.isExpand) {
|
|
||||||
element.classList.remove('divHeight')
|
|
||||||
} else {
|
|
||||||
element.classList.add('divHeight')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style>
|
|
||||||
.searchBarBox {
|
|
||||||
width: 100%;
|
|
||||||
position: relative;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.searchBarBox::after {
|
|
||||||
content: "";
|
|
||||||
display: block;
|
|
||||||
clear: both;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divHeight {
|
|
||||||
height: 45px;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.searchBar .blue-block {
|
|
||||||
display: inline-block;
|
|
||||||
float: left;
|
|
||||||
width: 4px;
|
|
||||||
height: 16px;
|
|
||||||
background-color: #0B58FF;
|
|
||||||
border-radius: 1px;
|
|
||||||
margin-right: 8px;
|
|
||||||
margin-top: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.searchBar .el-form-item {
|
|
||||||
margin-bottom: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.searchBar .el-date-editor .el-range__icon {
|
|
||||||
font-size: 16px;
|
|
||||||
color: #0B58FF;
|
|
||||||
}
|
|
||||||
|
|
||||||
.searchBar .el-input__prefix .el-icon-date {
|
|
||||||
font-size: 16px;
|
|
||||||
color: #0B58FF;
|
|
||||||
}
|
|
||||||
|
|
||||||
.searchBar .el-input__prefix .el-icon-time {
|
|
||||||
font-size: 16px;
|
|
||||||
color: #0B58FF;
|
|
||||||
}
|
|
||||||
|
|
||||||
.searchBar .separateStyle {
|
|
||||||
display: inline-block;
|
|
||||||
width: 1px;
|
|
||||||
height: 24px;
|
|
||||||
background: #E8E8E8;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
.searchBarBox .foldClass {
|
|
||||||
position: absolute;
|
|
||||||
top: 14px;
|
|
||||||
right: 0;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 12px;
|
|
||||||
color: #0B58FF;
|
|
||||||
}
|
|
||||||
|
|
||||||
.searchBarBox .foldClass .iconfont {
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
65
src/views/cost/components/SmallTitle.vue
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2023-08-01 15:27:31
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2023-08-01 16:25:54
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<div :class="[className, { 'p-0': noPadding }]">
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
size: {
|
||||||
|
// 取值范围: xl lg md sm
|
||||||
|
type: String,
|
||||||
|
default: 'de',
|
||||||
|
validator: function (val) {
|
||||||
|
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
noPadding: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
className: function () {
|
||||||
|
return `${this.size}-title`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
|
||||||
|
$mgr: 8px;
|
||||||
|
@each $size, $height in $pxls {
|
||||||
|
.#{$size}-title {
|
||||||
|
font-size: $height;
|
||||||
|
line-height: $height;
|
||||||
|
color: #000;
|
||||||
|
font-weight: 500;
|
||||||
|
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: top;
|
||||||
|
width: 4px;
|
||||||
|
height: $height + 2px;
|
||||||
|
border-radius: 1px;
|
||||||
|
margin-right: $mgr;
|
||||||
|
background-color: #0b58ff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.p-0 {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
442
src/views/cost/components/add-or-updata.vue
Normal file
@@ -0,0 +1,442 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2025-10-13 15:07:24
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2025-11-07 15:35:14
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="circle-container">
|
||||||
|
<div v-for="(item, index) in dotArr" :key="index" class="circle-wrapper">
|
||||||
|
<div
|
||||||
|
class="circle"
|
||||||
|
:style="{
|
||||||
|
background: stepNum == index + 1 ? '#0B58FF' : '',
|
||||||
|
}">
|
||||||
|
{{ index + 1 }}
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="circle-text"
|
||||||
|
:style="{
|
||||||
|
color: stepNum == index + 1 ? '#0B58FF' : '',
|
||||||
|
}">
|
||||||
|
{{ item.name }}
|
||||||
|
</div>
|
||||||
|
<!-- 圆点后面的虚线 -->
|
||||||
|
<div v-if="index < 2" class="connector" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-if="stepNum == 1">
|
||||||
|
<div class="topTip">
|
||||||
|
1.可选择库区、巷道,同批次创建任务搬运仅支持同一产品型号。
|
||||||
|
<br />
|
||||||
|
2.须在本页下方填写搬运数量,搬运数量仅支持双数,且数量≤当前可用库存总量。
|
||||||
|
</div>
|
||||||
|
<small-title style="margin: 16px 0" size="sm" :no-padding="true">
|
||||||
|
步骤一:选择产品及起点
|
||||||
|
</small-title>
|
||||||
|
<el-form
|
||||||
|
:model="dataForm"
|
||||||
|
:rules="dataRule"
|
||||||
|
ref="dataForm"
|
||||||
|
@keyup.enter.native="dataFormSubmit()"
|
||||||
|
label-position="top"
|
||||||
|
label-width="80px">
|
||||||
|
<el-row :gutter="10">
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="搬运对象" prop="val1">
|
||||||
|
<el-select
|
||||||
|
style="width: 100%"
|
||||||
|
v-model="dataForm.val1"
|
||||||
|
placeholder="请选择搬运对象">
|
||||||
|
<el-option
|
||||||
|
v-for="item in options1"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6" v-if="dataForm.val1 == 1">
|
||||||
|
<el-form-item label="产品名称" prop="val1">
|
||||||
|
<el-select
|
||||||
|
style="width: 100%"
|
||||||
|
v-model="dataForm.val2"
|
||||||
|
placeholder="请选择产品名称">
|
||||||
|
<el-option
|
||||||
|
v-for="item in options1"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6" v-if="dataForm.val1 == 1">
|
||||||
|
<el-form-item label="规格型号" prop="val1">
|
||||||
|
<el-select
|
||||||
|
style="width: 100%"
|
||||||
|
v-model="dataForm.val2"
|
||||||
|
placeholder="请选择规格型号">
|
||||||
|
<el-option
|
||||||
|
v-for="item in options1"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="搬运数量" prop="val4">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.val4"
|
||||||
|
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')">
|
||||||
|
<template slot="append">盘</template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="10">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="起点信息" prop="val5">
|
||||||
|
<el-radio-group v-model="dataForm.val5">
|
||||||
|
<el-radio :label="1">按策略自动选择</el-radio>
|
||||||
|
<el-radio :label="2">指定起点</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<div v-if="dataForm.val5 == 2" class="potBG-div">
|
||||||
|
<div>
|
||||||
|
<el-row :gutter="10">
|
||||||
|
<el-col :span="10">
|
||||||
|
起点库区:
|
||||||
|
<el-select
|
||||||
|
style="width: 200px; margin-left: 10px"
|
||||||
|
v-model="startPot"
|
||||||
|
size="small"
|
||||||
|
placeholder="请选择起点库区">
|
||||||
|
<el-option
|
||||||
|
v-for="item in options1"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="13" style="text-align: right; line-height: 36px">
|
||||||
|
<span
|
||||||
|
class="num1-startPot-status"
|
||||||
|
style="background-color: #5ab45a" />
|
||||||
|
可选
|
||||||
|
<span class="num1-startPot-status" />
|
||||||
|
不可选
|
||||||
|
<span
|
||||||
|
class="num1-startPot-status"
|
||||||
|
style="background-color: #e9b100" />
|
||||||
|
已选
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<div class="potTitleBG">
|
||||||
|
<div v-for="item in Object.keys(startPotList)" :key="item">
|
||||||
|
<div class="potTitle">
|
||||||
|
{{ item }}
|
||||||
|
</div>
|
||||||
|
<div class="potList">
|
||||||
|
<div
|
||||||
|
class="pot"
|
||||||
|
v-for="sitem in startPotList[item]"
|
||||||
|
:key="sitem.id"
|
||||||
|
:style="{
|
||||||
|
backgroundColor: potBGcolor[sitem.status],
|
||||||
|
cursor: sitem.status > 0 ? 'pointer' : '',
|
||||||
|
}"
|
||||||
|
@click="sitem.status > 0 && setStartPot(sitem)"
|
||||||
|
:title="sitem.name">
|
||||||
|
{{ sitem.name }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-divider></el-divider>
|
||||||
|
<div style="text-align: right">可用库存总量 <span style="color:#409EFF;font-size:16px">12</span> 盘</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-if="stepNum == 2">
|
||||||
|
<div class="topTip">
|
||||||
|
1.指定终点库位,下发后会锁定所属巷道仅本批次任务进入。
|
||||||
|
<br />
|
||||||
|
2.指定终点库位选位规则:仅可从巷道最里空对位选位。
|
||||||
|
<br />
|
||||||
|
3.只选择库区或巷道时,该方式下当前终点为候选位置,系统将根据策略与现场实际情况自动确定最终终点库位。
|
||||||
|
</div>
|
||||||
|
<small-title style="margin: 16px 0" size="sm" :no-padding="true">
|
||||||
|
步骤二:选择终点
|
||||||
|
</small-title>
|
||||||
|
</div>
|
||||||
|
<div v-if="stepNum == 3">
|
||||||
|
<small-title style="margin: 16px 0" size="sm" :no-padding="true">
|
||||||
|
步骤三:预览与下发
|
||||||
|
</small-title>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import SmallTitle from './SmallTitle';
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
SmallTitle,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dotArr: [
|
||||||
|
{
|
||||||
|
name: '选择起点',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '选择终点',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '预览下发',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
potBGcolor: ['', '#dafadc', '#f8f0c4'],
|
||||||
|
stepNum: 1, // 当前第几步
|
||||||
|
//第一步参数
|
||||||
|
dataForm: {
|
||||||
|
id: undefined,
|
||||||
|
val1: undefined,
|
||||||
|
val2: undefined,
|
||||||
|
val3: undefined,
|
||||||
|
val4: undefined,
|
||||||
|
val5: 1,
|
||||||
|
},
|
||||||
|
options1: [
|
||||||
|
{
|
||||||
|
label: '产品',
|
||||||
|
value: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '空盘',
|
||||||
|
value: 2,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
dataRule: {},
|
||||||
|
startPot: undefined, //起点库区选择的类型
|
||||||
|
startPotList: {
|
||||||
|
//起点库区List
|
||||||
|
G01: [
|
||||||
|
{
|
||||||
|
id: '001',
|
||||||
|
name: 'L001',
|
||||||
|
status: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '002',
|
||||||
|
name: 'R002',
|
||||||
|
status: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '003',
|
||||||
|
name: 'L003',
|
||||||
|
status: 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '004',
|
||||||
|
name: 'R004',
|
||||||
|
status: 0,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
G02: [
|
||||||
|
{
|
||||||
|
id: '005',
|
||||||
|
name: 'L005',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '006',
|
||||||
|
name: 'R006',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '007',
|
||||||
|
name: 'L007',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '008',
|
||||||
|
name: 'R008',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init(id) {
|
||||||
|
this.dataForm.id = id || undefined;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (this.dataForm.id) {
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//上一步
|
||||||
|
upSubmit() {
|
||||||
|
if (this.stepNum == 2) {
|
||||||
|
this.stepNum -= 1;
|
||||||
|
this.$emit('setSN', this.stepNum);
|
||||||
|
} else if (this.stepNum == 3) {
|
||||||
|
this.stepNum -= 1;
|
||||||
|
this.$emit('setSN', this.stepNum);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//下一步
|
||||||
|
nextSubmit() {
|
||||||
|
if (this.stepNum == 1) {
|
||||||
|
this.stepNum += 1;
|
||||||
|
this.$emit('setSN', this.stepNum);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.stepNum == 2) {
|
||||||
|
this.stepNum += 1;
|
||||||
|
this.$emit('setSN', this.stepNum);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.stepNum == 3) {
|
||||||
|
this.stepNum = 1;
|
||||||
|
this.$emit('setSN', this.stepNum);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
cancelStep() {},
|
||||||
|
|
||||||
|
// 第一步方法
|
||||||
|
setStartPot(data) {
|
||||||
|
data.status = data.status == 1 ? 2 : 1;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.topTip {
|
||||||
|
background-color: #ebebeb;
|
||||||
|
padding: 10px 20px;
|
||||||
|
border-radius: 5px;
|
||||||
|
line-height: 25px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<!-- //库位点的样式 -->
|
||||||
|
<style scoped>
|
||||||
|
.potBG-div {
|
||||||
|
width: 100%;
|
||||||
|
margin: 10px;
|
||||||
|
border: 1px solid gainsboro;
|
||||||
|
box-shadow: 2px 2px 2px gainsboro, -1px -1px 3px gainsboro;
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
.num1-startPot-status {
|
||||||
|
margin-left: 5px;
|
||||||
|
display: inline-block;
|
||||||
|
width: 14px;
|
||||||
|
height: 14px;
|
||||||
|
border: 1px solid gainsboro;
|
||||||
|
}
|
||||||
|
.potTitleBG {
|
||||||
|
margin-top: 10px;
|
||||||
|
overflow-x: auto;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.potTitle {
|
||||||
|
width: 82px;
|
||||||
|
background-color: rgb(169, 235, 249);
|
||||||
|
border-radius: 3px;
|
||||||
|
margin-right: 5px;
|
||||||
|
text-align: center;
|
||||||
|
color: #000000;
|
||||||
|
letter-spacing: 1px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
.potList {
|
||||||
|
width: 82px;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 40px 40px;
|
||||||
|
gap: 2px;
|
||||||
|
}
|
||||||
|
.pot {
|
||||||
|
width: 40px;
|
||||||
|
text-align: center;
|
||||||
|
border: 1px solid gainsboro;
|
||||||
|
border-radius: 3px;
|
||||||
|
padding: 5px 0;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<!-- //序号圆点 -->
|
||||||
|
<style scoped>
|
||||||
|
.circle-container {
|
||||||
|
height: 110px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 20px;
|
||||||
|
width: 90%;
|
||||||
|
overflow-x: auto;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.circle-wrapper {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.circle {
|
||||||
|
width: 52px;
|
||||||
|
height: 52px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #8db1ff;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 31px;
|
||||||
|
color: #ffffff;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.circle-text {
|
||||||
|
position: absolute;
|
||||||
|
top: 60px;
|
||||||
|
left: -15px;
|
||||||
|
color: #8db1ff;
|
||||||
|
width: 82px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 下半圆虚线边框 */
|
||||||
|
.circle::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
bottom: -6px; /* 2px边框 + 2px间隙 */
|
||||||
|
left: -4px;
|
||||||
|
right: -4px;
|
||||||
|
height: 30px; /* 半圆高度 */
|
||||||
|
border-radius: 0 0 60px 60px;
|
||||||
|
border: 1px dashed #0b58ff;
|
||||||
|
border-top: none;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.connector {
|
||||||
|
width: 160px; /* 计算连接线长度 */
|
||||||
|
height: 2px;
|
||||||
|
border-bottom: 1px dashed rgb(11, 88, 255, 1);
|
||||||
|
margin: 0 5px;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
273
src/views/cost/components/detailDrawer.vue
Normal file
@@ -0,0 +1,273 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2025-11-07 17:01:51
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2025-11-07 22:31:17
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-drawer
|
||||||
|
:visible.sync="visible"
|
||||||
|
:with-header="false"
|
||||||
|
size="50%"
|
||||||
|
@close="closeD"
|
||||||
|
:show-close="false">
|
||||||
|
<div class="bgDiv1">
|
||||||
|
<el-row :gutter="20" style="margin-bottom: 15px">
|
||||||
|
<el-col :span="8" style="font-size: 20px; font-weight: 600">
|
||||||
|
TSK202510230001
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">满盘搬运(自动)</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
上次刷新:{{ parseTime(Date.now()) }}
|
||||||
|
<el-button type="text" @click="refresh">刷新</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="8">任务状态</el-col>
|
||||||
|
<el-col :span="8">优先级</el-col>
|
||||||
|
<el-col :span="8">执行车辆</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20" style="margin-bottom: 15px">
|
||||||
|
<el-col :span="8">
|
||||||
|
<span
|
||||||
|
:style="{ backgroundColor: statusColor[1].color }"
|
||||||
|
class="taskStatus">
|
||||||
|
{{ statusColor[1].label }}
|
||||||
|
</span>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">中</el-col>
|
||||||
|
<el-col :span="8">--</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="8">执行时长</el-col>
|
||||||
|
<el-col :span="8">创建人</el-col>
|
||||||
|
<el-col :span="8">创建时间</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="8">--</el-col>
|
||||||
|
<el-col :span="8">系统/张三</el-col>
|
||||||
|
<el-col :span="8">{{ parseTime(Date.now()) }}</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
<div class="bgDiv2">
|
||||||
|
<el-steps
|
||||||
|
:active="stepNum"
|
||||||
|
finish-status="success"
|
||||||
|
:process-status="stepStatus"
|
||||||
|
align-center>
|
||||||
|
<el-step title="待下发"></el-step>
|
||||||
|
<el-step title="待执行"></el-step>
|
||||||
|
<el-step title="执行中"></el-step>
|
||||||
|
<el-step title="已完成"></el-step>
|
||||||
|
</el-steps>
|
||||||
|
<div class="abnormal">任务异常:无效路径</div>
|
||||||
|
</div>
|
||||||
|
<div class="bgDiv3">
|
||||||
|
<small-title style="margin: 0 0 8px 0" size="sm" :no-padding="true">
|
||||||
|
搬运对象
|
||||||
|
</small-title>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="pan-info">
|
||||||
|
<div class="pan-title">L盘</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<div class="pan-info">
|
||||||
|
<div class="pan-title">R盘</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
<div class="bgDiv4">
|
||||||
|
<small-title style="margin: 0 0 8px 0" size="sm" :no-padding="true">
|
||||||
|
回收信息
|
||||||
|
</small-title>
|
||||||
|
<el-descriptions :column="2" size="medium" border>
|
||||||
|
<el-descriptions-item label="回收方式">他车回收</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="回收任务编号">
|
||||||
|
18100000000
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="回收库位">
|
||||||
|
CK-01-A05-L / R
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="执行车辆">AGV-06</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</div>
|
||||||
|
<div class="bgDiv5">
|
||||||
|
<small-title style="margin: 0 0 8px 0" size="sm" :no-padding="true">
|
||||||
|
任务明细
|
||||||
|
</small-title>
|
||||||
|
<el-descriptions :column="2" size="medium" border>
|
||||||
|
<el-descriptions-item label="起点库位(L/R)">
|
||||||
|
CK-01-A05-L / R
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="终点库位(L/R)">
|
||||||
|
CC-02-B03-L/R (候选 )
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="起点策略">--</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="终点策略">入库策略</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="FMS任务号">--</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="车辆位置">--</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="电量">--</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="是否载货">--</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="创建方式">自动/人工</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="任务来源">
|
||||||
|
PDA/PC/系统
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="关联叫料单">--</el-descriptions-item>
|
||||||
|
<el-descriptions-item label=""></el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</div>
|
||||||
|
<div class="bgDiv6">
|
||||||
|
<small-title style="margin: 0 0 8px 0" size="sm" :no-padding="true">
|
||||||
|
任务日志
|
||||||
|
</small-title>
|
||||||
|
<el-timeline style="padding: 0">
|
||||||
|
<el-timeline-item
|
||||||
|
v-for="(activity, index) in activities"
|
||||||
|
:key="index"
|
||||||
|
:type="activity.type"
|
||||||
|
:color="activity.color"
|
||||||
|
size="large"
|
||||||
|
hide-timestamp>
|
||||||
|
<span>{{ activity.content }}</span>
|
||||||
|
<span style="float: right">{{ activity.timestamp }}</span>
|
||||||
|
</el-timeline-item>
|
||||||
|
</el-timeline>
|
||||||
|
</div>
|
||||||
|
<el-divider></el-divider>
|
||||||
|
|
||||||
|
<!-- 底部按钮 -->
|
||||||
|
<div class="drawer-body__footer">
|
||||||
|
<el-button @click="closeD">返 回</el-button>
|
||||||
|
</div>
|
||||||
|
</el-drawer>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import SmallTitle from './SmallTitle';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: '',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
visible: false,
|
||||||
|
title: '',
|
||||||
|
statusColor: [
|
||||||
|
//bgDiv1的任务状态
|
||||||
|
{ label: '待下发', color: '#fa8c16' },
|
||||||
|
{ label: '待执行', color: '#1890ff' },
|
||||||
|
{ label: '执行中', color: '#1890ff' },
|
||||||
|
{ label: '已完成', color: '#52c41a' },
|
||||||
|
{ label: '暂停中', color: '#8c8c8c' },
|
||||||
|
{ label: '已终止', color: '#faad14' },
|
||||||
|
{ label: '异常', color: '#ff4d4f' },
|
||||||
|
{ label: '禁用', color: '#d9d9d9' },
|
||||||
|
],
|
||||||
|
//bgDiv2的步骤条
|
||||||
|
stepNum: 2,
|
||||||
|
stepStatus: 'finish',
|
||||||
|
//bgDiv6的时间线
|
||||||
|
|
||||||
|
activities: [
|
||||||
|
{
|
||||||
|
content: 'FMS | 卸货完成,任务完成',
|
||||||
|
timestamp: '2018-04-12 20:46',
|
||||||
|
type: 'primary',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
content: 'FMS | 取货完成',
|
||||||
|
timestamp: '2018-04-03 20:46',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
content: 'FMS | 派车AGV-03,前往起点取货',
|
||||||
|
timestamp: '2018-04-03 20:46',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
content: '张三 | 任务扫码配对完成,进入待下发',
|
||||||
|
timestamp: '2018-04-03 20:46',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
SmallTitle,
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
methods: {
|
||||||
|
init(val) {
|
||||||
|
this.visible = true;
|
||||||
|
},
|
||||||
|
//刷新
|
||||||
|
refresh() {},
|
||||||
|
closeD() {
|
||||||
|
this.visible = false
|
||||||
|
this.$emit('closeDrawer');
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.bgDiv1 {
|
||||||
|
background-color: rgba(242, 242, 242, 0.5);
|
||||||
|
padding: 20px;
|
||||||
|
line-height: 25px;
|
||||||
|
font-size: 15px;
|
||||||
|
border-bottom: 1px solid rgba(121, 121, 121, 0.5);
|
||||||
|
.taskStatus {
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 3px;
|
||||||
|
padding: 2px 5px;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.bgDiv2 {
|
||||||
|
border-bottom: 1px solid rgba(121, 121, 121, 0.5);
|
||||||
|
padding: 18px 0;
|
||||||
|
.abnormal {
|
||||||
|
width: 80%;
|
||||||
|
margin: auto;
|
||||||
|
border-radius: 5px;
|
||||||
|
height: 40px;
|
||||||
|
font-size: 22px;
|
||||||
|
line-height: 40px;
|
||||||
|
text-align: center;
|
||||||
|
background-color: rgba(217, 0, 27, 0.1);
|
||||||
|
color: rgba(217, 0, 27, 1);
|
||||||
|
border: 1px solid rgba(217, 0, 27, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.bgDiv3 {
|
||||||
|
padding: 20px 20px 0;
|
||||||
|
.pan-info {
|
||||||
|
height: 350px;
|
||||||
|
border: 1px solid rgba(121, 121, 121, 0.8);
|
||||||
|
border-radius: 5px;
|
||||||
|
.pan-title {
|
||||||
|
background-color: rgba(242, 242, 242, 0.5);
|
||||||
|
height: 35px;
|
||||||
|
font-size: 20px;
|
||||||
|
line-height: 35px;
|
||||||
|
padding: 0 20px;
|
||||||
|
border-bottom: 1px solid rgba(121, 121, 121, 0.5);
|
||||||
|
letter-spacing: 2px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.bgDiv4 {
|
||||||
|
padding: 20px 20px 0;
|
||||||
|
}
|
||||||
|
.bgDiv5 {
|
||||||
|
padding: 20px 20px 0;
|
||||||
|
}
|
||||||
|
.bgDiv6 {
|
||||||
|
padding: 20px 20px 0;
|
||||||
|
}
|
||||||
|
.drawer-body__footer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
padding: 0 18px 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
65
src/views/cost/components/stopInStock.vue
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2025-11-08 17:44:05
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2025-11-08 18:13:25
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div>请选择要执行的终止方式,系统会根据选择进行处理</div>
|
||||||
|
<el-radio-group v-model="radio" class="stockRadioDiv">
|
||||||
|
<el-radio :label="1" border style="margin: 10px 0">
|
||||||
|
仅终止,稍后回收
|
||||||
|
<div style="font-weight: 400">
|
||||||
|
任务立即终止,车辆保持暂停,稍后可在任务列表中手动回收
|
||||||
|
</div>
|
||||||
|
</el-radio>
|
||||||
|
<el-radio :label="2" border style="margin: 10px 0">
|
||||||
|
终止,并立即回收
|
||||||
|
<div style="font-weight: 400">
|
||||||
|
任务立即终止立即,选择货物回收方式生成任务或更新卸货点
|
||||||
|
</div>
|
||||||
|
</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
<div>
|
||||||
|
终止原因:
|
||||||
|
<el-input
|
||||||
|
type="textarea"
|
||||||
|
:rows="3"
|
||||||
|
style="margin: 10px 0"
|
||||||
|
placeholder="请输入终止原因"
|
||||||
|
v-model="textarea" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
radio: 1,
|
||||||
|
textarea: '',
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init(val) {},
|
||||||
|
submit() {
|
||||||
|
if(this.textarea){
|
||||||
|
|
||||||
|
}else{
|
||||||
|
this.$message('请输入终止原因');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.stockRadioDiv >>> .el-radio--medium.is-bordered {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
height: 70px;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
32
src/views/cost/components/subSpan1.vue
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2025-10-13 16:18:41
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2025-11-06 15:19:24
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<span>
|
||||||
|
{{
|
||||||
|
(injectData.val2
|
||||||
|
? ['满盘搬运', '空盘搬运', '备料搬运', '临时搬运'][injectData.val2]
|
||||||
|
: '-')
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
injectData: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
methods: {},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
32
src/views/cost/components/subSpan2.vue
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2025-10-13 16:18:41
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2025-11-06 15:20:43
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<span>
|
||||||
|
{{
|
||||||
|
(injectData.val3
|
||||||
|
? ['待下发', '待执行', '执行中', '已完成', '暂停中', '已终止', '异常'][injectData.val3]
|
||||||
|
: '-')
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
injectData: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
methods: {},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
57
src/views/cost/components/subSpan3.vue
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2025-10-13 16:18:41
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2025-11-06 15:37:02
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div style="display: flex; align-items: center">
|
||||||
|
<div
|
||||||
|
style="
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: #e89b24;
|
||||||
|
color: #fff;
|
||||||
|
text-align:center;
|
||||||
|
line-height:16px
|
||||||
|
">
|
||||||
|
L
|
||||||
|
</div>
|
||||||
|
产品名称+产品规格
|
||||||
|
</div>
|
||||||
|
<div style="display: flex; align-items: center">
|
||||||
|
<div
|
||||||
|
style="
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: #6a96ec;
|
||||||
|
color: #fff;
|
||||||
|
text-align:center;
|
||||||
|
line-height:16px
|
||||||
|
">
|
||||||
|
R
|
||||||
|
</div>
|
||||||
|
产品名称+产品规格
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
injectData: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
methods: {},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
32
src/views/cost/components/subSpan4.vue
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2025-10-13 16:18:41
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2025-11-06 15:19:24
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<span>
|
||||||
|
{{
|
||||||
|
(injectData.val2
|
||||||
|
? ['满盘搬运', '空盘搬运', '备料搬运', '临时搬运'][injectData.val2]
|
||||||
|
: '-')
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
injectData: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
methods: {},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
23
src/views/cost/components/typeRule.vue
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2023-12-05 13:45:59
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2024-04-15 17:12:03
|
||||||
|
* @Description
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<span>{{ parseTime(injectData.startTime,'{y}年{m}月{d}日') + '-' + (parseTime(injectData.endTime)?parseTime(injectData.endTime,'{y}年{m}月{d}日'):'永久') }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: '',
|
||||||
|
props: {
|
||||||
|
injectData: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -1,430 +1,45 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="home-page">
|
||||||
<!-- 顶部日期&筛选栏 -->
|
|
||||||
<el-row :gutter="20" class="top-bar">
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="dateRange"
|
|
||||||
type="daterange"
|
|
||||||
range-separator="~"
|
|
||||||
start-placeholder="开始日期"
|
|
||||||
end-placeholder="结束日期"
|
|
||||||
value-format="yyyy-MM-dd" />
|
|
||||||
<el-button type="primary" style="margin-left: 10px">查询</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="16">
|
|
||||||
<el-tag type="info" @click="changeTime('yesterday')">昨日</el-tag>
|
|
||||||
<el-tag type="info" @click="changeTime('week')">本周</el-tag>
|
|
||||||
<el-tag type="info" @click="changeTime('month')">本月</el-tag>
|
|
||||||
<el-tag type="info" @click="changeTime('year')">本年</el-tag>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<!-- 成本概览卡片 -->
|
|
||||||
<el-row :gutter="20" class="card-row">
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-card class="cost-card">
|
|
||||||
<div class="card-title">总制造成本(元/平米)</div>
|
|
||||||
<div class="card-content">
|
|
||||||
<div>
|
|
||||||
目标
|
|
||||||
<span class="target-val">16</span>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
实际
|
|
||||||
<span class="actual-val">12.8</span>
|
|
||||||
</div>
|
|
||||||
<el-progress :stroke-width="13" :percentage="80" color="#42b983" />
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-card class="cost-card">
|
|
||||||
<div class="card-title">原片成本(元/平米)</div>
|
|
||||||
<div class="card-content">
|
|
||||||
<div>
|
|
||||||
目标
|
|
||||||
<span class="target-val">16</span>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
实际
|
|
||||||
<span class="actual-val">12.8</span>
|
|
||||||
</div>
|
|
||||||
<el-progress :stroke-width="13" :percentage="99" color="#42b983" />
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-card class="cost-card">
|
|
||||||
<div class="card-title">加工成本(元/平米)</div>
|
|
||||||
<div class="card-content">
|
|
||||||
<div>
|
|
||||||
目标
|
|
||||||
<span class="target-val">16</span>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
实际
|
|
||||||
<span class="actual-val">12.8</span>
|
|
||||||
</div>
|
|
||||||
<el-progress :stroke-width="13" :percentage="99" color="#42b983" />
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<!-- 成本构成区域 -->
|
|
||||||
<el-row :gutter="20" class="composition-row">
|
|
||||||
<!-- 饼图 -->
|
|
||||||
<el-col :span="6">
|
|
||||||
<el-card class="composition-card">
|
|
||||||
<div class="card-title">成本构成</div>
|
|
||||||
<div id="costPie" class="chart" style="height: 350px"></div>
|
|
||||||
</el-card>
|
|
||||||
</el-col>
|
|
||||||
<!-- 原片/加工成本子项 -->
|
|
||||||
<el-col :span="18">
|
|
||||||
<el-card class="composition-card">
|
|
||||||
<div class="card-title">成本构成</div>
|
|
||||||
|
|
||||||
<!-- 原片成本子项 -->
|
|
||||||
<div class="sub-cost-group">
|
|
||||||
<div class="sub-cost-title">原片成本</div>
|
|
||||||
<div class="sub-cost">
|
|
||||||
<div
|
<div
|
||||||
v-for="(item, idx) in rawSubCosts"
|
class="main-footer"
|
||||||
:key="idx"
|
style="
|
||||||
class="sub-cost-div">
|
color: #c7c7c7;
|
||||||
<div class="sub-cost-name">
|
user-select: none;
|
||||||
{{ item.name }}
|
font-size: 14px;
|
||||||
<div class="sub-cost-val">{{ item.val }}</div>
|
letter-spacing: 1px;
|
||||||
|
height: 30px;
|
||||||
|
display: grid;
|
||||||
|
place-content: center;
|
||||||
|
">
|
||||||
|
© 中建材智能自动化研究院有限公司
|
||||||
</div>
|
</div>
|
||||||
<div style="text-align: center">
|
|
||||||
<el-progress
|
|
||||||
type="circle"
|
|
||||||
:percentage="89"
|
|
||||||
:width="60"
|
|
||||||
:stroke-width="10"
|
|
||||||
:show-text="false"
|
|
||||||
color="#e74c3c" />
|
|
||||||
</div>
|
|
||||||
<div class="sub-cost-name">
|
|
||||||
目标
|
|
||||||
<span class="red-text">{{ item.target }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="sub-cost-name">
|
|
||||||
完成率
|
|
||||||
<span class="red-text">89%</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<el-divider></el-divider>
|
|
||||||
<!-- 加工成本子项 -->
|
|
||||||
<div class="sub-cost-group" style="margin-top: 20px">
|
|
||||||
<div class="sub-cost-title">加工成本</div>
|
|
||||||
<div class="sub-cost">
|
|
||||||
<div
|
|
||||||
v-for="(item, idx) in processSubCosts"
|
|
||||||
:key="idx"
|
|
||||||
class="sub-cost-div">
|
|
||||||
<div class="sub-cost-name">
|
|
||||||
{{ item.name }}
|
|
||||||
<div class="sub-cost-val">{{ item.val }}</div>
|
|
||||||
</div>
|
|
||||||
<div style="text-align: center">
|
|
||||||
<el-progress
|
|
||||||
type="circle"
|
|
||||||
:percentage="89"
|
|
||||||
:width="60"
|
|
||||||
:stroke-width="10"
|
|
||||||
:show-text="false"
|
|
||||||
color="#e74c3c" />
|
|
||||||
</div>
|
|
||||||
<div class="sub-cost-name">
|
|
||||||
目标
|
|
||||||
<span class="red-text">{{ item.target }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="sub-cost-name">
|
|
||||||
完成率
|
|
||||||
<span class="red-text">89%</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<!-- 趋势图区域 -->
|
|
||||||
<el-row :gutter="20" class="trend-row">
|
|
||||||
<!-- 总制造成本趋势 -->
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-card class="trend-card">
|
|
||||||
<div class="card-title">总制造成本趋势</div>
|
|
||||||
<div id="totalTrend" class="chart" style="height: 300px"></div>
|
|
||||||
</el-card>
|
|
||||||
</el-col>
|
|
||||||
<!-- 原片/加工成本趋势 -->
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-card class="trend-card">
|
|
||||||
<div class="card-title">原片/加工成本趋势</div>
|
|
||||||
<el-tabs v-model="costTab" type="card" style="margin-bottom: 10px">
|
|
||||||
<el-tab-pane label="原片成本" name="raw"></el-tab-pane>
|
|
||||||
<el-tab-pane label="加工成本" name="process"></el-tab-pane>
|
|
||||||
</el-tabs>
|
|
||||||
<div id="rawProcessTrend" class="chart" style="height: 300px"></div>
|
|
||||||
</el-card>
|
|
||||||
</el-col>
|
|
||||||
<!-- 单项成本趋势 -->
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-card class="trend-card">
|
|
||||||
<div class="card-title">单项成本趋势</div>
|
|
||||||
<el-tabs v-model="itemTab" type="card" style="margin-bottom: 10px">
|
|
||||||
<el-tab-pane label="人工成本" name="labor"></el-tab-pane>
|
|
||||||
<el-tab-pane label="原料成本" name="material"></el-tab-pane>
|
|
||||||
<el-tab-pane label="制造费用" name="expense"></el-tab-pane>
|
|
||||||
<el-tab-pane label="玻璃热耗" name="heat"></el-tab-pane>
|
|
||||||
<el-tab-pane label="原片成品率" name="yield"></el-tab-pane>
|
|
||||||
</el-tabs>
|
|
||||||
<div id="itemTrend" class="chart" style="height: 300px"></div>
|
|
||||||
</el-card>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as echarts from 'echarts';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'CostDashboard',
|
name: 'Home',
|
||||||
|
mixins: [],
|
||||||
|
components: {},
|
||||||
|
computed: {},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {};
|
||||||
dateRange: ['2023-05-06', '2023-05-06'],
|
|
||||||
costTab: 'raw',
|
|
||||||
itemTab: 'labor',
|
|
||||||
// 原片成本子项
|
|
||||||
rawSubCosts: [
|
|
||||||
{ name: '人工成本', val: 4.56, target: 4.32 },
|
|
||||||
{ name: '原料成本', val: 4.56, target: 4.32 },
|
|
||||||
{ name: '原片制造费用', val: 4.56, target: 4.32 },
|
|
||||||
{ name: '玻璃热耗', val: 4.56, target: 4.32 },
|
|
||||||
{ name: '原片成品率', val: 4.56, target: 4.32 },
|
|
||||||
],
|
|
||||||
// 加工成本子项
|
|
||||||
processSubCosts: [
|
|
||||||
{ name: '人工成本', val: 4.56, target: 4.32 },
|
|
||||||
{ name: '加工动力成本', val: 4.56, target: 4.32 },
|
|
||||||
{ name: '加工制造费用', val: 4.56, target: 4.32 },
|
|
||||||
{ name: '加工投入产出率', val: 4.56, target: 4.32 },
|
|
||||||
],
|
|
||||||
// 趋势图模拟数据
|
|
||||||
trendX: ['00:00', '01:00', '02:00'],
|
|
||||||
trendY: [20, 40, 50],
|
|
||||||
targetY: 12.54,
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
mounted() {
|
created() {
|
||||||
this.initCostPie();
|
},
|
||||||
this.initTotalTrend();
|
beforeDestroy() {
|
||||||
this.initRawProcessTrend();
|
|
||||||
this.initItemTrend();
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 切换时间范围(示例)
|
|
||||||
changeTime(type) {
|
|
||||||
// 实际项目中需根据type请求对应数据
|
|
||||||
console.log('切换时间:', type);
|
|
||||||
},
|
|
||||||
// 初始化成本构成饼图
|
|
||||||
initCostPie() {
|
|
||||||
const pieChart = echarts.init(document.getElementById('costPie'));
|
|
||||||
pieChart.setOption({
|
|
||||||
tooltip: { trigger: 'item' },
|
|
||||||
legend: {
|
|
||||||
orient: 'horizontal', // 水平排列
|
|
||||||
bottom: 0, // 放在底部
|
|
||||||
icon: 'circle',
|
|
||||||
left: 'center',
|
|
||||||
formatter: function (name) {
|
|
||||||
return name;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
type: 'pie',
|
|
||||||
data: [
|
|
||||||
{ name: '原料成本(4.2元)', value: 29.9 },
|
|
||||||
{ name: '动力成本(2.1元)', value: 24 },
|
|
||||||
{ name: '人工成本(1.5元)', value: 24 },
|
|
||||||
{ name: '辅料成本(0.5元)', value: 21.2 },
|
|
||||||
{ name: '制造费用(0.5元)', value: 21.2 },
|
|
||||||
],
|
|
||||||
label: { show: false },
|
|
||||||
labelLine: { show: false },
|
|
||||||
bottom: 10,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
});
|
|
||||||
window.addEventListener('resize', () => pieChart.resize());
|
|
||||||
},
|
|
||||||
// 初始化总制造成本趋势图
|
|
||||||
initTotalTrend() {
|
|
||||||
const totalChart = echarts.init(document.getElementById('totalTrend'));
|
|
||||||
totalChart.setOption({
|
|
||||||
grid: { top: 20, bottom: 30, left: 30, right: 10 },
|
|
||||||
xAxis: { type: 'category', data: this.trendX },
|
|
||||||
yAxis: { type: 'value', min: -20, max: 60 },
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
name: '实际值',
|
|
||||||
type: 'line',
|
|
||||||
data: this.trendY,
|
|
||||||
lineStyle: { color: '#409eff' },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '目标值',
|
|
||||||
type: 'line',
|
|
||||||
data: [this.targetY, this.targetY, this.targetY],
|
|
||||||
lineStyle: { type: 'dashed', color: '#e6a23c' },
|
|
||||||
},
|
|
||||||
],
|
|
||||||
});
|
|
||||||
window.addEventListener('resize', () => totalChart.resize());
|
|
||||||
},
|
|
||||||
// 初始化原片/加工成本趋势图
|
|
||||||
initRawProcessTrend() {
|
|
||||||
const rpChart = echarts.init(document.getElementById('rawProcessTrend'));
|
|
||||||
rpChart.setOption({
|
|
||||||
grid: { top: 10, bottom: 20, left: 20, right: 10 },
|
|
||||||
xAxis: { type: 'category', data: this.trendX },
|
|
||||||
yAxis: { type: 'value', min: -20, max: 60 },
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
name: '实际值',
|
|
||||||
type: 'line',
|
|
||||||
data: this.trendY,
|
|
||||||
lineStyle: { color: '#409eff' },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '目标值',
|
|
||||||
type: 'line',
|
|
||||||
data: [this.targetY, this.targetY, this.targetY],
|
|
||||||
lineStyle: { type: 'dashed', color: '#e6a23c' },
|
|
||||||
},
|
|
||||||
],
|
|
||||||
});
|
|
||||||
window.addEventListener('resize', () => rpChart.resize());
|
|
||||||
},
|
|
||||||
// 初始化单项成本趋势图
|
|
||||||
initItemTrend() {
|
|
||||||
const itemChart = echarts.init(document.getElementById('itemTrend'));
|
|
||||||
itemChart.setOption({
|
|
||||||
grid: { top: 10, bottom: 20, left: 20, right: 10 },
|
|
||||||
xAxis: { type: 'category', data: this.trendX },
|
|
||||||
yAxis: { type: 'value', min: -20, max: 60 },
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
name: '实际值',
|
|
||||||
type: 'line',
|
|
||||||
data: this.trendY,
|
|
||||||
lineStyle: { color: '#409eff' },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '目标值',
|
|
||||||
type: 'line',
|
|
||||||
data: [this.targetY, this.targetY, this.targetY],
|
|
||||||
lineStyle: { type: 'dashed', color: '#e6a23c' },
|
|
||||||
},
|
|
||||||
],
|
|
||||||
});
|
|
||||||
window.addEventListener('resize', () => itemChart.resize());
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style lang="scss" scoped>
|
||||||
.top-bar {
|
|
||||||
margin-bottom: 20px;
|
</style>
|
||||||
}
|
<style lang="scss">
|
||||||
.card-row,
|
|
||||||
.composition-row {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
.cost-card .card-title {
|
|
||||||
font-size: 22px;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
}
|
|
||||||
.cost-card .card-content {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 1fr 1fr 1fr;
|
|
||||||
gap: 10px;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 18px;
|
|
||||||
}
|
|
||||||
.target-val {
|
|
||||||
color: #666;
|
|
||||||
margin-left: 5px;
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
.actual-val {
|
|
||||||
color: #42b983;
|
|
||||||
margin-left: 5px;
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
.composition-card {
|
|
||||||
height: 480px;
|
|
||||||
}
|
|
||||||
.composition-card .card-title {
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
}
|
|
||||||
.sub-cost {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
|
|
||||||
gap: 10px;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.sub-cost-group .sub-cost-title {
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
.sub-cost-group .sub-cost-div {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 1fr 1fr;
|
|
||||||
gap: 10px;
|
|
||||||
align-items: center;
|
|
||||||
border: 1px solid rgb(220, 220, 220, 0.5);
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
.sub-cost-name {
|
|
||||||
text-align: center;
|
|
||||||
margin-top: 5px;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
.sub-cost-val {
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
.completion {
|
|
||||||
text-align: center;
|
|
||||||
font-size: 12px;
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
.red-text {
|
|
||||||
color: #e74c3c;
|
|
||||||
}
|
|
||||||
.trend-card {
|
|
||||||
height: 450px;
|
|
||||||
}
|
|
||||||
.trend-card .card-title {
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
35
src/views/cost/raw/costMaterial/changeStatus.vue
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<template>
|
||||||
|
<el-switch
|
||||||
|
@change="changeStatus"
|
||||||
|
size="small"
|
||||||
|
v-model="list.enabled"
|
||||||
|
:active-value="1"
|
||||||
|
:inactive-value="0"></el-switch>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { updateGroup } from '@/api/group/groupSetting';
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
injectData: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
list: this.injectData,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
methods: {
|
||||||
|
changeStatus(val) {
|
||||||
|
const data = { ...this.injectData, enabled: val };
|
||||||
|
updateGroup(data).then((res) => {
|
||||||
|
this.$modal.msgSuccess('修改成功');
|
||||||
|
this.$emit('emitData');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -1,134 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-dialog :visible.sync="visible" width="40%">
|
|
||||||
<small-title slot="title" :no-padding="true">
|
|
||||||
{{ this.dataForm.lineId + '·' + this.dataForm.equipmentName }}
|
|
||||||
</small-title>
|
|
||||||
|
|
||||||
<div class="content">
|
|
||||||
<div class="visual-part">
|
|
||||||
<base-table :table-props="tableProps"
|
|
||||||
:page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="tableData">
|
|
||||||
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
|
|
||||||
@clickBtn="handleClick" /> -->
|
|
||||||
</base-table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- <div slot="footer" class="dialog-footer">
|
|
||||||
<el-button style="" @click="goback()">取消</el-button>
|
|
||||||
<el-button type="primary" @click="dataFormSubmit()">
|
|
||||||
确定
|
|
||||||
</el-button>
|
|
||||||
</div> -->
|
|
||||||
</el-dialog>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
const tableProps = [
|
|
||||||
|
|
||||||
{
|
|
||||||
prop: 'paramName',
|
|
||||||
label: '参数名称'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'paramValue',
|
|
||||||
label: '当前值',
|
|
||||||
// filter: parseTime,
|
|
||||||
// width: 160
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
import { getParamMonitor } from '@/api/base/equipment';
|
|
||||||
// import { parseTime } from '../../mixins/code-filter';
|
|
||||||
import SmallTitle from './SmallTitle';
|
|
||||||
export default {
|
|
||||||
components: { SmallTitle },
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
visible: false,
|
|
||||||
tableProps,
|
|
||||||
tableData:[],
|
|
||||||
listQuery: {
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize:100,
|
|
||||||
},
|
|
||||||
addOrUpdateVisible: false,
|
|
||||||
dataForm: {
|
|
||||||
equipmentId:undefined,
|
|
||||||
equipmentName: undefined,
|
|
||||||
lineId: undefined,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
init(data) {
|
|
||||||
console.log(data.paramMonitors,'data');
|
|
||||||
|
|
||||||
this.dataForm.equipmentId = data.equipmentId || '';
|
|
||||||
this.dataForm.equipmentName = data.equipmentName || '';
|
|
||||||
this.dataForm.lineId = data.lineId || '';
|
|
||||||
|
|
||||||
|
|
||||||
this.visible = true;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
// this.$refs['dataForm'].resetFields();
|
|
||||||
// getParamMonitor({
|
|
||||||
// equipmentId:this.dataForm.equipmentId
|
|
||||||
// }).then((res) => {
|
|
||||||
this.tableData = data.paramMonitors
|
|
||||||
// })
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.drawer >>> .el-drawer {
|
|
||||||
border-radius: 8px 0 0 8px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer >>> .el-form-item__label {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer >>> .el-drawer__header {
|
|
||||||
margin: 0;
|
|
||||||
padding: 32px 32px 24px;
|
|
||||||
border-bottom: 1px solid #dcdfe6;
|
|
||||||
}
|
|
||||||
.drawer >>> .el-drawer__body {
|
|
||||||
flex: 1;
|
|
||||||
height: 1px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer >>> .content {
|
|
||||||
padding: 30px 24px;
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
/* height: 100%; */
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer >>> .visual-part {
|
|
||||||
flex: 1 auto;
|
|
||||||
max-height: 76vh;
|
|
||||||
overflow: hidden;
|
|
||||||
overflow-y: scroll;
|
|
||||||
padding-right: 10px; /* 调整滚动条样式 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer >>> .el-form,
|
|
||||||
.drawer >>> .attr-list {
|
|
||||||
padding: 0 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer-body__footer {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
padding: 18px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,561 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-dialog :visible.sync="visible" width="80%" @close="handleClose" title-class="dialog-title">
|
|
||||||
<small-title slot="title" :no-padding="true">
|
|
||||||
{{ dataForm.lineId + '·' + dataForm.equipmentName }}
|
|
||||||
</small-title>
|
|
||||||
<search-bar removeBlue :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
|
||||||
<el-tabs class="custom-tabs" v-model="activeLabel" :stretch="true" @tab-click="handleTabClick">
|
|
||||||
<el-tab-pane :label="'\u3000报警时长\u3000'" name="duration"></el-tab-pane>
|
|
||||||
<el-tab-pane :label="'\u3000报警次数\u3000'" name="times"></el-tab-pane>
|
|
||||||
</el-tabs>
|
|
||||||
<div class="content">
|
|
||||||
<div class="visual-part">
|
|
||||||
<div v-if="hasData" style="display: flex; justify-content: space-around; gap: 20px; padding: 10px 0;">
|
|
||||||
<!-- 移除 v-if,始终渲染两个图表容器 -->
|
|
||||||
<div id="barChart" style="width: 48%; height: 400px;"></div>
|
|
||||||
<div id="pieChart" style="width: 48%; height: 400px;"></div>
|
|
||||||
</div>
|
|
||||||
<div v-if="!hasData" class="no-data">
|
|
||||||
<el-empty description="暂无相关报警数据"></el-empty>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { getAlarmDet } from '@/api/base/equipment';
|
|
||||||
import * as echarts from 'echarts';
|
|
||||||
import SmallTitle from './SmallTitle';
|
|
||||||
|
|
||||||
const CHART_CONFIG = {
|
|
||||||
barColor: '#288AFF',
|
|
||||||
pieColors: [
|
|
||||||
'#288AFF', '#4096FF', '#69B1FF', '#91CFFF', '#B8E0FF',
|
|
||||||
'#E0F2FF', '#1890FF', '#096DD9', '#0050B3', '#003A8C'
|
|
||||||
],
|
|
||||||
fontColor: '#333',
|
|
||||||
lightFontColor: '#666',
|
|
||||||
borderRadius: 4
|
|
||||||
};
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: { SmallTitle },
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
visible: false,
|
|
||||||
hasData: false,
|
|
||||||
listQuery: {
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 100,
|
|
||||||
equipmentId: undefined,
|
|
||||||
startTime: undefined,
|
|
||||||
endTime: undefined
|
|
||||||
},
|
|
||||||
formConfig: [
|
|
||||||
{
|
|
||||||
type: 'datePicker',
|
|
||||||
label: '时间段',
|
|
||||||
dateType: 'daterange',
|
|
||||||
format: 'yyyy-MM-dd',
|
|
||||||
valueFormat: 'timestamp',
|
|
||||||
rangeSeparator: '-',
|
|
||||||
startPlaceholder: '开始时间',
|
|
||||||
endPlaceholder: '结束时间',
|
|
||||||
param: 'timeVal',
|
|
||||||
defaultTime: ['00:00:00', '23:59:59'],
|
|
||||||
defaultSelect: []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'button',
|
|
||||||
btnName: '查询',
|
|
||||||
name: 'search',
|
|
||||||
color: 'primary'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
activeLabel: 'duration', // 默认选中「报警时长」
|
|
||||||
dataForm: {
|
|
||||||
equipmentId: undefined,
|
|
||||||
equipmentName: undefined,
|
|
||||||
lineId: undefined
|
|
||||||
},
|
|
||||||
chartInstances: {
|
|
||||||
bar: null,
|
|
||||||
pie: null
|
|
||||||
},
|
|
||||||
isDomReady: false,
|
|
||||||
originData: null // 存储原始数据
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.isDomReady = true;
|
|
||||||
if (this.listQuery.equipmentId) {
|
|
||||||
this.getDataList();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
// Tab 切换时自动刷新图表(无需额外操作,依赖 handleTabClick 触发查询)
|
|
||||||
activeLabel() {
|
|
||||||
if (this.isDomReady && this.originData) {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.renderBothCharts(); // 切换 Tab 后重新渲染两个图表
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
initDefaultDate() {
|
|
||||||
const today = new Date();
|
|
||||||
const start = new Date(today.getFullYear(), today.getMonth(), today.getDate(), 0, 0, 0, 0).getTime();
|
|
||||||
const end = new Date(today.getFullYear(), today.getMonth(), today.getDate(), 23, 59, 59, 0).getTime();
|
|
||||||
|
|
||||||
this.formConfig[0].defaultSelect = [start, end];
|
|
||||||
this.listQuery.startTime = start;
|
|
||||||
this.listQuery.endTime = end;
|
|
||||||
|
|
||||||
if (this.$refs.searchBarForm) {
|
|
||||||
this.$refs.searchBarForm.form.timeVal = [start, end];
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
handleTabClick() {
|
|
||||||
// 切换 Tab 时重新查询数据(或直接复用已有数据渲染)
|
|
||||||
this.getDataList();
|
|
||||||
},
|
|
||||||
|
|
||||||
buttonClick(val) {
|
|
||||||
switch (val.btnName) {
|
|
||||||
case 'search':
|
|
||||||
this.listQuery.startTime = val.timeVal?.[0];
|
|
||||||
this.listQuery.endTime = val.timeVal?.[1];
|
|
||||||
this.getDataList();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
async getDataList() {
|
|
||||||
try {
|
|
||||||
if (!this.listQuery.equipmentId) {
|
|
||||||
console.warn('设备ID不能为空');
|
|
||||||
this.hasData = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const queryParams = {
|
|
||||||
equipmentId: this.listQuery.equipmentId,
|
|
||||||
startTime: this.listQuery.startTime,
|
|
||||||
endTime: this.listQuery.endTime,
|
|
||||||
};
|
|
||||||
|
|
||||||
const res = await getAlarmDet(queryParams);
|
|
||||||
const originData = res.data || [];
|
|
||||||
this.originData = originData;
|
|
||||||
this.hasData = originData.length > 0;
|
|
||||||
|
|
||||||
if (this.hasData && this.isDomReady) {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.renderBothCharts(); // 数据查询成功后,同时渲染两个图表
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.destroyAllCharts();
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error('获取报警数据失败:', error);
|
|
||||||
this.hasData = false;
|
|
||||||
this.destroyAllCharts();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// 核心方法:同时渲染柱状图和饼图(根据当前 Tab 类型)
|
|
||||||
renderBothCharts() {
|
|
||||||
if (this.activeLabel === 'duration') {
|
|
||||||
// 报警时长:柱状图(时长排序)+ 饼图(时长占比)
|
|
||||||
this.renderBarChart('duration');
|
|
||||||
this.renderPieChart('duration');
|
|
||||||
} else {
|
|
||||||
// 报警次数:柱状图(次数排序)+ 饼图(次数占比)
|
|
||||||
this.renderBarChart('times');
|
|
||||||
this.renderPieChart('times');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// 渲染柱状图(支持两种数据类型)
|
|
||||||
renderBarChart(type) {
|
|
||||||
this.destroyChart('bar');
|
|
||||||
const chartDom = document.getElementById('barChart');
|
|
||||||
if (!chartDom || !this.originData.length) return;
|
|
||||||
|
|
||||||
// 根据类型排序和提取数据
|
|
||||||
let sortedData, xData, seriesData, yAxisName;
|
|
||||||
if (type === 'duration') {
|
|
||||||
// 报警时长:按时长降序
|
|
||||||
sortedData = [...this.originData].sort((a, b) => b.alarmDuration - a.alarmDuration);
|
|
||||||
seriesData = sortedData.map(item => item.alarmDuration);
|
|
||||||
yAxisName = '报警时长';
|
|
||||||
} else {
|
|
||||||
// 报警次数:按次数降序
|
|
||||||
sortedData = [...this.originData].sort((a, b) => b.alarmCount - a.alarmCount);
|
|
||||||
seriesData = sortedData.map(item => item.alarmCount);
|
|
||||||
yAxisName = '报警次数';
|
|
||||||
}
|
|
||||||
|
|
||||||
xData = sortedData.map(item => this.truncateText(item.alarmContent, 8));
|
|
||||||
|
|
||||||
try {
|
|
||||||
this.chartInstances.bar = echarts.init(chartDom);
|
|
||||||
const option = {
|
|
||||||
title: {
|
|
||||||
text: `${yAxisName}统计(柱状图)`,
|
|
||||||
left: 'center',
|
|
||||||
textStyle: { fontSize: 14, color: CHART_CONFIG.fontColor }
|
|
||||||
},
|
|
||||||
tooltip: {
|
|
||||||
trigger: 'axis',
|
|
||||||
axisPointer: { type: 'shadow' },
|
|
||||||
padding: 10,
|
|
||||||
textStyle: { fontSize: 11 },
|
|
||||||
formatter: (params) => {
|
|
||||||
const index = params[0].dataIndex;
|
|
||||||
const item = sortedData[index];
|
|
||||||
return `
|
|
||||||
<div style="text-align: left;">
|
|
||||||
<div>${item.alarmContent}</div>
|
|
||||||
<div>${yAxisName}:${type === 'duration' ? item.alarmDuration : item.alarmCount}</div>
|
|
||||||
<div>占比:${type === 'duration' ? item.alarmDurationRatio.toFixed(2) : item.alarmCountRatio.toFixed(2)}%</div>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
grid: {
|
|
||||||
left: '5%',
|
|
||||||
right: '5%',
|
|
||||||
bottom: '18%',
|
|
||||||
top: '15%',
|
|
||||||
containLabel: true
|
|
||||||
},
|
|
||||||
xAxis: [
|
|
||||||
{
|
|
||||||
type: 'category',
|
|
||||||
data: xData,
|
|
||||||
axisTick: { alignWithLabel: true },
|
|
||||||
axisLabel: {
|
|
||||||
interval: 0,
|
|
||||||
fontSize: 12,
|
|
||||||
color: CHART_CONFIG.lightFontColor
|
|
||||||
},
|
|
||||||
axisLine: { lineStyle: { color: '#e8e8e8' } }
|
|
||||||
}
|
|
||||||
],
|
|
||||||
yAxis: [
|
|
||||||
{
|
|
||||||
type: 'value',
|
|
||||||
name: yAxisName,
|
|
||||||
nameTextStyle: { fontSize: 11, color: CHART_CONFIG.lightFontColor },
|
|
||||||
axisLabel: {
|
|
||||||
fontSize: 11,
|
|
||||||
color: CHART_CONFIG.lightFontColor,
|
|
||||||
},
|
|
||||||
axisLine: { lineStyle: { color: '#e8e8e8' } },
|
|
||||||
splitLine: { lineStyle: { color: '#f5f5f5' } },
|
|
||||||
max: (value) => value.max * 1.2
|
|
||||||
}
|
|
||||||
],
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
name: yAxisName,
|
|
||||||
type: 'bar',
|
|
||||||
itemStyle: {
|
|
||||||
color: CHART_CONFIG.barColor,
|
|
||||||
borderRadius: [CHART_CONFIG.borderRadius, CHART_CONFIG.borderRadius, 0, 0],
|
|
||||||
shadowBlur: 3,
|
|
||||||
shadowColor: 'rgba(40, 138, 255, 0.2)',
|
|
||||||
shadowOffsetY: 2
|
|
||||||
},
|
|
||||||
barWidth: '16',
|
|
||||||
data: seriesData,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: 'top',
|
|
||||||
distance: 6,
|
|
||||||
fontSize: 11,
|
|
||||||
color: CHART_CONFIG.fontColor,
|
|
||||||
formatter: (params) => `${params.value}`
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
|
|
||||||
this.chartInstances.bar.setOption(option);
|
|
||||||
this.addResizeListener('bar');
|
|
||||||
} catch (error) {
|
|
||||||
console.error(`${yAxisName}柱状图初始化失败:`, error);
|
|
||||||
setTimeout(() => this.renderBarChart(type), 200);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// 渲染饼图(支持两种数据类型)
|
|
||||||
renderPieChart(type) {
|
|
||||||
this.destroyChart('pie');
|
|
||||||
const chartDom = document.getElementById('pieChart');
|
|
||||||
if (!chartDom || !this.originData.length) return;
|
|
||||||
|
|
||||||
// 根据类型处理饼图数据
|
|
||||||
let pieData, seriesName;
|
|
||||||
if (type === 'duration') {
|
|
||||||
// 报警时长:按时长占比处理
|
|
||||||
seriesName = '报警时长';
|
|
||||||
pieData = this.handlePieData(this.originData, 'alarmDuration', 'alarmDurationRatio');
|
|
||||||
} else {
|
|
||||||
// 报警次数:按次数占比处理
|
|
||||||
seriesName = '报警次数';
|
|
||||||
pieData = this.handlePieData(this.originData, 'alarmCount', 'alarmCountRatio');
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
this.chartInstances.pie = echarts.init(chartDom);
|
|
||||||
const option = {
|
|
||||||
title: {
|
|
||||||
text: `${seriesName}统计(饼图)`,
|
|
||||||
left: 'center',
|
|
||||||
textStyle: { fontSize: 14, color: CHART_CONFIG.fontColor }
|
|
||||||
},
|
|
||||||
tooltip: {
|
|
||||||
trigger: 'item',
|
|
||||||
padding: 10,
|
|
||||||
textStyle: { fontSize: 11 },
|
|
||||||
formatter: (params) => {
|
|
||||||
return `
|
|
||||||
<div style="text-align: left;">
|
|
||||||
<div>${params.name}</div>
|
|
||||||
<div>${seriesName}:${params.value}${type === 'duration' ? '' : '次'}</div>
|
|
||||||
<div>占比:${params.percent.toFixed(2)}%</div>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
name: seriesName,
|
|
||||||
type: 'pie',
|
|
||||||
radius: ['50%', '70%'],
|
|
||||||
center: ['50%', '55%'],
|
|
||||||
color: CHART_CONFIG.pieColors,
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: 'outside',
|
|
||||||
distance: 15,
|
|
||||||
fontSize: 11,
|
|
||||||
color: CHART_CONFIG.lightFontColor,
|
|
||||||
formatter: (params) => {
|
|
||||||
const truncatedName = this.truncateText(params.name, 8);
|
|
||||||
return `${truncatedName}(${params.value}${type === 'duration' ? '' : '次'}, ${params.percent.toFixed(1)}%)`;
|
|
||||||
},
|
|
||||||
align: 'center',
|
|
||||||
baseline: 'middle'
|
|
||||||
},
|
|
||||||
labelLine: {
|
|
||||||
show: true,
|
|
||||||
length: 15,
|
|
||||||
length2: 20,
|
|
||||||
lineStyle: {
|
|
||||||
color: '#ccc',
|
|
||||||
width: 1,
|
|
||||||
type: 'solid'
|
|
||||||
},
|
|
||||||
smooth: 0.2
|
|
||||||
},
|
|
||||||
data: pieData,
|
|
||||||
emphasis: {
|
|
||||||
itemStyle: {
|
|
||||||
shadowBlur: 10,
|
|
||||||
shadowColor: 'rgba(0, 0, 0, 0.1)'
|
|
||||||
},
|
|
||||||
label: {
|
|
||||||
color: CHART_CONFIG.fontColor,
|
|
||||||
fontSize: 12,
|
|
||||||
fontWeight: 500
|
|
||||||
},
|
|
||||||
labelLine: {
|
|
||||||
lineStyle: {
|
|
||||||
color: CHART_CONFIG.barColor,
|
|
||||||
width: 1.5
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
|
|
||||||
this.chartInstances.pie.setOption(option);
|
|
||||||
this.addResizeListener('pie');
|
|
||||||
} catch (error) {
|
|
||||||
console.error(`${seriesName}饼图初始化失败:`, error);
|
|
||||||
setTimeout(() => this.renderPieChart(type), 200);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// 通用饼图数据处理(支持动态字段)
|
|
||||||
handlePieData(data, valueKey, ratioKey) {
|
|
||||||
const threshold = 5; // 占比低于5%合并为「其他」
|
|
||||||
let otherCount = 0;
|
|
||||||
const mainData = data.filter(item => {
|
|
||||||
if (item[ratioKey] >= threshold) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
otherCount += item[valueKey];
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}).map(item => ({
|
|
||||||
name: item.alarmContent,
|
|
||||||
value: item[valueKey],
|
|
||||||
ratio: item[ratioKey]
|
|
||||||
}));
|
|
||||||
|
|
||||||
if (otherCount > 0) {
|
|
||||||
mainData.push({
|
|
||||||
name: '其他',
|
|
||||||
value: otherCount,
|
|
||||||
ratio: 100 - mainData.reduce((sum, item) => sum + item.ratio, 0)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return mainData;
|
|
||||||
},
|
|
||||||
|
|
||||||
truncateText(text, maxLength) {
|
|
||||||
if (!text) return '';
|
|
||||||
return text.length > maxLength ? text.slice(0, maxLength) + '...' : text;
|
|
||||||
},
|
|
||||||
|
|
||||||
addResizeListener(type) {
|
|
||||||
const chart = this.chartInstances[type];
|
|
||||||
if (chart) {
|
|
||||||
const resizeHandler = () => chart.resize();
|
|
||||||
window.addEventListener('resize', resizeHandler);
|
|
||||||
chart.resizeHandler = resizeHandler;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
destroyChart(type) {
|
|
||||||
const chart = this.chartInstances[type];
|
|
||||||
if (chart) {
|
|
||||||
window.removeEventListener('resize', chart.resizeHandler);
|
|
||||||
chart.dispose();
|
|
||||||
this.chartInstances[type] = null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
destroyAllCharts() {
|
|
||||||
Object.keys(this.chartInstances).forEach(type => {
|
|
||||||
this.destroyChart(type);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
handleClose() {
|
|
||||||
this.destroyAllCharts();
|
|
||||||
this.formConfig[0].defaultSelect = [];
|
|
||||||
this.listQuery.startTime = undefined;
|
|
||||||
this.listQuery.endTime = undefined;
|
|
||||||
this.originData = null;
|
|
||||||
this.hasData = true;
|
|
||||||
if (this.$refs.searchBarForm) {
|
|
||||||
this.$refs.searchBarForm.form.timeVal = [];
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
init(data) {
|
|
||||||
this.dataForm = {
|
|
||||||
equipmentId: data.equipmentId || '',
|
|
||||||
equipmentName: data.equipmentName || '',
|
|
||||||
lineId: data.lineId || ''
|
|
||||||
};
|
|
||||||
this.activeLabel = 'duration'
|
|
||||||
this.listQuery.equipmentId = data.equipmentId || undefined;
|
|
||||||
this.visible = true;
|
|
||||||
this.originData = null;
|
|
||||||
this.hasData = false;
|
|
||||||
|
|
||||||
this.initDefaultDate();
|
|
||||||
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.isDomReady = true;
|
|
||||||
this.getDataList();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
beforeDestroy() {
|
|
||||||
this.destroyAllCharts();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
/* 保持原有样式,优化图表容器布局 */
|
|
||||||
.drawer>>>.el-drawer {
|
|
||||||
border-radius: 8px 0 0 8px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer>>>.el-form-item__label {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer>>>.el-drawer__header {
|
|
||||||
margin: 0;
|
|
||||||
padding: 32px 32px 24px;
|
|
||||||
border-bottom: 1px solid #dcdfe6;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer>>>.el-drawer__body {
|
|
||||||
flex: 1;
|
|
||||||
height: 1px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer>>>.content {
|
|
||||||
padding: 30px 24px;
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer>>>.visual-part {
|
|
||||||
flex: 1 auto;
|
|
||||||
max-height: 76vh;
|
|
||||||
overflow: hidden;
|
|
||||||
padding: 10px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 优化图表容器响应式布局 */
|
|
||||||
@media (max-width: 1200px) {
|
|
||||||
.visual-part>div {
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
#barChart,
|
|
||||||
#pieChart {
|
|
||||||
width: 100% !important;
|
|
||||||
height: 350px !important;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer>>>.el-form,
|
|
||||||
.drawer>>>.attr-list {
|
|
||||||
padding: 0 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer-body__footer {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
padding: 18px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||