Compare commits

..

60 Commits

Author SHA1 Message Date
‘937886381’
45e1fe4b47 Merge branch 'projects/mes-test' into projects/mes-zhp 2025-03-17 14:19:01 +08:00
‘937886381’
e823dee9ff 修改 2025-03-17 14:18:07 +08:00
932d35c14c Merge pull request 'projects/mes-zjl' (#425) from projects/mes-zjl into projects/mes-test
Reviewed-on: #425
2025-03-17 10:36:14 +08:00
ceeb853783 去除限制3档计价 2025-03-17 10:35:48 +08:00
6ed21030f5 Merge branch 'projects/mes-test' into projects/mes-zjl 2025-03-17 10:25:56 +08:00
73feff0d8b 修改 2025-03-17 10:22:59 +08:00
d49a698136 Merge pull request '自测bug' (#421) from projects/mes-zjl into projects/mes-test
Reviewed-on: #421
2025-02-18 08:50:15 +08:00
6e774dfc5d 自测bug 2025-02-18 08:44:43 +08:00
3eeded056f Merge pull request '修改' (#420) from projects/mes-zjl into projects/mes-test
Reviewed-on: #420
2025-01-24 14:29:38 +08:00
881eace12f 修改 2025-01-24 14:28:28 +08:00
dad3b2da95 Merge pull request 'projects/mes-zjl' (#419) from projects/mes-zjl into projects/mes-test
Reviewed-on: #419
2025-01-10 13:59:08 +08:00
f5cfc5d2bb Merge branch 'projects/mes-test' into projects/mes-zjl 2025-01-10 13:53:55 +08:00
235b0a6512 修改部分bug 2025-01-10 13:52:13 +08:00
13bf1e0fd0 Merge pull request 'projects/mes-zhp' (#418) from projects/mes-zhp into projects/mes-test
Reviewed-on: #418
2025-01-08 16:21:21 +08:00
‘937886381’
97acb4faac Merge branch 'projects/mes-test' into projects/mes-zhp 2025-01-08 16:11:12 +08:00
‘937886381’
04a5359eda 修改 2025-01-08 16:10:46 +08:00
7ae7dfad95 Merge pull request '部分bug' (#417) from projects/mes-zjl into projects/mes-test
Reviewed-on: #417
2025-01-08 15:48:58 +08:00
e202ac542e 部分bug 2025-01-08 15:47:22 +08:00
eb8736178a Merge pull request 'projects/mes-zjl' (#416) from projects/mes-zjl into projects/mes-test
Reviewed-on: #416
2025-01-07 14:28:21 +08:00
580a66549c 系统管理bug 2025-01-07 14:27:13 +08:00
30c45e6f74 修改系统bug 2025-01-06 10:44:23 +08:00
e9c2917c77 Merge pull request '排班bug' (#415) from projects/mes-zjl into projects/mes-test
Reviewed-on: #415
2025-01-03 14:39:30 +08:00
0a9bd0c6de Merge branch 'projects/mes-test' into projects/mes-zjl 2025-01-03 14:39:08 +08:00
84dbd8d5b2 排班bug 2025-01-03 14:37:54 +08:00
‘937886381’
00f54f3de6 Merge branch 'projects/mes-test' into projects/mes-zhp 2025-01-03 09:56:35 +08:00
‘937886381’
f26d7abc64 修改 2025-01-03 09:55:08 +08:00
028c14a174 Merge pull request 'projects/mes-zjl' (#414) from projects/mes-zjl into projects/mes-test
Reviewed-on: #414
2025-01-03 09:06:01 +08:00
b14abd39b6 Merge branch 'projects/mes-test' into projects/mes-zjl 2025-01-03 09:05:22 +08:00
dfc8110410 排班bug 2025-01-03 09:04:21 +08:00
baede9ef34 Merge pull request '更新bug' (#412) from projects/mes-zwq into projects/mes-test
Reviewed-on: #412
2024-12-27 15:39:23 +08:00
zwq
2c44906bd6 更新bug 2024-12-27 15:38:14 +08:00
466c822b0f Merge pull request '生产管理bug修改' (#411) from projects/mes-zjl into projects/mes-test
Reviewed-on: #411
2024-12-27 15:05:29 +08:00
031e3098b7 生产管理bug修改 2024-12-27 15:00:43 +08:00
d14dae86fc Merge pull request '工单' (#408) from projects/mes-zjl into projects/mes-test
Reviewed-on: #408
2024-11-21 15:55:47 +08:00
492b591fa9 工单 2024-11-21 15:55:02 +08:00
fc20e275f7 Merge pull request '跟新bug' (#407) from projects/mes-zwq into projects/mes-test
Reviewed-on: #407
2024-11-20 13:48:28 +08:00
zwq
10fd959c9d 跟新bug 2024-11-20 13:47:55 +08:00
342e83ab41 Merge pull request '更新bug' (#406) from projects/mes-zwq into projects/mes-test
Reviewed-on: #406
2024-11-18 10:45:22 +08:00
zwq
df530abb90 更新bug 2024-11-18 10:44:51 +08:00
8f1e5212e3 Merge pull request 'projects/mes-zhp' (#405) from projects/mes-zhp into projects/mes-test
Reviewed-on: #405
2024-11-14 13:43:43 +08:00
‘937886381’
5dd299e549 Merge branch 'projects/mes-test' into projects/mes-zhp 2024-11-14 13:43:00 +08:00
‘937886381’
511a00d0a3 修改 2024-11-14 13:42:29 +08:00
d5b71c4d7d Merge pull request '修改bug' (#404) from projects/mes-zhp into projects/mes-test
Reviewed-on: #404
2024-11-14 08:50:39 +08:00
‘937886381’
43d0a2668d 修改bug 2024-11-14 08:45:45 +08:00
a492fe4c87 Merge pull request '更新' (#403) from projects/mes-zwq into projects/mes-test
Reviewed-on: #403
2024-11-13 14:47:51 +08:00
zwq
319e0ac90d 更新 2024-11-13 14:47:19 +08:00
e11c71edf1 Merge pull request '更新bug' (#402) from projects/mes-zwq into projects/mes-test
Reviewed-on: #402
2024-11-06 08:53:57 +08:00
zwq
4bf610eeb1 更新bug 2024-11-06 08:53:24 +08:00
8e0ac6f962 Merge pull request '更新' (#401) from projects/mes-zwq into projects/mes-test
Reviewed-on: #401
2024-10-17 09:28:51 +08:00
zwq
d41ae3bc76 更新 2024-10-17 09:27:52 +08:00
f4eaddf6ae Merge pull request '更新' (#400) from projects/mes-zwq into projects/mes-test
Reviewed-on: #400
2024-10-16 09:58:03 +08:00
zwq
9699e90ab3 更新 2024-10-16 09:55:22 +08:00
9fc6f013cc Merge pull request 'projects/mes-zwq' (#398) from projects/mes-zwq into projects/mes-test
Reviewed-on: #398
2024-09-26 14:07:58 +08:00
916f99a852 Merge pull request 'projects/mes-zhp' (#395) from projects/mes-zhp into projects/mes-test
Reviewed-on: #395
2024-09-11 14:28:11 +08:00
‘937886381’
9581d91c52 生产 2024-09-11 14:26:39 +08:00
‘937886381’
c847ba1595 生产管理 2024-09-11 10:36:47 +08:00
‘937886381’
2ab8a99ff5 Merge branch 'projects/mes-test' into projects/mes-zhp 2024-09-05 11:18:44 +08:00
‘937886381’
d65dcb8712 修改 2024-09-05 11:18:03 +08:00
‘937886381’
2213b93f0a Merge branch 'projects/mes-test' into projects/mes-zhp 2024-08-13 08:36:54 +08:00
‘937886381’
d6acfa4fd7 新增 2024-08-13 08:36:23 +08:00
174 changed files with 11036 additions and 9295 deletions

View File

@@ -1,8 +1,8 @@
### ###
# @Author: Do not edit # @Author: Do not edit
# @Date: 2023-08-29 09:40:39 # @Date: 2023-08-29 09:40:39
# @LastEditTime: 2024-07-31 14:57:31 # @LastEditTime: 2024-11-07 09:29:23
# @LastEditors: zhp # @LastEditors: zwq
# @Description: # @Description:
### ###
# 开发环境配置 # 开发环境配置
@@ -12,22 +12,13 @@ ENV = 'development'
VUE_APP_TITLE = MES系统 VUE_APP_TITLE = MES系统
# 芋道管理系统/开发环境 # 芋道管理系统/开发环境
# VUE_APP_BASE_API = 'http://100.64.0.26:48082' # VUE_APP_BASE_API = 'http://172.16.21.222:48082'
# VUE_APP_BASE_API = 'http://192.168.0.33:48082' VUE_APP_BASE_API = 'http://mes2.kszny.picaiba.com'
# 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.81: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.56:48082'
# VUE_APP_BASE_API = 'http://192.168.4.159:48080'
# VUE_APP_BASE_API = 'http://192.168.1.64:48082'
VUE_APP_BASE_API = 'http://192.168.1.99:48082'
# 积木报表指向地址 # 积木报表指向地址
VUE_APP_JIMU_API = 'http://192.168.0.33:48082' VUE_APP_JIMU_API = 'http://mes2.kszny.picaiba.com'
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@@ -1,8 +1,8 @@
### ###
# @Author: zhp # @Author: zhp
# @Date: 2023-11-07 19:11:40 # @Date: 2023-11-07 19:11:40
# @LastEditTime: 2023-11-16 16:40:59 # @LastEditTime: 2024-10-17 09:09:05
# @LastEditors: zhp # @LastEditors: zwq
# @Description: # @Description:
### ###
# 生产环境配置 # 生产环境配置
@@ -12,15 +12,18 @@ ENV = 'production'
VUE_APP_TITLE = MES系统 VUE_APP_TITLE = MES系统
# 芋道管理系统/生产环境 # 芋道管理系统/生产环境
VUE_APP_BASE_API = '/prod-api' # VUE_APP_BASE_API = '/prod-api'
VUE_APP_BASE_API = ''
# 积木报表指向地址 # 积木报表指向地址
VUE_APP_JIMU_API = 'http://192.168.0.33:48082' # VUE_APP_JIMU_API = 'http://192.168.0.33:48082'
VUE_APP_JIMU_API = ''
# 根据服务器或域名修改 # 根据服务器或域名修改
# PUBLIC_PATH = 'http://my-pi.com:8888/yudao-admin/' # PUBLIC_PATH = 'http://my-pi.com:8888/yudao-admin/'
PUBLIC_PATH = 'http://192.168.0.33:8889/' # PUBLIC_PATH = 'http://192.168.0.33:8889/'
PUBLIC_PATH = ''
# 二级部署路径 # 二级部署路径
VUE_APP_APP_NAME ='yudao-admin' VUE_APP_APP_NAME ='yudao-admin'

View File

@@ -6,7 +6,7 @@
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"local": "vue-cli-service serve --mode local", "local": "vue-cli-service serve --mode local",
"dev": "vue-cli-service serve --mode dev", "dev": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --mode dev",
"front": "vue-cli-service serve --mode front", "front": "vue-cli-service serve --mode front",
"build:prod": "vue-cli-service build --mode prod", "build:prod": "vue-cli-service build --mode prod",
"build:stage": "vue-cli-service build --mode stage", "build:stage": "vue-cli-service build --mode stage",

View File

@@ -1,3 +1,10 @@
/*
* @Author: zwq
* @Date: 2024-06-28 17:03:29
* @LastEditors: zwq
* @LastEditTime: 2024-09-27 09:24:09
* @Description:
*/
import request from '@/utils/request' import request from '@/utils/request'
// 获取走势分析数据 // 获取走势分析数据
@@ -17,6 +24,15 @@ export function exportTrend(data) {
responseType: 'blob' responseType: 'blob'
}) })
} }
// 导出对比分析数据
export function exportCompare(data) {
return request({
url: '/analysis/energy-analysis/exportCompare',
method: 'post',
data: data,
responseType: 'blob'
})
}
// 获取对比分析数据 // 获取对比分析数据
export function getCompare(data) { export function getCompare(data) {
return request({ return request({
@@ -35,6 +51,24 @@ export function getYoy(data) {
}) })
} }
// 导出同比分析数据
export function exportYoy(data) {
return request({
url: '/analysis/energy-analysis/exportYoy',
method: 'post',
data: data,
responseType: 'blob'
})
}
// 导出环比分析数据
export function exportChain(data) {
return request({
url: '/analysis/energy-analysis/exportChain',
method: 'post',
data: data,
responseType: 'blob'
})
}
// 获取环比分析数据(1:月,2:周,3:日) // 获取环比分析数据(1:月,2:周,3:日)
export function getQoq(data) { export function getQoq(data) {
return request({ return request({

View File

@@ -3,7 +3,7 @@
* @Date: 2023-10-21 11:50:46 * @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-10-30 14:37:28 * @LastEditTime: 2023-10-30 14:37:28
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
*/ */
import request from '@/utils/request' import request from '@/utils/request'
@@ -65,4 +65,11 @@ export function getCoreDepartmentList(query) {
method: 'get', method: 'get',
params: query params: query
}) })
} }
export function getDepartmentList(query) {
return request({
url: '/system/dept/list',
method: 'get',
params: query
})
}

View File

@@ -1,9 +1,9 @@
/* /*
* @Author: Do not edit * @Author: Do not edit
* @Date: 2023-10-21 11:50:46 * @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-11-15 17:19:19 * @LastEditTime: 2024-12-27 15:20:14
* @LastEditors: DY * @LastEditors: zwq
* @Description: * @Description:
*/ */
import request from '@/utils/request' import request from '@/utils/request'
@@ -16,6 +16,14 @@ export function createCoreWO(data) {
}) })
} }
// 获取工艺模式工单预计消耗物料
export function getMaterialCostWorkOrder(data) {
return request({
url: '/extend/process-retrospect/getMaterialCostWorkOrder',
method: 'post',
data: data
})
}
// 更新工单 // 更新工单
export function updateCoreWO(data) { export function updateCoreWO(data) {
return request({ return request({
@@ -153,3 +161,20 @@ export function createConCoreWOr(data) {
data: data data: data
}) })
} }
// 更新分配产量
export function updateBatch(data) {
return request({
url: '/base/core-order-con-work-order/updateBatch',
method: 'put',
data: data
})
}
// 更新订单表与工单关联表 多对多
export function updateConCoreWOr(data) {
return request({
url: '/base/core-order-con-work-order/update',
method: 'put',
data: data
})
}

View File

@@ -8,7 +8,13 @@ export function createGroupRule(data) {
data: data data: data
}) })
} }
// 作废排班规则
export function disableGroupRule(id) {
return request({
url: '/base/group-scheduling-rule/disable?id=' + id,
method: 'post',
})
}
// 更新排班规则基础信息 // 更新排班规则基础信息
export function updateGroupRule(data) { export function updateGroupRule(data) {
return request({ return request({

View File

@@ -50,6 +50,22 @@ export function getOrderById(query) {
params: query params: query
}) })
} }
// 订单进度-获取普通模式订单剩余数量
export function getOrderRemainNum(id) {
return request({
url: '/base/order/getOrderRemainNum?id=' + id,
method: 'get'
})
}
// 订单进度-获取工艺模式订单预计消耗物料(计算后)
export function getMaterialCostOrder(data) {
return request({
url: '/extend/process-retrospect/getMaterialCostOrder',
method: 'post',
data: data
})
}
// 获得工艺流程列表 // 获得工艺流程列表
export function getProcessFlowList() { export function getProcessFlowList() {
@@ -59,6 +75,16 @@ export function getProcessFlowList() {
}) })
} }
// 获得工艺流程列表
export function getProcessFlowPage(query) {
return request({
url: '/extend/process-flow/page',
method: 'get',
params: query
})
}
// 创建订单 // 创建订单
export function orderCreate(data) { export function orderCreate(data) {
return request({ return request({
@@ -165,3 +191,34 @@ export function orderVoid(data) {
data data
}) })
} }
export function orderSplit(data) {
return request({
url: '/base/order/split',
method: 'post',
data
})
}
export function getDetailTree(data) {
return request({
url: 'base/order/getDetailTree',
method: 'get',
params: data
})
}
export function getDetailTreeInfo(query) {
return request({
url: 'base/order/getDetailTreeInfoByIdNew',
method: 'get',
params: query
})
}
export function orderStop(data) {
return request({
url: 'base/order/stop',
method: 'post',
params: data
})
}

View File

@@ -1,8 +1,16 @@
import request from '@/utils/request' import request from '@/utils/request'
// 获得产品列表 // 获得物料列表(包括产品)
export function getProductAll() { export function getProductAll() {
return request({ return request({
url: '/base/core-product-material/listAll', url: '/base/core-product-material/listAll',
method: 'get' method: 'get'
}) })
} }
// 获得产品列表
export function getProductList() {
return request({
url: '/base/core-product-material/listAllProduct',
method: 'get'
})
}

View File

@@ -5,13 +5,6 @@
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
*/ */
/*
* @Author: zhp
* @Date: 2024-07-12 15:31:41
* @LastEditTime: 2024-07-22 09:33:20
* @LastEditors: zhp
* @Description:
*/
import request from '@/utils/request' import request from '@/utils/request'
@@ -26,7 +19,7 @@ export function getItemPageData(data) {
return request({ return request({
url: '/base/equipment-check-program/page', url: '/base/equipment-check-program/page',
method: 'get', method: 'get',
data params: data
}) })
} }

View File

@@ -23,6 +23,13 @@ export function getItemPageData(data) {
}) })
} }
export function getByEquId(id) {
return request({
url: '/base/equipment-maintain-program/getByEquId?id=' + id,
method: 'get',
})
}
export function getItemData(id) { export function getItemData(id) {
return request({ return request({
url: 'base/equipment-maintain-program/get?id=' + id, url: 'base/equipment-maintain-program/get?id=' + id,

View File

@@ -3,7 +3,7 @@
* @Date: 2023-11-08 15:56:52 * @Date: 2023-11-08 15:56:52
* @LastEditTime: 2024-02-26 17:02:53 * @LastEditTime: 2024-02-26 17:02:53
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
*/ */
import request from '@/utils/request' import request from '@/utils/request'
@@ -78,3 +78,11 @@ export function deleteLogDet(id) {
method: 'delete' method: 'delete'
}) })
} }
export function getEqMaintainPlanPageData(query) {
return request({
url: '/base/equipment-maintain-log-det/page',
method: 'get',
params: query
})
}

View File

@@ -27,7 +27,7 @@ export function getWorkOrderList(query) {
export function getCoreProduct(id) { export function getCoreProduct(id) {
return request({ return request({
url: '/base/core-product/get?id=' + id, url: '/base/core-product-material/get?id=' + id,
method: 'get' method: 'get'
}) })
} }

View File

@@ -44,11 +44,7 @@ export function updateRole(data) {
} }
// 角色状态修改 // 角色状态修改
export function changeRoleStatus(id, status) { export function changeRoleStatus(data) {
const data = {
id,
status
}
return request({ return request({
url: '/system/role/update-status', url: '/system/role/update-status',
method: 'put', method: 'put',

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="72px" height="72px" viewBox="0 0 40 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>rollback</title>
<defs>
<filter x="-1.1%" y="-5.8%" width="102.1%" height="115.3%" filterUnits="objectBoundingBox" id="filter-1">
<feOffset dx="0" dy="5" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
<feGaussianBlur stdDeviation="6" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0926573427 0" type="matrix" in="shadowBlurOuter1" result="shadowMatrixOuter1"></feColorMatrix>
<feMerge>
<feMergeNode in="shadowMatrixOuter1"></feMergeNode>
<feMergeNode in="SourceGraphic"></feMergeNode>
</feMerge>
</filter>
</defs>
<g id="页面" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="页内多种导航方式" transform="translate(-1914.000000, -745.000000)" fill-rule="nonzero">
<g id="编组-16" filter="url(#filter-1)" transform="translate(94.000000, 641.000000)">
<g id="编组-3备份" transform="translate(1816.000000, 96.000000)">
<g id="rollback" transform="translate(16.000000, 15.000000)">
<rect id="矩形" fill="#000000" opacity="0" x="0" y="0" width="20" height="20"></rect>
<path d="M11.390625,3.78125 L5.71875,3.78125 L5.71875,2.625 C5.71875,2.5203125 5.5984375,2.4625 5.5171875,2.5265625 L3.2984375,4.2765625 C3.234375,4.3265625 3.234375,4.4234375 3.2984375,4.4734375 L5.5171875,6.2234375 C5.5984375,6.2875 5.71875,6.2296875 5.71875,6.125 L5.71875,4.96875 L11.203125,4.96875 C11.7554097,4.96875 12.203125,5.41646525 12.203125,5.96875 L12.203125,11.3125 C12.203125,11.8647847 11.7554097,12.3125 11.203125,12.3125 L2.93775156,12.3125 L2.93775156,12.3125 C2.55569144,12.3125 2.36466138,12.4938859 2.36466138,12.8566576 C2.36466138,13.5 2.93775156,13.5 2.93775156,13.5 C2.93775156,13.5 5.75537604,13.5 11.390625,13.5 C13,13.5 13.390625,12.8986083 13.390625,11.9909216 L13.390625,4.96875 C13.390625,4.06071182 13,3.78125 11.390625,3.78125 Z" id="路径" fill="#0B58FF"></path>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -1,10 +1,3 @@
<!--
filename: index.vue
author: liubin
date: 2024-04-02 09:49:36
description:
-->
<template> <template>
<!-- 按钮切换 --> <!-- 按钮切换 -->
<div v-if="buttonMode" class="button-nav"> <div v-if="buttonMode" class="button-nav">
@@ -12,9 +5,8 @@
v-for="m in menus" v-for="m in menus"
:key="m" :key="m"
@click="currentMenu = m" @click="currentMenu = m"
:data-text="m"
:class="[m === currentMenu ? 'active' : '']" :class="[m === currentMenu ? 'active' : '']"
></button> >{{m}}</button>
</div> </div>
<!-- 标签切换 --> <!-- 标签切换 -->
<div v-else class="custom-tabs" style="height: 100%; width: 100%"> <div v-else class="custom-tabs" style="height: 100%; width: 100%">
@@ -75,33 +67,24 @@ export default {
} }
button { button {
height: 48px;
line-height: 48px;
cursor: pointer; cursor: pointer;
appearance: none; appearance: none;
outline: none; outline: none;
border: none; border: none;
background: #fff; background: #fff;
border-radius: 8px; border-radius: 8px;
padding: 15px; font-size: 16px;
color: #888; font-weight: 500;
color: rgba(22, 22, 22, 0.65);
letter-spacing: 2px; letter-spacing: 2px;
flex: 1; flex: 1;
box-sizing: padding-box; box-sizing: padding-box;
position: relative; position: relative;
&::after {
content: attr(data-text);
position: absolute;
top: 5px;
left: 50%;
font-size: 16px;
font-weight: 500;
transform: translate(-50%);
}
&.active { &.active {
color: #111; color: rgba(22, 22, 22, 1);
//border-bottom: 2px solid #0b58ff; border-bottom: 4px solid #0b58ff;
box-shadow: 0px 2px 1px 1px #0b58ff;
} }
} }
} }

View File

@@ -28,7 +28,7 @@ export default {
// tableBtn: [], // 占位 // tableBtn: [], // 占位
// searchBarFormConfig: [], // 占位 // searchBarFormConfig: [], // 占位
// // 弹窗表单配置 // // 弹窗表单配置
// dialogFormConfig: [], // // dialogFormConfig: [], //
updateUrl: '', updateUrl: '',
addUrl: '', addUrl: '',
pageUrl: '', pageUrl: '',
@@ -109,9 +109,11 @@ export default {
} }
}, },
// 处理搜索栏按钮 // 处理搜索栏按钮
handleSearchBarBtnClick(btn) { handleSearchBarBtnClick(btn) {
console.log(btn);
// const keys = ['name', 'createTime']; // timeVal // 已被 searchBarKeys 替代 // const keys = ['name', 'createTime']; // timeVal // 已被 searchBarKeys 替代
switch (btn.btnName) { switch (btn.btnName) {
case 'search': case 'search':
this.searchBarKeys.forEach((key) => { this.searchBarKeys.forEach((key) => {
if (key == 'timeVal') { if (key == 'timeVal') {

View File

@@ -23,7 +23,7 @@ const permission = {
state.topbarRouters = routes state.topbarRouters = routes
}, },
SET_SIDEBAR_ROUTERS: (state, routes) => { SET_SIDEBAR_ROUTERS: (state, routes) => {
console.log('==SET_SIDEBAR_ROUTERS==:',routes) // console.log('==SET_SIDEBAR_ROUTERS==:',routes)
state.sidebarRouters = routes state.sidebarRouters = routes
}, },
}, },

View File

@@ -89,6 +89,7 @@ export const DICT_TYPE = {
// ============== ENERGY - 能源模块 ============= // ============== ENERGY - 能源模块 =============
ENERGY_UNIT: 'energy_unit', ENERGY_UNIT: 'energy_unit',
ENERGY_TYPE: 'energy_type',
EQU_ALARM_LEVEL: 'equ_alarm_level', EQU_ALARM_LEVEL: 'equ_alarm_level',
MONITOR_INDEX_TYPE: 'monitor_index_type', MONITOR_INDEX_TYPE: 'monitor_index_type',
OBJECT_TYPE: 'object_type', OBJECT_TYPE: 'object_type',

View File

@@ -1,41 +1,23 @@
<!-- <!--
* @Date: 2020-12-14 09:07:03 * @Date: 2020-12-14 09:07:03
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2023-11-14 10:11:09 * @LastEditTime: 2024-09-05 09:50:14
* @FilePath: \mt-bus-fe\src\views\OperationalOverview\components\baseTable.vue * @FilePath: \mt-bus-fe\src\views\OperationalOverview\components\baseTable.vue
* @Description: * @Description:
--> -->
<template> <template>
<div class="visual-base-table-container"> <div class="visual-base-table-container">
<el-table <el-table v-loading="isLoading"
v-loading="isLoading" :header-cell-style="{background:'rgba(4, 74, 132, .19)',color:'#fff'}" :row-style="setRowStyle" :data="renderData"
:header-cell-style="{background:'rgba(4, 74, 132, .19)',color:'#fff'}" border style="width: 100%; background: transparent">
:row-style="setRowStyle" <el-table-column v-if="page && limit && showIndex" prop="_pageIndex" :label="'tableHeader.index' | i18nFilter"
:data="renderData" :width="70" align="center" />
border <el-table-column v-for="item in renderTableHeadList" :key="item.prop" :show-overflow-tooltip="showOverflow"
style="width: 100%; background: transparent" v-bind="item">
>
<el-table-column
v-if="page && limit && showIndex"
prop="_pageIndex"
:label="'tableHeader.index' | i18nFilter"
:width="70"
align="center"
/>
<el-table-column
v-for="item in renderTableHeadList"
:key="item.prop"
:show-overflow-tooltip="showOverflow"
v-bind="item"
>
<template slot-scope="scope"> <template slot-scope="scope">
<component <component :is="item.subcomponent" v-if="item.subcomponent" :inject-data="{...scope.row, ...item}"
:is="item.subcomponent" @emitData="emitData" />
v-if="item.subcomponent"
:inject-data="{...scope.row, ...item}"
@emitData="emitData"
/>
<span v-else>{{ scope.row[item.prop] | commonFilter(item.filter) }}</span> <span v-else>{{ scope.row[item.prop] | commonFilter(item.filter) }}</span>
</template> </template>

View File

@@ -38,15 +38,8 @@
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="发货负责人" prop="deliveryPersonId"> <el-form-item label="发货负责人" prop="deliveryPerson">
<el-select v-model="form.deliveryPersonId" placeholder="请选择" style="width: 100%;" filterable> <el-input v-model="form.deliveryPerson"></el-input>
<el-option
v-for="item in personList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='6'> <el-col :span='6'>
@@ -75,7 +68,6 @@
</el-form> </el-form>
</template> </template>
<script> <script>
import { getWorkerList } from '@/api/base/worker'
import { deliveryLogCreate, deliveryLogUpdate, getDeliveryLog, listOrderList } from '@/api/base/delivery' import { deliveryLogCreate, deliveryLogUpdate, getDeliveryLog, listOrderList } from '@/api/base/delivery'
export default { export default {
name: 'AddOrUpdate', name: 'AddOrUpdate',
@@ -87,7 +79,7 @@ export default {
name: '', name: '',
code: '', code: '',
deliveryTime: null, deliveryTime: null,
deliveryPersonId: '', deliveryPerson: '',
principal: '', principal: '',
principalCall: '', principalCall: '',
principalCost: 0.00, principalCost: 0.00,
@@ -100,7 +92,6 @@ export default {
code: [{ required: true, message: "发货单号不能为空", trigger: "blur" }] code: [{ required: true, message: "发货单号不能为空", trigger: "blur" }]
}, },
orderList: [], orderList: [],
personList: []
} }
}, },
methods: { methods: {
@@ -118,9 +109,6 @@ export default {
listOrderList().then(res => { listOrderList().then(res => {
this.orderList = res.data || [] this.orderList = res.data || []
}) })
getWorkerList().then(res => {
this.personList = res.data || []
})
}, },
submitForm() { submitForm() {
this.$refs['addOrUpdate'].validate((valid) => { this.$refs['addOrUpdate'].validate((valid) => {

View File

@@ -93,6 +93,16 @@ const tableProps = [
label: '装箱规格(片/箱)', label: '装箱规格(片/箱)',
width: 150 width: 150
}, },
{
prop: 'contactPerson',
label: '车辆联系人',
width: 150
},
{
prop: 'contactPersonCall',
label: '联系方式',
width: 150
},
{ {
prop: 'packagingNum', prop: 'packagingNum',
label: '箱数' label: '箱数'
@@ -221,4 +231,4 @@ export default {
padding:32px 32px 30px 30px; padding:32px 32px 30px 30px;
height: calc(100vh - 125px); height: calc(100vh - 125px);
} }
</style> </style>

View File

@@ -8,26 +8,29 @@
</el-col> </el-col>
<el-col :span='12'> <el-col :span='12'>
<el-form-item label="装车时间" prop="loadTime"> <el-form-item label="装车时间" prop="loadTime">
<el-date-picker <el-date-picker v-model="form.loadTime" type="datetime" format='yyyy-MM-dd HH:mm:ss' value-format="timestamp"
v-model="form.loadTime" style="width: 100%;" placeholder="选择日期">
type="datetime"
format='yyyy-MM-dd HH:mm:ss'
value-format="timestamp"
style="width: 100%;"
placeholder="选择日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="24">
<el-col :span='12'>
<el-form-item label="车辆联系人" prop="contactPerson">
<el-input v-model="form.contactPerson"></el-input>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="联系方式" prop="contactPersonCall">
<el-input v-model="form.contactPersonCall"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row> <el-row>
<el-col :span='12'> <el-col :span='12'>
<el-form-item label="装车产品" prop="productId"> <el-form-item label="装车产品" prop="productId">
<el-select v-model="form.productId" disabled placeholder="请选择" style="width: 100%;"> <el-select v-model="form.productId" disabled placeholder="请选择" style="width: 100%;">
<el-option <el-option v-for="item in productList" :key="item.id" :label="item.name" :value="item.id">
v-for="item in productList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -121,4 +124,4 @@ export default {
} }
} }
} }
</script> </script>

View File

@@ -44,14 +44,14 @@
:table-data="tableData" :table-data="tableData"
:max-height="tableH" :max-height="tableH"
> >
<method-btn <!-- <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
:width="80" :width="80"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="viewDetDetail" @clickBtn="viewDetDetail"
/> /> -->
</base-table> </base-table>
<pagination <pagination
:page.sync="queryParams.pageNo" :page.sync="queryParams.pageNo"
@@ -63,7 +63,7 @@
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="环形图" name="barChart"> <el-tab-pane label="环形图" name="barChart">
<div v-if="activeName === 'barChart'"> <div v-if="activeName === 'barChart'">
<div <div
id="logDetPieBar" id="logDetPieBar"
style="width: 60%" style="width: 60%"
:style="{ height: chartHeight + 'px' }" :style="{ height: chartHeight + 'px' }"
@@ -73,51 +73,14 @@
</el-tabs> </el-tabs>
</div> </div>
<!-- 详情抽屉 --> <!-- 详情抽屉 -->
<el-drawer
title="发货详情"
size="50%"
:append-to-body="true"
:visible.sync="innerDrawer"
@close='closeB'
:show-close='false'>
<div class="box3">
<el-row>
<el-col :span='12'>
<span class="title">订单名</span>
<span class="text">{{orderMsg.orderName ? orderMsg.orderName : '-'}}</span>
</el-col>
<el-col :span='12'>
<span class="title">发货单号</span>
<span class="text">{{logCode ? logCode : '-'}}</span>
</el-col>
</el-row>
</div>
<div class="box4">
<div class="boxTitle">
<span class="blueTitle"></span>
<span>详情</span>
</div>
<base-table
:page="queryParams2.pageNo"
:limit="queryParams2.pageSize"
:table-props="tableProps2"
:table-data="tableData2"
:max-height="tableH2"
/>
<pagination
:page.sync="queryParams2.pageNo"
:limit.sync="queryParams2.pageSize"
:total="total2"
@pagination="getList2"
/>
</div>
</el-drawer>
</el-drawer> </el-drawer>
</template> </template>
<script> <script>
import { deliveryLogPage, deliveryLogDetPage } from '@/api/base/delivery' import { deliveryLogPage, deliveryLogDetPage } from '@/api/base/delivery'
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
import * as echarts from 'echarts' import * as echarts from 'echarts'
import detailButton from './detailButton';
import resize from '@/utils/chartMixins/resize' import resize from '@/utils/chartMixins/resize'
const tableProps = [ const tableProps = [
{ {
@@ -142,55 +105,21 @@ const tableProps = [
{ {
prop: 'rate', prop: 'rate',
label: '发货比列(%)', label: '发货比列(%)',
width: 110 width: 110,
filter: (val) =>
val != null ? `${(val).toFixed(2)}%` : '',
}, },
{ {
prop: 'principalCost', prop: 'principalCost',
label: '运输费用' label: '运输费用'
},
{
prop: 'desc',
label: '装车详情',
subcomponent: detailButton,
} }
] ]
const tableProps2 = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'deliveryCarCode',
label: '装车单号',
showOverflowtooltip: true
},
{
prop: 'loadTime',
label: '装车时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'productName',
label: '装车产品',
showOverflowtooltip: true
},
{
prop: 'packagingSize',
label: '装箱规格(片/箱)',
minWidth: 140
},
{
prop: 'packagingNum',
label: '箱数'
},
{
prop: 'quantity',
label: '装车总量'
},
{
prop: 'productDate',
label: '产品批次',
showOverflowtooltip: true
}
]
export default { export default {
name: 'DeliveryLogDetDetail', name: 'DeliveryLogDetDetail',
mixins: [resize], mixins: [resize],
@@ -224,7 +153,6 @@ export default {
pageSize: 20, pageSize: 20,
logId: '' logId: ''
}, },
tableProps2,
tableData2: [], tableData2: [],
tableH2: this.tableHeight(275), tableH2: this.tableHeight(275),
total2: 0, total2: 0,
@@ -288,7 +216,7 @@ export default {
for (let i = 0; i < this.tableData.length; i++) { for (let i = 0; i < this.tableData.length; i++) {
let obj = {} let obj = {}
obj.value = this.tableData[i].num obj.value = this.tableData[i].num
obj.name = this.tableData[i].name obj.name = this.tableData[i].code
seriesData.push(obj) seriesData.push(obj)
if (i < 5) { if (i < 5) {
colorList.push(color[i]) colorList.push(color[i])
@@ -394,14 +322,7 @@ export default {
this.total2 = res.data.total || 0 this.total2 = res.data.total || 0
}) })
}, },
closeB() {
this.logCode = ''
this.queryParams2.pageNo = 1
this.queryParams2.pageSize = 20
this.queryParams2.logId = ''
this.tableData2 = []
this.total2 = 0
}
} }
} }
</script> </script>
@@ -498,4 +419,4 @@ export default {
color: rgba(0, 0, 0, 0.45); color: rgba(0, 0, 0, 0.45);
} }
} }
</style> </style>

View File

@@ -0,0 +1,253 @@
<!--
* @Author: zwq
* @Date: 2023-08-03 14:09:18
* @LastEditors: DY
* @LastEditTime: 2023-10-13 16:47:25
* @Description:
-->
<template>
<div class="tableInner">
<el-button @click="viewDetDetail" type="text" style="margin: 5px 0; padding: 0" >
<span class="iconfont" :class="'icon-detail' +
' primary-color'
"></span>
</el-button>
<el-drawer title="发货详情" size="50%" :append-to-body="true" :visible.sync="innerDrawer" @close='closeB'
:show-close='false'>
<div class="box3">
<el-row>
<el-col :span='12'>
<span class="title">订单名</span>
<span class="text">{{ orderMsg.orderName ? orderMsg.orderName : '-' }}</span>
</el-col>
<el-col :span='12'>
<span class="title">发货单号</span>
<span class="text">{{ logCode ? logCode : '-' }}</span>
</el-col>
</el-row>
</div>
<div class="box4">
<div class="boxTitle">
<span class="blueTitle"></span>
<span>详情</span>
</div>
<base-table :page="queryParams2.pageNo" :limit="queryParams2.pageSize" :table-props="tableProps2"
:table-data="tableData2" :max-height="tableH2" />
<pagination :page.sync="queryParams2.pageNo" :limit.sync="queryParams2.pageSize" :total="total2"
@pagination="getList2" />
</div>
</el-drawer>
</div>
</template>
<script>
import { deliveryLogDetPage } from '@/api/base/delivery'
import { parseTime } from '@/utils/ruoyi'
const tableProps2 = [
// {
// prop: 'createTime',
// label: '添加时间',
// filter: parseTime,
// minWidth: 160
// },
{
prop: 'deliveryCarCode',
label: '装车单号',
showOverflowtooltip: true
},
{
prop: 'loadTime',
label: '装车时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'productName',
label: '装车产品',
showOverflowtooltip: true
},
{
prop: 'packagingSize',
label: '装箱规格(片/箱)',
minWidth: 140
},
{
prop: 'packagingNum',
label: '箱数'
},
{
prop: 'quantity',
label: '装车总量'
},
{
prop: 'productDate',
label: '产品批次',
showOverflowtooltip: true
}
]
export default {
props: {
injectData: {
type: Object,
default: () => ({}),
},
},
data() {
return {
list: this.injectData,
visible: false,
tableProps2,
logCode:'',
orderMsg: {},
tableData2: [],
tableH2: this.tableHeight(275),
total2: 0,
innerDrawer:false,
queryParams2: {
pageNo: 1,
pageSize: 20,
logId: ''
},
};
},
mounted() {
window.addEventListener('resize', () => {
this.tableH2 = this.tableHeight(275)
})
},
methods: {
viewDetDetail() {
console.log(this.list);
this.logCode = this.list.code
this.orderMsg.orderName = this.list.orderName
this.innerDrawer = true
this.queryParams2.logId = this.list.id
this.getList2()
},
closeB() {
this.logCode = ''
this.queryParams2.pageNo = 1
this.queryParams2.pageSize = 20
this.queryParams2.logId = ''
this.tableData2 = []
this.total2 = 0
},
getList2() {
deliveryLogDetPage({ ...this.queryParams2 }).then(res => {
this.tableData2 = res.data.list || []
this.total2 = res.data.total || 0
})
},
},
};
</script>
<style scoped lang='scss'>
.box1 {
height: 76px;
border-bottom: 1px solid #E9E9E9;
margin: 0px 8px 20px 30px;
.box_col {
display: inline-block;
width: 20%;
padding: 8px 8px 8px 8px;
.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);
}
}
}
.box2 {
padding: 0px 32px 30px 30px;
height: calc(100vh - 150px);
}
.boxTitle {
display: inline-block;
font-size: 16px;
font-weight: 400;
color: #000000;
margin: 0 10px 10px 0;
}
.blueTitle {
content: '';
display: inline-block;
width: 4px;
height: 18px;
background-color: #0B58FF;
border-radius: 1px;
margin-right: 8px;
vertical-align: bottom;
}
.box3 {
padding: 8px 8px 8px 40px;
.title {
height: 16px;
font-size: 14px;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
}
.text {
height: 16px;
font-size: 14px;
font-weight: 400;
color: rgba(102, 102, 102, 0.75);
}
}
.box4 {
padding: 32px 32px 30px 30px;
height: calc(100vh - 125px);
}
</style>
<style lang='scss'>
.deliveryLogDetail {
.el-tabs__nav::after {
content: "";
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 2px;
background-color: #e4e7ed;
/* z-index: 1; */
}
.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);
}
}
</style>

View File

@@ -0,0 +1,153 @@
<!--
* @Author: zwq
* @Date: 2023-08-03 14:09:18
* @LastEditors: DY
* @LastEditTime: 2023-10-13 16:47:25
* @Description:
-->
<template>
<div class="tableInner">
<el-button @click="handleClick" type="text" style="margin: 5px 0; padding: 0">
<span class="iconfont" :class="'icon-detail' +
' primary-color'
"></span>
</el-button>
<delivery-log-det-detail ref='deliveryLogDetail' />
</div>
</template>
<script>
import DeliveryLogDetDetail from './deliveryLogDetDetail.vue'
export default {
props: {
injectData: {
type: Object,
default: () => ({}),
},
},
data() {
return {
list: this.injectData,
};
},
components: { DeliveryLogDetDetail },
mounted() {
},
methods: {
handleClick() {
this.$nextTick(() => {
this.$refs.deliveryLogDetail.init(this.list)
})
}
},
};
</script>
<style scoped lang='scss'>
.box1 {
height: 76px;
border-bottom: 1px solid #E9E9E9;
margin: 0px 8px 20px 30px;
.box_col {
display: inline-block;
width: 20%;
padding: 8px 8px 8px 8px;
.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);
}
}
}
.box2 {
padding: 0px 32px 30px 30px;
height: calc(100vh - 150px);
}
.boxTitle {
display: inline-block;
font-size: 16px;
font-weight: 400;
color: #000000;
margin: 0 10px 10px 0;
}
.blueTitle {
content: '';
display: inline-block;
width: 4px;
height: 18px;
background-color: #0B58FF;
border-radius: 1px;
margin-right: 8px;
vertical-align: bottom;
}
.box3 {
padding: 8px 8px 8px 40px;
.title {
height: 16px;
font-size: 14px;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
}
.text {
height: 16px;
font-size: 14px;
font-weight: 400;
color: rgba(102, 102, 102, 0.75);
}
}
.box4 {
padding: 32px 32px 30px 30px;
height: calc(100vh - 125px);
}
</style>
<style lang='scss'>
.deliveryLogDetail {
.el-tabs__nav::after {
content: "";
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 2px;
background-color: #e4e7ed;
/* z-index: 1; */
}
.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);
}
}
</style>

