Compare commits
72 Commits
48c678d260
...
projects/m
| Author | SHA1 | Date | |
|---|---|---|---|
| 787c994224 | |||
| cc1e237043 | |||
|
|
45e1fe4b47 | ||
|
|
e823dee9ff | ||
| 932d35c14c | |||
| ceeb853783 | |||
| 6ed21030f5 | |||
| 73feff0d8b | |||
| d49a698136 | |||
| 6e774dfc5d | |||
| 3eeded056f | |||
| 881eace12f | |||
| dad3b2da95 | |||
| f5cfc5d2bb | |||
| 235b0a6512 | |||
| 13bf1e0fd0 | |||
|
|
97acb4faac | ||
|
|
04a5359eda | ||
| 7ae7dfad95 | |||
| e202ac542e | |||
| eb8736178a | |||
| 580a66549c | |||
| 30c45e6f74 | |||
| e9c2917c77 | |||
| 0a9bd0c6de | |||
| 84dbd8d5b2 | |||
|
|
00f54f3de6 | ||
|
|
f26d7abc64 | ||
| 028c14a174 | |||
| b14abd39b6 | |||
| dfc8110410 | |||
| baede9ef34 | |||
| 2c44906bd6 | |||
| 466c822b0f | |||
| 031e3098b7 | |||
| d14dae86fc | |||
| 492b591fa9 | |||
| fc20e275f7 | |||
| 10fd959c9d | |||
| 342e83ab41 | |||
| df530abb90 | |||
| 8f1e5212e3 | |||
|
|
5dd299e549 | ||
|
|
511a00d0a3 | ||
| d5b71c4d7d | |||
|
|
43d0a2668d | ||
| a492fe4c87 | |||
| 319e0ac90d | |||
| e11c71edf1 | |||
| 4bf610eeb1 | |||
| 8e0ac6f962 | |||
| d41ae3bc76 | |||
| f4eaddf6ae | |||
| 9699e90ab3 | |||
| 9fc6f013cc | |||
| cee303fd20 | |||
| 4b621a6699 | |||
| 916f99a852 | |||
|
|
9581d91c52 | ||
|
|
c847ba1595 | ||
|
|
2ab8a99ff5 | ||
|
|
d65dcb8712 | ||
| 5711468b10 | |||
| 1b82ff5a96 | |||
| 59f33a2ef5 | |||
| 3c620f4dfa | |||
|
|
2213b93f0a | ||
|
|
d6acfa4fd7 | ||
| ca08b46f77 | |||
| 54b3652c0e | |||
| 884fad3b0e | |||
| 7eb4fdb790 |
19
.env.dev
19
.env.dev
@@ -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
|
||||||
|
|||||||
13
.env.prod
13
.env.prod
@@ -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'
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -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'
|
||||||
|
|
||||||
// 获取走势分析数据
|
// 获取走势分析数据
|
||||||
@@ -8,7 +15,24 @@ export function getEnergyTrend(data) {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 导出走势分析数据
|
||||||
|
export function exportTrend(data) {
|
||||||
|
return request({
|
||||||
|
url: '/analysis/energy-analysis/exportTrend',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
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({
|
||||||
@@ -27,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({
|
||||||
@@ -34,4 +76,4 @@ export function getQoq(data) {
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -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({
|
||||||
|
|||||||
@@ -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
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -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'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
54
src/api/home.js
Normal file
54
src/api/home.js
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2024-09-12 13:38:33
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2024-09-13 15:25:07
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
// 获得首页生产总览以及工单监控
|
||||||
|
export function getHomeOrder(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/core-work-order/homeOrder',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 获得首页生产总览-完成订单数量
|
||||||
|
export function getHomeOrderNum(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/order/homeOrder',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 首页设备总览
|
||||||
|
export function getHomeEquipment() {
|
||||||
|
return request({
|
||||||
|
url: '/monitoring/equipment-monitor/homeEquipment',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 首页设备报警信息
|
||||||
|
export function getHomeEquipmentAlarmList() {
|
||||||
|
return request({
|
||||||
|
url: '/base/equipment-alarm-realtime/homeEquipmentAlarmList',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 获取是否存在报警(右上角红点)
|
||||||
|
export function getHomeGetAlarm() {
|
||||||
|
return request({
|
||||||
|
url: '/base/core-alarm-log/homeGetAlarm',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 条件查询获得异常警告列表
|
||||||
|
export function getHomeAlarmList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/core-alarm-log/listbyfilter',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -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'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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',
|
||||||
|
|||||||
@@ -49,6 +49,14 @@ export function getWarehouseAreaList(id) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获得库区设置列表
|
||||||
|
export function getWarehouseAreaListAll() {
|
||||||
|
return request({
|
||||||
|
url: '/extend/warehouse-area/listAll',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 获得库区设置分页
|
// 获得库区设置分页
|
||||||
export function getWarehouseAreaPage(query) {
|
export function getWarehouseAreaPage(query) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2023-11-02 16:20:15
|
* @Date: 2023-11-02 16:20:15
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2024-08-08 15:56:30
|
* @LastEditTime: 2024-08-21 11:03:14
|
||||||
* @Description:
|
* @Description:
|
||||||
*/
|
*/
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
@@ -41,6 +41,13 @@ export function getWarehouseLocation(id) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 库位存储详情
|
||||||
|
export function getStoreInfo(id) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/warehouse-location/getStoreInfo?id=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
// 获得库位设置列表
|
// 获得库位设置列表
|
||||||
export function getWarehouseLocationTree() {
|
export function getWarehouseLocationTree() {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -63,6 +63,14 @@ export function getWarehouseRealtimePage(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获得库存列表分页
|
||||||
|
export function inventoryPage(data) {
|
||||||
|
return request({
|
||||||
|
url: '/extend/warehouse-realtime/allPage',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
// 获得出入库-无库位-历史分页
|
// 获得出入库-无库位-历史分页
|
||||||
export function getWarehouseRealtimeHisPage(data) {
|
export function getWarehouseRealtimeHisPage(data) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
27
src/assets/icons/svg/back.svg
Normal file
27
src/assets/icons/svg/back.svg
Normal 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 |
15
src/assets/icons/svg/home-alarm-white-circle.svg
Normal file
15
src/assets/icons/svg/home-alarm-white-circle.svg
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<title></title>
|
||||||
|
<g id="主界面" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
|
<g id="主页" transform="translate(-1713.000000, -32.000000)">
|
||||||
|
<g id="icon/banner/消息" transform="translate(1713.000000, 32.000000)">
|
||||||
|
<g id="编组">
|
||||||
|
<rect id="矩形" x="0" y="0" width="24" height="24"></rect>
|
||||||
|
<path d="M13.875,20.6585751 L13.9796526,20.6647179 C14.3523487,20.7094224 14.6,20.9943408 14.6,21.3949387 C14.6,21.793137 14.3546839,22.079785 13.9805499,22.1250542 L13.8720425,22.1313899 L10.125,22.1313023 L10.0203474,22.1251595 C9.64765132,22.080455 9.4,21.7955365 9.4,21.3949387 C9.4,20.9967404 9.64531608,20.7100924 10.0194501,20.6648232 L10.1279575,20.6584875 L13.875,20.6585751 Z M12,0.930991914 L12.114202,0.938656892 C12.4461465,0.982430206 12.6786924,1.21840343 12.7188472,1.56053658 L12.7250824,1.6705356 L12.724,2.83025932 L12.975759,2.90430031 L13.2244725,2.9413468 C16.687784,3.51732717 19.3536312,6.48703662 19.5838508,10.0724929 L19.5959741,10.3244915 L19.6000064,10.5775585 L19.6,18.0623023 L20.7499628,18.1131205 L20.8641749,18.1204751 C21.1961465,18.1642484 21.4286924,18.4002216 21.4688472,18.7423548 L21.4750824,18.8523538 L21.4678171,18.9675593 C21.4246486,19.3025982 21.1922705,19.5388574 20.8555499,19.5795997 L20.7470425,19.5859353 L3.25,19.5859353 L3.14534744,19.5797049 C2.77265132,19.5350005 2.525,19.250082 2.525,18.8494841 C2.525,18.4512975 2.77030543,18.1646386 3.1443756,18.1193685 L3.25285992,18.113033 L4.35003719,18.1123023 L4.4,10.5767569 L4.40403631,10.3246942 C4.524824,6.55675169 7.34298069,3.38911146 11.0266305,2.90405757 L11.229889,2.87995432 L11.275,1.66770897 L11.2823355,1.55103724 C11.3211556,1.24947788 11.5116242,1.02739927 11.7956288,0.955808301 L11.897531,0.937079811 L12,0.930991914 Z M12,4.31312051 C8.70150639,4.31312051 5.97362451,6.99932148 5.85407645,10.3480678 L5.85000794,10.5758657 L5.849,18.0622956 L18.099,18.1123023 L18.15,10.5767635 L18.1459233,10.3480647 C18.0266869,7.00812062 15.3071214,4.31312051 12,4.31312051 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>
|
||||||
|
</g>
|
||||||
|
<circle id="Oval-1-Copy-2" fill="#F5222D" cx="18" cy="6" r="3"></circle>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.4 KiB |
@@ -8,8 +8,7 @@
|
|||||||
<rect id="矩形" x="0" y="0" width="24" height="24"></rect>
|
<rect id="矩形" x="0" y="0" width="24" height="24"></rect>
|
||||||
<path d="M13.875,20.6585751 L13.9796526,20.6647179 C14.3523487,20.7094224 14.6,20.9943408 14.6,21.3949387 C14.6,21.793137 14.3546839,22.079785 13.9805499,22.1250542 L13.8720425,22.1313899 L10.125,22.1313023 L10.0203474,22.1251595 C9.64765132,22.080455 9.4,21.7955365 9.4,21.3949387 C9.4,20.9967404 9.64531608,20.7100924 10.0194501,20.6648232 L10.1279575,20.6584875 L13.875,20.6585751 Z M12,0.930991914 L12.114202,0.938656892 C12.4461465,0.982430206 12.6786924,1.21840343 12.7188472,1.56053658 L12.7250824,1.6705356 L12.724,2.83025932 L12.975759,2.90430031 L13.2244725,2.9413468 C16.687784,3.51732717 19.3536312,6.48703662 19.5838508,10.0724929 L19.5959741,10.3244915 L19.6000064,10.5775585 L19.6,18.0623023 L20.7499628,18.1131205 L20.8641749,18.1204751 C21.1961465,18.1642484 21.4286924,18.4002216 21.4688472,18.7423548 L21.4750824,18.8523538 L21.4678171,18.9675593 C21.4246486,19.3025982 21.1922705,19.5388574 20.8555499,19.5795997 L20.7470425,19.5859353 L3.25,19.5859353 L3.14534744,19.5797049 C2.77265132,19.5350005 2.525,19.250082 2.525,18.8494841 C2.525,18.4512975 2.77030543,18.1646386 3.1443756,18.1193685 L3.25285992,18.113033 L4.35003719,18.1123023 L4.4,10.5767569 L4.40403631,10.3246942 C4.524824,6.55675169 7.34298069,3.38911146 11.0266305,2.90405757 L11.229889,2.87995432 L11.275,1.66770897 L11.2823355,1.55103724 C11.3211556,1.24947788 11.5116242,1.02739927 11.7956288,0.955808301 L11.897531,0.937079811 L12,0.930991914 Z M12,4.31312051 C8.70150639,4.31312051 5.97362451,6.99932148 5.85407645,10.3480678 L5.85000794,10.5758657 L5.849,18.0622956 L18.099,18.1123023 L18.15,10.5767635 L18.1459233,10.3480647 C18.0266869,7.00812062 15.3071214,4.31312051 12,4.31312051 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>
|
<path d="M13.875,20.6585751 L13.9796526,20.6647179 C14.3523487,20.7094224 14.6,20.9943408 14.6,21.3949387 C14.6,21.793137 14.3546839,22.079785 13.9805499,22.1250542 L13.8720425,22.1313899 L10.125,22.1313023 L10.0203474,22.1251595 C9.64765132,22.080455 9.4,21.7955365 9.4,21.3949387 C9.4,20.9967404 9.64531608,20.7100924 10.0194501,20.6648232 L10.1279575,20.6584875 L13.875,20.6585751 Z M12,0.930991914 L12.114202,0.938656892 C12.4461465,0.982430206 12.6786924,1.21840343 12.7188472,1.56053658 L12.7250824,1.6705356 L12.724,2.83025932 L12.975759,2.90430031 L13.2244725,2.9413468 C16.687784,3.51732717 19.3536312,6.48703662 19.5838508,10.0724929 L19.5959741,10.3244915 L19.6000064,10.5775585 L19.6,18.0623023 L20.7499628,18.1131205 L20.8641749,18.1204751 C21.1961465,18.1642484 21.4286924,18.4002216 21.4688472,18.7423548 L21.4750824,18.8523538 L21.4678171,18.9675593 C21.4246486,19.3025982 21.1922705,19.5388574 20.8555499,19.5795997 L20.7470425,19.5859353 L3.25,19.5859353 L3.14534744,19.5797049 C2.77265132,19.5350005 2.525,19.250082 2.525,18.8494841 C2.525,18.4512975 2.77030543,18.1646386 3.1443756,18.1193685 L3.25285992,18.113033 L4.35003719,18.1123023 L4.4,10.5767569 L4.40403631,10.3246942 C4.524824,6.55675169 7.34298069,3.38911146 11.0266305,2.90405757 L11.229889,2.87995432 L11.275,1.66770897 L11.2823355,1.55103724 C11.3211556,1.24947788 11.5116242,1.02739927 11.7956288,0.955808301 L11.897531,0.937079811 L12,0.930991914 Z M12,4.31312051 C8.70150639,4.31312051 5.97362451,6.99932148 5.85407645,10.3480678 L5.85000794,10.5758657 L5.849,18.0622956 L18.099,18.1123023 L18.15,10.5767635 L18.1459233,10.3480647 C18.0266869,7.00812062 15.3071214,4.31312051 12,4.31312051 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>
|
||||||
</g>
|
</g>
|
||||||
<circle id="Oval-1-Copy-2" fill="#F5222D" cx="18" cy="6" r="3"></circle>
|
|
||||||
</g>
|
</g>
|
||||||
</g>
|
</g>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.3 KiB |
115
src/components/ButtonNav/index.vue
Normal file
115
src/components/ButtonNav/index.vue
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
<template>
|
||||||
|
<!-- 按钮切换 -->
|
||||||
|
<div v-if="buttonMode" class="button-nav">
|
||||||
|
<button
|
||||||
|
v-for="m in menus"
|
||||||
|
:key="m"
|
||||||
|
@click="currentMenu = m"
|
||||||
|
:class="[m === currentMenu ? 'active' : '']"
|
||||||
|
>{{m}}</button>
|
||||||
|
</div>
|
||||||
|
<!-- 标签切换 -->
|
||||||
|
<div v-else class="custom-tabs" style="height: 100%; width: 100%">
|
||||||
|
<el-tabs class="tag-nav" v-model="currentMenu" style="height: 100%">
|
||||||
|
<el-tab-pane
|
||||||
|
v-for="(m, idx) in menus"
|
||||||
|
:key="m"
|
||||||
|
:label="idx == 0 ? `\u2002${m}\u2002` : `\u3000${m}\u3000`"
|
||||||
|
:name="m"
|
||||||
|
>
|
||||||
|
<slot :name="`tab${idx + 1}`"></slot>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "ButtonNav",
|
||||||
|
props: {
|
||||||
|
menus: {
|
||||||
|
type: Array,
|
||||||
|
required: true,
|
||||||
|
default: () => [],
|
||||||
|
validator: (val) => {
|
||||||
|
return val.length > 0;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
buttonMode: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
currentMenu: "",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.currentMenu = this.menus[0];
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
currentMenu(val) {
|
||||||
|
this.$emit("change", val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.button-nav {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
gap: 12px;
|
||||||
|
|
||||||
|
* {
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
height: 48px;
|
||||||
|
line-height: 48px;
|
||||||
|
cursor: pointer;
|
||||||
|
appearance: none;
|
||||||
|
outline: none;
|
||||||
|
border: none;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: rgba(22, 22, 22, 0.65);
|
||||||
|
letter-spacing: 2px;
|
||||||
|
flex: 1;
|
||||||
|
box-sizing: padding-box;
|
||||||
|
position: relative;
|
||||||
|
&.active {
|
||||||
|
color: rgba(22, 22, 22, 1);
|
||||||
|
border-bottom: 4px solid #0b58ff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.custom-tabs >>> .el-tabs__header {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
display: inline-block;
|
||||||
|
/* transform: translateY(-12px); */
|
||||||
|
}
|
||||||
|
.custom-tabs >>> .el-tabs__item {
|
||||||
|
padding-left: 0px !important;
|
||||||
|
padding-right: 0px !important;
|
||||||
|
line-height: 36px !important;
|
||||||
|
height: 36px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-tabs >>> .el-tabs__content {
|
||||||
|
height: calc(100% - 42px);
|
||||||
|
}
|
||||||
|
.custom-tabs >>> .el-tab-pane {
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: 100%;
|
||||||
|
padding: 20px;
|
||||||
|
border: 10px solid #f002;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -218,7 +218,7 @@ export default {
|
|||||||
float: left;
|
float: left;
|
||||||
height: 84px !important;
|
height: 84px !important;
|
||||||
line-height: 84px !important;
|
line-height: 84px !important;
|
||||||
color: #999093 !important;
|
color: transparent !important;
|
||||||
padding: 0 5px !important;
|
padding: 0 5px !important;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
|
|||||||
121
src/mixins/basic-add.js
Normal file
121
src/mixins/basic-add.js
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2022-08-24 11:19:43
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2023-11-02 15:33:39
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import { listData } from "@/api/system/dict/data";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
/* eslint-disable */
|
||||||
|
return {
|
||||||
|
urlOptions: {
|
||||||
|
createURL: '',
|
||||||
|
updateURL: '',
|
||||||
|
infoURL: '',
|
||||||
|
codeURL: '',
|
||||||
|
getOption: false, //是否加载获取下拉框方法
|
||||||
|
isGetCode: false, //是否加载获取code方法
|
||||||
|
getDictList: false, //是否加载获取数据字典方法
|
||||||
|
optionArrUrl: [], //需要获取下拉框的方法数组
|
||||||
|
optionArr: {}, //需要获取下拉框的方法数组的返回结果
|
||||||
|
dictList: {}, //需要获取数据字典的方法数组的返回结果
|
||||||
|
},
|
||||||
|
visible: false,
|
||||||
|
setData: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
},
|
||||||
|
activated() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init(id) {
|
||||||
|
this.dataForm.id = id || "";
|
||||||
|
this.visible = true;
|
||||||
|
if (this.urlOptions.getOption) {
|
||||||
|
this.getArr()
|
||||||
|
}
|
||||||
|
if (this.urlOptions.getDictList) {
|
||||||
|
this.getDict()
|
||||||
|
}
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs["dataForm"].resetFields();
|
||||||
|
if (this.dataForm.id) {
|
||||||
|
this.urlOptions.infoURL(id).then(response => {
|
||||||
|
this.dataForm = response.data;
|
||||||
|
if (this.setData) {
|
||||||
|
this.setDataForm()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if (this.urlOptions.isGetCode) {
|
||||||
|
this.getCode()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getCode() {
|
||||||
|
this.urlOptions.codeURL()
|
||||||
|
.then(({ data: res }) => {
|
||||||
|
this.dataForm.code = res;
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
getArr() {
|
||||||
|
const params = {
|
||||||
|
pageSize: 100,
|
||||||
|
pageNo: 1,
|
||||||
|
}
|
||||||
|
this.urlOptions.optionArrUrl.forEach((item, index) => {
|
||||||
|
item(params).then(({ data: res }) => {
|
||||||
|
this.$set(this.urlOptions.optionArr, `arr${index}`, res.list)
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 查询字典数据列表 */
|
||||||
|
getDict() {
|
||||||
|
this.nameList.forEach((item,index)=>{
|
||||||
|
const queryParams = {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 99,
|
||||||
|
dictType: item,
|
||||||
|
}
|
||||||
|
listData(queryParams).then(response => {
|
||||||
|
this.$set(this.urlOptions.dictList, `dict${index}`, response.data.list)
|
||||||
|
});
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 表单提交
|
||||||
|
dataFormSubmit() {
|
||||||
|
this.$refs["dataForm"].validate((valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 修改的提交
|
||||||
|
if (this.dataForm.id) {
|
||||||
|
this.urlOptions.updateURL(this.dataForm).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit("refreshDataList");
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 添加的提交
|
||||||
|
this.urlOptions.createURL(this.dataForm).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit("refreshDataList");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
formClear() {
|
||||||
|
if (this.$refs.dataForm!==undefined) {
|
||||||
|
this.$refs.dataForm.resetFields();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
175
src/mixins/basic-page.js
Normal file
175
src/mixins/basic-page.js
Normal file
@@ -0,0 +1,175 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2022-08-24 11:19:43
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2024-08-14 15:17:01
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
/* eslint-disable */
|
||||||
|
return {
|
||||||
|
urlOptions: {
|
||||||
|
getDataListURL: '',
|
||||||
|
deleteURL: '',
|
||||||
|
statusUrl: '',
|
||||||
|
exportURL: ''
|
||||||
|
},
|
||||||
|
tableData: [],
|
||||||
|
listQuery: {
|
||||||
|
pageSize: 20,
|
||||||
|
pageNo: 1,
|
||||||
|
total: 1,
|
||||||
|
},
|
||||||
|
exportLoading: false,
|
||||||
|
dataListLoading: false,
|
||||||
|
addOrEditTitle: '',
|
||||||
|
addOrUpdateVisible: false,
|
||||||
|
addOrUpdate: 'addOrUpdate'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getDataList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 获取数据列表
|
||||||
|
getDataList() {
|
||||||
|
this.dataListLoading = true;
|
||||||
|
this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
||||||
|
if (response.hasOwnProperty('data')) {
|
||||||
|
this.tableData = response.data.list;
|
||||||
|
this.listQuery.total = response.data.total;
|
||||||
|
} else {
|
||||||
|
this.tableData = []
|
||||||
|
}
|
||||||
|
this.dataListLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 每页数
|
||||||
|
sizeChangeHandle(val) {
|
||||||
|
this.listQuery.pageSize = val;
|
||||||
|
this.listQuery.pageNo = 1;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
// 当前页
|
||||||
|
currentChangeHandle(val) {
|
||||||
|
this.listQuery.pageNo = val;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
// 新增 / 修改
|
||||||
|
addOrUpdateHandle(id) {
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init(id);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
cancel(id) {
|
||||||
|
this.$refs["popover-" + id].showPopper = false;
|
||||||
|
},
|
||||||
|
//改变状态
|
||||||
|
changeStatus(id) {
|
||||||
|
this.$http
|
||||||
|
.post(this.urlOptions.statusUrl, { id })
|
||||||
|
.then(({ data: res }) => {
|
||||||
|
if (res.code !== 0) {
|
||||||
|
return this.$message.error(res.msg);
|
||||||
|
}
|
||||||
|
this.$refs["popover-" + id].showPopper = false;
|
||||||
|
this.$message({
|
||||||
|
message: this.$t("prompt.success"),
|
||||||
|
type: "success",
|
||||||
|
duration: 500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => { });
|
||||||
|
},
|
||||||
|
//tableBtn点击
|
||||||
|
handleClick(val) {
|
||||||
|
if (val.type === "edit") {
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.addOrEditTitle = "编辑";
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init(val.data.id);
|
||||||
|
});
|
||||||
|
} else if (val.type === "delete") {
|
||||||
|
if (val.data.name) {
|
||||||
|
this.deleteHandle(val.data.id, val.data.name)
|
||||||
|
} else {
|
||||||
|
this.setDelete(val.data)
|
||||||
|
}
|
||||||
|
} else if (val.type === "change") {
|
||||||
|
this.changeStatus(val.data.id)
|
||||||
|
} else {
|
||||||
|
this.otherMethods(val)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 删除
|
||||||
|
deleteHandle(id, name) {
|
||||||
|
this.$modal
|
||||||
|
.delConfirm(name)
|
||||||
|
.then(() => {
|
||||||
|
this.urlOptions.deleteURL(id).then(({ data }) => {
|
||||||
|
this.$message({
|
||||||
|
message: "操作成功",
|
||||||
|
type: "success",
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => { });
|
||||||
|
},
|
||||||
|
//search-bar点击
|
||||||
|
buttonClick(val) {
|
||||||
|
switch (val.btnName) {
|
||||||
|
case "search":
|
||||||
|
this.listQuery.xm1 = val.xm1;
|
||||||
|
this.listQuery.xm2 = val.xm2;
|
||||||
|
this.listQuery.pageNo = 1;
|
||||||
|
this.getDataList();
|
||||||
|
break;
|
||||||
|
case "add":
|
||||||
|
this.addOrEditTitle = '新增'
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.addOrUpdateHandle()
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.log(val)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleCancel() {
|
||||||
|
this.$refs[this.addOrUpdate].formClear()
|
||||||
|
this.addOrUpdateVisible = false
|
||||||
|
this.addOrEditTitle = ''
|
||||||
|
this.addOrUpdate = 'addOrUpdate'
|
||||||
|
},
|
||||||
|
handleConfirm() {
|
||||||
|
this.$refs[this.addOrUpdate].dataFormSubmit()
|
||||||
|
},
|
||||||
|
successSubmit() {
|
||||||
|
this.handleCancel()
|
||||||
|
this.getDataList()
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
// 处理查询参数
|
||||||
|
let params = { ...this.queryParams };
|
||||||
|
params.pageNo = undefined;
|
||||||
|
params.pageSize = undefined;
|
||||||
|
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
||||||
|
this.exportLoading = true;
|
||||||
|
return this.urlOptions.exportURL(params);
|
||||||
|
}).then(response => {
|
||||||
|
this.$download.excel(response, '报表.xls');
|
||||||
|
this.exportLoading = false;
|
||||||
|
}).catch(() => { });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
73
src/mixins/code-filter.js
Normal file
73
src/mixins/code-filter.js
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* @Date: 2020-12-29 16:49:28
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2024-08-21 11:14:58
|
||||||
|
* @FilePath: \basic-admin\src\filters\basicData\index.js
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
|
||||||
|
const table = {
|
||||||
|
lineStatus: {
|
||||||
|
1: '生产中',
|
||||||
|
2: '停止',
|
||||||
|
3: '未知',
|
||||||
|
},
|
||||||
|
deactivate: {
|
||||||
|
1: '启用',
|
||||||
|
0: '停用',
|
||||||
|
},
|
||||||
|
reportType: {
|
||||||
|
1: '日',
|
||||||
|
2: '周',
|
||||||
|
3: '月'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 日期格式化
|
||||||
|
export function parseTime(time, pattern) {
|
||||||
|
if (arguments.length === 0 || !time) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
|
||||||
|
let date
|
||||||
|
if (typeof time === 'object') {
|
||||||
|
date = time
|
||||||
|
} else {
|
||||||
|
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
|
||||||
|
time = parseInt(time)
|
||||||
|
} else if (typeof time === 'string') {
|
||||||
|
time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.\d{3}/gm),'');
|
||||||
|
}
|
||||||
|
if ((typeof time === 'number') && (time.toString().length === 10)) {
|
||||||
|
time = time * 1000
|
||||||
|
}
|
||||||
|
date = new Date(time)
|
||||||
|
}
|
||||||
|
const formatObj = {
|
||||||
|
y: date.getFullYear(),
|
||||||
|
m: date.getMonth() + 1,
|
||||||
|
d: date.getDate(),
|
||||||
|
h: date.getHours(),
|
||||||
|
i: date.getMinutes(),
|
||||||
|
s: date.getSeconds(),
|
||||||
|
a: date.getDay()
|
||||||
|
}
|
||||||
|
const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => {
|
||||||
|
let value = formatObj[key]
|
||||||
|
// Note: getDay() returns 0 on Sunday
|
||||||
|
if (key === 'a') {
|
||||||
|
return ['日', '一', '二', '三', '四', '五', '六'][value]
|
||||||
|
}
|
||||||
|
if (result.length > 0 && value < 10) {
|
||||||
|
value = '0' + value
|
||||||
|
}
|
||||||
|
return value || 0
|
||||||
|
})
|
||||||
|
return time_str
|
||||||
|
}
|
||||||
|
export default function (dictTable) {
|
||||||
|
return function (val) {
|
||||||
|
return table?.[dictTable]?.[val]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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') {
|
||||||
|
|||||||
@@ -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
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -224,6 +224,10 @@ input, textarea{
|
|||||||
left:20px;
|
left:20px;
|
||||||
font-size:21px !important
|
font-size:21px !important
|
||||||
}
|
}
|
||||||
|
.el-message-box__input {
|
||||||
|
padding-left: 57px;
|
||||||
|
padding-right: 15px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.el-message-box__btns {
|
.el-message-box__btns {
|
||||||
padding-right: 32px;
|
padding-right: 32px;
|
||||||
|
|||||||
@@ -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',
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
22
src/views/abnormalWarning/alarmGrade.vue
Normal file
22
src/views/abnormalWarning/alarmGrade.vue
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2024-09-12 14:55:26
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2024-09-12 15:00:14
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<dict-tag
|
||||||
|
:type="DICT_TYPE.EQU_ALARM_LEVEL"
|
||||||
|
:value="injectData.alarmGrade" />
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
injectData: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -34,6 +34,12 @@
|
|||||||
import Navbar from './components/Navbar';
|
import Navbar from './components/Navbar';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import tableHeightMixin from '@/mixins/tableHeightMixin';
|
import tableHeightMixin from '@/mixins/tableHeightMixin';
|
||||||
|
import { listData } from '@/api/system/dict/data';
|
||||||
|
import alarmGrade from './alarmGrade.vue'
|
||||||
|
import {
|
||||||
|
getHomeAlarmList
|
||||||
|
} from '@/api/home';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AbnormalWarning',
|
name: 'AbnormalWarning',
|
||||||
mixins: [tableHeightMixin],
|
mixins: [tableHeightMixin],
|
||||||
@@ -45,25 +51,28 @@ export default {
|
|||||||
type: 'input',
|
type: 'input',
|
||||||
label: '报警来源',
|
label: '报警来源',
|
||||||
placeholder: '报警来源',
|
placeholder: '报警来源',
|
||||||
param: 'content',
|
param: 'alarmSource',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'select',
|
type: 'datePicker',
|
||||||
label: '时间段',
|
label: '时间段',
|
||||||
selectOptions: [],
|
dateType: 'daterange',
|
||||||
labelField: 'name',
|
format: 'yyyy-MM-dd',
|
||||||
valueField: 'id',
|
valueFormat: 'timestamp',
|
||||||
param: 'typeId',
|
rangeSeparator: '-',
|
||||||
filterable: true,
|
startPlaceholder: '开始时间',
|
||||||
|
endPlaceholder: '结束时间',
|
||||||
|
param: 'alarmTime',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'select',
|
type: 'select',
|
||||||
label: '报警级别',
|
label: '报警级别',
|
||||||
selectOptions: [],
|
selectOptions: [],
|
||||||
labelField: 'name',
|
param: 'alarmGrade',
|
||||||
valueField: 'id',
|
defaultSelect: '',
|
||||||
param: 'typeId',
|
|
||||||
filterable: true,
|
filterable: true,
|
||||||
|
labelField: 'label',
|
||||||
|
valueField: 'value',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'button',
|
type: 'button',
|
||||||
@@ -75,60 +84,79 @@ export default {
|
|||||||
heightNum: 280,
|
heightNum: 280,
|
||||||
tableProps: [
|
tableProps: [
|
||||||
{
|
{
|
||||||
prop: 'createTime',
|
prop: 'alarmTime',
|
||||||
label: '报警时间',
|
label: '报警时间',
|
||||||
width: 180,
|
width: 180,
|
||||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'productionLineName1',
|
prop: 'alarmSource',
|
||||||
label: '报警来源',
|
label: '报警来源',
|
||||||
showOverflowtooltip: true,
|
showOverflowtooltip: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'productionLineName2',
|
prop: 'alarmType',
|
||||||
label: '报警类型',
|
label: '报警类型',
|
||||||
showOverflowtooltip: true,
|
showOverflowtooltip: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'productionLineName3',
|
prop: 'alarmGrade',
|
||||||
label: '报警级别',
|
label: '报警级别',
|
||||||
showOverflowtooltip: true,
|
showOverflowtooltip: true,
|
||||||
|
subcomponent: alarmGrade
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'productionLineName4',
|
prop: 'alarmReason',
|
||||||
label: '报警原因',
|
label: '报警原因',
|
||||||
showOverflowtooltip: true,
|
showOverflowtooltip: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'sectionName5',
|
prop: 'alarmContent',
|
||||||
label: '报警详情',
|
label: '报警详情',
|
||||||
showOverflowtooltip: true,
|
showOverflowtooltip: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
list: [
|
list: [],
|
||||||
{ productionLineName: 1 },
|
listQuery: {
|
||||||
{ productionLineName: 1 },
|
alarmSource: undefined,
|
||||||
{ productionLineName: 1 },
|
alarmTime: undefined,
|
||||||
{ productionLineName: 1 },
|
alarmGrade: undefined,
|
||||||
{ productionLineName: 1 },
|
}
|
||||||
{ productionLineName: 1 },
|
|
||||||
{ productionLineName: 1 },
|
|
||||||
{ productionLineName: 1 },
|
|
||||||
{ productionLineName: 1 },
|
|
||||||
{ productionLineName: 1 },
|
|
||||||
{ productionLineName: 1 },
|
|
||||||
{ productionLineName: 1 },
|
|
||||||
{ productionLineName: 1 },
|
|
||||||
{ productionLineName: 1 },
|
|
||||||
{ productionLineName: 1 },
|
|
||||||
{ productionLineName: 1 },
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {},
|
created() {
|
||||||
|
const queryParams = {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 99,
|
||||||
|
dictType: 'equ_alarm_level',
|
||||||
|
};
|
||||||
|
listData(queryParams).then((response) => {
|
||||||
|
this.formConfig[2].selectOptions = response.data.list;
|
||||||
|
});
|
||||||
|
this.getDataList()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
buttonClick(val) {},
|
buttonClick(val) {
|
||||||
|
switch (val.btnName) {
|
||||||
|
case 'search':
|
||||||
|
this.listQuery.alarmSource = val.alarmSource;
|
||||||
|
this.listQuery.alarmGrade = val.alarmGrade;
|
||||||
|
this.listQuery.alarmTime = val.alarmTime ? val.alarmTime : null;
|
||||||
|
this.getDataList();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.log(val);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getDataList(){
|
||||||
|
getHomeAlarmList(this.listQuery).then(response => {
|
||||||
|
if(response.hasOwnProperty('data')){
|
||||||
|
this.list = response.data;
|
||||||
|
}else{
|
||||||
|
this.list = []
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
toHome() {
|
toHome() {
|
||||||
this.$router.push({ path: '/' });
|
this.$router.push({ path: '/' });
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import basicAdd from '../../core/mixins/basic-add';
|
import basicAdd from '@/mixins/basic-add';
|
||||||
import { createCustomer, updateCustomer, getCustomer, getCode } from "@/api/base/coreCustomer";
|
import { createCustomer, updateCustomer, getCustomer, getCode } from "@/api/base/coreCustomer";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
:table-props="tableProps"
|
:table-props="tableProps"
|
||||||
:page="listQuery.pageNo"
|
:page="listQuery.pageNo"
|
||||||
:limit="listQuery.pageSize"
|
:limit="listQuery.pageSize"
|
||||||
|
:max-height="tableH"
|
||||||
:table-data="tableData">
|
:table-data="tableData">
|
||||||
<method-btn
|
<method-btn
|
||||||
v-if="tableBtn.length"
|
v-if="tableBtn.length"
|
||||||
@@ -39,18 +40,20 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import AddOrUpdate from './add-or-updata';
|
import AddOrUpdate from './add-or-updata';
|
||||||
import basicPage from '../../core/mixins/basic-page';
|
import basicPage from '@/mixins/basic-page';
|
||||||
import { parseTime } from '../../core/mixins/code-filter';
|
import { parseTime } from '../../core/mixins/code-filter';
|
||||||
import {
|
import {
|
||||||
getCustomerPage,
|
getCustomerPage,
|
||||||
deleteCustomer
|
deleteCustomer
|
||||||
} from '@/api/base/coreCustomer';
|
} from '@/api/base/coreCustomer';
|
||||||
|
import tableHeightMixin from '@/mixins/tableHeightMixin';
|
||||||
|
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
prop: 'createTime',
|
prop: 'createTime',
|
||||||
label: '添加时间',
|
label: '添加时间',
|
||||||
filter: parseTime
|
filter: parseTime,
|
||||||
|
width: 150
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'name',
|
prop: 'name',
|
||||||
@@ -58,7 +61,8 @@ const tableProps = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'code',
|
prop: 'code',
|
||||||
label: '客户编码'
|
label: '客户编码',
|
||||||
|
width: 150
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'contact',
|
prop: 'contact',
|
||||||
@@ -79,7 +83,7 @@ const tableProps = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [basicPage],
|
mixins: [basicPage,tableHeightMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
urlOptions: {
|
urlOptions: {
|
||||||
@@ -133,27 +137,18 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {},
|
created() {},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取数据列表
|
|
||||||
// getDataList() {
|
|
||||||
// this.dataListLoading = true;
|
|
||||||
// this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
|
||||||
// this.tableData = response.data.list;
|
|
||||||
// this.listQuery.total = response.data.total;
|
|
||||||
// this.dataListLoading = false;
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
buttonClick(val) {
|
buttonClick(val) {
|
||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.name = val.name ? val.name : undefined;
|
this.listQuery.name = val.name ? val.name : undefined;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
break;
|
break;
|
||||||
case 'reset':
|
case 'reset':
|
||||||
this.$refs.searchBarForm.resetForm();
|
this.$refs.searchBarForm.resetForm();
|
||||||
this.listQuery = {
|
this.listQuery = {
|
||||||
pageSize: 10,
|
pageSize: 20,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
total: 1,
|
total: 1,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2021-11-18 14:16:25
|
* @Date: 2021-11-18 14:16:25
|
||||||
* @LastEditors: DY
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2023-11-22 10:27:43
|
* @LastEditTime: 2024-08-14 15:15:45
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import basicAdd from '../../core/mixins/basic-add';
|
import basicAdd from '@/mixins/basic-add';
|
||||||
import { createCoreSupplier, updateCoreSupplier, getCoreSupplier, getCode } from "@/api/base/coreSupplier";
|
import { createCoreSupplier, updateCoreSupplier, getCoreSupplier, getCode } from "@/api/base/coreSupplier";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -112,7 +112,7 @@ export default {
|
|||||||
if (this.dataForm.id) {
|
if (this.dataForm.id) {
|
||||||
this.urlOptions.updateURL(this.dataForm).then(response => {
|
this.urlOptions.updateURL(this.dataForm).then(response => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
this.$emit("refreshDataList");
|
this.$emit("refreshDataList");
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
:table-props="tableProps"
|
:table-props="tableProps"
|
||||||
:page="listQuery.pageNo"
|
:page="listQuery.pageNo"
|
||||||
:limit="listQuery.pageSize"
|
:limit="listQuery.pageSize"
|
||||||
|
:max-height="tableH"
|
||||||
:table-data="tableData">
|
:table-data="tableData">
|
||||||
<method-btn
|
<method-btn
|
||||||
v-if="tableBtn.length"
|
v-if="tableBtn.length"
|
||||||
@@ -39,52 +40,55 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import AddOrUpdate from './add-or-updata';
|
import AddOrUpdate from './add-or-updata';
|
||||||
import basicPage from '../../core/mixins/basic-page';
|
import basicPage from '@/mixins/basic-page';
|
||||||
import { parseTime } from '../../core/mixins/code-filter';
|
import { parseTime } from '../../core/mixins/code-filter';
|
||||||
import {
|
import {
|
||||||
getCoreSupplierPage,
|
getCoreSupplierPage,
|
||||||
deleteCoreSupplier
|
deleteCoreSupplier,
|
||||||
} from '@/api/base/coreSupplier';
|
} from '@/api/base/coreSupplier';
|
||||||
|
import tableHeightMixin from '@/mixins/tableHeightMixin';
|
||||||
|
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
prop: 'createTime',
|
prop: 'createTime',
|
||||||
label: '添加时间',
|
label: '添加时间',
|
||||||
filter: parseTime
|
filter: parseTime,
|
||||||
|
width: 150,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'code',
|
prop: 'code',
|
||||||
label: '供应商编码'
|
label: '供应商编码',
|
||||||
|
width: 150,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'name',
|
prop: 'name',
|
||||||
label: '供应商名称'
|
label: '供应商名称',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'contact',
|
prop: 'contact',
|
||||||
label: '联系人'
|
label: '联系人',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'telephone',
|
prop: 'telephone',
|
||||||
label: '联系电话'
|
label: '联系电话',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'address',
|
prop: 'address',
|
||||||
label: '地址'
|
label: '地址',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'remark',
|
prop: 'remark',
|
||||||
label: '备注'
|
label: '备注',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [basicPage],
|
mixins: [basicPage, tableHeightMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
urlOptions: {
|
urlOptions: {
|
||||||
getDataListURL: getCoreSupplierPage,
|
getDataListURL: getCoreSupplierPage,
|
||||||
deleteURL: deleteCoreSupplier
|
deleteURL: deleteCoreSupplier,
|
||||||
},
|
},
|
||||||
tableProps,
|
tableProps,
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
@@ -94,13 +98,13 @@ export default {
|
|||||||
btnName: '编辑',
|
btnName: '编辑',
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
this.$auth.hasPermi(`base:core-supplier:delete`)
|
this.$auth.hasPermi(`base:core-supplier:delete`)
|
||||||
? {
|
? {
|
||||||
type: 'delete',
|
type: 'delete',
|
||||||
btnName: '删除',
|
btnName: '删除',
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
].filter((v)=>v),
|
].filter((v) => v),
|
||||||
tableData: [],
|
tableData: [],
|
||||||
formConfig: [
|
formConfig: [
|
||||||
{
|
{
|
||||||
@@ -119,11 +123,13 @@ export default {
|
|||||||
type: 'separate',
|
type: 'separate',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: this.$auth.hasPermi('base:core-supplier:create') ? 'button' : '',
|
type: this.$auth.hasPermi('base:core-supplier:create')
|
||||||
|
? 'button'
|
||||||
|
: '',
|
||||||
btnName: '新增',
|
btnName: '新增',
|
||||||
name: 'add',
|
name: 'add',
|
||||||
color: 'success',
|
color: 'success',
|
||||||
plain: true
|
plain: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
@@ -134,14 +140,14 @@ export default {
|
|||||||
created() {},
|
created() {},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
// getDataList() {
|
// getDataList() {
|
||||||
// this.dataListLoading = true;
|
// this.dataListLoading = true;
|
||||||
// this.urlOptions.getDataListURL(this.listQuery).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.listQuery.total = response.data.total;
|
||||||
// this.dataListLoading = false;
|
// this.dataListLoading = false;
|
||||||
// });
|
// });
|
||||||
// },
|
// },
|
||||||
buttonClick(val) {
|
buttonClick(val) {
|
||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
|
|||||||
@@ -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) => {
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
253
src/views/delivery/deliveryLogDet/components/detailButton.vue
Normal file
253
src/views/delivery/deliveryLogDet/components/detailButton.vue
Normal 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>
|
||||||
153
src/views/delivery/deliveryLogDet/components/shippingBtn.vue
Normal file
153
src/views/delivery/deliveryLogDet/components/shippingBtn.vue
Normal 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>
|
||||||
@@ -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>
|
||||||
|
|||||||
@@ -0,0 +1,399 @@
|
|||||||
|
<!--
|
||||||
|
filename: AssetsUpload.vue
|
||||||
|
author: liubin
|
||||||
|
date: 2023-10-12 16:40:14
|
||||||
|
description: 上传资料/图片 组件
|
||||||
|
-->
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="assets-upload">
|
||||||
|
<section class="operations">
|
||||||
|
<el-button type="text" class="expand-btn" @click="expand = !expand">
|
||||||
|
<i class="el-icon-folder-opened" v-if="expand"></i>
|
||||||
|
<i class="el-icon-folder" v-else></i>
|
||||||
|
展开
|
||||||
|
</el-button>
|
||||||
|
<!-- <div class="preview-btn">
|
||||||
|
<i class="el-icon-view"></i>
|
||||||
|
预览
|
||||||
|
</div> -->
|
||||||
|
</section>
|
||||||
|
<section
|
||||||
|
class="file-area"
|
||||||
|
:style="{
|
||||||
|
height: expand ? 'auto' : isPicMode ? '180px' : '152px',
|
||||||
|
gap: isPicMode ? '0 24px' : '24px',
|
||||||
|
gridAutoRows: isPicMode ? '180px' : '152px',
|
||||||
|
}">
|
||||||
|
<el-upload
|
||||||
|
class="equipment-upload"
|
||||||
|
:disabled="disabled"
|
||||||
|
drag
|
||||||
|
:action="uploadUrl"
|
||||||
|
:headers="headers"
|
||||||
|
multiple
|
||||||
|
:show-file-list="false"
|
||||||
|
:before-upload="beforeUpload"
|
||||||
|
:on-success="handleSuccess">
|
||||||
|
<i class="el-icon-upload"></i>
|
||||||
|
<div class="el-upload__text">
|
||||||
|
<span>将文件拖到此处或</span>
|
||||||
|
<em>点击上传</em>
|
||||||
|
</div>
|
||||||
|
<div class="el-upload__tip" slot="tip">
|
||||||
|
{{
|
||||||
|
isPicMode ? '仅支持上传 .jpg .png 格式文件, 且' : ''
|
||||||
|
}}文件大小不超过2MB
|
||||||
|
</div>
|
||||||
|
</el-upload>
|
||||||
|
<div
|
||||||
|
v-for="(file, index) in files"
|
||||||
|
:key="file.fileName"
|
||||||
|
style="width: 100%">
|
||||||
|
<div
|
||||||
|
class="file-list__item"
|
||||||
|
v-if="!isPicMode"
|
||||||
|
:style="{
|
||||||
|
background: isPicMode
|
||||||
|
? `url(${file.fileUrl}) no-repeat`
|
||||||
|
: `url(${defaultBg}) no-repeat`,
|
||||||
|
backgroundSize: isPicMode ? '100% 100%' : '64px',
|
||||||
|
backgroundPosition: isPicMode ? '0% 0%' : 'center',
|
||||||
|
}"
|
||||||
|
@click="handleDownload(file)"
|
||||||
|
:data-name="file.fileName">
|
||||||
|
<el-button
|
||||||
|
v-if="!disabled"
|
||||||
|
type="text"
|
||||||
|
class="el-icon-delete"
|
||||||
|
style="padding: 0"
|
||||||
|
@click="(e) => handleDelete(file)" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-image
|
||||||
|
v-else
|
||||||
|
class="file-list__item"
|
||||||
|
style="width: 100%"
|
||||||
|
:src="file.fileUrl"
|
||||||
|
:preview-src-list="files.map((item) => item.fileUrl)"></el-image>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getAccessToken } from '@/utils/auth';
|
||||||
|
import defaultBg from '@/assets/images/default-file-icon.png';
|
||||||
|
|
||||||
|
function checkSize(file, message) {
|
||||||
|
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||||
|
if (!isLt2M) {
|
||||||
|
message.error('上传文件大小不能超过 2MB!');
|
||||||
|
}
|
||||||
|
return isLt2M;
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkPic(file, message) {
|
||||||
|
const isJPG = file.type === 'image/jpeg';
|
||||||
|
const isPNG = file.type === 'image/png';
|
||||||
|
const isPic = isJPG || isPNG;
|
||||||
|
if (!isPic) {
|
||||||
|
message.error('上传图片只能是 JPG/PNG 格式!');
|
||||||
|
}
|
||||||
|
return isPic;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'AssetsUpload',
|
||||||
|
components: {},
|
||||||
|
model: {
|
||||||
|
prop: 'dataSource',
|
||||||
|
event: 'update',
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
default: 'image',
|
||||||
|
},
|
||||||
|
dataSource: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
equipmentId: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
isPicMode: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
disabled: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
emits: ['update-filelist'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
defaultBg,
|
||||||
|
expand: false,
|
||||||
|
headers: { Authorization: 'Bearer ' + getAccessToken() }, // 设置上传的请求头部
|
||||||
|
fileList: [],
|
||||||
|
uploadUrl: process.env.VUE_APP_BASE_API + '/admin-api/infra/file/upload',
|
||||||
|
files: [],
|
||||||
|
updateTimer: null,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
dataSource: {
|
||||||
|
handler(val) {
|
||||||
|
this.files = JSON.parse(JSON.stringify(val));
|
||||||
|
},
|
||||||
|
immediate: true,
|
||||||
|
deep: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {},
|
||||||
|
methods: {
|
||||||
|
// handle success, per file!
|
||||||
|
handleSuccess(response, file, fileList) {
|
||||||
|
this.$notify({
|
||||||
|
title: '成功',
|
||||||
|
message: '上传成功! 点击确认保存上传结果',
|
||||||
|
type: 'success',
|
||||||
|
});
|
||||||
|
if (
|
||||||
|
response == null ||
|
||||||
|
!('data' in response) ||
|
||||||
|
response.data == null ||
|
||||||
|
response.data.trim() == ''
|
||||||
|
) {
|
||||||
|
this.$message.error('上传出错了!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.files.push({
|
||||||
|
fileName: file.name,
|
||||||
|
fileUrl: response.data,
|
||||||
|
fileType: this.isPicMode ? 1 : 2,
|
||||||
|
});
|
||||||
|
// debugger;
|
||||||
|
|
||||||
|
// 延时更新
|
||||||
|
if (this.updateTimer) {
|
||||||
|
clearTimeout(this.updateTimer);
|
||||||
|
}
|
||||||
|
this.updateTimer = setTimeout(() => {
|
||||||
|
// console.log('[AssetsUpload] 更新上传列表');
|
||||||
|
this.emitFilelist();
|
||||||
|
clearTimeout(this.updateTimer);
|
||||||
|
this.updateTimer = null;
|
||||||
|
}, 500);
|
||||||
|
},
|
||||||
|
|
||||||
|
async handleDownload(file) {
|
||||||
|
if (this.isPicMode) {
|
||||||
|
// this.$emit('preview', file);
|
||||||
|
const link = document.createElement('a');
|
||||||
|
link.href = file.fileUrl;
|
||||||
|
link.target = '_blank';
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
document.body.removeChild(link);
|
||||||
|
} else {
|
||||||
|
// this.$emit('download', file);
|
||||||
|
const data = await this.$axios({
|
||||||
|
url: file.fileUrl,
|
||||||
|
method: 'get',
|
||||||
|
responseType: 'blob',
|
||||||
|
});
|
||||||
|
const link = document.createElement('a');
|
||||||
|
link.href = window.URL.createObjectURL(new Blob([data]));
|
||||||
|
link.download = file.fileName;
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
document.body.removeChild(link);
|
||||||
|
window.URL.revokeObjectURL(link.href);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
emitFilelist() {
|
||||||
|
this.$emit('update', this.files);
|
||||||
|
},
|
||||||
|
|
||||||
|
handleRemove(file, fileList) {
|
||||||
|
debugger;
|
||||||
|
},
|
||||||
|
|
||||||
|
handleDelete(file) {
|
||||||
|
// fileName fileType 都可能一样,但 fileUrl 一定不一样
|
||||||
|
this.files = this.files.filter((item) => item.fileUrl != file.fileUrl);
|
||||||
|
this.$notify({
|
||||||
|
title: '成功',
|
||||||
|
message: '删除成功! 需点击确认保存删除结果',
|
||||||
|
type: 'success',
|
||||||
|
});
|
||||||
|
this.emitFilelist();
|
||||||
|
},
|
||||||
|
|
||||||
|
beforeUpload(file) {
|
||||||
|
if (this.isPicMode) {
|
||||||
|
return checkPic(file, this.$message) && checkSize(file, this.$message);
|
||||||
|
}
|
||||||
|
return checkSize(file, this.$message);
|
||||||
|
},
|
||||||
|
|
||||||
|
handleUpload() {
|
||||||
|
switch (this.type) {
|
||||||
|
case 'image':
|
||||||
|
break;
|
||||||
|
case 'asset':
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
updateFileList(appendFilelist) {
|
||||||
|
// Array
|
||||||
|
this.$emit('update-filelist', this.appendFilelist);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.assets-upload {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.operations {
|
||||||
|
position: absolute;
|
||||||
|
top: -36px;
|
||||||
|
right: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.expand-btn,
|
||||||
|
.preview-btn {
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 1.2;
|
||||||
|
display: inline-block;
|
||||||
|
padding-left: 20px;
|
||||||
|
cursor: pointer;
|
||||||
|
z-index: 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.expand-btn {
|
||||||
|
margin-right: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preview-btn {
|
||||||
|
color: #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.expand-btn,
|
||||||
|
.preview-btn:hover,
|
||||||
|
.preview-btn.active {
|
||||||
|
// color: #0042d0;
|
||||||
|
color: #0b58ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.equipment-upload) {
|
||||||
|
.el-upload-dragger {
|
||||||
|
width: 188px;
|
||||||
|
height: 128px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-icon-upload {
|
||||||
|
margin: 12px 0;
|
||||||
|
font-size: 48px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-upload__text {
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 2px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
em {
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-upload__tip {
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.5;
|
||||||
|
color: #d1d1d1;
|
||||||
|
margin: 0 0 12px;
|
||||||
|
transform: translateY(-12px);
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.equipment-upload {
|
||||||
|
margin-bottom: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-list {
|
||||||
|
padding: 12px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
// custom
|
||||||
|
.file-area {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fill, 188px);
|
||||||
|
grid-auto-rows: 152px;
|
||||||
|
gap: 48px 24px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-list__item {
|
||||||
|
height: 128px;
|
||||||
|
background-color: #fff;
|
||||||
|
border: 1px dashed #d9d9d9;
|
||||||
|
border-radius: 6px;
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
|
text-align: center;
|
||||||
|
cursor: pointer;
|
||||||
|
position: relative;
|
||||||
|
// overflow: hidden;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
.el-icon-delete {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-icon-delete {
|
||||||
|
color: #ccc;
|
||||||
|
position: absolute;
|
||||||
|
top: 8px;
|
||||||
|
right: 8px;
|
||||||
|
display: none;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: rgb(210, 41, 41);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-list__item:hover {
|
||||||
|
border-color: #0b58ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-list__item::after {
|
||||||
|
content: attr(data-name);
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
bottom: -26px;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 2;
|
||||||
|
color: #616161;
|
||||||
|
}
|
||||||
|
|
||||||
|
.default-icon {
|
||||||
|
background: url(../../../../../assets/images/default-file-icon.png) no-repeat;
|
||||||
|
background-position: center;
|
||||||
|
background-size: 64px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
313
src/views/devConfig/base/coreEquipment/components/DialogForm.vue
Normal file
313
src/views/devConfig/base/coreEquipment/components/DialogForm.vue
Normal file
@@ -0,0 +1,313 @@
|
|||||||
|
<!--
|
||||||
|
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]"
|
||||||
|
@change="$emit('update', form)"
|
||||||
|
:placeholder="`请输入${col.label}`"
|
||||||
|
v-bind="col.bind" />
|
||||||
|
<el-select
|
||||||
|
v-if="col.select"
|
||||||
|
v-model="form[col.prop]"
|
||||||
|
:placeholder="`请选择${col.label}`"
|
||||||
|
@change="$emit('update', form)"
|
||||||
|
v-bind="col.bind">
|
||||||
|
<el-option
|
||||||
|
v-for="opt in optionListOf[col.prop]"
|
||||||
|
:key="opt.value"
|
||||||
|
:label="opt.label"
|
||||||
|
:value="opt.value" />
|
||||||
|
</el-select>
|
||||||
|
<el-date-picker
|
||||||
|
v-if="col.datetime"
|
||||||
|
v-model="form[col.prop]"
|
||||||
|
type="datetime"
|
||||||
|
:placeholder="`请选择${col.label}`"
|
||||||
|
value-format="timestamp"
|
||||||
|
v-bind="col.bind"></el-date-picker>
|
||||||
|
<el-upload
|
||||||
|
class="upload-in-dialog"
|
||||||
|
v-if="col.upload"
|
||||||
|
:file-list="uploadedFileList"
|
||||||
|
:action="col.url"
|
||||||
|
:on-success="handleUploadSuccess"
|
||||||
|
v-bind="col.bind">
|
||||||
|
<el-button
|
||||||
|
size="small"
|
||||||
|
type="primary"
|
||||||
|
:disabled="col.bind?.disabled || false">
|
||||||
|
点击上传
|
||||||
|
</el-button>
|
||||||
|
<div class="el-upload__tip" slot="tip" v-if="col.uploadTips">
|
||||||
|
{{ col.uploadTips || '只能上传jpg/png文件,大小不超过2MB' }}
|
||||||
|
</div>
|
||||||
|
</el-upload>
|
||||||
|
<el-switch
|
||||||
|
v-if="col.switch"
|
||||||
|
v-model="form[col.prop]"
|
||||||
|
active-color="#0b58ff"
|
||||||
|
inactive-color="#e1e1e1"
|
||||||
|
v-bind="col.bind"></el-switch>
|
||||||
|
<component
|
||||||
|
v-if="col.subcomponent"
|
||||||
|
:key="col.key"
|
||||||
|
:is="col.subcomponent"
|
||||||
|
v-bind="col.bind"
|
||||||
|
:inlineStyle="col.style"></component>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
/**
|
||||||
|
* 找到最长的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;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return max;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DialogForm',
|
||||||
|
model: {
|
||||||
|
prop: 'dataForm',
|
||||||
|
event: 'update',
|
||||||
|
},
|
||||||
|
emits: ['update'],
|
||||||
|
components: {},
|
||||||
|
props: {
|
||||||
|
rows: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
dataForm: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
|
disabled: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
labelPosition: {
|
||||||
|
type: String,
|
||||||
|
default: 'right',
|
||||||
|
},
|
||||||
|
size: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
formLoading: true,
|
||||||
|
optionListOf: {},
|
||||||
|
uploadedFileList: [],
|
||||||
|
dataLoaded: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
labelWidth() {
|
||||||
|
let max = findMaxLabelWidth(this.rows);
|
||||||
|
// 每个汉字占20px
|
||||||
|
return max * 20;
|
||||||
|
// return max * 20 + 'px';
|
||||||
|
},
|
||||||
|
form: {
|
||||||
|
get() {
|
||||||
|
// if (this.dataLoaded) return this.dataForm;
|
||||||
|
// else return {}
|
||||||
|
return this.dataForm;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
console.log('set form', val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
rows: {
|
||||||
|
handler() {
|
||||||
|
console.log('watch triggered!');
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.handleOptions('watch');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
immediate: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
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) {
|
||||||
|
console.log('[handleOptions] setting watch');
|
||||||
|
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: true,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
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, fileList) {
|
||||||
|
console.log(
|
||||||
|
'[dialogForm:handleUploadSuccess]',
|
||||||
|
response,
|
||||||
|
file,
|
||||||
|
fileList,
|
||||||
|
this.form
|
||||||
|
);
|
||||||
|
// 保存原始文件名
|
||||||
|
if ('fileNames' in this.form) this.form.fileNames.push(file.name);
|
||||||
|
// 保存完整地址
|
||||||
|
if ('fileUrls' in this.form) this.form.fileUrls.push(response.data);
|
||||||
|
this.$modal.msgSuccess('上传成功');
|
||||||
|
},
|
||||||
|
|
||||||
|
getFileName(fileUrl) {
|
||||||
|
return fileUrl.split('/').pop();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.el-date-editor,
|
||||||
|
.el-select {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,550 @@
|
|||||||
|
<!--
|
||||||
|
filename: EquipmentDrawer.vue
|
||||||
|
author: liubin
|
||||||
|
date: 2023-08-22 14:38:56
|
||||||
|
description:
|
||||||
|
-->
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<el-drawer
|
||||||
|
:visible="visible"
|
||||||
|
:show-close="false"
|
||||||
|
:wrapper-closable="false"
|
||||||
|
class="drawer"
|
||||||
|
custom-class="mes-drawer"
|
||||||
|
size="60%"
|
||||||
|
@closed="$emit('destroy')">
|
||||||
|
<SmallTitle slot="title">
|
||||||
|
{{
|
||||||
|
mode.includes('detail')
|
||||||
|
? '详情'
|
||||||
|
: mode.includes('edit')
|
||||||
|
? '编辑'
|
||||||
|
: '新增'
|
||||||
|
}}
|
||||||
|
</SmallTitle>
|
||||||
|
|
||||||
|
<div class="drawer-body flex">
|
||||||
|
<div class="drawer-body__content">
|
||||||
|
<section v-for="(section, index) in sections" :key="section.key">
|
||||||
|
<SmallTitle v-if="index != 0">{{ section.name }}</SmallTitle>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="form-part"
|
||||||
|
v-if="section.key == 'base'"
|
||||||
|
style="margin-bottom: 32px">
|
||||||
|
<el-skeleton v-if="!showForm" animated />
|
||||||
|
<EquipmentInfoForm
|
||||||
|
key="drawer-dialog-form"
|
||||||
|
v-if="showForm"
|
||||||
|
:disabled="mode.includes('detail')"
|
||||||
|
:sync-filelist="syncFileListFlag"
|
||||||
|
v-model="form" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
v-if="section.key == 'attrs'"
|
||||||
|
style="margin-top: 12px; position: relative">
|
||||||
|
<div
|
||||||
|
v-if="!mode.includes('detail')"
|
||||||
|
style="position: absolute; top: -40px; right: 0">
|
||||||
|
<el-button @click="handleAddAttr" type="text">
|
||||||
|
<i class="el-icon-plus"></i>
|
||||||
|
添加属性
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
<base-table
|
||||||
|
v-loading="attrListLoading"
|
||||||
|
:table-props="section.props"
|
||||||
|
:page="attrQuery?.params.pageNo || 1"
|
||||||
|
:limit="attrQuery?.params.pageSize || 10"
|
||||||
|
:table-data="list"
|
||||||
|
@emitFun="handleEmitFun">
|
||||||
|
<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'"
|
||||||
|
@emitButtonClick="handleAddAttr" -->
|
||||||
|
<method-btn
|
||||||
|
v-if="section.tableBtn"
|
||||||
|
slot="handleBtn"
|
||||||
|
label="操作"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleTableBtnClick" />
|
||||||
|
</base-table>
|
||||||
|
|
||||||
|
<!-- 分页组件 -->
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="attrQuery.params.pageNo"
|
||||||
|
:limit.sync="attrQuery.params.pageSize"
|
||||||
|
@pagination="getAttrList" />
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="drawer-body__footer">
|
||||||
|
<el-button style="" @click="handleCancel">取消</el-button>
|
||||||
|
<el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button v-else type="primary" @click="handleConfirm">保存</el-button>
|
||||||
|
<!-- sections的第二项必须是 属性列表 -->
|
||||||
|
<!-- <el-button
|
||||||
|
v-if="sections[1].allowAdd"
|
||||||
|
type="primary"
|
||||||
|
@click="handleAddAttr">
|
||||||
|
添加属性
|
||||||
|
</el-button> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 属性对话框 -->
|
||||||
|
<base-dialog
|
||||||
|
v-if="sections[1].allowAdd"
|
||||||
|
:dialogTitle="attrTitle"
|
||||||
|
:dialogVisible="attrFormVisible"
|
||||||
|
width="35%"
|
||||||
|
:append-to-body="true"
|
||||||
|
custom-class="baseDialog"
|
||||||
|
@close="closeAttrForm"
|
||||||
|
@cancel="closeAttrForm"
|
||||||
|
@confirm="submitAttrForm">
|
||||||
|
<DialogForm
|
||||||
|
v-if="attrFormVisible"
|
||||||
|
ref="attrForm"
|
||||||
|
:dataForm="attrForm"
|
||||||
|
:rows="attrRows" />
|
||||||
|
</base-dialog>
|
||||||
|
</el-drawer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import DialogForm from './DialogForm';
|
||||||
|
import EquipmentInfoForm from './EquipmentInfoForm.vue';
|
||||||
|
|
||||||
|
const SmallTitle = {
|
||||||
|
name: 'SmallTitle',
|
||||||
|
props: ['size'],
|
||||||
|
components: {},
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
methods: {},
|
||||||
|
render: function (h) {
|
||||||
|
return h(
|
||||||
|
'span',
|
||||||
|
{
|
||||||
|
class: 'small-title',
|
||||||
|
style: {
|
||||||
|
fontSize: '18px',
|
||||||
|
lineHeight:
|
||||||
|
this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
|
||||||
|
fontWeight: 500,
|
||||||
|
fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
this.$slots.default
|
||||||
|
);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { SmallTitle, DialogForm, EquipmentInfoForm },
|
||||||
|
props: ['sections', 'mode', 'dataId'], // dataId 作为一个通用的存放id的字段
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
visible: false,
|
||||||
|
showForm: false,
|
||||||
|
btnLoading: false,
|
||||||
|
total: 0,
|
||||||
|
form: {},
|
||||||
|
list: [],
|
||||||
|
attrTitle: '',
|
||||||
|
attrForm: {
|
||||||
|
id: null,
|
||||||
|
equipmentId: null,
|
||||||
|
name: '',
|
||||||
|
value: '',
|
||||||
|
},
|
||||||
|
attrFormVisible: false,
|
||||||
|
attrRows: [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '属性名称',
|
||||||
|
prop: 'name',
|
||||||
|
rules: [
|
||||||
|
{ required: true, message: '属性名称不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '属性值',
|
||||||
|
prop: 'value',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
|
attrQuery: {
|
||||||
|
params: {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
},
|
||||||
|
}, // 属性列表的请求
|
||||||
|
infoQuery: null, // 基本信息的请求
|
||||||
|
attrFormSubmitting: false,
|
||||||
|
attrListLoading: false,
|
||||||
|
syncFileListFlag: null,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
formRows() {
|
||||||
|
return this.sections[0].rows.map((row) => {
|
||||||
|
return row.map((col) => {
|
||||||
|
if (col.key == 'eq-pics') {
|
||||||
|
// 重置图片的位置
|
||||||
|
return {
|
||||||
|
...col,
|
||||||
|
bind: {
|
||||||
|
...col.bind,
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
left: 0,
|
||||||
|
right: 'unset',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
...col,
|
||||||
|
bind: {
|
||||||
|
...col.bind,
|
||||||
|
// 详情 模式下,禁用各种输入
|
||||||
|
disabled: this.mode == 'detail',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
tableBtn() {
|
||||||
|
return this.mode == 'detail' ? [] : this.sections[1].tableBtn;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
for (const section of this.sections) {
|
||||||
|
// 请求具体信息
|
||||||
|
if ('url' in section) {
|
||||||
|
const query = {
|
||||||
|
url: section.url,
|
||||||
|
method: section.method || 'get',
|
||||||
|
params: section.queryParams || null,
|
||||||
|
data: section.data || null,
|
||||||
|
};
|
||||||
|
this.$axios(query).then(({ data }) => {
|
||||||
|
if (section.key == 'base') {
|
||||||
|
this.form = data;
|
||||||
|
// this.form = {
|
||||||
|
// code: 'gj',
|
||||||
|
// name: '下片机',
|
||||||
|
// enName: 'unload',
|
||||||
|
// abbr: '',
|
||||||
|
// equipmentTypeId: 21084,
|
||||||
|
// remark: '备注',
|
||||||
|
// id: '1712367395052384257',
|
||||||
|
// createTime: 1697095176000,
|
||||||
|
// enterTime: 0,
|
||||||
|
// productionTime: 0,
|
||||||
|
// files: [
|
||||||
|
// {
|
||||||
|
// fileName: '测试.xlsx',
|
||||||
|
// fileUrl: 'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2022%2F0108%2F0f0c6f30j00r5cle9000sc000hs00gtc.jpg&thumbnail=660x2147483647&quality=80&type=jpg',
|
||||||
|
// fileType: 1
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// fileName: '测试2.xlsx',
|
||||||
|
// fileUrl: 'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2022%2F0415%2F2cd23619j00racb96000kc000hs00hsc.jpg&thumbnail=660x2147483647&quality=80&type=jpg',
|
||||||
|
// fileType: 1
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// fileName: '测试3.xlsx',
|
||||||
|
// fileUrl: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2F1fea91a0-d088-409e-b145-e0e61254b28b%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1700031689&t=2e0fe7d1de7f54adff3007efe133d67c',
|
||||||
|
// fileType: 1
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// fileName: '测试4.xlsx',
|
||||||
|
// fileUrl: 'https://pics5.baidu.com/feed/b7003af33a87e950cdfb4b4546eed044faf2b40d.jpeg?token=1d7484cfe4b014dd201f8c8725cab945',
|
||||||
|
// fileType: 2
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// fileName: '测试5.xlsx',
|
||||||
|
// fileUrl: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2Fe3500876-9c46-4b70-8d37-4799520cdd13%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1700031689&t=4abc1df930e62730e5361a7d3765e0f2',
|
||||||
|
// fileType: 2
|
||||||
|
// },
|
||||||
|
// ],
|
||||||
|
// tvalue: 0,
|
||||||
|
// processingTime: 0,
|
||||||
|
// manufacturer: '',
|
||||||
|
// spec: '',
|
||||||
|
// description: '描述',
|
||||||
|
// };
|
||||||
|
this.showForm = true;
|
||||||
|
this.infoQuery = query;
|
||||||
|
} else if (section.key == 'attrs') {
|
||||||
|
this.attrQuery = query;
|
||||||
|
this.list = data.list;
|
||||||
|
this.total = data.total;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleTableBtnClick({ type, data }) {
|
||||||
|
switch (type) {
|
||||||
|
case 'edit':
|
||||||
|
this.handleEditAttr(data.id);
|
||||||
|
break;
|
||||||
|
case 'delete':
|
||||||
|
this.handleDeleteAttr(data.id);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async handleConfirm() {
|
||||||
|
this.btnLoading = true;
|
||||||
|
this.syncFileListFlag = Math.random();
|
||||||
|
|
||||||
|
this.$nextTick(async () => {
|
||||||
|
const { code, data } = await this.$axios({
|
||||||
|
url: this.sections[0].urlUpdate,
|
||||||
|
method: 'put',
|
||||||
|
data: this.form,
|
||||||
|
});
|
||||||
|
if (code == 0) {
|
||||||
|
this.$modal.msgSuccess('更新成功');
|
||||||
|
}
|
||||||
|
|
||||||
|
this.btnLoading = false;
|
||||||
|
this.handleCancel();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
handleEmitFun(val) {
|
||||||
|
console.log('handleEmitFun', val);
|
||||||
|
},
|
||||||
|
|
||||||
|
init() {
|
||||||
|
this.visible = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
async getAttrList() {
|
||||||
|
this.attrListLoading = true;
|
||||||
|
const res = await this.$axios(this.attrQuery);
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.list = res.data.list;
|
||||||
|
this.total = res.data.total;
|
||||||
|
}
|
||||||
|
this.attrListLoading = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
// 保存表单
|
||||||
|
handleSave() {
|
||||||
|
this.$refs['form'][0].validate(async (valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const isEdit = this.mode == 'edit';
|
||||||
|
await this.$axios({
|
||||||
|
url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
|
||||||
|
method: isEdit ? 'put' : 'post',
|
||||||
|
data: this.form,
|
||||||
|
});
|
||||||
|
this.$modal.msgSuccess(`${isEdit ? '更新' : '创建'}成功`);
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
handleCancel() {
|
||||||
|
this.visible = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
// 开启编辑
|
||||||
|
toggleEdit() {
|
||||||
|
this.$emit('update-mode', 'edit');
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增属性
|
||||||
|
handleAddAttr() {
|
||||||
|
if (!this.dataId) return this.$message.error('请先创建设备信息');
|
||||||
|
this.attrForm = {
|
||||||
|
id: null,
|
||||||
|
equipmentId: this.dataId,
|
||||||
|
name: '',
|
||||||
|
value: '',
|
||||||
|
};
|
||||||
|
this.attrTitle = '添加设备属性';
|
||||||
|
this.attrFormVisible = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
// 编辑属性
|
||||||
|
async handleEditAttr(attrId) {
|
||||||
|
const res = await this.$axios({
|
||||||
|
url: this.sections[1].urlDetail,
|
||||||
|
method: 'get',
|
||||||
|
params: { id: attrId },
|
||||||
|
});
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.attrForm = res.data;
|
||||||
|
this.attrTitle = '编辑设备属性';
|
||||||
|
this.attrFormVisible = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除属性
|
||||||
|
handleDeleteAttr(attrId) {
|
||||||
|
this.$confirm('确定删除该属性?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
const res = await this.$axios({
|
||||||
|
url: this.sections[1].urlDelete,
|
||||||
|
method: 'delete',
|
||||||
|
params: { id: attrId },
|
||||||
|
});
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.$message({
|
||||||
|
message: '删除成功',
|
||||||
|
type: 'success',
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getAttrList();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 提交属性表
|
||||||
|
submitAttrForm() {
|
||||||
|
this.$refs['attrForm'].validate(async (valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const isEdit = this.attrForm.id != null;
|
||||||
|
this.attrFormSubmitting = true;
|
||||||
|
const res = await this.$axios({
|
||||||
|
url: isEdit
|
||||||
|
? this.sections[1].urlUpdate
|
||||||
|
: this.sections[1].urlCreate,
|
||||||
|
method: isEdit ? 'put' : 'post',
|
||||||
|
data: this.attrForm,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.closeAttrForm();
|
||||||
|
this.$message({
|
||||||
|
message: `${isEdit ? '更新' : '创建'}成功`,
|
||||||
|
type: 'success',
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getAttrList();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.attrFormSubmitting = false;
|
||||||
|
} catch (err) {
|
||||||
|
this.$message({
|
||||||
|
message: err,
|
||||||
|
type: 'error',
|
||||||
|
duration: 1500,
|
||||||
|
});
|
||||||
|
this.attrFormSubmitting = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
closeAttrForm() {
|
||||||
|
this.attrFormVisible = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
handleClick(raw) {
|
||||||
|
if (raw.type === 'delete') {
|
||||||
|
this.$confirm(
|
||||||
|
`确定对${
|
||||||
|
raw.data.name
|
||||||
|
? '[名称=' + raw.data.name + ']'
|
||||||
|
: '[序号=' + raw.data._pageIndex + ']'
|
||||||
|
}进行删除操作?`,
|
||||||
|
'提示',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
deleteProductAttr(raw.data.id).then(({ data }) => {
|
||||||
|
this.$message({
|
||||||
|
message: '操作成功',
|
||||||
|
type: 'success',
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
} else {
|
||||||
|
this.addNew(raw.data.id);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.drawer >>> .el-drawer {
|
||||||
|
border-radius: 8px 0 0 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawer >>> .el-drawer__header {
|
||||||
|
margin: 0;
|
||||||
|
padding: 32px 32px 24px;
|
||||||
|
border-bottom: 1px solid #dcdfe6;
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.small-title::before {
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: top;
|
||||||
|
width: 4px;
|
||||||
|
height: 22px;
|
||||||
|
border-radius: 1px;
|
||||||
|
margin-right: 8px;
|
||||||
|
background-color: #0b58ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawer-body {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawer-body__content {
|
||||||
|
flex: 1;
|
||||||
|
/* background: #eee; */
|
||||||
|
padding: 20px 30px;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawer-body__footer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
padding: 18px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,288 @@
|
|||||||
|
<!--
|
||||||
|
filename: dialogForm.vue
|
||||||
|
author: liubin
|
||||||
|
date: 2023-08-15 10:32:36
|
||||||
|
description: 弹窗的表单组件
|
||||||
|
-->
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<el-form class="equipment-info-form" ref="form" :model="form" label-width="200px" label-position="top"
|
||||||
|
v-loading="formLoading">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="设备名称" prop="name" :rules="[{ required: true, message: '设备名称不能为空', trigger: 'blur' }]">
|
||||||
|
<el-input v-model="form.name" :disabled="disabled" placeholder="请输入设备名称"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="设备编码" prop="code" :rules="[]">
|
||||||
|
<el-input v-model="form.code" :disabled="disabled" placeholder="请输入设备编码"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="英文名称" prop="enName" :rules="[]">
|
||||||
|
<el-input v-model="form.enName" :disabled="disabled" placeholder="请输入英文名称"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="缩写" prop="abbr" :rules="[]">
|
||||||
|
<el-input v-model="form.abbr" :disabled="disabled" placeholder="请输入名称缩写"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="设备类型" prop="equipmentTypeId"
|
||||||
|
:rules="[{ required: true, message: '设备类型不能为空', trigger: 'blur' }]">
|
||||||
|
<el-select v-model="form.equipmentTypeId" :disabled="disabled" filterable placeholder="请选择设备类型">
|
||||||
|
<el-option v-for="eqType in eqTypeList" :key="eqType.id" :label="eqType.name"
|
||||||
|
:value="eqType.id"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="预计生产时间(min/天)" prop="workTime" :rules="[
|
||||||
|
{ required: true, message: '预计生产时间不能为空', trigger: 'blur' },
|
||||||
|
{
|
||||||
|
type: 'number',
|
||||||
|
message: '请输入正确的数字值',
|
||||||
|
trigger: 'blur',
|
||||||
|
transform: (val) => Number(val),
|
||||||
|
},
|
||||||
|
]">
|
||||||
|
<el-input v-model="form.workTime" :disabled="disabled" placeholder="请输入预计生产时间"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="生产日期" prop="productionTime" :rules="[]">
|
||||||
|
<el-date-picker v-model="form.enterTime" :disabled="disabled" type="datetime" placeholder="请选择生产日期"
|
||||||
|
value-format="timestamp"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="进场日期" prop="enterTime" :rules="[]">
|
||||||
|
<el-date-picker v-model="form.enterTime" :disabled="disabled" type="datetime" placeholder="请选择进场日期"
|
||||||
|
value-format="timestamp"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="设备TT值" prop="tvalue" :rules="[
|
||||||
|
{ required: true, message: '设备TT值不能为空', trigger: 'blur' },
|
||||||
|
{
|
||||||
|
type: 'number',
|
||||||
|
message: '请输入正确的数字值',
|
||||||
|
trigger: 'blur',
|
||||||
|
transform: (val) => Number(val),
|
||||||
|
},
|
||||||
|
]">
|
||||||
|
<el-input v-model="form.tvalue" :disabled="disabled" placeholder="请输入设备TT值"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="产品加工时间(s)" prop="processingTime" :rules="[
|
||||||
|
{ required: true, message: '产品加工时间不能为空', trigger: 'blur' },
|
||||||
|
{
|
||||||
|
type: 'number',
|
||||||
|
message: '请输入正确的数字值',
|
||||||
|
trigger: 'blur',
|
||||||
|
transform: (val) => Number(val),
|
||||||
|
},
|
||||||
|
]">
|
||||||
|
<el-input v-model="form.processingTime" :disabled="disabled" placeholder="请输入产品加工时间"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="制造商" prop="manufacturer" :rules="[]">
|
||||||
|
<el-input v-model="form.manufacturer" :disabled="disabled" placeholder="请输入制造商"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="设备规格" prop="spec" :rules="[]">
|
||||||
|
<el-input v-model="form.spec" :disabled="disabled" placeholder="请输入设备规格"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<!-- 功能描述 -->
|
||||||
|
<el-col>
|
||||||
|
<el-form-item label="功能描述" prop="description" :rules="[]">
|
||||||
|
<el-input type="textarea" :disabled="disabled" v-model="form.description"
|
||||||
|
placeholder="请填写功能描述"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<!-- 功能描述 -->
|
||||||
|
<el-col>
|
||||||
|
<el-form-item label="备注" prop="remark" :rules="[]">
|
||||||
|
<el-input v-model="form.remark" :disabled="disabled" placeholder="请输入备注"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<!-- 上传资料 -->
|
||||||
|
<el-col>
|
||||||
|
<el-form-item label="上传资料" prop="assets" :rules="[]">
|
||||||
|
<AssetsUpload v-model="form.assets" :disabled="disabled" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<!-- 上传图片 -->
|
||||||
|
<el-col>
|
||||||
|
<el-form-item label="上传图片" prop="pics" :rules="[]">
|
||||||
|
<AssetsUpload :is-pic-mode="true" v-model="form.pics" :disabled="disabled" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import AssetsUpload from './AssetsUpload.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'EquipmentInfoForm',
|
||||||
|
|
||||||
|
model: {
|
||||||
|
prop: 'dataForm',
|
||||||
|
event: 'update',
|
||||||
|
},
|
||||||
|
|
||||||
|
emits: ['update'],
|
||||||
|
|
||||||
|
components: { AssetsUpload },
|
||||||
|
|
||||||
|
props: {
|
||||||
|
dataForm: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
|
disabled: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
syncFilelist: {
|
||||||
|
type: Number,
|
||||||
|
default: null,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
formLoading: false,
|
||||||
|
form: {
|
||||||
|
name: '',
|
||||||
|
code: '',
|
||||||
|
enName: '',
|
||||||
|
abbr: '',
|
||||||
|
equipmentTypeId: '',
|
||||||
|
remark: '',
|
||||||
|
productionTime: '',
|
||||||
|
workTime: '',
|
||||||
|
enterTime: '',
|
||||||
|
tvalue: '',
|
||||||
|
processingTime: '',
|
||||||
|
manufacturer: '',
|
||||||
|
spec: '',
|
||||||
|
description: '',
|
||||||
|
assets: [],
|
||||||
|
pics: [],
|
||||||
|
},
|
||||||
|
eqTypeList: [],
|
||||||
|
dataLoaded: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
watch: {
|
||||||
|
dataForm: {
|
||||||
|
handler(val) {
|
||||||
|
// debugger;
|
||||||
|
this.form = JSON.parse(JSON.stringify(val));
|
||||||
|
this.form.assets =
|
||||||
|
this.form.files?.filter((item) => item.fileType == '2') || [];
|
||||||
|
this.form.pics =
|
||||||
|
this.form.files?.filter((item) => item.fileType == '1') || [];
|
||||||
|
delete this.form.files;
|
||||||
|
},
|
||||||
|
immediate: true,
|
||||||
|
deep: true,
|
||||||
|
},
|
||||||
|
syncFilelist: {
|
||||||
|
handler(val) {
|
||||||
|
if (val != null) {
|
||||||
|
this.updateForm();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
immediate: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
this.getEqTypeList();
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
updateForm() {
|
||||||
|
console.log('update form ==> ');
|
||||||
|
this.form.files = [...this.form.assets, ...this.form.pics];
|
||||||
|
delete this.form.assets;
|
||||||
|
delete this.form.pics;
|
||||||
|
this.$emit('update', this.form);
|
||||||
|
},
|
||||||
|
|
||||||
|
async getEqTypeList() {
|
||||||
|
this.formLoading = true;
|
||||||
|
const { code, data } = await this.$axios(
|
||||||
|
'/base/core-equipment-type/page?pageNo=1&pageSize=100'
|
||||||
|
);
|
||||||
|
// debugger;
|
||||||
|
if (code == 0) {
|
||||||
|
this.eqTypeList = data.list;
|
||||||
|
}
|
||||||
|
this.formLoading = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 模拟透传 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;
|
||||||
|
},
|
||||||
|
// 上传成功的特殊处理
|
||||||
|
beforeUpload() { },
|
||||||
|
// 上传前的验证规则可通过 bind 属性传入
|
||||||
|
handleUploadSuccess(response, file, fileList) {
|
||||||
|
// 保存原始文件名
|
||||||
|
if ('fileNames' in this.form) this.form.fileNames.push(file.name);
|
||||||
|
// 保存完整地址
|
||||||
|
if ('fileUrls' in this.form) this.form.fileUrls.push(response.data);
|
||||||
|
this.$modal.msgSuccess('上传成功');
|
||||||
|
},
|
||||||
|
|
||||||
|
getFileName(fileUrl) {
|
||||||
|
return fileUrl.split('/').pop();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.el-date-editor,
|
||||||
|
.el-select {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
689
src/views/devConfig/base/coreEquipment/index.vue
Normal file
689
src/views/devConfig/base/coreEquipment/index.vue
Normal file
@@ -0,0 +1,689 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<SearchBar
|
||||||
|
:formConfigs="searchBarFormConfig"
|
||||||
|
ref="search-bar"
|
||||||
|
@headBtnClick="handleSearchBarBtnClick" />
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<base-table
|
||||||
|
:table-props="tableProps"
|
||||||
|
:page="queryParams.pageNo"
|
||||||
|
:limit="queryParams.pageSize"
|
||||||
|
:table-data="list"
|
||||||
|
@emitFun="handleEmitFun">
|
||||||
|
<method-btn
|
||||||
|
v-if="tableBtn.length"
|
||||||
|
slot="handleBtn"
|
||||||
|
:width="120"
|
||||||
|
label="操作"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleTableBtnClick" />
|
||||||
|
</base-table>
|
||||||
|
|
||||||
|
<!-- 分页组件 -->
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNo"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList" />
|
||||||
|
|
||||||
|
<!-- 对话框(添加) -->
|
||||||
|
<base-dialog
|
||||||
|
:dialogTitle="title"
|
||||||
|
:dialogVisible="open"
|
||||||
|
@close="cancel"
|
||||||
|
@cancel="cancel"
|
||||||
|
width="60%"
|
||||||
|
@confirm="submitForm">
|
||||||
|
<DialogForm
|
||||||
|
v-if="open"
|
||||||
|
key="index-dialog-form"
|
||||||
|
ref="form"
|
||||||
|
label-position="top"
|
||||||
|
size="small"
|
||||||
|
v-model="form"
|
||||||
|
:has-files="['files', 'files2']"
|
||||||
|
:rows="computedRows" />
|
||||||
|
</base-dialog>
|
||||||
|
|
||||||
|
<!-- 设备 详情 - 编辑 -->
|
||||||
|
<EquipmentDrawer
|
||||||
|
v-if="editVisible"
|
||||||
|
ref="drawer"
|
||||||
|
:mode="editMode"
|
||||||
|
@update-mode="editMode = $event"
|
||||||
|
:data-id="form.id"
|
||||||
|
:sections="[
|
||||||
|
{
|
||||||
|
name: '基本信息',
|
||||||
|
key: 'base',
|
||||||
|
rows: computedRows,
|
||||||
|
url: '/base/core-equipment/get',
|
||||||
|
urlUpdate: '/base/core-equipment/update',
|
||||||
|
urlCreate: '/base/core-equipment/create',
|
||||||
|
queryParams: { id: form.id },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '属性列表',
|
||||||
|
key: 'attrs',
|
||||||
|
props: drawerListProps,
|
||||||
|
url: '/base/core-equipment-attr/page',
|
||||||
|
urlCreate: '/base/core-equipment-attr/create',
|
||||||
|
urlUpdate: '/base/core-equipment-attr/update',
|
||||||
|
urlDelete: '/base/core-equipment-attr/delete',
|
||||||
|
urlDetail: '/base/core-equipment-attr/get',
|
||||||
|
queryParams: {
|
||||||
|
equipmentId: form.id,
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
},
|
||||||
|
tableBtn: [
|
||||||
|
this.$auth.hasPermi('base:core-equipment-attr:update')
|
||||||
|
? {
|
||||||
|
type: 'edit',
|
||||||
|
btnName: '修改',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
this.$auth.hasPermi('base:core-equipment-attr:delete')
|
||||||
|
? {
|
||||||
|
type: 'delete',
|
||||||
|
btnName: '删除',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
].filter((v) => v),
|
||||||
|
allowAdd: true,
|
||||||
|
},
|
||||||
|
]"
|
||||||
|
@refreshDataList="getList"
|
||||||
|
@cancel="cancelEdit"
|
||||||
|
@destroy="cancelEdit" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import moment from 'moment';
|
||||||
|
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||||
|
import EquipmentDrawer from './components/EquipmentDrawer';
|
||||||
|
|
||||||
|
import {
|
||||||
|
createEquipment,
|
||||||
|
updateEquipment,
|
||||||
|
deleteEquipment,
|
||||||
|
getEquipment,
|
||||||
|
getEquipmentPage,
|
||||||
|
exportEquipmentExcel,
|
||||||
|
} from '@/api/base/equipment';
|
||||||
|
import Editor from '@/components/Editor';
|
||||||
|
import AssetsUpload from './components/AssetsUpload.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'Equipment',
|
||||||
|
components: {
|
||||||
|
Editor,
|
||||||
|
EquipmentDrawer,
|
||||||
|
},
|
||||||
|
mixins: [basicPageMixin],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
searchBarKeys: ['name', 'code'],
|
||||||
|
tableBtn: [
|
||||||
|
this.$auth.hasPermi(`base:core-equipment:update`)
|
||||||
|
? {
|
||||||
|
type: 'detail',
|
||||||
|
btnName: '详情',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
this.$auth.hasPermi('base:core-equipment:update')
|
||||||
|
? {
|
||||||
|
type: 'edit',
|
||||||
|
btnName: '修改',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
this.$auth.hasPermi('base:core-equipment:delete')
|
||||||
|
? {
|
||||||
|
type: 'delete',
|
||||||
|
btnName: '删除',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
].filter((v) => v),
|
||||||
|
tableProps: [
|
||||||
|
{
|
||||||
|
prop: 'createTime',
|
||||||
|
label: '添加时间',
|
||||||
|
fixed: true,
|
||||||
|
width: 180,
|
||||||
|
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||||
|
},
|
||||||
|
{ prop: 'name', label: '设备名称' },
|
||||||
|
{ width: 256, prop: 'code', label: '设备编码' },
|
||||||
|
{ prop: 'equipmentTypeName', label: '设备类型' },
|
||||||
|
{ prop: 'enName', label: '英文名称' },
|
||||||
|
{ prop: 'abbr', label: '缩写' },
|
||||||
|
// {
|
||||||
|
// action: 'show-detail',
|
||||||
|
// label: '详情',
|
||||||
|
// subcomponent: {
|
||||||
|
// props: ['injectData'],
|
||||||
|
// render: function (h) {
|
||||||
|
// const _this = this;
|
||||||
|
// return h(
|
||||||
|
// 'el-button',
|
||||||
|
// {
|
||||||
|
// props: { type: 'text', size: 'mini' },
|
||||||
|
// on: {
|
||||||
|
// click: function () {
|
||||||
|
// console.log('inejctdata', _this.injectData);
|
||||||
|
// _this.$emit('emitData', {
|
||||||
|
// action: _this.injectData.action,
|
||||||
|
// value: _this.injectData.id,
|
||||||
|
// });
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// '查看详情'
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
],
|
||||||
|
searchBarFormConfig: [
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: '名称',
|
||||||
|
placeholder: '请输入设备名称',
|
||||||
|
param: 'name',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: '编码',
|
||||||
|
placeholder: '请输入设备编码',
|
||||||
|
param: 'code',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '查询',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'separate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: this.$auth.hasPermi('base:core-equipment:export')
|
||||||
|
? 'button'
|
||||||
|
: '',
|
||||||
|
btnName: '导出',
|
||||||
|
name: 'export',
|
||||||
|
plain: true,
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: this.$auth.hasPermi('base:core-equipment:create')
|
||||||
|
? 'button'
|
||||||
|
: '',
|
||||||
|
btnName: '新增',
|
||||||
|
name: 'add',
|
||||||
|
plain: true,
|
||||||
|
color: 'success',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
rows: [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '设备名称',
|
||||||
|
prop: 'name',
|
||||||
|
rules: [
|
||||||
|
{ required: true, message: '设备名称不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
|
// bind: {
|
||||||
|
// disabled: this.editMode == 'detail', // some condition, like detail mode...
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '设备编码',
|
||||||
|
prop: 'code',
|
||||||
|
url: '/base/core-equipment/getCode',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '英文名称',
|
||||||
|
prop: 'enName',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '缩写',
|
||||||
|
prop: 'abbr',
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
select: true,
|
||||||
|
label: '设备类型',
|
||||||
|
prop: 'equipmentTypeId',
|
||||||
|
url: '/base/core-equipment-type/page?pageNo=1&pageSize=100',
|
||||||
|
rules: [
|
||||||
|
{ required: true, message: '设备类型不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
|
bind: {
|
||||||
|
filterable: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '预计生产时间(min/天)',
|
||||||
|
prop: 'workTime',
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '预计生产时间不能为空',
|
||||||
|
trigger: 'blur',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'number',
|
||||||
|
message: '请输入正确的数字值',
|
||||||
|
trigger: 'blur',
|
||||||
|
transform: (val) => Number(val),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// select: true,
|
||||||
|
// label: '设备分组',
|
||||||
|
// prop: 'groupId',
|
||||||
|
// url: '/base/core-equipment-group/page?pageNo=1&pageSize=100',
|
||||||
|
// },
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
datetime: true,
|
||||||
|
label: '生产日期',
|
||||||
|
prop: 'productionTime',
|
||||||
|
bind: {
|
||||||
|
format: 'yyyy-MM-dd',
|
||||||
|
clearable: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
datetime: true,
|
||||||
|
label: '进厂日期',
|
||||||
|
prop: 'enterTime',
|
||||||
|
bind: {
|
||||||
|
format: 'yyyy-MM-dd',
|
||||||
|
clearable: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
prop: 'tvalue',
|
||||||
|
label: '设备TT值',
|
||||||
|
rules: [
|
||||||
|
{ required: true, message: '设备TT值不能为空', trigger: 'blur' },
|
||||||
|
{
|
||||||
|
type: 'number',
|
||||||
|
message: '请输入正确的数字值',
|
||||||
|
trigger: 'blur',
|
||||||
|
transform: (val) => Number(val),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '单件产品加工时间(s)',
|
||||||
|
prop: 'processingTime',
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '单件产品加工时间不能为空',
|
||||||
|
trigger: 'blur',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'number',
|
||||||
|
message: '请输入正确的数字值',
|
||||||
|
trigger: 'blur',
|
||||||
|
transform: (val) => Number(val),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '制造商',
|
||||||
|
prop: 'manufacturer',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '规格描述',
|
||||||
|
prop: 'spec',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
textarea: true,
|
||||||
|
label: '功能描述',
|
||||||
|
prop: 'description',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
upload: true,
|
||||||
|
label: '设备资料',
|
||||||
|
prop: 'files',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
upload: true,
|
||||||
|
label: '设备图片',
|
||||||
|
prop: 'files2',
|
||||||
|
fileType: 1,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[{ input: true, label: '备注', prop: 'remark' }],
|
||||||
|
// [
|
||||||
|
// {
|
||||||
|
// assetUpload: true,
|
||||||
|
// label: '上传资料',
|
||||||
|
// fieldName: 'assets',
|
||||||
|
// subcomponent: AssetsUpload
|
||||||
|
// },
|
||||||
|
// ],
|
||||||
|
// [
|
||||||
|
// {
|
||||||
|
// assetUpload: true,
|
||||||
|
// label: '上传图片',
|
||||||
|
// fieldName: 'images',
|
||||||
|
// subcomponent: AssetsUpload
|
||||||
|
// },
|
||||||
|
// ],
|
||||||
|
// [
|
||||||
|
// {
|
||||||
|
// upload: true,
|
||||||
|
// label: '上传资料',
|
||||||
|
// prop: 'uploadFiles',
|
||||||
|
// url: process.env.VUE_APP_BASE_API + '/admin-api/infra/file/upload', // 请求地址
|
||||||
|
// uploadFnName: 'assetsUpload', // 上传方法名
|
||||||
|
// bind: {
|
||||||
|
// headers: { Authorization: 'Bearer ' + getAccessToken() },
|
||||||
|
// 'show-file-list': false,
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// diy: true,
|
||||||
|
// key: 'eq-assets',
|
||||||
|
// label: '设备资料',
|
||||||
|
// prop: 'fileNames',
|
||||||
|
// subcomponent: EquipmentAssets,
|
||||||
|
// },
|
||||||
|
// ],
|
||||||
|
// [
|
||||||
|
// {
|
||||||
|
// upload: true,
|
||||||
|
// label: '上传图片',
|
||||||
|
// prop: 'uploadImages',
|
||||||
|
// url: process.env.VUE_APP_BASE_API + '/admin-api/infra/file/upload', // 请求地址
|
||||||
|
// uploadFnName: 'imagesUpload', // 上传方法名
|
||||||
|
// bind: {
|
||||||
|
// headers: { Authorization: 'Bearer ' + getAccessToken() },
|
||||||
|
// 'show-file-list': false,
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// diy: true,
|
||||||
|
// key: 'eq-pics',
|
||||||
|
// label: '设备图片',
|
||||||
|
// prop: 'fileUrls',
|
||||||
|
// subcomponent: EquipmentPics,
|
||||||
|
// pictures: async () => {
|
||||||
|
// // some async request
|
||||||
|
// return [];
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// ],
|
||||||
|
// [
|
||||||
|
// {
|
||||||
|
// diy: true,
|
||||||
|
// key: 'eq-pics',
|
||||||
|
// label: '设备图片',
|
||||||
|
// prop: 'fileUrls',
|
||||||
|
// subcomponent: EquipmentPics,
|
||||||
|
// pictures: async () => {
|
||||||
|
// // some async request
|
||||||
|
// return [];
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// ],
|
||||||
|
],
|
||||||
|
editVisible: false,
|
||||||
|
editMode: 'edit', // 'edit', 'detail'
|
||||||
|
// drawer 里的设备属性列表配置项
|
||||||
|
drawerListProps: [
|
||||||
|
{
|
||||||
|
prop: 'createTime',
|
||||||
|
label: '添加时间',
|
||||||
|
fixed: true,
|
||||||
|
width: 180,
|
||||||
|
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||||
|
},
|
||||||
|
{ prop: 'name', label: '属性名称' },
|
||||||
|
{ prop: 'value', label: '属性值' },
|
||||||
|
],
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
code: '',
|
||||||
|
name: '',
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {
|
||||||
|
id: null,
|
||||||
|
files: [],
|
||||||
|
},
|
||||||
|
showUploadComponents: false, // 是否显示上传组件
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
computedRows() {
|
||||||
|
return this.showUploadComponents
|
||||||
|
? [
|
||||||
|
...this.rows,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
assetUpload: true,
|
||||||
|
key: 'eq-assets', // 用于区分不同的上传组件
|
||||||
|
label: '上传资料',
|
||||||
|
fieldName: 'assets',
|
||||||
|
subcomponent: AssetsUpload,
|
||||||
|
prop: 'uploadedAssets',
|
||||||
|
default: [],
|
||||||
|
bind: {
|
||||||
|
'is-pic-mode': false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
assetUpload: true,
|
||||||
|
key: 'eq-pics', // 用于区分不同的上传组件
|
||||||
|
label: '上传图片',
|
||||||
|
fieldName: 'images',
|
||||||
|
subcomponent: AssetsUpload,
|
||||||
|
// prop: '',
|
||||||
|
// default: [],
|
||||||
|
bind: {
|
||||||
|
'is-pic-mode': true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
]
|
||||||
|
: this.rows;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
// 执行查询
|
||||||
|
getEquipmentPage(this.queryParams).then((response) => {
|
||||||
|
this.list = response.data.list;
|
||||||
|
this.total = response.data.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 取消按钮 */
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
cancelEdit() {
|
||||||
|
this.showUploadComponents = false;
|
||||||
|
this.editVisible = false;
|
||||||
|
},
|
||||||
|
/** 表单重置 */
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: undefined,
|
||||||
|
code: undefined,
|
||||||
|
name: undefined,
|
||||||
|
enName: undefined,
|
||||||
|
abbr: undefined,
|
||||||
|
enterTime: undefined,
|
||||||
|
productionTime: undefined,
|
||||||
|
equipmentTypeId: undefined,
|
||||||
|
groupId: undefined,
|
||||||
|
tvalue: undefined,
|
||||||
|
processingTime: undefined,
|
||||||
|
manufacturer: undefined,
|
||||||
|
spec: undefined,
|
||||||
|
description: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
files: [],
|
||||||
|
files2: [],
|
||||||
|
};
|
||||||
|
this.resetForm('form');
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.showUploadComponents = false;
|
||||||
|
this.title = '添加设备';
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
this.showUploadComponents = true;
|
||||||
|
const id = row.id;
|
||||||
|
getEquipment(id).then((response) => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = '修改设备';
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs['form'].validate((valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const payload = Object.assign({}, this.form);
|
||||||
|
payload.files = [...payload.files, ...payload.files2];
|
||||||
|
delete payload.files2;
|
||||||
|
// 修改的提交
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updateEquipment(payload).then((response) => {
|
||||||
|
this.$modal.msgSuccess('修改成功');
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 添加的提交
|
||||||
|
createEquipment(payload).then((response) => {
|
||||||
|
this.$modal.msgSuccess('新增成功');
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const id = row.id;
|
||||||
|
this.$modal
|
||||||
|
.delConfirm(row.name)
|
||||||
|
.then(function () {
|
||||||
|
return deleteEquipment(id);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess('删除成功');
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
// 处理查询参数
|
||||||
|
let params = { ...this.queryParams };
|
||||||
|
params.pageNo = undefined;
|
||||||
|
params.pageSize = undefined;
|
||||||
|
this.$modal
|
||||||
|
.confirm('是否确认导出所有设备数据项?')
|
||||||
|
.then(() => {
|
||||||
|
this.exportLoading = true;
|
||||||
|
return exportEquipmentExcel(params);
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
this.$download.excel(response, '设备.xls');
|
||||||
|
this.exportLoading = false;
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
// 查看详情
|
||||||
|
viewDetail(id) {
|
||||||
|
this.reset();
|
||||||
|
this.editMode = 'detail';
|
||||||
|
this.showUploadComponents = true;
|
||||||
|
this.form.id = id;
|
||||||
|
this.editVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['drawer'].init();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// overwrite basicPageMixin 里的 处理表格按钮 方法
|
||||||
|
handleTableBtnClick({ data, type }) {
|
||||||
|
switch (type) {
|
||||||
|
case 'edit':
|
||||||
|
this.reset();
|
||||||
|
this.editMode = 'edit';
|
||||||
|
this.showUploadComponents = true;
|
||||||
|
this.form.id = data.id;
|
||||||
|
this.editVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['drawer'].init();
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 'delete':
|
||||||
|
this.handleDelete(data);
|
||||||
|
break;
|
||||||
|
case 'detail':
|
||||||
|
const { id } = data;
|
||||||
|
this.viewDetail(id);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
370
src/views/devConfig/base/coreEquipmentLineBind/index.vue
Normal file
370
src/views/devConfig/base/coreEquipmentLineBind/index.vue
Normal file
@@ -0,0 +1,370 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<SearchBar
|
||||||
|
:formConfigs="searchBarFormConfig"
|
||||||
|
ref="search-bar"
|
||||||
|
@headBtnClick="handleSearchBarBtnClick" />
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<base-table
|
||||||
|
:table-props="tableProps"
|
||||||
|
:page="queryParams.pageNo"
|
||||||
|
:limit="queryParams.pageSize"
|
||||||
|
:table-data="list"
|
||||||
|
@emitFun="handleEmitFun">
|
||||||
|
<method-btn
|
||||||
|
v-if="tableBtn.length"
|
||||||
|
slot="handleBtn"
|
||||||
|
label="操作"
|
||||||
|
:width="100"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleTableBtnClick" />
|
||||||
|
</base-table>
|
||||||
|
|
||||||
|
<!-- 分页组件 -->
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNo"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList" />
|
||||||
|
|
||||||
|
<!-- 对话框(添加 / 修改) -->
|
||||||
|
<base-dialog
|
||||||
|
:dialogTitle="title"
|
||||||
|
:dialogVisible="open"
|
||||||
|
@close="cancel"
|
||||||
|
@cancel="cancel"
|
||||||
|
@confirm="submitForm">
|
||||||
|
<DialogForm
|
||||||
|
v-if="open"
|
||||||
|
ref="form"
|
||||||
|
v-model="form"
|
||||||
|
:has-files="false"
|
||||||
|
:rows="rows" />
|
||||||
|
</base-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import moment from 'moment';
|
||||||
|
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||||
|
|
||||||
|
// import { getAccessToken } from '@/utils/auth';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'EquipmentLineBind',
|
||||||
|
components: {},
|
||||||
|
mixins: [basicPageMixin],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
basePath: '/base/core-equipment-bind-section',
|
||||||
|
searchBarKeys: ['equipmentName', 'productionLineId'],
|
||||||
|
tableBtn: [
|
||||||
|
this.$auth.hasPermi('base:core-equipment-bind-section:update')
|
||||||
|
? {
|
||||||
|
type: 'edit',
|
||||||
|
btnName: '修改',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
this.$auth.hasPermi('base:core-equipment-bind-section:delete')
|
||||||
|
? {
|
||||||
|
type: 'delete',
|
||||||
|
btnName: '删除',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
].filter((v) => v),
|
||||||
|
tableProps: [
|
||||||
|
{
|
||||||
|
prop: 'createTime',
|
||||||
|
label: '添加时间',
|
||||||
|
fixed: true,
|
||||||
|
width: 150,
|
||||||
|
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||||
|
},
|
||||||
|
{ prop: 'productionLineName', label: '产线名称' },
|
||||||
|
{ prop: 'workshopSectionName', label: '工段名称' },
|
||||||
|
{ prop: 'equipmentName', label: '设备名称' },
|
||||||
|
{ prop: 'sort', label: '工段中排序' },
|
||||||
|
{
|
||||||
|
prop: 'lineDataType',
|
||||||
|
label: '产线统计类型',
|
||||||
|
width:120,
|
||||||
|
filter: (val) =>
|
||||||
|
val != null ? ['无类型', '进片数量统计', '出片数量统计'][val] : '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'sectionDataType',
|
||||||
|
label: '工段统计类型',
|
||||||
|
width:120,
|
||||||
|
filter: (val) =>
|
||||||
|
val != null ? ['无类型', '进片数量统计', '出片数量统计'][val] : '',
|
||||||
|
},
|
||||||
|
// { prop: 'remark', label: '备注' },
|
||||||
|
],
|
||||||
|
searchBarFormConfig: [
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '产线',
|
||||||
|
placeholder: '请选择产线',
|
||||||
|
param: 'productionLineId',
|
||||||
|
selectOptions: [],
|
||||||
|
filterable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: '设备名',
|
||||||
|
placeholder: '请输入设备名称',
|
||||||
|
param: 'equipmentName',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '查询',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'separate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: this.$auth.hasPermi('base:core-equipment-bind-section:create')
|
||||||
|
? 'button'
|
||||||
|
: '',
|
||||||
|
btnName: '新增',
|
||||||
|
name: 'add',
|
||||||
|
plain: true,
|
||||||
|
color: 'success',
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// type: this.$auth.hasPermi('base:quality-inspection-type:export')
|
||||||
|
// ? 'button'
|
||||||
|
// : '',
|
||||||
|
// btnName: '导出',
|
||||||
|
// name: 'export',
|
||||||
|
// color: 'warning',
|
||||||
|
// },
|
||||||
|
],
|
||||||
|
rows: [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
select: true,
|
||||||
|
label: '产线',
|
||||||
|
prop: 'productionLineId',
|
||||||
|
rules: [{ required: true, message: '产线名不能为空', trigger: 'blur' }],
|
||||||
|
url: '/base/core-production-line/listAll',
|
||||||
|
bind: { clearable: true, filterable: true },
|
||||||
|
// watch: 'workshopSectionId'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
select: true,
|
||||||
|
label: '工段',
|
||||||
|
prop: 'workshopSectionId',
|
||||||
|
depends: 'productionLineId',
|
||||||
|
rules: [{ required: true, message: '工段不能为空', trigger: 'blur' }],
|
||||||
|
bind: { clearable: true, filterable: true },
|
||||||
|
url: '/base/core-workshop-section/listByParentId',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
select: true,
|
||||||
|
label: '设备',
|
||||||
|
prop: 'equipmentId',
|
||||||
|
rules: [{ required: true, message: '设备名不能为空', trigger: 'blur' }],
|
||||||
|
bind: { clearable: true, filterable: true },
|
||||||
|
url: '/base/core-equipment/listAll',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '工段排序',
|
||||||
|
prop: 'sort',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
select: true,
|
||||||
|
options: [
|
||||||
|
{ label: '无类型', value: 0 },
|
||||||
|
{ label: '进片数量统计', value: 1 },
|
||||||
|
{ label: '出片数量统计', value: 2 },
|
||||||
|
],
|
||||||
|
label: '产线统计类型',
|
||||||
|
prop: 'lineDataType',
|
||||||
|
bind: {
|
||||||
|
clearable: true, filterable: true
|
||||||
|
},
|
||||||
|
rules: [{ required: true, message: '产线统计类型不能为空', trigger: 'change' }],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
select: true,
|
||||||
|
options: [
|
||||||
|
{ label: '无类型', value: 0 },
|
||||||
|
{ label: '进片数量统计', value: 1 },
|
||||||
|
{ label: '出片数量统计', value: 2 },
|
||||||
|
],
|
||||||
|
label: '工段统计类型',
|
||||||
|
prop: 'sectionDataType',
|
||||||
|
bind: {
|
||||||
|
clearable: true, filterable: true
|
||||||
|
},
|
||||||
|
rules: [{ required: true, message: '工段统计类型不能为空', trigger: 'change' }],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
equipmentName: null,
|
||||||
|
productionLineId: null,
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.initSearchOptions();
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 初始化查询条件 */
|
||||||
|
async initSearchOptions() {
|
||||||
|
this.http('/base/core-production-line/listAll', 'get').then(
|
||||||
|
({ code, data }) => {
|
||||||
|
if (code == 0) {
|
||||||
|
this.searchBarFormConfig[0].selectOptions = data.map((item) => {
|
||||||
|
return {
|
||||||
|
name: item.name,
|
||||||
|
id: item.id,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
/** 查询列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
// 执行查询
|
||||||
|
this.recv(this.queryParams).then(({ code, data }) => {
|
||||||
|
// if (code == 0) {
|
||||||
|
this.list = data.list;
|
||||||
|
this.total = data.total;
|
||||||
|
this.loading = false;
|
||||||
|
// }
|
||||||
|
});
|
||||||
|
// .catch(err => {
|
||||||
|
// this.list = [];
|
||||||
|
// this.total = 0;
|
||||||
|
// this.loading = false;
|
||||||
|
// })
|
||||||
|
},
|
||||||
|
/** 取消按钮 */
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
/** 表单重置 */
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: undefined,
|
||||||
|
productionLineId: undefined,
|
||||||
|
// 工段
|
||||||
|
workshopSectionId: undefined,
|
||||||
|
// 设备
|
||||||
|
equipmentId: undefined,
|
||||||
|
// 工段排序
|
||||||
|
sort: undefined,
|
||||||
|
// 产线统计类型
|
||||||
|
lineDataType: undefined,
|
||||||
|
// 工段统计类型
|
||||||
|
sectionDataType: undefined,
|
||||||
|
};
|
||||||
|
this.resetForm('form');
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNo = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm('queryForm');
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = '添加设备工段绑定';
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const id = row.id;
|
||||||
|
this.info({ id }).then(({ code, data }) => {
|
||||||
|
this.form = data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = '修改设备工段绑定';
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs['form'].validate((valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 修改的提交
|
||||||
|
if (this.form.id != null) {
|
||||||
|
this.put(this.form).then(({ code, data }) => {
|
||||||
|
this.$modal.msgSuccess('修改成功');
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.post(this.form).then(({ code, data }) => {
|
||||||
|
this.$modal.msgSuccess('修改成功');
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const id = row.id;
|
||||||
|
this.$modal
|
||||||
|
.delConfirm(row.equipmentName)
|
||||||
|
.then(function () {
|
||||||
|
return deleteEquipmentType(id);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess('删除成功');
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
// 处理查询参数
|
||||||
|
let params = { ...this.queryParams };
|
||||||
|
params.pageNo = undefined;
|
||||||
|
params.pageSize = undefined;
|
||||||
|
this.$modal
|
||||||
|
.confirm('是否确认导出所有设备工段绑定?')
|
||||||
|
.then(() => {
|
||||||
|
this.exportLoading = true;
|
||||||
|
// return exportEquipmentTypeExcel(params);
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
this.$download.excel(response, '设备工段绑定.xls');
|
||||||
|
this.exportLoading = false;
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
312
src/views/devConfig/base/coreEquipmentType/index.vue
Normal file
312
src/views/devConfig/base/coreEquipmentType/index.vue
Normal file
@@ -0,0 +1,312 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<SearchBar
|
||||||
|
:formConfigs="searchBarFormConfig"
|
||||||
|
ref="search-bar"
|
||||||
|
@headBtnClick="handleSearchBarBtnClick" />
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<base-table
|
||||||
|
:table-props="tableProps"
|
||||||
|
:page="queryParams.pageNo"
|
||||||
|
:limit="queryParams.pageSize"
|
||||||
|
:table-data="list"
|
||||||
|
@emitFun="handleEmitFun">
|
||||||
|
<method-btn
|
||||||
|
v-if="tableBtn.length"
|
||||||
|
slot="handleBtn"
|
||||||
|
label="操作"
|
||||||
|
:width="120"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleTableBtnClick" />
|
||||||
|
</base-table>
|
||||||
|
|
||||||
|
<!-- 分页组件 -->
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNo"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList" />
|
||||||
|
|
||||||
|
<!-- 对话框(添加 / 修改) -->
|
||||||
|
<base-dialog
|
||||||
|
:dialogTitle="title"
|
||||||
|
:dialogVisible="open"
|
||||||
|
@close="cancel"
|
||||||
|
@cancel="cancel"
|
||||||
|
@confirm="submitForm">
|
||||||
|
<DialogForm
|
||||||
|
v-if="open"
|
||||||
|
ref="form"
|
||||||
|
v-model="form"
|
||||||
|
:has-files="true"
|
||||||
|
:rows="rows" />
|
||||||
|
</base-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import moment from 'moment';
|
||||||
|
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||||
|
|
||||||
|
import {
|
||||||
|
createEquipmentType,
|
||||||
|
updateEquipmentType,
|
||||||
|
deleteEquipmentType,
|
||||||
|
getEquipmentType,
|
||||||
|
getEquipmentTypePage,
|
||||||
|
exportEquipmentTypeExcel,
|
||||||
|
} from '@/api/base/equipmentType';
|
||||||
|
|
||||||
|
// import { getAccessToken } from '@/utils/auth';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'EquipmentType',
|
||||||
|
components: {},
|
||||||
|
mixins: [basicPageMixin],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
searchBarKeys: ['name'],
|
||||||
|
tableBtn: [
|
||||||
|
this.$auth.hasPermi('base:core-equipment-type:update')
|
||||||
|
? {
|
||||||
|
type: 'edit',
|
||||||
|
btnName: '修改',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
this.$auth.hasPermi('base:core-equipment-type:delete')
|
||||||
|
? {
|
||||||
|
type: 'delete',
|
||||||
|
btnName: '删除',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
].filter((v) => v),
|
||||||
|
tableProps: [
|
||||||
|
{
|
||||||
|
prop: 'createTime',
|
||||||
|
label: '添加时间',
|
||||||
|
fixed: true,
|
||||||
|
width: 150,
|
||||||
|
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||||
|
},
|
||||||
|
{ prop: 'name', label: '类型名称' },
|
||||||
|
{ prop: 'code', label: '类型编号', width: 210 },
|
||||||
|
{ prop: 'remark', label: '备注' },
|
||||||
|
],
|
||||||
|
searchBarFormConfig: [
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: '设备类型',
|
||||||
|
placeholder: '设备类型',
|
||||||
|
param: 'name',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '查询',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'separate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: this.$auth.hasPermi('base:core-equipment-type:create')
|
||||||
|
? 'button'
|
||||||
|
: '',
|
||||||
|
btnName: '新增',
|
||||||
|
name: 'add',
|
||||||
|
plain: true,
|
||||||
|
color: 'success',
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// type: this.$auth.hasPermi('base:quality-inspection-type:export')
|
||||||
|
// ? 'button'
|
||||||
|
// : '',
|
||||||
|
// btnName: '导出',
|
||||||
|
// name: 'export',
|
||||||
|
// color: 'warning',
|
||||||
|
// },
|
||||||
|
],
|
||||||
|
rows: [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '类型名称',
|
||||||
|
prop: 'name',
|
||||||
|
rules: [
|
||||||
|
{ required: true, message: '类型名称不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
|
// bind: {
|
||||||
|
// disabled: true, // some condition, like detail mode...
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: true,
|
||||||
|
label: '类型编号',
|
||||||
|
prop: 'code',
|
||||||
|
url: '/base/core-equipment-type/getCode',
|
||||||
|
rules: [
|
||||||
|
{ required: true, message: '类型编号不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
select: true,
|
||||||
|
label: '父类',
|
||||||
|
prop: 'parentId',
|
||||||
|
url: '/base/core-equipment-type/page?pageNo=1&pageSize=100',
|
||||||
|
},
|
||||||
|
{},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
upload: true,
|
||||||
|
label: '上传资料',
|
||||||
|
prop: 'files',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[{ input: true, label: '备注', prop: 'remark' }],
|
||||||
|
],
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
name: '',
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {
|
||||||
|
code: undefined,
|
||||||
|
name: undefined,
|
||||||
|
id: undefined,
|
||||||
|
parentId: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
// form: {
|
||||||
|
// handler: function (val, oldVal) {
|
||||||
|
// console.log('[watch:form]', val, oldVal);
|
||||||
|
// },
|
||||||
|
// deep: true,
|
||||||
|
// },
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
// 执行查询
|
||||||
|
getEquipmentTypePage(this.queryParams).then((response) => {
|
||||||
|
this.list = response.data.list;
|
||||||
|
this.total = response.data.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 取消按钮 */
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
/** 表单重置 */
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: undefined,
|
||||||
|
code: undefined,
|
||||||
|
name: undefined,
|
||||||
|
parentId: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
};
|
||||||
|
this.resetForm('form');
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNo = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm('queryForm');
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = '添加设备类型';
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const id = row.id;
|
||||||
|
getEquipmentType(id).then((response) => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = '修改设备类型';
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs['form'].validate((valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 修改的提交
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updateEquipmentType(this.form).then((response) => {
|
||||||
|
this.$modal.msgSuccess('修改成功');
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 添加的提交
|
||||||
|
createEquipmentType(this.form).then((response) => {
|
||||||
|
this.$modal.msgSuccess('新增成功');
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const id = row.id;
|
||||||
|
this.$modal
|
||||||
|
.delConfirm(row.name)
|
||||||
|
.then(function () {
|
||||||
|
return deleteEquipmentType(id);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess('删除成功');
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
// 处理查询参数
|
||||||
|
let params = { ...this.queryParams };
|
||||||
|
params.pageNo = undefined;
|
||||||
|
params.pageSize = undefined;
|
||||||
|
this.$modal
|
||||||
|
.confirm('是否确认导出所有设备类型数据项?')
|
||||||
|
.then(() => {
|
||||||
|
this.exportLoading = true;
|
||||||
|
return exportEquipmentTypeExcel(params);
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
this.$download.excel(response, '设备类型.xls');
|
||||||
|
this.exportLoading = false;
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
163
src/views/devConfig/base/coreProductionLine/add-or-updata.vue
Normal file
163
src/views/devConfig/base/coreProductionLine/add-or-updata.vue
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2021-11-18 14:16:25
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2024-09-25 10:24:33
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-form
|
||||||
|
:model="dataForm"
|
||||||
|
:rules="dataRule"
|
||||||
|
ref="dataForm"
|
||||||
|
@keyup.enter.native="dataFormSubmit()"
|
||||||
|
label-width="100px">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="产线名称" prop="name">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.name"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入产线名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="产线编号" prop="code">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.code"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入产线编号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="工厂名称" prop="factoryId">
|
||||||
|
<el-select
|
||||||
|
v-model="dataForm.factoryId"
|
||||||
|
filterable
|
||||||
|
placeholder="请选择工厂"
|
||||||
|
style="width: 100%">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in factoryList"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.name"
|
||||||
|
:value="dict.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="归属部门" prop="deptId">
|
||||||
|
<treeselect
|
||||||
|
v-model="dataForm.deptId"
|
||||||
|
:options="deptOptions"
|
||||||
|
:show-count="true"
|
||||||
|
:clearable="false"
|
||||||
|
placeholder="请选择归属部门"
|
||||||
|
:normalizer="normalizer" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="产线TT值(h)" prop="tvalue">
|
||||||
|
<el-input
|
||||||
|
v-model.number="dataForm.tvalue"
|
||||||
|
type="number"
|
||||||
|
placeholder="TT值" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="描述信息" prop="description">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.description"
|
||||||
|
placeholder="请输入描述信息" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="dataForm.remark" placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import basicAdd from '@/mixins/basic-add';
|
||||||
|
import {
|
||||||
|
createCorePL,
|
||||||
|
updateCorePL,
|
||||||
|
getCorePL,
|
||||||
|
getCode,
|
||||||
|
} from '@/api/base/coreProductionLine';
|
||||||
|
import { getFactoryList } from '@/api/core/base/factory';
|
||||||
|
import { listSimpleDepts } from '@/api/system/dept';
|
||||||
|
import Treeselect from '@riophae/vue-treeselect';
|
||||||
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [basicAdd],
|
||||||
|
components: { Treeselect },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
urlOptions: {
|
||||||
|
isGetCode: true,
|
||||||
|
codeURL: getCode,
|
||||||
|
createURL: createCorePL,
|
||||||
|
updateURL: updateCorePL,
|
||||||
|
infoURL: getCorePL,
|
||||||
|
},
|
||||||
|
// 部门树选项
|
||||||
|
deptOptions: undefined,
|
||||||
|
dataForm: {
|
||||||
|
id: undefined,
|
||||||
|
code: undefined,
|
||||||
|
name: undefined,
|
||||||
|
description: undefined,
|
||||||
|
tvalue: 0,
|
||||||
|
factoryId: undefined,
|
||||||
|
deptId: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
},
|
||||||
|
factoryList: [],
|
||||||
|
dataRule: {
|
||||||
|
code: [
|
||||||
|
{ required: true, message: '产线编号不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
|
name: [
|
||||||
|
{ required: true, message: '产线名称不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
|
factoryId: [
|
||||||
|
{ required: true, message: '工厂不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getDict();
|
||||||
|
this.getTreeselect()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async getDict() {
|
||||||
|
// 工厂列表
|
||||||
|
const factoryRes = await getFactoryList();
|
||||||
|
this.factoryList = factoryRes.data;
|
||||||
|
},
|
||||||
|
/** 查询部门下拉树结构 */
|
||||||
|
getTreeselect() {
|
||||||
|
listSimpleDepts().then((response) => {
|
||||||
|
// 处理 deptOptions 参数
|
||||||
|
this.deptOptions = [];
|
||||||
|
this.deptOptions.push(...this.handleTree(response.data, 'id'));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 格式化部门的下拉框
|
||||||
|
normalizer(node) {
|
||||||
|
return {
|
||||||
|
id: node.id,
|
||||||
|
label: node.name,
|
||||||
|
children: node.children,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
204
src/views/devConfig/base/coreProductionLine/index.vue
Normal file
204
src/views/devConfig/base/coreProductionLine/index.vue
Normal file
@@ -0,0 +1,204 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<search-bar
|
||||||
|
:formConfigs="formConfig"
|
||||||
|
ref="searchBarForm"
|
||||||
|
@headBtnClick="buttonClick" />
|
||||||
|
<base-table
|
||||||
|
v-loading="dataListLoading"
|
||||||
|
:table-props="tableProps"
|
||||||
|
:page="listQuery.pageNo"
|
||||||
|
:limit="listQuery.pageSize"
|
||||||
|
:table-data="tableData">
|
||||||
|
<method-btn
|
||||||
|
v-if="tableBtn.length"
|
||||||
|
slot="handleBtn"
|
||||||
|
:width="120"
|
||||||
|
label="操作"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleClick" />
|
||||||
|
</base-table>
|
||||||
|
<pagination
|
||||||
|
:limit.sync="listQuery.pageSize"
|
||||||
|
:page.sync="listQuery.pageNo"
|
||||||
|
:total="listQuery.total"
|
||||||
|
@pagination="getDataList" />
|
||||||
|
<base-dialog
|
||||||
|
:dialogTitle="addOrEditTitle"
|
||||||
|
:dialogVisible="addOrUpdateVisible"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
@confirm="handleConfirm"
|
||||||
|
:before-close="handleCancel"
|
||||||
|
width="50%">
|
||||||
|
<add-or-update
|
||||||
|
ref="addOrUpdate"
|
||||||
|
@refreshDataList="successSubmit"></add-or-update>
|
||||||
|
</base-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import AddOrUpdate from './add-or-updata';
|
||||||
|
import basicPage from '@/mixins/basic-page';
|
||||||
|
import { parseTime } from '@/mixins/code-filter';
|
||||||
|
import codeFilter from '@/mixins/code-filter';
|
||||||
|
import { getCorePLPage, deleteCorePL } from '@/api/base/coreProductionLine';
|
||||||
|
import { getStatus } from '@/api/core/base/productionLine';
|
||||||
|
|
||||||
|
const tableProps = [
|
||||||
|
{
|
||||||
|
prop: 'createTime',
|
||||||
|
label: '添加时间',
|
||||||
|
filter: parseTime,
|
||||||
|
width: 150,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'factoryName',
|
||||||
|
label: '工厂',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'departmentName',
|
||||||
|
label: '归属部门',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'name',
|
||||||
|
label: '产线名称',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'code',
|
||||||
|
label: '产线编码',
|
||||||
|
width: 150,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'enabled',
|
||||||
|
label: '当前状态',
|
||||||
|
filter: codeFilter('lineStatus'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'tvalue',
|
||||||
|
label: '产线TT值(h)',
|
||||||
|
width: 100,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'description',
|
||||||
|
label: '描述',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '备注',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [basicPage],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
urlOptions: {
|
||||||
|
getDataListURL: getCorePLPage,
|
||||||
|
deleteURL: deleteCorePL,
|
||||||
|
},
|
||||||
|
tableProps,
|
||||||
|
tableBtn: [
|
||||||
|
this.$auth.hasPermi(`base:core-production-line:update`)
|
||||||
|
? {
|
||||||
|
type: 'edit',
|
||||||
|
btnName: '编辑',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
this.$auth.hasPermi(`base:core-production-line:delete`)
|
||||||
|
? {
|
||||||
|
type: 'delete',
|
||||||
|
btnName: '删除',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
].filter((v) => v),
|
||||||
|
tableData: [],
|
||||||
|
formConfig: [
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: '产线名称',
|
||||||
|
placeholder: '产线名称',
|
||||||
|
param: 'name',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '查询',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'separate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: this.$auth.hasPermi('base:core-production-line:create')
|
||||||
|
? 'button'
|
||||||
|
: '',
|
||||||
|
btnName: '新增',
|
||||||
|
name: 'add',
|
||||||
|
color: 'success',
|
||||||
|
plain: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
AddOrUpdate,
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
methods: {
|
||||||
|
// 获取数据列表
|
||||||
|
getDataList() {
|
||||||
|
this.dataListLoading = true;
|
||||||
|
this.urlOptions.getDataListURL(this.listQuery).then((response) => {
|
||||||
|
// this.tableData = response.data.list;
|
||||||
|
this.getStatus(response.data.list);
|
||||||
|
this.listQuery.total = response.data.total;
|
||||||
|
this.dataListLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getStatus(list) {
|
||||||
|
const ids = list.map((i) => {
|
||||||
|
return i.id;
|
||||||
|
});
|
||||||
|
console.log('111', ids);
|
||||||
|
getStatus(ids).then((response) => {
|
||||||
|
response.forEach((a) => {
|
||||||
|
list.forEach((b) => {
|
||||||
|
if (b.id === a.id) b.enabled = a.status;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
this.tableData = list;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
buttonClick(val) {
|
||||||
|
switch (val.btnName) {
|
||||||
|
case 'search':
|
||||||
|
this.listQuery.pageNo = 1;
|
||||||
|
this.listQuery.pageSize = 10;
|
||||||
|
this.listQuery.name = val.name ? val.name : undefined;
|
||||||
|
this.getDataList();
|
||||||
|
break;
|
||||||
|
case 'reset':
|
||||||
|
this.$refs.searchBarForm.resetForm();
|
||||||
|
this.listQuery = {
|
||||||
|
pageSize: 10,
|
||||||
|
pageNo: 1,
|
||||||
|
total: 1,
|
||||||
|
};
|
||||||
|
this.getDataList();
|
||||||
|
break;
|
||||||
|
case 'add':
|
||||||
|
this.addOrEditTitle = '新增';
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.addOrUpdateHandle();
|
||||||
|
break;
|
||||||
|
case 'export':
|
||||||
|
this.handleExport();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.log(val);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
105
src/views/devConfig/base/coreWorkshopSection/add-or-updata.vue
Normal file
105
src/views/devConfig/base/coreWorkshopSection/add-or-updata.vue
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2021-11-18 14:16:25
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2024-09-24 14:49:25
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-form
|
||||||
|
:model="dataForm"
|
||||||
|
:rules="dataRule"
|
||||||
|
ref="dataForm"
|
||||||
|
@keyup.enter.native="dataFormSubmit()"
|
||||||
|
label-width="80px">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="工段名称" prop="name">
|
||||||
|
<el-input v-model="dataForm.name" clearable placeholder="请输入工段名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="工段编号" prop="code">
|
||||||
|
<el-input v-model="dataForm.code" clearable placeholder="请输入工段编号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="产线" prop="productionLineId">
|
||||||
|
<el-select
|
||||||
|
v-model="dataForm.productionLineId"
|
||||||
|
filterable
|
||||||
|
placeholder="请选择产线">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in proLineList"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.name"
|
||||||
|
:value="dict.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="排序" prop="sort">
|
||||||
|
<el-input-number
|
||||||
|
v-model="dataForm.sort"
|
||||||
|
controls-position="right"
|
||||||
|
placeholder="排序"
|
||||||
|
style="width: 100%" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.remark"
|
||||||
|
placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import basicAdd from '@/mixins/basic-add';
|
||||||
|
import { createCWSection, updateCWSection, getCWSection, getCode } from "@/api/base/coreWorkshopSection";
|
||||||
|
import { getCorePLList } from '@/api/base/coreProductionLine';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [basicAdd],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
urlOptions: {
|
||||||
|
isGetCode: true,
|
||||||
|
codeURL: getCode,
|
||||||
|
createURL: createCWSection,
|
||||||
|
updateURL: updateCWSection,
|
||||||
|
infoURL: getCWSection
|
||||||
|
},
|
||||||
|
dataForm: {
|
||||||
|
id: undefined,
|
||||||
|
code: undefined,
|
||||||
|
name: undefined,
|
||||||
|
description: undefined,
|
||||||
|
sort: 0,
|
||||||
|
productionLineId: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
},
|
||||||
|
proLineList: [],
|
||||||
|
dataRule: {
|
||||||
|
code: [{ required: true, message: "工段编号不能为空", trigger: "blur" }],
|
||||||
|
name: [{ required: true, message: "工段名称不能为空", trigger: "blur" }],
|
||||||
|
productionLineId: [{ required: true, message: "产线不能为空", trigger: "blur" }],
|
||||||
|
sort: [{ required: true, message: "排序不能为空", trigger: "blur" }]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getDict()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async getDict() {
|
||||||
|
// 产线列表
|
||||||
|
const res = await getCorePLList();
|
||||||
|
this.proLineList = res.data;
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
165
src/views/devConfig/base/coreWorkshopSection/index.vue
Normal file
165
src/views/devConfig/base/coreWorkshopSection/index.vue
Normal file
@@ -0,0 +1,165 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<search-bar
|
||||||
|
:formConfigs="formConfig"
|
||||||
|
ref="searchBarForm"
|
||||||
|
@headBtnClick="buttonClick" />
|
||||||
|
<base-table
|
||||||
|
v-loading="dataListLoading"
|
||||||
|
:table-props="tableProps"
|
||||||
|
:page="listQuery.pageNo"
|
||||||
|
:limit="listQuery.pageSize"
|
||||||
|
:table-data="tableData">
|
||||||
|
<method-btn
|
||||||
|
v-if="tableBtn.length"
|
||||||
|
slot="handleBtn"
|
||||||
|
:width="120"
|
||||||
|
label="操作"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleClick" />
|
||||||
|
</base-table>
|
||||||
|
<pagination
|
||||||
|
:limit.sync="listQuery.pageSize"
|
||||||
|
:page.sync="listQuery.pageNo"
|
||||||
|
:total="listQuery.total"
|
||||||
|
@pagination="getDataList" />
|
||||||
|
<base-dialog
|
||||||
|
:dialogTitle="addOrEditTitle"
|
||||||
|
:dialogVisible="addOrUpdateVisible"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
@confirm="handleConfirm"
|
||||||
|
:before-close="handleCancel"
|
||||||
|
width="40%">
|
||||||
|
<add-or-update
|
||||||
|
ref="addOrUpdate"
|
||||||
|
@refreshDataList="successSubmit"></add-or-update>
|
||||||
|
</base-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import AddOrUpdate from './add-or-updata';
|
||||||
|
import basicPage from '@/mixins/basic-page';
|
||||||
|
import { parseTime } from '@/mixins/code-filter';
|
||||||
|
import {
|
||||||
|
getCWSectionPage,
|
||||||
|
deleteCWSection
|
||||||
|
} from '@/api/base/coreWorkshopSection';
|
||||||
|
|
||||||
|
const tableProps = [
|
||||||
|
{
|
||||||
|
prop: 'createTime',
|
||||||
|
label: '添加时间',
|
||||||
|
filter: parseTime,
|
||||||
|
width:150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'code',
|
||||||
|
label: '工段编码',
|
||||||
|
width:150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'name',
|
||||||
|
label: '工段名称'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'productionLineName',
|
||||||
|
label: '产线名'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'sort',
|
||||||
|
label: '排序'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '备注'
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [basicPage],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
urlOptions: {
|
||||||
|
getDataListURL: getCWSectionPage,
|
||||||
|
deleteURL: deleteCWSection
|
||||||
|
},
|
||||||
|
tableProps,
|
||||||
|
tableBtn: [
|
||||||
|
this.$auth.hasPermi(`base:core-workshop-section:update`)
|
||||||
|
? {
|
||||||
|
type: 'edit',
|
||||||
|
btnName: '编辑',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
this.$auth.hasPermi(`base:core-workshop-section:delete`)
|
||||||
|
? {
|
||||||
|
type: 'delete',
|
||||||
|
btnName: '删除',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
].filter((v)=>v),
|
||||||
|
tableData: [],
|
||||||
|
formConfig: [
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: '工段名称',
|
||||||
|
placeholder: '工段名称',
|
||||||
|
param: 'name'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '查询',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'separate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: this.$auth.hasPermi('base:core-workshop-section:create') ? 'button' : '',
|
||||||
|
btnName: '新增',
|
||||||
|
name: 'add',
|
||||||
|
color: 'success',
|
||||||
|
plain: true
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
AddOrUpdate,
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
methods: {
|
||||||
|
buttonClick(val) {
|
||||||
|
switch (val.btnName) {
|
||||||
|
case 'search':
|
||||||
|
this.listQuery.pageNo = 1;
|
||||||
|
this.listQuery.pageSize = 10;
|
||||||
|
this.listQuery.name = val.name ? val.name : undefined;
|
||||||
|
this.getDataList();
|
||||||
|
break;
|
||||||
|
case 'reset':
|
||||||
|
this.$refs.searchBarForm.resetForm();
|
||||||
|
this.listQuery = {
|
||||||
|
pageSize: 10,
|
||||||
|
pageNo: 1,
|
||||||
|
total: 1,
|
||||||
|
};
|
||||||
|
this.getDataList();
|
||||||
|
break;
|
||||||
|
case 'add':
|
||||||
|
this.addOrEditTitle = '新增';
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.addOrUpdateHandle();
|
||||||
|
break;
|
||||||
|
case 'export':
|
||||||
|
this.handleExport();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.log(val);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
90
src/views/devConfig/base/factory/add-or-updata.vue
Normal file
90
src/views/devConfig/base/factory/add-or-updata.vue
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2021-11-18 14:16:25
|
||||||
|
* @LastEditors: DY
|
||||||
|
* @LastEditTime: 2023-11-03 16:32:52
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-form
|
||||||
|
:model="dataForm"
|
||||||
|
:rules="dataRule"
|
||||||
|
ref="dataForm"
|
||||||
|
@keyup.enter.native="dataFormSubmit()"
|
||||||
|
label-width="80px">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="工厂名称" prop="name">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.name"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入工厂名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="工厂编码" prop="code">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.code"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入工厂编码" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="地址" prop="address">
|
||||||
|
<el-input v-model="dataForm.address" clearable placeholder="请输入地址" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<!-- <el-form-item label="启用状态" prop="enabled">
|
||||||
|
<el-select
|
||||||
|
v-model="dataForm.enabled"
|
||||||
|
placeholder="请选择启用状态">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in this.getDictDatas(DICT_TYPE.INFRA_BOOLEAN_STRING)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="dataForm.remark" clearable placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import basicAdd from '@/mixins/basic-add';
|
||||||
|
import { createFactory, updateFactory, getFactory, getCode } from "@/api/core/base/factory";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [basicAdd],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
urlOptions: {
|
||||||
|
isGetCode: true,
|
||||||
|
codeURL: getCode,
|
||||||
|
createURL: createFactory,
|
||||||
|
updateURL: updateFactory,
|
||||||
|
infoURL: getFactory,
|
||||||
|
},
|
||||||
|
dataForm: {
|
||||||
|
id: undefined,
|
||||||
|
code: undefined,
|
||||||
|
name: undefined,
|
||||||
|
address: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
},
|
||||||
|
dataRule: {
|
||||||
|
code: [{ required: true, message: "工厂编码不能为空", trigger: "blur" }],
|
||||||
|
name: [{ required: true, message: "工厂名称不能为空", trigger: "blur" }],
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
184
src/views/devConfig/base/factory/index.vue
Normal file
184
src/views/devConfig/base/factory/index.vue
Normal file
@@ -0,0 +1,184 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<search-bar
|
||||||
|
:formConfigs="formConfig"
|
||||||
|
ref="searchBarForm"
|
||||||
|
@headBtnClick="buttonClick" />
|
||||||
|
<base-table
|
||||||
|
v-loading="dataListLoading"
|
||||||
|
:table-props="tableProps"
|
||||||
|
:page="listQuery.pageNo"
|
||||||
|
:limit="listQuery.pageSize"
|
||||||
|
:table-data="tableData">
|
||||||
|
<method-btn
|
||||||
|
v-if="tableBtn.length"
|
||||||
|
slot="handleBtn"
|
||||||
|
:width="120"
|
||||||
|
label="操作"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleClick" />
|
||||||
|
</base-table>
|
||||||
|
<pagination
|
||||||
|
:limit.sync="listQuery.pageSize"
|
||||||
|
:page.sync="listQuery.pageNo"
|
||||||
|
:total="listQuery.total"
|
||||||
|
@pagination="getDataList" />
|
||||||
|
<base-dialog
|
||||||
|
:dialogTitle="addOrEditTitle"
|
||||||
|
:dialogVisible="addOrUpdateVisible"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
@confirm="handleConfirm"
|
||||||
|
:before-close="handleCancel"
|
||||||
|
width="50%">
|
||||||
|
<add-or-update
|
||||||
|
ref="addOrUpdate"
|
||||||
|
@refreshDataList="successSubmit"></add-or-update>
|
||||||
|
</base-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import AddOrUpdate from './add-or-updata';
|
||||||
|
import basicPage from '@/mixins/basic-page';
|
||||||
|
import { parseTime } from '@/mixins/code-filter';
|
||||||
|
import {
|
||||||
|
deleteFactory,
|
||||||
|
getFactoryPage
|
||||||
|
} from '@/api/core/base/factory';
|
||||||
|
|
||||||
|
const tableProps = [
|
||||||
|
{
|
||||||
|
prop: 'createTime',
|
||||||
|
label: '添加时间',
|
||||||
|
filter: parseTime
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'name',
|
||||||
|
label: '工厂名称'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'code',
|
||||||
|
label: '工厂编码'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'address',
|
||||||
|
label: '地址'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '备注'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [basicPage],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
urlOptions: {
|
||||||
|
getDataListURL: getFactoryPage,
|
||||||
|
deleteURL: deleteFactory,
|
||||||
|
// exportURL: exportFactoryExcel,
|
||||||
|
},
|
||||||
|
tableProps,
|
||||||
|
tableBtn: [
|
||||||
|
this.$auth.hasPermi(`base:core-factory:update`)
|
||||||
|
? {
|
||||||
|
type: 'edit',
|
||||||
|
btnName: '编辑',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
this.$auth.hasPermi(`base:core-factory:delete`)
|
||||||
|
? {
|
||||||
|
type: 'delete',
|
||||||
|
btnName: '删除',
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
|
].filter((v)=>v),
|
||||||
|
tableData: [],
|
||||||
|
formConfig: [
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: '工厂名称',
|
||||||
|
placeholder: '工厂名称',
|
||||||
|
param: 'name',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: '工厂编码',
|
||||||
|
placeholder: '工厂编码',
|
||||||
|
param: 'code',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '查询',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// type: 'separate',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// type: 'button',
|
||||||
|
// btnName: '重置',
|
||||||
|
// name: 'reset',
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
type: 'separate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: this.$auth.hasPermi('base:core-factory:create') ? 'button' : '',
|
||||||
|
btnName: '新增',
|
||||||
|
name: 'add',
|
||||||
|
color: 'success',
|
||||||
|
plain: true,
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
|
||||||
|
// btnName: '导出',
|
||||||
|
// name: 'export',
|
||||||
|
// color: 'warning',
|
||||||
|
// },
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
AddOrUpdate,
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
methods: {
|
||||||
|
buttonClick(val) {
|
||||||
|
switch (val.btnName) {
|
||||||
|
case 'search':
|
||||||
|
this.listQuery.pageNo = 1;
|
||||||
|
this.listQuery.pageSize = 10;
|
||||||
|
this.listQuery.name = val.name;
|
||||||
|
this.listQuery.code = val.code;
|
||||||
|
this.getDataList();
|
||||||
|
break;
|
||||||
|
case 'reset':
|
||||||
|
this.$refs.searchBarForm.resetForm();
|
||||||
|
this.listQuery = {
|
||||||
|
pageSize: 10,
|
||||||
|
pageNo: 1,
|
||||||
|
total: 1,
|
||||||
|
};
|
||||||
|
this.getDataList();
|
||||||
|
break;
|
||||||
|
case 'add':
|
||||||
|
this.addOrEditTitle = '新增';
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.addOrUpdateHandle();
|
||||||
|
break;
|
||||||
|
case 'export':
|
||||||
|
this.handleExport();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.log(val);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -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) {
|
||||||
@@ -241,7 +244,9 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
this.$modal.confirm('是否确认删除监控对象为"' + row.objName + '"的数据项?').then(function() {
|
this.$modal
|
||||||
|
.delConfirm(row.objName)
|
||||||
|
.then(function() {
|
||||||
return deleteEnergyLimit(row.id);
|
return deleteEnergyLimit(row.id);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.queryParams.pageNo = 1;
|
this.queryParams.pageNo = 1;
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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,16 +60,18 @@ const tableProps = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'objCode',
|
prop: 'objCode',
|
||||||
label: '对象编码'
|
label: '对象编码',
|
||||||
|
minWidth: 160,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'plcTableName',
|
prop: 'plcTableName',
|
||||||
label: '关联表名'
|
label: '关联表名'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'plcTableCode',
|
prop: 'plcTableCode',
|
||||||
label: '关联表编码',
|
label: '关联表编码',
|
||||||
showOverflowtooltip: true
|
showOverflowtooltip: true,
|
||||||
|
minWidth: 160,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'cnName',
|
prop: 'cnName',
|
||||||
@@ -230,7 +232,9 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
this.$modal.confirm('是否确认删除对象为"' + row.objName + '"的数据项?').then(function() {
|
this.$modal
|
||||||
|
.delConfirm(row.objName)
|
||||||
|
.then(function() {
|
||||||
return deleteEnergyPlcConnect(row.id);
|
return deleteEnergyPlcConnect(row.id);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.queryParams.pageNo = 1;
|
this.queryParams.pageNo = 1;
|
||||||
|
|||||||
@@ -60,7 +60,8 @@ export default {
|
|||||||
name: '',
|
name: '',
|
||||||
code: '',
|
code: '',
|
||||||
type: '',
|
type: '',
|
||||||
energyTypeId: ''
|
energyTypeId: '',
|
||||||
|
remark: ''
|
||||||
},
|
},
|
||||||
plcList: [],
|
plcList: [],
|
||||||
objList: [],
|
objList: [],
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ const tableProps = [
|
|||||||
showOverflowtooltip: true
|
showOverflowtooltip: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'type',
|
prop: 'type',
|
||||||
label: '统计类型',
|
label: '统计类型',
|
||||||
filter: publicFormatter('statistic_type')
|
filter: publicFormatter('statistic_type')
|
||||||
},
|
},
|
||||||
@@ -224,7 +224,9 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
this.$modal.confirm('是否确认删除方案名称为"' + row.name + '"的数据项?').then(function() {
|
this.$modal
|
||||||
|
.delConfirm(row.name)
|
||||||
|
.then(function() {
|
||||||
return deleteEnergyStatistics(row.id);
|
return deleteEnergyStatistics(row.id);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.queryParams.pageNo = 1;
|
this.queryParams.pageNo = 1;
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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',
|
||||||
@@ -205,7 +209,9 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
this.$modal.confirm('是否确认删除能源类型为"' + row.name + '"的数据项?').then(function() {
|
this.$modal
|
||||||
|
.delConfirm(row.name)
|
||||||
|
.then(function() {
|
||||||
return deleteEnergyType(row.id);
|
return deleteEnergyType(row.id);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.queryParams.pageNo = 1;
|
this.queryParams.pageNo = 1;
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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');
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -1,66 +1,100 @@
|
|||||||
<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"/>
|
||||||
<el-tabs v-model="activeName" @tab-click="switchChart" v-show='chartData.length'>
|
<div v-show="chartData.length">
|
||||||
<el-tab-pane label="柱状图" name="bar">
|
<bar-chart
|
||||||
<bar-chart ref="analysisBarChart" :chartData="chartData" :timeDim="timeDim" />
|
ref="analysisBarChart"
|
||||||
</el-tab-pane>
|
:chartData="chartData"
|
||||||
<el-tab-pane label="折线图" name="line">
|
:timeDim="timeDim" />
|
||||||
<line-chart ref="analysisLineChart" :chartData="chartData" :timeDim="timeDim"/>
|
<base-table
|
||||||
</el-tab-pane>
|
:table-props="tableProps"
|
||||||
</el-tabs>
|
:table-data="list"
|
||||||
|
:max-height="tableH"
|
||||||
|
class="contrast-out-table" />
|
||||||
|
</div>
|
||||||
<!-- 没有数据 -->
|
<!-- 没有数据 -->
|
||||||
<div class="no-data-bg" v-show='!chartData.length'></div>
|
<div class="no-data-bg" v-show='!chartData.length'></div>
|
||||||
</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 LineChart from "./components/lineChart"
|
import tableHeightMixin from '@/mixins/tableHeightMixin';
|
||||||
|
import FileSaver from 'file-saver';
|
||||||
|
import * as XLSX from 'xlsx/xlsx.mjs';
|
||||||
// import moment from 'moment'
|
// import moment from 'moment'
|
||||||
export default {
|
export default {
|
||||||
name: 'ContrastAnalysis',
|
name: 'ContrastAnalysis',
|
||||||
components: { SearchArea, BarChart, LineChart },
|
components: { SearchArea, BarChart },
|
||||||
|
mixins: [tableHeightMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isFold: false,
|
isFold: false,
|
||||||
activeName: 'bar',
|
chartData: [],
|
||||||
chartData: [],
|
timeDim: '',
|
||||||
timeDim: ''
|
tableProps: [],
|
||||||
|
list: [],
|
||||||
|
tableH: this.tableHeight(250) / 2,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
window.addEventListener('resize', () => {
|
window.addEventListener('resize', () => {
|
||||||
this.tableH = this.tableHeight(260)
|
this.tableH = this.tableHeight(260)
|
||||||
this.isFold = this.searchBarWidth('contrastAnalysisBox', 1437)
|
this.isFold = this.searchBarWidth('contrastAnalysisBox', 1310)
|
||||||
// console.log(document.getElementById("contrastAnalysisBox").offsetWidth)
|
// console.log(document.getElementById("contrastAnalysisBox").offsetWidth)
|
||||||
})
|
})
|
||||||
this.isFold = this.searchBarWidth('contrastAnalysisBox', 1437)
|
this.isFold = this.searchBarWidth('contrastAnalysisBox', 1310)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
_setTableHeight() {
|
||||||
|
this.tableH = this.tableHeight(250) / 2;
|
||||||
|
},
|
||||||
getList(params) {
|
getList(params) {
|
||||||
this.timeDim = params.timeDim
|
this.timeDim = params.timeDim
|
||||||
getCompare({ ...params }).then((res) => {
|
getCompare({ ...params }).then((res) => {
|
||||||
console.log(res)
|
if (res.code === 0) {
|
||||||
if (res.code === 0) {
|
this.getTableList(res.data || []);
|
||||||
this.chartData = res.data || []
|
this.chartData = res.data || [];
|
||||||
} else {
|
} else {
|
||||||
this.chartData = []
|
this.chartData = []
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
switchChart() {
|
getTableList(arr) {
|
||||||
if (this.activeName === 'bar') {
|
this.tableProps = [];
|
||||||
this.$nextTick((res) => {
|
this.list = [];
|
||||||
this.$refs.analysisBarChart.getChart()
|
let tempX = [];
|
||||||
})
|
let timeArr = arr[0].trendRespVOList || [];
|
||||||
} else {
|
this.list = timeArr.map((item) => {
|
||||||
this.$nextTick((res) => {
|
return { time: item.time };
|
||||||
this.$refs.analysisLineChart.getChart()
|
});
|
||||||
})
|
for (let i = 0; i < arr.length; i++) {
|
||||||
}
|
let obj = {};
|
||||||
|
obj.prop = arr[i].objId;
|
||||||
|
obj.label = arr[i].objName;
|
||||||
|
obj.minWidth = 100;
|
||||||
|
tempX.push(obj);
|
||||||
|
let tiemList = arr[i].trendRespVOList;
|
||||||
|
for (let j = 0; j < tiemList.length; j++) {
|
||||||
|
this.list[j][arr[i].objId] = tiemList[j].useNum
|
||||||
|
? tiemList[j].useNum.toFixed(2)
|
||||||
|
: null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.tableProps = [{ prop: 'time', label: '时间' }].concat(tempX);
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
exportData(val) {
|
||||||
|
// 处理查询参数
|
||||||
|
this.$modal.confirm('是否确认导出对比分析数据?').then(() => {
|
||||||
|
this.exportLoading = true;
|
||||||
|
return exportCompare(val);
|
||||||
|
}).then(response => {
|
||||||
|
this.$download.excel(response, '对比分析数据.xlsx');
|
||||||
|
this.exportLoading = false;
|
||||||
|
}).catch(() => {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -93,4 +127,4 @@ export default {
|
|||||||
color: rgba(0, 0, 0, 0.45);
|
color: rgba(0, 0, 0, 0.45);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
74
src/views/energy/analysis/index.vue
Normal file
74
src/views/energy/analysis/index.vue
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2024-09-23 14:35:30
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2024-09-23 14:48:08
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div style="background: #f2f4f9; height: 56px; width: 100%">
|
||||||
|
<ButtonNav
|
||||||
|
:menus="['走势分析', '对比分析', '同比分析', '环比分析']"
|
||||||
|
@change="currentMenu">
|
||||||
|
<template v-slot:tab1>
|
||||||
|
<div>走势分析</div>
|
||||||
|
</template>
|
||||||
|
<template v-slot:tab2>
|
||||||
|
<div>对比分析</div>
|
||||||
|
</template>
|
||||||
|
<template v-slot:tab3>
|
||||||
|
<div>同比分析</div>
|
||||||
|
</template>
|
||||||
|
<template v-slot:tab4>
|
||||||
|
<div>环比分析</div>
|
||||||
|
</template>
|
||||||
|
</ButtonNav>
|
||||||
|
</div>
|
||||||
|
<div class="app-container">
|
||||||
|
<div v-if="activeName === '走势分析'">
|
||||||
|
<trendAnalysis />
|
||||||
|
</div>
|
||||||
|
<div v-else-if="activeName === '对比分析'">
|
||||||
|
<contrastAnalysis />
|
||||||
|
</div>
|
||||||
|
<div v-else-if="activeName === '同比分析'">
|
||||||
|
<yoyAnalysis />
|
||||||
|
</div>
|
||||||
|
<div v-else-if="activeName === '环比分析'">
|
||||||
|
<qoqAnalysis />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import ButtonNav from '@/components/ButtonNav';
|
||||||
|
import trendAnalysis from './trendAnalysis';
|
||||||
|
import contrastAnalysis from './contrastAnalysis';
|
||||||
|
import yoyAnalysis from './yoyAnalysis';
|
||||||
|
import qoqAnalysis from './qoqAnalysis';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: '',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
activeName: '走势分析',
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
ButtonNav,
|
||||||
|
trendAnalysis,
|
||||||
|
contrastAnalysis,
|
||||||
|
yoyAnalysis,
|
||||||
|
qoqAnalysis,
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
methods: {
|
||||||
|
currentMenu(val) {
|
||||||
|
this.activeName = val;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss"></style>
|
||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -1,456 +1,490 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="searchBarBox divHeight" ref="searchBarRef" :style="{ paddingRight: isFold ? '55px' : '0px' }">
|
<div
|
||||||
<el-form :inline="true" class="demo-form-inline">
|
class="searchBarBox divHeight"
|
||||||
<span class="blue-block"></span>
|
ref="searchBarRef"
|
||||||
<el-form-item label="能源类型" required>
|
:style="{ paddingRight: isFold ? '55px' : '0px' }">
|
||||||
<el-select v-model="queryParams.energyTypeId" placeholder="请选择" style="width: 100px;" size="small">
|
<el-form :inline="true" class="demo-form-inline">
|
||||||
<el-option
|
<span class="blue-block"></span>
|
||||||
v-for="item in energyTypeList"
|
<el-form-item label="能源类型" required>
|
||||||
:key="item.id"
|
<el-select
|
||||||
:label="item.name"
|
v-model="queryParams.energyTypeId"
|
||||||
:value="item.id">
|
placeholder="请选择"
|
||||||
</el-option>
|
style="width: 100px"
|
||||||
</el-select>
|
size="small">
|
||||||
</el-form-item>
|
<el-option
|
||||||
<el-form-item label="对象选择" required>
|
v-for="item in energyTypeList"
|
||||||
<el-cascader
|
:key="item.id"
|
||||||
v-model="objArr"
|
:label="item.name"
|
||||||
:options="objList"
|
:value="item.id"></el-option>
|
||||||
:props="{ checkStrictly: true, value: 'id', label: 'name' }"
|
</el-select>
|
||||||
popper-class="cascaderParent"
|
</el-form-item>
|
||||||
size="small"
|
<el-form-item label="对象选择" required>
|
||||||
clearable></el-cascader>
|
<el-cascader
|
||||||
</el-form-item>
|
v-model="objArr"
|
||||||
<el-form-item label="时间维度" required>
|
:options="objList"
|
||||||
<el-select v-model="queryParams.timeDim" placeholder="请选择" style="width: 80px;" size="small">
|
:props="{ checkStrictly: true, value: 'id', label: 'name' }"
|
||||||
<el-option
|
popper-class="cascaderParent"
|
||||||
v-for="item in getDictDatas(this.DICT_TYPE.TIME_DIM)"
|
size="small"
|
||||||
:key="item.value"
|
clearable></el-cascader>
|
||||||
:label="item.label"
|
</el-form-item>
|
||||||
:value="item.value"
|
<el-form-item label="时间维度" required>
|
||||||
size="small">
|
<el-select
|
||||||
</el-option>
|
v-model="queryParams.timeDim"
|
||||||
</el-select>
|
placeholder="请选择"
|
||||||
</el-form-item>
|
style="width: 80px"
|
||||||
<el-form-item label="时间范围" required>
|
size="small">
|
||||||
<div v-show="queryParams.timeDim === '1'">
|
<el-option
|
||||||
<el-date-picker
|
v-for="item in getDictDatas(this.DICT_TYPE.TIME_DIM)"
|
||||||
v-model="timeValue"
|
:key="item.value"
|
||||||
type="datetimerange"
|
:label="item.label"
|
||||||
range-separator="至"
|
:value="item.value"
|
||||||
start-placeholder="开始日期"
|
size="small"></el-option>
|
||||||
end-placeholder="结束日期"
|
</el-select>
|
||||||
format="yyyy-MM-dd HH:mm"
|
</el-form-item>
|
||||||
value-format="timestamp"
|
<el-form-item label="时间范围" required>
|
||||||
:picker-options="pickerOptions"
|
<div v-show="queryParams.timeDim === '1'">
|
||||||
popper-class="noneMinute"
|
<el-date-picker
|
||||||
@change="timeSelect"
|
v-model="timeValue"
|
||||||
size="small"
|
type="datetimerange"
|
||||||
style='width:350px;'
|
range-separator="至"
|
||||||
>
|
start-placeholder="开始日期"
|
||||||
</el-date-picker>
|
end-placeholder="结束日期"
|
||||||
</div>
|
format="yyyy-MM-dd HH:mm"
|
||||||
<div v-show="queryParams.timeDim === '2'">
|
value-format="timestamp"
|
||||||
<el-date-picker
|
:picker-options="pickerOptions"
|
||||||
v-model="dateValue"
|
popper-class="noneMinute"
|
||||||
type="daterange"
|
@change="timeSelect"
|
||||||
range-separator="至"
|
size="small"
|
||||||
start-placeholder="开始日期"
|
style="width: 350px"></el-date-picker>
|
||||||
end-placeholder="结束日期"
|
</div>
|
||||||
value-format="timestamp"
|
<div v-show="queryParams.timeDim === '2'">
|
||||||
:picker-options="pickerOptions"
|
<el-date-picker
|
||||||
@change="timeSelect"
|
v-model="dateValue"
|
||||||
size="small"
|
type="daterange"
|
||||||
style='width:350px;'
|
range-separator="至"
|
||||||
>
|
start-placeholder="开始日期"
|
||||||
</el-date-picker>
|
end-placeholder="结束日期"
|
||||||
</div>
|
value-format="timestamp"
|
||||||
<div v-show="queryParams.timeDim === '3'">
|
:picker-options="pickerOptions"
|
||||||
<el-date-picker
|
@change="timeSelect"
|
||||||
v-model="weekValue1"
|
size="small"
|
||||||
type="week"
|
style="width: 350px"></el-date-picker>
|
||||||
format="yyyy 第 WW 周"
|
</div>
|
||||||
style='width:170px;'
|
<div v-show="queryParams.timeDim === '3'">
|
||||||
:picker-options="pickerOptionsWeek"
|
<el-date-picker
|
||||||
@change="startWeek"
|
v-model="weekValue1"
|
||||||
size="small"
|
type="week"
|
||||||
placeholder="选择周">
|
format="yyyy 第 WW 周"
|
||||||
</el-date-picker>-
|
style="width: 170px"
|
||||||
<el-date-picker
|
:picker-options="pickerOptionsWeek"
|
||||||
v-model="weekValue2"
|
@change="startWeek"
|
||||||
type="week"
|
size="small"
|
||||||
format="yyyy 第 WW 周"
|
placeholder="选择周"></el-date-picker>
|
||||||
:picker-options="pickerOptionsWeek"
|
-
|
||||||
style='width:170px;'
|
<el-date-picker
|
||||||
@change="endWeek"
|
v-model="weekValue2"
|
||||||
size="small"
|
type="week"
|
||||||
placeholder="选择周">
|
format="yyyy 第 WW 周"
|
||||||
</el-date-picker>
|
:picker-options="pickerOptionsWeek"
|
||||||
</div>
|
style="width: 170px"
|
||||||
<div v-show="queryParams.timeDim === '4'">
|
@change="endWeek"
|
||||||
<el-date-picker
|
size="small"
|
||||||
v-model="monthValue"
|
placeholder="选择周"></el-date-picker>
|
||||||
type="monthrange"
|
</div>
|
||||||
range-separator="至"
|
<div v-show="queryParams.timeDim === '4'">
|
||||||
start-placeholder="开始日期"
|
<el-date-picker
|
||||||
end-placeholder="结束日期"
|
v-model="monthValue"
|
||||||
value-format="timestamp"
|
type="monthrange"
|
||||||
:picker-options="pickerOptions"
|
range-separator="至"
|
||||||
size="small"
|
start-placeholder="开始日期"
|
||||||
style='width:350px;'
|
end-placeholder="结束日期"
|
||||||
@change="timeSelect"
|
value-format="timestamp"
|
||||||
>
|
:picker-options="pickerOptions"
|
||||||
</el-date-picker>
|
size="small"
|
||||||
</div>
|
style="width: 350px"
|
||||||
<div v-show="queryParams.timeDim === '5'">
|
@change="timeSelect"></el-date-picker>
|
||||||
<el-date-picker
|
</div>
|
||||||
style='width:170px;'
|
<div v-show="queryParams.timeDim === '5'">
|
||||||
v-model="yearValue1"
|
<el-date-picker
|
||||||
type="year"
|
style="width: 170px"
|
||||||
:picker-options="pickerOptions"
|
v-model="yearValue1"
|
||||||
value-format="timestamp"
|
type="year"
|
||||||
placeholder="选择年"
|
:picker-options="pickerOptions"
|
||||||
size="small"
|
value-format="timestamp"
|
||||||
@change="startYear"
|
placeholder="选择年"
|
||||||
>
|
size="small"
|
||||||
</el-date-picker>-
|
@change="startYear"></el-date-picker>
|
||||||
<el-date-picker
|
-
|
||||||
style='width:170px;'
|
<el-date-picker
|
||||||
v-model="yearValue2"
|
style="width: 170px"
|
||||||
type="year"
|
v-model="yearValue2"
|
||||||
:picker-options="pickerOptions"
|
type="year"
|
||||||
value-format="timestamp"
|
:picker-options="pickerOptions"
|
||||||
placeholder="选择年"
|
value-format="timestamp"
|
||||||
size="small"
|
placeholder="选择年"
|
||||||
@change="endYear"
|
size="small"
|
||||||
>
|
@change="endYear"></el-date-picker>
|
||||||
</el-date-picker>
|
</div>
|
||||||
</div>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item>
|
||||||
<el-form-item>
|
<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-form-item>
|
<el-button type="primary" size="small" @click="exportData" plain>
|
||||||
</el-form>
|
导出
|
||||||
<span v-if="isFold" class="foldClass" @click='switchMode'>
|
</el-button>
|
||||||
{{ isExpand ? '收起' : '展开' }}
|
</el-form-item>
|
||||||
<svg-icon :icon-class="isExpand ? 'upward' : 'downward'" />
|
</el-form>
|
||||||
</span>
|
<span v-if="isFold" class="foldClass" @click="switchMode">
|
||||||
</div>
|
{{ isExpand ? '收起' : '展开' }}
|
||||||
|
<svg-icon :icon-class="isExpand ? 'upward' : 'downward'" />
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getEnergyTypeListAll } from "@/api/base/energyType"
|
import { getEnergyTypeListAll } from '@/api/base/energyType';
|
||||||
import { getTree } from '@/api/base/factory'
|
import { getTree } from '@/api/base/factory';
|
||||||
import moment from 'moment'
|
import moment from 'moment';
|
||||||
export default {
|
export default {
|
||||||
name: 'searchArea',
|
name: 'searchArea',
|
||||||
props: {
|
props: {
|
||||||
isFold: {// 多行模式(默认否)
|
isFold: {
|
||||||
type: Boolean,
|
// 多行模式(默认否)
|
||||||
default: false
|
type: Boolean,
|
||||||
}
|
default: false,
|
||||||
},
|
},
|
||||||
data() {
|
},
|
||||||
return {
|
data() {
|
||||||
isExpand: false, // 展开收起
|
return {
|
||||||
// 查询参数
|
isExpand: false, // 展开收起
|
||||||
queryParams: {
|
// 查询参数
|
||||||
energyTypeId: null,
|
queryParams: {
|
||||||
objId: null,
|
energyTypeId: null,
|
||||||
timeDim: null,
|
objId: null,
|
||||||
startTime: null,
|
timeDim: null,
|
||||||
endTime: null
|
startTime: null,
|
||||||
},
|
endTime: null,
|
||||||
objArr: [],
|
},
|
||||||
timeValue: [],// 最大7天只能整点
|
objArr: [],
|
||||||
dateValue: [],// 最大30天
|
timeValue: [], // 最大7天只能整点
|
||||||
weekValue1: null,//最多24周
|
dateValue: [], // 最大30天
|
||||||
weekValue2: null,
|
weekValue1: null, //最多24周
|
||||||
monthValue: [],//最多24月
|
weekValue2: null,
|
||||||
yearValue1: null,//最多10年
|
monthValue: [], //最多24月
|
||||||
yearValue2: null,
|
yearValue1: null, //最多10年
|
||||||
energyTypeList: [],
|
yearValue2: null,
|
||||||
objList: [],
|
energyTypeList: [],
|
||||||
pickerOptions: {
|
objList: [],
|
||||||
disabledDate(date) {
|
pickerOptions: {
|
||||||
return date.getTime() > Date.now()
|
disabledDate(date) {
|
||||||
}
|
return date.getTime() > Date.now();
|
||||||
},
|
},
|
||||||
pickerOptionsWeek: {
|
},
|
||||||
disabledDate(time) {
|
pickerOptionsWeek: {
|
||||||
let day = Date.now()
|
disabledDate(time) {
|
||||||
let limitTime = moment(day).day(-1)
|
let day = Date.now();
|
||||||
return time.getTime() > new Date(limitTime).getTime()
|
let limitTime = moment(day).day(-1);
|
||||||
}
|
return time.getTime() > new Date(limitTime).getTime();
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
};
|
||||||
mounted() {
|
},
|
||||||
this.getTypeList()
|
mounted() {
|
||||||
this.getObjTree()
|
this.getTypeList();
|
||||||
this.queryParams.timeDim = this.getDictDatas(this.DICT_TYPE.TIME_DIM)[0].value // 默认时
|
this.getObjTree();
|
||||||
this.timeValue = [moment().startOf('day'), moment().endOf('day')-59*61*1000]
|
this.queryParams.timeDim = this.getDictDatas(
|
||||||
},
|
this.DICT_TYPE.TIME_DIM
|
||||||
methods: {
|
)[0].value; // 默认时
|
||||||
getTypeList() {
|
this.timeValue = [
|
||||||
getEnergyTypeListAll().then((res) => {
|
moment().startOf('day'),
|
||||||
this.energyTypeList = res.data || []
|
moment().endOf('day') - 59 * 61 * 1000,
|
||||||
})
|
];
|
||||||
},
|
},
|
||||||
getObjTree() {
|
methods: {
|
||||||
getTree().then(res => {
|
getTypeList() {
|
||||||
this.objList = res.data || []
|
getEnergyTypeListAll().then((res) => {
|
||||||
})
|
this.energyTypeList = res.data || [];
|
||||||
},
|
this.queryParams.energyTypeId = res.data[0].id
|
||||||
// 范围选择器
|
});
|
||||||
timeSelect() {
|
},
|
||||||
switch (this.queryParams.timeDim) {
|
getObjTree() {
|
||||||
case '1':
|
getTree().then((res) => {
|
||||||
if (this.timeValue[1] - this.timeValue[0] > 7*24*3600000) {
|
this.objList = res.data || [];
|
||||||
this.$modal.msgError('最大时间范围为7天,请重新选择')
|
});
|
||||||
this.timeValue = []
|
},
|
||||||
}
|
// 范围选择器
|
||||||
break
|
timeSelect() {
|
||||||
case '2':
|
switch (this.queryParams.timeDim) {
|
||||||
if (this.dateValue[1] - this.dateValue[0] > 29*24*3600000) {
|
case '1':
|
||||||
this.$modal.msgError('最大时间范围为30天,请重新选择') // 自动选择默认是0:00:00要求是23:59:59
|
if (this.timeValue[1] - this.timeValue[0] > 7 * 24 * 3600000) {
|
||||||
this.dateValue = []
|
this.$modal.msgError('最大时间范围为7天,请重新选择');
|
||||||
}
|
this.timeValue = [];
|
||||||
break
|
}
|
||||||
case '4':
|
break;
|
||||||
if (this.monthValue[1] - this.monthValue[0] > 729*24*3600000) {
|
case '2':
|
||||||
this.$modal.msgError('最大时间范围为24个月,请重新选择')// 同理上面
|
if (this.dateValue[1] - this.dateValue[0] > 29 * 24 * 3600000) {
|
||||||
this.monthValue = []
|
this.$modal.msgError('最大时间范围为30天,请重新选择'); // 自动选择默认是0:00:00要求是23:59:59
|
||||||
}
|
this.dateValue = [];
|
||||||
break
|
}
|
||||||
default:
|
break;
|
||||||
}
|
case '4':
|
||||||
},
|
if (this.monthValue[1] - this.monthValue[0] > 729 * 24 * 3600000) {
|
||||||
// 年选择器
|
this.$modal.msgError('最大时间范围为24个月,请重新选择'); // 同理上面
|
||||||
startYear() {
|
this.monthValue = [];
|
||||||
if (this.yearValue2 && this.yearValue2 < this.yearValue1) {
|
}
|
||||||
this.$modal.msgError('开始时间不能晚于结束时间,请重新选择')
|
break;
|
||||||
this.yearValue1 = null
|
default:
|
||||||
return false
|
}
|
||||||
}
|
},
|
||||||
if (this.yearValue1 && this.yearValue2) {
|
// 年选择器
|
||||||
if (this.yearValue2 - this.yearValue1 > 10*365*24*3600000) {
|
startYear() {
|
||||||
this.$modal.msgError('最大时间范围为10年,请重新选择')
|
if (this.yearValue2 && this.yearValue2 < this.yearValue1) {
|
||||||
this.yearValue1 = null
|
this.$modal.msgError('开始时间不能晚于结束时间,请重新选择');
|
||||||
return false
|
this.yearValue1 = null;
|
||||||
}
|
return false;
|
||||||
}
|
}
|
||||||
},
|
if (this.yearValue1 && this.yearValue2) {
|
||||||
endYear() {
|
if (this.yearValue2 - this.yearValue1 > 10 * 365 * 24 * 3600000) {
|
||||||
if (this.yearValue2 && this.yearValue2 < this.yearValue1) {
|
this.$modal.msgError('最大时间范围为10年,请重新选择');
|
||||||
this.$modal.msgError('结束时间不能早于开始时间,请重新选择')
|
this.yearValue1 = null;
|
||||||
this.yearValue2 = null
|
return false;
|
||||||
return false
|
}
|
||||||
}
|
}
|
||||||
if (this.yearValue1 && this.yearValue2) {
|
},
|
||||||
if (this.yearValue2 - this.yearValue1 > 10*365*24*3600000) {
|
endYear() {
|
||||||
this.$modal.msgError('最大时间范围为10年,请重新选择')
|
if (this.yearValue2 && this.yearValue2 < this.yearValue1) {
|
||||||
this.yearValue2 = null
|
this.$modal.msgError('结束时间不能早于开始时间,请重新选择');
|
||||||
return false
|
this.yearValue2 = null;
|
||||||
}
|
return false;
|
||||||
}
|
}
|
||||||
},
|
if (this.yearValue1 && this.yearValue2) {
|
||||||
// 周选择器
|
if (this.yearValue2 - this.yearValue1 > 10 * 365 * 24 * 3600000) {
|
||||||
startWeek() {
|
this.$modal.msgError('最大时间范围为10年,请重新选择');
|
||||||
if (this.weekValue1 && this.weekValue2) {
|
this.yearValue2 = null;
|
||||||
let a = new Date(this.weekValue1).getTime()
|
return false;
|
||||||
let b = new Date(this.weekValue2).getTime()
|
}
|
||||||
if (a > b) {
|
}
|
||||||
this.$modal.msgError('开始时间不能晚于结束时间,请重新选择')
|
},
|
||||||
this.weekValue1 = null
|
// 周选择器
|
||||||
return false
|
startWeek() {
|
||||||
}
|
if (this.weekValue1 && this.weekValue2) {
|
||||||
if (b - a > 167*24*3600000) {
|
let a = new Date(this.weekValue1).getTime();
|
||||||
this.$modal.msgError('最大时间范围为24周,请重新选择')
|
let b = new Date(this.weekValue2).getTime();
|
||||||
this.weekValue1 = null
|
if (a > b) {
|
||||||
return false
|
this.$modal.msgError('开始时间不能晚于结束时间,请重新选择');
|
||||||
}
|
this.weekValue1 = null;
|
||||||
}
|
return false;
|
||||||
},
|
}
|
||||||
endWeek() {
|
if (b - a > 167 * 24 * 3600000) {
|
||||||
if (this.weekValue1 && this.weekValue2) {
|
this.$modal.msgError('最大时间范围为24周,请重新选择');
|
||||||
let a = new Date(this.weekValue1).getTime()
|
this.weekValue1 = null;
|
||||||
let b = new Date(this.weekValue2).getTime()
|
return false;
|
||||||
if (a > b) {
|
}
|
||||||
this.$modal.msgError('结束时间不能早于开始时间,请重新选择')
|
}
|
||||||
this.weekValue2 = null
|
},
|
||||||
return false
|
endWeek() {
|
||||||
}
|
if (this.weekValue1 && this.weekValue2) {
|
||||||
if (b - a > 167*24*3600000) {
|
let a = new Date(this.weekValue1).getTime();
|
||||||
this.$modal.msgError('最大时间范围为24周,请重新选择')
|
let b = new Date(this.weekValue2).getTime();
|
||||||
this.weekValue2 = null
|
if (a > b) {
|
||||||
return false
|
this.$modal.msgError('结束时间不能早于开始时间,请重新选择');
|
||||||
}
|
this.weekValue2 = null;
|
||||||
}
|
return false;
|
||||||
},
|
}
|
||||||
// 查询
|
if (b - a > 167 * 24 * 3600000) {
|
||||||
search() {
|
this.$modal.msgError('最大时间范围为24周,请重新选择');
|
||||||
if (!this.queryParams.energyTypeId) {
|
this.weekValue2 = null;
|
||||||
this.$modal.msgError('请选择能源类型')
|
return false;
|
||||||
return false
|
}
|
||||||
}
|
}
|
||||||
if (this.objArr.length === 0) {
|
},
|
||||||
this.$modal.msgError('请选择对象')
|
// 导出和查询判定
|
||||||
return false
|
validateData() {
|
||||||
} else {
|
if (!this.queryParams.energyTypeId) {
|
||||||
this.queryParams.objId = this.objArr[this.objArr.length-1]
|
this.$modal.msgError('请选择能源类型');
|
||||||
}
|
return false;
|
||||||
if (!this.queryParams.timeDim) {
|
}
|
||||||
this.$modal.msgError('请选择时间维度')
|
if (this.objArr.length === 0) {
|
||||||
return false
|
this.$modal.msgError('请选择对象');
|
||||||
}
|
return false;
|
||||||
switch (this.queryParams.timeDim) {
|
} else {
|
||||||
case '1':
|
this.queryParams.objId = this.objArr[this.objArr.length - 1];
|
||||||
if (this.timeValue.length > 0) {
|
}
|
||||||
this.queryParams.startTime = this.timeValue[0]
|
if (!this.queryParams.timeDim) {
|
||||||
this.queryParams.endTime = this.timeValue[1] // 不用转
|
this.$modal.msgError('请选择时间维度');
|
||||||
} else {
|
return false;
|
||||||
this.$modal.msgError('时间范围不能为空')
|
}
|
||||||
return false
|
switch (this.queryParams.timeDim) {
|
||||||
}
|
case '1':
|
||||||
break
|
if (this.timeValue.length > 0) {
|
||||||
case '2':
|
this.queryParams.startTime = this.timeValue[0];
|
||||||
if (this.dateValue.length > 0) {
|
this.queryParams.endTime = this.timeValue[1]; // 不用转
|
||||||
this.queryParams.startTime = this.dateValue[0]
|
} else {
|
||||||
this.queryParams.endTime = this.dateValue[1] + 86399000 // 转为23:59:59
|
this.$modal.msgError('时间范围不能为空');
|
||||||
} else {
|
return false;
|
||||||
this.$modal.msgError('日范围不能为空')
|
}
|
||||||
return false
|
break;
|
||||||
}
|
case '2':
|
||||||
break
|
if (this.dateValue.length > 0) {
|
||||||
case '3':
|
this.queryParams.startTime = this.dateValue[0];
|
||||||
if (this.weekValue1 && this.weekValue2) {
|
this.queryParams.endTime = this.dateValue[1] + 86399000; // 转为23:59:59
|
||||||
let a = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' 00:00:00'
|
} else {
|
||||||
let b = moment(this.weekValue2).day(6).format('YYYY-MM-DD') + ' 23:59:59'
|
this.$modal.msgError('日范围不能为空');
|
||||||
this.queryParams.startTime = new Date(a).getTime()
|
return false;
|
||||||
this.queryParams.endTime = new Date(b).getTime()
|
}
|
||||||
} else {
|
break;
|
||||||
this.$modal.msgError('周范围不能为空')
|
case '3':
|
||||||
return false
|
if (this.weekValue1 && this.weekValue2) {
|
||||||
}
|
let a =
|
||||||
break
|
moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' 00:00:00';
|
||||||
case '4':// 转为本月最后一天的最后一秒
|
let b =
|
||||||
if (this.monthValue.length > 0) {
|
moment(this.weekValue2).day(6).format('YYYY-MM-DD') + ' 23:59:59';
|
||||||
this.queryParams.startTime = this.monthValue[0]
|
this.queryParams.startTime = new Date(a).getTime();
|
||||||
this.queryParams.endTime = this.transformTime(this.monthValue[1])
|
this.queryParams.endTime = new Date(b).getTime();
|
||||||
} else {
|
} else {
|
||||||
this.$modal.msgError('月范围不能为空')
|
this.$modal.msgError('周范围不能为空');
|
||||||
return false
|
return false;
|
||||||
}
|
}
|
||||||
break
|
break;
|
||||||
default://本年最后一天
|
case '4': // 转为本月最后一天的最后一秒
|
||||||
if (this.yearValue1 && this.yearValue2) {
|
if (this.monthValue.length > 0) {
|
||||||
if (this.yearValue2 < this.yearValue1) {
|
this.queryParams.startTime = this.monthValue[0];
|
||||||
this.$modal.msgError('结束时间不能早于开始时间')
|
this.queryParams.endTime = this.transformTime(this.monthValue[1]);
|
||||||
return false
|
} else {
|
||||||
} else {
|
this.$modal.msgError('月范围不能为空');
|
||||||
this.queryParams.startTime = this.yearValue1
|
return false;
|
||||||
this.queryParams.endTime = this.transformYear(this.yearValue2)
|
}
|
||||||
}
|
break;
|
||||||
} else {
|
default: //本年最后一天
|
||||||
this.$modal.msgError('年范围不能为空')
|
if (this.yearValue1 && this.yearValue2) {
|
||||||
return false
|
if (this.yearValue2 < this.yearValue1) {
|
||||||
}
|
this.$modal.msgError('结束时间不能早于开始时间');
|
||||||
}
|
return false;
|
||||||
this.queryParams.startTime = this.queryParams.startTime + ''
|
} else {
|
||||||
this.queryParams.endTime = this.queryParams.endTime + ''
|
this.queryParams.startTime = this.yearValue1;
|
||||||
this.$emit('submit', this.queryParams)
|
this.queryParams.endTime = this.transformYear(this.yearValue2);
|
||||||
},
|
}
|
||||||
// 重置
|
} else {
|
||||||
resetBtn() {
|
this.$modal.msgError('年范围不能为空');
|
||||||
this.queryParams.energyTypeId = null
|
return false;
|
||||||
this.queryParams.objId = null
|
}
|
||||||
this.objArr = []
|
}
|
||||||
this.queryParams.timeDim = this.getDictDatas(this.DICT_TYPE.TIME_DIM)[0].value // 默认时
|
return true;
|
||||||
this.timeValue = [moment().startOf('day'), moment().endOf('day')-59*61*1000]
|
},
|
||||||
},
|
// 查询
|
||||||
transformTime(timeStamp) {// 本月最后一天
|
search() {
|
||||||
let year = moment(timeStamp).format('YYYY')
|
if (this.validateData()) {
|
||||||
let month = moment(timeStamp).format('MM')
|
this.queryParams.startTime = this.queryParams.startTime + '';
|
||||||
let newData = moment(new Date(year,month,0)).format('YYYY-MM-DD') + ' 23:59:59'
|
this.queryParams.endTime = this.queryParams.endTime + '';
|
||||||
let value = new Date(newData).getTime()
|
this.$emit('submit', this.queryParams);
|
||||||
return value
|
}
|
||||||
},
|
},
|
||||||
transformYear(timeStamp) {// 本年最后一天
|
// 重置
|
||||||
let year = moment(timeStamp).format('YYYY')
|
resetBtn() {
|
||||||
let newData = year+'-12-31 23:59:59'
|
this.queryParams.energyTypeId = null;
|
||||||
let value = new Date(newData).getTime()
|
this.queryParams.objId = null;
|
||||||
return value
|
this.objArr = [];
|
||||||
},
|
this.queryParams.timeDim = this.getDictDatas(
|
||||||
switchMode() {// 展开和收起切换
|
this.DICT_TYPE.TIME_DIM
|
||||||
this.isExpand = !this.isExpand
|
)[0].value; // 默认时
|
||||||
const element = this.$refs.searchBarRef
|
this.timeValue = [
|
||||||
if (this.isExpand) {
|
moment().startOf('day'),
|
||||||
element.classList.remove('divHeight')
|
moment().endOf('day') - 59 * 61 * 1000,
|
||||||
} else {
|
];
|
||||||
element.classList.add('divHeight')
|
},
|
||||||
}
|
transformTime(timeStamp) {
|
||||||
}
|
// 本月最后一天
|
||||||
}
|
let year = moment(timeStamp).format('YYYY');
|
||||||
}
|
let month = moment(timeStamp).format('MM');
|
||||||
|
let newData =
|
||||||
|
moment(new Date(year, month, 0)).format('YYYY-MM-DD') + ' 23:59:59';
|
||||||
|
let value = new Date(newData).getTime();
|
||||||
|
return value;
|
||||||
|
},
|
||||||
|
transformYear(timeStamp) {
|
||||||
|
// 本年最后一天
|
||||||
|
let year = moment(timeStamp).format('YYYY');
|
||||||
|
let newData = year + '-12-31 23:59:59';
|
||||||
|
let value = new Date(newData).getTime();
|
||||||
|
return value;
|
||||||
|
},
|
||||||
|
switchMode() {
|
||||||
|
// 展开和收起切换
|
||||||
|
this.isExpand = !this.isExpand;
|
||||||
|
const element = this.$refs.searchBarRef;
|
||||||
|
if (this.isExpand) {
|
||||||
|
element.classList.remove('divHeight');
|
||||||
|
} else {
|
||||||
|
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>
|
||||||
<style lang='scss'>
|
<style lang="scss">
|
||||||
/* 级联选择器 */
|
/* 级联选择器 */
|
||||||
.cascaderParent .el-cascader-panel .el-scrollbar:first-child .el-radio {
|
.cascaderParent .el-cascader-panel .el-scrollbar:first-child .el-radio {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
/* 时间整点 */
|
/* 时间整点 */
|
||||||
.noneMinute .el-time-spinner__wrapper {
|
.noneMinute .el-time-spinner__wrapper {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.noneMinute .el-scrollbar:nth-of-type(2) {
|
.noneMinute .el-scrollbar:nth-of-type(2) {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.demo-form-inline {
|
.demo-form-inline {
|
||||||
.el-date-editor .el-range__icon {
|
.el-date-editor .el-range__icon {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
color: #0B58FF;
|
color: #0b58ff;
|
||||||
}
|
}
|
||||||
.el-input__prefix .el-icon-date {
|
.el-input__prefix .el-icon-date {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
color: #0B58FF;
|
color: #0b58ff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.demo-form-inline {
|
.demo-form-inline {
|
||||||
.blue-block {
|
.blue-block {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 4px;
|
width: 4px;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
background-color: #0B58FF;
|
background-color: #0b58ff;
|
||||||
border-radius: 1px;
|
border-radius: 1px;
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
margin-top: 12px;
|
margin-top: 12px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.searchBarBox .foldClass {
|
.searchBarBox .foldClass {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 14px;
|
top: 14px;
|
||||||
right: 0;
|
right: 0;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color:#0B58FF;
|
color: #0b58ff;
|
||||||
}
|
}
|
||||||
.searchBarBox .foldClass .iconfont {
|
.searchBarBox .foldClass .iconfont {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
.divHeight {
|
.divHeight {
|
||||||
height: 45px;
|
height: 45px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.separateStyle {
|
.separateStyle {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 1px;
|
width: 1px;
|
||||||
height: 24px;
|
height: 24px;
|
||||||
background: #E8E8E8;
|
background: #e8e8e8;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,94 +1,104 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2024-07-01 14:53:55
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2024-09-26 10:47:36
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container trendAnalysisBox" id="trendAnalysisBox">
|
<div class="app-container trendAnalysisBox" id="trendAnalysisBox">
|
||||||
<!-- 搜索工作栏 -->
|
<!-- 搜索工作栏 -->
|
||||||
<search-area :isFold="isFold" @submit="getList"/>
|
<search-area :isFold="isFold" @submit="getList" @exportD="exportData"/>
|
||||||
<el-tabs v-model="activeName" @tab-click="switchChart" v-show='chartData.length'>
|
<div v-show="chartData.length">
|
||||||
<el-tab-pane label="柱状图" name="bar">
|
<base-table
|
||||||
<bar-chart ref="analysisBarChart" :chartData="chartData" :timeDim="timeDim"/>
|
:table-props="tableProps"
|
||||||
</el-tab-pane>
|
:table-data="list"
|
||||||
<el-tab-pane label="折线图" name="line">
|
class="trend-out-table" />
|
||||||
<line-chart ref="analysisLineChart" :chartData="chartData" :timeDim="timeDim"/>
|
<line-chart
|
||||||
</el-tab-pane>
|
ref="analysisLineChart"
|
||||||
</el-tabs>
|
:chartData="chartData"
|
||||||
|
:timeDim="timeDim" />
|
||||||
|
</div>
|
||||||
<!-- 没有数据 -->
|
<!-- 没有数据 -->
|
||||||
<div class="no-data-bg" v-show='!chartData.length'></div>
|
<div class="no-data-bg" v-show='!chartData.length'></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getEnergyTrend } from "@/api/analysis/energyAnalysis"
|
import { getEnergyTrend, exportTrend } from "@/api/analysis/energyAnalysis"
|
||||||
import SearchArea from "./components/searchArea"
|
import SearchArea from "./components/searchArea"
|
||||||
import BarChart from "./components/barChart"
|
|
||||||
import LineChart from "./components/lineChart"
|
import LineChart from "./components/lineChart"
|
||||||
// import moment from 'moment'
|
// import moment from 'moment'
|
||||||
export default {
|
export default {
|
||||||
name: 'TrendAnalysis',
|
name: 'TrendAnalysis',
|
||||||
components: { SearchArea, BarChart, LineChart },
|
components: { SearchArea, LineChart },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isFold: false,
|
isFold: false,
|
||||||
activeName: 'bar',
|
|
||||||
chartData: [],
|
chartData: [],
|
||||||
timeDim: ''
|
timeDim: '',
|
||||||
|
tableProps: [],
|
||||||
|
list: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
window.addEventListener('resize', () => {
|
window.addEventListener('resize', () => {
|
||||||
this.tableH = this.tableHeight(260)
|
this.tableH = this.tableHeight(260)
|
||||||
this.isFold = this.searchBarWidth('trendAnalysisBox', 1263)
|
this.isFold = this.searchBarWidth('trendAnalysisBox', 1146)
|
||||||
})
|
})
|
||||||
this.isFold = this.searchBarWidth('trendAnalysisBox', 1263)
|
this.isFold = this.searchBarWidth('trendAnalysisBox', 1146)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getList(params) {
|
getList(params) {
|
||||||
this.timeDim = params.timeDim
|
this.timeDim = params.timeDim
|
||||||
getEnergyTrend({ ...params }).then((res) => {
|
getEnergyTrend({ ...params }).then((res) => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.chartData = res.data
|
this.getTableList(res.data || []);
|
||||||
|
this.chartData = res.data || [];
|
||||||
} else {
|
} else {
|
||||||
this.chartData = []
|
this.chartData = []
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
switchChart() {
|
getTableList(arr) {
|
||||||
if (this.activeName === 'bar') {
|
this.tableProps = [];
|
||||||
this.$nextTick((res) => {
|
this.list = [];
|
||||||
this.$refs.analysisBarChart.getChart()
|
let tempX = [];
|
||||||
})
|
let listObj = { useNum: '消耗量' }; // 数据
|
||||||
} else {
|
for (let i = 0; i < arr.length; i++) {
|
||||||
this.$nextTick((res) => {
|
let obj = {};
|
||||||
this.$refs.analysisLineChart.getChart()
|
if (this.timeDim === '3') {
|
||||||
})
|
let fName = arr[i].time.slice(0, 4);
|
||||||
}
|
let lName = arr[i].time.slice(4, 6);
|
||||||
|
obj.label = fName + ' 第 ' + lName + ' 周';
|
||||||
|
} else {
|
||||||
|
obj.label = arr[i].time;
|
||||||
|
}
|
||||||
|
obj.prop = arr[i].time;
|
||||||
|
obj.minWidth = 100;
|
||||||
|
tempX.push(obj);
|
||||||
|
listObj[arr[i].time] = arr[i].useNum || null;
|
||||||
|
}
|
||||||
|
this.tableProps = [{ prop: 'useNum', label: '时间' }].concat(tempX);
|
||||||
|
this.list.push(listObj);
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
exportData(val) {
|
||||||
|
// 处理查询参数
|
||||||
|
this.$modal.confirm('是否确认导出走势分析数据?').then(() => {
|
||||||
|
this.exportLoading = true;
|
||||||
|
return exportTrend(val);
|
||||||
|
}).then(response => {
|
||||||
|
this.$download.excel(response, '走势分析数据.xlsx');
|
||||||
|
this.exportLoading = false;
|
||||||
|
}).catch(() => {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang='scss'>
|
<style lang='scss'>
|
||||||
.trendAnalysisBox {
|
.trendAnalysisBox {
|
||||||
.el-tabs__nav::after {
|
.trend-out-table {
|
||||||
content: "";
|
margin-bottom: 15px;
|
||||||
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>
|
</style>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
430
src/views/equipment/DialogFormZ.vue
Normal file
430
src/views/equipment/DialogFormZ.vue
Normal 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', // 上传有关的headers,url都是固定的
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
labelWidth() {
|
||||||
|
let max = findMaxLabelWidth(this.rows);
|
||||||
|
// 每个汉字占20px
|
||||||
|
return max * 20;
|
||||||
|
// return max * 20 + 'px';
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
rows: {
|
||||||
|
handler() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.handleOptions('watch');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
immediate: false,
|
||||||
|
},
|
||||||
|
dataForm: {
|
||||||
|
handler(val) {
|
||||||
|
this.form = JSON.parse(JSON.stringify(val));
|
||||||
|
if (this.hasFiles) {
|
||||||
|
if (typeof this.hasFiles == 'boolean' && this.hasFiles) {
|
||||||
|
this.form.files = this.form.files ?? [];
|
||||||
|
} else if (Array.isArray(this.hasFiles)) {
|
||||||
|
this.hasFiles.forEach((prop) => {
|
||||||
|
this.form[prop] = this.form[prop] ?? [];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
immediate: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
// 处理 options
|
||||||
|
this.handleOptions();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 模拟透传 ref */
|
||||||
|
validate(cb) {
|
||||||
|
return this.$refs.form.validate(cb);
|
||||||
|
},
|
||||||
|
resetFields(args) {
|
||||||
|
return this.$refs.form.resetFields(args);
|
||||||
|
},
|
||||||
|
// getCode
|
||||||
|
async getCode(url) {
|
||||||
|
const response = await this.$axios(url);
|
||||||
|
return response.data;
|
||||||
|
},
|
||||||
|
async handleOptions(trigger = 'monuted') {
|
||||||
|
console.log('[dialogForm:handleOptions]');
|
||||||
|
const promiseList = [];
|
||||||
|
this.rows.forEach((cols) => {
|
||||||
|
cols.forEach((opt) => {
|
||||||
|
if (opt.value && !this.form[opt.prop]) {
|
||||||
|
// 默认值
|
||||||
|
this.form[opt.prop] = opt.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (opt.options) {
|
||||||
|
this.$set(this.optionListOf, opt.prop, opt.options);
|
||||||
|
} else if (opt.url) {
|
||||||
|
// 如果有 depends,则暂时先不获取,注册一个watcher
|
||||||
|
if (opt.depends) {
|
||||||
|
this.$watch(
|
||||||
|
() => this.form[opt.depends],
|
||||||
|
(id) => {
|
||||||
|
console.log('<', opt.depends, '>', 'changed', id);
|
||||||
|
if (id == null) return;
|
||||||
|
// 清空原有选项
|
||||||
|
this.form[opt.prop] = null;
|
||||||
|
// 获取新的选项
|
||||||
|
this.$axios({
|
||||||
|
url: `${opt.url}?id=${id}`,
|
||||||
|
}).then((res) => {
|
||||||
|
this.$set(
|
||||||
|
this.optionListOf,
|
||||||
|
opt.prop,
|
||||||
|
res.data.map((item) => ({
|
||||||
|
label: item[opt.labelKey ?? 'name'],
|
||||||
|
value: item[opt.valueKey ?? 'id'],
|
||||||
|
}))
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
{
|
||||||
|
immediate: false,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 如果是下拉框,或者新增模式下的输入框,才去请求
|
||||||
|
if (opt.select || (opt.input && !this.form?.id)) {
|
||||||
|
promiseList.push(async () => {
|
||||||
|
const response = await this.$axios(opt.url, {
|
||||||
|
method: opt.method ?? 'get',
|
||||||
|
});
|
||||||
|
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>
|
||||||
@@ -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();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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({
|
||||||
|
|||||||
@@ -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: [
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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({
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -29,9 +29,9 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
},
|
},
|
||||||
mounted() {
|
// mounted() {
|
||||||
this.getDataList()
|
// this.getDataList()
|
||||||
},
|
// },
|
||||||
methods: {
|
methods: {
|
||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
getDataList() {
|
getDataList() {
|
||||||
|
|||||||
@@ -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)
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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 || [];
|
||||||
|
|||||||
@@ -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 || [];
|
||||||
|
|||||||
@@ -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 || [];
|
||||||
|
|||||||
@@ -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('确认成功');
|
||||||
|
|||||||
@@ -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)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user