Compare commits
18 Commits
8399081a6f
...
3aec5ee86c
Author | SHA1 | Date | |
---|---|---|---|
|
3aec5ee86c | ||
|
79274aa8c8 | ||
29ea06e5be | |||
|
f5bb5f27b4 | ||
|
fbe8e5c023 | ||
0f4bddc6d1 | |||
91d269e1ce | |||
4e26d49ff5 | |||
63b19d84e4 | |||
6c7390f61e | |||
1661615af4 | |||
8fdaa3e968 | |||
f2e38b5e67 | |||
fe0c84bc3a | |||
0a53bcb57e | |||
1ce61f13b7 | |||
|
4e48eae2a7 | ||
49d002142f |
6
.env.dev
6
.env.dev
@ -1,7 +1,7 @@
|
||||
###
|
||||
# @Author: Do not edit
|
||||
# @Date: 2023-08-29 09:40:39
|
||||
# @LastEditTime: 2023-11-21 10:36:47
|
||||
# @LastEditTime: 2023-12-14 14:02:40
|
||||
# @LastEditors: DY
|
||||
# @Description:
|
||||
###
|
||||
@ -14,13 +14,13 @@ VUE_APP_TITLE = MES系统
|
||||
# 芋道管理系统/开发环境
|
||||
# VUE_APP_BASE_API = 'http://100.64.0.26:48082'
|
||||
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.4.173:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.78:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.49:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.8:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.4.159:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.56:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.4.159:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.62:48082'
|
||||
|
||||
# 积木报表指向地址
|
||||
VUE_APP_JIMU_API = 'http://192.168.0.33:48082'
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-10-21 11:50:46
|
||||
* @LastEditTime: 2023-11-15 15:56:14
|
||||
* @LastEditTime: 2023-12-14 10:57:24
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
@ -65,4 +65,31 @@ export function getHotMaterialList(query) {
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 创建原料质量检测条目
|
||||
export function createHotMaterialCheck(data) {
|
||||
return request({
|
||||
url: '/base/core-hot-material-check/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新原料质量检测条目
|
||||
export function updateHotMaterialCheck(data) {
|
||||
return request({
|
||||
url: '/base/core-hot-material-check/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获得质量检测条目列表
|
||||
export function getHotCheckList(query) {
|
||||
return request({
|
||||
url: '/base/core-hot-material-check/listByMaterial',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
56
src/api/base/energyQuantityManual.js
Normal file
56
src/api/base/energyQuantityManual.js
Normal file
@ -0,0 +1,56 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获得分页数据
|
||||
export function energyQuantityManualPage(data) {
|
||||
return request({
|
||||
url: '/base/energy-quantity-manual/page',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 创建
|
||||
export function energyQuantityManualCreate(data) {
|
||||
return request({
|
||||
url: '/base/energy-quantity-manual/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新
|
||||
export function energyQuantityManualUpdate(data) {
|
||||
return request({
|
||||
url: '/base/energy-quantity-manual/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
//获得能源抄表(手动)
|
||||
export function energyQuantityManualGet(query) {
|
||||
return request({
|
||||
url: '/base/energy-quantity-manual/get',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
//删除
|
||||
export function energyQuantityManualDelete(query) {
|
||||
return request({
|
||||
url: '/base/energy-quantity-manual/delete',
|
||||
method: 'delete',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
//导出
|
||||
export function energyQuantityManualExport(data) {
|
||||
return request({
|
||||
url: '/base/energy-quantity-manual/export-excel',
|
||||
method: 'post',
|
||||
data: data,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
101
src/api/base/qualityHotMaterial.js
Normal file
101
src/api/base/qualityHotMaterial.js
Normal file
@ -0,0 +1,101 @@
|
||||
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2023-11-06 15:38:12
|
||||
* @LastEditTime: 2023-12-08 16:08:35
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建质量检测类型基础
|
||||
export function createQualityHotMaterial(data) {
|
||||
return request({
|
||||
url: '/base/quality-hot-material/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新质量检测类型基础
|
||||
export function updateQualityHotMaterial(data) {
|
||||
return request({
|
||||
url: '/base/quality-hot-material/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除质量检测类型基础
|
||||
export function deleteQualityHotMaterial(id) {
|
||||
return request({
|
||||
url: '/base/quality-hot-material/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得质量检测类型基础
|
||||
export function getQualityHotMaterial(id) {
|
||||
return request({
|
||||
url: '/base/quality-hot-material/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得质量检测类型基础分页
|
||||
export function getQualityHotMaterialPage(query) {
|
||||
return request({
|
||||
url: 'base/quality-hot-material/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出质量检测类型基础 Excel
|
||||
// export function exportQualityScrapTypeExcel(query) {
|
||||
// return request({
|
||||
// url: '/base/quality-scrap-type/export-excel',
|
||||
// method: 'get',
|
||||
// params: query,
|
||||
// responseType: 'blob'
|
||||
// })
|
||||
// }
|
||||
|
||||
export function getCode(query) {
|
||||
return request({
|
||||
url: '/base/quality-hot-material/getCode',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
export function getHotMaterialAllList(query) {
|
||||
return request({
|
||||
url: '/base/core-hot-material/listAll',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getSupplierList(query) {
|
||||
return request({
|
||||
url: '/base/core-supplier/listAll',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getWorkerList(query) {
|
||||
return request({
|
||||
url: '/base/core-worker/listAll',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getMaterialCheckList(query) {
|
||||
return request({
|
||||
url: '/base/core-hot-material-check/listByMaterial',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
@ -1,10 +1,17 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-04 14:10:37
|
||||
* @LastEditTime: 2023-12-13 16:03:46
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建安灯按钮16键对应
|
||||
export function createQualityInspectionBoxBtn(data) {
|
||||
return request({
|
||||
url: '/base/quality-inspection-box-btn/create',
|
||||
method: 'post',
|
||||
url: '/base/quality-inspection-box-btn/updateBatch',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@ -52,3 +59,19 @@ export function exportQualityInspectionBoxBtnExcel(query) {
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
export function getAllDetByTypeList(query) {
|
||||
return request({
|
||||
url: '/base/quality-scrap-det/scrapMap',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
export function getListByLineSection(query) {
|
||||
return request({
|
||||
url: '/base/quality-inspection-box-btn/detListByLineSection',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2023-11-06 15:38:12
|
||||
* @LastEditTime: 2023-11-06 15:39:39
|
||||
* @LastEditTime: 2023-12-08 09:46:55
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
@ -67,3 +67,4 @@ export function getCode(query) {
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
78
src/api/cost/costEneryAutoReport.js
Normal file
78
src/api/cost/costEneryAutoReport.js
Normal file
@ -0,0 +1,78 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2023-11-23 14:57:00
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-12-07 09:37:18
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建能源自动记录报
|
||||
export function createCostEneryAutoReport(data) {
|
||||
return request({
|
||||
url: '/extend/cost-enery-auto-report/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新能源自动记录报
|
||||
export function updateCostEneryAutoReport(data) {
|
||||
return request({
|
||||
url: '/extend/cost-enery-auto-report/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除能源自动记录报
|
||||
export function deleteCostEneryAutoReport(id) {
|
||||
return request({
|
||||
url: '/extend/cost-enery-auto-report/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得能源自动记录报
|
||||
export function getCostEneryAutoReport(id) {
|
||||
return request({
|
||||
url: '/extend/cost-enery-auto-report/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得能源自动记录报分页历史
|
||||
export function getCostEneryAutoReportPage(data) {
|
||||
return request({
|
||||
url: '/extend/cost-enery-auto-report/page',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 获得能源查询
|
||||
export function getCostEneryAutoPage(data) {
|
||||
return request({
|
||||
url: '/extend/cost-energy-search/getData',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 导出能源自动记录报 Excel
|
||||
export function exportCostEneryAutoReportExcel(data) {
|
||||
return request({
|
||||
url: '/extend/cost-enery-auto-report/export-excel',
|
||||
method: 'post',
|
||||
data: data,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出能源自动记录报 Excel 查询
|
||||
export function exportCostEneryExcel(data) {
|
||||
return request({
|
||||
url: '/extend/cost-energy-search/export-excel',
|
||||
method: 'post',
|
||||
data: data,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
73
src/api/cost/costMaterialAutoReport.js
Normal file
73
src/api/cost/costMaterialAutoReport.js
Normal file
@ -0,0 +1,73 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建原料成本自动统计报
|
||||
export function createCostMaterialAutoReport(data) {
|
||||
return request({
|
||||
url: '/extend/cost-material-auto-report/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新原料成本自动统计报
|
||||
export function updateCostMaterialAutoReport(data) {
|
||||
return request({
|
||||
url: '/extend/cost-material-auto-report/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除原料成本自动统计报
|
||||
export function deleteCostMaterialAutoReport(id) {
|
||||
return request({
|
||||
url: '/extend/cost-material-auto-report/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得原料成本自动统计报
|
||||
export function getCostMaterialAutoReport(id) {
|
||||
return request({
|
||||
url: '/extend/cost-material-auto-report/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得原料成本自动统计报分页历史
|
||||
export function getCostMaterialAutoReportPage(data) {
|
||||
return request({
|
||||
url: '/extend/cost-material-auto-report/page',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获得原料成本查询
|
||||
export function getCostMaterialSearchPage(data) {
|
||||
return request({
|
||||
url: '/extend/cost-material-search/getData',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 导出原料成本自动统计报 Excel
|
||||
export function exportCostMaterialAutoReportExcel(data) {
|
||||
return request({
|
||||
url: '/extend/cost-material-auto-report/export-excel',
|
||||
method: 'post',
|
||||
data: data,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出原料成本自动统计报 Excel查询
|
||||
export function exportCostMaterialSearch(data) {
|
||||
return request({
|
||||
url: '/extend/cost-material-search/export-excel',
|
||||
method: 'post',
|
||||
data: data,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
61
src/api/cost/costMaterialSet.js
Normal file
61
src/api/cost/costMaterialSet.js
Normal file
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2023-11-15 09:24:30
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-12-05 14:38:48
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建原料价位配置
|
||||
export function createCostMaterialSet(data) {
|
||||
return request({
|
||||
url: '/extend/cost-material-set/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新原料价位配置
|
||||
export function updateCostMaterialSet(data) {
|
||||
return request({
|
||||
url: '/extend/cost-material-set/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除原料价位配置
|
||||
export function deleteCostMaterialSet(id) {
|
||||
return request({
|
||||
url: '/extend/cost-material-set/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得原料价位配置
|
||||
export function getCostMaterialSet(id) {
|
||||
return request({
|
||||
url: '/extend/cost-material-set/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得原料价位配置分页
|
||||
export function getCostMaterialSetPage(data) {
|
||||
return request({
|
||||
url: '/extend/cost-material-set/page',
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 导出原料价位配置 Excel
|
||||
export function exportCostMaterialSetExcel(query) {
|
||||
return request({
|
||||
url: '/extend/cost-material-set/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
63
src/api/monitoring/qualityIsra.js
Normal file
63
src/api/monitoring/qualityIsra.js
Normal file
@ -0,0 +1,63 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-08 15:26:59
|
||||
* @LastEditTime: 2023-12-11 15:21:44
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
export function getQualityIsraPage(query) {
|
||||
return request({
|
||||
url: 'base/quality-isra-statistics/getIsraData',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getQualityIsraDayMap(query) {
|
||||
return request({
|
||||
url: '/base/quality-isra-statistics/dayMap',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getQualityIsraWeekMap(query) {
|
||||
return request({
|
||||
url: '/base/quality-isra-statistics/weekMap',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getQualityIsraMonthMap(query) {
|
||||
return request({
|
||||
url: '/base/quality-isra-statistics/monthMap',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getQualityIsraDayList(query) {
|
||||
return request({
|
||||
url: '/base/quality-isra-statistics/dayList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getQualityIsraWeekList(query) {
|
||||
return request({
|
||||
url: '/base/quality-isra-statistics/weekList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getQualityIsraMonthList(query) {
|
||||
return request({
|
||||
url: '/base/quality-isra-statistics/monthList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2023-10-31 10:55:20
|
||||
* @LastEditTime: 2023-10-31 15:05:30
|
||||
* @LastEditTime: 2023-12-06 14:09:14
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
@ -33,3 +33,12 @@ export function exportEnergyPlcExcel(query) {
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
export function getOriginalGlassRetrace(query) {
|
||||
return request({
|
||||
url: '/base/original-glass-statistics/originalGlassRetrace',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
|
61
src/api/report/glass.js
Normal file
61
src/api/report/glass.js
Normal file
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-12-08 10:26:48
|
||||
* @LastEditTime: 2023-12-13 17:16:00
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建原片自动报
|
||||
export function createGlass(data) {
|
||||
return request({
|
||||
url: '/base/report-auto-original-glass/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 批量更新原片自动报
|
||||
export function updateGlass(data) {
|
||||
return request({
|
||||
url: '/base/report-auto-original-glass/updatePlus',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 更新原片自动报
|
||||
export function updateGlassRemark(data) {
|
||||
return request({
|
||||
url: '/base/report-auto-original-glass/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获得原片自动报
|
||||
export function getGlass(id) {
|
||||
return request({
|
||||
url: '/base/report-auto-original-glass/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得原片分页
|
||||
export function getGlassPage(query) {
|
||||
return request({
|
||||
url: '/base/report-auto-original-glass/listPlus',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出原片自动报 Excel
|
||||
export function exportGlasscExcel(query) {
|
||||
return request({
|
||||
url: '/base/report-auto-original-glass/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
41
src/api/report/production.js
Normal file
41
src/api/report/production.js
Normal file
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:49:02
|
||||
* @LastEditTime: 2023-12-13 15:52:11
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获得质量检查信息记录表分页
|
||||
|
||||
export function getProductionDataList(query) {
|
||||
return request({
|
||||
url: '/base/report-auto-production/listPlus',
|
||||
method: 'get',
|
||||
data: query,
|
||||
})
|
||||
}
|
||||
|
||||
export function updateProductionDataList(query) {
|
||||
return request({
|
||||
url: '/base/report-auto-production/updatePlus',
|
||||
method: 'put',
|
||||
data: query,
|
||||
})
|
||||
}
|
||||
export function updateSumProductionDataList(query) {
|
||||
return request({
|
||||
url: '/base/report-auto-production/update',
|
||||
method: 'put',
|
||||
data: query,
|
||||
})
|
||||
}
|
||||
|
||||
export function getAutoDeliveDataList(query) {
|
||||
return request({
|
||||
url: '/base/report-auto-delive/listPlus',
|
||||
method: 'put',
|
||||
data: query,
|
||||
})
|
||||
}
|
92
src/api/safetyEnvironmental/environmental.js
Normal file
92
src/api/safetyEnvironmental/environmental.js
Normal file
@ -0,0 +1,92 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获得环保检测指标实时数据
|
||||
export function environmentalCheckRealtime(query) {
|
||||
return request({
|
||||
url: '/base/environmental-check/realtime',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得环保检测指标趋势数据
|
||||
export function environmentalCheckRealtimeTrend(data) {
|
||||
return request({
|
||||
url: '/base/environmental-check-record/trend',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获得环保检测指标分页
|
||||
export function environmentalCheckPage(query) {
|
||||
return request({
|
||||
url: '/base/environmental-check/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 创建环保检测指标
|
||||
export function environmentalCheckCreate(data) {
|
||||
return request({
|
||||
url: '/base/environmental-check/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新环保检测指标
|
||||
export function environmentalCheckUpdate(data) {
|
||||
return request({
|
||||
url: '/base/environmental-check/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获得环保检测指标
|
||||
export function environmentalCheckGet(query) {
|
||||
return request({
|
||||
url: '/base/environmental-check/get',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 删除环保检测指标
|
||||
export function environmentalCheckDelete(query) {
|
||||
return request({
|
||||
url: '/base/environmental-check/delete',
|
||||
method: 'delete',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得环保检测记录分页
|
||||
export function environmentalCheckRecordPage(data) {
|
||||
return request({
|
||||
url: '/base/environmental-check-record/page',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 导出环保检测记录 Excel
|
||||
export function environmentalCheckRecordExport(data) {
|
||||
return request({
|
||||
url: '/base/environmental-check-record/export-excel',
|
||||
method: 'post',
|
||||
data: data,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取环保检测指标code
|
||||
export function getEnvironmentalCheckCode(query) {
|
||||
return request({
|
||||
url: '/base/environmental-check/getCode',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
BIN
src/assets/images/choicepart/Cost.png
Normal file
BIN
src/assets/images/choicepart/Cost.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
BIN
src/assets/images/choicepart/Databoard.png
Normal file
BIN
src/assets/images/choicepart/Databoard.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
src/assets/images/choicepart/SafetyEnvironmental.png
Normal file
BIN
src/assets/images/choicepart/SafetyEnvironmental.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
BIN
src/assets/images/detectionData.png
Normal file
BIN
src/assets/images/detectionData.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
@ -142,9 +142,6 @@ function findMaxLabelWidth(rows) {
|
||||
if (!opt.label) return 0;
|
||||
if (opt.label.length > max) {
|
||||
max = opt.label.length;
|
||||
if (opt.label.includes('(')) {
|
||||
max = max - 3
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -242,7 +239,7 @@ export default {
|
||||
size: {
|
||||
type: String,
|
||||
default: '',
|
||||
}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -83,7 +83,7 @@ export default {
|
||||
],
|
||||
},
|
||||
placeholder: '请输入内容',
|
||||
// readOnly: false,
|
||||
readOnly: true,
|
||||
},
|
||||
};
|
||||
},
|
||||
@ -123,7 +123,6 @@ export default {
|
||||
const editor = this.$refs.editor;
|
||||
this.Quill = new Quill(editor, this.options);
|
||||
// 取消自动聚焦 start
|
||||
this.Quill?.enable(false);
|
||||
this.$nextTick(() => {
|
||||
this.Quill?.blur();
|
||||
this.Quill?.enable(true);
|
||||
@ -195,7 +194,7 @@ export default {
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
<style>
|
||||
.editor-wrapper {
|
||||
position: relative;
|
||||
cursor: not-allowed;
|
||||
|
@ -15,6 +15,7 @@
|
||||
:headers="headers"
|
||||
:file-list="fileList"
|
||||
:on-preview="handlePictureCardPreview"
|
||||
:disabled="disabled"
|
||||
:class="{hide: this.fileList.length >= this.limit}"
|
||||
>
|
||||
<i class="el-icon-plus"></i>
|
||||
@ -44,6 +45,7 @@
|
||||
|
||||
<script>
|
||||
import { getAccessToken } from "@/utils/auth";
|
||||
import { flatten } from 'min-dash';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
@ -67,6 +69,10 @@ export default {
|
||||
isShowTip: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -122,14 +128,16 @@ export default {
|
||||
// 上传成功回调
|
||||
handleUploadSuccess(res) {
|
||||
// edit by 芋道源码
|
||||
this.uploadList.push({ name: res.data, url: res.data });
|
||||
if (this.uploadList.length === this.number) {
|
||||
this.fileList = this.fileList.concat(this.uploadList);
|
||||
this.uploadList = [];
|
||||
this.number = 0;
|
||||
this.$emit("input", this.listToString(this.fileList));
|
||||
this.$modal.closeLoading();
|
||||
if (res.code !== 500) {
|
||||
this.uploadList.push({ name: res.data, url: res.data });
|
||||
if (this.uploadList.length === this.number) {
|
||||
this.fileList = this.fileList.concat(this.uploadList);
|
||||
this.uploadList = [];
|
||||
this.number = 0;
|
||||
this.$emit("input", this.listToString(this.fileList));
|
||||
}
|
||||
}
|
||||
this.$modal.closeLoading();
|
||||
},
|
||||
// 上传前loading加载
|
||||
handleBeforeUpload(file) {
|
||||
|
@ -360,7 +360,6 @@ export default {
|
||||
ts: Date.now(), // 现在的时间戳
|
||||
}
|
||||
reqGet(data).then(res => {
|
||||
console.log(1)
|
||||
if (res.repCode === '0000') {
|
||||
this.backImgBase = res.repData.originalImageBase64
|
||||
this.blockBackImgBase = res.repData.jigsawImageBase64
|
||||
|
@ -28,7 +28,7 @@ export default {
|
||||
// tableBtn: [], // 占位
|
||||
// searchBarFormConfig: [], // 占位
|
||||
// // 弹窗表单配置
|
||||
// dialogFormConfig: [], //
|
||||
// dialogFormConfig: [], //
|
||||
updateUrl: '',
|
||||
addUrl: '',
|
||||
pageUrl: '',
|
||||
@ -118,9 +118,9 @@ export default {
|
||||
this.queryParams['startTime'] = btn.timeVal[0];
|
||||
this.queryParams['endTime'] = btn.timeVal[1];
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.queryParams[key] = btn[key] || null;
|
||||
});
|
||||
});
|
||||
this.handleQuery();
|
||||
break;
|
||||
case 'add':
|
||||
|
@ -104,7 +104,7 @@ export const constantRoutes = [
|
||||
// this generates a separate chunk (about.[hash].js) for this route
|
||||
// which is lazy-loaded when the route is visited.
|
||||
component: () => import(/* webpackChunkName: "about" */ '@/views/OperationalOverview/coldBoard.vue')
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/processingBoard',
|
||||
name: 'processingBoard',
|
||||
|
@ -94,6 +94,8 @@ export const DICT_TYPE = {
|
||||
OBJECT_TYPE: 'object_type',
|
||||
STATISTIC_TYPE: 'statistic_type',
|
||||
TIME_DIM: 'time_dim',
|
||||
TABLE_NAME: 'table_name',
|
||||
METHOD: 'method',
|
||||
|
||||
// ============== ORDER - 订单模块 =============
|
||||
ORDER_STATUS: 'order_status',
|
||||
@ -104,6 +106,9 @@ export const DICT_TYPE = {
|
||||
// ============== EQUIPMENT - 设备模块 =============
|
||||
MAINTAIN_TYPE: 'maintain_type',
|
||||
FAULT_LEVEL: 'fault-level',
|
||||
|
||||
// ============== ENVIRONMENTAL - 环保模块 =============
|
||||
ENVIRONMENT_CHECK_UNIT: 'environment_check_unit'
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
const baseURL = process.env.VUE_APP_BASE_API
|
||||
|
||||
// 日期格式化
|
||||
// 日期格式化(通用)
|
||||
export function parseTime(time, pattern) {
|
||||
if (arguments.length === 0 || !time) {
|
||||
return null
|
||||
@ -48,6 +48,51 @@ export function parseTime(time, pattern) {
|
||||
return time_str
|
||||
}
|
||||
|
||||
// 日期格式化(仅适用表格)
|
||||
export function parseTimeTable(pattern) {
|
||||
return function(time){
|
||||
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 function resetForm(refName) {
|
||||
if (this.$refs[refName]) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-22 10:27:50
|
||||
* @LastEditTime: 2023-12-12 16:04:44
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -15,25 +15,26 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户编号" prop="code">
|
||||
<el-input v-model="dataForm.code" clearable placeholder="请输入客户编号" />
|
||||
<el-input v-model="dataForm.code" :disabled="isdetail" clearable placeholder="请输入客户编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户名称" prop="name">
|
||||
<el-input v-model="dataForm.name" clearable placeholder="请输入客户名称" />
|
||||
<el-input v-model="dataForm.name" :disabled="isdetail" clearable placeholder="请输入客户名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系人" prop="contact">
|
||||
<el-input v-model="dataForm.contact" clearable placeholder="请输入联系人" />
|
||||
<el-input v-model="dataForm.contact" :disabled="isdetail" clearable placeholder="请输入联系人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="telephone">
|
||||
<el-input
|
||||
v-model="dataForm.telephone"
|
||||
:disabled="isdetail"
|
||||
maxlength="11"
|
||||
placeholder="请输入联系电话" />
|
||||
</el-form-item>
|
||||
@ -42,22 +43,34 @@
|
||||
<el-form-item label="地址" prop="address">
|
||||
<el-input
|
||||
v-model="dataForm.address"
|
||||
:disabled="isdetail"
|
||||
placeholder="请输入地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="dataForm.remark"
|
||||
:disabled="isdetail"
|
||||
placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="特殊要求" prop="specialRequirements">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="dataForm.specialRequirements"
|
||||
:disabled="isdetail"
|
||||
placeholder="请输入备注" />
|
||||
<imageUpload v-model="files" :disabled="isdetail" :limit="5"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from '../../core/mixins/basic-add';
|
||||
import { createCustomer, updateCustomer, getCustomer, getCode } from "@/api/base/coreCustomer";
|
||||
import ImageUpload from '@/components/ImageUpload';
|
||||
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
components: { ImageUpload },
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
@ -67,6 +80,8 @@ export default {
|
||||
updateURL: updateCustomer,
|
||||
infoURL: getCustomer
|
||||
},
|
||||
files: [],
|
||||
isdetail: false,
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
code: undefined,
|
||||
@ -74,7 +89,9 @@ export default {
|
||||
telephone: undefined,
|
||||
contact: undefined,
|
||||
address: undefined,
|
||||
remark: undefined
|
||||
remark: undefined,
|
||||
specialRequirements: undefined,
|
||||
files: []
|
||||
},
|
||||
dataRule: {
|
||||
code: [{ required: true, message: "客户编号不能为空", trigger: "blur" }],
|
||||
@ -100,6 +117,66 @@ export default {
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
methods: {}
|
||||
methods: {
|
||||
init(id, isdetail) {
|
||||
this.dataForm.id = id || "";
|
||||
this.isdetail = isdetail || false;
|
||||
this.visible = true;
|
||||
if (this.urlOptions.getOption) {
|
||||
this.getArr()
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs["dataForm"].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.infoURL(id).then(response => {
|
||||
this.dataForm = response.data;
|
||||
if (this.setData) {
|
||||
this.setDataForm()
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (this.urlOptions.isGetCode) {
|
||||
this.getCode()
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
console.log('122', this.files)
|
||||
this.$refs["dataForm"].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.dataForm.files = []
|
||||
if (this.files.length > 0) {
|
||||
this.files.forEach(item => {
|
||||
const temp = {
|
||||
fileType: 1,
|
||||
fileUrl: item
|
||||
}
|
||||
this.dataForm.files.push(temp)
|
||||
})
|
||||
}
|
||||
|
||||
// 修改的提交
|
||||
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");
|
||||
});
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -88,13 +88,19 @@ export default {
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`base:core-customer:detail`)
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:core-customer:update`)
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:core-customer:delete`)
|
||||
this.$auth.hasPermi(`base:core-customer:delete`)
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
@ -171,6 +177,13 @@ export default {
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
otherMethods(val) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle = "详情";
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data.id, true);
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
65
src/views/base/coreHotMaterial/SmallTitle.vue
Normal file
65
src/views/base/coreHotMaterial/SmallTitle.vue
Normal file
@ -0,0 +1,65 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-01 15:27:31
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-08-01 16:25:54
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div :class="[className, { 'p-0': noPadding }]">
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
size: {
|
||||
// 取值范围: xl lg md sm
|
||||
type: String,
|
||||
default: 'de',
|
||||
validator: function (val) {
|
||||
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
|
||||
},
|
||||
},
|
||||
noPadding: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
className: function () {
|
||||
return `${this.size}-title`;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
|
||||
$mgr: 8px;
|
||||
@each $size, $height in $pxls {
|
||||
.#{$size}-title {
|
||||
font-size: 18px;
|
||||
line-height: $height;
|
||||
color: #000;
|
||||
font-weight: 500;
|
||||
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: 4px;
|
||||
height: $height + 2px;
|
||||
border-radius: 1px;
|
||||
margin-right: $mgr;
|
||||
background-color: #0b58ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.p-0 {
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-27 20:12:00
|
||||
* @LastEditTime: 2023-12-14 13:52:42
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -15,19 +15,19 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="原料名称" prop="name">
|
||||
<el-input v-model="dataForm.name" clearable placeholder="请输入原料名称" />
|
||||
<el-input v-model="dataForm.name" :disabled="isdetail" 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-input v-model="dataForm.code" :disabled="isdetail" clearable placeholder="请输入原料编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="每日消耗量" prop="dailyCost">
|
||||
<el-input-number v-model="dataForm.dailyCost" controls-position="right" clearable placeholder="请输入每日消耗量" style="width: 100%" />
|
||||
<el-input-number v-model="dataForm.dailyCost" :disabled="isdetail" :min="0" controls-position="right" clearable placeholder="请输入每日消耗量" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@ -35,6 +35,7 @@
|
||||
<el-select
|
||||
v-model="dataForm.unit"
|
||||
filterable
|
||||
:disabled="isdetail"
|
||||
style="width: 100%"
|
||||
placeholder="请选择单位">
|
||||
<el-option
|
||||
@ -47,17 +48,58 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" clearable placeholder="请输入备注" />
|
||||
<el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
|
||||
<small-title
|
||||
:size="'sm'"
|
||||
style="margin: 16px 0; padding-left: 8px; font-size: 14px"
|
||||
:no-padding="true">
|
||||
质量信息
|
||||
</small-title>
|
||||
<div v-if="!isdetail" class="action_btn">
|
||||
<template>
|
||||
<span style="display: inline-block;">
|
||||
<el-button type="text" @click="addNew()" icon="el-icon-plus">新增</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</div>
|
||||
<el-row :gutter="20" v-for="(item, index) in test" :key="index">
|
||||
<el-col :span="9">
|
||||
<el-form-item label="成分" label-width="50px" prop="name1">
|
||||
<el-input v-model="item.name" :disabled="isdetail" :min="0" controls-position="right" clearable placeholder="请输入成分" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="15">
|
||||
<el-form-item label="标准含量" prop="unit1">
|
||||
<el-row :gutter="5">
|
||||
<el-col :span="1">
|
||||
<el-tooltip content="如果标准含量不是一个范围,而是一个值,在最大值、最小值中填入相同数字即可。" placement="top">
|
||||
<span style="margin-left: -15px"><i class="el-icon-question"></i></span>
|
||||
</el-tooltip>
|
||||
</el-col>
|
||||
<el-col :span="11">
|
||||
<el-input-number v-model="item.minValue" :disabled="isdetail" :min="0" controls-position="right" clearable placeholder="最小值" style="width: 100%" />
|
||||
</el-col>
|
||||
<el-col :span="11">
|
||||
<el-input-number v-model="item.maxValue" :disabled="isdetail" :min="0" controls-position="right" clearable placeholder="最大值" style="width: 100%" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from '../../core/mixins/basic-add';
|
||||
import { createHotMaterial, updateHotMaterial, getHotMaterial, getCode } from "@/api/base/coreHotMaterial";
|
||||
import { createHotMaterial, updateHotMaterial, getHotMaterial, getCode, createHotMaterialCheck, updateHotMaterialCheck, getHotCheckList } from "@/api/base/coreHotMaterial";
|
||||
import { getDictDatas} from "@/utils/dict";
|
||||
import SmallTitle from './SmallTitle';
|
||||
|
||||
export default {
|
||||
components: { SmallTitle },
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
@ -76,8 +118,10 @@ export default {
|
||||
dailyCost: undefined,
|
||||
remark: undefined
|
||||
},
|
||||
test: [],
|
||||
departmentlList: [],
|
||||
menuOptions: [],
|
||||
isdetail: false,
|
||||
dataRule: {
|
||||
code: [{ required: true, message: "原料编码不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "原料名称不能为空", trigger: "blur" }]
|
||||
@ -85,6 +129,100 @@ export default {
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
methods: {}
|
||||
methods: {
|
||||
init(id, isdetail) {
|
||||
this.test = []
|
||||
this.dataForm.id = id || "";
|
||||
this.isdetail = isdetail || false;
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs["dataForm"].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.infoURL(id).then(response => {
|
||||
this.dataForm = response.data;
|
||||
});
|
||||
getHotCheckList({
|
||||
materialId: this.dataForm.id
|
||||
}).then(res => {
|
||||
this.test = res.data
|
||||
})
|
||||
} else {
|
||||
this.test = [
|
||||
{
|
||||
name: null,
|
||||
minValue: undefined,
|
||||
maxValue: undefined
|
||||
}
|
||||
]
|
||||
if (this.urlOptions.isGetCode) {
|
||||
this.getCode()
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs["dataForm"].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.updateURL(this.dataForm).then(response => {
|
||||
if (this.test.length > 1 || this.test[0].name) {
|
||||
this.test.forEach(check => {
|
||||
check.hotMaterialId = this.dataForm.id
|
||||
if (check.id) {
|
||||
updateHotMaterialCheck(check).then(res => {
|
||||
console.log(res)
|
||||
})
|
||||
} else {
|
||||
createHotMaterialCheck(check).then(res1 => {
|
||||
console.log(res1)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
this.urlOptions.createURL(this.dataForm).then(response => {
|
||||
if (this.test.length > 1 || this.test[0].name) {
|
||||
this.test.forEach(check => {
|
||||
check.hotMaterialId = response.data
|
||||
createHotMaterialCheck(check).then(res => {
|
||||
console.log(res)
|
||||
})
|
||||
})
|
||||
}
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
});
|
||||
},
|
||||
addNew() {
|
||||
this.test.push({
|
||||
name: null,
|
||||
minValue: undefined,
|
||||
maxValue: undefined
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.action_btn {
|
||||
float: right;
|
||||
margin: -40px 15px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.add {
|
||||
color: #0b58ff;
|
||||
}
|
||||
</style>
|
||||
|
@ -83,13 +83,19 @@ export default {
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`base:core-hot-material:update`)
|
||||
this.$auth.hasPermi(`base:core-hot-material-check:detail`)
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:core-hot-material-check:update`)
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:core-hot-material:delete`)
|
||||
this.$auth.hasPermi(`base:core-hot-material-check:delete`)
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
@ -120,7 +126,7 @@ export default {
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:core-hot-material:create') ? 'button' : '',
|
||||
type: this.$auth.hasPermi('base:core-hot-material-check:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
@ -143,6 +149,14 @@ export default {
|
||||
// this.dataListLoading = false;
|
||||
// });
|
||||
// },
|
||||
otherMethods(val) {
|
||||
// 详情
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle = "详情";
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data.id, true);
|
||||
});
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-27 20:07:09
|
||||
* @LastEditTime: 2023-12-06 10:36:56
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -91,27 +91,30 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单位平方数" prop="area">
|
||||
<el-input-number v-model="dataForm.area" :precision="2" style="width: 100%" :disabled="isdetail" clearable placeholder="请输入单位平方数" />
|
||||
<el-input-number v-model="dataForm.area" :precision="6" :min="0" style="width: 100%" :disabled="isdetail" clearable placeholder="请输入单位平方数" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="规格" prop="specifications">
|
||||
<el-input v-model="dataForm.specifications" :disabled="isdetail" clearable placeholder="请输入规格" />
|
||||
<el-input v-model="dataForm.specifications" :disabled="isdetail" @blur="setArea" @clear="clearArea" clearable placeholder="请输入规格" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="产线生产单位用时(S)" prop="processTime">
|
||||
<el-input v-model.number="dataForm.processTime" type="number" :disabled="isdetail" clearable placeholder="请输入产线生产单位用时" />
|
||||
<el-input v-model.number="dataForm.processTime" :precision="4" :min="0" type="number" :disabled="isdetail" clearable placeholder="请输入产线生产单位用时" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" />
|
||||
<el-form-item label="重量" prop="weight">
|
||||
<el-input-number v-model="dataForm.weight" :precision="6" :min="0" style="width: 100%" :disabled="isdetail" clearable placeholder="请输入重量" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
@ -240,7 +243,8 @@ export default {
|
||||
specifications: undefined,
|
||||
processTime: 0,
|
||||
remark: undefined,
|
||||
unit: undefined
|
||||
unit: undefined,
|
||||
weight: undefined
|
||||
},
|
||||
productAttrList: [],
|
||||
visible: false,
|
||||
@ -257,6 +261,24 @@ export default {
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
clearArea() {
|
||||
this.$set(this.dataForm, 'area', 0)
|
||||
this.$set(this.dataForm, 'weight', 0)
|
||||
},
|
||||
setArea() {
|
||||
if (this.dataForm.specifications) {
|
||||
const height = Number(this.dataForm.specifications.slice(2,4))
|
||||
const length = Number(this.dataForm.specifications.slice(4,8))
|
||||
const width = Number(this.dataForm.specifications.slice(8))
|
||||
// this.dataForm.area = length * width
|
||||
// this.dataForm.weight = 2.5 * height * length * width
|
||||
this.$set(this.dataForm, 'area', length * width)
|
||||
this.$set(this.dataForm, 'weight', 2.5 * height * length * width)
|
||||
} else {
|
||||
this.dataForm.area = 0
|
||||
this.dataForm.weight = 0
|
||||
}
|
||||
},
|
||||
initData() {
|
||||
this.productAttrList.splice(0);
|
||||
this.listQuery.total = 0;
|
||||
@ -317,6 +339,10 @@ export default {
|
||||
// 获取产品详情
|
||||
this.urlOptions.infoURL(id).then(response => {
|
||||
this.dataForm = response.data
|
||||
// this.dataForm.area = response.data.area || 0
|
||||
// this.dataForm.weight = response.data.weight || 0
|
||||
// this.dataForm.specifications = response.data.specifications || undefined
|
||||
console.log('11res112', this.dataForm.specifications, this.dataForm.weight, this.dataForm.area)
|
||||
if (this.dataForm.unit !== undefined) {
|
||||
this.dataForm.unit = String(this.dataForm.unit)
|
||||
}
|
||||
@ -339,7 +365,7 @@ export default {
|
||||
goback() {
|
||||
this.$emit('refreshDataList');
|
||||
this.visible = false;
|
||||
// this.initData();
|
||||
this.initData();
|
||||
},
|
||||
goEdit() {
|
||||
this.isdetail = false;
|
||||
@ -370,6 +396,7 @@ export default {
|
||||
this.urlOptions.createURL(this.dataForm).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.idAttrShow = true
|
||||
this.dataForm.id = response.data
|
||||
// this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
|
@ -140,12 +140,13 @@ export default {
|
||||
allocationVisible: false,
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`base:core-work-order:material`)
|
||||
? {
|
||||
type: 'material',
|
||||
btnName: '原料信息',
|
||||
}
|
||||
: undefined,
|
||||
// this.$auth.hasPermi(`base:core-work-order:material`)
|
||||
// ? {
|
||||
// type: 'material',
|
||||
// btnName: '原料信息',
|
||||
// showTip: '预使用原料信息'
|
||||
// }
|
||||
// : undefined,
|
||||
{
|
||||
type: 'active',
|
||||
btnName: '激活',
|
||||
|
@ -273,12 +273,20 @@ export default {
|
||||
$('.hiprint-printTemplate').empty()
|
||||
// const templates = this.$ls.get('KEY_TEMPLATES', {})
|
||||
const template = provider.value
|
||||
// console.log(template)
|
||||
// console.log(template)
|
||||
if (this.modelData) {
|
||||
hiprintTemplate = new hiprint.PrintTemplate({
|
||||
template: this.modelData != '' ? JSON.parse(this.modelData) : {},
|
||||
template: JSON.parse(this.modelData),
|
||||
settingContainer: '#PrintElementOptionSetting',
|
||||
paginationContainer: '.hiprint-printPagination'
|
||||
})
|
||||
} else {
|
||||
hiprintTemplate = new hiprint.PrintTemplate({
|
||||
template:{},
|
||||
settingContainer: '#PrintElementOptionSetting',
|
||||
paginationContainer: '.hiprint-printPagination'
|
||||
})
|
||||
}
|
||||
// }
|
||||
hiprintTemplate.design('#hiprint-printTemplate')
|
||||
// console.log(hiprintTemplate)
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-27 15:26:12
|
||||
* @LastEditTime: 2023-12-04 15:10:11
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -377,6 +377,7 @@ export default {
|
||||
this.urlOptions.createURL(this.dataForm).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.idAttrShow = true
|
||||
this.dataForm.id = response.data
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
});
|
||||
|
@ -1,18 +1,18 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-10-17 16:50:19
|
||||
* @LastEditTime: 2023-10-30 10:47:13
|
||||
* @LastEditTime: 2023-12-01 16:48:53
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-dialog :visible.sync="visible" :show-close="false" :wrapper-closable="false" width="40%">
|
||||
<el-dialog class="baseDialog" :visible.sync="visible" :show-close="false" :wrapper-closable="false" width="40%" show-close="true">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
{{ !dataForm.id ? '新增' : '编辑' }}
|
||||
</small-title>
|
||||
|
||||
<!--
|
||||
<div class="content">
|
||||
<div class="visual-part">
|
||||
<div class="visual-part"> -->
|
||||
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px"
|
||||
@keyup.enter.native="dataFormSubmit">
|
||||
<el-row :gutter="20">
|
||||
@ -96,8 +96,8 @@
|
||||
:page-sizes="[5, 10, 15]"
|
||||
@pagination="getList" />
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
<!-- </div> -->
|
||||
|
||||
<!-- <div style="position: absolute; bottom: 24px; right: 24px">
|
||||
<el-button style="margin-right: 10px" @click="goback()">返回</el-button>
|
||||
@ -416,3 +416,34 @@ export default {
|
||||
padding: 18px;
|
||||
}
|
||||
</style> -->
|
||||
<style>
|
||||
|
||||
.baseDialog .el-dialog__header {
|
||||
font-size: 16px;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
font-weight: 500;
|
||||
padding: 13px 24px;
|
||||
border-bottom: 1px solid #e9e9e9;
|
||||
}
|
||||
.baseDialog .el-dialog__header .titleStyle::before{
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
background-color: #0B58FF;
|
||||
border-radius: 1px;
|
||||
margin-right: 8px;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
.baseDialog .el-dialog__body {
|
||||
padding-left: 24px;
|
||||
padding-right: 24px;
|
||||
}
|
||||
.baseDialog .btnTextStyle {
|
||||
letter-spacing:6px;
|
||||
padding: 9px 10px 9px 16px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -1,12 +1,12 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-10-17 16:50:19
|
||||
* @LastEditTime: 2023-10-30 10:41:07
|
||||
* @LastEditTime: 2023-12-04 13:43:19
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-dialog :visible.sync="visible" :show-close="false" :wrapper-closable="false" width="30%">
|
||||
<el-dialog class="baseDialog" :visible.sync="visible" :show-close="false" :wrapper-closable="false" width="30%" show-close="true">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
{{ !dataForm.id ? '新增' : '编辑' }}
|
||||
</small-title>
|
||||
@ -46,7 +46,7 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="模板设计" prop="content">
|
||||
<el-button type="primary" @click="btnClickDesign()">模板设计</el-button>
|
||||
<el-button icon="el-icon-edit" @click="btnClickDesign()">模板设计</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">
|
||||
@ -439,3 +439,36 @@ export default {
|
||||
padding: 18px;
|
||||
}
|
||||
</style> -->
|
||||
<style>
|
||||
|
||||
|
||||
.baseDialog .el-dialog__header {
|
||||
font-size: 16px;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
font-weight: 500;
|
||||
padding: 13px 24px;
|
||||
border-bottom: 1px solid #e9e9e9;
|
||||
}
|
||||
.baseDialog .el-dialog__header .titleStyle::before{
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
background-color: #0B58FF;
|
||||
border-radius: 1px;
|
||||
margin-right: 8px;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
.baseDialog .el-dialog__body {
|
||||
padding-left: 24px;
|
||||
padding-right: 24px;
|
||||
}
|
||||
.baseDialog .btnTextStyle {
|
||||
letter-spacing:6px;
|
||||
padding: 9px 10px 9px 16px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-01 14:55:51
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-11-22 14:40:07
|
||||
* @LastEditTime: 2023-12-04 13:38:45
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -71,7 +71,7 @@ export default {
|
||||
modelShow:false,
|
||||
tableBtn: [
|
||||
{
|
||||
type: 'print',
|
||||
type: 'detail',
|
||||
btnName: '查看',
|
||||
},
|
||||
this.$auth.hasPermi(`base:packaging-print-model:update`)
|
||||
@ -121,11 +121,12 @@ export default {
|
||||
// name: 'reset',
|
||||
// },
|
||||
{
|
||||
type: 'separate',
|
||||
type: 'label',
|
||||
label:'标签模板',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:packaging-print-model:create') ? 'button' : '',
|
||||
btnName: '新增模板',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true,
|
||||
|
@ -1,19 +1,19 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-10-17 16:50:19
|
||||
* @LastEditTime: 2023-10-18 16:07:39
|
||||
* @LastEditTime: 2023-12-04 13:45:45
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-dialog :visible.sync="visible" :show-close="false" :wrapper-closable="false" width="40%">
|
||||
<el-dialog class="baseDialog" :visible.sync="visible" :show-close="false" :wrapper-closable="false" width="40%" show-close="true">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
{{ !dataForm.id ? '新增' : '编辑' }}
|
||||
</small-title>
|
||||
|
||||
<div class="content">
|
||||
<div class="visual-part">
|
||||
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px"
|
||||
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="auto"
|
||||
@keyup.enter.native="dataFormSubmit">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
@ -345,3 +345,37 @@ export default {
|
||||
padding: 18px;
|
||||
}
|
||||
</style> -->
|
||||
<style>
|
||||
|
||||
|
||||
.baseDialog .el-dialog__header {
|
||||
font-size: 16px;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
font-weight: 500;
|
||||
padding: 13px 24px;
|
||||
border-bottom: 1px solid #e9e9e9;
|
||||
}
|
||||
.baseDialog .el-dialog__header .titleStyle::before{
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
background-color: #0B58FF;
|
||||
border-radius: 1px;
|
||||
margin-right: 8px;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
.baseDialog .el-dialog__body {
|
||||
padding-left: 24px;
|
||||
padding-right: 24px;
|
||||
}
|
||||
.baseDialog .btnTextStyle {
|
||||
letter-spacing:6px;
|
||||
padding: 9px 10px 9px 16px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-01 14:55:51
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-11-22 14:36:33
|
||||
* @LastEditTime: 2023-12-04 13:44:01
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -122,7 +122,8 @@ export default {
|
||||
// name: 'reset',
|
||||
// },
|
||||
{
|
||||
type: 'separate',
|
||||
type: 'label',
|
||||
label: '标签类型'
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:packaging-print-type:create') ? 'button' : '',
|
||||
|
@ -2,7 +2,7 @@
|
||||
<div class="choicepart-container">
|
||||
<navbar />
|
||||
<div class="choicepart-wrapper">
|
||||
<div class="choicepart-box" id="choicepartBox" :style="'transform:scale('+scale+');width:1574px;height:538px;'" v-show="showItem">
|
||||
<div class="choicepart-box" id="choicepartBox" :style="'transform:scale('+scale+');width:1710px;height:538px;'" v-show="showItem">
|
||||
<div class="choicepart-line1">
|
||||
<div
|
||||
v-for="(item, index) in menuArr1"
|
||||
@ -102,9 +102,7 @@ export default {
|
||||
meta: {
|
||||
title: ''
|
||||
}
|
||||
}
|
||||
],
|
||||
menuArr2: [
|
||||
},
|
||||
{
|
||||
name: 'Packaging',
|
||||
title: '包装管理',
|
||||
@ -112,7 +110,9 @@ export default {
|
||||
meta: {
|
||||
title: ''
|
||||
}
|
||||
},
|
||||
}
|
||||
],
|
||||
menuArr2: [
|
||||
{
|
||||
name: 'Material',
|
||||
title: '物料管理',
|
||||
@ -129,17 +129,41 @@ export default {
|
||||
title: ''
|
||||
}
|
||||
},
|
||||
// {
|
||||
// name: 'Delivery',
|
||||
// title: '成品发货',
|
||||
// visible: false,
|
||||
// meta: {
|
||||
// title: ''
|
||||
// }
|
||||
// },
|
||||
{
|
||||
name: 'Delivery',
|
||||
title: '成品发货',
|
||||
name: 'Report',
|
||||
title: '报表管理',
|
||||
visible: false,
|
||||
meta: {
|
||||
title: ''
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'Report',
|
||||
title: '报表管理',
|
||||
name: 'Cost',
|
||||
title: '成本管理',
|
||||
visible: false,
|
||||
meta: {
|
||||
title: ''
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'SafetyEnvironmental',
|
||||
title: '安环管理',
|
||||
visible: false,
|
||||
meta: {
|
||||
title: ''
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'Databoard',
|
||||
title: '数据驾驶舱',
|
||||
visible: false,
|
||||
meta: {
|
||||
title: ''
|
||||
@ -176,7 +200,7 @@ export default {
|
||||
console.log(menuList)
|
||||
if (menuList.length > 0) {
|
||||
for (let i = 0; i < menuList.length; i ++) {
|
||||
for (let k = 0; k < 7; k++) {
|
||||
for (let k = 0; k < 8; k++) {
|
||||
if (menuList[i].name === this.menuArr1[k].name) {
|
||||
this.menuArr1[k].visible = true
|
||||
this.menuArr1[k].id = menuList[i].id
|
||||
@ -185,7 +209,7 @@ export default {
|
||||
this.menuArr1[k].meta = menuList[i].meta
|
||||
}
|
||||
}
|
||||
for (let j = 0; j < 6; j++) {
|
||||
for (let j = 0; j < 7; j++) {
|
||||
if (menuList[i].name === this.menuArr2[j].name) {
|
||||
this.menuArr2[j].visible = true
|
||||
this.menuArr2[j].id = menuList[i].id
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2022-08-24 11:19:43
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-11-06 15:59:53
|
||||
* @LastEditTime: 2023-12-13 15:52:53
|
||||
* @Description:
|
||||
*/
|
||||
export default {
|
||||
@ -38,7 +38,7 @@ export default {
|
||||
this.$refs["dataForm"].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.infoURL(id).then(response => {
|
||||
this.dataForm = response.data;
|
||||
this.dataForm = response.data
|
||||
if (this.setData) {
|
||||
this.setDataForm()
|
||||
}
|
||||
@ -80,7 +80,7 @@ export default {
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.updateURL(this.dataForm).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.visible = false;
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
return;
|
||||
|
162
src/views/cost/energyCost/index.vue
Normal file
162
src/views/cost/energyCost/index.vue
Normal file
@ -0,0 +1,162 @@
|
||||
<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"></base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:page.sync="listQuery.pageNo"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from '../mixins/basic-page';
|
||||
import codeFilter from '../mixins/code-filter';
|
||||
import {
|
||||
getCostEneryAutoPage,
|
||||
exportCostEneryExcel,
|
||||
} from '@/api/cost/costEneryAutoReport';
|
||||
import { getEnergyTypeListAll } from '@/api/base/energyType';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'energyTypeName',
|
||||
label: '能源类型',
|
||||
},
|
||||
{
|
||||
prop: 'objName',
|
||||
label: '监控对象',
|
||||
filter: (val) => (val != null ? val : '--'),
|
||||
},
|
||||
{
|
||||
prop: 'tableName',
|
||||
label: '水/气表名',
|
||||
filter: (val) => (val != null ? val : '--'),
|
||||
filter: publicFormatter('table_name'),
|
||||
},
|
||||
{
|
||||
prop: 'totalUsed',
|
||||
label: '累计使用量',
|
||||
},
|
||||
{
|
||||
prop: 'totalCost',
|
||||
label: '总价',
|
||||
align: 'right',
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getCostEneryAutoPage,
|
||||
exportURL: exportCostEneryExcel
|
||||
},
|
||||
tableData: [],
|
||||
tableProps,
|
||||
drawerVisible: false,
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '能源类型',
|
||||
selectOptions: [],
|
||||
param: 'energyTypeId',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间范围',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'timestamp',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'searchTime',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('cost:energyCost:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'primary',
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {},
|
||||
created() {
|
||||
getEnergyTypeListAll().then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
if(this.listQuery.searchTime){
|
||||
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;
|
||||
}
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
}else{
|
||||
this.$message.warning('请选择时间范围')
|
||||
}
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.energyTypeId = val.energyTypeId;
|
||||
this.listQuery.searchTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'export':
|
||||
const data = {
|
||||
energyTypeId:val.energyTypeId,
|
||||
startTime : val.searchTime ? val.searchTime[0] : null,
|
||||
endTime : val.searchTime ? val.searchTime[1] : null,
|
||||
}
|
||||
this.handleExport(data);
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.app-container .el-table .el-table__cell {
|
||||
padding: 0;
|
||||
height: 35px;
|
||||
}
|
||||
</style>
|
173
src/views/cost/energyCostHis/index.vue
Normal file
173
src/views/cost/energyCostHis/index.vue
Normal file
@ -0,0 +1,173 @@
|
||||
<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"></base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:page.sync="listQuery.pageNo"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from '../mixins/basic-page';
|
||||
import codeFilter from '../mixins/code-filter';
|
||||
import {
|
||||
getCostEneryAutoReportPage,
|
||||
exportCostEneryAutoReportExcel,
|
||||
} from '@/api/cost/costEneryAutoReport';
|
||||
import { getEnergyTypeListAll } from '@/api/base/energyType';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'reportType',
|
||||
label: '维度',
|
||||
filter: codeFilter('reportType'),
|
||||
},
|
||||
{
|
||||
prop: 'reportName',
|
||||
label: '时间',
|
||||
minWidth: 150,
|
||||
},
|
||||
{
|
||||
prop: 'energyType',
|
||||
label: '能源类型',
|
||||
},
|
||||
{
|
||||
prop: 'objName',
|
||||
label: '监控对象',
|
||||
filter: (val) => (val != null ? val : '--'),
|
||||
},
|
||||
{
|
||||
prop: 'tableName',
|
||||
label: '水/气表名',
|
||||
filter: (val) => (val != null ? val : '--'),
|
||||
filter: publicFormatter('table_name'),
|
||||
},
|
||||
{
|
||||
prop: 'totalUsed',
|
||||
label: '累计使用量',
|
||||
},
|
||||
{
|
||||
prop: 'totalCost',
|
||||
label: '总价',
|
||||
align: 'right',
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getCostEneryAutoReportPage,
|
||||
exportURL: exportCostEneryAutoReportExcel,
|
||||
},
|
||||
tableData: [],
|
||||
tableProps,
|
||||
drawerVisible: false,
|
||||
listQuery: {
|
||||
reportType: 2,
|
||||
},
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '维度',
|
||||
selectOptions: [
|
||||
{ id: 2, name: '日' },
|
||||
{ id: 3, name: '周' },
|
||||
{ id: 4, name: '月' },
|
||||
{ id: 5, name: '年' },
|
||||
],
|
||||
param: 'reportType',
|
||||
filterable: true,
|
||||
defaultSelect: 2, // 默认值
|
||||
clearable: false,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '能源类型',
|
||||
selectOptions: [],
|
||||
param: 'energyTypeId',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间范围',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'timestamp',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'searchTime',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('cost:energyCostHis:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'primary',
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {},
|
||||
created() {
|
||||
getEnergyTypeListAll().then((response) => {
|
||||
this.formConfig[1].selectOptions = response.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.reportType = val.reportType;
|
||||
this.listQuery.energyTypeId = val.energyTypeId;
|
||||
this.listQuery.reportTime = val.searchTime ? val.searchTime : null;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'export':
|
||||
const data = {
|
||||
reportType: val.reportType,
|
||||
energyTypeId: val.energyTypeId,
|
||||
reportTime: val.searchTime ? val.searchTime : null
|
||||
}
|
||||
this.handleExport(data);
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.app-container .el-table .el-table__cell {
|
||||
padding: 0;
|
||||
height: 35px;
|
||||
}
|
||||
</style>
|
121
src/views/cost/mixins/basic-add.js
Normal file
121
src/views/cost/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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
172
src/views/cost/mixins/basic-page.js
Normal file
172
src/views/cost/mixins/basic-page.js
Normal file
@ -0,0 +1,172 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2022-08-24 11:19:43
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-12-07 09:35:33
|
||||
* @Description:
|
||||
*/
|
||||
export default {
|
||||
data() {
|
||||
/* eslint-disable */
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: '',
|
||||
deleteURL: '',
|
||||
statusUrl: '',
|
||||
exportURL: ''
|
||||
},
|
||||
tableData: [],
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
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;
|
||||
}
|
||||
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") {
|
||||
this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex)
|
||||
} else if (val.type === "change") {
|
||||
this.changeStatus(val.data.id)
|
||||
} else {
|
||||
this.otherMethods(val)
|
||||
}
|
||||
},
|
||||
// 删除
|
||||
deleteHandle(id, name, index) {
|
||||
this.$confirm(`是否确认删除${name ? '名称为"' + name + '"' : '序号为"' + index + '"'}的数据项?`, "系统提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.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(data) {
|
||||
// 处理查询参数
|
||||
let params = data?{ ...data }:{ ...this.listQuery };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return this.urlOptions.exportURL(params);
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '报表.xls');
|
||||
this.exportLoading = false;
|
||||
}).catch(() => { });
|
||||
}
|
||||
}
|
||||
}
|
79
src/views/cost/mixins/code-filter.js
Normal file
79
src/views/cost/mixins/code-filter.js
Normal file
@ -0,0 +1,79 @@
|
||||
|
||||
/*
|
||||
* @Date: 2020-12-29 16:49:28
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-12-07 10:00:51
|
||||
* @FilePath: \basic-admin\src\filters\basicData\index.js
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
const table = {
|
||||
lineStatus: {
|
||||
1: '生产中',
|
||||
2: '停止',
|
||||
3: '未知',
|
||||
},
|
||||
deactivate: {
|
||||
1: '启用',
|
||||
0: '停用',
|
||||
},
|
||||
wareType: {
|
||||
1: '缓存',
|
||||
2: '活动',
|
||||
3: '其它',
|
||||
},
|
||||
reportType: {
|
||||
2: '日',
|
||||
3: '周',
|
||||
4: '月',
|
||||
5: '年',
|
||||
},
|
||||
}
|
||||
|
||||
// 日期格式化
|
||||
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]
|
||||
}
|
||||
}
|
23
src/views/cost/mixins/connectTime.vue
Normal file
23
src/views/cost/mixins/connectTime.vue
Normal file
@ -0,0 +1,23 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-12-05 13:45:59
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-12-06 15:54:40
|
||||
* @Description
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<span>{{ parseTime(injectData.enableTime,'{y}年{m}月{d}日') + '-' + (parseTime(injectData.disableTime)?parseTime(injectData.disableTime,'{y}年{m}月{d}日'):'永久') }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: '',
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
166
src/views/cost/rawMaterialConfig/add-or-updata.vue
Normal file
166
src/views/cost/rawMaterialConfig/add-or-updata.vue
Normal file
@ -0,0 +1,166 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-01 13:52:10
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-12-05 15:41:39
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
v-if="visible"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="100px"
|
||||
label-position="top">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="原料名称" prop="materialId">
|
||||
<el-select
|
||||
v-model="dataForm.materialId"
|
||||
filterable
|
||||
clearable
|
||||
@change="setCode"
|
||||
:style="{ width: '100%' }"
|
||||
placeholder="请选择原料名称">
|
||||
<el-option
|
||||
v-for="item in MaterialList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="原料等级" prop="grade">
|
||||
<el-select
|
||||
v-model="dataForm.grade"
|
||||
filterable
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
placeholder="请选择原料等级">
|
||||
<el-option
|
||||
v-for="item in urlOptions.dictList.dict0"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="parseInt(item.value)"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="原料编码" prop="code">
|
||||
<el-input v-model="dataForm.code" clearable readonly />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单价" prop="price">
|
||||
<el-input-number
|
||||
:min="0"
|
||||
style="width: 80%"
|
||||
v-model="dataForm.price"
|
||||
clearable
|
||||
placeholder="请输入允许留存时间" />
|
||||
(元/吨)
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="生效开始时间" prop="enabledTime">
|
||||
<el-date-picker
|
||||
v-model="dataForm.enabledTime"
|
||||
type="datetime"
|
||||
value-format="timestamp"
|
||||
:style="{ width: '100%' }"
|
||||
placeholder="选择开始时间"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="生效结束时间" prop="disabledTime">
|
||||
<el-date-picker
|
||||
v-model="dataForm.disabledTime"
|
||||
type="datetime"
|
||||
value-format="timestamp"
|
||||
:style="{ width: '100%' }"
|
||||
placeholder="选择结束时间"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<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 {
|
||||
createCostMaterialSet,
|
||||
updateCostMaterialSet,
|
||||
getCostMaterialSet,
|
||||
} from '@/api/cost/costMaterialSet';
|
||||
import { getHotMaterialList } from '@/api/base/coreHotMaterial';
|
||||
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDictList: true,
|
||||
createURL: createCostMaterialSet,
|
||||
updateURL: updateCostMaterialSet,
|
||||
infoURL: getCostMaterialSet,
|
||||
getOption: true,
|
||||
},
|
||||
nameList: ['material_grade'],
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
code: '',
|
||||
materialId: '',
|
||||
price: '',
|
||||
grade: '',
|
||||
enabledTime: new Date().getTime(),
|
||||
disabledTime: null,
|
||||
remark: '',
|
||||
},
|
||||
setData: true,
|
||||
MaterialList: [],
|
||||
dataRule: {
|
||||
materialId: [
|
||||
{ required: true, message: '原料不能为空', trigger: 'change' },
|
||||
],
|
||||
price: [{ required: true, message: '单价不能为空', trigger: 'blur' }],
|
||||
enabledTime: [
|
||||
{
|
||||
required: true,
|
||||
message: '生效开始时间不能为空',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
getArr() {
|
||||
getHotMaterialList().then((response) => {
|
||||
this.MaterialList = response.data;
|
||||
});
|
||||
},
|
||||
setDataForm() {
|
||||
this.setCode();
|
||||
},
|
||||
setCode() {
|
||||
this.MaterialList.forEach((item) => {
|
||||
if (item.id === this.dataForm.materialId) {
|
||||
this.dataForm.code = item.code;
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
186
src/views/cost/rawMaterialConfig/index.vue
Normal file
186
src/views/cost/rawMaterialConfig/index.vue
Normal file
@ -0,0 +1,186 @@
|
||||
<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="80"
|
||||
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 {
|
||||
deleteCostMaterialSet,
|
||||
getCostMaterialSetPage,
|
||||
} from '@/api/cost/costMaterialSet';
|
||||
import { getHotMaterialList } from '@/api/base/coreHotMaterial';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'rawMaterialName',
|
||||
label: '原料名称',
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '原料编码',
|
||||
width: 190,
|
||||
},
|
||||
{
|
||||
prop: 'grade',
|
||||
label: '原料等级',
|
||||
filter: publicFormatter('material_grade'),
|
||||
},
|
||||
{
|
||||
prop: 'dailyUse',
|
||||
label: '单日消耗量(天)吨',
|
||||
width: 130,
|
||||
},
|
||||
{
|
||||
prop: 'price',
|
||||
label: '单价(元/吨)',
|
||||
align: 'right',
|
||||
},
|
||||
{
|
||||
prop: 'enabledTime',
|
||||
label: '生效时间',
|
||||
filter: parseTime,
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getCostMaterialSetPage,
|
||||
deleteURL: deleteCostMaterialSet,
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`cost:rawMaterialConfig:update`)
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`cost:rawMaterialConfig:delete`)
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '原料名称',
|
||||
selectOptions: [],
|
||||
param: 'name',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('cost:rawMaterialConfig:create')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
created() {
|
||||
getHotMaterialList().then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.materialId = val.name;
|
||||
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>
|
166
src/views/cost/rawMaterialCost/index.vue
Normal file
166
src/views/cost/rawMaterialCost/index.vue
Normal file
@ -0,0 +1,166 @@
|
||||
<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"></base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:page.sync="listQuery.pageNo"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from '../mixins/basic-page';
|
||||
import connectTime from '../mixins/connectTime';
|
||||
import {
|
||||
getCostMaterialSearchPage,
|
||||
exportCostMaterialSearch,
|
||||
} from '@/api/cost/costMaterialAutoReport';
|
||||
import { getHotMaterialList } from '@/api/base/coreHotMaterial';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'rawMaterialName',
|
||||
label: '原料名称',
|
||||
},
|
||||
{
|
||||
prop: 'grade',
|
||||
label: '原料等级',
|
||||
filter: publicFormatter('material_grade'),
|
||||
},
|
||||
{
|
||||
prop: 'price',
|
||||
label: '单价(元/吨)',
|
||||
align: 'right',
|
||||
},
|
||||
{
|
||||
prop: 'reportName',
|
||||
label: '单价生效时间',
|
||||
minWidth: 190,
|
||||
subcomponent: connectTime,
|
||||
},
|
||||
{
|
||||
prop: 'totalUsed',
|
||||
label: '累计使用量(吨)',
|
||||
},
|
||||
{
|
||||
prop: 'totalCost',
|
||||
label: '总价(元)',
|
||||
align: 'right',
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getCostMaterialSearchPage,
|
||||
exportURL: exportCostMaterialSearch,
|
||||
},
|
||||
tableData: [],
|
||||
tableProps,
|
||||
drawerVisible: false,
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '原料名称',
|
||||
selectOptions: [],
|
||||
param: 'materialId',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间范围',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'timestamp',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'searchTime',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('cost:rawMaterialCost:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'primary',
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {},
|
||||
created() {
|
||||
getHotMaterialList().then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
if (this.listQuery.searchTime) {
|
||||
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;
|
||||
}
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
} else {
|
||||
this.$message.warning('请选择时间范围');
|
||||
}
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.materialId = val.materialId;
|
||||
this.listQuery.searchTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'export':
|
||||
this.listQuery.materialId = val.materialId;
|
||||
this.listQuery.searchTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
|
||||
this.handleExport();
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.app-container .el-table .el-table__cell {
|
||||
padding: 0;
|
||||
height: 35px;
|
||||
}
|
||||
</style>
|
170
src/views/cost/rawMaterialCostHis/index.vue
Normal file
170
src/views/cost/rawMaterialCostHis/index.vue
Normal file
@ -0,0 +1,170 @@
|
||||
<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"></base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:page.sync="listQuery.pageNo"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from '../mixins/basic-page';
|
||||
import codeFilter from '../mixins/code-filter';
|
||||
import {
|
||||
getCostMaterialAutoReportPage,
|
||||
exportCostMaterialAutoReportExcel,
|
||||
} from '@/api/cost/costMaterialAutoReport';
|
||||
import { getHotMaterialList } from '@/api/base/coreHotMaterial';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'reportType',
|
||||
label: '维度',
|
||||
filter: codeFilter('reportType'),
|
||||
},
|
||||
{
|
||||
prop: 'reportName',
|
||||
label: '时间',
|
||||
minWidth: 150,
|
||||
},
|
||||
{
|
||||
prop: 'rawMaterialName',
|
||||
label: '原料名称',
|
||||
},
|
||||
{
|
||||
prop: 'grade',
|
||||
label: '原料等级',
|
||||
filter: publicFormatter('material_grade'),
|
||||
},
|
||||
{
|
||||
prop: 'price',
|
||||
label: '单价(元/吨)',
|
||||
align: 'right',
|
||||
},
|
||||
{
|
||||
prop: 'totalUsed',
|
||||
label: '累计使用量(吨)',
|
||||
},
|
||||
{
|
||||
prop: 'totalCost',
|
||||
label: '总价(元)',
|
||||
align: 'right',
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getCostMaterialAutoReportPage,
|
||||
exportURL: exportCostMaterialAutoReportExcel
|
||||
},
|
||||
tableData: [],
|
||||
tableProps,
|
||||
drawerVisible: false,
|
||||
listQuery: {
|
||||
reportType: 2,
|
||||
},
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '维度',
|
||||
selectOptions: [
|
||||
{ id: 2, name: '日' },
|
||||
{ id: 3, name: '周' },
|
||||
{ id: 4, name: '月' },
|
||||
{ id: 5, name: '年' },
|
||||
],
|
||||
param: 'reportType',
|
||||
filterable: true,
|
||||
defaultSelect: 2, // 默认值
|
||||
clearable: false,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '原料名称',
|
||||
selectOptions: [],
|
||||
param: 'materialId',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间范围',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'timestamp',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'searchTime',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('cost:rawMaterialCostHis:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'primary',
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {},
|
||||
created() {
|
||||
getHotMaterialList().then((response) => {
|
||||
this.formConfig[1].selectOptions = response.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.reportType = val.reportType;
|
||||
this.listQuery.materialId = val.materialId;
|
||||
this.listQuery.times = val.searchTime ? val.searchTime : null;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'export':
|
||||
this.listQuery.reportType = val.reportType;
|
||||
this.listQuery.materialId = val.materialId;
|
||||
this.listQuery.times = val.searchTime ? val.searchTime : null;
|
||||
this.handleExport();
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.app-container .el-table .el-table__cell {
|
||||
padding: 0;
|
||||
height: 35px;
|
||||
}
|
||||
</style>
|
@ -221,18 +221,30 @@ export default {
|
||||
timeSelect() {
|
||||
switch (this.queryParams.timeDim) {
|
||||
case '1':
|
||||
if (!this.timeValue) {
|
||||
this.$modal.msgError('时间范围不能为空')
|
||||
return false
|
||||
}
|
||||
if (this.timeValue[1] - this.timeValue[0] > 7*24*3600000) {
|
||||
this.$modal.msgError('最大时间范围为7天,请重新选择')
|
||||
this.timeValue = []
|
||||
}
|
||||
break
|
||||
case '2':
|
||||
if (!this.dateValue) {
|
||||
this.$modal.msgError('时间范围不能为空')
|
||||
return false
|
||||
}
|
||||
if (this.dateValue[1] - this.dateValue[0] > 29*24*3600000) {
|
||||
this.$modal.msgError('最大时间范围为30天,请重新选择') // 自动选择默认是0:00:00要求是23:59:59
|
||||
this.dateValue = []
|
||||
}
|
||||
break
|
||||
case '4':
|
||||
if (!this.monthValue) {
|
||||
this.$modal.msgError('时间范围不能为空')
|
||||
return false
|
||||
}
|
||||
if (this.monthValue[1] - this.monthValue[0] > 729*24*3600000) {
|
||||
this.$modal.msgError('最大时间范围为24个月,请重新选择')// 同理上面
|
||||
this.monthValue = []
|
||||
@ -338,7 +350,7 @@ export default {
|
||||
}
|
||||
switch (this.queryParams.timeDim) {
|
||||
case '1':
|
||||
if (this.timeValue.length > 0) {
|
||||
if (this.timeValue && this.timeValue.length > 0) {
|
||||
this.queryParams.startTime = this.timeValue[0]
|
||||
this.queryParams.endTime = this.timeValue[1] // 不用转
|
||||
} else {
|
||||
|
@ -8,7 +8,6 @@
|
||||
<script>
|
||||
import * as echarts from 'echarts'
|
||||
import resize from '@/utils/chartMixins/resize'
|
||||
import moment from 'moment'
|
||||
export default {
|
||||
name: "LineChart",
|
||||
mixins: [resize],
|
||||
|
@ -207,18 +207,30 @@ export default {
|
||||
timeSelect() {
|
||||
switch (this.queryParams.timeDim) {
|
||||
case '1':
|
||||
if (!this.timeValue) {
|
||||
this.$modal.msgError('时间范围不能为空')
|
||||
return false
|
||||
}
|
||||
if (this.timeValue[1] - this.timeValue[0] > 7*24*3600000) {
|
||||
this.$modal.msgError('最大时间范围为7天,请重新选择')
|
||||
this.timeValue = []
|
||||
}
|
||||
break
|
||||
case '2':
|
||||
if (!this.dateValue) {
|
||||
this.$modal.msgError('时间范围不能为空')
|
||||
return false
|
||||
}
|
||||
if (this.dateValue[1] - this.dateValue[0] > 29*24*3600000) {
|
||||
this.$modal.msgError('最大时间范围为30天,请重新选择') // 自动选择默认是0:00:00要求是23:59:59
|
||||
this.dateValue = []
|
||||
}
|
||||
break
|
||||
case '4':
|
||||
if (!this.monthValue) {
|
||||
this.$modal.msgError('时间范围不能为空')
|
||||
return false
|
||||
}
|
||||
if (this.monthValue[1] - this.monthValue[0] > 729*24*3600000) {
|
||||
this.$modal.msgError('最大时间范围为24个月,请重新选择')// 同理上面
|
||||
this.monthValue = []
|
||||
@ -307,7 +319,7 @@ export default {
|
||||
}
|
||||
switch (this.queryParams.timeDim) {
|
||||
case '1':
|
||||
if (this.timeValue.length > 0) {
|
||||
if (this.timeValue && this.timeValue.length > 0) {
|
||||
this.queryParams.startTime = this.timeValue[0]
|
||||
this.queryParams.endTime = this.timeValue[1] // 不用转
|
||||
} else {
|
||||
@ -316,7 +328,7 @@ export default {
|
||||
}
|
||||
break
|
||||
case '2':
|
||||
if (this.dateValue.length > 0) {
|
||||
if (this.dateValue && this.dateValue.length > 0) {
|
||||
this.queryParams.startTime = this.dateValue[0]
|
||||
this.queryParams.endTime = this.dateValue[1] + 86399000 // 转为23:59:59
|
||||
} else {
|
||||
@ -336,7 +348,7 @@ export default {
|
||||
}
|
||||
break
|
||||
case '4':// 转为本月最后一天的最后一秒
|
||||
if (this.monthValue.length > 0) {
|
||||
if (this.monthValue && this.monthValue.length > 0) {
|
||||
this.queryParams.startTime = this.monthValue[0]
|
||||
this.queryParams.endTime = this.transformTime(this.monthValue[1])
|
||||
} else {
|
||||
|
@ -0,0 +1,149 @@
|
||||
<template>
|
||||
<el-form ref="energyQuantityManualForm" :rules="rules" label-width="90px" :model="form">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="能源类型" prop="energyTypeId">
|
||||
<el-select v-model="form.energyTypeId" placeholder="请选择" style="width: 100%;" filterable>
|
||||
<el-option
|
||||
v-for="item in this.energyTypeList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="水/气表名" prop="tableName">
|
||||
<el-select v-model="form.tableName" placeholder="请选择" style="width: 100%;" filterable>
|
||||
<el-option
|
||||
v-for="item in getDictDatas(DICT_TYPE.TABLE_NAME)"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="抄表数" prop="readingQuantity">
|
||||
<el-input-number v-model="form.readingQuantity" :min="0" :max="999999999999" :controls='false' style="width: 50%;"></el-input-number>
|
||||
<el-select v-model="form.unit" placeholder="单位" style="width: 50%;">
|
||||
<el-option
|
||||
v-for="item in getDictDatas(DICT_TYPE.ENERGY_UNIT)"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="抄表日期" prop="recordTime">
|
||||
<el-date-picker
|
||||
v-model="form.recordTime"
|
||||
type="date"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="timestamp"
|
||||
placeholder="选择日期"
|
||||
style="width: 100%;">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
<script>
|
||||
import { energyQuantityManualCreate, energyQuantityManualUpdate, energyQuantityManualGet } from '@/api/base/energyQuantityManual'
|
||||
import moment from 'moment'
|
||||
export default {
|
||||
name: 'EnergyQuantityManualAdd',
|
||||
props: {
|
||||
energyTypeList: {
|
||||
type: Array,
|
||||
required: true,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
id: '',
|
||||
energyTypeId: '',
|
||||
tableName: '',
|
||||
readingQuantity: null,
|
||||
unit: '',
|
||||
recordTime: ''
|
||||
},
|
||||
rules: {
|
||||
energyTypeId: [{ required: true, message: '能源类型不能为空', trigger: 'change' }],
|
||||
tableName: [{ required: true, message: '水/气表名不能为空', trigger: 'change' }],
|
||||
readingQuantity: [{ required: true, message: '抄表数不能为空', trigger: 'blur' }],
|
||||
recordTime: [{ required: true, message: '抄表日期不能为空', trigger: 'change' }]
|
||||
},
|
||||
isEdit: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init(params) {
|
||||
this.form.recordTime = moment().valueOf()
|
||||
if (params.type === 'add') {
|
||||
this.isEdit = false
|
||||
} else if (params.type === 'meterReading') {
|
||||
this.isEdit = false
|
||||
this.form.energyTypeId = params.energyTypeId
|
||||
this.form.tableName = params.tableName + ''
|
||||
}else {
|
||||
this.isEdit = true
|
||||
this.form.id = params.id
|
||||
energyQuantityManualGet({id: this.form.id}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.form.energyTypeId = res.data.energyTypeId
|
||||
this.form.tableName = res.data.tableName ? res.data.tableName+'' : ''
|
||||
this.form.readingQuantity = res.data.readingQuantity
|
||||
this.form.unit = res.data.unit ? res.data.unit+'' : ''
|
||||
this.form.recordTime = res.data.recordTime ? res.data.recordTime : null
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs['energyQuantityManualForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (!this.form.unit) {
|
||||
this.$modal.msgError("抄表数单位不能为空");
|
||||
return false
|
||||
}
|
||||
if (this.isEdit) {
|
||||
// 编辑
|
||||
energyQuantityManualUpdate({...this.form}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
this.$emit('successSubmit')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
energyQuantityManualCreate({...this.form}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
this.$emit('successSubmit')
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
formClear() {
|
||||
this.$refs.energyQuantityManualForm.resetFields()
|
||||
this.form.unit = ''
|
||||
this.isEdit = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
309
src/views/energy/base/energyQuantityManual/index.vue
Normal file
309
src/views/energy/base/energyQuantityManual/index.vue
Normal file
@ -0,0 +1,309 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick"
|
||||
/>
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
@selection-change="selectChange"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="120"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
</base-table>
|
||||
<pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<!-- 新增 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="centervisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
>
|
||||
<energy-quantity-manual-add ref="energyQuantityManualAdd" :energyTypeList="energyTypeList" @successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { energyQuantityManualPage, energyQuantityManualDelete, energyQuantityManualExport } from "@/api/base/energyQuantityManual"
|
||||
import { getEnergyTypeListAll } from "@/api/base/energyType"
|
||||
import { publicFormatter } from '@/utils/dict'
|
||||
import { parseTime, parseTimeTable } from '@/utils/ruoyi'
|
||||
// import FileSaver from "file-saver"
|
||||
// import * as XLSX from 'xlsx/xlsx.mjs'
|
||||
import EnergyQuantityManualAdd from './components/energyQuantityManualAdd'
|
||||
import moment from 'moment'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'energyType',
|
||||
label: '能源类型',
|
||||
minWidth: 110,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'tableName',
|
||||
label: '水/气表名',
|
||||
filter: publicFormatter('table_name'),
|
||||
minWidth: 110
|
||||
},
|
||||
{
|
||||
prop: 'recordTime',
|
||||
label: '抄表日期',
|
||||
filter: parseTimeTable('{y}-{m}-{d}'),
|
||||
minWidth: 110
|
||||
},
|
||||
{
|
||||
prop: 'readingQuantity',
|
||||
label: '抄表值'
|
||||
},
|
||||
{
|
||||
prop: 'recordTimeLast',
|
||||
label: '上期抄表日期',
|
||||
filter: parseTimeTable('{y}-{m}-{d}'),
|
||||
minWidth: 110
|
||||
},
|
||||
{
|
||||
prop: 'readingQuantityLast',
|
||||
label: '上期抄表值',
|
||||
minWidth: 110
|
||||
},
|
||||
{
|
||||
prop: 'diff',
|
||||
label: '差值'
|
||||
}
|
||||
]
|
||||
export default {
|
||||
name: "EnergyQuantityManual",
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '能源类型',
|
||||
selectOptions: [],
|
||||
param: 'energyTypeId',
|
||||
filterable: true
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: "timestamp",
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'timeVal',
|
||||
defaultSelect: []
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary'
|
||||
},
|
||||
{
|
||||
type: 'separate'
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:energy-quantity-manual:export') ? 'button' : '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'primary',
|
||||
plain: true
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:energy-quantity-manual:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true
|
||||
}
|
||||
],
|
||||
tableProps,
|
||||
tableH: this.tableHeight(260),
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 班次基础信息列表
|
||||
list: [],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:energy-quantity-manual:create')
|
||||
? {
|
||||
type: 'meterReading',
|
||||
btnName: '抄表'
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:energy-quantity-manual:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'latest',
|
||||
value: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:energy-quantity-manual:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除'
|
||||
}
|
||||
: undefined
|
||||
].filter((v)=>v),
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
energyTypeId: '',
|
||||
recordTime: []
|
||||
},
|
||||
energyTypeList: [],
|
||||
exportList: [],
|
||||
addOrEditTitle: '',
|
||||
centervisible: false,
|
||||
|
||||
};
|
||||
},
|
||||
components: { EnergyQuantityManualAdd },
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf()
|
||||
let start = moment(moment().subtract(7, 'days').format('YYYY-MM-DD 00:00:00')).valueOf()
|
||||
this.formConfig[1].defaultSelect = [start, end]
|
||||
this.queryParams.recordTime[0] = start
|
||||
this.queryParams.recordTime[1] = end
|
||||
this.getList();
|
||||
this.getTypeList()
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams.energyTypeId = val.energyTypeId
|
||||
this.queryParams.recordTime[0] = val.timeVal ? moment(moment(val.timeVal[0]).format('YYYY-MM-DD 00:00:00')).valueOf() : null
|
||||
this.queryParams.recordTime[1] = val.timeVal ? moment(moment(val.timeVal[1]).format('YYYY-MM-DD 23:59:59')).valueOf() : null
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.getList()
|
||||
break
|
||||
case 'add':
|
||||
this.addOrEditTitle = '新增'
|
||||
this.centervisible = true
|
||||
let params = {}
|
||||
params.type = 'add'
|
||||
this.$nextTick(() => {
|
||||
this.$refs.energyQuantityManualAdd.init(params)
|
||||
})
|
||||
break
|
||||
default:
|
||||
this.$modal.confirm('是否确认导出').then(() => {
|
||||
return energyQuantityManualExport({...this.queryParams});
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '能源报表.xls');
|
||||
}).catch(() => {})
|
||||
}
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
energyQuantityManualPage(this.queryParams).then(response => {
|
||||
let arr = response.data.list || []
|
||||
arr && arr.map(item => {
|
||||
item.amount = item.amount ? (!isNaN(parseFloat(item.amount)) && isFinite(item.amount) ? item.amount.toFixed(2) : '') : ''
|
||||
})
|
||||
this.list = arr
|
||||
this.total = response.data.total;
|
||||
this.exportList = []
|
||||
});
|
||||
},
|
||||
getTypeList() {
|
||||
getEnergyTypeListAll().then((res) => {
|
||||
this.formConfig[0].selectOptions = res.data || []
|
||||
this.energyTypeList = res.data || []
|
||||
})
|
||||
},
|
||||
selectChange(val) {
|
||||
console.log(val)
|
||||
this.exportList = val
|
||||
},
|
||||
handleClick(val) {
|
||||
console.log(val)
|
||||
switch (val.type) {
|
||||
case 'edit':
|
||||
this.addOrEditTitle = '编辑'
|
||||
this.centervisible = true
|
||||
let paramA = {}
|
||||
paramA.type = 'edit'
|
||||
paramA.id = val.data.id
|
||||
this.$nextTick(() => {
|
||||
this.$refs.energyQuantityManualAdd.init(paramA)
|
||||
})
|
||||
break
|
||||
case 'meterReading':
|
||||
this.addOrEditTitle = '新增'
|
||||
this.centervisible = true
|
||||
let paramB = {}
|
||||
paramB.type = 'meterReading'
|
||||
paramB.energyTypeId = val.data.energyTypeId
|
||||
paramB.tableName = val.data.tableName
|
||||
this.$nextTick(() => {
|
||||
this.$refs.energyQuantityManualAdd.init(paramB)
|
||||
})
|
||||
break
|
||||
default:
|
||||
this.handleDelete(val.data)
|
||||
}
|
||||
},
|
||||
// 新增
|
||||
handleCancel() {
|
||||
this.$refs.energyQuantityManualAdd.formClear()
|
||||
this.centervisible = false
|
||||
this.addOrEditTitle = ''
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$refs.energyQuantityManualAdd.submitForm()
|
||||
},
|
||||
successSubmit() {
|
||||
this.handleCancel()
|
||||
this.getList()
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
console.log(row.id)
|
||||
this.$modal.confirm('是否确认删除能源类型为"' + row.energyType + '"的数据项?').then(function() {
|
||||
return energyQuantityManualDelete({id: row.id});
|
||||
}).then(() => {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,12 +1,13 @@
|
||||
<template>
|
||||
<el-popover placement="right" width="400" trigger="click">
|
||||
<span v-if='tableProps.length'>计量维度: {{dim === 4 ? '月' : (dim === 5 ? '年' : '-')}}</span>
|
||||
<el-table :data="tableData" v-if='tableProps.length'>
|
||||
<el-table-column
|
||||
v-for='item in tableProps'
|
||||
:key="item.prop"
|
||||
:prop="item.prop"
|
||||
:label="item.label"
|
||||
:align="item.align ? item.align : 'left'"
|
||||
:align="item.align ? item.align : 'left'"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -70,7 +71,8 @@ export default {
|
||||
tableProps: [],
|
||||
singlePrice:'',
|
||||
temp1,
|
||||
temp2
|
||||
temp2,
|
||||
dim: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -78,7 +80,6 @@ export default {
|
||||
let id = data.id
|
||||
getEnergyType(id).then((res) => {
|
||||
if (res.code === 0) {
|
||||
console.log(res)
|
||||
if (res.data.pricingMethod === 0) {
|
||||
this.tableProps = this.temp1
|
||||
this.singlePrice = ''
|
||||
@ -87,6 +88,7 @@ export default {
|
||||
item.price = item.price.toFixed(2)
|
||||
}
|
||||
this.tableData = arr1
|
||||
this.dim = ''
|
||||
} else if (res.data.pricingMethod === 1) {
|
||||
this.tableProps = this.temp2
|
||||
this.singlePrice = ''
|
||||
@ -95,10 +97,12 @@ export default {
|
||||
item.price = item.price.toFixed(2)
|
||||
}
|
||||
this.tableData = arr2
|
||||
this.dim = res.data.dim
|
||||
} else {
|
||||
this.tableProps = []
|
||||
this.tableData = []
|
||||
this.singlePrice = res.data.singlePrice
|
||||
this.dim = ''
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -22,7 +22,6 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
changeInput() {
|
||||
console.log(this.list)
|
||||
this.$emit('emitData', this.list)
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
changeInput() {
|
||||
console.log(this.list)
|
||||
this.$emit('emitData', this.list)
|
||||
}
|
||||
}
|
||||
|
@ -41,6 +41,14 @@
|
||||
<el-input-number v-model="form.singlePrice" :precision="2" :min="0" :max="999999999" style="width: 100%;"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-show="form.pricingMethod === 1">
|
||||
<el-form-item label="计量维度" prop="dim">
|
||||
<el-select v-model="form.dim" placeholder="请选择" style="width: 100%;">
|
||||
<el-option label="月" :value= '4' ></el-option>
|
||||
<el-option label="年" :value= '5' ></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-show="form.pricingMethod === 0">
|
||||
<el-form-item label="时间段" prop="pricingMethod">
|
||||
<base-table
|
||||
@ -213,10 +221,10 @@ export default {
|
||||
// 增加
|
||||
emitButtonClick1() {
|
||||
let n = this.tableData1.length
|
||||
if (n >=3) {
|
||||
this.$modal.msgWarning('最多可添加3档计价')
|
||||
return false
|
||||
}
|
||||
// if (n >=3) {
|
||||
// this.$modal.msgWarning('最多可添加3档计价')
|
||||
// return false
|
||||
// }
|
||||
let obj = {}
|
||||
obj.startTime = n === 0 ? '' : this.tableData1[n-1].endTime
|
||||
obj.endTime = ''
|
||||
@ -289,6 +297,7 @@ export default {
|
||||
unit: this.form.unit,
|
||||
pricingMethod: this.form.pricingMethod,
|
||||
description: this.form.description,
|
||||
dim: this.form.pricingMethod === 1 ? this.form.dim: '',
|
||||
singlePrice: this.form.pricingMethod === 2 ? this.form.singlePrice : '',
|
||||
segPriceList: this.form.pricingMethod === 0 ? this.tableData1: [],
|
||||
usedPriceList: this.form.pricingMethod === 1 ? this.tableData2: []
|
||||
@ -305,6 +314,7 @@ export default {
|
||||
unit: this.form.unit,
|
||||
pricingMethod: this.form.pricingMethod,
|
||||
description: this.form.description,
|
||||
dim: this.form.pricingMethod === 1 ? this.form.dim: '',
|
||||
singlePrice: this.form.pricingMethod === 2 ? this.form.singlePrice : '',
|
||||
segPriceList: this.form.pricingMethod === 0 ? this.tableData1: [],
|
||||
usedPriceList: this.form.pricingMethod === 1 ? this.tableData2: []
|
||||
|
@ -2,6 +2,18 @@
|
||||
<el-form ref="form" :rules="rules" label-width="110px" :model="form">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="抄表方式" prop="method">
|
||||
<el-select v-model="form.method" placeholder="请选择" style="width: 100%;" @change="changeMethod">
|
||||
<el-option
|
||||
v-for="item in getDictDatas(DICT_TYPE.METHOD)"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if='form.method == 1'>
|
||||
<el-form-item label="监控对象" prop="objectId">
|
||||
<el-cascader
|
||||
style='width: 100%;'
|
||||
@ -13,8 +25,20 @@
|
||||
clearable></el-cascader>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if='form.method == 2'>
|
||||
<el-form-item label="水/气表名" prop="tableName">
|
||||
<el-select v-model="form.tableName" placeholder="请选择" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in getDictDatas(DICT_TYPE.TABLE_NAME)"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="能源类型" prop="energyTypeId">
|
||||
<el-form-item label="监控能源类型" prop="energyTypeId">
|
||||
<el-select v-model="form.energyTypeId" placeholder="请选择" style="width: 100%;" filterable @change="toggleType">
|
||||
<el-option
|
||||
v-for="item in this.energyTypeList"
|
||||
@ -25,11 +49,29 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12" v-if='form.method == 1'>
|
||||
<el-form-item label="监控模式" prop="type">
|
||||
<el-select v-model="form.type" placeholder="请选择" style="width: 100%;" @change="typeChange">
|
||||
<el-option label="合并" :value= "1" ></el-option>
|
||||
<el-option label="详细" :value= "2" ></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if='form.method == 1'>
|
||||
<el-form-item label="监控详细参数" prop="type" v-if="form.type === 2">
|
||||
<el-select v-model="form.plcParamId" placeholder="请选择" style="width: 100%;" @change="selectDetail">
|
||||
<el-option
|
||||
v-for="item in detailList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="指标类型" prop="limitType">
|
||||
<el-select v-model="form.limitType" placeholder="请选择" style="width: 100%;">
|
||||
<el-select v-model="form.limitType" placeholder="请选择" style="width: 100%;" :disabled='form.method == 2'>
|
||||
<el-option
|
||||
v-for="item in getDictDatas(DICT_TYPE.MONITOR_INDEX_TYPE)"
|
||||
:key="item.value"
|
||||
@ -39,34 +81,12 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="监控模式" prop="type">
|
||||
<el-select v-model="form.type" placeholder="请选择" style="width: 100%;" @change="typeChange">
|
||||
<el-option label="合并" :value= "1" ></el-option>
|
||||
<el-option label="详细" :value= "2" ></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="消耗量阈值">
|
||||
<el-input-number v-model="form.minValue" placeholder="最小值" :max="9999999" style="width: 50%;"></el-input-number>
|
||||
<el-input-number v-model="form.maxValue" placeholder="最大值" :max="9999999" style="width: 50%;"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="监控详细参数" prop="type" v-if="form.type === 2">
|
||||
<el-select v-model="form.plcParamId" placeholder="请选择" style="width: 100%;" @change="selectDetail">
|
||||
<el-option
|
||||
v-for="item in detailList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
@ -91,6 +111,7 @@ export default {
|
||||
return {
|
||||
form: {
|
||||
id: '',
|
||||
method: '1',
|
||||
objectId: '',
|
||||
objectType: '',
|
||||
energyTypeId: '',
|
||||
@ -103,7 +124,8 @@ export default {
|
||||
objIds: [],// 回显数组
|
||||
isEdit: false, //是否是编辑
|
||||
rules: {
|
||||
objectId: [{ required: true, message: '对象不能为空', trigger: 'change' }],
|
||||
method: [{ required: true, message: '抄表方式不能为空', trigger: 'change' }],
|
||||
objectId: [{ required: true, message: '监控对象不能为空', trigger: 'change' }],
|
||||
energyTypeId: [{ required: true, message: '能源类型不能为空', trigger: 'change' }],
|
||||
type: [{ required: true, message: '监控模式不能为空', trigger: 'change' }],
|
||||
limitType: [{ required: true, message: '指标类型不能为空', trigger: 'change' }]
|
||||
@ -120,6 +142,7 @@ export default {
|
||||
if (res.code === 0) {
|
||||
this.form = res.data
|
||||
this.form.plcParamId = res.data.plcParamId || ''
|
||||
this.form.method = this.form.method ? this.form.method + '' : ''
|
||||
this.form.limitType = this.form.limitType ? this.form.limitType + '' : ''
|
||||
this.objIds = this.changeDetSelect(this.form.objectId, this.objList)
|
||||
if (this.form.type === 2) {
|
||||
@ -132,6 +155,14 @@ export default {
|
||||
this.form.id = ''
|
||||
}
|
||||
},
|
||||
// 切换方式
|
||||
changeMethod() {
|
||||
if(this.form.method === '2'){
|
||||
this.form.limitType = "2"
|
||||
}else{
|
||||
this.form.limitType = ''
|
||||
}
|
||||
},
|
||||
// 监控详细参数
|
||||
getDetailList() {
|
||||
getEnergyParamList({
|
||||
|
@ -51,6 +51,11 @@ import { getTree } from '@/api/base/factory'
|
||||
import { publicFormatter } from '@/utils/dict'
|
||||
import EnergyLimitAdd from './components/energyLimitAdd'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'method',
|
||||
label: '抄表方式',
|
||||
filter: publicFormatter('method')
|
||||
},
|
||||
{
|
||||
prop: 'objName',
|
||||
label: '监控对象'
|
||||
@ -59,6 +64,11 @@ const tableProps = [
|
||||
prop: 'objCode',
|
||||
label: '对象编码'
|
||||
},
|
||||
{
|
||||
prop: 'tableName',
|
||||
label: '水/气表名',
|
||||
filter: publicFormatter('table_name')
|
||||
},
|
||||
{
|
||||
prop: 'energyType',
|
||||
label: '能源类型'
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="app-container energyOverlimitLog">
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
@ -7,14 +7,29 @@
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick"
|
||||
/>
|
||||
<el-tabs v-model="activeName" @tab-click="toggleTab">
|
||||
<el-tab-pane label="自动抄表" name="auto"></el-tab-pane>
|
||||
<el-tab-pane label="手动抄表" name="manual"></el-tab-pane>
|
||||
</el-tabs>
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
/>
|
||||
<div v-if="activeName === 'auto'">
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="activeName === 'manual'">
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps2"
|
||||
:table-data="list2"
|
||||
:max-height="tableH"
|
||||
/>
|
||||
</div>
|
||||
<pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@ -28,6 +43,7 @@
|
||||
import { getEnergyOverlimitLogPage } from "@/api/monitoring/energyOverlimitLog";
|
||||
import { getEnergyTypeListAll } from "@/api/base/energyType";
|
||||
import { publicFormatter } from '@/utils/dict'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'objName',
|
||||
@ -65,6 +81,41 @@ const tableProps = [
|
||||
{
|
||||
prop: 'overValue',
|
||||
label: '超出值'
|
||||
},
|
||||
{
|
||||
prop: 'time',
|
||||
label: '提醒时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
}
|
||||
]
|
||||
const tableProps2 = [
|
||||
{
|
||||
prop: 'energyType',
|
||||
label: '能源类型'
|
||||
},
|
||||
{
|
||||
prop: 'limitType',
|
||||
label: '指标类型',
|
||||
filter: publicFormatter('monitor_index_type')
|
||||
},
|
||||
{
|
||||
prop: 'realityValue',
|
||||
label: '实际值'
|
||||
},
|
||||
{
|
||||
prop: 'limitValue',
|
||||
label: '阈值'
|
||||
},
|
||||
{
|
||||
prop: 'overValue',
|
||||
label: '超出值'
|
||||
},
|
||||
{
|
||||
prop: 'time',
|
||||
label: '提醒时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
}
|
||||
]
|
||||
export default {
|
||||
@ -93,18 +144,20 @@ export default {
|
||||
color: 'primary'
|
||||
}
|
||||
],
|
||||
activeName: 'auto',
|
||||
tableProps,
|
||||
tableProps2,
|
||||
tableH: this.tableHeight(260),
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 班次基础信息列表
|
||||
list: [],
|
||||
list2: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
energyTypeId: '',
|
||||
indexType: ''
|
||||
indexType: '',
|
||||
method: '1'
|
||||
},
|
||||
typeList: [
|
||||
{id: 1, name: '合并'},
|
||||
@ -155,7 +208,47 @@ export default {
|
||||
console.log(res)
|
||||
this.formConfig[0].selectOptions = res.data || []
|
||||
})
|
||||
},
|
||||
toggleTab() {
|
||||
if (this.activeName === 'auto') {
|
||||
this.queryParams.method = '1'
|
||||
}else{
|
||||
this.queryParams.method = '2'
|
||||
}
|
||||
this.queryParams.pageNo = 1
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
.energyOverlimitLog {
|
||||
.el-tabs__nav::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
background-color: #e4e7ed;
|
||||
}
|
||||
.el-tabs__nav-wrap::after {
|
||||
width: 0;
|
||||
}
|
||||
.el-tabs__item {
|
||||
padding: 0 10px;
|
||||
}
|
||||
.el-tabs__item:hover {
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
}
|
||||
.el-tabs__item.is-active {
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
}
|
||||
.el-tabs__item {
|
||||
color: rgba(0, 0, 0, 0.45);
|
||||
}
|
||||
.searchBarBox {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -9,8 +9,7 @@
|
||||
<el-drawer
|
||||
:visible="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="mode.includes('detail') ? true : false"
|
||||
:before-close="handleCancel"
|
||||
:wrapper-closable="false"
|
||||
class="drawer"
|
||||
custom-class="mes-drawer"
|
||||
:size="size || '50%'"
|
||||
@ -130,12 +129,13 @@
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div v-if="!mode.includes('detail')" class="drawer-body__footer">
|
||||
<el-button style="" @click="handleCancel">取消</el-button>
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="handleCancel">返回</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
v-if="!mode.includes('detail')"
|
||||
@click="handleSave">
|
||||
确定
|
||||
保存
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -9,8 +9,7 @@
|
||||
<el-drawer
|
||||
:visible="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="mode.includes('detail') ? true : false"
|
||||
:before-close="handleCancel"
|
||||
:wrapper-closable="false"
|
||||
class="drawer"
|
||||
custom-class="mes-drawer"
|
||||
:size="size || '50%'"
|
||||
@ -129,10 +128,11 @@
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div v-if="!mode.includes('detail')" class="drawer-body__footer">
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="handleCancel">取消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
v-if="!mode.includes('detail')"
|
||||
@click="handleCancel">
|
||||
确定
|
||||
</el-button>
|
||||
|
@ -34,7 +34,7 @@
|
||||
<base-dialog
|
||||
:dialogTitle="title"
|
||||
:dialogVisible="open"
|
||||
width="30%"
|
||||
width="700px"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
|
@ -25,7 +25,6 @@
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:width="90"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
@ -42,7 +41,7 @@
|
||||
<base-dialog
|
||||
:dialogTitle="title"
|
||||
:dialogVisible="open"
|
||||
width="45%"
|
||||
width="700px"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
@ -128,7 +127,7 @@ export default {
|
||||
// width: 180,
|
||||
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
// },
|
||||
{ prop: 'code', label: '编码', showOverflowtooltip: true },
|
||||
{ prop: 'code', label: '编码' },
|
||||
{ prop: 'plcTableName', label: '关联表名' },
|
||||
{ prop: 'name', label: '标识名称' },
|
||||
{ prop: 'enName', label: '英文名称' },
|
||||
@ -137,7 +136,7 @@ export default {
|
||||
label: '是否采集',
|
||||
subcomponent: switchBtn,
|
||||
},
|
||||
{ prop: 'description', label: '描述', showOverflowtooltip: true },
|
||||
{ prop: 'description', label: '描述' },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
@ -214,28 +213,16 @@ export default {
|
||||
},
|
||||
],
|
||||
[
|
||||
// {
|
||||
// switch: true,
|
||||
// label: '是否采集', // 是否采集 0 代表不采集, 1 代表采集
|
||||
// prop: 'collection',
|
||||
// bind: {
|
||||
// 'active-value': 1,
|
||||
// 'inactive-value': 0,
|
||||
// value: 1,
|
||||
// },
|
||||
// },
|
||||
{
|
||||
select: true,
|
||||
options: [
|
||||
{ label: '否', value: 0 },
|
||||
{ label: '是', value: 1 }
|
||||
],
|
||||
label: '是否采集',
|
||||
switch: true,
|
||||
label: '是否采集', // 是否采集 0 代表不采集, 1 代表采集
|
||||
prop: 'collection',
|
||||
bind: {
|
||||
clearable: true, filterable: true
|
||||
}
|
||||
}
|
||||
'active-value': 1,
|
||||
'inactive-value': 0,
|
||||
value: 1,
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
|
@ -9,8 +9,7 @@
|
||||
<el-drawer
|
||||
:visible="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="mode.includes('detail') ? true : false"
|
||||
:before-close="handleCancel"
|
||||
:wrapper-closable="false"
|
||||
class="drawer"
|
||||
custom-class="mes-drawer"
|
||||
:size="size || '50%'"
|
||||
@ -148,12 +147,13 @@
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div v-if="!mode.includes('detail')" class="drawer-body__footer">
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="handleCancel">取消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
v-if="!mode.includes('detail')"
|
||||
@click="handleSave">
|
||||
确定
|
||||
保存
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,8 +1,8 @@
|
||||
<!--
|
||||
<!--
|
||||
filename: dialogForm.vue
|
||||
author: liubin
|
||||
date: 2023-10-31 15:55:13
|
||||
description:
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
@ -112,7 +112,7 @@
|
||||
<el-form-item label="附件">
|
||||
<FileUpload v-model="file" :limit="1" :f-name="fileName" :disabled="isdetail" @name="setFileName" />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
</el-form>
|
||||
|
||||
<div v-if="!isdetail" class="drawer-body__footer">
|
||||
@ -125,7 +125,7 @@
|
||||
<script>
|
||||
import SmallTitle from '../../../base/alarm/Record/SmallTitle.vue';
|
||||
import { createCheckLog, updateCheckLog, getcheckConfigByEqList, getEqCheckLog } from '@/api/equipment/base/inspection/record'
|
||||
import { getEquipmentAll } from '@/api/base/equipment'
|
||||
import { getEquipmentPage } from '@/api/base/equipment'
|
||||
import Editor from "@/components/Editor";
|
||||
import { getCheckDetPage } from "@/api/equipment/base/inspection/settings";
|
||||
// import FileUpload from "@/components/FileUpload";
|
||||
@ -203,7 +203,7 @@ export default {
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
created() {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
@ -211,8 +211,12 @@ export default {
|
||||
this.fileName = val
|
||||
},
|
||||
async getDict() {
|
||||
const res = await getEquipmentAll()
|
||||
this.eqList = res.data
|
||||
const res = await getEquipmentPage({
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
special: false
|
||||
})
|
||||
this.eqList = res.data.list
|
||||
const configres = await getcheckConfigByEqList()
|
||||
this.configList = configres.data
|
||||
},
|
||||
@ -269,7 +273,6 @@ export default {
|
||||
}
|
||||
this.dataForm.description = this.dataForm.description || '无'
|
||||
this.setConfig()
|
||||
this.setInspectionContet()
|
||||
});
|
||||
} else {
|
||||
// if (this.urlOptions.isGetCode) {
|
||||
|
@ -49,8 +49,7 @@
|
||||
<addRecord
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="getList"
|
||||
@destroy="addOrUpdateVisible = false" />
|
||||
@refreshDataList="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -216,6 +215,7 @@ export default {
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
special: false,
|
||||
maintenanceStatus: null,
|
||||
createTime: null,
|
||||
equipmentId: null,
|
||||
@ -232,11 +232,15 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
initSearchBar() {
|
||||
this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
|
||||
this.http('/base/core-equipment/page', 'get', {
|
||||
special: false,
|
||||
pageNo: 1,
|
||||
pageSize: 99,
|
||||
}).then(({ data }) => {
|
||||
this.$set(
|
||||
this.searchBarFormConfig[0],
|
||||
'selectOptions',
|
||||
data.map((item) => ({
|
||||
(data?.list || []).map((item) => ({
|
||||
name: item.name,
|
||||
id: item.id,
|
||||
}))
|
||||
|
@ -49,7 +49,7 @@
|
||||
|
||||
<script>
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
// import moment from 'moment';
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import { exportMaintainMonitorExcel } from '@/api/equipment/base/maintain/record'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
@ -67,7 +67,7 @@ const remainBox = {
|
||||
color() {
|
||||
if (this.value) {
|
||||
const v = +this.value;
|
||||
return v < 0 ? '#FF5454' : v >= 0 && v < 2 ? '#FFD767' : '#37D97F';
|
||||
return v < 0 ? 'red' : v >= 0 && v < 2 ? 'yellow' : 'green';
|
||||
}
|
||||
return 'unset';
|
||||
},
|
||||
@ -78,10 +78,9 @@ const remainBox = {
|
||||
style={`background: ${
|
||||
this.color
|
||||
}; position:absolute; inset: 0; padding: 0 10px; display: flex; align-items: center; color: ${
|
||||
// this.color == 'red' ? '#fff' : 'unset'
|
||||
'#fff'
|
||||
this.color == 'red' ? '#fff' : 'unset'
|
||||
}`}>
|
||||
{ this.injectData[this.injectData.prop]?.toFixed(0) || '' }
|
||||
{this.injectData[this.injectData.prop] || ''}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
@ -122,35 +121,30 @@ export default {
|
||||
// width: 180,
|
||||
// filter: parseTime(createTime),
|
||||
// },
|
||||
{ prop: 'name', label: '保养计划', minWidth: 100, showOverflowtooltip: true },
|
||||
{ prop: 'lineName', label: '产线名', minWidth: 100, showOverflowtooltip: true },
|
||||
{ prop: 'sectionName', label: '工段名', minWidth: 100, showOverflowtooltip: true },
|
||||
{ prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true },
|
||||
{ prop: 'equipmentCode', label: '设备编码', minWidth: 100, showOverflowtooltip: true },
|
||||
{ prop: 'name', label: '保养计划' },
|
||||
{ prop: 'lineName', label: '产线名' },
|
||||
{ prop: 'sectionName', label: '工段名' },
|
||||
{ prop: 'equipmentName', label: '设备名称' },
|
||||
{ prop: 'equipmentCode', label: '设备编码' },
|
||||
{ prop: 'maintenancePeriod', label: '保养频率' },
|
||||
{
|
||||
prop: 'maintainType',
|
||||
label: '保养类型',
|
||||
showOverflowtooltip: true,
|
||||
filter: publicFormatter(this.DICT_TYPE.MAINTAIN_TYPE),
|
||||
},
|
||||
{
|
||||
prop: 'lastMaintainTime',
|
||||
label: '上次保养时间',
|
||||
filter: parseTime,
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{ prop: 'nextMaintainTime', label: '计划下次保养时间', filter: parseTime, minWidth: 150, showOverflowtooltip: true },
|
||||
{ prop: 'nextMaintainTime', label: '计划下次保养时间', filter: parseTime },
|
||||
{
|
||||
prop: 'remainDays',
|
||||
label: '距离保养时间(天)',
|
||||
subcomponent: remainBox,
|
||||
minWidth: 150,
|
||||
// showOverflowtooltip: true
|
||||
},
|
||||
{ prop: 'opt1', label: '设备保养', name: '操作', subcomponent: btn, width: 100 },
|
||||
{ prop: 'opt2', label: '保养记录', name: '查看详情', subcomponent: btn, width: 100 },
|
||||
{ prop: 'opt1', label: '设备保养', name: '操作', subcomponent: btn },
|
||||
{ prop: 'opt2', label: '保养记录', name: '查看详情', subcomponent: btn },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
@ -192,6 +186,7 @@ export default {
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
special: false,
|
||||
equipmentName: null,
|
||||
createTime: null,
|
||||
},
|
||||
@ -223,11 +218,15 @@ export default {
|
||||
.catch(() => { });
|
||||
},
|
||||
initSearchBar() {
|
||||
this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
|
||||
this.http('/base/core-equipment/page', 'get', {
|
||||
special: false,
|
||||
pageNo: 1,
|
||||
pageSize: 99
|
||||
}).then(({ data }) => {
|
||||
this.$set(
|
||||
this.searchBarFormConfig[1],
|
||||
'selectOptions',
|
||||
data.map((item) => ({
|
||||
(data?.list || []).map((item) => ({
|
||||
name: item.name,
|
||||
id: item.id,
|
||||
}))
|
||||
|
@ -186,7 +186,8 @@ export default {
|
||||
select: true,
|
||||
label: '设备名称',
|
||||
prop: 'equipmentId',
|
||||
url: '/base/core-equipment/listAll',
|
||||
// url: '/base/core-equipment/listAll?special=false',
|
||||
url: '/base/core-equipment/page?special=false&pageNo=1&pageSize=99',
|
||||
rules: [{ required: true, message: '设备名称不能为空', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
@ -244,6 +245,7 @@ export default {
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
special: false,
|
||||
equipmentName: null,
|
||||
createTime: null,
|
||||
},
|
||||
|
@ -99,24 +99,23 @@ export default {
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
fixed: true,
|
||||
width: 150,
|
||||
width: 180,
|
||||
filter: timeFilter,
|
||||
},
|
||||
{ prop: 'maintainOrderNumber', label: '设备保养单号', width: 110, showOverflowtooltip: true },
|
||||
{ prop: 'startTime', label: '开始时间', filter: timeFilter, minWidth: 150, showOverflowtooltip: true },
|
||||
{ prop: 'endTime', label: '结束时间', filter: timeFilter, minWidth: 150, showOverflowtooltip: true },
|
||||
{ prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true },
|
||||
{ prop: 'maintainWorker', label: '保养人员', minWidth: 100, showOverflowtooltip: true },
|
||||
{ prop: 'maintainOrderNumber', label: '设备保养单号' },
|
||||
{ prop: 'startTime', label: '开始时间', filter: timeFilter },
|
||||
{ prop: 'endTime', label: '结束时间', filter: timeFilter },
|
||||
{ prop: 'equipmentName', label: '设备名称' },
|
||||
{ prop: 'maintainWorker', label: '保养人员' },
|
||||
{
|
||||
prop: 'relatePlan',
|
||||
label: '是否计划保养',
|
||||
width: 120,
|
||||
filter: (v) => (v != null ? ['', '是', '否'][v] : ''),
|
||||
},
|
||||
{ prop: 'planName', label: '保养计划名称', minWidth: 120, showOverflowtooltip: true },
|
||||
{ prop: 'maintainDuration', label: '计划保养用时(h)', minWidth: 130, showOverflowtooltip: true },
|
||||
{ prop: 'timeUsed', label: '实际保养用时(h)', minWidth: 130 },
|
||||
{ prop: 'remark', label: '备注', minWidth: 100, showOverflowtooltip: true },
|
||||
{ prop: 'planName', label: '保养计划名称' },
|
||||
{ prop: 'maintainDuration', label: '计划保养用时(h)' },
|
||||
{ prop: 'timeUsed', label: '实际保养用时(h)' },
|
||||
{ prop: 'remark', label: '备注' },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
@ -181,6 +180,14 @@ export default {
|
||||
plain: true,
|
||||
color: 'success',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('equipment:maintain-record:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'warning',
|
||||
},
|
||||
],
|
||||
rows: [
|
||||
[
|
||||
@ -188,7 +195,8 @@ export default {
|
||||
select: true,
|
||||
label: '保养设备',
|
||||
prop: 'equipmentId',
|
||||
url: '/base/core-equipment/listAll',
|
||||
// url: '/base/core-equipment/listAll',
|
||||
url: '/base/core-equipment/page?special=false&pageNo=1&pageSize=99',
|
||||
bind: {
|
||||
filterable: true,
|
||||
clearable: true,
|
||||
@ -215,29 +223,17 @@ export default {
|
||||
},
|
||||
],
|
||||
[
|
||||
// {
|
||||
// switch: true,
|
||||
// label: '是否计划保养',
|
||||
// prop: 'relatePlan',
|
||||
// bind: {
|
||||
// 'active-value': 1,
|
||||
// 'inactive-value': 2,
|
||||
// },
|
||||
// rules: [{ required: true, message: '是否计划保养不能为空', trigger: 'blur' }],
|
||||
// },
|
||||
{
|
||||
select: true,
|
||||
options: [
|
||||
{ label: '是', value: 1 },
|
||||
{ label: '否', value: 2 }
|
||||
],
|
||||
switch: true,
|
||||
label: '是否计划保养',
|
||||
prop: 'relatePlan',
|
||||
bind: {
|
||||
clearable: true, filterable: true
|
||||
'active-value': 1,
|
||||
'inactive-value': 2,
|
||||
},
|
||||
rules: [{ required: true, message: '是否计划保养不能为空', trigger: 'blur' }],
|
||||
},
|
||||
{},
|
||||
{
|
||||
select: true,
|
||||
label: '所属计划',
|
||||
@ -248,11 +244,6 @@ export default {
|
||||
clearable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '保养用时',
|
||||
prop: 'timeUsed',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
@ -279,7 +270,11 @@ export default {
|
||||
clearable: true,
|
||||
},
|
||||
},
|
||||
{}
|
||||
{
|
||||
input: true,
|
||||
label: '保养用时',
|
||||
prop: 'timeUsed',
|
||||
},
|
||||
],
|
||||
|
||||
[
|
||||
@ -307,6 +302,7 @@ export default {
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
special: false,
|
||||
maintainPlanId: null,
|
||||
maintainPlanId: null,
|
||||
startTime: null,
|
||||
@ -344,11 +340,15 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
initSearchBar() {
|
||||
this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
|
||||
this.http('/base/core-equipment/page', 'get', {
|
||||
special: false,
|
||||
pageNo: 1,
|
||||
pageSize: 99
|
||||
}).then(({ data }) => {
|
||||
this.$set(
|
||||
this.searchBarFormConfig[0],
|
||||
'selectOptions',
|
||||
data.map((item) => ({
|
||||
(data?.list || []).map((item) => ({
|
||||
name: item.name,
|
||||
id: item.id,
|
||||
}))
|
||||
|
@ -1,180 +1,173 @@
|
||||
<!--
|
||||
|
||||
首页
|
||||
工单管理
|
||||
合并请求
|
||||
里程碑
|
||||
探索
|
||||
通知469
|
||||
创建…
|
||||
个人信息和配置
|
||||
mt-fe-group / yudao-dev
|
||||
取消关注
|
||||
11
|
||||
点赞
|
||||
0
|
||||
派生
|
||||
0
|
||||
代码
|
||||
工单
|
||||
0
|
||||
合并请求
|
||||
0
|
||||
版本发布
|
||||
0
|
||||
百科
|
||||
动态
|
||||
559 提交
|
||||
25 分支
|
||||
145 MiB
|
||||
分支: projects/mes-test
|
||||
yudao-dev/src/views/equipment/base/repair/CustomDialogForm.vue
|
||||
346 行
|
||||
8.9 KiB
|
||||
原始文件
|
||||
永久链接
|
||||
Blame
|
||||
文件历史
|
||||
|
||||
<!--
|
||||
filename: dialogForm.vue
|
||||
author: liubin
|
||||
date: 2023-10-31 15:55:13
|
||||
description:
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="disabled"
|
||||
class="drawer"
|
||||
custom-class="mes-drawer"
|
||||
size="65%"
|
||||
@closed="$emit('destroy')">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
{{ disabled ? '查看详情' : !dataForm.maintenanceStatus ? '修改' : '完成' }}
|
||||
</small-title>
|
||||
<div class="drawer-body flex">
|
||||
<div class="drawer-body__content">
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="dataForm"
|
||||
label-width="100px"
|
||||
label-position="top"
|
||||
v-loading="formLoading">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="维修单号" prop="repairOrderNumber">
|
||||
<span>{{ dataForm.repairOrderNumber }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备名称" prop="equipmentName">
|
||||
<span>{{ dataForm.equipmentName }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="维修工" prop="repairman">
|
||||
<span>{{ dataForm.repairman }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="故障发生时间" prop="faultTime">
|
||||
<span>{{ parseTime(dataForm.faultTime) }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="故障级别" prop="faultLevel">
|
||||
<span>{{ getDictDataLabel('fault-level', dataForm.faultLevel) }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系方式" prop="repairmanPhone">
|
||||
<span>{{ dataForm.repairmanPhone }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="disabled" class="drawer"
|
||||
custom-class="mes-drawer" size="65%" @closed="$emit('destroy')">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
{{ disabled ? '查看详情' : !dataForm.maintenanceStatus ? '修改' : '完成' }}
|
||||
</small-title>
|
||||
<div class="drawer-body flex">
|
||||
<div class="drawer-body__content">
|
||||
<el-form ref="form" :model="dataForm" label-width="100px" label-position="top" v-loading="formLoading">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="维修单号" prop="repairOrderNumber">
|
||||
<span>{{ dataForm.repairOrderNumber }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备名称" prop="equipmentName">
|
||||
<span>{{ dataForm.equipmentName }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="维修工" prop="repairman">
|
||||
<span>{{ dataForm.repairman }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="故障发生时间" prop="faultTime">
|
||||
<span>{{ parseTime(dataForm.faultTime) }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="故障级别" prop="faultLevel">
|
||||
<span>{{ getDictDataLabel('fault-level', dataForm.faultLevel) }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系方式" prop="repairmanPhone">
|
||||
<span>{{ dataForm.repairmanPhone }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-divider />
|
||||
|
||||
<div v-if=" disabled && dataForm.maintenanceStatus === 1 ? true : !disabled ? true : false">
|
||||
<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
|
||||
{{ '设备维修信息' }}
|
||||
</small-title>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item
|
||||
label="维修开始时间"
|
||||
prop="maintenanceStartTime"
|
||||
:rules="[{ required: true, message: '维修开始时间不能为空', trigger: 'blur' }]">
|
||||
<el-date-picker
|
||||
v-model="dataForm.maintenanceStartTime"
|
||||
type="datetime"
|
||||
:disabled="disabled"
|
||||
placeholder="请选择维修开始时间"
|
||||
value-format="timestamp" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item
|
||||
label="维修结束时间"
|
||||
prop="maintenanceFinishTime"
|
||||
:rules="[{ required: true, message: '维修结束时间不能为空', trigger: 'blur' }]">
|
||||
<el-date-picker
|
||||
v-model="dataForm.maintenanceFinishTime"
|
||||
type="datetime"
|
||||
:disabled="disabled"
|
||||
placeholder="请选择维修开始时间"
|
||||
value-format="timestamp" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item
|
||||
label="维修方式"
|
||||
prop="repairMode"
|
||||
:rules="[{ required: true, message: '维修方式不能为空', trigger: 'blur' }]">
|
||||
<el-select
|
||||
:disabled="disabled"
|
||||
v-model="dataForm.repairMode"
|
||||
placeholder="请选择维修方式">
|
||||
<el-option
|
||||
v-for="opt in getDictDatas('repair-mode')"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="故障类型" prop="faultType">
|
||||
<el-select
|
||||
:disabled="disabled"
|
||||
v-model="dataForm.faultType"
|
||||
placeholder="请选择故障类型">
|
||||
<el-option
|
||||
v-for="opt in getDictDatas('fault-type')"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider style="margin-top: -10px" />
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col>
|
||||
<el-form-item
|
||||
label="故障明细"
|
||||
prop="faultDetail"
|
||||
:rules="[{ required: true, message: '故障明细不能为空', trigger: 'blur' }]">
|
||||
<!-- // 富文本 -->
|
||||
<editor v-model="dataForm.faultDetail" :read-only="disabled" :min-height="150"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
|
||||
{{ '设备维修信息' }}
|
||||
</small-title>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="维修开始时间" prop="maintenanceStartTime"
|
||||
:rules="[{ required: true, message: '维修开始时间不能为空', trigger: 'blur' }]">
|
||||
<el-date-picker v-model="dataForm.maintenanceStartTime" type="datetime" :disabled="disabled"
|
||||
placeholder="请选择维修开始时间" value-format="timestamp" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="维修结束时间" prop="maintenanceFinishTime"
|
||||
:rules="[{ required: true, message: '维修结束时间不能为空', trigger: 'blur' }]">
|
||||
<el-date-picker v-model="dataForm.maintenanceFinishTime" type="datetime" :disabled="disabled"
|
||||
placeholder="请选择维修开始时间" value-format="timestamp" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="维修方式" prop="repairMode"
|
||||
:rules="[{ required: true, message: '维修方式不能为空', trigger: 'blur' }]">
|
||||
<el-select :disabled="disabled" v-model="dataForm.repairMode" placeholder="请选择维修方式">
|
||||
<el-option v-for="opt in getDictDatas('repair-mode')" :key="opt.value" :label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="故障类型" prop="faultType">
|
||||
<el-select :disabled="disabled" v-model="dataForm.faultType" placeholder="请选择故障类型">
|
||||
<el-option v-for="opt in getDictDatas('fault-type')" :key="opt.value" :label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col>
|
||||
<el-form-item label="维修记录" prop="maintenanceDetail">
|
||||
<!-- // 富文本 -->
|
||||
<editor v-model="dataForm.maintenanceDetail" :read-only="disabled" :min-height="150"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col>
|
||||
<el-form-item label="故障明细" prop="faultDetail"
|
||||
:rules="[{ required: true, message: '故障明细不能为空', trigger: 'blur' }]">
|
||||
<!-- // 富文本 -->
|
||||
<editor v-model="dataForm.faultDetail" :read-only="disabled" :min-height="150" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col>
|
||||
<el-form-item label="维修附件" prop="file">
|
||||
<FileUpload v-model="file" :limit="1" :f-name="fileName" :disabled="disabled" @name="setFileName" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col>
|
||||
<el-form-item label="维修记录" prop="maintenanceDetail">
|
||||
<!-- // 富文本 -->
|
||||
<editor v-model="dataForm.maintenanceDetail" :read-only="disabled" :min-height="150" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="dataForm.remark"
|
||||
:placeholder="`请输入备注`"
|
||||
:disabled="disabled" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
<el-row :gutter="20">
|
||||
<el-col>
|
||||
<el-form-item label="维修附件" prop="file">
|
||||
<FileUpload v-model="file" :limit="1" :f-name="fileName" :disabled="disabled" @name="setFileName" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<div v-if="!disabled" class="drawer-body__footer">
|
||||
<el-button style="" @click="goback()">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-drawer>
|
||||
<el-row :gutter="20">
|
||||
<el-col>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" :placeholder="`请输入备注`" :disabled="disabled" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<div v-if="!disabled" class="drawer-body__footer">
|
||||
<el-button style="" @click="goback()">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -187,102 +180,102 @@ import { parseTime } from '@/utils/ruoyi'
|
||||
import { getDictDataLabel } from '@/utils/dict';
|
||||
|
||||
export default {
|
||||
name: 'DialogForm',
|
||||
model: {
|
||||
prop: 'dataForm',
|
||||
event: 'update',
|
||||
},
|
||||
emits: ['update'],
|
||||
components: { SmallTitle, Editor, FileUpload },
|
||||
props: {
|
||||
// dataForm: {
|
||||
// type: Object,
|
||||
// default: () => ({}),
|
||||
// },
|
||||
// disabled: {
|
||||
// type: Boolean,
|
||||
// default: false
|
||||
// },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formLoading: true,
|
||||
visible: false,
|
||||
disabled: false,
|
||||
dataForm: {},
|
||||
file: '',
|
||||
fileName: ''
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
setFileName(val) {
|
||||
this.fileName = val
|
||||
},
|
||||
goback() {
|
||||
this.$emit('refreshDataList');
|
||||
this.visible = false;
|
||||
},
|
||||
goEdit() {
|
||||
this.disabled = false;
|
||||
},
|
||||
/** 模拟透传 ref */
|
||||
validate(cb) {
|
||||
return this.$refs.form.validate(cb);
|
||||
},
|
||||
resetFields(args) {
|
||||
return this.$refs.form.resetFields(args);
|
||||
},
|
||||
initData() {
|
||||
this.file = ''
|
||||
this.fileName = ''
|
||||
},
|
||||
init(row, isdetail) {
|
||||
this.initData();
|
||||
this.disabled = isdetail || false;
|
||||
this.dataForm.id = row.id || undefined;
|
||||
this.visible = true;
|
||||
name: 'DialogForm',
|
||||
model: {
|
||||
prop: 'dataForm',
|
||||
event: 'update',
|
||||
},
|
||||
emits: ['update'],
|
||||
components: { SmallTitle, Editor, FileUpload },
|
||||
props: {
|
||||
// dataForm: {
|
||||
// type: Object,
|
||||
// default: () => ({}),
|
||||
// },
|
||||
// disabled: {
|
||||
// type: Boolean,
|
||||
// default: false
|
||||
// },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formLoading: true,
|
||||
visible: false,
|
||||
disabled: false,
|
||||
dataForm: {},
|
||||
file: '',
|
||||
fileName: ''
|
||||
};
|
||||
},
|
||||
mounted() { },
|
||||
methods: {
|
||||
setFileName(val) {
|
||||
this.fileName = val
|
||||
},
|
||||
goback() {
|
||||
this.$emit('refreshDataList');
|
||||
this.visible = false;
|
||||
},
|
||||
goEdit() {
|
||||
this.disabled = false;
|
||||
},
|
||||
/** 模拟透传 ref */
|
||||
validate(cb) {
|
||||
return this.$refs.form.validate(cb);
|
||||
},
|
||||
resetFields(args) {
|
||||
return this.$refs.form.resetFields(args);
|
||||
},
|
||||
initData() {
|
||||
this.file = ''
|
||||
this.fileName = ''
|
||||
},
|
||||
init(row, isdetail) {
|
||||
this.initData();
|
||||
this.disabled = isdetail || false;
|
||||
this.dataForm.id = row.id || undefined;
|
||||
this.visible = true;
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form'].resetFields();
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form'].resetFields();
|
||||
|
||||
if (this.dataForm.id) {
|
||||
// 获取设备维修
|
||||
getEqRepair(this.dataForm.id).then(response => {
|
||||
this.formLoading = false
|
||||
if (this.dataForm.id) {
|
||||
// 获取设备维修
|
||||
getEqRepair(this.dataForm.id).then(response => {
|
||||
this.formLoading = false
|
||||
this.dataForm = response.data;
|
||||
this.dataForm.maintenanceStatus = this.dataForm.maintenanceStatus || 0
|
||||
if (this.dataForm.files.length > 0) {
|
||||
this.file = this.dataForm.files[0].fileUrl
|
||||
this.fileName = this.dataForm.files[0].fileName
|
||||
}
|
||||
this.dataForm.maintenanceStatus = row.maintenanceStatus || 0
|
||||
if (this.dataForm.files.length > 0) {
|
||||
this.file = this.dataForm.files[0].fileUrl
|
||||
this.fileName = this.dataForm.files[0].fileName
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// if (this.urlOptions.isGetCode) {
|
||||
} else {
|
||||
// if (this.urlOptions.isGetCode) {
|
||||
// this.getCode()
|
||||
// }
|
||||
}
|
||||
});
|
||||
},
|
||||
// 表单提交
|
||||
}
|
||||
});
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.file) {
|
||||
const temp = this.file.split(',') // 获取文件个数
|
||||
let arry = []
|
||||
temp.forEach(item => {
|
||||
arry.push({
|
||||
fileName: this.fileName,
|
||||
fileType: 2,
|
||||
fileUrl: item
|
||||
})
|
||||
})
|
||||
this.dataForm.files = arry
|
||||
}
|
||||
if (this.file) {
|
||||
const temp = this.file.split(',') // 获取文件个数
|
||||
let arry = []
|
||||
temp.forEach(item => {
|
||||
arry.push({
|
||||
fileName: this.fileName,
|
||||
fileType: 2,
|
||||
fileUrl: item
|
||||
})
|
||||
})
|
||||
this.dataForm.files = arry
|
||||
}
|
||||
if (this.dataForm.id) {
|
||||
updateEqRepair(this.dataForm).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
@ -299,49 +292,49 @@ export default {
|
||||
// });
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.drawer >>> .el-drawer {
|
||||
border-radius: 8px 0 0 8px;
|
||||
.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;
|
||||
.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;
|
||||
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%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.drawer-body__content {
|
||||
flex: 1;
|
||||
/* background: #eee; */
|
||||
padding: 20px 30px;
|
||||
overflow-y: auto;
|
||||
flex: 1;
|
||||
/* background: #eee; */
|
||||
padding: 20px 30px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.drawer-body__footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 18px;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 18px;
|
||||
}
|
||||
</style>
|
||||
|
@ -17,7 +17,7 @@
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:width="120"
|
||||
:width="180"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
@ -48,8 +48,7 @@
|
||||
<CustomDialogForm
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="getList"
|
||||
@destroy="addOrUpdateVisible = false" />
|
||||
@refreshDataList="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -71,6 +70,12 @@ export default {
|
||||
addOrUpdateVisible: false,
|
||||
searchBarKeys: ['maintenanceStatus', 'createTime', 'equipmentId'],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('equipment:repair:update')
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('equipment:repair:finish')
|
||||
? {
|
||||
type: 'finish',
|
||||
@ -79,16 +84,10 @@ export default {
|
||||
: undefined,
|
||||
this.$auth.hasPermi('equipment:repair:update')
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
: undefined,
|
||||
// this.$auth.hasPermi('equipment:repair:update')
|
||||
// ? {
|
||||
// type: 'edit',
|
||||
// btnName: '修改',
|
||||
// }
|
||||
// : undefined,
|
||||
this.$auth.hasPermi('equipment:repair:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
@ -101,24 +100,22 @@ export default {
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
fixed: true,
|
||||
width: 150,
|
||||
width: 180,
|
||||
filter: parseTime,
|
||||
},
|
||||
{ prop: 'repairOrderNumber', label: '设备维修单号', minWidth: 100, showOverflowtooltip: true },
|
||||
{ prop: 'maintenanceStartTime', label: '开始时间', filter: parseTime, minWidth: 150, showOverflowtooltip: true },
|
||||
{ prop: 'repairOrderNumber', label: '设备维修单号' },
|
||||
{ prop: 'maintenanceStartTime', label: '开始时间', filter: parseTime },
|
||||
{
|
||||
prop: 'maintenanceFinishTime',
|
||||
label: '结束时间',
|
||||
filter: parseTime,
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'maintenanceStatus',
|
||||
label: '维修状态',
|
||||
filter: (v) => (v != null ? ['未完成', '完成', '进行中'][v] : ''),
|
||||
},
|
||||
{ prop: 'maintenanceDuration', label: '维修时长(h)', width: 110 },
|
||||
{ prop: 'maintenanceDuration', label: '维修时长(h)' },
|
||||
{ prop: 'lineName', label: '产线' },
|
||||
{ prop: 'sectionName', label: '工段' },
|
||||
{ prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true },
|
||||
@ -196,7 +193,8 @@ export default {
|
||||
select: true,
|
||||
label: '设备名称',
|
||||
prop: 'equipmentId',
|
||||
url: '/base/core-equipment/listAll',
|
||||
// url: '/base/core-equipment/listAll',
|
||||
url: '/base/core-equipment/page?special=false&pageNo=1&pageSize=99',
|
||||
bind: {
|
||||
filterable: true,
|
||||
clearable: true,
|
||||
@ -254,6 +252,7 @@ export default {
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
special: false,
|
||||
maintenanceStatus: null,
|
||||
createTime: null,
|
||||
equipmentId: null,
|
||||
@ -270,11 +269,15 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
initSearchBar() {
|
||||
this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
|
||||
this.http('/base/core-equipment/page', 'get', {
|
||||
special: false,
|
||||
pageNo: 1,
|
||||
pageSize: 99,
|
||||
}).then(({ data }) => {
|
||||
this.$set(
|
||||
this.searchBarFormConfig[0],
|
||||
'selectOptions',
|
||||
data.map((item) => ({
|
||||
(data?.list || []).map((item) => ({
|
||||
name: item.name,
|
||||
id: item.id,
|
||||
}))
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-11-28 10:03:20
|
||||
* @LastEditTime: 2023-12-08 13:59:20
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -11,11 +11,11 @@
|
||||
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
|
||||
</small-title>
|
||||
<div class="content">
|
||||
<div class="visual-part">
|
||||
<!-- <div class="visual-part"> -->
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
|
||||
label-width="100px" label-position="top">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备名称" prop="equipmentId">
|
||||
<el-select v-model="dataForm.equipmentId" filterable :disabled="isdetail" style="width: 100%"
|
||||
@change="getCode" placeholder="请选择设备名称">
|
||||
@ -23,44 +23,39 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备编码" prop="equipmentCode">
|
||||
<el-input v-model="dataForm.equipmentCode" clearable :disabled="isdetail" placeholder="请输入设备编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备Bom编码" prop="code">
|
||||
<el-input v-model="dataForm.code" clearable :disabled="isdetail" placeholder="请输入设备Bom编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备物料BOM名称" prop="name">
|
||||
<el-input v-model="dataForm.name" clearable :disabled="isdetail" placeholder="请输入设备物料BOM名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="当前状态" prop="enabled">
|
||||
<el-switch v-model="dataForm.enabled" :active-value="1" :inactive-value="0" />
|
||||
<el-select v-model="dataForm.enabled" filterable :disabled="isdetail" style="width: 100%"
|
||||
placeholder="请选择当前状态">
|
||||
<el-option v-for="dict in enableList" :key=" dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div v-if="!isdetail" class="drawer-body__footer">
|
||||
<el-button style="" @click="goback()">取消</el-button>
|
||||
<el-button v-if="isdetail" type="primary" @click="goEdit()">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</div>
|
||||
|
||||
<!-- </div> -->
|
||||
<div class="attr-list" v-if="idAttrShow">
|
||||
<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
|
||||
设备物料明细
|
||||
@ -80,14 +75,12 @@
|
||||
</base-table>
|
||||
<pagination v-show="listQuery.total > 0" :total="listQuery.total" :page.sync="listQuery.pageNo"
|
||||
:limit.sync="listQuery.pageSize" :page-sizes="[5, 10, 15]" @pagination="getList" />
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button type="primary" @click="goback()">关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="goback()">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</div>
|
||||
<attr-add v-if="addOrUpdateVisible" ref="addOrUpdate" :product-id="dataForm.id" @refreshDataList="getList" />
|
||||
</el-drawer>
|
||||
</template>
|
||||
@ -200,6 +193,29 @@ export default {
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
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.idAttrShow = true;
|
||||
this.dataForm.id = res.data
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
});
|
||||
},
|
||||
getCode(val) {
|
||||
this.equipmentList.forEach((ele) => {
|
||||
if (val === ele.id) {
|
||||
@ -232,8 +248,8 @@ export default {
|
||||
this.$confirm(
|
||||
`确定对${
|
||||
raw.data.materialName
|
||||
? '[物料名称为' + raw.data.materialName + ']'
|
||||
: '[序号为' + raw.data.materialName + ']'
|
||||
? '[物料名为' + raw.data.materialName + ']'
|
||||
: '[序号为' + raw.data.id + ']'
|
||||
}进行删除操作?`,
|
||||
'提示',
|
||||
{
|
||||
@ -374,7 +390,7 @@ export default {
|
||||
}
|
||||
.action_btn {
|
||||
float: right;
|
||||
margin: 5px 15px;
|
||||
margin: -40px 15px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.add {
|
||||
|
@ -1,13 +1,8 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
<<<<<<< HEAD
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-11-28 10:09:20
|
||||
=======
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-27 16:37:17
|
||||
>>>>>>> projects/mes-test
|
||||
* @LastEditTime: 2023-12-14 14:03:27
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -16,11 +11,11 @@
|
||||
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
|
||||
</small-title>
|
||||
<div class="content">
|
||||
<div class="visual-part">
|
||||
<!-- <div class="visual-part"> -->
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
|
||||
label-width="100px" label-position="top">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备名称" prop="equipmentId">
|
||||
<el-select v-model="dataForm.equipmentId" filterable :disabled="isdetail" style="width: 100%"
|
||||
@change="getCode" placeholder="请选择设备名称">
|
||||
@ -28,43 +23,44 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备编码" prop="equipmentCode">
|
||||
<el-input v-model="dataForm.equipmentCode" clearable :disabled="isdetail" placeholder="请输入设备编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="参数Bom编码" prop="code">
|
||||
<el-input v-model="dataForm.code" clearable :disabled="isdetail" placeholder="请输入参数Bom编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备参数BOM名称" prop="name">
|
||||
<el-input v-model="dataForm.name" clearable :disabled="isdetail" placeholder="请输入设备参数BOM名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="当前状态" prop="enabled">
|
||||
<el-switch v-model="dataForm.enabled" :active-value="1" :inactive-value="0" />
|
||||
<!-- <el-switch v-model="dataForm.enabled" :active-value="1" :inactive-value="0" /> -->
|
||||
<el-select v-model="dataForm.enabled" filterable :disabled="isdetail" style="width: 100%"
|
||||
placeholder="请选择当前状态">
|
||||
<el-option v-for="dict in enableList" :key=" dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
</div>
|
||||
<div v-if="!isdetail" class="drawer-body__footer">
|
||||
<el-button style="" @click="goback()">取消</el-button>
|
||||
<el-button v-if="isdetail" type="primary" @click="goEdit()">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
<!-- <div v-if="!isdetail" class="drawer-body__footer">
|
||||
|
||||
</div> -->
|
||||
|
||||
<div class="attr-list" v-if="idAttrShow">
|
||||
<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
|
||||
@ -85,14 +81,12 @@
|
||||
</base-table>
|
||||
<pagination v-show="listQuery.total > 0" :total="listQuery.total" :page.sync="listQuery.pageNo"
|
||||
:limit.sync="listQuery.pageSize" :page-sizes="[5, 10, 15]" @pagination="getList" />
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button type="primary" @click="goback()">关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div v-if="!isdetail" class="drawer-body__footer">
|
||||
<el-button style="" @click="goback()">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</div>
|
||||
<attr-add v-if="addOrUpdateVisible" ref="addOrUpdate" :product-id="dataForm.id" @refreshDataList="getList" />
|
||||
</el-drawer>
|
||||
</template>
|
||||
@ -173,7 +167,17 @@ export default {
|
||||
tableBtn,
|
||||
tableProps,
|
||||
topBtnConfig,
|
||||
addOrUpdateVisible: false,
|
||||
addOrUpdateVisible: false,
|
||||
enableList: [
|
||||
{
|
||||
id: 0,
|
||||
name: '停用'
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
name:'启用'
|
||||
}
|
||||
],
|
||||
urlOptions: {
|
||||
isGetCode: false,
|
||||
// codeURL: getCode,
|
||||
@ -248,8 +252,8 @@ export default {
|
||||
this.$confirm(
|
||||
`确定对${
|
||||
raw.data.valueName
|
||||
? '[物料名称为' + raw.data.valueName + ']'
|
||||
: '[序号为' + raw.data.valueName + ']'
|
||||
? '[参数名为' + raw.data.valueName + ']'
|
||||
: '[序号为' + raw.data.id + ']'
|
||||
}进行删除操作?`,
|
||||
'提示',
|
||||
{
|
||||
@ -274,7 +278,30 @@ export default {
|
||||
} else {
|
||||
this.addNew(raw.data.id);
|
||||
}
|
||||
},
|
||||
},
|
||||
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.idAttrShow = true;
|
||||
this.dataForm.id = res.data
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
});
|
||||
},
|
||||
getList() {
|
||||
// 获取产品属性列表
|
||||
processEquValueBomDetPage({
|
||||
@ -389,12 +416,13 @@ export default {
|
||||
justify-content: flex-end;
|
||||
padding: 18px;
|
||||
}
|
||||
.action_btn {
|
||||
float: right;
|
||||
margin: 5px 15px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.add {
|
||||
color: #0b58ff;
|
||||
}
|
||||
.action_btn {
|
||||
float: right;
|
||||
margin: -40px 15px;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-11-08 15:30:27
|
||||
* @LastEditTime: 2023-11-28 10:11:40
|
||||
* @LastEditTime: 2023-12-04 15:19:33
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -15,36 +15,40 @@
|
||||
</slot>
|
||||
</template>
|
||||
|
||||
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px"
|
||||
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px" label-position="top"
|
||||
@keyup.enter.native="dataFormSubmit()">
|
||||
<el-form-item label="参数名称" prop="paramId">
|
||||
<el-select v-model="dataForm.paramId" filterable placeholder="参数名称" @change="getData" multiple >
|
||||
<el-option v-for="dict in materialList" :key=" dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="参数编码" prop="code">
|
||||
<el-input v-model="dataForm.code" placeholder="请输入参数编码" clearable />
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="标准最小值" prop="standardMinValue">
|
||||
<el-input v-model="dataForm.standardMinValue" placeholder="请输入标准最小值" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="标准最大值" prop="standardMaxValue">
|
||||
<el-input v-model="dataForm.standardMaxValue" placeholder="请输入标准最大值" clearable />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="工艺最小值" prop="minValue">
|
||||
<el-input v-model="dataForm.minValue" placeholder="请输入工艺最小值" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="工艺最大值" prop="maxValue">
|
||||
<el-input v-model="dataForm.maxValue" placeholder="请输入工艺最大值" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="工艺标准值" prop="defaultValue">
|
||||
<el-input v-model="dataForm.defaultValue" placeholder="请输入工艺标准值" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="请输入备注" clearable />
|
||||
</el-form-item>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="参数名称" prop="paramId">
|
||||
<el-select v-model="dataForm.paramId" filterable placeholder="参数名称" @change="getData" multiple>
|
||||
<el-option v-for="dict in materialList" :key=" dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="工艺最小值" prop="minValue">
|
||||
<el-input v-model="dataForm.minValue" placeholder="请输入工艺最小值" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="工艺最大值" prop="maxValue">
|
||||
<el-input v-model="dataForm.maxValue" placeholder="请输入工艺最大值" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="工艺标准值" prop="defaultValue">
|
||||
<el-input v-model="dataForm.defaultValue" placeholder="请输入工艺标准值" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" placeholder="请输入备注" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<el-row style="text-align: right">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
|
@ -290,7 +290,6 @@ export default {
|
||||
break;
|
||||
case '2': // 能源
|
||||
this.$router.push({
|
||||
// path: '/energy/monitoring/energy-report-search?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime
|
||||
path: '/energy/base/energy-quantity-realtime?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime
|
||||
})
|
||||
break;
|
||||
|
@ -6,7 +6,7 @@
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-form ref="form" :model="dataForm" label-width="120px" v-loading="formLoading">
|
||||
<el-form ref="dataForm" :model="dataForm" label-width="120px" v-loading="formLoading" label-position="top">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产线" prop="productionLineId"
|
||||
@ -24,8 +24,22 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="检测内容" prop="inspectionDetIdList"
|
||||
:rules="[{ required: true, message: '不能为空', trigger: 'change' }]">
|
||||
<div class="itemDet" v-for="item in inspectionDetList" :key="item.typeId" style="padding: 0 20px;">
|
||||
<div>{{ item.typeName}} </div>
|
||||
<!-- <div>{{ item.data }} </div> -->
|
||||
<div class="content">
|
||||
<el-checkbox-group v-model="dataForm.inspectionDetIdList" @change="handleCheckedCitiesChange">
|
||||
<el-checkbox v-for="i in item.data" :key="i.content" :label="i.detId">{{ i.content }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="按钮盒识别码" prop="buttonId" :rules="[
|
||||
{ required: true, message: '不能为空', trigger: 'blur' },
|
||||
{
|
||||
@ -37,70 +51,7 @@
|
||||
]">
|
||||
<el-input v-model="dataForm.buttonId" @change="$emit('update', dataForm)" placeholder="请输入整数" />
|
||||
</el-form-item>
|
||||
<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-col>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="按钮值" prop="keyValue" :rules="[
|
||||
{ required: true, message: '不能为空', trigger: 'blur' },
|
||||
@ -121,34 +72,43 @@
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="检测内容" prop="inspectionDetId">
|
||||
<el-select v-model="dataForm.inspectionDetId" placeholder="请选择检测内容" filterable
|
||||
<el-form-item label="检测内容" prop="inspectionDetContent"
|
||||
:rules="[{ required: true, message: '不能为空', trigger: 'change' }]">
|
||||
<el-select v-model="dataForm.inspectionDetContent" placeholder="请选择检测内容" filterable
|
||||
@change="$emit('update', dataForm)">
|
||||
<el-option v-for="opt in inspectionDetList" :key="opt.value" :label="opt.label" :value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from '../../mixins/basic-add';
|
||||
import {
|
||||
createQualityInspectionBoxBtn,
|
||||
updateQualityInspectionBoxBtn,
|
||||
getQualityInspectionBoxBtn,
|
||||
getListByLineSection
|
||||
} from '@/api/base/qualityInspectionBoxBtn';
|
||||
export default {
|
||||
name: 'DialogForm',
|
||||
model: {
|
||||
prop: 'dataForm',
|
||||
event: 'update',
|
||||
},
|
||||
emits: ['update'],
|
||||
components: {},
|
||||
props: {
|
||||
dataForm: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
return {
|
||||
urlOptions: {
|
||||
// isGetCode: false,
|
||||
// codeURL: getCode,
|
||||
createURL: createQualityInspectionBoxBtn,
|
||||
updateURL: updateQualityInspectionBoxBtn,
|
||||
infoURL: getQualityInspectionBoxBtn,
|
||||
},
|
||||
dataForm: {
|
||||
// id: null,
|
||||
sectionId: null,
|
||||
productionLineId: null,
|
||||
inspectionDetIdList:[],
|
||||
},
|
||||
formLoading: true,
|
||||
productionLineList: [],
|
||||
inspectionDetList:[],
|
||||
@ -158,6 +118,7 @@ export default {
|
||||
mounted() {
|
||||
this.getProductionLineList()
|
||||
this.getQualityInspectionDetList()
|
||||
// this.getList()
|
||||
// this.getWorksectionList();
|
||||
// this.getCode('/base/equipment-group-alarm/getCode').then((code) => {
|
||||
// this.formLoading = false;
|
||||
@ -170,13 +131,56 @@ export default {
|
||||
watch: {
|
||||
'dataForm.productionId': {
|
||||
handler(id) {
|
||||
if (id != null) this.getWorksectionList(id);
|
||||
if (id != null) this.getWorksectionList(id)
|
||||
},
|
||||
immediate: true,
|
||||
immediate: true
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
/** 模拟透传 ref */
|
||||
methods: {
|
||||
init(obj) {
|
||||
// console.log(productionLineId);
|
||||
console.log(obj);
|
||||
this.visible = true;
|
||||
// if(obj.id)
|
||||
this.dataForm.id = obj.id ? obj.id : ""
|
||||
this.$nextTick(() => {
|
||||
this.$refs["dataForm"].resetFields()
|
||||
if (obj) {
|
||||
getListByLineSection({
|
||||
productionLineId: obj.productionLineId,
|
||||
sectionId: obj.sectionId,
|
||||
}).then((res) => {
|
||||
console.log(res);
|
||||
this.dataForm.inspectionDetIdList = res.data
|
||||
})
|
||||
}
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.infoURL(obj.id).then(response => {
|
||||
this.dataForm.id = response.data.id
|
||||
this.dataForm.productionLineId = response.data.productionLineId
|
||||
this.dataForm.sectionId = response.data.sectionId
|
||||
// if (this.setData) {
|
||||
// this.setDataForm()
|
||||
// }
|
||||
});
|
||||
} else {
|
||||
// if (this.urlOptions.isGetCode) {
|
||||
// this.getCode()
|
||||
// }
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 模拟透传 ref */
|
||||
handleCheckedCitiesChange(value) {
|
||||
;console.log(value);
|
||||
// let checkedCount = value.length;
|
||||
// this.checkAll = checkedCount === this.cities.length;
|
||||
// this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length;
|
||||
},
|
||||
// getList() {
|
||||
// console.log(this.dataForm.sectionId);
|
||||
|
||||
// },
|
||||
validate(cb) {
|
||||
return this.$refs.form.validate(cb);
|
||||
},
|
||||
@ -200,14 +204,34 @@ export default {
|
||||
async getQualityInspectionDetList() {
|
||||
this.formLoading = true;
|
||||
const res = await this.$axios({
|
||||
url: '/base/quality-inspection-det/listAll',
|
||||
url: '/base/quality-inspection-det/inspectionMap',
|
||||
method: 'get',
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.inspectionDetList = res.data.map((item) => ({
|
||||
label: item.content,
|
||||
value: item.id,
|
||||
}));
|
||||
console.log(res)
|
||||
let arr = []
|
||||
for (let i in res.data) {
|
||||
let obj = {
|
||||
typeName: res.data[i].length !== 0 ? res.data[i][0].typeName : '',
|
||||
typeId: res.data[i].length !== 0 ? res.data[i][0].typeId : '',
|
||||
data:[]
|
||||
}
|
||||
let detArr = []
|
||||
res.data[i].forEach(ele => {
|
||||
detArr.push({
|
||||
detId: ele.id,
|
||||
content: ele.content
|
||||
})
|
||||
})
|
||||
obj.data = detArr
|
||||
arr.push(obj)
|
||||
}
|
||||
this.inspectionDetList = arr
|
||||
console.log(this.inspectionDetList);
|
||||
// this.inspectionDetList = res.data.map((item) => ({
|
||||
// label: item.content,
|
||||
// value: item.content,
|
||||
// }));
|
||||
}
|
||||
this.formLoading = false;
|
||||
},
|
||||
|
@ -1,47 +1,24 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="search-bar"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="buttonClick" />
|
||||
|
||||
<!-- 列表 -->
|
||||
<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"
|
||||
fixed="right"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
<!-- 列表 -->
|
||||
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="tableData">
|
||||
<method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" fixed="right" :method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
<!-- 分页组件 -->
|
||||
<pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<base-dialog
|
||||
:dialogTitle="title"
|
||||
:dialogVisible="open"
|
||||
width="50%"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="addOrUpdateVisible" width="50%" @cancel="handleCancel"
|
||||
@confirm="handleConfirm" :before-close="handleCancel">
|
||||
<add-or-update ref="addOrUpdate" @refreshDataList="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -53,84 +30,21 @@ import {
|
||||
getQualityInspectionBoxBtnPage,
|
||||
exportQualityInspectionBoxBtnExcel,
|
||||
} from '@/api/base/qualityInspectionBoxBtn';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import basicPage from '../../mixins/basic-page';
|
||||
import moment from 'moment';
|
||||
import DialogForm from './dialogForm.vue';
|
||||
import addOrUpdate from './dialogForm.vue';
|
||||
|
||||
export default {
|
||||
name: 'QualityInspectionBoxBtn',
|
||||
mixins: [basicPageMixin],
|
||||
components: { DialogForm },
|
||||
mixins: [basicPage],
|
||||
components: { addOrUpdate },
|
||||
data() {
|
||||
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,
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getQualityInspectionBoxBtnPage,
|
||||
deleteURL: deleteQualityInspectionBoxBtn,
|
||||
// exportURL: exportFactoryExcel,
|
||||
},
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
@ -170,15 +84,17 @@ export default {
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
].filter((v) => v),
|
||||
tableData: [],
|
||||
|
||||
tableProps: [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
fixed: true,
|
||||
width: 180,
|
||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
},
|
||||
// {
|
||||
// prop: 'createTime',
|
||||
// label: '添加时间',
|
||||
// fixed: true,
|
||||
// width: 180,
|
||||
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
// },
|
||||
{
|
||||
prop: 'productionLineName',
|
||||
label: '产线',
|
||||
@ -190,39 +106,22 @@ export default {
|
||||
{
|
||||
prop: 'inspectionDetContent',
|
||||
label: '检测内容',
|
||||
},
|
||||
{
|
||||
width: 160,
|
||||
prop: 'buttonId',
|
||||
label: '按钮盒识别码',
|
||||
},
|
||||
// {
|
||||
// width: 256,
|
||||
// prop: 'productionId',
|
||||
// label: '按钮盒所在产线ID',
|
||||
// ,
|
||||
// },
|
||||
// {
|
||||
// width: 256,
|
||||
// prop: 'sectionId',
|
||||
// label: '按钮盒所在工段ID',
|
||||
// ,
|
||||
// },
|
||||
{ width: 90, prop: 'keyValue', label: '按钮值' },
|
||||
{ width: 128, prop: 'model', label: '按钮盒模式' },
|
||||
}
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
listQuery: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
inspectionDetContent: null,
|
||||
},
|
||||
// 搜索框需要的 keys, 与上面 queryParams 的除 pageNo, pageSize 之外的 key 一一对应
|
||||
},
|
||||
addOrUpdateVisible: false,
|
||||
addOrEditTitle:'',
|
||||
// 搜索框需要的 keys, 与上面 listQuery 的除 pageNo, pageSize 之外的 key 一一对应
|
||||
searchBarKeys: ['inspectionDetContent'],
|
||||
form: {
|
||||
id: null,
|
||||
buttonId: null,
|
||||
inspectionDetId: null,
|
||||
inspectionDetContent: [],
|
||||
productionLineId: null,
|
||||
sectionId: null,
|
||||
model: null,
|
||||
@ -231,19 +130,19 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
// this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
getQualityInspectionBoxBtnPage(this.queryParams).then((response) => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// getList() {
|
||||
// this.loading = true;
|
||||
// // 执行查询
|
||||
// getQualityInspectionBoxBtnPage(this.listQuery).then((response) => {
|
||||
// this.list = response.data.list;
|
||||
// this.total = response.data.total;
|
||||
// this.loading = false;
|
||||
// });
|
||||
// },
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
@ -256,78 +155,28 @@ export default {
|
||||
keyValue: null,
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = '添加安灯按钮16键对应';
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id;
|
||||
getQualityInspectionBoxBtn(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = '修改安灯按钮16键对应';
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
updateQualityInspectionBoxBtn(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createQualityInspectionBoxBtn(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal
|
||||
.confirm('是否确认删除"' + row.sectionName + '"?')
|
||||
.then(function () {
|
||||
return deleteQualityInspectionBoxBtn(id);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.queryParams };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal
|
||||
.confirm('是否确认导出所有安灯按钮16键对应数据项?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportQualityInspectionBoxBtnExcel(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '安灯按钮16键对应.xls');
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.inspectionDetContent = val.inspectionDetContent ? val.inspectionDetContent : undefined;
|
||||
// this.listQuery.teamId = val.teamId ? val.teamId : undefined;
|
||||
this.getDataList()
|
||||
break;
|
||||
case 'add':
|
||||
this.addOrEditTitle = '新增';
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle();
|
||||
break;
|
||||
case 'export':
|
||||
this.handleExport();
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
100
src/views/quality/base/mixins/basic-add.js
Normal file
100
src/views/quality/base/mixins/basic-add.js
Normal file
@ -0,0 +1,100 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2022-08-24 11:19:43
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-12-13 15:57:27
|
||||
* @Description:
|
||||
*/
|
||||
export default {
|
||||
data() {
|
||||
/* eslint-disable */
|
||||
return {
|
||||
urlOptions: {
|
||||
createURL: '',
|
||||
updateURL: '',
|
||||
infoURL: '',
|
||||
codeURL: '',
|
||||
getOption: false,
|
||||
isGetCode: false,
|
||||
optionArrUrl: [],
|
||||
optionArr: {}
|
||||
},
|
||||
visible: false,
|
||||
setData: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
activated() {
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.dataForm.id = id || "";
|
||||
this.visible = true;
|
||||
if (this.urlOptions.getOption) {
|
||||
this.getArr()
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs["dataForm"].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.infoURL(id).then(response => {
|
||||
this.dataForm = response.data
|
||||
if (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(() => {
|
||||
});
|
||||
});
|
||||
},
|
||||
// 表单提交
|
||||
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() {
|
||||
this.$refs.dataForm.resetFields()
|
||||
}
|
||||
}
|
||||
}
|
168
src/views/quality/base/mixins/basic-page.js
Normal file
168
src/views/quality/base/mixins/basic-page.js
Normal file
@ -0,0 +1,168 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2022-08-24 11:19:43
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-12-13 16:19:04
|
||||
* @Description:
|
||||
*/
|
||||
export default {
|
||||
data() {
|
||||
/* eslint-disable */
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: '',
|
||||
deleteURL: '',
|
||||
statusUrl: '',
|
||||
exportURL: ''
|
||||
},
|
||||
tableData: [],
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
total: 1,
|
||||
},
|
||||
exportLoading: false,
|
||||
dataListLoading: false,
|
||||
addOrEditTitle: '',
|
||||
addOrUpdateVisible: false,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
mounted() {
|
||||
this.getDataList()
|
||||
},
|
||||
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;
|
||||
});
|
||||
},
|
||||
// 每页数
|
||||
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);
|
||||
});
|
||||
} else if (val.type === "delete") {
|
||||
this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex)
|
||||
} else if (val.type === "change") {
|
||||
this.changeStatus(val.data.id)
|
||||
} else {
|
||||
this.otherMethods(val)
|
||||
}
|
||||
},
|
||||
// 删除
|
||||
deleteHandle(id, name, index) {
|
||||
this.$confirm(`确定对${name ? '[名称=' + name + ']' : '[序号=' + index + ']'}进行删除操作?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.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.addOrUpdate.formClear()
|
||||
this.addOrUpdateVisible = false
|
||||
this.addOrEditTitle = ''
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$refs.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(() => { });
|
||||
}
|
||||
}
|
||||
}
|
69
src/views/quality/base/mixins/code-filter.js
Normal file
69
src/views/quality/base/mixins/code-filter.js
Normal file
@ -0,0 +1,69 @@
|
||||
|
||||
/*
|
||||
* @Date: 2020-12-29 16:49:28
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-09-12 11:13:34
|
||||
* @FilePath: \basic-admin\src\filters\basicData\index.js
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
const table = {
|
||||
lineStatus: {
|
||||
1: '生产中',
|
||||
2: '停止',
|
||||
3: '未知',
|
||||
},
|
||||
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]
|
||||
}
|
||||
}
|
65
src/views/quality/base/qualityHotMaterial/SmallTitle.vue
Normal file
65
src/views/quality/base/qualityHotMaterial/SmallTitle.vue
Normal file
@ -0,0 +1,65 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-11-07 19:28:13
|
||||
* @LastEditTime: 2023-11-08 14:11:43
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div :class="[className, { 'p-0': noPadding }]">
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
size: {
|
||||
// 取值范围: xl lg md sm
|
||||
type: String,
|
||||
default: 'de',
|
||||
validator: function (val) {
|
||||
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
|
||||
},
|
||||
},
|
||||
noPadding: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
className: function () {
|
||||
return `${this.size}-title`;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
|
||||
$mgr: 8px;
|
||||
@each $size, $height in $pxls {
|
||||
.#{$size}-title {
|
||||
font-size: 18px;
|
||||
line-height: $height;
|
||||
color: #000;
|
||||
font-weight: 500;
|
||||
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: 4px;
|
||||
height: $height + 2px;
|
||||
border-radius: 1px;
|
||||
margin-right: $mgr;
|
||||
background-color: #0b58ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.p-0 {
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
375
src/views/quality/base/qualityHotMaterial/add-or-updata.vue
Normal file
375
src/views/quality/base/qualityHotMaterial/add-or-updata.vue
Normal file
@ -0,0 +1,375 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-08 13:46:17
|
||||
* @LastEditTime: 2023-12-08 16:09:13
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="false" class="drawer" size="50%">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
|
||||
</small-title>
|
||||
<div class="content">
|
||||
<!-- <div class="visual-part"> -->
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
|
||||
label-width="100px" label-position="top">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商" prop="supplierId">
|
||||
<el-select v-model="dataForm.supplierId" filterable :disabled="isdetail" style="width: 100%"
|
||||
placeholder="请选择供应商">
|
||||
<el-option v-for="dict in supplierList" :key=" dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="原料" prop="materialId">
|
||||
<el-select v-model="dataForm.materialId" filterable :disabled="isdetail" style="width: 100%"
|
||||
@change="getData" placeholder="请选择原料">
|
||||
<el-option v-for="dict in materialList" :key=" dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="样品编码" prop="sampleCode">
|
||||
<el-input v-model="dataForm.sampleCode" clearable :disabled="isdetail" placeholder="请输入样品编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="取样人" prop="samplerId">
|
||||
<el-select v-model="dataForm.samplerId" filterable :disabled="isdetail" style="width: 100%"
|
||||
placeholder="请选择取样人">
|
||||
<el-option v-for="dict in workerList" :key=" dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="检测人" prop="checkerId">
|
||||
<el-select v-model="dataForm.checkerId" filterable :disabled="isdetail" style="width: 100%"
|
||||
placeholder="请选择检测人">
|
||||
<el-option v-for="dict in workerList" :key=" dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="检测时间" prop="checkTime">
|
||||
<el-date-picker v-model="dataForm.checkTime" type="datetime" placeholder="选择检测时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<!-- </div> -->
|
||||
<div class="attr-list" v-if="idAttrShow">
|
||||
<!-- <small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
|
||||
设备物料明细
|
||||
</small-title>
|
||||
|
||||
<div v-if="!isdetail" class="action_btn">
|
||||
<template>
|
||||
<span style="display: inline-block;">
|
||||
<el-button type="text" @click="addNew()" icon="el-icon-plus">新增</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</div>
|
||||
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
|
||||
:table-data="productAttrList">
|
||||
<method-btn v-if="!isdetail" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<pagination v-show="listQuery.total > 0" :total="listQuery.total" :page.sync="listQuery.pageNo"
|
||||
:limit.sync="listQuery.pageSize" :page-sizes="[5, 10, 15]" @pagination="getList" /> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="goback()">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</div>
|
||||
<!-- <attr-add v-if="addOrUpdateVisible" ref="addOrUpdate" :product-id="dataForm.id" @refreshDataList="getList" /> -->
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import basicAdd from '../../core/mixins/basic-add';
|
||||
import {
|
||||
getQualityHotMaterial,
|
||||
updateQualityHotMaterial,
|
||||
createQualityHotMaterial,
|
||||
getHotMaterialAllList,
|
||||
getSupplierList,
|
||||
getWorkerList,
|
||||
getMaterialCheckList
|
||||
} from '@/api/base/qualityHotMaterial';
|
||||
import SmallTitle from './SmallTitle';
|
||||
// import { parseTime } from '../../core/mixins/code-filter';
|
||||
// import attrAdd from './attr-add';
|
||||
// import {DICT_TYPE, getDictDatas} from "@/utils/dict";
|
||||
// import { publicFormatter } from '@/utils/dict';
|
||||
const topBtnConfig = [
|
||||
{
|
||||
type: 'add',
|
||||
btnName: 'btn.add'
|
||||
}
|
||||
]
|
||||
|
||||
export default {
|
||||
// mixins: [basicAdd],
|
||||
components: { SmallTitle },
|
||||
data() {
|
||||
return {
|
||||
// tableBtn,
|
||||
// tableProps,
|
||||
// topBtnConfig,
|
||||
addOrUpdateVisible: false,
|
||||
urlOptions: {
|
||||
isGetCode: false,
|
||||
// codeURL: getCode,
|
||||
createURL: createQualityHotMaterial,
|
||||
updateURL: updateQualityHotMaterial,
|
||||
infoURL: getQualityHotMaterial,
|
||||
},
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
total: 0,
|
||||
},
|
||||
materialList: [],
|
||||
workerList: [],
|
||||
supplierList:[],
|
||||
equipmentList:[],
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
materialId:null,
|
||||
supplierId: null,
|
||||
sampleCode: null,
|
||||
samplerId: null,
|
||||
checkerId: null,
|
||||
checkTime: null,
|
||||
appearance: null,
|
||||
checkResult: null,
|
||||
materialGrade: null,
|
||||
},
|
||||
productAttrList: [],
|
||||
visible: false,
|
||||
isdetail: false,
|
||||
idAttrShow: false,
|
||||
dataRule: {
|
||||
// code: [{ required: true, message: "设备物料编码不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "设备物料名称不能为空", trigger: "blur" }],
|
||||
equipmentId: [{ required: true, message: "设备名称不能为空", trigger: "change" }],
|
||||
// : [{ required: true, message: "产品类型不能为空", trigger: "change" }],
|
||||
// processTime: [{ required: true, message: "产线生产单位用时不能为空", trigger: "blur" }]
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
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.idAttrShow = true;
|
||||
this.dataForm.id = res.data
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
});
|
||||
},
|
||||
getData(val) {
|
||||
console.log(val);
|
||||
getMaterialCheckList({
|
||||
materialId:val
|
||||
}).then((res) => {
|
||||
console.log(res);
|
||||
})
|
||||
},
|
||||
// clickTopBtn(val) {
|
||||
// if (val === 'add') {
|
||||
// this.addNew()
|
||||
// }
|
||||
// },
|
||||
initData() {
|
||||
this.productAttrList.splice(0);
|
||||
this.listQuery.total = 0;
|
||||
},
|
||||
getDict() {
|
||||
getHotMaterialAllList().then((res) => {
|
||||
this.materialList = res.data
|
||||
})
|
||||
getWorkerList().then((res) => {
|
||||
this.workerList = res.data
|
||||
})
|
||||
getSupplierList().then(res => {
|
||||
this.supplierList = res.data
|
||||
})
|
||||
},
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(
|
||||
`确定对${
|
||||
raw.data.materialName
|
||||
? '[物料名称为' + raw.data.materialName + ']'
|
||||
: '[序号为' + raw.data.materialName + ']'
|
||||
}进行删除操作?`,
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
deleteProcessEquMaterialBomDet(raw.data.id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
} else {
|
||||
this.addNew(raw.data.id);
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
// 获取产品属性列表
|
||||
processEquMaterialBomDetPage({
|
||||
...this.listQuery,
|
||||
bomId: this.dataForm.id,
|
||||
}).then((response) => {
|
||||
this.productAttrList = response.data.list;
|
||||
this.listQuery.total = response.data.total;
|
||||
});
|
||||
},
|
||||
init(id, isdetail) {
|
||||
this.initData()
|
||||
this.getDict()
|
||||
this.isdetail = isdetail || false;
|
||||
this.dataForm.id = id || undefined;
|
||||
this.visible = true;
|
||||
if (id) {
|
||||
this.idAttrShow = true
|
||||
} else {
|
||||
this.idAttrShow = false
|
||||
}
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
|
||||
if (this.dataForm.id) {
|
||||
// 获取产品详情
|
||||
this.urlOptions.infoURL({
|
||||
bomId: id,
|
||||
pageNo: 1,
|
||||
pageSize:10
|
||||
}).then(response => {
|
||||
this.dataForm = response.data
|
||||
this.dataForm.unit = String(this.dataForm.unit)
|
||||
this.dataForm.materialType = String(this.dataForm.materialType)
|
||||
this.dataForm.productType = String(this.dataForm.productType)
|
||||
});
|
||||
// 获取产品属性列表
|
||||
this.getList();
|
||||
} else {
|
||||
if (this.urlOptions.isGetCode) {
|
||||
this.getCode()
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
goback() {
|
||||
this.$emit('refreshDataList');
|
||||
this.visible = false;
|
||||
// this.initData();
|
||||
},
|
||||
goEdit() {
|
||||
this.isdetail = false;
|
||||
},
|
||||
// 新增 / 修改
|
||||
addNew(id) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id,this.dataForm.id);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.drawer >>> .el-drawer {
|
||||
border-radius: 8px 0 0 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.drawer >>> .el-form-item__label {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.drawer >>> .el-drawer__header {
|
||||
margin: 0;
|
||||
padding: 32px 32px 24px;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
}
|
||||
.drawer >>> .el-drawer__body {
|
||||
flex: 1;
|
||||
height: 1px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.drawer >>> .content {
|
||||
padding: 30px 24px;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/* height: 100%; */
|
||||
}
|
||||
|
||||
.drawer >>> .visual-part {
|
||||
flex: 1 auto;
|
||||
max-height: 76vh;
|
||||
overflow: hidden;
|
||||
overflow-y: scroll;
|
||||
padding-right: 10px; /* 调整滚动条样式 */
|
||||
}
|
||||
|
||||
.drawer >>> .el-form,
|
||||
.drawer >>> .attr-list {
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
.drawer-body__footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 18px;
|
||||
}
|
||||
.action_btn {
|
||||
float: right;
|
||||
margin: -40px 15px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.add {
|
||||
color: #0b58ff;
|
||||
}
|
||||
</style>
|
182
src/views/quality/base/qualityHotMaterial/index.vue
Normal file
182
src/views/quality/base/qualityHotMaterial/index.vue
Normal file
@ -0,0 +1,182 @@
|
||||
<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="30%"> -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" />
|
||||
<!-- </base-dialog> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
import basicPage from '../../../core/mixins/basic-page';
|
||||
import { parseTime } from '../../../core/mixins/code-filter';
|
||||
import {
|
||||
getQualityHotMaterialPage,
|
||||
deleteQualityHotMaterial,
|
||||
getHotMaterialAllList
|
||||
} from '@/api/base/qualityHotMaterial';
|
||||
// import { getList, } from "@/api/base/qualityScrapType";
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
filter: parseTime
|
||||
},
|
||||
{
|
||||
prop: 'supplierName',
|
||||
label: '供应商'
|
||||
},
|
||||
{
|
||||
prop: 'materialName',
|
||||
label: '原料'
|
||||
},
|
||||
{
|
||||
prop: 'sampleCode',
|
||||
label: '样品编号'
|
||||
},
|
||||
{
|
||||
prop: 'samplerName',
|
||||
label: '取样人'
|
||||
},
|
||||
{
|
||||
prop: 'appearance',
|
||||
label: '是否合格'
|
||||
},
|
||||
{
|
||||
prop: 'materialGrade',
|
||||
label: '原料等级'
|
||||
},
|
||||
{
|
||||
prop: 'checkerName',
|
||||
label: '检测人员'
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getQualityHotMaterialPage,
|
||||
deleteURL: deleteQualityHotMaterial,
|
||||
// exportURL: exportFactoryExcel,
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`base:quality-inspection-det:update`)
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:quality-inspection-det:delete`)
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v)=>v),
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
// {
|
||||
// type: 'input',
|
||||
// label: '报废原因',
|
||||
// placeholder: '报废原因',
|
||||
// param: 'content',
|
||||
// },
|
||||
{
|
||||
type: 'select',
|
||||
label: '原料名称',
|
||||
selectOptions: [],
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
param: 'materialId',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:quality-scrap-det:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
created() { },
|
||||
mounted () {
|
||||
this.getDict();
|
||||
},
|
||||
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;
|
||||
});
|
||||
},
|
||||
async getDict() {
|
||||
// 物料列表
|
||||
const res = await getHotMaterialAllList();
|
||||
this.formConfig[0].selectOptions = res.data;
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.content = val.content ? val.content : undefined;
|
||||
this.listQuery.typeId = val.typeId ? val.typeId : 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>
|
@ -15,7 +15,7 @@
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<base-dialog :dialogTitle="title" :dialogVisible="open" width="40%" @close="cancel" @cancel="cancel"
|
||||
<base-dialog :dialogTitle="title" :dialogVisible="open" width="30%" @close="cancel" @cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<DialogForm v-if="open" ref="form" v-model="form" :rows="[
|
||||
[
|
||||
|
270
src/views/quality/base/qualityIsra/dialogForm.vue
Normal file
270
src/views/quality/base/qualityIsra/dialogForm.vue
Normal file
@ -0,0 +1,270 @@
|
||||
<!--
|
||||
filename: dialogForm.vue
|
||||
author: liubin
|
||||
date: 2023-09-11 15:55:13
|
||||
description: DialogForm for qualityInspectionRecord only
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="innerDataForm"
|
||||
label-width="100px"
|
||||
v-loading="formLoading">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="检测内容"
|
||||
prop="inspectionDetId"
|
||||
:rules="[{ required: true, message: '检测内容不能为空', trigger: 'blur' }]">
|
||||
<el-select
|
||||
v-model="innerDataForm.inspectionDetId"
|
||||
placeholder="请选择检测内容"
|
||||
filterable
|
||||
clearable
|
||||
@change="handleInspectionDetChange">
|
||||
<el-option
|
||||
v-for="opt in inspectionDetList"
|
||||
: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="source"
|
||||
:rules="[{ required: true, message: '来源不能为空', trigger: 'blur' }]">
|
||||
<el-select
|
||||
v-model="innerDataForm.source"
|
||||
placeholder="请选择来源"
|
||||
filterable
|
||||
clearable
|
||||
@change="$emit('update', innerDataForm)">
|
||||
<el-option
|
||||
v-for="opt in [
|
||||
{ label: '手动', value: 1 },
|
||||
{ label: '自动', value: 2 },
|
||||
]"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="产线"
|
||||
prop="productionLineId"
|
||||
:rules="[{ required: true, message: '产线不能为空', trigger: 'blur' }]">
|
||||
<el-select
|
||||
v-model="innerDataForm.productionLineId"
|
||||
placeholder="请选择产线"
|
||||
filterable
|
||||
clearable
|
||||
@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="innerDataForm.sectionId"
|
||||
placeholder="请选择工段"
|
||||
clearable
|
||||
filterable
|
||||
@change="$emit('update', innerDataForm)">
|
||||
<el-option
|
||||
v-for="opt in sectionList"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="检测人员" prop="checkPerson">
|
||||
<el-input
|
||||
v-model="innerDataForm.checkPerson"
|
||||
clearable
|
||||
@change="$emit('update', innerDataForm)"
|
||||
placeholder="请输入检测人员" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="检测时间"
|
||||
prop="checkTime"
|
||||
:rules="[{ required: true, message: '检测时间不能为空', trigger: 'blur' }]">
|
||||
<el-date-picker
|
||||
v-model="innerDataForm.checkTime"
|
||||
type="datetime"
|
||||
placeholder="请选择检测时间"
|
||||
value-format="timestamp"
|
||||
@change="$emit('update', innerDataForm)"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col>
|
||||
<el-form-item label="描述" prop="explainText">
|
||||
<el-input
|
||||
v-model="innerDataForm.explainText"
|
||||
placeholder="请输入描述信息"
|
||||
@change="$emit('update', innerDataForm)"
|
||||
type="textarea"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="innerDataForm.remark"
|
||||
@change="$emit('update', innerDataForm)"
|
||||
placeholder="请输入备注"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'DialogForm',
|
||||
model: {
|
||||
prop: 'dataForm',
|
||||
event: 'update',
|
||||
},
|
||||
emits: ['update'],
|
||||
components: {},
|
||||
props: {
|
||||
dataForm: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formLoading: true,
|
||||
inspectionDetList: [],
|
||||
productionLineList: [],
|
||||
sectionList: [],
|
||||
innerDataForm: {},
|
||||
cacheInspectionDetList: null,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
Promise.all([this.getProductLineList(), this.getInspectionDetList()]).then(
|
||||
() => {
|
||||
this.formLoading = false;
|
||||
}
|
||||
);
|
||||
},
|
||||
watch: {
|
||||
// 'innerDataForm.productionLineId': {
|
||||
// handler: async function (plId) {
|
||||
// if (plId) await this.getWorksectionList(plId);
|
||||
// },
|
||||
// immediate: true,
|
||||
// },
|
||||
dataForm: {
|
||||
handler: function (dataForm) {
|
||||
this.innerDataForm = Object.assign({}, dataForm);
|
||||
|
||||
if (dataForm.productionLineId)
|
||||
this.getWorksectionList(dataForm.productionLineId);
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
/** 模拟透传 ref */
|
||||
validate(cb) {
|
||||
return this.$refs.form.validate(cb);
|
||||
},
|
||||
resetFields(args) {
|
||||
return this.$refs.form.resetFields(args);
|
||||
},
|
||||
|
||||
handleInspectionDetChange(value) {
|
||||
const { id, content } = this.cacheInspectionDetList.find(
|
||||
(item) => item.id == value
|
||||
);
|
||||
this.innerDataForm.inspectionDetId = id;
|
||||
this.innerDataForm.inspectionDetContent = content;
|
||||
this.$emit('update', this.innerDataForm);
|
||||
},
|
||||
|
||||
async handleProductlineChange(id) {
|
||||
// await this.getWorksectionList(id);
|
||||
this.innerDataForm.sectionId = null;
|
||||
this.$emit('update', this.innerDataForm);
|
||||
},
|
||||
|
||||
// getCode
|
||||
async getCode(url) {
|
||||
const response = await this.$axios(url);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// 获取产线列表
|
||||
async getProductLineList() {
|
||||
const response = await this.$axios('/base/core-production-line/listAll');
|
||||
this.productionLineList = response.data.map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
},
|
||||
|
||||
// 获取检测内容列表
|
||||
async getInspectionDetList() {
|
||||
const response = await this.$axios(
|
||||
'/base/quality-inspection-det/listAll'
|
||||
);
|
||||
this.cacheInspectionDetList = response.data;
|
||||
this.inspectionDetList = response.data.map((item) => ({
|
||||
label: item.content,
|
||||
value: item.id,
|
||||
}));
|
||||
},
|
||||
|
||||
// 获取工段列表
|
||||
async getWorksectionList(plId) {
|
||||
const response = await this.$axios(
|
||||
'/base/workshop-section/listByParentId',
|
||||
{
|
||||
params: {
|
||||
id: plId,
|
||||
},
|
||||
}
|
||||
);
|
||||
this.sectionList = response.data.map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.el-date-editor,
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
494
src/views/quality/base/qualityIsra/index.vue
Normal file
494
src/views/quality/base/qualityIsra/index.vue
Normal file
@ -0,0 +1,494 @@
|
||||
<template>
|
||||
<div class="status-timegraph-container" style="background: #f2f4f9; flex: 1; display: flex; flex-direction: column">
|
||||
<el-row class="" style="
|
||||
margin-bottom: 12px;
|
||||
background: #fff;
|
||||
padding: 16px 16px 0;
|
||||
border-radius: 8px;
|
||||
">
|
||||
<!-- <div class="blue-title">生产节拍时序图</div> -->
|
||||
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" />
|
||||
|
||||
<!-- 列表 -->
|
||||
<base-table :table-props="tableProps" :page="1" :limit="10" :table-data="list">
|
||||
</base-table>
|
||||
</el-row>
|
||||
|
||||
<el-row class="" style="
|
||||
height: 1px;
|
||||
flex: 1;
|
||||
margin-bottom: 12px;
|
||||
background: #fff;
|
||||
padding: 16px 16px 32px;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<div class="blue-title">
|
||||
<!-- <span > -->
|
||||
图表时间维度
|
||||
<!-- </span> -->
|
||||
<el-tabs style="margin-top: 10px;" v-model="activeName" type="card" @tab-click="handleClick">
|
||||
<el-tab-pane label="天" name="day">
|
||||
<div id="mapDayMain" style="height: 500px;width: 1000px;"></div>
|
||||
<div id="listDayMain" style="height: 500px;width: 1000px;"></div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="周" name="week">
|
||||
<div id="mapWeekMain" style="height: 500px;width: 1000px;"></div>
|
||||
<div id="listWeekMain" style="height: 500px;width: 1000px;"></div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="月" name="month">
|
||||
<div id="mapMonthMain" style="height: 500px;width: 1000px;"></div>
|
||||
<div id="listMonthMain" style="height: 500px;width: 1000px;"></div>
|
||||
</el-tab-pane>
|
||||
<!-- <el-tab-pane label="定时任务补偿" name="fourth">定时任务补偿</el-tab-pane> -->
|
||||
</el-tabs>
|
||||
</div>
|
||||
</el-col>
|
||||
<!-- <el-col :span="18" class="legend-row">
|
||||
<div class="legend">
|
||||
<div class="icon running"></div>
|
||||
<div>运行中</div>
|
||||
</div>
|
||||
<div class="legend">
|
||||
<div class="icon fault"></div>
|
||||
<div>故障</div>
|
||||
</div>
|
||||
<div class="legend">
|
||||
<div class="icon stop"></div>
|
||||
<div>计划停机</div>
|
||||
</div>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
<!-- <div class="main-area" style="flex: 1; display: flex; flex-direction: column">
|
||||
<div class="graphs" v-show="graphList.length" id="status-chart" style="height: 1px; flex: 1"></div>
|
||||
<h2 v-if="!graphList || graphList.length == 0" class="no-data-bg"></h2>
|
||||
</div> -->
|
||||
</el-row>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getQualityIsraPage,
|
||||
getQualityIsraDayMap,
|
||||
getQualityIsraWeekMap,
|
||||
getQualityIsraMonthMap,
|
||||
getQualityIsraDayList,
|
||||
getQualityIsraWeekList,
|
||||
getQualityIsraMonthList,
|
||||
} from '@/api/monitoring/qualityIsra';
|
||||
// import Editor from '@/components/Editor';
|
||||
import moment from 'moment';
|
||||
// import DialogForm from './dialogForm.vue';
|
||||
import * as echarts from 'echarts';
|
||||
|
||||
// import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
export default {
|
||||
name: 'statisticalData',
|
||||
// components: {
|
||||
// DialogForm,
|
||||
// },
|
||||
// mixins: [basicPageMixin],
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
dynamicProps: [],
|
||||
activeName: 'day',
|
||||
dayMapUrl: '/base/quality-isra-statistics/dayMap',
|
||||
weekMapUrl: '/base/quality-isra-statistics/weekMap',
|
||||
monthMapUrl: '/base/quality-isra-statistics/monthMap',
|
||||
dayListUrl: '/base/quality-isra-statistics/dayList',
|
||||
weekListUrl: '/base/quality-isra-statistics/weekList',
|
||||
monthListUrl: '/base/quality-isra-statistics/monthList',
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '缺陷类型',
|
||||
placeholder: '请选择缺陷类型',
|
||||
param: 'checkType',
|
||||
selectOptions: [],
|
||||
labelField: 'name',
|
||||
valueField: 'name',
|
||||
defaultSelect: []
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间段',
|
||||
dateType: 'daterange', // datetimerange
|
||||
// format: 'yyyy-MM-dd HH:mm:ss',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始日期',
|
||||
endPlaceholder: '结束日期',
|
||||
defaultTime: ['00:00:00', '23:59:59'],
|
||||
param: 'checkTime',
|
||||
// width: 350,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
checkType:undefined,
|
||||
// productionId: undefined,
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
// productionLineId: null,
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// this.getProductLineList();
|
||||
},
|
||||
computed: {
|
||||
tableProps() {
|
||||
return [
|
||||
{
|
||||
// width: 128,
|
||||
prop: 'checkType',
|
||||
label: '缺陷类型',
|
||||
},
|
||||
{
|
||||
// width: 128,
|
||||
prop: 'sumNum',
|
||||
label: '缺陷总数',
|
||||
},
|
||||
...this.dynamicProps,
|
||||
];
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
// if (this.$route.query.woIdString) {
|
||||
// console.log(this.$route.query.woIdString)
|
||||
// this.queryParams.workOrderIdList = this.$route.query.woIdString.split(',')
|
||||
// // this.queryParams.workOrderIdList = [this.$route.query.woIdString]
|
||||
// // let arr =[]
|
||||
// this.searchBarFormConfig[0].defaultSelect = this.$route.query.woIdString.split(',')
|
||||
// console.log(this.searchBarFormConfig[0].defaultSelect);
|
||||
// }
|
||||
// if (this.$route.params.startTime && this.$route.params.endTime) {
|
||||
// this.searchBarFormConfig[0].defaultSelect = [
|
||||
// this.$route.params.startTime,
|
||||
// this.$route.params.endTime,
|
||||
// ];
|
||||
// this.queryParams.param = {};
|
||||
// this.$set(
|
||||
// this.queryParams.param,
|
||||
// 'startTime',
|
||||
// this.$route.params.startTime
|
||||
// );
|
||||
// this.$set(this.queryParams.param, 'endTime', this.$route.params.endTime);
|
||||
// } else {
|
||||
// this.searchBarFormConfig[0].defaultSelect = [];
|
||||
// }
|
||||
this.getList()
|
||||
this.getData()
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
handleClick() {
|
||||
this.getData()
|
||||
},
|
||||
getData() {
|
||||
this.$axios({
|
||||
url: this.activeName === 'day' ? this.dayMapUrl : this.activeName === 'week' ? this.weekMapUrl : this.monthMapUrl,
|
||||
method: 'get',
|
||||
params: this.queryParams
|
||||
}).then((res) => {
|
||||
let mapArr= []
|
||||
let mapLegendData = []
|
||||
// let mapXAxisData = []
|
||||
for (let i in res.data) {
|
||||
let obj = {
|
||||
name: '',
|
||||
type: 'line',
|
||||
// stack: 'Total',
|
||||
data: [],
|
||||
mapXAxisData:[],
|
||||
}
|
||||
// console.log(i)
|
||||
let dataArr = []
|
||||
res.data[i].forEach(ele => {
|
||||
dataArr.push(ele.num)
|
||||
obj.mapXAxisData.push(ele.checkTime)
|
||||
})
|
||||
obj.name = i
|
||||
obj.data = dataArr
|
||||
mapLegendData.push(i)
|
||||
mapArr.push(obj)
|
||||
}
|
||||
// console.log(res.data[res]);
|
||||
var chartDom = this.activeName === 'day' ? document.getElementById('mapDayMain') : this.activeName === 'week' ? document.getElementById('mapWeekMain') : document.getElementById('mapMonthMain')
|
||||
var myChart = echarts.init(chartDom);
|
||||
var option;
|
||||
option = {
|
||||
title: {
|
||||
text: '各类型缺陷对比图'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
legend: {
|
||||
data: mapLegendData
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
// toolbox: {
|
||||
// feature: {
|
||||
// saveAsImage: {}
|
||||
// }
|
||||
// },
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
// boundaryGap: false,
|
||||
data: mapArr[0].mapXAxisData
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
series: mapArr
|
||||
}
|
||||
option && myChart.setOption(option);
|
||||
})
|
||||
this.$axios({
|
||||
url: this.activeName === 'day' ? this.dayListUrl : this.activeName === 'week' ? this.weekListUrl : this.monthListUrl,
|
||||
method: 'get',
|
||||
params: this.queryParams
|
||||
}).then((res) => {
|
||||
// console.log(res);
|
||||
let listNumArr = []
|
||||
let listRatioArr = []
|
||||
// let listLegendData = []
|
||||
let listXAxisData = []
|
||||
// for (let i in res.data) {
|
||||
// console.log(i)
|
||||
// let dataArr = []
|
||||
res.data.forEach(ele => {;
|
||||
listNumArr.push(ele.num)
|
||||
listRatioArr.push(ele.ratio)
|
||||
listXAxisData.push(ele.checkTime)
|
||||
})
|
||||
console.log(listNumArr);
|
||||
// obj.name = i
|
||||
// obj.data = dataArr
|
||||
// listLegendData.push(i)
|
||||
// listArr.push(obj)
|
||||
// }
|
||||
// console.log(res.data[res]);
|
||||
var chartDom = this.activeName === 'day' ? document.getElementById('listDayMain') : this.activeName === 'week' ? document.getElementById('listWeekMain') : document.getElementById('listMonthMain')
|
||||
var myChart = echarts.init(chartDom);
|
||||
var option;
|
||||
option = {
|
||||
title: {
|
||||
text: '缺陷率趋势图'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
legend: {
|
||||
data: ['缺陷数量', '缺陷率']
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
// toolbox: {
|
||||
// feature: {
|
||||
// saveAsImage: {}
|
||||
// }
|
||||
// },
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
// boundaryGap: false,
|
||||
data: listXAxisData
|
||||
},
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
name: '缺陷数量',
|
||||
// min: 0,
|
||||
// max: 250,
|
||||
// interval: 50,
|
||||
// axisLabel: {
|
||||
// formatter: '{value} ml'
|
||||
// }
|
||||
},
|
||||
{
|
||||
type: 'value',
|
||||
name: '缺陷率',
|
||||
// min: 0,
|
||||
// max: 25,
|
||||
// interval: 5,
|
||||
axisLabel: {
|
||||
formatter: '{value} %'
|
||||
}
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '缺陷数量',
|
||||
type: 'bar',
|
||||
barWidth: '3%',
|
||||
data: listNumArr,
|
||||
label: {
|
||||
show: true, //开启显示
|
||||
position: 'top', //在上方显示
|
||||
// formatter: '{c}%',//显示百分号
|
||||
textStyle: { //数值样式
|
||||
color: 'black',//字体颜色
|
||||
fontSize: 20//字体大小
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '缺陷率',
|
||||
type: 'line',
|
||||
yAxisIndex: 1,
|
||||
tooltip: {
|
||||
valueFormatter: function (value) {
|
||||
return value + '%';
|
||||
}
|
||||
},
|
||||
data: listRatioArr
|
||||
}
|
||||
]
|
||||
}
|
||||
option && myChart.setOption(option);
|
||||
})
|
||||
},
|
||||
/** 获取搜索栏的产线列表 */
|
||||
async getDict() {
|
||||
// const res = await getProductList()
|
||||
// const result = await getWorkOrderList()
|
||||
const res = await this.$axios({
|
||||
url: '/base/quality-isra-standards/page',
|
||||
method: 'get',
|
||||
params: {
|
||||
pageSize: 100,
|
||||
pageNo:1
|
||||
}
|
||||
});
|
||||
console.log(res)
|
||||
this.searchBarFormConfig[0].selectOptions = res.data.list
|
||||
// this.searchBarFormConfig[1].selectOptions = res.data.map((item) => {
|
||||
// return {
|
||||
// name: item.name,
|
||||
// id:item.id
|
||||
// }
|
||||
// })
|
||||
// this.searchBarFormConfig[0].selectOptions = result.data.map((item) => {
|
||||
// return {
|
||||
// name: item.name,
|
||||
// id: item.id
|
||||
// }
|
||||
// })
|
||||
},
|
||||
// getProductLineList() {
|
||||
// this.$axios('/base/production-line/listAll').then((response) => {
|
||||
// this.searchBarFormConfig[0].selectOptions = response.data.map(
|
||||
// (item) => {
|
||||
// return {
|
||||
// name: item.name,
|
||||
// id: item.id,
|
||||
// };
|
||||
// }
|
||||
// );
|
||||
// });
|
||||
// },
|
||||
getList() {
|
||||
this.getDataList()
|
||||
},
|
||||
/** 查询列表 */
|
||||
async getDataList() {
|
||||
console.log(this.queryParams);
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
const {
|
||||
data: { data, otherList, otherMap, nameData },
|
||||
} = await getQualityIsraPage(this.queryParams)
|
||||
console.log(this.queryParams);
|
||||
this.dynamicProps = this.filterNameData(nameData)
|
||||
this.list = this.filterData(data);
|
||||
},
|
||||
filterNameData(nameData) {
|
||||
const ndSet = new Set();
|
||||
nameData.forEach((nd) => {
|
||||
ndSet.add(nd.name);
|
||||
});
|
||||
return Array.from(ndSet.values())
|
||||
.sort()
|
||||
.map((name) => ({
|
||||
prop: name,
|
||||
label: name,
|
||||
}));
|
||||
},
|
||||
filterData(data) {
|
||||
return data.map((item) => {
|
||||
const { data: innerData } = item;
|
||||
const keyValuePairs = {};
|
||||
innerData.map((d) => {
|
||||
keyValuePairs[d.dynamicName] = d.dynamicValue;
|
||||
});
|
||||
return {
|
||||
// inspectionContent: item.inspectionContent,
|
||||
...keyValuePairs,
|
||||
sumNum: item.sumNum,
|
||||
// sumInput: item.sumInput,
|
||||
// productionName: item.productionName,
|
||||
checkType: item.checkType,
|
||||
// scrapRatio: item.scrapRatio,
|
||||
};
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
handleSearchBarBtnClick(val) {
|
||||
if (val.btnName === 'search') {
|
||||
this.queryParams.checkType = val.checkType ? val.checkType : undefined
|
||||
// this.queryParams.productionId = val.productionId ? val.productionId : undefined
|
||||
this.queryParams.startTime = val.checkTime ? val.checkTime[0] : undefined
|
||||
this.queryParams.endTime = val.checkTime ? val.checkTime[1] : undefined
|
||||
|
||||
this.getList()
|
||||
}
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.blue-title {
|
||||
position: relative;
|
||||
padding: 4px 0;
|
||||
padding-left: 12px;
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
font-weight: 700;
|
||||
margin-bottom: 12px;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 6px;
|
||||
height: 16px;
|
||||
width: 4px;
|
||||
border-radius: 1px;
|
||||
background: #0b58ff;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,12 +1,12 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-11-06 15:15:30
|
||||
* @LastEditTime: 2023-11-07 19:38:13
|
||||
* @LastEditTime: 2023-12-01 10:58:25
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-dialog :visible.sync="dialogVisible" width="50%" :before-close="handleClose">
|
||||
<el-dialog :visible.sync="visible" width="50%">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
{{ '详情' }}
|
||||
</small-title>
|
||||
@ -118,7 +118,7 @@ export default {
|
||||
name: '自动',
|
||||
}
|
||||
],
|
||||
dialogVisible:false,
|
||||
visible:false,
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
logTime: undefined,
|
||||
@ -144,79 +144,79 @@ export default {
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
// this.getDict()
|
||||
this.getDict()
|
||||
console.log('我看看', this.dataForm)
|
||||
this.getCurrentTime()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.dialogVisible = true
|
||||
},
|
||||
// init() {
|
||||
// this.dialogVisible = true
|
||||
// },
|
||||
getCurrentTime() {
|
||||
// new Date().Format("yyyy-MM-dd HH:mm:ss")
|
||||
this.dataForm.logTime = new Date()
|
||||
// this.dataForm.logTime = year + "-" + month + "-" + day;
|
||||
console.log(this.dataForm.logTime);
|
||||
},
|
||||
// async getDict() {
|
||||
// // 物料列表
|
||||
// const res = await getList()
|
||||
// this.typeList = res.data
|
||||
// getWorkOrderList().then((res) => {
|
||||
// console.log(res);
|
||||
// // console.log(response);
|
||||
// this.workOrderList = res.data.map((item) => {
|
||||
// return {
|
||||
// name: item.name,
|
||||
// id: item.id
|
||||
// }
|
||||
// })
|
||||
// // console.log(this.formConfig[0].selectOptions);
|
||||
// // this.listQuery.total = response.data.total;
|
||||
// })
|
||||
// getLineList().then((res) => {
|
||||
// console.log(res);
|
||||
// // console.log(response);
|
||||
// this.lineList = res.data.map((item) => {
|
||||
// return {
|
||||
// name: item.name,
|
||||
// id: item.id
|
||||
// }
|
||||
// })
|
||||
// // console.log(this.formConfig[0].selectOptions);
|
||||
// // this.listQuery.total = response.data.total;
|
||||
// })
|
||||
// getDetList().then((res) => {
|
||||
// console.log(res);
|
||||
// // console.log(response);
|
||||
// this.workOrderList = res.data.map((item) => {
|
||||
// return {
|
||||
// name: item.name,
|
||||
// id: item.id
|
||||
// }
|
||||
// })
|
||||
// // console.log(this.formConfig[0].selectOptions);
|
||||
// // this.listQuery.total = response.data.total;
|
||||
// })
|
||||
// getTeamList().then((res) => {
|
||||
// console.log(res);
|
||||
// // console.log(response);
|
||||
// this.teamList = res.data.map((item) => {
|
||||
// return {
|
||||
// name: item.name,
|
||||
// id: item.id
|
||||
// }
|
||||
// })
|
||||
// // console.log(this.formConfig[0].selectOptions);
|
||||
// // this.listQuery.total = response.data.total;
|
||||
// })
|
||||
// },
|
||||
// setMaterialCode() {
|
||||
// const chooseM = this.materialList.filter(item => {
|
||||
// return item.id === this.dataForm.materialId
|
||||
// })
|
||||
// this.dataForm.materialCode = chooseM[0].code
|
||||
// }
|
||||
async getDict() {
|
||||
// 物料列表
|
||||
const res = await getList()
|
||||
this.typeList = res.data
|
||||
getWorkOrderList().then((res) => {
|
||||
console.log(res);
|
||||
// console.log(response);
|
||||
this.workOrderList = res.data.map((item) => {
|
||||
return {
|
||||
name: item.name,
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
// console.log(this.formConfig[0].selectOptions);
|
||||
// this.listQuery.total = response.data.total;
|
||||
})
|
||||
getLineList().then((res) => {
|
||||
console.log(res);
|
||||
// console.log(response);
|
||||
this.lineList = res.data.map((item) => {
|
||||
return {
|
||||
name: item.name,
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
// console.log(this.formConfig[0].selectOptions);
|
||||
// this.listQuery.total = response.data.total;
|
||||
})
|
||||
getDetList().then((res) => {
|
||||
console.log(res);
|
||||
// console.log(response);
|
||||
this.workOrderList = res.data.map((item) => {
|
||||
return {
|
||||
name: item.name,
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
// console.log(this.formConfig[0].selectOptions);
|
||||
// this.listQuery.total = response.data.total;
|
||||
})
|
||||
getTeamList().then((res) => {
|
||||
console.log(res);
|
||||
// console.log(response);
|
||||
this.teamList = res.data.map((item) => {
|
||||
return {
|
||||
name: item.name,
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
// console.log(this.formConfig[0].selectOptions);
|
||||
// this.listQuery.total = response.data.total;
|
||||
})
|
||||
},
|
||||
setMaterialCode() {
|
||||
const chooseM = this.materialList.filter(item => {
|
||||
return item.id === this.dataForm.materialId
|
||||
})
|
||||
this.dataForm.materialCode = chooseM[0].code
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -40,7 +40,7 @@ const tableProps = [
|
||||
label: '工单'
|
||||
},
|
||||
{
|
||||
prop: 'teamId',
|
||||
prop: 'teamName',
|
||||
label: '班组'
|
||||
},
|
||||
{
|
||||
|
@ -1,19 +1,20 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-11-06 15:15:30
|
||||
* @LastEditTime: 2023-11-24 08:42:18
|
||||
* @LastEditTime: 2023-12-01 16:33:41
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
|
||||
label-width="110px">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报废类型编码" prop="code">
|
||||
<el-input v-model="dataForm.code" placeholder="请输入报废类型编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="11">
|
||||
<el-form-item label="报废类型" prop="name">
|
||||
<el-input v-model="dataForm.name" placeholder="请输入报废类型" />
|
||||
</el-form-item>
|
||||
@ -21,12 +22,12 @@
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="描述类型" prop="description">
|
||||
<el-form-item label="描述类型" prop="description" label-width="110px">
|
||||
<el-input v-model="dataForm.description" clearable placeholder="描述类型" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-col :span="11">
|
||||
<el-form-item label="备注" prop="remark" label-width="110px">
|
||||
<el-input v-model="dataForm.remark" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -307,6 +307,10 @@ export default {
|
||||
type: 'category',
|
||||
data: arrXAxis
|
||||
},
|
||||
grid: {
|
||||
left: '5%',
|
||||
top:'2%'
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-01 14:55:51
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-11-24 10:55:54
|
||||
* @LastEditTime: 2023-12-01 16:41:40
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -57,7 +57,8 @@ const tableProps = [
|
||||
},
|
||||
{
|
||||
prop: 'userName',
|
||||
label: '操作人'
|
||||
label: '操作人',
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'source',
|
||||
@ -128,7 +129,7 @@ export default {
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '搜索',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
@ -161,7 +162,8 @@ export default {
|
||||
type: this.$auth.hasPermi('monitoring:materiel-date-from:export') ? 'button' : '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'warning',
|
||||
color: 'primary',
|
||||
plain: true
|
||||
},
|
||||
],
|
||||
};
|
||||
|
252
src/views/quality/monitoring/originalGlassRetrace/index.vue
Normal file
252
src/views/quality/monitoring/originalGlassRetrace/index.vue
Normal file
@ -0,0 +1,252 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-01 14:55:51
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-12-06 14:08:00
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="list">
|
||||
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
|
||||
@clickBtn="handleClick" /> -->
|
||||
</base-table>
|
||||
<pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
|
||||
@pagination="getList" />
|
||||
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import AddOrUpdate from './add-or-updata';
|
||||
// import unitDict from './unitDict';
|
||||
// import basicPage from '../mixins/basic-page';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import { parseTime } from '../mixins/code-filter';
|
||||
import {
|
||||
getOriginalGlassRetrace,
|
||||
getWorkOrderList,
|
||||
// exportEnergyPlcExcel
|
||||
} from '@/api/quality/rawMaterialTraceability';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'workOrderName',
|
||||
label: '工单名称',
|
||||
},
|
||||
{
|
||||
prop: 'palletNumber',
|
||||
label: '托号',
|
||||
},
|
||||
{
|
||||
prop: 'transportQuantity',
|
||||
label: '该托片数',
|
||||
},
|
||||
{
|
||||
prop: 'packagingCode',
|
||||
label: '包装条码',
|
||||
},
|
||||
{
|
||||
prop: '',
|
||||
label: '原片产线',
|
||||
},
|
||||
{
|
||||
prop: 'originalGlassOutputTime',
|
||||
label: '原片下片时间',
|
||||
filter: parseTime
|
||||
},
|
||||
{
|
||||
prop: 'batch',
|
||||
label: '深加工产线',
|
||||
},
|
||||
{
|
||||
prop: 'deepProcessingInputTime',
|
||||
label: '深加工上片时间',
|
||||
filter: parseTime
|
||||
},
|
||||
{
|
||||
prop: 'productionOutputTime',
|
||||
label: '深加工下片时间',
|
||||
filter: parseTime
|
||||
}
|
||||
];
|
||||
|
||||
export default {
|
||||
// mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
// urlOptions: {
|
||||
// getDataListURL: getMaterialUseLogPage,
|
||||
// // deleteURL: deletePackingType,
|
||||
// // exportURL: exportPackingExcel,
|
||||
// },
|
||||
tableProps,
|
||||
// tableBtn: [
|
||||
// this.$auth.hasPermi(`base:packaging-print-log:update`)
|
||||
// ? {
|
||||
// type: 'edit',
|
||||
// btnName: '编辑',
|
||||
// }
|
||||
// : undefined,
|
||||
// this.$auth.hasPermi(`base:packaging-print-log:delete`)
|
||||
// ? {
|
||||
// type: 'delete',
|
||||
// btnName: '删除',
|
||||
// }
|
||||
// : undefined,
|
||||
|
||||
// ].filter((v) => v),
|
||||
list: [],
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
total: 0,
|
||||
workOrderId: undefined,
|
||||
startTime: undefined,
|
||||
endTime:undefined,
|
||||
},
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '工单',
|
||||
selectOptions: [],
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
param: 'workOrderId'
|
||||
},
|
||||
// {
|
||||
// type: 'datePicker',
|
||||
// label: '时间段',
|
||||
// dateType: 'daterange',
|
||||
// format: 'yyyy-MM-dd',
|
||||
// valueFormat: "yyyy-MM-dd",
|
||||
// rangeSeparator: '-',
|
||||
// startPlaceholder: '开始时间',
|
||||
// endPlaceholder: '结束时间',
|
||||
// param: 'timeVal',
|
||||
// defaultSelect: [],
|
||||
// width: 250
|
||||
// },
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
// {
|
||||
// type: 'separate',
|
||||
// },
|
||||
// {
|
||||
// type: 'button',
|
||||
// btnName: '重置',
|
||||
// name: 'reset',
|
||||
// },
|
||||
// {
|
||||
// type: 'separate',
|
||||
// },
|
||||
// {
|
||||
// type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '',
|
||||
// btnName: '新增',
|
||||
// name: 'add',
|
||||
// color: 'success',
|
||||
// plain: true,
|
||||
// },
|
||||
// {
|
||||
// type: 'separate',
|
||||
// type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
|
||||
// },
|
||||
// {
|
||||
// type: this.$auth.hasPermi('monitoring:materiel-date-from:export') ? 'button' : '',
|
||||
// btnName: '导出',
|
||||
// name: 'export',
|
||||
// color: 'warning',
|
||||
// },
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
// AddOrUpdate,
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
getOriginalGlassRetrace({ ...this.listQuery }).then(res => {
|
||||
console.log(res);
|
||||
this.list = res.data || []
|
||||
console.log(this.list);
|
||||
// this.listQuery.total = res.data.total || 0
|
||||
})
|
||||
},
|
||||
getDict() {
|
||||
// 获取产品的属性列表
|
||||
// getCustomerList().then((response) => {
|
||||
// console.log(response);
|
||||
// this.customerList = response.data
|
||||
// // this.listQuery.total = response.data.total;
|
||||
// })
|
||||
// getModelList().then((response) => {
|
||||
// console.log(response);
|
||||
// this.modelList = response.data
|
||||
// // this.listQuery.total = response.data.total;
|
||||
// })
|
||||
getWorkOrderList().then((response) => {
|
||||
// console.log(response);
|
||||
this.formConfig[0].selectOptions = response.data.map((item) => {
|
||||
return {
|
||||
name: item.name,
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
console.log(this.formConfig[0].selectOptions);
|
||||
// this.listQuery.total = response.data.total;
|
||||
})
|
||||
},
|
||||
// handleExport() {
|
||||
// // 处理查询参数
|
||||
// let params = { ...this.listQuery };
|
||||
// params.pageNo = undefined;
|
||||
// params.pageSize = undefined;
|
||||
// this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
||||
// this.exportLoading = true;
|
||||
// return exportEnergyPlcExcel(params);
|
||||
// }).then(response => {
|
||||
// this.$download.excel(response, '物料信息追溯 ');
|
||||
// this.exportLoading = false;
|
||||
// }).catch(() => { });
|
||||
// },
|
||||
buttonClick(val) {
|
||||
console.log(val)
|
||||
if (val.btnName === 'search') {
|
||||
this.listQuery.workOrderId = val.workOrderId ? val.workOrderId :undefined
|
||||
// this.queryParams.status = val.status
|
||||
// if (val.timeVal && val.timeVal.length != 0 ) {
|
||||
// this.listQuery.startTime = val.timeVal[0] + ' 00:00:00'
|
||||
// this.listQuery.endTime = val.timeVal[1] + ' 23:59:59'
|
||||
// } else {
|
||||
// this.listQuery.startTime = undefined
|
||||
// this.listQuery.endTime = undefined
|
||||
// }
|
||||
this.getList()
|
||||
} else {
|
||||
// this.handleExport()
|
||||
// this.addOrEditTitle = '新增'
|
||||
// this.centervisible = true
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.orderAdd.init()
|
||||
// })
|
||||
}
|
||||
},
|
||||
otherMethods(val) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle = '详情';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data.id, true);
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-01 14:55:51
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-11-28 10:51:44
|
||||
* @LastEditTime: 2023-12-01 16:43:10
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -134,7 +134,7 @@ export default {
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '搜索',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
|
@ -124,7 +124,8 @@ export default {
|
||||
// immediate: true,
|
||||
// },
|
||||
dataForm: {
|
||||
handler: function (dataForm) {
|
||||
handler: function (dataForm) {
|
||||
console.log(dataForm);
|
||||
this.innerDataForm = Object.assign({}, dataForm);
|
||||
|
||||
if (dataForm.productionLineId)
|
||||
|
@ -66,7 +66,19 @@ export default {
|
||||
mixins: [basicPageMixin],
|
||||
data() {
|
||||
return {
|
||||
rows: [
|
||||
rows: [
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
label: '工单名称',
|
||||
url: 'base/core-work-order/listbyfilter',
|
||||
prop: 'workOrderId',
|
||||
rules: [{ required: true, message: '工单名称不能为空', trigger: 'change' }],
|
||||
bind: {
|
||||
filterable: true,
|
||||
},
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
@ -122,18 +134,7 @@ export default {
|
||||
label: '检测人员',
|
||||
prop: 'checkPerson',
|
||||
},
|
||||
{
|
||||
datetime: true,
|
||||
label: '检测时间',
|
||||
prop: 'checkTime',
|
||||
rules: [{ required: true, message: '检测时间不能为空', trigger: 'blur' }],
|
||||
bind: {
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
'value-format': 'timestamp',
|
||||
// 'value-format': 'yyyy-MM-dd HH:mm:ss',
|
||||
clearable: true,
|
||||
},
|
||||
},
|
||||
|
||||
],
|
||||
[{ textarea: true, label: '描述', prop: 'explainText' }],
|
||||
[{ input: true, label: '备注', prop: 'remark' }],
|
||||
@ -224,7 +225,7 @@ export default {
|
||||
},
|
||||
{
|
||||
// width: 128,
|
||||
prop: 'lineName',
|
||||
prop: 'productionLineName',
|
||||
label: '产线',
|
||||
},
|
||||
{
|
||||
@ -247,9 +248,10 @@ export default {
|
||||
},
|
||||
],
|
||||
// 搜索框需要的 keys, 与上面 queryParams 的除 pageNo, pageSize 之外的 key 一一对应
|
||||
searchBarKeys: ['inspectionDetContent', 'checkTime', 'productionLineId'],
|
||||
searchBarKeys: ['inspectionDetContent', 'checkTime', 'workOrderId'],
|
||||
form: {
|
||||
id: undefined,
|
||||
id: undefined,
|
||||
// workOrderId:undefined,
|
||||
inspectionDetId: undefined,
|
||||
inspectionDetContent: undefined,
|
||||
productionLineId: undefined,
|
||||
@ -354,7 +356,8 @@ export default {
|
||||
inspectionDetContent: undefined,
|
||||
sectionId: undefined,
|
||||
checkPerson: undefined,
|
||||
checkTime: undefined,
|
||||
checkTime: undefined,
|
||||
workOrderId:undefined,
|
||||
source: undefined,
|
||||
explainText: undefined,
|
||||
remark: undefined,
|
||||
@ -383,12 +386,14 @@ export default {
|
||||
this.reset();
|
||||
const id = row.id;
|
||||
getQualityInspectionRecord(id).then((response) => {
|
||||
/** 因为后端返回的时间是时间戳格式,需转换 */
|
||||
/** 因为后端返回的时间是时间戳格式,需转换 */
|
||||
console.log(response.data);
|
||||
const info = {}
|
||||
Object.keys(this.form).forEach(key => {
|
||||
info[key] = response.data[key]
|
||||
});
|
||||
this.form = info;
|
||||
this.form = info;
|
||||
console.log(this.form);
|
||||
this.open = true;
|
||||
this.title = '修改质量检查信息记录表';
|
||||
});
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user