View File

@@ -14,14 +14,14 @@
:table-data="list" :table-data="list"
:max-height="tableH" :max-height="tableH"
> >
<method-btn <!-- <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
:width="80" :width="80"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleClick" @clickBtn="handleClick"
/> /> -->
</base-table> </base-table>
<pagination <pagination
:page.sync="queryParams.pageNo" :page.sync="queryParams.pageNo"
@@ -30,12 +30,13 @@
@pagination="getList" @pagination="getList"
/> />
<!-- 详情抽屉 --> <!-- 详情抽屉 -->
<delivery-log-det-detail ref='deliveryLogDetail'/> <!-- <delivery-log-det-detail ref='deliveryLogDetail'/> -->
</div> </div>
</template> </template>
<script> <script>
import { deliveryProgressPage } from '@/api/base/delivery' import { deliveryProgressPage } from '@/api/base/delivery'
import DeliveryLogDetDetail from './components/deliveryLogDetDetail.vue'
import shippingBtn from './components/shippingBtn.vue';
const tableProps = [ const tableProps = [
{ {
prop: 'orderName', prop: 'orderName',
@@ -61,7 +62,12 @@ const tableProps = [
}, },
{ {
prop: 'rate', prop: 'rate',
label: '累计发货比例(%)' label: '发货进度(%)'
},
{
prop: 'desc',
label: '发货详情',
subcomponent: shippingBtn,
} }
] ]
export default { export default {
@@ -101,7 +107,7 @@ export default {
].filter((v) => v) ].filter((v) => v)
} }
}, },
components: { DeliveryLogDetDetail }, // components: { DeliveryLogDetDetail },
created() { created() {
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260) this.tableH = this.tableHeight(260)
@@ -119,12 +125,12 @@ export default {
this.queryParams.orderName = val.orderName this.queryParams.orderName = val.orderName
this.getList() this.getList()
}, },
handleClick(val) { // handleClick(val) {
console.log(val) // console.log(val)
this.$nextTick(() => { // this.$nextTick(() => {
this.$refs.deliveryLogDetail.init(val.data) // this.$refs.deliveryLogDetail.init(val.data)
}) // })
} // }
} }
} }
</script> </script>

View File

