Compare commits
14 Commits
f9741b07c0
...
e6158cd59b
Author | SHA1 | Date | |
---|---|---|---|
|
e6158cd59b | ||
|
624ed7bc27 | ||
afba54fcab | |||
|
f7846f2767 | ||
|
a8adb317c0 | ||
b185d3ebf7 | |||
045843bc1c | |||
3812eb38a9 | |||
|
1962ecc6df | ||
e64e33a203 | |||
3ada2c5d08 | |||
0eb6a99fa9 | |||
9e8276d3a7 | |||
6e1bf994c2 |
10
.env.dev
10
.env.dev
@ -1,7 +1,7 @@
|
|||||||
###
|
###
|
||||||
# @Author: Do not edit
|
# @Author: Do not edit
|
||||||
# @Date: 2023-08-29 09:40:39
|
# @Date: 2023-08-29 09:40:39
|
||||||
# @LastEditTime: 2023-11-07 09:23:07
|
# @LastEditTime: 2023-11-11 20:50:30
|
||||||
# @LastEditors: DY
|
# @LastEditors: DY
|
||||||
# @Description:
|
# @Description:
|
||||||
###
|
###
|
||||||
@ -14,14 +14,13 @@ VUE_APP_TITLE = MES系统
|
|||||||
# 芋道管理系统/开发环境
|
# 芋道管理系统/开发环境
|
||||||
# VUE_APP_BASE_API = 'http://100.64.0.26:48082'
|
# VUE_APP_BASE_API = 'http://100.64.0.26:48082'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.0.33:48082'
|
# VUE_APP_BASE_API = 'http://192.168.0.33:48082'
|
||||||
VUE_APP_BASE_API = 'http://192.168.4.173:48080'
|
# VUE_APP_BASE_API = 'http://192.168.4.173:48080'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
|
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.1.49:48080'
|
# VUE_APP_BASE_API = 'http://192.168.1.49:48080'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.1.8:48080'
|
# VUE_APP_BASE_API = 'http://192.168.1.8:48080'
|
||||||
|
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.1.56:48080'
|
# VUE_APP_BASE_API = 'http://192.168.1.56:48080'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.1.188:48080'
|
# VUE_APP_BASE_API = 'http://192.168.4.159:48080'
|
||||||
# VUE_APP_BASE_API = 'http://192.168.2.159:48080'
|
|
||||||
|
|
||||||
# 路由懒加载
|
# 路由懒加载
|
||||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||||
|
|
||||||
@ -36,3 +35,4 @@ VUE_APP_DOC_ENABLE = true
|
|||||||
|
|
||||||
# 百度统计
|
# 百度统计
|
||||||
# VUE_APP_BAIDU_CODE = fadc1bd5db1a1d6f581df60a1807f8ab
|
# VUE_APP_BAIDU_CODE = fadc1bd5db1a1d6f581df60a1807f8ab
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
# 开发环境配置
|
# 开发环境配置
|
||||||
ENV = 'development'
|
ENV = 'development'
|
||||||
|
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
ENV = 'production'
|
ENV = 'production'
|
||||||
|
|
||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = 产线监控系统
|
VUE_APP_TITLE = MES系统
|
||||||
|
|
||||||
# 芋道管理系统/生产环境
|
# 芋道管理系统/生产环境
|
||||||
VUE_APP_BASE_API = '/prod-api'
|
VUE_APP_BASE_API = '/prod-api'
|
||||||
|
|
||||||
# 根据服务器或域名修改
|
# 根据服务器或域名修改
|
||||||
# PUBLIC_PATH = 'http://my-pi.com:8888/yudao-admin/'
|
# PUBLIC_PATH = 'http://my-pi.com:8888/yudao-admin/'
|
||||||
PUBLIC_PATH = 'http://192.168.0.33:8888/'
|
PUBLIC_PATH = 'http://192.168.0.33:8889/'
|
||||||
|
|
||||||
# 二级部署路径
|
# 二级部署路径
|
||||||
VUE_APP_APP_NAME ='yudao-admin'
|
VUE_APP_APP_NAME ='yudao-admin'
|
||||||
|
12
.env.production
Normal file
12
.env.production
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
###
|
||||||
|
# @Author: zhp
|
||||||
|
# @Date: 2023-10-30 14:18:30
|
||||||
|
# @LastEditTime: 2023-11-02 16:16:09
|
||||||
|
# @LastEditors: zhp
|
||||||
|
# @Description:
|
||||||
|
###
|
||||||
|
# just a flag
|
||||||
|
ENV = 'production'
|
||||||
|
|
||||||
|
# base api
|
||||||
|
# VUE_APP_BASE_API = '/api'
|
@ -23,3 +23,4 @@ VUE_APP_DOC_ENABLE = false
|
|||||||
|
|
||||||
# 百度统计
|
# 百度统计
|
||||||
VUE_APP_BAIDU_CODE = fadc1bd5db1a1d6f581df60a1807f8ab
|
VUE_APP_BAIDU_CODE = fadc1bd5db1a1d6f581df60a1807f8ab
|
||||||
|
|
||||||
|
@ -71,3 +71,21 @@ export function deliveryLogDetCreate(data) {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获得一条发货详细
|
||||||
|
export function deliveryLogDetGet(query) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/delivery-log-det/get',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 编辑发货详情
|
||||||
|
export function deliveryLogDetUpdate(data) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/delivery-log-det/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -137,4 +137,13 @@ export function bomUseNum(query) {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 完成订单
|
||||||
|
export function orderFinish(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/order/finish',
|
||||||
|
method: 'post',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
}
|
}
|
69
src/api/base/qualityScrapDet.js
Normal file
69
src/api/base/qualityScrapDet.js
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zhp
|
||||||
|
* @Date: 2023-11-06 15:38:12
|
||||||
|
* @LastEditTime: 2023-11-06 15:39:39
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 创建质量检测类型基础
|
||||||
|
export function createQualityScrapDet(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/quality-scrap-det/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新质量检测类型基础
|
||||||
|
export function updateQualityScrapDet(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/quality-scrap-det/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除质量检测类型基础
|
||||||
|
export function deleteQualityScrapDet(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/quality-scrap-det/delete?id=' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得质量检测类型基础
|
||||||
|
export function getQualityScrapDet(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/quality-scrap-det/get?id=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得质量检测类型基础分页
|
||||||
|
export function getQualityScrapDetPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/quality-scrap-det/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出质量检测类型基础 Excel
|
||||||
|
export function exportQualityScrapTypeExcel(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/quality-scrap-type/export-excel',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getCode(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/quality-scrap-det/getCode',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
100
src/api/base/qualityScrapLog.js
Normal file
100
src/api/base/qualityScrapLog.js
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zhp
|
||||||
|
* @Date: 2023-11-07 15:02:37
|
||||||
|
* @LastEditTime: 2023-11-07 18:32:07
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 创建质量检测类型基础
|
||||||
|
export function createQualityScrapLog(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/quality-scrap-log/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新质量检测类型基础
|
||||||
|
export function updateQualityScrapLog(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/quality-scrap-log/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除质量检测类型基础
|
||||||
|
export function deleteQualityScrapLog(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/quality-scrap-log/delete?id=' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得质量检测类型基础
|
||||||
|
export function getQualityScrapLog(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/quality-scrap-log/get?id=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得质量检测类型基础分页
|
||||||
|
export function getQualityScrapLogPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/quality-scrap-log/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出质量检测类型基础 Excel
|
||||||
|
export function exportQualityScrapTypeExcel(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/quality-scrap-type/export-excel',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getCode(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/quality-scrap-log/getCode',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function getWorkOrderList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/core-work-order/listbyfilter',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getTeamList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/group-team/listAll',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getLineList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/core-production-line/listAll',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getDetList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/quality-scrap-det/listAll',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
})
|
||||||
|
}
|
76
src/api/base/qualityScrapType.js
Normal file
76
src/api/base/qualityScrapType.js
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zhp
|
||||||
|
* @Date: 2023-11-04 18:27:11
|
||||||
|
* @LastEditTime: 2023-11-06 15:55:24
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 创建质量检测类型基础
|
||||||
|
export function createQualityScrapType(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/quality-scrap-type/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新质量检测类型基础
|
||||||
|
export function updateQualityScrapType(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/quality-scrap-type/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除质量检测类型基础
|
||||||
|
export function deleteQualityScrapType(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/quality-scrap-type/delete?id=' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得质量检测类型基础
|
||||||
|
export function getQualityScrapType(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/quality-scrap-type/get?id=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得质量检测类型基础分页
|
||||||
|
export function getQualityScrapTypePage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/quality-scrap-type/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出质量检测类型基础 Excel
|
||||||
|
export function exportQualityScrapTypeExcel(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/quality-scrap-type/export-excel',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getCode(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/quality-scrap-type/getCode',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function getList(query) {
|
||||||
|
return request({
|
||||||
|
url: 'base/quality-scrap-type/listAll',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* @Author: zhp
|
* @Author: zhp
|
||||||
* @Date: 2023-09-12 14:07:04
|
* @Date: 2023-09-12 14:07:04
|
||||||
* @LastEditTime: 2023-11-07 14:17:38
|
* @LastEditTime: 2023-11-10 10:23:43
|
||||||
* @LastEditors: DY
|
* @LastEditors: DY
|
||||||
* @Description:
|
* @Description:
|
||||||
*/
|
*/
|
||||||
@ -15,9 +15,10 @@ export function getYieldAnalysisPageData(query) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 产线平衡分析
|
||||||
export function getCT(data) {
|
export function getCT(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/analysis/production-analysis/getCT',
|
url: '/analysis/equipment-analysis/getCT',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
|
27
src/api/equipment/analysis/statistics.js
Normal file
27
src/api/equipment/analysis/statistics.js
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* @Author: Do not edit
|
||||||
|
* @Date: 2023-11-10 09:27:39
|
||||||
|
* @LastEditTime: 2023-11-10 09:30:00
|
||||||
|
* @LastEditors: DY
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 获得设备统计分析
|
||||||
|
export function getEqAnalysis(query) {
|
||||||
|
return request({
|
||||||
|
url: '/analysis/equipment-analysis/statistics',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出设备统计分析
|
||||||
|
export function exportEqAnalysisExcel(query) {
|
||||||
|
return request({
|
||||||
|
url: '/analysis/equipment-analysis/export-excel',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
60
src/api/equipment/base/alarm/records.js
Normal file
60
src/api/equipment/base/alarm/records.js
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
/*
|
||||||
|
* @Author: Do not edit
|
||||||
|
* @Date: 2023-11-08 15:56:52
|
||||||
|
* @LastEditTime: 2023-11-09 17:42:27
|
||||||
|
* @LastEditors: DY
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 创建设备报警处理
|
||||||
|
export function createAlarmHand(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-alarm-hand/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新设备报警处理
|
||||||
|
export function updateAlarmHand(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-alarm-hand/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除设备报警处理
|
||||||
|
export function deleteAlarmHand(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-alarm-hand/delete?id=' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//获得设备报警处理
|
||||||
|
export function getAlarmHand(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-alarm-hand/get?id=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得设备报警处理分页
|
||||||
|
export function getAlarmHandPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-alarm-hand/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//获得设备报警记录
|
||||||
|
export function getAlarmLog(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-alarm-log/get?id=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
62
src/api/equipment/base/inspection/record.js
Normal file
62
src/api/equipment/base/inspection/record.js
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
/*
|
||||||
|
* @Author: Do not edit
|
||||||
|
* @Date: 2023-11-08 15:56:52
|
||||||
|
* @LastEditTime: 2023-11-11 19:52:54
|
||||||
|
* @LastEditors: DY
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 根据设备获得所有巡检内容列表
|
||||||
|
export function getcheckAllList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-check/listAll',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建设备巡检计划记录
|
||||||
|
export function createCheckLog(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-check-log/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新设备巡检计划记录
|
||||||
|
export function updateCheckLog(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-check-log/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得设备巡检计划记录
|
||||||
|
export function getEqCheckLog(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-check-log/get?id=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出设备巡检计划记录
|
||||||
|
export function exportCheckLogExcel(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-check-log/export-excel',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据设备获得所有巡检配置列表
|
||||||
|
export function getcheckConfigByEqList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-check-config/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
68
src/api/equipment/base/inspection/settings.js
Normal file
68
src/api/equipment/base/inspection/settings.js
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* @Author: Do not edit
|
||||||
|
* @Date: 2023-11-08 15:56:52
|
||||||
|
* @LastEditTime: 2023-11-10 09:04:50
|
||||||
|
* @LastEditors: DY
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 获得设备巡检设置
|
||||||
|
export function getEqCheck(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-check-config/get?id=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建巡检项目
|
||||||
|
export function createCheckDet(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-check-config-det/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新巡检项目
|
||||||
|
export function updateCheckDet(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-check-config-det/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除巡检项目
|
||||||
|
export function deleteCheckDet(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-check-config-det/delete?id=' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//巡检项目
|
||||||
|
export function getCheckDet(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-check-config-det/get?id=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得巡检项目分页
|
||||||
|
export function getCheckDetPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-check-config-det/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得x巡检所有列表
|
||||||
|
export function getcheckList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-check/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
25
src/api/equipment/base/repair.js
Normal file
25
src/api/equipment/base/repair.js
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* @Author: Do not edit
|
||||||
|
* @Date: 2023-11-10 16:09:33
|
||||||
|
* @LastEditTime: 2023-11-10 16:50:08
|
||||||
|
* @LastEditors: DY
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
//获得设备维修
|
||||||
|
export function getEqRepair(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-repair-log/get?id=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新设备维修记录
|
||||||
|
export function updateEqRepair(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-repair-log/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
51
src/api/equipment/base/spare-parts/config.js
Normal file
51
src/api/equipment/base/spare-parts/config.js
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
* @Author: Do not edit
|
||||||
|
* @Date: 2023-11-11 16:18:57
|
||||||
|
* @LastEditTime: 2023-11-11 17:28:54
|
||||||
|
* @LastEditors: DY
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
//获得备品备件配置
|
||||||
|
export function getSparePartConfig(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-spare-part-config/get?id=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建设备备品备件配置--抽屉
|
||||||
|
export function createConfigDet(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-spare-part-config-det/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除设备备品备件配置--抽屉
|
||||||
|
export function deleteConfigDet(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-spare-part-config-det/delete?id=' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得抽屉表格分页
|
||||||
|
export function getConfigDetPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-spare-part-config-det/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得备品备件列表
|
||||||
|
export function getSparePartList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-spare-part/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
45
src/api/equipment/base/spare-parts/monitor.js
Normal file
45
src/api/equipment/base/spare-parts/monitor.js
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
/*
|
||||||
|
* @Author: Do not edit
|
||||||
|
* @Date: 2023-11-11 16:18:57
|
||||||
|
* @LastEditTime: 2023-11-11 18:44:51
|
||||||
|
* @LastEditors: DY
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 获得抽屉表格分页
|
||||||
|
export function getConfigDetMonitorPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-spare-part-config-det/monitor',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建设备备品备件更换log
|
||||||
|
export function createSparePartLog(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-spare-part-log/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得设备备品备件更换log分页
|
||||||
|
export function getSparePartLogPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-spare-part-log/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出设备备品备件更换log
|
||||||
|
export function exportSparePartLogExcel(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-spare-part-log/export-excel',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
106
src/api/extend/processEquMaterialBom.js
Normal file
106
src/api/extend/processEquMaterialBom.js
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zhp
|
||||||
|
* @Date: 2023-11-07 19:47:48
|
||||||
|
* @LastEditTime: 2023-11-08 16:59:32
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 获得能耗统计查询分页
|
||||||
|
export function processEquMaterialBomPage(data) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/process-equ-material-bom/page',
|
||||||
|
method: 'get',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateProcessEquMaterialBom(data) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/process-equ-material-bom/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function createProcessEquMaterialBom(data) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/process-equ-material-bom/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function getProcessEquMaterialBom(data) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/process-equ-material-bom/get',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function deleteProcessEquMaterialBom(id) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/process-equ-material-bom/delete?id=' + id,
|
||||||
|
method: 'delete',
|
||||||
|
// data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getEquipmentList(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/core-equipment/listAll',
|
||||||
|
method: 'get',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function deleteProcessEquMaterialBomDet(id) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/process-equ-material-bom-det/delete?id=' + id,
|
||||||
|
method: 'delete',
|
||||||
|
// data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function processEquMaterialBomDetPage(data) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/process-equ-material-bom-det/page',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateProcessEquMaterialBomDet(data) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/process-equ-material-bom-det/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function createProcessEquMaterialBomDet(data) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/process-equ-material-bom-det/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getProcessEquMaterialBomDet(data) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/process-equ-material-bom-det/get',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getMaterialList(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/material/listbyfilter',
|
||||||
|
method: 'get',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
106
src/api/extend/processEquValueBom.js
Normal file
106
src/api/extend/processEquValueBom.js
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zhp
|
||||||
|
* @Date: 2023-11-09 09:37:14
|
||||||
|
* @LastEditTime: 2023-11-09 14:20:02
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 获得能耗统计查询分页
|
||||||
|
export function processEquValueBomPage(data) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/process-equ-value-bom/page',
|
||||||
|
method: 'get',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateProcessEquValueBom(data) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/process-equ-value-bom/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function createProcessEquValueBom(data) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/process-equ-value-bom/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function getProcessEquValueBom(data) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/process-equ-value-bom/get',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function deleteProcessEquValueBom(id) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/process-equ-value-bom/delete?id=' + id,
|
||||||
|
method: 'delete',
|
||||||
|
// data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getEquipmentList(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/core-equipment/listAll',
|
||||||
|
method: 'get',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function deleteProcessEquValueBomDet(id) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/process-equ-value-bom-det/delete?id=' + id,
|
||||||
|
method: 'delete',
|
||||||
|
// data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function processEquValueBomDetPage(data) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/process-equ-value-bom-det/page',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateProcessEquValueBomDet(data) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/process-equ-value-bom-det/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function createProcessEquValueBomDet(data) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/process-equ-value-bom-det/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getProcessEquValueBomDet(data) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/process-equ-value-bom-det/get',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getValueList(data) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/process-equ-value-bom-det/getEnableValuesByEquId',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
@ -1,9 +1,16 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zhp
|
||||||
|
* @Date: 2023-10-17 09:26:38
|
||||||
|
* @LastEditTime: 2023-11-02 17:00:17
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
// 创建质量检查信息记录表
|
// 创建质量检查信息记录表
|
||||||
export function createQualityInspectionRecord(data) {
|
export function createQualityInspectionRecord(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/monitoring/quality-inspection-record/create',
|
url: '/base/quality-inspection-record/create',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
@ -12,7 +19,7 @@ export function createQualityInspectionRecord(data) {
|
|||||||
// 更新质量检查信息记录表
|
// 更新质量检查信息记录表
|
||||||
export function updateQualityInspectionRecord(data) {
|
export function updateQualityInspectionRecord(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/monitoring/quality-inspection-record/update',
|
url: '/base/quality-inspection-record/update',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
@ -21,7 +28,7 @@ export function updateQualityInspectionRecord(data) {
|
|||||||
// 删除质量检查信息记录表
|
// 删除质量检查信息记录表
|
||||||
export function deleteQualityInspectionRecord(id) {
|
export function deleteQualityInspectionRecord(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/monitoring/quality-inspection-record/delete?id=' + id,
|
url: '/base/quality-inspection-record/delete?id=' + id,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -29,7 +36,7 @@ export function deleteQualityInspectionRecord(id) {
|
|||||||
// 获得质量检查信息记录表
|
// 获得质量检查信息记录表
|
||||||
export function getQualityInspectionRecord(id) {
|
export function getQualityInspectionRecord(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/monitoring/quality-inspection-record/get?id=' + id,
|
url: '/base/quality-inspection-record/get?id=' + id,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -37,7 +44,7 @@ export function getQualityInspectionRecord(id) {
|
|||||||
// 获得质量检查信息记录表分页
|
// 获得质量检查信息记录表分页
|
||||||
export function getQualityInspectionRecordPage(query) {
|
export function getQualityInspectionRecordPage(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/monitoring/quality-inspection-record/page',
|
url: '/base/quality-inspection-record/page',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
@ -46,7 +53,7 @@ export function getQualityInspectionRecordPage(query) {
|
|||||||
// 导出质量检查信息记录表 Excel
|
// 导出质量检查信息记录表 Excel
|
||||||
export function exportQualityInspectionRecordExcel(query) {
|
export function exportQualityInspectionRecordExcel(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/monitoring/quality-inspection-record/export-excel',
|
url: '/base/quality-inspection-record/export-excel',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query,
|
params: query,
|
||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
|
40
src/api/monitoring/statisticalData.js
Normal file
40
src/api/monitoring/statisticalData.js
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zhp
|
||||||
|
* @Date: 2023-11-07 14:10:18
|
||||||
|
* @LastEditTime: 2023-11-07 16:29:55
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 获得质量检查信息记录表分页
|
||||||
|
export function getStatisticalDataPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/statistical-data/getStatisticData',
|
||||||
|
method: 'get',
|
||||||
|
data: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getWorkOrderList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/core-work-order/listbyfilter',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function getProductList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/core-product/listAll',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getInspectionData(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/statistical-data/getInspectionData',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
})
|
||||||
|
}
|
35
src/api/quality/deviceParameters.js
Normal file
35
src/api/quality/deviceParameters.js
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zhp
|
||||||
|
* @Date: 2023-10-18 09:33:57
|
||||||
|
* @LastEditTime: 2023-11-03 09:31:17
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
|
||||||
|
// 获得物料信息追溯page
|
||||||
|
export function getTreeData(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/core-factory/getTreeByWorkOrder',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getWorkOrderList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/core-work-order/listbyfilter',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 导出物料信息
|
||||||
|
export function exportEnergyPlcExcel(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/material-use-log/materialTraceExport',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
35
src/api/quality/materialTraceability.js
Normal file
35
src/api/quality/materialTraceability.js
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zhp
|
||||||
|
* @Date: 2023-10-18 09:33:57
|
||||||
|
* @LastEditTime: 2023-10-31 10:28:51
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
|
||||||
|
// 获得物料信息追溯page
|
||||||
|
export function getMaterialUseLogPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/material-use-log/materialTrace',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getWorkOrderList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/core-work-order/listbyfilter',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 导出物料信息
|
||||||
|
export function exportEnergyPlcExcel(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/material-use-log/materialTraceExport',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
35
src/api/quality/processTraceability.js
Normal file
35
src/api/quality/processTraceability.js
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zhp
|
||||||
|
* @Date: 2023-10-31 15:05:06
|
||||||
|
* @LastEditTime: 2023-11-03 09:05:50
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
|
||||||
|
// 获得工艺信息追溯page
|
||||||
|
export function getProcessTraceabilityPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/process-retrospect/get',
|
||||||
|
method: 'post',
|
||||||
|
data: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getWorkOrderList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/core-work-order/listbyfilter',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 导出物料信息
|
||||||
|
// export function exportEnergyPlcExcel(query) {
|
||||||
|
// return request({
|
||||||
|
// url: '/base/material-use-log/materialTraceExport',
|
||||||
|
// method: 'get',
|
||||||
|
// params: query,
|
||||||
|
// responseType: 'blob'
|
||||||
|
// })
|
||||||
|
// }
|
43
src/api/quality/processTraceabilityDetail.js
Normal file
43
src/api/quality/processTraceabilityDetail.js
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zhp
|
||||||
|
* @Date: 2023-10-18 09:33:57
|
||||||
|
* @LastEditTime: 2023-11-09 15:33:20
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
|
||||||
|
// 获得物料信息追溯page
|
||||||
|
export function getDetMaterial(query) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/process-retrospect/getDetMaterial',
|
||||||
|
method: 'post',
|
||||||
|
data: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getDetValue(query) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/process-retrospect/getDetValue',
|
||||||
|
method: 'post',
|
||||||
|
data: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// export function getWorkOrderList(query) {
|
||||||
|
// return request({
|
||||||
|
// url: '/base/core-work-order/listbyfilter',
|
||||||
|
// method: 'get',
|
||||||
|
// params: query,
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// // 导出物料信息
|
||||||
|
// export function exportEnergyPlcExcel(query) {
|
||||||
|
// return request({
|
||||||
|
// url: '/base/material-use-log/materialTraceExport',
|
||||||
|
// method: 'get',
|
||||||
|
// params: query,
|
||||||
|
// responseType: 'blob'
|
||||||
|
// })
|
||||||
|
// }
|
35
src/api/quality/rawMaterialTraceability.js
Normal file
35
src/api/quality/rawMaterialTraceability.js
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zhp
|
||||||
|
* @Date: 2023-10-31 10:55:20
|
||||||
|
* @LastEditTime: 2023-10-31 15:05:30
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
|
||||||
|
// 获得原料信息追溯page
|
||||||
|
export function getRawMaterialPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/core-work-order-material/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getWorkOrderList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/core-work-order/listbyfilter',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 导出物料信息
|
||||||
|
export function exportEnergyPlcExcel(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/material-use-log/materialTraceExport',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
@ -66,7 +66,10 @@
|
|||||||
:key="col.key"
|
:key="col.key"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
:is="col.subcomponent"
|
:is="col.subcomponent"
|
||||||
:inlineStyle="col.style"></component>
|
v-model="form[col.prop]"
|
||||||
|
:inlineStyle="col.style"
|
||||||
|
@on-change="$emit('update', form)"
|
||||||
|
v-bind="col.bind"></component>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="upload-area"
|
class="upload-area"
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
ref="fileUpload"
|
ref="fileUpload"
|
||||||
>
|
>
|
||||||
<!-- 上传按钮 -->
|
<!-- 上传按钮 -->
|
||||||
<el-button size="mini" type="primary">选取文件</el-button>
|
<el-button size="mini" :disabled="disabled" type="primary">选取文件</el-button>
|
||||||
<!-- 上传提示 -->
|
<!-- 上传提示 -->
|
||||||
<div class="el-upload__tip" slot="tip" v-if="showTip">
|
<div class="el-upload__tip" slot="tip" v-if="showTip">
|
||||||
请上传
|
请上传
|
||||||
@ -66,6 +66,11 @@ export default {
|
|||||||
isShowTip: {
|
isShowTip: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
|
},
|
||||||
|
// 是否禁用
|
||||||
|
disabled: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@ -179,6 +184,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 获取文件名称
|
// 获取文件名称
|
||||||
getFileName(name) {
|
getFileName(name) {
|
||||||
|
console.log('你好', name)
|
||||||
if (name.lastIndexOf("/") > -1) {
|
if (name.lastIndexOf("/") > -1) {
|
||||||
return name.slice(name.lastIndexOf("/") + 1);
|
return name.slice(name.lastIndexOf("/") + 1);
|
||||||
} else {
|
} else {
|
||||||
|
@ -134,7 +134,7 @@ import printPreview from './preview'
|
|||||||
import { MessageBox } from 'element-ui'
|
import { MessageBox } from 'element-ui'
|
||||||
import { hiprint } from 'vue-plugin-hiprint'
|
import { hiprint } from 'vue-plugin-hiprint'
|
||||||
import providers from './providers'
|
import providers from './providers'
|
||||||
import printData from './print-data'
|
// import printData from './print-data'
|
||||||
import $ from 'jquery'
|
import $ from 'jquery'
|
||||||
import SmallTitle from './SmallTitle.vue'
|
import SmallTitle from './SmallTitle.vue'
|
||||||
let hiprintTemplate = null
|
let hiprintTemplate = null
|
||||||
@ -160,6 +160,7 @@ export default {
|
|||||||
// width: 220,
|
// width: 220,
|
||||||
// height: 80
|
// height: 80
|
||||||
},
|
},
|
||||||
|
printData:{},
|
||||||
drawer: false,
|
drawer: false,
|
||||||
// 纸张类型
|
// 纸张类型
|
||||||
paperTypes: {
|
paperTypes: {
|
||||||
@ -355,13 +356,13 @@ export default {
|
|||||||
},
|
},
|
||||||
preView() {
|
preView() {
|
||||||
const { width } = this.curPaper
|
const { width } = this.curPaper
|
||||||
this.$refs.preView.show(hiprintTemplate, printData, width)
|
this.$refs.preView.show(hiprintTemplate, this.printData, width)
|
||||||
},
|
},
|
||||||
print() {
|
print() {
|
||||||
// if (window.hiwebSocket.opened) {
|
// if (window.hiwebSocket.opened) {
|
||||||
const printerList = hiprintTemplate.getPrinterList()
|
const printerList = hiprintTemplate.getPrinterList()
|
||||||
console.log(printerList)
|
console.log(printerList)
|
||||||
hiprintTemplate.print2(printData, { printer: '', title: '预览打印' })
|
hiprintTemplate.print2(this.printData, { printer: '', title: '预览打印' })
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
// this.$message.error('客户端未连接,无法直接打印')
|
// this.$message.error('客户端未连接,无法直接打印')
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2022-08-24 11:19:43
|
* @Date: 2022-08-24 11:19:43
|
||||||
* @LastEditors: DY
|
* @LastEditors: zhp
|
||||||
* @LastEditTime: 2023-09-21 16:02:07
|
* @LastEditTime: 2023-11-01 10:30:12
|
||||||
* @Description:
|
* @Description:
|
||||||
*/
|
*/
|
||||||
export default {
|
export default {
|
||||||
@ -101,7 +101,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 删除
|
// 删除
|
||||||
deleteHandle(id, name, index) {
|
deleteHandle(id, name, index) {
|
||||||
this.$confirm(`确定对${name ? '[名称=' + name + ']' : '[序号=' + index + ']'}进行删除操作?`, "提示", {
|
this.$confirm(`是否确认删除${name ? '[' + name + ']' : '[' + index + ']'}数据项?`, "提示", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2023-08-01 14:55:51
|
* @Date: 2023-08-01 14:55:51
|
||||||
* @LastEditors: zhp
|
* @LastEditors: zhp
|
||||||
* @LastEditTime: 2023-10-30 10:44:48
|
* @LastEditTime: 2023-11-07 19:28:18
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@ -47,6 +47,7 @@ import {
|
|||||||
import {
|
import {
|
||||||
deletePacking,
|
deletePacking,
|
||||||
getPackingPage,
|
getPackingPage,
|
||||||
|
getWorkOrderList,
|
||||||
exportPackingExcel,
|
exportPackingExcel,
|
||||||
} from '@/api/base/packingInfo';
|
} from '@/api/base/packingInfo';
|
||||||
|
|
||||||
@ -102,37 +103,41 @@ export default {
|
|||||||
btnName: '编辑',
|
btnName: '编辑',
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
{
|
|
||||||
type: 'print',
|
|
||||||
btnName: '打印',
|
|
||||||
},
|
|
||||||
this.$auth.hasPermi(`base:packaging-print-log:delete`)
|
this.$auth.hasPermi(`base:packaging-print-log:delete`)
|
||||||
? {
|
? {
|
||||||
type: 'delete',
|
type: 'delete',
|
||||||
btnName: '删除',
|
btnName: '删除',
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
|
{
|
||||||
|
type: 'print',
|
||||||
|
btnName: '打印',
|
||||||
|
},
|
||||||
].filter((v) => v),
|
].filter((v) => v),
|
||||||
tableData: [],
|
tableData: [],
|
||||||
formConfig: [
|
formConfig: [
|
||||||
{
|
{
|
||||||
type: 'input',
|
type: 'select',
|
||||||
label: '工单',
|
label: '工单',
|
||||||
placeholder: '工单',
|
selectOptions: [],
|
||||||
param: 'workOrderId',
|
labelField: 'name',
|
||||||
},
|
valueField: 'id',
|
||||||
{
|
param: 'workOrderId'
|
||||||
|
},
|
||||||
|
{
|
||||||
// parent: 'dateFilterType',
|
// parent: 'dateFilterType',
|
||||||
// 日期选择
|
// 时间段选择
|
||||||
type: 'datePicker',
|
type: 'datePicker',
|
||||||
label: '时间',
|
// label: '时间段',
|
||||||
dateType: 'date',
|
dateType: 'daterange',
|
||||||
placeholder: '选择日期',
|
format: 'yyyy-MM-dd HH:mm:ss',
|
||||||
format: 'yyyy-MM-dd',
|
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||||
valueFormat: 'yyyy-MM-dd',
|
defaultTime: ['00:00:00', '00:00:00'],
|
||||||
|
rangeSeparator: '-',
|
||||||
|
startPlaceholder: '开始时间',
|
||||||
|
endPlaceholder: '结束时间',
|
||||||
param: 'createTime',
|
param: 'createTime',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'button',
|
type: 'button',
|
||||||
btnName: '搜索',
|
btnName: '搜索',
|
||||||
@ -173,7 +178,9 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
AddOrUpdate,
|
AddOrUpdate,
|
||||||
},
|
},
|
||||||
created() {},
|
created() {
|
||||||
|
this.getDict()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getDataList() {
|
getDataList() {
|
||||||
this.dataListLoading = true;
|
this.dataListLoading = true;
|
||||||
@ -183,6 +190,30 @@ export default {
|
|||||||
this.dataListLoading = false;
|
this.dataListLoading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
getDict() {
|
||||||
|
// 获取产品的属性列表
|
||||||
|
// getCustomerList().then((response) => {
|
||||||
|
// console.log(response);
|
||||||
|
// this.customerList = response.data
|
||||||
|
// // this.listQuery.total = response.data.total;
|
||||||
|
// })
|
||||||
|
// getModelList().then((response) => {
|
||||||
|
// console.log(response);
|
||||||
|
// this.modelList = response.data
|
||||||
|
// // this.listQuery.total = response.data.total;
|
||||||
|
// })
|
||||||
|
getWorkOrderList().then((response) => {
|
||||||
|
// console.log(response);
|
||||||
|
this.formConfig[0].selectOptions = response.data.map((item) => {
|
||||||
|
return {
|
||||||
|
name: item.name,
|
||||||
|
id: item.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(this.formConfig[0].selectOptions);
|
||||||
|
// this.listQuery.total = response.data.total;
|
||||||
|
})
|
||||||
|
},
|
||||||
handlePrint(id) {
|
handlePrint(id) {
|
||||||
if (id) {
|
if (id) {
|
||||||
getPackingModel(id).then(res => {
|
getPackingModel(id).then(res => {
|
||||||
@ -259,8 +290,14 @@ export default {
|
|||||||
case 'search':
|
case 'search':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 10;
|
||||||
this.listQuery.packagingCode = val.packagingCode;
|
this.listQuery.workOrderId = val.workOrderId;
|
||||||
this.listQuery.createTime = val.createTime;
|
if (val.createTime && val.createTime.length != 0) {
|
||||||
|
this.listQuery.createTime = val.createTime
|
||||||
|
// this.listQuery.createTime[1] = val.timeVal[1]
|
||||||
|
} else {
|
||||||
|
this.listQuery.createTime = undefined
|
||||||
|
// this.listQuery.endTime = undefined
|
||||||
|
}
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
console.log(this.tableData)
|
console.log(this.tableData)
|
||||||
break;
|
break;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2023-08-01 14:55:51
|
* @Date: 2023-08-01 14:55:51
|
||||||
* @LastEditors: zhp
|
* @LastEditors: zhp
|
||||||
* @LastEditTime: 2023-10-30 10:45:23
|
* @LastEditTime: 2023-11-01 10:28:29
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@ -44,7 +44,7 @@ const tableProps = [
|
|||||||
{
|
{
|
||||||
prop: 'printModel',
|
prop: 'printModel',
|
||||||
label: '打印方式',
|
label: '打印方式',
|
||||||
filter: (val) => val ==1 ? '自动打印' : '自动打印',
|
filter: (val) => val ==1 ? '自动打印' : '手动打印',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'remark',
|
prop: 'remark',
|
||||||
@ -71,17 +71,16 @@ export default {
|
|||||||
btnName: '编辑',
|
btnName: '编辑',
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
{
|
|
||||||
type: 'print',
|
|
||||||
btnName: '打印',
|
|
||||||
},
|
|
||||||
this.$auth.hasPermi(`base:packaging-print-model:delete`)
|
this.$auth.hasPermi(`base:packaging-print-model:delete`)
|
||||||
? {
|
? {
|
||||||
type: 'delete',
|
type: 'delete',
|
||||||
btnName: '删除',
|
btnName: '删除',
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
|
{
|
||||||
|
type: 'print',
|
||||||
|
btnName: '查看',
|
||||||
|
},
|
||||||
].filter((v) => v),
|
].filter((v) => v),
|
||||||
tableData: [],
|
tableData: [],
|
||||||
formConfig: [
|
formConfig: [
|
||||||
@ -102,12 +101,12 @@ export default {
|
|||||||
// valueFormat: 'yyyy-MM-dd',
|
// valueFormat: 'yyyy-MM-dd',
|
||||||
// param: 'createTime',
|
// param: 'createTime',
|
||||||
// },
|
// },
|
||||||
{
|
// {
|
||||||
type: 'button',
|
// type: 'button',
|
||||||
btnName: '搜索',
|
// btnName: '搜索',
|
||||||
name: 'search',
|
// name: 'search',
|
||||||
color: 'primary',
|
// color: 'primary',
|
||||||
},
|
// },
|
||||||
// {
|
// {
|
||||||
// type: 'separate',
|
// type: 'separate',
|
||||||
// },
|
// },
|
||||||
@ -121,7 +120,7 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: this.$auth.hasPermi('base:packaging-print-model:create') ? 'button' : '',
|
type: this.$auth.hasPermi('base:packaging-print-model:create') ? 'button' : '',
|
||||||
btnName: '新增',
|
btnName: '新增模板',
|
||||||
name: 'add',
|
name: 'add',
|
||||||
color: 'success',
|
color: 'success',
|
||||||
plain: true,
|
plain: true,
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<div v-if="tableData.length">
|
<div v-if="tableData.length">
|
||||||
<base-table v-loading="dataListLoading" :span-method="mergeColumnHandler" :table-props="tableProps" :table-data="tableData" />
|
<base-table v-loading="dataListLoading" :span-method="mergeColumnHandler" :table-props="tableProps" :table-data="tableData" />
|
||||||
<SearchBar :formConfigs="[{ label: '产线平衡分析图', type: 'title' }]" />
|
<SearchBar :formConfigs="[{ label: '产线平衡分析图', type: 'title' }]" />
|
||||||
<balance-chart ref="lineChart" />
|
<BalanceChart ref="lineChart" />
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="no-data-bg"></div>
|
<div v-else class="no-data-bg"></div>
|
||||||
<!-- <pagination
|
<!-- <pagination
|
||||||
@ -19,7 +19,7 @@
|
|||||||
// import basicPage from '../../mixins/basic-page';
|
// import basicPage from '../../mixins/basic-page';
|
||||||
import { parseTime } from '../../mixins/code-filter';
|
import { parseTime } from '../../mixins/code-filter';
|
||||||
import { getCT } from '@/api/core/analysis/index';
|
import { getCT } from '@/api/core/analysis/index';
|
||||||
import { getProductionLinePage } from '@/api/core/base/productionLine';
|
import { getCorePLList } from '@/api/base/coreProductionLine';
|
||||||
import BalanceChart from '../balanceChart'
|
import BalanceChart from '../balanceChart'
|
||||||
import { time } from 'echarts';
|
import { time } from 'echarts';
|
||||||
// import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
|
// import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
|
||||||
@ -68,7 +68,7 @@ export default {
|
|||||||
spanArr: [],
|
spanArr: [],
|
||||||
xData: [],
|
xData: [],
|
||||||
yData: [],
|
yData: [],
|
||||||
optionArrUrl: [getProductionLinePage],
|
optionArrUrl: [getCorePLList],
|
||||||
formConfig: [
|
formConfig: [
|
||||||
{
|
{
|
||||||
type: 'select',
|
type: 'select',
|
||||||
@ -111,7 +111,7 @@ export default {
|
|||||||
}
|
}
|
||||||
this.optionArrUrl.forEach((item, index) => {
|
this.optionArrUrl.forEach((item, index) => {
|
||||||
item(params).then((response) => {
|
item(params).then((response) => {
|
||||||
this.formConfig[index].selectOptions = response.data.list
|
this.formConfig[index].selectOptions = response.data
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -212,8 +212,10 @@ export default {
|
|||||||
}
|
}
|
||||||
this.tableProps = arr
|
this.tableProps = arr
|
||||||
|
|
||||||
console.log('表格横坐标', this.xData)
|
console.log('表格横坐标', this.xData, this.yData)
|
||||||
this.$refs.lineChart.initChart(this.xData, this.yData)
|
this.$nextTick(() => {
|
||||||
|
this.$refs.lineChart.initChart(this.xData, this.yData)
|
||||||
|
})
|
||||||
// this.total = response.data.total;
|
// this.total = response.data.total;
|
||||||
// this.dataListLoading = false;
|
// this.dataListLoading = false;
|
||||||
});
|
});
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zhp
|
* @Author: zhp
|
||||||
* @Date: 2023-09-13 09:02:25
|
* @Date: 2023-09-13 09:02:25
|
||||||
* @LastEditTime: 2023-10-08 16:36:37
|
* @LastEditTime: 2023-11-10 10:48:09
|
||||||
* @LastEditors: DY
|
* @LastEditors: DY
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
@ -10,7 +10,7 @@
|
|||||||
<div style="margin: 20px">
|
<div style="margin: 20px">
|
||||||
<el-button v-for="(item, index) in buttonList" :key="index" :class="[item.actived ? 'activeButton': 'normalButton']" @click="changeChart(index)">{{ item.name }}</el-button>
|
<el-button v-for="(item, index) in buttonList" :key="index" :class="[item.actived ? 'activeButton': 'normalButton']" @click="changeChart(index)">{{ item.name }}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div ref="chartDiv" :class="className" :style="{height:height,width:width}" />
|
<div id="chart" ref="chartDiv" :class="className" :style="{height:height,width:width}" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -48,6 +48,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
// this.initChart()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeChart(index) {
|
changeChart(index) {
|
||||||
@ -81,7 +82,8 @@ export default {
|
|||||||
console.log('看一下数据', this.dataArray)
|
console.log('看一下数据', this.dataArray)
|
||||||
this.xDatas = xData
|
this.xDatas = xData
|
||||||
this.chart = echarts.init(this.$refs.chartDiv, 'macarons')
|
this.chart = echarts.init(this.$refs.chartDiv, 'macarons')
|
||||||
this.setOptions(xData, yData[0], lineName)
|
// this.chart = echarts.init(document.getElementById('chart'), 'macarons')
|
||||||
|
// this.setOptions(xData, yData[0], lineName)
|
||||||
},
|
},
|
||||||
setOptions(xData, dataList, lineName) {
|
setOptions(xData, dataList, lineName) {
|
||||||
// let seriesData = []
|
// let seriesData = []
|
||||||
|
@ -21,6 +21,7 @@ import { parseTime } from '../../mixins/code-filter';
|
|||||||
import { getYieldAnalysisPageData } from '@/api/core/analysis/index';
|
import { getYieldAnalysisPageData } from '@/api/core/analysis/index';
|
||||||
// import { getProductionLinePage } from '@/api/core/base/productionLine';
|
// import { getProductionLinePage } from '@/api/core/base/productionLine';
|
||||||
import lineChart from '../LineChart'
|
import lineChart from '../LineChart'
|
||||||
|
import moment from 'moment';
|
||||||
// import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
|
// import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
|
||||||
|
|
||||||
// const tableProps = [
|
// const tableProps = [
|
||||||
@ -62,6 +63,9 @@ export default {
|
|||||||
recordTime: []
|
recordTime: []
|
||||||
},
|
},
|
||||||
dateLabelList: [],
|
dateLabelList: [],
|
||||||
|
tempTtime: '',
|
||||||
|
day: 0,
|
||||||
|
xData: [],
|
||||||
formConfig: [
|
formConfig: [
|
||||||
// {
|
// {
|
||||||
// type: 'select',
|
// type: 'select',
|
||||||
@ -109,111 +113,77 @@ export default {
|
|||||||
// });
|
// });
|
||||||
// });
|
// });
|
||||||
// },
|
// },
|
||||||
getData() {
|
// 设置表头和横坐标
|
||||||
// this.listQuery.lineIds = ['1672847052717821953']
|
setHeader() {
|
||||||
// this.listQuery.productId = val.productId;
|
const month = this.tempTtime.getMonth() + 1
|
||||||
// this.listQuery.time = '1694486098000';
|
let arr = [
|
||||||
this.urlOptions.getDataListURL(this.listQuery).then(res => {
|
{
|
||||||
let arr = [
|
prop: 'proName',
|
||||||
{
|
label: '产品名称',
|
||||||
prop: 'lineName',
|
fixed: 'left'
|
||||||
label: '产线',
|
},
|
||||||
fixed: 'left'
|
{
|
||||||
},
|
prop: 'specifications',
|
||||||
{
|
label: '产品规格',
|
||||||
prop: 'sum',
|
fixed: 'left'
|
||||||
label: '合计',
|
},
|
||||||
fixed: 'left'
|
{
|
||||||
},
|
prop: 'sum',
|
||||||
{
|
label: '合计',
|
||||||
prop: res.data ? res.data.nameData[0].name : undefined,
|
fixed: 'left'
|
||||||
label: res.data ? res.data.nameData[0].name : undefined,
|
},
|
||||||
align: 'center',
|
{
|
||||||
children:[
|
label: this.tempTtime.getFullYear() + '年' + month + '月',
|
||||||
|
align: 'center',
|
||||||
]
|
children: []
|
||||||
}
|
|
||||||
]
|
|
||||||
// console.log(res.data.nameData.slice(1))
|
|
||||||
let xData = []
|
|
||||||
let yAllData = []
|
|
||||||
let lineName = []
|
|
||||||
if (res.data) {
|
|
||||||
let tempDateList = []
|
|
||||||
res.data.nameData.forEach(date => {
|
|
||||||
tempDateList.push(date.name)
|
|
||||||
})
|
|
||||||
this.dateLabelList = Array.from(new Set(tempDateList))
|
|
||||||
|
|
||||||
this.dateLabelList.forEach(item => {
|
|
||||||
if (item.indexOf('年') === -1) {
|
|
||||||
// 构造表头
|
|
||||||
const props = {
|
|
||||||
'prop': item,
|
|
||||||
'label': item
|
|
||||||
}
|
|
||||||
arr[2].children.push(props)
|
|
||||||
|
|
||||||
// 构造echarts横坐标
|
|
||||||
xData.push(item)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// res.data.nameData.slice(1).forEach(item => {
|
|
||||||
// const props = {
|
|
||||||
// 'prop': item.name,
|
|
||||||
// 'label': item.name,
|
|
||||||
// 'align': 'center'
|
|
||||||
// }
|
|
||||||
// arr[2].children.push(props)
|
|
||||||
// })
|
|
||||||
let tableDataArr =[]
|
|
||||||
res.data.data.forEach(item => {
|
|
||||||
let obj = {}
|
|
||||||
obj.lineName= item.lineName,
|
|
||||||
obj.sum= item.sum,
|
|
||||||
item.data.forEach((ele, index) => {
|
|
||||||
// console.log(ele)
|
|
||||||
ele.children.forEach((e) => {
|
|
||||||
console.log(e.dynamicName)
|
|
||||||
obj['' + e.dynamicName + ''] = e.dynamicValue
|
|
||||||
console.log(obj['' + e.dynamicName + '']);
|
|
||||||
})
|
|
||||||
})
|
|
||||||
tableDataArr.push(obj)
|
|
||||||
});
|
|
||||||
this.tableData = tableDataArr
|
|
||||||
this.tableProps = arr
|
|
||||||
|
|
||||||
// let tempList = []
|
|
||||||
// res.data.nameData.slice(1).forEach(item => {
|
|
||||||
// tempList.push(item.name)
|
|
||||||
// // arr[2].children.push(props)
|
|
||||||
// })
|
|
||||||
// xData = Array.from(new Set(tempList))
|
|
||||||
|
|
||||||
res.data.data.forEach(item => {
|
|
||||||
let yData = []
|
|
||||||
lineName.push(item.lineName)
|
|
||||||
// let obj = {}
|
|
||||||
// obj.lineName = item.lineName,
|
|
||||||
// obj.sum = item.sum,
|
|
||||||
item.data.forEach((ele, index) => {
|
|
||||||
// console.log(ele)
|
|
||||||
ele.children.forEach((e) => {
|
|
||||||
// let yData = []
|
|
||||||
yData.push(e.dynamicValue)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
yAllData.push(yData)
|
|
||||||
});
|
|
||||||
console.log(lineName)
|
|
||||||
} else {
|
|
||||||
this.tableProps = arr
|
|
||||||
this.tableData = []
|
|
||||||
xData = []
|
|
||||||
yAllData = []
|
|
||||||
lineName = []
|
|
||||||
}
|
}
|
||||||
|
]
|
||||||
|
for (let d = 1; d <= this.day; d ++) {
|
||||||
|
arr[3].children.push({
|
||||||
|
prop: 'value' + d, label: month + '-' + d
|
||||||
|
})
|
||||||
|
// 横坐标
|
||||||
|
this.xData.push(month + '-' + d)
|
||||||
|
}
|
||||||
|
this.tableProps = arr
|
||||||
|
},
|
||||||
|
getData() {
|
||||||
|
this.urlOptions.getDataListURL(this.listQuery).then(res => {
|
||||||
|
//构造数据
|
||||||
|
if (res.data) {
|
||||||
|
this.setHeader()
|
||||||
|
res.data.forEach(item => {
|
||||||
|
console.log('111', item.recordTime, moment(item.recordTime).format('DD'))
|
||||||
|
this.tableData.push({
|
||||||
|
proName: item.proName,
|
||||||
|
specifications: item.specifications
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
console.log('饿', this.tableData)
|
||||||
|
// res.data.data.forEach(item => {
|
||||||
|
// let yData = []
|
||||||
|
// lineName.push(item.lineName)
|
||||||
|
// // let obj = {}
|
||||||
|
// // obj.lineName = item.lineName,
|
||||||
|
// // obj.sum = item.sum,
|
||||||
|
// item.data.forEach((ele, index) => {
|
||||||
|
// // console.log(ele)
|
||||||
|
// ele.children.forEach((e) => {
|
||||||
|
// // let yData = []
|
||||||
|
// yData.push(e.dynamicValue)
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// yAllData.push(yData)
|
||||||
|
// });
|
||||||
|
// console.log(lineName)
|
||||||
|
// } else {
|
||||||
|
// this.tableProps = arr
|
||||||
|
// this.tableData = []
|
||||||
|
// xData = []
|
||||||
|
// yAllData = []
|
||||||
|
// lineName = []
|
||||||
|
// }
|
||||||
// res.data.data[0].data[0].children.forEach((item, index) => {
|
// res.data.data[0].data[0].children.forEach((item, index) => {
|
||||||
// // console.log(item)
|
// // console.log(item)
|
||||||
// yData.push(item.dynamicValue)
|
// yData.push(item.dynamicValue)
|
||||||
@ -221,7 +191,7 @@ export default {
|
|||||||
// // obj['' + item.dynamicName + ''] = item.dynamicValue
|
// // obj['' + item.dynamicName + ''] = item.dynamicValue
|
||||||
// })
|
// })
|
||||||
// console.log(this.yData)
|
// console.log(this.yData)
|
||||||
this.$refs.lineChart.initChart(xData, yAllData, lineName)
|
// this.$refs.lineChart.initChart(this.xData, yAllData, lineName)
|
||||||
// this.total = response.data.total;
|
// this.total = response.data.total;
|
||||||
// this.dataListLoading = false;
|
// this.dataListLoading = false;
|
||||||
});
|
});
|
||||||
@ -231,23 +201,21 @@ export default {
|
|||||||
case 'search':
|
case 'search':
|
||||||
// this.listQuery.recordTime = val.time ? new Date(val.time).getTime() : undefined
|
// this.listQuery.recordTime = val.time ? new Date(val.time).getTime() : undefined
|
||||||
if (val.time) {
|
if (val.time) {
|
||||||
const tempTtime = new Date(val.time)
|
this.tempTtime = new Date(val.time)
|
||||||
let day = 0
|
switch (this.tempTtime.getMonth() + 1) {
|
||||||
switch (tempTtime.getMonth() + 1) {
|
|
||||||
case 1, 3, 5, 7, 8, 10, 12:
|
case 1, 3, 5, 7, 8, 10, 12:
|
||||||
day = 31;
|
this.day = 31;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
day = 28;
|
this.day = 28;
|
||||||
break;
|
break;
|
||||||
case 4, 6, 9, 11:
|
case 4, 6, 9, 11:
|
||||||
day = 30;
|
this.day = 30;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
console.log(parseTime(new Date(tempTtime.getFullYear(), 11, 31, 23, 59, 59)))
|
|
||||||
this.listQuery.recordTime = [
|
this.listQuery.recordTime = [
|
||||||
val.time,
|
val.time,
|
||||||
parseTime(new Date(tempTtime.getFullYear(), tempTtime.getMonth(), day, 23, 59, 59))
|
parseTime(new Date(this.tempTtime.getFullYear(), this.tempTtime.getMonth(), this.day, 23, 59, 59))
|
||||||
]
|
]
|
||||||
this.getData()
|
this.getData()
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2022-08-24 11:19:43
|
* @Date: 2022-08-24 11:19:43
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zhp
|
||||||
* @LastEditTime: 2023-08-03 14:21:04
|
* @LastEditTime: 2023-11-06 15:59:53
|
||||||
* @Description:
|
* @Description:
|
||||||
*/
|
*/
|
||||||
export default {
|
export default {
|
||||||
@ -80,7 +80,7 @@ export default {
|
|||||||
if (this.dataForm.id) {
|
if (this.dataForm.id) {
|
||||||
this.urlOptions.updateURL(this.dataForm).then(response => {
|
this.urlOptions.updateURL(this.dataForm).then(response => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
this.$emit("refreshDataList");
|
this.$emit("refreshDataList");
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: Do not edit
|
* @Author: Do not edit
|
||||||
* @Date: 2023-08-29 14:59:29
|
* @Date: 2023-08-29 14:59:29
|
||||||
* @LastEditTime: 2023-10-16 15:10:42
|
* @LastEditTime: 2023-11-07 18:48:35
|
||||||
* @LastEditors: DY
|
* @LastEditors: DY
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
@ -175,7 +175,7 @@ export default {
|
|||||||
label: '统计开始时间',
|
label: '统计开始时间',
|
||||||
dateType: 'datetimerange',
|
dateType: 'datetimerange',
|
||||||
format: 'yyyy-MM-dd HH:mm:ss',
|
format: 'yyyy-MM-dd HH:mm:ss',
|
||||||
valueFormat: "yyyy-MM-ddTHH:mm:ss",
|
valueFormat: "yyyy-MM-dd HH:mm:ss",
|
||||||
rangeSeparator: '-',
|
rangeSeparator: '-',
|
||||||
startPlaceholder: '开始时间',
|
startPlaceholder: '开始时间',
|
||||||
endPlaceholder: '结束时间',
|
endPlaceholder: '结束时间',
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { getPdlDataOneDay } from '@/api/core/monitoring/data24'
|
import { getPdlDataOneDay } from '@/api/core/monitoring/data24'
|
||||||
import { parseTime } from '../../mixins/code-filter';
|
import { parseTime } from '../../mixins/code-filter';
|
||||||
|
import { Loading } from 'element-ui';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'productionLineData24',
|
name: 'productionLineData24',
|
||||||
@ -105,13 +106,13 @@ export default {
|
|||||||
let sectionArr= []
|
let sectionArr= []
|
||||||
console.log('打印看下数据list', list)
|
console.log('打印看下数据list', list)
|
||||||
list.forEach((ele, index) => {
|
list.forEach((ele, index) => {
|
||||||
let tempData = []
|
let tempData = {}
|
||||||
tempData[ele.recordTime + '_up'] = ele.inputNum
|
tempData[ele.recordTime + '_up'] = ele.inputNum
|
||||||
tempData[ele.recordTime + '_down'] = ele.outputNum
|
tempData[ele.recordTime + '_down'] = ele.outputNum
|
||||||
tempData[ele.recordTime + '_up'] = ele.inputNum
|
tempData[ele.recordTime + '_up'] = ele.inputNum
|
||||||
tempData['proLineName'] = ele.lineName
|
tempData['proLineName'] = ele.lineName
|
||||||
tempData['workOrderName'] = ele.workOrderName
|
tempData['workOrderName'] = ele.workOrderName
|
||||||
tempData['spec'] = ele.spec
|
tempData['spec'] = ele.specifications
|
||||||
this.tableData.push(tempData)
|
this.tableData.push(tempData)
|
||||||
console.log('看看数据', this.tableData, tempData)
|
console.log('看看数据', this.tableData, tempData)
|
||||||
const { proLineName } = tempData
|
const { proLineName } = tempData
|
||||||
|
@ -1,46 +1,69 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-drawer
|
<div>
|
||||||
title="发货清单详情"
|
<el-drawer
|
||||||
size="60%"
|
title="发货清单详情"
|
||||||
:append-to-body="true"
|
size="60%"
|
||||||
:visible.sync="centervisible"
|
:append-to-body="true"
|
||||||
@close='close'>
|
:visible.sync="centervisible"
|
||||||
<div class="box1">
|
@close='close'>
|
||||||
<el-row>
|
<div class="box1">
|
||||||
<el-col :span='12'>
|
<el-row>
|
||||||
<span class="title">订单名:</span>
|
<el-col :span='12'>
|
||||||
<span class="text">{{orderName ? orderName : '-'}}</span>
|
<span class="title">订单名:</span>
|
||||||
</el-col>
|
<span class="text">{{orderName ? orderName : '-'}}</span>
|
||||||
<el-col :span='12'>
|
</el-col>
|
||||||
<span class="title">发货单号:</span>
|
<el-col :span='12'>
|
||||||
<span class="text">{{code ? code : '-'}}</span>
|
<span class="title">发货单号:</span>
|
||||||
</el-col>
|
<span class="text">{{code ? code : '-'}}</span>
|
||||||
</el-row>
|
</el-col>
|
||||||
</div>
|
</el-row>
|
||||||
<div class="box2">
|
|
||||||
<div class="boxTitle">
|
|
||||||
<span class="blueTitle"></span>
|
|
||||||
<span>详情</span>
|
|
||||||
</div>
|
</div>
|
||||||
<base-table
|
<div class="box2">
|
||||||
:page="queryParams.pageNo"
|
<div class="boxTitle">
|
||||||
:limit="queryParams.pageSize"
|
<span class="blueTitle"></span>
|
||||||
:table-props="tableProps"
|
<span>详情</span>
|
||||||
:table-data="tableData"
|
</div>
|
||||||
:max-height="tableH"
|
<base-table
|
||||||
/>
|
:page="queryParams.pageNo"
|
||||||
<pagination
|
:limit="queryParams.pageSize"
|
||||||
:page.sync="queryParams.pageNo"
|
:table-props="tableProps"
|
||||||
:limit.sync="queryParams.pageSize"
|
:table-data="tableData"
|
||||||
:total="total"
|
:max-height="tableH"
|
||||||
@pagination="getList"
|
>
|
||||||
/>
|
<method-btn
|
||||||
</div>
|
v-if="tableBtn.length"
|
||||||
</el-drawer>
|
slot="handleBtn"
|
||||||
|
:width="80"
|
||||||
|
label="操作"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="editDetDetail"
|
||||||
|
/>
|
||||||
|
</base-table>
|
||||||
|
<pagination
|
||||||
|
:page.sync="queryParams.pageNo"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
:total="total"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</el-drawer>
|
||||||
|
<!-- 编辑详情 -->
|
||||||
|
<base-dialog
|
||||||
|
dialogTitle="编辑"
|
||||||
|
:dialogVisible="detailEditVisible"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
@confirm="handleConfirm"
|
||||||
|
:before-close="handleCancel"
|
||||||
|
width="50%"
|
||||||
|
>
|
||||||
|
<edit-detail ref="editDetail" @successSubmit="successSubmit" />
|
||||||
|
</base-dialog>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { parseTime } from '@/utils/ruoyi'
|
import { parseTime } from '@/utils/ruoyi'
|
||||||
import { deliveryLogDetPage } from '@/api/base/delivery'
|
import { deliveryLogDetPage } from '@/api/base/delivery'
|
||||||
|
import EditDetail from './editDetail.vue'
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
prop: 'createTime',
|
prop: 'createTime',
|
||||||
@ -51,6 +74,7 @@ const tableProps = [
|
|||||||
{
|
{
|
||||||
prop: 'deliveryCarCode',
|
prop: 'deliveryCarCode',
|
||||||
label: '装车单号',
|
label: '装车单号',
|
||||||
|
minWidth: 100,
|
||||||
showOverflowtooltip: true
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -96,11 +120,21 @@ export default {
|
|||||||
total: 0,
|
total: 0,
|
||||||
tableProps,
|
tableProps,
|
||||||
tableData: [],
|
tableData: [],
|
||||||
|
tableBtn: [
|
||||||
|
this.$auth.hasPermi('extend:delivery-log:update')
|
||||||
|
? {
|
||||||
|
type: 'edit',
|
||||||
|
btnName: '编辑'
|
||||||
|
}
|
||||||
|
: undefined
|
||||||
|
].filter((v) => v),
|
||||||
tableH: this.tableHeight(275),
|
tableH: this.tableHeight(275),
|
||||||
orderName: '',
|
orderName: '',
|
||||||
code: ''
|
code: '',
|
||||||
|
detailEditVisible: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
components: { EditDetail },
|
||||||
mounted() {
|
mounted() {
|
||||||
window.addEventListener('resize', () => {
|
window.addEventListener('resize', () => {
|
||||||
this.tableH = this.tableHeight(275)
|
this.tableH = this.tableHeight(275)
|
||||||
@ -128,6 +162,23 @@ export default {
|
|||||||
this.queryParams.logId = ''
|
this.queryParams.logId = ''
|
||||||
this.tableData = []
|
this.tableData = []
|
||||||
this.total = 0
|
this.total = 0
|
||||||
|
},
|
||||||
|
editDetDetail(val) {
|
||||||
|
this.detailEditVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.editDetail.init(val.data.id)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleCancel() {
|
||||||
|
this.$refs.editDetail.formClear()
|
||||||
|
this.detailEditVisible = false
|
||||||
|
},
|
||||||
|
handleConfirm() {
|
||||||
|
this.$refs.editDetail.submitForm()
|
||||||
|
},
|
||||||
|
successSubmit() {
|
||||||
|
this.handleCancel()
|
||||||
|
this.getList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -154,11 +205,13 @@ export default {
|
|||||||
padding: 8px 8px 8px 40px;
|
padding: 8px 8px 8px 40px;
|
||||||
.title {
|
.title {
|
||||||
height: 16px;
|
height: 16px;
|
||||||
|
font-size: 14px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: rgba(0,0,0,0.85);
|
color: rgba(0,0,0,0.85);
|
||||||
}
|
}
|
||||||
.text {
|
.text {
|
||||||
height: 16px;
|
height: 16px;
|
||||||
|
font-size: 14px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: rgba(102,102,102,0.75);
|
color: rgba(102,102,102,0.75);
|
||||||
}
|
}
|
||||||
|
124
src/views/delivery/deliveryLog/components/editDetail.vue
Normal file
124
src/views/delivery/deliveryLog/components/editDetail.vue
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
<template>
|
||||||
|
<el-form ref="addOrUpdate" :rules="rules" label-width="130px" :model="form">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span='12'>
|
||||||
|
<el-form-item label="装车单号" prop="deliveryCarCode">
|
||||||
|
<el-input v-model="form.deliveryCarCode"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span='12'>
|
||||||
|
<el-form-item label="装车时间" prop="loadTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="form.loadTime"
|
||||||
|
type="datetime"
|
||||||
|
format='yyyy-MM-dd HH:mm:ss'
|
||||||
|
value-format="timestamp"
|
||||||
|
style="width: 100%;"
|
||||||
|
placeholder="选择日期">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span='12'>
|
||||||
|
<el-form-item label="装车产品" prop="productId">
|
||||||
|
<el-select v-model="form.productId" disabled placeholder="请选择" style="width: 100%;">
|
||||||
|
<el-option
|
||||||
|
v-for="item in productList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span='12'>
|
||||||
|
<el-form-item label="装箱规格(片/箱)" prop="packagingSize">
|
||||||
|
<el-input-number v-model="form.packagingSize" :min="0" :max='9999999999' style="width:100%"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span='12'>
|
||||||
|
<el-form-item label="产品批次" prop="productDate">
|
||||||
|
<el-input v-model="form.productDate" placeholder="多个批次用','隔开"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span='12'>
|
||||||
|
<el-form-item label="箱/托数" prop="packagingNum">
|
||||||
|
<el-input-number v-model="form.packagingNum" :min="0" :max='9999999999' style="width:100%"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span='12'>
|
||||||
|
<el-form-item label="装车总量" prop="quantity">
|
||||||
|
<el-input-number v-model="form.quantity" :min="0" :max='9999999999' style="width:100%"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { getProductAll } from '@/api/base/product'
|
||||||
|
import { deliveryLogDetGet, deliveryLogDetUpdate } from '@/api/base/delivery'
|
||||||
|
export default {
|
||||||
|
name: 'editDetail',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
form: {
|
||||||
|
logId: '',
|
||||||
|
deliveryCarCode: '',
|
||||||
|
loadTime: null,
|
||||||
|
productId: '',
|
||||||
|
packagingSize: null,
|
||||||
|
productDate: '',
|
||||||
|
packagingNum: null,
|
||||||
|
quantity: null
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
deliveryCarCode: [{ required: true, message: "装车单号不能为空", trigger: "blur" }],
|
||||||
|
productId: [{ required: true, message: "装车产品不能为空", trigger: "change" }],
|
||||||
|
packagingSize: [{ required: true, message: "装箱规格不能为空", trigger: "blur" }],
|
||||||
|
packagingNum: [{ required: true, message: "箱/托数不能为空", trigger: "blur" }],
|
||||||
|
quantity: [{ required: true, message: "装车总量不能为空", trigger: "blur" }]
|
||||||
|
},
|
||||||
|
productList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getSelectList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init(id) {
|
||||||
|
deliveryLogDetGet({id}).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
this.form = res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getSelectList() {
|
||||||
|
getProductAll().then(res => {
|
||||||
|
this.productList = res.data || []
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submitForm() {
|
||||||
|
this.$refs['addOrUpdate'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
console.log(this.form)
|
||||||
|
deliveryLogDetUpdate({ ...this.form }).then((res) => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.$modal.msgSuccess("操作成功");
|
||||||
|
this.$emit('successSubmit')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
formClear() {
|
||||||
|
this.$refs.addOrUpdate.resetFields()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
@ -39,7 +39,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span='12'>
|
<el-col :span='12'>
|
||||||
<el-form-item label="装车产品" prop="productId">
|
<el-form-item label="装车产品" prop="productId">
|
||||||
<el-select v-model="form.productId" placeholder="请选择" style="width: 100%;">
|
<el-select v-model="form.productId" disabled placeholder="请选择" style="width: 100%;">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in productList"
|
v-for="item in productList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
@ -79,6 +79,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { getProductAll } from '@/api/base/product'
|
import { getProductAll } from '@/api/base/product'
|
||||||
import { deliveryLogDetCreate } from '@/api/base/delivery'
|
import { deliveryLogDetCreate } from '@/api/base/delivery'
|
||||||
|
import { orderDetail } from '@/api/base/orderManage'
|
||||||
export default {
|
export default {
|
||||||
name: 'LoadedPage',
|
name: 'LoadedPage',
|
||||||
data() {
|
data() {
|
||||||
@ -107,16 +108,25 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init(id, code) {
|
init(id, code, orderId) {
|
||||||
this.getSelectList()
|
this.getSelectList()
|
||||||
this.form.logId = id
|
this.form.logId = id
|
||||||
this.code = code
|
this.code = code
|
||||||
|
this.getProductId(orderId)
|
||||||
},
|
},
|
||||||
getSelectList() {
|
getSelectList() {
|
||||||
getProductAll().then(res => {
|
getProductAll().then(res => {
|
||||||
this.productList = res.data || []
|
this.productList = res.data || []
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 获得装车产品
|
||||||
|
getProductId(orderId) {
|
||||||
|
orderDetail({
|
||||||
|
id: orderId
|
||||||
|
}).then(res => {
|
||||||
|
this.form.productId = res.data.planProductId || ''
|
||||||
|
})
|
||||||
|
},
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs['addOrUpdate'].validate((valid) => {
|
this.$refs['addOrUpdate'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
@ -119,7 +119,8 @@ export default {
|
|||||||
{
|
{
|
||||||
type: 'input',
|
type: 'input',
|
||||||
label: '订单名',
|
label: '订单名',
|
||||||
param: 'orderName'
|
param: 'orderName',
|
||||||
|
defaultSelect: ''
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'input',
|
type: 'input',
|
||||||
@ -138,10 +139,10 @@ export default {
|
|||||||
color: 'primary'
|
color: 'primary'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'separate'
|
type: this.$auth.hasPermi('extend:delivery-log:create') ? 'separate' : '',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'button',
|
type: this.$auth.hasPermi('extend:delivery-log:create') ? 'button' : '',
|
||||||
btnName: '新增',
|
btnName: '新增',
|
||||||
name: 'add',
|
name: 'add',
|
||||||
color: 'success',
|
color: 'success',
|
||||||
@ -161,25 +162,25 @@ export default {
|
|||||||
tableH: this.tableHeight(260),
|
tableH: this.tableHeight(260),
|
||||||
total: 0,
|
total: 0,
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
this.$auth.hasPermi('base:group-team:update')
|
this.$auth.hasPermi('extend:delivery-log:loaded')
|
||||||
? {
|
? {
|
||||||
type: 'loaded',
|
type: 'loaded',
|
||||||
btnName: '装车'
|
btnName: '装车'
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
this.$auth.hasPermi('base:group-team:update')
|
this.$auth.hasPermi('extend:delivery-log:detail')
|
||||||
? {
|
? {
|
||||||
type: 'detail',
|
type: 'detail',
|
||||||
btnName: '详情'
|
btnName: '详情'
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
this.$auth.hasPermi('base:group-team:update')
|
this.$auth.hasPermi('extend:delivery-log:update')
|
||||||
? {
|
? {
|
||||||
type: 'edit',
|
type: 'edit',
|
||||||
btnName: '编辑'
|
btnName: '编辑'
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
this.$auth.hasPermi('base:group-team:delete')
|
this.$auth.hasPermi('extend:delivery-log:delete')
|
||||||
? {
|
? {
|
||||||
type: 'delete',
|
type: 'delete',
|
||||||
btnName: '删除'
|
btnName: '删除'
|
||||||
@ -196,10 +197,32 @@ export default {
|
|||||||
window.addEventListener('resize', () => {
|
window.addEventListener('resize', () => {
|
||||||
this.tableH = this.tableHeight(260)
|
this.tableH = this.tableHeight(260)
|
||||||
})
|
})
|
||||||
|
if (location.href.indexOf('?') > 0) {
|
||||||
|
let arr = location.href.split('?')[1]
|
||||||
|
this.formConfig[0].defaultSelect = decodeURI(arr.split('=')[1])
|
||||||
|
} else {
|
||||||
|
this.formConfig[0].defaultSelect = ''
|
||||||
|
}
|
||||||
|
this.queryParams.orderName = this.formConfig[0].defaultSelect
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
components: { AddOrUpdate, LoadedPage, DeliveryLogDetail },
|
components: { AddOrUpdate, LoadedPage, DeliveryLogDetail },
|
||||||
|
watch: {
|
||||||
|
$route: 'initData'
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
initData(to) {
|
||||||
|
if (to.name === 'DeliveryLog') {
|
||||||
|
if (location.href.indexOf('?') > 0) {
|
||||||
|
let arr = location.href.split('?')[1]
|
||||||
|
this.formConfig[0].defaultSelect = decodeURI(arr.split('=')[1])
|
||||||
|
} else {
|
||||||
|
this.formConfig[0].defaultSelect = ''
|
||||||
|
}
|
||||||
|
this.queryParams.orderName = this.formConfig[0].defaultSelect
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
},
|
||||||
getList() {
|
getList() {
|
||||||
deliveryLogPage({...this.queryParams}).then(res => {
|
deliveryLogPage({...this.queryParams}).then(res => {
|
||||||
this.list = res.data.list || []
|
this.list = res.data.list || []
|
||||||
@ -236,7 +259,7 @@ export default {
|
|||||||
case 'loaded':
|
case 'loaded':
|
||||||
this.centervisible2 = true
|
this.centervisible2 = true
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.loadedPage.init(val.data.id, val.data.code)
|
this.$refs.loadedPage.init(val.data.id, val.data.code, val.data.orderId)
|
||||||
})
|
})
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
@ -279,7 +302,7 @@ export default {
|
|||||||
successSubmit2() {
|
successSubmit2() {
|
||||||
this.handleCancel2()
|
this.handleCancel2()
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
@ -19,11 +19,11 @@
|
|||||||
<div class="lightTip">{{orderMsg.num ? orderMsg.num : '-'}}</div>
|
<div class="lightTip">{{orderMsg.num ? orderMsg.num : '-'}}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box_col">
|
<div class="box_col">
|
||||||
<div class="blodTip">累积占比(%)</div>
|
<div class="blodTip">累计占比(%)</div>
|
||||||
<div class="lightTip">{{orderMsg.rate ? orderMsg.rate : '-'}}</div>
|
<div class="lightTip">{{orderMsg.rate ? orderMsg.rate : '-'}}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box_col">
|
<div class="box_col">
|
||||||
<div class="blodTip">累积运输费用</div>
|
<div class="blodTip">累计运输费用</div>
|
||||||
<div class="lightTip">{{orderMsg.cost ? orderMsg.cost : '-'}}</div>
|
<div class="lightTip">{{orderMsg.cost ? orderMsg.cost : '-'}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -305,8 +305,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
legend: {
|
legend: {
|
||||||
bottom: '5%',
|
type: 'scroll',
|
||||||
left: 'center',
|
orient: 'vertical',
|
||||||
|
right: '10%',
|
||||||
|
top: 20,
|
||||||
|
bottom: 20,
|
||||||
icon: 'rect',
|
icon: 'rect',
|
||||||
itemHeight: 8,
|
itemHeight: 8,
|
||||||
itemWidth: 8
|
itemWidth: 8
|
||||||
@ -379,12 +382,14 @@ export default {
|
|||||||
padding: 8px 8px 8px 40px;
|
padding: 8px 8px 8px 40px;
|
||||||
.blodTip {
|
.blodTip {
|
||||||
height: 16px;
|
height: 16px;
|
||||||
|
font-size: 14px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: rgba(0,0,0,0.85);
|
color: rgba(0,0,0,0.85);
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
.lightTip {
|
.lightTip {
|
||||||
height: 16px;
|
height: 16px;
|
||||||
|
font-size: 14px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: rgba(102,102,102,0.75);
|
color: rgba(102,102,102,0.75);
|
||||||
}
|
}
|
||||||
@ -415,11 +420,13 @@ export default {
|
|||||||
padding: 8px 8px 8px 40px;
|
padding: 8px 8px 8px 40px;
|
||||||
.title {
|
.title {
|
||||||
height: 16px;
|
height: 16px;
|
||||||
|
font-size: 14px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: rgba(0,0,0,0.85);
|
color: rgba(0,0,0,0.85);
|
||||||
}
|
}
|
||||||
.text {
|
.text {
|
||||||
height: 16px;
|
height: 16px;
|
||||||
|
font-size: 14px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: rgba(102,102,102,0.75);
|
color: rgba(102,102,102,0.75);
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ const tableProps = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'rate',
|
prop: 'rate',
|
||||||
label: '累积发货比例(%)'
|
label: '累计发货比例(%)'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
export default {
|
export default {
|
||||||
@ -92,7 +92,7 @@ export default {
|
|||||||
tableH: this.tableHeight(260),
|
tableH: this.tableHeight(260),
|
||||||
total: 0,
|
total: 0,
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
this.$auth.hasPermi('base:group-team:update')
|
this.$auth.hasPermi('extend:delivery-log-det:detail')
|
||||||
? {
|
? {
|
||||||
type: 'detail',
|
type: 'detail',
|
||||||
btnName: '详情'
|
btnName: '详情'
|
||||||
|
@ -92,7 +92,7 @@ export default {
|
|||||||
color: 'primary'
|
color: 'primary'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'separate'
|
type: this.$auth.hasPermi('base:energy-type:create') ? 'separate' : '',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: this.$auth.hasPermi('base:energy-type:create') ? 'button' : '',
|
type: this.$auth.hasPermi('base:energy-type:create') ? 'button' : '',
|
||||||
|
@ -62,8 +62,9 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="消耗量阈值" prop="limitValue">
|
<el-form-item label="消耗量阈值">
|
||||||
<el-input-number v-model="form.limitValue" :min="0" :max="10000000000000000" style="width: 100%;"></el-input-number>
|
<el-input-number v-model="form.minValue" placeholder="最小值" :max="10000000000000000" style="width: 50%;"></el-input-number>
|
||||||
|
<el-input-number v-model="form.maxValue" placeholder="最大值" :max="10000000000000000" style="width: 50%;"></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -96,14 +97,16 @@ export default {
|
|||||||
type: '',
|
type: '',
|
||||||
plcParamId: '',
|
plcParamId: '',
|
||||||
limitType: '',
|
limitType: '',
|
||||||
limitValue: ''
|
minValue: null,
|
||||||
|
maxValue: null
|
||||||
},
|
},
|
||||||
objIds: [],// 回显数组
|
objIds: [],// 回显数组
|
||||||
isEdit: false, //是否是编辑
|
isEdit: false, //是否是编辑
|
||||||
rules: {
|
rules: {
|
||||||
objectId: [{ required: true, message: '对象不能为空', trigger: 'change' }],
|
objectId: [{ required: true, message: '对象不能为空', trigger: 'change' }],
|
||||||
energyTypeId: [{ required: true, message: '能源类型不能为空', trigger: 'change' }],
|
energyTypeId: [{ required: true, message: '能源类型不能为空', trigger: 'change' }],
|
||||||
type: [{ required: true, message: '监控模式不能为空', trigger: 'change' }]
|
type: [{ required: true, message: '监控模式不能为空', trigger: 'change' }],
|
||||||
|
limitType: [{ required: true, message: '指标类型不能为空', trigger: 'change' }]
|
||||||
},
|
},
|
||||||
detailList: []
|
detailList: []
|
||||||
}
|
}
|
||||||
@ -199,6 +202,12 @@ export default {
|
|||||||
this.$modal.msgError("监控模式为详细时,详细参数为必填");
|
this.$modal.msgError("监控模式为详细时,详细参数为必填");
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if (this.form.minValue && this.form.maxValue) {
|
||||||
|
if (this.form.minValue > this.form.maxValue) {
|
||||||
|
this.$modal.msgError("消耗量阈值,最小值不能大于最大值");
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
// this.form.limitType = Number(this.form.limitType)
|
// this.form.limitType = Number(this.form.limitType)
|
||||||
if (this.isEdit) {
|
if (this.isEdit) {
|
||||||
// 编辑
|
// 编辑
|
||||||
@ -223,6 +232,10 @@ export default {
|
|||||||
},
|
},
|
||||||
formClear() {
|
formClear() {
|
||||||
this.$refs.form.resetFields()
|
this.$refs.form.resetFields()
|
||||||
|
this.form.type = ''
|
||||||
|
this.form.plcParamId = ''
|
||||||
|
this.form.minValue = null
|
||||||
|
this.form.maxValue = null
|
||||||
this.objIds = ''
|
this.objIds = ''
|
||||||
this.detailList = []
|
this.detailList = []
|
||||||
this.isEdit = false
|
this.isEdit = false
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
@cancel="handleCancel"
|
@cancel="handleCancel"
|
||||||
@confirm="handleConfirm"
|
@confirm="handleConfirm"
|
||||||
:before-close="handleCancel"
|
:before-close="handleCancel"
|
||||||
|
width='60%'
|
||||||
>
|
>
|
||||||
<energy-limit-add ref="energyLimit" @successSubmit="successSubmit" :energyTypeList="energyTypeList" :objList="objList"/>
|
<energy-limit-add ref="energyLimit" @successSubmit="successSubmit" :energyTypeList="energyTypeList" :objList="objList"/>
|
||||||
</base-dialog>
|
</base-dialog>
|
||||||
@ -199,6 +200,15 @@ export default {
|
|||||||
item.type = i.label
|
item.type = i.label
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
if (item.minValue && item.maxValue) {
|
||||||
|
item.limitValue = item.minValue + '-' + item.maxValue
|
||||||
|
} else if(item.minValue){
|
||||||
|
item.limitValue = '最小值' + item.minValue
|
||||||
|
}else if(item.maxValue){
|
||||||
|
item.limitValue = '最大值' + item.maxValue
|
||||||
|
} else {
|
||||||
|
item.limitValue = ''
|
||||||
|
}
|
||||||
})
|
})
|
||||||
this.list = arr
|
this.list = arr
|
||||||
this.total = response.data.total;
|
this.total = response.data.total;
|
||||||
|
@ -136,6 +136,15 @@ export default {
|
|||||||
item.type = i.name
|
item.type = i.name
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
if (item.minValue && item.maxValue) {
|
||||||
|
item.limitValue = item.minValue + '-' + item.maxValue
|
||||||
|
} else if(item.minValue){
|
||||||
|
item.limitValue = '最小值' + item.minValue
|
||||||
|
}else if(item.maxValue){
|
||||||
|
item.limitValue = '最大值' + item.maxValue
|
||||||
|
} else {
|
||||||
|
item.limitValue = ''
|
||||||
|
}
|
||||||
})
|
})
|
||||||
this.list = arr
|
this.list = arr
|
||||||
this.total = response.data.total;
|
this.total = response.data.total;
|
||||||
|
@ -121,8 +121,9 @@ export default {
|
|||||||
this.tableH = this.tableHeight(260)
|
this.tableH = this.tableHeight(260)
|
||||||
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180)
|
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180)
|
||||||
})
|
})
|
||||||
if (this.$route.params.startTime && this.$route.params.endTime) {
|
if (location.href.indexOf('?') > 0) {
|
||||||
this.formConfig[2].defaultSelect = [this.$route.params.startTime, this.$route.params.endTime]
|
let arr = location.href.split('?')[1].split('&')
|
||||||
|
this.formConfig[2].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
|
||||||
} else {
|
} else {
|
||||||
this.formConfig[2].defaultSelect = [Date.now() - 7*24*3600000, Date.now()]
|
this.formConfig[2].defaultSelect = [Date.now() - 7*24*3600000, Date.now()]
|
||||||
}
|
}
|
||||||
@ -138,8 +139,9 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
initData(to) {
|
initData(to) {
|
||||||
if (to.name === 'EnergyReportSearch') {
|
if (to.name === 'EnergyReportSearch') {
|
||||||
if (this.$route.params.startTime && this.$route.params.endTime) {
|
if (location.href.indexOf('?') > 0) {
|
||||||
this.formConfig[2].defaultSelect = [this.$route.params.startTime, this.$route.params.endTime]
|
let arr = location.href.split('?')[1].split('&')
|
||||||
|
this.formConfig[2].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
|
||||||
} else {
|
} else {
|
||||||
this.formConfig[2].defaultSelect = [Date.now() - 7*24*3600000, Date.now()]
|
this.formConfig[2].defaultSelect = [Date.now() - 7*24*3600000, Date.now()]
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,7 @@ export default {
|
|||||||
type: 'select',
|
type: 'select',
|
||||||
label: '能源类型',
|
label: '能源类型',
|
||||||
selectOptions: [],
|
selectOptions: [],
|
||||||
param: 'objType',
|
param: 'energyTypeId',
|
||||||
filterable: true,
|
filterable: true,
|
||||||
width: 120,
|
width: 120,
|
||||||
clearable: false
|
clearable: false
|
||||||
@ -126,7 +126,7 @@ export default {
|
|||||||
selectOptions: this.getDictDatas(this.DICT_TYPE.OBJECT_TYPE),
|
selectOptions: this.getDictDatas(this.DICT_TYPE.OBJECT_TYPE),
|
||||||
labelField: 'label',
|
labelField: 'label',
|
||||||
valueField: 'value',
|
valueField: 'value',
|
||||||
param: 'energyTypeId',
|
param: 'objType',
|
||||||
width: 100,
|
width: 100,
|
||||||
clearable: false
|
clearable: false
|
||||||
},
|
},
|
||||||
|
177
src/views/equipment/analysis/Statistics/index.vue
Normal file
177
src/views/equipment/analysis/Statistics/index.vue
Normal file
@ -0,0 +1,177 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<search-bar
|
||||||
|
:formConfigs="formConfig"
|
||||||
|
ref="searchBarForm"
|
||||||
|
@headBtnClick="buttonClick" />
|
||||||
|
<base-table
|
||||||
|
v-loading="dataListLoading"
|
||||||
|
:table-props="tableProps"
|
||||||
|
:page="listQuery.pageNo"
|
||||||
|
:limit="listQuery.pageSize"
|
||||||
|
:table-data="tableData">
|
||||||
|
<method-btn
|
||||||
|
v-if="tableBtn.length"
|
||||||
|
slot="handleBtn"
|
||||||
|
:width="120"
|
||||||
|
label="操作"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleClick" />
|
||||||
|
</base-table>
|
||||||
|
<pagination
|
||||||
|
:limit.sync="listQuery.pageSize"
|
||||||
|
:page.sync="listQuery.pageNo"
|
||||||
|
:total="listQuery.total"
|
||||||
|
@pagination="getDataList" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import basicPage from '../../../core/mixins/basic-page';
|
||||||
|
import { parseTime } from '../../../core/mixins/code-filter';
|
||||||
|
import {
|
||||||
|
getEqAnalysis,
|
||||||
|
exportEqAnalysisExcel
|
||||||
|
} from '@/api/equipment/analysis/statistics';
|
||||||
|
|
||||||
|
const tableProps = [
|
||||||
|
{
|
||||||
|
prop: 'recordTime',
|
||||||
|
label: '时间段',
|
||||||
|
filter: parseTime
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'lineName',
|
||||||
|
label: '产线'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'sectionName',
|
||||||
|
label: '工段'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'equipmentName',
|
||||||
|
label: '设备名称'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'equipmentType',
|
||||||
|
label: '设备类型'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'workTime',
|
||||||
|
label: '工作时间累积(h)'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'repairCount',
|
||||||
|
label: '维修次数'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'maintainCount',
|
||||||
|
label: '保养次数'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [basicPage],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
urlOptions: {
|
||||||
|
getDataListURL: getEqAnalysis,
|
||||||
|
exportURL: exportEqAnalysisExcel,
|
||||||
|
},
|
||||||
|
tableProps,
|
||||||
|
tableBtn: [].filter((v)=>v),
|
||||||
|
tableData: [],
|
||||||
|
formConfig: [
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: '设备名称',
|
||||||
|
placeholder: '设备名称',
|
||||||
|
param: 'name',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'datePicker',
|
||||||
|
label: '时间段',
|
||||||
|
dateType: 'daterange', // datetimerange
|
||||||
|
// format: 'yyyy-MM-dd HH:mm:ss',
|
||||||
|
format: 'yyyy-MM-dd',
|
||||||
|
// valueFormat: 'timestamp',
|
||||||
|
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||||
|
rangeSeparator: '-',
|
||||||
|
startPlaceholder: '开始日期',
|
||||||
|
endPlaceholder: '结束日期',
|
||||||
|
defaultTime: ['00:00:00', '23:59:59'],
|
||||||
|
param: 'recordTime',
|
||||||
|
defaultSelect: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '查询',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'separate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: this.$auth.hasPermi('equipment:analysis-statistics:export') ? 'button' : '',
|
||||||
|
btnName: '导出',
|
||||||
|
name: 'export',
|
||||||
|
color: 'warning',
|
||||||
|
plain: true
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
methods: {
|
||||||
|
// 获取数据列表
|
||||||
|
getDataList() {
|
||||||
|
this.dataListLoading = true;
|
||||||
|
this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
||||||
|
this.tableData = response.data.list;
|
||||||
|
this.listQuery.total = response.data.total;
|
||||||
|
this.dataListLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
buttonClick(val) {
|
||||||
|
switch (val.btnName) {
|
||||||
|
case 'search':
|
||||||
|
this.listQuery.pageNo = 1;
|
||||||
|
this.listQuery.pageSize = 10;
|
||||||
|
this.listQuery.equipmentName = val.name ? val.name : undefined;
|
||||||
|
this.listQuery.recordTime = val.recordTime ? val.recordTime : undefined;
|
||||||
|
this.getDataList();
|
||||||
|
break;
|
||||||
|
case 'reset':
|
||||||
|
this.$refs.searchBarForm.resetForm();
|
||||||
|
this.listQuery = {
|
||||||
|
pageSize: 10,
|
||||||
|
pageNo: 1,
|
||||||
|
total: 1,
|
||||||
|
};
|
||||||
|
this.getDataList();
|
||||||
|
break;
|
||||||
|
case 'export':
|
||||||
|
this.handleExport();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.log(val);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
// 处理查询参数
|
||||||
|
let params = { ...this.listQuery };
|
||||||
|
params.pageNo = undefined;
|
||||||
|
params.pageSize = undefined;
|
||||||
|
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
||||||
|
this.exportLoading = true;
|
||||||
|
return this.urlOptions.exportURL(params);
|
||||||
|
}).then(response => {
|
||||||
|
this.$download.excel(response, '设备统计分析.xls');
|
||||||
|
this.exportLoading = false;
|
||||||
|
}).catch(() => { });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
65
src/views/equipment/analysis/Visualization/SmallTitle.vue
Normal file
65
src/views/equipment/analysis/Visualization/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: 18px;
|
||||||
|
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>
|
514
src/views/equipment/analysis/Visualization/index.vue
Normal file
514
src/views/equipment/analysis/Visualization/index.vue
Normal file
@ -0,0 +1,514 @@
|
|||||||
|
<!--
|
||||||
|
filename: index.vue
|
||||||
|
author: liubin
|
||||||
|
date: 2023-09-04 09:34:52
|
||||||
|
description: 设备效率分析
|
||||||
|
-->
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="app-container allow-overflow">
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<small-title
|
||||||
|
style="margin: 16px 0; padding-left: 8px"
|
||||||
|
:no-padding="true">
|
||||||
|
设备运行状态
|
||||||
|
</small-title>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="graph"
|
||||||
|
style="
|
||||||
|
overflow: inherit;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
position: relative;
|
||||||
|
">
|
||||||
|
<div class="blue-title">各设备加工数量</div>
|
||||||
|
<div class="legend">
|
||||||
|
<div class="legend-item">
|
||||||
|
<span class="icon blue"></span>
|
||||||
|
<span class="text">工作时长</span>
|
||||||
|
</div>
|
||||||
|
<div class="legend-item">
|
||||||
|
<span class="icon green"></span>
|
||||||
|
<span class="text">停机时长</span>
|
||||||
|
</div>
|
||||||
|
<div class="legend-item">
|
||||||
|
<span class="icon purple"></span>
|
||||||
|
<span class="text">故障时长</span>
|
||||||
|
</div>
|
||||||
|
<div class="legend-item">
|
||||||
|
<span class="icon yellow"></span>
|
||||||
|
<span class="text">速度开动率</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="graph-grid">
|
||||||
|
<div class="bg-grid grid-line">
|
||||||
|
<div
|
||||||
|
class="grid-item"
|
||||||
|
v-for="item in list.length"
|
||||||
|
:key="item"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="bg-grid grid-charts">
|
||||||
|
<pie-chart
|
||||||
|
v-for="item in list"
|
||||||
|
:key="item.id"
|
||||||
|
:value="item" />
|
||||||
|
<!-- <pie-chart v-for="item in 5" :key="item" :value="item" /> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// import moment from 'moment';
|
||||||
|
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||||
|
import PieChart from '../efficiency/components/pieChart.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'EfficiencyAnalysis',
|
||||||
|
mixins: [basicPageMixin],
|
||||||
|
components: { PieChart },
|
||||||
|
props: {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
visualizationOpen: false,
|
||||||
|
trendOpen: false,
|
||||||
|
// tableBtn: [
|
||||||
|
// this.$auth.hasPermi('base:equipment-group:update')
|
||||||
|
// ? {
|
||||||
|
// type: 'edit',
|
||||||
|
// btnName: '修改',
|
||||||
|
// }
|
||||||
|
// : undefined,
|
||||||
|
// this.$auth.hasPermi('base:equipment-group:delete')
|
||||||
|
// ? {
|
||||||
|
// type: 'delete',
|
||||||
|
// btnName: '删除',
|
||||||
|
// }
|
||||||
|
// : undefined,
|
||||||
|
// ].filter((v) => v),
|
||||||
|
tableProps: [
|
||||||
|
{ prop: 'factoryName', label: '工厂' },
|
||||||
|
{ prop: 'lineName', label: '产线' },
|
||||||
|
{ prop: 'sectionName', label: '工段' },
|
||||||
|
{ prop: 'equipmentName', label: '设备' },
|
||||||
|
{
|
||||||
|
label: '有效时间',
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
width: 128,
|
||||||
|
prop: 'workTime',
|
||||||
|
label: '工作时长[h]',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
width: 128,
|
||||||
|
prop: 'workRate',
|
||||||
|
label: '百分比[%]',
|
||||||
|
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '关机时间',
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
width: 128,
|
||||||
|
prop: 'stopTime',
|
||||||
|
label: '停机时长[h]',
|
||||||
|
},
|
||||||
|
{ width: 128, prop: 'stopRate', label: '百分比[%]' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '中断损失',
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
width: 128,
|
||||||
|
prop: 'downTime',
|
||||||
|
label: '故障时长[h]',
|
||||||
|
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
|
||||||
|
},
|
||||||
|
{ width: 128, prop: 'downRate', label: '百分比[%]' },
|
||||||
|
{
|
||||||
|
width: 128,
|
||||||
|
prop: 'timeEfficiency',
|
||||||
|
label: '时间开动率',
|
||||||
|
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '速度损失',
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
width: 128,
|
||||||
|
prop: 'realProcSpeed',
|
||||||
|
label: '实际加工速度',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
width: 128,
|
||||||
|
prop: 'designProcSpeed',
|
||||||
|
label: '理论加工速度',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
width: 128,
|
||||||
|
prop: 'peEfficiency',
|
||||||
|
label: '速度开动率',
|
||||||
|
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'oee',
|
||||||
|
label: 'OEE',
|
||||||
|
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'teep',
|
||||||
|
label: 'TEEP',
|
||||||
|
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// _action: 'view-trend',
|
||||||
|
// label: '趋势',
|
||||||
|
// ,
|
||||||
|
// subcomponent: {
|
||||||
|
// props: ['injectData'],
|
||||||
|
// render: function (h) {
|
||||||
|
// const _this = this;
|
||||||
|
// return h(
|
||||||
|
// 'el-button',
|
||||||
|
// {
|
||||||
|
// props: { type: 'text' },
|
||||||
|
// on: {
|
||||||
|
// click: function () {
|
||||||
|
// console.log('inejctdata', _this.injectData);
|
||||||
|
// _this.$emit('emitData', {
|
||||||
|
// action: _this.injectData._action,
|
||||||
|
// // value: _this.injectData.id,
|
||||||
|
// value: _this.injectData,
|
||||||
|
// });
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// '查看趋势'
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
],
|
||||||
|
searchBarFormConfig: [
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '工厂',
|
||||||
|
placeholder: '请选择工厂',
|
||||||
|
param: 'factoryId',
|
||||||
|
selectOptions: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '产线',
|
||||||
|
placeholder: '请选择产线',
|
||||||
|
param: 'lineId',
|
||||||
|
selectOptions: [],
|
||||||
|
},
|
||||||
|
// 选项切换
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '时间类型',
|
||||||
|
param: 'dateFilterType',
|
||||||
|
defaultSelect: 0,
|
||||||
|
selectOptions: [
|
||||||
|
{ id: 0, name: '按时间段' },
|
||||||
|
{ id: 1, name: '按日期' },
|
||||||
|
],
|
||||||
|
index: 2,
|
||||||
|
extraOptions: [
|
||||||
|
{
|
||||||
|
parent: 'dateFilterType',
|
||||||
|
// 时间段选择
|
||||||
|
type: 'datePicker',
|
||||||
|
// label: '时间段',
|
||||||
|
dateType: 'daterange',
|
||||||
|
format: 'yyyy-MM-dd',
|
||||||
|
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||||
|
defaultTime: ['00:00:00', '00:00:00'],
|
||||||
|
rangeSeparator: '-',
|
||||||
|
startPlaceholder: '开始时间',
|
||||||
|
endPlaceholder: '结束时间',
|
||||||
|
param: 'timerange',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
parent: 'dateFilterType',
|
||||||
|
// 日期选择
|
||||||
|
type: 'datePicker',
|
||||||
|
// label: '日期',
|
||||||
|
dateType: 'date',
|
||||||
|
placeholder: '选择日期',
|
||||||
|
format: 'yyyy-MM-dd',
|
||||||
|
valueFormat: 'yyyy-MM-dd',
|
||||||
|
param: 'timeday',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '查询',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// type: 'separate',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// type: 'button',
|
||||||
|
// btnName: '设备可视化',
|
||||||
|
// name: 'visualization',
|
||||||
|
// plain: true,
|
||||||
|
// color: 'success',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// type: 'button',
|
||||||
|
// btnName: 'OEE',
|
||||||
|
// name: 'add',
|
||||||
|
// plain: true,
|
||||||
|
// color: 'success',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// type: 'button',
|
||||||
|
// btnName: 'TEEP',
|
||||||
|
// name: 'add',
|
||||||
|
// plain: true,
|
||||||
|
// color: 'warning',
|
||||||
|
// },
|
||||||
|
],
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
lineId: null,
|
||||||
|
factoryId: null,
|
||||||
|
recordTime: [],
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
list: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
// this.getFactory();
|
||||||
|
// this.getLine();
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 准备工厂数据 */
|
||||||
|
// async getFactory() {
|
||||||
|
// const { code, data } = await this.$axios({
|
||||||
|
// url: '/base/factory/listAll',
|
||||||
|
// method: 'get',
|
||||||
|
// });
|
||||||
|
// if (code == 0) {
|
||||||
|
// this.searchBarFormConfig[0].selectOptions = data.map((item) => {
|
||||||
|
// return {
|
||||||
|
// name: item.name,
|
||||||
|
// id: item.id,
|
||||||
|
// };
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
|
||||||
|
/** 准备产线数据 */
|
||||||
|
// async getLine() {
|
||||||
|
// const { code, data } = await this.$axios({
|
||||||
|
// url: '/base/core-production-line/listAll',
|
||||||
|
// method: 'get',
|
||||||
|
// });
|
||||||
|
// if (code == 0) {
|
||||||
|
// this.searchBarFormConfig[1].selectOptions = data.map((item) => {
|
||||||
|
// return {
|
||||||
|
// name: item.name,
|
||||||
|
// id: item.id,
|
||||||
|
// };
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
|
||||||
|
/** 覆盖 handleEmitFun 的默认实现 */
|
||||||
|
// handleEmitFun({ action, value }) {
|
||||||
|
// switch (action) {
|
||||||
|
// case 'view-trend':
|
||||||
|
// const { id } = value;
|
||||||
|
// this.open = true;
|
||||||
|
// this.trendOpen = true;
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
/** 查询列表 */
|
||||||
|
async getList() {
|
||||||
|
this.loading = true;
|
||||||
|
const { code, data } = await this.$axios({
|
||||||
|
url: '/analysis/equipment-analysis/efficiency',
|
||||||
|
method: 'get',
|
||||||
|
params: this.queryParams,
|
||||||
|
});
|
||||||
|
if (code == 0) {
|
||||||
|
this.list = data;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
submitForm() {},
|
||||||
|
|
||||||
|
handleTabClick() {},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.visualization {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(3, minmax(240px, 1fr));
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.custom-tabs) {
|
||||||
|
.el-tabs__header {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
display: inline-block;
|
||||||
|
transform: translateY(-12px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tabs__content {
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tabs__item {
|
||||||
|
padding-left: 0 !important;
|
||||||
|
padding-right: 0 !important;
|
||||||
|
line-height: 36px !important;
|
||||||
|
height: 36px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.blue-title {
|
||||||
|
position: relative;
|
||||||
|
padding: 4px 0;
|
||||||
|
padding-left: 12px;
|
||||||
|
font-size: 14px;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 6px;
|
||||||
|
height: 16px;
|
||||||
|
width: 4px;
|
||||||
|
border-radius: 1px;
|
||||||
|
background: #0b58ff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.graph-grid {
|
||||||
|
margin-top: 8px;
|
||||||
|
padding: 12px;
|
||||||
|
position: relative;
|
||||||
|
border-radius: 12px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
// background: #0003;
|
||||||
|
overflow: inherit;
|
||||||
|
}
|
||||||
|
.bg-grid {
|
||||||
|
display: grid;
|
||||||
|
place-content: center;
|
||||||
|
grid-template-columns: repeat(4, minmax(280px, 1fr));
|
||||||
|
grid-auto-columns: 280px;
|
||||||
|
grid-auto-rows: 290px;
|
||||||
|
overflow: inherit;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid-line::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: -1px;
|
||||||
|
left: -1px;
|
||||||
|
width: calc(100% + 2px);
|
||||||
|
height: calc(100% + 2px);
|
||||||
|
display: inline-block;
|
||||||
|
border: 8px solid #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid-charts {
|
||||||
|
position: absolute;
|
||||||
|
width: calc(100% - 24px);
|
||||||
|
top: 12px;
|
||||||
|
left: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid-item {
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid-item:not(:first-child) {
|
||||||
|
border-left: 0;
|
||||||
|
border-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.legend {
|
||||||
|
position: absolute;
|
||||||
|
top: 8px;
|
||||||
|
right: 12px;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.legend .legend-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-left: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.legend .legend-item .icon {
|
||||||
|
width: 10px;
|
||||||
|
height: 10px;
|
||||||
|
border-radius: 1px;
|
||||||
|
margin-right: 4px;
|
||||||
|
margin-top: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.legend .legend-item .text {
|
||||||
|
color: #8c8c8c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blue {
|
||||||
|
background-color: #3da8fd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.green {
|
||||||
|
background-color: #8ef0ab;
|
||||||
|
}
|
||||||
|
|
||||||
|
.purple {
|
||||||
|
background-color: #6b5cfd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.yellow {
|
||||||
|
background-color: #ffc72a;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 1390px) {
|
||||||
|
.bg-grid {
|
||||||
|
grid-template-columns: repeat(3, minmax(280px, 1fr));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 1190px) {
|
||||||
|
.bg-grid {
|
||||||
|
grid-template-columns: repeat(2, minmax(280px, 1fr));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 640px) {
|
||||||
|
.bg-grid {
|
||||||
|
grid-template-columns: repeat(1, minmax(280px, 1fr));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,4 +1,4 @@
|
|||||||
<!--
|
<!--
|
||||||
filename: index.vue
|
filename: index.vue
|
||||||
author: liubin
|
author: liubin
|
||||||
date: 2023-09-04 09:34:52
|
date: 2023-09-04 09:34:52
|
||||||
@ -13,14 +13,21 @@
|
|||||||
ref="search-bar"
|
ref="search-bar"
|
||||||
@headBtnClick="handleSearchBarBtnClick" />
|
@headBtnClick="handleSearchBarBtnClick" />
|
||||||
|
|
||||||
<el-row>
|
<base-table
|
||||||
|
class="base-table__margin"
|
||||||
|
:table-props="tableProps"
|
||||||
|
:page="1"
|
||||||
|
:limit="10"
|
||||||
|
:table-data="list"
|
||||||
|
@emitFun="handleEmitFun" />
|
||||||
|
|
||||||
|
<!-- <el-row>
|
||||||
<el-col class="custom-tabs">
|
<el-col class="custom-tabs">
|
||||||
<el-tabs
|
<el-tabs
|
||||||
v-model="activeName"
|
v-model="activeName"
|
||||||
:stretch="true"
|
:stretch="true"
|
||||||
@tab-click="handleTabClick">
|
@tab-click="handleTabClick">
|
||||||
<el-tab-pane :label="'\u2002数据列表\u2002'" name="table">
|
<el-tab-pane :label="'\u2002数据列表\u2002'" name="table">
|
||||||
<!-- 列表 -->
|
|
||||||
<base-table
|
<base-table
|
||||||
class="base-table__margin"
|
class="base-table__margin"
|
||||||
:table-props="tableProps"
|
:table-props="tableProps"
|
||||||
@ -74,14 +81,13 @@
|
|||||||
v-for="item in list"
|
v-for="item in list"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:value="item" />
|
:value="item" />
|
||||||
<!-- <pie-chart v-for="item in 5" :key="item" :value="item" /> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -132,7 +138,7 @@ export default {
|
|||||||
width: 128,
|
width: 128,
|
||||||
prop: 'workRate',
|
prop: 'workRate',
|
||||||
label: '百分比[%]',
|
label: '百分比[%]',
|
||||||
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
|
filter: (val) => (val != null ? +Number(val).toFixed(3) : '-'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -161,7 +167,7 @@ export default {
|
|||||||
width: 128,
|
width: 128,
|
||||||
prop: 'timeEfficiency',
|
prop: 'timeEfficiency',
|
||||||
label: '时间开动率',
|
label: '时间开动率',
|
||||||
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
|
filter: (val) => (val != null ? +Number(val).toFixed(3) : '-'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -182,19 +188,19 @@ export default {
|
|||||||
width: 128,
|
width: 128,
|
||||||
prop: 'peEfficiency',
|
prop: 'peEfficiency',
|
||||||
label: '速度开动率',
|
label: '速度开动率',
|
||||||
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
|
filter: (val) => (val != null ? +Number(val).toFixed(3) : '-'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'oee',
|
prop: 'oee',
|
||||||
label: 'OEE',
|
label: 'OEE',
|
||||||
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
|
filter: (val) => (val != null ? +Number(val).toFixed(3) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'teep',
|
prop: 'teep',
|
||||||
label: 'TEEP',
|
label: 'TEEP',
|
||||||
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
|
filter: (val) => (val != null ? +Number(val).toFixed(3) : '-'),
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// _action: 'view-trend',
|
// _action: 'view-trend',
|
||||||
@ -332,7 +338,7 @@ export default {
|
|||||||
/** 准备工厂数据 */
|
/** 准备工厂数据 */
|
||||||
async getFactory() {
|
async getFactory() {
|
||||||
const { code, data } = await this.$axios({
|
const { code, data } = await this.$axios({
|
||||||
url: '/base/factory/listAll',
|
url: '/base/core-factory/listAll',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
});
|
});
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
@ -348,7 +354,7 @@ export default {
|
|||||||
/** 准备产线数据 */
|
/** 准备产线数据 */
|
||||||
async getLine() {
|
async getLine() {
|
||||||
const { code, data } = await this.$axios({
|
const { code, data } = await this.$axios({
|
||||||
url: '/base/production-line/listAll',
|
url: '/base/core-production-line/listAll',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
});
|
});
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
|
@ -75,7 +75,7 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
tableProps: [
|
tableProps: [
|
||||||
{ prop: 'lineName', label: '产线' },
|
{ prop: 'lineName', label: '产线名称' },
|
||||||
{ prop: 'sectionName', label: '工段' },
|
{ prop: 'sectionName', label: '工段' },
|
||||||
{ prop: 'equipmentName', label: '设备' },
|
{ prop: 'equipmentName', label: '设备' },
|
||||||
{
|
{
|
||||||
@ -136,7 +136,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
async fillLineOptions() {
|
async fillLineOptions() {
|
||||||
const { data } = await this.$axios({
|
const { data } = await this.$axios({
|
||||||
url: '/base/production-line/listAll',
|
url: '/base/core-production-line/listAll',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
});
|
});
|
||||||
const cfg = this.searchBarFormConfig.find(
|
const cfg = this.searchBarFormConfig.find(
|
||||||
|
@ -262,7 +262,7 @@ export default {
|
|||||||
|
|
||||||
async fillLineOptions() {
|
async fillLineOptions() {
|
||||||
const { data } = await this.$axios({
|
const { data } = await this.$axios({
|
||||||
url: '/base/production-line/listAll',
|
url: '/base/core-production-line/listAll',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
});
|
});
|
||||||
const cfg = this.searchBarFormConfig.find(
|
const cfg = this.searchBarFormConfig.find(
|
||||||
@ -280,7 +280,7 @@ export default {
|
|||||||
|
|
||||||
async fillProductOptions() {
|
async fillProductOptions() {
|
||||||
const { data } = await this.$axios({
|
const { data } = await this.$axios({
|
||||||
url: '/base/product/listAll',
|
url: '/base/core-product/listAll',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
});
|
});
|
||||||
const cfg = this.searchBarFormConfig.find(
|
const cfg = this.searchBarFormConfig.find(
|
||||||
|
65
src/views/equipment/base/alarm/Record/SmallTitle.vue
Normal file
65
src/views/equipment/base/alarm/Record/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: 18px;
|
||||||
|
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>
|
195
src/views/equipment/base/alarm/Record/add-or-updata.vue
Normal file
195
src/views/equipment/base/alarm/Record/add-or-updata.vue
Normal file
@ -0,0 +1,195 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2021-11-18 14:16:25
|
||||||
|
* @LastEditors: DY
|
||||||
|
* @LastEditTime: 2023-11-11 20:33:12
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<small-title
|
||||||
|
style="margin: 16px 0; padding-left: 8px"
|
||||||
|
:no-padding="true">
|
||||||
|
系统自带
|
||||||
|
</small-title>
|
||||||
|
<el-form
|
||||||
|
:model="dataForm1"
|
||||||
|
ref="dataForm1"
|
||||||
|
label-width="80px">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="设备编码" prop="equipment">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm1.equipment"
|
||||||
|
disabled
|
||||||
|
placeholder="请输入设备编码" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="报警时间" prop="createTime">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm1.createTime"
|
||||||
|
disabled
|
||||||
|
placeholder="请输入报警时间" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="报警编号" prop="code">
|
||||||
|
<!-- 接口缺参数 -->
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm1.code"
|
||||||
|
disabled
|
||||||
|
placeholder="请输入报警编号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="报警内容" prop="alarmContent">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm1.alarmContent"
|
||||||
|
disabled
|
||||||
|
placeholder="请输入报警内容" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<small-title
|
||||||
|
style="margin: 16px 0; padding-left: 8px"
|
||||||
|
:no-padding="true">
|
||||||
|
处理方式
|
||||||
|
</small-title>
|
||||||
|
<el-form
|
||||||
|
:model="dataForm"
|
||||||
|
:rules="dataRule"
|
||||||
|
ref="dataForm"
|
||||||
|
label-width="80px">
|
||||||
|
<el-form-item label="处理人" prop="hander">
|
||||||
|
<el-select
|
||||||
|
v-model="dataForm.hander"
|
||||||
|
:disabled="isdetail"
|
||||||
|
placeholder="请选择处理人"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in workersList"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.name"
|
||||||
|
:value="dict.name" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="处理方式" prop="handerMode">
|
||||||
|
<editor v-model="dataForm.handerMode" :read-only="isdetail" :min-height="200"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="附件" prop="file">
|
||||||
|
<!-- <el-input
|
||||||
|
v-model="dataForm.file"
|
||||||
|
type="textarea"
|
||||||
|
min-size="3"
|
||||||
|
placeholder="请输入处理方式" /> -->
|
||||||
|
<FileUpload v-model="file" :disabled="isdetail" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import basicAdd from '../../../../core/mixins/basic-add';
|
||||||
|
import SmallTitle from './SmallTitle';
|
||||||
|
import { getworkerAll } from "@/api/base/materialUseLog";
|
||||||
|
import { createAlarmHand, getAlarmLog } from '@/api/equipment/base/alarm/records';
|
||||||
|
import FileUpload from "@/components/FileUpload";
|
||||||
|
import Editor from "@/components/Editor";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { SmallTitle, FileUpload, Editor },
|
||||||
|
mixins: [basicAdd],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
urlOptions: {
|
||||||
|
createURL: createAlarmHand,
|
||||||
|
infoURL: getAlarmLog,
|
||||||
|
},
|
||||||
|
dataForm1: {
|
||||||
|
id: undefined,
|
||||||
|
equipment: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
alarmContent: undefined,
|
||||||
|
code: undefined
|
||||||
|
},
|
||||||
|
file: '',
|
||||||
|
dataForm: {
|
||||||
|
id: undefined,
|
||||||
|
hander: undefined,
|
||||||
|
handerMode: undefined
|
||||||
|
},
|
||||||
|
isdetail: false,
|
||||||
|
workersList: [],
|
||||||
|
dataRule: {
|
||||||
|
hander: [{ required: true, message: "处理人不能为空", trigger: "change" }],
|
||||||
|
handerMode: [{ required: true, message: "处理方式不能为空", trigger: "blur" }]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getDict()
|
||||||
|
console.log('我看看', this.dataForm)
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async getDict() {
|
||||||
|
// 获得员工
|
||||||
|
const workerRes = await getworkerAll()
|
||||||
|
this.workersList = workerRes.data
|
||||||
|
},
|
||||||
|
// 表单提交
|
||||||
|
dataFormSubmit() {
|
||||||
|
this.$refs["dataForm"].validate((valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 修改的提交
|
||||||
|
// if (this.dataForm.id) {
|
||||||
|
// this.urlOptions.updateURL(this.dataForm).then(response => {
|
||||||
|
// this.$modal.msgSuccess("修改成功");
|
||||||
|
// this.visible = false;
|
||||||
|
// this.$emit("refreshDataList");
|
||||||
|
// });
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// 添加的提交
|
||||||
|
if (this.file) {
|
||||||
|
const temp = this.file.split(',') // 获取文件个数
|
||||||
|
let arry = []
|
||||||
|
temp.forEach(item => {
|
||||||
|
arry.push({
|
||||||
|
fileType: 2,
|
||||||
|
fileUrl: item
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.dataForm.files = arry
|
||||||
|
}
|
||||||
|
this.urlOptions.createURL(this.dataForm).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit("refreshDataList");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
init(id, isdetail) {
|
||||||
|
this.dataForm1.id = id || "";
|
||||||
|
this.isdetail = isdetail || false
|
||||||
|
this.visible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs["dataForm1"].resetFields();
|
||||||
|
this.$refs["dataForm"].resetFields();
|
||||||
|
if (this.dataForm1.id) {
|
||||||
|
this.urlOptions.infoURL(id).then(response => {
|
||||||
|
if (response.data) {
|
||||||
|
this.dataForm1 = response.data;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
350
src/views/equipment/base/alarm/Record/index.vue
Normal file
350
src/views/equipment/base/alarm/Record/index.vue
Normal file
@ -0,0 +1,350 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<SearchBar
|
||||||
|
:formConfigs="searchBarFormConfig"
|
||||||
|
ref="search-bar"
|
||||||
|
@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"
|
||||||
|
label="操作"
|
||||||
|
:width="120"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleTableBtnClick" />
|
||||||
|
</base-table>
|
||||||
|
|
||||||
|
<!-- 分页组件 -->
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNo"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList" />
|
||||||
|
|
||||||
|
<!-- 对话框(添加 / 修改) -->
|
||||||
|
<base-dialog
|
||||||
|
:dialogTitle="title"
|
||||||
|
:dialogVisible="open"
|
||||||
|
width="60%"
|
||||||
|
@close="cancel"
|
||||||
|
@cancel="cancel"
|
||||||
|
@confirm="submitForm">
|
||||||
|
<!-- <DialogForm
|
||||||
|
v-if="open"
|
||||||
|
ref="form"
|
||||||
|
v-model="form"
|
||||||
|
:disabled="mode == 'detail'"
|
||||||
|
:has-files="false"
|
||||||
|
:rows="rows" /> -->
|
||||||
|
<add-or-update
|
||||||
|
ref="addOrUpdate"
|
||||||
|
@refreshDataList="successSubmit" />
|
||||||
|
</base-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import moment from 'moment';
|
||||||
|
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||||
|
import AddOrUpdate from './add-or-updata.vue'
|
||||||
|
import { publicFormatter } from '@/utils/dict';
|
||||||
|
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||||
|
|
||||||
|
|
||||||
|
const btn = {
|
||||||
|
name: 'tableBtn',
|
||||||
|
props: ['injectData'],
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleClick() {
|
||||||
|
this.$emit('emitData', { action: this.injectData.name, value: this.injectData });
|
||||||
|
},
|
||||||
|
},
|
||||||
|
render: function (h) {
|
||||||
|
return (
|
||||||
|
<el-button type="text" onClick={this.handleClick}>
|
||||||
|
{this.injectData.name}
|
||||||
|
</el-button>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'Record',
|
||||||
|
components: { AddOrUpdate },
|
||||||
|
mixins: [basicPageMixin],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
searchBarKeys: ['equipmentName', 'recordTime'],
|
||||||
|
tableBtn: [
|
||||||
|
// this.$auth.hasPermi('equipment:spare-parts-config:update')
|
||||||
|
// ? {
|
||||||
|
// type: 'detail',
|
||||||
|
// btnName: '详情',
|
||||||
|
// }
|
||||||
|
// : undefined,
|
||||||
|
// this.$auth.hasPermi('equipment:spare-parts-config:update')
|
||||||
|
// ? {
|
||||||
|
// type: 'edit',
|
||||||
|
// btnName: '修改',
|
||||||
|
// }
|
||||||
|
// : undefined,
|
||||||
|
// this.$auth.hasPermi('equipment:spare-parts-config:delete')
|
||||||
|
// ? {
|
||||||
|
// type: 'delete',
|
||||||
|
// btnName: '删除',
|
||||||
|
// }
|
||||||
|
// : undefined,
|
||||||
|
].filter((v) => v),
|
||||||
|
tableProps: [
|
||||||
|
{ prop: 'productionLine', label: '产线' },
|
||||||
|
{ prop: 'workshopSection', label: '工段' },
|
||||||
|
{ prop: 'equipment', label: '设备名称' },
|
||||||
|
{ prop: 'alarmGrade', label: '报警级别', filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL) },
|
||||||
|
{ prop: 'responsible', label: '报警时间' }, // 接口缺
|
||||||
|
{ prop: 'responsible1', label: '设备报警码' }, // 接口缺
|
||||||
|
{ prop: 'alarmContent', label: '报警内容' },
|
||||||
|
{ prop: 'opt1', label: '处理记录', name: '查看', subcomponent: btn },
|
||||||
|
{ prop: 'opt2', label: '处理', name: '报警处理', subcomponent: btn }, // TODO: 是否换成按钮, 群里问
|
||||||
|
// { prop: 'remark', label: '备注' },
|
||||||
|
],
|
||||||
|
searchBarFormConfig: [
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: '设备名',
|
||||||
|
placeholder: '请输入设备名称',
|
||||||
|
param: 'equipmentName',
|
||||||
|
},
|
||||||
|
// 时间段
|
||||||
|
{
|
||||||
|
type: 'datePicker',
|
||||||
|
label: '时间段',
|
||||||
|
dateType: 'daterange', // datetimerange
|
||||||
|
// format: 'yyyy-MM-dd HH:mm:ss',
|
||||||
|
format: 'yyyy-MM-dd',
|
||||||
|
// valueFormat: 'timestamp',
|
||||||
|
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||||
|
rangeSeparator: '-',
|
||||||
|
startPlaceholder: '开始日期',
|
||||||
|
endPlaceholder: '结束日期',
|
||||||
|
defaultTime: ['00:00:00', '23:59:59'],
|
||||||
|
param: 'recordTime',
|
||||||
|
// defaultSelect: [
|
||||||
|
// new Date(y, m, d)
|
||||||
|
// .toLocaleString()
|
||||||
|
// .split('/')
|
||||||
|
// .map((item, index) => {
|
||||||
|
// if (index == 1 || index == 2) return item.padStart(2, '0');
|
||||||
|
// return item;
|
||||||
|
// })
|
||||||
|
// .join('-'),
|
||||||
|
// new Date(y, m, d, 23, 59, 59)
|
||||||
|
// .toLocaleString()
|
||||||
|
// .split('/')
|
||||||
|
// .map((item, index) => {
|
||||||
|
// if (index == 1 || index == 2) return item.padStart(2, '0');
|
||||||
|
// return item;
|
||||||
|
// })
|
||||||
|
// .join('-'),
|
||||||
|
// ],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '查询',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// type: 'separate',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// type: this.$auth.hasPermi('equipment:spare-parts-config:create')
|
||||||
|
// ? 'button'
|
||||||
|
// : '',
|
||||||
|
// btnName: '新增',
|
||||||
|
// name: 'add',
|
||||||
|
// plain: true,
|
||||||
|
// color: 'success',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// type: this.$auth.hasPermi('equipment:spare-parts-config:export')
|
||||||
|
// ? 'button'
|
||||||
|
// : '',
|
||||||
|
// btnName: '导出',
|
||||||
|
// name: 'export',
|
||||||
|
// color: 'warning',
|
||||||
|
// },
|
||||||
|
],
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
lineId: null,
|
||||||
|
equipmentId: null,
|
||||||
|
},
|
||||||
|
basePath: '/base/equipment-alarm-log',
|
||||||
|
list: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
// this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleEmitFun(val) {
|
||||||
|
console.log('你好', val)
|
||||||
|
if (val.action === '报警处理') {
|
||||||
|
// 报警处理
|
||||||
|
this.open = true
|
||||||
|
this.title = '报警处理'
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init(val.value.id);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// 查看
|
||||||
|
this.open = true
|
||||||
|
this.title = '查看'
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init(val.value.id, true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 查询列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
// 执行查询
|
||||||
|
this.recv(this.queryParams).then((response) => {
|
||||||
|
this.list = response.data.list;
|
||||||
|
this.total = response.data.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
successSubmit() {
|
||||||
|
this.cancel()
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
/** 取消按钮 */
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
// this.mode = null;
|
||||||
|
// this.reset();
|
||||||
|
},
|
||||||
|
/** 表单重置 */
|
||||||
|
// reset() {
|
||||||
|
// this.form = {
|
||||||
|
// id: null,
|
||||||
|
// name: null,
|
||||||
|
// equipmentId: null,
|
||||||
|
// description: null,
|
||||||
|
// responsible: null
|
||||||
|
// };
|
||||||
|
// this.resetForm('form');
|
||||||
|
// },
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNo = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm('queryForm');
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = '添加备品备件配置';
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const id = row.id;
|
||||||
|
this.info({ id }).then((response) => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = '修改备品备件配置';
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs.addOrUpdate.dataFormSubmit()
|
||||||
|
// this.$refs['form'].validate((valid) => {
|
||||||
|
// if (!valid) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// // 修改的提交
|
||||||
|
// if (this.form.id != null) {
|
||||||
|
// this.put(this.form).then((response) => {
|
||||||
|
// this.$modal.msgSuccess('修改成功');
|
||||||
|
// this.open = false;
|
||||||
|
// this.getList();
|
||||||
|
// });
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// // 添加的提交
|
||||||
|
// this.post(this.form).then((response) => {
|
||||||
|
// this.$modal.msgSuccess('新增成功');
|
||||||
|
// this.open = false;
|
||||||
|
// this.getList();
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const id = row.id;
|
||||||
|
this.$modal
|
||||||
|
.confirm('是否确认删除记录"' + row.name + '"?')
|
||||||
|
.then(function () {
|
||||||
|
return this.delete({ id });
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess('删除成功');
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
handleDetail({ id }) {
|
||||||
|
this.reset();
|
||||||
|
this.mode = 'detail';
|
||||||
|
this.info({ id }).then((response) => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = '修改备品备件配置';
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
// 处理查询参数
|
||||||
|
let params = { ...this.queryParams };
|
||||||
|
params.pageNo = undefined;
|
||||||
|
params.pageSize = undefined;
|
||||||
|
this.$modal
|
||||||
|
.confirm('是否确认导出所有备品备件配置?')
|
||||||
|
.then(() => {
|
||||||
|
this.exportLoading = true;
|
||||||
|
return exportEquipmentTypeExcel(params);
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
this.$download.excel(response, '备品备件配置.xls');
|
||||||
|
this.exportLoading = false;
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
393
src/views/equipment/base/inspection/Record/addRecord.vue
Normal file
393
src/views/equipment/base/inspection/Record/addRecord.vue
Normal file
@ -0,0 +1,393 @@
|
|||||||
|
<!--
|
||||||
|
filename: dialogForm.vue
|
||||||
|
author: liubin
|
||||||
|
date: 2023-10-31 15:55:13
|
||||||
|
description:
|
||||||
|
-->
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<el-drawer
|
||||||
|
:visible.sync="visible"
|
||||||
|
:show-close="false"
|
||||||
|
:wrapper-closable="false"
|
||||||
|
class="drawer"
|
||||||
|
size="60%">
|
||||||
|
<small-title slot="title" :no-padding="true">
|
||||||
|
{{ isdetail ? '查看详情' : '新增' }}
|
||||||
|
</small-title>
|
||||||
|
<el-form
|
||||||
|
ref="dataForm"
|
||||||
|
:model="dataForm"
|
||||||
|
:rules="dataRule"
|
||||||
|
label-width="100px"
|
||||||
|
v-loading="formLoading">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="设备名称" prop="equipmentId">
|
||||||
|
<el-select
|
||||||
|
v-model="dataForm.equipmentId"
|
||||||
|
filterable
|
||||||
|
:disabled="isdetail"
|
||||||
|
style="width: 100%"
|
||||||
|
placeholder="请选择设备名称">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in eqList"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.name"
|
||||||
|
:value="dict.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<!-- <el-form-item label="物料名称" prop="name">
|
||||||
|
<el-input v-model="dataForm.name" :disabled="isdetail" clearable placeholder="请输入物料名称" />
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item label="巡检配置名称" prop="configId">
|
||||||
|
<el-select
|
||||||
|
v-model="dataForm.configId"
|
||||||
|
filterable
|
||||||
|
:disabled="isdetail"
|
||||||
|
style="width: 100%"
|
||||||
|
placeholder="请选择巡检配置">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in configList"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.name"
|
||||||
|
: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="equipmentCode">
|
||||||
|
<el-input v-model="dataForm.equipmentCode" disabled clearable placeholder="请输入设备编码" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="巡检人" prop="responsible">
|
||||||
|
<el-input v-model="dataForm.responsible" :disabled="isdetail" clearable placeholder="请输入巡检人" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="巡检时间" prop="actualTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dataForm.actualTime"
|
||||||
|
type="date"
|
||||||
|
:disabled="isdetail"
|
||||||
|
format='yyyy-MM-dd'
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
placeholder="选择巡检时间" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-form-item label="巡检内容">
|
||||||
|
<base-table
|
||||||
|
:table-props="tableProps"
|
||||||
|
:page="listQuery.pageNo"
|
||||||
|
:limit="listQuery.pageSize"
|
||||||
|
:table-data="list" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="巡检详情" prop="description">
|
||||||
|
<editor v-model="dataForm.description" :read-only="isdetail" :min-height="380"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="附件">
|
||||||
|
<FileUpload v-model="file" :disabled="isdetail" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<div class="drawer-body__footer">
|
||||||
|
<el-button type="primary" @click="goback()">取消</el-button>
|
||||||
|
<el-button v-if="isdetail" type="primary" @click="goEdit()">
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- <attr-add
|
||||||
|
v-if="addOrUpdateVisible"
|
||||||
|
ref="addOrUpdate"
|
||||||
|
:config-id="dataForm.id"
|
||||||
|
@refreshDataList="getList" /> -->
|
||||||
|
</el-drawer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import SmallTitle from '../../../base/alarm/Record/SmallTitle.vue';
|
||||||
|
import { createCheckLog, updateCheckLog, getcheckAllList, getcheckConfigByEqList, getEqCheckLog } from '@/api/equipment/base/inspection/record'
|
||||||
|
import { getEquipmentAll } from '@/api/base/equipment'
|
||||||
|
import Editor from "@/components/Editor";
|
||||||
|
// import FileUpload from "@/components/FileUpload";
|
||||||
|
// import { parseTime } from '../../../../core/mixins/code-filter';
|
||||||
|
// import attrAdd from './attr-add';
|
||||||
|
import FileUpload from "@/components/FileUpload";
|
||||||
|
|
||||||
|
const tableBtn = [
|
||||||
|
{
|
||||||
|
type: 'delete',
|
||||||
|
btnName: '删除',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const tableProps = [
|
||||||
|
{
|
||||||
|
prop: 'program',
|
||||||
|
label: '巡检项目',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'content',
|
||||||
|
label: '巡检内容',
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'AddRecord',
|
||||||
|
model: {
|
||||||
|
prop: 'dataForm',
|
||||||
|
event: 'update',
|
||||||
|
},
|
||||||
|
emits: ['update'],
|
||||||
|
components: { SmallTitle, Editor, FileUpload },
|
||||||
|
props: {
|
||||||
|
// dataForm: {
|
||||||
|
// type: Object,
|
||||||
|
// default: () => ({}),
|
||||||
|
// },
|
||||||
|
// disabled: {
|
||||||
|
// type: Boolean,
|
||||||
|
// default: false
|
||||||
|
// },
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
tableBtn,
|
||||||
|
tableProps,
|
||||||
|
addOrUpdateVisible: false,
|
||||||
|
formLoading: true,
|
||||||
|
visible: false,
|
||||||
|
isdetail: false,
|
||||||
|
dataForm: {
|
||||||
|
id: undefined,
|
||||||
|
configId: undefined,
|
||||||
|
equipmentId: undefined,
|
||||||
|
actualTime: undefined,
|
||||||
|
responsible: undefined,
|
||||||
|
description: undefined
|
||||||
|
},
|
||||||
|
list: [],
|
||||||
|
eqList: [],
|
||||||
|
configList: [],
|
||||||
|
listQuery: {
|
||||||
|
pageSize: 10,
|
||||||
|
pageNo: 1,
|
||||||
|
total: 0,
|
||||||
|
},
|
||||||
|
file: '',
|
||||||
|
dataRule: {
|
||||||
|
responsible: [{ required: true, message: "巡检人不能为空", trigger: "blur" }],
|
||||||
|
actualTime: [{ required: true, message: "巡检时间不能为空", trigger: "blur" }]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getDict()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async getDict() {
|
||||||
|
const res = await getEquipmentAll()
|
||||||
|
this.eqList = res.data
|
||||||
|
const configres = await getcheckConfigByEqList()
|
||||||
|
this.configList = configres.data
|
||||||
|
},
|
||||||
|
goback() {
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
this.visible = false;
|
||||||
|
},
|
||||||
|
goEdit() {
|
||||||
|
this.isdetail = false;
|
||||||
|
},
|
||||||
|
/** 模拟透传 ref */
|
||||||
|
validate(cb) {
|
||||||
|
return this.$refs.dataForm.validate(cb);
|
||||||
|
},
|
||||||
|
resetFields(args) {
|
||||||
|
return this.$refs.dataForm.resetFields(args);
|
||||||
|
},
|
||||||
|
init(id, isdetail) {
|
||||||
|
// this.initData();
|
||||||
|
this.isdetail = isdetail || false;
|
||||||
|
this.dataForm.id = id || undefined;
|
||||||
|
this.visible = true;
|
||||||
|
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['dataForm'].resetFields();
|
||||||
|
|
||||||
|
if (this.dataForm.id) {
|
||||||
|
// 获取备品备件
|
||||||
|
getEqCheckLog(this.dataForm.id).then(response => {
|
||||||
|
this.formLoading = false
|
||||||
|
this.dataForm = response.data;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// if (this.urlOptions.isGetCode) {
|
||||||
|
// this.getCode()
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.formLoading = false
|
||||||
|
},
|
||||||
|
handleClick(raw) {
|
||||||
|
if (raw.type === 'delete') {
|
||||||
|
this.$confirm(
|
||||||
|
`确定要删除名称为${raw.data.sparePartName}的数据?`,
|
||||||
|
'提示',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
deleteConfigDet(raw.data.id).then(({ data }) => {
|
||||||
|
this.$message({
|
||||||
|
message: '操作成功',
|
||||||
|
type: 'success',
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
} else {
|
||||||
|
this.addNew(raw.data.id);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getList() {
|
||||||
|
// 获取巡检内容分页
|
||||||
|
getcheckAllList({
|
||||||
|
...this.listQuery,
|
||||||
|
configId: this.dataForm.id,
|
||||||
|
}).then((response) => {
|
||||||
|
this.list = response.data.list;
|
||||||
|
this.listQuery.total = response.data.total;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 新增 / 修改
|
||||||
|
addNew(id) {
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init(id);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 表单提交
|
||||||
|
dataFormSubmit() {
|
||||||
|
this.$refs["dataForm"].validate((valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (this.file) {
|
||||||
|
const temp = this.file.split(',') // 获取文件个数
|
||||||
|
let arry = []
|
||||||
|
temp.forEach(item => {
|
||||||
|
arry.push({
|
||||||
|
fileType: 2,
|
||||||
|
fileUrl: item
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.dataForm.files = arry
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改的提交
|
||||||
|
if (this.dataForm.id) {
|
||||||
|
updateCheckLog(this.dataForm).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit("refreshDataList");
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 添加的提交
|
||||||
|
createCheckLog(this.dataForm).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit("refreshDataList");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.el-date-editor,
|
||||||
|
.el-select {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.drawer-body__footer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
padding: 18px;
|
||||||
|
}
|
||||||
|
.action_btn {
|
||||||
|
float: right;
|
||||||
|
margin: 5px 15px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
.add {
|
||||||
|
color: #0b58ff;
|
||||||
|
}
|
||||||
|
.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;
|
||||||
|
margin: 10px 0;
|
||||||
|
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>
|
148
src/views/equipment/base/inspection/Record/attr-add.vue
Normal file
148
src/views/equipment/base/inspection/Record/attr-add.vue
Normal file
@ -0,0 +1,148 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
:visible.sync="visible"
|
||||||
|
:width="'35%'"
|
||||||
|
:append-to-body="true"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
class="dialog">
|
||||||
|
<template #title>
|
||||||
|
<slot name="title">
|
||||||
|
<div class="titleStyle">
|
||||||
|
{{ !dataForm.id ? '新增' : '编辑' }}
|
||||||
|
</div>
|
||||||
|
</slot>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<el-form
|
||||||
|
ref="dataForm"
|
||||||
|
:model="dataForm"
|
||||||
|
:rules="dataRule"
|
||||||
|
label-width="100px"
|
||||||
|
@keyup.enter.native="dataFormSubmit()">
|
||||||
|
<el-form-item label="备品备件" prop="sparePartId">
|
||||||
|
<el-select
|
||||||
|
v-model="dataForm.sparePartId"
|
||||||
|
filterable
|
||||||
|
style="width: 100%"
|
||||||
|
placeholder="请选择备品备件">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in partList"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.name"
|
||||||
|
:value="dict.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row style="text-align: right">
|
||||||
|
<el-button @click="visible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||||
|
</el-row>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
createConfigDet,
|
||||||
|
getSparePartList
|
||||||
|
} from '@/api/equipment/base/spare-parts/config';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
configId: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
visible: false,
|
||||||
|
dataForm: {
|
||||||
|
id: undefined,
|
||||||
|
sparePartId: ''
|
||||||
|
},
|
||||||
|
partList: [],
|
||||||
|
dataRule: {
|
||||||
|
sparePartId: [{ required: true, message: '备品备件不能为空', trigger: 'change' }]
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getDict()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async getDict() {
|
||||||
|
const res = await getSparePartList()
|
||||||
|
this.partList = res.data
|
||||||
|
},
|
||||||
|
init(id) {
|
||||||
|
this.dataForm.id = id || '';
|
||||||
|
this.visible = true;
|
||||||
|
// this.$nextTick(() => {
|
||||||
|
// this.$refs['dataForm'].resetFields();
|
||||||
|
// if (this.dataForm.id) {
|
||||||
|
// getCoreProductAttr({
|
||||||
|
// id: this.dataForm.id
|
||||||
|
// }).then((res) => {
|
||||||
|
// const { name, value } = res.data;
|
||||||
|
// this.dataForm.name = name;
|
||||||
|
// this.dataForm.value = value;
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
},
|
||||||
|
// 表单提交
|
||||||
|
dataFormSubmit() {
|
||||||
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
// 修改的提交
|
||||||
|
// if (this.dataForm.id) {
|
||||||
|
// updateCoreProductAttr({
|
||||||
|
// ...this.dataForm,
|
||||||
|
// productId: this.productId,
|
||||||
|
// }).then((response) => {
|
||||||
|
// this.$modal.msgSuccess('修改成功');
|
||||||
|
// this.visible = false;
|
||||||
|
// this.$emit('refreshDataList');
|
||||||
|
// });
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// 添加的提交
|
||||||
|
createConfigDet({
|
||||||
|
...this.dataForm,
|
||||||
|
configId: this.configId,
|
||||||
|
}).then((response) => {
|
||||||
|
this.$modal.msgSuccess('新增成功');
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.dialog >>> .el-dialog__body {
|
||||||
|
padding: 30px 24px;
|
||||||
|
}
|
||||||
|
.dialog >>> .el-dialog__header {
|
||||||
|
font-size: 16px;
|
||||||
|
color: rgba(0, 0, 0, 0.85);
|
||||||
|
font-weight: 500;
|
||||||
|
padding: 13px 24px;
|
||||||
|
border-bottom: 1px solid #e9e9e9;
|
||||||
|
}
|
||||||
|
.dialog >>> .el-dialog__header .titleStyle::before {
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
width: 4px;
|
||||||
|
height: 16px;
|
||||||
|
background-color: #0b58ff;
|
||||||
|
border-radius: 1px;
|
||||||
|
margin-right: 8px;
|
||||||
|
position: relative;
|
||||||
|
top: 2px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -45,24 +45,32 @@
|
|||||||
:has-files="true"
|
:has-files="true"
|
||||||
:rows="rows" />
|
:rows="rows" />
|
||||||
</base-dialog>
|
</base-dialog>
|
||||||
|
|
||||||
|
<addRecord
|
||||||
|
v-if="addOrUpdateVisible"
|
||||||
|
ref="addOrUpdate"
|
||||||
|
@refreshDataList="getList" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||||
|
import addRecord from './addRecord.vue';
|
||||||
|
import { exportCheckLogExcel } from '@/api/equipment/base/inspection/record'
|
||||||
|
|
||||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'EquipmentRepair',
|
name: 'EquipmentRepair',
|
||||||
components: {},
|
components: { addRecord },
|
||||||
mixins: [basicPageMixin],
|
mixins: [basicPageMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
addOrUpdateVisible: false,
|
||||||
searchBarKeys: ['equipmentId', 'createTime'],
|
searchBarKeys: ['equipmentId', 'createTime'],
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
this.$auth.hasPermi('equipment:check-record:update')
|
this.$auth.hasPermi('equipment:check-record:detail')
|
||||||
? {
|
? {
|
||||||
type: 'detail',
|
type: 'detail',
|
||||||
btnName: '详情',
|
btnName: '详情',
|
||||||
@ -129,6 +137,9 @@ export default {
|
|||||||
plain: true,
|
plain: true,
|
||||||
color: 'success',
|
color: 'success',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
type: 'separate',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: this.$auth.hasPermi('equipment:check-record:export')
|
type: this.$auth.hasPermi('equipment:check-record:export')
|
||||||
? 'button'
|
? 'button'
|
||||||
@ -288,18 +299,26 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
// this.reset();
|
||||||
this.open = true;
|
// this.open = true;
|
||||||
this.title = '添加维修记录';
|
// this.title = '添加维修记录';
|
||||||
|
this.addOrUpdateVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
// this.reset();
|
||||||
const id = row.id;
|
// const id = row.id;
|
||||||
this.info({ id }).then((response) => {
|
// this.info({ id }).then((response) => {
|
||||||
this.form = response.data;
|
// this.form = response.data;
|
||||||
this.open = true;
|
// this.open = true;
|
||||||
this.title = '修改维修记录';
|
// this.title = '修改维修记录';
|
||||||
|
// });
|
||||||
|
this.addOrUpdateVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init(row.id);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
@ -340,12 +359,9 @@ export default {
|
|||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
handleDetail({ id }) {
|
handleDetail({ id }) {
|
||||||
this.reset();
|
this.addOrUpdateVisible = true
|
||||||
this.mode = 'detail';
|
this.$nextTick(() => {
|
||||||
this.info({ id }).then((response) => {
|
this.$refs.addOrUpdate.init(id, true);
|
||||||
this.form = response.data;
|
|
||||||
this.open = true;
|
|
||||||
this.title = '修改维修记录';
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
@ -355,13 +371,13 @@ export default {
|
|||||||
params.pageNo = undefined;
|
params.pageNo = undefined;
|
||||||
params.pageSize = undefined;
|
params.pageSize = undefined;
|
||||||
this.$modal
|
this.$modal
|
||||||
.confirm('是否确认导出所有维修记录?')
|
.confirm('是否确认导出所有设备巡检记录?')
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.exportLoading = true;
|
this.exportLoading = true;
|
||||||
return exportEquipmentTypeExcel(params);
|
return exportCheckLogExcel(params);
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
this.$download.excel(response, '维修记录.xls');
|
this.$download.excel(response, '设备巡检记录.xls');
|
||||||
this.exportLoading = false;
|
this.exportLoading = false;
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
|
65
src/views/equipment/base/inspection/Settings/SmallTitle.vue
Normal file
65
src/views/equipment/base/inspection/Settings/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: 18px;
|
||||||
|
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>
|
317
src/views/equipment/base/inspection/Settings/add-or-updata.vue
Normal file
317
src/views/equipment/base/inspection/Settings/add-or-updata.vue
Normal file
@ -0,0 +1,317 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2021-11-18 14:16:25
|
||||||
|
* @LastEditors: DY
|
||||||
|
* @LastEditTime: 2023-11-09 11:09:26
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-drawer
|
||||||
|
:visible.sync="visible"
|
||||||
|
:show-close="false"
|
||||||
|
:wrapper-closable="false"
|
||||||
|
class="drawer"
|
||||||
|
size="50%">
|
||||||
|
<small-title slot="title" :no-padding="true">
|
||||||
|
{{ isdetail ? '详情' : '添加巡检' }}
|
||||||
|
</small-title>
|
||||||
|
<div class="content">
|
||||||
|
<div class="visual-part">
|
||||||
|
<el-form
|
||||||
|
:model="dataForm"
|
||||||
|
:rules="dataRule"
|
||||||
|
ref="dataForm"
|
||||||
|
@keyup.enter.native="dataFormSubmit()"
|
||||||
|
label-width="100px"
|
||||||
|
label-position="top">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="设备名称" prop="equipmentName">
|
||||||
|
<el-input v-model="dataForm.equipmentName" disabled clearable placeholder="请输入设备名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="设备编码" prop="equipmentCode">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.equipmentCode"
|
||||||
|
clearable
|
||||||
|
disabled
|
||||||
|
placeholder="请输入设备编码" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="attr-list">
|
||||||
|
<small-title
|
||||||
|
style="margin: 16px 0; padding-left: 8px"
|
||||||
|
:no-padding="true">
|
||||||
|
巡检项目
|
||||||
|
</small-title>
|
||||||
|
|
||||||
|
<div v-if="!isdetail" class="action_btn">
|
||||||
|
<template>
|
||||||
|
<span style="display: inline-block;" @click="addNew()">
|
||||||
|
<svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" />
|
||||||
|
<span class="add">添加</span>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
<base-table
|
||||||
|
:table-props="tableProps"
|
||||||
|
:page="listQuery.pageNo"
|
||||||
|
:limit="listQuery.pageSize"
|
||||||
|
:table-data="checkDetList">
|
||||||
|
<method-btn
|
||||||
|
v-if="!isdetail"
|
||||||
|
slot="handleBtn"
|
||||||
|
:width="120"
|
||||||
|
label="操作"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleClick" />
|
||||||
|
</base-table>
|
||||||
|
<pagination
|
||||||
|
v-show="listQuery.total > 0"
|
||||||
|
:total="listQuery.total"
|
||||||
|
:page.sync="listQuery.pageNo"
|
||||||
|
:limit.sync="listQuery.pageSize"
|
||||||
|
:page-sizes="[5, 10, 15]"
|
||||||
|
@pagination="getList" />
|
||||||
|
|
||||||
|
<div class="drawer-body__footer">
|
||||||
|
<el-button type="primary" @click="goback()">关闭</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<attr-add
|
||||||
|
v-if="addOrUpdateVisible"
|
||||||
|
ref="addOrUpdate"
|
||||||
|
:config-id="dataForm.id"
|
||||||
|
@refreshDataList="getList" />
|
||||||
|
</el-drawer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getEqCheck, getCheckDetPage, deleteCheckDet } from "@/api/equipment/base/inspection/settings";
|
||||||
|
import SmallTitle from './SmallTitle';
|
||||||
|
import attrAdd from './attr-add';
|
||||||
|
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
|
||||||
|
|
||||||
|
const tableBtn = [
|
||||||
|
{
|
||||||
|
type: 'edit',
|
||||||
|
btnName: '编辑',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'delete',
|
||||||
|
btnName: '删除',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const tableProps = [
|
||||||
|
{
|
||||||
|
prop: 'program',
|
||||||
|
label: '巡检项目',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'content',
|
||||||
|
label: '巡检内容',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'code',
|
||||||
|
label: '巡检内容编码',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'description',
|
||||||
|
label: '备注',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { SmallTitle, attrAdd },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
tableBtn,
|
||||||
|
tableProps,
|
||||||
|
addOrUpdateVisible: false,
|
||||||
|
urlOptions: {
|
||||||
|
infoURL: getEqCheck,
|
||||||
|
},
|
||||||
|
listQuery: {
|
||||||
|
pageSize: 10,
|
||||||
|
pageNo: 1,
|
||||||
|
total: 0,
|
||||||
|
},
|
||||||
|
dataForm: {
|
||||||
|
id: undefined,
|
||||||
|
code: undefined,
|
||||||
|
name: '',
|
||||||
|
materialType: undefined,
|
||||||
|
productType: undefined,
|
||||||
|
area: undefined,
|
||||||
|
specifications: undefined,
|
||||||
|
processTime: 0,
|
||||||
|
remark: undefined,
|
||||||
|
unit: undefined
|
||||||
|
},
|
||||||
|
checkDetList: [],
|
||||||
|
visible: false,
|
||||||
|
isdetail: false,
|
||||||
|
dataRule: {
|
||||||
|
code: [{ required: true, message: "物料编码不能为空", trigger: "blur" }],
|
||||||
|
name: [{ required: true, message: "物料名称不能为空", trigger: "blur" }],
|
||||||
|
materialType: [{ required: true, message: "物料类型不能为空", trigger: "change" }],
|
||||||
|
productType: [{ required: true, message: "产品类型不能为空", trigger: "change" }],
|
||||||
|
processTime: [{ required: true, message: "产线生产单位用时不能为空", trigger: "blur" }]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {},
|
||||||
|
methods: {
|
||||||
|
initData() {
|
||||||
|
this.checkDetList.splice(0);
|
||||||
|
this.listQuery.total = 0;
|
||||||
|
},
|
||||||
|
handleClick(raw) {
|
||||||
|
if (raw.type === 'delete') {
|
||||||
|
this.$confirm(
|
||||||
|
`确定对${
|
||||||
|
raw.data.attrName
|
||||||
|
? '[名称=' + raw.data.attrName + ']'
|
||||||
|
: '[序号=' + raw.data._pageIndex + ']'
|
||||||
|
}进行删除操作?`,
|
||||||
|
'提示',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
deleteCheckDet(raw.data.id).then(({ data }) => {
|
||||||
|
this.$message({
|
||||||
|
message: '操作成功',
|
||||||
|
type: 'success',
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
} else {
|
||||||
|
this.addNew(raw.data.id);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getList() {
|
||||||
|
// 获取巡检项目分页
|
||||||
|
getCheckDetPage({
|
||||||
|
...this.listQuery,
|
||||||
|
configId: this.dataForm.id,
|
||||||
|
}).then((response) => {
|
||||||
|
this.checkDetList = response.data.list;
|
||||||
|
this.listQuery.total = response.data.total;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
init(id, isdetail) {
|
||||||
|
this.initData();
|
||||||
|
this.isdetail = isdetail || false;
|
||||||
|
this.dataForm.id = id || undefined;
|
||||||
|
this.visible = true;
|
||||||
|
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['dataForm'].resetFields();
|
||||||
|
|
||||||
|
if (this.dataForm.id) {
|
||||||
|
// 获取设备巡检详情
|
||||||
|
this.urlOptions.infoURL(id).then(response => {
|
||||||
|
this.dataForm = response.data
|
||||||
|
});
|
||||||
|
// 获取设备项目列表
|
||||||
|
this.getList();
|
||||||
|
} else {
|
||||||
|
if (this.urlOptions.isGetCode) {
|
||||||
|
this.getCode()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
goback() {
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
this.visible = false;
|
||||||
|
// this.initData();
|
||||||
|
},
|
||||||
|
goEdit() {
|
||||||
|
this.isdetail = false;
|
||||||
|
},
|
||||||
|
// 新增 / 修改
|
||||||
|
addNew(id) {
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init(id);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</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;
|
||||||
|
}
|
||||||
|
.action_btn {
|
||||||
|
float: right;
|
||||||
|
margin: 5px 15px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
.add {
|
||||||
|
color: #0b58ff;
|
||||||
|
}
|
||||||
|
</style>
|
145
src/views/equipment/base/inspection/Settings/attr-add.vue
Normal file
145
src/views/equipment/base/inspection/Settings/attr-add.vue
Normal file
@ -0,0 +1,145 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
:visible.sync="visible"
|
||||||
|
:width="'35%'"
|
||||||
|
:append-to-body="true"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
class="dialog">
|
||||||
|
<template #title>
|
||||||
|
<slot name="title">
|
||||||
|
<div class="titleStyle">
|
||||||
|
{{ !dataForm.id ? '新增' : '编辑' }}
|
||||||
|
</div>
|
||||||
|
</slot>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<el-form
|
||||||
|
ref="dataForm"
|
||||||
|
:model="dataForm"
|
||||||
|
:rules="dataRule"
|
||||||
|
label-width="100px"
|
||||||
|
@keyup.enter.native="dataFormSubmit()">
|
||||||
|
<el-form-item label="巡检" prop="checkId">
|
||||||
|
<el-select v-model="dataForm.checkId" filterable placeholder="请选择巡检" style="width: 100%">
|
||||||
|
<el-option v-for="dict in checkList" :key="dict.id" :label="dict.content"
|
||||||
|
:value="dict.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="description">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.description"
|
||||||
|
placeholder="请输入备注"
|
||||||
|
clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row style="text-align: right">
|
||||||
|
<el-button @click="visible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||||
|
</el-row>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getCheckDet, createCheckDet, updateCheckDet, getcheckList } from "@/api/equipment/base/inspection/settings";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
configId: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
visible: false,
|
||||||
|
dataForm: {
|
||||||
|
id: undefined,
|
||||||
|
checkId: undefined,
|
||||||
|
configId: undefined,
|
||||||
|
description: ''
|
||||||
|
},
|
||||||
|
checkList: [],
|
||||||
|
dataRule: {
|
||||||
|
checkId: [{ required: true, message: '巡检不能为空', trigger: 'blur' }],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getDict()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async getDict() {
|
||||||
|
const res = await getcheckList()
|
||||||
|
this.checkList = res.data
|
||||||
|
},
|
||||||
|
init(id) {
|
||||||
|
this.dataForm.id = id || '';
|
||||||
|
this.visible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['dataForm'].resetFields();
|
||||||
|
if (this.dataForm.id) {
|
||||||
|
getCheckDet(this.dataForm.id).then((res) => {
|
||||||
|
// const { name, value } = res.data;
|
||||||
|
// this.dataForm.name = name;
|
||||||
|
// this.dataForm.value = value;
|
||||||
|
this.dataForm = res.data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 表单提交
|
||||||
|
dataFormSubmit() {
|
||||||
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
// 修改的提交
|
||||||
|
if (this.dataForm.id) {
|
||||||
|
updateCheckDet({
|
||||||
|
...this.dataForm,
|
||||||
|
configId: this.configId
|
||||||
|
}).then((response) => {
|
||||||
|
this.$modal.msgSuccess('修改成功');
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 添加的提交
|
||||||
|
createCheckDet({
|
||||||
|
...this.dataForm,
|
||||||
|
configId: this.configId,
|
||||||
|
}).then((response) => {
|
||||||
|
this.$modal.msgSuccess('新增成功');
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.dialog >>> .el-dialog__body {
|
||||||
|
padding: 30px 24px;
|
||||||
|
}
|
||||||
|
.dialog >>> .el-dialog__header {
|
||||||
|
font-size: 16px;
|
||||||
|
color: rgba(0, 0, 0, 0.85);
|
||||||
|
font-weight: 500;
|
||||||
|
padding: 13px 24px;
|
||||||
|
border-bottom: 1px solid #e9e9e9;
|
||||||
|
}
|
||||||
|
.dialog >>> .el-dialog__header .titleStyle::before {
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
width: 4px;
|
||||||
|
height: 16px;
|
||||||
|
background-color: #0b58ff;
|
||||||
|
border-radius: 1px;
|
||||||
|
margin-right: 8px;
|
||||||
|
position: relative;
|
||||||
|
top: 2px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -17,7 +17,7 @@
|
|||||||
v-if="tableBtn.length"
|
v-if="tableBtn.length"
|
||||||
slot="handleBtn"
|
slot="handleBtn"
|
||||||
label="操作"
|
label="操作"
|
||||||
:width="120"
|
:width="180"
|
||||||
:method-list="tableBtn"
|
:method-list="tableBtn"
|
||||||
@clickBtn="handleTableBtnClick" />
|
@clickBtn="handleTableBtnClick" />
|
||||||
</base-table>
|
</base-table>
|
||||||
@ -45,35 +45,49 @@
|
|||||||
:has-files="false"
|
:has-files="false"
|
||||||
:rows="rows" />
|
:rows="rows" />
|
||||||
</base-dialog>
|
</base-dialog>
|
||||||
|
<!-- 添加巡检,查看详情 -->
|
||||||
|
<addOrUpdata
|
||||||
|
v-if="addOrUpdateVisible"
|
||||||
|
ref="addOrUpdate"
|
||||||
|
@refreshDataList="getList" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||||
|
import addOrUpdata from './add-or-updata.vue';
|
||||||
// import { publicFormatter } from '@/utils/dict';
|
// import { publicFormatter } from '@/utils/dict';
|
||||||
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'EquipmentCheckSetting',
|
name: 'EquipmentCheckSetting',
|
||||||
components: {},
|
components: { addOrUpdata },
|
||||||
mixins: [basicPageMixin],
|
mixins: [basicPageMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
addOrUpdateVisible: false,
|
||||||
|
addOrEditTitle: '',
|
||||||
searchBarKeys: ['equipmentId', 'name'],
|
searchBarKeys: ['equipmentId', 'name'],
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
// this.$auth.hasPermi('equipment:check-setting:update')
|
|
||||||
// ? {
|
|
||||||
// type: 'detail',
|
|
||||||
// btnName: '详情',
|
|
||||||
// }
|
|
||||||
// : undefined,
|
|
||||||
this.$auth.hasPermi('equipment:check-setting:update')
|
this.$auth.hasPermi('equipment:check-setting:update')
|
||||||
? {
|
? {
|
||||||
type: 'edit',
|
type: 'edit',
|
||||||
btnName: '修改',
|
btnName: '修改',
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
|
this.$auth.hasPermi('equipment:check-setting:update')
|
||||||
|
? {
|
||||||
|
type: 'detail',
|
||||||
|
btnName: '查看详情',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
this.$auth.hasPermi('equipment:check-setting:addInsp')
|
||||||
|
? {
|
||||||
|
type: 'add',
|
||||||
|
btnName: '添加巡检',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
this.$auth.hasPermi('equipment:check-setting:delete')
|
this.$auth.hasPermi('equipment:check-setting:delete')
|
||||||
? {
|
? {
|
||||||
type: 'delete',
|
type: 'delete',
|
||||||
@ -285,13 +299,35 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
|
// 处理表格按钮
|
||||||
|
handleTableBtnClick({ data, type }) {
|
||||||
|
switch (type) {
|
||||||
|
case 'edit':
|
||||||
|
this.handleUpdate(data);
|
||||||
|
break;
|
||||||
|
case 'delete':
|
||||||
|
this.handleDelete(data);
|
||||||
|
break;
|
||||||
|
case 'detail':
|
||||||
|
this.handleDetail(data);
|
||||||
|
break;
|
||||||
|
case 'add':
|
||||||
|
this.handleAddDetail(data);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
handleDetail({ id }) {
|
handleDetail({ id }) {
|
||||||
this.reset();
|
this.addOrUpdateVisible = true;
|
||||||
this.mode = 'detail';
|
this.addOrEditTitle = "详情";
|
||||||
this.info({ id }).then((response) => {
|
this.$nextTick(() => {
|
||||||
this.form = response.data;
|
this.$refs.addOrUpdate.init(id, true);
|
||||||
this.open = true;
|
});
|
||||||
this.title = '修改巡检设置';
|
},
|
||||||
|
handleAddDetail({ id }) {
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.addOrEditTitle = "添加巡检";
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init(id);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
|
@ -92,7 +92,7 @@ const btn = {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleClick() {
|
handleClick() {
|
||||||
this.$emit('emitData', { action: this.injectData.label, value: null });
|
this.$emit('emitData', { action: this.injectData.label, value: this.injectData });
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
render: function (h) {
|
render: function (h) {
|
||||||
@ -224,11 +224,18 @@ export default {
|
|||||||
switch (action) {
|
switch (action) {
|
||||||
// 查看详情
|
// 查看详情
|
||||||
case '设备保养':
|
case '设备保养':
|
||||||
alert('设备保养');
|
this.$router.push({ path: '/equipment/base/maintain/plan-config',query: {
|
||||||
|
equipmentId: value.equipmentId,
|
||||||
|
equipmentName: value.equipmentName
|
||||||
|
} })
|
||||||
break;
|
break;
|
||||||
case '保养记录':
|
case '保养记录':
|
||||||
alert('保养记录');
|
const queryData = {
|
||||||
break;
|
equipmentId: value.equipmentId,
|
||||||
|
maintainPlanId: value.id
|
||||||
|
}
|
||||||
|
this.$router.push({ path: '/equipment/base/maintain/record',query: queryData })
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/** 查询列表 */
|
/** 查询列表 */
|
||||||
|
@ -110,8 +110,8 @@ export default {
|
|||||||
label: '时间段',
|
label: '时间段',
|
||||||
dateType: 'daterange', // datetimerange
|
dateType: 'daterange', // datetimerange
|
||||||
format: 'yyyy-MM-dd',
|
format: 'yyyy-MM-dd',
|
||||||
// valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||||
valueFormat: 'timestamp',
|
// valueFormat: 'timestamp',
|
||||||
rangeSeparator: '-',
|
rangeSeparator: '-',
|
||||||
startPlaceholder: '开始日期',
|
startPlaceholder: '开始日期',
|
||||||
endPlaceholder: '结束日期',
|
endPlaceholder: '结束日期',
|
||||||
@ -239,6 +239,10 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
if (this.$route.query) {
|
||||||
|
this.queryParams.equipmentId = this.$route.query?.equipmentId ?? undefined
|
||||||
|
this.searchBarFormConfig[0].defaultSelect = this.$route.query.equipmentName ?? undefined
|
||||||
|
}
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -288,12 +292,20 @@ export default {
|
|||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = '添加保养计划';
|
this.title = '添加保养计划';
|
||||||
},
|
},
|
||||||
handleDetail(id){
|
handleDetail(row){
|
||||||
// alert('跳转到 保养记录')
|
// alert('跳转到 保养记录')
|
||||||
this.$router.push({
|
// console.log(row)
|
||||||
name: 'Record',
|
const queryData = {
|
||||||
// params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime }
|
equipmentId: row.equipmentId,
|
||||||
})
|
maintainPlanId: row.id,
|
||||||
|
relatePlan: row.enabled
|
||||||
|
}
|
||||||
|
if (this.queryParams.createTime) {
|
||||||
|
queryData.createTime = this.queryParams.createTime
|
||||||
|
}
|
||||||
|
console.log('你好', queryData)
|
||||||
|
this.$router.push({ path: '/equipment/base/maintain/record',query: queryData })
|
||||||
|
// this.$router.push({ path: '/equipment/base/maintain/record', query: { orderNo: row.orderNo }})
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
|
@ -52,6 +52,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||||
|
import Editor from '@/components/Editor';
|
||||||
|
|
||||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||||
|
|
||||||
@ -192,13 +193,13 @@ export default {
|
|||||||
select: true,
|
select: true,
|
||||||
label: '保养人员',
|
label: '保养人员',
|
||||||
prop: 'maintainWorker',
|
prop: 'maintainWorker',
|
||||||
// url: '/base/core-equipment/listAll',
|
url: '/base/core-worker/listAll',
|
||||||
|
valueKey: 'name',
|
||||||
bind: {
|
bind: {
|
||||||
filterable: true,
|
filterable: true,
|
||||||
clearable: true,
|
clearable: true,
|
||||||
multiple: true,
|
multiple: true,
|
||||||
},
|
},
|
||||||
selectOptions: [{ name: 'test', id: 'test' }],
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -212,6 +213,11 @@ export default {
|
|||||||
switch: true,
|
switch: true,
|
||||||
label: '是否计划保养',
|
label: '是否计划保养',
|
||||||
prop: 'relatePlan',
|
prop: 'relatePlan',
|
||||||
|
bind: {
|
||||||
|
'active-value': 1,
|
||||||
|
'inactive-value': 2,
|
||||||
|
},
|
||||||
|
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||||
},
|
},
|
||||||
{},
|
{},
|
||||||
{
|
{
|
||||||
@ -266,7 +272,9 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
// TODO: 富文本
|
// TODO: 富文本
|
||||||
[{ input: true, label: '保养描述', prop: 'maintenanceDes' }],
|
[{ label: '保养描述', prop: 'maintenanceDes', subcomponent: Editor, bind: {
|
||||||
|
'min-height': 192
|
||||||
|
} }],
|
||||||
[{ input: true, label: '备注', prop: 'remark' }],
|
[{ input: true, label: '备注', prop: 'remark' }],
|
||||||
],
|
],
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
@ -289,6 +297,16 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.initSearchBar();
|
this.initSearchBar();
|
||||||
|
if (this.$route.query) {
|
||||||
|
this.queryParams.equipmentId = this.$route.query?.equipmentId ?? undefined
|
||||||
|
this.queryParams.maintainPlanId = this.$route.query?.maintainPlanId ?? undefined
|
||||||
|
this.queryParams.relatePlan = this.$route.query?.relatePlan ?? undefined
|
||||||
|
this.queryParams.startTime = this.$route.query?.createTime ?? undefined
|
||||||
|
this.searchBarFormConfig[0].defaultSelect = this.$route.query.equipmentId ?? undefined
|
||||||
|
this.searchBarFormConfig[1].defaultSelect = Number(this.$route.query.maintainPlanId) ?? undefined
|
||||||
|
this.searchBarFormConfig[2].defaultSelect = this.$route.query?.createTime ?? undefined
|
||||||
|
this.searchBarFormConfig[3].defaultSelect = Number(this.$route.query.relatePlan) ?? undefined
|
||||||
|
}
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -380,6 +398,7 @@ export default {
|
|||||||
this.info({ id }).then((response) => {
|
this.info({ id }).then((response) => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
|
this.form.maintainWorker = this.form.maintainWorker.split(',')
|
||||||
this.title = '修改保养记录';
|
this.title = '修改保养记录';
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -389,6 +408,7 @@ export default {
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.form.maintainWorker = this.form.maintainWorker.join(',')
|
||||||
// 修改的提交
|
// 修改的提交
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
this.put(this.form).then((response) => {
|
this.put(this.form).then((response) => {
|
||||||
|
@ -6,155 +6,179 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-form
|
<el-drawer
|
||||||
ref="form"
|
:visible.sync="visible"
|
||||||
:model="dataForm"
|
:show-close="false"
|
||||||
label-width="100px"
|
:wrapper-closable="false"
|
||||||
v-loading="formLoading">
|
class="drawer"
|
||||||
<el-row :gutter="20">
|
size="60%">
|
||||||
<el-col :span="8">
|
<small-title slot="title" :no-padding="true">
|
||||||
<el-form-item label="维修单号" prop="code">
|
{{ disabled ? '查看详情' : !dataForm.maintenanceStatus ? '修改' : '完成' }}
|
||||||
<span>{{ dataForm.code }}</span>
|
</small-title>
|
||||||
</el-form-item>
|
<el-form
|
||||||
</el-col>
|
ref="form"
|
||||||
<el-col :span="8">
|
:model="dataForm"
|
||||||
<el-form-item label="设备名称" prop="code">
|
label-width="100px"
|
||||||
<span>{{ dataForm.code }}</span>
|
v-loading="formLoading">
|
||||||
</el-form-item>
|
<el-row :gutter="20">
|
||||||
</el-col>
|
<el-col :span="8">
|
||||||
<el-col :span="8">
|
<el-form-item label="维修单号" prop="repairOrderNumber">
|
||||||
<el-form-item label="维修工" prop="code">
|
<span>{{ dataForm.repairOrderNumber }}</span>
|
||||||
<span>{{ dataForm.code }}</span>
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-col>
|
||||||
</el-col>
|
<el-col :span="8">
|
||||||
</el-row>
|
<el-form-item label="设备名称" prop="equipmentName">
|
||||||
<el-row :gutter="20">
|
<span>{{ dataForm.equipmentName }}</span>
|
||||||
<el-col :span="8">
|
</el-form-item>
|
||||||
<el-form-item label="故障发生时间" prop="code">
|
</el-col>
|
||||||
<span>{{ dataForm.code }}</span>
|
<el-col :span="8">
|
||||||
</el-form-item>
|
<el-form-item label="维修工" prop="repairman">
|
||||||
</el-col>
|
<span>{{ dataForm.repairman }}</span>
|
||||||
<el-col :span="8">
|
</el-form-item>
|
||||||
<el-form-item label="故障级别" prop="code">
|
</el-col>
|
||||||
<span>{{ dataForm.code }}</span>
|
</el-row>
|
||||||
</el-form-item>
|
<el-row :gutter="20">
|
||||||
</el-col>
|
<el-col :span="8">
|
||||||
<el-col :span="8">
|
<el-form-item label="故障发生时间" prop="faultTime">
|
||||||
<el-form-item label="联系方式" prop="code">
|
<span>{{ dataForm.faultTime }}</span>
|
||||||
<span>{{ dataForm.code }}</span>
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-col>
|
||||||
</el-col>
|
<el-col :span="8">
|
||||||
</el-row>
|
<el-form-item label="故障级别" prop="faultLevel">
|
||||||
<el-row :gutter="20">
|
<span>{{ dataForm.faultLevel }}</span>
|
||||||
<el-col :span="8">
|
</el-form-item>
|
||||||
<el-form-item
|
</el-col>
|
||||||
label="维修开始时间"
|
<el-col :span="8">
|
||||||
prop="alarmCode"
|
<el-form-item label="联系方式" prop="repairmanPhone">
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
<span>{{ dataForm.repairmanPhone }}</span>
|
||||||
<el-date-picker
|
</el-form-item>
|
||||||
v-model="dataForm.startTIme"
|
</el-col>
|
||||||
type="datetime"
|
</el-row>
|
||||||
:disabled="disabled"
|
<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
|
||||||
:placeholder="请选择维修开始时间"
|
{{ '可编辑信息' }}
|
||||||
value-format="timestamp"
|
</small-title>
|
||||||
@change="$emit('update', form)"></el-date-picker>
|
<el-row :gutter="20">
|
||||||
</el-form-item>
|
<el-col :span="8">
|
||||||
</el-col>
|
<el-form-item
|
||||||
|
label="维修开始时间"
|
||||||
|
prop="maintenanceStartTime"
|
||||||
|
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dataForm.maintenanceStartTime"
|
||||||
|
type="datetime"
|
||||||
|
:disabled="disabled"
|
||||||
|
placeholder="请选择维修开始时间"
|
||||||
|
value-format="timestamp" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="维修结束时间"
|
label="维修结束时间"
|
||||||
prop="alarmCode"
|
prop="maintenanceFinishTime"
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="dataForm.startTIme"
|
v-model="dataForm.maintenanceFinishTime"
|
||||||
type="datetime"
|
type="datetime"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
:placeholder="请选择维修开始时间"
|
placeholder="请选择维修开始时间"
|
||||||
value-format="timestamp"
|
value-format="timestamp" />
|
||||||
@change="$emit('update', form)"></el-date-picker>
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-col>
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="维修方式"
|
label="维修方式"
|
||||||
prop="grade"
|
prop="repairMode"
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
||||||
<el-select
|
<el-select
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
v-model="dataForm.grade"
|
v-model="dataForm.repairMode"
|
||||||
placeholder="请选择报警级别"
|
placeholder="请选择维修方式">
|
||||||
@change="$emit('update', dataForm)">
|
<el-option
|
||||||
<el-option
|
v-for="opt in getDictDatas('repair-mode')"
|
||||||
v-for="opt in getDictDatas(DICT_TYPE.EQU_ALARM_LEVEL)"
|
:key="opt.value"
|
||||||
:key="opt.value"
|
:label="opt.label"
|
||||||
:label="opt.label"
|
:value="opt.value" />
|
||||||
:value="opt.value" />
|
</el-select>
|
||||||
</el-select>
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-col>
|
||||||
</el-col>
|
</el-row>
|
||||||
</el-row>
|
<el-row :gutter="20">
|
||||||
<el-row :gutter="20">
|
<el-col :span="8">
|
||||||
<el-col :span="8">
|
<el-form-item label="故障类型" prop="faultType">
|
||||||
<el-form-item label="故障类型" prop="alarmCode">
|
<el-select
|
||||||
<el-select
|
:disabled="disabled"
|
||||||
:disabled="disabled"
|
v-model="dataForm.faultType"
|
||||||
v-model="dataForm.grade"
|
placeholder="请选择故障类型">
|
||||||
placeholder="请选择报警级别"
|
<el-option
|
||||||
@change="$emit('update', dataForm)">
|
v-for="opt in getDictDatas('fault-type')"
|
||||||
<el-option
|
:key="opt.value"
|
||||||
v-for="opt in getDictDatas(DICT_TYPE.EQU_ALARM_LEVEL)"
|
:label="opt.label"
|
||||||
:key="opt.value"
|
:value="opt.value" />
|
||||||
:label="opt.label"
|
</el-select>
|
||||||
:value="opt.value" />
|
</el-form-item>
|
||||||
</el-select>
|
</el-col>
|
||||||
</el-form-item>
|
</el-row>
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="故障明细"
|
label="故障明细"
|
||||||
prop="dsfsdfasd"
|
prop="faultDetail"
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
||||||
<!-- // 富文本 -->
|
<!-- // 富文本 -->
|
||||||
</el-form-item>
|
<editor v-model="dataForm.faultDetail" :read-only="disabled" :min-height="380"/>
|
||||||
</el-col>
|
</el-form-item>
|
||||||
</el-row>
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-form-item label="维修记录" prop="dsfsdfasd">
|
<el-form-item label="维修记录" prop="maintenanceDetail">
|
||||||
<!-- // 富文本 -->
|
<!-- // 富文本 -->
|
||||||
</el-form-item>
|
<editor v-model="dataForm.maintenanceDetail" :read-only="disabled" :min-height="380"/>
|
||||||
</el-col>
|
</el-form-item>
|
||||||
</el-row>
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-form-item label="维修附件" prop="dsfsdfasd">
|
<el-form-item label="维修附件" prop="file">
|
||||||
<el-upload></el-upload>
|
<FileUpload v-model="file" :disabled="disabled" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="dataForm.remark"
|
v-model="dataForm.remark"
|
||||||
@change="$emit('update', form)"
|
:placeholder="`请输入备注`"
|
||||||
:placeholder="`请输入备注`"
|
:disabled="disabled" />
|
||||||
:disabled="disabled" />
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-col>
|
||||||
</el-col>
|
</el-row>
|
||||||
</el-row>
|
</el-form>
|
||||||
</el-form>
|
|
||||||
|
<div class="drawer-body__footer">
|
||||||
|
<el-button style="" @click="goback()">取消</el-button>
|
||||||
|
<el-button v-if="disabled" type="primary" @click="goEdit()">
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-drawer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import SmallTitle from '../../base/alarm/Record/SmallTitle.vue';
|
||||||
|
import { getEqRepair, updateEqRepair } from '@/api/equipment/base/repair'
|
||||||
|
import Editor from "@/components/Editor";
|
||||||
|
import FileUpload from "@/components/FileUpload";
|
||||||
|
import { getDictDatas } from "@/utils/dict";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'DialogForm',
|
name: 'DialogForm',
|
||||||
model: {
|
model: {
|
||||||
@ -162,32 +186,35 @@ export default {
|
|||||||
event: 'update',
|
event: 'update',
|
||||||
},
|
},
|
||||||
emits: ['update'],
|
emits: ['update'],
|
||||||
components: {},
|
components: { SmallTitle, Editor, FileUpload },
|
||||||
props: {
|
props: {
|
||||||
dataForm: {
|
// dataForm: {
|
||||||
type: Object,
|
// type: Object,
|
||||||
default: () => ({}),
|
// default: () => ({}),
|
||||||
},
|
// },
|
||||||
disabled: {
|
// disabled: {
|
||||||
type: Boolean,
|
// type: Boolean,
|
||||||
default: false,
|
// default: false
|
||||||
},
|
// },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
formLoading: true,
|
formLoading: true,
|
||||||
|
visible: false,
|
||||||
|
disabled: false,
|
||||||
|
dataForm: {},
|
||||||
|
file: ''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {},
|
||||||
this.getCode('/base/equipment-group-alarm/getCode').then((code) => {
|
|
||||||
this.formLoading = false;
|
|
||||||
this.$emit('update', {
|
|
||||||
...this.dataForm,
|
|
||||||
code,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
|
goback() {
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
this.visible = false;
|
||||||
|
},
|
||||||
|
goEdit() {
|
||||||
|
this.isdetail = false;
|
||||||
|
},
|
||||||
/** 模拟透传 ref */
|
/** 模拟透传 ref */
|
||||||
validate(cb) {
|
validate(cb) {
|
||||||
return this.$refs.form.validate(cb);
|
return this.$refs.form.validate(cb);
|
||||||
@ -195,22 +222,124 @@ export default {
|
|||||||
resetFields(args) {
|
resetFields(args) {
|
||||||
return this.$refs.form.resetFields(args);
|
return this.$refs.form.resetFields(args);
|
||||||
},
|
},
|
||||||
async handleTypeChange(id) {
|
init(row, isdetail) {
|
||||||
// debugger;
|
// this.initData();
|
||||||
this.dataForm.alarmCode = '';
|
this.disabled = isdetail || false;
|
||||||
this.$emit('update', this.dataForm);
|
this.dataForm.id = row.id || undefined;
|
||||||
},
|
this.visible = true;
|
||||||
async getCode(url) {
|
console.log('111', this.dataForm, row)
|
||||||
const response = await this.$axios(url);
|
|
||||||
return response.data;
|
this.$nextTick(() => {
|
||||||
|
this.$refs['form'].resetFields();
|
||||||
|
|
||||||
|
if (this.dataForm.id) {
|
||||||
|
// 获取设备维修
|
||||||
|
getEqRepair(this.dataForm.id).then(response => {
|
||||||
|
this.formLoading = false
|
||||||
|
this.dataForm = response.data;
|
||||||
|
this.dataForm.maintenanceStatus = row.maintenanceStatus || 0
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// if (this.urlOptions.isGetCode) {
|
||||||
|
// this.getCode()
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
// 表单提交
|
||||||
|
dataFormSubmit() {
|
||||||
|
this.$refs["form"].validate((valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 修改的提交
|
||||||
|
if (this.file) {
|
||||||
|
const temp = this.file.split(',') // 获取文件个数
|
||||||
|
let arry = []
|
||||||
|
temp.forEach(item => {
|
||||||
|
arry.push({
|
||||||
|
fileType: 2,
|
||||||
|
fileUrl: item
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.dataForm.files = arry
|
||||||
|
}
|
||||||
|
if (this.dataForm.id) {
|
||||||
|
updateEqRepair(this.dataForm).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit("refreshDataList");
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 添加的提交
|
||||||
|
// this.urlOptions.createURL(this.dataForm).then(response => {
|
||||||
|
// this.$modal.msgSuccess("新增成功");
|
||||||
|
// this.visible = false;
|
||||||
|
// this.$emit("refreshDataList");
|
||||||
|
// });
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped>
|
||||||
.el-date-editor,
|
.el-date-editor,
|
||||||
.el-select {
|
.el-select {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
.drawer-body__footer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
padding: 18px;
|
||||||
|
}
|
||||||
|
.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>
|
</style>
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
v-if="tableBtn.length"
|
v-if="tableBtn.length"
|
||||||
slot="handleBtn"
|
slot="handleBtn"
|
||||||
label="操作"
|
label="操作"
|
||||||
:width="120"
|
:width="180"
|
||||||
:method-list="tableBtn"
|
:method-list="tableBtn"
|
||||||
@clickBtn="handleTableBtnClick" />
|
@clickBtn="handleTableBtnClick" />
|
||||||
</base-table>
|
</base-table>
|
||||||
@ -45,21 +45,27 @@
|
|||||||
:has-files="true"
|
:has-files="true"
|
||||||
:rows="rows" />
|
:rows="rows" />
|
||||||
</base-dialog>
|
</base-dialog>
|
||||||
|
<CustomDialogForm
|
||||||
|
v-if="addOrUpdateVisible"
|
||||||
|
ref="addOrUpdate"
|
||||||
|
@refreshDataList="getList" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||||
|
import CustomDialogForm from './CustomDialogForm.vue';
|
||||||
|
|
||||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'EquipmentRepair',
|
name: 'EquipmentRepair',
|
||||||
components: {},
|
components: { CustomDialogForm },
|
||||||
mixins: [basicPageMixin],
|
mixins: [basicPageMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
addOrUpdateVisible: false,
|
||||||
searchBarKeys: ['maintenanceStatus', 'createTime', 'equipmentId'],
|
searchBarKeys: ['maintenanceStatus', 'createTime', 'equipmentId'],
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
this.$auth.hasPermi('equipment:repair:update')
|
this.$auth.hasPermi('equipment:repair:update')
|
||||||
@ -68,6 +74,12 @@ export default {
|
|||||||
btnName: '详情',
|
btnName: '详情',
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
|
this.$auth.hasPermi('equipment:repair:finish')
|
||||||
|
? {
|
||||||
|
type: 'finish',
|
||||||
|
btnName: '完成',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
this.$auth.hasPermi('equipment:repair:update')
|
this.$auth.hasPermi('equipment:repair:update')
|
||||||
? {
|
? {
|
||||||
type: 'edit',
|
type: 'edit',
|
||||||
@ -156,6 +168,7 @@ export default {
|
|||||||
input: true,
|
input: true,
|
||||||
label: '维修单号',
|
label: '维修单号',
|
||||||
prop: 'repairOrderNumber',
|
prop: 'repairOrderNumber',
|
||||||
|
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
select: true,
|
select: true,
|
||||||
@ -172,16 +185,18 @@ export default {
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
// TODO: 和班组联动
|
// TODO: 和班组联动
|
||||||
select: true,
|
// select: true,
|
||||||
|
input: true,
|
||||||
label: '维修工',
|
label: '维修工',
|
||||||
prop: 'repairman',
|
prop: 'repairman',
|
||||||
// url: '/base/core-equipment/listAll',
|
// url: '/base/core-worker/listAll',
|
||||||
|
// valueKey: 'name',
|
||||||
bind: {
|
bind: {
|
||||||
filterable: true,
|
filterable: true,
|
||||||
clearable: true,
|
clearable: true,
|
||||||
multiple: true,
|
// multiple: true,
|
||||||
},
|
},
|
||||||
options: [{ label: 'test', value: 'test' }],
|
// options: [{ label: 'test', value: 'test' }],
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -306,12 +321,28 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
// this.reset();
|
||||||
const id = row.id;
|
// const id = row.id;
|
||||||
this.info({ id }).then((response) => {
|
// this.info({ id }).then((response) => {
|
||||||
this.form = response.data;
|
// this.form = response.data;
|
||||||
this.open = true;
|
// // this.form.repairman = this.form.repairman.split(',')
|
||||||
this.title = '修改维修记录';
|
// this.open = true;
|
||||||
|
// this.title = '修改维修记录';
|
||||||
|
// });
|
||||||
|
this.addOrUpdateVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init({id: row.id});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 完成按钮操作 */
|
||||||
|
handlFinish(row) {
|
||||||
|
this.addOrUpdateVisible = true
|
||||||
|
const params = {
|
||||||
|
id: row.id,
|
||||||
|
maintenanceStatus: 1
|
||||||
|
}
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init(params);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
@ -320,6 +351,9 @@ export default {
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// if (this.form.repairman) {
|
||||||
|
// this.form.repairman = this.form.repairman.join(',')
|
||||||
|
// }
|
||||||
// 修改的提交
|
// 修改的提交
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
this.put(this.form).then((response) => {
|
this.put(this.form).then((response) => {
|
||||||
@ -352,12 +386,9 @@ export default {
|
|||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
handleDetail({ id }) {
|
handleDetail({ id }) {
|
||||||
this.reset();
|
this.addOrUpdateVisible = true
|
||||||
this.mode = 'detail';
|
this.$nextTick(() => {
|
||||||
this.info({ id }).then((response) => {
|
this.$refs.addOrUpdate.init({id: id}, true);
|
||||||
this.form = response.data;
|
|
||||||
this.open = true;
|
|
||||||
this.title = '修改维修记录';
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
@ -378,6 +409,23 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
|
// 处理表格按钮
|
||||||
|
handleTableBtnClick({ data, type }) {
|
||||||
|
switch (type) {
|
||||||
|
case 'edit':
|
||||||
|
this.handleUpdate(data);
|
||||||
|
break;
|
||||||
|
case 'delete':
|
||||||
|
this.handleDelete(data);
|
||||||
|
break;
|
||||||
|
case 'detail':
|
||||||
|
this.handleDetail(data);
|
||||||
|
break;
|
||||||
|
case 'finish':
|
||||||
|
this.handlFinish(data);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
315
src/views/equipment/base/spareParts/Config/addSparts.vue
Normal file
315
src/views/equipment/base/spareParts/Config/addSparts.vue
Normal file
@ -0,0 +1,315 @@
|
|||||||
|
<!--
|
||||||
|
filename: dialogForm.vue
|
||||||
|
author: liubin
|
||||||
|
date: 2023-10-31 15:55:13
|
||||||
|
description:
|
||||||
|
-->
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<el-drawer
|
||||||
|
:visible.sync="visible"
|
||||||
|
:show-close="false"
|
||||||
|
:wrapper-closable="false"
|
||||||
|
class="drawer"
|
||||||
|
size="60%">
|
||||||
|
<small-title slot="title" :no-padding="true">
|
||||||
|
{{ disabled ? '查看备件' : '添加备件' }}
|
||||||
|
</small-title>
|
||||||
|
<el-form
|
||||||
|
ref="form"
|
||||||
|
:model="dataForm"
|
||||||
|
label-width="100px"
|
||||||
|
v-loading="formLoading">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="配置名" prop="name">
|
||||||
|
<span>{{ dataForm.name }}</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="设备名称" prop="equipmentName">
|
||||||
|
<span>{{ dataForm.equipmentName }}</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="负责人" prop="responsible">
|
||||||
|
<span>{{ dataForm.responsible }}</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-form-item label="描述" prop="faultTime">
|
||||||
|
<editor v-model="dataForm.description" read-only :min-height="200"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<div v-if="!disabled" class="action_btn">
|
||||||
|
<template>
|
||||||
|
<span style="display: inline-block;" @click="addNew()">
|
||||||
|
<svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" />
|
||||||
|
<span class="add">添加</span>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
<base-table
|
||||||
|
:table-props="tableProps"
|
||||||
|
:page="listQuery.pageNo"
|
||||||
|
:limit="listQuery.pageSize"
|
||||||
|
:table-data="list">
|
||||||
|
<method-btn
|
||||||
|
v-if="!disabled"
|
||||||
|
slot="handleBtn"
|
||||||
|
:width="120"
|
||||||
|
label="操作"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleClick" />
|
||||||
|
</base-table>
|
||||||
|
<pagination
|
||||||
|
v-show="listQuery.total > 0"
|
||||||
|
:total="listQuery.total"
|
||||||
|
:page.sync="listQuery.pageNo"
|
||||||
|
:limit.sync="listQuery.pageSize"
|
||||||
|
:page-sizes="[5, 10, 15]"
|
||||||
|
@pagination="getList" />
|
||||||
|
|
||||||
|
<div class="drawer-body__footer">
|
||||||
|
<el-button type="primary" @click="goback()">关闭</el-button>
|
||||||
|
<el-button v-if="disabled" type="primary" @click="goEdit()">
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<attr-add
|
||||||
|
v-if="addOrUpdateVisible"
|
||||||
|
ref="addOrUpdate"
|
||||||
|
:config-id="dataForm.id"
|
||||||
|
@refreshDataList="getList" />
|
||||||
|
</el-drawer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import SmallTitle from '../../../base/alarm/Record/SmallTitle.vue';
|
||||||
|
import { getSparePartConfig, deleteConfigDet, getConfigDetPage } from '@/api/equipment/base/spare-parts/config'
|
||||||
|
import Editor from "@/components/Editor";
|
||||||
|
// import FileUpload from "@/components/FileUpload";
|
||||||
|
import { parseTime } from '../../../../core/mixins/code-filter';
|
||||||
|
import attrAdd from './attr-add';
|
||||||
|
|
||||||
|
const tableBtn = [
|
||||||
|
{
|
||||||
|
type: 'delete',
|
||||||
|
btnName: '删除',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const tableProps = [
|
||||||
|
{
|
||||||
|
prop: 'createTime',
|
||||||
|
label: '添加时间',
|
||||||
|
filter: parseTime,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'sparePartName',
|
||||||
|
label: '备品备件',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'life',
|
||||||
|
label: '使用寿命(h)',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '备注'
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DialogForm',
|
||||||
|
model: {
|
||||||
|
prop: 'dataForm',
|
||||||
|
event: 'update',
|
||||||
|
},
|
||||||
|
emits: ['update'],
|
||||||
|
components: { SmallTitle, Editor, attrAdd },
|
||||||
|
props: {
|
||||||
|
// dataForm: {
|
||||||
|
// type: Object,
|
||||||
|
// default: () => ({}),
|
||||||
|
// },
|
||||||
|
// disabled: {
|
||||||
|
// type: Boolean,
|
||||||
|
// default: false
|
||||||
|
// },
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
tableBtn,
|
||||||
|
tableProps,
|
||||||
|
addOrUpdateVisible: false,
|
||||||
|
formLoading: true,
|
||||||
|
visible: false,
|
||||||
|
disabled: false,
|
||||||
|
dataForm: {},
|
||||||
|
list: [],
|
||||||
|
listQuery: {
|
||||||
|
pageSize: 10,
|
||||||
|
pageNo: 1,
|
||||||
|
total: 0,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {},
|
||||||
|
methods: {
|
||||||
|
goback() {
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
this.visible = false;
|
||||||
|
},
|
||||||
|
goEdit() {
|
||||||
|
this.disabled = false;
|
||||||
|
},
|
||||||
|
/** 模拟透传 ref */
|
||||||
|
validate(cb) {
|
||||||
|
return this.$refs.form.validate(cb);
|
||||||
|
},
|
||||||
|
resetFields(args) {
|
||||||
|
return this.$refs.form.resetFields(args);
|
||||||
|
},
|
||||||
|
init(id, isdetail) {
|
||||||
|
// this.initData();
|
||||||
|
this.disabled = isdetail || false;
|
||||||
|
this.dataForm.id = id || undefined;
|
||||||
|
this.visible = true;
|
||||||
|
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['form'].resetFields();
|
||||||
|
|
||||||
|
if (this.dataForm.id) {
|
||||||
|
// 获取备品备件
|
||||||
|
getSparePartConfig(this.dataForm.id).then(response => {
|
||||||
|
this.formLoading = false
|
||||||
|
this.dataForm = response.data;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// if (this.urlOptions.isGetCode) {
|
||||||
|
// this.getCode()
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.formLoading = false
|
||||||
|
},
|
||||||
|
handleClick(raw) {
|
||||||
|
if (raw.type === 'delete') {
|
||||||
|
this.$confirm(
|
||||||
|
`确定要删除名称为${raw.data.sparePartName}的数据?`,
|
||||||
|
'提示',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
deleteConfigDet(raw.data.id).then(({ data }) => {
|
||||||
|
this.$message({
|
||||||
|
message: '操作成功',
|
||||||
|
type: 'success',
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
} else {
|
||||||
|
this.addNew(raw.data.id);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getList() {
|
||||||
|
// 获取备品备件详情分页
|
||||||
|
getConfigDetPage({
|
||||||
|
...this.listQuery,
|
||||||
|
configId: this.dataForm.id,
|
||||||
|
}).then((response) => {
|
||||||
|
this.list = response.data.list;
|
||||||
|
this.listQuery.total = response.data.total;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 新增 / 修改
|
||||||
|
addNew(id) {
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init(id);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.el-date-editor,
|
||||||
|
.el-select {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.drawer-body__footer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
padding: 18px;
|
||||||
|
}
|
||||||
|
.action_btn {
|
||||||
|
float: right;
|
||||||
|
margin: 5px 15px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
.add {
|
||||||
|
color: #0b58ff;
|
||||||
|
}
|
||||||
|
.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>
|
148
src/views/equipment/base/spareParts/Config/attr-add.vue
Normal file
148
src/views/equipment/base/spareParts/Config/attr-add.vue
Normal file
@ -0,0 +1,148 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
:visible.sync="visible"
|
||||||
|
:width="'35%'"
|
||||||
|
:append-to-body="true"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
class="dialog">
|
||||||
|
<template #title>
|
||||||
|
<slot name="title">
|
||||||
|
<div class="titleStyle">
|
||||||
|
{{ !dataForm.id ? '新增' : '编辑' }}
|
||||||
|
</div>
|
||||||
|
</slot>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<el-form
|
||||||
|
ref="dataForm"
|
||||||
|
:model="dataForm"
|
||||||
|
:rules="dataRule"
|
||||||
|
label-width="100px"
|
||||||
|
@keyup.enter.native="dataFormSubmit()">
|
||||||
|
<el-form-item label="备品备件" prop="sparePartId">
|
||||||
|
<el-select
|
||||||
|
v-model="dataForm.sparePartId"
|
||||||
|
filterable
|
||||||
|
style="width: 100%"
|
||||||
|
placeholder="请选择备品备件">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in partList"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.name"
|
||||||
|
:value="dict.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row style="text-align: right">
|
||||||
|
<el-button @click="visible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||||
|
</el-row>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
createConfigDet,
|
||||||
|
getSparePartList
|
||||||
|
} from '@/api/equipment/base/spare-parts/config';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
configId: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
visible: false,
|
||||||
|
dataForm: {
|
||||||
|
id: undefined,
|
||||||
|
sparePartId: ''
|
||||||
|
},
|
||||||
|
partList: [],
|
||||||
|
dataRule: {
|
||||||
|
sparePartId: [{ required: true, message: '备品备件不能为空', trigger: 'change' }]
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getDict()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async getDict() {
|
||||||
|
const res = await getSparePartList()
|
||||||
|
this.partList = res.data
|
||||||
|
},
|
||||||
|
init(id) {
|
||||||
|
this.dataForm.id = id || '';
|
||||||
|
this.visible = true;
|
||||||
|
// this.$nextTick(() => {
|
||||||
|
// this.$refs['dataForm'].resetFields();
|
||||||
|
// if (this.dataForm.id) {
|
||||||
|
// getCoreProductAttr({
|
||||||
|
// id: this.dataForm.id
|
||||||
|
// }).then((res) => {
|
||||||
|
// const { name, value } = res.data;
|
||||||
|
// this.dataForm.name = name;
|
||||||
|
// this.dataForm.value = value;
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
},
|
||||||
|
// 表单提交
|
||||||
|
dataFormSubmit() {
|
||||||
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
// 修改的提交
|
||||||
|
// if (this.dataForm.id) {
|
||||||
|
// updateCoreProductAttr({
|
||||||
|
// ...this.dataForm,
|
||||||
|
// productId: this.productId,
|
||||||
|
// }).then((response) => {
|
||||||
|
// this.$modal.msgSuccess('修改成功');
|
||||||
|
// this.visible = false;
|
||||||
|
// this.$emit('refreshDataList');
|
||||||
|
// });
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// 添加的提交
|
||||||
|
createConfigDet({
|
||||||
|
...this.dataForm,
|
||||||
|
configId: this.configId,
|
||||||
|
}).then((response) => {
|
||||||
|
this.$modal.msgSuccess('新增成功');
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.dialog >>> .el-dialog__body {
|
||||||
|
padding: 30px 24px;
|
||||||
|
}
|
||||||
|
.dialog >>> .el-dialog__header {
|
||||||
|
font-size: 16px;
|
||||||
|
color: rgba(0, 0, 0, 0.85);
|
||||||
|
font-weight: 500;
|
||||||
|
padding: 13px 24px;
|
||||||
|
border-bottom: 1px solid #e9e9e9;
|
||||||
|
}
|
||||||
|
.dialog >>> .el-dialog__header .titleStyle::before {
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
width: 4px;
|
||||||
|
height: 16px;
|
||||||
|
background-color: #0b58ff;
|
||||||
|
border-radius: 1px;
|
||||||
|
margin-right: 8px;
|
||||||
|
position: relative;
|
||||||
|
top: 2px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -17,7 +17,7 @@
|
|||||||
v-if="tableBtn.length"
|
v-if="tableBtn.length"
|
||||||
slot="handleBtn"
|
slot="handleBtn"
|
||||||
label="操作"
|
label="操作"
|
||||||
:width="120"
|
:width="250"
|
||||||
:method-list="tableBtn"
|
:method-list="tableBtn"
|
||||||
@clickBtn="handleTableBtnClick" />
|
@clickBtn="handleTableBtnClick" />
|
||||||
</base-table>
|
</base-table>
|
||||||
@ -46,6 +46,10 @@
|
|||||||
:has-files="false"
|
:has-files="false"
|
||||||
:rows="rows" />
|
:rows="rows" />
|
||||||
</base-dialog>
|
</base-dialog>
|
||||||
|
<addSparts
|
||||||
|
v-if="addOrUpdateVisible"
|
||||||
|
ref="addOrUpdate"
|
||||||
|
@refreshDataList="getList" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -53,15 +57,18 @@
|
|||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||||
import { publicFormatter } from '@/utils/dict';
|
import { publicFormatter } from '@/utils/dict';
|
||||||
|
import Editor from '@/components/Editor';
|
||||||
|
import addSparts from './addSparts.vue';
|
||||||
|
|
||||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'EquipmentSparePartsConfig',
|
name: 'EquipmentSparePartsConfig',
|
||||||
components: {},
|
components: { addSparts },
|
||||||
mixins: [basicPageMixin],
|
mixins: [basicPageMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
addOrUpdateVisible: false,
|
||||||
searchBarKeys: ['name', 'equipmentId', 'equipmentIdList'],
|
searchBarKeys: ['name', 'equipmentId', 'equipmentIdList'],
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
// this.$auth.hasPermi('equipment:spare-parts-config:update')
|
// this.$auth.hasPermi('equipment:spare-parts-config:update')
|
||||||
@ -76,6 +83,18 @@ export default {
|
|||||||
btnName: '修改',
|
btnName: '修改',
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
|
this.$auth.hasPermi('equipment:spare-parts-config:queryParts')
|
||||||
|
? {
|
||||||
|
type: 'queryParts',
|
||||||
|
btnName: '查看备件',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
this.$auth.hasPermi('equipment:spare-parts-config:addParts')
|
||||||
|
? {
|
||||||
|
type: 'addParts',
|
||||||
|
btnName: '添加备件',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
this.$auth.hasPermi('equipment:spare-parts-config:delete')
|
this.$auth.hasPermi('equipment:spare-parts-config:delete')
|
||||||
? {
|
? {
|
||||||
type: 'delete',
|
type: 'delete',
|
||||||
@ -162,18 +181,23 @@ export default {
|
|||||||
select: true, // TODO: or INPUT instead of SELECT
|
select: true, // TODO: or INPUT instead of SELECT
|
||||||
label: '负责人',
|
label: '负责人',
|
||||||
prop: 'responsible',
|
prop: 'responsible',
|
||||||
url: '/base/core-equipment/listAll', // TODO: 班组
|
url: '/base/core-worker/listAll', // TODO: 班组
|
||||||
|
valueKey: 'name',
|
||||||
bind: {
|
bind: {
|
||||||
filterable: true,
|
filterable: true,
|
||||||
clearable: true,
|
clearable: true,
|
||||||
|
multiple: true
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
input: true,
|
|
||||||
label: '描述',
|
label: '描述',
|
||||||
prop: 'description', // TODO: 富文本
|
prop: 'description', // TODO: 富文本
|
||||||
|
subcomponent: Editor,
|
||||||
|
bind: {
|
||||||
|
'min-height': 192
|
||||||
|
}
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -258,6 +282,7 @@ export default {
|
|||||||
const id = row.id;
|
const id = row.id;
|
||||||
this.info({ id }).then((response) => {
|
this.info({ id }).then((response) => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
|
this.form.responsible = this.form.responsible.split(',')
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = '修改备品备件配置';
|
this.title = '修改备品备件配置';
|
||||||
});
|
});
|
||||||
@ -268,6 +293,7 @@ export default {
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.form.responsible = this.form.responsible.join(',')
|
||||||
// 修改的提交
|
// 修改的提交
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
this.put(this.form).then((response) => {
|
this.put(this.form).then((response) => {
|
||||||
@ -300,12 +326,15 @@ export default {
|
|||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
handleDetail({ id }) {
|
handleDetail({ id }) {
|
||||||
this.reset();
|
this.addOrUpdateVisible = true
|
||||||
this.mode = 'detail';
|
this.$nextTick(() => {
|
||||||
this.info({ id }).then((response) => {
|
this.$refs.addOrUpdate.init(id, true);
|
||||||
this.form = response.data;
|
});
|
||||||
this.open = true;
|
},
|
||||||
this.title = '修改备品备件配置';
|
handlAddParts({ id }) {
|
||||||
|
this.addOrUpdateVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init(id);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
@ -326,6 +355,23 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
|
// 处理表格按钮
|
||||||
|
handleTableBtnClick({ data, type }) {
|
||||||
|
switch (type) {
|
||||||
|
case 'edit':
|
||||||
|
this.handleUpdate(data);
|
||||||
|
break;
|
||||||
|
case 'delete':
|
||||||
|
this.handleDelete(data);
|
||||||
|
break;
|
||||||
|
case 'queryParts':
|
||||||
|
this.handleDetail(data);
|
||||||
|
break;
|
||||||
|
case 'addParts':
|
||||||
|
this.handlAddParts(data);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -148,7 +148,7 @@ export default {
|
|||||||
select: true,
|
select: true,
|
||||||
label: '供应商',
|
label: '供应商',
|
||||||
prop: 'supplierId',
|
prop: 'supplierId',
|
||||||
url: '/base/core-supplier/listAll', // TODO: 课上关系
|
url: '/base/core-supplier/listAll', // TODO: 供应商
|
||||||
bind: {
|
bind: {
|
||||||
filterable: true,
|
filterable: true,
|
||||||
clearable: true,
|
clearable: true,
|
||||||
@ -161,12 +161,13 @@ export default {
|
|||||||
select: true,
|
select: true,
|
||||||
label: '物料类型',
|
label: '物料类型',
|
||||||
prop: 'type',
|
prop: 'type',
|
||||||
url: '/base/core-equipment/listAll', // TODO: 物料
|
options: this.getDictDatas('material_type'),
|
||||||
|
// url: '/base/core-equipment/listAll', // TODO: 物料
|
||||||
bind: {
|
bind: {
|
||||||
filterable: true,
|
filterable: true,
|
||||||
clearable: true,
|
clearable: true,
|
||||||
},
|
},
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
rules: [{ required: true, message: '物料类型不能为空', trigger: 'blur' }],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: true,
|
input: true,
|
||||||
|
431
src/views/equipment/base/spareParts/Monitor/addSparts.vue
Normal file
431
src/views/equipment/base/spareParts/Monitor/addSparts.vue
Normal file
@ -0,0 +1,431 @@
|
|||||||
|
<!--
|
||||||
|
filename: dialogForm.vue
|
||||||
|
author: liubin
|
||||||
|
date: 2023-10-31 15:55:13
|
||||||
|
description:
|
||||||
|
-->
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<el-drawer
|
||||||
|
:visible.sync="visible"
|
||||||
|
:show-close="false"
|
||||||
|
:wrapper-closable="false"
|
||||||
|
class="drawer"
|
||||||
|
size="60%">
|
||||||
|
<small-title slot="title" :no-padding="true">
|
||||||
|
{{ !isLog ? '操作页面' : '更换记录' }}
|
||||||
|
</small-title>
|
||||||
|
<el-form
|
||||||
|
ref="form"
|
||||||
|
:model="dataForm"
|
||||||
|
label-width="100px"
|
||||||
|
v-loading="formLoading">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item v-if="!isLog" label="配置名" prop="name">
|
||||||
|
<span>{{ dataForm.name }}</span>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-else label="产线名称" prop="lineName">
|
||||||
|
<span>{{ dataForm.lineName }}</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="设备名称" prop="equipmentName">
|
||||||
|
<span>{{ dataForm.equipmentName }}</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-form-item label="描述" prop="faultTime">
|
||||||
|
<editor v-model="dataForm.description" read-only :min-height="200"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<div v-if="!isLog">
|
||||||
|
<base-table
|
||||||
|
:table-props="tableProps"
|
||||||
|
:page="listQuery.pageNo"
|
||||||
|
:limit="listQuery.pageSize"
|
||||||
|
:table-data="list">
|
||||||
|
<method-btn
|
||||||
|
v-if="!isLog"
|
||||||
|
slot="handleBtn"
|
||||||
|
:width="120"
|
||||||
|
label="操作"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleClick" />
|
||||||
|
</base-table>
|
||||||
|
<pagination
|
||||||
|
v-show="listQuery.total > 0"
|
||||||
|
:total="listQuery.total"
|
||||||
|
:page.sync="listQuery.pageNo"
|
||||||
|
:limit.sync="listQuery.pageSize"
|
||||||
|
:page-sizes="[5, 10, 15]"
|
||||||
|
@pagination="getList" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else>
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<SearchBar
|
||||||
|
:formConfigs="formConfig"
|
||||||
|
ref="search-bar"
|
||||||
|
@headBtnClick="buttonClick" />
|
||||||
|
<base-table
|
||||||
|
:table-props="tableProps1"
|
||||||
|
:page="listQuery1.pageNo"
|
||||||
|
:limit="listQuery1.pageSize"
|
||||||
|
:table-data="list1" />
|
||||||
|
<pagination
|
||||||
|
v-show="listQuery1.total > 0"
|
||||||
|
:total="listQuery1.total"
|
||||||
|
:page.sync="listQuery1.pageNo"
|
||||||
|
:limit.sync="listQuery1.pageSize"
|
||||||
|
:page-sizes="[5, 10, 15]"
|
||||||
|
@pagination="getList1" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="drawer-body__footer">
|
||||||
|
<el-button type="primary" @click="goback()">关闭</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<attr-add
|
||||||
|
v-if="addOrUpdateVisible"
|
||||||
|
ref="addOrUpdate"
|
||||||
|
:config-id="dataForm.id"
|
||||||
|
@refreshDataList="getList" />
|
||||||
|
</el-drawer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import SmallTitle from '../../../base/alarm/Record/SmallTitle.vue';
|
||||||
|
import { getSparePartConfig } from '@/api/equipment/base/spare-parts/config'
|
||||||
|
import { getConfigDetMonitorPage, getSparePartLogPage, exportSparePartLogExcel } from '@/api/equipment/base/spare-parts/monitor'
|
||||||
|
import Editor from "@/components/Editor";
|
||||||
|
// import FileUpload from "@/components/FileUpload";
|
||||||
|
import { parseTime } from '../../../../core/mixins/code-filter';
|
||||||
|
import attrAdd from './attr-add';
|
||||||
|
|
||||||
|
const tableBtn = [
|
||||||
|
{
|
||||||
|
type: 'change',
|
||||||
|
btnName: '更换',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const tableProps = [
|
||||||
|
{
|
||||||
|
prop: 'sparePartName',
|
||||||
|
label: '备品备件',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'life',
|
||||||
|
label: '使用寿命(h)',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'timeUsed',
|
||||||
|
label: '更换耗时(min)',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'replacementTime',
|
||||||
|
label: '更换时间',
|
||||||
|
filter: parseTime
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'nextReplacementTime',
|
||||||
|
label: '下次更换时间',
|
||||||
|
filter: parseTime
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'color',
|
||||||
|
label: '是否超期',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'responsible',
|
||||||
|
label: '操作人',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'description',
|
||||||
|
label: '备注'
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const tableProps1 = [
|
||||||
|
{
|
||||||
|
prop: 'sparePartName',
|
||||||
|
label: '备品备件',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'life',
|
||||||
|
label: '使用寿命(h)',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'timeUsed',
|
||||||
|
label: '更换耗时(min)',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'replacementTime',
|
||||||
|
label: '更换时间',
|
||||||
|
filter: parseTime
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'nextReplacementTime',
|
||||||
|
label: '下次更换时间',
|
||||||
|
filter: parseTime
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'responsible',
|
||||||
|
label: '操作人',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'description',
|
||||||
|
label: '备注'
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DialogForm',
|
||||||
|
model: {
|
||||||
|
prop: 'dataForm',
|
||||||
|
event: 'update',
|
||||||
|
},
|
||||||
|
emits: ['update'],
|
||||||
|
components: { SmallTitle, Editor, attrAdd },
|
||||||
|
props: {
|
||||||
|
// dataForm: {
|
||||||
|
// type: Object,
|
||||||
|
// default: () => ({}),
|
||||||
|
// },
|
||||||
|
// disabled: {
|
||||||
|
// type: Boolean,
|
||||||
|
// default: false
|
||||||
|
// },
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
tableBtn,
|
||||||
|
tableProps,
|
||||||
|
tableProps1,
|
||||||
|
addOrUpdateVisible: false,
|
||||||
|
formLoading: true,
|
||||||
|
visible: false,
|
||||||
|
isLog: false,
|
||||||
|
dataForm: {},
|
||||||
|
list: [],
|
||||||
|
list1: [],
|
||||||
|
listQuery: {
|
||||||
|
pageSize: 10,
|
||||||
|
pageNo: 1,
|
||||||
|
total: 0,
|
||||||
|
},
|
||||||
|
listQuery1: {
|
||||||
|
pageSize: 10,
|
||||||
|
pageNo: 1,
|
||||||
|
total: 0,
|
||||||
|
replacementTime: undefined
|
||||||
|
},
|
||||||
|
formConfig: [
|
||||||
|
{
|
||||||
|
type: 'datePicker',
|
||||||
|
label: '更换时间段',
|
||||||
|
dateType: 'daterange', // datetimerange
|
||||||
|
format: 'yyyy-MM-dd',
|
||||||
|
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||||
|
rangeSeparator: '-',
|
||||||
|
startPlaceholder: '开始日期',
|
||||||
|
endPlaceholder: '结束日期',
|
||||||
|
defaultTime: ['00:00:00', '23:59:59'],
|
||||||
|
param: 'replacementTime',
|
||||||
|
// width: 350,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '查询',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'separate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '导出',
|
||||||
|
name: 'export',
|
||||||
|
color: 'warning',
|
||||||
|
plain: true
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {},
|
||||||
|
methods: {
|
||||||
|
buttonClick(val) {
|
||||||
|
switch (val.btnName) {
|
||||||
|
case 'search':
|
||||||
|
this.listQuery1.pageNo = 1;
|
||||||
|
this.listQuery1.pageSize = 10;
|
||||||
|
this.listQuery1.replacementTime = val.replacementTime ? val.replacementTime : undefined;
|
||||||
|
this.getList1();
|
||||||
|
break;
|
||||||
|
case 'export':
|
||||||
|
this.handleExport();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.log(val);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
goback() {
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
this.visible = false;
|
||||||
|
},
|
||||||
|
/** 模拟透传 ref */
|
||||||
|
validate(cb) {
|
||||||
|
return this.$refs.form.validate(cb);
|
||||||
|
},
|
||||||
|
resetFields(args) {
|
||||||
|
return this.$refs.form.resetFields(args);
|
||||||
|
},
|
||||||
|
init(id, isLog) {
|
||||||
|
// this.initData();
|
||||||
|
this.isLog = isLog || false;
|
||||||
|
this.dataForm.id = id || undefined;
|
||||||
|
this.visible = true;
|
||||||
|
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['form'].resetFields();
|
||||||
|
|
||||||
|
if (this.dataForm.id) {
|
||||||
|
// 获取备品备件
|
||||||
|
getSparePartConfig(this.dataForm.id).then(response => {
|
||||||
|
this.formLoading = false
|
||||||
|
this.dataForm = response.data;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// if (this.urlOptions.isGetCode) {
|
||||||
|
// this.getCode()
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.getList()
|
||||||
|
this.formLoading = false
|
||||||
|
},
|
||||||
|
handleClick(raw) {
|
||||||
|
if (raw.type === 'change') {
|
||||||
|
// 更换
|
||||||
|
this.addNew();
|
||||||
|
} else {}
|
||||||
|
},
|
||||||
|
getList() {
|
||||||
|
// 获取备品备件详情分页
|
||||||
|
getConfigDetMonitorPage({
|
||||||
|
...this.listQuery,
|
||||||
|
configId: this.dataForm.id,
|
||||||
|
}).then((response) => {
|
||||||
|
this.list = response.data;
|
||||||
|
this.listQuery.total = response.data.total;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getList1() {
|
||||||
|
// 获取备品备件更换log分页
|
||||||
|
getSparePartLogPage({
|
||||||
|
...this.listQuery1,
|
||||||
|
configId: this.dataForm.id,
|
||||||
|
}).then((response) => {
|
||||||
|
this.list1 = response.data.list;
|
||||||
|
this.listQuery1.total = response.data.total;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 新增 / 修改
|
||||||
|
addNew(id) {
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init(id);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
// 处理查询参数
|
||||||
|
let params = { ...this.listQuery1 };
|
||||||
|
params.pageNo = undefined;
|
||||||
|
params.pageSize = undefined;
|
||||||
|
this.$modal
|
||||||
|
.confirm('是否确认导出所有设备备品备件更换log数据项?')
|
||||||
|
.then(() => {
|
||||||
|
this.exportLoading = true;
|
||||||
|
return exportSparePartLogExcel(params);
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
this.$download.excel(response, '设备备品备件更换log.xls');
|
||||||
|
this.exportLoading = false;
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.el-date-editor,
|
||||||
|
.el-select {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.drawer-body__footer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
padding: 18px;
|
||||||
|
}
|
||||||
|
.action_btn {
|
||||||
|
float: right;
|
||||||
|
margin: 5px 15px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
.add {
|
||||||
|
color: #0b58ff;
|
||||||
|
}
|
||||||
|
.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>
|
126
src/views/equipment/base/spareParts/Monitor/attr-add.vue
Normal file
126
src/views/equipment/base/spareParts/Monitor/attr-add.vue
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
:visible.sync="visible"
|
||||||
|
:width="'35%'"
|
||||||
|
:append-to-body="true"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
class="dialog">
|
||||||
|
<template #title>
|
||||||
|
<slot name="title">
|
||||||
|
<div class="titleStyle">
|
||||||
|
{{ !dataForm.id ? '新增' : '编辑' }}
|
||||||
|
</div>
|
||||||
|
</slot>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<el-form
|
||||||
|
ref="dataForm"
|
||||||
|
:model="dataForm"
|
||||||
|
:rules="dataRule"
|
||||||
|
label-width="100px"
|
||||||
|
@keyup.enter.native="dataFormSubmit()">
|
||||||
|
<el-form-item label="操作人" prop="responsible">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.responsible"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入操作人" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row style="text-align: right">
|
||||||
|
<el-button @click="visible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||||
|
</el-row>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { createSparePartLog } from '@/api/equipment/base/spare-parts/monitor';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
configId: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
visible: false,
|
||||||
|
dataForm: {
|
||||||
|
id: undefined,
|
||||||
|
responsible: ''
|
||||||
|
},
|
||||||
|
partList: [],
|
||||||
|
dataRule: {
|
||||||
|
responsible: [{ required: true, message: '操作人不能为空', trigger: 'blur' }]
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
// this.getDict()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// async getDict() {
|
||||||
|
// const res = await getSparePartList()
|
||||||
|
// this.partList = res.data
|
||||||
|
// },
|
||||||
|
init(id) {
|
||||||
|
this.dataForm.id = id || '';
|
||||||
|
this.visible = true;
|
||||||
|
},
|
||||||
|
// 表单提交
|
||||||
|
dataFormSubmit() {
|
||||||
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
// 修改的提交
|
||||||
|
// if (this.dataForm.id) {
|
||||||
|
// updateCoreProductAttr({
|
||||||
|
// ...this.dataForm,
|
||||||
|
// productId: this.productId,
|
||||||
|
// }).then((response) => {
|
||||||
|
// this.$modal.msgSuccess('修改成功');
|
||||||
|
// this.visible = false;
|
||||||
|
// this.$emit('refreshDataList');
|
||||||
|
// });
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// 添加的提交
|
||||||
|
createSparePartLog({
|
||||||
|
...this.dataForm,
|
||||||
|
configId: this.configId,
|
||||||
|
}).then((response) => {
|
||||||
|
this.$modal.msgSuccess('新增成功');
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.dialog >>> .el-dialog__body {
|
||||||
|
padding: 30px 24px;
|
||||||
|
}
|
||||||
|
.dialog >>> .el-dialog__header {
|
||||||
|
font-size: 16px;
|
||||||
|
color: rgba(0, 0, 0, 0.85);
|
||||||
|
font-weight: 500;
|
||||||
|
padding: 13px 24px;
|
||||||
|
border-bottom: 1px solid #e9e9e9;
|
||||||
|
}
|
||||||
|
.dialog >>> .el-dialog__header .titleStyle::before {
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
width: 4px;
|
||||||
|
height: 16px;
|
||||||
|
background-color: #0b58ff;
|
||||||
|
border-radius: 1px;
|
||||||
|
margin-right: 8px;
|
||||||
|
position: relative;
|
||||||
|
top: 2px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -31,7 +31,7 @@
|
|||||||
@pagination="getList" />
|
@pagination="getList" />
|
||||||
|
|
||||||
<!-- 对话框(添加 / 修改) -->
|
<!-- 对话框(添加 / 修改) -->
|
||||||
<base-dialog
|
<!-- <base-dialog
|
||||||
:dialogTitle="title"
|
:dialogTitle="title"
|
||||||
:dialogVisible="open"
|
:dialogVisible="open"
|
||||||
width="35%"
|
width="35%"
|
||||||
@ -45,13 +45,20 @@
|
|||||||
:disabled="mode == 'detail'"
|
:disabled="mode == 'detail'"
|
||||||
:has-files="false"
|
:has-files="false"
|
||||||
:rows="rows" />
|
:rows="rows" />
|
||||||
</base-dialog>
|
</base-dialog> -->
|
||||||
|
|
||||||
|
<addSparts
|
||||||
|
v-if="addOrUpdateVisible"
|
||||||
|
ref="addOrUpdate"
|
||||||
|
@refreshDataList="getList" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||||
|
import { getCorePLList } from '@/api/base/coreProductionLine';
|
||||||
|
import addSparts from './addSparts.vue';
|
||||||
// import { publicFormatter } from '@/utils/dict';
|
// import { publicFormatter } from '@/utils/dict';
|
||||||
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||||
|
|
||||||
@ -65,12 +72,18 @@ const remainBox = {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
value() {
|
value() {
|
||||||
|
const temp = this.injectData[this.injectData.prop] || null
|
||||||
|
if (temp) {
|
||||||
|
console.log('12', temp)
|
||||||
|
return temp === 'Green' ? 'green' : 'red'
|
||||||
|
}
|
||||||
return this.injectData[this.injectData.prop] || null;
|
return this.injectData[this.injectData.prop] || null;
|
||||||
},
|
},
|
||||||
color() {
|
color() {
|
||||||
if (this.value) {
|
if (this.value) {
|
||||||
const v = +this.value;
|
// const v = +this.value;
|
||||||
return v < 0 ? 'red' : v >= 0 && v < 2 ? 'yellow' : 'green';
|
// return v < 0 ? 'red' : v >= 0 && v < 2 ? 'yellow' : 'green';
|
||||||
|
return this.value
|
||||||
}
|
}
|
||||||
return 'unset';
|
return 'unset';
|
||||||
},
|
},
|
||||||
@ -80,8 +93,10 @@ const remainBox = {
|
|||||||
<div
|
<div
|
||||||
style={`background: ${
|
style={`background: ${
|
||||||
this.color
|
this.color
|
||||||
|
// this.color == 'Green' ? 'green' : this.color == 'Red' ? 'red' : 'yellow'
|
||||||
}; position:absolute; inset: 0; padding: 0 10px; display: flex; align-items: center; color: ${
|
}; position:absolute; inset: 0; padding: 0 10px; display: flex; align-items: center; color: ${
|
||||||
this.color == 'red' ? '#fff' : 'unset'
|
'unset'
|
||||||
|
// this.color == 'red' ? '#fff' : 'unset'
|
||||||
}`}>
|
}`}>
|
||||||
{this.injectData[this.injectData.prop] || ''}
|
{this.injectData[this.injectData.prop] || ''}
|
||||||
</div>
|
</div>
|
||||||
@ -97,13 +112,13 @@ const btn = {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleClick() {
|
handleClick() {
|
||||||
this.$emit('emitData', { action: this.injectData.label, value: null });
|
this.$emit('emitData', { action: this.injectData.name, value: this.injectData });
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
render: function (h) {
|
render: function (h) {
|
||||||
return (
|
return (
|
||||||
<el-button type="text" onClick={this.handleClick}>
|
<el-button type="text" onClick={this.handleClick}>
|
||||||
{this.injectData.label}
|
{this.injectData.name}
|
||||||
</el-button>
|
</el-button>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -113,11 +128,12 @@ const btn = {
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'EquipmentSparePartsMonitor',
|
name: 'EquipmentSparePartsMonitor',
|
||||||
components: {},
|
components: { addSparts },
|
||||||
mixins: [basicPageMixin],
|
mixins: [basicPageMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
searchBarKeys: ['name', 'equipmentId', 'equipmentIdList'],
|
addOrUpdateVisible: false,
|
||||||
|
searchBarKeys: ['lineId', 'equipmentId'],
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
// this.$auth.hasPermi('equipment:spare-parts-config:update')
|
// this.$auth.hasPermi('equipment:spare-parts-config:update')
|
||||||
// ? {
|
// ? {
|
||||||
@ -125,36 +141,36 @@ export default {
|
|||||||
// btnName: '详情',
|
// btnName: '详情',
|
||||||
// }
|
// }
|
||||||
// : undefined,
|
// : undefined,
|
||||||
this.$auth.hasPermi('equipment:spare-parts-config:update')
|
// this.$auth.hasPermi('equipment:spare-parts-config:update')
|
||||||
? {
|
// ? {
|
||||||
type: 'edit',
|
// type: 'edit',
|
||||||
btnName: '修改',
|
// btnName: '修改',
|
||||||
}
|
// }
|
||||||
: undefined,
|
// : undefined,
|
||||||
this.$auth.hasPermi('equipment:spare-parts-config:delete')
|
// this.$auth.hasPermi('equipment:spare-parts-config:delete')
|
||||||
? {
|
// ? {
|
||||||
type: 'delete',
|
// type: 'delete',
|
||||||
btnName: '删除',
|
// btnName: '删除',
|
||||||
}
|
// }
|
||||||
: undefined,
|
// : undefined,
|
||||||
].filter((v) => v),
|
].filter((v) => v),
|
||||||
tableProps: [
|
tableProps: [
|
||||||
{ prop: 'name', label: '配置名' },
|
{ prop: 'name', label: '配置名' },
|
||||||
{ prop: 'lineName', label: '产线' },
|
{ prop: 'lineName', label: '产线名称' },
|
||||||
{ prop: 'sectionName', label: '工段' },
|
{ prop: 'sectionName', label: '工段名' },
|
||||||
{ prop: 'equipmentName', label: '设备' },
|
{ prop: 'equipmentName', label: '设备名称' },
|
||||||
{ prop: 'responsible', label: '负责人' },
|
{ prop: 'responsible', label: '负责人' },
|
||||||
{ prop: 'equipmentCode', label: '是否超期', subcomonent: remainBox },
|
{ prop: 'color', label: '是否超期', subcomponent: remainBox },
|
||||||
{ prop: 'opt1', label: '备件更换' },
|
{ prop: 'opt1', label: '备件更换', name: '操作', subcomponent: btn },
|
||||||
{ prop: 'opt2', label: '更新记录' }, // TODO: 是否换成按钮, 群里问
|
{ prop: 'opt2', label: '更换记录', name: '更新记录', subcomponent: btn }, // TODO: 是否换成按钮, 群里问
|
||||||
// { prop: 'remark', label: '备注' },
|
// { prop: 'remark', label: '备注' },
|
||||||
],
|
],
|
||||||
searchBarFormConfig: [
|
searchBarFormConfig: [
|
||||||
{
|
{
|
||||||
type: 'input',
|
type: 'select',
|
||||||
label: '产线',
|
label: '产线',
|
||||||
placeholder: '请选择产线',
|
placeholder: '请选择产线',
|
||||||
param: 'name',
|
param: 'lineId',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'select',
|
type: 'select',
|
||||||
@ -237,7 +253,7 @@ export default {
|
|||||||
queryParams: {
|
queryParams: {
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
name: null,
|
lineId: null,
|
||||||
equipmentId: null,
|
equipmentId: null,
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
@ -251,7 +267,43 @@ export default {
|
|||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleEmitFun(val) {
|
||||||
|
console.log('emit unf', val);
|
||||||
|
switch (val.action) {
|
||||||
|
// 操作
|
||||||
|
case '操作':
|
||||||
|
this.eqOperation(val.value); // 交由每个组件自己实现
|
||||||
|
break;
|
||||||
|
// 更新记录
|
||||||
|
case '更新记录':
|
||||||
|
this.updateLog(val.value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
eqOperation({ id }) {
|
||||||
|
this.addOrUpdateVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init(id);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
updateLog({ id }) {
|
||||||
|
this.addOrUpdateVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init(id, true);
|
||||||
|
});
|
||||||
|
},
|
||||||
initSearchBar() {
|
initSearchBar() {
|
||||||
|
// 产线列表
|
||||||
|
getCorePLList().then(res => {
|
||||||
|
this.$set(
|
||||||
|
this.searchBarFormConfig[0],
|
||||||
|
'selectOptions',
|
||||||
|
res.data.map((item) => ({
|
||||||
|
name: item.name,
|
||||||
|
id: item.id
|
||||||
|
}))
|
||||||
|
);
|
||||||
|
})
|
||||||
this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
|
this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
|
||||||
this.$set(
|
this.$set(
|
||||||
this.searchBarFormConfig[1],
|
this.searchBarFormConfig[1],
|
||||||
@ -267,7 +319,7 @@ export default {
|
|||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
// 执行查询
|
// 执行查询
|
||||||
this.recv(this.queryParams).then((response) => {
|
this.http('/base/equipment-spare-part-config/monitor', 'get', this.queryParams).then((response) => {
|
||||||
this.list = response.data.list;
|
this.list = response.data.list;
|
||||||
this.total = response.data.total;
|
this.total = response.data.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
338
src/views/equipment/monitor/StatusAndParams/index.vue
Normal file
338
src/views/equipment/monitor/StatusAndParams/index.vue
Normal file
@ -0,0 +1,338 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<SearchBar
|
||||||
|
:formConfigs="searchBarFormConfig"
|
||||||
|
ref="search-bar"
|
||||||
|
@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"
|
||||||
|
label="操作"
|
||||||
|
:width="120"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleTableBtnClick" />
|
||||||
|
</base-table>
|
||||||
|
|
||||||
|
<!-- 分页组件 -->
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNo"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList" />
|
||||||
|
|
||||||
|
<!-- 对话框(添加 / 修改) -->
|
||||||
|
<base-dialog
|
||||||
|
:dialogTitle="title"
|
||||||
|
:dialogVisible="open"
|
||||||
|
width="60%"
|
||||||
|
@close="cancel"
|
||||||
|
@cancel="cancel"
|
||||||
|
@confirm="submitForm">
|
||||||
|
<!-- <DialogForm
|
||||||
|
v-if="open"
|
||||||
|
ref="form"
|
||||||
|
v-model="form"
|
||||||
|
:disabled="mode == 'detail'"
|
||||||
|
:has-files="false"
|
||||||
|
:rows="rows" /> -->
|
||||||
|
</base-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import moment from 'moment';
|
||||||
|
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||||
|
import { publicFormatter } from '@/utils/dict';
|
||||||
|
import { parseTime } from '@/utils/ruoyi'
|
||||||
|
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||||
|
|
||||||
|
|
||||||
|
const btn = {
|
||||||
|
name: 'tableBtn',
|
||||||
|
props: ['injectData'],
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleClick() {
|
||||||
|
this.$emit('emitData', { action: this.injectData.label, value: this.injectData });
|
||||||
|
},
|
||||||
|
},
|
||||||
|
render: function (h) {
|
||||||
|
return (
|
||||||
|
<el-button type="text" onClick={this.handleClick}>
|
||||||
|
{this.injectData.name}
|
||||||
|
</el-button>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'StatusAndParams',
|
||||||
|
mixins: [basicPageMixin],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
searchBarKeys: ['equipmentName', 'recordTime'],
|
||||||
|
tableBtn: [
|
||||||
|
// this.$auth.hasPermi('equipment:spare-parts-config:update')
|
||||||
|
// ? {
|
||||||
|
// type: 'detail',
|
||||||
|
// btnName: '详情',
|
||||||
|
// }
|
||||||
|
// : undefined,
|
||||||
|
// this.$auth.hasPermi('equipment:spare-parts-config:update')
|
||||||
|
// ? {
|
||||||
|
// type: 'edit',
|
||||||
|
// btnName: '修改',
|
||||||
|
// }
|
||||||
|
// : undefined,
|
||||||
|
// this.$auth.hasPermi('equipment:spare-parts-config:delete')
|
||||||
|
// ? {
|
||||||
|
// type: 'delete',
|
||||||
|
// btnName: '删除',
|
||||||
|
// }
|
||||||
|
// : undefined,
|
||||||
|
].filter((v) => v),
|
||||||
|
tableProps: [
|
||||||
|
{ prop: 'productionLine', label: '设备名称' },
|
||||||
|
{ prop: 'workshopSection', label: '设备编码' },
|
||||||
|
{ prop: 'equipment', label: '投入数' },
|
||||||
|
{ prop: 'productionLine', label: '产出数' },
|
||||||
|
{ prop: 'workshopSection', label: '是否运行' },
|
||||||
|
{ prop: 'equipment22', label: '状态' },
|
||||||
|
// { prop: 'alarmGrade', label: '报警级别', filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL) },
|
||||||
|
{ prop: 'productionLine', label: '是否故障' },
|
||||||
|
{ prop: 'workshopSection', label: '生产量记录时间', filter: parseTime },
|
||||||
|
{ prop: 'equipment1', label: '状态记录时间', filter: parseTime },
|
||||||
|
{ prop: 'opt1', label: '状态可视化', name: '查看', subcomponent: btn },
|
||||||
|
{ prop: 'opt2', label: '参数监控', name: '查看', subcomponent: btn } // TODO: 是否换成按钮, 群里问
|
||||||
|
// { prop: 'remark', label: '备注' },
|
||||||
|
],
|
||||||
|
searchBarFormConfig: [
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: '设备名',
|
||||||
|
placeholder: '请输入设备名称',
|
||||||
|
param: 'equipmentName',
|
||||||
|
},
|
||||||
|
// 时间段
|
||||||
|
{
|
||||||
|
type: 'datePicker',
|
||||||
|
label: '时间段',
|
||||||
|
dateType: 'daterange', // datetimerange
|
||||||
|
// format: 'yyyy-MM-dd HH:mm:ss',
|
||||||
|
format: 'yyyy-MM-dd',
|
||||||
|
// valueFormat: 'timestamp',
|
||||||
|
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||||
|
rangeSeparator: '-',
|
||||||
|
startPlaceholder: '开始日期',
|
||||||
|
endPlaceholder: '结束日期',
|
||||||
|
defaultTime: ['00:00:00', '23:59:59'],
|
||||||
|
param: 'recordTime',
|
||||||
|
// defaultSelect: [
|
||||||
|
// new Date(y, m, d)
|
||||||
|
// .toLocaleString()
|
||||||
|
// .split('/')
|
||||||
|
// .map((item, index) => {
|
||||||
|
// if (index == 1 || index == 2) return item.padStart(2, '0');
|
||||||
|
// return item;
|
||||||
|
// })
|
||||||
|
// .join('-'),
|
||||||
|
// new Date(y, m, d, 23, 59, 59)
|
||||||
|
// .toLocaleString()
|
||||||
|
// .split('/')
|
||||||
|
// .map((item, index) => {
|
||||||
|
// if (index == 1 || index == 2) return item.padStart(2, '0');
|
||||||
|
// return item;
|
||||||
|
// })
|
||||||
|
// .join('-'),
|
||||||
|
// ],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '查询',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// type: 'separate',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// type: this.$auth.hasPermi('equipment:spare-parts-config:create')
|
||||||
|
// ? 'button'
|
||||||
|
// : '',
|
||||||
|
// btnName: '新增',
|
||||||
|
// name: 'add',
|
||||||
|
// plain: true,
|
||||||
|
// color: 'success',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// type: this.$auth.hasPermi('equipment:spare-parts-config:export')
|
||||||
|
// ? 'button'
|
||||||
|
// : '',
|
||||||
|
// btnName: '导出',
|
||||||
|
// name: 'export',
|
||||||
|
// color: 'warning',
|
||||||
|
// },
|
||||||
|
],
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
lineId: null,
|
||||||
|
equipmentId: null,
|
||||||
|
},
|
||||||
|
basePath: '/base/equipment-alarm-log',
|
||||||
|
list: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
// this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleEmitFun(val) {
|
||||||
|
console.log('你好', val)
|
||||||
|
if (val.action === '状态可视化') {
|
||||||
|
// 状态可视化
|
||||||
|
} else {
|
||||||
|
// 参数监控
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 查询列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
// 执行查询
|
||||||
|
this.recv(this.queryParams).then((response) => {
|
||||||
|
this.list = response.data.list;
|
||||||
|
this.total = response.data.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
successSubmit() {
|
||||||
|
this.cancel()
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
/** 取消按钮 */
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
// this.mode = null;
|
||||||
|
// this.reset();
|
||||||
|
},
|
||||||
|
/** 表单重置 */
|
||||||
|
// reset() {
|
||||||
|
// this.form = {
|
||||||
|
// id: null,
|
||||||
|
// name: null,
|
||||||
|
// equipmentId: null,
|
||||||
|
// description: null,
|
||||||
|
// responsible: null
|
||||||
|
// };
|
||||||
|
// this.resetForm('form');
|
||||||
|
// },
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNo = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm('queryForm');
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = '添加备品备件配置';
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const id = row.id;
|
||||||
|
this.info({ id }).then((response) => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = '修改备品备件配置';
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs.addOrUpdate.dataFormSubmit()
|
||||||
|
// this.$refs['form'].validate((valid) => {
|
||||||
|
// if (!valid) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// // 修改的提交
|
||||||
|
// if (this.form.id != null) {
|
||||||
|
// this.put(this.form).then((response) => {
|
||||||
|
// this.$modal.msgSuccess('修改成功');
|
||||||
|
// this.open = false;
|
||||||
|
// this.getList();
|
||||||
|
// });
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// // 添加的提交
|
||||||
|
// this.post(this.form).then((response) => {
|
||||||
|
// this.$modal.msgSuccess('新增成功');
|
||||||
|
// this.open = false;
|
||||||
|
// this.getList();
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const id = row.id;
|
||||||
|
this.$modal
|
||||||
|
.confirm('是否确认删除记录"' + row.name + '"?')
|
||||||
|
.then(function () {
|
||||||
|
return this.delete({ id });
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess('删除成功');
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
handleDetail({ id }) {
|
||||||
|
this.reset();
|
||||||
|
this.mode = 'detail';
|
||||||
|
this.info({ id }).then((response) => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = '修改备品备件配置';
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
// 处理查询参数
|
||||||
|
let params = { ...this.queryParams };
|
||||||
|
params.pageNo = undefined;
|
||||||
|
params.pageSize = undefined;
|
||||||
|
this.$modal
|
||||||
|
.confirm('是否确认导出所有备品备件配置?')
|
||||||
|
.then(() => {
|
||||||
|
this.exportLoading = true;
|
||||||
|
return exportEquipmentTypeExcel(params);
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
this.$download.excel(response, '备品备件配置.xls');
|
||||||
|
this.exportLoading = false;
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
@ -432,7 +432,7 @@ export default {
|
|||||||
/** 准备产线数据 */
|
/** 准备产线数据 */
|
||||||
async initProductline() {
|
async initProductline() {
|
||||||
const { code, data } = await this.$axios({
|
const { code, data } = await this.$axios({
|
||||||
url: '/base/production-line/listAll',
|
url: '/base/core-production-line/listAll',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
});
|
});
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
@ -448,7 +448,7 @@ export default {
|
|||||||
/** 准备工段数据 */
|
/** 准备工段数据 */
|
||||||
async initWorksection() {
|
async initWorksection() {
|
||||||
const { code, data } = await this.$axios({
|
const { code, data } = await this.$axios({
|
||||||
url: '/base/workshop-section/listAll',
|
url: '/base/core-workshop-section/listAll',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
});
|
});
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
@ -464,7 +464,7 @@ export default {
|
|||||||
/** 根据产线获取工段 */
|
/** 根据产线获取工段 */
|
||||||
async getWorksectionById(lineId) {
|
async getWorksectionById(lineId) {
|
||||||
const { code, data } = await this.$axios({
|
const { code, data } = await this.$axios({
|
||||||
url: '/base/workshop-section/listByParentId',
|
url: '/base/core-workshop-section/listByParentId',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: {
|
params: {
|
||||||
id: lineId,
|
id: lineId,
|
||||||
|
@ -239,7 +239,7 @@ export default {
|
|||||||
/** 准备产线数据 */
|
/** 准备产线数据 */
|
||||||
async initProductline() {
|
async initProductline() {
|
||||||
const { code, data } = await this.$axios({
|
const { code, data } = await this.$axios({
|
||||||
url: '/base/production-line/listAll',
|
url: '/base/core-production-line/listAll',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
});
|
});
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
@ -255,7 +255,7 @@ export default {
|
|||||||
/** 准备工段数据 */
|
/** 准备工段数据 */
|
||||||
async initWorksection() {
|
async initWorksection() {
|
||||||
const { code, data } = await this.$axios({
|
const { code, data } = await this.$axios({
|
||||||
url: '/base/workshop-section/listAll',
|
url: '/base/core-workshop-section/listAll',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
});
|
});
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
@ -276,7 +276,7 @@ export default {
|
|||||||
switch (param) {
|
switch (param) {
|
||||||
case 'lineId':
|
case 'lineId':
|
||||||
this.$axios({
|
this.$axios({
|
||||||
url: '/base/workshop-section/listByParentId',
|
url: '/base/core-workshop-section/listByParentId',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: {
|
params: {
|
||||||
id: value,
|
id: value,
|
||||||
|
65
src/views/extend/processEquMaterialBom/SmallTitle.vue
Normal file
65
src/views/extend/processEquMaterialBom/SmallTitle.vue
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zhp
|
||||||
|
* @Date: 2023-11-07 19:28:13
|
||||||
|
* @LastEditTime: 2023-11-08 14:11:43
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @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: 18px;
|
||||||
|
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>
|
379
src/views/extend/processEquMaterialBom/add-or-updata.vue
Normal file
379
src/views/extend/processEquMaterialBom/add-or-updata.vue
Normal file
@ -0,0 +1,379 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2021-11-18 14:16:25
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @LastEditTime: 2023-11-10 16:26:08
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="false" class="drawer" size="50%">
|
||||||
|
<small-title slot="title" :no-padding="true">
|
||||||
|
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
|
||||||
|
</small-title>
|
||||||
|
<div class="content">
|
||||||
|
<div class="visual-part">
|
||||||
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
|
||||||
|
label-width="100px" label-position="top">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="设备名称" prop="equipmentId">
|
||||||
|
<el-select v-model="dataForm.equipmentId" filterable :disabled="isdetail" style="width: 100%"
|
||||||
|
@change="getCode" placeholder="请选择设备名称">
|
||||||
|
<el-option v-for="dict in equipmentList" :key=" dict.id" :label="dict.name" :value="dict.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="设备编码" prop="equipmentCode">
|
||||||
|
<el-input v-model="dataForm.equipmentCode" clearable :disabled="isdetail" placeholder="请输入设备编码" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="设备Bom编码" prop="code">
|
||||||
|
<el-input v-model="dataForm.code" clearable :disabled="isdetail" placeholder="请输入设备Bom编码" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="设备物料BOM名称" prop="name">
|
||||||
|
<el-input v-model="dataForm.name" clearable :disabled="isdetail" placeholder="请输入设备物料BOM名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="当前状态" prop="enabled">
|
||||||
|
<el-switch v-model="dataForm.enabled" :active-value="1" :inactive-value="0" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<div class="drawer-body__footer">
|
||||||
|
<el-button style="" @click="goback()">取消</el-button>
|
||||||
|
<el-button v-if="isdetail" type="primary" @click="goEdit()">
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="attr-list" v-if="idAttrShow">
|
||||||
|
<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
|
||||||
|
设备物料明细
|
||||||
|
</small-title>
|
||||||
|
|
||||||
|
<div v-if="!isdetail" class="action_btn">
|
||||||
|
<template>
|
||||||
|
<span style="display: inline-block;">
|
||||||
|
<el-button type="text" @click="addNew()" icon="el-icon-plus">新增</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
|
||||||
|
:table-data="productAttrList">
|
||||||
|
<method-btn v-if="!isdetail" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
|
||||||
|
@clickBtn="handleClick" />
|
||||||
|
</base-table>
|
||||||
|
<pagination v-show="listQuery.total > 0" :total="listQuery.total" :page.sync="listQuery.pageNo"
|
||||||
|
:limit.sync="listQuery.pageSize" :page-sizes="[5, 10, 15]" @pagination="getList" />
|
||||||
|
|
||||||
|
<div class="drawer-body__footer">
|
||||||
|
<el-button type="primary" @click="goback()">关闭</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<attr-add v-if="addOrUpdateVisible" ref="addOrUpdate" :product-id="dataForm.id" @refreshDataList="getList" />
|
||||||
|
</el-drawer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import basicAdd from '../../core/mixins/basic-add';
|
||||||
|
import {
|
||||||
|
getProcessEquMaterialBom,
|
||||||
|
createProcessEquMaterialBom,
|
||||||
|
updateProcessEquMaterialBom,
|
||||||
|
getEquipmentList,
|
||||||
|
processEquMaterialBomDetPage,
|
||||||
|
deleteProcessEquMaterialBomDet
|
||||||
|
} from '@/api/extend/processEquMaterialBom';
|
||||||
|
import SmallTitle from './SmallTitle';
|
||||||
|
import { parseTime } from '../../core/mixins/code-filter';
|
||||||
|
import attrAdd from './attr-add';
|
||||||
|
// import {DICT_TYPE, getDictDatas} from "@/utils/dict";
|
||||||
|
import { publicFormatter } from '@/utils/dict';
|
||||||
|
const tableBtn = [
|
||||||
|
{
|
||||||
|
type: 'edit',
|
||||||
|
btnName: '编辑',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'delete',
|
||||||
|
btnName: '删除',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const tableProps = [
|
||||||
|
{
|
||||||
|
prop: 'materialName',
|
||||||
|
label: '物料名称',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'materialCode',
|
||||||
|
label: '物料编码',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'unit',
|
||||||
|
label: '单位',
|
||||||
|
filter: publicFormatter('unit_dict')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'num',
|
||||||
|
label: '数量',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '备注',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const topBtnConfig = [
|
||||||
|
{
|
||||||
|
type: 'add',
|
||||||
|
btnName: 'btn.add'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [basicAdd],
|
||||||
|
components: { SmallTitle, attrAdd },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
tableBtn,
|
||||||
|
tableProps,
|
||||||
|
topBtnConfig,
|
||||||
|
addOrUpdateVisible: false,
|
||||||
|
urlOptions: {
|
||||||
|
isGetCode: false,
|
||||||
|
// codeURL: getCode,
|
||||||
|
createURL:createProcessEquMaterialBom,
|
||||||
|
updateURL: updateProcessEquMaterialBom,
|
||||||
|
infoURL: getProcessEquMaterialBom,
|
||||||
|
},
|
||||||
|
listQuery: {
|
||||||
|
pageSize: 10,
|
||||||
|
pageNo: 1,
|
||||||
|
total: 0,
|
||||||
|
},
|
||||||
|
equipmentList:[],
|
||||||
|
dataForm: {
|
||||||
|
id: undefined,
|
||||||
|
code: undefined,
|
||||||
|
name: '',
|
||||||
|
equipmentId: undefined,
|
||||||
|
equipmentCode: undefined,
|
||||||
|
enabled:undefined,
|
||||||
|
// area: undefined,
|
||||||
|
// specifications: undefined,
|
||||||
|
// processTime: 0,
|
||||||
|
remark: undefined,
|
||||||
|
// unit: undefined
|
||||||
|
},
|
||||||
|
productAttrList: [],
|
||||||
|
visible: false,
|
||||||
|
isdetail: false,
|
||||||
|
idAttrShow: false,
|
||||||
|
dataRule: {
|
||||||
|
// code: [{ required: true, message: "设备物料编码不能为空", trigger: "blur" }],
|
||||||
|
name: [{ required: true, message: "设备物料名称不能为空", trigger: "blur" }],
|
||||||
|
equipmentId: [{ required: true, message: "设备名称不能为空", trigger: "change" }],
|
||||||
|
// : [{ required: true, message: "产品类型不能为空", trigger: "change" }],
|
||||||
|
// processTime: [{ required: true, message: "产线生产单位用时不能为空", trigger: "blur" }]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getDict()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getCode(val) {
|
||||||
|
this.equipmentList.forEach((ele) => {
|
||||||
|
if (val === ele.id) {
|
||||||
|
this.dataForm.equipmentCode = ele.code
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// clickTopBtn(val) {
|
||||||
|
// if (val === 'add') {
|
||||||
|
// this.addNew()
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
initData() {
|
||||||
|
this.productAttrList.splice(0);
|
||||||
|
this.listQuery.total = 0;
|
||||||
|
},
|
||||||
|
getDict() {
|
||||||
|
getEquipmentList().then((res) => {
|
||||||
|
|
||||||
|
// console.log(res);
|
||||||
|
// console.log(response);
|
||||||
|
this.equipmentList = res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleClick(raw) {
|
||||||
|
if (raw.type === 'delete') {
|
||||||
|
this.$confirm(
|
||||||
|
`确定对${
|
||||||
|
raw.data.materialName
|
||||||
|
? '[物料名称为' + raw.data.materialName + ']'
|
||||||
|
: '[序号为' + raw.data.materialName + ']'
|
||||||
|
}进行删除操作?`,
|
||||||
|
'提示',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
deleteProcessEquMaterialBomDet(raw.data.id).then(({ data }) => {
|
||||||
|
this.$message({
|
||||||
|
message: '操作成功',
|
||||||
|
type: 'success',
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
} else {
|
||||||
|
this.addNew(raw.data.id);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getList() {
|
||||||
|
// 获取产品属性列表
|
||||||
|
processEquMaterialBomDetPage({
|
||||||
|
...this.listQuery,
|
||||||
|
bomId: this.dataForm.id,
|
||||||
|
}).then((response) => {
|
||||||
|
this.productAttrList = response.data.list;
|
||||||
|
this.listQuery.total = response.data.total;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
init(id, isdetail) {
|
||||||
|
this.initData();
|
||||||
|
this.isdetail = isdetail || false;
|
||||||
|
this.dataForm.id = id || undefined;
|
||||||
|
this.visible = true;
|
||||||
|
if (id) {
|
||||||
|
this.idAttrShow = true
|
||||||
|
} else {
|
||||||
|
this.idAttrShow = false
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['dataForm'].resetFields();
|
||||||
|
|
||||||
|
if (this.dataForm.id) {
|
||||||
|
// 获取产品详情
|
||||||
|
this.urlOptions.infoURL({
|
||||||
|
bomId: id,
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize:10
|
||||||
|
}).then(response => {
|
||||||
|
this.dataForm = response.data
|
||||||
|
this.dataForm.unit = String(this.dataForm.unit)
|
||||||
|
this.dataForm.materialType = String(this.dataForm.materialType)
|
||||||
|
this.dataForm.productType = String(this.dataForm.productType)
|
||||||
|
});
|
||||||
|
// 获取产品属性列表
|
||||||
|
this.getList();
|
||||||
|
} else {
|
||||||
|
if (this.urlOptions.isGetCode) {
|
||||||
|
this.getCode()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
goback() {
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
this.visible = false;
|
||||||
|
// this.initData();
|
||||||
|
},
|
||||||
|
goEdit() {
|
||||||
|
this.isdetail = false;
|
||||||
|
},
|
||||||
|
// 新增 / 修改
|
||||||
|
addNew(id) {
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init(id,this.dataForm.id);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</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;
|
||||||
|
}
|
||||||
|
.action_btn {
|
||||||
|
float: right;
|
||||||
|
margin: 5px 15px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
.add {
|
||||||
|
color: #0b58ff;
|
||||||
|
}
|
||||||
|
</style>
|
149
src/views/extend/processEquMaterialBom/attr-add.vue
Normal file
149
src/views/extend/processEquMaterialBom/attr-add.vue
Normal file
@ -0,0 +1,149 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zhp
|
||||||
|
* @Date: 2023-11-08 15:30:27
|
||||||
|
* @LastEditTime: 2023-11-09 14:11:02
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-dialog :visible.sync="visible" :width="'35%'" :append-to-body="true" :close-on-click-modal="false" class="dialog">
|
||||||
|
<template #title>
|
||||||
|
<slot name="title">
|
||||||
|
<div class="titleStyle">
|
||||||
|
{{ !dataForm.id ? '新增' : '编辑' }}
|
||||||
|
</div>
|
||||||
|
</slot>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px"
|
||||||
|
@keyup.enter.native="dataFormSubmit()">
|
||||||
|
<el-form-item label="物料名称" prop="materialId">
|
||||||
|
<el-select v-model="dataForm.materialId" filterable placeholder="请选择物料名称">
|
||||||
|
<el-option v-for="dict in materialList" :key=" dict.id" :label="dict.name" :value="dict.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="数量" prop="num">
|
||||||
|
<el-input v-model="dataForm.num" placeholder="请输入数量" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row style="text-align: right">
|
||||||
|
<el-button @click="visible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||||
|
</el-row>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
getProcessEquMaterialBomDet,
|
||||||
|
createProcessEquMaterialBomDet,
|
||||||
|
updateProcessEquMaterialBomDet,
|
||||||
|
getMaterialList
|
||||||
|
} from '@/api/extend/processEquMaterialBom';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
productId: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
visible: false,
|
||||||
|
materialList:[],
|
||||||
|
dataForm: {
|
||||||
|
id: undefined,
|
||||||
|
bomId: undefined,
|
||||||
|
materialId:null,
|
||||||
|
num: undefined,
|
||||||
|
},
|
||||||
|
dataRule: {
|
||||||
|
attrName: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
this.getDict();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init(id,bomId) {
|
||||||
|
this.dataForm.id = id || '';
|
||||||
|
this.dataForm.bomId = bomId || '';
|
||||||
|
console.log(bomId);
|
||||||
|
this.visible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['dataForm'].resetFields();
|
||||||
|
if (this.dataForm.id) {
|
||||||
|
getProcessEquMaterialBomDet({
|
||||||
|
id: this.dataForm.id
|
||||||
|
}).then((res) => {
|
||||||
|
this.dataForm = res.data;
|
||||||
|
// this.dataForm.materialId = materialId;
|
||||||
|
// this.dataForm.value = value;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getDict() {
|
||||||
|
getMaterialList().then((res) => [
|
||||||
|
this.materialList = res.data,
|
||||||
|
console.log(res)
|
||||||
|
])
|
||||||
|
},
|
||||||
|
// 表单提交
|
||||||
|
dataFormSubmit() {
|
||||||
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
// 修改的提交
|
||||||
|
if (this.dataForm.id) {
|
||||||
|
updateProcessEquMaterialBomDet({
|
||||||
|
...this.dataForm,
|
||||||
|
productId: this.productId,
|
||||||
|
}).then((response) => {
|
||||||
|
this.$modal.msgSuccess('修改成功');
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 添加的提交
|
||||||
|
createProcessEquMaterialBomDet({
|
||||||
|
...this.dataForm,
|
||||||
|
productId: this.productId,
|
||||||
|
}).then((response) => {
|
||||||
|
this.$modal.msgSuccess('新增成功');
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.dialog >>> .el-dialog__body {
|
||||||
|
padding: 30px 24px;
|
||||||
|
}
|
||||||
|
.dialog >>> .el-dialog__header {
|
||||||
|
font-size: 16px;
|
||||||
|
color: rgba(0, 0, 0, 0.85);
|
||||||
|
font-weight: 500;
|
||||||
|
padding: 13px 24px;
|
||||||
|
border-bottom: 1px solid #e9e9e9;
|
||||||
|
}
|
||||||
|
.dialog >>> .el-dialog__header .titleStyle::before {
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
width: 4px;
|
||||||
|
height: 16px;
|
||||||
|
background-color: #0b58ff;
|
||||||
|
border-radius: 1px;
|
||||||
|
margin-right: 8px;
|
||||||
|
position: relative;
|
||||||
|
top: 2px;
|
||||||
|
}
|
||||||
|
</style>
|
203
src/views/extend/processEquMaterialBom/index.vue
Normal file
203
src/views/extend/processEquMaterialBom/index.vue
Normal file
@ -0,0 +1,203 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||||
|
<base-table v-loading="dataListLoading" :table-props="tableProps" :page="listQuery.pageNo"
|
||||||
|
:limit="listQuery.pageSize" :table-data="tableData">
|
||||||
|
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
|
||||||
|
@clickBtn="handleClick" />
|
||||||
|
</base-table>
|
||||||
|
<pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
|
||||||
|
@pagination="getDataList" />
|
||||||
|
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" />
|
||||||
|
<!-- <detail-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" @refreshDataList="successSubmit" /> -->
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import AddOrUpdate from './add-or-updata';
|
||||||
|
// import DetailOrUpdate from './detail-or-updata';
|
||||||
|
|
||||||
|
import basicPage from '../../core/mixins/basic-page';
|
||||||
|
import StatusBtn from './statusBtn.vue'
|
||||||
|
import {
|
||||||
|
processEquMaterialBomPage,
|
||||||
|
deleteProcessEquMaterialBom,
|
||||||
|
getEquipmentList
|
||||||
|
} from '@/api/extend/processEquMaterialBom';
|
||||||
|
|
||||||
|
const tableProps = [
|
||||||
|
{
|
||||||
|
prop: 'equipmentCode',
|
||||||
|
label: '设备编码',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'equipmentName',
|
||||||
|
label: '设备名称'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'code',
|
||||||
|
label: '物料配方编码'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'name',
|
||||||
|
label: '物料配方名称'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'enabled',
|
||||||
|
label: '当前激活状态',
|
||||||
|
subcomponent: StatusBtn
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '备注'
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [basicPage],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
urlOptions: {
|
||||||
|
getDataListURL: processEquMaterialBomPage,
|
||||||
|
deleteURL: deleteProcessEquMaterialBom,
|
||||||
|
// exportURL: exportFactoryExcel,
|
||||||
|
},
|
||||||
|
tableProps,
|
||||||
|
tableBtn: [
|
||||||
|
this.$auth.hasPermi(`extend:process-equ-material-bom:update`)
|
||||||
|
? {
|
||||||
|
type: 'edit',
|
||||||
|
btnName: '编辑',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
this.$auth.hasPermi(`extend:process-equ-material-bom:detail`)
|
||||||
|
? {
|
||||||
|
type: 'detail',
|
||||||
|
btnName: '详情',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
this.$auth.hasPermi(`extend:process-equ-material-bom:delete`)
|
||||||
|
? {
|
||||||
|
type: 'delete',
|
||||||
|
btnName: '删除',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
].filter((v)=>v),
|
||||||
|
tableData: [],
|
||||||
|
detailOrUpdateVisible:false,
|
||||||
|
formConfig: [
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '设备名称',
|
||||||
|
selectOptions: [],
|
||||||
|
labelField: 'name',
|
||||||
|
valueField: 'id',
|
||||||
|
param: 'equipmentId',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: '物料配方名称',
|
||||||
|
// selectOptions: [],
|
||||||
|
// labelField: 'name',
|
||||||
|
// valueField: 'id',
|
||||||
|
param: 'name',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: '物料配方编码',
|
||||||
|
// selectOptions: [],
|
||||||
|
// labelField: 'name',
|
||||||
|
// valueField: 'id',
|
||||||
|
param: 'code',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '查询',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'separate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: this.$auth.hasPermi('extend:process-equ-material-bom:create') ? 'button' : '',
|
||||||
|
btnName: '新增',
|
||||||
|
name: 'add',
|
||||||
|
color: 'success',
|
||||||
|
plain: true
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
AddOrUpdate,
|
||||||
|
// DetailOrUpdate
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getDict()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
otherMethods(val) {
|
||||||
|
if (val.type === 'detail') {
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.addOrEditTitle = "详情";
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init(val.data.id, true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getDict() {
|
||||||
|
getEquipmentList().then((res) => {
|
||||||
|
// console.log(res);
|
||||||
|
// console.log(response);
|
||||||
|
this.formConfig[0].selectOptions = res.data.map((item) => {
|
||||||
|
return {
|
||||||
|
name: item.name,
|
||||||
|
id: item.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 获取数据列表
|
||||||
|
getDataList() {
|
||||||
|
this.dataListLoading = true;
|
||||||
|
this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
||||||
|
this.tableData = response.data.list;
|
||||||
|
this.listQuery.total = response.data.total;
|
||||||
|
this.dataListLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
buttonClick(val) {
|
||||||
|
switch (val.btnName) {
|
||||||
|
case 'search':
|
||||||
|
this.listQuery.pageNo = 1;
|
||||||
|
this.listQuery.pageSize = 10;
|
||||||
|
this.listQuery.equipmentId = val.equipmentId ? val.equipmentId : undefined;
|
||||||
|
this.listQuery.name = val.name ? val.name : undefined;
|
||||||
|
this.listQuery.name = val.name ? val.name : undefined;
|
||||||
|
this.getDataList();
|
||||||
|
break;
|
||||||
|
case 'reset':
|
||||||
|
this.$refs.searchBarForm.resetForm();
|
||||||
|
this.listQuery = {
|
||||||
|
pageSize: 10,
|
||||||
|
pageNo: 1,
|
||||||
|
total: 1,
|
||||||
|
};
|
||||||
|
this.getDataList();
|
||||||
|
break;
|
||||||
|
case 'add':
|
||||||
|
this.addOrEditTitle = '新增';
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.addOrUpdateHandle();
|
||||||
|
break;
|
||||||
|
case 'export':
|
||||||
|
this.handleExport();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.log(val);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
67
src/views/extend/processEquMaterialBom/statusBtn.vue
Normal file
67
src/views/extend/processEquMaterialBom/statusBtn.vue
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zhp
|
||||||
|
* @Date: 2023-11-08 14:00:52
|
||||||
|
* @LastEditTime: 2023-11-08 14:46:27
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-switch v-model="state" type="text" size="small" @change="changeHandler" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
// processEquMaterialBomPage,
|
||||||
|
updateProcessEquMaterialBom,
|
||||||
|
// getWorkOrderList,
|
||||||
|
// getTeamList
|
||||||
|
} from '@/api/extend/processEquMaterialBom';
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
injectData: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
state: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// computed: {
|
||||||
|
// readonly() {
|
||||||
|
// return !!this.injectData.readonly
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
mounted() {
|
||||||
|
this.mapToState()
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
mapToState() {
|
||||||
|
if (this.injectData.prop === 'enabled') {
|
||||||
|
this.state = this.injectData.enabled === 1 ? true : false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
changeHandler() {
|
||||||
|
// let params = {}
|
||||||
|
let payload = {}
|
||||||
|
// params.name = 'state'
|
||||||
|
payload.id = this.injectData.id
|
||||||
|
payload.enabled = this.state ? '1' : '0'
|
||||||
|
payload.code = this.injectData.code
|
||||||
|
payload.name = this.injectData.name
|
||||||
|
payload.equipmentId = this.injectData.equipmentId
|
||||||
|
payload.remark = this.injectData.remark
|
||||||
|
|
||||||
|
// params.payload = payload
|
||||||
|
updateProcessEquMaterialBom(payload).then((res) => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.$modal.msgSuccess("操作成功");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// this.$emit('emitData', params)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
65
src/views/extend/processEquValueBom/SmallTitle.vue
Normal file
65
src/views/extend/processEquValueBom/SmallTitle.vue
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zhp
|
||||||
|
* @Date: 2023-11-07 19:28:13
|
||||||
|
* @LastEditTime: 2023-11-08 14:11:43
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @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: 18px;
|
||||||
|
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>
|
391
src/views/extend/processEquValueBom/add-or-updata.vue
Normal file
391
src/views/extend/processEquValueBom/add-or-updata.vue
Normal file
@ -0,0 +1,391 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2021-11-18 14:16:25
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @LastEditTime: 2023-11-09 14:49:16
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="false" class="drawer" size="50%">
|
||||||
|
<small-title slot="title" :no-padding="true">
|
||||||
|
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
|
||||||
|
</small-title>
|
||||||
|
<div class="content">
|
||||||
|
<div class="visual-part">
|
||||||
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
|
||||||
|
label-width="100px" label-position="top">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="设备名称" prop="equipmentId">
|
||||||
|
<el-select v-model="dataForm.equipmentId" filterable :disabled="isdetail" style="width: 100%"
|
||||||
|
@change="getCode" placeholder="请选择设备名称">
|
||||||
|
<el-option v-for="dict in equipmentList" :key=" dict.id" :label="dict.name" :value="dict.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="设备编码" prop="equipmentCode">
|
||||||
|
<el-input v-model="dataForm.equipmentCode" clearable :disabled="isdetail" placeholder="请输入设备编码" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="参数Bom编码" prop="code">
|
||||||
|
<el-input v-model="dataForm.code" clearable :disabled="isdetail" placeholder="请输入参数Bom编码" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="设备参数BOM名称" prop="name">
|
||||||
|
<el-input v-model="dataForm.name" clearable :disabled="isdetail" placeholder="请输入设备参数BOM名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="当前状态" prop="enabled">
|
||||||
|
<el-switch v-model="dataForm.enabled" :active-value="1" :inactive-value="0" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<div class="drawer-body__footer">
|
||||||
|
<el-button style="" @click="goback()">取消</el-button>
|
||||||
|
<el-button v-if="isdetail" type="primary" @click="goEdit()">
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="attr-list" v-if="idAttrShow">
|
||||||
|
<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
|
||||||
|
设备物料明细
|
||||||
|
</small-title>
|
||||||
|
|
||||||
|
<div v-if="!isdetail" class="action_btn">
|
||||||
|
<template>
|
||||||
|
<span style="display: inline-block;">
|
||||||
|
<el-button type="text" @click="addNew()" icon="el-icon-plus">新增</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
|
||||||
|
:table-data="productAttrList">
|
||||||
|
<method-btn v-if="!isdetail" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
|
||||||
|
@clickBtn="handleClick" />
|
||||||
|
</base-table>
|
||||||
|
<pagination v-show="listQuery.total > 0" :total="listQuery.total" :page.sync="listQuery.pageNo"
|
||||||
|
:limit.sync="listQuery.pageSize" :page-sizes="[5, 10, 15]" @pagination="getList" />
|
||||||
|
|
||||||
|
<div class="drawer-body__footer">
|
||||||
|
<el-button type="primary" @click="goback()">关闭</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<attr-add v-if="addOrUpdateVisible" ref="addOrUpdate" :product-id="dataForm.id" @refreshDataList="getList" />
|
||||||
|
</el-drawer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import basicAdd from '../../core/mixins/basic-add';
|
||||||
|
import {
|
||||||
|
getProcessEquValueBom,
|
||||||
|
createProcessEquValueBom,
|
||||||
|
updateProcessEquValueBom,
|
||||||
|
getEquipmentList,
|
||||||
|
processEquValueBomDetPage,
|
||||||
|
deleteProcessEquValueBomDet
|
||||||
|
} from '@/api/extend/processEquValueBom';
|
||||||
|
import SmallTitle from './SmallTitle';
|
||||||
|
import { parseTime } from '../../core/mixins/code-filter';
|
||||||
|
import attrAdd from './attr-add';
|
||||||
|
// import {DICT_TYPE, getDictDatas} from "@/utils/dict";
|
||||||
|
|
||||||
|
const tableBtn = [
|
||||||
|
{
|
||||||
|
type: 'edit',
|
||||||
|
btnName: '编辑',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'delete',
|
||||||
|
btnName: '删除',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const tableProps = [
|
||||||
|
{
|
||||||
|
prop: 'valueName',
|
||||||
|
label: '参数名称',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'valueCode',
|
||||||
|
label: '参数编码',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'standardMinValue',
|
||||||
|
label: '最小值(标准)',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'standardMaxValue',
|
||||||
|
label: '最大值(标准)',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'minValue',
|
||||||
|
label: '最小值(工艺)',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'manValue',
|
||||||
|
label: '最大值(工艺)',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'defaultValue',
|
||||||
|
label: '标准值(工艺)',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '备注',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const topBtnConfig = [
|
||||||
|
{
|
||||||
|
type: 'add',
|
||||||
|
btnName: 'btn.add'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [basicAdd],
|
||||||
|
components: { SmallTitle, attrAdd },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
tableBtn,
|
||||||
|
tableProps,
|
||||||
|
topBtnConfig,
|
||||||
|
addOrUpdateVisible: false,
|
||||||
|
urlOptions: {
|
||||||
|
isGetCode: false,
|
||||||
|
// codeURL: getCode,
|
||||||
|
createURL:createProcessEquValueBom,
|
||||||
|
updateURL: updateProcessEquValueBom,
|
||||||
|
infoURL: getProcessEquValueBom,
|
||||||
|
},
|
||||||
|
listQuery: {
|
||||||
|
pageSize: 10,
|
||||||
|
pageNo: 1,
|
||||||
|
total: 0,
|
||||||
|
},
|
||||||
|
equipmentList:[],
|
||||||
|
dataForm: {
|
||||||
|
id: undefined,
|
||||||
|
code: undefined,
|
||||||
|
name: '',
|
||||||
|
equipmentId: undefined,
|
||||||
|
equipmentCode: undefined,
|
||||||
|
enabled:undefined,
|
||||||
|
// area: undefined,
|
||||||
|
// specifications: undefined,
|
||||||
|
// processTime: 0,
|
||||||
|
remark: undefined,
|
||||||
|
// unit: undefined
|
||||||
|
},
|
||||||
|
productAttrList: [],
|
||||||
|
visible: false,
|
||||||
|
isdetail: false,
|
||||||
|
idAttrShow: false,
|
||||||
|
dataRule: {
|
||||||
|
// code: [{ required: true, message: "设备物料编码不能为空", trigger: "blur" }],
|
||||||
|
name: [{ required: true, message: "设备参数名称不能为空", trigger: "blur" }],
|
||||||
|
equipmentId: [{ required: true, message: "设备名称不能为空", trigger: "change" }],
|
||||||
|
// : [{ required: true, message: "产品类型不能为空", trigger: "change" }],
|
||||||
|
// processTime: [{ required: true, message: "产线生产单位用时不能为空", trigger: "blur" }]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getDict()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getCode(val) {
|
||||||
|
this.equipmentList.forEach((ele) => {
|
||||||
|
if (val === ele.id) {
|
||||||
|
this.dataForm.equipmentCode = ele.code
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// clickTopBtn(val) {
|
||||||
|
// if (val === 'add') {
|
||||||
|
// this.addNew()
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
initData() {
|
||||||
|
this.productAttrList.splice(0);
|
||||||
|
this.listQuery.total = 0;
|
||||||
|
},
|
||||||
|
getDict() {
|
||||||
|
getEquipmentList().then((res) => {
|
||||||
|
|
||||||
|
// console.log(res);
|
||||||
|
// console.log(response);
|
||||||
|
this.equipmentList = res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleClick(raw) {
|
||||||
|
if (raw.type === 'delete') {
|
||||||
|
this.$confirm(
|
||||||
|
`确定对${
|
||||||
|
raw.data.valueName
|
||||||
|
? '[物料名称为' + raw.data.valueName + ']'
|
||||||
|
: '[序号为' + raw.data.valueName + ']'
|
||||||
|
}进行删除操作?`,
|
||||||
|
'提示',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
deleteProcessEquValueBomDet(raw.data.id).then(({ data }) => {
|
||||||
|
this.$message({
|
||||||
|
message: '操作成功',
|
||||||
|
type: 'success',
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
} else {
|
||||||
|
this.addNew(raw.data.id);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getList() {
|
||||||
|
// 获取产品属性列表
|
||||||
|
processEquValueBomDetPage({
|
||||||
|
...this.listQuery,
|
||||||
|
bomId: this.dataForm.id,
|
||||||
|
}).then((response) => {
|
||||||
|
this.productAttrList = response.data.list;
|
||||||
|
this.listQuery.total = response.data.total;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
init(id, isdetail) {
|
||||||
|
this.initData();
|
||||||
|
console.log(isdetail);
|
||||||
|
this.isdetail = isdetail || false;
|
||||||
|
this.dataForm.id = id || undefined;
|
||||||
|
this.visible = true;
|
||||||
|
if (id) {
|
||||||
|
this.idAttrShow = true
|
||||||
|
} else {
|
||||||
|
this.idAttrShow = false
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['dataForm'].resetFields();
|
||||||
|
|
||||||
|
if (this.dataForm.id) {
|
||||||
|
// 获取产品详情
|
||||||
|
this.urlOptions.infoURL({
|
||||||
|
bomId: id,
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize:10
|
||||||
|
}).then(response => {
|
||||||
|
this.dataForm = response.data
|
||||||
|
// this.dataForm.unit = String(this.dataForm.unit)
|
||||||
|
// this.dataForm.ValueType = String(this.dataForm.ValueType)
|
||||||
|
// this.dataForm.productType = String(this.dataForm.productType)
|
||||||
|
});
|
||||||
|
// 获取产品属性列表
|
||||||
|
this.getList();
|
||||||
|
} else {
|
||||||
|
if (this.urlOptions.isGetCode) {
|
||||||
|
this.getCode()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
goback() {
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
this.visible = false;
|
||||||
|
// this.initData();
|
||||||
|
},
|
||||||
|
goEdit() {
|
||||||
|
this.isdetail = false;
|
||||||
|
},
|
||||||
|
// 新增 / 修改
|
||||||
|
addNew(id) {
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init(id,this.dataForm.id,this.dataForm.equipmentId);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</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;
|
||||||
|
}
|
||||||
|
.action_btn {
|
||||||
|
float: right;
|
||||||
|
margin: 5px 15px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
.add {
|
||||||
|
color: #0b58ff;
|
||||||
|
}
|
||||||
|
</style>
|
189
src/views/extend/processEquValueBom/attr-add.vue
Normal file
189
src/views/extend/processEquValueBom/attr-add.vue
Normal file
@ -0,0 +1,189 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zhp
|
||||||
|
* @Date: 2023-11-08 15:30:27
|
||||||
|
* @LastEditTime: 2023-11-09 14:44:49
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-dialog :visible.sync="visible" :width="'35%'" :append-to-body="true" :close-on-click-modal="false" class="dialog">
|
||||||
|
<template #title>
|
||||||
|
<slot name="title">
|
||||||
|
<div class="titleStyle">
|
||||||
|
{{ !dataForm.id ? '新增' : '编辑' }}
|
||||||
|
</div>
|
||||||
|
</slot>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px"
|
||||||
|
@keyup.enter.native="dataFormSubmit()">
|
||||||
|
<el-form-item label="参数名称" prop="paramId">
|
||||||
|
<el-select v-model="dataForm.paramId" filterable placeholder="参数名称" @change="getData">
|
||||||
|
<el-option v-for="dict in materialList" :key=" dict.id" :label="dict.name" :value="dict.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="参数编码" prop="code">
|
||||||
|
<el-input v-model="dataForm.code" placeholder="请输入参数编码" clearable />
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item label="标准最小值" prop="standardMinValue">
|
||||||
|
<el-input v-model="dataForm.standardMinValue" placeholder="请输入标准最小值" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="标准最大值" prop="standardMaxValue">
|
||||||
|
<el-input v-model="dataForm.standardMaxValue" placeholder="请输入标准最大值" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="工艺最小值" prop="minValue">
|
||||||
|
<el-input v-model="dataForm.minValue" placeholder="请输入工艺最小值" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="工艺最大值" prop="maxValue">
|
||||||
|
<el-input v-model="dataForm.maxValue" placeholder="请输入工艺最大值" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="工艺标准值" prop="defaultValue">
|
||||||
|
<el-input v-model="dataForm.defaultValue" placeholder="请输入工艺标准值" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="dataForm.remark" placeholder="请输入备注" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row style="text-align: right">
|
||||||
|
<el-button @click="visible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||||
|
</el-row>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
getProcessEquValueBomDet,
|
||||||
|
createProcessEquValueBomDet,
|
||||||
|
updateProcessEquValueBomDet,
|
||||||
|
getValueList
|
||||||
|
} from '@/api/extend/processEquValueBom';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
productId: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
visible: false,
|
||||||
|
materialList:[],
|
||||||
|
dataForm: {
|
||||||
|
id: undefined,
|
||||||
|
bomId: undefined,
|
||||||
|
paramId:undefined,
|
||||||
|
minValue:undefined,
|
||||||
|
maxValue: undefined,
|
||||||
|
defaultValue: undefined,
|
||||||
|
standardMinValue: undefined,
|
||||||
|
standardMaxValue: undefined,
|
||||||
|
remark:null
|
||||||
|
},
|
||||||
|
equipmentId:null,
|
||||||
|
dataRule: {
|
||||||
|
attrName: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getData(val) {
|
||||||
|
this.materialList.forEach((ele) => {
|
||||||
|
if (val === ele.id) {
|
||||||
|
console.log(ele)
|
||||||
|
this.dataForm.code = ele.code
|
||||||
|
this.dataForm.standardMinValue = ele.minValue
|
||||||
|
this.dataForm.standardMaxValue = ele.maxValue
|
||||||
|
// this.dataForm.code = ele.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
init(id, bomId, equipmentId) {
|
||||||
|
console.log(equipmentId);
|
||||||
|
this.dataForm.id = id || '';
|
||||||
|
this.dataForm.bomId = bomId || '';
|
||||||
|
this.equipmentId = equipmentId
|
||||||
|
this.getDict()
|
||||||
|
console.log(bomId);
|
||||||
|
this.visible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['dataForm'].resetFields();
|
||||||
|
if (this.dataForm.id) {
|
||||||
|
getProcessEquValueBomDet({
|
||||||
|
id: this.dataForm.id
|
||||||
|
}).then((res) => {
|
||||||
|
this.dataForm = res.data;
|
||||||
|
// this.dataForm.materialId = materialId;
|
||||||
|
// this.dataForm.value = value;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getDict() {
|
||||||
|
console.log(this.equipmentId);
|
||||||
|
getValueList({
|
||||||
|
id: this.equipmentId
|
||||||
|
}).then((res) => [
|
||||||
|
this.materialList = res.data,
|
||||||
|
console.log(res)
|
||||||
|
])
|
||||||
|
},
|
||||||
|
// 表单提交
|
||||||
|
dataFormSubmit() {
|
||||||
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
// 修改的提交
|
||||||
|
if (this.dataForm.id) {
|
||||||
|
updateProcessEquValueBomDet({
|
||||||
|
...this.dataForm,
|
||||||
|
productId: this.productId,
|
||||||
|
}).then((response) => {
|
||||||
|
this.$modal.msgSuccess('修改成功');
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 添加的提交
|
||||||
|
createProcessEquValueBomDet({
|
||||||
|
...this.dataForm,
|
||||||
|
productId: this.productId,
|
||||||
|
}).then((response) => {
|
||||||
|
this.$modal.msgSuccess('新增成功');
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.dialog >>> .el-dialog__body {
|
||||||
|
padding: 30px 24px;
|
||||||
|
}
|
||||||
|
.dialog >>> .el-dialog__header {
|
||||||
|
font-size: 16px;
|
||||||
|
color: rgba(0, 0, 0, 0.85);
|
||||||
|
font-weight: 500;
|
||||||
|
padding: 13px 24px;
|
||||||
|
border-bottom: 1px solid #e9e9e9;
|
||||||
|
}
|
||||||
|
.dialog >>> .el-dialog__header .titleStyle::before {
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
width: 4px;
|
||||||
|
height: 16px;
|
||||||
|
background-color: #0b58ff;
|
||||||
|
border-radius: 1px;
|
||||||
|
margin-right: 8px;
|
||||||
|
position: relative;
|
||||||
|
top: 2px;
|
||||||
|
}
|
||||||
|
</style>
|
203
src/views/extend/processEquValueBom/index.vue
Normal file
203
src/views/extend/processEquValueBom/index.vue
Normal file
@ -0,0 +1,203 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||||
|
<base-table v-loading="dataListLoading" :table-props="tableProps" :page="listQuery.pageNo"
|
||||||
|
:limit="listQuery.pageSize" :table-data="tableData">
|
||||||
|
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
|
||||||
|
@clickBtn="handleClick" />
|
||||||
|
</base-table>
|
||||||
|
<pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
|
||||||
|
@pagination="getDataList" />
|
||||||
|
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" />
|
||||||
|
<!-- <detail-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" @refreshDataList="successSubmit" /> -->
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import AddOrUpdate from './add-or-updata';
|
||||||
|
// import DetailOrUpdate from './detail-or-updata';
|
||||||
|
|
||||||
|
import basicPage from '../../core/mixins/basic-page';
|
||||||
|
import StatusBtn from './statusBtn.vue'
|
||||||
|
import {
|
||||||
|
processEquValueBomPage,
|
||||||
|
deleteProcessEquValueBom,
|
||||||
|
getEquipmentList
|
||||||
|
} from '@/api/extend/processEquValueBom';
|
||||||
|
|
||||||
|
const tableProps = [
|
||||||
|
{
|
||||||
|
prop: 'equipmentCode',
|
||||||
|
label: '设备编码',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'equipmentName',
|
||||||
|
label: '设备名称'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'code',
|
||||||
|
label: '参数配方编码'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'name',
|
||||||
|
label: '参数配方名称'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'enabled',
|
||||||
|
label: '当前激活状态',
|
||||||
|
subcomponent: StatusBtn
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '备注'
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [basicPage],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
urlOptions: {
|
||||||
|
getDataListURL: processEquValueBomPage,
|
||||||
|
deleteURL: deleteProcessEquValueBom,
|
||||||
|
// exportURL: exportFactoryExcel,
|
||||||
|
},
|
||||||
|
tableProps,
|
||||||
|
tableBtn: [
|
||||||
|
this.$auth.hasPermi(`extend:process-equ-value-bom:update`)
|
||||||
|
? {
|
||||||
|
type: 'edit',
|
||||||
|
btnName: '编辑',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
this.$auth.hasPermi(`extend:process-equ-value-bom:detail`)
|
||||||
|
? {
|
||||||
|
type: 'detail',
|
||||||
|
btnName: '详情',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
this.$auth.hasPermi(`extend:process-equ-value-bom:delete`)
|
||||||
|
? {
|
||||||
|
type: 'delete',
|
||||||
|
btnName: '删除',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
].filter((v)=>v),
|
||||||
|
tableData: [],
|
||||||
|
detailOrUpdateVisible:false,
|
||||||
|
formConfig: [
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '设备名称',
|
||||||
|
selectOptions: [],
|
||||||
|
labelField: 'name',
|
||||||
|
valueField: 'id',
|
||||||
|
param: 'equipmentId',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: '物料配方名称',
|
||||||
|
// selectOptions: [],
|
||||||
|
// labelField: 'name',
|
||||||
|
// valueField: 'id',
|
||||||
|
param: 'name',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: '物料配方编码',
|
||||||
|
// selectOptions: [],
|
||||||
|
// labelField: 'name',
|
||||||
|
// valueField: 'id',
|
||||||
|
param: 'code',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '查询',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'separate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: this.$auth.hasPermi('extend:process-equ-value-bom:create') ? 'button' : '',
|
||||||
|
btnName: '新增',
|
||||||
|
name: 'add',
|
||||||
|
color: 'success',
|
||||||
|
plain: true
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
AddOrUpdate,
|
||||||
|
// DetailOrUpdate
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getDict()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
otherMethods(val) {
|
||||||
|
if (val.type === 'detail') {
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.addOrEditTitle = "详情";
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init(val.data.id, true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getDict() {
|
||||||
|
getEquipmentList().then((res) => {
|
||||||
|
// console.log(res);
|
||||||
|
// console.log(response);
|
||||||
|
this.formConfig[0].selectOptions = res.data.map((item) => {
|
||||||
|
return {
|
||||||
|
name: item.name,
|
||||||
|
id: item.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 获取数据列表
|
||||||
|
getDataList() {
|
||||||
|
this.dataListLoading = true;
|
||||||
|
this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
||||||
|
this.tableData = response.data.list;
|
||||||
|
this.listQuery.total = response.data.total;
|
||||||
|
this.dataListLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
buttonClick(val) {
|
||||||
|
switch (val.btnName) {
|
||||||
|
case 'search':
|
||||||
|
this.listQuery.pageNo = 1;
|
||||||
|
this.listQuery.pageSize = 10;
|
||||||
|
this.listQuery.equipmentId = val.equipmentId ? val.equipmentId : undefined;
|
||||||
|
this.listQuery.name = val.name ? val.name : undefined;
|
||||||
|
this.listQuery.name = val.name ? val.name : undefined;
|
||||||
|
this.getDataList();
|
||||||
|
break;
|
||||||
|
case 'reset':
|
||||||
|
this.$refs.searchBarForm.resetForm();
|
||||||
|
this.listQuery = {
|
||||||
|
pageSize: 10,
|
||||||
|
pageNo: 1,
|
||||||
|
total: 1,
|
||||||
|
};
|
||||||
|
this.getDataList();
|
||||||
|
break;
|
||||||
|
case 'add':
|
||||||
|
this.addOrEditTitle = '新增';
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.addOrUpdateHandle();
|
||||||
|
break;
|
||||||
|
case 'export':
|
||||||
|
this.handleExport();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.log(val);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
67
src/views/extend/processEquValueBom/statusBtn.vue
Normal file
67
src/views/extend/processEquValueBom/statusBtn.vue
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zhp
|
||||||
|
* @Date: 2023-11-08 14:00:52
|
||||||
|
* @LastEditTime: 2023-11-09 09:59:53
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-switch v-model="state" type="text" size="small" @change="changeHandler" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
// processEquMaterialBomPage,
|
||||||
|
updateProcessEquValueBom,
|
||||||
|
// getWorkOrderList,
|
||||||
|
// getTeamList
|
||||||
|
} from '@/api/extend/processEquValueBom';
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
injectData: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
state: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// computed: {
|
||||||
|
// readonly() {
|
||||||
|
// return !!this.injectData.readonly
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
mounted() {
|
||||||
|
this.mapToState()
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
mapToState() {
|
||||||
|
if (this.injectData.prop === 'enabled') {
|
||||||
|
this.state = this.injectData.enabled === 1 ? true : false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
changeHandler() {
|
||||||
|
// let params = {}
|
||||||
|
let payload = {}
|
||||||
|
// params.name = 'state'
|
||||||
|
payload.id = this.injectData.id
|
||||||
|
payload.enabled = this.state ? 1 : 0
|
||||||
|
payload.code = this.injectData.code
|
||||||
|
payload.name = this.injectData.name
|
||||||
|
payload.equipmentId = this.injectData.equipmentId
|
||||||
|
payload.remark = this.injectData.remark
|
||||||
|
|
||||||
|
// params.payload = payload
|
||||||
|
updateProcessEquValueBom(payload).then((res) => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.$modal.msgSuccess("操作成功");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// this.$emit('emitData', params)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
@ -1,8 +1,8 @@
|
|||||||
<!--
|
<!--
|
||||||
filename: ProcessGraph.vue
|
filename: ProcessGraph.vue
|
||||||
author: liubin
|
author: liubin
|
||||||
date: 2023-10-20 15:00:58
|
date: 2023-10-20 15:00:58
|
||||||
description:
|
description:
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -40,7 +40,7 @@ import ProcessNode, { createProcessNode, CACHE_NAME, getSectionFrom } from './Pr
|
|||||||
import DialogForm from '@/components/DialogForm';
|
import DialogForm from '@/components/DialogForm';
|
||||||
// import { IdToName } from '@/utils'
|
// import { IdToName } from '@/utils'
|
||||||
|
|
||||||
Graph.registerNode('process-node', ProcessNode);
|
Graph.registerNode('process-node', ProcessNode,true);
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ProcessGraph',
|
name: 'ProcessGraph',
|
||||||
@ -350,7 +350,7 @@ export default {
|
|||||||
.then((form) => {
|
.then((form) => {
|
||||||
const { name, sectionId, remark } = form;
|
const { name, sectionId, remark } = form;
|
||||||
getSectionFrom(sectionId).then(sectionName => {
|
getSectionFrom(sectionId).then(sectionName => {
|
||||||
// 修改当前node的信息
|
// 修改当前node的信息
|
||||||
this.currentNode.setAttrs({
|
this.currentNode.setAttrs({
|
||||||
detName: { text: name },
|
detName: { text: name },
|
||||||
sectionId: { text: sectionId },
|
sectionId: { text: sectionId },
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<!--
|
<!--
|
||||||
filename: index.vue
|
filename: index.vue
|
||||||
author: liubin
|
author: liubin
|
||||||
date: 2023-10-18 12:25:46
|
date: 2023-10-18 12:25:46
|
||||||
description:
|
description:
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
267
src/views/extend/processTraceability/index.vue
Normal file
267
src/views/extend/processTraceability/index.vue
Normal file
@ -0,0 +1,267 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2023-08-01 14:55:51
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @LastEditTime: 2023-11-10 10:23:33
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||||
|
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="list">
|
||||||
|
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
|
||||||
|
@clickBtn="handleClick" />
|
||||||
|
</base-table>
|
||||||
|
<pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
|
||||||
|
@pagination="getList" />
|
||||||
|
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// import AddOrUpdate from './add-or-updata';
|
||||||
|
// import unitDict from './unitDict';
|
||||||
|
// import basicPage from '../mixins/basic-page';
|
||||||
|
import { parseTime } from '../../core/mixins/code-filter';
|
||||||
|
import {
|
||||||
|
getProcessTraceabilityPage,
|
||||||
|
getWorkOrderList,
|
||||||
|
// exportEnergyPlcExcel
|
||||||
|
} from '@/api/quality/processTraceability';
|
||||||
|
|
||||||
|
const tableProps = [
|
||||||
|
{
|
||||||
|
prop: 'name',
|
||||||
|
label: '工单名称'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'code',
|
||||||
|
label: '工单编码'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'planProductName',
|
||||||
|
label: '产品名'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'status',
|
||||||
|
label: '状态'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'startProduceTime',
|
||||||
|
label: '开始生产时间',
|
||||||
|
filter: parseTime
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'finishProduceTime',
|
||||||
|
label: '结束生产时间',
|
||||||
|
filter: parseTime
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'actualQuantity',
|
||||||
|
label: '生产数量'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'unit',
|
||||||
|
label: '单位'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'processFlowName',
|
||||||
|
label: '工艺名称'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'yield',
|
||||||
|
label: '成品率'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
export default {
|
||||||
|
// mixins: [basicPage],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// urlOptions: {
|
||||||
|
// getDataListURL: getMaterialUseLogPage,
|
||||||
|
// // deleteURL: deletePackingType,
|
||||||
|
// // exportURL: exportPackingExcel,
|
||||||
|
// },
|
||||||
|
tableProps,
|
||||||
|
tableBtn: [
|
||||||
|
// this.$auth.hasPermi(`base:packaging-print-log:update`)
|
||||||
|
// ? {
|
||||||
|
// type: 'edit',
|
||||||
|
// btnName: '编辑',
|
||||||
|
// }
|
||||||
|
// : undefined,
|
||||||
|
{
|
||||||
|
type: 'processDetail',
|
||||||
|
btnName: '查看工艺详情',
|
||||||
|
},
|
||||||
|
|
||||||
|
].filter((v) => v),
|
||||||
|
list: [],
|
||||||
|
listQuery: {
|
||||||
|
pageSize: 10,
|
||||||
|
pageNo: 1,
|
||||||
|
// total: 0,
|
||||||
|
// orderName: '工单',
|
||||||
|
// startTime: undefined,
|
||||||
|
// endTime:undefined,
|
||||||
|
},
|
||||||
|
formConfig: [
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '工单',
|
||||||
|
selectOptions: [],
|
||||||
|
labelField: 'name',
|
||||||
|
valueField: 'id',
|
||||||
|
param: 'orderName'
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// type: 'datePicker',
|
||||||
|
// label: '时间段',
|
||||||
|
// dateType: 'daterange',
|
||||||
|
// format: 'yyyy-MM-dd',
|
||||||
|
// valueFormat: "yyyy-MM-dd",
|
||||||
|
// rangeSeparator: '-',
|
||||||
|
// startPlaceholder: '开始时间',
|
||||||
|
// endPlaceholder: '结束时间',
|
||||||
|
// param: 'timeVal',
|
||||||
|
// defaultSelect: [],
|
||||||
|
// width: 250
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '搜索',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// type: 'separate',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// type: 'button',
|
||||||
|
// btnName: '重置',
|
||||||
|
// name: 'reset',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// type: 'separate',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '',
|
||||||
|
// btnName: '新增',
|
||||||
|
// name: 'add',
|
||||||
|
// color: 'success',
|
||||||
|
// plain: true,
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// type: 'separate',
|
||||||
|
// type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// type: this.$auth.hasPermi('monitoring:materiel-date-from:export') ? 'button' : '',
|
||||||
|
// btnName: '导出',
|
||||||
|
// name: 'export',
|
||||||
|
// color: 'warning',
|
||||||
|
// },
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
// AddOrUpdate,
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList()
|
||||||
|
this.getDict()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getList() {
|
||||||
|
getProcessTraceabilityPage(this.listQuery).then(res => {
|
||||||
|
this.list = res.data.list || []
|
||||||
|
this.listQuery.total = res.data.total || 0
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleClick(val) {
|
||||||
|
if (val.type === "processDetail") {
|
||||||
|
console.log(val);
|
||||||
|
this.$router.push({
|
||||||
|
name: 'process-traceability-detail',
|
||||||
|
params: {
|
||||||
|
id: '1715180991838887938',
|
||||||
|
orderId: val.data.id,
|
||||||
|
name: val.data.name,
|
||||||
|
productName: val.data.planProductName,
|
||||||
|
processFlowName: val.data.processFlowName
|
||||||
|
// equipmentName,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
// this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getDict() {
|
||||||
|
// 获取产品的属性列表
|
||||||
|
// getCustomerList().then((response) => {
|
||||||
|
// console.log(response);
|
||||||
|
// this.customerList = response.data
|
||||||
|
// // this.listQuery.total = response.data.total;
|
||||||
|
// })
|
||||||
|
// getModelList().then((response) => {
|
||||||
|
// console.log(response);
|
||||||
|
// this.modelList = response.data
|
||||||
|
// // this.listQuery.total = response.data.total;
|
||||||
|
// })
|
||||||
|
getWorkOrderList().then((response) => {
|
||||||
|
// console.log(response);
|
||||||
|
this.formConfig[0].selectOptions = response.data.map((item) => {
|
||||||
|
return {
|
||||||
|
name: item.name,
|
||||||
|
id: item.name
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(this.formConfig[0].selectOptions);
|
||||||
|
// this.listQuery.total = response.data.total;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// handleExport() {
|
||||||
|
// // 处理查询参数
|
||||||
|
// let params = { ...this.listQuery };
|
||||||
|
// params.pageNo = undefined;
|
||||||
|
// params.pageSize = undefined;
|
||||||
|
// this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
||||||
|
// this.exportLoading = true;
|
||||||
|
// return exportEnergyPlcExcel(params);
|
||||||
|
// }).then(response => {
|
||||||
|
// this.$download.excel(response, '物料信息追溯 ');
|
||||||
|
// this.exportLoading = false;
|
||||||
|
// }).catch(() => { });
|
||||||
|
// },
|
||||||
|
buttonClick(val) {
|
||||||
|
console.log(val)
|
||||||
|
if (val.btnName === 'search') {
|
||||||
|
this.listQuery.orderName = val.orderName ? val.orderName :undefined
|
||||||
|
// this.queryParams.status = val.status
|
||||||
|
// if (val.timeVal && val.timeVal.length != 0 ) {
|
||||||
|
// this.listQuery.startTime = val.timeVal[0] + ' 00:00:00'
|
||||||
|
// this.listQuery.endTime = val.timeVal[1] + ' 23:59:59'
|
||||||
|
// } else {
|
||||||
|
// this.listQuery.startTime = undefined
|
||||||
|
// this.listQuery.endTime = undefined
|
||||||
|
// }
|
||||||
|
this.getList()
|
||||||
|
} else {
|
||||||
|
// this.handleExport()
|
||||||
|
// this.addOrEditTitle = '新增'
|
||||||
|
// this.centervisible = true
|
||||||
|
// this.$nextTick(() => {
|
||||||
|
// this.$refs.orderAdd.init()
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
},
|
||||||
|
otherMethods(val) {
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.addOrEditTitle = '详情';
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init(val.data.id, true);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
@ -0,0 +1,302 @@
|
|||||||
|
<!--
|
||||||
|
filename: ProcessBomList.vue
|
||||||
|
author: liubin
|
||||||
|
date: 2023-10-20 15:00:58
|
||||||
|
description:
|
||||||
|
-->
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section class="process-bom">
|
||||||
|
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" />
|
||||||
|
<!-- <small-title :no-padding="true">
|
||||||
|
设备名称: {{ name }}
|
||||||
|
</small-title> -->
|
||||||
|
<div class="btns" style="
|
||||||
|
text-align: right;
|
||||||
|
position: absolute;
|
||||||
|
top: 20px;
|
||||||
|
right: 20px;
|
||||||
|
display: flex;
|
||||||
|
">
|
||||||
|
<!-- <el-input icon="el-icon-search" placeholder="搜索" v-model="searchText" style="margin-left: 20px">
|
||||||
|
<i slot="prefix" class="el-input__icon el-icon-search"></i>
|
||||||
|
</el-input>
|
||||||
|
<el-button type="primary" plain :disabled="currentDet == null" class="btn-create" icon="el-icon-plus">
|
||||||
|
分配设备
|
||||||
|
</el-button> -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<el-row>
|
||||||
|
<div style="margin-bottom: 10px;font-size: 16px;">设备名称:{{ name }}</div>
|
||||||
|
<el-col class="custom-tabs">
|
||||||
|
<el-tabs v-model="activeName" :stretch="true" @tab-click="handleTabClick">
|
||||||
|
<el-tab-pane :label="'\u2002物料追溯\u2002'" name="material">
|
||||||
|
<!-- 列表 -->
|
||||||
|
<base-table class="base-table__margin" :table-props="materialTableProps" :page="1" :limit="10"
|
||||||
|
:table-data="materialList" @emitFun="handleEmitFun"></base-table>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane :label="'\u3000参数追溯\u3000'" name="value" style="overflow: inherit">
|
||||||
|
<base-table class="base-table__margin" :table-props="valueTableProps" :page="1" :limit="10"
|
||||||
|
:table-data="valueList" @emitFun="handleEmitFun"></base-table>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<!-- 分页组件 -->
|
||||||
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList" />
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// import SmallTitle from './SmallTitle';
|
||||||
|
import {
|
||||||
|
getDetMaterial,
|
||||||
|
getDetValue
|
||||||
|
} from '@/api/quality/processTraceabilityDetail';
|
||||||
|
import StatusBtn from './statusBtn.vue'
|
||||||
|
export default {
|
||||||
|
name: 'ProcessBom',
|
||||||
|
components: {
|
||||||
|
// SmallTitle
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
currentDet: {
|
||||||
|
type: Object,
|
||||||
|
default: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
detId:undefined,
|
||||||
|
activeName: 'material',
|
||||||
|
searchBarFormConfig: [{ label: '设备参数及物料追溯' },
|
||||||
|
{
|
||||||
|
type: 'datePicker',
|
||||||
|
label: '时间段',
|
||||||
|
dateType: 'daterange', // datetimerange
|
||||||
|
// format: 'yyyy-MM-dd HH:mm:ss',
|
||||||
|
format: 'yyyy-MM-dd',
|
||||||
|
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||||
|
rangeSeparator: '-',
|
||||||
|
startPlaceholder: '开始日期',
|
||||||
|
endPlaceholder: '结束日期',
|
||||||
|
defaultTime: ['00:00:00', '23:59:59'],
|
||||||
|
param: 'timeVal',
|
||||||
|
// width: 350,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '查询',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},],
|
||||||
|
materialTableProps: [
|
||||||
|
// {
|
||||||
|
// prop: 'createTime',
|
||||||
|
// label: '添加时间',
|
||||||
|
// fixed: true,
|
||||||
|
// width: 180,
|
||||||
|
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||||
|
// },
|
||||||
|
{ prop: 'name', label: '物料名称' },
|
||||||
|
{ prop: 'planNum', label: '预计使用数量' },
|
||||||
|
{ prop: 'actualNum', label: '实际使用数量' },
|
||||||
|
],
|
||||||
|
name:null,
|
||||||
|
materialList: [],
|
||||||
|
valueTableProps: [
|
||||||
|
// {
|
||||||
|
// prop: 'createTime',
|
||||||
|
// label: '添加时间',
|
||||||
|
// fixed: true,
|
||||||
|
// width: 180,
|
||||||
|
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||||
|
// },
|
||||||
|
{ prop: 'name', label: '参数名' },
|
||||||
|
{
|
||||||
|
prop: 'name', label: '设定范围最小- 最大 / 标准',
|
||||||
|
subcomponent: StatusBtn
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'code', label: '最小值',
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
prop: 'minValueSet',
|
||||||
|
label: '值'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'minValueAppearTime',
|
||||||
|
label: '出现时间'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'code', label: '最大值',
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
prop: 'maxValueSet',
|
||||||
|
label: '值'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'maxValueAppearTime',
|
||||||
|
label: '出现时间'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'averageValueAppear', label: '平均值',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
valueList: [],
|
||||||
|
total: 0,
|
||||||
|
tableBtn: [],
|
||||||
|
queryParams: {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
},
|
||||||
|
searchText: ''
|
||||||
|
};
|
||||||
|
},
|
||||||
|
// components: {
|
||||||
|
// SmallTitle,
|
||||||
|
// },
|
||||||
|
watch: {
|
||||||
|
currentDet: {
|
||||||
|
handler(val) {
|
||||||
|
if (val != null) {
|
||||||
|
this.getList(val);
|
||||||
|
this.detId = val.detId
|
||||||
|
console.log(val);
|
||||||
|
} else {
|
||||||
|
this.clearList();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
immediate: true,
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleSearchBarBtnClick(val) {
|
||||||
|
console.log(val)
|
||||||
|
getDetMaterial({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
orderId: this.$route.params.orderId,
|
||||||
|
flowDetId: [this.detId],
|
||||||
|
// orderId: this.$route.params.orderId,
|
||||||
|
|
||||||
|
},).then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
})
|
||||||
|
// if (timeVal && timeVal.length > 0) {
|
||||||
|
// this.queryParams.time = timeVal;
|
||||||
|
// } else {
|
||||||
|
// this.queryParams.time = [];
|
||||||
|
// }
|
||||||
|
// await this.handleQuery();
|
||||||
|
},
|
||||||
|
handleEmitFun() { },
|
||||||
|
handleTableBtnClick() { },
|
||||||
|
put(payload) {
|
||||||
|
return this.http(this.updateUrl, 'put', payload);
|
||||||
|
},
|
||||||
|
post(payload) {
|
||||||
|
return this.http(this.addUrl, 'post', payload);
|
||||||
|
},
|
||||||
|
recv(payload) {
|
||||||
|
return this.http(this.pageUrl, 'get', payload);
|
||||||
|
},
|
||||||
|
info(payload) {
|
||||||
|
return this.http(this.infoUrl, 'get', payload);
|
||||||
|
},
|
||||||
|
http(url, method, payload) {
|
||||||
|
return this.$axios({
|
||||||
|
url,
|
||||||
|
method,
|
||||||
|
params: method === 'get' ? payload : null,
|
||||||
|
data: method !== 'get' ? payload : null,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// getList({ detId, detName, detDesc, flowId, sectionName } = {}) {
|
||||||
|
// console.log('get list')
|
||||||
|
|
||||||
|
// },
|
||||||
|
handleTabClick(val) {
|
||||||
|
// console.log(this.activeName);
|
||||||
|
if (this.activeName === 'material') {
|
||||||
|
getDetMaterial({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
orderId: this.$route.params.orderId,
|
||||||
|
flowDetId: [this.detId],
|
||||||
|
// orderId: this.$route.params.orderId,
|
||||||
|
|
||||||
|
},).then((res) => {
|
||||||
|
this.materialList = res.data[0].data
|
||||||
|
this.name = res.data[0].name
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
getDetValue({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
orderId: this.$route.params.orderId,
|
||||||
|
flowDetId: [this.detId],
|
||||||
|
// orderId: this.$route.params.orderId,
|
||||||
|
|
||||||
|
}).then((res) => {
|
||||||
|
this.valueList = res.data[0].data
|
||||||
|
this.name = res.data[0].name
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getList(val) {
|
||||||
|
console.log(val);
|
||||||
|
getDetMaterial({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
orderId: this.$route.params.orderId,
|
||||||
|
flowDetId: [this.detId],
|
||||||
|
}).then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
this.materialList = res.data[0].data
|
||||||
|
this.name = res.data[0].name
|
||||||
|
})
|
||||||
|
},
|
||||||
|
clearList() {
|
||||||
|
this.list = [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.process-bom {
|
||||||
|
position: relative;
|
||||||
|
flex: 1;
|
||||||
|
padding: 12px 20px;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
:deep(.custom-tabs) {
|
||||||
|
.el-tabs__header {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
display: inline-block;
|
||||||
|
transform: translateY(-12px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tabs__content {
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tabs__item {
|
||||||
|
padding-left: 0 !important;
|
||||||
|
padding-right: 0 !important;
|
||||||
|
line-height: 36px !important;
|
||||||
|
height: 36px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,488 @@
|
|||||||
|
<!--
|
||||||
|
filename: ProcessGraph.vue
|
||||||
|
author: liubin
|
||||||
|
date: 2023-10-20 15:00:58
|
||||||
|
description:
|
||||||
|
-->
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section class="process-graph">
|
||||||
|
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" />
|
||||||
|
|
||||||
|
<!-- <div class="btns" style="text-align: right; position: absolute; top: 20px; right: 20px">
|
||||||
|
<el-button type="warning" @click="undo" plain v-if="allowUndo" :disabled="!allowUndo" icon="el-icon-back">
|
||||||
|
撤销
|
||||||
|
</el-button>
|
||||||
|
<el-button type="warning" @click="redo" plain v-if="allowRedo" :disabled="!allowRedo">
|
||||||
|
下一步
|
||||||
|
<i class="el-icon-right el-icon--right"></i>
|
||||||
|
</el-button>
|
||||||
|
<el-button class="btn-refresh" @click="handleUpdateLayout" icon="el-icon-refresh">
|
||||||
|
刷新布局</el-button>
|
||||||
|
<el-button type="primary" plain class="btn-create" icon="el-icon-plus" @click="handleAdd">
|
||||||
|
新建工序
|
||||||
|
</el-button>
|
||||||
|
<el-button class="btn-edit" :disabled="currentDet == null" @click="handleEdit">编辑</el-button>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
<div class="process-graph__panel" ref="panel"></div>
|
||||||
|
|
||||||
|
<base-dialog :dialogTitle="title" :dialogVisible="open" width="35%" @close="cancel" @cancel="cancel"
|
||||||
|
@confirm="submitForm">
|
||||||
|
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" />
|
||||||
|
</base-dialog>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { Graph } from '@antv/x6';
|
||||||
|
import ProcessNode, { createProcessNode, CACHE_NAME, getSectionFrom } from './ProcessNode';
|
||||||
|
import DialogForm from '@/components/DialogForm';
|
||||||
|
// import { IdToName } from '@/utils'
|
||||||
|
// if (process - node){
|
||||||
|
|
||||||
|
// }
|
||||||
|
Graph.registerNode('process-node', ProcessNode, true);
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ProcessGraph',
|
||||||
|
components: { DialogForm },
|
||||||
|
props: {},
|
||||||
|
inject: ['getFlowId'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
allowRedo: false,
|
||||||
|
allowUndo: false,
|
||||||
|
graph: null,
|
||||||
|
searchBarFormConfig: [{ label: '工序列表' }],
|
||||||
|
title: '',
|
||||||
|
open: false,
|
||||||
|
form: {
|
||||||
|
name: '', // 工序名称
|
||||||
|
sectionId: '', // 工段id
|
||||||
|
remark: '', // 描述
|
||||||
|
},
|
||||||
|
rows: [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '工序名称',
|
||||||
|
prop: 'name',
|
||||||
|
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
select: true,
|
||||||
|
label: '工段',
|
||||||
|
prop: 'sectionId',
|
||||||
|
url: '/base/core-workshop-section/listAll',
|
||||||
|
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||||
|
bind: {
|
||||||
|
filterable: true,
|
||||||
|
},
|
||||||
|
cache: CACHE_NAME
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
textarea: true,
|
||||||
|
label: '工序说明',
|
||||||
|
prop: 'remark',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
|
updateUrl: '/extend/process-flow-det/update',
|
||||||
|
deleteUrl: '/extend/process-flow-det/delete',
|
||||||
|
addUrl: '/extend/process-flow-det/create',
|
||||||
|
// pageUrl: '/extend/process-flow-det/get',
|
||||||
|
infoUrl: '/extend/process-flow-view/getByFlowId',
|
||||||
|
layout: {
|
||||||
|
id: null,
|
||||||
|
flowId: null,
|
||||||
|
content: '',
|
||||||
|
createTime: null
|
||||||
|
},
|
||||||
|
currentDet: null,
|
||||||
|
currentNode: null
|
||||||
|
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
'form.sectionId': {
|
||||||
|
handler(id) {
|
||||||
|
},
|
||||||
|
immediate: false,
|
||||||
|
},
|
||||||
|
currentDet: {
|
||||||
|
handler(val) {
|
||||||
|
this.$emit('det-selected', val)
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
immediate: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
console.log(this.$route.params.id)
|
||||||
|
this.loadLayout().then(json => {
|
||||||
|
this.initGraph(json)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// mounted () {
|
||||||
|
// },
|
||||||
|
destroyed() {
|
||||||
|
this.graph.dispose();
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.resetLayout();
|
||||||
|
this.graph = null;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
initGraph(json) {
|
||||||
|
const graph = new Graph({
|
||||||
|
container: this.$refs.panel,
|
||||||
|
grid: {
|
||||||
|
size: 10,
|
||||||
|
visible: true,
|
||||||
|
},
|
||||||
|
history: true,
|
||||||
|
selecting: {
|
||||||
|
className: 'my-select'
|
||||||
|
},
|
||||||
|
connecting: {
|
||||||
|
snap: true,
|
||||||
|
allowBlank: false,
|
||||||
|
allowLoop: false,
|
||||||
|
allowNode: false,
|
||||||
|
allowPort: true,
|
||||||
|
allowEdge: false,
|
||||||
|
},
|
||||||
|
panning: true,
|
||||||
|
// scroller: {
|
||||||
|
// enabled: true,
|
||||||
|
// pannable: true,
|
||||||
|
// cursor: '',
|
||||||
|
// width: 800,
|
||||||
|
// height: 200
|
||||||
|
// },
|
||||||
|
mousewheel: {
|
||||||
|
enabled: true,
|
||||||
|
modifiers: ['ctrl', 'meta']
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
graph.fromJSON(json)
|
||||||
|
this.graph = graph;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.registerGraphEvents();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
registerGraphEvents() {
|
||||||
|
const reset = () => {
|
||||||
|
const nodes = this.graph.getNodes();
|
||||||
|
const edges = this.graph.getEdges();
|
||||||
|
this.currentDet = null;
|
||||||
|
this.currentNode = null;
|
||||||
|
|
||||||
|
nodes.forEach(node => {
|
||||||
|
node.attr('container/stroke', '#ccc');
|
||||||
|
});
|
||||||
|
edges.forEach(edge => {
|
||||||
|
edge.attr('line/stroke', '#ccc')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
this.graph.on('node:click', ({ e, x, y, node, view }) => {
|
||||||
|
reset();
|
||||||
|
node.attr('container/stroke', '#0b58ff');
|
||||||
|
const { detId, detName, detDesc, processId, sectionId, sectionName } = node.attrs;
|
||||||
|
this.currentDet = {}
|
||||||
|
this.$set(this.currentDet, 'detId', detId.text)
|
||||||
|
this.$set(this.currentDet, 'sectionId', sectionId.text)
|
||||||
|
this.$set(this.currentDet, 'detName', detName.text)
|
||||||
|
this.$set(this.currentDet, 'detDesc', detDesc.text)
|
||||||
|
this.$set(this.currentDet, 'flowId', processId.text)
|
||||||
|
this.$set(this.currentDet, 'sectionName', sectionName.text)
|
||||||
|
this.currentNode = node
|
||||||
|
});
|
||||||
|
this.graph.on('edge:click', ({ e, x, y, edge, view }) => {
|
||||||
|
// console.log('edge clicked!', edge)
|
||||||
|
reset();
|
||||||
|
edge.attr('line/stroke', '#0b58ff')
|
||||||
|
});
|
||||||
|
this.graph.on('blank:click', ({ e, x, y }) => {x
|
||||||
|
reset();
|
||||||
|
});
|
||||||
|
this.graph.on('node:mouseenter', ({ node }) => {
|
||||||
|
node.addTools({
|
||||||
|
name: 'button-remove',
|
||||||
|
args: {
|
||||||
|
x: '100%',
|
||||||
|
y: 0,
|
||||||
|
offset: { x: 0, y: 0 },
|
||||||
|
onClick: ({ e, cell, view }) => {
|
||||||
|
this.$confirm(
|
||||||
|
'确定删除这个工序吗?',
|
||||||
|
'提示',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}
|
||||||
|
).then(async () => {
|
||||||
|
const id = node.attrs.detId.text;
|
||||||
|
const status = await this.handleDelete(id);
|
||||||
|
if (status) {
|
||||||
|
view.cell.remove();
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
return;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
this.graph.on('node:mouseleave', ({ node }) => {
|
||||||
|
node.removeTools();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
resetLayout() {
|
||||||
|
this.layout = {
|
||||||
|
id: null,
|
||||||
|
flowId: null,
|
||||||
|
content: '',
|
||||||
|
createTime: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
async loadLayout() {
|
||||||
|
const flowId = this.$route.params.id;
|
||||||
|
console.log(flowId)
|
||||||
|
if (!flowId) return { cells: [] }
|
||||||
|
const { code, data } = await this.info({ id: flowId });
|
||||||
|
if (code == 0) {
|
||||||
|
if (data) {
|
||||||
|
this.layout = data;
|
||||||
|
return JSON.parse(data?.content) || { cells: [] };
|
||||||
|
}
|
||||||
|
return { cells: [] };
|
||||||
|
}
|
||||||
|
this.resetLayout();
|
||||||
|
return Promise.reject(this.infoUrl + ' 接口出错!');
|
||||||
|
},
|
||||||
|
|
||||||
|
handleToJson() { },
|
||||||
|
|
||||||
|
handleLoadJson() { },
|
||||||
|
|
||||||
|
handleDumpJson() {
|
||||||
|
if (this.graph) {
|
||||||
|
console.log(JSON.stringify(this.graph.toJSON(), null, 2));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
async handleUpdateLayout() {
|
||||||
|
this.layout.content = JSON.stringify(this.graph.toJSON());
|
||||||
|
let code, data;
|
||||||
|
console.table([this.layout, this.$route.params.id])
|
||||||
|
// 手动刷新布局
|
||||||
|
if (this.layout.id) {
|
||||||
|
({ code, data } = await this.http('/extend/process-flow-view/update', 'put', this.layout));
|
||||||
|
} else {
|
||||||
|
this.layout.flowId = this.$route.params.id;
|
||||||
|
({ code, data } = await this.http('/extend/process-flow-view/create', 'post', this.layout));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (code == 0) {
|
||||||
|
this.$modal.msgSuccess('布局已刷新!')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
name: '', // 工序名称
|
||||||
|
sectionId: '', // 工段id
|
||||||
|
remark: '', // 描述
|
||||||
|
};
|
||||||
|
this.resetForm('form');
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 取消按钮 */
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = '添加工序';
|
||||||
|
},
|
||||||
|
|
||||||
|
handleEdit() {
|
||||||
|
this.form.name = this.currentDet.detName;
|
||||||
|
this.form.sectionId = this.currentDet.sectionId;
|
||||||
|
this.form.remark = this.currentDet.detDesc;
|
||||||
|
this.form.id = this.currentDet.detId;
|
||||||
|
this.title = '编辑工序';
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.open = true;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
async handleDelete(id) {
|
||||||
|
const { code, data } = await this.delete({ id });
|
||||||
|
debugger;
|
||||||
|
if (code == 0) {
|
||||||
|
this.$modal.msgSuccess('成功删除一个工序!');
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs['form'].validate((valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 修改的提交
|
||||||
|
if (this.form.id != null) {
|
||||||
|
this.updateProcess()
|
||||||
|
.then((form) => {
|
||||||
|
const { name, sectionId, remark } = form;
|
||||||
|
getSectionFrom(sectionId).then(sectionName => {
|
||||||
|
// 修改当前node的信息
|
||||||
|
this.currentNode.setAttrs({
|
||||||
|
detName: { text: name },
|
||||||
|
sectionId: { text: sectionId },
|
||||||
|
sectionName: { text: sectionName },
|
||||||
|
detDesc: { text: remark }
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch(err => { });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.createProcess()
|
||||||
|
.then(({ id, name, sectionId, remark, flowId }) => {
|
||||||
|
if (!id) return null;
|
||||||
|
return createProcessNode({
|
||||||
|
flowId: flowId,
|
||||||
|
name, sectionId, remark,
|
||||||
|
id,
|
||||||
|
})
|
||||||
|
}).then(node => {
|
||||||
|
if (!node) {
|
||||||
|
this.$modal.msgError('创建节点失败');
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
this.graph.addNode(node);
|
||||||
|
}).catch(err => {
|
||||||
|
return;
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
updateProcess() {
|
||||||
|
const flowId = this.getFlowId();
|
||||||
|
if (!flowId) {
|
||||||
|
this.$modal.msgError('工艺ID不能为空');
|
||||||
|
return Promise.reject('工艺ID不能为空');
|
||||||
|
}
|
||||||
|
return this.put({ flowId, ...this.form })
|
||||||
|
.then(({ code, data }) => {
|
||||||
|
if (code == 0) {
|
||||||
|
this.$modal.msgSuccess('修改成功');
|
||||||
|
} else {
|
||||||
|
this.$modal.msgError('修改失败');
|
||||||
|
}
|
||||||
|
const formCopy = { ...this.form }
|
||||||
|
this.open = false;
|
||||||
|
return formCopy;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
createProcess() {
|
||||||
|
// const flowId = this.$route.params.id;
|
||||||
|
const flowId = this.getFlowId(); // it also works
|
||||||
|
if (!flowId) {
|
||||||
|
this.$modal.msgError('工艺ID不能为空');
|
||||||
|
return Promise.reject('工艺ID不能为空');
|
||||||
|
}
|
||||||
|
console.log('create process', this.form)
|
||||||
|
// 添加的提交
|
||||||
|
return this.post({ flowId, ...this.form }).then(
|
||||||
|
({ code, data }) => {
|
||||||
|
this.$modal.msgSuccess('新增成功');
|
||||||
|
this.open = false;
|
||||||
|
// this.getList();
|
||||||
|
return {
|
||||||
|
id: data, // 服务器返回的新建的工段id
|
||||||
|
...this.form, // 保存一份 this.form 副本,当 open->false 时 this.form 里的信息就清空了
|
||||||
|
flowId
|
||||||
|
};
|
||||||
|
}
|
||||||
|
).catch(err => {
|
||||||
|
this.$modal.msgError(err)
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
put(payload) {
|
||||||
|
return this.http(this.updateUrl, 'put', payload);
|
||||||
|
},
|
||||||
|
post(payload) {
|
||||||
|
return this.http(this.addUrl, 'post', payload);
|
||||||
|
},
|
||||||
|
recv(payload) {
|
||||||
|
return this.http(this.pageUrl, 'get', payload);
|
||||||
|
},
|
||||||
|
info(payload) {
|
||||||
|
return this.http(this.infoUrl, 'get', payload);
|
||||||
|
},
|
||||||
|
delete({ id }) {
|
||||||
|
return this.$axios({
|
||||||
|
url: this.deleteUrl + `?id=${id}`,
|
||||||
|
method: 'delete',
|
||||||
|
});
|
||||||
|
},
|
||||||
|
http(url, method, payload) {
|
||||||
|
return this.$axios({
|
||||||
|
url,
|
||||||
|
method,
|
||||||
|
params: method === 'get' ? payload : null,
|
||||||
|
data: method !== 'get' ? payload : null,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.process-graph {
|
||||||
|
padding: 12px 20px 20px;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.process-graph__panel {
|
||||||
|
height: 300px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.x6-widget-selection-selected {
|
||||||
|
border: 1px solid red;
|
||||||
|
}
|
||||||
|
|
||||||
|
.my-select {
|
||||||
|
border: 1px solid red;
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,126 @@
|
|||||||
|
<!--
|
||||||
|
filename: ProcessInfo.vue
|
||||||
|
author: liubin
|
||||||
|
date: 2023-10-20 15:00:58
|
||||||
|
description:
|
||||||
|
-->
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section class="process-info">
|
||||||
|
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" />
|
||||||
|
|
||||||
|
<el-row :gutter="24">
|
||||||
|
<el-col :span="6">
|
||||||
|
<InfoItem label="工单名称" :value="form.name" />
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<InfoItem label="工艺名称" :value="form.processFlowName" />
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<InfoItem label="产品名称" :value="form.productName" />
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<InfoItem label="产品规格" />
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
const InfoItem = {
|
||||||
|
name: 'InfoItem',
|
||||||
|
components: {},
|
||||||
|
props: ['label', 'value'],
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
methods: {},
|
||||||
|
render: function (h) {
|
||||||
|
return (
|
||||||
|
<div style="display: flex; align-items: center; font-size: 14px; line-height: 1.5">
|
||||||
|
<span style="width: 100px; text-align: left; font-weight: 700">{this.label}:</span>
|
||||||
|
<span style="width: 200px; text-align: left; text-overflow: ellipse; white-space: nowrap">
|
||||||
|
{this.value}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ProcessInfo',
|
||||||
|
components: { InfoItem },
|
||||||
|
props: {},
|
||||||
|
inject: ['getFlowId'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
infoUrl: '/extend/process-flow/get',
|
||||||
|
searchBarFormConfig: [{ label: '工艺详情' }],
|
||||||
|
form: {
|
||||||
|
id: null,
|
||||||
|
name: null,
|
||||||
|
productName: null,
|
||||||
|
processFlowName: null,
|
||||||
|
// remark: null,
|
||||||
|
// enable: null,
|
||||||
|
// code: null
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getInfo()
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
methods: {
|
||||||
|
// utils
|
||||||
|
// http(url, method, payload) {
|
||||||
|
// return this.$axios({
|
||||||
|
// url,
|
||||||
|
// method,
|
||||||
|
// params: method === 'get' ? payload : null,
|
||||||
|
// data: method !== 'get' ? payload : null,
|
||||||
|
// })
|
||||||
|
// },
|
||||||
|
// put(payload) {
|
||||||
|
// return this.http(this.updateUrl, 'put', payload);
|
||||||
|
// },
|
||||||
|
// post(payload) {
|
||||||
|
// return this.http(this.addUrl, 'post', payload);
|
||||||
|
// },
|
||||||
|
// recv(payload) {
|
||||||
|
// return this.http(this.pageUrl, 'get', payload);
|
||||||
|
// },
|
||||||
|
// info(payload) {
|
||||||
|
// return this.http(this.infoUrl, 'get', payload);
|
||||||
|
// },
|
||||||
|
async getInfo() {
|
||||||
|
this.form.name = this.$route.params.name
|
||||||
|
this.form.productName = this.$route.params.productName
|
||||||
|
this.form.processFlowName = this.$route.params.processFlowName
|
||||||
|
// this.form.name = this.$route.params.name
|
||||||
|
// const flowId = this.$route.params.id;
|
||||||
|
// console.log(flowId);
|
||||||
|
// if (!flowId) this.$router.go(-1);
|
||||||
|
// const { code, data } = await this.info({ id: flowId });
|
||||||
|
// // debugger;
|
||||||
|
// if (code == 0) {
|
||||||
|
// this.form = {
|
||||||
|
// ...data
|
||||||
|
// };
|
||||||
|
// } else {
|
||||||
|
// this.$modal.msgError('工艺信息获取失败')
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.process-info {
|
||||||
|
padding: 12px 20px 20px;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,170 @@
|
|||||||
|
import { Node, ObjectExt, Shape } from '@antv/x6';
|
||||||
|
import { IdToName } from '@/utils'
|
||||||
|
import cache from '@/utils/cache'
|
||||||
|
import axios from '@/utils/request'
|
||||||
|
import { v4 } from 'uuid'
|
||||||
|
|
||||||
|
Shape.Edge.config({
|
||||||
|
attrs: {
|
||||||
|
line: {
|
||||||
|
stroke: '#ccc',
|
||||||
|
strokeWidth: 1,
|
||||||
|
targetMarker: {
|
||||||
|
name: 'block',
|
||||||
|
width: 1,
|
||||||
|
height: 1
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
export default class ProcessNode extends Node { }
|
||||||
|
ProcessNode.config({
|
||||||
|
width: 200,
|
||||||
|
height: 100,
|
||||||
|
markup: [
|
||||||
|
{
|
||||||
|
tagName: 'rect',
|
||||||
|
selector: 'container',
|
||||||
|
attrs: {
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: 200,
|
||||||
|
height: 100,
|
||||||
|
fill: 'transparent',
|
||||||
|
stroke: '#ccc'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
tagName: 'rect',
|
||||||
|
attrs: {
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: 200,
|
||||||
|
height: 50,
|
||||||
|
fill: '#ffffff',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
tagName: 'rect',
|
||||||
|
attrs: {
|
||||||
|
x: 0,
|
||||||
|
y: 50,
|
||||||
|
width: 200,
|
||||||
|
height: 50,
|
||||||
|
fill: '#f8f8f8',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
tagName: 'text',
|
||||||
|
selector: 'detName',
|
||||||
|
attrs: {
|
||||||
|
x: 20,
|
||||||
|
y: 30,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
tagName: 'text',
|
||||||
|
selector: 'sectionName',
|
||||||
|
attrs: {
|
||||||
|
x: 115,
|
||||||
|
y: 30,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
tagName: 'text',
|
||||||
|
selector: 'detDesc',
|
||||||
|
attrs: {
|
||||||
|
x: 26,
|
||||||
|
y: 80,
|
||||||
|
fill: '#777',
|
||||||
|
fontSize: 14,
|
||||||
|
fill: '#1a90fc',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
attrs: {
|
||||||
|
line: {
|
||||||
|
fill: 'red'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
ports: {
|
||||||
|
groups: {
|
||||||
|
in: {
|
||||||
|
position: 'left',
|
||||||
|
attrs: {
|
||||||
|
circle: {
|
||||||
|
r: 2,
|
||||||
|
magnet: true,
|
||||||
|
stroke: '#0b58ff',
|
||||||
|
strokeWidth: 1,
|
||||||
|
fill: '#0b58ff'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
out: {
|
||||||
|
position: 'right',
|
||||||
|
attrs: {
|
||||||
|
circle: {
|
||||||
|
r: 2,
|
||||||
|
magnet: true,
|
||||||
|
stroke: '#0b58ff',
|
||||||
|
strokeWidth: 1,
|
||||||
|
fill: '#0b58ff'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
propHooks(metadata) {
|
||||||
|
const { detId, detName, detDesc, sectionName, processId, sectionId, ...others } = metadata;
|
||||||
|
// debugger;
|
||||||
|
if (detName) ObjectExt.setByPath(others, 'attrs/detName/text', detName);
|
||||||
|
if (detDesc) ObjectExt.setByPath(others, 'attrs/detDesc/text', detDesc);
|
||||||
|
if (sectionName) ObjectExt.setByPath(others, 'attrs/sectionName/text', sectionName);
|
||||||
|
if (detId) ObjectExt.setByPath(others, 'attrs/detId/text', detId);
|
||||||
|
if (processId) ObjectExt.setByPath(others, 'attrs/processId/text', processId);
|
||||||
|
if (sectionId) ObjectExt.setByPath(others, 'attrs/sectionId/text', sectionId);
|
||||||
|
return others;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export const CACHE_NAME = 'ProcessDetail::section';
|
||||||
|
|
||||||
|
export async function getSectionFrom(sectionId) {
|
||||||
|
const sectionList = await cache.getList(
|
||||||
|
CACHE_NAME,
|
||||||
|
async () => {
|
||||||
|
const { code, data } = await axios(
|
||||||
|
'/base/core-production-line/listAll'
|
||||||
|
);
|
||||||
|
if (code == 0) {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return IdToName(sectionId, sectionList);
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function createProcessNode({ flowId, id, name, sectionId, remark }) {
|
||||||
|
const sectionName = await getSectionFrom(sectionId);
|
||||||
|
return {
|
||||||
|
shape: 'process-node',
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
detName: name, // 工序名称
|
||||||
|
sectionName, // 工段
|
||||||
|
sectionId,
|
||||||
|
detDesc: remark, // 工序说明
|
||||||
|
processId: flowId, // 工艺ID
|
||||||
|
detId: id, // 工序ID
|
||||||
|
tools: [],
|
||||||
|
ports: [
|
||||||
|
{ id: v4(), group: 'in' },
|
||||||
|
{ id: v4(), group: 'out' },
|
||||||
|
]
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function createEdge(src, dest) { }
|
@ -0,0 +1,72 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zhp
|
||||||
|
* @Date: 2023-11-09 16:32:21
|
||||||
|
* @LastEditTime: 2023-11-09 16:32:21
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<!--
|
||||||
|
* @Author: zhp
|
||||||
|
* @Date: 2023-11-07 19:28:13
|
||||||
|
* @LastEditTime: 2023-11-08 14:11:43
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @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: 18px;
|
||||||
|
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>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user