Compare commits
No commits in common. "d70887fef0dfb30f7af94975c3ae98bbb6bcfe12" and "8b88d6a9b9baa182c5ac50deacdda81e99ac3fc1" have entirely different histories.
d70887fef0
...
8b88d6a9b9
15
.env.dev
15
.env.dev
@ -1,7 +1,7 @@
|
||||
###
|
||||
# @Author: Do not edit
|
||||
# @Date: 2023-08-29 09:40:39
|
||||
# @LastEditTime: 2024-03-13 14:57:16
|
||||
# @LastEditTime: 2024-02-01 16:49:38
|
||||
# @LastEditors: zhp
|
||||
# @Description:
|
||||
###
|
||||
@ -13,19 +13,22 @@ 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.1.20:48080'
|
||||
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://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.47:48082'
|
||||
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.78:48082'
|
||||
# socket地址
|
||||
VUE_APP_Socket_API = 'ws://192.168.0.30:8888'
|
||||
VUE_APP_Socket_API = 'ws://10.70.2.2:8080'
|
||||
VUE_APP_Socket_Dcs_API = 'ws://10.70.180.10:8081'
|
||||
|
||||
# 积木报表指向地址
|
||||
|
@ -153,12 +153,3 @@ export function createConCoreWOr(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改分配产量
|
||||
export function updateConCoreWOr(data) {
|
||||
return request({
|
||||
url: '/base/core-order-con-work-order/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
@ -1,72 +0,0 @@
|
||||
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,23 +8,6 @@ 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({
|
||||
@ -34,15 +17,6 @@ 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({
|
||||
@ -112,15 +86,6 @@ 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({
|
||||
@ -139,6 +104,24 @@ 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({
|
||||
|
@ -5,13 +5,4 @@ export function getLineAll() {
|
||||
url: '/base/core-production-line/listAll',
|
||||
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: 2024-03-19 15:02:49
|
||||
* @LastEditTime: 2023-12-14 10:06:03
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
@ -26,11 +26,10 @@ export function updateQualityInspectionBoxBtn(data) {
|
||||
}
|
||||
|
||||
// 删除安灯按钮16键对应
|
||||
export function deleteQualityInspectionBoxBtn(query) {
|
||||
export function deleteQualityInspectionBoxBtn(id) {
|
||||
return request({
|
||||
url: 'base/quality-inspection-box-btn/deleteByLineSection',
|
||||
method: 'delete',
|
||||
params: query
|
||||
url: '/base/quality-inspection-box-btn/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -1,53 +0,0 @@
|
||||
/*
|
||||
* @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: 2024-02-28 18:16:56
|
||||
* @LastEditTime: 2023-11-16 20:15:02
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
@ -52,17 +52,6 @@ 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({
|
||||
@ -79,55 +68,3 @@ 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: 2024-02-25 22:23:54
|
||||
* @LastEditTime: 2023-11-25 16:22:49
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
@ -100,63 +100,3 @@ 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
|
||||
})
|
||||
}
|
||||
|
@ -1,26 +0,0 @@
|
||||
/*
|
||||
* @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
|
||||
})
|
||||
}
|
@ -1,104 +0,0 @@
|
||||
/*
|
||||
* @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: 2024-02-26 17:02:53
|
||||
* @LastEditTime: 2023-11-23 19:10:07
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
@ -42,39 +42,3 @@ 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: 2024-03-20 15:39:27
|
||||
* @LastEditTime: 2023-11-03 09:31:17
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
@ -33,12 +33,3 @@ 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-03-12 11:16:01
|
||||
* @LastEditTime: 2024-01-24 15:54:58
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
|
@ -26,13 +26,6 @@ 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({
|
||||
|
@ -1,18 +0,0 @@
|
||||
<?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>
|
Before Width: | Height: | Size: 2.7 KiB |
@ -1,24 +0,0 @@
|
||||
<?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>
|
Before Width: | Height: | Size: 2.3 KiB |
@ -1,24 +0,0 @@
|
||||
<?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>
|
Before Width: | Height: | Size: 2.3 KiB |
Binary file not shown.
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 20 KiB |
@ -360,9 +360,8 @@ 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 { getUserSimple } from "@/api/system/user.js";
|
||||
import { getUser } 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
|
||||
getUserSimple(id).then(res => {
|
||||
this.dept = res.data.deptName ? res.data.deptName : '---'
|
||||
getUser(id).then(res => {
|
||||
this.dept = res.data.dept ? res.data.dept.name : ''
|
||||
})
|
||||
},
|
||||
async logout() {
|
||||
|
@ -106,8 +106,6 @@ export default {
|
||||
case 'detail':
|
||||
this.handleDetail(data);
|
||||
break;
|
||||
default:
|
||||
this.handleTableActions({data, type});
|
||||
}
|
||||
},
|
||||
// 处理搜索栏按钮
|
||||
@ -135,13 +133,10 @@ export default {
|
||||
this.$refs['search-bar'].resetForm();
|
||||
this.resetQuery();
|
||||
break;
|
||||
default:
|
||||
this.searchBarClicked(btn);
|
||||
break;
|
||||
}
|
||||
},
|
||||
handleEmitFun(val) {
|
||||
console.log('[basicPageMixin handleEmitFun]', val);
|
||||
console.log('emit unf', val);
|
||||
switch (val.action) {
|
||||
// 查看详情
|
||||
case 'show-detail':
|
||||
|
@ -87,7 +87,6 @@ const user = {
|
||||
// 获取用户信息
|
||||
GetInfo({ commit, state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log('GetInfo')
|
||||
getInfo().then(res => {
|
||||
// 没有 data 数据,赋予个默认值
|
||||
if (!res) {
|
||||
@ -97,7 +96,7 @@ const user = {
|
||||
user: {
|
||||
id: '',
|
||||
avatar: '',
|
||||
username: '',
|
||||
userName: '',
|
||||
nickname: ''
|
||||
}
|
||||
}
|
||||
@ -114,7 +113,7 @@ const user = {
|
||||
commit('SET_ROLES', ['ROLE_DEFAULT'])
|
||||
}
|
||||
commit('SET_ID', user.id)
|
||||
// commit('SET_NAME', user.username) //无效调用,接口未提供username值
|
||||
commit('SET_NAME', user.userName)
|
||||
commit('SET_NICKNAME', user.nickname)
|
||||
commit('SET_AVATAR', avatar)
|
||||
resolve(res)
|
||||
|
@ -104,21 +104,16 @@ export const DICT_TYPE = {
|
||||
ORDER_PRIORITY: 'order_priority',
|
||||
PACK_SPEC: 'pack_spec',
|
||||
WORK_ORDER_STATUS: 'work_order_status',
|
||||
|
||||
|
||||
// ============== 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',
|
||||
// ============== GROUP - 质量模块 =============
|
||||
MATERIAL_GRADE: 'material_grade'
|
||||
WORK_SHOP: 'workshop'
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,4 +0,0 @@
|
||||
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: true,
|
||||
fullscreen: false,
|
||||
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) + "异常";
|
||||
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)
|
||||
}
|
||||
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-03-12 09:05:20
|
||||
* @LastEditTime: 2024-02-01 15:35:10
|
||||
* @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="'task'" :back="'energy'">
|
||||
<base-container :beilv="1" :size="'middle'" :title="'搬运任务'" :title-icon="'5_1'" :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="'order'" :back="'energy'">
|
||||
<base-container :beilv="1" :size="'middle'" :title="'周转进度'" :title-icon="'5_3'" :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="'productLine'"
|
||||
<base-container :beilv="1" :height="256" :size="'middle'" :title="'库存管理'" :title-icon="'5_5'"
|
||||
: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="'info'"
|
||||
<base-container :beilv="1" :height="318 + 338 + 16" :size="'middle'" :title="'库位信息'" :title-icon="'5_4'"
|
||||
:back="'energy'">
|
||||
<!-- <div style="width: 45%;position: absolute; top: 3em; right: 3em;">
|
||||
<top-radio-group />
|
||||
@ -715,7 +715,6 @@ export default {
|
||||
qualityMonthTableProps,
|
||||
modelMonth: '',
|
||||
qualityList1,
|
||||
// logoutTime: 43200000,
|
||||
qualityTableProps2,
|
||||
qualityList2,
|
||||
dateType: '0',
|
||||
@ -870,8 +869,6 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
|
||||
.visual-container {
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
@ -888,16 +885,14 @@ export default {
|
||||
position: relative;
|
||||
.unit{
|
||||
position: absolute;
|
||||
left: 290px;
|
||||
left: 260px;
|
||||
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 {
|
||||
@ -997,11 +992,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,11 +1,17 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-01-29 16:50:26
|
||||
* @LastEditTime: 2024-03-13 09:07:37
|
||||
* @LastEditTime: 2024-02-01 15:35:43
|
||||
* @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="{
|
||||
@ -13,7 +19,7 @@
|
||||
lineHeight: 88 + 'px',
|
||||
fontSize: 31 + 'px'
|
||||
}">
|
||||
<img src="../../assets/img/logo.png" style="width:1.1em;position:relative;top:.22em" alt="">
|
||||
<img src="../../assets/img/logo.png" style="width:1.1em;position:relative;top:.4em" alt="">
|
||||
许昌安彩冷端看板
|
||||
<h3 class="unit">单位:河南汇融数字科技有限公司</h3>
|
||||
<h3 class="time">{{ times }}</h3>
|
||||
@ -335,9 +341,7 @@ export default {
|
||||
// offsetWidth: null,
|
||||
cxNameList,
|
||||
cxDataList,
|
||||
// time:12,
|
||||
cutProps,
|
||||
// logoutTime: 43200000,
|
||||
cutTableDataList:[],
|
||||
clientWidth: 0,
|
||||
containerWidth: 111111,
|
||||
@ -428,15 +432,36 @@ export default {
|
||||
this.beilv2 = _this.clientWidth / 1920
|
||||
})()
|
||||
}
|
||||
// logoutInterval = setInterval(() => {
|
||||
// this.logoutTime -= 1000
|
||||
// }, 1000)
|
||||
// if (this.logoutTime === 0) {
|
||||
// this.SJGInitWebSocket()
|
||||
// this.CutInitWebSocket()
|
||||
// this.funInitWebSocket()
|
||||
// this.logoutTimeReset()
|
||||
// let obj = {
|
||||
// 'a': 11111,
|
||||
// 'b': 22222,
|
||||
// 'c': 33333,
|
||||
// 'd': 44444,
|
||||
// 'e': 55555,
|
||||
// }
|
||||
// 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() {
|
||||
// //离开页面删除检测器和所有侦听器
|
||||
@ -444,16 +469,13 @@ 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)
|
||||
},
|
||||
funWebSocketClose(e) {
|
||||
funInitWebSocket(e) {
|
||||
console.log('WebSocket 断开连接', e)
|
||||
},
|
||||
formatTime(time, option) {
|
||||
@ -699,17 +721,17 @@ export default {
|
||||
let cutArr = this.cutWsData.productHourData.map((item, index) => [
|
||||
// console.log(item)
|
||||
`
|
||||
<span style="color:rgba(255,255,255,0.7)" >${index + 1 || ''}
|
||||
<span style="color:rgba(255,255,255,0.5)" >${index + 1 || ''}
|
||||
</span>`,
|
||||
// formatDate(item.planStartTime) || '',
|
||||
`
|
||||
<span style="color:rgba(255,255,255,0.7)" >${item.lineName || ''}
|
||||
<span style="color:rgba(255,255,255,0.5)" >${item.lineName || ''}
|
||||
</span>`,
|
||||
`<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>
|
||||
`<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>
|
||||
<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
|
||||
@ -962,7 +984,7 @@ background: linear-gradient(to bottom,rgba(60,
|
||||
height: 290px;
|
||||
width: 1px;
|
||||
position: absolute;
|
||||
left: 66.3%;
|
||||
left: 66.2%;
|
||||
top: 12%;
|
||||
background: linear-gradient(to bottom, rgba(60,
|
||||
231,
|
||||
@ -1014,11 +1036,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-03-13 08:58:01
|
||||
* @LastEditTime: 2024-01-29 14:56:38
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -85,11 +85,11 @@ export default {
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
bottom: '10%',
|
||||
bottom: '2%',
|
||||
left: 'center',
|
||||
itemWidth: 12,
|
||||
itemHeight:12,
|
||||
icon: 'rect',
|
||||
itemWidth: 18,
|
||||
itemHeight:18,
|
||||
icon: 'circle',
|
||||
textStyle: {
|
||||
color: '#fff'
|
||||
},
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: gtz
|
||||
* @Date: 2022-01-19 15:58:17
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-02-22 10:26:59
|
||||
* @LastEditTime: 2024-02-01 15:25:14
|
||||
* @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: .01em" />
|
||||
<svg-icon :icon-class="titleIcon" style="font-size: 1em; position: relative; top: .08em" />
|
||||
{{ title }}
|
||||
</span>
|
||||
<!-- <span v-if="showTime" style="font-size: 20px;color:#52FFF8;margin-left: 10px;margin-top: 2px;">
|
||||
@ -157,58 +157,35 @@ 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%;
|
||||
backdrop-filter: blur(5px);
|
||||
// background-position: 0 0;
|
||||
}
|
||||
// &__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%;
|
||||
backdrop-filter: blur(5px);
|
||||
// background-position: 0 0;
|
||||
}
|
||||
|
||||
&__large {
|
||||
background: url(../../../../assets/img/high.png) no-repeat;
|
||||
background-size: 100% 100%;
|
||||
backdrop-filter: blur(5px);
|
||||
// background-position: 0 0;
|
||||
}
|
||||
&__eqStatus {
|
||||
background: url(../../../../assets/img/high.png) no-repeat;
|
||||
background: url(../../../../assets/img/short.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 {
|
||||
@ -295,9 +272,4 @@ 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-03-13 08:51:12
|
||||
* @LastEditTime: 2024-02-01 15:52:41
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -172,7 +172,7 @@ export default {
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
type: 'solid',
|
||||
color: '#25528f',
|
||||
color: '#213259', // 左边线的颜色
|
||||
width: '1' // 坐标线的宽度
|
||||
}
|
||||
},
|
||||
@ -186,7 +186,7 @@ export default {
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: '#25528f'
|
||||
color: '#213259'
|
||||
}
|
||||
},
|
||||
data: nameList
|
||||
@ -215,7 +215,7 @@ export default {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
type: 'solid',
|
||||
color: '#25528f',
|
||||
color: '#213259', // 左边线的颜色
|
||||
width: '1' // 坐标线的宽度
|
||||
}
|
||||
},
|
||||
@ -228,7 +228,7 @@ export default {
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: '#25528f'
|
||||
color: '#213259'
|
||||
}
|
||||
}
|
||||
// type: 'value'
|
||||
@ -260,7 +260,7 @@ export default {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
type: 'solid',
|
||||
color: '#25528f', // 左边线的颜色
|
||||
color: '#213259', // 左边线的颜色
|
||||
width: '1' // 坐标线的宽度
|
||||
}
|
||||
},
|
||||
@ -275,7 +275,7 @@ export default {
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: '#25528f'
|
||||
color: '#213259'
|
||||
}
|
||||
}
|
||||
// type: 'value'
|
||||
|
@ -145,7 +145,7 @@ export default {
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
type: 'solid',
|
||||
color: '#25528f', // 左边线的颜色
|
||||
color: '#213259', // 左边线的颜色
|
||||
width: '1' // 坐标线的宽度
|
||||
}
|
||||
},
|
||||
@ -156,7 +156,7 @@ export default {
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: '#25528f'
|
||||
color: '#213259'
|
||||
}
|
||||
},
|
||||
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: "#25528f",
|
||||
color: "#213259",
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: "#25528f",
|
||||
color: "#213259a0",
|
||||
},
|
||||
}
|
||||
},
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-27 13:54:52
|
||||
* @LastEditTime: 2024-03-13 09:04:11
|
||||
* @LastEditTime: 2024-01-25 14:08:27
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -91,78 +91,43 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
initChart(nameList, topNameList, nameWasteList, passRateList, wasteList) {
|
||||
let rawData = []
|
||||
rawData.push(passRateList,wasteList)
|
||||
// console.log(1)
|
||||
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,
|
||||
let series = [
|
||||
{
|
||||
// 辅助系列
|
||||
name: '良品',
|
||||
type: 'bar',
|
||||
stack: 'total',
|
||||
// silent: true,
|
||||
// itemStyle: {
|
||||
color: '#0fdedb',
|
||||
// },
|
||||
// barCategoryGap: '10%',
|
||||
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,
|
||||
// // },
|
||||
// // },
|
||||
// // },
|
||||
// }
|
||||
// ]
|
||||
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({
|
||||
|
||||
@ -170,9 +135,8 @@ export default {
|
||||
// }
|
||||
this.chart.setOption({
|
||||
legend: {
|
||||
itemWidth: 12,
|
||||
itemHeight: 12,
|
||||
icon: 'rect',
|
||||
// top: '2.5%',
|
||||
// right: '20px',
|
||||
textStyle: {
|
||||
color: '#ffffff'
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-07-19 15:18:30
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-03-12 09:34:06
|
||||
* @LastEditTime: 2024-02-01 15:35:29
|
||||
* @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,8 +982,6 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
|
||||
.visual-container {
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
@ -995,15 +993,12 @@ export default {
|
||||
background: url('../../assets/img/OperationalOverview/title.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
color: #00fff0;
|
||||
// word-spacing: 8px;
|
||||
letter-spacing: 8px;
|
||||
word-spacing: 8px;
|
||||
text-align: center;
|
||||
.unit {
|
||||
position: absolute;
|
||||
left: 290px;
|
||||
left: 260px;
|
||||
top: 25px;
|
||||
letter-spacing: 0px;
|
||||
color: rgba($color: #ffffff, $alpha: 8);
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
@ -1011,8 +1006,6 @@ export default {
|
||||
position: absolute;
|
||||
left: 1360px;
|
||||
top: 25px;
|
||||
letter-spacing: 0px;
|
||||
color: rgba($color: #ffffff, $alpha: 8);
|
||||
font-size: 20px;
|
||||
}
|
||||
.title-button {
|
||||
@ -1112,11 +1105,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, publicFormatter } from "@/utils/dict";
|
||||
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
@ -50,8 +50,7 @@ const tableProps = [
|
||||
},
|
||||
{
|
||||
prop: 'alarmGrade',
|
||||
label: '报警级别',
|
||||
filter: publicFormatter(DICT_TYPE.EQU_ALARM_LEVEL)
|
||||
label: '报警级别'
|
||||
},
|
||||
{
|
||||
prop: 'alarmReason',
|
||||
|
@ -7,11 +7,10 @@
|
||||
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible.sync="visible"
|
||||
:visible="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="true"
|
||||
:wrapper-closable="false"
|
||||
class="drawer"
|
||||
:before-close="beforeClose"
|
||||
custom-class="mes-drawer"
|
||||
size="60%"
|
||||
@closed="$emit('destroy')">
|
||||
@ -82,12 +81,12 @@
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div v-if="mode == 'edit'" class="drawer-body__footer">
|
||||
<div 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 type="primary" @click="handleConfirm">保存</el-button>
|
||||
</el-button>
|
||||
<el-button v-else type="primary" @click="handleConfirm">保存</el-button>
|
||||
<!-- sections的第二项必须是 属性列表 -->
|
||||
<!-- <el-button
|
||||
v-if="sections[1].allowAdd"
|
||||
@ -299,17 +298,6 @@ 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,7 +486,6 @@ export default {
|
||||
pageSize: 10,
|
||||
code: '',
|
||||
name: '',
|
||||
special: false
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
|
@ -83,14 +83,20 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="工段排序"
|
||||
prop="sort">
|
||||
<el-input-number
|
||||
prop="sort"
|
||||
:rules="[
|
||||
{
|
||||
type: 'number',
|
||||
trigger: 'change',
|
||||
message: '请输入正确的数字类型',
|
||||
transform: (val) => Number(val),
|
||||
},
|
||||
]">
|
||||
<el-input
|
||||
v-model="dataForm.sort"
|
||||
clearable
|
||||
controls-position="right"
|
||||
@change="$emit('update', dataForm)"
|
||||
placeholder="请输入工段排序"
|
||||
style="width: 100%" />
|
||||
placeholder="请输入工段排序" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -298,9 +298,9 @@ export default {
|
||||
// 工段排序
|
||||
sort: undefined,
|
||||
// 产线统计类型
|
||||
lineDataType: 0,
|
||||
lineDataType: undefined,
|
||||
// 工段统计类型
|
||||
sectionDataType: 0,
|
||||
sectionDataType: undefined,
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-03-14 10:02:53
|
||||
* @LastEditTime: 2023-12-14 13:52:42
|
||||
* @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-03-13 13:54:01
|
||||
* @LastEditTime: 2024-01-08 16:11:03
|
||||
* @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 || isedit" clearable placeholder="请输入产品名称" />
|
||||
<el-input v-model="dataForm.name" :disabled="isdetail" clearable placeholder="请输入产品名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
@ -35,7 +35,7 @@
|
||||
<el-input
|
||||
v-model="dataForm.code"
|
||||
clearable
|
||||
:disabled="isdetail || isedit"
|
||||
:disabled="isdetail"
|
||||
placeholder="请输入产品编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -44,12 +44,12 @@
|
||||
<el-select
|
||||
v-model="dataForm.materialType"
|
||||
filterable
|
||||
:disabled="isdetail || isedit"
|
||||
:disabled="isdetail"
|
||||
style="width: 100%"
|
||||
placeholder="请选择物料类型">
|
||||
<el-option
|
||||
v-for="(dict, index) in getDictDatas('material_type')"
|
||||
:key="index"
|
||||
v-for="dict in getDictDatas('material_type')"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
@ -62,12 +62,12 @@
|
||||
<el-select
|
||||
v-model="dataForm.productType"
|
||||
filterable
|
||||
:disabled="isdetail || isedit"
|
||||
:disabled="isdetail"
|
||||
style="width: 100%"
|
||||
placeholder="请选择产品类型">
|
||||
<el-option
|
||||
v-for="(dict, index) in getDictDatas(DICT_TYPE.PRODUCT_TYPE)"
|
||||
:key="index"
|
||||
v-for="dict in getDictDatas(DICT_TYPE.PRODUCT_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
@ -78,12 +78,12 @@
|
||||
<el-select
|
||||
v-model="dataForm.unit"
|
||||
filterable
|
||||
:disabled="isdetail || isedit"
|
||||
:disabled="isdetail"
|
||||
style="width: 100%"
|
||||
placeholder="请选择单位">
|
||||
<el-option
|
||||
v-for="(dict, index) in getDictDatas(DICT_TYPE.UNIT_DICT)"
|
||||
:key="index"
|
||||
v-for="dict in getDictDatas(DICT_TYPE.UNIT_DICT)"
|
||||
:key="dict.value"
|
||||
: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 || isedit" clearable placeholder="请输入单位平方数" />
|
||||
<el-input-number v-model="dataForm.area" :precision="6" :min="0" style="width: 100%" :disabled="isdetail" 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 || isedit" @blur="setArea" @clear="clearArea" clearable placeholder="请输入规格" />
|
||||
<el-input v-model="dataForm.specifications" :disabled="isdetail" @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 || isedit" clearable placeholder="请输入重量" />
|
||||
<el-input-number v-model="dataForm.weight" :precision="6" :min="0" style="width: 100%" :disabled="isdetail" clearable placeholder="请输入重量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -241,7 +241,7 @@ export default {
|
||||
productType: undefined,
|
||||
area: undefined,
|
||||
specifications: undefined,
|
||||
processTime: undefined,
|
||||
processTime: 0,
|
||||
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: false, message: "规格不能为空", trigger: "blur" }],
|
||||
specifications: [{ required: true, message: "规格不能为空", trigger: "blur" }],
|
||||
materialType: [{ required: true, message: "物料类型不能为空", trigger: "change" }],
|
||||
productType: [{ required: true, message: "产品类型不能为空", trigger: "change" }]
|
||||
productType: [{ required: true, message: "产品类型不能为空", trigger: "change" }],
|
||||
processTime: [{ required: true, message: "产线生产单位用时不能为空", trigger: "blur" }]
|
||||
}
|
||||
};
|
||||
},
|
||||
@ -322,14 +322,12 @@ export default {
|
||||
this.listQuery.total = response.data.total;
|
||||
});
|
||||
},
|
||||
init(row, isdetail) {
|
||||
init(id, isdetail) {
|
||||
this.initData();
|
||||
this.isdetail = isdetail || false;
|
||||
this.dataForm.id = row?.id || undefined;
|
||||
this.isedit = row?.id && row?.externalCode ? true : false;
|
||||
console.log('你好', this.isedit)
|
||||
this.dataForm.id = id || undefined;
|
||||
this.visible = true;
|
||||
if (row) {
|
||||
if (id) {
|
||||
this.idAttrShow = true
|
||||
} else {
|
||||
this.idAttrShow = false
|
||||
@ -340,14 +338,15 @@ export default {
|
||||
|
||||
if (this.dataForm.id) {
|
||||
// 获取产品详情
|
||||
this.urlOptions.infoURL(this.dataForm.id).then(response => {
|
||||
this.urlOptions.infoURL(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
|
||||
// if (this.dataForm.unit !== undefined) {
|
||||
// this.dataForm.unit = String(this.dataForm.unit)
|
||||
// }
|
||||
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.materialType !== undefined) {
|
||||
this.dataForm.materialType = String(this.dataForm.materialType)
|
||||
}
|
||||
|
@ -74,7 +74,9 @@ export default {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
getCoreProductAttr(this.dataForm.id).then((res) => {
|
||||
getCoreProductAttr({
|
||||
id: this.dataForm.id
|
||||
}).then((res) => {
|
||||
const { name, value } = res.data;
|
||||
this.dataForm.name = name;
|
||||
this.dataForm.value = value;
|
||||
|
@ -141,22 +141,6 @@ 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}"的数据项`, "提示", {
|
||||
@ -184,7 +168,7 @@ export default {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle = "详情";
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data, true);
|
||||
this.$refs.addOrUpdate.init(val.data.id, true);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-03-13 13:54:48
|
||||
* @LastEditTime: 2023-11-21 18:59:54
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -12,6 +12,18 @@
|
||||
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">
|
||||
@ -29,36 +41,6 @@
|
||||
</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"
|
||||
@ -110,13 +92,11 @@ 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" }]
|
||||
}
|
||||
};
|
||||
@ -125,26 +105,6 @@ 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,7 +47,6 @@ 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 = [
|
||||
{
|
||||
@ -59,11 +58,6 @@ const tableProps = [
|
||||
prop: 'factoryName',
|
||||
label: '工厂'
|
||||
},
|
||||
{
|
||||
prop: 'roomNameDict',
|
||||
label: '车间名称',
|
||||
filter: publicFormatter('workshop')
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '产线名称'
|
||||
@ -77,10 +71,10 @@ const tableProps = [
|
||||
label: '当前状态',
|
||||
filter: codeFilter('lineStatus')
|
||||
},
|
||||
// {
|
||||
// prop: 'tvalue',
|
||||
// label: '产线TT值(h)'
|
||||
// },
|
||||
{
|
||||
prop: 'tvalue',
|
||||
label: '产线TT值(h)'
|
||||
},
|
||||
{
|
||||
prop: 'description',
|
||||
label: '描述'
|
||||
@ -88,7 +82,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%;" clearable @change="materialMethodChange">
|
||||
<el-select v-model="dataForm.materialMethod" placeholder="请选择物料计算方式" style="width: 100%;" @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" clearable placeholder="请选择优先级" style="width: 100%;">
|
||||
<el-select v-model="dataForm.priority" 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" clearable placeholder="请选择工单类型" style="width: 100%;">
|
||||
<el-select v-model="dataForm.type" placeholder="请选择工单类型" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in workOrderTypeList"
|
||||
:key="item.id"
|
||||
@ -116,26 +116,9 @@
|
||||
</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" clearable placeholder="请选择关联产线" multiple style="width: 100%;">
|
||||
<el-select v-model="dataForm.productLineIds" placeholder="请选择关联产线" multiple style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in productLineList"
|
||||
:key="item.id"
|
||||
@ -147,7 +130,7 @@
|
||||
</el-col>
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="负责人" prop="workers">
|
||||
<el-input v-model="dataForm.workers" clearable placeholder="请输入负责人"></el-input>
|
||||
<el-input v-model="dataForm.workers" placeholder="请输入负责人"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -164,7 +147,7 @@
|
||||
import { getProductAll } from '@/api/base/product'
|
||||
import { getProcessFlowList, workOrderList } from '@/api/base/orderManage'
|
||||
import { createCoreWO, updateCoreWO, getCode, getCoreWO } from '@/api/base/coreWorkOrder'
|
||||
import { getLinelistByRoom, getLineAll } from '@/api/base/productionLine'
|
||||
import { getLineAll } from '@/api/base/productionLine'
|
||||
import basicAdd from '../../core/mixins/basic-add';
|
||||
|
||||
export default {
|
||||
@ -197,7 +180,6 @@ export default {
|
||||
productLineIds: [],
|
||||
type: '',
|
||||
workers: '',
|
||||
roomNameDict: '',
|
||||
status: 1
|
||||
},
|
||||
rules: {
|
||||
@ -205,9 +187,7 @@ export default {
|
||||
planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }],
|
||||
planAssignQuantity: [{ required: true, message: "计划投入数量不能为空", trigger: "blur" }],
|
||||
planQuantity: [{ required: true, message: "计划生产数量不能为空", trigger: "blur" }],
|
||||
roomNameDict: [{ required: true, message: "车间名称不能为空", trigger: "blur" }],
|
||||
productLineIds: [{ required: true, message: "关联产线不能为空", trigger: "change" }],
|
||||
materialMethod: [{ required: true, message: "物料计算方式不能为空", trigger: "change" }]
|
||||
productLineIds: [{ required: true, message: "关联产线不能为空", trigger: "change" }]
|
||||
},
|
||||
productList: [],
|
||||
processFlowList: [],
|
||||
@ -226,14 +206,6 @@ 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) {
|
||||
@ -264,9 +236,7 @@ export default {
|
||||
if (this.dataForm.priority !== undefined) {
|
||||
this.dataForm.priority = String(this.dataForm.priority)
|
||||
}
|
||||
if (this.dataForm.roomNameDict !== undefined) {
|
||||
this.dataForm.roomNameDict = String(this.dataForm.roomNameDict)
|
||||
}
|
||||
this.dataForm.priority
|
||||
});
|
||||
} else {
|
||||
if (this.urlOptions.isGetCode) {
|
||||
@ -294,20 +264,19 @@ export default {
|
||||
this.urlOptions.createURL(this.dataForm).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.visible = false;
|
||||
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");
|
||||
// });
|
||||
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: 2024-03-15 15:34:58
|
||||
* @LastEditTime: 2023-11-16 09:14:35
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -17,47 +17,17 @@
|
||||
</small-title>
|
||||
<div class="content">
|
||||
<div class="formContent">
|
||||
<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>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<div class="attr-list">
|
||||
@ -71,12 +41,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.isallocation"></el-input>
|
||||
<el-input v-model="scope.row.planAssignmentQuantity" :disabled="scope.row.actualAssignmentQuantity"></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.isallocation"></el-input>
|
||||
<el-input v-model="scope.row.actualAssignmentQuantity" :disabled="scope.row.actualAssignmentQuantity"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
@ -116,11 +86,11 @@
|
||||
</div>
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="goback()">取消</el-button>
|
||||
<el-button style="" type="primary" @click="goback()">关闭</el-button>
|
||||
<!-- <el-button v-if="isdetail" type="primary" @click="goEdit()">
|
||||
编辑
|
||||
</el-button> -->
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</el-button>
|
||||
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -134,7 +104,7 @@
|
||||
|
||||
<script>
|
||||
import basicAdd from '../../core/mixins/basic-add';
|
||||
import { getConOrderList, updateConCoreWOr, getCoreWO, statusChange } from '@/api/base/coreWorkOrder';
|
||||
import { getConOrderList, createConCoreWOr, getCoreWO } from '@/api/base/coreWorkOrder';
|
||||
import SmallTitle from '../material/SmallTitle';
|
||||
// import { parseTime } from '../../core/mixins/code-filter';
|
||||
// import attrAdd from './attr-add';
|
||||
@ -165,43 +135,11 @@ export default {
|
||||
tableData: [],
|
||||
visible: false,
|
||||
isdetail: false,
|
||||
idAttrShow: false,
|
||||
rules: {
|
||||
name: [{ required: true, message: "工单名称不能为空", trigger: "blur" }],
|
||||
finishProduceTime: [{ required: true, message: "实际生产完成时间不能为空", trigger: "change" }]
|
||||
},
|
||||
idAttrShow: false
|
||||
};
|
||||
},
|
||||
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;
|
||||
@ -221,8 +159,8 @@ export default {
|
||||
// });
|
||||
// return;
|
||||
}
|
||||
// 修改的提交
|
||||
updateConCoreWOr({
|
||||
// 添加的提交
|
||||
createConCoreWOr({
|
||||
...row,
|
||||
workOrderId: this.dataForm.id
|
||||
}).then((response) => {
|
||||
@ -235,17 +173,16 @@ 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.length;
|
||||
this.listQuery.total = response.data.total;
|
||||
});
|
||||
},
|
||||
// 构造一行
|
||||
@ -304,9 +241,6 @@ export default {
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
/* .item .el-form-item__label {
|
||||
color: red;
|
||||
} */
|
||||
.drawer >>> .el-drawer {
|
||||
border-radius: 8px 0 0 8px;
|
||||
display: flex;
|
||||
@ -315,7 +249,6 @@ export default {
|
||||
|
||||
.drawer >>> .el-form-item__label {
|
||||
padding: 0;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.drawer >>> .el-drawer__header {
|
||||
@ -362,18 +295,4 @@ 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: 2024-03-15 15:40:24
|
||||
* @LastEditTime: 2023-12-26 16:59:25
|
||||
* @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 ? 'MES-订单下发' : 'ERP'}}</div>
|
||||
<div class="lightTip">{{ dataForm.triggerOrigin === 1 ? 'MES' : dataForm.triggerOrigin === 2 ? 'ERP' : ''}}</div>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<div class="blodTip">所属订单</div>
|
||||
@ -97,10 +97,6 @@
|
||||
<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>
|
||||
@ -222,7 +218,7 @@
|
||||
|
||||
<script>
|
||||
// import basicAdd from '../../core/mixins/basic-add';
|
||||
import { getCoreWO, getCoreWOMaPage, getConOrderList, getCoreWOListById } from "@/api/base/coreWorkOrder";
|
||||
import { getCoreWO, getMaterialBomPage, getConOrderList, getCoreWOListById } from "@/api/base/coreWorkOrder";
|
||||
// import { orderList } from "@/api/base/orderManage";
|
||||
import { getProcessFlowList } from '@/api/base/orderManage'
|
||||
import SmallTitle from './SmallTitle';
|
||||
@ -265,9 +261,8 @@ const tableProps = [
|
||||
|
||||
const tableProps1 = [
|
||||
{
|
||||
prop: 'material',
|
||||
label: '物料名称',
|
||||
filter: publicFormatter('material')
|
||||
prop: 'materialName',
|
||||
label: '物料名称'
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
@ -275,13 +270,9 @@ const tableProps1 = [
|
||||
filter: publicFormatter('unit_dict')
|
||||
},
|
||||
{
|
||||
prop: 'remaining',
|
||||
prop: 'num',
|
||||
label: '剩余生产预计消耗'
|
||||
},
|
||||
{
|
||||
prop: 'num',
|
||||
label: '库存数量'
|
||||
}
|
||||
];
|
||||
|
||||
export default {
|
||||
@ -440,17 +431,11 @@ export default {
|
||||
// this.listQuery.total = response.data.total;
|
||||
});
|
||||
// 获取预使用原料列表
|
||||
console.log()
|
||||
if (this.dataForm.id) {
|
||||
getCoreWOMaPage({
|
||||
workOrderId: this.dataForm.id,
|
||||
pageNo: 1,
|
||||
pageSize: 100
|
||||
if (this.dataForm.planProductId) {
|
||||
getMaterialBomPage({
|
||||
productId: this.dataForm.planProductId,
|
||||
}).then((response) => {
|
||||
this.materialList = response.data.records.map((item) => {
|
||||
item.remaining = item?.num * this.dataForm.remainingQuantity || 0
|
||||
return item
|
||||
});
|
||||
this.materialList = response.data;
|
||||
// this.listQuery.total = response.data.length;
|
||||
});
|
||||
}
|
||||
|
@ -60,7 +60,6 @@ import {
|
||||
getConOrderList,
|
||||
getCoreWOList
|
||||
} from '@/api/base/coreWorkOrder';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
|
||||
|
||||
const tableProps = [
|
||||
@ -83,13 +82,6 @@ const tableProps = [
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'roomNameDict',
|
||||
label: '负责车间',
|
||||
minWidth: 120,
|
||||
filter: publicFormatter('workshop'),
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'workers',
|
||||
label: '负责人',
|
||||
@ -109,7 +101,7 @@ const tableProps = [
|
||||
{
|
||||
prop: 'status',
|
||||
label: '工单状态',
|
||||
filter: (val) => ['', '等待', '激活', '暂停', '完成', '作废', '终止'][val]
|
||||
filter: (val) => ['', '等待', '激活', '暂停', '完成', '', '', '', '', '作废'][val]
|
||||
},
|
||||
{
|
||||
prop: 'planFinishTime',
|
||||
@ -197,7 +189,17 @@ export default {
|
||||
{
|
||||
name: 'status',
|
||||
type: 'equal',
|
||||
value: 1
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
name: 'status',
|
||||
type: 'equal',
|
||||
value: 3
|
||||
},
|
||||
{
|
||||
name: 'status',
|
||||
type: 'equal',
|
||||
value: 4
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -221,25 +223,6 @@ 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',
|
||||
@ -261,23 +244,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: [
|
||||
@ -306,8 +289,7 @@ export default {
|
||||
{ id: 2, name: '激活' },
|
||||
{ id: 3, name: '暂停' },
|
||||
{ id: 4, name: '完成' },
|
||||
{ id: 5, name: '作废' },
|
||||
{ id: 6, name: '终止' }
|
||||
{ id: 9, name: '作废' }
|
||||
],
|
||||
param: 'status',
|
||||
clearable: true
|
||||
@ -419,45 +401,36 @@ export default {
|
||||
opration = '暂停'
|
||||
}
|
||||
if (val.type === 'nullify') {
|
||||
param.status = 5
|
||||
opration = '作废'
|
||||
param.status = 9
|
||||
opration = '报废'
|
||||
}
|
||||
if (val.type === 'finish') {
|
||||
param.status = 4
|
||||
opration = '完成'
|
||||
}
|
||||
if (val.type === 'stop') {
|
||||
param.status = 6
|
||||
opration = '终止'
|
||||
}
|
||||
console.log('22',val)
|
||||
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);
|
||||
// }
|
||||
},
|
||||
});
|
||||
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(() => { });
|
||||
} else {
|
||||
// 完成弹出分配框
|
||||
this.allocationOrder(param);
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
}
|
||||
},
|
||||
allocationOrder(val) {
|
||||
@ -465,25 +438,20 @@ export default {
|
||||
getConOrderList({
|
||||
workOrderId: val.id,
|
||||
}).then((response) => {
|
||||
|
||||
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(() => { });
|
||||
|
||||
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.listQuery.total = response.data.total;
|
||||
});
|
||||
},
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-02-21 09:41:39
|
||||
* @LastEditTime: 2023-12-04 15:10:11
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -59,7 +59,7 @@
|
||||
style="width: 100%"
|
||||
placeholder="请选择物料类型">
|
||||
<el-option
|
||||
v-for="dict in getDictDatas('material_type')"
|
||||
v-for="dict in materialList"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value" />
|
||||
@ -238,7 +238,7 @@ export default {
|
||||
remark: undefined,
|
||||
unit: ''
|
||||
},
|
||||
// materialList: [],
|
||||
materialList: [],
|
||||
supplierList: [],
|
||||
materialAttrList: [],
|
||||
unitList: [],
|
||||
@ -258,18 +258,17 @@ export default {
|
||||
methods: {
|
||||
async getDict() {
|
||||
// 物料类型列表
|
||||
// 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 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 supplierRes = await getSupplierList();
|
||||
this.supplierList = supplierRes.data;
|
||||
@ -349,9 +348,6 @@ 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,79 +1,72 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-10-17 16:50:19
|
||||
* @LastEditTime: 2024-02-28 10:07:29
|
||||
* @LastEditTime: 2023-12-01 16:48:53
|
||||
* @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="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 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-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">
|
||||
产品属性列表
|
||||
@ -103,7 +96,7 @@
|
||||
:page-sizes="[5, 10, 15]"
|
||||
@pagination="getList" />
|
||||
</div> -->
|
||||
<!-- </div> -->
|
||||
<!-- </div> -->
|
||||
<!-- </div> -->
|
||||
|
||||
<!-- <div style="position: absolute; bottom: 24px; right: 24px">
|
||||
@ -193,7 +186,6 @@ 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: 2024-02-28 10:38:34
|
||||
* @LastEditTime: 2023-11-24 09:13:50
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -55,11 +55,7 @@ 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-03-20 08:36:01
|
||||
* @LastEditTime: 2024-01-22 09:55:32
|
||||
* @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,7 +46,6 @@
|
||||
import BalanceChart from '../balanceChart';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import AnalysisChart from './chart.vue';
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -83,7 +82,7 @@ export default {
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间',
|
||||
dateType: 'month',
|
||||
dateType: 'monthrange',
|
||||
format: 'yyyy-MM',
|
||||
valueFormat: 'timestamp',
|
||||
rangeSeparator: '-',
|
||||
@ -256,13 +255,13 @@ export default {
|
||||
const date = eq.dynamicName;
|
||||
eq.children.forEach((sub) => {
|
||||
if (sub.dynamicName == '设备CT')
|
||||
row[date + '_eq_ct'] = sub?.dynamicValue?.toFixed(2);
|
||||
row[date + '_eq_ct'] = sub.dynamicValue;
|
||||
if (sub.dynamicName == '设备TT')
|
||||
row[date + '_eq_tt'] = sub?.dynamicValue?.toFixed(2);
|
||||
row[date + '_eq_tt'] = sub.dynamicValue;
|
||||
if (sub.dynamicName == '产线CT')
|
||||
row[date + '_pl_ct'] = sub.dynamicValue?.toFixed(2);
|
||||
row[date + '_pl_ct'] = sub.dynamicValue;
|
||||
if (sub.dynamicName == '产线TT')
|
||||
row[date + '_pl_tt'] = sub.dynamicValue?.toFixed(2);
|
||||
row[date + '_pl_tt'] = sub.dynamicValue;
|
||||
});
|
||||
});
|
||||
this.tableData.push(row);
|
||||
@ -370,63 +369,21 @@ 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;
|
||||
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;
|
||||
this.queryParams.startTime = btn.timeArr ? btn.timeArr[0] : null;
|
||||
this.queryParams.endTime = btn.timeArr ? btn.timeArr[1] : null;
|
||||
|
||||
if (!btn.lineIds || !btn.timeArr) {
|
||||
if (!btn.lineIds || !btn.timeArr.length) {
|
||||
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: 2024-02-23 14:50:22
|
||||
* @LastEditTime: 2023-09-12 11:13:34
|
||||
* @FilePath: \basic-admin\src\filters\basicData\index.js
|
||||
* @Description:
|
||||
*/
|
||||
@ -62,17 +62,6 @@ 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,7 +111,6 @@ export default {
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'searchTime',
|
||||
defaultSelect: [],
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@ -133,14 +132,6 @@ 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,7 +110,6 @@ export default {
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'searchTime',
|
||||
defaultSelect: [],
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@ -132,14 +131,6 @@ 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,5 +1,8 @@
|
||||
<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'
|
||||
@ -53,10 +56,11 @@ 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]
|
||||
@ -67,14 +71,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,23 +4,38 @@
|
||||
<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>
|
||||
@ -31,17 +46,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: {
|
||||
@ -57,7 +72,7 @@ export default {
|
||||
return {
|
||||
tableProps,
|
||||
tableData: [],
|
||||
addButtonShow: '新增',
|
||||
addButtonShow:'新增',
|
||||
form: {
|
||||
id: '',
|
||||
energyTypeId: '',
|
||||
@ -83,16 +98,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)
|
||||
}
|
||||
@ -115,10 +130,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
|
||||
}
|
||||
@ -127,11 +142,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("操作成功");
|
||||
@ -140,9 +155,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,20 +2,44 @@
|
||||
<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>
|
||||
@ -44,7 +68,7 @@ const tableProps = [
|
||||
},
|
||||
{
|
||||
prop: 'tableName',
|
||||
label: '能源表名',
|
||||
label: '水/气表名',
|
||||
filter: publicFormatter('table_name'),
|
||||
minWidth: 110
|
||||
},
|
||||
@ -118,25 +142,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,
|
||||
@ -185,10 +209,10 @@ export default {
|
||||
break
|
||||
default:
|
||||
this.$modal.confirm('是否确认导出').then(() => {
|
||||
return energyQuantityManualExport({ energyTypeId: this.queryParams.energyTypeId, recordTime: this.queryParams.recordTime });
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '能源报表.xls');
|
||||
}).catch(() => { })
|
||||
return energyQuantityManualExport({...this.queryParams});
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '能源报表.xls');
|
||||
}).catch(() => {})
|
||||
}
|
||||
},
|
||||
/** 查询列表 */
|
||||
@ -257,13 +281,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,12 +2,27 @@
|
||||
<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>
|
||||
|
||||
@ -56,8 +71,7 @@ export default {
|
||||
type: 'select',
|
||||
label: '能源类型',
|
||||
selectOptions: [],
|
||||
param: 'energyTypeId',
|
||||
filterable: true
|
||||
param: 'energyTypeId'
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
@ -115,7 +129,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]
|
||||
@ -132,7 +146,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]
|
||||
@ -179,7 +193,7 @@ export default {
|
||||
if (this.exportList.length > 0) {
|
||||
let body = this.exportList.map((x) => [
|
||||
x.objName,
|
||||
x.objCode,
|
||||
x.objRemark,
|
||||
x.energyTypeName,
|
||||
x.startValue,
|
||||
x.endValue,
|
||||
|
@ -16,7 +16,10 @@
|
||||
<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>
|
||||
@ -25,9 +28,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>
|
||||
@ -35,33 +38,56 @@
|
||||
<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>
|
||||
@ -126,12 +152,10 @@ export default {
|
||||
id: '',
|
||||
name: '',
|
||||
code: '',
|
||||
unit: '',
|
||||
singlePrice: 0,
|
||||
nuit: '',
|
||||
pricingMethod: 2,
|
||||
dim: '',
|
||||
push: false,
|
||||
description: ''
|
||||
leaderName: '',
|
||||
push: false
|
||||
},
|
||||
isEdit: false, //是否是编辑
|
||||
rules: {
|
||||
@ -158,24 +182,22 @@ 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.unit = res.data.unit
|
||||
this.form.nuit = res.data.nuit
|
||||
this.form.pricingMethod = res.data.pricingMethod
|
||||
this.form.push = res.data.push ? true : false
|
||||
this.form.description = res.data.description
|
||||
switch (this.form.pricingMethod) {
|
||||
this.form.leaderName = res.data.leaderName
|
||||
this.form.push = res.data.push ? true : false
|
||||
switch(this.form.pricingMethod) {
|
||||
case 0:
|
||||
this.tableData1 = res.data.segPriceList || []
|
||||
this.tableData1 = this.form.segPriceList || []
|
||||
break;
|
||||
case 1:
|
||||
this.tableData2 = res.data.usedPriceList || []
|
||||
this.form.dim = res.data.dim
|
||||
this.tableData2 = this.form.usedPriceList || []
|
||||
break;
|
||||
default:
|
||||
this.form.singlePrice = res.data.singlePrice || 0
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -211,16 +233,24 @@ 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)
|
||||
@ -237,7 +267,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('时间段表格数据不能为空')
|
||||
@ -267,7 +297,7 @@ export default {
|
||||
default:// 固定单价
|
||||
if (!this.form.singlePrice) {
|
||||
this.$modal.msgError('单价有误请检查,请检查')
|
||||
return false
|
||||
return false
|
||||
}
|
||||
}
|
||||
console.log(this.form)
|
||||
@ -280,11 +310,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("操作成功");
|
||||
@ -298,11 +328,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,22 +2,40 @@
|
||||
<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>
|
||||
|
||||
@ -142,8 +160,8 @@ export default {
|
||||
method: '1'
|
||||
},
|
||||
typeList: [
|
||||
{ id: 1, name: '合并' },
|
||||
{ id: 2, name: '详细' }
|
||||
{id: 1, name: '合并'},
|
||||
{id: 2, name: '详细'}
|
||||
]
|
||||
};
|
||||
},
|
||||
@ -165,7 +183,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
|
||||
@ -173,21 +191,15 @@ 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 = ''
|
||||
}
|
||||
})
|
||||
if (this.queryParams.method === '1') {
|
||||
this.list = arr
|
||||
this.list2 = []
|
||||
} else {
|
||||
this.list2 = arr
|
||||
this.list1 = []
|
||||
}
|
||||
this.list = arr
|
||||
this.total = response.data.total;
|
||||
});
|
||||
},
|
||||
@ -200,7 +212,7 @@ export default {
|
||||
toggleTab() {
|
||||
if (this.activeName === 'auto') {
|
||||
this.queryParams.method = '1'
|
||||
} else {
|
||||
}else{
|
||||
this.queryParams.method = '2'
|
||||
}
|
||||
this.queryParams.pageNo = 1
|
||||
@ -220,27 +232,21 @@ 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: 'primary',
|
||||
color: 'warning',
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
|
@ -19,7 +19,6 @@
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
max-height="600"
|
||||
@emitFun="handleEmitFun">
|
||||
<!-- <method-btn
|
||||
v-if="tableBtn.length"
|
||||
@ -94,29 +93,17 @@ 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: 'datePicker',
|
||||
label: '时间',
|
||||
dateType: 'month',
|
||||
format: 'yyyy-MM',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
width: 240,
|
||||
type: 'select',
|
||||
label: '请选择月份',
|
||||
placeholder: '请选择月份',
|
||||
param: 'month',
|
||||
selectOptions: Array(12)
|
||||
.fill(0)
|
||||
.map((v, i) => ({
|
||||
id: i + 1,
|
||||
name: `${i + 1}月`,
|
||||
})),
|
||||
},
|
||||
{
|
||||
__index: 'line',
|
||||
@ -124,7 +111,6 @@ export default {
|
||||
label: '产线',
|
||||
placeholder: '请选择产线',
|
||||
param: 'lineId',
|
||||
filterable: true
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@ -178,13 +164,7 @@ export default {
|
||||
},
|
||||
});
|
||||
if (code === 0) {
|
||||
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
|
||||
});
|
||||
this.list = data;
|
||||
} else {
|
||||
this.list.splice(0);
|
||||
}
|
||||
@ -194,14 +174,12 @@ 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 = [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')
|
||||
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',
|
||||
];
|
||||
} 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 './DialogForm';
|
||||
import DialogForm from '@/components/DialogForm';
|
||||
|
||||
export default {
|
||||
name: 'AlarmHandle',
|
||||
|
@ -1,520 +0,0 @@
|
||||
<!--
|
||||
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: false, message: '报警级别不能为空', trigger: 'blur' }]">
|
||||
:rules="[{ required: true, message: '报警级别不能为空', trigger: 'blur' }]">
|
||||
<el-select
|
||||
:disabled="disabled"
|
||||
v-model="dataForm.grade"
|
||||
|
@ -7,11 +7,10 @@
|
||||
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible.sync="visible"
|
||||
:visible="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="true"
|
||||
:wrapper-closable="false"
|
||||
class="drawer"
|
||||
:before-close="beforeClose"
|
||||
custom-class="mes-drawer"
|
||||
:size="size || '50%'"
|
||||
@closed="$emit('destroy')">
|
||||
@ -44,51 +43,7 @@
|
||||
:rows="formRows" /> -->
|
||||
|
||||
<!-- <el-row v-if="mode.includes('detail')" 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-row style="margin-bottom: 24px">
|
||||
<el-col :span="8">
|
||||
<div
|
||||
class="title"
|
||||
@ -107,7 +62,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">
|
||||
@ -173,11 +128,12 @@
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div v-if="!mode.includes('detail')" class="drawer-body__footer">
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="handleCancel">取消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="handleSave">
|
||||
v-if="!mode.includes('detail')"
|
||||
@click="handleCancel">
|
||||
确定
|
||||
</el-button>
|
||||
</div>
|
||||
@ -207,8 +163,6 @@
|
||||
<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',
|
||||
@ -237,21 +191,16 @@ const SmallTitle = {
|
||||
|
||||
export default {
|
||||
components: { SmallTitle, DialogForm, BaseInfoForm },
|
||||
props: ['sections', 'defaultMode', 'dataId', 'size', 'equipmentId', 'id'], // dataId 作为一个通用的存放id的字段
|
||||
props: ['sections', 'defaultMode', 'dataId', 'size'], // 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: '',
|
||||
@ -376,34 +325,6 @@ 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':
|
||||
@ -421,16 +342,6 @@ 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() {
|
||||
@ -449,9 +360,9 @@ export default {
|
||||
if (valid) {
|
||||
const isEdit = !this.mode.includes('detail');
|
||||
await this.$axios({
|
||||
url: '/base/equipment-bind-group/update',
|
||||
url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
|
||||
method: isEdit ? 'put' : 'post',
|
||||
data: this.dataForm,
|
||||
data: this.form,
|
||||
});
|
||||
this.$modal.msgSuccess(`${isEdit ? '更新' : '创建'}成功`);
|
||||
this.visible = false;
|
||||
|
@ -48,8 +48,6 @@
|
||||
size="45%"
|
||||
:default-mode="editMode"
|
||||
:data-id="alarmForm.id"
|
||||
:equipment-id="equipmentId"
|
||||
:id="id"
|
||||
:sections="[
|
||||
{
|
||||
name: '基本信息',
|
||||
@ -222,7 +220,7 @@ export default {
|
||||
{
|
||||
select: true,
|
||||
label: '设备',
|
||||
url: '/base/core-equipment/page?pageNo=1&pageSize=100&special=false',
|
||||
url: '/base/core-equipment/page?pageNo=1&pageSize=100',
|
||||
prop: 'equipmentId',
|
||||
bind: {
|
||||
filterable: true,
|
||||
@ -268,8 +266,6 @@ export default {
|
||||
equipmentGroupCode: undefined,
|
||||
equipmentGroupName: undefined,
|
||||
},
|
||||
equipmentId: undefined,
|
||||
id: undefined,
|
||||
editVisible: false,
|
||||
editMode: '',
|
||||
drawerBaseInfoRows: [
|
||||
@ -444,8 +440,6 @@ 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,14 +41,11 @@
|
||||
<base-dialog
|
||||
:dialogTitle="title"
|
||||
:dialogVisible="open"
|
||||
width="30%"
|
||||
width="700px"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<!-- <DialogForm v-if="open" ref="form" v-model="form" :rows="rows" /> -->
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit" />
|
||||
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" />
|
||||
</base-dialog>
|
||||
|
||||
<!-- 抽屉 详情 -->
|
||||
@ -126,12 +123,11 @@ 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, AddOrUpdate },
|
||||
components: { BasicDrawer },
|
||||
data() {
|
||||
return {
|
||||
searchBarKeys: ['equipmentId', 'plcId'],
|
||||
@ -347,10 +343,6 @@ export default {
|
||||
this.initSearchOptions();
|
||||
},
|
||||
methods: {
|
||||
successSubmit() {
|
||||
this.cancel()
|
||||
this.getList()
|
||||
},
|
||||
async getEquipmentOptions() {
|
||||
const res = await this.$axios({
|
||||
url: '/base/core-equipment/listAll',
|
||||
@ -379,7 +371,7 @@ export default {
|
||||
});
|
||||
this.searchBarFormConfig[1].selectOptions = plcList.map((item) => {
|
||||
return {
|
||||
name: item.code,
|
||||
name: item.name,
|
||||
id: item.id,
|
||||
};
|
||||
});
|
||||
@ -463,10 +455,7 @@ export default {
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = '添加设备采集配置';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init()
|
||||
})
|
||||
this.title = '添加设备与实时采集关系表(一对多)';
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
@ -475,12 +464,31 @@ export default {
|
||||
getEquipmentPlcConnect(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = '修改设备采集配置';
|
||||
this.title = '修改设备与实时采集关系表(一对多)';
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs.addOrUpdate.dataFormSubmit()
|
||||
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();
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// 查看报警
|
||||
|
@ -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: 1,
|
||||
collection: undefined,
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
|
@ -1,155 +0,0 @@
|
||||
<!--
|
||||
* @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.plcTableName"
|
||||
:label="plc.name"
|
||||
: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/listAll',
|
||||
url: '/base/equipment-plc/page',
|
||||
}).then(({ code, data }) => {
|
||||
this.plcList = data;
|
||||
this.plcList = data.list;
|
||||
});
|
||||
}
|
||||
for (const section of this.sections) {
|
||||
|
@ -1,65 +0,0 @@
|
||||
<!--
|
||||
* @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>
|
@ -1,251 +0,0 @@
|
||||
<!--
|
||||
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>
|
@ -1,572 +0,0 @@
|
||||
<!--
|
||||
* @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>
|
@ -1,172 +0,0 @@
|
||||
<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>
|
@ -1,539 +0,0 @@
|
||||
/* 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;
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
@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
@ -1,44 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
<?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>
|
Before Width: | Height: | Size: 4.8 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,500 +0,0 @@
|
||||
<!--
|
||||
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>
|
@ -1,312 +0,0 @@
|
||||
<!--
|
||||
* @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,11 +50,6 @@
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="getList" />
|
||||
|
||||
<add-content
|
||||
v-if="addContent"
|
||||
ref="addContent"
|
||||
@refreshDataList="addContent = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -62,41 +57,19 @@
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import addRecord from './addRecord.vue';
|
||||
import AddContent from './addContent.vue';
|
||||
import { exportCheckOrderExcel, deleteEqCheckLog } from '@/api/equipment/base/inspection/record'
|
||||
import { exportCheckLogExcel, 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 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>
|
||||
);
|
||||
},
|
||||
};
|
||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
|
||||
export default {
|
||||
name: 'EquipmentInspectionRecord',
|
||||
components: { addRecord, AddContent },
|
||||
name: 'EquipmentRepair',
|
||||
components: { addRecord },
|
||||
mixins: [basicPageMixin],
|
||||
data() {
|
||||
return {
|
||||
addOrUpdateVisible: false,
|
||||
addContent: false,
|
||||
searchBarKeys: ['name', 'actualCheckTime'],
|
||||
searchBarKeys: ['equipmentId', 'actualTime'],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('equipment:check-record:detail')
|
||||
? {
|
||||
@ -104,57 +77,48 @@ 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: '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: 'configName', label: '配置名称' },
|
||||
{ prop: 'equipmentName', 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: 'input',
|
||||
label: '巡检单名称',
|
||||
placeholder: '请输入巡检单',
|
||||
param: 'name'
|
||||
type: 'select',
|
||||
label: '设备',
|
||||
placeholder: '请选择设备',
|
||||
param: 'equipmentId',
|
||||
filterable: true
|
||||
},
|
||||
// 开始结束时间
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '巡检时间',
|
||||
dateType: 'datetimerange', // datetimerange
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
label: '时间段',
|
||||
dateType: 'daterange', // datetimerange
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始日期',
|
||||
endPlaceholder: '结束日期',
|
||||
defaultTime: ['00:00:00', '23:59:59'],
|
||||
param: 'actualCheckTime',
|
||||
param: 'actualTime',
|
||||
// width: 350,
|
||||
},
|
||||
{
|
||||
@ -174,16 +138,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: [
|
||||
[
|
||||
@ -252,54 +216,37 @@ export default {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
special: false,
|
||||
name: null,
|
||||
actualCheckTime: null,
|
||||
status: 2
|
||||
maintenanceStatus: null,
|
||||
createTime: null,
|
||||
equipmentId: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
basePath: '/base/equipment-check-order',
|
||||
basePath: '/base/equipment-check-log',
|
||||
mode: null,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
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.initSearchBar();
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
handleEmitFun({action, value}) {
|
||||
switch (action) {
|
||||
// 查看详情
|
||||
case '巡检内容':
|
||||
this.addContent = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addContent.init(value.id, true);
|
||||
});
|
||||
break;
|
||||
}
|
||||
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,
|
||||
}))
|
||||
);
|
||||
});
|
||||
},
|
||||
// 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;
|
||||
@ -416,14 +363,10 @@ export default {
|
||||
.catch(() => {});
|
||||
},
|
||||
handleDetail({ id }) {
|
||||
this.addContent = true;
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addContent.init(id, true);
|
||||
this.$refs.addOrUpdate.init(id, true);
|
||||
});
|
||||
// this.addOrUpdateVisible = true
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.addOrUpdate.init(id, true);
|
||||
// });
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
@ -435,7 +378,7 @@ export default {
|
||||
.confirm('是否确认导出所有设备巡检记录?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportCheckOrderExcel(params);
|
||||
return exportCheckLogExcel(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '设备巡检记录.xls');
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-02-26 08:40:22
|
||||
* @LastEditTime: 2023-12-01 11:02:43
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -13,25 +13,34 @@
|
||||
class="drawer"
|
||||
size="50%">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
<!-- {{ isdetail ? '详情' : '添加巡检' }} -->
|
||||
{{ '添加内容' }}
|
||||
{{ isdetail ? '详情' : '添加巡检' }}
|
||||
</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">{{ parseTime(dataForm.planCheckTime) }}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="100px"
|
||||
label-position="top">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设备名称" prop="equipmentName">
|
||||
<el-input v-model="dataForm.equipmentName" disabled clearable placeholder="请输入设备名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设备编码" prop="equipmentCode">
|
||||
<el-input
|
||||
v-model="dataForm.equipmentCode"
|
||||
clearable
|
||||
disabled
|
||||
placeholder="请输入设备编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<el-divider />
|
||||
@ -40,7 +49,7 @@
|
||||
<small-title
|
||||
style="margin: 16px 0; padding-left: 8px"
|
||||
:no-padding="true">
|
||||
巡检内容
|
||||
巡检项目
|
||||
</small-title>
|
||||
|
||||
<div v-if="!isdetail" class="action_btn">
|
||||
@ -81,18 +90,16 @@
|
||||
<attr-add
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
:order-id="dataForm.id"
|
||||
:config-id="dataForm.id"
|
||||
@refreshDataList="getList" />
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getCheckOrder } from "@/api/equipment/base/inspection/settings";
|
||||
import { deleteCheckOrderDet, getCheckOrderDetPage } from '@/api/equipment/base/inspection/record';
|
||||
import { getEqCheck, getCheckDetPage, deleteCheckDet } from "@/api/equipment/base/inspection/settings";
|
||||
import SmallTitle from './SmallTitle';
|
||||
import attrAdd from './attr-add';
|
||||
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
|
||||
import { parseTime } from '../../../../core/mixins/code-filter';
|
||||
|
||||
const tableBtn = [
|
||||
{
|
||||
@ -106,13 +113,21 @@ const tableBtn = [
|
||||
];
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'equipmentName',
|
||||
label: '设备名称',
|
||||
prop: 'program',
|
||||
label: '巡检项目',
|
||||
},
|
||||
{
|
||||
prop: 'program',
|
||||
label: '检查项目',
|
||||
}
|
||||
prop: 'content',
|
||||
label: '巡检内容',
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '巡检内容编码',
|
||||
},
|
||||
{
|
||||
prop: 'description',
|
||||
label: '备注',
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
@ -123,7 +138,7 @@ export default {
|
||||
tableProps,
|
||||
addOrUpdateVisible: false,
|
||||
urlOptions: {
|
||||
infoURL: getCheckOrder,
|
||||
infoURL: getEqCheck,
|
||||
},
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
@ -132,13 +147,26 @@ export default {
|
||||
},
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
department: undefined,
|
||||
planCheckTime: undefined
|
||||
code: undefined,
|
||||
name: '',
|
||||
materialType: undefined,
|
||||
productType: undefined,
|
||||
area: undefined,
|
||||
specifications: undefined,
|
||||
processTime: 0,
|
||||
remark: undefined,
|
||||
unit: undefined
|
||||
},
|
||||
checkDetList: [],
|
||||
visible: false,
|
||||
isdetail: false
|
||||
isdetail: false,
|
||||
dataRule: {
|
||||
code: [{ required: true, message: "物料编码不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "物料名称不能为空", trigger: "blur" }],
|
||||
materialType: [{ required: true, message: "物料类型不能为空", trigger: "change" }],
|
||||
productType: [{ required: true, message: "产品类型不能为空", trigger: "change" }],
|
||||
processTime: [{ required: true, message: "产线生产单位用时不能为空", trigger: "blur" }]
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
@ -159,7 +187,7 @@ export default {
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
deleteCheckOrderDet(raw.data.id).then(({ data }) => {
|
||||
deleteCheckDet(raw.data.id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
@ -177,9 +205,9 @@ export default {
|
||||
},
|
||||
getList() {
|
||||
// 获取巡检项目分页
|
||||
getCheckOrderDetPage({
|
||||
getCheckDetPage({
|
||||
...this.listQuery,
|
||||
orderId: this.dataForm.id,
|
||||
configId: this.dataForm.id,
|
||||
}).then((response) => {
|
||||
this.checkDetList = response.data.list;
|
||||
this.listQuery.total = response.data.total;
|
||||
@ -192,7 +220,7 @@ export default {
|
||||
this.visible = true;
|
||||
|
||||
this.$nextTick(() => {
|
||||
// this.$refs['dataForm'].resetFields();
|
||||
this.$refs['dataForm'].resetFields();
|
||||
|
||||
if (this.dataForm.id) {
|
||||
// 获取设备巡检详情
|
||||
@ -259,7 +287,7 @@ export default {
|
||||
|
||||
.drawer >>> .visual-part {
|
||||
flex: 1 auto;
|
||||
max-height: 10vh;
|
||||
max-height: 16vh;
|
||||
overflow: hidden;
|
||||
overflow-y: scroll;
|
||||
padding-right: 10px; /* 调整滚动条样式 */
|
||||
@ -283,18 +311,4 @@ 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: 2024-03-15 18:38:52
|
||||
* @LastEditTime: 2023-11-25 16:23:13
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -11,81 +11,44 @@
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="150px">
|
||||
label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<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>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="部门"
|
||||
prop="departmentId"
|
||||
:rules="[{ required: false, message: '请选择部门', trigger: 'blur' }]">
|
||||
<el-select
|
||||
v-model="dataForm.departmentId"
|
||||
:placeholder="`请选择部门`"
|
||||
style="width: 100%">
|
||||
<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="12">
|
||||
<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-form-item label="配置名称" prop="name">
|
||||
<el-input
|
||||
v-model="dataForm.checkPeriod"
|
||||
placeholder="请输入巡检频率(天/次)" />
|
||||
v-model="dataForm.name"
|
||||
placeholder="请输入配置名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="确认时限 (时)" prop="confirmTimeLimit">
|
||||
<el-form-item label="配置编码" prop="code">
|
||||
<el-input
|
||||
v-model="dataForm.confirmTimeLimit"
|
||||
:placeholder="`请输入确认时限`" />
|
||||
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="groupClass">
|
||||
<el-form-item label="设备名称" prop="equipmentId">
|
||||
<el-select
|
||||
v-model="dataForm.groupClass"
|
||||
v-model="dataForm.equipmentId"
|
||||
filterable
|
||||
clearable
|
||||
multiple
|
||||
style="width: 100%"
|
||||
placeholder="请选择班次">
|
||||
placeholder="请选择设备名称"
|
||||
@change="setCode">
|
||||
<el-option
|
||||
v-for="d in groupOptions"
|
||||
:key="d.id"
|
||||
:label="d.label"
|
||||
:value="d.label" />
|
||||
v-for="dict in eqList"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备编码" prop="equipmentCode">
|
||||
<el-input v-model="dataForm.equipmentCode" disabled placeholder="请输入设备编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
@ -93,157 +56,50 @@
|
||||
|
||||
<script>
|
||||
import basicAdd from '../../../../core/mixins/basic-add';
|
||||
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'
|
||||
import { getEqCheck, getCode, createCheckConfig, updateCheckConfig } from "@/api/equipment/base/inspection/settings";
|
||||
import { getEquipmentAll } from '@/api/base/equipment'
|
||||
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
isGetCode: true,
|
||||
codeURL: getOrderCode,
|
||||
createURL: createCheckOrder,
|
||||
updateURL: updateCheckOrder,
|
||||
infoURL: getCheckOrder,
|
||||
isGetCode: true,
|
||||
codeURL: getCode,
|
||||
createURL: createCheckConfig,
|
||||
updateURL: updateCheckConfig,
|
||||
infoURL: getEqCheck,
|
||||
},
|
||||
dataForm: {
|
||||
id: null,
|
||||
code: null,
|
||||
name: null,
|
||||
departmentId: null,
|
||||
planCheckTime: null,
|
||||
confirmTimeLimit: null,
|
||||
groupClass: null,
|
||||
remark: null,
|
||||
checkPeriod: null
|
||||
id: undefined,
|
||||
code: undefined,
|
||||
name: undefined,
|
||||
equipmentId: undefined,
|
||||
equipmentCode: undefined
|
||||
},
|
||||
groupOptions: [],
|
||||
departmentOptions: [],
|
||||
eqList: [],
|
||||
dataRule: {
|
||||
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),
|
||||
}
|
||||
]
|
||||
equipmentId: [{ required: true, message: "设备不能为空", trigger: "blur" }],
|
||||
code: [{ required: true, message: "配置编码不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "配置名称不能为空", trigger: "blur" }],
|
||||
}
|
||||
};
|
||||
},
|
||||
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: {
|
||||
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');
|
||||
});
|
||||
});
|
||||
// 设备列表
|
||||
const res = await getEquipmentAll()
|
||||
this.eqList = res.data
|
||||
},
|
||||
setCode() {
|
||||
const chooseM = this.eqList.filter(item => {
|
||||
return item.id === this.dataForm.equipmentId
|
||||
})
|
||||
this.dataForm.equipmentCode = chooseM[0].code
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -17,32 +17,18 @@
|
||||
ref="dataForm"
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
label-width="90px"
|
||||
label-width="60px"
|
||||
@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 equipmentOptions"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
<el-form-item label="巡检" prop="checkId">
|
||||
<el-select v-model="dataForm.checkId" filterable placeholder="请选择巡检" style="width: 100%">
|
||||
<el-option v-for="dict in checkList" :key="dict.id" :label="dict.content"
|
||||
:value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="巡检项目" prop="program">
|
||||
<el-form-item label="备注" prop="description">
|
||||
<el-input
|
||||
v-model="dataForm.program"
|
||||
placeholder="请输入巡检项目"
|
||||
clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="巡检结果" prop="checkResult">
|
||||
<el-input
|
||||
v-model="dataForm.checkResult"
|
||||
placeholder="请输入巡检结果"
|
||||
v-model="dataForm.description"
|
||||
placeholder="请输入备注"
|
||||
clearable />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -55,12 +41,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getCheckOrderDet, createCheckOrderDet, updateCheckOrderDet } from "@/api/equipment/base/inspection/settings";
|
||||
import { getEquipmentPage } from '@/api/base/equipment'
|
||||
import { getCheckDet, createCheckDet, updateCheckDet, getcheckList } from "@/api/equipment/base/inspection/settings";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
orderId: {
|
||||
configId: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
@ -69,22 +54,14 @@ export default {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: null,
|
||||
equipmentId: null,
|
||||
program: null,
|
||||
checkResult: null
|
||||
id: undefined,
|
||||
checkId: undefined,
|
||||
configId: undefined,
|
||||
description: ''
|
||||
},
|
||||
equipmentOptions: [],
|
||||
checkList: [],
|
||||
dataRule: {
|
||||
equipmentId: [
|
||||
{ required: true, message: '设备不能为空', trigger: 'blur' }
|
||||
],
|
||||
program: [
|
||||
{ required: true, message: '巡检项目不能为空', trigger: 'blur' }
|
||||
],
|
||||
checkResult: [
|
||||
{ required: true, message: '巡检结果不能为空', trigger: 'blur' }
|
||||
]
|
||||
checkId: [{ required: true, message: '巡检不能为空', trigger: 'blur' }],
|
||||
},
|
||||
};
|
||||
},
|
||||
@ -93,12 +70,8 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async getDict() {
|
||||
const res = await getEquipmentPage({
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
special: false
|
||||
})
|
||||
this.equipmentOptions = res.data.list
|
||||
const res = await getcheckList()
|
||||
this.checkList = res.data
|
||||
},
|
||||
init(id) {
|
||||
this.dataForm.id = id || '';
|
||||
@ -106,7 +79,7 @@ export default {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
getCheckOrderDet(this.dataForm.id).then((res) => {
|
||||
getCheckDet(this.dataForm.id).then((res) => {
|
||||
// const { name, value } = res.data;
|
||||
// this.dataForm.name = name;
|
||||
// this.dataForm.value = value;
|
||||
@ -121,9 +94,9 @@ export default {
|
||||
if (valid) {
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
updateCheckOrderDet({
|
||||
updateCheckDet({
|
||||
...this.dataForm,
|
||||
orderId: this.orderId
|
||||
configId: this.configId
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.visible = false;
|
||||
@ -132,9 +105,9 @@ export default {
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createCheckOrderDet({
|
||||
createCheckDet({
|
||||
...this.dataForm,
|
||||
orderId: this.orderId,
|
||||
configId: this.configId,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.visible = false;
|
||||
|
@ -17,7 +17,7 @@
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:width="120"
|
||||
:width="180"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
@ -37,7 +37,9 @@
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="handleConfirm">
|
||||
<add ref="add" @refreshDataList="successSubmit" />
|
||||
<add
|
||||
ref="add"
|
||||
@refreshDataList="successSubmit" />
|
||||
</base-dialog>
|
||||
<!-- 添加巡检,查看详情 -->
|
||||
<addOrUpdata
|
||||
@ -50,9 +52,7 @@
|
||||
<script>
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import addOrUpdata from './add-or-updata.vue';
|
||||
import add from './add.vue';
|
||||
import { parseTime } from '../../../../core/mixins/code-filter';
|
||||
import { groupClassesListAll } from '@/api/monitoring/teamProduction';
|
||||
import add from './add.vue'
|
||||
// import { publicFormatter } from '@/utils/dict';
|
||||
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
|
||||
@ -70,84 +70,52 @@ 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: '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: '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: 'responsible', label: '负责人' },
|
||||
{ prop: 'remark', label: '备注' }, // TODO: 操作 选项,四个,群里询问
|
||||
{ prop: 'checkNumber', 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: '查询',
|
||||
@ -206,11 +174,7 @@ export default {
|
||||
clearable: true,
|
||||
},
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '设备名称不能为空',
|
||||
trigger: 'change',
|
||||
},
|
||||
{ required: true, message: '设备名称不能为空', trigger: 'change' },
|
||||
],
|
||||
},
|
||||
{
|
||||
@ -228,29 +192,25 @@ export default {
|
||||
pageSize: 10,
|
||||
equipmentId: null,
|
||||
name: null,
|
||||
special: false,
|
||||
status: 0,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
basePath: '/base/equipment-check-order',
|
||||
basePath: '/base/equipment-check-config',
|
||||
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(
|
||||
@ -263,11 +223,6 @@ export default {
|
||||
);
|
||||
});
|
||||
},
|
||||
getGroup() {
|
||||
groupClassesListAll().then((res) => {
|
||||
this.groupList = res.data || [];
|
||||
});
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
@ -280,9 +235,9 @@ export default {
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.$refs.add.formClear();
|
||||
this.$refs.add.formClear()
|
||||
this.open = false;
|
||||
this.title = '';
|
||||
this.title = ''
|
||||
// this.reset();
|
||||
},
|
||||
/** 表单重置 */
|
||||
|
@ -1,444 +0,0 @@
|
||||
<!--
|
||||
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>
|
@ -1,368 +0,0 @@
|
||||
<!--
|
||||
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>
|
@ -1,758 +0,0 @@
|
||||
<!--
|
||||
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>
|
@ -1,307 +0,0 @@
|
||||
<!--
|
||||
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>
|
@ -1,838 +0,0 @@
|
||||
<!--
|
||||
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>
|
@ -1,539 +0,0 @@
|
||||
/* 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