@@ -92,7 +92,8 @@ export default {
type: 'select', type: 'select',
label: '能源类型', label: '能源类型',
selectOptions: [], selectOptions: [],
param: 'energyTypeId' param: 'energyTypeId',
clearable: false
}, },
{ {
type: 'select', type: 'select',
@@ -162,7 +163,6 @@ export default {
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260) this.tableH = this.tableHeight(260)
}) })
this.getList();
this.getTypeList() this.getTypeList()
// 获取对象树形结构 // 获取对象树形结构
this.getObjTree() this.getObjTree()
@@ -171,7 +171,10 @@ export default {
getTypeList() { getTypeList() {
getEnergyTypeListAll().then((res) => { getEnergyTypeListAll().then((res) => {
this.formConfig[0].selectOptions = res.data || [] this.formConfig[0].selectOptions = res.data || []
this.formConfig[0].defaultSelect = res.data[0].id
this.queryParams.energyTypeId = res.data[0].id
this.energyTypeList = res.data || [] this.energyTypeList = res.data || []
this.getList();
}) })
}, },
buttonClick(val) { buttonClick(val) {

View File

@@ -3,7 +3,7 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="能源类型" prop="typeId"> <el-form-item label="能源类型" prop="typeId">
<el-select v-model="form.typeId" placeholder="请选择" style="width: 100%;" filterable> <el-select v-model="form.typeId" placeholder="请选择" style="width: 100%;" filterable @change="getUnit">
<el-option <el-option
v-for="item in energyListType" v-for="item in energyListType"
:key="item.id" :key="item.id"
@@ -79,9 +79,17 @@ export default {
} }
}, },
methods: { methods: {
getUnit(val) {
this.energyListType.forEach((item) => {
if (val === item.id) {
this.form.unit = item.unit
}
})
},
init(param) { init(param) {
this.form.connectId = param.connectId this.form.connectId = param.connectId
getEnergyTypeListAll().then((res) => { getEnergyTypeListAll().then((res) => {
console.log(res)
this.energyListType = res.data || [] this.energyListType = res.data || []
}) })
if (param.id) { if (param.id) {

View File

@@ -37,7 +37,7 @@
@cancel="handleCancel" @cancel="handleCancel"
@confirm="handleConfirm" @confirm="handleConfirm"
:before-close="handleCancel" :before-close="handleCancel"
width='30%' width='50%'
> >
<energy-plc-connect-add ref="energyPlcConnect" :objList="objList" @successSubmit="successSubmit" /> <energy-plc-connect-add ref="energyPlcConnect" :objList="objList" @successSubmit="successSubmit" />
</base-dialog> </base-dialog>
@@ -60,7 +60,8 @@ const tableProps = [
}, },
{ {
prop: 'objCode', prop: 'objCode',
label: '对象编码' label: '对象编码',
minWidth: 160,
}, },
{ {
prop: 'plcTableName', prop: 'plcTableName',
@@ -69,7 +70,8 @@ const tableProps = [
{ {
prop: 'plcTableCode', prop: 'plcTableCode',
label: '关联表编码', label: '关联表编码',
showOverflowtooltip: true showOverflowtooltip: true,
minWidth: 160,
}, },
{ {
prop: 'cnName', prop: 'cnName',

View File

@@ -60,7 +60,8 @@ export default {
name: '', name: '',
code: '', code: '',
type: '', type: '',
energyTypeId: '' energyTypeId: '',
remark: ''
}, },
plcList: [], plcList: [],
objList: [], objList: [],

View File

@@ -16,7 +16,7 @@
type="text" type="text"
class="tableInnerButton" class="tableInnerButton"
@click="showInnerTable(injectData)" @click="showInnerTable(injectData)"
>详情</el-button >价格详情</el-button
> >
</el-popover> </el-popover>
</template> </template>

View File

@@ -3,7 +3,14 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="能源类型" prop="name"> <el-form-item label="能源类型" prop="name">
<el-input v-model="form.name"></el-input> <el-select v-model="form.name" placeholder="请选择" style="width: 100%;">
<el-option
v-for="item in getDictDatas(DICT_TYPE.ENERGY_TYPE)"
:key="item.value"
:label="item.label"
:value="item.label">
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@@ -213,10 +220,6 @@ export default {
// 增加 // 增加
emitButtonClick1() { emitButtonClick1() {
let n = this.tableData1.length let n = this.tableData1.length
if (n >=3) {
this.$modal.msgWarning('最多可添加3档计价')
return false
}
let obj = {} let obj = {}
obj.startTime = n === 0 ? '' : this.tableData1[n-1].endTime obj.startTime = n === 0 ? '' : this.tableData1[n-1].endTime
obj.endTime = '' obj.endTime = ''
@@ -225,10 +228,6 @@ export default {
}, },
emitButtonClick2() { emitButtonClick2() {
let n = this.tableData2.length let n = this.tableData2.length
if (n >=3) {
this.$modal.msgWarning('最多可添加3档计价')
return false
}
let obj = {} 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.endUsed = 0

View File

@@ -80,10 +80,14 @@ export default {
return { return {
formConfig: [ formConfig: [
{ {
type: 'input', type: 'select',
label: '能源类型', label: '能源类型',
selectOptions: this.getDictDatas(this.DICT_TYPE.ENERGY_TYPE),
placeholder: '能源类型', placeholder: '能源类型',
param: 'name' labelField: 'label',
valueField: 'label',
param: 'name',
flilterable: true
}, },
{ {
type: 'button', type: 'button',

View File

@@ -13,60 +13,6 @@
v-loading="formLoading"> v-loading="formLoading">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item
label="产线"
prop="productionLineId"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-select
v-model="dataForm.productionLineId"
placeholder="请选择产线"
filterable
@change="handleProductlineChange">
<el-option
v-for="opt in productionLineList"
: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="sectionId"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-select
v-model="dataForm.sectionId"
placeholder="请选择工段"
filterable
@change="$emit('update', dataForm)">
<el-option
v-for="opt in workshopSectionList"
: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="buttonId"
:rules="[
{ required: true, message: '不能为空', trigger: 'blur' },
{
type: 'number',
message: '请输入整数',
trigger: 'blur',
transform: (val) => Number.isInteger(Number(val)) && Number(val),
},
]">
<el-input
v-model="dataForm.buttonId"
@change="$emit('update', dataForm)"
placeholder="请输入整数" />
</el-form-item>
<el-form-item <el-form-item
label="产线" label="产线"
prop="productionLineId" prop="productionLineId"
@@ -130,13 +76,22 @@
placeholder="请输入整数" /> placeholder="请输入整数" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item
label="按钮盒模式"
prop="model">
<el-input
v-model="dataForm.model"
@change="$emit('update', dataForm)"
placeholder="请输入按钮盒模式" />
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item
label="按钮值" label="按钮值"
prop="keyValue" prop="keyValue"
:rules="[ :rules="[
{ required: true, message: '不能为空', trigger: 'blur' }, { required: true, message: '按钮值不能为空', trigger: 'blur' },
{ {
type: 'number', type: 'number',
message: '请输入100以内的整数', message: '请输入100以内的整数',
@@ -154,17 +109,22 @@
min="0" min="0"
max="100" max="100"
@change="$emit('update', dataForm)" @change="$emit('update', dataForm)"
placeholder="请输入按钮盒模式" /> placeholder="请输入按钮" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="检测内容" prop="inspectionDetId"> <el-form-item
label="检测内容"
prop="inspectionDetId"
:rules="[
{ required: true, message: '检测内容不能为空', trigger: 'blur' },
]">
<el-select <el-select
v-model="dataForm.inspectionDetId" v-model="dataForm.inspectionDetId"
placeholder="请选择检测内容" placeholder="请选择检测内容"
filterable filterable
@change="$emit('update', dataForm)"> @change="handleInspectionDetChange">
<el-option <el-option
v-for="opt in inspectionDetList" v-for="opt in inspectionDetList"
:key="opt.value" :key="opt.value"
@@ -203,14 +163,9 @@ export default {
mounted() { mounted() {
this.getProductionLineList(); this.getProductionLineList();
this.getQualityInspectionDetList(); this.getQualityInspectionDetList();
// this.getWorksectionList(); if (this.dataForm.productionLineId) {
// this.getCode('/base/equipment-group-alarm/getCode').then((code) => { this.getWorksectionList(this.dataForm.productionLineId);
// this.formLoading = false; }
// this.$emit('update', {
// ...this.dataForm,
// code,
// });
// });
}, },
watch: { watch: {
'dataForm.productionId': { 'dataForm.productionId': {
@@ -279,11 +234,18 @@ export default {
this.dataForm.sectionId = null; this.dataForm.sectionId = null;
this.$emit('update', this.dataForm); this.$emit('update', this.dataForm);
}, },
async getCode(url) { async getCode(url) {
const response = await this.$axios(url); const response = await this.$axios(url);
return response.data; return response.data;
}, },
handleInspectionDetChange(id) {
this.inspectionDetList.forEach((item) => {
if (item.value == id) {
this.dataForm.inspectionDetContent = item.label;
}
});
this.$emit('update', this.dataForm);
}
}, },
}; };
</script> </script>

View File

@@ -40,7 +40,7 @@
@close="cancel" @close="cancel"
@cancel="cancel" @cancel="cancel"
@confirm="submitForm"> @confirm="submitForm">
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" /> <DialogForm v-if="open" ref="form" v-model="form"/>
</base-dialog> </base-dialog>
</div> </div>
</template> </template>
@@ -65,78 +65,6 @@ export default {
components: { DialogForm }, components: { DialogForm },
data() { data() {
return { return {
rows: [
[
{
select: true,
label: '产线',
url: '/base/production-line/listAll',
prop: 'productionId',
rules: [
{ required: true, message: '产线不能为空', trigger: 'blur' },
],
bind: {
filterable: true,
},
},
{
select: true,
label: '工段',
url: '/base/workshop-section/listAll',
prop: 'sectionId',
rules: [
{ required: true, message: '工段不能为空', trigger: 'blur' },
],
bind: {
filterable: true,
},
},
],
[
{
input: true,
label: '按钮盒识别码',
prop: 'buttonId',
rules: [
{
type: 'number',
message: '请输入整数',
trigger: 'blur',
transform: (val) =>
Number.isInteger(Number(val)) && Number(val),
},
],
},
{ input: true, label: '按钮盒模式', prop: 'model' },
],
[
{
input: true,
label: '按钮值',
prop: 'keyValue',
rules: [
{
type: 'number',
message: '请输入100以内的整数',
trigger: 'blur',
transform: (val) =>
Number(val) <= 100 && Number.isInteger(+val) && Number(val),
},
],
bind: { type: 'number', min: 0, max: 100 },
},
{
select: true,
label: '检测内容',
url: '/base/quality-inspection-det/listAll',
prop: 'inspectionDetId',
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
bind: {
filterable: true,
},
},
],
],
searchBarFormConfig: [ searchBarFormConfig: [
{ {
type: 'input', type: 'input',
@@ -230,6 +158,7 @@ export default {
id: null, id: null,
buttonId: null, buttonId: null,
inspectionDetId: null, inspectionDetId: null,
inspectionDetContent: null,
productionLineId: null, productionLineId: null,
sectionId: null, sectionId: null,
model: null, model: null,
@@ -256,12 +185,13 @@ export default {
this.form = { this.form = {
id: null, id: null,
buttonId: null, buttonId: null,
inspectionDetId: null,
inspectionDetContent: null, inspectionDetContent: null,
productionId: null, productionLineId: null,
sectionId: null, sectionId: null,
model: null, model: null,
keyValue: null, keyValue: null,
}; },
this.resetForm('form'); this.resetForm('form');
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */

View File

@@ -150,6 +150,10 @@
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<span class="separateStyle"></span> <span class="separateStyle"></span>
<el-button size="small" @click="resetBtn">重置</el-button> <el-button size="small" @click="resetBtn">重置</el-button>
<span class="separateStyle"></span>
<el-button type="primary" size="small" @click="exportData" plain>
导出
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span v-if="isFold" class="foldClass" @click='switchMode'> <span v-if="isFold" class="foldClass" @click='switchMode'>
@@ -215,6 +219,7 @@ export default {
getTypeList() { getTypeList() {
getEnergyTypeListAll().then((res) => { getEnergyTypeListAll().then((res) => {
this.energyTypeList = res.data || [] this.energyTypeList = res.data || []
this.queryParams.energyTypeId = res.data[0].id
}) })
}, },
// 范围选择器 // 范围选择器
@@ -326,8 +331,16 @@ export default {
}) })
} }
}, },
// 查询
search() {
if (this.validateData()) {
this.queryParams.startTime = this.queryParams.startTime + '';
this.queryParams.endTime = this.queryParams.endTime + '';
this.$emit('submit', this.queryParams);
}
},
// 查询 // 查询
search() { validateData() {
if (!this.queryParams.energyTypeId) { if (!this.queryParams.energyTypeId) {
this.$modal.msgError('请选择能源类型') this.$modal.msgError('请选择能源类型')
return false return false
@@ -397,10 +410,7 @@ export default {
this.$modal.msgError('请选择对象') this.$modal.msgError('请选择对象')
return false return false
} }
this.queryParams.startTime = this.queryParams.startTime + '' return true;
this.queryParams.endTime = this.queryParams.endTime + ''
console.log(this.queryParams)
this.$emit('submit', this.queryParams)
}, },
resetBtn() { resetBtn() {
this.queryParams.energyTypeId = null this.queryParams.energyTypeId = null
@@ -436,7 +446,14 @@ export default {
} else { } else {
element.classList.add('divHeight') element.classList.add('divHeight')
} }
} },
exportData() {
if (this.validateData()) {
this.queryParams.startTime = this.queryParams.startTime + '';
this.queryParams.endTime = this.queryParams.endTime + '';
this.$emit('exportD', this.queryParams);
}
},
} }
} }
</script> </script>
@@ -494,4 +511,4 @@ export default {
vertical-align: middle; vertical-align: middle;
margin: 0 10px; margin: 0 10px;
} }
</style> </style>

View File

@@ -1,7 +1,7 @@
<template> <template>
<div class="app-container contrastAnalysisBox" id="contrastAnalysisBox"> <div class="app-container contrastAnalysisBox" id="contrastAnalysisBox">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-area :isFold="isFold" @submit="getList"/> <search-area :isFold="isFold" @submit="getList" @exportD="exportData"/>
<div v-show="chartData.length"> <div v-show="chartData.length">
<bar-chart <bar-chart
ref="analysisBarChart" ref="analysisBarChart"
@@ -18,7 +18,7 @@
</div> </div>
</template> </template>
<script> <script>
import { getCompare } from "@/api/analysis/energyAnalysis" import { getCompare ,exportCompare} from "@/api/analysis/energyAnalysis"
import SearchArea from "./components/searchArea" import SearchArea from "./components/searchArea"
import BarChart from "./components/barChart" import BarChart from "./components/barChart"
import tableHeightMixin from '@/mixins/tableHeightMixin'; import tableHeightMixin from '@/mixins/tableHeightMixin';
@@ -85,32 +85,17 @@ export default {
} }
this.tableProps = [{ prop: 'time', label: '时间' }].concat(tempX); this.tableProps = [{ prop: 'time', label: '时间' }].concat(tempX);
}, },
// 导出 /** 导出按钮操作 */
exportExl() { exportData(val) {
if (this.list.length > 0) { // 处理查询参数
var wb = XLSX.utils.table_to_book( this.$modal.confirm('是否确认导出对比分析数据?').then(() => {
document.querySelector('.contrast-out-table') this.exportLoading = true;
); return exportCompare(val);
let fileName = '对比分析.xlsx'; }).then(response => {
var wbout = XLSX.write(wb, { this.$download.excel(response, '对比分析数据.xlsx');
bookType: 'xlsx', this.exportLoading = false;
bookSST: true, }).catch(() => {});
type: 'array', }
});
try {
FileSaver.saveAs(
new Blob([wbout], { type: 'application/octet-stream' }),
fileName
);
this.$message.success('导出成功');
} catch (e) {
if (typeof console !== 'undefined') console.log(e, wbout);
}
return wbout;
} else {
this.$modal.msgWarning('暂无数据导出');
}
},
} }
} }
</script> </script>

View File

@@ -7,7 +7,7 @@
--> -->
<template> <template>
<div> <div>
<div style="background: #f2f4f9; height: 40px; width: 100%"> <div style="background: #f2f4f9; height: 56px; width: 100%">
<ButtonNav <ButtonNav
:menus="['走势分析', '对比分析', '同比分析', '环比分析']" :menus="['走势分析', '对比分析', '同比分析', '环比分析']"
@change="currentMenu"> @change="currentMenu">

View File

@@ -158,14 +158,33 @@ export default {
this.$emit('submit', this.queryParams) this.$emit('submit', this.queryParams)
}, },
exportData() { exportData() {
let name if (this.objArr.length === 0) {
if (this.queryParams.objId) { this.$modal.msgError('请选择对象')
name = this.getObjName(this.objList, this.queryParams.objId) return false
} else { } else {
this.$modal.msgWarning("对象不能为空") this.queryParams.objId = this.objArr[this.objArr.length-1]
}
if (!this.queryParams.type) {
this.$modal.msgError('请选择时间维度')
return false return false
} }
this.$emit('exportD', {name: name}) if (!this.queryParams.searchTime) {
this.$modal.msgError('请选择时间')
return false
}
switch (this.queryParams.type) {
case 1:
this.queryParams.searchTime = this.transformTime(this.monthValue)
break;
case 2:
let value = moment(this.weekValue).day(6).format('YYYY-MM-DD') + ' 23:59:59'
this.queryParams.searchTime = new Date(value).getTime()
break;
default:
let value2 = moment(this.dateValue).format('YYYY-MM-DD') + ' 23:59:59'
this.queryParams.searchTime = new Date(value2).getTime()
}
this.$emit('exportD', this.queryParams)
}, },
// 递归取对象name // 递归取对象name
getObjName(list, id) { getObjName(list, id) {
@@ -229,4 +248,4 @@ export default {
margin-top: 10px; margin-top: 10px;
} }
} }
</style> </style>

View File

@@ -19,7 +19,7 @@
</div> </div>
</template> </template>
<script> <script>
import { getQoq } from "@/api/analysis/energyAnalysis" import { getQoq,exportChain } from "@/api/analysis/energyAnalysis"
import SearchArea from "./components/searchArea" import SearchArea from "./components/searchArea"
import LineChart from "./components/lineChart" import LineChart from "./components/lineChart"
import FileSaver from "file-saver" import FileSaver from "file-saver"
@@ -89,26 +89,14 @@ export default {
this.chartData = this.list this.chartData = this.list
}, },
exportData(val) { exportData(val) {
if (this.list.length > 0) { // 处理查询参数
var wb = XLSX.utils.table_to_book(document.querySelector(".qoq-out-table")) this.$modal.confirm('是否确认导出环比分析数据?').then(() => {
let fileName = val.name + "环比分析.xlsx" this.exportLoading = true;
var wbout = XLSX.write(wb, { return exportChain(val);
bookType: "xlsx", }).then(response => {
bookSST: true, this.$download.excel(response, '环比分析数据.xlsx');
type: "array" this.exportLoading = false;
}) }).catch(() => {});
try {
FileSaver.saveAs(
new Blob([wbout], { type: "application/octet-stream" }),
fileName
)
} catch (e) {
if (typeof console !== "undefined") console.log(e, wbout);
}
return wbout
} else {
this.$modal.msgWarning("暂无数据导出")
}
} }
} }
} }
@@ -129,4 +117,4 @@ export default {
margin-right: 8px; margin-right: 8px;
vertical-align: bottom; vertical-align: bottom;
} }
</style> </style>

View File

@@ -205,6 +205,7 @@ export default {
getTypeList() { getTypeList() {
getEnergyTypeListAll().then((res) => { getEnergyTypeListAll().then((res) => {
this.energyTypeList = res.data || []; this.energyTypeList = res.data || [];
this.queryParams.energyTypeId = res.data[0].id
}); });
}, },
getObjTree() { getObjTree() {

View File

@@ -125,14 +125,26 @@ export default {
this.$emit('submit', this.queryParams) this.$emit('submit', this.queryParams)
}, },
exportData() { exportData() {
let name if (this.objArr.length === 0) {
if (this.queryParams.objId) { this.$modal.msgError('请选择对象')
name = this.getObjName(this.objList, this.queryParams.objId) return false
} else { } else {
this.$modal.msgWarning("对象不能为空") this.queryParams.objId = this.objArr[this.objArr.length-1]
}
if (!this.queryParams.type) {
this.$modal.msgError('请选择时间维度')
return false return false
} }
this.$emit('exportD', {name: name}) if (!this.queryParams.searchTime) {
this.$modal.msgError('请选择时间')
return false
}
if (this.queryParams.type === 3) {
this.queryParams.searchTime = this.transformTime(this.yearMonth) + ''
} else {
this.queryParams.searchTime = this.transformYear(this.yearValue) + ''
}
this.$emit('exportD', this.queryParams)
}, },
// 递归取对象name // 递归取对象name
getObjName(list, id) { getObjName(list, id) {
@@ -202,4 +214,4 @@ export default {
background: #E8E8E8; background: #E8E8E8;
vertical-align: middle; vertical-align: middle;
} }
</style> </style>

View File

@@ -20,7 +20,7 @@
</div> </div>
</template> </template>
<script> <script>
import { getYoy } from "@/api/analysis/energyAnalysis" import { getYoy,exportYoy } from "@/api/analysis/energyAnalysis"
import subRate from "./components/subRate.vue" import subRate from "./components/subRate.vue"
import SearchArea from "./components/searchArea" import SearchArea from "./components/searchArea"
import LineChart from "./components/lineChart" import LineChart from "./components/lineChart"
@@ -101,26 +101,14 @@ export default {
this.chartData = this.list this.chartData = this.list
}, },
exportData(val) { exportData(val) {
if (this.list.length > 0) { // 处理查询参数
var wb = XLSX.utils.table_to_book(document.querySelector(".yoy-out-table")) this.$modal.confirm('是否确认导出同比分析数据?').then(() => {
let fileName = val.name + "同比分析.xlsx" this.exportLoading = true;
var wbout = XLSX.write(wb, { return exportYoy(val);
bookType: "xlsx", }).then(response => {
bookSST: true, this.$download.excel(response, '同比分析数据.xlsx');
type: "array" this.exportLoading = false;
}) }).catch(() => {});
try {
FileSaver.saveAs(
new Blob([wbout], { type: "application/octet-stream" }),
fileName
)
} catch (e) {
if (typeof console !== "undefined") console.log(e, wbout);
}
return wbout
} else {
this.$modal.msgWarning("暂无数据导出")
}
} }
} }
} }
@@ -140,4 +128,4 @@ export default {
margin-right: 8px; margin-right: 8px;
vertical-align: bottom; vertical-align: bottom;
} }
</style> </style>

View File

@@ -0,0 +1,430 @@
<!--
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}`" 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}`"
@change="$emit('selectupdate', 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="col.disabled ? col.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 class="upload-in-dialog" v-if="col.upload" :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="col.bind?.disabled || false">
<svg-icon icon-class="icon-upload" style="color: inherit"></svg-icon>
上传文件
</el-button>
<div class="el-upload__tip" slot="tip" v-if="col.uploadTips">
{{ col.uploadTips || '只能上传jpg/png文件, 大小不超过2MB' }}
</div>
</el-upload>
<uploadedFile class="file" v-for="file in form[col.prop]" :file="file" :key="file.fileUrl"
@delete="!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'],
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}
<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', // 上传有关的headersurl都是固定的
};
},
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',
});
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() {},
// 上传前的验证规则可通过 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>

View File

@@ -331,7 +331,7 @@ export default {
queryParams: { queryParams: {
lineId: null, lineId: null,
factoryId: null, factoryId: null,
recordTime: [], recordTime: undefined,
}, },
// 表单参数 // 表单参数
form: {}, form: {},
@@ -410,15 +410,13 @@ export default {
this.queryParams.factoryId = payload.factoryId || null; this.queryParams.factoryId = payload.factoryId || null;
this.queryParams.lineId = payload.lineId || null; this.queryParams.lineId = payload.lineId || null;
if (0 == payload.dateFilterType) { if (0 == payload.dateFilterType) {
this.queryParams.recordTime = payload.timerange; this.queryParams.recordTime = payload.timerange ? payload.timerange :undefined
} else if (1 == payload.dateFilterType) { } else if (1 == payload.dateFilterType) {
this.queryParams.recordTime = [ this.queryParams.recordTime = [
`${payload.timeday} 00:00:00`, `${payload.timeday} 00:00:00`,
`${payload.timeday} 23:59:59`, `${payload.timeday} 23:59:59`,
]; ];
} }
} else {
this.queryParams.recordTime = null;
} }
this.getList(); this.getList();
}, },

View File

