Compare commits
217 Commits
8b88d6a9b9
...
d70887fef0
Author | SHA1 | Date | |
---|---|---|---|
d70887fef0 | |||
7bc5947a43 | |||
4801287c01 | |||
57071bc24a | |||
40ff565b92 | |||
300a33dca4 | |||
6f937e1976 | |||
b315564489 | |||
|
aa582495de | ||
|
6adbdac0a4 | ||
135d9f0a60 | |||
|
e211e585af | ||
|
630e7a95b3 | ||
395a6e2967 | |||
8fcf6516a3 | |||
c339e5c2de | |||
|
75309dd9ea | ||
|
a0a9107863 | ||
|
94886eedde | ||
cb3406fac3 | |||
0c5245ef9b | |||
1ea2fe2738 | |||
549d66f753 | |||
ca129f5434 | |||
b5049b22fa | |||
|
a4994ca5ae | ||
|
448467ed61 | ||
5af67b93fb | |||
73928a0ed0 | |||
3d33912eff | |||
|
db2cbb64c9 | ||
|
67948c10cb | ||
60864e7110 | |||
e3133cef1f | |||
efdf1f5b54 | |||
|
eba9d2ba60 | ||
|
6b96f84150 | ||
7de46a583f | |||
526bb8c534 | |||
7b4cd85ba0 | |||
57660ee5fd | |||
764030a8da | |||
2d7fc02e0b | |||
d2e38be1e1 | |||
26d2e2b7e5 | |||
25f3c5d13b | |||
|
0256306c0e | ||
|
224625e10f | ||
e55198974d | |||
|
680f852057 | ||
|
6025c8fbf7 | ||
a4f5e75d3d | |||
|
149ec4c844 | ||
|
8045c303ee | ||
3aee4a54fb | |||
bf700b316e | |||
|
4c9277b361 | ||
|
0457514f1e | ||
b23d7427bd | |||
|
3be7ac4237 | ||
|
bddb182b73 | ||
a74b3aa30a | |||
|
8f0de8f0ba | ||
|
df75aa04a1 | ||
4531429e83 | |||
|
756ed9772d | ||
|
2e214b52a6 | ||
a42f976127 | |||
|
a81f961aca | ||
|
39493549b9 | ||
79394affb5 | |||
|
2c06d68d72 | ||
|
e6e280c930 | ||
354fd488a9 | |||
|
a80ce13de1 | ||
|
a027c4ca63 | ||
267ee0015c | |||
9a6aa75171 | |||
41b79ba82c | |||
|
0a1175075d | ||
|
50cfcc3af2 | ||
d44f76b641 | |||
ac36dea881 | |||
|
063532567b | ||
873653b56d | |||
|
b2c6a5fae9 | ||
|
17b675cd13 | ||
|
3aa3361559 | ||
|
6df8c3bcc1 | ||
|
da0aa4aa75 | ||
3b6483f013 | |||
|
e509722ac4 | ||
|
48e7612a78 | ||
679f31af97 | |||
|
f685a65a1f | ||
|
d8c126fccf | ||
4f14b32a83 | |||
f378347063 | |||
6452b6a12c | |||
151df54032 | |||
4c41d6fad9 | |||
9beca01fef | |||
c66e82b152 | |||
38668fca09 | |||
20bf8c27f0 | |||
afe28d103e | |||
889f4472e6 | |||
606a23f10d | |||
5deaa0bc1e | |||
933a4e45a6 | |||
|
7c8c584837 | ||
838c8d66ad | |||
|
93eb12aeb7 | ||
a41db38229 | |||
a822ffe138 | |||
d750cbe0f8 | |||
1318e96d0d | |||
4174feab9e | |||
e0aa0b7052 | |||
ce1971727a | |||
|
f8d033c97a | ||
|
ecb447c052 | ||
dd6f07a9b0 | |||
|
0ba8d3bff8 | ||
|
1a622dc4d3 | ||
2fe3aebe89 | |||
|
bf90cc453d | ||
|
afd6e68d9b | ||
|
c71d99a21e | ||
|
dbbccc7d72 | ||
ac162415c5 | |||
2c87e3f3b8 | |||
529596b923 | |||
2a7bfa2562 | |||
|
520c31a9e1 | ||
|
8e1a1848fb | ||
a00edd8938 | |||
71d1986671 | |||
7287a1f6fa | |||
|
38911a29d2 | ||
|
6490fe3f45 | ||
8abe75a9b9 | |||
44dc55d69f | |||
|
85791cc10c | ||
|
ef740fec27 | ||
5c251e6a25 | |||
a8013fce87 | |||
65e2f9ed6a | |||
ad3a2cb1ae | |||
6d3b41a394 | |||
007cf5e638 | |||
3e89f4066f | |||
2c12a26e64 | |||
c5925e54cd | |||
af426f4bf8 | |||
512986faf6 | |||
b08639f15c | |||
9a807ff798 | |||
|
7da93bbca0 | ||
|
0abf628377 | ||
e78a5e1b85 | |||
|
35da704bb4 | ||
2997f4b7b9 | |||
4316e7f37f | |||
38bb5a31e7 | |||
842b863561 | |||
89e86c31bb | |||
71fc98b0bb | |||
15738642b0 | |||
2c88d442f2 | |||
|
8dccbdbeb7 | ||
|
81c1f2c571 | ||
5dd551c795 | |||
|
a6f7bb2f2d | ||
|
05b513a862 | ||
f72cd9d68e | |||
99b225e3dc | |||
4d1b72fae7 | |||
67a76869e1 | |||
ca2774ca28 | |||
1dd7fef171 | |||
9ad83f84fa | |||
ef354732b4 | |||
478baaabd4 | |||
|
ff19047729 | ||
|
ea7c419c6f | ||
95a4b336f8 | |||
ed65bd7f30 | |||
fd03fdf046 | |||
5b40c3972c | |||
|
d3b87e4051 | ||
|
03ee5e1037 | ||
f8c2889abc | |||
eb0445f479 | |||
9f8d604456 | |||
d5551eabb8 | |||
8ca1ef5624 | |||
564a4a42d2 | |||
8e081342f0 | |||
874e36eb50 | |||
66337f4aca | |||
d21bec434e | |||
ade0f6745e | |||
2ee2b2bfc7 | |||
441a0f5371 | |||
f67930941f | |||
86996f8dd2 | |||
9f82aac931 | |||
ae7b13695a | |||
372749e313 | |||
d0a4dc527f | |||
71aab2df9a | |||
fd7e295975 | |||
da5596766c | |||
3a3e33db0e | |||
49afcb7666 | |||
4a68467d88 |
15
.env.dev
15
.env.dev
@ -1,7 +1,7 @@
|
||||
###
|
||||
# @Author: Do not edit
|
||||
# @Date: 2023-08-29 09:40:39
|
||||
# @LastEditTime: 2024-02-01 16:49:38
|
||||
# @LastEditTime: 2024-03-13 14:57:16
|
||||
# @LastEditors: zhp
|
||||
# @Description:
|
||||
###
|
||||
@ -13,22 +13,19 @@ VUE_APP_TITLE = MES系统
|
||||
|
||||
# 芋道管理系统/开发环境
|
||||
# VUE_APP_BASE_API = 'http://100.64.0.26:48082'
|
||||
VUE_APP_BASE_API = 'http://10.70.2.2:8080'
|
||||
# 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://10.70.2.2:8080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.20:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.49:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.8:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.4.159:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.104: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.0.33:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.62:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.78:48082'
|
||||
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.78:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.47:48082'
|
||||
# socket地址
|
||||
VUE_APP_Socket_API = 'ws://10.70.2.2:8080'
|
||||
VUE_APP_Socket_API = 'ws://192.168.0.30:8888'
|
||||
VUE_APP_Socket_Dcs_API = 'ws://10.70.180.10:8081'
|
||||
|
||||
# 积木报表指向地址
|
||||
|
@ -153,3 +153,12 @@ export function createConCoreWOr(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改分配产量
|
||||
export function updateConCoreWOr(data) {
|
||||
return request({
|
||||
url: '/base/core-order-con-work-order/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
72
src/api/base/orderGroup.js
Normal file
72
src/api/base/orderGroup.js
Normal file
@ -0,0 +1,72 @@
|
||||
import request from '@/utils/request'
|
||||
// 获得集团订单分页
|
||||
export function getOrderGroupPage(query) {
|
||||
return request({
|
||||
url: '/base/order-group/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得集团订单
|
||||
export function getOrderGroup(query) {
|
||||
return request({
|
||||
url: '/base/order-group/get',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 更新集团订单
|
||||
export function updateOrderGroup(data) {
|
||||
return request({
|
||||
url: '/base/order-group/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 创建集团订单
|
||||
export function createOrderGroup(data) {
|
||||
return request({
|
||||
url: '/base/order-group/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改集团订单状态,结束-终止-作废用
|
||||
export function groupOrderStatusSet(data) {
|
||||
return request({
|
||||
url: '/base/order-group/groupOrderStatusSet',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获得集团订单详情
|
||||
export function orderGroupDetail(query) {
|
||||
return request({
|
||||
url: '/base/order-group/getDetail',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 创建集团订单与厂务订单表关联表 一对多
|
||||
export function orderConGroupOrder(data) {
|
||||
return request({
|
||||
url: '/base/order-con-group-order/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 订单监控
|
||||
export function orderGroupMonitor(query) {
|
||||
return request({
|
||||
url: '/base/order-group/orderGroupMonitor',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
@ -8,6 +8,23 @@ export function orderList(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 获得订单列表
|
||||
export function getOrderList(query) {
|
||||
return request({
|
||||
url: '/base/order/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得订单列表
|
||||
export function getFreeOrderList() {
|
||||
return request({
|
||||
url: '/base/order/getFreeOrderList',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 条件获得工单列表
|
||||
export function workOrderList(query) {
|
||||
return request({
|
||||
@ -17,6 +34,15 @@ export function workOrderList(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 条件获得工单列表
|
||||
export function getFreeWOlist(query) {
|
||||
return request({
|
||||
url: '/base/core-work-order/getFreeWOlist',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得订单分页
|
||||
export function getOrderPage(query) {
|
||||
return request({
|
||||
@ -86,6 +112,15 @@ export function orderDelete(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 修改订单状态,结束-终止-作废用
|
||||
export function orderStatusSet(data) {
|
||||
return request({
|
||||
url: '/base/order/orderStatusSet',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 下发订单,绑定的穿工单id,新建不传
|
||||
export function orderIssue(data) {
|
||||
return request({
|
||||
@ -104,24 +139,6 @@ export function getWorkOrderById(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 订单监控
|
||||
export function orderMonitor(query) {
|
||||
return request({
|
||||
url: '/base/order/orderMonitor',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获取订单绑定的工单和数量信息,可传订单id列表,map索引为订单id
|
||||
export function orderAssignmentList(query) {
|
||||
return request({
|
||||
url: '/base/order/orderAssignmentList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得所有客户列表
|
||||
export function customerList() {
|
||||
return request({
|
||||
|
@ -6,3 +6,12 @@ export function getLineAll() {
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据车间获得所有工厂产线列表
|
||||
export function getLinelistByRoom(query) {
|
||||
return request({
|
||||
url: '/base/core-production-line/listFilter',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-04 14:10:37
|
||||
* @LastEditTime: 2023-12-14 10:06:03
|
||||
* @LastEditTime: 2024-03-19 15:02:49
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
@ -26,10 +26,11 @@ export function updateQualityInspectionBoxBtn(data) {
|
||||
}
|
||||
|
||||
// 删除安灯按钮16键对应
|
||||
export function deleteQualityInspectionBoxBtn(id) {
|
||||
export function deleteQualityInspectionBoxBtn(query) {
|
||||
return request({
|
||||
url: '/base/quality-inspection-box-btn/delete?id=' + id,
|
||||
method: 'delete'
|
||||
url: 'base/quality-inspection-box-btn/deleteByLineSection',
|
||||
method: 'delete',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
53
src/api/equipment/base/config/config.js
Normal file
53
src/api/equipment/base/config/config.js
Normal file
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2024-02-21 13:43:02
|
||||
* @LastEditTime: 2024-03-14 19:12:31
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获得关联表名
|
||||
export function getplcAllList(query) {
|
||||
return request({
|
||||
url: '/base/equipment-plc/listAll',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得设备
|
||||
export function getEquipmentList(query) {
|
||||
return request({
|
||||
url: '/base/core-equipment/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 根据产线获得工段
|
||||
export function listByParentId(query) {
|
||||
return request({
|
||||
url: '/base/core-workshop-section/listByParentId',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得产线工段设备树形结构
|
||||
export function getTree(query) {
|
||||
return request({
|
||||
url: '/base/core-factory/getTree',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得设备分组列表
|
||||
export function getgroupAllList(query) {
|
||||
return request({
|
||||
url: '/base/equipment-group/listAll',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-11-08 15:56:52
|
||||
* @LastEditTime: 2023-11-16 20:15:02
|
||||
* @LastEditTime: 2024-02-28 18:16:56
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
@ -52,6 +52,17 @@ export function exportCheckLogExcel(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 导出设备巡检单记录
|
||||
export function exportCheckOrderExcel(query) {
|
||||
return request({
|
||||
url: '/base/equipment-check-order/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 根据设备获得所有巡检配置列表
|
||||
export function getcheckConfigByEqList(query) {
|
||||
return request({
|
||||
@ -68,3 +79,55 @@ export function deleteEqCheckLog(id) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得设备巡检单详情分页
|
||||
export function getCheckOrderDetPage(query) {
|
||||
return request({
|
||||
url: '/base/equipment-check-order-det/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 创建设备巡检单详情
|
||||
export function createCheckOrderDet(data) {
|
||||
return request({
|
||||
url: '/base/equipment-check-order-det/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新设备巡检单详情
|
||||
export function updateCheckOrderDet(data) {
|
||||
return request({
|
||||
url: '/base/equipment-check-order-det/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设备巡检单详情
|
||||
export function deleteCheckOrderDet(id) {
|
||||
return request({
|
||||
url: '/base/equipment-check-order-det/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得设备巡检计划单
|
||||
export function getEqCheckOrder(id) {
|
||||
return request({
|
||||
url: '/base/equipment-check-order/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得设备巡检单分页
|
||||
export function getCheckOrderPage(query) {
|
||||
return request({
|
||||
url: '/base/equipment-check-order/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-11-08 15:56:52
|
||||
* @LastEditTime: 2023-11-25 16:22:49
|
||||
* @LastEditTime: 2024-02-25 22:23:54
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
@ -100,3 +100,63 @@ export function updateCheckConfig(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 创建巡检单
|
||||
export function createCheckOrder(data) {
|
||||
return request({
|
||||
url: '/base/equipment-check-order/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新巡检单
|
||||
export function updateCheckOrder(data) {
|
||||
return request({
|
||||
url: '/base/equipment-check-order/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获得设备巡检单code
|
||||
export function getOrderCode() {
|
||||
return request({
|
||||
url: '/base/equipment-check-order/getCode',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得巡检单
|
||||
export function getCheckOrder(id) {
|
||||
return request({
|
||||
url: '/base/equipment-check-order/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得巡检单详细
|
||||
export function getCheckOrderDet(id) {
|
||||
return request({
|
||||
url: '/base/equipment-check-order-det/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 创建巡检单详情
|
||||
export function createCheckOrderDet(data) {
|
||||
return request({
|
||||
url: '/base/equipment-check-order-det/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新巡检单详情
|
||||
export function updateCheckOrderDet(data) {
|
||||
return request({
|
||||
url: '/base/equipment-check-order-det/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
26
src/api/equipment/base/maintain/confirm.js
Normal file
26
src/api/equipment/base/maintain/confirm.js
Normal file
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2024-02-26 15:01:48
|
||||
* @LastEditTime: 2024-02-26 18:09:39
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获得设备保养记录分页
|
||||
export function getLogDetPage(query) {
|
||||
return request({
|
||||
url: '/base/equipment-maintain-log-det/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得设备巡检单
|
||||
export function getCheckOrder(query) {
|
||||
return request({
|
||||
url: '/base/equipment-check-order/get',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
104
src/api/equipment/base/maintain/planconfig.js
Normal file
104
src/api/equipment/base/maintain/planconfig.js
Normal file
@ -0,0 +1,104 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2024-02-22 15:14:19
|
||||
* @LastEditTime: 2024-02-23 19:18:22
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获得设备保养计划配置分页
|
||||
export function getPlanPage(query) {
|
||||
return request({
|
||||
url: '/base/equipment-maintain-plan/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 创建设备保养计划
|
||||
export function createPlan(data) {
|
||||
return request({
|
||||
url: '/base/equipment-maintain-plan/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新设备保养计划
|
||||
export function updatePlan(data) {
|
||||
return request({
|
||||
url: '/base/equipment-maintain-plan/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获得计划code
|
||||
export function getCode() {
|
||||
return request({
|
||||
url: '/base/equipment-maintain-plan/getCode',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得计划
|
||||
export function getPlan(query) {
|
||||
return request({
|
||||
url: '/base/equipment-maintain-plan/get',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得设备保养计划配置详情分页
|
||||
export function getPlanDetPage(query) {
|
||||
return request({
|
||||
url: '/base/equipment-maintain-plan-det/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 创建设备保养计划详情
|
||||
export function createPlanDet(data) {
|
||||
return request({
|
||||
url: '/base/equipment-maintain-plan-det/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新设备保养计划详情
|
||||
export function updatePlanDet(data) {
|
||||
return request({
|
||||
url: '/base/equipment-maintain-plan-det/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获得计划详情
|
||||
export function getPlanDet(query) {
|
||||
return request({
|
||||
url: '/base/equipment-maintain-plan-det/get',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设备保养计划
|
||||
export function deletePlan(id) {
|
||||
return request({
|
||||
url: '/base/equipment-maintain-plan/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设备保养计划详情
|
||||
export function deletePlanDet(id) {
|
||||
return request({
|
||||
url: '/base/equipment-maintain-plan-det/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-11-08 15:56:52
|
||||
* @LastEditTime: 2023-11-23 19:10:07
|
||||
* @LastEditTime: 2024-02-26 17:02:53
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
@ -42,3 +42,39 @@ export function exportMaintainLogExcel(query) {
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出巡检单
|
||||
export function exportCheckOrderExcel(query) {
|
||||
return request({
|
||||
url: '/base/equipment-check-order/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得保养记录
|
||||
export function getLog(query) {
|
||||
return request({
|
||||
url: '/base/equipment-maintain-log/get',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得设备保养记录详情分页
|
||||
export function getLogDetPage(query) {
|
||||
return request({
|
||||
url: '/base/equipment-maintain-log-det/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设备保养记录详情
|
||||
export function deleteLogDet(id) {
|
||||
return request({
|
||||
url: '/base/equipment-maintain-log-det/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2023-10-18 09:33:57
|
||||
* @LastEditTime: 2023-11-03 09:31:17
|
||||
* @LastEditTime: 2024-03-20 15:39:27
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
@ -33,3 +33,12 @@ export function exportEnergyPlcExcel(query) {
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
export function exportEquipmentTraceabilityExcel(query) {
|
||||
return request({
|
||||
url: '/analysis/equipment-analysis/export-efficiency',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:49:02
|
||||
* @LastEditTime: 2024-01-24 15:54:58
|
||||
* @LastEditTime: 2024-03-12 11:16:01
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
|
@ -26,6 +26,13 @@ export function getUser(userId) {
|
||||
})
|
||||
}
|
||||
|
||||
export function getUserSimple(userId) {
|
||||
return request({
|
||||
url: '/system/user/getSimple?id=' + praseStrEmpty(userId),
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增用户
|
||||
export function addUser(data) {
|
||||
return request({
|
||||
|
18
src/assets/icons/svg/info.svg
Normal file
18
src/assets/icons/svg/info.svg
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="25px" height="26px" viewBox="0 0 25 26" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>库位信息</title>
|
||||
<g id="新增看板" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="周转看板" transform="translate(-996.000000, -618.000000)">
|
||||
<g id="编组-26备份-3" transform="translate(972.000000, 596.000000)">
|
||||
<g id="库位信息" transform="translate(24.000000, 22.000000)">
|
||||
<rect id="矩形" x="0" y="0" width="24" height="24"></rect>
|
||||
<g id="信息" transform="translate(1.000000, 2.000000)" fill-rule="nonzero">
|
||||
<rect id="矩形" x="0" y="0" width="24" height="24"></rect>
|
||||
<polygon id="路径" fill="#59D0E2" points="6.87951585 6.64119413 10.014693 6.64119413 10.014693 10.0613874 6.87951585 10.0613874"></polygon>
|
||||
<path d="M19.42625,1.5 L4.57625,1.5 C3.45125001,1.5 2.51375,2.43750001 2.51375,3.56250001 L2.51375,20.4375 C2.51375,21.5625 3.45125001,22.5 4.57625,22.5 L19.46375,22.5 C20.58875,22.5 21.52625,21.5625 21.52625,20.4375 L21.52625,3.56250001 C21.48875,2.43750001 20.58875,1.5 19.42625,1.5 Z M5.66375,6.9375 C5.66375,6.1125 6.33875,5.4375 7.16375,5.4375 L9.63875,5.4375 C10.46375,5.4375 11.13875,6.1125 11.13875,6.9375 L11.13875,9.6375 C11.13875,10.4625 10.46375,11.1375 9.63875,11.1375 L7.16375,11.1375 C6.33875,11.1375 5.66375,10.4625 5.66375,9.6375 L5.66375,6.9375 Z M17.58875,18.5625 L6.41375001,18.5625 C6.00125002,18.5625 5.66375,18.225 5.66375,17.8125 C5.66375,17.4 6.00125,17.0625 6.41375001,17.0625 L17.55125,17.0625 C17.96375,17.0625 18.30125,17.4 18.30125,17.8125 C18.30125,18.225 18.00125,18.5625 17.58875,18.5625 Z M17.58875,15.1875 L6.41375001,15.1875 C6.00125002,15.1875 5.66375,14.85 5.66375,14.4375 C5.66375,14.025 6.00125,13.6875 6.41375001,13.6875 L17.55125,13.6875 C17.96375,13.6875 18.30125,14.025 18.30125,14.4375 C18.30125,14.85 18.00125,15.1875 17.58875,15.1875 Z M17.58875,10.65 L13.83875,10.65 C13.42625,10.65 13.08875,10.3125 13.08875,9.90000001 C13.08875,9.48750002 13.42625,9.14999999 13.83875,9.14999999 L17.58875,9.14999999 C18.00125,9.14999999 18.33875,9.48749999 18.33875,9.90000001 C18.33875,10.3125 18.00125,10.65 17.58875,10.65 Z M17.58875,7.425 L13.83875,7.425 C13.42625,7.425 13.08875,7.08750001 13.08875,6.675 C13.08875,6.26249998 13.42625,5.925 13.83875,5.925 L17.58875,5.925 C18.00125,5.925 18.33875,6.2625 18.33875,6.675 C18.33875,7.08749999 18.00125,7.425 17.58875,7.425 Z" id="形状" fill="#59D0E2"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.7 KiB |
24
src/assets/icons/svg/task.svg
Normal file
24
src/assets/icons/svg/task.svg
Normal file
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>搬运任务</title>
|
||||
<g id="新增看板" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="周转看板" transform="translate(-64.000000, -149.000000)">
|
||||
<g id="编组-26" transform="translate(40.000000, 127.000000)">
|
||||
<g id="搬运任务" transform="translate(24.000000, 22.000000)">
|
||||
<rect id="矩形" x="0" y="0" width="24" height="24"></rect>
|
||||
<g id="异常" transform="translate(1.000000, 2.000000)" fill-rule="nonzero">
|
||||
<rect id="矩形" fill="#000000" opacity="0" x="2" y="1" width="17" height="17"></rect>
|
||||
<g>
|
||||
<rect id="矩形" fill="#000000" opacity="0" x="5" y="6" width="13" height="13"></rect>
|
||||
<g id="数量_面性">
|
||||
<rect id="矩形" fill="#000000" opacity="0" x="2" y="2" width="16" height="16"></rect>
|
||||
<path d="M11.5012639,11 C11.3917412,11 11.2835161,10.977151 11.184033,10.9329979 L0.441155372,6.16366481 C0.172262497,6.04432342 -1.77635684e-15,5.78507176 -1.77635684e-15,5.49973467 C-1.77635684e-15,5.21439758 0.172262497,4.95514592 0.441155372,4.83580453 L11.184033,0.066471464 C11.3846433,-0.0221571547 11.6153567,-0.0221571547 11.815967,0.066471464 L22.5588446,4.83580453 C22.8277375,4.95514592 23,5.21439758 23,5.49973467 C23,5.78507176 22.8277375,6.04432342 22.5588446,6.16366481 L11.815967,10.9329979 C11.7172585,10.9768087 11.6099339,10.9996587 11.5012639,11 L11.5012639,11 Z M22,14 L11.5,18.4986025 L1,14 L1,15.5733794 L11.1785976,19.935011 C11.3818459,20.021663 11.6155931,20.021663 11.8188415,19.935011 L22,15.5733794 L22,14 Z" id="形状" fill="#59D0E2"></path>
|
||||
<path d="M22,9 L11.5,13.4953318 L1,9 L1,10.5789585 L11.1785976,14.9350754 C11.3818459,15.0216415 11.6155931,15.0216415 11.8188415,14.9350754 L22,10.5789585 L22,9 Z" id="路径" fill="#59D0E2"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.3 KiB |
24
src/assets/icons/svg/tasks.svg
Normal file
24
src/assets/icons/svg/tasks.svg
Normal file
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>搬运任务</title>
|
||||
<g id="新增看板" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="周转看板" transform="translate(-64.000000, -149.000000)">
|
||||
<g id="编组-26" transform="translate(40.000000, 127.000000)">
|
||||
<g id="搬运任务" transform="translate(24.000000, 22.000000)">
|
||||
<rect id="矩形" x="0" y="0" width="24" height="24"></rect>
|
||||
<g id="异常" transform="translate(1.000000, 2.000000)" fill-rule="nonzero">
|
||||
<rect id="矩形" fill="#000000" opacity="0" x="2" y="1" width="17" height="17"></rect>
|
||||
<g>
|
||||
<rect id="矩形" fill="#000000" opacity="0" x="5" y="6" width="13" height="13"></rect>
|
||||
<g id="数量_面性">
|
||||
<rect id="矩形" fill="#000000" opacity="0" x="2" y="2" width="16" height="16"></rect>
|
||||
<path d="M11.5012639,11 C11.3917412,11 11.2835161,10.977151 11.184033,10.9329979 L0.441155372,6.16366481 C0.172262497,6.04432342 -1.77635684e-15,5.78507176 -1.77635684e-15,5.49973467 C-1.77635684e-15,5.21439758 0.172262497,4.95514592 0.441155372,4.83580453 L11.184033,0.066471464 C11.3846433,-0.0221571547 11.6153567,-0.0221571547 11.815967,0.066471464 L22.5588446,4.83580453 C22.8277375,4.95514592 23,5.21439758 23,5.49973467 C23,5.78507176 22.8277375,6.04432342 22.5588446,6.16366481 L11.815967,10.9329979 C11.7172585,10.9768087 11.6099339,10.9996587 11.5012639,11 L11.5012639,11 Z M22,14 L11.5,18.4986025 L1,14 L1,15.5733794 L11.1785976,19.935011 C11.3818459,20.021663 11.6155931,20.021663 11.8188415,19.935011 L22,15.5733794 L22,14 Z" id="形状" fill="#59D0E2"></path>
|
||||
<path d="M22,9 L11.5,13.4953318 L1,9 L1,10.5789585 L11.1785976,14.9350754 C11.3818459,15.0216415 11.6155931,15.0216415 11.8188415,14.9350754 L22,10.5789585 L22,9 Z" id="路径" fill="#59D0E2"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.3 KiB |
Binary file not shown.
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 22 KiB |
@ -360,8 +360,9 @@ export default {
|
||||
promiseList.push(async () => {
|
||||
const response = await this.$axios(opt.url, {
|
||||
method: opt.method ?? 'get',
|
||||
// data: opt.method == 'post' ? opt.queryParams : null
|
||||
});
|
||||
console.log('[dialogForm:handleOptions:response]', response);
|
||||
// console.log('[dialogForm:handleOptions:response]', response);
|
||||
if (opt.select) {
|
||||
// 处理下拉框选项
|
||||
const list =
|
||||
|
@ -26,7 +26,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import moment from 'moment'
|
||||
import { getUser } from "@/api/system/user.js";
|
||||
import { getUserSimple } from "@/api/system/user.js";
|
||||
import {getPath} from "@/utils/ruoyi";
|
||||
export default {
|
||||
name: 'navRight',
|
||||
@ -67,8 +67,8 @@ export default {
|
||||
},
|
||||
getUserMsg() {
|
||||
let id = this.$store.getters.userId
|
||||
getUser(id).then(res => {
|
||||
this.dept = res.data.dept ? res.data.dept.name : ''
|
||||
getUserSimple(id).then(res => {
|
||||
this.dept = res.data.deptName ? res.data.deptName : '---'
|
||||
})
|
||||
},
|
||||
async logout() {
|
||||
|
@ -106,6 +106,8 @@ export default {
|
||||
case 'detail':
|
||||
this.handleDetail(data);
|
||||
break;
|
||||
default:
|
||||
this.handleTableActions({data, type});
|
||||
}
|
||||
},
|
||||
// 处理搜索栏按钮
|
||||
@ -133,10 +135,13 @@ export default {
|
||||
this.$refs['search-bar'].resetForm();
|
||||
this.resetQuery();
|
||||
break;
|
||||
default:
|
||||
this.searchBarClicked(btn);
|
||||
break;
|
||||
}
|
||||
},
|
||||
handleEmitFun(val) {
|
||||
console.log('emit unf', val);
|
||||
console.log('[basicPageMixin handleEmitFun]', val);
|
||||
switch (val.action) {
|
||||
// 查看详情
|
||||
case 'show-detail':
|
||||
|
@ -87,6 +87,7 @@ const user = {
|
||||
// 获取用户信息
|
||||
GetInfo({ commit, state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log('GetInfo')
|
||||
getInfo().then(res => {
|
||||
// 没有 data 数据,赋予个默认值
|
||||
if (!res) {
|
||||
@ -96,7 +97,7 @@ const user = {
|
||||
user: {
|
||||
id: '',
|
||||
avatar: '',
|
||||
userName: '',
|
||||
username: '',
|
||||
nickname: ''
|
||||
}
|
||||
}
|
||||
@ -113,7 +114,7 @@ const user = {
|
||||
commit('SET_ROLES', ['ROLE_DEFAULT'])
|
||||
}
|
||||
commit('SET_ID', user.id)
|
||||
commit('SET_NAME', user.userName)
|
||||
// commit('SET_NAME', user.username) //无效调用,接口未提供username值
|
||||
commit('SET_NICKNAME', user.nickname)
|
||||
commit('SET_AVATAR', avatar)
|
||||
resolve(res)
|
||||
|
@ -108,12 +108,17 @@ export const DICT_TYPE = {
|
||||
// ============== EQUIPMENT - 设备模块 =============
|
||||
MAINTAIN_TYPE: 'maintain_type',
|
||||
FAULT_LEVEL: 'fault-level',
|
||||
FAULT_TYPE: 'fault-type',
|
||||
REPAIR_MODE: 'repair-mode',
|
||||
REPAIR_RESULT: 'repair-result',
|
||||
|
||||
// ============== ENVIRONMENTAL - 环保模块 =============
|
||||
ENVIRONMENT_CHECK_UNIT: 'environment_check_unit',
|
||||
|
||||
// ============== GROUP - 班组模块 =============
|
||||
WORK_SHOP: 'workshop'
|
||||
WORK_SHOP: 'workshop',
|
||||
// ============== GROUP - 质量模块 =============
|
||||
MATERIAL_GRADE: 'material_grade'
|
||||
}
|
||||
|
||||
/**
|
||||
|
4
src/utils/equipment-module.js
Normal file
4
src/utils/equipment-module.js
Normal file
@ -0,0 +1,4 @@
|
||||
import { getDictData } from './dict';
|
||||
|
||||
export const groupConnectWorkshop = (groupName, workshopValue) =>
|
||||
`${groupName} - ${getDictData('workshop', workshopValue)?.label}`;
|
@ -1,10 +1,10 @@
|
||||
import axios from 'axios'
|
||||
import {Message, MessageBox, Notification, Loading} from 'element-ui'
|
||||
import { Message, MessageBox, Notification, Loading } from 'element-ui'
|
||||
import store from '@/store'
|
||||
import {getAccessToken, getRefreshToken, getTenantId, setToken} from '@/utils/auth'
|
||||
import { getAccessToken, getRefreshToken, getTenantId, setToken } from '@/utils/auth'
|
||||
import errorCode from '@/utils/errorCode'
|
||||
import {getPath, getTenantEnable} from "@/utils/ruoyi";
|
||||
import {refreshToken} from "@/api/login";
|
||||
import { getPath, getTenantEnable } from "@/utils/ruoyi";
|
||||
import { refreshToken } from "@/api/login";
|
||||
|
||||
// 需要忽略的提示。忽略后,自动 Promise.reject('error')
|
||||
const ignoreMsgs = [
|
||||
@ -42,7 +42,7 @@ const service = axios.create({
|
||||
let loadingInstance = null
|
||||
function startLoading() {
|
||||
loadingInstance = Loading.service({
|
||||
fullscreen: false,
|
||||
fullscreen: true,
|
||||
text: '拼命加载中...',
|
||||
background: 'rgba(0, 0, 0, 0.1)'
|
||||
})
|
||||
@ -86,7 +86,7 @@ service.interceptors.request.use(config => {
|
||||
for (const propName of Object.keys(config.params)) {
|
||||
const value = config.params[propName];
|
||||
const part = encodeURIComponent(propName) + '='
|
||||
if (value !== null && typeof(value) !== "undefined") {
|
||||
if (value !== null && typeof (value) !== "undefined") {
|
||||
if (typeof value === 'object') {
|
||||
for (const key of Object.keys(value)) {
|
||||
let params = propName + '[' + key + ']';
|
||||
@ -104,9 +104,9 @@ service.interceptors.request.use(config => {
|
||||
}
|
||||
return config
|
||||
}, error => {
|
||||
tryHideFullScreenLoading()
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
tryHideFullScreenLoading()
|
||||
console.log(error)
|
||||
Promise.reject(error)
|
||||
})
|
||||
|
||||
// 响应拦截器
|
||||
@ -189,23 +189,23 @@ service.interceptors.response.use(async res => {
|
||||
return res.data
|
||||
}
|
||||
}, error => {
|
||||
tryHideFullScreenLoading()
|
||||
console.log('err' + error)
|
||||
let {message} = error;
|
||||
if (message === "Network Error") {
|
||||
message = "后端接口连接异常";
|
||||
} else if (message.includes("timeout")) {
|
||||
message = "系统接口请求超时";
|
||||
} else if (message.includes("Request failed with status code")) {
|
||||
message = "系统接口" + message.substr(message.length - 3) + "异常";
|
||||
}
|
||||
Message({
|
||||
message: message,
|
||||
type: 'error',
|
||||
duration: 5 * 1000
|
||||
})
|
||||
return Promise.reject(error)
|
||||
tryHideFullScreenLoading()
|
||||
console.log('err' + error)
|
||||
let { message } = error;
|
||||
if (message === "Network Error") {
|
||||
message = "后端接口连接异常";
|
||||
} else if (message.includes("timeout")) {
|
||||
message = "系统接口请求超时";
|
||||
} else if (message.includes("Request failed with status code")) {
|
||||
message = "系统接口" + message.substr(message.length - 3) + "异常";
|
||||
}
|
||||
Message({
|
||||
message: message,
|
||||
type: 'error',
|
||||
duration: 5 * 1000
|
||||
})
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
export function getBaseHeader() {
|
||||
@ -219,10 +219,10 @@ function handleAuthorized() {
|
||||
if (!isRelogin.show) {
|
||||
isRelogin.show = true;
|
||||
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
|
||||
confirmButtonText: '重新登录',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}
|
||||
confirmButtonText: '重新登录',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}
|
||||
).then(() => {
|
||||
isRelogin.show = false;
|
||||
store.dispatch('LogOut').then(() => {
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-07-19 15:18:30
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-02-01 15:35:10
|
||||
* @LastEditTime: 2024-03-12 09:05:20
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -29,13 +29,13 @@
|
||||
<el-row class="container-main flex-col" type="flex">
|
||||
<el-row :style="{ padding: '0 ' + 9 + 'px' }" :gutter="15 * beilv" type="flex" class="flex-1">
|
||||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="12">
|
||||
<base-container :beilv="1" :size="'middle'" :title="'搬运任务'" :title-icon="'5_1'" :back="'energy'">
|
||||
<base-container :beilv="1" :size="'middle'" :title="'搬运任务'" :title-icon="'task'" :back="'energy'">
|
||||
<base-table1 :page="1" :limit="999" :show-index="false" :beilv="1" :table-config="qualityYearTableProps"
|
||||
:table-data="qualityYearList" />
|
||||
</base-container>
|
||||
</el-col>
|
||||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="12">
|
||||
<base-container :beilv="1" :size="'middle'" :title="'周转进度'" :title-icon="'5_3'" :back="'energy'">
|
||||
<base-container :beilv="1" :size="'middle'" :title="'周转进度'" :title-icon="'order'" :back="'energy'">
|
||||
<!-- <div style="width: 45%;position: absolute; top: 3em; right: 3em;">
|
||||
<top-radio-group />
|
||||
</div> -->
|
||||
@ -87,7 +87,7 @@
|
||||
|
||||
<el-row :style="{ padding: '0 ' + 9 + 'px' }" :gutter="12 * beilv" type="flex" class="flex-1">
|
||||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="12">
|
||||
<base-container :beilv="1" :height="256" :size="'middle'" :title="'库存管理'" :title-icon="'5_5'"
|
||||
<base-container :beilv="1" :height="256" :size="'middle'" :title="'库存管理'" :title-icon="'productLine'"
|
||||
:back="'energy'">
|
||||
<!-- <div style="width: 45%;position: absolute; top: 3em; right: 3em;">
|
||||
<top-radio-group />
|
||||
@ -110,7 +110,7 @@
|
||||
</base-container>
|
||||
</el-col>
|
||||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="12">
|
||||
<base-container :beilv="1" :height="318 + 338 + 16" :size="'middle'" :title="'库位信息'" :title-icon="'5_4'"
|
||||
<base-container :beilv="1" :height="318 + 338 + 16" :size="'middle'" :title="'库位信息'" :title-icon="'info'"
|
||||
:back="'energy'">
|
||||
<!-- <div style="width: 45%;position: absolute; top: 3em; right: 3em;">
|
||||
<top-radio-group />
|
||||
@ -715,6 +715,7 @@ export default {
|
||||
qualityMonthTableProps,
|
||||
modelMonth: '',
|
||||
qualityList1,
|
||||
// logoutTime: 43200000,
|
||||
qualityTableProps2,
|
||||
qualityList2,
|
||||
dateType: '0',
|
||||
@ -869,6 +870,8 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
|
||||
.visual-container {
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
@ -885,14 +888,16 @@ export default {
|
||||
position: relative;
|
||||
.unit{
|
||||
position: absolute;
|
||||
left: 260px;
|
||||
left: 290px;
|
||||
top:25px;
|
||||
color: rgba($color: #ffffff, $alpha: 8);
|
||||
font-size: 20px;
|
||||
}
|
||||
.time{
|
||||
position: absolute;
|
||||
left: 1360px;
|
||||
top:25px;
|
||||
color: rgba($color: #ffffff, $alpha: 8);
|
||||
font-size: 20px;
|
||||
}
|
||||
.title-button {
|
||||
@ -992,11 +997,11 @@ export default {
|
||||
min-height: 10px;
|
||||
}
|
||||
|
||||
.el-input__inner {
|
||||
background-color: rgba($color: #31878c, $alpha: 0.29);
|
||||
border: rgba($color: #31878c, $alpha: 0.29);
|
||||
color: aliceblue;
|
||||
}
|
||||
// .el-input__inner {
|
||||
// background-color: rgba($color: #31878c, $alpha: 0.29);
|
||||
// border: rgba($color: #31878c, $alpha: 0.29);
|
||||
// color: aliceblue;
|
||||
// }
|
||||
|
||||
.el-divider--vertical {
|
||||
height: 174px;
|
||||
|
@ -1,17 +1,11 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-01-29 16:50:26
|
||||
* @LastEditTime: 2024-02-01 15:35:43
|
||||
* @LastEditTime: 2024-03-13 09:07:37
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-07-19 15:18:30
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-01-29 17:05:37
|
||||
* @Description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div id="container" ref="container" class="visual-container" :style="styles">
|
||||
<el-row class="container-title" :style="{
|
||||
@ -19,7 +13,7 @@
|
||||
lineHeight: 88 + 'px',
|
||||
fontSize: 31 + 'px'
|
||||
}">
|
||||
<img src="../../assets/img/logo.png" style="width:1.1em;position:relative;top:.4em" alt="">
|
||||
<img src="../../assets/img/logo.png" style="width:1.1em;position:relative;top:.22em" alt="">
|
||||
许昌安彩冷端看板
|
||||
<h3 class="unit">单位:河南汇融数字科技有限公司</h3>
|
||||
<h3 class="time">{{ times }}</h3>
|
||||
@ -341,7 +335,9 @@ export default {
|
||||
// offsetWidth: null,
|
||||
cxNameList,
|
||||
cxDataList,
|
||||
// time:12,
|
||||
cutProps,
|
||||
// logoutTime: 43200000,
|
||||
cutTableDataList:[],
|
||||
clientWidth: 0,
|
||||
containerWidth: 111111,
|
||||
@ -432,36 +428,15 @@ export default {
|
||||
this.beilv2 = _this.clientWidth / 1920
|
||||
})()
|
||||
}
|
||||
// let obj = {
|
||||
// 'a': 11111,
|
||||
// 'b': 22222,
|
||||
// 'c': 33333,
|
||||
// 'd': 44444,
|
||||
// 'e': 55555,
|
||||
// logoutInterval = setInterval(() => {
|
||||
// this.logoutTime -= 1000
|
||||
// }, 1000)
|
||||
// if (this.logoutTime === 0) {
|
||||
// this.SJGInitWebSocket()
|
||||
// this.CutInitWebSocket()
|
||||
// this.funInitWebSocket()
|
||||
// this.logoutTimeReset()
|
||||
// }
|
||||
// let index = 0
|
||||
// for (let i in obj) {
|
||||
// index++,
|
||||
// console.log(index);
|
||||
// }
|
||||
// this.getList()
|
||||
// const _this = this;
|
||||
// window.onresize = () => {
|
||||
// return (() => {
|
||||
// _this.clientWidth = `${document.documentElement.clientWidth}`
|
||||
// this.beilv2 = _this.clientWidth / 1920
|
||||
// })()
|
||||
// }
|
||||
// this.beilv2 = window.innerWidth / 1920
|
||||
// addEventListener('resize', resizeFun = () => {
|
||||
// this.beilv2 = window.innerWidth / 1920
|
||||
// })
|
||||
// erd.listenTo(document, (element) => {
|
||||
// this.beilv2 = element.offsetWidth / 1920
|
||||
|
||||
// // var width = element.offsetWidth;
|
||||
// // var height = element.offsetHeight;
|
||||
// });
|
||||
},
|
||||
// beforeDestroy() {
|
||||
// //离开页面删除检测器和所有侦听器
|
||||
@ -469,13 +444,16 @@ export default {
|
||||
// removeEventListener('resize', resizeFun)
|
||||
// },
|
||||
methods: {
|
||||
// logoutTimeReset() {
|
||||
// this.logoutTime = this.time * 60 * 60 * 1000
|
||||
// },
|
||||
CutWebsocketClose(e) {
|
||||
console.log('WebSocket 断开连接', e)
|
||||
},
|
||||
SJGWebsocketClose(e) {
|
||||
console.log('WebSocket 断开连接', e)
|
||||
},
|
||||
funInitWebSocket(e) {
|
||||
funWebSocketClose(e) {
|
||||
console.log('WebSocket 断开连接', e)
|
||||
},
|
||||
formatTime(time, option) {
|
||||
@ -721,17 +699,17 @@ export default {
|
||||
let cutArr = this.cutWsData.productHourData.map((item, index) => [
|
||||
// console.log(item)
|
||||
`
|
||||
<span style="color:rgba(255,255,255,0.5)" >${index + 1 || ''}
|
||||
<span style="color:rgba(255,255,255,0.7)" >${index + 1 || ''}
|
||||
</span>`,
|
||||
// formatDate(item.planStartTime) || '',
|
||||
`
|
||||
<span style="color:rgba(255,255,255,0.5)" >${item.lineName || ''}
|
||||
<span style="color:rgba(255,255,255,0.7)" >${item.lineName || ''}
|
||||
</span>`,
|
||||
`<span style="color:rgba(255,255,255,0.5)">${this.formatTime(item.time) || ''}</span>`,
|
||||
`<span style="color:rgba(255,255,255,0.5)">${this.getSize(item.size) || ''}</span>`,
|
||||
`<span style="color:rgba(255,255,255,0.5)">${item.productArea + '㎡' || ''}</span>`,
|
||||
`<span style="color:rgba(255,255,255,0.5)">${item.wasteArea + '㎡' || ''}</span>`,
|
||||
`<div style = "${(item.product * 100).toFixed(2) > 91 ? 'display:block;color:rgba(255,255,255,0.5)' : 'display:none;'}">${(item.product * 100).toFixed(2) + '%' || ''}</div>
|
||||
`<span style="color:rgba(255,255,255,0.7)">${this.formatTime(item.time) || ''}</span>`,
|
||||
`<span style="color:rgba(255,255,255,0.7)">${this.getSize(item.size) || ''}</span>`,
|
||||
`<span style="color:rgba(255,255,255,0.7)">${item.productArea + '㎡' || ''}</span>`,
|
||||
`<span style="color:rgba(255,255,255,0.7)">${item.wasteArea + '㎡' || ''}</span>`,
|
||||
`<div style = "${(item.product * 100).toFixed(2) > 91 ? 'display:block;color:#00FFF7' : 'display:none;'}">${(item.product * 100).toFixed(2) + '%' || ''}</div>
|
||||
<div style = "${(item.product * 100).toFixed(2) < 91 ? 'display:block; color:rgba(255, 209, 96, 1)' : 'display:none;'}">${(item.product * 100).toFixed(2) + '%' || ''}</div>`
|
||||
])
|
||||
this.cutConfig.data = cutArr
|
||||
@ -984,7 +962,7 @@ background: linear-gradient(to bottom,rgba(60,
|
||||
height: 290px;
|
||||
width: 1px;
|
||||
position: absolute;
|
||||
left: 66.2%;
|
||||
left: 66.3%;
|
||||
top: 12%;
|
||||
background: linear-gradient(to bottom, rgba(60,
|
||||
231,
|
||||
@ -1036,11 +1014,11 @@ background: linear-gradient(to bottom,rgba(60,
|
||||
min-height: 10px;
|
||||
}
|
||||
|
||||
.el-input__inner {
|
||||
background-color: rgba($color: #31878c, $alpha: 0.29);
|
||||
border: rgba($color: #31878c, $alpha: 0.29);
|
||||
color: aliceblue;
|
||||
}
|
||||
// .el-input__inner {
|
||||
// background-color: rgba($color: #31878c, $alpha: 0.29);
|
||||
// border: rgba($color: #31878c, $alpha: 0.29);
|
||||
// color: aliceblue;
|
||||
// }
|
||||
|
||||
.el-divider--vertical {
|
||||
height: 174px;
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-01-29 13:45:56
|
||||
* @LastEditTime: 2024-01-29 14:56:38
|
||||
* @LastEditTime: 2024-03-13 08:58:01
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -85,11 +85,11 @@ export default {
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
bottom: '2%',
|
||||
bottom: '10%',
|
||||
left: 'center',
|
||||
itemWidth: 18,
|
||||
itemHeight:18,
|
||||
icon: 'circle',
|
||||
itemWidth: 12,
|
||||
itemHeight:12,
|
||||
icon: 'rect',
|
||||
textStyle: {
|
||||
color: '#fff'
|
||||
},
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: gtz
|
||||
* @Date: 2022-01-19 15:58:17
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-02-01 15:25:14
|
||||
* @LastEditTime: 2024-02-22 10:26:59
|
||||
* @Description: file content
|
||||
* @FilePath: \mt-bus-fe\src\views\OperationalOverview\components\baseContainer\index.vue
|
||||
-->
|
||||
@ -24,7 +24,7 @@
|
||||
<div class="bar-item">
|
||||
<div v-if="title" class="bar-title" ds>
|
||||
<span>
|
||||
<svg-icon :icon-class="titleIcon" style="font-size: 1em; position: relative; top: .08em" />
|
||||
<svg-icon :icon-class="titleIcon" style="font-size: 1em; position: relative; top: .01em" />
|
||||
{{ title }}
|
||||
</span>
|
||||
<!-- <span v-if="showTime" style="font-size: 20px;color:#52FFF8;margin-left: 10px;margin-top: 2px;">
|
||||
@ -157,35 +157,58 @@ export default {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
|
||||
.base-container {
|
||||
color: #fff;
|
||||
width: 100%;
|
||||
// background-color: rgba($color: #061027, $alpha: 0.15);
|
||||
position: relative;
|
||||
opacity: calc(.8);
|
||||
// border: 2px solid;
|
||||
// background: url('../../../../assets/img/energy.png') no-repeat;
|
||||
// background-size: 100% 100%;
|
||||
&__small {
|
||||
background: url(../../../../assets/img/short.png) no-repeat;
|
||||
background-size: 100% 100%;
|
||||
// background-position: 0 0;
|
||||
backdrop-filter: blur(5px);
|
||||
}
|
||||
|
||||
// &__small::after {
|
||||
// content: "";
|
||||
// position: absolute;
|
||||
// top: 0;
|
||||
// left: 0;
|
||||
// filter: blur(20px);
|
||||
// z-index: -1;
|
||||
// }
|
||||
&__middle {
|
||||
background: url(../../../../assets/img/middle.png) no-repeat;
|
||||
background-size: 100% 100%;
|
||||
// background-position: 0 0;
|
||||
backdrop-filter: blur(5px);
|
||||
}
|
||||
|
||||
&__large {
|
||||
background: url(../../../../assets/img/high.png) no-repeat;
|
||||
background-size: 100% 100%;
|
||||
// background-position: 0 0;
|
||||
backdrop-filter: blur(5px);
|
||||
}
|
||||
&__eqStatus {
|
||||
background: url(../../../../assets/img/short.png) no-repeat;
|
||||
background: url(../../../../assets/img/high.png) no-repeat;
|
||||
background-size: 100% 100%;
|
||||
backdrop-filter: blur(5px);
|
||||
}
|
||||
// &::after {
|
||||
// content: " ";
|
||||
// // display: block;
|
||||
// position: absolute;
|
||||
// left: 0;
|
||||
// top: 0;
|
||||
// right: 0;
|
||||
// bottom: 0;
|
||||
// // background: inherit;
|
||||
// /* 设置模糊,不用 filter */
|
||||
// backdrop-filter: blur(5px);
|
||||
// z-index: -1;
|
||||
// }
|
||||
// border-radius: 40px 0px 40px 0px;
|
||||
// border-image: linear-gradient(360deg, rgba(157, 246, 254, 0.05), rgba(100, 233, 252, 0.9)) 2 2;
|
||||
// .line {
|
||||
@ -272,4 +295,9 @@ export default {
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
// .base-container::after{
|
||||
// z-index: -1;
|
||||
// width: 100%;
|
||||
// filter: blur(2px);
|
||||
// }
|
||||
</style>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-09-21 09:06:28
|
||||
* @LastEditTime: 2024-02-01 15:52:41
|
||||
* @LastEditTime: 2024-03-13 08:51:12
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -172,7 +172,7 @@ export default {
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
type: 'solid',
|
||||
color: '#213259', // 左边线的颜色
|
||||
color: '#25528f',
|
||||
width: '1' // 坐标线的宽度
|
||||
}
|
||||
},
|
||||
@ -186,7 +186,7 @@ export default {
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: '#213259'
|
||||
color: '#25528f'
|
||||
}
|
||||
},
|
||||
data: nameList
|
||||
@ -215,7 +215,7 @@ export default {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
type: 'solid',
|
||||
color: '#213259', // 左边线的颜色
|
||||
color: '#25528f',
|
||||
width: '1' // 坐标线的宽度
|
||||
}
|
||||
},
|
||||
@ -228,7 +228,7 @@ export default {
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: '#213259'
|
||||
color: '#25528f'
|
||||
}
|
||||
}
|
||||
// type: 'value'
|
||||
@ -260,7 +260,7 @@ export default {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
type: 'solid',
|
||||
color: '#213259', // 左边线的颜色
|
||||
color: '#25528f', // 左边线的颜色
|
||||
width: '1' // 坐标线的宽度
|
||||
}
|
||||
},
|
||||
@ -275,7 +275,7 @@ export default {
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: '#213259'
|
||||
color: '#25528f'
|
||||
}
|
||||
}
|
||||
// type: 'value'
|
||||
|
@ -145,7 +145,7 @@ export default {
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
type: 'solid',
|
||||
color: '#213259', // 左边线的颜色
|
||||
color: '#25528f', // 左边线的颜色
|
||||
width: '1' // 坐标线的宽度
|
||||
}
|
||||
},
|
||||
@ -156,7 +156,7 @@ export default {
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: '#213259'
|
||||
color: '#25528f'
|
||||
}
|
||||
},
|
||||
data: this.nameList
|
||||
@ -172,17 +172,17 @@ export default {
|
||||
axisLabel: {
|
||||
color: "#fff",
|
||||
fontSize: 12,
|
||||
formatter: '{value}/kwh'
|
||||
// formatter: '{value}/kwh'
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: "#213259",
|
||||
color: "#25528f",
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: "#213259a0",
|
||||
color: "#25528f",
|
||||
},
|
||||
}
|
||||
},
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-27 13:54:52
|
||||
* @LastEditTime: 2024-01-25 14:08:27
|
||||
* @LastEditTime: 2024-03-13 09:04:11
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -91,43 +91,78 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
initChart(nameList, topNameList, nameWasteList, passRateList, wasteList) {
|
||||
let rawData = []
|
||||
rawData.push(passRateList,wasteList)
|
||||
// console.log(1)
|
||||
this.chart = echarts.init(document.getElementById(this.id))
|
||||
let series = [
|
||||
{
|
||||
// 辅助系列
|
||||
name: '良品',
|
||||
type: 'bar',
|
||||
stack: 'total',
|
||||
// silent: true,
|
||||
// itemStyle: {
|
||||
color: '#0fdedb',
|
||||
// },
|
||||
// barCategoryGap: '10%',
|
||||
barWidth: 10,
|
||||
data: passRateList
|
||||
},
|
||||
{
|
||||
type: 'bar',
|
||||
stack: 'total',
|
||||
name: '废品',
|
||||
// barCategoryGap: '10%',
|
||||
data: wasteList,
|
||||
// barWidth: 10,
|
||||
// barWidth: 15,
|
||||
// label: {
|
||||
// position: [10, 10],
|
||||
// normal: {
|
||||
// position: [800, -24],
|
||||
// show: true,
|
||||
// textStyle: {
|
||||
// color: '#2359ec',
|
||||
// fontSize: 16,
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
const totalData = [];
|
||||
for (let i = 0; i < rawData[0].length; ++i) {
|
||||
let sum = 0;
|
||||
for (let j = 0; j < rawData.length; ++j) {
|
||||
sum += rawData[j][i];
|
||||
}
|
||||
]
|
||||
totalData.push(sum);
|
||||
}
|
||||
let colors = ['#0fdedb', '#2359ec' ]
|
||||
console.log('total', totalData);
|
||||
this.chart = echarts.init(document.getElementById(this.id))
|
||||
const series = [
|
||||
'良品',
|
||||
'废品',
|
||||
// 'Affiliate Ad',
|
||||
// 'Video Ad',
|
||||
// 'Search Engine'
|
||||
].map((name, sid) => {
|
||||
// console.log(sid)
|
||||
return {
|
||||
name,
|
||||
type: 'bar',
|
||||
stack: 'total',
|
||||
barWidth: 10,
|
||||
label: {
|
||||
show: true,
|
||||
formatter: (params) => Math.round(params.value * 1000) / 10 + '%'
|
||||
},
|
||||
color:colors[sid],
|
||||
data: rawData[sid].map((d, did) =>
|
||||
totalData[did] <= 0 ? 0 : d / totalData[did]
|
||||
)
|
||||
};
|
||||
});
|
||||
// let series = [
|
||||
// {
|
||||
// // 辅助系列
|
||||
// name: '良品',
|
||||
// type: 'bar',
|
||||
// stack: 'total',
|
||||
// // silent: true,
|
||||
// // itemStyle: {
|
||||
// color: '#0fdedb',
|
||||
// // },
|
||||
// // barCategoryGap: '10%',
|
||||
// barWidth: 10,
|
||||
// data: passRateList
|
||||
// },
|
||||
// {
|
||||
// type: 'bar',
|
||||
// stack: 'total',
|
||||
// name: '废品',
|
||||
// // barCategoryGap: '10%',
|
||||
// data: wasteList,
|
||||
// // barWidth: 10,
|
||||
// // barWidth: 15,
|
||||
// // label: {
|
||||
// // position: [10, 10],
|
||||
// // normal: {
|
||||
// // position: [800, -24],
|
||||
// // show: true,
|
||||
// // textStyle: {
|
||||
// // color: '#2359ec',
|
||||
// // fontSize: 16,
|
||||
// // },
|
||||
// // },
|
||||
// // },
|
||||
// }
|
||||
// ]
|
||||
// for (i = 0; i < 5; i++) {
|
||||
// series.push({
|
||||
|
||||
@ -135,8 +170,9 @@ export default {
|
||||
// }
|
||||
this.chart.setOption({
|
||||
legend: {
|
||||
// top: '2.5%',
|
||||
// right: '20px',
|
||||
itemWidth: 12,
|
||||
itemHeight: 12,
|
||||
icon: 'rect',
|
||||
textStyle: {
|
||||
color: '#ffffff'
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-07-19 15:18:30
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-02-01 15:35:29
|
||||
* @LastEditTime: 2024-03-12 09:34:06
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -632,12 +632,12 @@ export default {
|
||||
])
|
||||
this.eqConfig.data = eqArr
|
||||
this.$refs['eqScrollBoard'].updateRows(eqArr)
|
||||
this.$refs.productLineChart.initChart(['D61', 'D62', 'D63', 'D64', 'D65',], [98, 97, 98.7, 98.5, 98.3,], [3134, 2323, 3232, 3233, 2321])
|
||||
this.getList()
|
||||
this.initWebSocket()
|
||||
this.SJGInitWebSocket()
|
||||
this.getTimes()
|
||||
// this.$refs.EnergyMonitoringChart.initChart(['Y61', 'Y62', 'Y63', 'Y64', 'Y65',], [3134, 2323, 3232, 3233, 2321])
|
||||
// this.$refs.productLineChart.initChart(['Y61', 'Y62', 'Y63', 'Y64', 'Y65',], [98, 97, 98.7, 98.5, 98.3,], [3134, 2323, 3232, 3233, 2321])
|
||||
const _this = this;
|
||||
_this.beilv2 = document.documentElement.clientWidth / 1920
|
||||
window.onresize = () => {
|
||||
@ -699,22 +699,22 @@ export default {
|
||||
])
|
||||
this.processConfig.data = processArr
|
||||
this.$refs['processScrollBoard'].updateRows(processArr)
|
||||
if (res.data.length !==0) {
|
||||
let processArr = res.data.map((item, index) => [
|
||||
// console.log(item)
|
||||
`<span style="color:rgba(255,255,255,0.5)" >${index + 1 || ''}
|
||||
</span>`,
|
||||
// formatDate(item.planStartTime) || '',
|
||||
`
|
||||
<span style="color:rgba(255,255,255,0.5)" >${item.productionLineName || ''}
|
||||
</span>`,
|
||||
`<span style="color:rgba(255,255,255,0.5)">${item.sectionName || ''}</span>`,
|
||||
`<span style="color:rgba(255,255,255,0.5)">${item.count || ''}</span>`,
|
||||
`<span style="color:rgba(255,255,255,0.5)">${item.inspectionTypeName || ''}</span>`,
|
||||
])
|
||||
this.processConfig.data = processArr
|
||||
this.$refs['processScrollBoard'].updateRows(processArr)
|
||||
}
|
||||
// if (res.data.length !==0) {
|
||||
// let processArr = res.data.map((item, index) => [
|
||||
// // console.log(item)
|
||||
// `<span style="color:rgba(255,255,255,0.5)" >${index + 1 || ''}
|
||||
// </span>`,
|
||||
// // formatDate(item.planStartTime) || '',
|
||||
// `
|
||||
// <span style="color:rgba(255,255,255,0.5)" >${item.productionLineName || ''}
|
||||
// </span>`,
|
||||
// `<span style="color:rgba(255,255,255,0.5)">${item.sectionName || ''}</span>`,
|
||||
// `<span style="color:rgba(255,255,255,0.5)">${item.count || ''}</span>`,
|
||||
// `<span style="color:rgba(255,255,255,0.5)">${item.inspectionTypeName || ''}</span>`,
|
||||
// ])
|
||||
// this.processConfig.data = processArr
|
||||
// this.$refs['processScrollBoard'].updateRows(processArr)
|
||||
// }
|
||||
})
|
||||
},
|
||||
getTimes() {
|
||||
@ -982,6 +982,8 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
|
||||
.visual-container {
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
@ -993,12 +995,15 @@ export default {
|
||||
background: url('../../assets/img/OperationalOverview/title.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
color: #00fff0;
|
||||
word-spacing: 8px;
|
||||
// word-spacing: 8px;
|
||||
letter-spacing: 8px;
|
||||
text-align: center;
|
||||
.unit {
|
||||
position: absolute;
|
||||
left: 260px;
|
||||
left: 290px;
|
||||
top: 25px;
|
||||
letter-spacing: 0px;
|
||||
color: rgba($color: #ffffff, $alpha: 8);
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
@ -1006,6 +1011,8 @@ export default {
|
||||
position: absolute;
|
||||
left: 1360px;
|
||||
top: 25px;
|
||||
letter-spacing: 0px;
|
||||
color: rgba($color: #ffffff, $alpha: 8);
|
||||
font-size: 20px;
|
||||
}
|
||||
.title-button {
|
||||
@ -1105,11 +1112,11 @@ export default {
|
||||
min-height: 10px;
|
||||
}
|
||||
|
||||
.el-input__inner {
|
||||
background-color: rgba($color: #31878c, $alpha: 0.29);
|
||||
border: rgba($color: #31878c, $alpha: 0.29);
|
||||
color: aliceblue;
|
||||
}
|
||||
// .el-input__inner {
|
||||
// background-color: rgba($color: #31878c, $alpha: 0.29);
|
||||
// border: rgba($color: #31878c, $alpha: 0.29);
|
||||
// color: aliceblue;
|
||||
// }
|
||||
|
||||
.el-divider--vertical {
|
||||
height: 174px;
|
||||
|
@ -32,7 +32,7 @@ import { parseTime } from '../../core/mixins/code-filter';
|
||||
import {
|
||||
getcoreAlarmLogPage
|
||||
} from '@/api/base/coreAlarmLog';
|
||||
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
|
||||
import {DICT_TYPE, getDictDatas, publicFormatter } from "@/utils/dict";
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
@ -50,7 +50,8 @@ const tableProps = [
|
||||
},
|
||||
{
|
||||
prop: 'alarmGrade',
|
||||
label: '报警级别'
|
||||
label: '报警级别',
|
||||
filter: publicFormatter(DICT_TYPE.EQU_ALARM_LEVEL)
|
||||
},
|
||||
{
|
||||
prop: 'alarmReason',
|
||||
|
@ -7,10 +7,11 @@
|
||||
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible="visible"
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="false"
|
||||
:wrapper-closable="true"
|
||||
class="drawer"
|
||||
:before-close="beforeClose"
|
||||
custom-class="mes-drawer"
|
||||
size="60%"
|
||||
@closed="$emit('destroy')">
|
||||
@ -81,12 +82,12 @@
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<div v-if="mode == 'edit'" class="drawer-body__footer">
|
||||
<el-button style="" @click="handleCancel">取消</el-button>
|
||||
<el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
|
||||
<!-- <el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-else type="primary" @click="handleConfirm">保存</el-button>
|
||||
</el-button> -->
|
||||
<el-button type="primary" @click="handleConfirm">保存</el-button>
|
||||
<!-- sections的第二项必须是 属性列表 -->
|
||||
<!-- <el-button
|
||||
v-if="sections[1].allowAdd"
|
||||
@ -298,6 +299,17 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
beforeClose(done) {
|
||||
if (this.mode.includes('edit')) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done();
|
||||
})
|
||||
.catch(_ => {});
|
||||
} else {
|
||||
done()
|
||||
}
|
||||
},
|
||||
handleTableBtnClick({ type, data }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
|
@ -486,6 +486,7 @@ export default {
|
||||
pageSize: 10,
|
||||
code: '',
|
||||
name: '',
|
||||
special: false
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
|
@ -83,20 +83,14 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="工段排序"
|
||||
prop="sort"
|
||||
:rules="[
|
||||
{
|
||||
type: 'number',
|
||||
trigger: 'change',
|
||||
message: '请输入正确的数字类型',
|
||||
transform: (val) => Number(val),
|
||||
},
|
||||
]">
|
||||
<el-input
|
||||
prop="sort">
|
||||
<el-input-number
|
||||
v-model="dataForm.sort"
|
||||
clearable
|
||||
controls-position="right"
|
||||
@change="$emit('update', dataForm)"
|
||||
placeholder="请输入工段排序" />
|
||||
placeholder="请输入工段排序"
|
||||
style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -298,9 +298,9 @@ export default {
|
||||
// 工段排序
|
||||
sort: undefined,
|
||||
// 产线统计类型
|
||||
lineDataType: undefined,
|
||||
lineDataType: 0,
|
||||
// 工段统计类型
|
||||
sectionDataType: undefined,
|
||||
sectionDataType: 0,
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-12-14 13:52:42
|
||||
* @LastEditTime: 2024-03-14 10:02:53
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -169,7 +169,7 @@ export default {
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.updateURL(this.dataForm).then(response => {
|
||||
if (this.test.length > 1 || this.test[0].name) {
|
||||
if (this.test.length > 1 || this.test[0]?.name) {
|
||||
this.test.forEach(check => {
|
||||
check.hotMaterialId = this.dataForm.id
|
||||
if (check.id) {
|
||||
@ -191,7 +191,7 @@ export default {
|
||||
}
|
||||
// 添加的提交
|
||||
this.urlOptions.createURL(this.dataForm).then(response => {
|
||||
if (this.test.length > 1 || this.test[0].name) {
|
||||
if (this.test.length > 1 || this.test[0]?.name) {
|
||||
this.test.forEach(check => {
|
||||
check.hotMaterialId = response.data
|
||||
createHotMaterialCheck(check).then(res => {
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-01-08 16:11:03
|
||||
* @LastEditTime: 2024-03-13 13:54:01
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -27,7 +27,7 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="产品名称" prop="name">
|
||||
<el-input v-model="dataForm.name" :disabled="isdetail" clearable placeholder="请输入产品名称" />
|
||||
<el-input v-model="dataForm.name" :disabled="isdetail || isedit" clearable placeholder="请输入产品名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
@ -35,7 +35,7 @@
|
||||
<el-input
|
||||
v-model="dataForm.code"
|
||||
clearable
|
||||
:disabled="isdetail"
|
||||
:disabled="isdetail || isedit"
|
||||
placeholder="请输入产品编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -44,12 +44,12 @@
|
||||
<el-select
|
||||
v-model="dataForm.materialType"
|
||||
filterable
|
||||
:disabled="isdetail"
|
||||
:disabled="isdetail || isedit"
|
||||
style="width: 100%"
|
||||
placeholder="请选择物料类型">
|
||||
<el-option
|
||||
v-for="dict in getDictDatas('material_type')"
|
||||
:key="dict.value"
|
||||
v-for="(dict, index) in getDictDatas('material_type')"
|
||||
:key="index"
|
||||
:label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
@ -62,12 +62,12 @@
|
||||
<el-select
|
||||
v-model="dataForm.productType"
|
||||
filterable
|
||||
:disabled="isdetail"
|
||||
:disabled="isdetail || isedit"
|
||||
style="width: 100%"
|
||||
placeholder="请选择产品类型">
|
||||
<el-option
|
||||
v-for="dict in getDictDatas(DICT_TYPE.PRODUCT_TYPE)"
|
||||
:key="dict.value"
|
||||
v-for="(dict, index) in getDictDatas(DICT_TYPE.PRODUCT_TYPE)"
|
||||
:key="index"
|
||||
:label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
@ -78,12 +78,12 @@
|
||||
<el-select
|
||||
v-model="dataForm.unit"
|
||||
filterable
|
||||
:disabled="isdetail"
|
||||
:disabled="isdetail || isedit"
|
||||
style="width: 100%"
|
||||
placeholder="请选择单位">
|
||||
<el-option
|
||||
v-for="dict in getDictDatas(DICT_TYPE.UNIT_DICT)"
|
||||
:key="dict.value"
|
||||
v-for="(dict, index) in getDictDatas(DICT_TYPE.UNIT_DICT)"
|
||||
:key="index"
|
||||
:label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
@ -91,24 +91,24 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单位平方数" prop="area">
|
||||
<el-input-number v-model="dataForm.area" :precision="6" :min="0" style="width: 100%" :disabled="isdetail" clearable placeholder="请输入单位平方数" />
|
||||
<el-input-number v-model="dataForm.area" :precision="6" :min="0" style="width: 100%" :disabled="isdetail || isedit" clearable placeholder="请输入单位平方数" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="规格" prop="specifications">
|
||||
<el-input v-model="dataForm.specifications" :disabled="isdetail" @blur="setArea" @clear="clearArea" clearable placeholder="请输入规格" />
|
||||
<el-input v-model="dataForm.specifications" :disabled="isdetail || isedit" @blur="setArea" @clear="clearArea" clearable placeholder="请输入规格" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="产线生产单位用时(S)" prop="processTime">
|
||||
<el-form-item label="生产节拍(S)" prop="processTime">
|
||||
<el-input v-model.number="dataForm.processTime" :precision="4" :min="0" type="number" :disabled="isdetail" clearable placeholder="请输入产线生产单位用时" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="重量" prop="weight">
|
||||
<el-input-number v-model="dataForm.weight" :precision="6" :min="0" style="width: 100%" :disabled="isdetail" clearable placeholder="请输入重量" />
|
||||
<el-input-number v-model="dataForm.weight" :precision="6" :min="0" style="width: 100%" :disabled="isdetail || isedit" clearable placeholder="请输入重量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -241,7 +241,7 @@ export default {
|
||||
productType: undefined,
|
||||
area: undefined,
|
||||
specifications: undefined,
|
||||
processTime: 0,
|
||||
processTime: undefined,
|
||||
remark: undefined,
|
||||
unit: undefined,
|
||||
weight: undefined
|
||||
@ -249,14 +249,14 @@ export default {
|
||||
productAttrList: [],
|
||||
visible: false,
|
||||
isdetail: false,
|
||||
isedit: false,
|
||||
idAttrShow: false,
|
||||
dataRule: {
|
||||
code: [{ required: true, message: "产品编码不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "产品名称不能为空", trigger: "blur" }],
|
||||
specifications: [{ required: true, message: "规格不能为空", trigger: "blur" }],
|
||||
specifications: [{ required: false, message: "规格不能为空", trigger: "blur" }],
|
||||
materialType: [{ required: true, message: "物料类型不能为空", trigger: "change" }],
|
||||
productType: [{ required: true, message: "产品类型不能为空", trigger: "change" }],
|
||||
processTime: [{ required: true, message: "产线生产单位用时不能为空", trigger: "blur" }]
|
||||
productType: [{ required: true, message: "产品类型不能为空", trigger: "change" }]
|
||||
}
|
||||
};
|
||||
},
|
||||
@ -322,12 +322,14 @@ export default {
|
||||
this.listQuery.total = response.data.total;
|
||||
});
|
||||
},
|
||||
init(id, isdetail) {
|
||||
init(row, isdetail) {
|
||||
this.initData();
|
||||
this.isdetail = isdetail || false;
|
||||
this.dataForm.id = id || undefined;
|
||||
this.dataForm.id = row?.id || undefined;
|
||||
this.isedit = row?.id && row?.externalCode ? true : false;
|
||||
console.log('你好', this.isedit)
|
||||
this.visible = true;
|
||||
if (id) {
|
||||
if (row) {
|
||||
this.idAttrShow = true
|
||||
} else {
|
||||
this.idAttrShow = false
|
||||
@ -338,15 +340,14 @@ export default {
|
||||
|
||||
if (this.dataForm.id) {
|
||||
// 获取产品详情
|
||||
this.urlOptions.infoURL(id).then(response => {
|
||||
this.urlOptions.infoURL(this.dataForm.id).then(response => {
|
||||
this.dataForm = response.data
|
||||
// this.dataForm.area = response.data.area || 0
|
||||
// this.dataForm.weight = response.data.weight || 0
|
||||
// this.dataForm.specifications = response.data.specifications || undefined
|
||||
console.log('11res112', this.dataForm.specifications, this.dataForm.weight, this.dataForm.area)
|
||||
if (this.dataForm.unit !== undefined) {
|
||||
this.dataForm.unit = String(this.dataForm.unit)
|
||||
}
|
||||
// if (this.dataForm.unit !== undefined) {
|
||||
// this.dataForm.unit = String(this.dataForm.unit)
|
||||
// }
|
||||
if (this.dataForm.materialType !== undefined) {
|
||||
this.dataForm.materialType = String(this.dataForm.materialType)
|
||||
}
|
||||
|
@ -74,9 +74,7 @@ export default {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
getCoreProductAttr({
|
||||
id: this.dataForm.id
|
||||
}).then((res) => {
|
||||
getCoreProductAttr(this.dataForm.id).then((res) => {
|
||||
const { name, value } = res.data;
|
||||
this.dataForm.name = name;
|
||||
this.dataForm.value = value;
|
||||
|
@ -141,6 +141,22 @@ export default {
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
//tableBtn点击
|
||||
handleClick(val) {
|
||||
if (val.type === "edit") {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle = "编辑";
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data);
|
||||
});
|
||||
} else if (val.type === "delete") {
|
||||
this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex,val.data)
|
||||
} else if (val.type === "change") {
|
||||
this.changeStatus(val.data.id)
|
||||
} else {
|
||||
this.otherMethods(val)
|
||||
}
|
||||
},
|
||||
// 删除
|
||||
deleteHandle(id, name, index) {
|
||||
this.$confirm(`是否确认删除产品名称为"${name}"的数据项`, "提示", {
|
||||
@ -168,7 +184,7 @@ export default {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle = "详情";
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data.id, true);
|
||||
this.$refs.addOrUpdate.init(val.data, true);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-21 18:59:54
|
||||
* @LastEditTime: 2024-03-13 13:54:48
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -12,18 +12,6 @@
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产线名称" prop="name">
|
||||
<el-input v-model="dataForm.name" clearable placeholder="请输入产线名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产线编号" prop="code">
|
||||
<el-input v-model="dataForm.code" clearable placeholder="请输入产线编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工厂名称" prop="factoryId">
|
||||
@ -41,6 +29,36 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="车间名称" prop="roomNameDict">
|
||||
<el-select
|
||||
v-model="dataForm.roomNameDict"
|
||||
filterable
|
||||
clearable
|
||||
style="width: 100%"
|
||||
placeholder="请选择车间名称">
|
||||
<el-option
|
||||
v-for="(dict, index) in getDictDatas('workshop')"
|
||||
:key="index"
|
||||
:label="dict.label"
|
||||
:value="Number(dict.value)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产线名称" prop="name">
|
||||
<el-input v-model="dataForm.name" clearable placeholder="请输入产线名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产线编号" prop="code">
|
||||
<el-input v-model="dataForm.code" clearable placeholder="请输入产线编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="产线TT值(h)" prop="tvalue">
|
||||
<el-input
|
||||
v-model.number="dataForm.tvalue"
|
||||
@ -92,11 +110,13 @@ export default {
|
||||
tvalue: 0,
|
||||
factoryId: undefined,
|
||||
remark: undefined,
|
||||
roomNameDict: undefined
|
||||
},
|
||||
factoryList: [],
|
||||
dataRule: {
|
||||
code: [{ required: true, message: "产线编号不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "产线名称不能为空", trigger: "blur" }],
|
||||
roomNameDict: [{ required: true, message: "车间名称不能为空", trigger: "blur" }],
|
||||
factoryId: [{ required: true, message: "工厂不能为空", trigger: "blur" }]
|
||||
}
|
||||
};
|
||||
@ -105,6 +125,26 @@ export default {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.dataForm.id = id || "";
|
||||
this.visible = true;
|
||||
if (this.urlOptions.getOption) {
|
||||
this.getArr()
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs["dataForm"].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.infoURL(id).then(response => {
|
||||
this.dataForm = response.data
|
||||
// this.dataForm.roomNameDict = String(this.dataForm.roomNameDict)
|
||||
});
|
||||
} else {
|
||||
if (this.urlOptions.isGetCode) {
|
||||
this.getCode()
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
async getDict() {
|
||||
// 工厂列表
|
||||
const factoryRes = await getFactoryList();
|
||||
|
@ -47,6 +47,7 @@ import {
|
||||
} from '@/api/base/coreProductionLine';
|
||||
import { getStatus } from '@/api/core/base/productionLine';
|
||||
import codeFilter from '../../core/mixins/code-filter';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
@ -58,6 +59,11 @@ const tableProps = [
|
||||
prop: 'factoryName',
|
||||
label: '工厂'
|
||||
},
|
||||
{
|
||||
prop: 'roomNameDict',
|
||||
label: '车间名称',
|
||||
filter: publicFormatter('workshop')
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '产线名称'
|
||||
@ -71,10 +77,10 @@ const tableProps = [
|
||||
label: '当前状态',
|
||||
filter: codeFilter('lineStatus')
|
||||
},
|
||||
{
|
||||
prop: 'tvalue',
|
||||
label: '产线TT值(h)'
|
||||
},
|
||||
// {
|
||||
// prop: 'tvalue',
|
||||
// label: '产线TT值(h)'
|
||||
// },
|
||||
{
|
||||
prop: 'description',
|
||||
label: '描述'
|
||||
@ -82,7 +88,7 @@ const tableProps = [
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注'
|
||||
},
|
||||
}
|
||||
];
|
||||
|
||||
export default {
|
||||
|
@ -84,7 +84,7 @@
|
||||
<el-radio :label="1">产品基础BOM</el-radio>
|
||||
<el-radio :label="2">工艺扩展BOM</el-radio>
|
||||
</el-radio-group> -->
|
||||
<el-select v-model="dataForm.materialMethod" placeholder="请选择物料计算方式" style="width: 100%;" @change="materialMethodChange">
|
||||
<el-select v-model="dataForm.materialMethod" placeholder="请选择物料计算方式" style="width: 100%;" clearable @change="materialMethodChange">
|
||||
<el-option key="1" label="产品基础BOM" :value="1" />
|
||||
<el-option key="2" label="工艺扩展BOM" :value="2" />
|
||||
</el-select>
|
||||
@ -92,7 +92,7 @@
|
||||
</el-col>
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="优先级" prop="priority">
|
||||
<el-select v-model="dataForm.priority" placeholder="请选择优先级" style="width: 100%;">
|
||||
<el-select v-model="dataForm.priority" clearable placeholder="请选择优先级" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)"
|
||||
:key="item.value"
|
||||
@ -104,7 +104,7 @@
|
||||
</el-col>
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="工单类型" prop="type">
|
||||
<el-select v-model="dataForm.type" placeholder="请选择工单类型" style="width: 100%;">
|
||||
<el-select v-model="dataForm.type" clearable placeholder="请选择工单类型" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in workOrderTypeList"
|
||||
:key="item.id"
|
||||
@ -116,9 +116,26 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="负责车间" prop="roomNameDict">
|
||||
<el-select
|
||||
v-model="dataForm.roomNameDict"
|
||||
filterable
|
||||
clearable
|
||||
style="width: 100%"
|
||||
@change="setLine"
|
||||
placeholder="请选择车间名称">
|
||||
<el-option
|
||||
v-for="(dict, index) in getDictDatas('workshop')"
|
||||
:key="index"
|
||||
:label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="关联产线" prop="productLineIds">
|
||||
<el-select v-model="dataForm.productLineIds" placeholder="请选择关联产线" multiple style="width: 100%;">
|
||||
<el-select v-model="dataForm.productLineIds" clearable placeholder="请选择关联产线" multiple style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in productLineList"
|
||||
:key="item.id"
|
||||
@ -130,7 +147,7 @@
|
||||
</el-col>
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="负责人" prop="workers">
|
||||
<el-input v-model="dataForm.workers" placeholder="请输入负责人"></el-input>
|
||||
<el-input v-model="dataForm.workers" clearable placeholder="请输入负责人"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -147,7 +164,7 @@
|
||||
import { getProductAll } from '@/api/base/product'
|
||||
import { getProcessFlowList, workOrderList } from '@/api/base/orderManage'
|
||||
import { createCoreWO, updateCoreWO, getCode, getCoreWO } from '@/api/base/coreWorkOrder'
|
||||
import { getLineAll } from '@/api/base/productionLine'
|
||||
import { getLinelistByRoom, getLineAll } from '@/api/base/productionLine'
|
||||
import basicAdd from '../../core/mixins/basic-add';
|
||||
|
||||
export default {
|
||||
@ -180,6 +197,7 @@ export default {
|
||||
productLineIds: [],
|
||||
type: '',
|
||||
workers: '',
|
||||
roomNameDict: '',
|
||||
status: 1
|
||||
},
|
||||
rules: {
|
||||
@ -187,7 +205,9 @@ export default {
|
||||
planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }],
|
||||
planAssignQuantity: [{ required: true, message: "计划投入数量不能为空", trigger: "blur" }],
|
||||
planQuantity: [{ required: true, message: "计划生产数量不能为空", trigger: "blur" }],
|
||||
productLineIds: [{ required: true, message: "关联产线不能为空", trigger: "change" }]
|
||||
roomNameDict: [{ required: true, message: "车间名称不能为空", trigger: "blur" }],
|
||||
productLineIds: [{ required: true, message: "关联产线不能为空", trigger: "change" }],
|
||||
materialMethod: [{ required: true, message: "物料计算方式不能为空", trigger: "change" }]
|
||||
},
|
||||
productList: [],
|
||||
processFlowList: [],
|
||||
@ -206,6 +226,14 @@ export default {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
setLine() {
|
||||
// 产线
|
||||
getLinelistByRoom({
|
||||
room: this.dataForm.roomNameDict
|
||||
}).then(res => {
|
||||
this.productLineList = res.data || []
|
||||
})
|
||||
},
|
||||
// 工艺变更
|
||||
materialMethodChange(val) {
|
||||
if (val === 2 && !this.dataForm.processFlowId) {
|
||||
@ -236,7 +264,9 @@ export default {
|
||||
if (this.dataForm.priority !== undefined) {
|
||||
this.dataForm.priority = String(this.dataForm.priority)
|
||||
}
|
||||
this.dataForm.priority
|
||||
if (this.dataForm.roomNameDict !== undefined) {
|
||||
this.dataForm.roomNameDict = String(this.dataForm.roomNameDict)
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (this.urlOptions.isGetCode) {
|
||||
@ -264,19 +294,20 @@ export default {
|
||||
this.urlOptions.createURL(this.dataForm).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.visible = false;
|
||||
this.$confirm('是否添加预使用主原料信息?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
console.log('121', this.dataForm.name)
|
||||
this.$emit("refreshDataList", {
|
||||
id: response.data,
|
||||
name: this.dataForm.name
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
this.$emit("refreshDataList");
|
||||
// this.$confirm('是否添加预使用主原料信息?', '提示', {
|
||||
// confirmButtonText: '确定',
|
||||
// cancelButtonText: '取消',
|
||||
// type: 'warning'
|
||||
// }).then(() => {
|
||||
// console.log('121', this.dataForm.name)
|
||||
// this.$emit("refreshDataList", {
|
||||
// id: response.data,
|
||||
// name: this.dataForm.name
|
||||
// });
|
||||
// }).catch(() => {
|
||||
// this.$emit("refreshDataList");
|
||||
// });
|
||||
});
|
||||
});
|
||||
},
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-16 09:14:35
|
||||
* @LastEditTime: 2024-03-15 15:34:58
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -17,17 +17,47 @@
|
||||
</small-title>
|
||||
<div class="content">
|
||||
<div class="formContent">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">工单名称:{{ dataForm.name }}</el-col>
|
||||
<el-col :span="12">工单编码:{{ dataForm.code }}</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">产品名称:{{ dataForm.productName }}</el-col>
|
||||
<el-col :span="12">产品规格:{{ dataForm.specifications }}</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">实际生产数量:{{ dataForm.expectedTime }}</el-col>
|
||||
</el-row>
|
||||
<el-form :model="dataForm" ref="dataForm" label-width="120px" label-position="top" class="demo-ruleForm" :rules="rules">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="工单名称" prop="name">
|
||||
<!-- <el-input v-model="dataForm.name" autocomplete="off"></el-input> -->
|
||||
<span>{{ dataForm.name }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="工单编码" prop="code">
|
||||
<span>{{ dataForm.code }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="产品名称" prop="productName">
|
||||
<span>{{ dataForm.productName }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="产品规格" prop="specifications">
|
||||
<span>{{ dataForm.specifications }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="实际生产数量" prop="actualQuantity">
|
||||
<el-input v-model.number="dataForm.actualQuantity" autocomplete="off" style="width: 80%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="实际生产完成时间" prop="finishProduceTime">
|
||||
<el-date-picker
|
||||
v-model="dataForm.finishProduceTime"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="选择日期时间" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div class="attr-list">
|
||||
@ -41,12 +71,12 @@
|
||||
<el-table-column prop="priority" label="优先级" />
|
||||
<el-table-column prop="planAssignmentQuantity" label="计划分配数量" >
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.planAssignmentQuantity" :disabled="scope.row.actualAssignmentQuantity"></el-input>
|
||||
<el-input v-model="scope.row.planAssignmentQuantity" :disabled="scope.row.isallocation"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="actualAssignmentQuantity" label="实际分配数量">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.actualAssignmentQuantity" :disabled="scope.row.actualAssignmentQuantity"></el-input>
|
||||
<el-input v-model="scope.row.actualAssignmentQuantity" :disabled="scope.row.isallocation"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
@ -86,11 +116,11 @@
|
||||
</div>
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" type="primary" @click="goback()">关闭</el-button>
|
||||
<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> -->
|
||||
</el-button> -->
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -104,7 +134,7 @@
|
||||
|
||||
<script>
|
||||
import basicAdd from '../../core/mixins/basic-add';
|
||||
import { getConOrderList, createConCoreWOr, getCoreWO } from '@/api/base/coreWorkOrder';
|
||||
import { getConOrderList, updateConCoreWOr, getCoreWO, statusChange } from '@/api/base/coreWorkOrder';
|
||||
import SmallTitle from '../material/SmallTitle';
|
||||
// import { parseTime } from '../../core/mixins/code-filter';
|
||||
// import attrAdd from './attr-add';
|
||||
@ -135,11 +165,43 @@ export default {
|
||||
tableData: [],
|
||||
visible: false,
|
||||
isdetail: false,
|
||||
idAttrShow: false
|
||||
idAttrShow: false,
|
||||
rules: {
|
||||
name: [{ required: true, message: "工单名称不能为空", trigger: "blur" }],
|
||||
finishProduceTime: [{ required: true, message: "实际生产完成时间不能为空", trigger: "change" }]
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs["dataForm"].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
statusChange({
|
||||
id: this.dataForm.id,
|
||||
status: 4,
|
||||
finishProduceTime: this.dataForm.finishProduceTime,
|
||||
actualQuantity: this.dataForm.actualQuantity
|
||||
}).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");
|
||||
// });
|
||||
});
|
||||
},
|
||||
initData() {
|
||||
// this.materialAttrList.splice(0);
|
||||
this.listQuery.total = 0;
|
||||
@ -159,8 +221,8 @@ export default {
|
||||
// });
|
||||
// return;
|
||||
}
|
||||
// 添加的提交
|
||||
createConCoreWOr({
|
||||
// 修改的提交
|
||||
updateConCoreWOr({
|
||||
...row,
|
||||
workOrderId: this.dataForm.id
|
||||
}).then((response) => {
|
||||
@ -173,16 +235,17 @@ export default {
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
// 获取产品Bom详细列表
|
||||
// 获取工单分配详细列表
|
||||
getConOrderList({
|
||||
...this.listQuery,
|
||||
workOrderId: this.dataForm.id
|
||||
}).then((response) => {
|
||||
this.tableData = response.data.map(item => {
|
||||
item.isEdit = false
|
||||
item.isallocation = item.actualAssignmentQuantity ? true : false
|
||||
return item
|
||||
});
|
||||
this.listQuery.total = response.data.total;
|
||||
this.listQuery.total = response.data.length;
|
||||
});
|
||||
},
|
||||
// 构造一行
|
||||
@ -241,6 +304,9 @@ export default {
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
/* .item .el-form-item__label {
|
||||
color: red;
|
||||
} */
|
||||
.drawer >>> .el-drawer {
|
||||
border-radius: 8px 0 0 8px;
|
||||
display: flex;
|
||||
@ -249,6 +315,7 @@ export default {
|
||||
|
||||
.drawer >>> .el-form-item__label {
|
||||
padding: 0;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.drawer >>> .el-drawer__header {
|
||||
@ -295,4 +362,18 @@ export default {
|
||||
margin-bottom: 10px;
|
||||
width: 100%;
|
||||
}
|
||||
.blodTip {
|
||||
height: 16px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: rgba(0,0,0,0.85);
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.lightTip {
|
||||
/* height: 16px; */
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: rgba(102,102,102,0.75);
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
</style>
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-12-26 16:59:25
|
||||
* @LastEditTime: 2024-03-15 15:40:24
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -45,7 +45,7 @@
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<div class="blodTip">工单来源</div>
|
||||
<div class="lightTip">{{ dataForm.triggerOrigin === 1 ? 'MES' : dataForm.triggerOrigin === 2 ? 'ERP' : ''}}</div>
|
||||
<div class="lightTip">{{ dataForm.triggerOrigin === 1 ? 'MES-手动' : dataForm.triggerOrigin === 2 ? 'MES-订单下发' : 'ERP'}}</div>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<div class="blodTip">所属订单</div>
|
||||
@ -97,6 +97,10 @@
|
||||
<div class="blodTip">关联工艺</div>
|
||||
<div class="lightTip">{{ dataForm.processFlowName }}</div>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<div class="blodTip">车间名称</div>
|
||||
<div class="lightTip">{{ (dataForm.roomNameDict || dataForm.roomNameDict === 0) ? getDictDataLabel('workshop', dataForm.roomNameDict) : '-' }}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
@ -218,7 +222,7 @@
|
||||
|
||||
<script>
|
||||
// import basicAdd from '../../core/mixins/basic-add';
|
||||
import { getCoreWO, getMaterialBomPage, getConOrderList, getCoreWOListById } from "@/api/base/coreWorkOrder";
|
||||
import { getCoreWO, getCoreWOMaPage, getConOrderList, getCoreWOListById } from "@/api/base/coreWorkOrder";
|
||||
// import { orderList } from "@/api/base/orderManage";
|
||||
import { getProcessFlowList } from '@/api/base/orderManage'
|
||||
import SmallTitle from './SmallTitle';
|
||||
@ -261,8 +265,9 @@ const tableProps = [
|
||||
|
||||
const tableProps1 = [
|
||||
{
|
||||
prop: 'materialName',
|
||||
label: '物料名称'
|
||||
prop: 'material',
|
||||
label: '物料名称',
|
||||
filter: publicFormatter('material')
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
@ -270,9 +275,13 @@ const tableProps1 = [
|
||||
filter: publicFormatter('unit_dict')
|
||||
},
|
||||
{
|
||||
prop: 'num',
|
||||
prop: 'remaining',
|
||||
label: '剩余生产预计消耗'
|
||||
},
|
||||
{
|
||||
prop: 'num',
|
||||
label: '库存数量'
|
||||
}
|
||||
];
|
||||
|
||||
export default {
|
||||
@ -431,11 +440,17 @@ export default {
|
||||
// this.listQuery.total = response.data.total;
|
||||
});
|
||||
// 获取预使用原料列表
|
||||
if (this.dataForm.planProductId) {
|
||||
getMaterialBomPage({
|
||||
productId: this.dataForm.planProductId,
|
||||
console.log()
|
||||
if (this.dataForm.id) {
|
||||
getCoreWOMaPage({
|
||||
workOrderId: this.dataForm.id,
|
||||
pageNo: 1,
|
||||
pageSize: 100
|
||||
}).then((response) => {
|
||||
this.materialList = response.data;
|
||||
this.materialList = response.data.records.map((item) => {
|
||||
item.remaining = item?.num * this.dataForm.remainingQuantity || 0
|
||||
return item
|
||||
});
|
||||
// this.listQuery.total = response.data.length;
|
||||
});
|
||||
}
|
||||
|
@ -60,6 +60,7 @@ import {
|
||||
getConOrderList,
|
||||
getCoreWOList
|
||||
} from '@/api/base/coreWorkOrder';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
|
||||
|
||||
const tableProps = [
|
||||
@ -82,6 +83,13 @@ const tableProps = [
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'roomNameDict',
|
||||
label: '负责车间',
|
||||
minWidth: 120,
|
||||
filter: publicFormatter('workshop'),
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'workers',
|
||||
label: '负责人',
|
||||
@ -101,7 +109,7 @@ const tableProps = [
|
||||
{
|
||||
prop: 'status',
|
||||
label: '工单状态',
|
||||
filter: (val) => ['', '等待', '激活', '暂停', '完成', '', '', '', '', '作废'][val]
|
||||
filter: (val) => ['', '等待', '激活', '暂停', '完成', '作废', '终止'][val]
|
||||
},
|
||||
{
|
||||
prop: 'planFinishTime',
|
||||
@ -189,17 +197,7 @@ export default {
|
||||
{
|
||||
name: 'status',
|
||||
type: 'equal',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
name: 'status',
|
||||
type: 'equal',
|
||||
value: 3
|
||||
},
|
||||
{
|
||||
name: 'status',
|
||||
type: 'equal',
|
||||
value: 4
|
||||
value: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -223,6 +221,25 @@ export default {
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'stop',
|
||||
btnName: '终止',
|
||||
showParam: {
|
||||
type: '|',
|
||||
data: [
|
||||
{
|
||||
name: 'status',
|
||||
type: 'equal',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
name: 'status',
|
||||
type: 'equal',
|
||||
value: 3
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
this.$auth.hasPermi(`base:core-work-order:detail`)
|
||||
? {
|
||||
type: 'detail',
|
||||
@ -244,23 +261,23 @@ export default {
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:core-work-order:delete`)
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
showParam: {
|
||||
type: '|',
|
||||
data: [
|
||||
{
|
||||
name: 'status',
|
||||
type: 'equal',
|
||||
value: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined
|
||||
// this.$auth.hasPermi(`base:core-work-order:delete`)
|
||||
// ? {
|
||||
// type: 'delete',
|
||||
// btnName: '删除',
|
||||
// showParam: {
|
||||
// type: '|',
|
||||
// data: [
|
||||
// {
|
||||
// name: 'status',
|
||||
// type: 'equal',
|
||||
// value: 1
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// }
|
||||
// : undefined
|
||||
].filter((v)=>v),
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
@ -289,7 +306,8 @@ export default {
|
||||
{ id: 2, name: '激活' },
|
||||
{ id: 3, name: '暂停' },
|
||||
{ id: 4, name: '完成' },
|
||||
{ id: 9, name: '作废' }
|
||||
{ id: 5, name: '作废' },
|
||||
{ id: 6, name: '终止' }
|
||||
],
|
||||
param: 'status',
|
||||
clearable: true
|
||||
@ -401,36 +419,45 @@ export default {
|
||||
opration = '暂停'
|
||||
}
|
||||
if (val.type === 'nullify') {
|
||||
param.status = 9
|
||||
opration = '报废'
|
||||
param.status = 5
|
||||
opration = '作废'
|
||||
}
|
||||
if (val.type === 'finish') {
|
||||
param.status = 4
|
||||
opration = '完成'
|
||||
}
|
||||
if (val.type === 'stop') {
|
||||
param.status = 6
|
||||
opration = '终止'
|
||||
}
|
||||
console.log('22',val)
|
||||
this.$confirm(`确定${opration}${'"工单' + val.data.name + '"'}?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
statusChange(param).then(({ data }) => {
|
||||
this.$message({
|
||||
message: '操作成功!工单状态稍后将会更新!',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
// 分配产量
|
||||
if (param.status === 4) {
|
||||
this.allocationOrder(param);
|
||||
}
|
||||
},
|
||||
if (param.status !== 4) {
|
||||
this.$confirm(`确定${opration}${'"工单' + val.data.name + '"'}?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
statusChange(param).then(({ data }) => {
|
||||
this.$message({
|
||||
message: '操作成功!工单状态稍后将会更新!',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
// 分配产量
|
||||
// if (param.status === 4) {
|
||||
// this.allocationOrder(param);
|
||||
// }
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
})
|
||||
.catch(() => { });
|
||||
} else {
|
||||
// 完成弹出分配框
|
||||
this.allocationOrder(param);
|
||||
}
|
||||
}
|
||||
},
|
||||
allocationOrder(val) {
|
||||
@ -438,20 +465,25 @@ export default {
|
||||
getConOrderList({
|
||||
workOrderId: val.id,
|
||||
}).then((response) => {
|
||||
if (response.data.length > 0) {
|
||||
this.$confirm('工单结束,可分配产量', "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.allocationVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.allocation.init(val.id, true);
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
}
|
||||
|
||||
this.$confirm('工单结束,可分配产量', "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.allocationVisible = true;
|
||||
this.$nextTick(() => {
|
||||
if (response.data.length > 0) {
|
||||
// 有绑定订单带id
|
||||
this.$refs.allocation.init(val.id);
|
||||
} else {
|
||||
this.$refs.allocation.init();
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
|
||||
// this.listQuery.total = response.data.total;
|
||||
});
|
||||
},
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-12-04 15:10:11
|
||||
* @LastEditTime: 2024-02-21 09:41:39
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -59,7 +59,7 @@
|
||||
style="width: 100%"
|
||||
placeholder="请选择物料类型">
|
||||
<el-option
|
||||
v-for="dict in materialList"
|
||||
v-for="dict in getDictDatas('material_type')"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value" />
|
||||
@ -238,7 +238,7 @@ export default {
|
||||
remark: undefined,
|
||||
unit: ''
|
||||
},
|
||||
materialList: [],
|
||||
// materialList: [],
|
||||
supplierList: [],
|
||||
materialAttrList: [],
|
||||
unitList: [],
|
||||
@ -258,17 +258,18 @@ export default {
|
||||
methods: {
|
||||
async getDict() {
|
||||
// 物料类型列表
|
||||
const res = await listData({
|
||||
pageNo: 1,
|
||||
pageSize: 99,
|
||||
dictType: 'material_type',
|
||||
});
|
||||
this.materialList = res.data.list.map(item => {
|
||||
return {
|
||||
label: item.label,
|
||||
value: Number(item.value)
|
||||
}
|
||||
});
|
||||
// const res = await listData({
|
||||
// pageNo: 1,
|
||||
// pageSize: 99,
|
||||
// dictType: 'material_type',
|
||||
// });
|
||||
// this.materialList = res.data.list
|
||||
// this.materialList = res.data.list.map(item => {
|
||||
// return {
|
||||
// label: item.label,
|
||||
// value: Number(item.value)
|
||||
// }
|
||||
// });
|
||||
// 供应商列表
|
||||
const supplierRes = await getSupplierList();
|
||||
this.supplierList = supplierRes.data;
|
||||
@ -348,6 +349,9 @@ export default {
|
||||
if (this.dataForm.unit) {
|
||||
this.dataForm.unit = String(this.dataForm.unit)
|
||||
}
|
||||
if (this.dataForm.type) {
|
||||
this.dataForm.type = String(this.dataForm.type)
|
||||
}
|
||||
});
|
||||
// 获取物料的属性列表
|
||||
this.getList();
|
||||
|
@ -1,72 +1,79 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-10-17 16:50:19
|
||||
* @LastEditTime: 2023-12-01 16:48:53
|
||||
* @LastEditTime: 2024-02-28 10:07:29
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-dialog class="baseDialog" :visible.sync="visible" :show-close="false" :wrapper-closable="false" width="40%" show-close="true">
|
||||
<el-dialog class="baseDialog" :visible.sync="visible" :show-close="false" :wrapper-closable="false" width="40%"
|
||||
show-close="true">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
{{ !dataForm.id ? '新增' : '编辑' }}
|
||||
</small-title>
|
||||
<!--
|
||||
<!--
|
||||
<div class="content">
|
||||
<div class="visual-part"> -->
|
||||
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px"
|
||||
@keyup.enter.native="dataFormSubmit">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="包装流水号" prop="packagingCode">
|
||||
<el-input v-model="dataForm.packagingCode" clearable placeholder="请输入包装流水号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="内容" prop="content">
|
||||
<el-input v-model="dataForm.content" clearable placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属工单" prop="workOrderId">
|
||||
<el-select v-model="dataForm.workOrderId" style="width: 100%;" placeholder="请选择所属工单" clearable>
|
||||
<el-option v-for="dict in workOrderList" :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="customerId">
|
||||
<el-select v-model="dataForm.customerId" style="width: 100%;" placeholder="请选择客户" clearable>
|
||||
<el-option v-for="dict in customerList" :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="modelId">
|
||||
<el-select v-model="dataForm.modelId" style="width: 100%;" placeholder="请选择标签模板" clearable>
|
||||
<el-option v-for="dict in modelList" :key="dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">
|
||||
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px"
|
||||
@keyup.enter.native="dataFormSubmit">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="包装流水号" prop="packagingCode">
|
||||
<el-input v-model="dataForm.packagingCode" clearable placeholder="请输入包装流水号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="内容" prop="content">
|
||||
<el-input v-model="dataForm.content" clearable placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属工单" prop="workOrderId">
|
||||
<el-select v-model="dataForm.workOrderId" style="width: 100%;" placeholder="请选择所属工单" clearable>
|
||||
<el-option v-for="dict in workOrderList" :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="customerId">
|
||||
<el-select v-model="dataForm.customerId" style="width: 100%;" placeholder="请选择客户" clearable>
|
||||
<el-option v-for="dict in customerList" :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="packagingBarCode">
|
||||
<el-input v-model="dataForm.packagingBarCode" clearable placeholder="请输入包装条码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="标签模板" prop="modelId">
|
||||
<el-select v-model="dataForm.modelId" style="width: 100%;" placeholder="请选择标签模板" clearable>
|
||||
<el-option v-for="dict in modelList" :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="area">
|
||||
<el-input v-model="dataForm.area" placeholder="请输入单位平方数" />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
<!-- <el-row :gutter="20">
|
||||
</el-row>
|
||||
<!-- <el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="完成单位产品用时" prop="processTime">
|
||||
<el-input v-model="dataForm.processTime" placeholder="请输入完成单位产品用时" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row> -->
|
||||
</el-form>
|
||||
</el-form>
|
||||
|
||||
<!-- <small-title
|
||||
<!-- <small-title
|
||||
style="margin: 16px 0; padding-left: 8px"
|
||||
:no-padding="true">
|
||||
产品属性列表
|
||||
@ -96,7 +103,7 @@
|
||||
:page-sizes="[5, 10, 15]"
|
||||
@pagination="getList" />
|
||||
</div> -->
|
||||
<!-- </div> -->
|
||||
<!-- </div> -->
|
||||
<!-- </div> -->
|
||||
|
||||
<!-- <div style="position: absolute; bottom: 24px; right: 24px">
|
||||
@ -186,6 +193,7 @@ export default {
|
||||
workOrderId: null, // 单位产品用时 (s)
|
||||
customerId: '', // 规格
|
||||
content: '', // 单位id
|
||||
packagingBarCode: null
|
||||
},
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-01 14:55:51
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-11-24 09:13:50
|
||||
* @LastEditTime: 2024-02-28 10:38:34
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -55,7 +55,11 @@ const tableProps = [
|
||||
{
|
||||
prop: 'packagingCode',
|
||||
label: '包装流水号'
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'packagingBarCode',
|
||||
label: '包装条码'
|
||||
},
|
||||
{
|
||||
prop: 'workOrderName',
|
||||
label: '所属工单'
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-10-17 16:50:19
|
||||
* @LastEditTime: 2024-01-22 09:55:32
|
||||
* @LastEditTime: 2024-03-20 08:36:01
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -23,7 +23,7 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="标签类型" prop="typeId">
|
||||
<el-select v-model="dataForm.typeId" style="width: 100%;" placeholder="请选择打印方式" clearable>
|
||||
<el-select v-model="dataForm.typeId" style="width: 100%;" placeholder="请选择标签类型" clearable>
|
||||
<el-option v-for="dict in typeList" :key="dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
@ -46,6 +46,7 @@
|
||||
import BalanceChart from '../balanceChart';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import AnalysisChart from './chart.vue';
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -82,7 +83,7 @@ export default {
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间',
|
||||
dateType: 'monthrange',
|
||||
dateType: 'month',
|
||||
format: 'yyyy-MM',
|
||||
valueFormat: 'timestamp',
|
||||
rangeSeparator: '-',
|
||||
@ -255,13 +256,13 @@ export default {
|
||||
const date = eq.dynamicName;
|
||||
eq.children.forEach((sub) => {
|
||||
if (sub.dynamicName == '设备CT')
|
||||
row[date + '_eq_ct'] = sub.dynamicValue;
|
||||
row[date + '_eq_ct'] = sub?.dynamicValue?.toFixed(2);
|
||||
if (sub.dynamicName == '设备TT')
|
||||
row[date + '_eq_tt'] = sub.dynamicValue;
|
||||
row[date + '_eq_tt'] = sub?.dynamicValue?.toFixed(2);
|
||||
if (sub.dynamicName == '产线CT')
|
||||
row[date + '_pl_ct'] = sub.dynamicValue;
|
||||
row[date + '_pl_ct'] = sub.dynamicValue?.toFixed(2);
|
||||
if (sub.dynamicName == '产线TT')
|
||||
row[date + '_pl_tt'] = sub.dynamicValue;
|
||||
row[date + '_pl_tt'] = sub.dynamicValue?.toFixed(2);
|
||||
});
|
||||
});
|
||||
this.tableData.push(row);
|
||||
@ -369,21 +370,63 @@ export default {
|
||||
// this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
changeTime(val) {
|
||||
console.log(val)
|
||||
if(val) {
|
||||
const timeStamp = new Date(val).getMonth(); //标准时间转为时间戳,毫秒级别
|
||||
console.log('沃尔沃', timeStamp)
|
||||
const fullyear = new Date(val).getFullYear()
|
||||
let days = 0
|
||||
switch (timeStamp) {
|
||||
case 0:
|
||||
case 2:
|
||||
case 4:
|
||||
case 6:
|
||||
case 7:
|
||||
case 9:
|
||||
case 11:
|
||||
days = 31
|
||||
break
|
||||
case 3:
|
||||
case 4:
|
||||
case 8:
|
||||
case 10:
|
||||
days = 30
|
||||
break
|
||||
case 1:
|
||||
if ((fullyear % 400 === 0) || (fullyear % 4 === 0 && fullyear % 100 !== 0)) {
|
||||
days = 29
|
||||
} else {
|
||||
days = 28
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
this.queryParams.startTime = new Date(fullyear, timeStamp, 1, 0, 0, 0).getTime() //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.queryParams.endTime = new Date(fullyear, timeStamp, days, 23, 59, 59).getTime() //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
} else {
|
||||
this.queryParams.startTime = undefined
|
||||
this.queryParams.endTime = undefined
|
||||
}
|
||||
},
|
||||
|
||||
handleSearchBarBtnClick(btn) {
|
||||
switch (btn.btnName) {
|
||||
case 'search':
|
||||
this.queryParams.lineId = btn.lineIds || null;
|
||||
this.queryParams.startTime = btn.timeArr ? btn.timeArr[0] : null;
|
||||
this.queryParams.endTime = btn.timeArr ? btn.timeArr[1] : null;
|
||||
console.log('2222', new Date(btn.timeArr).getFullYear())
|
||||
this.changeTime(btn.timeArr)
|
||||
// this.queryParams.startTime = btn.timeArr ? btn.timeArr[0] : null;
|
||||
// this.queryParams.endTime = btn.timeArr ? btn.timeArr[1] : null;
|
||||
|
||||
if (!btn.lineIds || !btn.timeArr.length) {
|
||||
if (!btn.lineIds || !btn.timeArr) {
|
||||
this.$message({
|
||||
message: '请选择产线和时间',
|
||||
type: 'warning',
|
||||
});
|
||||
} else {
|
||||
this.getList();
|
||||
}
|
||||
this.getList();
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
@ -2,7 +2,7 @@
|
||||
/*
|
||||
* @Date: 2020-12-29 16:49:28
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-09-12 11:13:34
|
||||
* @LastEditTime: 2024-02-23 14:50:22
|
||||
* @FilePath: \basic-admin\src\filters\basicData\index.js
|
||||
* @Description:
|
||||
*/
|
||||
@ -62,6 +62,17 @@ export function parseTime(time, pattern) {
|
||||
})
|
||||
return time_str
|
||||
}
|
||||
|
||||
export function toDay(time) {
|
||||
if (time < 24) {
|
||||
return time + '小时'
|
||||
} else {
|
||||
const day = ~~(time / 24)
|
||||
const hour = time % 24
|
||||
return day + '天' + hour + '小时'
|
||||
}
|
||||
}
|
||||
|
||||
export default function (dictTable) {
|
||||
return function (val) {
|
||||
return table?.[dictTable]?.[val]
|
||||
|
@ -111,6 +111,7 @@ export default {
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'searchTime',
|
||||
defaultSelect: [],
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@ -132,6 +133,14 @@ export default {
|
||||
},
|
||||
components: {},
|
||||
created() {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||
this.formConfig[2].defaultSelect = [start, end];
|
||||
this.listQuery.reportTime = [
|
||||
moment(start).startOf('day').format('x'),
|
||||
moment(end).endOf('day').format('x'),
|
||||
];
|
||||
getEnergyTypeListAll().then((response) => {
|
||||
this.formConfig[1].selectOptions = response.data;
|
||||
});
|
||||
|
@ -110,6 +110,7 @@ export default {
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'searchTime',
|
||||
defaultSelect: [],
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@ -131,6 +132,14 @@ export default {
|
||||
},
|
||||
components: {},
|
||||
created() {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||
this.formConfig[2].defaultSelect = [start, end];
|
||||
this.listQuery.times = [
|
||||
moment(start).startOf('day').format('x'),
|
||||
moment(end).endOf('day').format('x'),
|
||||
];
|
||||
getHotMaterialList().then((response) => {
|
||||
this.formConfig[1].selectOptions = response.data;
|
||||
});
|
||||
|
@ -1,8 +1,5 @@
|
||||
<template>
|
||||
<div
|
||||
id="analysischartLine"
|
||||
style="width: 100%;height: 100%;"
|
||||
></div>
|
||||
<div id="analysischartLine" style="width: 100%;height: 100%;"></div>
|
||||
</template>
|
||||
<script>
|
||||
import * as echarts from 'echarts'
|
||||
@ -56,11 +53,10 @@ export default {
|
||||
let yData = []
|
||||
for (let j = 0; j < arr.length; j++) {
|
||||
for (let k = 0; k < keys.length; k++) {
|
||||
if (keys[k].indexOf(arr[j]+'_上年同期') > -1 || keys[k].indexOf(arr[j]+'_能源消耗') > -1) {
|
||||
if (keys[k].indexOf(arr[j] + '_上年同期') > -1 || keys[k].indexOf(arr[j] + '_能源消耗') > -1) {
|
||||
let obj = {
|
||||
name: '',
|
||||
type: 'line',
|
||||
stack: 'Total',
|
||||
data: []
|
||||
}
|
||||
obj.name = keys[k]
|
||||
@ -71,14 +67,14 @@ export default {
|
||||
for (let i = 0; i < this.chartData.length; i++) {
|
||||
xData.push(this.chartData[i].time)
|
||||
for (let p = 0; p < yData.length; p++) {
|
||||
yData[p].data.push(this.chartData[i][ yData[p].name])
|
||||
yData[p].data.push(this.chartData[i][yData[p].name])
|
||||
}
|
||||
}
|
||||
var option = {
|
||||
color:['#FFDC94','#8EF0AB','#63BDFF','#288AFF','#7164FF','#FF6860','#FF9747','#B0EB42','#D680FF','#0043D2'],
|
||||
color: ['#FFDC94', '#8EF0AB', '#63BDFF', '#288AFF', '#7164FF', '#FF6860', '#FF9747', '#B0EB42', '#D680FF', '#0043D2'],
|
||||
legend: {
|
||||
data: keys,
|
||||
right:'1%'
|
||||
right: '1%'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
|
@ -4,38 +4,23 @@
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="能源类型" prop="energyTypeId">
|
||||
<el-select v-model="form.energyTypeId" placeholder="请选择" style="width: 100%;" filterable>
|
||||
<el-option
|
||||
v-for="item in this.energyTypeList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
<el-option v-for="item in this.energyTypeList" :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="recordTime">
|
||||
<el-date-picker
|
||||
v-model="form.recordTime"
|
||||
type="date"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="timestamp"
|
||||
placeholder="选择日期"
|
||||
style="width: 100%;">
|
||||
<el-date-picker v-model="form.recordTime" type="date" format="yyyy-MM-dd" value-format="timestamp"
|
||||
placeholder="选择日期" style="width: 100%;">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='24'>
|
||||
<base-table
|
||||
border
|
||||
:table-props="tableProps"
|
||||
:table-data="tableData"
|
||||
:add-button-show="addButtonShow"
|
||||
@emitFun="inputChange"
|
||||
@emitButtonClick="emitButtonClick"
|
||||
/>
|
||||
<base-table border :table-props="tableProps" :table-data="tableData" :add-button-show="addButtonShow"
|
||||
@emitFun="inputChange" @emitButtonClick="emitButtonClick" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
@ -46,17 +31,17 @@ import moment from 'moment'
|
||||
import InputArea from './InputArea'
|
||||
import SelectArea from './SelectArea'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'tableName',
|
||||
label: '表名',
|
||||
subcomponent: SelectArea
|
||||
},
|
||||
{
|
||||
prop: 'readingQuantity',
|
||||
label: '抄表数',
|
||||
subcomponent: InputArea
|
||||
}
|
||||
]
|
||||
{
|
||||
prop: 'tableName',
|
||||
label: '表名*',
|
||||
subcomponent: SelectArea
|
||||
},
|
||||
{
|
||||
prop: 'readingQuantity',
|
||||
label: '抄表数*',
|
||||
subcomponent: InputArea
|
||||
}
|
||||
]
|
||||
export default {
|
||||
name: 'EnergyQuantityManualAdd',
|
||||
props: {
|
||||
@ -72,7 +57,7 @@ export default {
|
||||
return {
|
||||
tableProps,
|
||||
tableData: [],
|
||||
addButtonShow:'新增',
|
||||
addButtonShow: '新增',
|
||||
form: {
|
||||
id: '',
|
||||
energyTypeId: '',
|
||||
@ -98,16 +83,16 @@ export default {
|
||||
obj.tableName = params.tableName + ''
|
||||
obj.readingQuantity = 0
|
||||
this.tableData.push(obj)
|
||||
}else {
|
||||
} else {
|
||||
this.isEdit = true
|
||||
this.form.id = params.id
|
||||
this.addButtonShow = ''
|
||||
energyQuantityManualGet({id: this.form.id}).then(res => {
|
||||
energyQuantityManualGet({ id: this.form.id }).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.form.energyTypeId = res.data.energyTypeId
|
||||
this.form.recordTime = res.data.recordTime ? res.data.recordTime : null
|
||||
let obj = {}
|
||||
obj.tableName = res.data.tableName ? res.data.tableName+'' : ''
|
||||
obj.tableName = res.data.tableName ? res.data.tableName + '' : ''
|
||||
obj.readingQuantity = res.data.readingQuantity
|
||||
this.tableData.push(obj)
|
||||
}
|
||||
@ -130,10 +115,10 @@ export default {
|
||||
if (this.tableData.length === 0) {
|
||||
this.$modal.msgError("抄表数据不能为空");
|
||||
return false
|
||||
}else{
|
||||
} else {
|
||||
for (let item of this.tableData) {
|
||||
console.log(item)
|
||||
if (!item.tableName || (!item.readingQuantity && item.readingQuantity!==0)) {
|
||||
if (!item.tableName || (!item.readingQuantity && item.readingQuantity !== 0)) {
|
||||
this.$modal.msgError("抄表数据有空值,请检查");
|
||||
return false
|
||||
}
|
||||
@ -142,11 +127,11 @@ export default {
|
||||
if (this.isEdit) {
|
||||
// 编辑
|
||||
energyQuantityManualUpdate({
|
||||
id:this.form.id,
|
||||
energyTypeId:this.form.energyTypeId,
|
||||
recordTime:this.form.recordTime,
|
||||
tableName:this.tableData[0].tableName,
|
||||
readingQuantity:this.tableData[0].readingQuantity
|
||||
id: this.form.id,
|
||||
energyTypeId: this.form.energyTypeId,
|
||||
recordTime: this.form.recordTime,
|
||||
tableName: this.tableData[0].tableName,
|
||||
readingQuantity: this.tableData[0].readingQuantity
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
@ -155,9 +140,9 @@ export default {
|
||||
})
|
||||
} else {
|
||||
energyQuantityManualCreate({
|
||||
energyTypeId:this.form.energyTypeId,
|
||||
recordTime:this.form.recordTime,
|
||||
data:this.tableData
|
||||
energyTypeId: this.form.energyTypeId,
|
||||
recordTime: this.form.recordTime,
|
||||
data: this.tableData
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
|
@ -2,44 +2,20 @@
|
||||
<div class="app-container">
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick"
|
||||
/>
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
@selection-change="selectChange"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="120"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
|
||||
:max-height="tableH" @selection-change="selectChange">
|
||||
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
|
||||
@pagination="getList" />
|
||||
<!-- 新增 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="centervisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
>
|
||||
<energy-quantity-manual-add ref="energyQuantityManualAdd" :energyTypeList="energyTypeList" @successSubmit="successSubmit" />
|
||||
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="centervisible" @cancel="handleCancel"
|
||||
@confirm="handleConfirm" :before-close="handleCancel">
|
||||
<energy-quantity-manual-add ref="energyQuantityManualAdd" :energyTypeList="energyTypeList"
|
||||
@successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@ -68,7 +44,7 @@ const tableProps = [
|
||||
},
|
||||
{
|
||||
prop: 'tableName',
|
||||
label: '水/气表名',
|
||||
label: '能源表名',
|
||||
filter: publicFormatter('table_name'),
|
||||
minWidth: 110
|
||||
},
|
||||
@ -142,25 +118,25 @@ export default {
|
||||
// 班次基础信息列表
|
||||
list: [],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:energy-quantity-manual:create')
|
||||
this.$auth.hasPermi('base:energy-quantity-manual:create')
|
||||
? {
|
||||
type: 'meterReading',
|
||||
btnName: '抄表'
|
||||
}
|
||||
type: 'meterReading',
|
||||
btnName: '抄表'
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:energy-quantity-manual:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑'
|
||||
}
|
||||
type: 'edit',
|
||||
btnName: '编辑'
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:energy-quantity-manual:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除'
|
||||
}
|
||||
type: 'delete',
|
||||
btnName: '删除'
|
||||
}
|
||||
: undefined
|
||||
].filter((v)=>v),
|
||||
].filter((v) => v),
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
@ -209,10 +185,10 @@ export default {
|
||||
break
|
||||
default:
|
||||
this.$modal.confirm('是否确认导出').then(() => {
|
||||
return energyQuantityManualExport({...this.queryParams});
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '能源报表.xls');
|
||||
}).catch(() => {})
|
||||
return energyQuantityManualExport({ energyTypeId: this.queryParams.energyTypeId, recordTime: this.queryParams.recordTime });
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '能源报表.xls');
|
||||
}).catch(() => { })
|
||||
}
|
||||
},
|
||||
/** 查询列表 */
|
||||
@ -281,13 +257,13 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
console.log(row.id)
|
||||
this.$modal.confirm('是否确认删除能源类型为"' + row.energyType + '"的数据项?').then(function() {
|
||||
return energyQuantityManualDelete({id: row.id});
|
||||
}).then(() => {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
this.$modal.confirm('是否确认删除能源类型为"' + row.energyType + '"的数据项?').then(function () {
|
||||
return energyQuantityManualDelete({ id: row.id });
|
||||
}).then(() => {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -2,27 +2,12 @@
|
||||
<div class="app-container">
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick"
|
||||
/>
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:selectWidth="55"
|
||||
:max-height="tableH"
|
||||
@selection-change="selectChange"
|
||||
/>
|
||||
<pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
|
||||
:selectWidth="55" :max-height="tableH" @selection-change="selectChange" />
|
||||
<pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
|
||||
@pagination="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -71,7 +56,8 @@ export default {
|
||||
type: 'select',
|
||||
label: '能源类型',
|
||||
selectOptions: [],
|
||||
param: 'energyTypeId'
|
||||
param: 'energyTypeId',
|
||||
filterable: true
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
@ -129,7 +115,7 @@ export default {
|
||||
let arr = location.href.split('?')[1].split('&')
|
||||
this.formConfig[1].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
|
||||
} else {
|
||||
this.formConfig[1].defaultSelect = [Date.now() - 7*24*3600000, Date.now()]
|
||||
this.formConfig[1].defaultSelect = [Date.now() - 7 * 24 * 3600000, Date.now()]
|
||||
}
|
||||
this.queryParams.startTime = this.formConfig[1].defaultSelect[0]
|
||||
this.queryParams.endTime = this.formConfig[1].defaultSelect[1]
|
||||
@ -146,7 +132,7 @@ export default {
|
||||
let arr = location.href.split('?')[1].split('&')
|
||||
this.formConfig[1].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
|
||||
} else {
|
||||
this.formConfig[1].defaultSelect = [Date.now() - 7*24*3600000, Date.now()]
|
||||
this.formConfig[1].defaultSelect = [Date.now() - 7 * 24 * 3600000, Date.now()]
|
||||
}
|
||||
this.queryParams.startTime = this.formConfig[1].defaultSelect[0]
|
||||
this.queryParams.endTime = this.formConfig[1].defaultSelect[1]
|
||||
@ -193,7 +179,7 @@ export default {
|
||||
if (this.exportList.length > 0) {
|
||||
let body = this.exportList.map((x) => [
|
||||
x.objName,
|
||||
x.objRemark,
|
||||
x.objCode,
|
||||
x.energyTypeName,
|
||||
x.startValue,
|
||||
x.endValue,
|
||||
|
@ -16,10 +16,7 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位" prop="unit">
|
||||
<el-select v-model="form.unit" placeholder="请选择" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in getDictDatas(DICT_TYPE.ENERGY_UNIT)"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
<el-option v-for="item in getDictDatas(DICT_TYPE.ENERGY_UNIT)" :key="item.value" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
@ -28,9 +25,9 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="计价方式" prop="pricingMethod">
|
||||
<el-select v-model="form.pricingMethod" placeholder="请选择" style="width: 100%;">
|
||||
<el-option label="时间段" :value= '0' ></el-option>
|
||||
<el-option label="使用量" :value= '1' ></el-option>
|
||||
<el-option label="固定价位" :value= '2' ></el-option>
|
||||
<el-option label="时间段" :value='0'></el-option>
|
||||
<el-option label="使用量" :value='1'></el-option>
|
||||
<el-option label="固定价位" :value='2'></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -38,56 +35,33 @@
|
||||
<el-row>
|
||||
<el-col :span="12" v-show="form.pricingMethod === 2">
|
||||
<el-form-item label="单价(元)" prop="pricingMethod">
|
||||
<el-input-number v-model="form.singlePrice" :precision="2" :min="0" :max="999999999" style="width: 100%;"></el-input-number>
|
||||
<el-input-number v-model="form.singlePrice" :precision="2" :min="0" :max="999999999"
|
||||
style="width: 100%;"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-show="form.pricingMethod === 1">
|
||||
<el-form-item label="计量维度" prop="dim">
|
||||
<el-select v-model="form.dim" placeholder="请选择" style="width: 100%;">
|
||||
<el-option label="月" :value= '4' ></el-option>
|
||||
<el-option label="年" :value= '5' ></el-option>
|
||||
<el-option label="月" :value='4'></el-option>
|
||||
<el-option label="年" :value='5'></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-show="form.pricingMethod === 0">
|
||||
<el-col :span="24" v-show="form.pricingMethod === 0">
|
||||
<el-form-item label="时间段" prop="pricingMethod">
|
||||
<base-table
|
||||
:key='timeKye'
|
||||
:table-props="tableProps1"
|
||||
:table-data="tableData1"
|
||||
:add-button-show="addButtonShow"
|
||||
@emitButtonClick="emitButtonClick1"
|
||||
@emitFun="inputChange1"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick1"
|
||||
/>
|
||||
<base-table :key='timeKye' :table-props="tableProps1" :table-data="tableData1"
|
||||
:add-button-show="addButtonShow" @emitButtonClick="emitButtonClick1" @emitFun="inputChange1">
|
||||
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn"
|
||||
@clickBtn="handleClick1" />
|
||||
</base-table>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-show="form.pricingMethod === 1">
|
||||
<el-form-item label="使用量" prop="pricingMethod">
|
||||
<base-table
|
||||
:key='usedKye'
|
||||
:table-props="tableProps2"
|
||||
:table-data="tableData2"
|
||||
:add-button-show="addButtonShow"
|
||||
@emitButtonClick="emitButtonClick2"
|
||||
@emitFun="inputChange2"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick2"
|
||||
/>
|
||||
<base-table :key='usedKye' :table-props="tableProps2" :table-data="tableData2"
|
||||
:add-button-show="addButtonShow" @emitButtonClick="emitButtonClick2" @emitFun="inputChange2">
|
||||
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn"
|
||||
@clickBtn="handleClick2" />
|
||||
</base-table>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -152,10 +126,12 @@ export default {
|
||||
id: '',
|
||||
name: '',
|
||||
code: '',
|
||||
nuit: '',
|
||||
unit: '',
|
||||
singlePrice: 0,
|
||||
pricingMethod: 2,
|
||||
leaderName: '',
|
||||
push: false
|
||||
dim: '',
|
||||
push: false,
|
||||
description: ''
|
||||
},
|
||||
isEdit: false, //是否是编辑
|
||||
rules: {
|
||||
@ -182,22 +158,24 @@ export default {
|
||||
if (id) {
|
||||
this.isEdit = true
|
||||
this.form.id = id
|
||||
getEnergyType( id ).then((res) => {
|
||||
getEnergyType(id).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.form.name = res.data.name
|
||||
this.form.code = res.data.code
|
||||
this.form.nuit = res.data.nuit
|
||||
this.form.unit = res.data.unit
|
||||
this.form.pricingMethod = res.data.pricingMethod
|
||||
this.form.leaderName = res.data.leaderName
|
||||
this.form.push = res.data.push ? true : false
|
||||
switch(this.form.pricingMethod) {
|
||||
this.form.push = res.data.push ? true : false
|
||||
this.form.description = res.data.description
|
||||
switch (this.form.pricingMethod) {
|
||||
case 0:
|
||||
this.tableData1 = this.form.segPriceList || []
|
||||
this.tableData1 = res.data.segPriceList || []
|
||||
break;
|
||||
case 1:
|
||||
this.tableData2 = this.form.usedPriceList || []
|
||||
this.tableData2 = res.data.usedPriceList || []
|
||||
this.form.dim = res.data.dim
|
||||
break;
|
||||
default:
|
||||
this.form.singlePrice = res.data.singlePrice || 0
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -233,24 +211,16 @@ export default {
|
||||
// 增加
|
||||
emitButtonClick1() {
|
||||
let n = this.tableData1.length
|
||||
// if (n >=3) {
|
||||
// this.$modal.msgWarning('最多可添加3档计价')
|
||||
// return false
|
||||
// }
|
||||
let obj = {}
|
||||
obj.startTime = n === 0 ? '' : this.tableData1[n-1].endTime
|
||||
obj.startTime = n === 0 ? '' : this.tableData1[n - 1].endTime
|
||||
obj.endTime = ''
|
||||
obj.price = 0
|
||||
this.tableData1.push(obj)
|
||||
},
|
||||
emitButtonClick2() {
|
||||
let n = this.tableData2.length
|
||||
if (n >=3) {
|
||||
this.$modal.msgWarning('最多可添加3档计价')
|
||||
return false
|
||||
}
|
||||
let obj = {}
|
||||
obj.startUsed = n === 0 ? 0 : this.tableData2[n-1].endUsed
|
||||
obj.startUsed = n === 0 ? 0 : this.tableData2[n - 1].endUsed
|
||||
obj.endUsed = 0
|
||||
obj.price = 0
|
||||
this.tableData2.push(obj)
|
||||
@ -267,7 +237,7 @@ export default {
|
||||
submitForm() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
switch(this.form.pricingMethod) {
|
||||
switch (this.form.pricingMethod) {
|
||||
case 0:// 时间段
|
||||
if (this.tableData1.length === 0) {
|
||||
this.$modal.msgError('时间段表格数据不能为空')
|
||||
@ -297,7 +267,7 @@ export default {
|
||||
default:// 固定单价
|
||||
if (!this.form.singlePrice) {
|
||||
this.$modal.msgError('单价有误请检查,请检查')
|
||||
return false
|
||||
return false
|
||||
}
|
||||
}
|
||||
console.log(this.form)
|
||||
@ -310,11 +280,11 @@ export default {
|
||||
unit: this.form.unit,
|
||||
pricingMethod: this.form.pricingMethod,
|
||||
description: this.form.description,
|
||||
dim: this.form.pricingMethod === 1 ? this.form.dim: '',
|
||||
dim: this.form.pricingMethod === 1 ? this.form.dim : '',
|
||||
singlePrice: this.form.pricingMethod === 2 ? this.form.singlePrice : '',
|
||||
segPriceList: this.form.pricingMethod === 0 ? this.tableData1: [],
|
||||
usedPriceList: this.form.pricingMethod === 1 ? this.tableData2: [],
|
||||
push:this.form.push ? 1 : 0
|
||||
segPriceList: this.form.pricingMethod === 0 ? this.tableData1 : [],
|
||||
usedPriceList: this.form.pricingMethod === 1 ? this.tableData2 : [],
|
||||
push: this.form.push ? 1 : 0
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
@ -328,11 +298,11 @@ export default {
|
||||
unit: this.form.unit,
|
||||
pricingMethod: this.form.pricingMethod,
|
||||
description: this.form.description,
|
||||
dim: this.form.pricingMethod === 1 ? this.form.dim: '',
|
||||
dim: this.form.pricingMethod === 1 ? this.form.dim : '',
|
||||
singlePrice: this.form.pricingMethod === 2 ? this.form.singlePrice : '',
|
||||
segPriceList: this.form.pricingMethod === 0 ? this.tableData1: [],
|
||||
usedPriceList: this.form.pricingMethod === 1 ? this.tableData2: [],
|
||||
push:this.form.push ? 1 : 0
|
||||
segPriceList: this.form.pricingMethod === 0 ? this.tableData1 : [],
|
||||
usedPriceList: this.form.pricingMethod === 1 ? this.tableData2 : [],
|
||||
push: this.form.push ? 1 : 0
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
|
@ -2,40 +2,22 @@
|
||||
<div class="app-container energyOverlimitLog">
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick"
|
||||
/>
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<el-tabs v-model="activeName" @tab-click="toggleTab">
|
||||
<el-tab-pane label="自动抄表" name="auto"></el-tab-pane>
|
||||
<el-tab-pane label="手动抄表" name="manual"></el-tab-pane>
|
||||
</el-tabs>
|
||||
<!-- 列表 -->
|
||||
<div v-if="activeName === 'auto'">
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
/>
|
||||
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
|
||||
:max-height="tableH" />
|
||||
</div>
|
||||
<div v-if="activeName === 'manual'">
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps2"
|
||||
:table-data="list2"
|
||||
:max-height="tableH"
|
||||
/>
|
||||
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps2"
|
||||
:table-data="list2" :max-height="tableH" />
|
||||
</div>
|
||||
<pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
|
||||
@pagination="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -160,8 +142,8 @@ export default {
|
||||
method: '1'
|
||||
},
|
||||
typeList: [
|
||||
{id: 1, name: '合并'},
|
||||
{id: 2, name: '详细'}
|
||||
{ id: 1, name: '合并' },
|
||||
{ id: 2, name: '详细' }
|
||||
]
|
||||
};
|
||||
},
|
||||
@ -183,7 +165,7 @@ export default {
|
||||
getList() {
|
||||
getEnergyOverlimitLogPage(this.queryParams).then(response => {
|
||||
let arr = response.data.list || [];
|
||||
arr&&arr.map((item) => {
|
||||
arr && arr.map((item) => {
|
||||
this.typeList.map((i) => {
|
||||
if (item.type === i.id) {
|
||||
item.type = i.name
|
||||
@ -191,15 +173,21 @@ export default {
|
||||
})
|
||||
if (item.minValue && item.maxValue) {
|
||||
item.limitValue = item.minValue + '-' + item.maxValue
|
||||
} else if(item.minValue){
|
||||
} else if (item.minValue) {
|
||||
item.limitValue = '最小值' + item.minValue
|
||||
}else if(item.maxValue){
|
||||
} else if (item.maxValue) {
|
||||
item.limitValue = '最大值' + item.maxValue
|
||||
} else {
|
||||
item.limitValue = ''
|
||||
}
|
||||
})
|
||||
this.list = arr
|
||||
if (this.queryParams.method === '1') {
|
||||
this.list = arr
|
||||
this.list2 = []
|
||||
} else {
|
||||
this.list2 = arr
|
||||
this.list1 = []
|
||||
}
|
||||
this.total = response.data.total;
|
||||
});
|
||||
},
|
||||
@ -212,7 +200,7 @@ export default {
|
||||
toggleTab() {
|
||||
if (this.activeName === 'auto') {
|
||||
this.queryParams.method = '1'
|
||||
}else{
|
||||
} else {
|
||||
this.queryParams.method = '2'
|
||||
}
|
||||
this.queryParams.pageNo = 1
|
||||
@ -232,21 +220,27 @@ export default {
|
||||
height: 2px;
|
||||
background-color: #e4e7ed;
|
||||
}
|
||||
|
||||
.el-tabs__nav-wrap::after {
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.el-tabs__item {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.el-tabs__item:hover {
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
}
|
||||
|
||||
.el-tabs__item.is-active {
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
}
|
||||
|
||||
.el-tabs__item {
|
||||
color: rgba(0, 0, 0, 0.45);
|
||||
}
|
||||
|
||||
.searchBarBox {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
@ -35,20 +35,20 @@ import {
|
||||
} from '@/api/equipment/analysis/statistics';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'recordTime',
|
||||
label: '时间段',
|
||||
filter: (val) => {
|
||||
if (val && val.length > 0) {
|
||||
return (
|
||||
moment(val[0]).format('YYYY-MM-DD HH:mm:ss') +
|
||||
' ~ ' +
|
||||
moment(val[1]).format('YYYY-MM-DD HH:mm:ss')
|
||||
);
|
||||
}
|
||||
return '-';
|
||||
},
|
||||
},
|
||||
// {
|
||||
// prop: 'recordTime',
|
||||
// label: '时间段',
|
||||
// filter: (val) => {
|
||||
// if (val && val.length > 0) {
|
||||
// return (
|
||||
// moment(val[0]).format('YYYY-MM-DD HH:mm:ss') +
|
||||
// ' ~ ' +
|
||||
// moment(val[1]).format('YYYY-MM-DD HH:mm:ss')
|
||||
// );
|
||||
// }
|
||||
// return '-';
|
||||
// },
|
||||
// },
|
||||
{
|
||||
prop: 'lineName',
|
||||
label: '产线',
|
||||
@ -158,7 +158,7 @@ export default {
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'warning',
|
||||
color: 'primary',
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
|
@ -19,6 +19,7 @@
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
max-height="600"
|
||||
@emitFun="handleEmitFun">
|
||||
<!-- <method-btn
|
||||
v-if="tableBtn.length"
|
||||
@ -93,17 +94,29 @@ export default {
|
||||
{ prop: 'downCount', label: '故障次数' },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
// {
|
||||
// type: 'select',
|
||||
// label: '请选择月份',
|
||||
// placeholder: '请选择月份',
|
||||
// param: 'month',
|
||||
// selectOptions: Array(12)
|
||||
// .fill(0)
|
||||
// .map((v, i) => ({
|
||||
// id: i + 1,
|
||||
// name: `${i + 1}月`,
|
||||
// })),
|
||||
// },
|
||||
{
|
||||
type: 'select',
|
||||
label: '请选择月份',
|
||||
placeholder: '请选择月份',
|
||||
type: 'datePicker',
|
||||
label: '时间',
|
||||
dateType: 'month',
|
||||
format: 'yyyy-MM',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
width: 240,
|
||||
param: 'month',
|
||||
selectOptions: Array(12)
|
||||
.fill(0)
|
||||
.map((v, i) => ({
|
||||
id: i + 1,
|
||||
name: `${i + 1}月`,
|
||||
})),
|
||||
},
|
||||
{
|
||||
__index: 'line',
|
||||
@ -111,6 +124,7 @@ export default {
|
||||
label: '产线',
|
||||
placeholder: '请选择产线',
|
||||
param: 'lineId',
|
||||
filterable: true
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@ -164,7 +178,13 @@ export default {
|
||||
},
|
||||
});
|
||||
if (code === 0) {
|
||||
this.list = data;
|
||||
this.list = data.map(item => {
|
||||
item.mtbf = item.mtbf?.toFixed(2)
|
||||
item.mttr = item.mttr?.toFixed(2)
|
||||
item.workTime = item.workTime?.toFixed(2)
|
||||
item.downTime = item.downTime?.toFixed(2)
|
||||
return item
|
||||
});
|
||||
} else {
|
||||
this.list.splice(0);
|
||||
}
|
||||
@ -174,12 +194,14 @@ export default {
|
||||
switch (btn.btnName) {
|
||||
case 'search':
|
||||
if (btn.month) {
|
||||
this.queryParams.recordTime = [
|
||||
moment()
|
||||
.month(btn.month - 1)
|
||||
.format('YYYY-MM') + '-01 00:00:00',
|
||||
moment().month(btn.month).format('YYYY-MM') + '-01 00:00:00',
|
||||
];
|
||||
// this.queryParams.recordTime = [
|
||||
// moment()
|
||||
// .month(btn.month - 1)
|
||||
// .format('YYYY-MM') + '-01 00:00:00',
|
||||
// moment().month(btn.month).format('YYYY-MM') + '-01 00:00:00',
|
||||
// ];
|
||||
this.queryParams.recordTime = [btn.month, moment().month(new Date(btn.month).getMonth() + 1).format('YYYY-MM') + '-01 00:00:00']
|
||||
console.log(btn.month, moment().month(new Date(btn.month).getMonth() + 1).format('YYYY-MM') + '-01 00:00:00')
|
||||
} else {
|
||||
this.queryParams.recordTime = null;
|
||||
}
|
||||
|
@ -38,7 +38,7 @@
|
||||
import SmallTitle from './SmallTitle';
|
||||
import { getworkerAll } from '@/api/base/materialUseLog';
|
||||
import Editor from '@/components/Editor';
|
||||
import DialogForm from '@/components/DialogForm';
|
||||
import DialogForm from './DialogForm';
|
||||
|
||||
export default {
|
||||
name: 'AlarmHandle',
|
||||
|
520
src/views/equipment/base/alarm/Record/DialogForm.vue
Normal file
520
src/views/equipment/base/alarm/Record/DialogForm.vue
Normal file
@ -0,0 +1,520 @@
|
||||
<!--
|
||||
filename: dialogForm.vue
|
||||
author: liubin
|
||||
date: 2023-08-15 10:32:36
|
||||
description: 弹窗的表单组件
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:label-width="`${labelWidth}px`"
|
||||
:size="size"
|
||||
:label-position="labelPosition"
|
||||
v-loading="formLoading">
|
||||
<el-row :gutter="20" v-for="(row, rindex) in rows" :key="rindex">
|
||||
<el-col v-for="col in row" :key="col.label" :span="24 / row.length">
|
||||
<el-form-item :label="col.label" :prop="col.prop" :rules="col.rules">
|
||||
<el-input
|
||||
v-if="col.input"
|
||||
v-model="form[col.prop]"
|
||||
@change="$emit('update', form)"
|
||||
:placeholder="`请输入${col.label}`"
|
||||
:disabled="disabled"
|
||||
v-bind="col.bind" />
|
||||
<el-input
|
||||
v-if="col.textarea"
|
||||
type="textarea"
|
||||
v-model="form[col.prop]"
|
||||
:disabled="disabled"
|
||||
@change="$emit('update', form)"
|
||||
:placeholder="`请输入${col.label}`"
|
||||
v-bind="col.bind" />
|
||||
<el-select
|
||||
v-if="col.select"
|
||||
v-model="form[col.prop]"
|
||||
:placeholder="`请选择${col.label}`"
|
||||
:disabled="disabled"
|
||||
@change="$emit('update', form)"
|
||||
v-bind="col.bind">
|
||||
<el-option
|
||||
v-for="opt in optionListOf[col.prop]"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
<el-date-picker
|
||||
v-if="col.datetime"
|
||||
v-model="form[col.prop]"
|
||||
type="datetime"
|
||||
:disabled="disabled"
|
||||
:placeholder="`请选择${col.label}`"
|
||||
value-format="timestamp"
|
||||
@change="$emit('update', form)"
|
||||
v-bind="col.bind"></el-date-picker>
|
||||
<el-switch
|
||||
v-if="col.switch"
|
||||
v-model="form[col.prop]"
|
||||
:disabled="disabled"
|
||||
active-color="#0b58ff"
|
||||
inactive-color="#e1e1e1"
|
||||
@change="$emit('update', form)"
|
||||
v-bind="col.bind"></el-switch>
|
||||
<component
|
||||
v-if="col.subcomponent"
|
||||
:key="col.key"
|
||||
:disabled="disabled"
|
||||
:read-only="disabled"
|
||||
:is="col.subcomponent"
|
||||
v-model="form[col.prop]"
|
||||
:inlineStyle="col.style"
|
||||
@on-change="$emit('update', form)"
|
||||
v-bind="col.bind"></component>
|
||||
|
||||
<div
|
||||
class="upload-area"
|
||||
:class="uploadOpen ? '' : 'height-48'"
|
||||
ref="uploadArea"
|
||||
:key="col.prop"
|
||||
v-if="col.upload">
|
||||
<span class="close-icon" :class="uploadOpen ? 'open' : ''">
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-arrow-right"
|
||||
@click="handleFilesOpen" />
|
||||
</span>
|
||||
<!-- :file-list="uploadedFileList" -->
|
||||
<el-upload
|
||||
v-if="col.upload"
|
||||
class="upload-in-dialog"
|
||||
:key="col.prop + '__el-upload'"
|
||||
:action="uploadUrl"
|
||||
:headers="uploadHeaders"
|
||||
:show-file-list="false"
|
||||
icon="el-icon-upload2"
|
||||
:disabled="disabled"
|
||||
:before-upload="beforeUpload"
|
||||
:on-success="
|
||||
(response, file, fileList) => {
|
||||
handleUploadSuccess(response, file, col.prop);
|
||||
}
|
||||
"
|
||||
v-bind="col.bind">
|
||||
<el-button
|
||||
size="mini"
|
||||
:disabled="disabled || col.bind?.disabled || false">
|
||||
<svg-icon
|
||||
icon-class="icon-upload"
|
||||
style="color: inherit"></svg-icon>
|
||||
上传文件
|
||||
</el-button>
|
||||
<div class="el-upload__tip" slot="tip" v-if="col.uploadTips">
|
||||
{{ col.uploadTips || '只能上传jpg/png文件, 大小不超过2MB' }}
|
||||
</div>
|
||||
</el-upload>
|
||||
|
||||
<uploadedFile
|
||||
class="file"
|
||||
v-for="file in form[col.prop]"
|
||||
:file="file"
|
||||
:key="file.fileUrl"
|
||||
:disabled="disabled"
|
||||
@delete="!disabled && handleDeleteFile(file, col.prop)" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getAccessToken } from '@/utils/auth';
|
||||
import tupleImg from '@/assets/images/tuple.png';
|
||||
import cache from '@/utils/cache';
|
||||
|
||||
/**
|
||||
* 找到最长的label
|
||||
* @param {*} options
|
||||
*/
|
||||
function findMaxLabelWidth(rows) {
|
||||
let max = 0;
|
||||
rows.forEach((row) => {
|
||||
row.forEach((opt) => {
|
||||
// debugger;
|
||||
if (!opt.label) return 0;
|
||||
if (opt.label.length > max) {
|
||||
max = opt.label.length;
|
||||
if (opt.label.includes('(')) {
|
||||
max = max - 3;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
return max;
|
||||
}
|
||||
|
||||
const uploadedFile = {
|
||||
name: 'UploadedFile',
|
||||
props: ['file', 'disabled'],
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
handleDelete() {
|
||||
this.$emit('delete', this.file);
|
||||
},
|
||||
async handleDownload() {
|
||||
const data = await this.$axios({
|
||||
url: this.file.fileUrl,
|
||||
method: 'get',
|
||||
responseType: 'blob',
|
||||
});
|
||||
|
||||
await this.$message.success('开始下载');
|
||||
// create download link
|
||||
const url = window.URL.createObjectURL(data);
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.download = this.file.fileName;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
render: function (h) {
|
||||
return (
|
||||
<div
|
||||
title={this.file.fileName}
|
||||
onClick={this.handleDownload}
|
||||
style={{
|
||||
background: `url(${tupleImg}) no-repeat`,
|
||||
backgroundSize: '14px',
|
||||
backgroundPosition: '0 55%',
|
||||
paddingLeft: '20px',
|
||||
paddingRight: '24px',
|
||||
textOverflow: 'ellipsis',
|
||||
whiteSpace: 'nowrap',
|
||||
overflow: 'hidden',
|
||||
cursor: 'pointer',
|
||||
display: 'inline-block',
|
||||
}}>
|
||||
{this.file.fileName}
|
||||
{!this.disabled && (
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-close"
|
||||
style="float: right; position: relative; top: 2px; left: 8px; z-index: 100"
|
||||
class="dialog__upload_component__close"
|
||||
onClick={this.handleDelete}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'DialogForm',
|
||||
model: {
|
||||
prop: 'dataForm',
|
||||
event: 'update',
|
||||
},
|
||||
emits: ['update'],
|
||||
components: { uploadedFile },
|
||||
props: {
|
||||
rows: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
dataForm: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
hasFiles: {
|
||||
type: Boolean | Array,
|
||||
default: false,
|
||||
},
|
||||
labelPosition: {
|
||||
type: String,
|
||||
default: 'right',
|
||||
},
|
||||
size: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
uploadOpen: false,
|
||||
form: {},
|
||||
formLoading: true,
|
||||
optionListOf: {},
|
||||
uploadedFileList: [],
|
||||
dataLoaded: false,
|
||||
uploadHeaders: { Authorization: 'Bearer ' + getAccessToken() },
|
||||
uploadUrl: process.env.VUE_APP_BASE_API + '/admin-api/infra/file/upload', // 上传有关的headers,url都是固定的
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
labelWidth() {
|
||||
let max = findMaxLabelWidth(this.rows);
|
||||
// 每个汉字占20px
|
||||
return max * 20;
|
||||
// return max * 20 + 'px';
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
rows: {
|
||||
handler() {
|
||||
this.$nextTick(() => {
|
||||
this.handleOptions('watch');
|
||||
});
|
||||
},
|
||||
deep: true,
|
||||
immediate: false,
|
||||
},
|
||||
dataForm: {
|
||||
handler(val) {
|
||||
this.form = JSON.parse(JSON.stringify(val));
|
||||
if (this.hasFiles) {
|
||||
if (typeof this.hasFiles == 'boolean' && this.hasFiles) {
|
||||
this.form.files = this.form.files ?? [];
|
||||
} else if (Array.isArray(this.hasFiles)) {
|
||||
this.hasFiles.forEach((prop) => {
|
||||
this.form[prop] = this.form[prop] ?? [];
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
// 处理 options
|
||||
this.handleOptions();
|
||||
},
|
||||
methods: {
|
||||
/** 模拟透传 ref */
|
||||
validate(cb) {
|
||||
return this.$refs.form.validate(cb);
|
||||
},
|
||||
resetFields(args) {
|
||||
return this.$refs.form.resetFields(args);
|
||||
},
|
||||
// getCode
|
||||
async getCode(url) {
|
||||
const response = await this.$axios(url);
|
||||
return response.data;
|
||||
},
|
||||
async handleOptions(trigger = 'monuted') {
|
||||
console.log('[dialogForm:handleOptions]');
|
||||
const promiseList = [];
|
||||
this.rows.forEach((cols) => {
|
||||
cols.forEach((opt) => {
|
||||
if (opt.value && !this.form[opt.prop]) {
|
||||
// 默认值
|
||||
this.form[opt.prop] = opt.value;
|
||||
}
|
||||
|
||||
if (opt.options) {
|
||||
this.$set(this.optionListOf, opt.prop, opt.options);
|
||||
} else if (opt.url) {
|
||||
// 如果有 depends,则暂时先不获取,注册一个watcher
|
||||
if (opt.depends) {
|
||||
this.$watch(
|
||||
() => this.form[opt.depends],
|
||||
(id) => {
|
||||
console.log('<', opt.depends, '>', 'changed', id);
|
||||
if (id == null) return;
|
||||
// 清空原有选项
|
||||
this.form[opt.prop] = null;
|
||||
// 获取新的选项
|
||||
this.$axios({
|
||||
url: `${opt.url}?id=${id}`,
|
||||
}).then((res) => {
|
||||
this.$set(
|
||||
this.optionListOf,
|
||||
opt.prop,
|
||||
res.data.map((item) => ({
|
||||
label: item[opt.labelKey ?? 'name'],
|
||||
value: item[opt.valueKey ?? 'id'],
|
||||
}))
|
||||
);
|
||||
});
|
||||
},
|
||||
{
|
||||
immediate: false,
|
||||
}
|
||||
);
|
||||
return;
|
||||
}
|
||||
// 如果是下拉框,或者新增模式下的输入框,才去请求
|
||||
if (opt.select || (opt.input && !this.form?.id)) {
|
||||
promiseList.push(async () => {
|
||||
const response = await this.$axios(opt.url, {
|
||||
method: opt.method ?? 'get',
|
||||
// data: opt.method == 'post' ? opt.queryParams : null
|
||||
});
|
||||
// console.log('[dialogForm:handleOptions:response]', response);
|
||||
if (opt.select) {
|
||||
// 处理下拉框选项
|
||||
const list =
|
||||
'list' in response.data
|
||||
? response.data.list
|
||||
: response.data;
|
||||
|
||||
if (opt.cache) {
|
||||
cache.store(opt.cache, list);
|
||||
}
|
||||
|
||||
this.$set(
|
||||
this.optionListOf,
|
||||
opt.prop,
|
||||
list.map((item) => ({
|
||||
label: item[opt.labelKey ?? 'name'],
|
||||
value: item[opt.valueKey ?? 'id'],
|
||||
}))
|
||||
);
|
||||
} else if (opt.input) {
|
||||
console.log('setting code: ', response.data);
|
||||
// 处理输入框数据
|
||||
this.form[opt.prop] = response.data;
|
||||
// 更新下外部的 dataForm,防止code字段有数据也报空的bug
|
||||
this.$emit('update', this.form);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
console.log('[dialogForm:handleOptions] done!');
|
||||
|
||||
// 如果是 watch 触发的,不需要执行进一步的请求
|
||||
if (trigger == 'watch') {
|
||||
this.formLoading = false;
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await Promise.all(promiseList.map((fn) => fn()));
|
||||
this.formLoading = false;
|
||||
this.dataLoaded = true;
|
||||
// console.log("[dialogForm:handleOptions:optionListOf]", this.optionListOf)
|
||||
} catch (error) {
|
||||
console.log('[dialogForm:handleOptions:error]', error);
|
||||
this.formLoading = false;
|
||||
}
|
||||
if (!promiseList.length) this.formLoading = false;
|
||||
},
|
||||
|
||||
// 上传成功的特殊处理
|
||||
beforeUpload(file) {
|
||||
const checkFileSize = () => {
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
if (!isLt2M) {
|
||||
this.$modal.msgError('上传文件大小不能超过 2MB!');
|
||||
}
|
||||
return isLt2M;
|
||||
};
|
||||
const checkFileType = () => {
|
||||
const isJPG =
|
||||
file.type === 'image/jpeg' ||
|
||||
file.type === 'image/png' ||
|
||||
file.type === 'image/jpg';
|
||||
return isJPG;
|
||||
};
|
||||
// return checkFileSize() && checkFileType();
|
||||
return checkFileSize();
|
||||
},
|
||||
|
||||
// 上传前的验证规则可通过 bind 属性传入
|
||||
handleUploadSuccess(response, file, prop) {
|
||||
console.log('[handleUploadSuccess]', response, file, prop);
|
||||
this.form[prop].push({
|
||||
fileName: file.name,
|
||||
fileUrl: response.data,
|
||||
fileType: prop == 'files' ? 2 : 1,
|
||||
});
|
||||
this.$modal.msgSuccess('上传成功');
|
||||
this.$emit('update', this.form);
|
||||
},
|
||||
|
||||
getFileName(fileUrl) {
|
||||
return fileUrl.split('/').pop();
|
||||
},
|
||||
|
||||
handleFilesOpen() {
|
||||
this.uploadOpen = !this.uploadOpen;
|
||||
},
|
||||
|
||||
handleDeleteFile(file, prop) {
|
||||
this.form[prop] = this.form[prop].filter(
|
||||
(item) => item.fileUrl != file.fileUrl
|
||||
);
|
||||
this.$emit('update', this.form);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.el-date-editor,
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.upload-area {
|
||||
// background: #ccc;
|
||||
// display: grid;
|
||||
// grid-auto-rows: 34px;
|
||||
// grid-template-columns: repeat(6, minmax(32px, max-content));
|
||||
// gap: 8px;
|
||||
// align-items: center;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: height 0.3s ease-out;
|
||||
}
|
||||
|
||||
.upload-in-dialog {
|
||||
// display: inline-block;
|
||||
margin-right: 24px;
|
||||
// background: #ccc;
|
||||
position: relative;
|
||||
// top: -13px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.close-icon {
|
||||
// background: #ccc;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 12px;
|
||||
z-index: 100;
|
||||
transition: transform 0.3s ease-out;
|
||||
}
|
||||
|
||||
.close-icon.open {
|
||||
transform: rotateZ(90deg);
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
.dialog__upload_component__close {
|
||||
color: #ccc;
|
||||
}
|
||||
.dialog__upload_component__close:hover {
|
||||
/* color: #777; */
|
||||
color: red;
|
||||
}
|
||||
|
||||
.height-48 {
|
||||
height: 35px !important;
|
||||
}
|
||||
</style>
|
@ -28,7 +28,7 @@
|
||||
<el-form-item
|
||||
label="报警级别"
|
||||
prop="grade"
|
||||
:rules="[{ required: true, message: '报警级别不能为空', trigger: 'blur' }]">
|
||||
:rules="[{ required: false, message: '报警级别不能为空', trigger: 'blur' }]">
|
||||
<el-select
|
||||
:disabled="disabled"
|
||||
v-model="dataForm.grade"
|
||||
|
@ -7,10 +7,11 @@
|
||||
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible="visible"
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="false"
|
||||
:wrapper-closable="true"
|
||||
class="drawer"
|
||||
:before-close="beforeClose"
|
||||
custom-class="mes-drawer"
|
||||
:size="size || '50%'"
|
||||
@closed="$emit('destroy')">
|
||||
@ -43,7 +44,51 @@
|
||||
:rows="formRows" /> -->
|
||||
|
||||
<!-- <el-row v-if="mode.includes('detail')" style="margin-bottom: 24px"> -->
|
||||
<el-row style="margin-bottom: 24px">
|
||||
<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="equipmentId"
|
||||
:rules="[{ required: true, message: '设备不能为空', trigger: 'change' }]">
|
||||
<el-select
|
||||
:disabled="isdetail"
|
||||
v-model="dataForm.equipmentId"
|
||||
placeholder="请选择设备"
|
||||
@change="$emit('update', dataForm)">
|
||||
<el-option
|
||||
v-for="opt in equipmentList"
|
||||
:key="opt.id"
|
||||
:label="opt.name"
|
||||
:value="opt.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="报警分组"
|
||||
prop="groupId"
|
||||
:rules="[{ required: true, message: '报警分组不能为空', trigger: 'change' }]">
|
||||
<el-select
|
||||
:disabled="isdetail"
|
||||
v-model="dataForm.groupId"
|
||||
placeholder="请选择报警分组"
|
||||
@change="$emit('update', dataForm)">
|
||||
<el-option
|
||||
v-for="opt in grouList"
|
||||
:key="opt.id"
|
||||
:label="opt.name"
|
||||
:value="opt.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<!-- <el-row style="margin-bottom: 24px">
|
||||
<el-col :span="8">
|
||||
<div
|
||||
class="title"
|
||||
@ -62,7 +107,7 @@
|
||||
{{ form.code }}
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row> -->
|
||||
<!-- <el-row v-else style="margin-bottom: 24px" :gutter="20">
|
||||
<el-form ref="form" :model="form">
|
||||
<el-col :span="8">
|
||||
@ -128,12 +173,11 @@
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<div v-if="!mode.includes('detail')" class="drawer-body__footer">
|
||||
<el-button style="" @click="handleCancel">取消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
v-if="!mode.includes('detail')"
|
||||
@click="handleCancel">
|
||||
@click="handleSave">
|
||||
确定
|
||||
</el-button>
|
||||
</div>
|
||||
@ -163,6 +207,8 @@
|
||||
<script>
|
||||
import BaseInfoForm from '@/components/DialogForm';
|
||||
import DialogForm from './dialogForm';
|
||||
import { getEquipmentList, getgroupAllList } from '@/api/equipment/base/config/config'
|
||||
import { updateEquipmentBindGroup } from '@/api/base/equipmentBindGroup';
|
||||
|
||||
const SmallTitle = {
|
||||
name: 'SmallTitle',
|
||||
@ -191,16 +237,21 @@ const SmallTitle = {
|
||||
|
||||
export default {
|
||||
components: { SmallTitle, DialogForm, BaseInfoForm },
|
||||
props: ['sections', 'defaultMode', 'dataId', 'size'], // dataId 作为一个通用的存放id的字段
|
||||
props: ['sections', 'defaultMode', 'dataId', 'size', 'equipmentId', 'id'], // dataId 作为一个通用的存放id的字段
|
||||
data() {
|
||||
return {
|
||||
mode: '',
|
||||
visible: false,
|
||||
showForm: false,
|
||||
isdetail: false,
|
||||
formLoading: false,
|
||||
grouList: [],
|
||||
equipmentList: [],
|
||||
total: 0,
|
||||
form: {},
|
||||
list: [],
|
||||
attrTitle: '',
|
||||
dataForm: {},
|
||||
attrForm: {
|
||||
id: null,
|
||||
equipmentGroupId: '',
|
||||
@ -325,6 +376,34 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// handleSave() {
|
||||
// updateEquipmentBindGroup(this.form).then((response) => {
|
||||
// this.$modal.msgSuccess('修改成功');
|
||||
// this.open = false;
|
||||
// this.getList();
|
||||
// });
|
||||
// },
|
||||
async getDict() {
|
||||
const res = await getEquipmentList({
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
special: false
|
||||
})
|
||||
this.equipmentList = res.data.list
|
||||
const groupRes = await getgroupAllList()
|
||||
this.grouList = groupRes.data
|
||||
},
|
||||
beforeClose(done) {
|
||||
if (this.mode.includes('edit')) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done();
|
||||
})
|
||||
.catch(_ => {});
|
||||
} else {
|
||||
done()
|
||||
}
|
||||
},
|
||||
handleTableBtnClick({ type, data }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
@ -342,6 +421,16 @@ export default {
|
||||
|
||||
init() {
|
||||
this.visible = true;
|
||||
// 设备分组传值
|
||||
// this.dataForm = {
|
||||
// equipmentId: this.equipmentId,
|
||||
// groupId: this.dataId
|
||||
// }
|
||||
this.getDict()
|
||||
this.$set(this.dataForm, 'equipmentId', this.equipmentId)
|
||||
this.$set(this.dataForm, 'groupId', this.dataId)
|
||||
this.$set(this.dataForm, 'id', this.id)
|
||||
this.isdetail = this.mode === 'detail' ? true : false
|
||||
},
|
||||
|
||||
async getAttrList() {
|
||||
@ -360,9 +449,9 @@ export default {
|
||||
if (valid) {
|
||||
const isEdit = !this.mode.includes('detail');
|
||||
await this.$axios({
|
||||
url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
|
||||
url: '/base/equipment-bind-group/update',
|
||||
method: isEdit ? 'put' : 'post',
|
||||
data: this.form,
|
||||
data: this.dataForm,
|
||||
});
|
||||
this.$modal.msgSuccess(`${isEdit ? '更新' : '创建'}成功`);
|
||||
this.visible = false;
|
||||
|
@ -48,6 +48,8 @@
|
||||
size="45%"
|
||||
:default-mode="editMode"
|
||||
:data-id="alarmForm.id"
|
||||
:equipment-id="equipmentId"
|
||||
:id="id"
|
||||
:sections="[
|
||||
{
|
||||
name: '基本信息',
|
||||
@ -220,7 +222,7 @@ export default {
|
||||
{
|
||||
select: true,
|
||||
label: '设备',
|
||||
url: '/base/core-equipment/page?pageNo=1&pageSize=100',
|
||||
url: '/base/core-equipment/page?pageNo=1&pageSize=100&special=false',
|
||||
prop: 'equipmentId',
|
||||
bind: {
|
||||
filterable: true,
|
||||
@ -266,6 +268,8 @@ export default {
|
||||
equipmentGroupCode: undefined,
|
||||
equipmentGroupName: undefined,
|
||||
},
|
||||
equipmentId: undefined,
|
||||
id: undefined,
|
||||
editVisible: false,
|
||||
editMode: '',
|
||||
drawerBaseInfoRows: [
|
||||
@ -440,6 +444,8 @@ export default {
|
||||
this.alarmForm.id = groupId;
|
||||
this.alarmForm.equipmentGroupCode = groupCode;
|
||||
this.alarmForm.equipmentGroupName = groupName;
|
||||
this.equipmentId = equipmentId;
|
||||
this.id = id;
|
||||
this.editVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['drawer'].init();
|
||||
|
@ -41,11 +41,14 @@
|
||||
<base-dialog
|
||||
:dialogTitle="title"
|
||||
:dialogVisible="open"
|
||||
width="700px"
|
||||
width="30%"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" />
|
||||
<!-- <DialogForm v-if="open" ref="form" v-model="form" :rows="rows" /> -->
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit" />
|
||||
</base-dialog>
|
||||
|
||||
<!-- 抽屉 详情 -->
|
||||
@ -123,11 +126,12 @@ import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
// import './http';
|
||||
import BasicDrawer from './components/BasicDrawer.vue';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
|
||||
export default {
|
||||
name: 'EquipmentPlcConnect',
|
||||
mixins: [basicPageMixin],
|
||||
components: { BasicDrawer },
|
||||
components: { BasicDrawer, AddOrUpdate },
|
||||
data() {
|
||||
return {
|
||||
searchBarKeys: ['equipmentId', 'plcId'],
|
||||
@ -343,6 +347,10 @@ export default {
|
||||
this.initSearchOptions();
|
||||
},
|
||||
methods: {
|
||||
successSubmit() {
|
||||
this.cancel()
|
||||
this.getList()
|
||||
},
|
||||
async getEquipmentOptions() {
|
||||
const res = await this.$axios({
|
||||
url: '/base/core-equipment/listAll',
|
||||
@ -371,7 +379,7 @@ export default {
|
||||
});
|
||||
this.searchBarFormConfig[1].selectOptions = plcList.map((item) => {
|
||||
return {
|
||||
name: item.name,
|
||||
name: item.code,
|
||||
id: item.id,
|
||||
};
|
||||
});
|
||||
@ -455,7 +463,10 @@ export default {
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = '添加设备与实时采集关系表(一对多)';
|
||||
this.title = '添加设备采集配置';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init()
|
||||
})
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
@ -464,31 +475,12 @@ export default {
|
||||
getEquipmentPlcConnect(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = '修改设备与实时采集关系表(一对多)';
|
||||
this.title = '修改设备采集配置';
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
updateEquipmentPlcConnect(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createEquipmentPlcConnect(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
this.$refs.addOrUpdate.dataFormSubmit()
|
||||
},
|
||||
|
||||
// 查看报警
|
||||
|
@ -218,9 +218,9 @@ export default {
|
||||
label: '是否采集', // 是否采集 0 代表不采集, 1 代表采集
|
||||
prop: 'collection',
|
||||
bind: {
|
||||
'active-value': 1,
|
||||
'active-value': 1,
|
||||
'inactive-value': 0,
|
||||
value: 1,
|
||||
value: 1,
|
||||
},
|
||||
},
|
||||
],
|
||||
@ -294,7 +294,7 @@ export default {
|
||||
name: undefined,
|
||||
enName: undefined,
|
||||
description: undefined,
|
||||
collection: undefined,
|
||||
collection: 1,
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
|
155
src/views/equipment/base/config/DataCollection/add-or-updata.vue
Normal file
155
src/views/equipment/base/config/DataCollection/add-or-updata.vue
Normal file
@ -0,0 +1,155 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-03-15 18:54:23
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="100px">
|
||||
<el-form-item label="设备" prop="equipmentId">
|
||||
<el-cascader
|
||||
placeholder="请选择设备"
|
||||
v-model="dataForm.equipmentId"
|
||||
:options="plLineList"
|
||||
:props="{value: 'id', label: 'name', children: 'children'}"
|
||||
style="width: 100%"
|
||||
filterable />
|
||||
</el-form-item>
|
||||
<el-form-item label="关联表名" prop="plcId">
|
||||
<el-select
|
||||
v-model="dataForm.plcId"
|
||||
filterable
|
||||
placeholder="请选择关联表"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="dict in plcList"
|
||||
:key="dict.id"
|
||||
:label="dict.plcTableName"
|
||||
:value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from '../../../../core/mixins/basic-add';
|
||||
import { createCorePL, updateCorePL, getCorePL, getCode } from "@/api/base/coreProductionLine";
|
||||
import { createEquipmentPlcConnect, updateEquipmentPlcConnect } from '@/api/base/equipmentPlcConnect';
|
||||
import { getplcAllList, getTree } from "@/api/equipment/base/config/config";
|
||||
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
isGetCode: true,
|
||||
codeURL: getCode,
|
||||
createURL: createCorePL,
|
||||
updateURL: updateCorePL,
|
||||
infoURL: getCorePL,
|
||||
},
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
equipmentId: undefined,
|
||||
plcId: undefined
|
||||
},
|
||||
plcList: [],
|
||||
plLineList: [],
|
||||
dataRule: {
|
||||
equipmentId: [{ required: true, message: "设备不能为空", trigger: "blur" }],
|
||||
plcId: [{ required: true, message: "关联表名不能为空", trigger: "blur" }]
|
||||
},
|
||||
options: [{
|
||||
value: 'zhinan',
|
||||
label: '指南',
|
||||
children: [{
|
||||
value: 'shejiyuanze',
|
||||
label: '设计原则',
|
||||
children: [{
|
||||
value: 'yizhi',
|
||||
label: '一致'
|
||||
}, {
|
||||
value: 'fankui',
|
||||
label: '反馈'
|
||||
}, {
|
||||
value: 'xiaolv',
|
||||
label: '效率'
|
||||
}, {
|
||||
value: 'kekong',
|
||||
label: '可控'
|
||||
}]
|
||||
}, {
|
||||
value: 'daohang',
|
||||
label: '导航'
|
||||
}]
|
||||
}]
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
})
|
||||
},
|
||||
async getDict() {
|
||||
// 关联表名列表
|
||||
const res = await getplcAllList();
|
||||
this.plcList = res.data;
|
||||
// 树形结构
|
||||
const res1 = await getTree();
|
||||
this.plLineList = res1.data;
|
||||
// const res1 = await getCorePLList();
|
||||
// this.plLineList = res1.data;
|
||||
// this.plLineList.forEach(item => {
|
||||
// listByParentId({ id: item.id }).then(resp => {
|
||||
// if (resp.data.length > 0) {
|
||||
// // item.children = resp.data
|
||||
// this.$set(item, 'children', resp.data)
|
||||
// // this.$forceUpdate()
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs["dataForm"].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
updateEquipmentPlcConnect({
|
||||
id: this.dataForm.id,
|
||||
equipmentId: this.dataForm.equipmentId[this.dataForm.equipmentId.length],
|
||||
plcId: this.dataForm.plcId
|
||||
}).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createEquipmentPlcConnect({
|
||||
id: this.dataForm.id,
|
||||
equipmentId: this.dataForm.equipmentId[this.dataForm.equipmentId.length - 1],
|
||||
plcId: this.dataForm.plcId
|
||||
}).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -99,7 +99,7 @@
|
||||
<el-option
|
||||
v-for="plc in plcList"
|
||||
:key="plc.id"
|
||||
:label="plc.name"
|
||||
:label="plc.plcTableName"
|
||||
:value="plc.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -404,9 +404,9 @@ export default {
|
||||
this.eqList = data;
|
||||
});
|
||||
this.$axios({
|
||||
url: '/base/equipment-plc/page',
|
||||
url: '/base/equipment-plc/listAll',
|
||||
}).then(({ code, data }) => {
|
||||
this.plcList = data.list;
|
||||
this.plcList = data;
|
||||
});
|
||||
}
|
||||
for (const section of this.sections) {
|
||||
|
65
src/views/equipment/base/inspection/Confirm/SmallTitle.vue
Normal file
65
src/views/equipment/base/inspection/Confirm/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>
|
251
src/views/equipment/base/inspection/Confirm/WaitingListTable.vue
Normal file
251
src/views/equipment/base/inspection/Confirm/WaitingListTable.vue
Normal file
@ -0,0 +1,251 @@
|
||||
<!--
|
||||
filename: WaitingListTable.vue
|
||||
author: liubin
|
||||
date: 2024-02-05 16:12:55
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-table
|
||||
:data="tableDataWithIndex"
|
||||
:border="true"
|
||||
@selection-change="handleSelectionChange"
|
||||
style="width: 100%"
|
||||
:header-cell-style="{
|
||||
background: '#f2f4f9',
|
||||
color: '#606266',
|
||||
}"
|
||||
class="waiting-list-table">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
:width="50"
|
||||
:selectable="checkSelectable" />
|
||||
<el-table-column prop="_pageIndex" width="80" align="center">
|
||||
<template slot="header">
|
||||
<el-popover placement="bottom-start" width="300" trigger="click">
|
||||
<div class="setting-box" style="max-height: 400px; overflow-y: auto">
|
||||
<el-checkbox
|
||||
v-for="(item, index) in tablePropsLabelList"
|
||||
:key="'cb' + index"
|
||||
v-model="selectedBox[index]"
|
||||
:label="item.label" />
|
||||
</div>
|
||||
<i slot="reference" class="el-icon-s-tools" />
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="selectedBox[0]"
|
||||
label="巡检单名称"
|
||||
prop="name"></el-table-column>
|
||||
<el-table-column v-if="selectedBox[1]" label="部门" prop="planName">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.department || '---' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="selectedBox[2]"
|
||||
label="巡检时间"
|
||||
prop="planCheckTime">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.planCheckTime | timeFilter }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="selectedBox[3]"
|
||||
label="班次"
|
||||
prop="groupClass">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.groupClass || '---' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="selectedBox[4]"
|
||||
label="确认截止时间"
|
||||
prop="confirmDueTime">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.confirmDueTime | timeFilter }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="selectedBox[5]"
|
||||
width="150"
|
||||
label="备注"
|
||||
prop="remark">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.remark }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column v-if="selectedBox[10]" width="60" label="详情">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="handelDetail(scope.row)">详情</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<!-- btns -->
|
||||
<el-table-column width="188" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip content="确认" placement="top">
|
||||
<el-button
|
||||
type="text"
|
||||
style="margin: 5px 0; padding: 0"
|
||||
:disabled="!checkSelectable(scope.row)"
|
||||
@click="$emit('confirm', scope.row)">
|
||||
确认
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<!-- line -->
|
||||
<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span>
|
||||
<el-tooltip content="查看详情" placement="top">
|
||||
<el-button
|
||||
type="text"
|
||||
style="margin: 5px 0; padding: 0"
|
||||
@click="$emit('detail', scope.row)">
|
||||
<i class="iconfont icon-detail primary-color" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<!-- line -->
|
||||
<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span>
|
||||
<el-tooltip content="编辑" placement="top">
|
||||
<el-button
|
||||
type="text"
|
||||
style="margin: 5px 0; padding: 0"
|
||||
@click="$emit('edit', scope.row)">
|
||||
<i class="iconfont icon-edit primary-color" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<!-- line -->
|
||||
<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button
|
||||
type="text"
|
||||
style="margin: 5px 0; padding: 0"
|
||||
@click="$emit('delete', scope.row)">
|
||||
<i class="iconfont icon-delete delete-color" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment';
|
||||
|
||||
export default {
|
||||
name: 'WaitingListTable',
|
||||
components: {},
|
||||
props: ['tableData', 'page', 'limit'],
|
||||
filters: {
|
||||
timeFilter: (val) =>
|
||||
val ? moment(val).format('yyyy-MM-DD HH:mm:ss') : '---',
|
||||
relatePlanFilter: (val) =>
|
||||
val != null ? ['-', '计划型', '非计划型'][val] : '-',
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tablePropsLabelList: [
|
||||
{
|
||||
label: '巡检单名称',
|
||||
},
|
||||
{
|
||||
label: '部门',
|
||||
},
|
||||
{
|
||||
label: '巡检时间',
|
||||
},
|
||||
{
|
||||
label: '班次',
|
||||
},
|
||||
{
|
||||
label: '确认截止时间',
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
},
|
||||
],
|
||||
selectedBox: [
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true
|
||||
],
|
||||
selectedPlan: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
tableDataWithIndex() {
|
||||
return this.tableData.map((item, index) => ({
|
||||
...item,
|
||||
_pageIndex: (this.page - 1) * this.limit + index + 1,
|
||||
}));
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
checkSelectable(row, index) {
|
||||
return true;
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.selectedPlan = val;
|
||||
},
|
||||
handleDelete(row) {},
|
||||
handleDetail(row) {},
|
||||
handleEdit(row) {},
|
||||
handleConfirm(row) {},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@import './iconfont/iconfont.css';
|
||||
.delete-color {
|
||||
color: #ff5454;
|
||||
}
|
||||
.primary-color {
|
||||
color: #0b58ff;
|
||||
}
|
||||
|
||||
.baseTable .show-col-btn {
|
||||
margin-right: 5px;
|
||||
line-height: inherit;
|
||||
cursor: pointer;
|
||||
}
|
||||
.baseTable .el-icon-refresh {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.waiting-list-table .el-table__body tr.current-row > td.el-table__cell {
|
||||
background-color: #eaf1fc;
|
||||
}
|
||||
.waiting-list-table.el-table .el-table__cell {
|
||||
padding: 0;
|
||||
height: 35px;
|
||||
}
|
||||
.waiting-list-table .addButton {
|
||||
width: 100%;
|
||||
height: 35px;
|
||||
border-top: none;
|
||||
color: #0b58ff;
|
||||
border-color: #ebeef5;
|
||||
border-radius: 0;
|
||||
}
|
||||
.waiting-list-table .addButton:hover {
|
||||
color: #0b58ff;
|
||||
border-color: #ebeef5;
|
||||
background-color: #fff;
|
||||
}
|
||||
.waiting-list-table .addButton:focus {
|
||||
border-color: #ebeef5;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.el-tooltip__popper.is-dark {
|
||||
background: rgba(0, 0, 0, 0.6) !important;
|
||||
}
|
||||
.el-tooltip__popper .popper__arrow,
|
||||
.el-tooltip__popper .popper__arrow::after {
|
||||
border-top-color: rgba(0, 0, 0, 0.4) !important;
|
||||
}
|
||||
</style>
|
572
src/views/equipment/base/inspection/Confirm/add-or-updata.vue
Normal file
572
src/views/equipment/base/inspection/Confirm/add-or-updata.vue
Normal file
@ -0,0 +1,572 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-03-18 15:47:20
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="true"
|
||||
:before-close="beforeClose"
|
||||
class="drawer"
|
||||
size="60%">
|
||||
<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="8">
|
||||
<el-form-item label="巡检单名称" prop="name">
|
||||
<el-input v-model="dataForm.name" :disabled="isdetail" placeholder="请输入巡检单名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="部门" prop="departmentId">
|
||||
<el-select
|
||||
v-model="dataForm.departmentId"
|
||||
:disabled="isdetail"
|
||||
:placeholder="`请选择部门`">
|
||||
<el-option
|
||||
v-for="opt in departmentOptions"
|
||||
:key="opt.id"
|
||||
:label="opt.name"
|
||||
:value="opt.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="班次" prop="groupClass">
|
||||
<el-select
|
||||
v-model="dataForm.groupClass"
|
||||
filterable
|
||||
clearable
|
||||
multiple
|
||||
:disabled="isdetail"
|
||||
style="width: 100%"
|
||||
placeholder="请选择班次">
|
||||
<el-option
|
||||
v-for="d in groupOptions"
|
||||
:key="d.id"
|
||||
:label="d.label"
|
||||
:value="d.label" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="巡检人" prop="checkPerson">
|
||||
<el-select
|
||||
v-model="dataForm.checkPerson"
|
||||
:placeholder="`请选择巡检人`"
|
||||
multiple
|
||||
clearable
|
||||
:disabled="isdetail"
|
||||
filterable
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="opt in inspectorOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.label" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="巡检时间" prop="planCheckTime">
|
||||
<el-date-picker
|
||||
v-model="dataForm.planCheckTime"
|
||||
type="datetime"
|
||||
:disabled="isdetail"
|
||||
placeholder="请选择巡检时间"
|
||||
value-format="timestamp"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</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">
|
||||
<div>
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="attr-search-bar"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
</div>
|
||||
<!-- <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="detList">
|
||||
<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>
|
||||
|
||||
</div>
|
||||
|
||||
<div v-if="!isdetail" class="drawer-body__footer">
|
||||
<el-button @click="goback()">取消</el-button>
|
||||
<!-- <el-button :disabled="isdetail" @click="init(dataForm.id)">重置</el-button> -->
|
||||
<el-button v-if="isshowConfirm" type="primary" @click="confirmIns()">保存</el-button>
|
||||
<el-button v-else type="primary" @click="dataFormSubmit()">保存</el-button>
|
||||
</div>
|
||||
|
||||
<attr-add
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
:order-id="dataForm.id"
|
||||
@refreshDataList="getList" />
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from './../../../../core/mixins/basic-add';
|
||||
import { createCheckOrder, updateCheckOrder, getCheckOrder } from "@/api/equipment/base/inspection/settings";
|
||||
import { getCheckOrderDetPage, deleteCheckOrderDet } from "@/api/equipment/base/inspection/record";
|
||||
import SmallTitle from './SmallTitle';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import attrAdd from './attr-add';
|
||||
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
|
||||
import { getCoreDepartmentList } from "@/api/base/coreDepartment";
|
||||
import { groupClassesListAll } from '@/api/monitoring/teamProduction'
|
||||
import { getDictDataLabel } from '@/utils/dict';
|
||||
|
||||
const tableBtn = [
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
},
|
||||
{
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
},
|
||||
];
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'equipmentName',
|
||||
label: '设备名称'
|
||||
},
|
||||
{
|
||||
prop: 'program',
|
||||
label: '巡检项目',
|
||||
},
|
||||
{
|
||||
prop: 'checkResult',
|
||||
label: '巡检结果',
|
||||
},
|
||||
];
|
||||
|
||||
const topBtnConfig = [
|
||||
{
|
||||
type: 'add',
|
||||
btnName: 'btn.add'
|
||||
}
|
||||
]
|
||||
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
components: { SmallTitle, attrAdd },
|
||||
data() {
|
||||
return {
|
||||
tableBtn,
|
||||
tableProps,
|
||||
topBtnConfig,
|
||||
addOrUpdateVisible: false,
|
||||
isshowConfirm: false,
|
||||
urlOptions: {
|
||||
isGetCode: false,
|
||||
createURL: createCheckOrder,
|
||||
updateURL: updateCheckOrder,
|
||||
infoURL: getCheckOrder,
|
||||
},
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '设备',
|
||||
placeholder: '请输入设备名称',
|
||||
param: 'equipmentName',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true
|
||||
}
|
||||
],
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
total: 0,
|
||||
equipmentName: undefined
|
||||
},
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
name: '',
|
||||
departmentId: undefined,
|
||||
groupClass: [],
|
||||
checkPerson: [],
|
||||
planCheckTime: undefined
|
||||
},
|
||||
detList: [],
|
||||
groupOptions: [],
|
||||
// departmentList: [],
|
||||
departmentOptions: [],
|
||||
inspectorOptions: [],
|
||||
visible: false,
|
||||
isdetail: false,
|
||||
isedit: false,
|
||||
idAttrShow: false,
|
||||
dataRule: {
|
||||
name: [{ required: true, message: "巡检单名称不能为空", trigger: "blur" }]
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
beforeClose(done) {
|
||||
if (!this.isdetail) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done();
|
||||
})
|
||||
.catch(_ => {});
|
||||
} else {
|
||||
done()
|
||||
}
|
||||
},
|
||||
async getDict() {
|
||||
// 班次列表
|
||||
const res = await groupClassesListAll();
|
||||
this.groupOptions = res.data.map((item) => {
|
||||
item.label = item.name + ' - ' + getDictDataLabel('workshop', item.roomNameDict)
|
||||
return item
|
||||
}) || [];
|
||||
// 部门列表
|
||||
const res1 = await getCoreDepartmentList();
|
||||
this.departmentOptions = res1.data || []
|
||||
// 巡检人
|
||||
let inspectorList = [];
|
||||
const userlist = await this.$axios({
|
||||
url: '/system/user/page',
|
||||
params: { pageNo: 1, pageSize: 100 },
|
||||
});
|
||||
if (userlist.code == 0) {
|
||||
inspectorList = inspectorList.concat(
|
||||
(userlist.data?.list || []).map((item) => ({
|
||||
label: item.username,
|
||||
value: item.id,
|
||||
}))
|
||||
);
|
||||
}
|
||||
const workerlist = await this.$axios('/base/core-worker/listAll');
|
||||
if (workerlist.code == 0) {
|
||||
inspectorList = inspectorList.concat(
|
||||
workerlist.data.map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}))
|
||||
);
|
||||
}
|
||||
this.inspectorOptions = inspectorList;
|
||||
// const res1 = await groupClassesListAll();
|
||||
// this.groupOptions = res1.data || [];
|
||||
// const res = await getEquipmentAll()
|
||||
// this.eqList = res.data
|
||||
},
|
||||
handleSearchBarBtnClick(btn) {
|
||||
switch (btn.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.equipmentName = btn.equipmentName;
|
||||
this.getList();
|
||||
break;
|
||||
case 'add':
|
||||
this.addNew()
|
||||
break;
|
||||
}
|
||||
},
|
||||
initData() {
|
||||
this.detList.splice(0);
|
||||
this.listQuery.total = 0;
|
||||
this.isshowConfirm = false;
|
||||
},
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(
|
||||
`是否确认删除巡检项目名为"${raw.data.program}"的数据项?`,
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
deleteCheckOrderDet(raw.data.id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
} else {
|
||||
this.addNew(raw.data.id);
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
// 获取设备巡检单详细
|
||||
getCheckOrderDetPage({
|
||||
...this.listQuery,
|
||||
orderId: this.dataForm.id,
|
||||
}).then((response) => {
|
||||
this.detList = response.data.list;
|
||||
this.listQuery.total = response.data.total;
|
||||
});
|
||||
},
|
||||
init(id, isdetail) {
|
||||
this.initData();
|
||||
this.isdetail = isdetail || false;
|
||||
this.dataForm.id = id || undefined;
|
||||
this.isedit = id ? true : false;
|
||||
console.log('你好', this.isedit)
|
||||
this.visible = true;
|
||||
if (id) {
|
||||
this.idAttrShow = true
|
||||
} else {
|
||||
this.dataForm.checkPerson = [this.$store.getters.nickname]
|
||||
this.idAttrShow = false
|
||||
}
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
|
||||
if (this.dataForm.id) {
|
||||
// 获取巡检单详情
|
||||
this.urlOptions.infoURL(id).then(response => {
|
||||
this.dataForm = response.data
|
||||
if (this.dataForm.groupClass && this.dataForm.groupClass !== ''){
|
||||
this.dataForm.groupClass = response.data?.groupClass.split(',')
|
||||
} else {
|
||||
this.dataForm.groupClass = []
|
||||
}
|
||||
if (this.dataForm.checkPerson && this.dataForm.checkPerson !== '') {
|
||||
this.dataForm.checkPerson = response.data?.checkPerson.split(',')
|
||||
} else {
|
||||
this.dataForm.checkPerson = []
|
||||
}
|
||||
});
|
||||
// 获取巡检内容列表
|
||||
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);
|
||||
});
|
||||
},
|
||||
getConfirmed() {
|
||||
return this.$confirm('是否直接确认巡检单', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
});
|
||||
},
|
||||
async confirmIns() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.getConfirmed().then(confirm => {
|
||||
// let checkPersonParam = '';
|
||||
// if (!this.dataForm.checkPerson || this.dataForm.checkPerson.trim() == '') {
|
||||
// /** 如有必要,更新巡检人 */
|
||||
// checkPersonParam = `&checkPerson=${this.$store.getters.nickname}`;
|
||||
// } else {
|
||||
// checkPersonParam = `&checkPerson=${this.dataForm.checkPerson}`
|
||||
// }
|
||||
this.$axios({
|
||||
url:
|
||||
`/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}`,
|
||||
method: 'put',
|
||||
data: [this.dataForm.id],
|
||||
}).then(res =>{
|
||||
if (res.code == 0) {
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
this.$message.success('已确认');
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
this.$message.success('取消确认');
|
||||
})
|
||||
})
|
||||
});
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs["dataForm"].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.updateURL({
|
||||
...this.dataForm,
|
||||
groupClass: this.dataForm.groupClass.join(','),
|
||||
checkPerson: this.dataForm.checkPerson.join(','),
|
||||
special: false,
|
||||
status: 1
|
||||
}).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
this.urlOptions.createURL({
|
||||
...this.dataForm,
|
||||
groupClass: this.dataForm.groupClass.join(','),
|
||||
checkPerson: this.dataForm.checkPerson.join(','),
|
||||
special: false,
|
||||
status: 1
|
||||
}).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.idAttrShow = true
|
||||
this.isshowConfirm = true
|
||||
this.dataForm.id = response.data
|
||||
// this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</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: -32px 15px 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
.add {
|
||||
color: #0b58ff;
|
||||
}
|
||||
</style>
|
172
src/views/equipment/base/inspection/Confirm/attr-add.vue
Normal file
172
src/views/equipment/base/inspection/Confirm/attr-add.vue
Normal file
@ -0,0 +1,172 @@
|
||||
<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="equipmentId">
|
||||
<el-select
|
||||
v-model="dataForm.equipmentId"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择设备名称"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="dict in eqList"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="巡检项目" prop="program">
|
||||
<el-input
|
||||
v-model="dataForm.program"
|
||||
placeholder="请输入巡检项目"
|
||||
clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="巡检结果" prop="checkResult">
|
||||
<el-input
|
||||
v-model="dataForm.checkResult"
|
||||
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 { createCheckOrderDet, updateCheckOrderDet, getCheckOrderDet } from "@/api/equipment/base/inspection/settings";
|
||||
import { getEquipmentPage } from '@/api/base/equipment'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
orderId: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: null,
|
||||
equipmentId: null,
|
||||
program: null,
|
||||
checkResult: null
|
||||
},
|
||||
eqList: [],
|
||||
dataRule: {
|
||||
equipmentId: [
|
||||
{ required: true, message: '设备不能为空', trigger: 'blur' },
|
||||
],
|
||||
program: [
|
||||
{ required: true, message: '巡检项目不能为空', trigger: 'blur' },
|
||||
],
|
||||
checkResult: [
|
||||
{ required: true, message: '巡检结果不能为空', trigger: 'blur' },
|
||||
]
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getDict();
|
||||
},
|
||||
methods: {
|
||||
async getDict() {
|
||||
const res = await getEquipmentPage({
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
special: false
|
||||
})
|
||||
this.eqList = res.data.list
|
||||
},
|
||||
init(id) {
|
||||
this.dataForm.id = id || '';
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
getCheckOrderDet(this.dataForm.id).then((res) => {
|
||||
const { equipmentId, program, checkResult } = res.data;
|
||||
this.dataForm.equipmentId = equipmentId;
|
||||
this.dataForm.program = program;
|
||||
this.dataForm.checkResult = checkResult;
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
updateCheckOrderDet({
|
||||
...this.dataForm,
|
||||
orderId: this.orderId,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createCheckOrderDet({
|
||||
...this.dataForm,
|
||||
orderId: this.orderId,
|
||||
}).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>
|
539
src/views/equipment/base/inspection/Confirm/iconfont/demo.css
Normal file
539
src/views/equipment/base/inspection/Confirm/iconfont/demo.css
Normal file
@ -0,0 +1,539 @@
|
||||
/* Logo 字体 */
|
||||
@font-face {
|
||||
font-family: "iconfont logo";
|
||||
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
|
||||
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
|
||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
|
||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
|
||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
|
||||
}
|
||||
|
||||
.logo {
|
||||
font-family: "iconfont logo";
|
||||
font-size: 160px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
/* tabs */
|
||||
.nav-tabs {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.nav-tabs .nav-more {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: 42px;
|
||||
line-height: 42px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
#tabs {
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
#tabs li {
|
||||
cursor: pointer;
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
border-bottom: 2px solid transparent;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
margin-bottom: -1px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
|
||||
#tabs .active {
|
||||
border-bottom-color: #f00;
|
||||
color: #222;
|
||||
}
|
||||
|
||||
.tab-container .content {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* 页面布局 */
|
||||
.main {
|
||||
padding: 30px 100px;
|
||||
width: 960px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.main .logo {
|
||||
color: #333;
|
||||
text-align: left;
|
||||
margin-bottom: 30px;
|
||||
line-height: 1;
|
||||
height: 110px;
|
||||
margin-top: -50px;
|
||||
overflow: hidden;
|
||||
*zoom: 1;
|
||||
}
|
||||
|
||||
.main .logo a {
|
||||
font-size: 160px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.helps {
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
.helps pre {
|
||||
padding: 20px;
|
||||
margin: 10px 0;
|
||||
border: solid 1px #e7e1cd;
|
||||
background-color: #fffdef;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.icon_lists {
|
||||
width: 100% !important;
|
||||
overflow: hidden;
|
||||
*zoom: 1;
|
||||
}
|
||||
|
||||
.icon_lists li {
|
||||
width: 100px;
|
||||
margin-bottom: 10px;
|
||||
margin-right: 20px;
|
||||
text-align: center;
|
||||
list-style: none !important;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.icon_lists li .code-name {
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.icon_lists .icon {
|
||||
display: block;
|
||||
height: 100px;
|
||||
line-height: 100px;
|
||||
font-size: 42px;
|
||||
margin: 10px auto;
|
||||
color: #333;
|
||||
-webkit-transition: font-size 0.25s linear, width 0.25s linear;
|
||||
-moz-transition: font-size 0.25s linear, width 0.25s linear;
|
||||
transition: font-size 0.25s linear, width 0.25s linear;
|
||||
}
|
||||
|
||||
.icon_lists .icon:hover {
|
||||
font-size: 100px;
|
||||
}
|
||||
|
||||
.icon_lists .svg-icon {
|
||||
/* 通过设置 font-size 来改变图标大小 */
|
||||
width: 1em;
|
||||
/* 图标和文字相邻时,垂直对齐 */
|
||||
vertical-align: -0.15em;
|
||||
/* 通过设置 color 来改变 SVG 的颜色/fill */
|
||||
fill: currentColor;
|
||||
/* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
|
||||
normalize.css 中也包含这行 */
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.icon_lists li .name,
|
||||
.icon_lists li .code-name {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
/* markdown 样式 */
|
||||
.markdown {
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
.highlight {
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.markdown img {
|
||||
vertical-align: middle;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.markdown h1 {
|
||||
color: #404040;
|
||||
font-weight: 500;
|
||||
line-height: 40px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.markdown h2,
|
||||
.markdown h3,
|
||||
.markdown h4,
|
||||
.markdown h5,
|
||||
.markdown h6 {
|
||||
color: #404040;
|
||||
margin: 1.6em 0 0.6em 0;
|
||||
font-weight: 500;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.markdown h1 {
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.markdown h2 {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.markdown h3 {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.markdown h4 {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.markdown h5 {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.markdown h6 {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.markdown hr {
|
||||
height: 1px;
|
||||
border: 0;
|
||||
background: #e9e9e9;
|
||||
margin: 16px 0;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.markdown p {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
.markdown>p,
|
||||
.markdown>blockquote,
|
||||
.markdown>.highlight,
|
||||
.markdown>ol,
|
||||
.markdown>ul {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.markdown ul>li {
|
||||
list-style: circle;
|
||||
}
|
||||
|
||||
.markdown>ul li,
|
||||
.markdown blockquote ul>li {
|
||||
margin-left: 20px;
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
.markdown>ul li p,
|
||||
.markdown>ol li p {
|
||||
margin: 0.6em 0;
|
||||
}
|
||||
|
||||
.markdown ol>li {
|
||||
list-style: decimal;
|
||||
}
|
||||
|
||||
.markdown>ol li,
|
||||
.markdown blockquote ol>li {
|
||||
margin-left: 20px;
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
.markdown code {
|
||||
margin: 0 3px;
|
||||
padding: 0 5px;
|
||||
background: #eee;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.markdown strong,
|
||||
.markdown b {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.markdown>table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0px;
|
||||
empty-cells: show;
|
||||
border: 1px solid #e9e9e9;
|
||||
width: 95%;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.markdown>table th {
|
||||
white-space: nowrap;
|
||||
color: #333;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.markdown>table th,
|
||||
.markdown>table td {
|
||||
border: 1px solid #e9e9e9;
|
||||
padding: 8px 16px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.markdown>table th {
|
||||
background: #F7F7F7;
|
||||
}
|
||||
|
||||
.markdown blockquote {
|
||||
font-size: 90%;
|
||||
color: #999;
|
||||
border-left: 4px solid #e9e9e9;
|
||||
padding-left: 0.8em;
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
.markdown blockquote p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.markdown .anchor {
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.markdown .waiting {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.markdown h1:hover .anchor,
|
||||
.markdown h2:hover .anchor,
|
||||
.markdown h3:hover .anchor,
|
||||
.markdown h4:hover .anchor,
|
||||
.markdown h5:hover .anchor,
|
||||
.markdown h6:hover .anchor {
|
||||
opacity: 1;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.markdown>br,
|
||||
.markdown>p>br {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
|
||||
.hljs {
|
||||
display: block;
|
||||
background: white;
|
||||
padding: 0.5em;
|
||||
color: #333333;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.hljs-comment,
|
||||
.hljs-meta {
|
||||
color: #969896;
|
||||
}
|
||||
|
||||
.hljs-string,
|
||||
.hljs-variable,
|
||||
.hljs-template-variable,
|
||||
.hljs-strong,
|
||||
.hljs-emphasis,
|
||||
.hljs-quote {
|
||||
color: #df5000;
|
||||
}
|
||||
|
||||
.hljs-keyword,
|
||||
.hljs-selector-tag,
|
||||
.hljs-type {
|
||||
color: #a71d5d;
|
||||
}
|
||||
|
||||
.hljs-literal,
|
||||
.hljs-symbol,
|
||||
.hljs-bullet,
|
||||
.hljs-attribute {
|
||||
color: #0086b3;
|
||||
}
|
||||
|
||||
.hljs-section,
|
||||
.hljs-name {
|
||||
color: #63a35c;
|
||||
}
|
||||
|
||||
.hljs-tag {
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.hljs-title,
|
||||
.hljs-attr,
|
||||
.hljs-selector-id,
|
||||
.hljs-selector-class,
|
||||
.hljs-selector-attr,
|
||||
.hljs-selector-pseudo {
|
||||
color: #795da3;
|
||||
}
|
||||
|
||||
.hljs-addition {
|
||||
color: #55a532;
|
||||
background-color: #eaffea;
|
||||
}
|
||||
|
||||
.hljs-deletion {
|
||||
color: #bd2c00;
|
||||
background-color: #ffecec;
|
||||
}
|
||||
|
||||
.hljs-link {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* 代码高亮 */
|
||||
/* PrismJS 1.15.0
|
||||
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
|
||||
/**
|
||||
* prism.js default theme for JavaScript, CSS and HTML
|
||||
* Based on dabblet (http://dabblet.com)
|
||||
* @author Lea Verou
|
||||
*/
|
||||
code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
color: black;
|
||||
background: none;
|
||||
text-shadow: 0 1px white;
|
||||
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
||||
text-align: left;
|
||||
white-space: pre;
|
||||
word-spacing: normal;
|
||||
word-break: normal;
|
||||
word-wrap: normal;
|
||||
line-height: 1.5;
|
||||
|
||||
-moz-tab-size: 4;
|
||||
-o-tab-size: 4;
|
||||
tab-size: 4;
|
||||
|
||||
-webkit-hyphens: none;
|
||||
-moz-hyphens: none;
|
||||
-ms-hyphens: none;
|
||||
hyphens: none;
|
||||
}
|
||||
|
||||
pre[class*="language-"]::-moz-selection,
|
||||
pre[class*="language-"] ::-moz-selection,
|
||||
code[class*="language-"]::-moz-selection,
|
||||
code[class*="language-"] ::-moz-selection {
|
||||
text-shadow: none;
|
||||
background: #b3d4fc;
|
||||
}
|
||||
|
||||
pre[class*="language-"]::selection,
|
||||
pre[class*="language-"] ::selection,
|
||||
code[class*="language-"]::selection,
|
||||
code[class*="language-"] ::selection {
|
||||
text-shadow: none;
|
||||
background: #b3d4fc;
|
||||
}
|
||||
|
||||
@media print {
|
||||
|
||||
code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
text-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Code blocks */
|
||||
pre[class*="language-"] {
|
||||
padding: 1em;
|
||||
margin: .5em 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
:not(pre)>code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
background: #f5f2f0;
|
||||
}
|
||||
|
||||
/* Inline code */
|
||||
:not(pre)>code[class*="language-"] {
|
||||
padding: .1em;
|
||||
border-radius: .3em;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.token.comment,
|
||||
.token.prolog,
|
||||
.token.doctype,
|
||||
.token.cdata {
|
||||
color: slategray;
|
||||
}
|
||||
|
||||
.token.punctuation {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.namespace {
|
||||
opacity: .7;
|
||||
}
|
||||
|
||||
.token.property,
|
||||
.token.tag,
|
||||
.token.boolean,
|
||||
.token.number,
|
||||
.token.constant,
|
||||
.token.symbol,
|
||||
.token.deleted {
|
||||
color: #905;
|
||||
}
|
||||
|
||||
.token.selector,
|
||||
.token.attr-name,
|
||||
.token.string,
|
||||
.token.char,
|
||||
.token.builtin,
|
||||
.token.inserted {
|
||||
color: #690;
|
||||
}
|
||||
|
||||
.token.operator,
|
||||
.token.entity,
|
||||
.token.url,
|
||||
.language-css .token.string,
|
||||
.style .token.string {
|
||||
color: #9a6e3a;
|
||||
background: hsla(0, 0%, 100%, .5);
|
||||
}
|
||||
|
||||
.token.atrule,
|
||||
.token.attr-value,
|
||||
.token.keyword {
|
||||
color: #07a;
|
||||
}
|
||||
|
||||
.token.function,
|
||||
.token.class-name {
|
||||
color: #DD4A68;
|
||||
}
|
||||
|
||||
.token.regex,
|
||||
.token.important,
|
||||
.token.variable {
|
||||
color: #e90;
|
||||
}
|
||||
|
||||
.token.important,
|
||||
.token.bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.token.italic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.token.entity {
|
||||
cursor: help;
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
@font-face {
|
||||
font-family: "iconfont"; /* Project id 3821755 */
|
||||
src: url('iconfont.eot?t=1689233106339'); /* IE9 */
|
||||
src: url('iconfont.eot?t=1689233106339#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
||||
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAARgAAsAAAAACcAAAAQUAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHFQGYACDKAqGSIUsATYCJAMYCw4ABCAFhGcHVBtUCMiuMG7hiaIkox1FaBhxvd1fpwAN4YKo1v7tWTr8hBRkBQgO7yqKUJKPUKzDjkixjn7/q0vlANCkEHCJtsMvx2eQn04h5rHEE8593TK2y1SC5nbvNG5gqgZBNEWTqFUQLGVFNnVu1TjyMm3SafEsC3y0myW12KdEh2x+deP/zzHTJeG3AVBm4lrnAxpQN0US7s3ijuSE6Jbh1UGv08cgQEivMg5z6m49Qj77TVxDEZww6gXicNkviSbkxgswNeGCj+CgMw1yFRpAnUNegSv+8+UfU/igsBpjnRV3rRV9+Su8Fk1Agv6CW4eAeyvAAhronJlI1tcrVnIMHZ0cCcsUTrRTnQ0CP50B4KfgEub9Lw80BougQBwGI8bYJU4LPwUbBw0/HXAw8NORUM90wsT9JeIMFACux9QckHyQ9FDYTobcGi+FLSjwMxDe3L5s+w9THFYeEs8H303FWMnZ1JuBWFgNPh3bd5wOvJmKI9aTqXeD8eJ66HnfnV1dJPE8cy4EgqT+s/SbdSWbp9Pn24NbZ1MnGw7CDbvT6+lL1CXVh++hcH56umDT9vOviL/grQ6srHjE57uLHdQn+dtO9x2v94WN6+eXm0HWlZOzta3tUDp1JWjymsiD8r0ViWGkC+n4GeH5aODSM+9COnilpdfdZsRIvMerLmS0uICTplrOnb99LT3NkJNeajPfpDznblq6bXH8efBjlPIUxhQcX+U0qEdt4bjxy6rMdOkbEn0/3mlvrXZL60ysxdwcn/qKLJ/82pnzGS61z5rBeGmrxf33ZXN/IBWUvb8KSvnttbwwq+YTkweZHue0M0+c0ssZGY/Rs+aVF8+3GaW07CkvLC/KcBvP8c2uGpsdm0THlazwlPE22Kdi9ZK4Hdsmtw9eHVQwPjG0p33Q7tGMJ6TUJ2VK1MMw6ftI6qPPtruCvEPmLZqiHcj1Aw3Rup/sdzj+lt/w3f5TrAHgx++nD7A+8xaD4CL8m60Q+KWYO7CgUY3gTFl+OwUBHKteh00BoWmGDIYm301frAJwKAg+BTEoPCpA41OPNNh2sET0g8NnCkI61M6PKKBzREwANBtGIOS6BEU2D0CT6xvSYP+Apdg/cOT6DyErI68W0RzbqhmYOFixuRNLFqoRi839Zh+A2KqYWJH1CTC7hM04My0j664HDVgXY+xtYhbnBBNGVVzH7geKQrHOqA0sPK2Fc70oPZ2UPSTNQlVUjQEmHLDCzDphEgtKQ9zCPP16DwBRK4UJAyKfyBg7jaeaxzKlyQAg6xkaKO9M2tu1EWXhOEL3IxhKhdWpMqCYDgrTy7vZAAsuTUsLm65IOlWIQBlp47PUS9wAhBgHOFGixYgVJx7+dtqutZuY1eXTvXYncJOkOF1Wicd+CnBACA==') format('woff2'),
|
||||
url('iconfont.woff?t=1689233106339') format('woff'),
|
||||
url('iconfont.ttf?t=1689233106339') format('truetype'),
|
||||
url('iconfont.svg?t=1689233106339#iconfont') format('svg');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-family: "iconfont" !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-downward:before {
|
||||
content: "\e604";
|
||||
}
|
||||
|
||||
.icon-upward:before {
|
||||
content: "\e605";
|
||||
}
|
||||
|
||||
.icon-detail:before {
|
||||
content: "\e601";
|
||||
}
|
||||
|
||||
.icon-edit:before {
|
||||
content: "\e602";
|
||||
}
|
||||
|
||||
.icon-delete:before {
|
||||
content: "\e603";
|
||||
}
|
||||
|
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -0,0 +1,44 @@
|
||||
{
|
||||
"id": "3821755",
|
||||
"name": "component",
|
||||
"font_family": "iconfont",
|
||||
"css_prefix_text": "icon-",
|
||||
"description": "封装的组件中的icon",
|
||||
"glyphs": [
|
||||
{
|
||||
"icon_id": "36426261",
|
||||
"name": "downward",
|
||||
"font_class": "downward",
|
||||
"unicode": "e604",
|
||||
"unicode_decimal": 58884
|
||||
},
|
||||
{
|
||||
"icon_id": "36426301",
|
||||
"name": "upward",
|
||||
"font_class": "upward",
|
||||
"unicode": "e605",
|
||||
"unicode_decimal": 58885
|
||||
},
|
||||
{
|
||||
"icon_id": "33347867",
|
||||
"name": "detail",
|
||||
"font_class": "detail",
|
||||
"unicode": "e601",
|
||||
"unicode_decimal": 58881
|
||||
},
|
||||
{
|
||||
"icon_id": "33347918",
|
||||
"name": "edit",
|
||||
"font_class": "edit",
|
||||
"unicode": "e602",
|
||||
"unicode_decimal": 58882
|
||||
},
|
||||
{
|
||||
"icon_id": "33347930",
|
||||
"name": "delete",
|
||||
"font_class": "delete",
|
||||
"unicode": "e603",
|
||||
"unicode_decimal": 58883
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>Created by iconfont</metadata>
|
||||
<defs>
|
||||
<font id="iconfont" horiz-adv-x="1024">
|
||||
<font-face
|
||||
font-family="iconfont"
|
||||
font-weight="400"
|
||||
font-stretch="normal"
|
||||
units-per-em="1024"
|
||||
ascent="896"
|
||||
descent="-128"
|
||||
/>
|
||||
<missing-glyph />
|
||||
|
||||
<glyph glyph-name="downward" unicode="" d="M556.942222 144.099556l363.064889 401.806222c24.860444 21.617778 24.860444 56.263111 0 77.880889a68.437333 68.437333 0 0 1-44.942222 16.156444c-16.896 0-33.052444-5.859556-44.885333-16.156444L512 260.949333l-318.236444 362.951111a68.437333 68.437333 0 0 1-44.942223 16.099556c-16.896 0-33.109333-5.802667-44.942222-16.156444-24.746667-21.617778-24.746667-56.206222 0-77.824l363.121778-401.749334c5.973333-5.290667 13.141333-9.443556 21.048889-12.231111 23.722667-8.305778 51.029333-3.527111 68.892444 12.060445z" horiz-adv-x="1024" />
|
||||
|
||||
<glyph glyph-name="upward" unicode="" d="M556.942222 623.900444l363.064889-401.806222c24.860444-21.617778 24.860444-56.263111 0-77.880889a68.437333 68.437333 0 0 0-44.942222-16.156444c-16.896 0-33.052444 5.859556-44.885333 16.156444L512 507.050667l-318.236444-362.951111a68.437333 68.437333 0 0 0-44.942223-16.099556c-16.896 0-33.109333 5.802667-44.942222 16.156444-24.746667 21.617778-24.746667 56.206222 0 77.824L467.057778 623.729778c5.973333 5.290667 13.141333 9.443556 21.048889 12.231111 23.722667 8.305778 51.029333 3.527111 68.892444-12.060445z" horiz-adv-x="1024" />
|
||||
|
||||
<glyph glyph-name="detail" unicode="" d="M902.428444 705.251556H332.401778a7.964444 7.964444 0 0 1-7.793778-8.021334v-56.206222a7.964444 7.964444 0 0 1 7.793778-8.078222h570.026666A7.964444 7.964444 0 0 1 910.222222 641.024v56.206222a7.964444 7.964444 0 0 1-7.793778 8.021334z m0-285.127112H332.401778a7.964444 7.964444 0 0 1-7.793778-7.964444v-56.32a7.964444 7.964444 0 0 1 7.793778-7.964444h570.026666a7.964444 7.964444 0 0 1 7.793778 7.964444v56.32a7.964444 7.964444 0 0 1-7.793778 7.964444z m0-285.070222H332.401778a7.964444 7.964444 0 0 1-7.793778-8.078222v-56.206222a7.964444 7.964444 0 0 1 7.793778-8.021334h570.026666a7.964444 7.964444 0 0 1 7.793778 8.021334v56.206222a7.964444 7.964444 0 0 1-7.793778 8.078222zM113.777778 669.127111c0-20.081778 10.410667-38.684444 27.306666-48.696889a53.361778 53.361778 0 0 1 54.670223 0 56.547556 56.547556 0 0 1 27.306666 48.696889 56.547556 56.547556 0 0 1-27.306666 48.696889 53.361778 53.361778 0 0 1-54.613334 0A56.547556 56.547556 0 0 1 113.777778 669.127111zM113.777778 384c0-20.081778 10.410667-38.684444 27.306666-48.696889a53.361778 53.361778 0 0 1 54.670223 0A56.547556 56.547556 0 0 1 223.061333 384a56.547556 56.547556 0 0 1-27.306666 48.696889 53.361778 53.361778 0 0 1-54.613334 0A56.547556 56.547556 0 0 1 113.777778 384z m0-285.127111c0-20.081778 10.410667-38.684444 27.306666-48.696889a53.361778 53.361778 0 0 1 54.670223 0 56.547556 56.547556 0 0 1 27.306666 48.696889 56.547556 56.547556 0 0 1-27.306666 48.696889 53.361778 53.361778 0 0 1-54.613334 0 56.547556 56.547556 0 0 1-27.363555-48.696889z" horiz-adv-x="1024" />
|
||||
|
||||
<glyph glyph-name="edit" unicode="" d="M873.016889 395.264a32.824889 32.824889 0 0 0 65.649778 0v-273.806222a164.124444 164.124444 0 0 0-164.124445-164.124445h-525.084444A164.124444 164.124444 0 0 0 85.333333 121.457778v525.084444A164.124444 164.124444 0 0 0 249.457778 810.666667h312.32a32.824889 32.824889 0 1 0 0-65.649778h-312.32a98.417778 98.417778 0 0 1-98.474667-98.417778v-525.141333c0-54.385778 44.088889-98.474667 98.417778-98.474667h525.141333a98.417778 98.417778 0 0 1 98.474667 98.417778V395.320889z m-14.222222 362.097778a32.824889 32.824889 0 0 0 48.014222-44.771556L548.750222 328.533333a32.824889 32.824889 0 1 0-48.014222 44.771556l358.115556 384.056889z" horiz-adv-x="1024" />
|
||||
|
||||
<glyph glyph-name="delete" unicode="" d="M601.024 146.24a29.632 29.632 0 0 0-29.696 29.696V503.04a29.632 29.632 0 1 0 59.456 0v-326.848a29.76 29.76 0 0 0-29.76-29.888z m-178.24 0a29.632 29.632 0 0 0-29.696 29.696V503.04a29.632 29.632 0 1 0 59.392 0v-326.848a29.76 29.76 0 0 0-29.696-29.888z m475.52 505.216h-148.544v59.456c0 49.152-39.616 89.088-88.512 89.088H363.392c-49.216 0-89.152-39.936-89.152-89.088v-59.456H125.696a29.632 29.632 0 1 1 0-59.392h772.608a29.632 29.632 0 1 1 0 59.392z m-564.608 59.456c0 16.256 13.44 29.696 29.696 29.696h297.856c16.32 0 29.056-13.12 29.056-29.696v-59.456H333.696v59.456zM720-32h-416a89.152 89.152 0 0 0-89.088 89.088V503.232a29.632 29.632 0 1 0 59.456 0v-446.08c0-16.512 13.44-29.76 29.696-29.76h416.064a29.632 29.632 0 0 1 29.696 29.696V502.144a29.632 29.632 0 1 0 59.456 0v-445.056A89.536 89.536 0 0 0 720-32z" horiz-adv-x="1024" />
|
||||
|
||||
</font>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 4.8 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
500
src/views/equipment/base/inspection/Confirm/index.vue
Normal file
500
src/views/equipment/base/inspection/Confirm/index.vue
Normal file
@ -0,0 +1,500 @@
|
||||
<!--
|
||||
filename: MaintainRecord.vue
|
||||
author: DY
|
||||
date: 2023-12-12 13:54:53
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="search-bar"
|
||||
@select-changed="handleSearchBarChange"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
<WaitingListTable
|
||||
ref="waiting-list-table"
|
||||
:table-data="list"
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
@edit="handleEdit"
|
||||
@detail="handleDetail"
|
||||
@delete="handleDelete"
|
||||
@confirm="handleConfirm" />
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<add-or-update
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import {
|
||||
exportCheckOrderExcel,
|
||||
} from '@/api/equipment/base/maintain/record';
|
||||
import WaitingListTable from './WaitingListTable.vue';
|
||||
|
||||
// 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: 'Confirm',
|
||||
components: {
|
||||
WaitingListTable,
|
||||
AddOrUpdate
|
||||
},
|
||||
mixins: [basicPageMixin],
|
||||
data() {
|
||||
return {
|
||||
addOrUpdateVisible: false,
|
||||
recordDetailVisible: false,
|
||||
searchBarKeys: [
|
||||
'name'
|
||||
],
|
||||
tobeConfirmedIdList: [],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '巡检单名称',
|
||||
placeholder: '请输入巡检单名称',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
plain: true,
|
||||
color: 'success',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '批量确认',
|
||||
name: 'batchConfirm',
|
||||
color: 'primary',
|
||||
plain: true,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
plain: true,
|
||||
color: 'primary',
|
||||
},
|
||||
// {
|
||||
// type: this.$auth.hasPermi('equipment:maintain-record:create')
|
||||
// ? 'button'
|
||||
// : '',
|
||||
// btnName: '新增',
|
||||
// name: 'add',
|
||||
// plain: true,
|
||||
// color: 'success',
|
||||
// },
|
||||
],
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
maintainPlanId: null,
|
||||
startTime: null,
|
||||
special: false,
|
||||
status: 1,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
basePath: '/base/equipment-check-order',
|
||||
mode: null,
|
||||
allSpecialEquipments: [],
|
||||
openPlannedDrawer: false,
|
||||
openUnplannedDrawer: false,
|
||||
openPlannedDrawer: false,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
tobeConfirmedIdList: {
|
||||
handler(val) {
|
||||
if (val.length == this.list.length) {
|
||||
this.$refs['table'].toggleAllSelection();
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 批量确认 */
|
||||
async searchBarClicked(btn) {
|
||||
switch (btn.btnName) {
|
||||
case 'batchConfirm':
|
||||
if (this.$refs['waiting-list-table'].selectedPlan.length == 0) {
|
||||
this.$message.warning('请选择待确认的设备巡检单');
|
||||
return;
|
||||
}
|
||||
this.$modal
|
||||
.confirm('是否确认所有选中巡检单"?')
|
||||
.then(() => {
|
||||
// let checkPersonParam = '';
|
||||
// if (!row.checkPerson || row.checkPerson.trim() == '') {
|
||||
// /** 如有必要,更新巡检人 */
|
||||
// checkPersonParam = `&checkPerson=${this.$store.getters.nickname}`;
|
||||
// }
|
||||
return this.$axios({
|
||||
// url: `/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}` + checkPersonParam,
|
||||
url: `/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}`,
|
||||
method: 'put',
|
||||
data: this.$refs['waiting-list-table'].selectedPlan.map(
|
||||
(item) => item.id
|
||||
),
|
||||
});
|
||||
})
|
||||
.then((res) => {
|
||||
this.getList();
|
||||
res.code == 0 && this.$modal.msgSuccess('确认成功');
|
||||
res.code != 0 && this.$modal.msgError('确认失败');
|
||||
})
|
||||
.catch(() => {});
|
||||
break;
|
||||
}
|
||||
},
|
||||
handleSelectionChange(list) {
|
||||
if (this.tobeConfirmedIdList.length) {
|
||||
this.tobeConfirmedIdList = [];
|
||||
this.list.forEach((item) => {
|
||||
this.handleEmitFun({
|
||||
action: 'row-selected',
|
||||
value: { row: item, selected: false },
|
||||
});
|
||||
});
|
||||
console.log(
|
||||
'清空选择列表',
|
||||
this.list.map((item) => item._selection)
|
||||
);
|
||||
} else {
|
||||
this.tobeConfirmedIdList = list.map((item) => item.id);
|
||||
this.list.forEach((item) => {
|
||||
this.handleEmitFun({
|
||||
action: 'row-selected',
|
||||
value: { row: item, selected: true },
|
||||
});
|
||||
});
|
||||
console.log(
|
||||
'全选',
|
||||
this.list.map((item) => item._selection)
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
handleEmitFun({ action, value }) {
|
||||
switch (action) {
|
||||
case '详情':
|
||||
this.recordDetailVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.recordDetailDrawer.show({
|
||||
id: value.id,
|
||||
planMaintainWorker: value.planMaintainWorker,
|
||||
maintainWorker: value.maintainWorker,
|
||||
});
|
||||
});
|
||||
break;
|
||||
case 'row-selected':
|
||||
if (value.selected) {
|
||||
this.tobeConfirmedIdList.push(value.row.id);
|
||||
value.row._selection = 0b11;
|
||||
} else {
|
||||
const index = this.tobeConfirmedIdList.indexOf(value.row.id);
|
||||
if (index != -1) {
|
||||
this.tobeConfirmedIdList.splice(index, 1);
|
||||
}
|
||||
}
|
||||
console.log('tobeConfirmedIdList', this.tobeConfirmedIdList);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
handleSearchBarChange({ param, value }) {
|
||||
console.log('122', param)
|
||||
// if ('specialType' === param) {
|
||||
// if (!value) {
|
||||
// this.setSearchBarEquipmentList(this.allSpecialEquipments);
|
||||
// return;
|
||||
// }
|
||||
// this.setSearchBarEquipmentList(
|
||||
// this.allSpecialEquipments.filter((item) => item.specialType == value)
|
||||
// );
|
||||
// }
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
this.recv({
|
||||
...this.queryParams
|
||||
}).then((response) => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.mode = null;
|
||||
this.reset();
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
relatePlan: null,
|
||||
maintainWorker: [],
|
||||
maintainOrderNumber: null,
|
||||
departmentId: null,
|
||||
lineId: null,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
planStartTime: null,
|
||||
planEndTime: null,
|
||||
confirmed: false,
|
||||
remark: null,
|
||||
special: false,
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm');
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
// this.reset();
|
||||
// this.open = true;
|
||||
// this.title = '添加待确认保养记录';
|
||||
// this.addOrEditTitle = '新增';
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init();
|
||||
});
|
||||
},
|
||||
|
||||
// 新增 / 修改
|
||||
// addOrUpdateHandle(id) {
|
||||
// this.addOrUpdateVisible = true;
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.addOrUpdate.init(id);
|
||||
// });
|
||||
// },
|
||||
|
||||
getConfirmed() {
|
||||
return this.$confirm('是否直接确认巡检记录', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
});
|
||||
},
|
||||
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
this.put({
|
||||
...this.form,
|
||||
maintainWorker: this.form.maintainWorker.join(','),
|
||||
special: false,
|
||||
relatePlan: 2,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 添加的提交
|
||||
this.getConfirmed()
|
||||
.then((confirmed) => {
|
||||
this.post({
|
||||
...this.form,
|
||||
maintainWorker: this.form.maintainWorker.join(','),
|
||||
special: false,
|
||||
relatePlan: 2,
|
||||
confirmed: true,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
this.post({
|
||||
...this.form,
|
||||
maintainWorker: this.form.maintainWorker.join(','),
|
||||
special: false,
|
||||
relatePlan: 2,
|
||||
confirmed: false,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 确认 */
|
||||
async handleConfirm(row) {
|
||||
this.$modal
|
||||
.confirm('是否确认巡检单"' + row.name + '"?')
|
||||
.then(() => {
|
||||
// let checkPersonParam = '';
|
||||
// const nickname = this.$store.getters.nickname;
|
||||
// if (!row.checkPerson || row.checkPerson.trim() == '') {
|
||||
// /** 如有必要,更新巡检人 */
|
||||
// checkPersonParam = `&checkPerson=${nickname}`;
|
||||
// } else {
|
||||
// checkPersonParam = `&checkPerson=${row.checkPerson}`
|
||||
// }
|
||||
return this.$axios({
|
||||
url:
|
||||
`/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}`,
|
||||
method: 'put',
|
||||
data: [row.id],
|
||||
});
|
||||
})
|
||||
.then((res) => {
|
||||
this.getList();
|
||||
res.code == 0 && this.$modal.msgSuccess('确认成功');
|
||||
res.code != 0 && this.$modal.msgError('确认失败');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 编辑 */
|
||||
async handleEdit(row) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(row.id);
|
||||
});
|
||||
// this.reset();
|
||||
// if (row.relatePlan == 1) {
|
||||
// // 计划型
|
||||
// // const res = await this.info({ id: row.id });
|
||||
// // this.form = res.data;
|
||||
// // this.form.maintainWorker = res.data.maintainWorker.split(',');
|
||||
// this.openPlannedDrawer = true;
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.planned.init(row);
|
||||
// });
|
||||
// } else {
|
||||
// this.openUnplannedDrawer = true;
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.unplanned.init(row);
|
||||
// });
|
||||
// }
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.$modal
|
||||
.confirm(
|
||||
'是否确认删除巡检单名称为"' + row.name + '"的数据项?'
|
||||
)
|
||||
.then(() => {
|
||||
return this.$axios({
|
||||
url: '/base/equipment-check-order/delete?id=' + row.id,
|
||||
method: 'delete',
|
||||
});
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(console.error);
|
||||
},
|
||||
handleDetail(row) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(row.id, true);
|
||||
});
|
||||
// this.recordDetailVisible = true;
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.recordDetailDrawer.show({
|
||||
// id: row.id,
|
||||
// planMaintainWorker: row.planMaintainWorker,
|
||||
// maintainWorker: row.maintainWorker,
|
||||
// });
|
||||
// });
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.queryParams };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal
|
||||
.confirm('是否确认导出所有巡检单?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportCheckOrderExcel(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '设备巡检单.xls');
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
312
src/views/equipment/base/inspection/Record/addContent.vue
Normal file
312
src/views/equipment/base/inspection/Record/addContent.vue
Normal file
@ -0,0 +1,312 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-02-26 09:25:10
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="isdetail"
|
||||
class="drawer"
|
||||
size="60%">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
{{ '设备巡检记录详情' }}
|
||||
</small-title>
|
||||
<div class="content">
|
||||
<div class="visual-part">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">巡检单名称</div>
|
||||
<div class="lightTip">{{ dataForm.name }}</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">部门</div>
|
||||
<div class="lightTip">{{ dataForm.department }}</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">班次</div>
|
||||
<div class="lightTip">{{ dataForm.groupClass }}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">巡检人</div>
|
||||
<div class="lightTip">{{ dataForm.checkPerson }}</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">巡检时间</div>
|
||||
<div class="lightTip">{{ parseTime(dataForm.actualCheckTime) }}</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">确认人</div>
|
||||
<div class="lightTip">{{ dataForm.confirmPerson }}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</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="planList">
|
||||
<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>
|
||||
|
||||
<div v-if="!isdetail" class="drawer-body__footer">
|
||||
<el-button style="" @click="goback()">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- <attr-add
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
:plan-id="dataForm.id"
|
||||
@refreshDataList="getList" /> -->
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from '../../../../core/mixins/basic-add';
|
||||
import { getEqCheckOrder, deleteCheckOrderDet, getCheckOrderDetPage } from '@/api/equipment/base/inspection/record';
|
||||
// import { listData } from "@/api/system/dict/data";
|
||||
import SmallTitle from '../../maintain/PlanConfig/SmallTitle.vue';
|
||||
import { parseTime } from '../../../../core/mixins/code-filter';
|
||||
// import attrAdd from './attr-add';
|
||||
// import { getDictDatas } from "@/utils/dict";
|
||||
|
||||
const tableBtn = [
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
},
|
||||
{
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
},
|
||||
];
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'equipmentName',
|
||||
label: '设备名称',
|
||||
},
|
||||
{
|
||||
prop: 'program',
|
||||
label: '巡检项目',
|
||||
},
|
||||
{
|
||||
prop: 'checkResult',
|
||||
label: '巡检结果',
|
||||
}
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
components: { SmallTitle },
|
||||
data() {
|
||||
return {
|
||||
tableBtn,
|
||||
tableProps,
|
||||
addOrUpdateVisible: false,
|
||||
urlOptions: {
|
||||
isGetCode: false,
|
||||
infoURL: getEqCheckOrder
|
||||
},
|
||||
listQuery: {
|
||||
pageSize: 99,
|
||||
pageNo: 1,
|
||||
total: 0
|
||||
},
|
||||
dataForm: {},
|
||||
planList: [],
|
||||
visible: false,
|
||||
isdetail: false,
|
||||
idAttrShow: false
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
initData() {
|
||||
this.planList.splice(0);
|
||||
this.listQuery.total = 0;
|
||||
},
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(
|
||||
`是否确认删除保养项目名为"${raw.data.program}"的数据项?`,
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
deleteCheckOrderDet(raw.data.id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
} else {
|
||||
this.addNew(raw.data.id);
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
// 获取巡检单详情分页
|
||||
getCheckOrderDetPage({
|
||||
...this.listQuery,
|
||||
orderId: this.dataForm.id,
|
||||
}).then((response) => {
|
||||
this.planList = 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(() => {
|
||||
|
||||
if (this.dataForm.id) {
|
||||
// 获取巡检记录详情
|
||||
this.urlOptions.infoURL(id).then(response => {
|
||||
this.dataForm = response.data;
|
||||
});
|
||||
// 获取详情分页
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
},
|
||||
goback() {
|
||||
this.$emit('refreshDataList');
|
||||
this.visible = false;
|
||||
// this.initData();
|
||||
},
|
||||
// 新增 / 修改
|
||||
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: 18vh;
|
||||
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: -40px 15px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.add {
|
||||
color: #0b58ff;
|
||||
}
|
||||
.blodTip {
|
||||
height: 16px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: rgba(0,0,0,0.85);
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.lightTip {
|
||||
/* height: 16px; */
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: rgba(102,102,102,0.75);
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
</style>
|
@ -50,6 +50,11 @@
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="getList" />
|
||||
|
||||
<add-content
|
||||
v-if="addContent"
|
||||
ref="addContent"
|
||||
@refreshDataList="addContent = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -57,19 +62,41 @@
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import addRecord from './addRecord.vue';
|
||||
import { exportCheckLogExcel, deleteEqCheckLog } from '@/api/equipment/base/inspection/record'
|
||||
import AddContent from './addContent.vue';
|
||||
import { exportCheckOrderExcel, deleteEqCheckLog } from '@/api/equipment/base/inspection/record'
|
||||
import { parseTime } from '../../../../core/mixins/code-filter';
|
||||
|
||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
// 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: 'EquipmentRepair',
|
||||
components: { addRecord },
|
||||
name: 'EquipmentInspectionRecord',
|
||||
components: { addRecord, AddContent },
|
||||
mixins: [basicPageMixin],
|
||||
data() {
|
||||
return {
|
||||
addOrUpdateVisible: false,
|
||||
searchBarKeys: ['equipmentId', 'actualTime'],
|
||||
addContent: false,
|
||||
searchBarKeys: ['name', 'actualCheckTime'],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('equipment:check-record:detail')
|
||||
? {
|
||||
@ -77,48 +104,57 @@ export default {
|
||||
btnName: '详情',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('equipment:check-record:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('equipment:check-record:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
// this.$auth.hasPermi('equipment:check-record:update')
|
||||
// ? {
|
||||
// type: 'edit',
|
||||
// btnName: '修改',
|
||||
// }
|
||||
// : undefined,
|
||||
// this.$auth.hasPermi('equipment:check-record:delete')
|
||||
// ? {
|
||||
// type: 'delete',
|
||||
// btnName: '删除',
|
||||
// }
|
||||
// : undefined,
|
||||
].filter((v) => v),
|
||||
tableProps: [
|
||||
{ prop: 'configName', label: '配置名称' },
|
||||
{ prop: 'equipmentName', label: '设备名称' },
|
||||
{ prop: 'origin', label: '数据来源', filter: (val) => ['', '手动', 'PDA'][val] },
|
||||
{ prop: 'name', label: '巡检单名称' },
|
||||
{ prop: 'department', label: '部门' },
|
||||
{ prop: 'actualCheckTime', label: '巡检时间', filter: parseTime },
|
||||
{ prop: 'groupClass', label: '班次' },
|
||||
// { prop: 'opt', label: '巡检内容', name: '详情', subcomponent: btn },
|
||||
{ prop: 'remark', label: '备注' }
|
||||
// { prop: 'origin', label: '数据来源', filter: (val) => ['', '手动', 'PDA'][val] },
|
||||
// { prop: 'sectionName', label: '计划巡检时间' },
|
||||
{ prop: 'actualTime', label: '实际巡检时间', filter: parseTime },
|
||||
// { prop: 'maintenanceDetail', label: '完成状态' },
|
||||
{ prop: 'responsible', label: '巡检人' },
|
||||
// { prop: 'responsible', label: '巡检人' },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
// {
|
||||
// type: 'select',
|
||||
// label: '巡检单名称',
|
||||
// placeholder: '请选择巡检单',
|
||||
// param: 'name',
|
||||
// filterable: true
|
||||
// },
|
||||
{
|
||||
type: 'select',
|
||||
label: '设备',
|
||||
placeholder: '请选择设备',
|
||||
param: 'equipmentId',
|
||||
filterable: true
|
||||
type: 'input',
|
||||
label: '巡检单名称',
|
||||
placeholder: '请输入巡检单',
|
||||
param: 'name'
|
||||
},
|
||||
// 开始结束时间
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间段',
|
||||
dateType: 'daterange', // datetimerange
|
||||
format: 'yyyy-MM-dd',
|
||||
label: '巡检时间',
|
||||
dateType: 'datetimerange', // datetimerange
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始日期',
|
||||
endPlaceholder: '结束日期',
|
||||
defaultTime: ['00:00:00', '23:59:59'],
|
||||
param: 'actualTime',
|
||||
param: 'actualCheckTime',
|
||||
// width: 350,
|
||||
},
|
||||
{
|
||||
@ -138,16 +174,16 @@ export default {
|
||||
name: 'export',
|
||||
plain: true,
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('equipment:check-record:create')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
plain: true,
|
||||
color: 'success',
|
||||
},
|
||||
}
|
||||
// {
|
||||
// type: this.$auth.hasPermi('equipment:check-record:create')
|
||||
// ? 'button'
|
||||
// : '',
|
||||
// btnName: '新增',
|
||||
// name: 'add',
|
||||
// plain: true,
|
||||
// color: 'success',
|
||||
// },
|
||||
],
|
||||
rows: [
|
||||
[
|
||||
@ -216,37 +252,54 @@ export default {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
special: false,
|
||||
maintenanceStatus: null,
|
||||
createTime: null,
|
||||
equipmentId: null,
|
||||
name: null,
|
||||
actualCheckTime: null,
|
||||
status: 2
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
basePath: '/base/equipment-check-log',
|
||||
basePath: '/base/equipment-check-order',
|
||||
mode: null,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.initSearchBar();
|
||||
let end = moment().format('YYYY-MM-DD 08:00:00')
|
||||
const current = new Date()
|
||||
let start = parseTime(new Date(current.getFullYear(), current.getMonth(), current.getDate() - 3, 8, 0, 0))
|
||||
this.searchBarFormConfig[1].defaultSelect = [start, end]
|
||||
this.queryParams.actualCheckTime = [start, end]
|
||||
// this.initSearchBar();
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
initSearchBar() {
|
||||
this.http('/base/core-equipment/page', 'get', {
|
||||
special: false,
|
||||
pageNo: 1,
|
||||
pageSize: 99,
|
||||
}).then(({ data }) => {
|
||||
this.$set(
|
||||
this.searchBarFormConfig[0],
|
||||
'selectOptions',
|
||||
(data?.list || []).map((item) => ({
|
||||
name: item.name,
|
||||
id: item.id,
|
||||
}))
|
||||
);
|
||||
});
|
||||
handleEmitFun({action, value}) {
|
||||
switch (action) {
|
||||
// 查看详情
|
||||
case '巡检内容':
|
||||
this.addContent = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addContent.init(value.id, true);
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
// initSearchBar() {
|
||||
// this.http('/base/equipment-check-order/page', 'get', {
|
||||
// special: false,
|
||||
// pageNo: 1,
|
||||
// pageSize: 99,
|
||||
// status: 2
|
||||
// }).then(({ data }) => {
|
||||
// this.$set(
|
||||
// this.searchBarFormConfig[0],
|
||||
// 'selectOptions',
|
||||
// (data?.list || []).map((item) => ({
|
||||
// name: item.name,
|
||||
// id: item.id,
|
||||
// }))
|
||||
// );
|
||||
// });
|
||||
// },
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
@ -363,10 +416,14 @@ export default {
|
||||
.catch(() => {});
|
||||
},
|
||||
handleDetail({ id }) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.addContent = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id, true);
|
||||
this.$refs.addContent.init(id, true);
|
||||
});
|
||||
// this.addOrUpdateVisible = true
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.addOrUpdate.init(id, true);
|
||||
// });
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
@ -378,7 +435,7 @@ export default {
|
||||
.confirm('是否确认导出所有设备巡检记录?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportCheckLogExcel(params);
|
||||
return exportCheckOrderExcel(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '设备巡检记录.xls');
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-12-01 11:02:43
|
||||
* @LastEditTime: 2024-02-26 08:40:22
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -13,34 +13,25 @@
|
||||
class="drawer"
|
||||
size="50%">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
{{ isdetail ? '详情' : '添加巡检' }}
|
||||
<!-- {{ 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>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">巡检单名称</div>
|
||||
<div class="lightTip">{{ dataForm.name }}</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">部门</div>
|
||||
<div class="lightTip">{{ dataForm.department }}</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">巡检时间</div>
|
||||
<div class="lightTip">{{ parseTime(dataForm.planCheckTime) }}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<el-divider />
|
||||
@ -49,7 +40,7 @@
|
||||
<small-title
|
||||
style="margin: 16px 0; padding-left: 8px"
|
||||
:no-padding="true">
|
||||
巡检项目
|
||||
巡检内容
|
||||
</small-title>
|
||||
|
||||
<div v-if="!isdetail" class="action_btn">
|
||||
@ -90,16 +81,18 @@
|
||||
<attr-add
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
:config-id="dataForm.id"
|
||||
:order-id="dataForm.id"
|
||||
@refreshDataList="getList" />
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getEqCheck, getCheckDetPage, deleteCheckDet } from "@/api/equipment/base/inspection/settings";
|
||||
import { getCheckOrder } from "@/api/equipment/base/inspection/settings";
|
||||
import { deleteCheckOrderDet, getCheckOrderDetPage } from '@/api/equipment/base/inspection/record';
|
||||
import SmallTitle from './SmallTitle';
|
||||
import attrAdd from './attr-add';
|
||||
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
|
||||
import { parseTime } from '../../../../core/mixins/code-filter';
|
||||
|
||||
const tableBtn = [
|
||||
{
|
||||
@ -112,22 +105,14 @@ const tableBtn = [
|
||||
},
|
||||
];
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'equipmentName',
|
||||
label: '设备名称',
|
||||
},
|
||||
{
|
||||
prop: 'program',
|
||||
label: '巡检项目',
|
||||
},
|
||||
{
|
||||
prop: 'content',
|
||||
label: '巡检内容',
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '巡检内容编码',
|
||||
},
|
||||
{
|
||||
prop: 'description',
|
||||
label: '备注',
|
||||
},
|
||||
label: '检查项目',
|
||||
}
|
||||
];
|
||||
|
||||
export default {
|
||||
@ -138,7 +123,7 @@ export default {
|
||||
tableProps,
|
||||
addOrUpdateVisible: false,
|
||||
urlOptions: {
|
||||
infoURL: getEqCheck,
|
||||
infoURL: getCheckOrder,
|
||||
},
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
@ -147,26 +132,13 @@ export default {
|
||||
},
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
code: undefined,
|
||||
name: '',
|
||||
materialType: undefined,
|
||||
productType: undefined,
|
||||
area: undefined,
|
||||
specifications: undefined,
|
||||
processTime: 0,
|
||||
remark: undefined,
|
||||
unit: undefined
|
||||
name: undefined,
|
||||
department: undefined,
|
||||
planCheckTime: 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" }]
|
||||
}
|
||||
isdetail: false
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
@ -187,7 +159,7 @@ export default {
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
deleteCheckDet(raw.data.id).then(({ data }) => {
|
||||
deleteCheckOrderDet(raw.data.id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
@ -205,9 +177,9 @@ export default {
|
||||
},
|
||||
getList() {
|
||||
// 获取巡检项目分页
|
||||
getCheckDetPage({
|
||||
getCheckOrderDetPage({
|
||||
...this.listQuery,
|
||||
configId: this.dataForm.id,
|
||||
orderId: this.dataForm.id,
|
||||
}).then((response) => {
|
||||
this.checkDetList = response.data.list;
|
||||
this.listQuery.total = response.data.total;
|
||||
@ -220,7 +192,7 @@ export default {
|
||||
this.visible = true;
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
// this.$refs['dataForm'].resetFields();
|
||||
|
||||
if (this.dataForm.id) {
|
||||
// 获取设备巡检详情
|
||||
@ -287,7 +259,7 @@ export default {
|
||||
|
||||
.drawer >>> .visual-part {
|
||||
flex: 1 auto;
|
||||
max-height: 16vh;
|
||||
max-height: 10vh;
|
||||
overflow: hidden;
|
||||
overflow-y: scroll;
|
||||
padding-right: 10px; /* 调整滚动条样式 */
|
||||
@ -311,4 +283,18 @@ export default {
|
||||
.add {
|
||||
color: #0b58ff;
|
||||
}
|
||||
.blodTip {
|
||||
height: 16px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: rgba(0,0,0,0.85);
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.lightTip {
|
||||
/* height: 16px; */
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: rgba(102,102,102,0.75);
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
</style>
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-25 16:23:13
|
||||
* @LastEditTime: 2024-03-15 18:38:52
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -11,44 +11,81 @@
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="80px">
|
||||
label-width="150px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="配置名称" prop="name">
|
||||
<el-input
|
||||
v-model="dataForm.name"
|
||||
placeholder="请输入配置名称" />
|
||||
<el-form-item label="巡检单名称" prop="name">
|
||||
<el-input v-model="dataForm.name" placeholder="请输入巡检单名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="配置编码" prop="code">
|
||||
<el-input
|
||||
v-model="dataForm.code"
|
||||
placeholder="请输入配置编码" />
|
||||
<el-form-item label="巡检单编码" prop="code">
|
||||
<el-input v-model="dataForm.code" placeholder="请输入巡检单编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设备名称" prop="equipmentId">
|
||||
<el-form-item
|
||||
label="部门"
|
||||
prop="departmentId"
|
||||
:rules="[{ required: false, message: '请选择部门', trigger: 'blur' }]">
|
||||
<el-select
|
||||
v-model="dataForm.equipmentId"
|
||||
filterable
|
||||
style="width: 100%"
|
||||
placeholder="请选择设备名称"
|
||||
@change="setCode">
|
||||
v-model="dataForm.departmentId"
|
||||
:placeholder="`请选择部门`"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="dict in eqList"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id" />
|
||||
v-for="opt in departmentOptions"
|
||||
:key="opt.id"
|
||||
:label="opt.name"
|
||||
:value="opt.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设备编码" prop="equipmentCode">
|
||||
<el-input v-model="dataForm.equipmentCode" disabled placeholder="请输入设备编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计划巡检时间" prop="planCheckTime">
|
||||
<el-date-picker
|
||||
v-model="dataForm.planCheckTime"
|
||||
type="datetime"
|
||||
:placeholder="`请选择计划巡检时间`"
|
||||
value-format="timestamp"
|
||||
:default-time="'8:00:00'"
|
||||
style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="巡检频率(天/次)" prop="checkPeriod">
|
||||
<el-input
|
||||
v-model="dataForm.checkPeriod"
|
||||
placeholder="请输入巡检频率(天/次)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="确认时限 (时)" prop="confirmTimeLimit">
|
||||
<el-input
|
||||
v-model="dataForm.confirmTimeLimit"
|
||||
:placeholder="`请输入确认时限`" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="班次" prop="groupClass">
|
||||
<el-select
|
||||
v-model="dataForm.groupClass"
|
||||
filterable
|
||||
clearable
|
||||
multiple
|
||||
style="width: 100%"
|
||||
placeholder="请选择班次">
|
||||
<el-option
|
||||
v-for="d in groupOptions"
|
||||
:key="d.id"
|
||||
:label="d.label"
|
||||
:value="d.label" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
@ -56,50 +93,157 @@
|
||||
|
||||
<script>
|
||||
import basicAdd from '../../../../core/mixins/basic-add';
|
||||
import { getEqCheck, getCode, createCheckConfig, updateCheckConfig } from "@/api/equipment/base/inspection/settings";
|
||||
import { getEquipmentAll } from '@/api/base/equipment'
|
||||
import {
|
||||
getCheckOrder,
|
||||
getOrderCode,
|
||||
createCheckOrder,
|
||||
updateCheckOrder,
|
||||
} from '@/api/equipment/base/inspection/settings';
|
||||
import { getCoreDepartmentList } from '@/api/base/coreDepartment';
|
||||
import { groupClassesListAll } from '@/api/monitoring/teamProduction';
|
||||
import { getDictDataLabel } from '@/utils/dict';
|
||||
// import { getEquipmentAll } from '@/api/base/equipment'
|
||||
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
isGetCode: true,
|
||||
codeURL: getCode,
|
||||
createURL: createCheckConfig,
|
||||
updateURL: updateCheckConfig,
|
||||
infoURL: getEqCheck,
|
||||
isGetCode: true,
|
||||
codeURL: getOrderCode,
|
||||
createURL: createCheckOrder,
|
||||
updateURL: updateCheckOrder,
|
||||
infoURL: getCheckOrder,
|
||||
},
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
code: undefined,
|
||||
name: undefined,
|
||||
equipmentId: undefined,
|
||||
equipmentCode: undefined
|
||||
id: null,
|
||||
code: null,
|
||||
name: null,
|
||||
departmentId: null,
|
||||
planCheckTime: null,
|
||||
confirmTimeLimit: null,
|
||||
groupClass: null,
|
||||
remark: null,
|
||||
checkPeriod: null
|
||||
},
|
||||
eqList: [],
|
||||
groupOptions: [],
|
||||
departmentOptions: [],
|
||||
dataRule: {
|
||||
equipmentId: [{ required: true, message: "设备不能为空", trigger: "blur" }],
|
||||
code: [{ required: true, message: "配置编码不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "配置名称不能为空", trigger: "blur" }],
|
||||
confirmTimeLimit: [
|
||||
{ required: true, message: '确认时限不能为空', trigger: 'blur' },
|
||||
],
|
||||
code: [
|
||||
{ required: true, message: '巡检单编码不能为空', trigger: 'blur' },
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '巡检单名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
planCheckTime: [
|
||||
{ required: true, message: '计划巡检时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
checkPeriod: [
|
||||
{ required: true, message: '巡检频率不能为空', trigger: 'blur' },
|
||||
{
|
||||
type: 'number',
|
||||
message: '请输入正确的数字类型',
|
||||
trigger: 'blur',
|
||||
transform: (val) => Number(val),
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
const currenttime = new Date();
|
||||
this.dataForm.planCheckTime = new Date(
|
||||
currenttime.getFullYear(),
|
||||
currenttime.getMonth(),
|
||||
currenttime.getDate(),
|
||||
8,
|
||||
0,
|
||||
0
|
||||
).getTime();
|
||||
},
|
||||
mounted() {
|
||||
this.getDict()
|
||||
this.getDict();
|
||||
},
|
||||
methods: {
|
||||
async getDict() {
|
||||
// 设备列表
|
||||
const res = await getEquipmentAll()
|
||||
this.eqList = res.data
|
||||
init(id) {
|
||||
this.dataForm.id = id || '';
|
||||
this.visible = true;
|
||||
if (this.urlOptions.getOption) {
|
||||
this.getArr();
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.infoURL(id).then((response) => {
|
||||
this.dataForm = response.data;
|
||||
if (response.data?.groupClass === '') {
|
||||
this.dataForm.groupClass = [];
|
||||
} else {
|
||||
this.dataForm.groupClass =
|
||||
response.data?.groupClass?.split(',') || undefined;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (this.urlOptions.isGetCode) {
|
||||
this.getCode();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
async getDict() {
|
||||
// 部门列表
|
||||
const res = await getCoreDepartmentList();
|
||||
this.departmentOptions = res.data || [];
|
||||
const res1 = await groupClassesListAll();
|
||||
this.groupOptions =
|
||||
res1.data.map((item) => {
|
||||
item.label =
|
||||
item.name + ' - ' + getDictDataLabel('workshop', item.roomNameDict);
|
||||
return item;
|
||||
}) || [];
|
||||
// const res = await getEquipmentAll()
|
||||
// this.eqList = res.data
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions
|
||||
.updateURL({
|
||||
...this.dataForm,
|
||||
special: false,
|
||||
status: 0,
|
||||
groupClass: this.dataForm.groupClass?.join(','),
|
||||
})
|
||||
.then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
this.urlOptions
|
||||
.createURL({
|
||||
...this.dataForm,
|
||||
special: false,
|
||||
status: 0,
|
||||
groupClass: this.dataForm.groupClass?.join(','),
|
||||
})
|
||||
.then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
});
|
||||
},
|
||||
setCode() {
|
||||
const chooseM = this.eqList.filter(item => {
|
||||
return item.id === this.dataForm.equipmentId
|
||||
})
|
||||
this.dataForm.equipmentCode = chooseM[0].code
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -17,18 +17,32 @@
|
||||
ref="dataForm"
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
label-width="60px"
|
||||
label-width="90px"
|
||||
@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"
|
||||
<el-form-item label="设备名称" prop="equipmentId">
|
||||
<el-select
|
||||
v-model="dataForm.equipmentId"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择设备名称"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="dict in equipmentOptions"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="description">
|
||||
<el-form-item label="巡检项目" prop="program">
|
||||
<el-input
|
||||
v-model="dataForm.description"
|
||||
placeholder="请输入备注"
|
||||
v-model="dataForm.program"
|
||||
placeholder="请输入巡检项目"
|
||||
clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="巡检结果" prop="checkResult">
|
||||
<el-input
|
||||
v-model="dataForm.checkResult"
|
||||
placeholder="请输入巡检结果"
|
||||
clearable />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -41,11 +55,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getCheckDet, createCheckDet, updateCheckDet, getcheckList } from "@/api/equipment/base/inspection/settings";
|
||||
import { getCheckOrderDet, createCheckOrderDet, updateCheckOrderDet } from "@/api/equipment/base/inspection/settings";
|
||||
import { getEquipmentPage } from '@/api/base/equipment'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
configId: {
|
||||
orderId: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
@ -54,14 +69,22 @@ export default {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
checkId: undefined,
|
||||
configId: undefined,
|
||||
description: ''
|
||||
id: null,
|
||||
equipmentId: null,
|
||||
program: null,
|
||||
checkResult: null
|
||||
},
|
||||
checkList: [],
|
||||
equipmentOptions: [],
|
||||
dataRule: {
|
||||
checkId: [{ required: true, message: '巡检不能为空', trigger: 'blur' }],
|
||||
equipmentId: [
|
||||
{ required: true, message: '设备不能为空', trigger: 'blur' }
|
||||
],
|
||||
program: [
|
||||
{ required: true, message: '巡检项目不能为空', trigger: 'blur' }
|
||||
],
|
||||
checkResult: [
|
||||
{ required: true, message: '巡检结果不能为空', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
};
|
||||
},
|
||||
@ -70,8 +93,12 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async getDict() {
|
||||
const res = await getcheckList()
|
||||
this.checkList = res.data
|
||||
const res = await getEquipmentPage({
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
special: false
|
||||
})
|
||||
this.equipmentOptions = res.data.list
|
||||
},
|
||||
init(id) {
|
||||
this.dataForm.id = id || '';
|
||||
@ -79,7 +106,7 @@ export default {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
getCheckDet(this.dataForm.id).then((res) => {
|
||||
getCheckOrderDet(this.dataForm.id).then((res) => {
|
||||
// const { name, value } = res.data;
|
||||
// this.dataForm.name = name;
|
||||
// this.dataForm.value = value;
|
||||
@ -94,9 +121,9 @@ export default {
|
||||
if (valid) {
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
updateCheckDet({
|
||||
updateCheckOrderDet({
|
||||
...this.dataForm,
|
||||
configId: this.configId
|
||||
orderId: this.orderId
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.visible = false;
|
||||
@ -105,9 +132,9 @@ export default {
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createCheckDet({
|
||||
createCheckOrderDet({
|
||||
...this.dataForm,
|
||||
configId: this.configId,
|
||||
orderId: this.orderId,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.visible = false;
|
||||
|
@ -17,7 +17,7 @@
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:width="180"
|
||||
:width="120"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
@ -37,9 +37,7 @@
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="handleConfirm">
|
||||
<add
|
||||
ref="add"
|
||||
@refreshDataList="successSubmit" />
|
||||
<add ref="add" @refreshDataList="successSubmit" />
|
||||
</base-dialog>
|
||||
<!-- 添加巡检,查看详情 -->
|
||||
<addOrUpdata
|
||||
@ -52,7 +50,9 @@
|
||||
<script>
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import addOrUpdata from './add-or-updata.vue';
|
||||
import add from './add.vue'
|
||||
import add from './add.vue';
|
||||
import { parseTime } from '../../../../core/mixins/code-filter';
|
||||
import { groupClassesListAll } from '@/api/monitoring/teamProduction';
|
||||
// import { publicFormatter } from '@/utils/dict';
|
||||
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
|
||||
@ -70,52 +70,84 @@ export default {
|
||||
? {
|
||||
type: 'add',
|
||||
btnName: '添加',
|
||||
showTip: '添加巡检'
|
||||
}
|
||||
showTip: '添加巡检',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('equipment:check-setting:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('equipment:check-setting:update')
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '查看详情',
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
// this.$auth.hasPermi('equipment:check-setting:update')
|
||||
// ? {
|
||||
// type: 'detail',
|
||||
// btnName: '查看详情',
|
||||
// }
|
||||
// : undefined,
|
||||
this.$auth.hasPermi('equipment:check-setting:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
tableProps: [
|
||||
{ prop: 'name', label: '配置名', width: 110, showOverflowtooltip: true },
|
||||
{ prop: 'code', label: '编码', minWidth: 150, showOverflowtooltip: true },
|
||||
{ prop: 'lineName', label: '产线', showOverflowtooltip: true },
|
||||
{ prop: 'sectionName', label: '工段', showOverflowtooltip: true },
|
||||
{ prop: 'equipmentName', label: '设备', showOverflowtooltip: true },
|
||||
{ prop: 'equipmentCode', label: '设备编码', minWidth: 150, showOverflowtooltip: true },
|
||||
{
|
||||
prop: 'name',
|
||||
label: '巡检单名称',
|
||||
width: 110,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '巡检单编码',
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{ prop: 'department', label: '部门', showOverflowtooltip: true },
|
||||
{
|
||||
prop: 'planCheckTime',
|
||||
label: '计划巡检时间',
|
||||
width: 150,
|
||||
filter: parseTime,
|
||||
},
|
||||
{
|
||||
prop: 'checkPeriod',
|
||||
label: '巡检频率(天/次)',
|
||||
width: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'confirmTimeLimit',
|
||||
label: '确认时限',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{ prop: 'groupClass', label: '班次', showOverflowtooltip: true },
|
||||
{ prop: 'creator', label: '创建人', showOverflowtooltip: true },
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
width: 150,
|
||||
filter: parseTime,
|
||||
},
|
||||
// { prop: 'responsible', label: '负责人' },
|
||||
{ prop: 'checkNumber', label: '巡检条数' }, // TODO: 操作 选项,四个,群里询问
|
||||
{ prop: 'remark', label: '备注' }, // TODO: 操作 选项,四个,群里询问
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '配置名称',
|
||||
placeholder: '请输入配置名称',
|
||||
label: '巡检单名称',
|
||||
placeholder: '请输入巡检单名称',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '设备名称',
|
||||
placeholder: '请选择设备',
|
||||
param: 'equipmentId',
|
||||
filterable: true,
|
||||
},
|
||||
// {
|
||||
// type: 'select',
|
||||
// label: '设备名称',
|
||||
// placeholder: '请选择设备',
|
||||
// param: 'equipmentId',
|
||||
// filterable: true,
|
||||
// },
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
@ -174,7 +206,11 @@ export default {
|
||||
clearable: true,
|
||||
},
|
||||
rules: [
|
||||
{ required: true, message: '设备名称不能为空', trigger: 'change' },
|
||||
{
|
||||
required: true,
|
||||
message: '设备名称不能为空',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
@ -192,25 +228,29 @@ export default {
|
||||
pageSize: 10,
|
||||
equipmentId: null,
|
||||
name: null,
|
||||
special: false,
|
||||
status: 0,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
basePath: '/base/equipment-check-config',
|
||||
basePath: '/base/equipment-check-order',
|
||||
mode: null,
|
||||
groupList: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.initSearchBar();
|
||||
this.getList();
|
||||
this.getGroup();
|
||||
},
|
||||
methods: {
|
||||
handleConfirm() {
|
||||
this.$refs.add.dataFormSubmit()
|
||||
},
|
||||
this.$refs.add.dataFormSubmit();
|
||||
},
|
||||
successSubmit() {
|
||||
this.cancel()
|
||||
this.getList()
|
||||
},
|
||||
this.cancel();
|
||||
this.getList();
|
||||
},
|
||||
initSearchBar() {
|
||||
this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
|
||||
this.$set(
|
||||
@ -223,6 +263,11 @@ export default {
|
||||
);
|
||||
});
|
||||
},
|
||||
getGroup() {
|
||||
groupClassesListAll().then((res) => {
|
||||
this.groupList = res.data || [];
|
||||
});
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
@ -235,9 +280,9 @@ export default {
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.$refs.add.formClear()
|
||||
this.$refs.add.formClear();
|
||||
this.open = false;
|
||||
this.title = ''
|
||||
this.title = '';
|
||||
// this.reset();
|
||||
},
|
||||
/** 表单重置 */
|
||||
|
444
src/views/equipment/base/maintain/Confirm/Record--detail.vue
Normal file
444
src/views/equipment/base/maintain/Confirm/Record--detail.vue
Normal file
@ -0,0 +1,444 @@
|
||||
<!--
|
||||
filename: PlanConfig--addContent.vue
|
||||
author: liubin
|
||||
date: 2024-02-04 09:40:04
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="true"
|
||||
class="drawer"
|
||||
custom-class="mes-drawer"
|
||||
size="60%">
|
||||
<SmallTitle slot="title">
|
||||
{{
|
||||
mode.includes('detail')
|
||||
? '详情'
|
||||
: mode.includes('edit')
|
||||
? '编辑'
|
||||
: '新增'
|
||||
}}
|
||||
</SmallTitle>
|
||||
|
||||
<div class="drawer-body flex">
|
||||
<div class="drawer-body__content">
|
||||
<section>
|
||||
<!-- <SmallTitle>保养信息</SmallTitle> -->
|
||||
<div class="form-part" style="margin-bottom: 32px">
|
||||
<el-skeleton v-if="!showForm" animated />
|
||||
<el-form
|
||||
v-else
|
||||
ref="form"
|
||||
:model="form"
|
||||
label-position="top"
|
||||
v-loading="formLoading">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">计划保养人员</div>
|
||||
<div class="lightTip">{{ form.planMaintainWorker }}</div>
|
||||
<!-- <el-form-item label="计划保养人员" prop="planMaintainWorker">
|
||||
<span>{{ form.planMaintainWorker }}</span>
|
||||
</el-form-item> -->
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">实际保养人员</div>
|
||||
<div class="lightTip">{{ form.maintainWorker }}</div>
|
||||
<!-- <el-form-item label="实际保养人员" prop="maintainWorker">
|
||||
<span>{{ form.maintainWorker }}</span>
|
||||
</el-form-item> -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<el-divider />
|
||||
|
||||
<section>
|
||||
<SmallTitle>保养详情</SmallTitle>
|
||||
<div style="margin-top: 12px; position: relative">
|
||||
<base-table
|
||||
v-loading="detailLoading"
|
||||
:table-props="detailTableProps"
|
||||
:page="detailTableQuery.pageNo || 1"
|
||||
:limit="detailTableQuery.pageSize || 10"
|
||||
:table-data="detailList"
|
||||
@emitFun="handleDetailTableAction">
|
||||
<!-- <method-btn
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
width="100"
|
||||
:method-list="detailTableBtns"
|
||||
@clickBtn="handleDetailTableBtnClicked" /> -->
|
||||
</base-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="detailTotal > 0"
|
||||
:total="detailTotal"
|
||||
:page.sync="detailTableQuery.pageNo"
|
||||
:limit.sync="detailTableQuery.pageSize"
|
||||
@pagination="refreshDetailList" />
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="drawer-body__footer"> -->
|
||||
<!-- <el-button style="" @click="cancel">返回</el-button> -->
|
||||
<!-- <el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-else type="primary" @click="confirm">保存</el-button> -->
|
||||
<!-- </div> -->
|
||||
|
||||
<!-- 属性对话框 -->
|
||||
<base-dialog
|
||||
dialogTitle="保养详情"
|
||||
:dialogVisible="detailAddVisible"
|
||||
width="35%"
|
||||
:append-to-body="true"
|
||||
custom-class="baseDialog"
|
||||
@close="closeDetailForm"
|
||||
@cancel="closeDetailForm"
|
||||
@confirm="submitDetailForm">
|
||||
<DialogForm
|
||||
v-if="detailAddVisible"
|
||||
ref="detailForm"
|
||||
v-model="detailForm"
|
||||
:rows="detailRows" />
|
||||
</base-dialog>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DialogForm from '@/components/DialogForm';
|
||||
|
||||
const SmallTitle = {
|
||||
name: 'SmallTitle',
|
||||
props: ['size'],
|
||||
components: {},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {},
|
||||
render: function (h) {
|
||||
return h(
|
||||
'span',
|
||||
{
|
||||
class: 'small-title',
|
||||
style: {
|
||||
fontSize: '18px',
|
||||
lineHeight:
|
||||
this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
|
||||
fontWeight: 500,
|
||||
fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
|
||||
},
|
||||
},
|
||||
this.$slots.default
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'PlanConfig--addContent',
|
||||
components: { SmallTitle, DialogForm },
|
||||
props: ['maintainData'],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
mode: 'detail',
|
||||
showForm: false,
|
||||
form: {
|
||||
id: null,
|
||||
maintainWorker: null,
|
||||
planMaintainWorker: null,
|
||||
},
|
||||
formLoading: false,
|
||||
equipmentOptions: [],
|
||||
detailList: [],
|
||||
detailAddVisible: false,
|
||||
detailPageProps: ['equipmentName', 'program'],
|
||||
detailForm: {
|
||||
planId: null,
|
||||
equipmentId: null,
|
||||
program: '',
|
||||
maintenanceDes: '',
|
||||
remark: '',
|
||||
},
|
||||
detailRows: [
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
label: '设备',
|
||||
prop: 'equipmentId',
|
||||
options: [],
|
||||
rules: [
|
||||
{ required: true, message: '设备不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '保养项目',
|
||||
prop: 'program',
|
||||
rules: [
|
||||
{ required: true, message: '保养项目不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '保养描述',
|
||||
prop: 'maintenanceDes',
|
||||
rules: [
|
||||
{ required: true, message: '包养描述不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
],
|
||||
detailLoading: false,
|
||||
detailTableProps: [
|
||||
{ prop: 'equipmentName', label: '设备名称' },
|
||||
{ prop: 'program', label: '保养项目' },
|
||||
{ prop: 'maintenanceDes', label: '保养描述' },
|
||||
// { prop: 'remark', label: '备注' },
|
||||
],
|
||||
detailTableQuery: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
detailTableBtns: [
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
},
|
||||
{
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
},
|
||||
],
|
||||
detailTotal: 0,
|
||||
detailList: [],
|
||||
equipmentList: [],
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
mounted() {
|
||||
this.loadEquipments();
|
||||
},
|
||||
methods: {
|
||||
handleColse() {},
|
||||
show({ planMaintainWorker, id, maintainWorker }) {
|
||||
this.form = Object.assign(
|
||||
{},
|
||||
{
|
||||
planMaintainWorker,
|
||||
id,
|
||||
maintainWorker,
|
||||
}
|
||||
);
|
||||
this.$nextTick(() => {
|
||||
this.refreshDetailList();
|
||||
});
|
||||
this.visible = true;
|
||||
this.showForm = true;
|
||||
},
|
||||
cancel() {
|
||||
this.visible = false;
|
||||
setTimeout(() => {
|
||||
this.$emit('closed');
|
||||
}, 500);
|
||||
},
|
||||
confirm() {
|
||||
this.cancel();
|
||||
},
|
||||
toggleEdit() {
|
||||
this.mode == 'edit' ? 'detail' : 'edit';
|
||||
},
|
||||
async loadEquipments() {
|
||||
// TODO: 很有可能此处要改成动态刷新/获取/加载设备列表,当总的特殊设备数量大于100的时候...
|
||||
const res = await this.$axios('/base/core-equipment/page', {
|
||||
params: {
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
special: false,
|
||||
},
|
||||
});
|
||||
this.equipmentList = res.data?.list || [];
|
||||
this.detailRows[0][0].options = (res.data?.list || []).map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
},
|
||||
closeDetailForm() {
|
||||
this.detailAddVisible = false;
|
||||
},
|
||||
async submitDetailForm() {
|
||||
// validation
|
||||
this.$refs.detailForm.validate(async (valid) => {
|
||||
if (!valid) return;
|
||||
const res = await this.$axios[this.detailForm.id ? 'put' : 'post'](
|
||||
`/base/equipment-maintain-log-det/create/${
|
||||
this.detailForm.id ? 'update' : 'create'
|
||||
}`,
|
||||
{
|
||||
...this.detailForm,
|
||||
logId: this.form.id,
|
||||
}
|
||||
);
|
||||
if (res.code == 0) {
|
||||
this.detailAddVisible = false;
|
||||
this.$message.success('添加成功');
|
||||
this.refreshDetailList();
|
||||
} else {
|
||||
this.detailAddVisible = false;
|
||||
this.$message.error('出错');
|
||||
}
|
||||
});
|
||||
},
|
||||
async refreshDetailList() {
|
||||
this.detailLoading = true;
|
||||
if (!this.form.id) {
|
||||
this.$message.info('没有找到保养计划相关信息...');
|
||||
this.detailLoading = false;
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await this.$axios(
|
||||
'/base/equipment-maintain-log-det/page',
|
||||
{
|
||||
params: {
|
||||
pageNo: this.detailTableQuery.pageNo,
|
||||
pageSize: this.detailTableQuery.pageSize,
|
||||
// planId: this.form.id,
|
||||
logId: this.form.id,
|
||||
},
|
||||
}
|
||||
);
|
||||
this.detailList = res.data?.list || [];
|
||||
this.detailTotal = res.data?.total || 0;
|
||||
this.detailLoading = false;
|
||||
} catch (err) {
|
||||
this.detailLoading = false;
|
||||
}
|
||||
},
|
||||
//
|
||||
handleDetailTableAction() {},
|
||||
handleDetailTableBtnClicked({ data, type }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
const { id, equipmentId, planId, program, maintenanceDes, remark } =
|
||||
data;
|
||||
this.detailAddVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.detailForm = Object.assign(
|
||||
{},
|
||||
{
|
||||
id,
|
||||
equipmentId,
|
||||
planId,
|
||||
program,
|
||||
maintenanceDes,
|
||||
remark,
|
||||
}
|
||||
);
|
||||
});
|
||||
break;
|
||||
case 'delete':
|
||||
if (!data.id) return;
|
||||
this.$confirm('确认移除该详情吗?', '提示', {
|
||||
confirmButtonText: '确 认',
|
||||
cancelButtonText: '取 消',
|
||||
})
|
||||
.then(async () => {
|
||||
const res = await this.$axios.delete(
|
||||
'/base/equipment-maintain-plan-det/delete',
|
||||
{
|
||||
params: {
|
||||
id: data.id,
|
||||
},
|
||||
}
|
||||
);
|
||||
if (res.code == 0) {
|
||||
this.$message.success('删除成功!');
|
||||
this.refreshDetailList();
|
||||
}
|
||||
})
|
||||
.catch(console.error);
|
||||
break;
|
||||
case 'detail':
|
||||
this.handleDetail(data);
|
||||
break;
|
||||
default:
|
||||
this.handleTableActions({ data, type });
|
||||
}
|
||||
},
|
||||
handleAddDetail() {
|
||||
this.detailAddVisible = true;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.drawer >>> .el-drawer {
|
||||
border-radius: 8px 0 0 8px;
|
||||
}
|
||||
|
||||
.drawer >>> .el-drawer__header {
|
||||
margin: 0;
|
||||
padding: 32px 32px 24px;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.small-title::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: 4px;
|
||||
height: 22px;
|
||||
border-radius: 1px;
|
||||
margin-right: 8px;
|
||||
background-color: #0b58ff;
|
||||
}
|
||||
|
||||
.drawer-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: calc(100% - 72px);
|
||||
}
|
||||
|
||||
.drawer-body__content {
|
||||
flex: 1;
|
||||
/* background: #eee; */
|
||||
padding: 20px 30px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.drawer-body__footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 18px;
|
||||
}
|
||||
.blodTip {
|
||||
height: 16px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: rgba(0,0,0,0.85);
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.lightTip {
|
||||
/* height: 16px; */
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: rgba(102,102,102,0.75);
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,368 @@
|
||||
<!--
|
||||
filename: dialogForm.vue
|
||||
author: liubin
|
||||
date: 2023-08-15 10:32:36
|
||||
description: 弹窗的表单组件
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:size="size"
|
||||
:label-position="labelPosition"
|
||||
v-loading="formLoading">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="设备保养单号"
|
||||
prop="maintainOrderNumber"
|
||||
:rules="[
|
||||
{ required: true, message: '请输入设备保养单号', trigger: 'blur' },
|
||||
]">
|
||||
<el-input
|
||||
v-model="form.maintainOrderNumber"
|
||||
@change="$emit('update', form)"
|
||||
:placeholder="`请输入保养计划单号`"
|
||||
:disabled="disabled" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="保养计划名称" prop="name">
|
||||
<el-input value="---" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="部门"
|
||||
prop="departmentId"
|
||||
:rules="[{ required: true, message: '请选择部门', trigger: 'blur' }]">
|
||||
<el-select
|
||||
v-model="form.departmentId"
|
||||
:placeholder="`请选择部门`"
|
||||
:disabled="disabled"
|
||||
clearable
|
||||
filterable
|
||||
@change="$emit('update', form)">
|
||||
<el-option
|
||||
v-for="opt in departmentOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item
|
||||
label="设备大类"
|
||||
prop="equipmentCategory"
|
||||
:rules="[
|
||||
{ required: true, message: '请选择设备大类', trigger: 'blur' },
|
||||
]">
|
||||
<el-select
|
||||
v-model="form.equipmentCategory"
|
||||
:placeholder="`请选择设备大类`"
|
||||
:disabled="disabled"
|
||||
@change="handleEqTypeChange">
|
||||
<el-option
|
||||
v-for="opt in equipmentTypeOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="产线"
|
||||
prop="lineId"
|
||||
:rules="[{ required: true, message: '请选择产线', trigger: 'blur' }]">
|
||||
<el-select
|
||||
v-model="form.lineId"
|
||||
:placeholder="`请选择产线`"
|
||||
:disabled="disabled"
|
||||
clearable
|
||||
filterable
|
||||
@change="$emit('update', form)">
|
||||
<el-option
|
||||
v-for="opt in lineOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="计划保养人员" prop="maintainer">
|
||||
<el-input value="---" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="计划开始时间" prop="planStartTime">
|
||||
<el-input value="---" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="计划结束时间" prop="planEndTime">
|
||||
<el-input value="---" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="实际开始时间"
|
||||
prop="startTime"
|
||||
:rules="[
|
||||
{ required: true, message: '请选择实际开始时间', trigger: 'blur' },
|
||||
]">
|
||||
<el-date-picker
|
||||
v-model="form.startTime"
|
||||
type="datetime"
|
||||
:disabled="edit"
|
||||
placeholder="请选择实际开始时间"
|
||||
@change="$emit('update', form)"
|
||||
value-format="timestamp"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="实际结束时间"
|
||||
prop="endTime"
|
||||
:rules="[
|
||||
{ required: true, message: '请选择实际结束时间', trigger: 'blur' },
|
||||
]">
|
||||
<el-date-picker
|
||||
v-model="form.endTime"
|
||||
type="datetime"
|
||||
:disabled="edit"
|
||||
placeholder="请选择实际结束时间"
|
||||
@change="$emit('update', form)"
|
||||
value-format="timestamp"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="实际保养人员"
|
||||
prop="maintainWorker"
|
||||
:rules="[
|
||||
{ required: true, message: '请选择实际保养人员', trigger: 'blur' },
|
||||
]">
|
||||
<el-select
|
||||
v-model="form.maintainWorker"
|
||||
:placeholder="`请选择实际保养人员`"
|
||||
:disabled="disabled"
|
||||
multiple
|
||||
clearable
|
||||
filterable
|
||||
@change="$emit('update', form)">
|
||||
<el-option
|
||||
v-for="opt in maintainerOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
@change="$emit('update', form)"
|
||||
:placeholder="`请输入备注`"
|
||||
:disabled="disabled" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'DialogForm',
|
||||
model: {
|
||||
prop: 'dataForm',
|
||||
event: 'update',
|
||||
},
|
||||
emits: ['update'],
|
||||
components: {},
|
||||
props: {
|
||||
rows: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
dataForm: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
edit: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
hasFiles: {
|
||||
type: Boolean | Array,
|
||||
default: false,
|
||||
},
|
||||
labelPosition: {
|
||||
type: String,
|
||||
default: 'right',
|
||||
},
|
||||
size: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: {},
|
||||
formLoading: true,
|
||||
lineList: [],
|
||||
maintainerList: [],
|
||||
departmentList: [],
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
dataForm: {
|
||||
handler(val) {
|
||||
this.form = JSON.parse(JSON.stringify(val));
|
||||
if (typeof val.maintainer == 'string')
|
||||
this.form.maintainer = val.maintainer.split(',');
|
||||
if (this.form.equipmentCategory != null) {
|
||||
setTimeout(() => {
|
||||
this.equipmentOptions = this.equipmentList
|
||||
.filter((item) => item.special)
|
||||
.filter(
|
||||
(item) => item.specialType === this.form.equipmentCategory
|
||||
)
|
||||
.map((item) => ({ label: item.name, value: item.id }));
|
||||
}, 1000);
|
||||
}
|
||||
if (this.hasFiles) {
|
||||
if (typeof this.hasFiles == 'boolean' && this.hasFiles) {
|
||||
this.form.files = this.form.files ?? [];
|
||||
} else if (Array.isArray(this.hasFiles)) {
|
||||
this.hasFiles.forEach((prop) => {
|
||||
this.form[prop] = this.form[prop] ?? [];
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
// !this.edit && this.getCode('/base/equipment-maintain-log/getCode');
|
||||
this.getList('maintainer');
|
||||
this.getList('department');
|
||||
this.getList('line');
|
||||
},
|
||||
computed: {
|
||||
departmentOptions() {
|
||||
return (this.departmentList || []).map((item) => ({
|
||||
id: item.id,
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
},
|
||||
lineOptions() {
|
||||
return (this.lineList || []).map((item) => ({
|
||||
id: item.id,
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
},
|
||||
maintainerOptions() {
|
||||
return (this.maintainerList || []).map((item) => ({
|
||||
id: item.id,
|
||||
label: item.name,
|
||||
value: item.name,
|
||||
}));
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
/** 模拟透传 ref */
|
||||
validate(cb) {
|
||||
return this.$refs.form.validate(cb);
|
||||
},
|
||||
resetFields(args) {
|
||||
return this.$refs.form.resetFields(args);
|
||||
},
|
||||
// getCode
|
||||
async getCode(url) {
|
||||
this.formLoading = true;
|
||||
const response = await this.$axios(url);
|
||||
this.formLoading = false;
|
||||
this.form.maintainOrderNumber = response.data || '';
|
||||
},
|
||||
// initialize
|
||||
async getEquipmentList() {
|
||||
this.formLoading = true;
|
||||
const response = await this.$axios('/base/core-equipment/listAll');
|
||||
this.equipmentList = response.data || [];
|
||||
this.equipmentOptions = (response.data || []).map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
this.formLoading = false;
|
||||
},
|
||||
async getList(source = 'department') {
|
||||
const urls = [
|
||||
'/base/core-production-line/listAll',
|
||||
'/base/core-department/listAll',
|
||||
'/base/core-worker/listAll',
|
||||
];
|
||||
let res;
|
||||
switch (source) {
|
||||
case 'department':
|
||||
res = await this.$axios(urls[1]);
|
||||
this.departmentList = res.data || [];
|
||||
break;
|
||||
case 'maintainer':
|
||||
res = await this.$axios(urls[2]);
|
||||
this.maintainerList = res.data || [];
|
||||
break;
|
||||
case 'line':
|
||||
res = await this.$axios(urls[0]);
|
||||
this.lineList = res.data || [];
|
||||
break;
|
||||
}
|
||||
this.formLoading = false;
|
||||
},
|
||||
|
||||
// handlers
|
||||
handleEqTypeChange(type) {
|
||||
this.form.equipmentId = null;
|
||||
if (type) {
|
||||
this.equipmentOptions = this.equipmentList
|
||||
.filter((item) => item.special)
|
||||
.filter((item) => item.specialType === type)
|
||||
.map((item) => ({ label: item.name, value: item.id }));
|
||||
} else
|
||||
this.equipmentOptions = this.equipmentList.map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
// this.$emit('update', this.form)
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.el-date-editor,
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,758 @@
|
||||
<!--
|
||||
filename: WaitingListUnplanned--edit.vue
|
||||
author: liubin
|
||||
date: 2023-08-22 14:38:56
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="false"
|
||||
class="drawer"
|
||||
custom-class="mes-drawer"
|
||||
size="60%"
|
||||
@closed="$emit('destroy')">
|
||||
<SmallTitle slot="title">编辑</SmallTitle>
|
||||
|
||||
<div class="drawer-body flex">
|
||||
<div class="drawer-body__content">
|
||||
<div class="form-part" style="margin-bottom: 32px">
|
||||
<!-- <el-skeleton v-if="!showForm" animated /> -->
|
||||
<el-form
|
||||
class="equipment-info-form"
|
||||
ref="form"
|
||||
:model="form"
|
||||
label-width="200px"
|
||||
label-position="top"
|
||||
v-loading="formLoading">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="保养计划单号" prop="maintainOrderNumber">
|
||||
<!-- :rules="[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入保养计划单号',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]" -->
|
||||
<el-input
|
||||
v-model="form.maintainOrderNumber"
|
||||
disabled
|
||||
:placeholder="`请输入保养计划单号`" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="保养计划名称" prop="planName">
|
||||
<el-input
|
||||
v-model="form.planName"
|
||||
placeholder="请输入保养计划名称"
|
||||
disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="部门" prop="departmentId">
|
||||
<!-- :rules="[
|
||||
{ required: true, message: '请选择部门', trigger: 'blur' },
|
||||
]" -->
|
||||
<el-select
|
||||
v-model="form.departmentId"
|
||||
:placeholder="`请选择部门`"
|
||||
clearable
|
||||
disabled
|
||||
filterable>
|
||||
<el-option
|
||||
v-for="opt in departmentOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="产线" prop="lineId">
|
||||
<!-- :rules="[
|
||||
{ required: true, message: '请选择产线', trigger: 'blur' },
|
||||
]" -->
|
||||
<el-select
|
||||
v-model="form.lineId"
|
||||
:placeholder="`请选择产线`"
|
||||
disabled
|
||||
clearable
|
||||
filterable>
|
||||
<el-option
|
||||
v-for="opt in lineOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="计划保养人员" prop="maintainer">
|
||||
<el-select
|
||||
v-model="form.planMaintainWorker"
|
||||
placeholder="请选择计划保养人员"
|
||||
disabled
|
||||
clearable
|
||||
filterable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="计划开始时间" prop="planStartTime">
|
||||
<el-date-picker
|
||||
v-model="form.planStartTime"
|
||||
type="datetime"
|
||||
disabled
|
||||
placeholder="请选择计划开始时间"
|
||||
value-format="timestamp"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="计划结束时间" prop="planEndTime">
|
||||
<el-date-picker
|
||||
v-model="form.planEndTime"
|
||||
type="datetime"
|
||||
disabled
|
||||
placeholder="请选择计划结束时间"
|
||||
value-format="timestamp"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="实际开始时间"
|
||||
prop="startTime"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: '请选择实际开始时间',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]">
|
||||
<el-date-picker
|
||||
v-model="form.startTime"
|
||||
type="datetime"
|
||||
placeholder="请选择实际开始时间"
|
||||
value-format="timestamp"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="实际结束时间"
|
||||
prop="endTime"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: '请选择实际结束时间',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]">
|
||||
<el-date-picker
|
||||
v-model="form.endTime"
|
||||
type="datetime"
|
||||
placeholder="请选择实际结束时间"
|
||||
value-format="timestamp"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="实际保养人员"
|
||||
prop="maintainWorker"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: '请选择实际保养人员',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]">
|
||||
<el-select
|
||||
v-model="form.maintainWorker"
|
||||
:placeholder="`请选择实际保养人员`"
|
||||
multiple
|
||||
clearable
|
||||
filterable>
|
||||
<el-option
|
||||
v-for="opt in maintainerOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" :placeholder="`请输入备注`" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<SmallTitle>保养内容</SmallTitle>
|
||||
|
||||
<div style="margin-top: 12px; position: relative">
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="attr-search-bar"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 12px; position: relative">
|
||||
<div style="position: absolute; top: -40px; right: 0">
|
||||
<el-button @click="handleAddAttr" type="text">
|
||||
<i class="el-icon-plus"></i>
|
||||
添加属性
|
||||
</el-button>
|
||||
</div>
|
||||
<base-table
|
||||
v-loading="attrListLoading"
|
||||
:table-props="attrTableProps"
|
||||
:page="attrQuery?.params.pageNo || 1"
|
||||
:limit="attrQuery?.params.pageSize || 10"
|
||||
:table-data="attrList"
|
||||
@emitFun="handleEmitFun">
|
||||
<method-btn
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="attrTotal > 0"
|
||||
:total="attrTotal"
|
||||
:page.sync="attrQuery.params.pageNo"
|
||||
:limit.sync="attrQuery.params.pageSize"
|
||||
@pagination="getAttrList" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="handleCancel">取消</el-button>
|
||||
<el-button type="primary" @click="handleConfirm">保存</el-button>
|
||||
<!-- sections的第二项必须是 属性列表 -->
|
||||
<!-- <el-button
|
||||
v-if="sections[1].allowAdd"
|
||||
type="primary"
|
||||
@click="handleAddAttr">
|
||||
添加属性
|
||||
</el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 属性对话框 -->
|
||||
<base-dialog
|
||||
:dialogTitle="attrTitle"
|
||||
:dialogVisible="attrFormVisible"
|
||||
width="35%"
|
||||
:append-to-body="true"
|
||||
custom-class="baseDialog"
|
||||
@close="closeAttrForm"
|
||||
@cancel="closeAttrForm"
|
||||
@confirm="submitAttrForm">
|
||||
<DialogForm
|
||||
v-if="attrFormVisible"
|
||||
ref="attrForm"
|
||||
v-model="attrForm"
|
||||
:rows="attrRows" />
|
||||
</base-dialog>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DialogForm from '../../../../../components/DialogForm/index.vue';
|
||||
|
||||
const SmallTitle = {
|
||||
name: 'SmallTitle',
|
||||
props: ['size'],
|
||||
components: {},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {},
|
||||
render: function (h) {
|
||||
return h(
|
||||
'span',
|
||||
{
|
||||
class: 'small-title',
|
||||
style: {
|
||||
fontSize: '18px',
|
||||
lineHeight:
|
||||
this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
|
||||
fontWeight: 500,
|
||||
fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
|
||||
},
|
||||
},
|
||||
this.$slots.default
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
components: { SmallTitle, DialogForm },
|
||||
props: ['dataId'], // dataId 作为一个通用的存放id的字段
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
btnLoading: false,
|
||||
form: {},
|
||||
formLoading: false,
|
||||
lineList: [],
|
||||
maintainerList: [],
|
||||
departmentList: [],
|
||||
attrTableProps: [
|
||||
{
|
||||
prop: 'equipmentName',
|
||||
label: '设备名称',
|
||||
},
|
||||
{
|
||||
prop: 'program',
|
||||
label: '保养项目',
|
||||
},
|
||||
{
|
||||
prop: 'maintenanceDes',
|
||||
label: '保养描述',
|
||||
},
|
||||
],
|
||||
attrList: [],
|
||||
attrTotal: 0,
|
||||
attrTitle: '',
|
||||
attrForm: {
|
||||
id: null,
|
||||
logId: null,
|
||||
program: null,
|
||||
maintenanceDes: null,
|
||||
remark: null,
|
||||
},
|
||||
attrFormVisible: false,
|
||||
attrRows: [
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
label: '设备名称',
|
||||
prop: 'equipmentId',
|
||||
url: '/base/core-equipment/page?pageNo=1&pageSize=100&special=false',
|
||||
// method: 'post',
|
||||
// queryParams: {
|
||||
// pageNo: 1,
|
||||
// pageSize: 100,
|
||||
// special: true,
|
||||
// },
|
||||
rules: [
|
||||
{ required: true, message: '设备不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '保养项目',
|
||||
prop: 'program',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '保养描述',
|
||||
prop: 'maintenanceDes',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '备注',
|
||||
prop: 'remark',
|
||||
},
|
||||
],
|
||||
],
|
||||
attrQuery: {
|
||||
params: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
equipmentName: null,
|
||||
},
|
||||
}, // 属性列表的请求
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '设备',
|
||||
placeholder: '请输入设备名称',
|
||||
param: 'equipmentName',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
],
|
||||
attrFormSubmitting: false,
|
||||
attrListLoading: false,
|
||||
// syncFileListFlag: null,
|
||||
tableBtn: [
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
},
|
||||
{
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
},
|
||||
],
|
||||
row: null,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
departmentOptions() {
|
||||
return (this.departmentList || []).map((item) => ({
|
||||
id: item.id,
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
},
|
||||
lineOptions() {
|
||||
return (this.lineList || []).map((item) => ({
|
||||
id: item.id,
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
},
|
||||
maintainerOptions() {
|
||||
return (this.maintainerList || []).map((item) => ({
|
||||
id: item.id,
|
||||
label: item.name,
|
||||
value: item.name,
|
||||
}));
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getList('maintainer');
|
||||
this.getList('department');
|
||||
this.getList('line');
|
||||
},
|
||||
methods: {
|
||||
handleSearchBarBtnClick(btn) {
|
||||
switch (btn.btnName) {
|
||||
case 'search':
|
||||
this.attrQuery.params.equipmentName = btn.equipmentName;
|
||||
this.getAttrList();
|
||||
break;
|
||||
}
|
||||
},
|
||||
handleTableBtnClick({ type, data }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
this.handleEditAttr(data.id);
|
||||
break;
|
||||
case 'delete':
|
||||
this.handleDeleteAttr(data.id);
|
||||
break;
|
||||
}
|
||||
},
|
||||
async handleConfirm() {
|
||||
this.btnLoading = true;
|
||||
this.$nextTick(async () => {
|
||||
const { code, data } = await this.$axios({
|
||||
url: '/base/equipment-maintain-log/update',
|
||||
method: 'put',
|
||||
data: {
|
||||
...this.form,
|
||||
maintainWorker: this.form.maintainWorker.join(','),
|
||||
planMaintainWorker: this.form.planMaintainWorker?.join(','),
|
||||
},
|
||||
});
|
||||
if (code == 0) {
|
||||
this.$modal.msgSuccess('更新成功');
|
||||
}
|
||||
this.btnLoading = false;
|
||||
this.$emit('refreshDataList');
|
||||
this.handleCancel();
|
||||
});
|
||||
},
|
||||
|
||||
handleEmitFun(val) {
|
||||
console.log('handleEmitFun', val);
|
||||
},
|
||||
|
||||
init(row) {
|
||||
this.visible = true;
|
||||
this.row = row;
|
||||
this.getInfo(row);
|
||||
this.getAttrList(row);
|
||||
},
|
||||
|
||||
async getInfo(row) {
|
||||
this.formLoading = true;
|
||||
const res = await this.$axios(
|
||||
'/base/equipment-maintain-log/get?id=' + row.id
|
||||
);
|
||||
if (res.code == 0) {
|
||||
this.form = res.data;
|
||||
this.form.maintainWorker = res.data.maintainWorker.split(',');
|
||||
this.form.planMaintainWorker = res.data.planMaintainWorker?.split(',');
|
||||
this.formLoading = false;
|
||||
}
|
||||
this.formLoading = false;
|
||||
},
|
||||
|
||||
async getAttrList(row, condition = {}) {
|
||||
if (!row) row = this.row;
|
||||
this.attrListLoading = true;
|
||||
const res = await this.$axios({
|
||||
url: '/base/equipment-maintain-log-det/page',
|
||||
method: 'get',
|
||||
params: {
|
||||
...this.attrQuery.params,
|
||||
logId: row.id,
|
||||
...condition,
|
||||
},
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.attrList = res.data.list;
|
||||
this.attrTotal = res.data.total;
|
||||
}
|
||||
this.attrListLoading = false;
|
||||
},
|
||||
|
||||
async getList(source = 'department') {
|
||||
const urls = [
|
||||
'/base/core-production-line/listAll',
|
||||
'/base/core-department/listAll',
|
||||
'/base/core-worker/listAll',
|
||||
];
|
||||
let res;
|
||||
switch (source) {
|
||||
case 'department':
|
||||
res = await this.$axios(urls[1]);
|
||||
this.departmentList = res.data || [];
|
||||
break;
|
||||
case 'maintainer':
|
||||
res = await this.$axios(urls[2]);
|
||||
this.maintainerList = res.data || [];
|
||||
break;
|
||||
case 'line':
|
||||
res = await this.$axios(urls[0]);
|
||||
this.lineList = res.data || [];
|
||||
break;
|
||||
}
|
||||
this.formLoading = false;
|
||||
},
|
||||
|
||||
// 保存表单
|
||||
handleSave() {
|
||||
this.$refs.form.validate(async (valid) => {
|
||||
if (valid) {
|
||||
await this.$axios({
|
||||
url: '/urlupdate', // this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
|
||||
method: 'post', // isEdit ? 'put' : 'post',
|
||||
data: this.form,
|
||||
});
|
||||
this.$modal.msgSuccess(`${isEdit ? '更新' : '创建'}成功`);
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
handleCancel() {
|
||||
this.visible = false;
|
||||
},
|
||||
|
||||
resetAttrform() {
|
||||
this.attrForm = {
|
||||
id: null,
|
||||
logId: this.row.id,
|
||||
maintenanceDes: '',
|
||||
program: null,
|
||||
remark: null,
|
||||
};
|
||||
},
|
||||
|
||||
// 新增属性
|
||||
handleAddAttr() {
|
||||
if (!this.row.id) return this.$message.error('请先选中保养记录');
|
||||
this.resetAttrform();
|
||||
this.attrTitle = '添加属性';
|
||||
this.attrFormVisible = true;
|
||||
},
|
||||
|
||||
// 编辑属性
|
||||
async handleEditAttr(attrId) {
|
||||
const res = await this.$axios({
|
||||
url: '/base/equipment-maintain-log-det/get',
|
||||
method: 'get',
|
||||
params: { id: attrId },
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.attrForm = res.data;
|
||||
this.attrTitle = '编辑属性';
|
||||
this.attrFormVisible = true;
|
||||
}
|
||||
},
|
||||
|
||||
// 删除属性
|
||||
handleDeleteAttr(attrId) {
|
||||
this.$confirm('确定删除该保养内容?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(async () => {
|
||||
const res = await this.$axios({
|
||||
url: '/base/equipment-maintain-log-det/delete?id=' + attrId,
|
||||
method: 'delete',
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getAttrList();
|
||||
},
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
|
||||
// 提交属性表
|
||||
submitAttrForm() {
|
||||
this.$refs['attrForm'].validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const isEdit = this.attrForm.id != null;
|
||||
this.attrFormSubmitting = true;
|
||||
const res = await this.$axios({
|
||||
url: isEdit
|
||||
? '/base/equipment-maintain-log-det/update'
|
||||
: '/base/equipment-maintain-log-det/create',
|
||||
method: isEdit ? 'put' : 'post',
|
||||
data: this.attrForm,
|
||||
});
|
||||
|
||||
if (res.code == 0) {
|
||||
this.closeAttrForm();
|
||||
this.$message({
|
||||
message: `${isEdit ? '更新' : '创建'}成功`,
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getAttrList();
|
||||
},
|
||||
});
|
||||
}
|
||||
this.attrFormSubmitting = false;
|
||||
} catch (err) {
|
||||
this.$message({
|
||||
message: err,
|
||||
type: 'error',
|
||||
duration: 1500,
|
||||
});
|
||||
this.attrFormSubmitting = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
closeAttrForm() {
|
||||
this.attrFormVisible = false;
|
||||
},
|
||||
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(
|
||||
`确定对${
|
||||
raw.data.name
|
||||
? '[名称=' + raw.data.name + ']'
|
||||
: '[序号=' + raw.data._pageIndex + ']'
|
||||
}进行删除操作?`,
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
deleteProductAttr(raw.data.id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
} else {
|
||||
this.addNew(raw.data.id);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.drawer >>> .el-drawer {
|
||||
border-radius: 8px 0 0 8px;
|
||||
}
|
||||
|
||||
.drawer >>> .el-date-editor,
|
||||
.drawer >>> .el-select {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.drawer >>> .el-drawer__header {
|
||||
margin: 0;
|
||||
padding: 32px 32px 24px;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.small-title::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: 4px;
|
||||
height: 22px;
|
||||
border-radius: 1px;
|
||||
margin-right: 8px;
|
||||
background-color: #0b58ff;
|
||||
}
|
||||
|
||||
.drawer-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.drawer-body__content {
|
||||
flex: 1;
|
||||
/* background: #eee; */
|
||||
padding: 20px 30px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.drawer-body__footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 18px;
|
||||
}
|
||||
</style>
|
307
src/views/equipment/base/maintain/Confirm/WaitingListTable.vue
Normal file
307
src/views/equipment/base/maintain/Confirm/WaitingListTable.vue
Normal file
@ -0,0 +1,307 @@
|
||||
<!--
|
||||
filename: WaitingListTable.vue
|
||||
author: liubin
|
||||
date: 2024-02-05 16:12:55
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-table
|
||||
:data="tableDataWithIndex"
|
||||
:border="true"
|
||||
@selection-change="handleSelectionChange"
|
||||
style="width: 100%"
|
||||
:header-cell-style="{
|
||||
background: '#f2f4f9',
|
||||
color: '#606266',
|
||||
}"
|
||||
class="waiting-list-table">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
:width="50"
|
||||
:selectable="checkSelectable" />
|
||||
<el-table-column prop="_pageIndex" width="80" align="center">
|
||||
<template slot="header">
|
||||
<el-popover placement="bottom-start" width="300" trigger="click">
|
||||
<div class="setting-box" style="max-height: 400px; overflow-y: auto">
|
||||
<el-checkbox
|
||||
v-for="(item, index) in tablePropsLabelList"
|
||||
:key="'cb' + index"
|
||||
v-model="selectedBox[index]"
|
||||
:label="item.label" />
|
||||
</div>
|
||||
<i slot="reference" class="el-icon-s-tools" />
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="selectedBox[0]"
|
||||
width="128"
|
||||
label="设备保养单号"
|
||||
prop="maintainOrderNumber"></el-table-column>
|
||||
<el-table-column v-if="selectedBox[1]" width="128" label="保养计划名称" prop="planName">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.planName || '---' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="selectedBox[2]" label="部门" prop="departmentName">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.departmentName || '---' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="selectedBox[3]" label="产线名" prop="lineName">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.lineName || '---' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="selectedBox[4]"
|
||||
width="150"
|
||||
label="计划开始时间"
|
||||
prop="planStartTime">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.planStartTime | timeFilter }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="selectedBox[5]"
|
||||
width="150"
|
||||
label="计划结束时间"
|
||||
prop="planEndTime">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.planEndTime | timeFilter }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="selectedBox[6]"
|
||||
width="150"
|
||||
label="实际开始时间"
|
||||
prop="startTime">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.startTime | timeFilter }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="selectedBox[7]"
|
||||
width="150"
|
||||
label="实际结束时间"
|
||||
prop="endTime">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.endTime | timeFilter }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="selectedBox[8]"
|
||||
width="150"
|
||||
label="确认截止时间"
|
||||
prop="confirmDueTime">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.confirmDueTime | timeFilter }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="selectedBox[9]"
|
||||
width="150"
|
||||
label="保养计划类型"
|
||||
prop="relatePlan">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.relatePlan | relatePlanFilter }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column v-if="selectedBox[10]" width="60" label="详情">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="handelDetail(scope.row)">详情</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<!-- btns -->
|
||||
<el-table-column width="188" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip content="确认" placement="top">
|
||||
<el-button
|
||||
type="text"
|
||||
style="margin: 5px 0; padding: 0"
|
||||
:disabled="!checkSelectable(scope.row)"
|
||||
@click="$emit('confirm', scope.row)">
|
||||
确认
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<!-- line -->
|
||||
<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span>
|
||||
<el-tooltip content="查看详情" placement="top">
|
||||
<el-button
|
||||
type="text"
|
||||
style="margin: 5px 0; padding: 0"
|
||||
@click="$emit('detail', scope.row)">
|
||||
<i class="iconfont icon-detail primary-color" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<!-- line -->
|
||||
<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span>
|
||||
<el-tooltip content="编辑" placement="top">
|
||||
<el-button
|
||||
type="text"
|
||||
style="margin: 5px 0; padding: 0"
|
||||
@click="$emit('edit', scope.row)">
|
||||
<i class="iconfont icon-edit primary-color" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<!-- line -->
|
||||
<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button
|
||||
type="text"
|
||||
style="margin: 5px 0; padding: 0"
|
||||
@click="$emit('delete', scope.row)">
|
||||
<i class="iconfont icon-delete delete-color" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment';
|
||||
|
||||
export default {
|
||||
name: 'WaitingListTable',
|
||||
components: {},
|
||||
props: ['tableData', 'page', 'limit'],
|
||||
filters: {
|
||||
timeFilter: (val) =>
|
||||
val ? moment(val).format('yyyy-MM-DD HH:mm:ss') : '---',
|
||||
relatePlanFilter: (val) =>
|
||||
val != null ? ['-', '计划型', '非计划型'][val] : '-',
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tablePropsLabelList: [
|
||||
{
|
||||
label: '设备保养单号',
|
||||
},
|
||||
{
|
||||
label: '保养计划名称',
|
||||
},
|
||||
{
|
||||
label: '部门',
|
||||
},
|
||||
{
|
||||
label: '产线名',
|
||||
},
|
||||
{
|
||||
label: '计划开始时间',
|
||||
},
|
||||
{
|
||||
label: '计划结束时间',
|
||||
},
|
||||
{
|
||||
label: '实际开始时间',
|
||||
},
|
||||
{
|
||||
label: '实际结束时间',
|
||||
},
|
||||
{
|
||||
label: '确认截止时间',
|
||||
},
|
||||
{
|
||||
label: '保养计划类型',
|
||||
},
|
||||
{
|
||||
label: '详情',
|
||||
},
|
||||
],
|
||||
selectedBox: [
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
],
|
||||
selectedPlan: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
tableDataWithIndex() {
|
||||
return this.tableData.map((item, index) => ({
|
||||
...item,
|
||||
_pageIndex: (this.page - 1) * this.limit + index + 1,
|
||||
}));
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
checkSelectable(row, index) {
|
||||
return (
|
||||
row.relatePlan == 2 ||
|
||||
(row.relatePlan == 1 &&
|
||||
(!row.confirmDueTime || +row.confirmDueTime >= new Date().getTime()))
|
||||
);
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.selectedPlan = val;
|
||||
},
|
||||
handleDelete(row) {},
|
||||
handleDetail(row) {},
|
||||
handleEdit(row) {},
|
||||
handleConfirm(row) {},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@import './iconfont/iconfont.css';
|
||||
.delete-color {
|
||||
color: #ff5454;
|
||||
}
|
||||
.primary-color {
|
||||
color: #0b58ff;
|
||||
}
|
||||
|
||||
.baseTable .show-col-btn {
|
||||
margin-right: 5px;
|
||||
line-height: inherit;
|
||||
cursor: pointer;
|
||||
}
|
||||
.baseTable .el-icon-refresh {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.waiting-list-table .el-table__body tr.current-row > td.el-table__cell {
|
||||
background-color: #eaf1fc;
|
||||
}
|
||||
.waiting-list-table.el-table .el-table__cell {
|
||||
padding: 0;
|
||||
height: 35px;
|
||||
}
|
||||
.waiting-list-table .addButton {
|
||||
width: 100%;
|
||||
height: 35px;
|
||||
border-top: none;
|
||||
color: #0b58ff;
|
||||
border-color: #ebeef5;
|
||||
border-radius: 0;
|
||||
}
|
||||
.waiting-list-table .addButton:hover {
|
||||
color: #0b58ff;
|
||||
border-color: #ebeef5;
|
||||
background-color: #fff;
|
||||
}
|
||||
.waiting-list-table .addButton:focus {
|
||||
border-color: #ebeef5;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.el-tooltip__popper.is-dark {
|
||||
background: rgba(0, 0, 0, 0.6) !important;
|
||||
}
|
||||
.el-tooltip__popper .popper__arrow,
|
||||
.el-tooltip__popper .popper__arrow::after {
|
||||
border-top-color: rgba(0, 0, 0, 0.4) !important;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,838 @@
|
||||
<!--
|
||||
filename: WaitingListUnplanned--edit.vue
|
||||
author: liubin
|
||||
date: 2023-08-22 14:38:56
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="false"
|
||||
class="drawer"
|
||||
custom-class="mes-drawer"
|
||||
size="60%"
|
||||
@closed="$emit('destroy')">
|
||||
<SmallTitle slot="title">{{ showTable ? '编辑' : '新增' }}</SmallTitle>
|
||||
|
||||
<div class="drawer-body flex">
|
||||
<div class="drawer-body__content">
|
||||
<div class="form-part" style="margin-bottom: 32px">
|
||||
<!-- <el-skeleton v-if="!showForm" animated /> -->
|
||||
<el-form
|
||||
class="equipment-info-form"
|
||||
ref="form"
|
||||
:model="form"
|
||||
label-width="200px"
|
||||
label-position="top"
|
||||
v-loading="formLoading">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="保养计划单号"
|
||||
prop="maintainOrderNumber"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入保养计划单号',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]">
|
||||
<el-input
|
||||
v-model="form.maintainOrderNumber"
|
||||
:placeholder="`请输入保养计划单号`" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="保养计划名称" prop="name">
|
||||
<el-input value="---" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="部门"
|
||||
prop="departmentId"
|
||||
:rules="[
|
||||
{ required: true, message: '请选择部门', trigger: 'blur' },
|
||||
]">
|
||||
<el-select
|
||||
v-model="form.departmentId"
|
||||
:placeholder="`请选择部门`"
|
||||
clearable
|
||||
filterable>
|
||||
<el-option
|
||||
v-for="opt in departmentOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="产线"
|
||||
prop="lineId"
|
||||
:rules="[
|
||||
{ required: true, message: '请选择产线', trigger: 'blur' },
|
||||
]">
|
||||
<el-select
|
||||
v-model="form.lineId"
|
||||
:placeholder="`请选择产线`"
|
||||
clearable
|
||||
filterable>
|
||||
<el-option
|
||||
v-for="opt in lineOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="计划保养人员" prop="maintainer">
|
||||
<el-input value="---" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="计划开始时间" prop="planStartTime">
|
||||
<el-input value="---" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="计划结束时间" prop="planEndTime">
|
||||
<el-input value="---" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="实际开始时间"
|
||||
prop="startTime"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: '请选择实际开始时间',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]">
|
||||
<el-date-picker
|
||||
v-model="form.startTime"
|
||||
type="datetime"
|
||||
placeholder="请选择实际开始时间"
|
||||
value-format="timestamp"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="实际结束时间"
|
||||
prop="endTime"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: '请选择实际结束时间',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]">
|
||||
<el-date-picker
|
||||
v-model="form.endTime"
|
||||
type="datetime"
|
||||
placeholder="请选择实际结束时间"
|
||||
value-format="timestamp"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="实际保养人员"
|
||||
prop="maintainWorker"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: '请选择实际保养人员',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]">
|
||||
<el-select
|
||||
v-model="form.maintainWorker"
|
||||
:placeholder="`请选择实际保养人员`"
|
||||
multiple
|
||||
clearable
|
||||
filterable>
|
||||
<el-option
|
||||
v-for="opt in maintainerOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" :placeholder="`请输入备注`" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div v-if="showTable">
|
||||
<SmallTitle>保养内容</SmallTitle>
|
||||
|
||||
<div style="margin-top: 12px; position: relative">
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="attr-search-bar"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 12px; position: relative">
|
||||
<div style="position: absolute; top: -40px; right: 0">
|
||||
<el-button @click="handleAddAttr" type="text">
|
||||
<i class="el-icon-plus"></i>
|
||||
添加属性
|
||||
</el-button>
|
||||
</div>
|
||||
<base-table
|
||||
v-loading="attrListLoading"
|
||||
:table-props="attrTableProps"
|
||||
:page="attrQuery?.params.pageNo || 1"
|
||||
:limit="attrQuery?.params.pageSize || 10"
|
||||
:table-data="attrList"
|
||||
@emitFun="handleEmitFun">
|
||||
<method-btn
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="attrTotal > 0"
|
||||
:total="attrTotal"
|
||||
:page.sync="attrQuery.params.pageNo"
|
||||
:limit.sync="attrQuery.params.pageSize"
|
||||
@pagination="getAttrList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="handleCancel">取消</el-button>
|
||||
<!-- 新增可确认 -->
|
||||
<el-button v-if="isAdd" type="primary" @click="addConfirm">保存</el-button>
|
||||
<el-button v-else type="primary" @click="handleConfirm">保存</el-button>
|
||||
<!-- sections的第二项必须是 属性列表 -->
|
||||
<!-- <el-button
|
||||
v-if="sections[1].allowAdd"
|
||||
type="primary"
|
||||
@click="handleAddAttr">
|
||||
添加属性
|
||||
</el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 属性对话框 -->
|
||||
<base-dialog
|
||||
:dialogTitle="attrTitle"
|
||||
:dialogVisible="attrFormVisible"
|
||||
width="35%"
|
||||
:append-to-body="true"
|
||||
custom-class="baseDialog"
|
||||
@close="closeAttrForm"
|
||||
@cancel="closeAttrForm"
|
||||
@confirm="submitAttrForm">
|
||||
<DialogForm
|
||||
v-if="attrFormVisible"
|
||||
ref="attrForm"
|
||||
v-model="attrForm"
|
||||
:rows="attrRows" />
|
||||
</base-dialog>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DialogForm from '../../../../../components/DialogForm/index.vue';
|
||||
|
||||
const SmallTitle = {
|
||||
name: 'SmallTitle',
|
||||
props: ['size'],
|
||||
components: {},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {},
|
||||
render: function (h) {
|
||||
return h(
|
||||
'span',
|
||||
{
|
||||
class: 'small-title',
|
||||
style: {
|
||||
fontSize: '18px',
|
||||
lineHeight:
|
||||
this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
|
||||
fontWeight: 500,
|
||||
fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
|
||||
},
|
||||
},
|
||||
this.$slots.default
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
components: { SmallTitle, DialogForm },
|
||||
props: ['dataId'], // dataId 作为一个通用的存放id的字段
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
btnLoading: false,
|
||||
showTable: false,
|
||||
isAdd: false,
|
||||
form: {},
|
||||
formLoading: false,
|
||||
lineList: [],
|
||||
maintainerList: [],
|
||||
departmentList: [],
|
||||
attrTableProps: [
|
||||
{
|
||||
prop: 'equipmentName',
|
||||
label: '设备名称',
|
||||
},
|
||||
{
|
||||
prop: 'program',
|
||||
label: '保养项目',
|
||||
},
|
||||
{
|
||||
prop: 'maintenanceDes',
|
||||
label: '保养描述',
|
||||
},
|
||||
],
|
||||
attrList: [],
|
||||
attrTotal: 0,
|
||||
attrTitle: '',
|
||||
attrForm: {
|
||||
id: null,
|
||||
logId: null,
|
||||
program: null,
|
||||
maintenanceDes: null,
|
||||
remark: null,
|
||||
},
|
||||
attrFormVisible: false,
|
||||
attrRows: [
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
label: '设备名称',
|
||||
prop: 'equipmentId',
|
||||
url: '/base/core-equipment/page?pageNo=1&pageSize=100&special=false',
|
||||
// method: 'post',
|
||||
// queryParams: {
|
||||
// pageNo: 1,
|
||||
// pageSize: 100,
|
||||
// special: true,
|
||||
// },
|
||||
rules: [
|
||||
{ required: true, message: '设备不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '保养项目',
|
||||
prop: 'program',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '保养描述',
|
||||
prop: 'maintenanceDes',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '备注',
|
||||
prop: 'remark',
|
||||
},
|
||||
],
|
||||
],
|
||||
attrQuery: {
|
||||
params: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
equipmentName: null,
|
||||
},
|
||||
}, // 属性列表的请求
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '设备',
|
||||
placeholder: '请输入设备名称',
|
||||
param: 'equipmentName',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
],
|
||||
attrFormSubmitting: false,
|
||||
attrListLoading: false,
|
||||
// syncFileListFlag: null,
|
||||
tableBtn: [],
|
||||
row: {},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
departmentOptions() {
|
||||
return (this.departmentList || []).map((item) => ({
|
||||
id: item.id,
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
},
|
||||
lineOptions() {
|
||||
return (this.lineList || []).map((item) => ({
|
||||
id: item.id,
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
},
|
||||
maintainerOptions() {
|
||||
return (this.maintainerList || []).map((item) => ({
|
||||
id: item.id,
|
||||
label: item.name,
|
||||
value: item.name,
|
||||
}));
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
!this.edit && this.getCode('/base/equipment-maintain-plan/getCode');
|
||||
this.getList('maintainer');
|
||||
this.getList('department');
|
||||
this.getList('line');
|
||||
},
|
||||
methods: {
|
||||
// getCode
|
||||
async getCode(url) {
|
||||
this.formLoading = true;
|
||||
const response = await this.$axios(url);
|
||||
this.formLoading = false;
|
||||
this.form.maintainOrderNumber = response.data || '';
|
||||
},
|
||||
handleSearchBarBtnClick(btn) {
|
||||
console.log('btn', btn);
|
||||
switch (btn.btnName) {
|
||||
case 'search':
|
||||
this.attrQuery.params.equipmentName = btn.equipmentName;
|
||||
this.getAttrList();
|
||||
break;
|
||||
}
|
||||
},
|
||||
handleTableBtnClick({ type, data }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
this.handleEditAttr(data.id);
|
||||
break;
|
||||
case 'delete':
|
||||
this.handleDeleteAttr(data.id);
|
||||
break;
|
||||
}
|
||||
},
|
||||
async addConfirm() {
|
||||
console.log('11', this.showTable)
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.getConfirmed().then(confirm => {
|
||||
console.log('111', confirm)
|
||||
this.$axios({
|
||||
url:
|
||||
'/base/equipment-maintain-log/confirm?confirmPerson=' +
|
||||
this.$store.getters.userId,
|
||||
method: 'put',
|
||||
data: [this.form.id],
|
||||
}).then(res =>{
|
||||
if (res.code == 0) {
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
this.$message.success('已确认');
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
this.$message.success('取消确认');
|
||||
})
|
||||
})
|
||||
});
|
||||
},
|
||||
getConfirmed() {
|
||||
return this.$confirm('是否直接确认保养记录', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
});
|
||||
},
|
||||
async handleConfirm() {
|
||||
this.btnLoading = true;
|
||||
// this.$nextTick(async () => {
|
||||
// const { code, data } = await this.$axios({
|
||||
// url: '/base/equipment-maintain-log/update',
|
||||
// method: 'put',
|
||||
// data: {
|
||||
// ...this.form,
|
||||
// maintainWorker: this.form.maintainWorker.join(',')
|
||||
// },
|
||||
// });
|
||||
// if (code == 0) {
|
||||
// this.$modal.msgSuccess('更新成功');
|
||||
// }
|
||||
// this.btnLoading = false;
|
||||
// this.$emit('refreshDataList');
|
||||
// this.handleCancel();
|
||||
// });
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
this.$axios({
|
||||
url: '/base/equipment-maintain-log/update',
|
||||
method: 'put',
|
||||
data: {
|
||||
...this.form,
|
||||
maintainWorker: this.form.maintainWorker.join(','),
|
||||
special: false,
|
||||
relatePlan: 2
|
||||
}
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.btnLoading = false;
|
||||
this.$emit('refreshDataList');
|
||||
this.handleCancel();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 添加的提交
|
||||
this.$axios({
|
||||
url: '/base/equipment-maintain-log/create',
|
||||
method: 'post',
|
||||
data: {
|
||||
...this.form,
|
||||
maintainWorker: this.form.maintainWorker.join(','),
|
||||
special: false,
|
||||
relatePlan: 2,
|
||||
confirmed: false,
|
||||
}
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.btnLoading = false;
|
||||
this.form.id = response.data
|
||||
this.row.id = response.data
|
||||
this.showTable = true
|
||||
this.isAdd = true
|
||||
this.$emit('refreshDataList');
|
||||
// this.handleCancel();
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
handleEmitFun(val) {
|
||||
console.log('handleEmitFun', val);
|
||||
},
|
||||
|
||||
init(row) {
|
||||
this.visible = true;
|
||||
if (row) {
|
||||
this.row = row;
|
||||
this.showTable = row ? true : false;
|
||||
this.$nextTick(() => {
|
||||
if (row.id) {
|
||||
this.getInfo(row.id);
|
||||
this.getAttrList(row.id);
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
async getInfo(id) {
|
||||
this.formLoading = true;
|
||||
const res = await this.$axios(
|
||||
'/base/equipment-maintain-log/get?id=' + id
|
||||
);
|
||||
if (res.code == 0) {
|
||||
this.form = res.data;
|
||||
this.form.maintainWorker = res.data.maintainWorker.split(',');
|
||||
this.formLoading = false;
|
||||
}
|
||||
this.formLoading = false;
|
||||
},
|
||||
|
||||
async getAttrList(id, condition = {}) {
|
||||
if (!id) id = this.row.id;
|
||||
this.attrListLoading = true;
|
||||
const res = await this.$axios({
|
||||
url: '/base/equipment-maintain-log-det/page',
|
||||
method: 'get',
|
||||
params: {
|
||||
...this.attrQuery.params,
|
||||
logId: id,
|
||||
...condition,
|
||||
},
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.attrList = res.data.list;
|
||||
this.attrTotal = res.data.total;
|
||||
}
|
||||
this.attrListLoading = false;
|
||||
},
|
||||
|
||||
async getList(source = 'department') {
|
||||
const urls = [
|
||||
'/base/core-production-line/listAll',
|
||||
'/base/core-department/listAll',
|
||||
'/base/core-worker/listAll',
|
||||
];
|
||||
let res;
|
||||
switch (source) {
|
||||
case 'department':
|
||||
res = await this.$axios(urls[1]);
|
||||
this.departmentList = res.data || [];
|
||||
break;
|
||||
case 'maintainer':
|
||||
res = await this.$axios(urls[2]);
|
||||
this.maintainerList = res.data || [];
|
||||
break;
|
||||
case 'line':
|
||||
res = await this.$axios(urls[0]);
|
||||
this.lineList = res.data || [];
|
||||
break;
|
||||
}
|
||||
this.formLoading = false;
|
||||
},
|
||||
|
||||
// 保存表单
|
||||
handleSave() {
|
||||
this.$refs.form.validate(async (valid) => {
|
||||
if (valid) {
|
||||
await this.$axios({
|
||||
url: '/urlupdate', // this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
|
||||
method: 'post', // isEdit ? 'put' : 'post',
|
||||
data: this.form,
|
||||
});
|
||||
this.$modal.msgSuccess(`${isEdit ? '更新' : '创建'}成功`);
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
handleCancel() {
|
||||
this.visible = false;
|
||||
},
|
||||
|
||||
resetAttrform() {
|
||||
this.attrForm = {
|
||||
id: null,
|
||||
logId: this.row.id,
|
||||
maintenanceDes: '',
|
||||
program: null,
|
||||
remark: null,
|
||||
};
|
||||
},
|
||||
|
||||
// 新增属性
|
||||
handleAddAttr() {
|
||||
if (!this.row.id) return this.$message.error('请先选中保养记录');
|
||||
this.resetAttrform();
|
||||
this.attrTitle = '添加设备属性';
|
||||
this.attrFormVisible = true;
|
||||
},
|
||||
|
||||
// 编辑属性
|
||||
async handleEditAttr(attrId) {
|
||||
const res = await this.$axios({
|
||||
url: '/base/equipment-maintain-log-det/get',
|
||||
method: 'get',
|
||||
params: { id: attrId },
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.attrForm = res.data;
|
||||
this.attrTitle = '编辑设备属性';
|
||||
this.attrFormVisible = true;
|
||||
}
|
||||
},
|
||||
|
||||
// 删除属性
|
||||
handleDeleteAttr(attrId) {
|
||||
this.$confirm('确定删除该属性?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(async () => {
|
||||
const res = await this.$axios({
|
||||
url: 'url delete', // this.sections[1].urlDelete,
|
||||
method: 'delete',
|
||||
params: { id: attrId },
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getAttrList();
|
||||
},
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
|
||||
// 提交属性表
|
||||
submitAttrForm() {
|
||||
this.$refs['attrForm'].validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const isEdit = this.attrForm.id != null;
|
||||
this.attrFormSubmitting = true;
|
||||
const res = await this.$axios({
|
||||
url: isEdit
|
||||
? '/base/equipment-maintain-log-det/update'
|
||||
: '/base/equipment-maintain-log-det/create',
|
||||
method: isEdit ? 'put' : 'post',
|
||||
data: this.attrForm,
|
||||
});
|
||||
|
||||
if (res.code == 0) {
|
||||
this.closeAttrForm();
|
||||
this.$message({
|
||||
message: `${isEdit ? '更新' : '创建'}成功`,
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getAttrList();
|
||||
},
|
||||
});
|
||||
}
|
||||
this.attrFormSubmitting = false;
|
||||
} catch (err) {
|
||||
this.$message({
|
||||
message: err,
|
||||
type: 'error',
|
||||
duration: 1500,
|
||||
});
|
||||
this.attrFormSubmitting = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
closeAttrForm() {
|
||||
this.attrFormVisible = false;
|
||||
},
|
||||
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(
|
||||
`确定对${
|
||||
raw.data.name
|
||||
? '[名称=' + raw.data.name + ']'
|
||||
: '[序号=' + raw.data._pageIndex + ']'
|
||||
}进行删除操作?`,
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
deleteProductAttr(raw.data.id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
} else {
|
||||
this.addNew(raw.data.id);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.drawer >>> .el-drawer {
|
||||
border-radius: 8px 0 0 8px;
|
||||
}
|
||||
|
||||
.drawer >>> .el-date-editor,
|
||||
.drawer >>> .el-select {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.drawer >>> .el-drawer__header {
|
||||
margin: 0;
|
||||
padding: 32px 32px 24px;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.small-title::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: 4px;
|
||||
height: 22px;
|
||||
border-radius: 1px;
|
||||
margin-right: 8px;
|
||||
background-color: #0b58ff;
|
||||
}
|
||||
|
||||
.drawer-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.drawer-body__content {
|
||||
flex: 1;
|
||||
/* background: #eee; */
|
||||
padding: 20px 30px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.drawer-body__footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 18px;
|
||||
}
|
||||
</style>
|
539
src/views/equipment/base/maintain/Confirm/iconfont/demo.css
Normal file
539
src/views/equipment/base/maintain/Confirm/iconfont/demo.css
Normal file
@ -0,0 +1,539 @@
|
||||
/* Logo 字体 */
|
||||
@font-face {
|
||||
font-family: "iconfont logo";
|
||||
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
|
||||
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
|
||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
|
||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
|
||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
|
||||
}
|
||||
|
||||
.logo {
|
||||
font-family: "iconfont logo";
|
||||
font-size: 160px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
/* tabs */
|
||||
.nav-tabs {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.nav-tabs .nav-more {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: 42px;
|
||||
line-height: 42px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
#tabs {
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
#tabs li {
|
||||
cursor: pointer;
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
border-bottom: 2px solid transparent;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
margin-bottom: -1px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
|
||||
#tabs .active {
|
||||
border-bottom-color: #f00;
|
||||
color: #222;
|
||||
}
|
||||
|
||||
.tab-container .content {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* 页面布局 */
|
||||
.main {
|
||||
padding: 30px 100px;
|
||||
width: 960px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.main .logo {
|
||||
color: #333;
|
||||
text-align: left;
|
||||
margin-bottom: 30px;
|
||||
line-height: 1;
|
||||
height: 110px;
|
||||
margin-top: -50px;
|
||||
overflow: hidden;
|
||||
*zoom: 1;
|
||||
}
|
||||
|
||||
.main .logo a {
|
||||
font-size: 160px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.helps {
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
.helps pre {
|
||||
padding: 20px;
|
||||
margin: 10px 0;
|
||||
border: solid 1px #e7e1cd;
|
||||
background-color: #fffdef;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.icon_lists {
|
||||
width: 100% !important;
|
||||
overflow: hidden;
|
||||
*zoom: 1;
|
||||
}
|
||||
|
||||
.icon_lists li {
|
||||
width: 100px;
|
||||
margin-bottom: 10px;
|
||||
margin-right: 20px;
|
||||
text-align: center;
|
||||
list-style: none !important;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.icon_lists li .code-name {
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.icon_lists .icon {
|
||||
display: block;
|
||||
height: 100px;
|
||||
line-height: 100px;
|
||||
font-size: 42px;
|
||||
margin: 10px auto;
|
||||
color: #333;
|
||||
-webkit-transition: font-size 0.25s linear, width 0.25s linear;
|
||||
-moz-transition: font-size 0.25s linear, width 0.25s linear;
|
||||
transition: font-size 0.25s linear, width 0.25s linear;
|
||||
}
|
||||
|
||||
.icon_lists .icon:hover {
|
||||
font-size: 100px;
|
||||
}
|
||||
|
||||
.icon_lists .svg-icon {
|
||||
/* 通过设置 font-size 来改变图标大小 */
|
||||
width: 1em;
|
||||
/* 图标和文字相邻时,垂直对齐 */
|
||||
vertical-align: -0.15em;
|
||||
/* 通过设置 color 来改变 SVG 的颜色/fill */
|
||||
fill: currentColor;
|
||||
/* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
|
||||
normalize.css 中也包含这行 */
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.icon_lists li .name,
|
||||
.icon_lists li .code-name {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
/* markdown 样式 */
|
||||
.markdown {
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
.highlight {
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.markdown img {
|
||||
vertical-align: middle;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.markdown h1 {
|
||||
color: #404040;
|
||||
font-weight: 500;
|
||||
line-height: 40px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.markdown h2,
|
||||
.markdown h3,
|
||||
.markdown h4,
|
||||
.markdown h5,
|
||||
.markdown h6 {
|
||||
color: #404040;
|
||||
margin: 1.6em 0 0.6em 0;
|
||||
font-weight: 500;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.markdown h1 {
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.markdown h2 {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.markdown h3 {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.markdown h4 {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.markdown h5 {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.markdown h6 {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.markdown hr {
|
||||
height: 1px;
|
||||
border: 0;
|
||||
background: #e9e9e9;
|
||||
margin: 16px 0;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.markdown p {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
.markdown>p,
|
||||
.markdown>blockquote,
|
||||
.markdown>.highlight,
|
||||
.markdown>ol,
|
||||
.markdown>ul {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.markdown ul>li {
|
||||
list-style: circle;
|
||||
}
|
||||
|
||||
.markdown>ul li,
|
||||
.markdown blockquote ul>li {
|
||||
margin-left: 20px;
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
.markdown>ul li p,
|
||||
.markdown>ol li p {
|
||||
margin: 0.6em 0;
|
||||
}
|
||||
|
||||
.markdown ol>li {
|
||||
list-style: decimal;
|
||||
}
|
||||
|
||||
.markdown>ol li,
|
||||
.markdown blockquote ol>li {
|
||||
margin-left: 20px;
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
.markdown code {
|
||||
margin: 0 3px;
|
||||
padding: 0 5px;
|
||||
background: #eee;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.markdown strong,
|
||||
.markdown b {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.markdown>table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0px;
|
||||
empty-cells: show;
|
||||
border: 1px solid #e9e9e9;
|
||||
width: 95%;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.markdown>table th {
|
||||
white-space: nowrap;
|
||||
color: #333;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.markdown>table th,
|
||||
.markdown>table td {
|
||||
border: 1px solid #e9e9e9;
|
||||
padding: 8px 16px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.markdown>table th {
|
||||
background: #F7F7F7;
|
||||
}
|
||||
|
||||
.markdown blockquote {
|
||||
font-size: 90%;
|
||||
color: #999;
|
||||
border-left: 4px solid #e9e9e9;
|
||||
padding-left: 0.8em;
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
.markdown blockquote p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.markdown .anchor {
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.markdown .waiting {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.markdown h1:hover .anchor,
|
||||
.markdown h2:hover .anchor,
|
||||
.markdown h3:hover .anchor,
|
||||
.markdown h4:hover .anchor,
|
||||
.markdown h5:hover .anchor,
|
||||
.markdown h6:hover .anchor {
|
||||
opacity: 1;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.markdown>br,
|
||||
.markdown>p>br {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
|
||||
.hljs {
|
||||
display: block;
|
||||
background: white;
|
||||
padding: 0.5em;
|
||||
color: #333333;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.hljs-comment,
|
||||
.hljs-meta {
|
||||
color: #969896;
|
||||
}
|
||||
|
||||
.hljs-string,
|
||||
.hljs-variable,
|
||||
.hljs-template-variable,
|
||||
.hljs-strong,
|
||||
.hljs-emphasis,
|
||||
.hljs-quote {
|
||||
color: #df5000;
|
||||
}
|
||||
|
||||
.hljs-keyword,
|
||||
.hljs-selector-tag,
|
||||
.hljs-type {
|
||||
color: #a71d5d;
|
||||
}
|
||||
|
||||
.hljs-literal,
|
||||
.hljs-symbol,
|
||||
.hljs-bullet,
|
||||
.hljs-attribute {
|
||||
color: #0086b3;
|
||||
}
|
||||
|
||||
.hljs-section,
|
||||
.hljs-name {
|
||||
color: #63a35c;
|
||||
}
|
||||
|
||||
.hljs-tag {
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.hljs-title,
|
||||
.hljs-attr,
|
||||
.hljs-selector-id,
|
||||
.hljs-selector-class,
|
||||
.hljs-selector-attr,
|
||||
.hljs-selector-pseudo {
|
||||
color: #795da3;
|
||||
}
|
||||
|
||||
.hljs-addition {
|
||||
color: #55a532;
|
||||
background-color: #eaffea;
|
||||
}
|
||||
|
||||
.hljs-deletion {
|
||||
color: #bd2c00;
|
||||
background-color: #ffecec;
|
||||
}
|
||||
|
||||
.hljs-link {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* 代码高亮 */
|
||||
/* PrismJS 1.15.0
|
||||
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
|
||||
/**
|
||||
* prism.js default theme for JavaScript, CSS and HTML
|
||||
* Based on dabblet (http://dabblet.com)
|
||||
* @author Lea Verou
|
||||
*/
|
||||
code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
color: black;
|
||||
background: none;
|
||||
text-shadow: 0 1px white;
|
||||
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
||||
text-align: left;
|
||||
white-space: pre;
|
||||
word-spacing: normal;
|
||||
word-break: normal;
|
||||
word-wrap: normal;
|
||||
line-height: 1.5;
|
||||
|
||||
-moz-tab-size: 4;
|
||||
-o-tab-size: 4;
|
||||
tab-size: 4;
|
||||
|
||||
-webkit-hyphens: none;
|
||||
-moz-hyphens: none;
|
||||
-ms-hyphens: none;
|
||||
hyphens: none;
|
||||
}
|
||||
|
||||
pre[class*="language-"]::-moz-selection,
|
||||
pre[class*="language-"] ::-moz-selection,
|
||||
code[class*="language-"]::-moz-selection,
|
||||
code[class*="language-"] ::-moz-selection {
|
||||
text-shadow: none;
|
||||
background: #b3d4fc;
|
||||
}
|
||||
|
||||
pre[class*="language-"]::selection,
|
||||
pre[class*="language-"] ::selection,
|
||||
code[class*="language-"]::selection,
|
||||
code[class*="language-"] ::selection {
|
||||
text-shadow: none;
|
||||
background: #b3d4fc;
|
||||
}
|
||||
|
||||
@media print {
|
||||
|
||||
code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
text-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Code blocks */
|
||||
pre[class*="language-"] {
|
||||
padding: 1em;
|
||||
margin: .5em 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
:not(pre)>code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
background: #f5f2f0;
|
||||
}
|
||||
|
||||
/* Inline code */
|
||||
:not(pre)>code[class*="language-"] {
|
||||
padding: .1em;
|
||||
border-radius: .3em;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.token.comment,
|
||||
.token.prolog,
|
||||
.token.doctype,
|
||||
.token.cdata {
|
||||
color: slategray;
|
||||
}
|
||||
|
||||
.token.punctuation {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.namespace {
|
||||
opacity: .7;
|
||||
}
|
||||
|
||||
.token.property,
|
||||
.token.tag,
|
||||
.token.boolean,
|
||||
.token.number,
|
||||
.token.constant,
|
||||
.token.symbol,
|
||||
.token.deleted {
|
||||
color: #905;
|
||||
}
|
||||
|
||||
.token.selector,
|
||||
.token.attr-name,
|
||||
.token.string,
|
||||
.token.char,
|
||||
.token.builtin,
|
||||
.token.inserted {
|
||||
color: #690;
|
||||
}
|
||||
|
||||
.token.operator,
|
||||
.token.entity,
|
||||
.token.url,
|
||||
.language-css .token.string,
|
||||
.style .token.string {
|
||||
color: #9a6e3a;
|
||||
background: hsla(0, 0%, 100%, .5);
|
||||
}
|
||||
|
||||
.token.atrule,
|
||||
.token.attr-value,
|
||||
.token.keyword {
|
||||
color: #07a;
|
||||
}
|
||||
|
||||
.token.function,
|
||||
.token.class-name {
|
||||
color: #DD4A68;
|
||||
}
|
||||
|
||||
.token.regex,
|
||||
.token.important,
|
||||
.token.variable {
|
||||
color: #e90;
|
||||
}
|
||||
|
||||
.token.important,
|
||||
.token.bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.token.italic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.token.entity {
|
||||
cursor: help;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user