@@ -252,7 +252,7 @@ export default {
computed: {}, computed: {},
created() { created() {
this.fillLineOptions(); this.fillLineOptions();
this.fillProductOptions(); // this.fillProductOptions();
}, },
mounted() { mounted() {
// window.addEventListener('resize', () => { // window.addEventListener('resize', () => {
@@ -284,23 +284,23 @@ export default {
); );
}, },
async fillProductOptions() { // async fillProductOptions() {
const { data } = await this.$axios({ // const { data } = await this.$axios({
url: '/base/core-product/listAll', // url: '/base/core-product/listAll',
method: 'get', // method: 'get',
}); // });
const cfg = this.searchBarFormConfig.find( // const cfg = this.searchBarFormConfig.find(
(item) => item.__index == 'product' // (item) => item.__index == 'product'
); // );
this.$set( // this.$set(
cfg, // cfg,
'selectOptions', // 'selectOptions',
data.map((item) => ({ // data.map((item) => ({
id: item.id, // id: item.id,
name: item.name, // name: item.name,
})) // }))
); // );
}, // },
async getList() { async getList() {
const { data } = await this.$axios({ const { data } = await this.$axios({

View File

@@ -39,13 +39,6 @@
@close="cancel" @close="cancel"
@cancel="cancel" @cancel="cancel"
@confirm="submitForm"> @confirm="submitForm">
<!-- <DialogForm
v-if="open"
ref="form"
v-model="form"
:disabled="mode == 'detail'"
:has-files="false"
:rows="rows" /> -->
<AddOrUpdate <AddOrUpdate
v-if="open" v-if="open"
ref="addOrUpdate" ref="addOrUpdate"
@@ -119,22 +112,22 @@ export default {
// : undefined, // : undefined,
].filter((v) => v), ].filter((v) => v),
tableProps: [ tableProps: [
{ prop: 'productionLine', label: '产线', width: 120, showOverflowtooltip: true }, { prop: 'productionLine', label: '产线', showOverflowtooltip: true },
{ prop: 'workshopSection', label: '工段', width: 120, showOverflowtooltip: true }, { prop: 'workshopSection', label: '工段',showOverflowtooltip: true },
{ prop: 'equipment', label: '设备名称', width: 120, showOverflowtooltip: true }, { prop: 'equipment', label: '设备名称', showOverflowtooltip: true },
{ {
prop: 'alarmGrade', prop: 'alarmGrade',
label: '报警级别', label: '报警级别',
filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL), filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL),
}, },
{ prop: 'createTime', label: '报警时间', filter: timeFilter, width: 150, showOverflowtooltip: true }, { prop: 'createTime', label: '报警时间', filter: timeFilter, showOverflowtooltip: true },
{ prop: 'alarmCode', label: '设备报警码', width: 180, showOverflowtooltip: true }, { prop: 'alarmCode', label: '设备报警码', showOverflowtooltip: true },
{ prop: 'alarmContent', label: '报警内容', width: 150, showOverflowtooltip: true }, { prop: 'alarmContent', label: '报警内容', showOverflowtooltip: true },
this.$auth.hasPermiAnd([ this.$auth.hasPermiAnd([
'monitoring:equipment-alarm-log:query', 'monitoring:equipment-alarm-log:query',
'base:equipment-alarm-hand:query' 'base:equipment-alarm-hand:query'
]) ? ]) ?
{ prop: 'opt1', label: '处理记录', name: '查看', subcomponent: btn } : undefined, { prop: 'opt1', label: '处理记录', name: '查看', subcomponent: btn } : '',
this.$auth.hasPermiAnd([ this.$auth.hasPermiAnd([
'monitoring:equipment-alarm-log:query', 'monitoring:equipment-alarm-log:query',
'base:equipment-alarm-hand:query', 'base:equipment-alarm-hand:query',
@@ -143,7 +136,7 @@ export default {
'base:equipment-alarm-hand:update', 'base:equipment-alarm-hand:update',
'monitoring:equipment-alarm-log:update' 'monitoring:equipment-alarm-log:update'
]) ? ]) ?
{ prop: 'opt2', label: '处理', name: '报警处理', subcomponent: btn } : undefined, { prop: 'opt2', label: '处理', name: '报警处理', subcomponent: btn } : '',
// { prop: 'remark', label: '备注' }, // { prop: 'remark', label: '备注' },
], ],
searchBarFormConfig: [ searchBarFormConfig: [

View File

@@ -119,12 +119,12 @@ export default {
return { return {
searchBarKeys: ['groupId', 'equipmentName'], searchBarKeys: ['groupId', 'equipmentName'],
tableBtn: [ tableBtn: [
this.$auth.hasPermi('equipment:bind-group:update') // this.$auth.hasPermi('equipment:bind-group:update')
? { // ? {
type: 'detail', // type: 'detail',
btnName: '查看报警', // btnName: '查看报警',
} // }
: undefined, // : undefined,
this.$auth.hasPermi('equipment:bind-group:update') this.$auth.hasPermi('equipment:bind-group:update')
? { ? {
type: 'edit', type: 'edit',
@@ -371,8 +371,8 @@ export default {
}, },
handleTableBtnClick({ data, type }) { handleTableBtnClick({ data, type }) {
switch (type) { switch (type) {
case 'edit': case 'edit':
this.handleDetail(data, 'edit'); this.handleUpdate(data)
break; break;
case 'delete': case 'delete':
this.handleDelete(data); this.handleDelete(data);
@@ -397,7 +397,7 @@ export default {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = '添加设备与分组绑定'; this.title = '添加设备与分组绑定';
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
@@ -432,19 +432,19 @@ export default {
}); });
}, },
// 查看报警 // 查看报警
handleDetail(row, mode = 'detail') { // handleDetail(row, mode = 'detail') {
const { equipmentId, equipmentName, groupCode, groupId, groupName, id } = // const { equipmentId, equipmentName, groupCode, groupId, groupName, id } =
row; // row;
// 打开抽屉 // // 打开抽屉
this.editMode = mode; // this.editMode = mode;
this.alarmForm.id = groupId; // this.alarmForm.id = groupId;
this.alarmForm.equipmentGroupCode = groupCode; // this.alarmForm.equipmentGroupCode = groupCode;
this.alarmForm.equipmentGroupName = groupName; // this.alarmForm.equipmentGroupName = groupName;
this.editVisible = true; // this.editVisible = true;
this.$nextTick(() => { // this.$nextTick(() => {
this.$refs['drawer'].init(); // this.$refs['drawer'].init();
}); // });
}, // },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const id = row.id; const id = row.id;

View File

@@ -1,8 +1,8 @@
<!-- <!--
filename: CollectionConfig.vue filename: CollectionConfig.vue
author: liubin author: liubin
date: 2023-10-30 10:09:03 date: 2023-10-30 10:09:03
description: description:
--> -->
<template> <template>
@@ -198,8 +198,8 @@ export default {
}, },
{ {
type: 'select', type: 'select',
label: '关联表编码', label: '标识名称',
placeholder: '请选择关联表编码', placeholder: '请选择标识名称',
param: 'plcId', param: 'plcId',
selectOptions: [], selectOptions: [],
filterable: true, filterable: true,

View File

@@ -1,160 +1,100 @@
<!-- <!--
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zhp * @LastEditors: zwq
* @LastEditTime: 2024-07-31 09:48:36 * @LastEditTime: 2024-11-18 09:51:03
* @Description: * @Description:
--> -->
<template> <template>
<el-drawer <el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="true" :before-close="beforeClose"
:visible.sync="visible" class="drawer" size="60%">
:show-close="false" <small-title slot="title" :no-padding="true">
:wrapper-closable="true" {{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
:before-close="beforeClose" </small-title>
class="drawer" <div class="content">
size="60%"> <div class="visual-part">
<small-title slot="title" :no-padding="true"> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }} label-width="100px" label-position="top">
</small-title> <el-row :gutter="20">
<div class="content"> <el-col :span="8">
<div class="visual-part"> <el-form-item label="巡检单名称" prop="name">
<el-form <el-input v-model="dataForm.name" :disabled="isdetail" placeholder="请输入巡检单名称" />
:model="dataForm" </el-form-item>
:rules="dataRule" </el-col>
ref="dataForm" <el-col :span="8">
@keyup.enter.native="dataFormSubmit()" <el-form-item label="部门" prop="departmentId">
label-width="100px" <el-select v-model="dataForm.departmentId" :disabled="isdetail" :placeholder="`请选择部门`"
label-position="top"> style="width: 100%">
<el-row :gutter="20"> <el-option v-for="opt in departmentOptions" :key="opt.id" :label="opt.name" :value="opt.id" />
<el-col :span="8"> </el-select>
<el-form-item label="巡检单名称" prop="name"> </el-form-item>
<el-input v-model="dataForm.name" :disabled="isdetail" placeholder="请输入巡检单名称" /> </el-col>
</el-form-item> <el-col :span="8">
</el-col> <el-form-item label="班次" prop="groupClass">
<el-col :span="8"> <el-select v-model="dataForm.groupClass" filterable clearable multiple :disabled="isdetail"
<el-form-item label="部门" prop="departmentId"> style="width: 100%" placeholder="请选择班次">
<el-select <el-option v-for="d in groupOptions" :key="d.id" :label="d.label" :value="d.label" />
v-model="dataForm.departmentId" </el-select>
:disabled="isdetail" </el-form-item>
:placeholder="`请选择部门`" </el-col>
style="width: 100%"> </el-row>
<el-option <el-row :gutter="20">
v-for="opt in departmentOptions" <el-col :span="8">
:key="opt.id" <el-form-item label="巡检人" prop="checkPerson">
:label="opt.name" <!-- <el-input v-model="dataForm.checkPerson" :disabled="isdetail" placeholder="请输入巡检人" /> -->
: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="actualCheckTime">
<el-date-picker
v-model="dataForm.actualCheckTime"
type="datetime"
:disabled="isdetail"
placeholder="请选择实际巡检时间"
value-format="timestamp"
style="width: 100%" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div v-if="idAttrShow"> <el-select v-model="dataForm.checkPerson" :placeholder="`请选择巡检人`" multiple clearable
<small-title> :disabled="isdetail" filterable style="width: 100%">
巡检内容 <el-option v-for="opt in inspectorOptions" :key="opt.value" :label="opt.label" :value="opt.label" />
</small-title> </el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="实际巡检时间" prop="actualCheckTime">
<el-date-picker v-model="dataForm.actualCheckTime" type="datetime" :disabled="isdetail"
placeholder="请选择实际巡检时间" value-format="timestamp" style="width: 100%" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div v-if="!isdetail" style="display: flex"> <div v-if="idAttrShow">
<SearchBar <small-title>
:formConfigs="searchBarFormConfig" 巡检内容
ref="attr-search-bar" </small-title>
@headBtnClick="handleSearchBarBtnClick" />
<!-- <div class="action_btn"> -->
<el-button type="text" class="action_btn" @click="addNew()">
<span style="display: inline-block;">
<svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" />
<span class="add">添加内容</span>
</span>
</el-button>
<!-- </div> -->
</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" style="display: flex">
<SearchBar :formConfigs="searchBarFormConfig" ref="attr-search-bar" @headBtnClick="handleSearchBarBtnClick" />
<!-- <div class="action_btn"> -->
<el-button type="text" class="action_btn" @click="addNew()">
<span style="display: inline-block;">
<svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" />
<span class="add">添加内容</span>
</span>
</el-button>
<!-- </div> -->
</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 v-if="!isdetail" class="drawer-body__footer"> </div>
<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 <div v-if="!isdetail" class="drawer-body__footer">
v-if="addOrUpdateVisible" <el-button @click="goback()">取消</el-button>
ref="addOrUpdate" <!-- <el-button :disabled="isdetail" @click="init(dataForm.id)">重置</el-button> -->
:order-id="dataForm.id" <el-button v-if="isshowConfirm" type="primary" @click="confirmIns()">保存</el-button>
@refreshDataList="getList" /> <el-button v-else type="primary" @click="dataFormSubmit()">保存</el-button>
</el-drawer> </div>
<attr-add v-if="addOrUpdateVisible" ref="addOrUpdate" :order-id="dataForm.id" @refreshDataList="getList" />
</el-drawer>
</template> </template>
<script> <script>
@@ -305,15 +245,15 @@ export default {
})) }))
); );
} }
const workerlist = await this.$axios('/base/core-worker/listAll'); // const workerlist = await this.$axios('/base/core-worker/listAll');
if (workerlist.code == 0) { // if (workerlist.code == 0) {
inspectorList = inspectorList.concat( // inspectorList = inspectorList.concat(
workerlist.data.map((item) => ({ // workerlist.data.map((item) => ({
label: item.name, // label: item.name,
value: item.id, // value: item.id,
})) // }))
); // );
} // }
this.inspectorOptions = inspectorList; this.inspectorOptions = inspectorList;
// const res1 = await groupClassesListAll(); // const res1 = await groupClassesListAll();
// this.groupOptions = res1.data || []; // this.groupOptions = res1.data || [];
@@ -453,9 +393,12 @@ export default {
// } // }
this.$axios({ this.$axios({
url: url:
`/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}`, `/base/equipment-check-order/confirm`,
method: 'put', method: 'put',
data: [this.dataForm.id], data: {
ids: [this.dataForm.id],
confirmBy: this.$store.getters.nickname,
},
}).then(res =>{ }).then(res =>{
if (res.code == 0) { if (res.code == 0) {
this.visible = false; this.visible = false;

View File

@@ -42,9 +42,7 @@
import AddOrUpdate from './add-or-updata'; import AddOrUpdate from './add-or-updata';
import moment from 'moment'; import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { import { exportCheckOrderExcel } from '@/api/equipment/base/maintain/record';
exportCheckOrderExcel,
} from '@/api/equipment/base/maintain/record';
import WaitingListTable from './WaitingListTable.vue'; import WaitingListTable from './WaitingListTable.vue';
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'); // const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
@@ -76,16 +74,14 @@ export default {
name: 'Confirm', name: 'Confirm',
components: { components: {
WaitingListTable, WaitingListTable,
AddOrUpdate AddOrUpdate,
}, },
mixins: [basicPageMixin], mixins: [basicPageMixin],
data() { data() {
return { return {
addOrUpdateVisible: false, addOrUpdateVisible: false,
recordDetailVisible: false, recordDetailVisible: false,
searchBarKeys: [ searchBarKeys: ['name'],
'name'
],
tobeConfirmedIdList: [], tobeConfirmedIdList: [],
searchBarFormConfig: [ searchBarFormConfig: [
{ {
@@ -100,46 +96,51 @@ export default {
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, },
{
type: (this.$auth.hasPermiAnd([
'equipment:check-record:create',
'base:core-worker:query',
'base:core-production-line:query',
'base:core-department:query'
]) || this.$auth.hasPermi('equipment:check-record:update') || this.$auth.hasPermi('equipment:check-record:export')) ? 'separate' : '',
},
{
type: this.$auth.hasPermiAnd([
'equipment:check-record:create',
'base:core-worker:query',
'base:core-production-line:query',
'base:core-department:query'
])
? 'button'
: '',
btnName: '新增',
name: 'add',
plain: true,
color: 'success',
},
{ {
type: this.$auth.hasPermi('equipment:check-record:update') type:
this.$auth.hasPermiAnd([
'equipment:check-record:create',
'base:core-worker:query',
'base:core-production-line:query',
'base:core-department:query',
]) ||
this.$auth.hasPermi('equipment:check-record:update') ||
this.$auth.hasPermi('equipment:check-record:export')
? 'separate'
: '',
},
{
type: this.$auth.hasPermiAnd([
'equipment:check-record:create',
'base:core-worker:query',
'base:core-production-line:query',
'base:core-department:query',
])
? 'button'
: '',
btnName: '新增',
name: 'add',
plain: true,
color: 'success',
},
{
type: this.$auth.hasPermi('equipment:check-record:update')
? 'button' ? 'button'
: '', : '',
btnName: '巡检人批量确认', btnName: '巡检人批量确认',
name: 'batchConfirm', name: 'batchConfirm',
color: 'primary', color: 'primary',
plain: true, plain: true,
}, },
{ {
type: this.$auth.hasPermi('equipment:check-record:update') type: this.$auth.hasPermi('equipment:check-record:update')
? 'button' ? 'button'
: '', : '',
btnName: '确认人批量确认', btnName: '确认人批量确认',
name: 'batchConfirm2', name: 'batchConfirm2',
color: 'primary', color: 'primary',
plain: true, plain: true,
}, },
// { // {
// type: this.$auth.hasPermi('equipment:check-record:export') // type: this.$auth.hasPermi('equipment:check-record:export')
// ? 'button' // ? 'button'
@@ -167,7 +168,8 @@ export default {
pageSize: 20, pageSize: 20,
maintainPlanId: null, maintainPlanId: null,
startTime: null, startTime: null,
special: false, special: false,
name:undefined,
status: 1, status: 1,
}, },
// 表单参数 // 表单参数
@@ -194,7 +196,9 @@ export default {
}, },
methods: { methods: {
/** 批量确认 */ /** 批量确认 */
async searchBarClicked(btn) { async handleSearchBarBtnClick(btn) {
console.log(btn);
switch (btn.btnName) { switch (btn.btnName) {
case 'batchConfirm': case 'batchConfirm':
if (this.$refs['waiting-list-table'].selectedPlan.length == 0) { if (this.$refs['waiting-list-table'].selectedPlan.length == 0) {
@@ -211,11 +215,45 @@ export default {
// } // }
return this.$axios({ 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}` + checkPersonParam,
url: `/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}`, url: `/base/equipment-check-order/confirm`,
method: 'put', method: 'put',
data: this.$refs['waiting-list-table'].selectedPlan.map( data: {
(item) => item.id ids: this.$refs['waiting-list-table'].selectedPlan.map(
), (item) => item.id
),
confirmBy: this.$store.getters.nickname,
},
});
})
.then((res) => {
this.getList();
res.code == 0 && this.$modal.msgSuccess('确认成功');
res.code != 0 && this.$modal.msgError('确认失败');
})
.catch(() => {});
case 'batchConfirm2':
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/confirm2`,
method: 'put',
data: {
ids: this.$refs['waiting-list-table'].selectedPlan.map(
(item) => item.id
),
confirmBy: this.$store.getters.nickname,
},
}); });
}) })
.then((res) => { .then((res) => {
@@ -224,34 +262,17 @@ export default {
res.code != 0 && this.$modal.msgError('确认失败'); res.code != 0 && this.$modal.msgError('确认失败');
}) })
.catch(() => { }); .catch(() => { });
case 'batchConfirm2': break;
if (this.$refs['waiting-list-table'].selectedPlan.length == 0) { case 'search':
this.$message.warning('请选择待确认的设备巡检单'); console.log(btn);
return; this.queryParams.name = btn.name || null;
} this.getList()
this.$modal break;
.confirm('是否确认所有选中巡检单"?') case 'add':
.then(() => { this.addOrUpdateVisible = true;
// let checkPersonParam = ''; this.$nextTick(() => {
// if (!row.checkPerson || row.checkPerson.trim() == '') { this.$refs.addOrUpdate.init();
// /** 如有必要,更新巡检人 */ });
// 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/confirm2?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; break;
} }
}, },
@@ -311,7 +332,7 @@ export default {
}, },
handleSearchBarChange({ param, value }) { handleSearchBarChange({ param, value }) {
console.log('122', param) console.log('122', param);
// if ('specialType' === param) { // if ('specialType' === param) {
// if (!value) { // if (!value) {
// this.setSearchBarEquipmentList(this.allSpecialEquipments); // this.setSearchBarEquipmentList(this.allSpecialEquipments);
@@ -327,7 +348,7 @@ export default {
this.loading = true; this.loading = true;
// 执行查询 // 执行查询
this.recv({ this.recv({
...this.queryParams ...this.queryParams,
}).then((response) => { }).then((response) => {
this.list = response.data.list; this.list = response.data.list;
this.total = response.data.total; this.total = response.data.total;
@@ -376,18 +397,18 @@ export default {
// this.title = '添加待确认保养记录'; // this.title = '添加待确认保养记录';
// this.addOrEditTitle = '新增'; // this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true; this.addOrUpdateVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(); this.$refs.addOrUpdate.init();
}); });
}, },
// 新增 / 修改 // 新增 / 修改
// addOrUpdateHandle(id) { // addOrUpdateHandle(id) {
// this.addOrUpdateVisible = true; // this.addOrUpdateVisible = true;
// this.$nextTick(() => { // this.$nextTick(() => {
// this.$refs.addOrUpdate.init(id); // this.$refs.addOrUpdate.init(id);
// }); // });
// }, // },
getConfirmed() { getConfirmed() {
return this.$confirm('是否直接确认巡检记录', '提示', { return this.$confirm('是否直接确认巡检记录', '提示', {
@@ -462,10 +483,12 @@ export default {
// checkPersonParam = `&checkPerson=${row.checkPerson}` // checkPersonParam = `&checkPerson=${row.checkPerson}`
// } // }
return this.$axios({ return this.$axios({
url: url: `/base/equipment-check-order/confirm`,
`/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}`,
method: 'put', method: 'put',
data: [row.id], data: {
ids: [row.id],
confirmBy: this.$store.getters.nickname,
},
}); });
}) })
.then((res) => { .then((res) => {
@@ -478,9 +501,9 @@ export default {
/** 编辑 */ /** 编辑 */
async handleEdit(row) { async handleEdit(row) {
this.addOrUpdateVisible = true; this.addOrUpdateVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(row.id); this.$refs.addOrUpdate.init(row.id);
}); });
// this.reset(); // this.reset();
// if (row.relatePlan == 1) { // if (row.relatePlan == 1) {
// // 计划型 // // 计划型
@@ -501,9 +524,7 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
this.$modal this.$modal
.confirm( .confirm('是否确认删除巡检单名称为"' + row.name + '"的数据项?')
'是否确认删除巡检单名称为"' + row.name + '"的数据项?'
)
.then(() => { .then(() => {
return this.$axios({ return this.$axios({
url: '/base/equipment-check-order/delete?id=' + row.id, url: '/base/equipment-check-order/delete?id=' + row.id,
@@ -518,9 +539,9 @@ export default {
}, },
handleDetail(row) { handleDetail(row) {
this.addOrUpdateVisible = true; this.addOrUpdateVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(row.id, true); this.$refs.addOrUpdate.init(row.id, true);
}); });
// this.recordDetailVisible = true; // this.recordDetailVisible = true;
// this.$nextTick(() => { // this.$nextTick(() => {
// this.$refs.recordDetailDrawer.show({ // this.$refs.recordDetailDrawer.show({

View File

@@ -6,84 +6,60 @@
* @Description: * @Description:
--> -->
<template> <template>
<el-drawer <el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="true" class="drawer" size="50%">
:visible.sync="visible" <small-title slot="title" :no-padding="true">
:show-close="false" <!-- {{ isdetail ? '详情' : '添加巡检' }} -->
:wrapper-closable="true" {{ '添加内容' }}
class="drawer" </small-title>
size="50%"> <div class="content">
<small-title slot="title" :no-padding="true"> <div class="visual-part">
<!-- {{ isdetail ? '详情' : '添加巡检' }} -->
{{ '添加内容' }}
</small-title>
<div class="content">
<div class="visual-part">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8"> <el-col :span="8">
<div class="blodTip">巡检单名称</div> <div class="blodTip">巡检单名称</div>
<div class="lightTip">{{ dataForm.name }}</div> <div class="lightTip">{{ dataForm.name }}</div>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<div class="blodTip">部门</div> <div class="blodTip">部门</div>
<div class="lightTip">{{ dataForm.department }}</div> <div class="lightTip">{{ dataForm.department }}</div>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<div class="blodTip">巡检时间</div> <div class="blodTip">计划巡检时间</div>
<div class="lightTip">{{ parseTime(dataForm.planCheckTime) }}</div> <div class="lightTip">{{ parseTime(dataForm.planCheckTime) }}</div>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<el-divider /> <el-divider />
<div class="attr-list"> <div class="attr-list">
<small-title <small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
style="margin: 16px 0; padding-left: 8px" 巡检内容
:no-padding="true"> </small-title>
巡检内容
</small-title>
<div v-if="!isdetail" class="action_btn"> <div v-if="!isdetail" class="action_btn">
<template> <template>
<span style="display: inline-block;"> <span style="display: inline-block;">
<el-button type="text" @click="addNew()" icon="el-icon-plus">添加</el-button> <el-button type="text" @click="addNew()" icon="el-icon-plus">添加</el-button>
</span> </span>
</template> </template>
</div> </div>
<base-table <base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
:table-props="tableProps" :table-data="checkDetList">
:page="listQuery.pageNo" <method-btn v-if="!isdetail" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
:limit="listQuery.pageSize" @clickBtn="handleClick" />
:table-data="checkDetList"> </base-table>
<method-btn <pagination v-show="listQuery.total > 0" :total="listQuery.total" :page.sync="listQuery.pageNo"
v-if="!isdetail" :limit.sync="listQuery.pageSize" :page-sizes="[5, 10, 15]" @pagination="getList" />
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
v-show="listQuery.total > 0"
:total="listQuery.total"
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:page-sizes="[5, 10, 15]"
@pagination="getList" />
<!-- <div class="drawer-body__footer"> <!-- <div class="drawer-body__footer">
<el-button type="primary" @click="goback()">关闭</el-button> <el-button type="primary" @click="goback()">关闭</el-button>
</div> --> </div> -->
</div> </div>
</div> </div>
<attr-add <attr-add v-if="addOrUpdateVisible" ref="addOrUpdate" :order-id="dataForm.id" @refreshDataList="getList" />
v-if="addOrUpdateVisible" </el-drawer>
ref="addOrUpdate"
:order-id="dataForm.id"
@refreshDataList="getList" />
</el-drawer>
</template> </template>
<script> <script>
@@ -111,8 +87,13 @@ const tableProps = [
}, },
{ {
prop: 'program', prop: 'program',
label: '检项目', label: '检项目',
} },
{
prop: 'checkResult',
label: '巡检结果',
},
]; ];
export default { export default {

View File

@@ -201,7 +201,7 @@ export default {
this.groupOptions = this.groupOptions =
res1.data.map((item) => { res1.data.map((item) => {
item.label = item.label =
item.name + ' - ' + getDictDataLabel('workshop', item.roomNameDict); item.name + (getDictDataLabel('workshop', item.roomNameDict) ? ' - ' + getDictDataLabel('workshop', item.roomNameDict) : '')
return item; return item;
}) || []; }) || [];
// const res = await getEquipmentAll() // const res = await getEquipmentAll()

View File

@@ -17,7 +17,7 @@
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="默认巡检结果" prop="resultType"> <el-form-item label="默认巡检结果" prop="resultType">
<el-select v-model="dataForm.resultType" placeholder="请选择默认保养结果"> <el-select v-model="dataForm.resultType" placeholder="请选择默认保养结果" @change="handleClear">
<el-option v-for="dict in resultList" :key="dict.id" :label="dict.name" :value="dict.id" /> <el-option v-for="dict in resultList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -38,13 +38,16 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row v-else-if="dataForm.resultType === 2" :gutter="24"> <el-row v-else-if="dataForm.resultType === 2" :gutter="24">
<el-col :span="12"> <el-col :span="11">
<el-form-item prop="minValue"> <el-form-item prop="minValue">
<el-input oninput="value=value.replace(/[^\-\d.]/g, '')" v-model="dataForm.minValue" placeholder="请输入最小值" /> <el-input oninput="value=value.replace(/[^\-\d.]/g, '')" v-model="dataForm.minValue" placeholder="请输入最小值" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="4">
<el-form-item prop="maxValue">
</el-col>
<el-col :span="9">
<el-form-item prop="maxValue" label-width="20">
<el-input @change="handleChange" oninput="value=value.replace(/[^\-\d.]/g, '')" v-model="dataForm.maxValue" <el-input @change="handleChange" oninput="value=value.replace(/[^\-\d.]/g, '')" v-model="dataForm.maxValue"
placeholder="请输入最大值" /> placeholder="请输入最大值" />
</el-form-item> </el-form-item>
@@ -113,7 +116,12 @@ export default {
this.getDict() this.getDict()
console.log('我看看', this.dataForm) console.log('我看看', this.dataForm)
}, },
methods: { methods: {
handleClear() {
this.dataForm.minValue = undefined
this.dataForm.maxValue = undefined
this.dataForm.maintainResult = undefined
},
async getDict() { async getDict() {
// 物料列表 // 物料列表
const res = await getList(); const res = await getList();

View File

@@ -29,9 +29,9 @@ export default {
}, },
created() { created() {
}, },
mounted() { // mounted() {
this.getDataList() // this.getDataList()
}, // },
methods: { methods: {
// 获取数据列表 // 获取数据列表
getDataList() { getDataList() {

View File

@@ -28,7 +28,6 @@ import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { deleteProgramTypeData } from '@/api/equipment/base/maintain/items' import { deleteProgramTypeData } from '@/api/equipment/base/maintain/items'
import showDetail from './showDetail.vue' import showDetail from './showDetail.vue'
import { publicFormatter } from '@/utils/dict';
export default { export default {
name: 'PlanConfig', name: 'PlanConfig',
@@ -40,7 +39,7 @@ export default {
const t = new Date(); const t = new Date();
const [y, m, d] = [t.getFullYear(), t.getMonth(), t.getDate()]; const [y, m, d] = [t.getFullYear(), t.getMonth(), t.getDate()];
return { return {
searchBarKeys: ['equipmentName', 'createTime'], searchBarKeys: ['equipmentTypeId'],
equipmentTypeList:[], equipmentTypeList:[],
tableBtn: [ tableBtn: [
{ {
@@ -125,7 +124,7 @@ export default {
created() { created() {
this.initSearchBar() this.initSearchBar()
this.getList(); this.getList();
}, },
methods: { methods: {
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
@@ -231,13 +230,14 @@ export default {
return; return;
} }
// 添加的提交 // 添加的提交
this.post(this.form).then((response) => { this.post(this.form).then((res) => {
console.log('res', res)
this.$modal.msgSuccess('新增成功'); this.$modal.msgSuccess('新增成功');
this.open = false; this.open = false;
this.getList() this.getList()
this.showDetailVisible = true this.showDetailVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.showDetail.init(this.form.equipmentTypeId) this.$refs.showDetail.init(res.data)
}) })
}); });
}); });

View File

@@ -36,7 +36,7 @@ const tableProps = [
align:'center', align:'center',
}, },
{ {
prop: 'maintainResult', prop: 'checkResult',
label: '默认巡检结果', label: '默认巡检结果',
align: 'center', align: 'center',
}, },
@@ -100,9 +100,11 @@ export default {
// console.log(this.tableData) // console.log(this.tableData)
}, },
getDataList(id) { getDataList(id) {
console.log(id)
this.dataListLoading = true; this.dataListLoading = true;
this.queryParams.equipmentTypeId = id this.queryParams.equipmentTypeId = id
this.urlOptions.getDataListURL(this.listQuery).then(response => { console.log(this.queryParams.equipmentTypeId)
this.urlOptions.getDataListURL(this.queryParams).then(response => {
this.tableData = response.data.list; this.tableData = response.data.list;
this.listQuery.total = response.data.total; this.listQuery.total = response.data.total;
this.dataListLoading = false this.dataListLoading = false

View File

@@ -6,55 +6,32 @@
--> -->
<template> <template>
<el-form <el-form ref="form" :model="form" :size="size" :label-position="labelPosition" v-loading="formLoading">
ref="form" <el-row :gutter="20">
:model="form" <el-col :span="12">
:size="size" <el-form-item label="设备保养单号" prop="maintainOrderNumber" :rules="[
: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' }, { required: true, message: '请输入设备保养单号', trigger: 'blur' },
]"> ]">
<el-input <el-input v-model="form.maintainOrderNumber" @change="$emit('update', form)" :placeholder="`请输入保养计划单号`"
v-model="form.maintainOrderNumber" :disabled="disabled" />
@change="$emit('update', form)" </el-form-item>
:placeholder="`请输入保养计划单号`" </el-col>
:disabled="disabled" />
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="保养计划名称" prop="name"> <el-form-item label="保养计划名称" prop="name">
<el-input value="---" disabled /> <el-input value="---" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item label="部门" prop="departmentId" :rules="[{ required: true, message: '请选择部门', trigger: 'blur' }]">
label="部门" <el-select v-model="form.departmentId" :placeholder="`请选择部门`" :disabled="disabled" clearable filterable
prop="departmentId" @change="$emit('update', form)">
:rules="[{ required: true, message: '请选择部门', trigger: 'blur' }]"> <el-option v-for="opt in departmentOptions" :key="opt.value" :label="opt.label" :value="opt.value" />
<el-select </el-select>
v-model="form.departmentId" </el-form-item>
: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 <!-- <el-form-item
label="设备大类" label="设备大类"
prop="equipmentCategory" prop="equipmentCategory"
:rules="[ :rules="[
@@ -72,89 +49,59 @@
:value="opt.value" /> :value="opt.value" />
</el-select> </el-select>
</el-form-item> --> </el-form-item> -->
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item label="产线" prop="lineId" :rules="[{ required: true, message: '请选择产线', trigger: 'blur' }]">
label="产线" <el-select v-model="form.lineId" :placeholder="`请选择产线`" :disabled="disabled" clearable filterable
prop="lineId" @change="$emit('update', form)">
:rules="[{ required: true, message: '请选择产线', trigger: 'blur' }]"> <el-option v-for="opt in lineOptions" :key="opt.value" :label="opt.label" :value="opt.value" />
<el-select </el-select>
v-model="form.lineId" </el-form-item>
:placeholder="`请选择产线`" </el-col>
: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-col :span="12">
<el-form-item label="计划保养人员" prop="maintainer"> <el-form-item label="计划保养人员" prop="maintainer">
<el-input value="---" disabled /> <el-input value="---" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="计划开始时间" prop="planStartTime"> <el-form-item label="计划开始时间" prop="planStartTime">
<el-input value="---" disabled /> <el-input value="---" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="计划结束时间" prop="planEndTime"> <el-form-item label="计划结束时间" prop="planEndTime">
<el-input value="---" disabled /> <el-input value="---" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item label="实际开始时间" prop="startTime" :rules="[
label="实际开始时间"
prop="startTime"
:rules="[
{ required: true, message: '请选择实际开始时间', trigger: 'blur' }, { required: true, message: '请选择实际开始时间', trigger: 'blur' },
]"> ]">
<el-date-picker <el-date-picker v-model="form.startTime" type="datetime" :disabled="edit" placeholder="请选择实际开始时间"
v-model="form.startTime" @change="$emit('update', form)" value-format="timestamp"></el-date-picker>
type="datetime" </el-form-item>
:disabled="edit" </el-col>
placeholder="请选择实际开始时间"
@change="$emit('update', form)"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item label="实际结束时间" prop="endTime" :rules="[
label="实际结束时间"
prop="endTime"
:rules="[
{ required: true, message: '请选择实际结束时间', trigger: 'blur' }, { required: true, message: '请选择实际结束时间', trigger: 'blur' },
]"> ]">
<el-date-picker <el-date-picker v-model="form.endTime" type="datetime" :disabled="edit" placeholder="请选择实际结束时间"
v-model="form.endTime" @change="$emit('update', form)" value-format="timestamp"></el-date-picker>
type="datetime" </el-form-item>
:disabled="edit" </el-col>
placeholder="请选择实际结束时间"
@change="$emit('update', form)"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item label="实际保养人员" prop="maintainWorker" :rules="[
label="实际保养人员" { required: false, message: '请输入实际保养人员', trigger: 'blur' },
prop="maintainWorker"
:rules="[
{ required: false, message: '请选择实际保养人员', trigger: 'blur' },
]"> ]">
<el-select <el-input v-model="form.maintainWorker" @change="$emit('update', form)" :placeholder="`请输入实际保养人员`" :disabled="disabled" />
<!-- <el-select
v-model="form.maintainWorker" v-model="form.maintainWorker"
:placeholder="`请选择实际保养人员`" :placeholder="`请选择实际保养人员`"
:disabled="disabled" :disabled="disabled"
@@ -167,21 +114,17 @@
:key="opt.value" :key="opt.value"
:label="opt.label" :label="opt.label"
:value="opt.value" /> :value="opt.value" />
</el-select> </el-select> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input <el-input v-model="form.remark" @change="$emit('update', form)" :placeholder="`请输入备注`" :disabled="disabled" />
v-model="form.remark" </el-form-item>
@change="$emit('update', form)" </el-col>
:placeholder="`请输入备注`" </el-row>
:disabled="disabled" /> </el-form>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template> </template>
<script> <script>
@@ -321,7 +264,6 @@ export default {
const urls = [ const urls = [
'/base/core-production-line/listAll', '/base/core-production-line/listAll',
'/system/dept/list-all-simple', '/system/dept/list-all-simple',
'/base/core-worker/listAll',
]; ];
let res; let res;
switch (source) { switch (source) {
@@ -329,10 +271,6 @@ export default {
res = await this.$axios(urls[1]); res = await this.$axios(urls[1]);
this.departmentList = res.data || []; this.departmentList = res.data || [];
break; break;
case 'maintainer':
res = await this.$axios(urls[2]);
this.maintainerList = res.data || [];
break;
case 'line': case 'line':
res = await this.$axios(urls[0]); res = await this.$axios(urls[0]);
this.lineList = res.data || []; this.lineList = res.data || [];

View File

@@ -6,177 +6,116 @@
--> -->
<template> <template>
<el-drawer <el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="true" class="drawer"
:visible.sync="visible" custom-class="mes-drawer" size="60%" :before-close="beforeClose" @closed="$emit('destroy')">
:show-close="false" <SmallTitle slot="title">编辑</SmallTitle>
:wrapper-closable="true"
class="drawer"
custom-class="mes-drawer"
size="60%"
:before-close="beforeClose"
@closed="$emit('destroy')">
<SmallTitle slot="title">编辑</SmallTitle>
<div class="drawer-body flex"> <div class="drawer-body flex">
<div class="drawer-body__content"> <div class="drawer-body__content">
<div class="form-part" style="margin-bottom: 32px"> <div class="form-part" style="margin-bottom: 32px">
<!-- <el-skeleton v-if="!showForm" animated /> --> <!-- <el-skeleton v-if="!showForm" animated /> -->
<el-form <el-form class="equipment-info-form" ref="form" :model="form" label-width="200px" label-position="top"
class="equipment-info-form" v-loading="formLoading">
ref="form" <el-row :gutter="20">
:model="form" <el-col :span="8">
label-width="200px" <el-form-item label="保养计划单号" prop="maintainOrderNumber">
label-position="top" <!-- :rules="[
v-loading="formLoading">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="保养计划单号" prop="maintainOrderNumber">
<!-- :rules="[
{ {
required: true, required: true,
message: '请输入保养计划单号', message: '请输入保养计划单号',
trigger: 'blur', trigger: 'blur',
}, },
]" --> ]" -->
<el-input <el-input v-model="form.maintainOrderNumber" disabled :placeholder="`请输入保养计划单号`" />
v-model="form.maintainOrderNumber" </el-form-item>
disabled </el-col>
:placeholder="`请输入保养计划单号`" />
</el-form-item>
</el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="保养计划名称" prop="planName"> <el-form-item label="保养计划名称" prop="planName">
<el-input <el-input v-model="form.planName" placeholder="请输入保养计划名称" disabled />
v-model="form.planName" </el-form-item>
placeholder="请输入保养计划名称" </el-col>
disabled />
</el-form-item>
</el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="部门" prop="departmentId"> <el-form-item label="部门" prop="departmentId">
<!-- :rules="[ <!-- :rules="[
{ required: true, message: '请选择部门', trigger: 'blur' }, { required: true, message: '请选择部门', trigger: 'blur' },
]" --> ]" -->
<el-select <el-select v-model="form.departmentId" :placeholder="`请选择部门`" clearable disabled filterable>
v-model="form.departmentId" <el-option v-for="opt in departmentOptions" :key="opt.value" :label="opt.label"
:placeholder="`请选择部门`" :value="opt.value" />
clearable </el-select>
disabled </el-form-item>
filterable> </el-col>
<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-col :span="8">
<el-form-item label="产线" prop="lineId"> <el-form-item label="产线" prop="lineId">
<!-- :rules="[ <!-- :rules="[
{ required: true, message: '请选择产线', trigger: 'blur' }, { required: true, message: '请选择产线', trigger: 'blur' },
]" --> ]" -->
<el-select <el-select v-model="form.lineId" :placeholder="`请选择产线`" disabled clearable filterable>
v-model="form.lineId" <el-option v-for="opt in lineOptions" :key="opt.value" :label="opt.label" :value="opt.value" />
:placeholder="`请选择产线`" </el-select>
disabled </el-form-item>
clearable </el-col>
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-col :span="8">
<el-form-item label="计划保养人员" prop="maintainer"> <el-form-item label="计划保养人员" prop="maintainer">
<el-select <el-select v-model="form.planMaintainWorker" placeholder="请选择计划保养人员" disabled clearable filterable />
v-model="form.planMaintainWorker" </el-form-item>
placeholder="请选择计划保养人员" </el-col>
disabled
clearable
filterable />
</el-form-item>
</el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="计划开始时间" prop="planStartTime"> <el-form-item label="计划开始时间" prop="planStartTime">
<el-date-picker <el-date-picker v-model="form.planStartTime" type="datetime" disabled placeholder="请选择计划开始时间"
v-model="form.planStartTime" value-format="timestamp"></el-date-picker>
type="datetime" </el-form-item>
disabled </el-col>
placeholder="请选择计划开始时间"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="计划结束时间" prop="planEndTime"> <el-form-item label="计划结束时间" prop="planEndTime">
<el-date-picker <el-date-picker v-model="form.planEndTime" type="datetime" disabled placeholder="请选择计划结束时间"
v-model="form.planEndTime" value-format="timestamp"></el-date-picker>
type="datetime" </el-form-item>
disabled </el-col>
placeholder="请选择计划结束时间"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item <el-form-item label="实际开始时间" prop="startTime" :rules="[
label="实际开始时间"
prop="startTime"
:rules="[
{ {
required: true, required: true,
message: '请选择实际开始时间', message: '请选择实际开始时间',
trigger: 'blur', trigger: 'blur',
}, },
]"> ]">
<el-date-picker <el-date-picker v-model="form.startTime" type="datetime" placeholder="请选择实际开始时间"
v-model="form.startTime" value-format="timestamp"></el-date-picker>
type="datetime" </el-form-item>
placeholder="请选择实际开始时间" </el-col>
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item <el-form-item label="实际结束时间" prop="endTime" :rules="[
label="实际结束时间"
prop="endTime"
:rules="[
{ {
required: true, required: true,
message: '请选择实际结束时间', message: '请选择实际结束时间',
trigger: 'blur', trigger: 'blur',
}, },
]"> ]">
<el-date-picker <el-date-picker v-model="form.endTime" type="datetime" placeholder="请选择实际结束时间"
v-model="form.endTime" value-format="timestamp"></el-date-picker>
type="datetime" </el-form-item>
placeholder="请选择实际结束时间" </el-col>
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item <el-form-item label="实际保养人员" prop="maintainWorker" :rules="[
label="实际保养人员"
prop="maintainWorker"
:rules="[
{ {
required: false, required: false,
message: '请选择实际保养人员', message: '请输入实际保养人员',
trigger: 'blur', trigger: 'blur',
}, },
]"> ]">
<el-select <el-input v-model="form.maintainWorker" :placeholder="`请输入实际保养人员`" />
<!-- <el-select
v-model="form.maintainWorker" v-model="form.maintainWorker"
:placeholder="`请选择实际保养人员`" :placeholder="`请选择实际保养人员`"
multiple multiple
@@ -187,89 +126,62 @@
:key="opt.value" :key="opt.value"
:label="opt.label" :label="opt.label"
:value="opt.value" /> :value="opt.value" />
</el-select> </el-select> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" :placeholder="`请输入备注`" /> <el-input v-model="form.remark" :placeholder="`请输入备注`" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
</div> </div>
<SmallTitle>保养内容</SmallTitle> <SmallTitle>保养内容</SmallTitle>
<div style="margin-top: 12px; position: relative"> <div style="margin-top: 12px; position: relative">
<SearchBar <SearchBar :formConfigs="searchBarFormConfig" ref="attr-search-bar" @headBtnClick="handleSearchBarBtnClick" />
:formConfigs="searchBarFormConfig" </div>
ref="attr-search-bar"
@headBtnClick="handleSearchBarBtnClick" />
</div>
<div style="margin-top: 12px; position: relative"> <div style="margin-top: 12px; position: relative">
<div style="position: absolute; top: -40px; right: 0"> <div style="position: absolute; top: -40px; right: 0">
<el-button @click="handleAddAttr" type="text"> <el-button @click="handleAddAttr" type="text">
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
添加属性 添加属性
</el-button> </el-button>
</div> </div>
<base-table <base-table v-loading="attrListLoading" :table-props="attrTableProps" :page="attrQuery?.params.pageNo || 1"
v-loading="attrListLoading" :limit="attrQuery?.params.pageSize || 10" :table-data="attrList" @emitFun="handleEmitFun">
:table-props="attrTableProps" <method-btn slot="handleBtn" label="操作" :method-list="tableBtn" @clickBtn="handleTableBtnClick" />
:page="attrQuery?.params.pageNo || 1" </base-table>
:limit="attrQuery?.params.pageSize || 10"
:table-data="attrList"
@emitFun="handleEmitFun">
<method-btn
slot="handleBtn"
label="操作"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
<!-- 分页组件 --> <!-- 分页组件 -->
<pagination <pagination v-show="attrTotal > 0" :total="attrTotal" :page.sync="attrQuery.params.pageNo"
v-show="attrTotal > 0" :limit.sync="attrQuery.params.pageSize" @pagination="getAttrList" />
:total="attrTotal" </div>
:page.sync="attrQuery.params.pageNo" </div>
:limit.sync="attrQuery.params.pageSize"
@pagination="getAttrList" />
</div>
</div>
<div class="drawer-body__footer"> <div class="drawer-body__footer">
<el-button style="" @click="handleCancel">取消</el-button> <el-button style="" @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleConfirm">保存</el-button> <el-button type="primary" @click="handleConfirm">保存</el-button>
<!-- sections的第二项必须是 属性列表 --> <!-- sections的第二项必须是 属性列表 -->
<!-- <el-button <!-- <el-button
v-if="sections[1].allowAdd" v-if="sections[1].allowAdd"
type="primary" type="primary"
@click="handleAddAttr"> @click="handleAddAttr">
添加属性 添加属性
</el-button> --> </el-button> -->
</div> </div>
</div> </div>
<!-- 属性对话框 --> <!-- 属性对话框 -->
<base-dialog <base-dialog :dialogTitle="attrTitle" :dialogVisible="attrFormVisible" width="35%" :append-to-body="true"
:dialogTitle="attrTitle" custom-class="baseDialog" @close="closeAttrForm" @cancel="closeAttrForm" @confirm="submitAttrForm">
:dialogVisible="attrFormVisible" <DialogForm v-if="attrFormVisible" ref="attrForm" v-model="attrForm" :rows="attrRows" />
width="35%" </base-dialog>
:append-to-body="true" </el-drawer>
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> </template>
<script> <script>
@@ -541,7 +453,7 @@ export default {
const urls = [ const urls = [
'/base/core-production-line/listAll', '/base/core-production-line/listAll',
'system/dept/list-all-simple', 'system/dept/list-all-simple',
'/base/core-worker/listAll', // '/base/core-worker/listAll',
]; ];
let res; let res;
switch (source) { switch (source) {
@@ -549,10 +461,10 @@ export default {
res = await this.$axios(urls[1]); res = await this.$axios(urls[1]);
this.departmentList = res.data || []; this.departmentList = res.data || [];
break; break;
case 'maintainer': // case 'maintainer':
res = await this.$axios(urls[2]); // res = await this.$axios(urls[2]);
this.maintainerList = res.data || []; // this.maintainerList = res.data || [];
break; // break;
case 'line': case 'line':
res = await this.$axios(urls[0]); res = await this.$axios(urls[0]);
this.lineList = res.data || []; this.lineList = res.data || [];

View File

@@ -105,14 +105,16 @@
<el-form-item label="实际保养人员" prop="maintainWorker" :rules="[ <el-form-item label="实际保养人员" prop="maintainWorker" :rules="[
{ {
required: false, required: false,
message: '请选择实际保养人员', message: '请输入实际保养人员',
trigger: 'blur', trigger: 'blur',
}, },
]"> ]">
<el-select v-model="form.maintainWorker" :placeholder="`请选择实际保养人员`" multiple clearable filterable> <el-input v-model="form.maintainWorker" :placeholder="`请输入实际保养人员`" />
<!-- <el-select v-model="form.maintainWorker" :placeholder="`请选择实际保养人员`" multiple clearable filterable>
<el-option v-for="opt in maintainerOptions" :key="opt.value" :label="opt.label" <el-option v-for="opt in maintainerOptions" :key="opt.value" :label="opt.label"
:value="opt.value" /> :value="opt.value" />
</el-select> </el-select> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
@@ -390,10 +392,12 @@ export default {
console.log('111', confirm) console.log('111', confirm)
this.$axios({ this.$axios({
url: url:
'/base/equipment-maintain-log/confirm?confirmPerson=' + '/base/equipment-maintain-log/confirm',
this.$store.getters.userId,
method: 'put', method: 'put',
data: [this.form.id], data: {
ids: [this.form.id],
confirmBy: this.$store.getters.nickname,
},
}).then(res =>{ }).then(res =>{
if (res.code == 0) { if (res.code == 0) {
this.visible = false; this.visible = false;
@@ -445,7 +449,7 @@ export default {
method: 'put', method: 'put',
data: { data: {
...this.form, ...this.form,
maintainWorker: this.form.maintainWorker.join(','), maintainWorker: this.form.maintainWorker ? this.form.maintainWorker.join(',') :null,
special: false, special: false,
relatePlan: 2 relatePlan: 2
} }
@@ -463,8 +467,8 @@ export default {
url: '/base/equipment-maintain-log/create', url: '/base/equipment-maintain-log/create',
method: 'post', method: 'post',
data: { data: {
...this.form, ...this.form,
maintainWorker: this.form.maintainWorker.join(','), maintainWorker: this.form.maintainWorker ? this.form.maintainWorker.join(',') : null,
special: false, special: false,
relatePlan: 2, relatePlan: 2,
confirmed: false, confirmed: false,
@@ -536,7 +540,7 @@ export default {
const urls = [ const urls = [
'/base/core-production-line/listAll', '/base/core-production-line/listAll',
'/system/dept/list-all-simple', '/system/dept/list-all-simple',
'/base/core-worker/listAll', // '/base/core-worker/listAll',
]; ];
let res; let res;
switch (source) { switch (source) {
@@ -544,10 +548,10 @@ export default {
res = await this.$axios(urls[1]); res = await this.$axios(urls[1]);
this.departmentList = res.data || []; this.departmentList = res.data || [];
break; break;
case 'maintainer': // case 'maintainer':
res = await this.$axios(urls[2]); // res = await this.$axios(urls[2]);
this.maintainerList = res.data || []; // this.maintainerList = res.data || [];
break; // break;
case 'line': case 'line':
res = await this.$axios(urls[0]); res = await this.$axios(urls[0]);
this.lineList = res.data || []; this.lineList = res.data || [];

View File

@@ -287,9 +287,12 @@ export default {
return this.$axios({ return this.$axios({
url: '/base/equipment-maintain-log/confirm', url: '/base/equipment-maintain-log/confirm',
method: 'put', method: 'put',
data: this.$refs['waiting-list-table'].selectedPlan.map( data:{
(item) => item.id ids: this.$refs['waiting-list-table'].selectedPlan.map(
), (item) => item.id
),
confirmBy: this.$store.getters.nickname,
},
}); });
// if (res.code == 0) { // if (res.code == 0) {
// this.$message.success('确认成功'); // this.$message.success('确认成功');
@@ -313,9 +316,12 @@ export default {
return this.$axios({ return this.$axios({
url: '/base/equipment-maintain-log/confirm2', url: '/base/equipment-maintain-log/confirm2',
method: 'put', method: 'put',
data: this.$refs['waiting-list-table'].selectedPlan.map( data: {
(item) => item.id ids: this.$refs['waiting-list-table'].selectedPlan.map(
), (item) => item.id
),
confirmBy: this.$store.getters.nickname,
},
}); });
// if (res.code == 0) { // if (res.code == 0) {
// this.$message.success('确认成功'); // this.$message.success('确认成功');
@@ -547,7 +553,10 @@ export default {
return this.$axios({ return this.$axios({
url: '/base/equipment-maintain-log/confirm', url: '/base/equipment-maintain-log/confirm',
method: 'put', method: 'put',
data: [row.id], data: {
ids: [row.id],
confirmBy: this.$store.getters.nickname,
},
}); });
// if (res.code == 0) { // if (res.code == 0) {
// this.$message.success('确认成功'); // this.$message.success('确认成功');

View File

@@ -37,8 +37,8 @@
</el-form> </el-form>
<div class="blue-title">保养内容</div> <div class="blue-title">保养内容</div>
<base-table v-loading="dataListLoading" :table-props="tableProps" :table-data="tableData"> <base-table v-loading="dataListLoading" :table-props="tableProps" :table-data="tableData">
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn" <!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" /> @clickBtn="handleClick" /> -->
</base-table> </base-table>
</div> </div>
</el-drawer> </el-drawer>
@@ -101,6 +101,7 @@ export default {
addOrUpdateVisible: false, addOrUpdateVisible: false,
addOrEditTitle: '', addOrEditTitle: '',
queryParams: { queryParams: {
logId:null,
pageNo:1, pageNo:1,
pageSize:10, pageSize:10,
planId:null, planId:null,
@@ -124,8 +125,10 @@ export default {
methods: { methods: {
getDataList(id) { getDataList(id) {
this.dataListLoading = true; this.dataListLoading = true;
this.queryParams.planId = id console.log(id);
this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.queryParams.logId = id
this.urlOptions.getDataListURL(this.queryParams).then(response => {
this.tableData = response.data.list; this.tableData = response.data.list;
// this.listQuery.total = response.data.total; // this.listQuery.total = response.data.total;
this.dataListLoading = false this.dataListLoading = false
@@ -147,6 +150,8 @@ export default {
init(obj) { init(obj) {
this.drawer = true this.drawer = true
this.dataForm = obj this.dataForm = obj
console.log(obj.id);
this.getDataList(obj.id) this.getDataList(obj.id)
} }
}, },

View File

@@ -135,7 +135,7 @@ export default {
maintainDuration: undefined, maintainDuration: undefined,
remark: undefined, remark: undefined,
firstMaintenanceTime: undefined, firstMaintenanceTime: undefined,
maintainer: undefined maintainer: null
}, },
menuOptions: [], menuOptions: [],
proLineList: [], proLineList: [],
@@ -175,8 +175,8 @@ export default {
const resline = await getCorePLList(); const resline = await getCorePLList();
this.proLineList = resline.data; this.proLineList = resline.data;
// 保养人员 // 保养人员
const personres = await getWorkerList() // const personres = await getWorkerList()
this.personList = personres.data || [] // this.personList = personres.data || []
}, },
getList() { getList() {
// 获取产品属性列表 // 获取产品属性列表
@@ -259,7 +259,8 @@ export default {
if (this.dataForm.id) { if (this.dataForm.id) {
this.urlOptions.updateURL({ this.urlOptions.updateURL({
...this.dataForm, ...this.dataForm,
maintainer: this.dataForm.maintainer.join(',') maintainer: this.dataForm.maintainer ? this.dataForm.maintainer.join(',') : null,
}).then(response => { }).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.visible = false; this.visible = false;
@@ -270,7 +271,7 @@ export default {
// 添加的提交 // 添加的提交
this.urlOptions.createURL({ this.urlOptions.createURL({
...this.dataForm, ...this.dataForm,
maintainer: this.dataForm.maintainer.join(',') maintainer: this.dataForm.maintainer ? this.dataForm.maintainer.join(',') : null,
}).then(response => { }).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
// this.idAttrShow = true // this.idAttrShow = true

View File

@@ -37,7 +37,7 @@
<script> <script>
import { createPlanDet, updatePlanDet, getPlanDet } from '@/api/equipment/base/maintain/planconfig'; import { createPlanDet, updatePlanDet, getPlanDet } from '@/api/equipment/base/maintain/planconfig';
import { getEquipmentPage } from '@/api/base/equipment' import { getEquipmentPage } from '@/api/base/equipment'
import { getItemPageData } from '@/api/equipment/base/maintain/items'; import { getByEquId } from '@/api/equipment/base/maintain/items';
export default { export default {
props: { props: {
@@ -94,20 +94,14 @@ export default {
}); });
}, },
async handleChange(val) { async handleChange(val) {
console.log(val); // let equipmentTypeId = undefined
let equipmentTypeId = undefined // this.eqList.forEach((ele) => {
this.eqList.forEach((ele) => { // if (ele.id == val) {
if (ele.id == val) { // equipmentTypeId = ele.equipmentTypeId
equipmentTypeId = ele.equipmentTypeId // }
} // })
}) const { code, data } = await getByEquId(val)
const { code, data } = await getItemPageData({ this.programList = data
pageNo: 1,
pageSize: 99,
equipmentTypeId: equipmentTypeId,
})
this.programList = data.list
console.log(data);
}, },
handleDecChange(val) { handleDecChange(val) {
let maintenanceDes = undefined let maintenanceDes = undefined

View File

@@ -17,7 +17,7 @@
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="默认保养结果" prop="resultType"> <el-form-item label="默认保养结果" prop="resultType">
<el-select v-model="dataForm.resultType" placeholder="请选择默认保养结果"> <el-select v-model="dataForm.resultType" placeholder="请选择默认保养结果" @change="handleClear">
<el-option v-for="dict in resultList" :key="dict.id" :label="dict.name" :value="dict.id" /> <el-option v-for="dict in resultList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -39,13 +39,16 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row v-else-if="dataForm.resultType === 2" :gutter="24"> <el-row v-else-if="dataForm.resultType === 2" :gutter="24">
<el-col :span="12"> <el-col :span="11">
<el-form-item prop="minValue"> <el-form-item prop="minValue">
<el-input oninput="value=value.replace(/[^\-\d.]/g, '')" v-model="dataForm.minValue" placeholder="请输入最小值" /> <el-input oninput="value=value.replace(/[^\-\d.]/g, '')" v-model="dataForm.minValue" placeholder="请输入最小值" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="4" style="text-align: center;">
<el-form-item prop="maxValue">
</el-col>
<el-col :span="9">
<el-form-item prop="maxValue" label-width="20">
<el-input @change="handleChange" oninput="value=value.replace(/[^\-\d.]/g, '')" v-model="dataForm.maxValue" <el-input @change="handleChange" oninput="value=value.replace(/[^\-\d.]/g, '')" v-model="dataForm.maxValue"
placeholder="请输入最大值" /> placeholder="请输入最大值" />
</el-form-item> </el-form-item>
@@ -67,6 +70,12 @@ import { getList,} from "@/api/base/qualityScrapType";
export default { export default {
mixins: [basicAdd], mixins: [basicAdd],
props: {
mainId: {
type: String,
},
},
data() { data() {
return { return {
urlOptions: { urlOptions: {
@@ -93,7 +102,7 @@ export default {
id: undefined, id: undefined,
program: undefined, program: undefined,
resultType: undefined, resultType: undefined,
equipmentTypeId: undefined, mainId:this.mainId,
minValue: undefined, minValue: undefined,
maxValue: undefined, maxValue: undefined,
maintainResult:undefined, maintainResult:undefined,
@@ -102,7 +111,9 @@ export default {
dataRule: { dataRule: {
// materialId: [{ required: true, message: "", trigger: "blur" }], // materialId: [{ required: true, message: "", trigger: "blur" }],
program: [{ required: true, message: "保养项目不能为空", trigger: "blur" }], program: [{ required: true, message: "保养项目不能为空", trigger: "blur" }],
maintainResult: [{ required: true, message: "默认保养结果不能为空", trigger: "blur" }], maintainResult: [{ required: true, message: "文本或数值不能为空不能为空", trigger: "blur" }],
resultType: [{ required: true, message: "默认保养结果不能为空", trigger: "blur" }],
minValue: [{ required: true, message: "最小值不能为空", trigger: "blur" }], minValue: [{ required: true, message: "最小值不能为空", trigger: "blur" }],
maxValue: [{ required: true, message: "最大值不能为空", trigger: "blur" }], maxValue: [{ required: true, message: "最大值不能为空", trigger: "blur" }],
@@ -112,9 +123,13 @@ export default {
}, },
mounted() { mounted() {
this.getDict() this.getDict()
console.log('我看看', this.dataForm)
}, },
methods: { methods: {
handleClear() {
this.dataForm.minValue = undefined
this.dataForm.maxValue = undefined
this.dataForm.maintainResult = undefined
},
async getDict() { async getDict() {
// 物料列表 // 物料列表
const res = await getList(); const res = await getList();

View File

@@ -1,8 +1,8 @@
/* /*
* @Author: zwq * @Author: zwq
* @Date: 2022-08-24 11:19:43 * @Date: 2022-08-24 11:19:43
* @LastEditors: zhp * @LastEditors: zwq
* @LastEditTime: 2024-07-19 14:47:02 * @LastEditTime: 2024-12-13 15:50:49
* @Description: * @Description:
*/ */
export default { export default {
@@ -28,10 +28,8 @@ export default {
activated() { activated() {
}, },
methods: { methods: {
init(obj) { init(id) {
console.log(obj); this.dataForm.id = id || "";
this.dataForm.id = obj.id || "";
this.dataForm.equipmentTypeId = obj.equipmentTypeId || "";
this.visible = true; this.visible = true;
if (this.urlOptions.getOption) { if (this.urlOptions.getOption) {
this.getArr() this.getArr()

View File

@@ -1,8 +1,8 @@
/* /*
* @Author: zhp * @Author: zhp
* @Date: 2024-07-19 09:49:22 * @Date: 2024-07-19 09:49:22
* @LastEditTime: 2024-07-22 09:17:31 * @LastEditTime: 2024-12-13 15:52:24
* @LastEditors: zhp * @LastEditors: zwq
* @Description: * @Description:
*/ */
export default { export default {
@@ -88,12 +88,8 @@ export default {
if (val.type === "edit") { if (val.type === "edit") {
this.addOrUpdateVisible = true; this.addOrUpdateVisible = true;
this.addOrEditTitle = "编辑" this.addOrEditTitle = "编辑"
let obj = {
id: val.data.id,
equipmentTypeId:val.data.equipmentTypeId
}
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(obj); this.$refs.addOrUpdate.init(val.data.id);
}); });
} else if (val.type === "delete") { } else if (val.type === "delete") {
this.deleteHandle(val.data.id, val.data.program, val.data._pageIndex) this.deleteHandle(val.data.id, val.data.program, val.data._pageIndex)

View File

@@ -1,8 +1,8 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-07-12 13:28:21 * @Date: 2024-07-12 13:28:21
* @LastEditTime: 2024-07-23 14:00:38 * @LastEditTime: 2024-12-13 16:03:29
* @LastEditors: zhp * @LastEditors: zwq
* @Description: * @Description:
--> -->
<template> <template>
@@ -22,7 +22,7 @@
</el-drawer> </el-drawer>
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="addOrUpdateVisible" @cancel="handleCancel" <base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="addOrUpdateVisible" @cancel="handleCancel"
@confirm="handleConfirm" :before-close="handleCancel" width="30%"> @confirm="handleConfirm" :before-close="handleCancel" width="30%">
<add-or-update ref="addOrUpdate" @refreshDataList="successSubmit"></add-or-update> <add-or-update ref="addOrUpdate" @refreshDataList="successSubmit" :main-id="queryParams.mainId"></add-or-update>
</base-dialog> </base-dialog>
</div> </div>
@@ -74,7 +74,7 @@ export default {
queryParams: { queryParams: {
pageNo:1, pageNo:1,
pageSize:10, pageSize:10,
equipmentTypeId:null, mainId:null,
}, },
tableProps, tableProps,
basePath: 'base/equipment-maintain-program', basePath: 'base/equipment-maintain-program',
@@ -103,28 +103,34 @@ export default {
this.tableData[val._pageIndex - 1][val.prop] = val[val.prop] this.tableData[val._pageIndex - 1][val.prop] = val[val.prop]
// console.log(this.tableData) // console.log(this.tableData)
}, },
getDataList(id) { handleCancel() {
this.$refs.addOrUpdate.formClear()
this.addOrUpdateVisible = false
this.addOrEditTitle = ''
},
successSubmit() {
this.handleCancel()
this.getDataList()
},
getDataList() {
this.dataListLoading = true; this.dataListLoading = true;
this.queryParams.equipmentTypeId = id this.urlOptions.getDataListURL(this.queryParams).then(response => {
this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.tableData = response.data.list; this.tableData = response.data.list;
this.listQuery.total = response.data.total; this.queryParams.total = response.data.total;
this.dataListLoading = false this.dataListLoading = false
}); });
}, },
handleAdd() { handleAdd() {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.addOrEditTitle = '新增' this.addOrEditTitle = '新增'
let obj = {
equipmentTypeId: this.queryParams.equipmentTypeId
}
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(obj) this.$refs.addOrUpdate.init()
}); });
}, },
init(id) { init(id) {
this.drawer = true this.drawer = true
this.getDataList(id) this.queryParams.mainId = id || ''
this.getDataList()
} }
}, },
} }

View File

@@ -8,10 +8,7 @@
<template> <template>
<!-- <el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="disabled" class="drawer" <!-- <el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="disabled" class="drawer"
custom-class="mes-drawer" size="50%" @closed="$emit('destroy')"> --> custom-class="mes-drawer" size="50%" @closed="$emit('destroy')"> -->
<el-dialog <el-dialog :visible.sync="visible" width="50%" :before-close="closed">
:visible.sync="visible"
width="50%"
:before-close="closed">
<small-title slot="title" :no-padding="true"> <small-title slot="title" :no-padding="true">
详情 详情
<!-- {{ disabled ? '查看详情' : !dataForm.maintenanceStatus ? '修改' : '完成' }} --> <!-- {{ disabled ? '查看详情' : !dataForm.maintenanceStatus ? '修改' : '完成' }} -->
@@ -20,55 +17,73 @@
<div class="drawer-body__content"> <div class="drawer-body__content">
<div> <div>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="6">
<div class="blodTip">维修单号</div>
<div class="lightTip">{{ dataForm.repairOrderNumber }}</div>
</el-col>
<el-col :span="6">
<div class="blodTip">产线名</div>
<div class="lightTip">{{ dataForm.lineName }}</div>
</el-col>
<el-col :span="6">
<div class="blodTip">工段名</div>
<div class="lightTip">{{ dataForm.sectionName }}</div>
</el-col>
<el-col :span="6"> <el-col :span="6">
<div class="blodTip">故障发生时间</div> <div class="blodTip">故障发生时间</div>
<div class="lightTip">{{ parseTime(dataForm.faultTime) }}</div> <div class="lightTip">{{ parseTime(dataForm.faultTime) }}</div>
</el-col> </el-col>
</el-row>
<el-row :gutter="20">
<!-- <el-col :span="6">
<div class="blodTip">故障发生时间</div>
<div class="lightTip">{{ parseTime(dataForm.faultTime) }}</div>
</el-col> -->
<el-col :span="6"> <el-col :span="6">
<div class="blodTip">设备名</div>
<div class="lightTip">{{ dataForm.equipmentName }}</div>
</el-col>
<el-col :span="6">
<div class="blodTip">维修时长</div>
<div class="lightTip">{{ dataForm.maintenanceDuration }}</div>
</el-col>
<!-- <el-col :span="6">
<div class="blodTip">故障级别</div> <div class="blodTip">故障级别</div>
<div class="lightTip">{{ getDictDataLabel('fault-level', dataForm.faultLevel) }}</div> <div class="lightTip">{{ getDictDataLabel('fault-level', dataForm.faultLevel) }}</div>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<div class="blodTip">故障类型</div> <div class="blodTip">故障类型</div>
<div class="lightTip">{{ getDictDataLabel('fault-type', dataForm.faultType) }}</div> <div class="lightTip">{{ getDictDataLabel('fault-type', dataForm.faultType) }}</div>
</el-col> </el-col> -->
<el-col :span="6"> <el-col :span="6">
<div class="blodTip">维修工</div> <div class="blodTip">维修工</div>
<div class="lightTip">{{ dataForm.repairman }}</div> <div class="lightTip">{{ dataForm.repairman }}</div>
</el-col> </el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="6"> <el-col :span="6">
<div class="blodTip">联系方式</div> <div class="blodTip">联系方式</div>
<div class="lightTip">{{ dataForm.repairmanPhone }}</div> <div class="lightTip">{{ dataForm.repairmanPhone }}</div>
</el-col> </el-col>
<el-col :span="6">
<div class="blodTip">维修方式</div>
<div class="lightTip">{{ getDictDataLabel('repair-mode', dataForm.repairMode) }}</div>
</el-col>
<el-col :span="6">
<div class="blodTip">创建时间</div>
<div class="lightTip">{{ parseTime(dataForm.createTime) }}</div>
</el-col>
<el-col :span="6">
<div class="blodTip">创建人</div>
<div class="lightTip">{{ dataForm.creator }}</div>
</el-col>
</el-row> </el-row>
<el-row> <el-row :gutter="20">
<div class="blodTip">备注</div> <el-col :span="6">
<div class="lightTip">{{ dataForm.remark }}</div> <div class="blodTip">备注</div>
<div class="lightTip">{{ dataForm.remark }}</div>
</el-col>
<el-col :span="6">
<div class="blodTip">故障明细</div>
<div class="lightTip">{{ dataForm.faultDetail.replace(/<\/?p>/g, '') }}</div>
</el-col>
<el-col :span="6">
<div class="blodTip">维修明细</div>
<div class="lightTip">{{ dataForm.maintenanceDetail.replace(/<\/?p>/g, '') }}</div>
</el-col>
</el-row> </el-row>
<el-row> <el-row>
<div class="blodTip">维修附件</div> <div class="blodTip">维修附件</div>
<div v-if="dataForm.files && dataForm.files.length > 0"> <div v-if="dataForm.files && dataForm.files.length > 0">
<uploadedFile <uploadedFile class="file" v-for="file in dataForm.files" :file="file" :key="file.fileUrl"
class="file" :disabled="disabled" @delete="!disabled && handleDeleteFile(file, col.prop)" />
v-for="file in dataForm.files"
:file="file"
:key="file.fileUrl"
:disabled="disabled"
@delete="!disabled && handleDeleteFile(file, col.prop)" />
</div> </div>
<p v-else>暂无附件</p> <p v-else>暂无附件</p>
</el-row> </el-row>
@@ -170,65 +185,65 @@ import { getDictDataLabel } from '@/utils/dict';
import tupleImg from '@/assets/images/tuple.png'; import tupleImg from '@/assets/images/tuple.png';
const uploadedFile = { const uploadedFile = {
name: 'UploadedFile', name: 'UploadedFile',
props: ['file', 'disabled'], props: ['file', 'disabled'],
data() { data() {
return {}; return {};
}, },
methods: { methods: {
handleDelete() { handleDelete() {
this.$emit('delete', this.file); this.$emit('delete', this.file);
}, },
async handleDownload() { async handleDownload() {
const data = await this.$axios({ const data = await this.$axios({
url: this.file.fileUrl, url: this.file.fileUrl,
method: 'get', method: 'get',
responseType: 'blob', responseType: 'blob',
}); });
await this.$message.success('开始下载'); await this.$message.success('开始下载');
// create download link // create download link
const url = window.URL.createObjectURL(data); const url = window.URL.createObjectURL(data);
const link = document.createElement('a'); const link = document.createElement('a');
link.href = url; link.href = url;
link.download = this.file.fileName; link.download = this.file.fileName;
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
document.body.removeChild(link); document.body.removeChild(link);
}, },
}, },
mounted() { mounted() {
}, },
render: function (h) { render: function (h) {
return ( return (
<div <div
title={this.file.fileName} title={this.file.fileName}
onClick={this.handleDownload} onClick={this.handleDownload}
style={{ style={{
background: `url(${tupleImg}) no-repeat`, background: `url(${tupleImg}) no-repeat`,
backgroundSize: '14px', backgroundSize: '14px',
backgroundPosition: '0 55%', backgroundPosition: '0 55%',
paddingLeft: '20px', paddingLeft: '20px',
paddingRight: '24px', paddingRight: '24px',
textOverflow: 'ellipsis', textOverflow: 'ellipsis',
whiteSpace: 'nowrap', whiteSpace: 'nowrap',
overflow: 'hidden', overflow: 'hidden',
cursor: 'pointer', cursor: 'pointer',
display: 'inline-block', display: 'inline-block',
}}> }}>
{this.file.fileName} {this.file.fileName}
{!this.disabled && ( {!this.disabled && (
<el-button <el-button
type="text" type="text"
icon="el-icon-close" icon="el-icon-close"
style="float: right; position: relative; top: 2px; left: 8px; z-index: 100" style="float: right; position: relative; top: 2px; left: 8px; z-index: 100"
class="dialog__upload_component__close" class="dialog__upload_component__close"
onClick={this.handleDelete} onClick={this.handleDelete}
/> />
)} )}
</div> </div>
); );
}, },
}; };
export default { export default {
@@ -392,18 +407,20 @@ export default {
justify-content: flex-end; justify-content: flex-end;
padding: 18px; padding: 18px;
} }
.blodTip { .blodTip {
height: 16px; height: 16px;
font-size: 14px; font-size: 14px;
font-weight: 600; font-weight: 600;
color: rgba(0,0,0,0.85); color: rgba(0, 0, 0, 0.85);
margin-bottom: 8px; margin-bottom: 8px;
} }
.lightTip { .lightTip {
/* height: 16px; */ /* height: 16px; */
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
color: rgba(102,102,102,0.75); color: rgba(102, 102, 102, 0.75);
margin-bottom: 12px; margin-bottom: 12px;
} }
</style> </style>

View File

@@ -63,106 +63,6 @@
value-format="timestamp" format="yyyy-MM-dd HH:mm:ss" clearable @change="$emit('update', form)" /> value-format="timestamp" format="yyyy-MM-dd HH:mm:ss" clearable @change="$emit('update', form)" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- 故障级别 -->
<!-- <el-col :span="8">
<el-form-item
label="故障级别"
prop="faultLevel"
:rules="[
{
required: true,
message: '故障级别不能为空',
trigger: 'blur',
},
]">
<el-select
v-model="form.faultLevel"
placeholder="故障级别"
:disabled="disabled"
@change="$emit('update', form)">
<el-option
v-for="opt in getDictDatas(DICT_TYPE.FAULT_LEVEL)"
: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="faultType"
:rules="[
{
required: true,
message: '故障类型不能为空',
trigger: 'blur',
},
]">
<el-select
v-model="form.faultType"
placeholder="故障类型"
:disabled="disabled"
@change="$emit('update', form)">
<el-option
v-for="opt in getDictDatas(DICT_TYPE.FAULT_TYPE)"
: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="maintenanceStartTime"
:rules="[
{
required: true,
message: '维修开始时间不能为空',
trigger: 'blur',
},
]">
<el-date-picker
v-model="form.maintenanceStartTime"
type="datetime"
:disabled="disabled"
:placeholder="`请选择维修开始时间`"
value-format="timestamp"
format="yyyy-MM-dd HH:mm:ss"
clearable
@change="$emit('update', form)" />
</el-form-item>
</el-col> -->
<!-- 维修结束时间 -->
<!-- <el-col :span="8">
<el-form-item
label="维修结束时间"
prop="maintenanceFinishTime"
:rules="[
{
required: true,
message: '维修结束时间不能为空',
trigger: 'blur',
},
]">
<el-date-picker
v-model="form.maintenanceFinishTime"
type="datetime"
:disabled="disabled"
:placeholder="`请选择维修结束时间`"
value-format="timestamp"
format="yyyy-MM-dd HH:mm:ss"
clearable
@change="$emit('update', form)" />
</el-form-item>
</el-col> -->
<el-col :span="8"> <el-col :span="8">
<el-form-item label="维修时长(h)" prop="maintenanceDuration"> <el-form-item label="维修时长(h)" prop="maintenanceDuration">
<el-input-number v-model="dataForm.maintenanceDuration" :min="0" controls-position="right" style="width: 100%" <el-input-number v-model="dataForm.maintenanceDuration" :min="0" controls-position="right" style="width: 100%"
@@ -433,8 +333,8 @@ export default {
sectionOptions: [], sectionOptions: [],
lineOptions: [], lineOptions: [],
uploadOpen: false, uploadOpen: false,
uploadUrl: process.env.VUE_APP_BASE_API + '/admin-api/infra/file/upload', // 上传有关的headersurl都是固定的 uploadHeaders: { Authorization: 'Bearer ' + getAccessToken() },
uploadHeaders: { Authorization: 'Bearer ' + getAccessToken() }, uploadUrl: process.env.VUE_APP_BASE_API + '/admin-api/infra/file/upload', // 上传有关的headersurl都是固定的
}; };
}, },
watch: { watch: {
@@ -633,17 +533,17 @@ export default {
handleUploadSuccess(response, file, prop) { handleUploadSuccess(response, file, prop) {
console.log('response', response); console.log('response', response);
if (response.code != 0) { // if (response.code != 0) {
this.$modal.msgError('上传失败: ', response.msg || '-'); // this.$modal.msgError('上传失败: ', response.msg || '-');
return; // return;
} // }
this.form.files.push({ this.form.files.push({
fileName: file.name, fileName: file.name,
fileUrl: response.data, fileUrl: response.data,
fileType: prop == 'files' ? 2 : 1, fileType: prop == 'files' ? 2 : 1,
}); });
this.$modal.msgSuccess('上传成功'); this.$modal.msgSuccess('上传成功');
this.$emit('update', this.form); this.$emit('update', this.form);
}, },
handleDeleteFile(file, prop) { handleDeleteFile(file, prop) {

View File

@@ -0,0 +1,53 @@
<!--
* @Author: zhp
* @Date: 2023-11-08 14:00:52
* @LastEditTime: 2023-12-01 10:12:27
* @LastEditors: DY
* @Description:
-->
<template>
<div>
<el-button type="text" @click="handleDetail">查看更多</el-button>
<CustomDialogForm v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getList" />
</div>
</template>
<script>
import CustomDialogForm from './CustomDialogForm.vue';
export default {
name: 'EquipmentRepairDetail',
components: { CustomDialogForm },
props: {
injectData: {
type: Object,
default: () => ({})
}
},
data() {
return {
addOrUpdateVisible:false,
}
},
mounted() {
this.getContent()
},
methods: {
handleDetail() {
// this.reset();
// const id = row.id;
// this.info({ id }).then((response) => {
// this.form = response.data;
// // this.form.repairman = this.form.repairman.split(',')
// this.open = true;
// this.title = '修改维修记录';
// });
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init({ id: this.injectData.id });
});
},
}
}
</script>

View File

@@ -0,0 +1,421 @@
<!--
filename: dialogForm.vue
author: liubin
date: 2023-10-31 15:55:13
description:
-->
<template>
<!-- <el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="disabled" class="drawer"
custom-class="mes-drawer" size="50%" @closed="$emit('destroy')"> -->
<el-dialog :visible.sync="visible" width="50%" :before-close="closed">
<small-title slot="title" :no-padding="true">
详情
<!-- {{ disabled ? '查看详情' : !dataForm.maintenanceStatus ? '修改' : '完成' }} -->
</small-title>
<div class="drawer-body flex">
<div class="drawer-body__content">
<div>
<el-row :gutter="20">
<el-col :span="6">
<div class="blodTip">维修单号</div>
<div class="lightTip">{{ dataForm.repairOrderNumber }}</div>
</el-col>
<el-col :span="6">
<div class="blodTip">产线名</div>
<div class="lightTip">{{ dataForm.lineName }}</div>
</el-col>
<el-col :span="6">
<div class="blodTip">工段名</div>
<div class="lightTip">{{ dataForm.sectionName }}</div>
</el-col>
<!-- <el-col :span="6">
<div class="blodTip">维修工</div>
<div class="lightTip">{{ dataForm.repairman }}</div>
</el-col> -->
</el-row>
<el-row :gutter="20">
<el-col :span="6">
<div class="blodTip">故障发生时间</div>
<div class="lightTip">{{ parseTime(dataForm.faultTime) }}</div>
</el-col>
<el-col :span="6">
<div class="blodTip">故障级别</div>
<div class="lightTip">{{ getDictDataLabel('fault-level', dataForm.faultLevel) }}</div>
</el-col>
<el-col :span="6">
<div class="blodTip">故障类型</div>
<div class="lightTip">{{ getDictDataLabel('fault-type', dataForm.faultType) }}</div>
</el-col>
<el-col :span="6">
<div class="blodTip">维修工</div>
<div class="lightTip">{{ dataForm.repairman }}</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="6">
<div class="blodTip">联系方式</div>
<div class="lightTip">{{ dataForm.repairmanPhone }}</div>
</el-col>
<el-col :span="6">
<div class="blodTip">维修方式</div>
<div class="lightTip">{{ getDictDataLabel('repair-mode', dataForm.repairMode) }}</div>
</el-col>
<el-col :span="6">
<div class="blodTip">创建时间</div>
<div class="lightTip">{{ parseTime(dataForm.createTime) }}</div>
</el-col>
<el-col :span="6">
<div class="blodTip">创建人</div>
<div class="lightTip">{{ dataForm.creator }}</div>
</el-col>
</el-row>
<el-row>
<div class="blodTip">备注</div>
<div class="lightTip">{{ dataForm.remark }}</div>
</el-row>
<el-row>
<div class="blodTip">维修附件</div>
<div v-if="dataForm.files && dataForm.files.length > 0">
<uploadedFile class="file" v-for="file in dataForm.files" :file="file" :key="file.fileUrl"
:disabled="disabled" @delete="!disabled && handleDeleteFile(file, col.prop)" />
</div>
<p v-else>暂无附件</p>
</el-row>
</div>
<!-- <el-divider style="margin-top: -10px" />
<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
{{ '设备维修信息' }}
</small-title> -->
<!-- <el-form ref="form" :model="dataForm" label-width="100px" label-position="top" v-loading="formLoading">
<el-row :gutter="20">
<el-col :span="6">
<el-form-item label="维修开始时间" prop="maintenanceStartTime"
:rules="[{ required: true, message: '维修开始时间不能为空', trigger: 'blur' }]">
<el-date-picker v-model="dataForm.maintenanceStartTime" type="datetime" :disabled="disabled"
placeholder="请选择维修开始时间" value-format="timestamp" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="维修结束时间" prop="maintenanceFinishTime"
:rules="[{ required: true, message: '维修结束时间不能为空', trigger: 'blur' }]">
<el-date-picker v-model="dataForm.maintenanceFinishTime" type="datetime" :disabled="disabled"
placeholder="请选择维修开始时间" value-format="timestamp" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="维修方式" prop="repairMode"
:rules="[{ required: true, message: '维修方式不能为空', trigger: 'blur' }]">
<el-select :disabled="disabled" v-model="dataForm.repairMode" placeholder="请选择维修方式">
<el-option v-for="opt in getDictDatas('repair-mode')" :key="opt.value" :label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="故障类型" prop="faultType">
<el-select :disabled="disabled" v-model="dataForm.faultType" placeholder="请选择故障类型">
<el-option v-for="opt in getDictDatas('fault-type')" :key="opt.value" :label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col>
<el-form-item label="故障明细" prop="faultDetail"
:rules="[{ required: true, message: '故障明细不能为空', trigger: 'blur' }]">
<editor v-model="dataForm.faultDetail" :read-only="disabled" :min-height="150" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col>
<el-form-item label="维修记录" prop="maintenanceDetail">
<editor v-model="dataForm.maintenanceDetail" :read-only="disabled" :min-height="150" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col>
<el-form-item label="维修附件" prop="file">
<FileUpload v-model="file" :limit="1" :f-name="fileName" :disabled="disabled" @name="setFileName" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" :placeholder="`请输入备注`" :disabled="disabled" />
</el-form-item>
</el-col>
</el-row>
</el-form> -->
<!-- <div v-if="!disabled" class="drawer-body__footer">
<el-button style="" @click="goback()">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</div> -->
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button>
</span>
</el-dialog>
<!-- </el-drawer> -->
</template>
<script>
import SmallTitle from '../../base/alarm/Record/SmallTitle.vue';
import { getEqRepair, updateEqRepair } from '@/api/equipment/base/repair'
import Editor from "@/components/Editor";
// import FileUpload from "@/components/FileUpload";
import { getDictDatas } from "@/utils/dict";
import { parseTime } from '@/utils/ruoyi'
import { getDictDataLabel } from '@/utils/dict';
import tupleImg from '@/assets/images/tuple.png';
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: { SmallTitle, Editor, uploadedFile },
props: {
// dataForm: {
// type: Object,
// default: () => ({}),
// },
// disabled: {
// type: Boolean,
// default: false
// },
},
data() {
return {
formLoading: true,
visible: false,
disabled: false,
dataForm: {},
file: '',
fileName: ''
};
},
mounted() { },
methods: {
closed() {
this.$emit('destroy')
},
setFileName(val) {
this.fileName = val
},
goback() {
this.$emit('refreshDataList');
this.visible = false;
},
goEdit() {
this.disabled = false;
},
/** 模拟透传 ref */
validate(cb) {
return this.$refs.form.validate(cb);
},
resetFields(args) {
return this.$refs.form.resetFields(args);
},
initData() {
this.file = ''
this.fileName = ''
},
init(row, isdetail) {
this.initData();
this.disabled = isdetail || false;
this.dataForm.id = row.id || undefined;
this.visible = true;
this.$nextTick(() => {
// this.$refs['form'].resetFields();
if (this.dataForm.id) {
// 获取设备维修
getEqRepair(this.dataForm.id).then(response => {
this.formLoading = false
this.dataForm = response.data;
// this.dataForm.maintenanceStatus = row.maintenanceStatus || 0
// if (this.dataForm.files.length > 0) {
// this.file = this.dataForm.files[0].fileUrl
// this.fileName = this.dataForm.files[0].fileName
// }
});
} else {
// if (this.urlOptions.isGetCode) {
// this.getCode()
// }
}
});
},
// 表单提交
dataFormSubmit() {
this.$refs["form"].validate((valid) => {
if (!valid) {
return false;
}
// 修改的提交
if (this.file) {
const temp = this.file.split(',') // 获取文件个数
let arry = []
temp.forEach(item => {
arry.push({
fileName: this.fileName,
fileType: 2,
fileUrl: item
})
})
this.dataForm.files = arry
}
if (this.dataForm.id) {
updateEqRepair(this.dataForm).then(response => {
this.$modal.msgSuccess("修改成功");
this.visible = false;
this.$emit("refreshDataList");
});
return;
}
// 添加的提交
// this.urlOptions.createURL(this.dataForm).then(response => {
// this.$modal.msgSuccess("新增成功");
// this.visible = false;
// this.$emit("refreshDataList");
// });
});
},
},
};
</script>
<style scoped>
.drawer>>>.el-drawer {
border-radius: 8px 0 0 8px;
}
.drawer>>>.el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
margin-bottom: 0px;
}
.small-title::before {
content: '';
display: inline-block;
vertical-align: top;
width: 4px;
height: 22px;
border-radius: 1px;
margin-right: 8px;
background-color: #0b58ff;
}
.drawer-body {
display: flex;
flex-direction: column;
height: 100%;
}
.drawer-body__content {
flex: 1;
/* background: #eee; */
padding: 5px 10px;
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>

View File

@@ -1,54 +1,26 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<SearchBar <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" />
:formConfigs="searchBarFormConfig"
ref="search-bar"
@headBtnClick="handleSearchBarBtnClick" />
<!-- 列表 --> <!-- 列表 -->
<base-table <base-table :table-props="tableProps" :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-data="list"
:table-props="tableProps" @emitFun="handleEmitFun" :max-height="tableH">
:page="queryParams.pageNo" <method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="90" :method-list="tableBtn"
:limit="queryParams.pageSize" @clickBtn="handleTableBtnClick" />
:table-data="list" </base-table>
@emitFun="handleEmitFun"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:width="90"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
<!-- 分页组件 --> <!-- 分页组件 -->
<pagination <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
v-show="total > 0" @pagination="getList" />
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<base-dialog <base-dialog :dialogTitle="title" :dialogVisible="open" @close="cancel" @cancel="cancel" @confirm="submitForm">
:dialogTitle="title" <DialogForm v-if="open" ref="form" v-model="form" :disabled="mode === 'detail'" />
:dialogVisible="open" </base-dialog>
@close="cancel" <CustomDialogForm v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getList" />
@cancel="cancel" <!-- <detail v-if="detailOrUpdateVisible" ref="detailOrUpdate" @refreshDataList="getList" /> -->
@confirm="submitForm"> </div>
<DialogForm
v-if="open"
ref="form"
v-model="form"
:disabled="mode == 'detail'" />
</base-dialog>
<CustomDialogForm
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getList" />
</div>
</template> </template>
<script> <script>
@@ -57,26 +29,31 @@ import basicPageMixin from '@/mixins/lb/basicPageMixin';
import CustomDialogForm from './CustomDialogForm.vue'; import CustomDialogForm from './CustomDialogForm.vue';
import { deleteRepair, exportRepairLogExcel } from '@/api/equipment/base/repair' import { deleteRepair, exportRepairLogExcel } from '@/api/equipment/base/repair'
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
import detailBtn from './detail-btn.vue'
import htmls from './htmls.vue' import htmls from './htmls.vue'
// import detail from './detail.vue'
import DialogForm from './Repair--add.vue'; import DialogForm from './Repair--add.vue';
import tableHeightMixin from '@/mixins/tableHeightMixin'; import tableHeightMixin from '@/mixins/tableHeightMixin';
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'); // const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
export default { export default {
name: 'EquipmentRepair', name: 'EquipmentRepair',
components: { CustomDialogForm, DialogForm }, components: { CustomDialogForm, DialogForm },
mixins: [basicPageMixin, tableHeightMixin], mixins: [basicPageMixin, tableHeightMixin],
data() { data() {
return { return {
addOrUpdateVisible: false, addOrUpdateVisible: false,
detailOrUpdateVisible:false,
searchBarKeys: ['maintenanceResult', 'createTime', 'equipmentId'], searchBarKeys: ['maintenanceResult', 'createTime', 'equipmentId'],
tableBtn: [ tableBtn: [
this.$auth.hasPermi('equipment:repair:query') // this.$auth.hasPermi('equipment:repair:query')
? { // ? {
type: 'detail', // type: 'detail',
btnName: '详情', // btnName: '详情',
} // }
: undefined, // : undefined,
// this.$auth.hasPermi('equipment:repair:finish') // this.$auth.hasPermi('equipment:repair:finish')
// ? { // ? {
// type: 'finish', // type: 'finish',
@@ -108,31 +85,33 @@ export default {
{ prop: 'lineName', label: '产线名', width: 120, showOverflowtooltip: true }, { prop: 'lineName', label: '产线名', width: 120, showOverflowtooltip: true },
{ prop: 'sectionName', label: '工段名', width: 120, showOverflowtooltip: true }, { prop: 'sectionName', label: '工段名', width: 120, showOverflowtooltip: true },
{ prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true }, { prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true },
{ prop: 'faultDetail', label: '故障明细', subcomponent: htmls, width: 180, showOverflowtooltip: true }, { prop: 'faultDetail', label: '故障明细', subcomponent: htmls, width: 180, showOverflowtooltip: true },
// { prop: 'maintenanceDetail', label: '维修明细', subcomponent: htmls, minWidth: 100, showOverflowtooltip: true }, // { prop: 'maintenanceDetail', label: '维修明细', subcomponent: htmls, minWidth: 100, showOverflowtooltip: true },
{ {
prop: 'maintenanceStartTime', prop: 'faultTime',
label: '维修开始时间', label: '故障开始时间',
width: 150,
filter: parseTime,
},
{
prop: 'maintenanceFinishTime',
label: '维修结束时间',
width: 150, width: 150,
filter: parseTime, filter: parseTime,
}, },
// {
// prop: 'maintenanceFinishTime',
// label: '维修结束时间',
// width: 150,
// filter: parseTime,
// },
// { prop: 'maintenanceStartTime', label: '开始时间', filter: parseTime }, // { prop: 'maintenanceStartTime', label: '开始时间', filter: parseTime },
{ // {
prop: 'maintenanceResult', // prop: 'maintenanceResult',
label: '维修结果', // label: '维修结果',
filter: (v) => (v != null ? ['成功', '失败'][v] : ''), // filter: (v) => (v != null ? ['成功', '失败'][v] : ''),
}, // },
// { prop: 'maintenanceDuration', label: '维修时长(h)' }, { prop: 'maintenanceDuration', label: '维修时长()' },//
{ prop: 'maintenanceDetail', label: '维修描述', subcomponent: htmls }, // 没有参数 { prop: 'maintenanceDetail', label: '维修描述', subcomponent: htmls }, // 没有参数
// { prop: 'repairman', label: '维修工', minWidth: 100, showOverflowtooltip: true }, // { prop: 'repairman', label: '维修工', minWidth: 100, showOverflowtooltip: true },
// { prop: 'repairmanPhone', label: '联系方式', minWidth: 100, showOverflowtooltip: true }, // { prop: 'repairmanPhone', label: '联系方式', minWidth: 100, showOverflowtooltip: true },
{ prop: 'remark', label: '备注', minWidth: 90, showOverflowtooltip: true } { prop: 'remark', label: '备注', minWidth: 90, showOverflowtooltip: true },
{ prop: 'detail', label: '查看详情', subcomponent: detailBtn }, // 没有参数
], ],
searchBarFormConfig: [ searchBarFormConfig: [
{ {
@@ -142,16 +121,16 @@ export default {
param: 'equipmentId', param: 'equipmentId',
filterable: true, filterable: true,
}, },
{ // {
type: 'select', // type: 'select',
label: '维修结果', // label: '维修结果',
placeholder: '请选择状态', // placeholder: '请选择状态',
param: 'maintenanceResult', // param: 'maintenanceResult',
selectOptions: [ // selectOptions: [
{ name: '成功', id: '0' }, // { name: '成功', id: '0' },
{ name: '失败', id: '1' } // { name: '失败', id: '1' }
], // ],
}, // },
// 时间段 // 时间段
{ {
type: 'datePicker', type: 'datePicker',
@@ -214,7 +193,7 @@ export default {
// 表单参数 // 表单参数
form: {}, form: {},
basePath: '/base/equipment-repair-log', basePath: '/base/equipment-repair-log',
mode: null mode: 'add'
}; };
}, },
created() { created() {
@@ -223,15 +202,13 @@ export default {
}, },
methods: { methods: {
initSearchBar() { initSearchBar() {
this.http('/base/core-equipment/page', 'get', { this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
special: false, console.log('data', data);
pageNo: 1,
pageSize: 999,
}).then(({ data }) => {
this.$set( this.$set(
this.searchBarFormConfig[0], this.searchBarFormConfig[0],
'selectOptions', 'selectOptions',
(data?.list || []).map((item) => ({ (data || []).map((item) => ({
name: item.name, name: item.name,
id: item.id, id: item.id,
})) }))
@@ -251,7 +228,7 @@ export default {
/** 取消按钮 */ /** 取消按钮 */
cancel() { cancel() {
this.open = false; this.open = false;
this.mode = null; // this.mode = null;
this.reset(); this.reset();
}, },
/** 表单重置 */ /** 表单重置 */
@@ -371,9 +348,9 @@ export default {
.catch(() => {}); .catch(() => {});
}, },
handleDetail({ id }) { handleDetail({ id }) {
this.addOrUpdateVisible = true this.detailOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init({id: id}, true); this.$refs.detailOrUpdate.init({id: id}, true);
}); });
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */

View File

@@ -1,8 +1,8 @@
<!-- <!--
filename: dialogForm.vue filename: dialogForm.vue
author: liubin author: liubin
date: 2023-10-31 15:55:13 date: 2023-10-31 15:55:13
description: description:
--> -->
<template> <template>
@@ -41,11 +41,11 @@
</el-col> </el-col>
</el-row> </el-row>
<el-form-item label="描述" prop="description"> <el-form-item label="描述" prop="description">
<div v-html="dataForm.description" style="padding: 5px; margin: 0; border: 1px solid #dfdfdf" /> <div v-html="dataForm.description" style="padding: 5px; margin: 0; border: 1px solid #dfdfdf;" />
<!-- <editor v-model="dataForm.description" read-only :min-height="200"/> --> <!-- <editor v-model="dataForm.description" read-only :min-height="200"/> -->
</el-form-item> </el-form-item>
</el-form> </el-form>
<div> <div>
<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true"> <small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
{{ '备品备件' }} {{ '备品备件' }}
@@ -78,7 +78,7 @@
:limit.sync="listQuery.pageSize" :limit.sync="listQuery.pageSize"
:page-sizes="[5, 10, 15]" :page-sizes="[5, 10, 15]"
@pagination="getList" /> @pagination="getList" />
</div> </div>
<div v-if="!disabled" class="drawer-body__footer"> <div v-if="!disabled" class="drawer-body__footer">
<el-button type="primary" @click="goback()">关闭</el-button> <el-button type="primary" @click="goback()">关闭</el-button>

View File

@@ -184,16 +184,17 @@ export default {
], ],
[ [
{ {
select: true, // TODO: or INPUT instead of SELECT input: true, // TODO: or INPUT instead of SELECT
label: '负责人', label: '负责人',
prop: 'responsible', prop: 'responsible',
url: '/base/core-worker/listAll', // TODO: 班组 // url: 'system/user/page', // TODO: 班组
valueKey: 'name', // valueKey: 'id',
bind: { // labelKey:'username',
filterable: true, // bind: {
clearable: true, // filterable: true,
multiple: true // clearable: true,
}, // multiple: true
// },
}, },
], ],
[ [
@@ -288,7 +289,7 @@ export default {
const id = row.id; const id = row.id;
this.info({ id }).then((response) => { this.info({ id }).then((response) => {
this.form = response.data; this.form = response.data;
this.form.responsible = this.form.responsible ? this.form.responsible.split(',') : undefined // this.form.responsible = this.form.responsible ? this.form.responsible.split(',') : undefined
this.open = true; this.open = true;
this.title = '修改备品备件配置'; this.title = '修改备品备件配置';
}); });
@@ -299,7 +300,7 @@ export default {
if (!valid) { if (!valid) {
return; return;
} }
this.form.responsible = this.form.responsible.join(',') // this.form.responsible = this.form.responsible.join(',')/
// 修改的提交 // 修改的提交
if (this.form.id != null) { if (this.form.id != null) {
this.put(this.form).then((response) => { this.put(this.form).then((response) => {

View File

@@ -37,12 +37,14 @@
@close="cancel" @close="cancel"
@cancel="cancel" @cancel="cancel"
@confirm="submitForm"> @confirm="submitForm">
<DialogForm <DialogFormZ
v-if="open" v-if="open"
ref="form" ref="form"
v-model="form" v-model="form"
label-position="top"
:disabled="mode == 'detail'" :disabled="mode == 'detail'"
:has-files="false" :has-files="false"
@selectupdate="updateDialogFormZ"
:rows="rows" /> :rows="rows" />
</base-dialog> </base-dialog>
</div> </div>
@@ -51,14 +53,16 @@
<script> <script>
import moment from 'moment'; import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import DialogFormZ from '../../../DialogFormZ.vue';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import { deleteSparePart } from '@/api/equipment/base/spare-parts/list'; import { deleteSparePart } from '@/api/equipment/base/spare-parts/list';
import { getMaterialTree, getMaterialList } from '@/api/base/material';
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'); const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
export default { export default {
name: 'EquipmentSparePartsList', name: 'EquipmentSparePartsList',
components: {}, components: { DialogFormZ },
mixins: [basicPageMixin], mixins: [basicPageMixin],
data() { data() {
return { return {
@@ -129,33 +133,45 @@ export default {
rows: [ rows: [
[ [
{ {
input: true, select: true,
label: '备件名称', label: '备件名称',
prop: 'name', prop: 'productMaterialId',
// url: '/base/core-product-material/listAll', // TODO: 供应商
options: [],
bind: {
filterable: true,
clearable: false,
},
rules: [ rules: [
{ required: true, message: '备件名称不能为空', trigger: 'blur' }, {
required: true,
message: '备件名称不能为空',
trigger: 'change',
},
], ],
}, },
{
input: true,
label: '备件编码',
prop: 'code',
url: '/base/equipment-spare-part/getCode',
rules: [
{ required: true, message: '备件编码不能为空', trigger: 'blur' },
],
},
],
[
{ {
input: true, input: true,
label: '备件型号', label: '备件型号',
prop: 'model', prop: 'model',
}, },
],
[
{
input: true,
label: '备件编码',
prop: 'code',
bind: {
disabled: true,
},
},
{ {
input: true, input: true,
label: '规格', label: '规格',
prop: 'specifications', prop: 'specifications',
bind: {
disabled: true,
},
}, },
], ],
[ [
@@ -165,27 +181,32 @@ export default {
prop: 'supplierId', prop: 'supplierId',
url: '/base/core-supplier/listAll', // TODO: 供应商 url: '/base/core-supplier/listAll', // TODO: 供应商
bind: { bind: {
filterable: true, disabled: true,
clearable: true,
}, },
rules: [
{ required: true, message: '供应商不能为空', trigger: 'blur' },
],
}, },
{ {
select: true, select: true,
label: '物料类型', label: '单位',
prop: 'type', prop: 'unit', // 数据字典
options: this.getDictDatas('material_type'),
// url: '/base/core-equipment/listAll', // TODO: 物料
bind: { bind: {
filterable: true, disabled: true,
clearable: true,
}, },
rules: [ options: this.getDictDatas(this.DICT_TYPE.UNIT_DICT),
{ required: true, message: '物料类型不能为空', trigger: 'blur' },
],
}, },
// {
// select: true,
// label: '物料类型',
// prop: 'type',
// options: this.getDictDatas('material_type'),
// // url: '/base/core-equipment/listAll', // TODO: 物料
// bind: {
// filterable: true,
// clearable: true,
// },
// rules: [
// { required: true, message: '物料类型不能为空', trigger: 'blur' },
// ],
// },
], ],
[ [
{ {
@@ -201,14 +222,6 @@ export default {
}, },
], ],
}, },
{
select: true,
label: '单位',
prop: 'unit', // 数据字典
options: this.getDictDatas(this.DICT_TYPE.UNIT_DICT),
},
],
[
{ {
input: true, input: true,
label: '备注', label: '备注',
@@ -225,11 +238,23 @@ export default {
name: null, name: null,
}, },
// 表单参数 // 表单参数
form: {}, form: {
id: null,
code: null,
name: null,
model: null,
specifications: null,
life: null,
type: null,
supplierId: null,
unit: null,
remark: null,
},
basePath: '/base/equipment-spare-part', basePath: '/base/equipment-spare-part',
mode: null, mode: null,
}; };
}, },
mounted() {},
created() { created() {
// this.initSearchBar(); // this.initSearchBar();
this.getList(); this.getList();
@@ -267,8 +292,8 @@ export default {
reset() { reset() {
this.form = { this.form = {
id: null, id: null,
productMaterialId: null,
code: null, code: null,
name: null,
model: null, model: null,
specifications: null, specifications: null,
life: null, life: null,
@@ -294,6 +319,7 @@ export default {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = '添加备品备件'; this.title = '添加备品备件';
this.getDict();
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
@@ -302,13 +328,14 @@ export default {
this.info({ id }).then((response) => { this.info({ id }).then((response) => {
this.form = response.data; this.form = response.data;
if (this.form.unit !== undefined) { if (this.form.unit !== undefined) {
this.form.unit = String(this.form.unit) this.form.unit = String(this.form.unit);
} }
if (this.form.type !== undefined) { if (this.form.type !== undefined) {
this.form.type = String(this.form.type) this.form.type = String(this.form.type);
} }
this.open = true; this.open = true;
this.title = '修改备品备件'; this.title = '修改备品备件';
this.getDict();
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
@@ -355,6 +382,7 @@ export default {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = '修改备品备件'; this.title = '修改备品备件';
this.getDict();
}); });
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
@@ -375,6 +403,30 @@ export default {
}) })
.catch(() => {}); .catch(() => {});
}, },
async getDict() {
// const materRes = await getMaterialTree();
// let typeId = materRes.data.find((item) => item.product === 2);
// const listQuery = {
// typeId: typeId,
// };
const materData = await getMaterialList();
this.rows[0][0].options = (materData.data || []).filter(item => item.typeId === 3)
.map(item => ({ label: item.name, value: item.id,...item }))
console.log(this.rows[0][0].options);
},
updateDialogFormZ(val) {
// console.log(this.rows[0][0].options)
const selectData = this.rows[0][0].options.find(
(item) => item.id === val.productMaterialId
);
this.form.productMaterialId = selectData.id;
this.form.name = selectData.name;
this.form.code = selectData.code;
this.form.specifications = selectData.specifications;
this.form.supplierId = selectData.supplierId;
this.form.unit = selectData.unit;
},
}, },
}; };
</script> </script>

View File

@@ -61,9 +61,9 @@ function getTodayStart(today) {
/** 颜色配置 */ /** 颜色配置 */
const types = [ const types = [
{ name: '运行', color: '#288AFF' }, { name: '运行', color: '#288AFF' },
{ name: '故障', color: '#FC9C91' },
{ name: '计划停机', color: '#FFDC94' }, { name: '计划停机', color: '#FFDC94' },
{ name: '故障', color: '#FC9C91' },
{ name: '空白', color: '#F2F4F9' }, { name: '空白', color: '#F2F4F9' },
]; ];
@@ -86,7 +86,7 @@ export default class GanttGraph {
<span class="eq-name" style="margin-left: 4px;">${params.seriesName}</span> <span class="eq-name" style="margin-left: 4px;">${params.seriesName}</span>
</div> </div>
<span class="run-status" style="margin-left: 8px; opacity: 0.6">${params.name}</span> <span class="run-status" style="margin-left: 8px; opacity: 0.6">${params.name}</span>
</div> </div>
` `
} }
} }
@@ -251,7 +251,7 @@ export default class GanttGraph {
y: 0, y: 0,
}, },
data: arr.map(item => ({ data: arr.map(item => ({
name: ['运行', '故障', '计划停机'][item.status], name: ['运行', '计划停机', '故障'][item.status],
value: [0, item.startTime, item.startTime + item.duration * 60 * 1000, 0], value: [0, item.startTime, item.startTime + item.duration * 60 * 1000, 0],
itemStyle: { itemStyle: {
color: types[item.status].color, color: types[item.status].color,
@@ -325,4 +325,4 @@ export default class GanttGraph {
console.log(JSON.stringify(this.option, null, 2)); console.log(JSON.stringify(this.option, null, 2));
} }
} }

View File

@@ -6,29 +6,19 @@
--> -->
<template> <template>
<div <div class="status-timegraph-container" style="background: #f2f4f9; flex: 1; display: flex; flex-direction: column">
class="status-timegraph-container" <el-row class="" style="
style="background: #f2f4f9; flex: 1; display: flex; flex-direction: column">
<el-row
class=""
style="
margin-bottom: 12px; margin-bottom: 12px;
background: #fff; background: #fff;
padding: 16px 16px 0; padding: 16px 16px 0;
border-radius: 8px; border-radius: 8px;
"> ">
<div class="blue-title">生产节拍时序图</div> <div class="blue-title">生产节拍时序图</div>
<SearchBar <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" :remove-blue="true"
:formConfigs="searchBarFormConfig" @select-changed="handleSearchBarSelectChange" @headBtnClick="handleSearchBarBtnClick" />
ref="search-bar" </el-row>
:remove-blue="true"
@select-changed="handleSearchBarSelectChange"
@headBtnClick="handleSearchBarBtnClick" />
</el-row>
<el-row <el-row class="" style="
class=""
style="
height: 1px; height: 1px;
flex: 1; flex: 1;
margin-bottom: 12px; margin-bottom: 12px;
@@ -38,60 +28,40 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
"> ">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="6"> <el-col :span="6">
<div class="blue-title">设备状态时序图</div> <div class="blue-title">设备状态时序图</div>
</el-col> </el-col>
<el-col :span="18" class="legend-row"> <el-col :span="18" class="legend-row">
<div class="legend"> <div class="legend">
<div class="icon running"></div> <div class="icon running"></div>
<div>运行中</div> <div>运行中</div>
</div> </div>
<div class="legend"> <div class="legend">
<div class="icon fault"></div> <div class="icon stop"></div>
<div>故障</div> <div>计划停机</div>
</div> </div>
<div class="legend"> <div class="legend">
<div class="icon stop"></div> <div class="icon fault"></div>
<div>计划停机</div> <div>故障</div>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<div <div class="main-area" style="flex: 1; display: flex; flex-direction: column">
class="main-area" <div class="graphs" v-show="graphList.length" id="status-chart" style="height: 1px; flex: 1"></div>
style="flex: 1; display: flex; flex-direction: column"> <h2 v-if="!graphList || graphList.length == 0" class="no-data-bg"></h2>
<div </div>
class="graphs" </el-row>
v-show="graphList.length"
id="status-chart"
style="height: 1px; flex: 1"></div>
<h2 v-if="!graphList || graphList.length == 0" class="no-data-bg"></h2>
</div>
</el-row>
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<base-dialog <base-dialog dialogTitle="添加设备" :dialogVisible="open" width="500px" @close="open = false" @cancel="open = false"
dialogTitle="添加设备" @confirm="submitForm">
:dialogVisible="open" <el-select v-if="open" style="width: 100%" filterable clearable v-model="queryParams.equipmentId"
width="500px" placeholder="请选择一个设备">
@close="open = false" <el-option v-for="eq in eqList" :key="eq.id" :value="eq.id" :label="eq.name"></el-option>
@cancel="open = false" </el-select>
@confirm="submitForm"> </base-dialog>
<el-select </div>
v-if="open"
style="width: 100%"
filterable
clearable
v-model="queryParams.equipmentId"
placeholder="请选择一个设备">
<el-option
v-for="eq in eqList"
:key="eq.id"
:value="eq.id"
:label="eq.name"></el-option>
</el-select>
</base-dialog>
</div>
</template> </template>
<script> <script>
@@ -103,12 +73,6 @@ export default {
components: {}, components: {},
props: {}, props: {},
data() { data() {
const today = new Date();
const todayStart = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate()
);
return { return {
chart: null, chart: null,
searchBarFormConfig: [ searchBarFormConfig: [
@@ -138,7 +102,7 @@ export default {
placeholder: '选择日期', placeholder: '选择日期',
param: 'recordTime', param: 'recordTime',
required: true, required: true,
defaultSelect: moment(todayStart).format('YYYY-MM-DD HH:mm:ss'), defaultSelect:null,
}, },
{ {
type: 'button', type: 'button',
@@ -191,14 +155,24 @@ export default {
// ], // ],
}; };
}, },
computed: {}, computed: {},
created() { created () {
this.initProductline(); this.initProductline();
this.initWorksection(); this.initWorksection();
this.initEquipment(); this.initEquipment();
},
mounted() {
const today = new Date();
const todayStart = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate()
);
this.searchBarFormConfig[2].defaultSelect = moment(todayStart).format('YYYY-MM-DD HH:mm:ss')
console.log('111111', this.searchBarFormConfig[2].defaultSelect)
// this.getList(); // this.getList();
}, },
mounted() {}, // mounted() {},
watch: { watch: {
graphList: { graphList: {
handler(val) { handler(val) {
@@ -246,7 +220,7 @@ export default {
}); });
}, },
async getList() { async getList() {
const { code, data } = await this.$axios({ const { code, data } = await this.$axios({
url: '/monitoring/equipment-monitor/status-series', url: '/monitoring/equipment-monitor/status-series',
method: 'get', method: 'get',
@@ -312,7 +286,7 @@ export default {
if (!value) { if (!value) {
this.searchBarFormConfig[1].selectOptions = []; this.searchBarFormConfig[1].selectOptions = [];
return; return;
} }
switch (param) { switch (param) {
case 'lineId': case 'lineId':
this.$axios({ this.$axios({
@@ -322,7 +296,8 @@ export default {
id: value, id: value,
}, },
}).then(({ code, data }) => { }).then(({ code, data }) => {
if (code == 0) { if (code == 0) {
this.searchBarFormConfig[1].defaultSelect = null
this.searchBarFormConfig[1].selectOptions = data.map((item) => { this.searchBarFormConfig[1].selectOptions = data.map((item) => {
return { return {
name: item.name, name: item.name,

View File

@@ -177,7 +177,7 @@ export default {
name: '', name: '',
equipmentId: undefined, equipmentId: undefined,
equipmentCode: undefined, equipmentCode: undefined,
enabled:undefined, enabled:1,
// area: undefined, // area: undefined,
// specifications: undefined, // specifications: undefined,
// processTime: 0, // processTime: 0,

View File

@@ -1,13 +1,8 @@
<!-- <!--
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
<<<<<<< HEAD
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2023-11-28 10:09:20 * @LastEditTime: 2023-11-28 10:09:20
=======
* @LastEditors: DY
* @LastEditTime: 2023-11-27 16:37:17
>>>>>>> projects/mes-test
* @Description: * @Description:
--> -->
<template> <template>

View File

@@ -1,8 +1,8 @@
<!-- <!--
filename: index.vue filename: index.vue
author: liubin author: liubin
date: 2023-10-19 10:03:42 date: 2023-10-19 10:03:42
description: description:
--> -->
<template> <template>
@@ -189,7 +189,7 @@ export default {
input: true, input: true,
label: '工艺编码', label: '工艺编码',
prop: 'code', prop: 'code',
// url: '/base/core-equipment/getCode', url: '/extend/process-flow/getCode',
}, },
], ],
[ [
@@ -274,7 +274,8 @@ export default {
async handleCopy(id) { async handleCopy(id) {
this.$confirm('确认拷贝操作?', '提示', { this.$confirm('确认拷贝操作?', '提示', {
confirmButtonText: '确 认', confirmButtonText: '确 认',
cancelButtonText: '取 消', cancelButtonText: '取 消',
type: 'info'
}) })
.then(async () => { .then(async () => {
const { code } = await this.http( const { code } = await this.http(
@@ -294,7 +295,8 @@ export default {
async handleDelete(id) { async handleDelete(id) {
this.$confirm('确认删除这个工艺吗?', '提示', { this.$confirm('确认删除这个工艺吗?', '提示', {
confirmButtonText: '确 认', confirmButtonText: '确 认',
cancelButtonText: '取 消', cancelButtonText: '取 消',
type: 'warning'
}) })
.then(async () => { .then(async () => {
const { code } = await this.http( const { code } = await this.http(

View File

@@ -1,8 +1,8 @@
<!-- <!--
filename: BomSelector.vue filename: BomSelector.vue
author: liubin author: liubin
date: 2023-11-17 16:23:28 date: 2023-11-17 16:23:28
description: description:
--> -->
<template> <template>
@@ -20,7 +20,7 @@
</el-row> </el-row>
<el-row v-if="filteredBomList.length" style="border: 1px solid #ccc; display: flex"> <el-row v-if="filteredBomList.length" style="border: 1px solid #ccc; display: flex">
<el-col :span="8"> <el-col :span="12">
<div class="select-list"> <div class="select-list">
<div class="sl__header" style="background: #f3f4fb; padding: 12px"> <div class="sl__header" style="background: #f3f4fb; padding: 12px">
<span style="">可分配设备</span> <span style="">可分配设备</span>
@@ -47,7 +47,7 @@
</div> </div>
</div> </div>
</el-col> </el-col>
<el-col :span="8" style="border-left: 1px solid #ccc"> <el-col :span="6" style="border-left: 1px solid #ccc">
<div class="select-list"> <div class="select-list">
<div class="sl__header" style="background: #f3f4fb; padding: 12px"> <div class="sl__header" style="background: #f3f4fb; padding: 12px">
<span style="">物料BOM</span> <span style="">物料BOM</span>

View File

@@ -1,8 +1,8 @@
<!-- <!--
filename: ProcessBomList.vue filename: ProcessBomList.vue
author: liubin author: liubin
date: 2023-10-20 15:00:58 date: 2023-10-20 15:00:58
description: description:
--> -->
<template> <template>
@@ -185,7 +185,13 @@ export default {
this.btnLoading = true; this.btnLoading = true;
// 现将子组件的修改提交更新至本组件 // 现将子组件的修改提交更新至本组件
this.$refs.bomSelector.commit(); this.$refs.bomSelector.commit();
// 再提交至后端 // 再提交至后端
const equMaterialBomId = this.selectedBoms.every(item => item.equMaterialBomId !== undefined && item.equMaterialBomId !== null && item.equMaterialBomId !== '');
const equValueBomId = this.selectedBoms.every(item => item.equValueBomId !== undefined && item.equValueBomId !== null && item.equValueBomId !== '')
if (!equMaterialBomId || !equValueBomId) {
this.btnLoading = false
return this.$message.warning('请选择物料bom和参数bom');
}
this.$nextTick(async () => { this.$nextTick(async () => {
console.log('selectedBoms', this.selectedBoms); console.log('selectedBoms', this.selectedBoms);
if (this.selectedBoms.length) { if (this.selectedBoms.length) {

View File

@@ -1,41 +1,42 @@
<!-- <!--
filename: ProcessInfo.vue filename: ProcessInfo.vue
author: liubin author: liubin
date: 2023-10-20 15:00:58 date: 2023-10-20 15:00:58
description: description:
--> -->
<template> <template>
<section class="process-info"> <section class="process-info">
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" /> <el-button style="position: absolute;right: 30px;z-index: 9999;" type="primary" plain @click="goBack">返回</el-button>
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" />
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="6"> <el-col :span="6">
<InfoItem label="工艺名称" :value="form.name" /> <InfoItem label="工艺名称" :value="form.name" />
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<InfoItem label="产线" :value="form.lineName" /> <InfoItem label="产线" :value="form.lineName" />
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<InfoItem label="工艺描述" :value="form.remark" /> <InfoItem label="工艺描述" :value="form.remark" />
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20" style="margin-top: 12px"> <el-row :gutter="20" style="margin-top: 12px">
<el-col :span="6"> <el-col :span="6">
<!-- <InfoItem label="创建人" value="xxse" /> --> <!-- <InfoItem label="创建人" value="xxse" /> -->
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<InfoItem label="创建时间" :value="form.createTime" :time-format="true" /> <InfoItem label="创建时间" :value="form.createTime" :time-format="true" />
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<!-- <InfoItem label="更新人" value="xxse" /> --> <!-- <InfoItem label="更新人" value="xxse" /> -->
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<!-- <InfoItem label="更新时间" value="2023-10-22 10:11:00" /> --> <!-- <InfoItem label="更新时间" value="2023-10-22 10:11:00" /> -->
</el-col> </el-col>
</el-row> </el-row>
</section> </section>
</template> </template>
<script> <script>
@@ -49,7 +50,9 @@ const InfoItem = {
return {}; return {};
}, },
computed: {}, computed: {},
methods: {}, methods: {
},
render: function (h) { render: function (h) {
return ( return (
<div style="display: flex; align-items: center; font-size: 14px; line-height: 1.5"> <div style="display: flex; align-items: center; font-size: 14px; line-height: 1.5">
@@ -99,7 +102,10 @@ export default {
params: method === 'get' ? payload : null, params: method === 'get' ? payload : null,
data: method !== 'get' ? payload : null, data: method !== 'get' ? payload : null,
}); });
}, },
goBack() {
this.$router.go(-1);
},
put(payload) { put(payload) {
return this.http(this.updateUrl, 'put', payload); return this.http(this.updateUrl, 'put', payload);
}, },

View File

@@ -1,8 +1,8 @@
<!-- <!--
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 14:55:51 * @Date: 2023-08-01 14:55:51
* @LastEditors: zhp * @LastEditors: zwq
* @LastEditTime: 2023-11-28 10:34:24 * @LastEditTime: 2024-10-15 15:59:48
* @Description: * @Description:
--> -->
<template> <template>
@@ -26,9 +26,11 @@ import { parseTime } from '../../core/mixins/code-filter';
import { import {
getProcessTraceabilityPage, getProcessTraceabilityPage,
getWorkOrderList, getWorkOrderList,
getCoreProduct
// exportEnergyPlcExcel // exportEnergyPlcExcel
} from '@/api/quality/processTraceability'; } from '@/api/quality/processTraceability';
import {
getProductMaterial,
} from '@/api/base/material';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
const tableProps = [ const tableProps = [
{ {
@@ -62,6 +64,14 @@ const tableProps = [
prop: 'actualQuantity', prop: 'actualQuantity',
label: '生产数量' label: '生产数量'
}, },
{
prop: 'lineName',
label: '产线名称'
},
{
prop: 'lineNum',
label: '产线预计产量'
},
{ {
prop: 'planProductUnit', prop: 'planProductUnit',
label: '单位', label: '单位',
@@ -187,7 +197,7 @@ export default {
if (val.type === "processDetail") { if (val.type === "processDetail") {
console.log(val); console.log(val);
let specificationsData ='' let specificationsData =''
getCoreProduct(val.data.planProductId).then((res) => { getProductMaterial(val.data.planProductId).then((res) => {
console.log(res) console.log(res)
this.$router.push({ this.$router.push({
@@ -199,6 +209,7 @@ export default {
specifications: res.data.specifications, specifications: res.data.specifications,
productName: val.data.planProductName, productName: val.data.planProductName,
processFlowName: val.data.processFlowName, processFlowName: val.data.processFlowName,
lineId: val.data.lineId,
// planProductId: val.data.planProductId // planProductId: val.data.planProductId
// equipmentName, // equipmentName,
}, },

View File

@@ -177,7 +177,7 @@ export default {
immediate: true, immediate: true,
deep: true deep: true
} }
}, },
methods: { methods: {
handleSearchBarBtnClick(val) { handleSearchBarBtnClick(val) {
console.log(val) console.log(val)
@@ -185,6 +185,7 @@ export default {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
orderId: this.$route.query.orderId, orderId: this.$route.query.orderId,
lineId: this.$route.query.lineId,
flowDetId: [this.detId], flowDetId: [this.detId],
// orderId: this.$route.query.orderId, // orderId: this.$route.query.orderId,
@@ -232,6 +233,7 @@ export default {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
orderId: this.$route.query.orderId, orderId: this.$route.query.orderId,
lineId: this.$route.query.lineId,
flowDetId: [this.detId], flowDetId: [this.detId],
// orderId: this.$route.query.orderId, // orderId: this.$route.query.orderId,
@@ -263,6 +265,7 @@ export default {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
orderId: this.$route.query.orderId, orderId: this.$route.query.orderId,
lineId: this.$route.query.lineId,
flowDetId: [this.detId], flowDetId: [this.detId],
}).then((res) => { }).then((res) => {
console.log(res); console.log(res);
@@ -278,7 +281,7 @@ export default {
}, },
}; };
</script> </script>
` `
<style scoped lang="scss"> <style scoped lang="scss">
.process-bom { .process-bom {
position: relative; position: relative;

View File

@@ -76,10 +76,10 @@ const tableProps = [
label: '班次状态', label: '班次状态',
subcomponent: StatusBtn, subcomponent: StatusBtn,
}, },
{ // {
prop: 'remark', // prop: 'remark',
label: '备注', // label: '备注',
}, // },
]; ];
export default { export default {
name: 'GroupClass', name: 'GroupClass',

View File

@@ -82,7 +82,7 @@
</div> </div>
<!-- 班次班组 --> <!-- 班次班组 -->
<!-- class有两个样式一个是类似class1还有个是选中红框显示 --> <!-- class有两个样式一个是类似class1还有个是选中红框显示 -->
<el-row <!-- <el-row
:gutter="2" :gutter="2"
:class=" :class="
'class' + 'class' +
@@ -92,6 +92,14 @@
: '') : '')
" "
v-for="(item, index) in list[Number(data.day.split('-')[2])]" v-for="(item, index) in list[Number(data.day.split('-')[2])]"
:key="index"> -->
<el-row
:gutter="2"
:class="
'class' +
(index + 1)
"
v-for="(item, index) in list[Number(data.day.split('-')[2])]"
:key="index"> :key="index">
<el-col :span="12"> <el-col :span="12">
<div class="selectDiv"> <div class="selectDiv">
@@ -141,6 +149,9 @@
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<div v-else style='font-size: 20px;font-weight: 500;text-align: right;'>
{{ Number(data.day.split('-')[2]) }}
</div>
</template> </template>
</el-calendar> </el-calendar>
</div> </div>
@@ -277,7 +288,7 @@ export default {
if ( if (
moment(this.startDay).format('YYYY-MM') === moment().format('YYYY-MM') moment(this.startDay).format('YYYY-MM') === moment().format('YYYY-MM')
) { ) {
num = Number(moment().format('DD')); num = Number(moment().format('DD'))-1;
} else { } else {
num = 0; num = 0;
} }

View File

@@ -211,6 +211,9 @@ export default {
this.$modal.msgSuccess('操作成功'); this.$modal.msgSuccess('操作成功');
this.$emit('successSubmit'); this.$emit('successSubmit');
}); });
}else{
this.$modal.msgSuccess('操作成功');
this.$emit('successSubmit');
} }
} }
}); });
@@ -226,6 +229,9 @@ export default {
this.$modal.msgSuccess('操作成功'); this.$modal.msgSuccess('操作成功');
this.$emit('successSubmit'); this.$emit('successSubmit');
}); });
}else{
this.$modal.msgSuccess('操作成功');
this.$emit('successSubmit');
} }
} }
}); });

View File

@@ -176,8 +176,10 @@ export default {
if (res.code === 0 && res.data.list && res.data.list.length > 0) { if (res.code === 0 && res.data.list && res.data.list.length > 0) {
res.data.list.forEach(item => { res.data.list.forEach(item => {
if(item.isProduction){ if(item.isProduction){
item.str = item.strList?item.strList.join(','):'-' item.str = item.strList?item.strList.join(''):'-'
} }else{
item.str = '-'
}
}); });
this.list = res.data.list; this.list = res.data.list;
this.total = res.data.total; this.total = res.data.total;

View File

@@ -125,13 +125,15 @@ export default {
addButtonShow: '', addButtonShow: '',
planArr: [], //排班计划数组 planArr: [], //排班计划数组
rules: { rules: {
name: [{ required: true, message: '请输入班组名称', trigger: 'blur' }],
startDay: [ startDay: [
{ required: true, message: '请选择排班开始时间', trigger: 'change' }, { required: true, message: '请选择排班开始时间', trigger: 'change' },
], ],
endDay: [ endDay: [
{ required: true, message: '请选择排班结束时间', trigger: 'change' }, { required: true, message: '请选择排班结束时间', trigger: 'change' },
], ],
planId:[
{ required: true, message: '请选择排班计划', trigger: 'change' },
]
}, },
}; };
}, },
@@ -231,6 +233,10 @@ export default {
}; };
list.push(obj); list.push(obj);
}); });
if (list.length === 0) {
this.$modal.msgError('班组上班顺序不能为空');
return false;
}
this.form.list = list; this.form.list = list;
updateGroupRule({ ...this.form }).then((res) => { updateGroupRule({ ...this.form }).then((res) => {
this.$modal.msgSuccess('操作成功'); this.$modal.msgSuccess('操作成功');
@@ -246,6 +252,10 @@ export default {
}; };
list.push(obj); list.push(obj);
}); });
if (list.length === 0) {
this.$modal.msgError('班组上班顺序不能为空');
return false;
}
this.form.list = list; this.form.list = list;
createGroupRule({ ...this.form }).then((res) => { createGroupRule({ ...this.form }).then((res) => {
this.$modal.msgSuccess('操作成功'); this.$modal.msgSuccess('操作成功');
@@ -268,13 +278,8 @@ export default {
margin-bottom: 5px; margin-bottom: 5px;
} }
.min-title::before { .min-title::before {
content: ''; content: "*";
display: inline-block; color: #ff5454;
vertical-align: middle; margin-right: 4px;
width: 6px;
height: 6px;
border-radius: 50%;
margin: auto 5px;
background-color: #0b58ff;
} }
</style> </style>

View File

@@ -44,7 +44,9 @@ import {
deleteGroupRule, deleteGroupRule,
updateGroupRule, updateGroupRule,
getGroupRule, getGroupRule,
disableGroupRule
} from '@/api/base/groupSchedulingRule'; } from '@/api/base/groupSchedulingRule';
import { groupClassesListAll } from '@/api/monitoring/teamProduction';
import schedulingRuleConfigAdd from './components/schedulingRuleConfigAdd.vue'; import schedulingRuleConfigAdd from './components/schedulingRuleConfigAdd.vue';
import { formatDate } from '@/utils'; import { formatDate } from '@/utils';
import tableHeightMixin from '@/mixins/tableHeightMixin'; import tableHeightMixin from '@/mixins/tableHeightMixin';
@@ -76,11 +78,13 @@ export default {
data() { data() {
return { return {
formConfig: [ formConfig: [
{ {
type: 'input', type: 'select',
label: '班次', label: '班次',
placeholder: '班次', selectOptions: [],
param: 'name', param: 'id',
defaultSelect: '',
filterable: true,
}, },
{ {
type: 'button', type: 'button',
@@ -154,19 +158,35 @@ export default {
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 20, pageSize: 20,
name: null, id: null,
}, },
classNameList:[]
}; };
}, },
created() { created() {
this.getClassNameList();
this.getList(); this.getList();
}, },
methods: { methods: {
getClassNameList() {
groupClassesListAll().then((res) => {
this.formConfig[0].selectOptions = res.data;
this.classNameList = res.data;
})
},
buttonClick(val) { buttonClick(val) {
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1;
this.queryParams.classesName = val.name || undefined; if (val.id) {
this.classNameList.map((item) => {
if (val.id === item.id) {
this.queryParams.classesName = item.name
}
})
}else{
this.queryParams.classesName = ''
}
this.getList(); this.getList();
break; break;
default: default:
@@ -186,7 +206,7 @@ export default {
formatDate(item.startDay) + formatDate(item.startDay) +
'至' + '至' +
(item.endDay ? formatDate(item.endDay) : '永久'); (item.endDay ? formatDate(item.endDay) : '永久');
item.str = item.strList.join(','); item.str = item.strList.join('');
}); });
this.list = res.data.list; this.list = res.data.list;
this.total = res.data.total; this.total = res.data.total;
@@ -231,14 +251,9 @@ export default {
'是否确认作废序号为"' + row.planName + '"的数据项?' '是否确认作废序号为"' + row.planName + '"的数据项?'
,'提示') ,'提示')
.then(() => { .then(() => {
getGroupRule(row.id).then((response) => { disableGroupRule(row.id).then((response) => {
let datas = response.data;
datas.list = datas.sequenceList;
datas.enabled = 0;
updateGroupRule(datas).then(() => {
_this.getList(); _this.getList();
_this.$modal.msgSuccess('操作成功'); _this.$modal.msgSuccess('操作成功');
});
}); });
}) })
.catch(() => {}); .catch(() => {});

View File

@@ -13,6 +13,8 @@
</el-col> </el-col>
</el-row> </el-row>
<base-table <base-table
:page="1"
:limit="5000"
:table-props="tableProps" :table-props="tableProps"
:table-data="tableData" :table-data="tableData"
:max-height="tableH" :max-height="tableH"
@@ -43,7 +45,7 @@ const tableProps = [
}, },
{ {
prop: 'workTime', prop: 'workTime',
label: '工作时长' label: '工作时长(h)'
} }
] ]
export default { export default {

View File

@@ -62,7 +62,8 @@ export default {
selectOptions: [], selectOptions: [],
param: 'workOrderId', param: 'workOrderId',
clearable: false, clearable: false,
filterable: true filterable: true,
required: true
}, },
{ {
type: 'button', type: 'button',

View File

@@ -18,7 +18,7 @@
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
:width="80" :width="80"
label="操作" label="生产情况"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleClick" @clickBtn="handleClick"
/> />
@@ -38,6 +38,7 @@ import { groupTeamSchedulingPage, groupClassesListAll } from '@/api/monitoring/t
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
import TeamProductionDetail from './components/teamProductionDetail' import TeamProductionDetail from './components/teamProductionDetail'
import tableHeightMixin from '@/mixins/tableHeightMixin'; import tableHeightMixin from '@/mixins/tableHeightMixin';
import moment from 'moment'
const tableProps = [ const tableProps = [
{ {
prop: 'createTime', prop: 'createTime',
@@ -53,14 +54,12 @@ const tableProps = [
{ {
prop: 'startTime', prop: 'startTime',
label: '上班时间', label: '上班时间',
filter: parseTime, filter: (val) => moment(val).format('HH:mm')
minWidth: 160
}, },
{ {
prop: 'endTime', prop: 'endTime',
label: '下班时间', label: '下班时间',
filter: parseTime, filter: (val) => moment(val).format('HH:mm')
minWidth: 160
}, },
{ {
prop: 'classesName', prop: 'classesName',
@@ -70,7 +69,8 @@ const tableProps = [
{ {
prop: 'teamName', prop: 'teamName',
label: '班组名称', label: '班组名称',
showOverflowtooltip: true showOverflowtooltip: true,
minWidth: 100
} }
] ]
export default { export default {
@@ -122,8 +122,8 @@ export default {
tableBtn: [ tableBtn: [
this.$auth.hasPermi('base:team-production:detail') this.$auth.hasPermi('base:team-production:detail')
? { ? {
type: 'detail', type: 'prodDetail',
btnName: '详情' btnName: '查看'
} }
: undefined : undefined
].filter((v) => v), ].filter((v) => v),

View File

@@ -407,7 +407,7 @@ export default {
} }
} }
.current-date { .current-date {
font-size: 10px; font-size: 15px;
font-weight: 500; font-weight: 500;
position: absolute; position: absolute;
right: 0px; right: 0px;

View File

@@ -176,7 +176,6 @@ import {
} from "@/utils/constants"; } from "@/utils/constants";
import { getSpuSimpleList } from "@/api/mall/product/spu"; import { getSpuSimpleList } from "@/api/mall/product/spu";
import { parseTime } from "@/utils/ruoyi"; import { parseTime } from "@/utils/ruoyi";
import {changeRoleStatus} from "@/api/system/role";
export default { export default {
name: "PromotionCouponTemplate", name: "PromotionCouponTemplate",

View File

@@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2024-08-14 15:24:11 * @LastEditTime: 2024-12-12 09:54:25
* @Description: * @Description:
--> -->
<template> <template>
@@ -83,7 +83,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" v-if="showTime"> <el-col :span="8" v-if="showTime">
<el-form-item label="生产单位用时" prop="processTime"> <el-form-item label="生产单位用时(s)" prop="processTime">
<el-input <el-input
v-model.number="dataForm.processTime" v-model.number="dataForm.processTime"
type="number" type="number"
@@ -154,8 +154,15 @@ export default {
required: true, required: true,
message: '物料产品类型不能为空', message: '物料产品类型不能为空',
trigger: 'blur', trigger: 'blur',
}, },
], ],
specifications: [
{
required: true,
message: '规格不能为空',
trigger: 'blur',
},
],
}, },
}; };
}, },

View File

@@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2024-07-01 14:54:06 * @Date: 2024-07-01 14:54:06
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2024-08-21 11:19:51 * @LastEditTime: 2024-12-16 10:03:30
* @Description: * @Description:
--> -->
<template> <template>
@@ -346,6 +346,7 @@ export default {
this.listQuery.typeId = data.id || undefined; this.listQuery.typeId = data.id || undefined;
this.listQuery.product = data.product; this.listQuery.product = data.product;
this.$refs.searchBarForm.formInline.type = data.name || undefined; this.$refs.searchBarForm.formInline.type = data.name || undefined;
this.getDataList()
}, },
// 新增节点 // 新增节点
append(data) { append(data) {

Some files were not shown because too many files have changed in this diff Show More