projects/mes-test #133

Merged
gtz217 merged 281 commits from projects/mes-test into projects/mes 2023-11-30 09:11:34 +08:00
96 changed files with 7088 additions and 1279 deletions
Showing only changes of commit ecc84a1c4b - Show all commits

View File

@ -1,7 +1,7 @@
###
# @Author: Do not edit
# @Date: 2023-08-29 09:40:39
# @LastEditTime: 2023-11-14 14:00:11
# @LastEditTime: 2023-11-15 09:09:12
# @LastEditors: zhp
# @Description:
###

Binary file not shown.

View File

@ -1,7 +1,7 @@
/*
* @Author: zhp
* @Date: 2023-09-12 14:07:04
* @LastEditTime: 2023-11-07 14:17:38
* @LastEditTime: 2023-11-10 10:23:43
* @LastEditors: DY
* @Description:
*/
@ -15,9 +15,10 @@ export function getYieldAnalysisPageData(query) {
})
}
// 产线平衡分析
export function getCT(data) {
return request({
url: '/analysis/production-analysis/getCT',
url: '/analysis/equipment-analysis/getCT',
method: 'post',
data: data
})

View File

@ -0,0 +1,27 @@
/*
* @Author: Do not edit
* @Date: 2023-11-10 09:27:39
* @LastEditTime: 2023-11-10 09:30:00
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 获得设备统计分析
export function getEqAnalysis(query) {
return request({
url: '/analysis/equipment-analysis/statistics',
method: 'get',
params: query
})
}
// 导出设备统计分析
export function exportEqAnalysisExcel(query) {
return request({
url: '/analysis/equipment-analysis/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,60 @@
/*
* @Author: Do not edit
* @Date: 2023-11-08 15:56:52
* @LastEditTime: 2023-11-09 17:42:27
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 创建设备报警处理
export function createAlarmHand(data) {
return request({
url: '/base/equipment-alarm-hand/create',
method: 'post',
data: data
})
}
// 更新设备报警处理
export function updateAlarmHand(data) {
return request({
url: '/base/equipment-alarm-hand/update',
method: 'put',
data: data
})
}
// 删除设备报警处理
export function deleteAlarmHand(id) {
return request({
url: '/base/equipment-alarm-hand/delete?id=' + id,
method: 'delete'
})
}
//获得设备报警处理
export function getAlarmHand(id) {
return request({
url: '/base/equipment-alarm-hand/get?id=' + id,
method: 'get'
})
}
// 获得设备报警处理分页
export function getAlarmHandPage(query) {
return request({
url: '/base/equipment-alarm-hand/page',
method: 'get',
params: query
})
}
//获得设备报警记录
export function getAlarmLog(id) {
return request({
url: '/base/equipment-alarm-log/get?id=' + id,
method: 'get'
})
}

View File

@ -0,0 +1,62 @@
/*
* @Author: Do not edit
* @Date: 2023-11-08 15:56:52
* @LastEditTime: 2023-11-11 19:52:54
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 根据设备获得所有巡检内容列表
export function getcheckAllList(query) {
return request({
url: '/base/equipment-check/listAll',
method: 'get',
params: query
})
}
// 创建设备巡检计划记录
export function createCheckLog(data) {
return request({
url: '/base/equipment-check-log/create',
method: 'post',
data: data
})
}
// 更新设备巡检计划记录
export function updateCheckLog(data) {
return request({
url: '/base/equipment-check-log/update',
method: 'put',
data: data
})
}
// 获得设备巡检计划记录
export function getEqCheckLog(id) {
return request({
url: '/base/equipment-check-log/get?id=' + id,
method: 'get'
})
}
// 导出设备巡检计划记录
export function exportCheckLogExcel(query) {
return request({
url: '/base/equipment-check-log/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
// 根据设备获得所有巡检配置列表
export function getcheckConfigByEqList(query) {
return request({
url: '/base/equipment-check-config/list',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,68 @@
/*
* @Author: Do not edit
* @Date: 2023-11-08 15:56:52
* @LastEditTime: 2023-11-10 09:04:50
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 获得设备巡检设置
export function getEqCheck(id) {
return request({
url: '/base/equipment-check-config/get?id=' + id,
method: 'get'
})
}
// 创建巡检项目
export function createCheckDet(data) {
return request({
url: '/base/equipment-check-config-det/create',
method: 'post',
data: data
})
}
// 更新巡检项目
export function updateCheckDet(data) {
return request({
url: '/base/equipment-check-config-det/update',
method: 'put',
data: data
})
}
// 删除巡检项目
export function deleteCheckDet(id) {
return request({
url: '/base/equipment-check-config-det/delete?id=' + id,
method: 'delete'
})
}
//巡检项目
export function getCheckDet(id) {
return request({
url: '/base/equipment-check-config-det/get?id=' + id,
method: 'get'
})
}
// 获得巡检项目分页
export function getCheckDetPage(query) {
return request({
url: '/base/equipment-check-config-det/page',
method: 'get',
params: query
})
}
// 获得x巡检所有列表
export function getcheckList(query) {
return request({
url: '/base/equipment-check/list',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,25 @@
/*
* @Author: Do not edit
* @Date: 2023-11-10 16:09:33
* @LastEditTime: 2023-11-10 16:50:08
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
//获得设备维修
export function getEqRepair(id) {
return request({
url: '/base/equipment-repair-log/get?id=' + id,
method: 'get'
})
}
// 更新设备维修记录
export function updateEqRepair(data) {
return request({
url: '/base/equipment-repair-log/update',
method: 'put',
data: data
})
}

View File

@ -0,0 +1,51 @@
/*
* @Author: Do not edit
* @Date: 2023-11-11 16:18:57
* @LastEditTime: 2023-11-11 17:28:54
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
//获得备品备件配置
export function getSparePartConfig(id) {
return request({
url: '/base/equipment-spare-part-config/get?id=' + id,
method: 'get'
})
}
// 创建设备备品备件配置--抽屉
export function createConfigDet(data) {
return request({
url: '/base/equipment-spare-part-config-det/create',
method: 'post',
data: data
})
}
// 删除设备备品备件配置--抽屉
export function deleteConfigDet(id) {
return request({
url: '/base/equipment-spare-part-config-det/delete?id=' + id,
method: 'delete'
})
}
// 获得抽屉表格分页
export function getConfigDetPage(query) {
return request({
url: '/base/equipment-spare-part-config-det/page',
method: 'get',
params: query
})
}
// 获得备品备件列表
export function getSparePartList(query) {
return request({
url: '/base/equipment-spare-part/list',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,45 @@
/*
* @Author: Do not edit
* @Date: 2023-11-11 16:18:57
* @LastEditTime: 2023-11-11 18:44:51
* @LastEditors: DY
* @Description:
*/
import request from '@/utils/request'
// 获得抽屉表格分页
export function getConfigDetMonitorPage(query) {
return request({
url: '/base/equipment-spare-part-config-det/monitor',
method: 'get',
params: query
})
}
// 创建设备备品备件更换log
export function createSparePartLog(data) {
return request({
url: '/base/equipment-spare-part-log/create',
method: 'post',
data: data
})
}
// 获得设备备品备件更换log分页
export function getSparePartLogPage(query) {
return request({
url: '/base/equipment-spare-part-log/page',
method: 'get',
params: query
})
}
// 导出设备备品备件更换log
export function exportSparePartLogExcel(query) {
return request({
url: '/base/equipment-spare-part-log/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>exit</title>
<g id="7能源管理" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="系统退出" transform="translate(-1783.000000, -56.000000)" fill="#000000" fill-rule="nonzero">
<g id="exit" transform="translate(1783.000000, 56.000000)">
<rect id="矩形" opacity="0" x="0" y="0" width="16" height="16"></rect>
<path d="M12.0719591,1.5140625 C12.3862828,1.52338993 12.6391466,1.78322084 12.6391466,2.1015625 C12.6391466,2.41990416 12.3862828,2.67973507 12.0690068,2.68910609 L3.64375,2.6890625 L3.54375,2.7890625 L3.54375,13.26875 L3.64375,13.36875 L12.0690068,13.3687064 C12.3862828,13.3780774 12.6391466,13.6379083 12.6391466,13.95625 C12.6391466,14.2745917 12.3862828,14.5344226 12.0690068,14.5437936 L3.0890625,14.5437936 C2.69272847,14.5437936 2.36875,14.2197715 2.36875,13.8234375 L2.36875,2.234375 C2.36875,1.83804097 2.69272847,1.5140625 3.0890625,1.5140625 Z M10.8144607,5.05039818 C11.0425957,4.82226311 11.4167793,4.82226311 11.6449143,5.05039818 L14.2074143,7.61289818 C14.4357222,7.84120602 14.4353075,8.21522958 14.2060583,8.44314597 L11.6433518,11.0058518 C11.4152168,11.2339869 11.0410332,11.2339869 10.8128982,11.0058518 C10.5847631,10.7777168 10.5847631,10.4035332 10.8128982,10.1753982 L12.1519607,8.83633568 L12.08125,8.665625 L7.1640625,8.665625 C6.81403169,8.665625 6.5265625,8.37857547 6.5265625,8.028125 C6.5265625,7.67809419 6.81361203,7.390625 7.1640625,7.390625 L12.0828125,7.390625 L12.1535232,7.21991432 L10.8144607,5.88085182 C10.5863256,5.65271675 10.5863256,5.27853325 10.8144607,5.05039818 Z" id="形状结合"></path>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>编组 17</title>
<g id="页面" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.695141">
<g id="最新参考" transform="translate(-1780.000000, -57.000000)" fill="#000000" fill-rule="nonzero">
<g id="编组-4" transform="translate(1772.000000, 48.000000)">
<g id="编组-17" transform="translate(8.000000, 9.000000)">
<rect id="矩形备份-2" opacity="0" x="0" y="0" width="16" height="16"></rect>
<g id="文档" transform="translate(2.436519, 1.472460)">
<path d="M9.61879642,0.990942446 C9.83682412,0.990942446 10.0548518,1.18867806 10.0548518,1.38641367 L10.0548518,11.6686655 C10.0548518,11.8664011 9.83682412,12.0641367 9.61879642,12.0641367 L3.60123204,12.0641367 L1.02850524,9.69130935 L1.02850524,1.38641367 C1.02850524,1.18867806 1.24653294,0.990942446 1.46456063,0.990942446 L9.61879642,0.990942446 M9.61879642,0.2 L1.50816617,0.2 C0.810477546,0.2 0.2,0.753659712 0.2,1.38641367 L0.2,10.0076863 L3.25238773,12.8550791 L9.61879642,12.8550791 C10.316485,12.8550791 10.9269626,12.3014194 10.9269626,11.6686655 L10.9269626,1.38641367 C10.9269626,0.753659712 10.316485,0.2 9.61879642,0.2 Z" id="形状"></path>
<path d="M9.61879642,0 C10.4228194,0 11.1269626,0.638607809 11.1269626,1.38641367 L11.1269626,11.6686655 C11.1269626,12.4164713 10.4228194,13.0550791 9.61879642,13.0550791 L3.25238773,13.0550791 L3.11596256,13.0013261 L0.0635748259,10.1539333 L0,10.0076863 L0,1.38641367 C0,0.638607809 0.704143212,0 1.50816617,0 L9.61879642,0 Z M9.61879642,0.4 L1.50816617,0.4 C0.91681188,0.4 0.4,0.868711615 0.4,1.38641367 L0.4,9.921 L3.331,12.6550791 L9.61879642,12.6550791 C10.1707271,12.6550791 10.657723,12.2467792 10.7202028,11.7714283 L10.7269626,11.6686655 L10.7269626,1.38641367 C10.7269626,0.868711615 10.2101507,0.4 9.61879642,0.4 Z M9.61879642,0.790942446 C9.94315845,0.790942446 10.2548518,1.07362615 10.2548518,1.38641367 L10.2548518,11.6686655 C10.2548518,11.981453 9.94315845,12.2641367 9.61879642,12.2641367 L3.60123204,12.2641367 L3.46563766,12.2111542 L0.892910861,9.83832691 L0.828505241,9.69130935 L0.828505241,1.38641367 C0.828505241,1.07362615 1.1401986,0.790942446 1.46456063,0.790942446 L9.61879642,0.790942446 Z M9.69667678,1.08901006 L1.38668992,1.08901006 C1.27286315,1.08901006 1.14612572,1.20395189 1.14612572,1.28821491 L1.14561083,9.66174324 L3.64342649,11.9659298 L9.69667678,11.9660691 C9.79153243,11.9660691 9.8953538,11.8862484 9.92732605,11.8108781 L9.93724098,11.7668642 L9.93724098,1.28821491 C9.93724098,1.20395189 9.81050356,1.08901006 9.69667678,1.08901006 Z" id="形状"></path>
<path d="M4.54092961,3.67913093 L2.25985278,3.67913093 C2.22052387,3.67913093 2.22052387,3.65291165 2.22052387,3.65291165 L2.22052387,2.91877199 C2.22052387,2.89255271 2.22052387,2.89255271 2.25985278,2.89255271 L4.54092961,2.89255271 C4.58025852,2.89255271 4.58025852,2.89255271 4.58025852,2.91877199 L4.58025852,3.65291165 L4.54092961,3.67913093 Z M8.86710981,5.44893192 L2.25985278,5.44893192 C2.22052387,5.44893192 2.22052387,5.44893192 2.22052387,5.40960301 L2.22052387,4.70168261 C2.22052387,4.6623537 2.22052387,4.6623537 2.25985278,4.6623537 L8.86710981,4.6623537 C8.90643872,4.6623537 8.90643872,4.6623537 8.90643872,4.70168261 L8.90643872,5.40960301 L8.86710981,5.44893192 Z M8.86710981,7.41537746 L2.25985278,7.41537746 C2.22052387,7.41537746 2.22052387,7.41537746 2.22052387,7.37604855 L2.22052387,6.66812815 C2.22052387,6.62879924 2.22052387,6.62879924 2.25985278,6.62879924 L8.86710981,6.62879924 C8.90643872,6.62879924 8.90643872,6.62879924 8.90643872,6.66812815 L8.90643872,7.37604855 L8.86710981,7.41537746 Z" id="形状"></path>
<path d="M8.86710981,6.44841431 C9.00606257,6.44841431 9.08682365,6.5291754 9.08682365,6.66812815 L9.08682365,7.37604855 L9.03399013,7.50359996 L8.99466122,7.54292887 L8.86710981,7.59576239 L2.25985278,7.59576239 C2.12090003,7.59576239 2.04013894,7.51500131 2.04013894,7.37604855 L2.04013894,6.66812815 C2.04013894,6.5291754 2.12090003,6.44841431 2.25985278,6.44841431 L8.86710981,6.44841431 Z M8.72520451,6.80870958 L2.40090881,6.80870958 L2.40090881,7.23441802 L8.72520451,7.23441802 L8.72520451,6.80870958 Z M8.86710981,4.48196877 C9.00606257,4.48196877 9.08682365,4.56272985 9.08682365,4.70168261 L9.08682365,5.40960301 L9.03399013,5.53715441 L8.99466122,5.57648333 L8.86710981,5.62931685 L2.25985278,5.62931685 C2.12090003,5.62931685 2.04013894,5.54855576 2.04013894,5.40960301 L2.04013894,4.70168261 C2.04013894,4.56272985 2.12090003,4.48196877 2.25985278,4.48196877 L8.86710981,4.48196877 Z M8.72520451,4.84251382 L2.40090881,4.84251382 L2.40090881,5.26822226 L8.72520451,5.26822226 L8.72520451,4.84251382 Z M4.54092961,2.71216778 C4.66811215,2.71216778 4.76064346,2.77385532 4.76064346,2.91877199 L4.76064346,3.65291165 L4.68031808,3.80300099 L4.64098917,3.82922026 L4.54092961,3.85951586 L2.25985278,3.85951586 C2.18859958,3.85951586 2.12331983,3.83050264 2.08113204,3.77425225 C2.04130723,3.6964836 2.04130723,3.6964836 2.04013894,3.65291165 L2.04013894,2.91877199 C2.04013894,2.77385532 2.13267025,2.71216778 2.25985278,2.71216778 L4.54092961,2.71216778 Z M4.39957385,3.07293764 L2.40090881,3.07293764 L2.40090881,3.49864608 L4.39957385,3.49864608 L4.39957385,3.07293764 Z" id="形状"></path>
<path d="M3.50158987,12.5394187 L3.50158987,9.83587533 L0.88525753,9.83587533 L0.88525753,8.96376455 L3.93764526,8.96376455 C4.19927849,8.96376455 4.37370065,9.1381867 4.37370065,9.39981994 L4.37370065,12.5394187 L3.50158987,12.5394187 Z" id="路径"></path>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

BIN
src/assets/images/cnbm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

BIN
src/assets/logo/cnbm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -1,10 +1,13 @@
/* ===== PC DESIGN ===== */
$W: 1000;
$W: 1080;
$H: 1920;
$picW: 438;
$picH: 560;
$formW: 320;
// $picW: 438;
// $picH: 560;
$picW: 1080;
$picH: 1118;
$formW: 420;
$tabW: $formW / 2;
// $rowH: 56;
$rowH: 56;
$buttonH: 50;
@ -15,6 +18,7 @@ $containerBgImage: '../assets/images/bg.png';
$logoWidth: 417px;
$logoHeight: 64px;
$logoImage: '../assets/logo/login-logo.png';
$cnbmLogo: '../assets/logo/cnbm.png';
// container-content
$contentWidth: round($W / $H * 100) * 1vw;
$contentHeight: round($picH / $W * 100) / 100 * $contentWidth;
@ -22,7 +26,8 @@ $contentBgColor: #ffffff;
// container-content-pic
$picWidth: round($picW / $H * 100) * 1vw;
$picHeight: inherit;
$picImage: '../assets/images/pic.png';
// $picImage: '../assets/images/pic.png';
$picImage: '../assets/images/login-bg.png';
// container-content-field
$fieldWidth: $contentWidth - $picWidth;
$fieldHeight: inherit;
@ -34,231 +39,309 @@ $buttonHeight: $buttonH * 1px;
// - - - - - 页面基础设置
.container {
.login-code {
width: 33%;
height: 38px;
float: right;
img {
cursor: pointer;
width:100%;max-width:100px; height:auto;
vertical-align: middle;
}
}
// 元素
width: inherit;
height: inherit;
min-width: 1080px;
min-height: 620px;
background-color: $containerBgColor;
background-image: url($containerBgImage);
background-size: cover;
// 定位
position: relative;
display: flex;
justify-content: center;
align-items: center;
// 文字
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: 400;
.logo {
// 元素
width: $logoWidth;
height: $logoHeight;
// background-image: url($logoImage);
// background-size: contain;
// 定位
position: absolute;
top: 50px;
left: 50%;
margin-left: -$logoWidth/2;
}
.content {
// 元素
width: $contentWidth;
height: $contentHeight;
background-color: #ffffff;
box-shadow: 0px 16px 40px rgba(0, 0, 0, 0.07);
border-radius: 20px;
// 定位
position: relative;
.pic {
// 元素
width: $picWidth;
height: $picHeight;
background-image: url($picImage);
background-repeat: no-repeat;
background-size: cover;
border-radius: 20px 0 0 20px;
// 定位
position: absolute;
top: 0;
left: 0;
}
.field {
width: $fieldWidth;
height: $fieldHeight;
// 定位
position: absolute;
top: 0;
left: $picWidth;
display:flex;
justify-content: center;
align-items: center;
.pc-title{ width: 100%; clear: both;}
.mobile-title,
.mobile-switch {
display: none;
}
.form {
box-sizing: border-box;
width: $formWidth;
// - - - tab
:deep(.el-tabs__content) {
padding: 20px 0 0;
}
:deep(.el-tabs__item) {
// 元素
width: $tabWidth;
height: $rowHeight;
padding: 0;
// 文字
line-height: $rowHeight;
color: #666666;
}
:deep(.el-tabs__item.is-active) {
font-weight: bold;
color: #2F53EB;
}
:deep(.el-tabs__active-bar) {
height: 3px;
border-radius: 2px;
}
// - - - input
:deep(.el-input__inner) {
// 元素
width: 100%;
height: $rowHeight;
background: #f5f5f5;
border: 0;
border-radius: 28px;
// 文字
text-align: center;
line-height: 19px;
color: #262626;
}
.code:deep(.el-input__inner) {
padding: 0 24px;
// 文字
text-align: left;
}
:deep(.el-input__inner::-webkit-input-placeholder) { /* WebKit browsers */
font-weight: 400;
color: #8C8C8C;
}
:deep(.el-input__inner:-moz-placeholder) { /* Mozilla Firefox 4 to 18 */
font-weight: 400;
color: #8C8C8C;
}
:deep(.el-input__inner::-moz-placeholder) { /* Mozilla Firefox 19+ */
font-weight: 400;
color: #8C8C8C;
opacity:1;
}
:deep(.el-input__inner:-ms-input-placeholder) { /* Internet Explorer 10+ */
font-weight: 400;
color: #8C8C8C !important;
}
:deep(.el-form-item) {
position: relative;
.button-code {
// 元素
height: $rowHeight;
box-sizing: border-box;
// 定位
position: absolute;
top: 0;
right: 20px;
z-index: 1;
// 文字
line-height: 20px;
font-size: 14px;
font-family: PingFang SC;
font-weight: 400;
color: #2F53EB;
span {
padding-left: 15px;
border-left: 2px solid #D9D9D9;
}
}
}
:deep(.el-form-item__error) {
padding-left: 24px;
}
.button {
width: 100%;
height: $buttonHeight;
background: rgba(24, 144, 255, 0.2);
border: 0;
border-radius: 24px;
margin-bottom: 20px;
// 文字
line-height: 26px;
font-size: 20px;
color: #FFFFFF;
}
.button-active {
background: #2F53EB;
box-shadow: 0px 2px 8px rgba(0, 80, 184, 0.2);
}
}
}
}
.footer {
// 元素
height: 16px;
line-height: 16px;
font-size: 12px;
color: #8c8c8c;
// 定位
position: absolute;
bottom: 30px;
a,
a:hover,
a:active {
color: inherit;
text-decoration: none;
}
}
.login-code {
width: 33%;
height: 38px;
float: right;
img {
cursor: pointer;
width: 100%;
max-width: 100px;
height: auto;
vertical-align: middle;
}
}
// 元素
width: inherit;
height: inherit;
min-width: 1080px;
min-height: 620px;
background-color: $containerBgColor;
// background-image: url($containerBgImage);
background-size: cover;
// 定位
position: relative;
display: flex;
justify-content: center;
align-items: center;
// 文字
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: 400;
.logo {
// 元素
width: $logoWidth;
height: $logoHeight;
// background-image: url($logoImage);
// background-size: contain;
// 定位
position: absolute;
top: 50px;
left: 50%;
margin-left: -$logoWidth/2;
}
.content {
// 元素
// width: $contentWidth;
// height: $contentHeight;
width: 100%;
height: 100%;
background-color: #ffffff;
// box-shadow: 0px 16px 40px rgba(0, 0, 0, 0.07);
// border-radius: 20px;
// 定位
position: relative;
display: flex;
.pic {
// 元素
width: $picWidth;
height: $picHeight;
background-image: url($picImage);
background-repeat: no-repeat;
background-size: 100% 100%;
background-position: 0 0;
position: relative;
&::after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
// background: #f003;
display: inline-block;
}
}
.field {
// background: #ccc3;
position: relative;
padding-top: 196px;
flex: 1;
display: flex;
flex-direction: column;
// justify-content: center;
align-items: center;
.pc-title {
width: 100%;
text-align: center;
clear: both;
position: relative;
top: -36px;
// h3.title {
// position: relative;
// &::before {
// content: '';
// background: url($cnbmLogo) 100% / 100% no-repeat;
// height: 48px;
// width: 48px;
// position: absolute;
// left: 0px;
// top: 4px;
// display: inline-block;
// }
// }
}
.mobile-title,
.mobile-switch {
display: none;
}
.form {
margin-top: 32px;
box-sizing: border-box;
// width: $formWidth;
width: 100%;
// - - - tab
:deep(.el-tabs__nav) {
// background: #f0f3;
}
:deep(.el-tabs__content) {
padding: 20px 0 0;
}
:deep(.el-tabs__item) {
user-select: none;
// 元素
width: $tabWidth;
height: $rowHeight;
padding: 0;
// 文字
line-height: $rowHeight;
color: #666666;
font-size: 18px;
font-weight: 400;
text-align: center;
}
:deep(.el-tabs__item.is-active) {
font-weight: 500;
color: #2f53eb;
}
:deep(.el-tabs__active-bar) {
height: 3px;
border-radius: 2px;
}
// - - - input
:deep(.el-input__inner) {
// 元素
width: 100%;
height: $rowHeight;
background: #f5f5f5;
border: 0;
border-radius: 28px;
// 文字
text-align: center;
line-height: 19px;
color: #262626;
}
.code:deep(.el-input__inner) {
padding: 0 24px;
// 文字
text-align: left;
}
:deep(.el-input__inner::-webkit-input-placeholder) {
/* WebKit browsers */
font-weight: 400;
color: #8c8c8c;
}
:deep(.el-input__inner:-moz-placeholder) {
/* Mozilla Firefox 4 to 18 */
font-weight: 400;
color: #8c8c8c;
}
:deep(.el-input__inner::-moz-placeholder) {
/* Mozilla Firefox 19+ */
font-weight: 400;
color: #8c8c8c;
opacity: 1;
}
:deep(.el-input__inner:-ms-input-placeholder) {
/* Internet Explorer 10+ */
font-weight: 400;
color: #8c8c8c !important;
}
:deep(.el-form-item) {
position: relative;
.button-code {
// 元素
height: $rowHeight;
box-sizing: border-box;
// 定位
position: absolute;
top: 0;
right: 20px;
z-index: 1;
// 文字
line-height: 20px;
font-size: 14px;
font-family: PingFang SC;
font-weight: 400;
color: #2f53eb;
span {
padding-left: 15px;
border-left: 2px solid #d9d9d9;
}
}
}
:deep(.el-form-item__error) {
padding-left: 24px;
}
.button {
width: 100%;
height: $buttonHeight;
background: rgba(24, 144, 255, 0.2);
border: 0;
border-radius: 24px;
margin-bottom: 20px;
// 文字
line-height: 26px;
font-size: 20px;
color: #ffffff;
}
.button-active {
background: #2f53eb;
box-shadow: 0px 2px 8px rgba(0, 80, 184, 0.2);
}
}
}
}
.login-form {
* {
user-select: none;
}
// - - - input
:deep(.el-input__inner) {
// 元素
width: 420px;
height: 66px;
color: #262626;
font-size: 18px;
}
:deep(.el-checkbox__label) {
font-size: 18px;
line-height: 14px;
}
}
.footer {
user-select: none;
// 元素
height: 16px;
line-height: 16px;
font-size: 12px;
color: #8c8c8c;
// 定位
position: absolute;
bottom: 30px;
a,
a:hover,
a:active {
color: inherit;
text-decoration: none;
}
}
}
// - - - - - PC 最小尺寸设置
@media screen and (min-width: 599px) and (max-width: 1366px) {
.container {
.content {
width: 710px;
height: 397px;
.pic {
width: 314px;
}
.field {
width: calc(710px - 314px);
left: 314px;
.form {
width: 320px;
:deep(.el-input__inner) {
width: 320px;
height: 56px;
}
.button {
height: 50px;
}
}
}
}
}
}
.container {
min-width: 599px;
.content {
// width: 710px;
// height: 397px;
width: 100%;
height: 100%;
.pic {
// width: 314px;
display: none;
}
.field {
// width: calc(710px - 314px);
// left: 314px;
// justify-content: center;
width: 100%;
.pc-title {
h3 {
font-size: 2.4rem !important;
}
}
.form {
// width: 320px;
:deep(.el-input__inner) {
width: 320px;
height: 56px;
}
.button {
height: 50px;
}
}
}
}
}
}
/* ===== MOBILE DESIGN ===== */
$mobileW: 375;
@ -273,115 +356,142 @@ $mobileButtonH: 48;
$mobileContainerBgImage: '../assets/images/bg-mobile.png';
// container-content
$mobileContentWidth: round($mobileContentW / $mobileW * 100) * 1vw;
$mobileContentHeight: round($mobileContentH / $mobileW * 100) / 100 * $mobileContentWidth;
$mobileContentHeight: round($mobileContentH / $mobileW * 100) / 100 *
$mobileContentWidth;
// container-content-field-form
$mobileFormWidth: round($mobileFormW / $mobileW *100) * 1vw;
$mobileFormWidth: round($mobileFormW / $mobileW * 100) * 1vw;
$mobileRowHeight: $mobileRowH * 1px;
$mobileButtonHeight: $mobileButtonH * 1px;
$iconBgImage: '../assets/images/icon.png';
// - - - - - 移动端设置
@media screen and (max-width: 599px) {
.container {
// 元素
background-image: url($mobileContainerBgImage);
min-width: 280px;
min-height: 568px;
// 文字
font-size: 17px;
font-family: PingFang SC;
font-weight: bold;
.logo {
display: none;
}
.container {
// 元素
background-image: url($mobileContainerBgImage);
min-width: 280px;
min-height: 568px;
// 文字
font-size: 14px;
font-family: PingFang SC;
font-weight: bold;
.logo {
display: none;
}
.content {
// 元素
width: $mobileContentWidth;
height: $mobileContentHeight;
min-width: 250px;
min-height: 340px;
// 定位
display: flex;
justify-content: center;
align-items: center;
.pic {
display: none;
}
.field {
// 元素
width: inherit;
min-height: inherit;
// 定位
left: 0;
display: flex;
flex-direction: column;
.mobile-title {
// 元素
margin: 0 0 20px;
display: block;
}
.form {
width: $mobileFormWidth;
// - - - tab
:deep(.el-tabs__header) {
display: none;
}
:deep(.el-tabs__content) {
padding: 0;
}
// - - - input
:deep(.el-input__inner) {
height: $mobileRowHeight;
line-height: 24px;
// 文字
text-align: center;
color: #262626;
}
:deep(.el-form-item) {
.button-code {
// 元素
height: $mobileRowHeight;
}
}
.button {
height: $mobileButtonHeight;
line-height: 24px;
color: #FFFFFF;
}
}
.mobile-switch {
display: block;
line-height: 20px;
font-size: 14px;
font-weight: 400;
color: #595959;
margin: 0;
.icon {
width: 14px;
height: 14px;
display: inline-block;
background-image: url($iconBgImage);
background-size: cover;
}
}
.mobile-switch:hover {
cursor: pointer;
}
}
}
.footer {
// 元素
font-size: 12px;
font-family: PingFang SC;
font-weight: 400;
line-height: 17px;
color: #333333;
opacity: 0.6;
// 定位
position: absolute;
bottom: 20px;
}
}
.pc-title {
display: none;
}
.content {
// 元素
width: $mobileContentWidth;
height: $mobileContentHeight;
min-width: 250px;
min-height: 340px;
// 定位
display: flex;
justify-content: center;
align-items: center;
.pic {
display: none;
}
.field {
padding: 0;
// 元素
width: inherit;
min-height: inherit;
// 定位
left: 0;
display: flex;
flex-direction: column;
.mobile-title {
// 元素
margin: 0;
display: block;
}
.form {
margin: 0;
width: $mobileFormWidth;
// - - - tab
:deep(.el-tabs__header) {
display: none;
}
:deep(.el-tabs__content) {
padding: 0;
}
// - - - input
:deep(.el-input__inner) {
height: $mobileRowHeight;
line-height: 24px;
// 文字
text-align: center;
color: #262626;
}
:deep(.el-form-item) {
.button-code {
// 元素
height: $mobileRowHeight;
}
}
.button {
height: $mobileButtonHeight;
line-height: 24px;
color: #ffffff;
}
}
.login-form {
:deep(.el-input__inner) {
height: $mobileRowHeight;
line-height: 24px;
// 文字
text-align: center;
color: #262626;
}
:deep(#button-form-item) {
margin: 0 !important;
button {
// 元素
height: $mobileRowHeight;
}
}
}
.mobile-switch {
display: block;
line-height: 20px;
font-size: 14px;
font-weight: 400;
color: #595959;
margin: 0;
.icon {
width: 14px;
height: 14px;
display: inline-block;
background-image: url($iconBgImage);
background-size: cover;
}
}
.mobile-switch:hover {
cursor: pointer;
}
}
}
.footer {
// 元素
font-size: 12px;
font-family: PingFang SC;
font-weight: 400;
line-height: 17px;
color: #333333;
opacity: 0.6;
// 定位
// position: absolute;
bottom: -32px;
}
}
}

View File

@ -35,7 +35,7 @@ export default {
const first = matched[0]
if (!this.isDashboard(first)) {
matched = [{ path: '/index', meta: { title: '首页' }}].concat(matched)
matched = [{ path: '/', meta: { title: '首页' }}].concat(matched)
}
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)

View File

@ -66,7 +66,10 @@
:key="col.key"
:disabled="disabled"
:is="col.subcomponent"
:inlineStyle="col.style"></component>
v-model="form[col.prop]"
:inlineStyle="col.style"
@on-change="$emit('update', form)"
v-bind="col.bind"></component>
<div
class="upload-area"

View File

@ -15,7 +15,7 @@
ref="fileUpload"
>
<!-- 上传按钮 -->
<el-button size="mini" type="primary">选取文件</el-button>
<el-button size="mini" :disabled="disabled" type="primary">选取文件</el-button>
<!-- 上传提示 -->
<div class="el-upload__tip" slot="tip" v-if="showTip">
请上传
@ -66,6 +66,11 @@ export default {
isShowTip: {
type: Boolean,
default: true
},
//
disabled: {
type: Boolean,
default: false
}
},
data() {
@ -179,6 +184,7 @@ export default {
},
//
getFileName(name) {
console.log('你好', name)
if (name.lastIndexOf("/") > -1) {
return name.slice(name.lastIndexOf("/") + 1);
} else {

View File

@ -5,8 +5,12 @@
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/>
<top-nav id="topmenu-container" class="topmenu-container" v-if="topNav"/>
<div class="right-menu">
<template v-if="device!=='mobile'">
<div style="padding-top: 5px; padding-right: 38px;">
<navbar-right :blackTitle='true'/>
</div>
<!-- <div class="right-menu"> -->
<!-- <template v-if="device!=='mobile'"> -->
<!-- <search id="header-search" class="right-menu-item" /> -->
<!-- 站内信 -->
@ -18,27 +22,27 @@
<size-select id="size-select" class="right-menu-item hover-effect" />
</el-tooltip> -->
</template>
<!-- </template> -->
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
<div class="avatar-wrapper">
<!-- <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
<div class="avatar-wrapper"> -->
<!-- <img :src="avatar" class="user-avatar"> -->
<span v-if="nickname" class="user-nickname">{{ nickname }}</span>
<!-- <span v-if="nickname" class="user-nickname">{{ nickname }}</span>
<i class="el-icon-caret-bottom" />
</div>
<el-dropdown-menu slot="dropdown">
<router-link to="/user/profile">
<el-dropdown-item>个人中心</el-dropdown-item>
</router-link>
</router-link> -->
<!-- <el-dropdown-item @click.native="setting = true">
<span>布局设置</span>
</el-dropdown-item> -->
<el-dropdown-item divided @click.native="logout">
<!-- <el-dropdown-item divided @click.native="logout">
<span>退出登录</span>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</el-dropdown> -->
<!-- </div> -->
</div>
</template>
@ -51,7 +55,8 @@ import Screenfull from '@/components/Screenfull'
import SizeSelect from '@/components/SizeSelect'
import Search from '@/components/HeaderSearch'
import NotifyMessage from '@/layout/components/Message'
import {getPath} from "@/utils/ruoyi";
// import {getPath} from "@/utils/ruoyi";
import NavbarRight from './NavbarRight.vue'
export default {
components: {
@ -61,7 +66,8 @@ export default {
Screenfull,
SizeSelect,
Search,
NotifyMessage
NotifyMessage,
NavbarRight
},
computed: {
...mapGetters([

View File

@ -0,0 +1,111 @@
<template>
<div class="right-msg" :style="blackTitle ? 'color: #000' : 'color: #fff'">
<div class="time-msg">
<div class="line1">{{timeZone}}&nbsp;&nbsp;&nbsp;&nbsp;{{topTime}}</div>
<div class="line2">{{topDate}}</div>
</div>
<div class="base-msg">
<div class="avatar">
<el-dropdown>
<img :src="require(`../../assets/images/choicepart/avatar.png`)" alt="" width="32" height="32" />
<el-dropdown-menu slot="dropdown">
<el-dropdown-item><svg-icon icon-class="helpbtn"/>帮助文档</el-dropdown-item>
<el-dropdown-item @click.native="logout"><svg-icon icon-class="exitbtn"/>退出登录</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<div class="use-msg">
<div class="line1">{{nickname}}</div>
<div class="line2">{{dept}}</div>
</div>
</div>
</div>
</template>
<script>
import moment from 'moment'
import { getUser } from "@/api/system/user.js";
import {getPath} from "@/utils/ruoyi";
export default {
name: 'navRight',
data() {
return {
topDate: '',
topTime: '',
timeZone: '',
timer: '',
dept:' ',
nickname: this.$store.getters.nickname
}
},
props: {
blackTitle: {
type: Boolean,
default: () => {
return false
}
}
},
mounted() {
this.getUserMsg()
this.getTime()
},
beforeDestroy() {
clearInterval(this.timer)
},
methods: {
getTime() {
let _this = this
this.timer = setInterval(function () {
_this.topDate = moment().format('YYYY/MM/DD')
let temp = moment().format('A-hh:mm').split('-')
_this.timeZone = temp[0]
_this.topTime = temp[1]
}, 1000)
},
getUserMsg() {
let id = this.$store.getters.userId
getUser(id).then(res => {
this.dept = res.data.dept ? res.data.dept.name : ''
})
},
async logout() {
this.$modal.confirm('确定注销并退出系统吗?', '提示').then(() => {
this.$store.dispatch('LogOut').then(() => {
location.href = getPath('/');
})
}).catch(() => {});
}
}
}
</script>
<style lang='scss' scoped>
.right-msg {
float: right;
height: 100%;
font-size: 14px;
// color: #fff;
// padding-top: 15px;
// padding-right: 38px;
.time-msg {
display: inline-block;
margin-right: 30px;
}
.base-msg {
display: inline-block;
.avatar {
display: inline-block;
margin-right: 10px;
}
.use-msg {
display: inline-block;
}
}
.line1 {
height: 19px;
}
.line2 {
height: 19px;
opacity: 0.65;
}
}
</style>

View File

@ -0,0 +1,96 @@
<template>
<div v-if="!item.hidden">
<template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)">
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
<item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" />
</el-menu-item>
</app-link>
</template>
<el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body>
<template slot="title">
<item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
</template>
<sidebar-item
v-for="(child, index) in item.children"
:key="child.path + index"
:is-nest="true"
:item="child"
:base-path="resolvePath(child.path)"
class="nest-menu"
/>
</el-submenu>
</div>
</template>
<script>
import path from 'path'
import { isExternal } from '@/utils/validate'
import Item from './Item'
import AppLink from './Link'
import FixiOSBug from './FixiOSBug'
export default {
name: 'SidebarItem',
components: { Item, AppLink },
mixins: [FixiOSBug],
props: {
// route object
item: {
type: Object,
required: true
},
isNest: {
type: Boolean,
default: false
},
basePath: {
type: String,
default: ''
}
},
data() {
this.onlyOneChild = null
return {}
},
methods: {
hasOneShowingChild(children = [], parent) {
if (!children) {
children = [];
}
const showingChildren = children.filter(item => {
if (item.hidden) {
return false
} else {
// Temp set(will be used if only has one showing child)
this.onlyOneChild = item
return true
}
})
// When there is only one child router, the child router is displayed by default
if (showingChildren.length === 1) {
return true
}
// Show parent if there are no child router to display
if (showingChildren.length === 0) {
this.onlyOneChild = { ... parent, path: '', noShowingChildren: true }
return true
}
return false
},
resolvePath(routePath) {
if (isExternal(routePath)) {
return routePath
}
if (isExternal(this.basePath)) {
return this.basePath
}
return path.resolve(this.basePath, routePath)
}
}
}
</script>

View File

@ -0,0 +1,71 @@
<template>
<div
:class="{ 'has-logo': showLogo }"
:style="{
backgroundColor:
settings.sideTheme === 'theme-dark'
? variables.menuBackground
: variables.menuLightBackground,
}">
<logo v-if="showLogo" :collapse="isCollapse" />
<el-scrollbar :class="settings.sideTheme" wrap-class="scrollbar-wrapper">
<el-menu
:default-active="activeMenu"
:collapse="isCollapse"
:background-color="
settings.sideTheme === 'theme-dark'
? variables.menuBackground
: variables.menuLightBackground
"
:text-color="
settings.sideTheme === 'theme-dark'
? variables.menuColor
: variables.menuLightColor
"
:unique-opened="true"
active-text-color="#fff"
:collapse-transition="false"
mode="vertical">
<!-- 根据 sidebarRouters 路由生成菜单 -->
<sidebar-item
v-for="(route, index) in sidebarRouters"
:key="route.path + index"
:item="route"
:base-path="route.path" />
</el-menu>
</el-scrollbar>
</div>
</template>
<script>
import { mapGetters, mapState } from 'vuex';
import Logo from './Logo';
import SidebarItem from './SidebarItem';
import variables from '@/assets/styles/variables.scss';
export default {
components: { SidebarItem, Logo },
computed: {
...mapState(['settings']),
...mapGetters(['sidebarRouters', 'sidebar']),
activeMenu() {
const route = this.$route;
const { meta, path } = route;
// if set path, the sidebar will highlight the path you set
if (meta.activeMenu) {
return meta.activeMenu;
}
return path;
},
showLogo() {
return this.$store.state.settings.sidebarLogo;
},
variables() {
return variables;
},
isCollapse() {
return !this.sidebar.opened;
},
},
};
</script>

View File

@ -28,7 +28,7 @@
mode="vertical">
<!-- 根据 sidebarRouters 路由生成菜单 -->
<sidebar-item
v-for="(route, index) in sidebarRouters"
v-for="(route, index) in routeList"
:key="route.path + index"
:item="route"
:base-path="route.path" />
@ -47,7 +47,12 @@ export default {
components: { SidebarItem, Logo },
computed: {
...mapState(['settings']),
...mapGetters(['sidebarRouters', 'sidebar']),
...mapGetters(['sidebarRouters', 'sidebar', 'choicepart']),
routeList() {
// return [this.partList[this.choicepart]]
// return [this.sidebarRouters[29]]
return [this.sidebarRouters[this.choicepart]]
},
activeMenu() {
const route = this.$route;
const { meta, path } = route;

View File

@ -71,17 +71,23 @@ export const constantRoutes = [
},
{
path: '/',
component: Layout,
// redirect: 'core/base/factory',
// children: [{
// path: 'index',
// redirect: 'core/base/factory',
// component: (resolve) => require(['@/views/index'], resolve),
// name: '首页',
// meta: { title: '首页', icon: 'dashboard', affix: true }
// }
// ]
component: () => import('@/views/choicePart'),
hidden: true,
meta: { requireToken: true }
},
// {
// path: '/',
// component: Layout,
// // redirect: 'core/base/factory',
// // children: [{
// // path: 'index',
// // redirect: 'core/base/factory',
// // component: (resolve) => require(['@/views/index'], resolve),
// // name: '首页',
// // meta: { title: '首页', icon: 'dashboard', affix: true }
// // }
// // ]
// },
{
path: '/AGVBoard',
name: 'AGVBoard',

View File

@ -17,6 +17,7 @@ const getters = {
topbarRouters:state => state.permission.topbarRouters,
defaultRoutes:state => state.permission.defaultRoutes,
sidebarRouters:state => state.permission.sidebarRouters,
choicepart: state => state.app.choicepart,
// 数据字典
dict_datas: state => state.dict.dictDatas
}

View File

@ -8,6 +8,7 @@ const state = {
},
device: "desktop",
size: localStorage.getItem("size") || "medium",
choicepart: localStorage.getItem('choicepart') || null
};
const mutations = {
@ -38,6 +39,10 @@ const mutations = {
SET_SIDEBAR_HIDE: (state, status) => {
state.sidebar.hide = status;
},
SET_CHOICEPART: (state, choicepart) => {
state.choicepart = choicepart
localStorage.setItem('choicepart', choicepart)
}
};
const actions = {
@ -56,6 +61,9 @@ const actions = {
toggleSideBarHide({ commit }, status) {
commit("SET_SIDEBAR_HIDE", status);
},
setChoicepart({ commit }, choicepart) {
commit('SET_CHOICEPART', choicepart)
}
};
export default {

View File

@ -0,0 +1,24 @@
<template>
<div class="navbar">
<div style="color: #fff;font-size: 22px; float: left; letter-spacing: 1px; font-weight: 500; padding-left: 24px; marginTop: 13px">
<img src="../../../assets/images/cnbm.png" style="width: 26px; height: 26px; position: relative; top: 6px; marginRight: 14px" alt="">
MES
</div>
<div style="padding-top: 15px; padding-right: 38px;">
<navbar-right />
</div>
</div>
</template>
<script>
import NavbarRight from '../../../layout/components/NavbarRight.vue'
export default {
name: 'Navbar',
components: { NavbarRight }
}
</script>
<style lang='scss' scoped>
.navbar {
height: 64px;
background: rgba(8, 17, 50, 0.25);
}
</style>

View File

@ -0,0 +1,312 @@
<template>
<div class="choicepart-container">
<navbar />
<div class="choicepart-wrapper">
<div class="choicepart-box" id="choicepartBox" :style="'transform:scale('+scale+');width:1574px;height:538px;'">
<div class="choicepart-line1">
<div
v-for="(item, index) in menuArr1"
:key="index"
class="choicepart-item"
@click="handelClick(item, item.choicepart)"
:style="{opacity: item.visible?1:0.4, pointerEvents:item.visible?'auto':'none'}"
>
<div>
<img :src="require(`../../assets/images/choicepart/${item.name}.png`)" alt="">
</div>
<div class="choicepart-item-title">{{item.meta.title}}</div>
</div>
</div>
<div class="choicepart-line2">
<div
v-for="(item, index) in menuArr2"
:key="index"
class="choicepart-item"
@click="handelClick(item, item.choicepart)"
:style="{opacity: item.visible?1:0.4, pointerEvents:item.visible?'auto':'none'}"
>
<div>
<img :src="require(`../../assets/images/choicepart/${item.name}.png`)" alt="">
</div>
<div class="choicepart-item-title">{{item.meta.title}}</div>
</div>
</div>
</div>
</div>
<div class="choicepart-footer">&copy; 中建材智能自动化研究院有限公司</div>
</div>
</template>
<script>
import Navbar from './components/Navbar.vue'
import { debounce } from '@/utils/debounce'
export default {
components: { Navbar },
name: 'choicePart',
data() {
return {
boxReset: '',
scale: 1,
menuArr1: [
{
name: 'Core',
title: '基础核心',
visible: false,
meta: {
title: ''
}
},
{
name: 'Order',
title: '订单管理',
visible: false,
meta: {
title: ''
}
},
{
name: 'Equipment',
title: '设备管理',
visible: false,
meta: {
title: ''
}
},
{
name: 'Group',
title: '班组管理',
visible: false,
meta: {
title: ''
}
},
{
name: 'Quality',
title: '质量管理',
visible: false,
meta: {
title: ''
}
},
{
name: 'Warehouse',
title: '仓库管理',
visible: false,
meta: {
title: ''
}
},
{
name: 'Energy',
title: '能源管理',
visible: false,
meta: {
title: ''
}
}
],
menuArr2: [
{
name: 'Packaging',
title: '包装管理',
visible: false,
meta: {
title: ''
}
},
{
name: 'Material',
title: '物料管理',
visible: false,
meta: {
title: ''
}
},
{
name: 'Extend',
title: '工艺管理',
visible: false,
meta: {
title: ''
}
},
{
name: 'Delivery',
title: '成品发货',
visible: false,
meta: {
title: ''
}
},
{
name: 'Report',
title: '报表管理',
visible: false,
meta: {
title: ''
}
},
{
name: 'System',
title: '系统管理',
visible: false,
meta: {
title: ''
}
}
],
}
},
// computed:{
// ...mapGetters(['sidebarRouters'])
// },
mounted() {
this.getMsg()
this.boxReset = debounce(() => {
this.resetSize()
}, 300)
this.boxReset()
window.addEventListener('resize', () => {
this.boxReset()
})
},
methods: {
getMsg() {
let menuList = this.$store.state.permission.sidebarRouters
console.log(menuList)
if (menuList.length > 0) {
for (let i = 0; i < menuList.length; i ++) {
for (let k = 0; k < 7; k++) {
if (menuList[i].name === this.menuArr1[k].name) {
this.menuArr1[k].visible = true
this.menuArr1[k].id = menuList[i].id
this.menuArr1[k].choicepart = i
this.menuArr1[k].children = menuList[i].children
this.menuArr1[k].meta = menuList[i].meta
}
}
for (let j = 0; j < 6; j++) {
if (menuList[i].name === this.menuArr2[j].name) {
this.menuArr2[j].visible = true
this.menuArr2[j].id = menuList[i].id
this.menuArr2[j].choicepart = i
this.menuArr2[j].children = menuList[i].children
this.menuArr2[j].meta = menuList[i].meta
}
}
}
}
console.log(this.menuArr1)
console.log(this.menuArr2)
},
handelClick(item, index) {
// this.$router.push({name: 'SystemUser'})
this.$store.dispatch('app/setChoicepart', index)
this.toRouter(item)
// if (item.meta.unuse) {
// this.$message.warning(this.$t(''))
// } else {
// this.toRouter(item)
// }
},
toRouter(item) {
console.log(item)
if (item.children) {
this.toRouter(item.children[0])
} else {
this.$router.push({ name: item.name })
}
},
resetSize() {
let choicepartBox = document.querySelector('#choicepartBox')
let rw = parseFloat(window.innerWidth)
let rh = parseFloat(window.innerHeight)
let bw = parseFloat(choicepartBox.style.width)
let bh = parseFloat(choicepartBox.style.height)
let wx = 0.82/(bw / rw)
let hx = 0.56/(bh / rh)
this.scale = wx > hx ? hx : wx
}
}
}
</script>
<style lang='scss' scoped>
.choicepart-container {
position: relative;
width: 100%;
height: 100%;
background: url('../../assets/images/choicepart/choicepart-back.png') repeat;
background-size: 100% 100%;
.choicepart-wrapper {
width: 100vw;
height: calc(100vh - 94px);
display: flex;
justify-content: center;
align-items: center;
}
.choicepart-box {
// border: 1px solid red;
.choicepart-line1 {
width: 100%;
margin-bottom: 80px;
display: flex;
flex-flow: row nowrap;
}
.choicepart-line2 {
width: 100%;
display: flex;
flex-flow: row nowrap;
justify-content: center;
}
.choicepart-item {
width: 184px;
height: 224px;
background: url('../../assets/images/choicepart/choice-item-back.png') no-repeat;
background-size: 100% 100%;
border-radius: 5px;
overflow: hidden;
cursor: pointer;
position: relative;
margin: 0 20px;
img {
width: 184px;
height: 224px;
}
.choicepart-item-title {
overflow: hidden;
padding: 0 10px;
text-overflow: ellipsis;
white-space: nowrap;
position: absolute;
bottom: 0;
left: 2px;
right: 2px;
text-align: center;
color: #fff;
font-size: 16px;
line-height: 40px;
height: 40px;
letter-spacing: 2px;
background-color: rgba($color: #0b58ff, $alpha: 0.45);
}
}
.choicepart-item:hover {
.choicepart-item-title {
background-color: rgba($color: #0b58ff, $alpha: 1);
}
}
}
.choicepart-footer {
position: absolute;
width: 100%;
color: #C7C7C7;
user-select: none;
font-size: 12px;
letter-spacing: 1px;
height: 30px;
display: grid;
place-content: center;
bottom: 0;
opacity: 0.5;
}
}
</style>

View File

@ -4,7 +4,7 @@
<div v-if="tableData.length">
<base-table v-loading="dataListLoading" :span-method="mergeColumnHandler" :table-props="tableProps" :table-data="tableData" />
<SearchBar :formConfigs="[{ label: '产线平衡分析图', type: 'title' }]" />
<balance-chart ref="lineChart" />
<BalanceChart ref="lineChart" />
</div>
<div v-else class="no-data-bg"></div>
<!-- <pagination
@ -19,7 +19,7 @@
// import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import { getCT } from '@/api/core/analysis/index';
import { getProductionLinePage } from '@/api/core/base/productionLine';
import { getCorePLList } from '@/api/base/coreProductionLine';
import BalanceChart from '../balanceChart'
import { time } from 'echarts';
// import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
@ -68,7 +68,7 @@ export default {
spanArr: [],
xData: [],
yData: [],
optionArrUrl: [getProductionLinePage],
optionArrUrl: [getCorePLList],
formConfig: [
{
type: 'select',
@ -111,7 +111,7 @@ export default {
}
this.optionArrUrl.forEach((item, index) => {
item(params).then((response) => {
this.formConfig[index].selectOptions = response.data.list
this.formConfig[index].selectOptions = response.data
});
});
},
@ -212,8 +212,10 @@ export default {
}
this.tableProps = arr
console.log('表格横坐标', this.xData)
this.$refs.lineChart.initChart(this.xData, this.yData)
console.log('表格横坐标', this.xData, this.yData)
this.$nextTick(() => {
this.$refs.lineChart.initChart(this.xData, this.yData)
})
// this.total = response.data.total;
// this.dataListLoading = false;
});

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-09-13 09:02:25
* @LastEditTime: 2023-10-08 16:36:37
* @LastEditTime: 2023-11-10 10:48:09
* @LastEditors: DY
* @Description:
-->
@ -10,7 +10,7 @@
<div style="margin: 20px">
<el-button v-for="(item, index) in buttonList" :key="index" :class="[item.actived ? 'activeButton': 'normalButton']" @click="changeChart(index)">{{ item.name }}</el-button>
</div>
<div ref="chartDiv" :class="className" :style="{height:height,width:width}" />
<div id="chart" ref="chartDiv" :class="className" :style="{height:height,width:width}" />
</div>
</template>
@ -48,6 +48,7 @@ export default {
}
},
mounted() {
// this.initChart()
},
methods: {
changeChart(index) {
@ -81,7 +82,8 @@ export default {
console.log('看一下数据', this.dataArray)
this.xDatas = xData
this.chart = echarts.init(this.$refs.chartDiv, 'macarons')
this.setOptions(xData, yData[0], lineName)
// this.chart = echarts.init(document.getElementById('chart'), 'macarons')
// this.setOptions(xData, yData[0], lineName)
},
setOptions(xData, dataList, lineName) {
// let seriesData = []

View File

@ -21,6 +21,7 @@ import { parseTime } from '../../mixins/code-filter';
import { getYieldAnalysisPageData } from '@/api/core/analysis/index';
// import { getProductionLinePage } from '@/api/core/base/productionLine';
import lineChart from '../LineChart'
import moment from 'moment';
// import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
// const tableProps = [
@ -62,6 +63,9 @@ export default {
recordTime: []
},
dateLabelList: [],
tempTtime: '',
day: 0,
xData: [],
formConfig: [
// {
// type: 'select',
@ -109,111 +113,77 @@ export default {
// });
// });
// },
getData() {
// this.listQuery.lineIds = ['1672847052717821953']
// this.listQuery.productId = val.productId;
// this.listQuery.time = '1694486098000';
this.urlOptions.getDataListURL(this.listQuery).then(res => {
let arr = [
{
prop: 'lineName',
label: '产线',
fixed: 'left'
},
{
prop: 'sum',
label: '合计',
fixed: 'left'
},
{
prop: res.data ? res.data.nameData[0].name : undefined,
label: res.data ? res.data.nameData[0].name : undefined,
align: 'center',
children:[
]
}
]
// console.log(res.data.nameData.slice(1))
let xData = []
let yAllData = []
let lineName = []
if (res.data) {
let tempDateList = []
res.data.nameData.forEach(date => {
tempDateList.push(date.name)
})
this.dateLabelList = Array.from(new Set(tempDateList))
this.dateLabelList.forEach(item => {
if (item.indexOf('年') === -1) {
//
const props = {
'prop': item,
'label': item
}
arr[2].children.push(props)
// echarts
xData.push(item)
}
})
// res.data.nameData.slice(1).forEach(item => {
// const props = {
// 'prop': item.name,
// 'label': item.name,
// 'align': 'center'
// }
// arr[2].children.push(props)
// })
let tableDataArr =[]
res.data.data.forEach(item => {
let obj = {}
obj.lineName= item.lineName,
obj.sum= item.sum,
item.data.forEach((ele, index) => {
// console.log(ele)
ele.children.forEach((e) => {
console.log(e.dynamicName)
obj['' + e.dynamicName + ''] = e.dynamicValue
console.log(obj['' + e.dynamicName + '']);
})
})
tableDataArr.push(obj)
});
this.tableData = tableDataArr
this.tableProps = arr
// let tempList = []
// res.data.nameData.slice(1).forEach(item => {
// tempList.push(item.name)
// // arr[2].children.push(props)
// })
// xData = Array.from(new Set(tempList))
res.data.data.forEach(item => {
let yData = []
lineName.push(item.lineName)
// let obj = {}
// obj.lineName = item.lineName,
// obj.sum = item.sum,
item.data.forEach((ele, index) => {
// console.log(ele)
ele.children.forEach((e) => {
// let yData = []
yData.push(e.dynamicValue)
})
})
yAllData.push(yData)
});
console.log(lineName)
} else {
this.tableProps = arr
this.tableData = []
xData = []
yAllData = []
lineName = []
//
setHeader() {
const month = this.tempTtime.getMonth() + 1
let arr = [
{
prop: 'proName',
label: '产品名称',
fixed: 'left'
},
{
prop: 'specifications',
label: '产品规格',
fixed: 'left'
},
{
prop: 'sum',
label: '合计',
fixed: 'left'
},
{
label: this.tempTtime.getFullYear() + '年' + month + '月',
align: 'center',
children: []
}
]
for (let d = 1; d <= this.day; d ++) {
arr[3].children.push({
prop: 'value' + d, label: month + '-' + d
})
//
this.xData.push(month + '-' + d)
}
this.tableProps = arr
},
getData() {
this.urlOptions.getDataListURL(this.listQuery).then(res => {
//
if (res.data) {
this.setHeader()
res.data.forEach(item => {
console.log('111', item.recordTime, moment(item.recordTime).format('DD'))
this.tableData.push({
proName: item.proName,
specifications: item.specifications
})
})
}
console.log('饿', this.tableData)
// res.data.data.forEach(item => {
// let yData = []
// lineName.push(item.lineName)
// // let obj = {}
// // obj.lineName = item.lineName,
// // obj.sum = item.sum,
// item.data.forEach((ele, index) => {
// // console.log(ele)
// ele.children.forEach((e) => {
// // let yData = []
// yData.push(e.dynamicValue)
// })
// })
// yAllData.push(yData)
// });
// console.log(lineName)
// } else {
// this.tableProps = arr
// this.tableData = []
// xData = []
// yAllData = []
// lineName = []
// }
// res.data.data[0].data[0].children.forEach((item, index) => {
// // console.log(item)
// yData.push(item.dynamicValue)
@ -221,7 +191,7 @@ export default {
// // obj['' + item.dynamicName + ''] = item.dynamicValue
// })
// console.log(this.yData)
this.$refs.lineChart.initChart(xData, yAllData, lineName)
// this.$refs.lineChart.initChart(this.xData, yAllData, lineName)
// this.total = response.data.total;
// this.dataListLoading = false;
});
@ -231,23 +201,21 @@ export default {
case 'search':
// this.listQuery.recordTime = val.time ? new Date(val.time).getTime() : undefined
if (val.time) {
const tempTtime = new Date(val.time)
let day = 0
switch (tempTtime.getMonth() + 1) {
this.tempTtime = new Date(val.time)
switch (this.tempTtime.getMonth() + 1) {
case 1, 3, 5, 7, 8, 10, 12:
day = 31;
this.day = 31;
break;
case 2:
day = 28;
this.day = 28;
break;
case 4, 6, 9, 11:
day = 30;
this.day = 30;
break;
}
console.log(parseTime(new Date(tempTtime.getFullYear(), 11, 31, 23, 59, 59)))
this.listQuery.recordTime = [
val.time,
parseTime(new Date(tempTtime.getFullYear(), tempTtime.getMonth(), day, 23, 59, 59))
parseTime(new Date(this.tempTtime.getFullYear(), this.tempTtime.getMonth(), this.day, 23, 59, 59))
]
this.getData()
} else {

View File

@ -1,7 +1,7 @@
<!--
* @Author: Do not edit
* @Date: 2023-08-29 14:59:29
* @LastEditTime: 2023-10-16 15:10:42
* @LastEditTime: 2023-11-07 18:48:35
* @LastEditors: DY
* @Description:
-->
@ -175,7 +175,7 @@ export default {
label: '统计开始时间',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: "yyyy-MM-ddTHH:mm:ss",
valueFormat: "yyyy-MM-dd HH:mm:ss",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',

View File

@ -25,6 +25,7 @@
<script>
import { getPdlDataOneDay } from '@/api/core/monitoring/data24'
import { parseTime } from '../../mixins/code-filter';
import { Loading } from 'element-ui';
export default {
name: 'productionLineData24',
@ -105,13 +106,13 @@ export default {
let sectionArr= []
console.log('打印看下数据list', list)
list.forEach((ele, index) => {
let tempData = []
let tempData = {}
tempData[ele.recordTime + '_up'] = ele.inputNum
tempData[ele.recordTime + '_down'] = ele.outputNum
tempData[ele.recordTime + '_up'] = ele.inputNum
tempData['proLineName'] = ele.lineName
tempData['workOrderName'] = ele.workOrderName
tempData['spec'] = ele.spec
tempData['spec'] = ele.specifications
this.tableData.push(tempData)
console.log('看看数据', this.tableData, tempData)
const { proLineName } = tempData

View File

@ -0,0 +1,177 @@
<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" />
</div>
</template>
<script>
import basicPage from '../../../core/mixins/basic-page';
import { parseTime } from '../../../core/mixins/code-filter';
import {
getEqAnalysis,
exportEqAnalysisExcel
} from '@/api/equipment/analysis/statistics';
const tableProps = [
{
prop: 'recordTime',
label: '时间段',
filter: parseTime
},
{
prop: 'lineName',
label: '产线'
},
{
prop: 'sectionName',
label: '工段'
},
{
prop: 'equipmentName',
label: '设备名称'
},
{
prop: 'equipmentType',
label: '设备类型'
},
{
prop: 'workTime',
label: '工作时间累积(h)'
},
{
prop: 'repairCount',
label: '维修次数'
},
{
prop: 'maintainCount',
label: '保养次数'
}
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getEqAnalysis,
exportURL: exportEqAnalysisExcel,
},
tableProps,
tableBtn: [].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'input',
label: '设备名称',
placeholder: '设备名称',
param: 'name',
},
{
type: 'datePicker',
label: '时间段',
dateType: 'daterange', // datetimerange
// format: 'yyyy-MM-dd HH:mm:ss',
format: 'yyyy-MM-dd',
// valueFormat: 'timestamp',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始日期',
endPlaceholder: '结束日期',
defaultTime: ['00:00:00', '23:59:59'],
param: 'recordTime',
defaultSelect: [],
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('equipment:analysis-statistics:export') ? 'button' : '',
btnName: '导出',
name: 'export',
color: 'warning',
plain: true
},
],
};
},
created() {},
methods: {
//
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.tableData = response.data.list;
this.listQuery.total = response.data.total;
this.dataListLoading = false;
});
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.equipmentName = val.name ? val.name : undefined;
this.listQuery.recordTime = val.recordTime ? val.recordTime : undefined;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
/** 导出按钮操作 */
handleExport() {
//
let params = { ...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(() => { });
}
},
};
</script>

View 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>

View File

@ -0,0 +1,514 @@
<!--
filename: index.vue
author: liubin
date: 2023-09-04 09:34:52
description: 设备效率分析
-->
<template>
<div class="app-container allow-overflow">
<!-- 搜索工作栏 -->
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
设备运行状态
</small-title>
<div
class="graph"
style="
overflow: inherit;
display: flex;
flex-direction: column;
position: relative;
">
<div class="blue-title">各设备加工数量</div>
<div class="legend">
<div class="legend-item">
<span class="icon blue"></span>
<span class="text">工作时长</span>
</div>
<div class="legend-item">
<span class="icon green"></span>
<span class="text">停机时长</span>
</div>
<div class="legend-item">
<span class="icon purple"></span>
<span class="text">故障时长</span>
</div>
<div class="legend-item">
<span class="icon yellow"></span>
<span class="text">速度开动率</span>
</div>
</div>
<div class="graph-grid">
<div class="bg-grid grid-line">
<div
class="grid-item"
v-for="item in list.length"
:key="item"></div>
</div>
<div class="bg-grid grid-charts">
<pie-chart
v-for="item in list"
:key="item.id"
:value="item" />
<!-- <pie-chart v-for="item in 5" :key="item" :value="item" /> -->
</div>
</div>
</div>
</div>
</template>
<script>
// import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import PieChart from '../efficiency/components/pieChart.vue';
export default {
name: 'EfficiencyAnalysis',
mixins: [basicPageMixin],
components: { PieChart },
props: {},
data() {
return {
visualizationOpen: false,
trendOpen: false,
// tableBtn: [
// this.$auth.hasPermi('base:equipment-group:update')
// ? {
// type: 'edit',
// btnName: '',
// }
// : undefined,
// this.$auth.hasPermi('base:equipment-group:delete')
// ? {
// type: 'delete',
// btnName: '',
// }
// : undefined,
// ].filter((v) => v),
tableProps: [
{ prop: 'factoryName', label: '工厂' },
{ prop: 'lineName', label: '产线' },
{ prop: 'sectionName', label: '工段' },
{ prop: 'equipmentName', label: '设备' },
{
label: '有效时间',
children: [
{
width: 128,
prop: 'workTime',
label: '工作时长[h]',
},
{
width: 128,
prop: 'workRate',
label: '百分比[%]',
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
},
],
},
{
label: '关机时间',
children: [
{
width: 128,
prop: 'stopTime',
label: '停机时长[h]',
},
{ width: 128, prop: 'stopRate', label: '百分比[%]' },
],
},
{
label: '中断损失',
children: [
{
width: 128,
prop: 'downTime',
label: '故障时长[h]',
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
},
{ width: 128, prop: 'downRate', label: '百分比[%]' },
{
width: 128,
prop: 'timeEfficiency',
label: '时间开动率',
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
},
],
},
{
label: '速度损失',
children: [
{
width: 128,
prop: 'realProcSpeed',
label: '实际加工速度',
},
{
width: 128,
prop: 'designProcSpeed',
label: '理论加工速度',
},
{
width: 128,
prop: 'peEfficiency',
label: '速度开动率',
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
},
],
},
{
prop: 'oee',
label: 'OEE',
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
},
{
prop: 'teep',
label: 'TEEP',
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
},
// {
// _action: 'view-trend',
// label: '',
// ,
// subcomponent: {
// props: ['injectData'],
// render: function (h) {
// const _this = this;
// return h(
// 'el-button',
// {
// props: { type: 'text' },
// on: {
// click: function () {
// console.log('inejctdata', _this.injectData);
// _this.$emit('emitData', {
// action: _this.injectData._action,
// // value: _this.injectData.id,
// value: _this.injectData,
// });
// },
// },
// },
// ''
// );
// },
// },
// },
],
searchBarFormConfig: [
{
type: 'select',
label: '工厂',
placeholder: '请选择工厂',
param: 'factoryId',
selectOptions: [],
},
{
type: 'select',
label: '产线',
placeholder: '请选择产线',
param: 'lineId',
selectOptions: [],
},
//
{
type: 'select',
label: '时间类型',
param: 'dateFilterType',
defaultSelect: 0,
selectOptions: [
{ id: 0, name: '按时间段' },
{ id: 1, name: '按日期' },
],
index: 2,
extraOptions: [
{
parent: 'dateFilterType',
//
type: 'datePicker',
// label: '',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
defaultTime: ['00:00:00', '00:00:00'],
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timerange',
},
{
parent: 'dateFilterType',
//
type: 'datePicker',
// label: '',
dateType: 'date',
placeholder: '选择日期',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
param: 'timeday',
},
],
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
// {
// type: 'separate',
// },
// {
// type: 'button',
// btnName: '',
// name: 'visualization',
// plain: true,
// color: 'success',
// },
// {
// type: 'button',
// btnName: 'OEE',
// name: 'add',
// plain: true,
// color: 'success',
// },
// {
// type: 'button',
// btnName: 'TEEP',
// name: 'add',
// plain: true,
// color: 'warning',
// },
],
//
open: false,
//
queryParams: {
lineId: null,
factoryId: null,
recordTime: [],
},
//
form: {},
list: [],
};
},
created() {
// this.getFactory();
// this.getLine();
this.getList();
},
methods: {
/** 准备工厂数据 */
// async getFactory() {
// const { code, data } = await this.$axios({
// url: '/base/factory/listAll',
// method: 'get',
// });
// if (code == 0) {
// this.searchBarFormConfig[0].selectOptions = data.map((item) => {
// return {
// name: item.name,
// id: item.id,
// };
// });
// }
// },
/** 准备产线数据 */
// async getLine() {
// const { code, data } = await this.$axios({
// url: '/base/core-production-line/listAll',
// method: 'get',
// });
// if (code == 0) {
// this.searchBarFormConfig[1].selectOptions = data.map((item) => {
// return {
// name: item.name,
// id: item.id,
// };
// });
// }
// },
/** 覆盖 handleEmitFun 的默认实现 */
// handleEmitFun({ action, value }) {
// switch (action) {
// case 'view-trend':
// const { id } = value;
// this.open = true;
// this.trendOpen = true;
// break;
// }
// },
/** 查询列表 */
async getList() {
this.loading = true;
const { code, data } = await this.$axios({
url: '/analysis/equipment-analysis/efficiency',
method: 'get',
params: this.queryParams,
});
if (code == 0) {
this.list = data;
}
},
submitForm() {},
handleTabClick() {},
},
};
</script>
<style scoped lang="scss">
.visualization {
display: grid;
grid-template-columns: repeat(3, minmax(240px, 1fr));
}
:deep(.custom-tabs) {
.el-tabs__header {
margin-bottom: 8px;
display: inline-block;
transform: translateY(-12px);
}
.el-tabs__content {
overflow: visible;
}
.el-tabs__item {
padding-left: 0 !important;
padding-right: 0 !important;
line-height: 36px !important;
height: 36px;
}
}
.blue-title {
position: relative;
padding: 4px 0;
padding-left: 12px;
font-size: 14px;
&::before {
content: '';
position: absolute;
left: 0;
top: 6px;
height: 16px;
width: 4px;
border-radius: 1px;
background: #0b58ff;
}
}
.graph-grid {
margin-top: 8px;
padding: 12px;
position: relative;
border-radius: 12px;
border: 1px solid #ccc;
// background: #0003;
overflow: inherit;
}
.bg-grid {
display: grid;
place-content: center;
grid-template-columns: repeat(4, minmax(280px, 1fr));
grid-auto-columns: 280px;
grid-auto-rows: 290px;
overflow: inherit;
position: relative;
}
.grid-line::after {
content: '';
position: absolute;
top: -1px;
left: -1px;
width: calc(100% + 2px);
height: calc(100% + 2px);
display: inline-block;
border: 8px solid #fff;
}
.grid-charts {
position: absolute;
width: calc(100% - 24px);
top: 12px;
left: 12px;
}
.grid-item {
border: 1px solid #ccc;
}
.grid-item:not(:first-child) {
border-left: 0;
border-top: 0;
}
.legend {
position: absolute;
top: 8px;
right: 12px;
display: flex;
}
.legend .legend-item {
display: flex;
align-items: center;
margin-left: 12px;
}
.legend .legend-item .icon {
width: 10px;
height: 10px;
border-radius: 1px;
margin-right: 4px;
margin-top: 1px;
}
.legend .legend-item .text {
color: #8c8c8c;
}
.blue {
background-color: #3da8fd;
}
.green {
background-color: #8ef0ab;
}
.purple {
background-color: #6b5cfd;
}
.yellow {
background-color: #ffc72a;
}
@media screen and (max-width: 1390px) {
.bg-grid {
grid-template-columns: repeat(3, minmax(280px, 1fr));
}
}
@media screen and (max-width: 1190px) {
.bg-grid {
grid-template-columns: repeat(2, minmax(280px, 1fr));
}
}
@media screen and (max-width: 640px) {
.bg-grid {
grid-template-columns: repeat(1, minmax(280px, 1fr));
}
}
</style>

View File

@ -13,14 +13,21 @@
ref="search-bar"
@headBtnClick="handleSearchBarBtnClick" />
<el-row>
<base-table
class="base-table__margin"
:table-props="tableProps"
:page="1"
:limit="10"
:table-data="list"
@emitFun="handleEmitFun" />
<!-- <el-row>
<el-col class="custom-tabs">
<el-tabs
v-model="activeName"
:stretch="true"
@tab-click="handleTabClick">
<el-tab-pane :label="'\u2002数据列表\u2002'" name="table">
<!-- 列表 -->
<base-table
class="base-table__margin"
:table-props="tableProps"
@ -74,14 +81,13 @@
v-for="item in list"
:key="item.id"
:value="item" />
<!-- <pie-chart v-for="item in 5" :key="item" :value="item" /> -->
</div>
</div>
</div>
</el-tab-pane>
</el-tabs>
</el-col>
</el-row>
</el-row> -->
</div>
</template>
@ -132,7 +138,7 @@ export default {
width: 128,
prop: 'workRate',
label: '百分比[%]',
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
filter: (val) => (val != null ? +Number(val).toFixed(3) : '-'),
},
],
},
@ -161,7 +167,7 @@ export default {
width: 128,
prop: 'timeEfficiency',
label: '时间开动率',
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
filter: (val) => (val != null ? +Number(val).toFixed(3) : '-'),
},
],
},
@ -182,19 +188,19 @@ export default {
width: 128,
prop: 'peEfficiency',
label: '速度开动率',
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
filter: (val) => (val != null ? +Number(val).toFixed(3) : '-'),
},
],
},
{
prop: 'oee',
label: 'OEE',
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
filter: (val) => (val != null ? +Number(val).toFixed(3) : '-'),
},
{
prop: 'teep',
label: 'TEEP',
filter: (val) => (val != null ? +val.toFixed(3) : '-'),
filter: (val) => (val != null ? +Number(val).toFixed(3) : '-'),
},
// {
// _action: 'view-trend',
@ -332,7 +338,7 @@ export default {
/** 准备工厂数据 */
async getFactory() {
const { code, data } = await this.$axios({
url: '/base/factory/listAll',
url: '/base/core-factory/listAll',
method: 'get',
});
if (code == 0) {
@ -348,7 +354,7 @@ export default {
/** 准备产线数据 */
async getLine() {
const { code, data } = await this.$axios({
url: '/base/production-line/listAll',
url: '/base/core-production-line/listAll',
method: 'get',
});
if (code == 0) {

View File

@ -75,7 +75,7 @@ export default {
},
],
tableProps: [
{ prop: 'lineName', label: '产线' },
{ prop: 'lineName', label: '产线名称' },
{ prop: 'sectionName', label: '工段' },
{ prop: 'equipmentName', label: '设备' },
{
@ -136,7 +136,7 @@ export default {
methods: {
async fillLineOptions() {
const { data } = await this.$axios({
url: '/base/production-line/listAll',
url: '/base/core-production-line/listAll',
method: 'get',
});
const cfg = this.searchBarFormConfig.find(

View File

@ -262,7 +262,7 @@ export default {
async fillLineOptions() {
const { data } = await this.$axios({
url: '/base/production-line/listAll',
url: '/base/core-production-line/listAll',
method: 'get',
});
const cfg = this.searchBarFormConfig.find(
@ -280,7 +280,7 @@ export default {
async fillProductOptions() {
const { data } = await this.$axios({
url: '/base/product/listAll',
url: '/base/core-product/listAll',
method: 'get',
});
const cfg = this.searchBarFormConfig.find(

View 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>

View File

@ -0,0 +1,195 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-11 20:33:12
* @Description:
-->
<template>
<div>
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
系统自带
</small-title>
<el-form
:model="dataForm1"
ref="dataForm1"
label-width="80px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="设备编码" prop="equipment">
<el-input
v-model="dataForm1.equipment"
disabled
placeholder="请输入设备编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="报警时间" prop="createTime">
<el-input
v-model="dataForm1.createTime"
disabled
placeholder="请输入报警时间" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="报警编号" prop="code">
<!-- 接口缺参数 -->
<el-input
v-model="dataForm1.code"
disabled
placeholder="请输入报警编号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="报警内容" prop="alarmContent">
<el-input
v-model="dataForm1.alarmContent"
disabled
placeholder="请输入报警内容" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
处理方式
</small-title>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
label-width="80px">
<el-form-item label="处理人" prop="hander">
<el-select
v-model="dataForm.hander"
:disabled="isdetail"
placeholder="请选择处理人"
>
<el-option
v-for="dict in workersList"
:key="dict.id"
:label="dict.name"
:value="dict.name" />
</el-select>
</el-form-item>
<el-form-item label="处理方式" prop="handerMode">
<editor v-model="dataForm.handerMode" :read-only="isdetail" :min-height="200"/>
</el-form-item>
<el-form-item label="附件" prop="file">
<!-- <el-input
v-model="dataForm.file"
type="textarea"
min-size="3"
placeholder="请输入处理方式" /> -->
<FileUpload v-model="file" :disabled="isdetail" />
</el-form-item>
</el-form>
</div>
</template>
<script>
import basicAdd from '../../../../core/mixins/basic-add';
import SmallTitle from './SmallTitle';
import { getworkerAll } from "@/api/base/materialUseLog";
import { createAlarmHand, getAlarmLog } from '@/api/equipment/base/alarm/records';
import FileUpload from "@/components/FileUpload";
import Editor from "@/components/Editor";
export default {
components: { SmallTitle, FileUpload, Editor },
mixins: [basicAdd],
data() {
return {
urlOptions: {
createURL: createAlarmHand,
infoURL: getAlarmLog,
},
dataForm1: {
id: undefined,
equipment: undefined,
createTime: undefined,
alarmContent: undefined,
code: undefined
},
file: '',
dataForm: {
id: undefined,
hander: undefined,
handerMode: undefined
},
isdetail: false,
workersList: [],
dataRule: {
hander: [{ required: true, message: "处理人不能为空", trigger: "change" }],
handerMode: [{ required: true, message: "处理方式不能为空", trigger: "blur" }]
}
};
},
mounted() {
this.getDict()
console.log('我看看', this.dataForm)
},
methods: {
async getDict() {
//
const workerRes = await getworkerAll()
this.workersList = workerRes.data
},
//
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;
// }
//
if (this.file) {
const temp = this.file.split(',') //
let arry = []
temp.forEach(item => {
arry.push({
fileType: 2,
fileUrl: item
})
})
this.dataForm.files = arry
}
this.urlOptions.createURL(this.dataForm).then(response => {
this.$modal.msgSuccess("新增成功");
this.visible = false;
this.$emit("refreshDataList");
});
});
},
init(id, isdetail) {
this.dataForm1.id = id || "";
this.isdetail = isdetail || false
this.visible = true;
this.$nextTick(() => {
this.$refs["dataForm1"].resetFields();
this.$refs["dataForm"].resetFields();
if (this.dataForm1.id) {
this.urlOptions.infoURL(id).then(response => {
if (response.data) {
this.dataForm1 = response.data;
}
});
}
});
},
},
};
</script>

View File

@ -0,0 +1,350 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<SearchBar
:formConfigs="searchBarFormConfig"
ref="search-bar"
@headBtnClick="handleSearchBarBtnClick" />
<!-- 列表 -->
<base-table
:table-props="tableProps"
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-data="list"
@emitFun="handleEmitFun">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:width="120"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
<!-- 分页组件 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="title"
:dialogVisible="open"
width="60%"
@close="cancel"
@cancel="cancel"
@confirm="submitForm">
<!-- <DialogForm
v-if="open"
ref="form"
v-model="form"
:disabled="mode == 'detail'"
:has-files="false"
:rows="rows" /> -->
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit" />
</base-dialog>
</div>
</template>
<script>
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import AddOrUpdate from './add-or-updata.vue'
import { publicFormatter } from '@/utils/dict';
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
const btn = {
name: 'tableBtn',
props: ['injectData'],
data() {
return {};
},
methods: {
handleClick() {
this.$emit('emitData', { action: this.injectData.name, value: this.injectData });
},
},
render: function (h) {
return (
<el-button type="text" onClick={this.handleClick}>
{this.injectData.name}
</el-button>
);
},
};
export default {
name: 'Record',
components: { AddOrUpdate },
mixins: [basicPageMixin],
data() {
return {
searchBarKeys: ['equipmentName', 'recordTime'],
tableBtn: [
// this.$auth.hasPermi('equipment:spare-parts-config:update')
// ? {
// type: 'detail',
// btnName: '',
// }
// : undefined,
// this.$auth.hasPermi('equipment:spare-parts-config:update')
// ? {
// type: 'edit',
// btnName: '',
// }
// : undefined,
// this.$auth.hasPermi('equipment:spare-parts-config:delete')
// ? {
// type: 'delete',
// btnName: '',
// }
// : undefined,
].filter((v) => v),
tableProps: [
{ prop: 'productionLine', label: '产线' },
{ prop: 'workshopSection', label: '工段' },
{ prop: 'equipment', label: '设备名称' },
{ prop: 'alarmGrade', label: '报警级别', filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL) },
{ prop: 'responsible', label: '报警时间' }, //
{ prop: 'responsible1', label: '设备报警码' }, //
{ prop: 'alarmContent', label: '报警内容' },
{ prop: 'opt1', label: '处理记录', name: '查看', subcomponent: btn },
{ prop: 'opt2', label: '处理', name: '报警处理', subcomponent: btn }, // TODO:
// { prop: 'remark', label: '' },
],
searchBarFormConfig: [
{
type: 'input',
label: '设备名',
placeholder: '请输入设备名称',
param: 'equipmentName',
},
//
{
type: 'datePicker',
label: '时间段',
dateType: 'daterange', // datetimerange
// format: 'yyyy-MM-dd HH:mm:ss',
format: 'yyyy-MM-dd',
// valueFormat: 'timestamp',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始日期',
endPlaceholder: '结束日期',
defaultTime: ['00:00:00', '23:59:59'],
param: 'recordTime',
// defaultSelect: [
// new Date(y, m, d)
// .toLocaleString()
// .split('/')
// .map((item, index) => {
// if (index == 1 || index == 2) return item.padStart(2, '0');
// return item;
// })
// .join('-'),
// new Date(y, m, d, 23, 59, 59)
// .toLocaleString()
// .split('/')
// .map((item, index) => {
// if (index == 1 || index == 2) return item.padStart(2, '0');
// return item;
// })
// .join('-'),
// ],
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
// {
// type: 'separate',
// },
// {
// type: this.$auth.hasPermi('equipment:spare-parts-config:create')
// ? 'button'
// : '',
// btnName: '',
// name: 'add',
// plain: true,
// color: 'success',
// },
// {
// type: this.$auth.hasPermi('equipment:spare-parts-config:export')
// ? 'button'
// : '',
// btnName: '',
// name: 'export',
// color: 'warning',
// },
],
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
lineId: null,
equipmentId: null,
},
basePath: '/base/equipment-alarm-log',
list: []
};
},
created() {
// this.getList();
},
methods: {
handleEmitFun(val) {
console.log('你好', val)
if (val.action === '报警处理') {
//
this.open = true
this.title = '报警处理'
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.value.id);
});
} else {
//
this.open = true
this.title = '查看'
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.value.id, true);
});
}
},
/** 查询列表 */
getList() {
this.loading = true;
//
this.recv(this.queryParams).then((response) => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
successSubmit() {
this.cancel()
this.getList()
},
/** 取消按钮 */
cancel() {
this.open = false;
// this.mode = null;
// this.reset();
},
/** 表单重置 */
// reset() {
// this.form = {
// id: null,
// name: null,
// equipmentId: null,
// description: null,
// responsible: null
// };
// this.resetForm('form');
// },
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm');
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = '添加备品备件配置';
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
this.info({ id }).then((response) => {
this.form = response.data;
this.open = true;
this.title = '修改备品备件配置';
});
},
/** 提交按钮 */
submitForm() {
this.$refs.addOrUpdate.dataFormSubmit()
// this.$refs['form'].validate((valid) => {
// if (!valid) {
// return;
// }
// //
// if (this.form.id != null) {
// this.put(this.form).then((response) => {
// this.$modal.msgSuccess('');
// this.open = false;
// this.getList();
// });
// return;
// }
// //
// this.post(this.form).then((response) => {
// this.$modal.msgSuccess('');
// this.open = false;
// this.getList();
// });
// });
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal
.confirm('是否确认删除记录"' + row.name + '"?')
.then(function () {
return this.delete({ id });
})
.then(() => {
this.getList();
this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
},
handleDetail({ id }) {
this.reset();
this.mode = 'detail';
this.info({ id }).then((response) => {
this.form = response.data;
this.open = true;
this.title = '修改备品备件配置';
});
},
/** 导出按钮操作 */
handleExport() {
//
let params = { ...this.queryParams };
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal
.confirm('是否确认导出所有备品备件配置?')
.then(() => {
this.exportLoading = true;
return exportEquipmentTypeExcel(params);
})
.then((response) => {
this.$download.excel(response, '备品备件配置.xls');
this.exportLoading = false;
})
.catch(() => {});
},
},
};
</script>

View File

@ -0,0 +1,393 @@
<!--
filename: dialogForm.vue
author: liubin
date: 2023-10-31 15:55:13
description:
-->
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="false"
class="drawer"
size="60%">
<small-title slot="title" :no-padding="true">
{{ isdetail ? '查看详情' : '新增' }}
</small-title>
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
v-loading="formLoading">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="设备名称" prop="equipmentId">
<el-select
v-model="dataForm.equipmentId"
filterable
:disabled="isdetail"
style="width: 100%"
placeholder="请选择设备名称">
<el-option
v-for="dict in eqList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<!-- <el-form-item label="物料名称" prop="name">
<el-input v-model="dataForm.name" :disabled="isdetail" clearable placeholder="请输入物料名称" />
</el-form-item> -->
<el-form-item label="巡检配置名称" prop="configId">
<el-select
v-model="dataForm.configId"
filterable
:disabled="isdetail"
style="width: 100%"
placeholder="请选择巡检配置">
<el-option
v-for="dict in configList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="设备编码" prop="equipmentCode">
<el-input v-model="dataForm.equipmentCode" disabled clearable placeholder="请输入设备编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="巡检人" prop="responsible">
<el-input v-model="dataForm.responsible" :disabled="isdetail" clearable placeholder="请输入巡检人" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="巡检时间" prop="actualTime">
<el-date-picker
v-model="dataForm.actualTime"
type="date"
:disabled="isdetail"
format='yyyy-MM-dd'
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择巡检时间" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="巡检内容">
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="list" />
</el-form-item>
<el-form-item label="巡检详情" prop="description">
<editor v-model="dataForm.description" :read-only="isdetail" :min-height="380"/>
</el-form-item>
<el-form-item label="附件">
<FileUpload v-model="file" :disabled="isdetail" />
</el-form-item>
</el-form>
<div class="drawer-body__footer">
<el-button type="primary" @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>
<!-- <attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
:config-id="dataForm.id"
@refreshDataList="getList" /> -->
</el-drawer>
</template>
<script>
import SmallTitle from '../../../base/alarm/Record/SmallTitle.vue';
import { createCheckLog, updateCheckLog, getcheckAllList, getcheckConfigByEqList, getEqCheckLog } from '@/api/equipment/base/inspection/record'
import { getEquipmentAll } from '@/api/base/equipment'
import Editor from "@/components/Editor";
// import FileUpload from "@/components/FileUpload";
// import { parseTime } from '../../../../core/mixins/code-filter';
// import attrAdd from './attr-add';
import FileUpload from "@/components/FileUpload";
const tableBtn = [
{
type: 'delete',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'program',
label: '巡检项目',
},
{
prop: 'content',
label: '巡检内容',
}
];
export default {
name: 'AddRecord',
model: {
prop: 'dataForm',
event: 'update',
},
emits: ['update'],
components: { SmallTitle, Editor, FileUpload },
props: {
// dataForm: {
// type: Object,
// default: () => ({}),
// },
// disabled: {
// type: Boolean,
// default: false
// },
},
data() {
return {
tableBtn,
tableProps,
addOrUpdateVisible: false,
formLoading: true,
visible: false,
isdetail: false,
dataForm: {
id: undefined,
configId: undefined,
equipmentId: undefined,
actualTime: undefined,
responsible: undefined,
description: undefined
},
list: [],
eqList: [],
configList: [],
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
},
file: '',
dataRule: {
responsible: [{ required: true, message: "巡检人不能为空", trigger: "blur" }],
actualTime: [{ required: true, message: "巡检时间不能为空", trigger: "blur" }]
}
};
},
mounted() {
this.getDict()
},
methods: {
async getDict() {
const res = await getEquipmentAll()
this.eqList = res.data
const configres = await getcheckConfigByEqList()
this.configList = configres.data
},
goback() {
this.$emit('refreshDataList');
this.visible = false;
},
goEdit() {
this.isdetail = false;
},
/** 模拟透传 ref */
validate(cb) {
return this.$refs.dataForm.validate(cb);
},
resetFields(args) {
return this.$refs.dataForm.resetFields(args);
},
init(id, isdetail) {
// this.initData();
this.isdetail = isdetail || false;
this.dataForm.id = id || undefined;
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
//
getEqCheckLog(this.dataForm.id).then(response => {
this.formLoading = false
this.dataForm = response.data;
});
} else {
// if (this.urlOptions.isGetCode) {
// this.getCode()
// }
}
});
this.formLoading = false
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定要删除名称为${raw.data.sparePartName}的数据?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
deleteConfigDet(raw.data.id).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getList();
},
});
});
})
.catch(() => {});
} else {
this.addNew(raw.data.id);
}
},
getList() {
//
getcheckAllList({
...this.listQuery,
configId: this.dataForm.id,
}).then((response) => {
this.list = response.data.list;
this.listQuery.total = response.data.total;
});
},
// /
addNew(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
},
//
dataFormSubmit() {
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false;
}
if (this.file) {
const temp = this.file.split(',') //
let arry = []
temp.forEach(item => {
arry.push({
fileType: 2,
fileUrl: item
})
})
this.dataForm.files = arry
}
//
if (this.dataForm.id) {
updateCheckLog(this.dataForm).then(response => {
this.$modal.msgSuccess("修改成功");
this.visible = false;
this.$emit("refreshDataList");
});
return;
}
//
createCheckLog(this.dataForm).then(response => {
this.$modal.msgSuccess("新增成功");
this.visible = false;
this.$emit("refreshDataList");
});
});
}
},
};
</script>
<style scoped>
.el-date-editor,
.el-select {
width: 100%;
}
.drawer-body__footer {
display: flex;
justify-content: flex-end;
padding: 18px;
}
.action_btn {
float: right;
margin: 5px 15px;
font-size: 14px;
}
.add {
color: #0b58ff;
}
.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;
margin: 10px 0;
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;
}
</style>

View File

@ -0,0 +1,148 @@
<template>
<el-dialog
:visible.sync="visible"
:width="'35%'"
:append-to-body="true"
:close-on-click-modal="false"
class="dialog">
<template #title>
<slot name="title">
<div class="titleStyle">
{{ !dataForm.id ? '新增' : '编辑' }}
</div>
</slot>
</template>
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="备品备件" prop="sparePartId">
<el-select
v-model="dataForm.sparePartId"
filterable
style="width: 100%"
placeholder="请选择备品备件">
<el-option
v-for="dict in partList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-form>
<el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row>
</el-dialog>
</template>
<script>
import {
createConfigDet,
getSparePartList
} from '@/api/equipment/base/spare-parts/config';
export default {
props: {
configId: {
type: String,
default: '',
},
},
data() {
return {
visible: false,
dataForm: {
id: undefined,
sparePartId: ''
},
partList: [],
dataRule: {
sparePartId: [{ required: true, message: '备品备件不能为空', trigger: 'change' }]
},
};
},
mounted() {
this.getDict()
},
methods: {
async getDict() {
const res = await getSparePartList()
this.partList = res.data
},
init(id) {
this.dataForm.id = id || '';
this.visible = true;
// this.$nextTick(() => {
// this.$refs['dataForm'].resetFields();
// if (this.dataForm.id) {
// getCoreProductAttr({
// id: this.dataForm.id
// }).then((res) => {
// const { name, value } = res.data;
// this.dataForm.name = name;
// this.dataForm.value = value;
// });
// }
// });
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
// if (this.dataForm.id) {
// updateCoreProductAttr({
// ...this.dataForm,
// productId: this.productId,
// }).then((response) => {
// this.$modal.msgSuccess('');
// this.visible = false;
// this.$emit('refreshDataList');
// });
// return;
// }
//
createConfigDet({
...this.dataForm,
configId: this.configId,
}).then((response) => {
this.$modal.msgSuccess('新增成功');
this.visible = false;
this.$emit('refreshDataList');
});
}
});
},
},
};
</script>
<style scoped>
.dialog >>> .el-dialog__body {
padding: 30px 24px;
}
.dialog >>> .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.dialog >>> .el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
</style>

View File

@ -45,24 +45,32 @@
:has-files="true"
:rows="rows" />
</base-dialog>
<addRecord
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getList" />
</div>
</template>
<script>
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import addRecord from './addRecord.vue';
import { exportCheckLogExcel } from '@/api/equipment/base/inspection/record'
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
export default {
name: 'EquipmentRepair',
components: {},
components: { addRecord },
mixins: [basicPageMixin],
data() {
return {
addOrUpdateVisible: false,
searchBarKeys: ['equipmentId', 'createTime'],
tableBtn: [
this.$auth.hasPermi('equipment:check-record:update')
this.$auth.hasPermi('equipment:check-record:detail')
? {
type: 'detail',
btnName: '详情',
@ -129,6 +137,9 @@ export default {
plain: true,
color: 'success',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('equipment:check-record:export')
? 'button'
@ -288,18 +299,26 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = '添加维修记录';
// this.reset();
// this.open = true;
// this.title = '';
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init();
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
this.info({ id }).then((response) => {
this.form = response.data;
this.open = true;
this.title = '修改维修记录';
// this.reset();
// const id = row.id;
// this.info({ id }).then((response) => {
// this.form = response.data;
// this.open = true;
// this.title = '';
// });
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(row.id);
});
},
/** 提交按钮 */
@ -340,12 +359,9 @@ export default {
.catch(() => {});
},
handleDetail({ id }) {
this.reset();
this.mode = 'detail';
this.info({ id }).then((response) => {
this.form = response.data;
this.open = true;
this.title = '修改维修记录';
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id, true);
});
},
/** 导出按钮操作 */
@ -355,13 +371,13 @@ export default {
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal
.confirm('是否确认导出所有维修记录?')
.confirm('是否确认导出所有设备巡检记录?')
.then(() => {
this.exportLoading = true;
return exportEquipmentTypeExcel(params);
return exportCheckLogExcel(params);
})
.then((response) => {
this.$download.excel(response, '维修记录.xls');
this.$download.excel(response, '设备巡检记录.xls');
this.exportLoading = false;
})
.catch(() => {});

View 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>

View File

@ -0,0 +1,317 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-09 11:09:26
* @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 ? '详情' : '添加巡检' }}
</small-title>
<div class="content">
<div class="visual-part">
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="100px"
label-position="top">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="设备名称" prop="equipmentName">
<el-input v-model="dataForm.equipmentName" disabled clearable placeholder="请输入设备名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备编码" prop="equipmentCode">
<el-input
v-model="dataForm.equipmentCode"
clearable
disabled
placeholder="请输入设备编码" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div class="attr-list">
<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;" @click="addNew()">
<svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" />
<span class="add">添加</span>
</span>
</template>
</div>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="checkDetList">
<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 class="drawer-body__footer">
<el-button type="primary" @click="goback()">关闭</el-button>
</div>
</div>
</div>
<attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
:config-id="dataForm.id"
@refreshDataList="getList" />
</el-drawer>
</template>
<script>
import { getEqCheck, getCheckDetPage, deleteCheckDet } from "@/api/equipment/base/inspection/settings";
import SmallTitle from './SmallTitle';
import attrAdd from './attr-add';
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
const tableBtn = [
{
type: 'edit',
btnName: '编辑',
},
{
type: 'delete',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'program',
label: '巡检项目',
},
{
prop: 'content',
label: '巡检内容',
},
{
prop: 'code',
label: '巡检内容编码',
},
{
prop: 'description',
label: '备注',
},
];
export default {
components: { SmallTitle, attrAdd },
data() {
return {
tableBtn,
tableProps,
addOrUpdateVisible: false,
urlOptions: {
infoURL: getEqCheck,
},
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
},
dataForm: {
id: undefined,
code: undefined,
name: '',
materialType: undefined,
productType: undefined,
area: undefined,
specifications: undefined,
processTime: 0,
remark: undefined,
unit: undefined
},
checkDetList: [],
visible: false,
isdetail: false,
dataRule: {
code: [{ required: true, message: "物料编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "物料名称不能为空", trigger: "blur" }],
materialType: [{ required: true, message: "物料类型不能为空", trigger: "change" }],
productType: [{ required: true, message: "产品类型不能为空", trigger: "change" }],
processTime: [{ required: true, message: "产线生产单位用时不能为空", trigger: "blur" }]
}
};
},
mounted() {},
methods: {
initData() {
this.checkDetList.splice(0);
this.listQuery.total = 0;
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定对${
raw.data.attrName
? '[名称=' + raw.data.attrName + ']'
: '[序号=' + raw.data._pageIndex + ']'
}进行删除操作?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
deleteCheckDet(raw.data.id).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getList();
},
});
});
})
.catch(() => {});
} else {
this.addNew(raw.data.id);
}
},
getList() {
//
getCheckDetPage({
...this.listQuery,
configId: this.dataForm.id,
}).then((response) => {
this.checkDetList = response.data.list;
this.listQuery.total = response.data.total;
});
},
init(id, isdetail) {
this.initData();
this.isdetail = isdetail || false;
this.dataForm.id = id || undefined;
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
//
this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data
});
//
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);
});
}
}
};
</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: 5px 15px;
font-size: 14px;
}
.add {
color: #0b58ff;
}
</style>

View File

@ -0,0 +1,145 @@
<template>
<el-dialog
:visible.sync="visible"
:width="'35%'"
:append-to-body="true"
:close-on-click-modal="false"
class="dialog">
<template #title>
<slot name="title">
<div class="titleStyle">
{{ !dataForm.id ? '新增' : '编辑' }}
</div>
</slot>
</template>
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="巡检" prop="checkId">
<el-select v-model="dataForm.checkId" filterable placeholder="请选择巡检" style="width: 100%">
<el-option v-for="dict in checkList" :key="dict.id" :label="dict.content"
:value="dict.id" />
</el-select>
</el-form-item>
<el-form-item label="备注" prop="description">
<el-input
v-model="dataForm.description"
placeholder="请输入备注"
clearable />
</el-form-item>
</el-form>
<el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row>
</el-dialog>
</template>
<script>
import { getCheckDet, createCheckDet, updateCheckDet, getcheckList } from "@/api/equipment/base/inspection/settings";
export default {
props: {
configId: {
type: String,
default: '',
},
},
data() {
return {
visible: false,
dataForm: {
id: undefined,
checkId: undefined,
configId: undefined,
description: ''
},
checkList: [],
dataRule: {
checkId: [{ required: true, message: '巡检不能为空', trigger: 'blur' }],
},
};
},
mounted() {
this.getDict()
},
methods: {
async getDict() {
const res = await getcheckList()
this.checkList = res.data
},
init(id) {
this.dataForm.id = id || '';
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
getCheckDet(this.dataForm.id).then((res) => {
// const { name, value } = res.data;
// this.dataForm.name = name;
// this.dataForm.value = value;
this.dataForm = res.data
});
}
});
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
if (this.dataForm.id) {
updateCheckDet({
...this.dataForm,
configId: this.configId
}).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
//
createCheckDet({
...this.dataForm,
configId: this.configId,
}).then((response) => {
this.$modal.msgSuccess('新增成功');
this.visible = false;
this.$emit('refreshDataList');
});
}
});
},
},
};
</script>
<style scoped>
.dialog >>> .el-dialog__body {
padding: 30px 24px;
}
.dialog >>> .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.dialog >>> .el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
</style>

View File

@ -17,7 +17,7 @@
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:width="120"
:width="180"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
@ -45,35 +45,49 @@
:has-files="false"
:rows="rows" />
</base-dialog>
<!-- 添加巡检查看详情 -->
<addOrUpdata
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getList" />
</div>
</template>
<script>
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import addOrUpdata from './add-or-updata.vue';
// import { publicFormatter } from '@/utils/dict';
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
export default {
name: 'EquipmentCheckSetting',
components: {},
components: { addOrUpdata },
mixins: [basicPageMixin],
data() {
return {
addOrUpdateVisible: false,
addOrEditTitle: '',
searchBarKeys: ['equipmentId', 'name'],
tableBtn: [
// this.$auth.hasPermi('equipment:check-setting:update')
// ? {
// type: 'detail',
// btnName: '',
// }
// : undefined,
this.$auth.hasPermi('equipment:check-setting:update')
? {
type: 'edit',
btnName: '修改',
}
: undefined,
this.$auth.hasPermi('equipment:check-setting:update')
? {
type: 'detail',
btnName: '查看详情',
}
: undefined,
this.$auth.hasPermi('equipment:check-setting:addInsp')
? {
type: 'add',
btnName: '添加巡检',
}
: undefined,
this.$auth.hasPermi('equipment:check-setting:delete')
? {
type: 'delete',
@ -285,13 +299,35 @@ export default {
})
.catch(() => {});
},
//
handleTableBtnClick({ data, type }) {
switch (type) {
case 'edit':
this.handleUpdate(data);
break;
case 'delete':
this.handleDelete(data);
break;
case 'detail':
this.handleDetail(data);
break;
case 'add':
this.handleAddDetail(data);
break;
}
},
handleDetail({ id }) {
this.reset();
this.mode = 'detail';
this.info({ id }).then((response) => {
this.form = response.data;
this.open = true;
this.title = '修改巡检设置';
this.addOrUpdateVisible = true;
this.addOrEditTitle = "详情";
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id, true);
});
},
handleAddDetail({ id }) {
this.addOrUpdateVisible = true;
this.addOrEditTitle = "添加巡检";
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
},
/** 导出按钮操作 */

View File

@ -92,7 +92,7 @@ const btn = {
},
methods: {
handleClick() {
this.$emit('emitData', { action: this.injectData.label, value: null });
this.$emit('emitData', { action: this.injectData.label, value: this.injectData });
},
},
render: function (h) {
@ -224,11 +224,18 @@ export default {
switch (action) {
//
case '设备保养':
alert('设备保养');
this.$router.push({ path: '/equipment/base/maintain/plan-config',query: {
equipmentId: value.equipmentId,
equipmentName: value.equipmentName
} })
break;
case '保养记录':
alert('保养记录');
break;
const queryData = {
equipmentId: value.equipmentId,
maintainPlanId: value.id
}
this.$router.push({ path: '/equipment/base/maintain/record',query: queryData })
break;
}
},
/** 查询列表 */

View File

@ -110,8 +110,8 @@ export default {
label: '时间段',
dateType: 'daterange', // datetimerange
format: 'yyyy-MM-dd',
// valueFormat: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'timestamp',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
// valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始日期',
endPlaceholder: '结束日期',
@ -239,6 +239,10 @@ export default {
};
},
created() {
if (this.$route.query) {
this.queryParams.equipmentId = this.$route.query?.equipmentId ?? undefined
this.searchBarFormConfig[0].defaultSelect = this.$route.query.equipmentName ?? undefined
}
this.getList();
},
methods: {
@ -288,12 +292,20 @@ export default {
this.open = true;
this.title = '添加保养计划';
},
handleDetail(id){
handleDetail(row){
// alert(' ')
this.$router.push({
name: 'Record',
// params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime }
})
// console.log(row)
const queryData = {
equipmentId: row.equipmentId,
maintainPlanId: row.id,
relatePlan: row.enabled
}
if (this.queryParams.createTime) {
queryData.createTime = this.queryParams.createTime
}
console.log('你好', queryData)
this.$router.push({ path: '/equipment/base/maintain/record',query: queryData })
// this.$router.push({ path: '/equipment/base/maintain/record', query: { orderNo: row.orderNo }})
},
/** 修改按钮操作 */
handleUpdate(row) {

View File

@ -52,6 +52,7 @@
<script>
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import Editor from '@/components/Editor';
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
@ -192,13 +193,13 @@ export default {
select: true,
label: '保养人员',
prop: 'maintainWorker',
// url: '/base/core-equipment/listAll',
url: '/base/core-worker/listAll',
valueKey: 'name',
bind: {
filterable: true,
clearable: true,
multiple: true,
},
selectOptions: [{ name: 'test', id: 'test' }],
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
},
{
@ -212,6 +213,11 @@ export default {
switch: true,
label: '是否计划保养',
prop: 'relatePlan',
bind: {
'active-value': 1,
'inactive-value': 2,
},
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
},
{},
{
@ -266,7 +272,9 @@ export default {
},
],
// TODO:
[{ input: true, label: '保养描述', prop: 'maintenanceDes' }],
[{ label: '保养描述', prop: 'maintenanceDes', subcomponent: Editor, bind: {
'min-height': 192
} }],
[{ input: true, label: '备注', prop: 'remark' }],
],
//
@ -289,6 +297,16 @@ export default {
},
created() {
this.initSearchBar();
if (this.$route.query) {
this.queryParams.equipmentId = this.$route.query?.equipmentId ?? undefined
this.queryParams.maintainPlanId = this.$route.query?.maintainPlanId ?? undefined
this.queryParams.relatePlan = this.$route.query?.relatePlan ?? undefined
this.queryParams.startTime = this.$route.query?.createTime ?? undefined
this.searchBarFormConfig[0].defaultSelect = this.$route.query.equipmentId ?? undefined
this.searchBarFormConfig[1].defaultSelect = Number(this.$route.query.maintainPlanId) ?? undefined
this.searchBarFormConfig[2].defaultSelect = this.$route.query?.createTime ?? undefined
this.searchBarFormConfig[3].defaultSelect = Number(this.$route.query.relatePlan) ?? undefined
}
this.getList();
},
methods: {
@ -380,6 +398,7 @@ export default {
this.info({ id }).then((response) => {
this.form = response.data;
this.open = true;
this.form.maintainWorker = this.form.maintainWorker.split(',')
this.title = '修改保养记录';
});
},
@ -389,6 +408,7 @@ export default {
if (!valid) {
return;
}
this.form.maintainWorker = this.form.maintainWorker.join(',')
//
if (this.form.id != null) {
this.put(this.form).then((response) => {

View File

@ -6,155 +6,179 @@
-->
<template>
<el-form
ref="form"
:model="dataForm"
label-width="100px"
v-loading="formLoading">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="维修单号" prop="code">
<span>{{ dataForm.code }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="设备名称" prop="code">
<span>{{ dataForm.code }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="维修工" prop="code">
<span>{{ dataForm.code }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="故障发生时间" prop="code">
<span>{{ dataForm.code }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="故障级别" prop="code">
<span>{{ dataForm.code }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系方式" prop="code">
<span>{{ dataForm.code }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item
label="维修开始时间"
prop="alarmCode"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-date-picker
v-model="dataForm.startTIme"
type="datetime"
:disabled="disabled"
:placeholder="请选择维修开始时间"
value-format="timestamp"
@change="$emit('update', form)"></el-date-picker>
</el-form-item>
</el-col>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="false"
class="drawer"
size="60%">
<small-title slot="title" :no-padding="true">
{{ disabled ? '查看详情' : !dataForm.maintenanceStatus ? '修改' : '完成' }}
</small-title>
<el-form
ref="form"
:model="dataForm"
label-width="100px"
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>{{ dataForm.faultTime }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="故障级别" prop="faultLevel">
<span>{{ 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>
<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
{{ '可编辑信息' }}
</small-title>
<el-row :gutter="20">
<el-col :span="8">
<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="8">
<el-form-item
label="维修结束时间"
prop="alarmCode"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-date-picker
v-model="dataForm.startTIme"
type="datetime"
:disabled="disabled"
:placeholder="请选择维修开始时间"
value-format="timestamp"
@change="$emit('update', form)"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item
label="维修结束时间"
prop="maintenanceFinishTime"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-date-picker
v-model="dataForm.maintenanceFinishTime"
type="datetime"
:disabled="disabled"
placeholder="请选择维修开始时间"
value-format="timestamp" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item
label="维修方式"
prop="grade"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-select
:disabled="disabled"
v-model="dataForm.grade"
placeholder="请选择报警级别"
@change="$emit('update', dataForm)">
<el-option
v-for="opt in getDictDatas(DICT_TYPE.EQU_ALARM_LEVEL)"
: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="8">
<el-form-item label="故障类型" prop="alarmCode">
<el-select
:disabled="disabled"
v-model="dataForm.grade"
placeholder="请选择报警级别"
@change="$emit('update', dataForm)">
<el-option
v-for="opt in getDictDatas(DICT_TYPE.EQU_ALARM_LEVEL)"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-col :span="8">
<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-row>
<el-row :gutter="20">
<el-col :span="8">
<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="dsfsdfasd"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<!-- // -->
</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="380"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col>
<el-form-item label="维修记录" prop="dsfsdfasd">
<!-- // -->
</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="380"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col>
<el-form-item label="维修附件" prop="dsfsdfasd">
<el-upload></el-upload>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col>
<el-form-item label="维修附件" prop="file">
<FileUpload v-model="file" :disabled="disabled" />
</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"
@change="$emit('update', form)"
:placeholder="`请输入备注`"
:disabled="disabled" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<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 class="drawer-body__footer">
<el-button style="" @click="goback()">取消</el-button>
<el-button v-if="disabled" type="primary" @click="goEdit()">
编辑
</el-button>
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button>
</div>
</el-drawer>
</template>
<script>
import SmallTitle from '../../base/alarm/Record/SmallTitle.vue';
import { getEqRepair, updateEqRepair } from '@/api/equipment/base/repair'
import Editor from "@/components/Editor";
import FileUpload from "@/components/FileUpload";
import { getDictDatas } from "@/utils/dict";
export default {
name: 'DialogForm',
model: {
@ -162,32 +186,35 @@ export default {
event: 'update',
},
emits: ['update'],
components: {},
components: { SmallTitle, Editor, FileUpload },
props: {
dataForm: {
type: Object,
default: () => ({}),
},
disabled: {
type: Boolean,
default: false,
},
// dataForm: {
// type: Object,
// default: () => ({}),
// },
// disabled: {
// type: Boolean,
// default: false
// },
},
data() {
return {
formLoading: true,
visible: false,
disabled: false,
dataForm: {},
file: ''
};
},
mounted() {
this.getCode('/base/equipment-group-alarm/getCode').then((code) => {
this.formLoading = false;
this.$emit('update', {
...this.dataForm,
code,
});
});
},
mounted() {},
methods: {
goback() {
this.$emit('refreshDataList');
this.visible = false;
},
goEdit() {
this.isdetail = false;
},
/** 模拟透传 ref */
validate(cb) {
return this.$refs.form.validate(cb);
@ -195,22 +222,124 @@ export default {
resetFields(args) {
return this.$refs.form.resetFields(args);
},
async handleTypeChange(id) {
// debugger;
this.dataForm.alarmCode = '';
this.$emit('update', this.dataForm);
},
async getCode(url) {
const response = await this.$axios(url);
return response.data;
init(row, isdetail) {
// this.initData();
this.disabled = isdetail || false;
this.dataForm.id = row.id || undefined;
this.visible = true;
console.log('111', this.dataForm, row)
this.$nextTick(() => {
this.$refs['form'].resetFields();
if (this.dataForm.id) {
//
getEqRepair(this.dataForm.id).then(response => {
this.formLoading = false
this.dataForm = response.data;
this.dataForm.maintenanceStatus = row.maintenanceStatus || 0
});
} 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({
fileType: 2,
fileUrl: item
})
})
this.dataForm.files = arry
}
if (this.dataForm.id) {
updateEqRepair(this.dataForm).then(response => {
this.$modal.msgSuccess("修改成功");
this.visible = false;
this.$emit("refreshDataList");
});
return;
}
//
// this.urlOptions.createURL(this.dataForm).then(response => {
// this.$modal.msgSuccess("");
// this.visible = false;
// this.$emit("refreshDataList");
// });
});
},
},
};
</script>
<style scoped lang="scss">
<style scoped>
.el-date-editor,
.el-select {
width: 100%;
}
.drawer-body__footer {
display: flex;
justify-content: flex-end;
padding: 18px;
}
.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;
}
</style>

View File

@ -17,7 +17,7 @@
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:width="120"
:width="180"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
@ -45,21 +45,27 @@
:has-files="true"
:rows="rows" />
</base-dialog>
<CustomDialogForm
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getList" />
</div>
</template>
<script>
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import CustomDialogForm from './CustomDialogForm.vue';
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
export default {
name: 'EquipmentRepair',
components: {},
components: { CustomDialogForm },
mixins: [basicPageMixin],
data() {
return {
addOrUpdateVisible: false,
searchBarKeys: ['maintenanceStatus', 'createTime', 'equipmentId'],
tableBtn: [
this.$auth.hasPermi('equipment:repair:update')
@ -68,6 +74,12 @@ export default {
btnName: '详情',
}
: undefined,
this.$auth.hasPermi('equipment:repair:finish')
? {
type: 'finish',
btnName: '完成',
}
: undefined,
this.$auth.hasPermi('equipment:repair:update')
? {
type: 'edit',
@ -156,6 +168,7 @@ export default {
input: true,
label: '维修单号',
prop: 'repairOrderNumber',
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
},
{
select: true,
@ -172,16 +185,18 @@ export default {
[
{
// TODO:
select: true,
// select: true,
input: true,
label: '维修工',
prop: 'repairman',
// url: '/base/core-equipment/listAll',
// url: '/base/core-worker/listAll',
// valueKey: 'name',
bind: {
filterable: true,
clearable: true,
multiple: true,
// multiple: true,
},
options: [{ label: 'test', value: 'test' }],
// options: [{ label: 'test', value: 'test' }],
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
},
{
@ -306,12 +321,28 @@ export default {
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
this.info({ id }).then((response) => {
this.form = response.data;
this.open = true;
this.title = '修改维修记录';
// this.reset();
// const id = row.id;
// this.info({ id }).then((response) => {
// this.form = response.data;
// // this.form.repairman = this.form.repairman.split(',')
// this.open = true;
// this.title = '';
// });
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init({id: row.id});
});
},
/** 完成按钮操作 */
handlFinish(row) {
this.addOrUpdateVisible = true
const params = {
id: row.id,
maintenanceStatus: 1
}
this.$nextTick(() => {
this.$refs.addOrUpdate.init(params);
});
},
/** 提交按钮 */
@ -320,6 +351,9 @@ export default {
if (!valid) {
return;
}
// if (this.form.repairman) {
// this.form.repairman = this.form.repairman.join(',')
// }
//
if (this.form.id != null) {
this.put(this.form).then((response) => {
@ -352,12 +386,9 @@ export default {
.catch(() => {});
},
handleDetail({ id }) {
this.reset();
this.mode = 'detail';
this.info({ id }).then((response) => {
this.form = response.data;
this.open = true;
this.title = '修改维修记录';
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init({id: id}, true);
});
},
/** 导出按钮操作 */
@ -378,6 +409,23 @@ export default {
})
.catch(() => {});
},
//
handleTableBtnClick({ data, type }) {
switch (type) {
case 'edit':
this.handleUpdate(data);
break;
case 'delete':
this.handleDelete(data);
break;
case 'detail':
this.handleDetail(data);
break;
case 'finish':
this.handlFinish(data);
break;
}
}
},
};
</script>

View File

@ -0,0 +1,315 @@
<!--
filename: dialogForm.vue
author: liubin
date: 2023-10-31 15:55:13
description:
-->
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="false"
class="drawer"
size="60%">
<small-title slot="title" :no-padding="true">
{{ disabled ? '查看备件' : '添加备件' }}
</small-title>
<el-form
ref="form"
:model="dataForm"
label-width="100px"
v-loading="formLoading">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="配置名" prop="name">
<span>{{ dataForm.name }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备名称" prop="equipmentName">
<span>{{ dataForm.equipmentName }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="负责人" prop="responsible">
<span>{{ dataForm.responsible }}</span>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="描述" prop="faultTime">
<editor v-model="dataForm.description" read-only :min-height="200"/>
</el-form-item>
</el-form>
<div v-if="!disabled" class="action_btn">
<template>
<span style="display: inline-block;" @click="addNew()">
<svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" />
<span class="add">添加</span>
</span>
</template>
</div>
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="list">
<method-btn
v-if="!disabled"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
v-show="listQuery.total > 0"
:total="listQuery.total"
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:page-sizes="[5, 10, 15]"
@pagination="getList" />
<div class="drawer-body__footer">
<el-button type="primary" @click="goback()">关闭</el-button>
<el-button v-if="disabled" type="primary" @click="goEdit()">
编辑
</el-button>
</div>
<attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
:config-id="dataForm.id"
@refreshDataList="getList" />
</el-drawer>
</template>
<script>
import SmallTitle from '../../../base/alarm/Record/SmallTitle.vue';
import { getSparePartConfig, deleteConfigDet, getConfigDetPage } from '@/api/equipment/base/spare-parts/config'
import Editor from "@/components/Editor";
// import FileUpload from "@/components/FileUpload";
import { parseTime } from '../../../../core/mixins/code-filter';
import attrAdd from './attr-add';
const tableBtn = [
{
type: 'delete',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime,
},
{
prop: 'sparePartName',
label: '备品备件',
},
{
prop: 'life',
label: '使用寿命(h)',
},
{
prop: 'remark',
label: '备注'
},
];
export default {
name: 'DialogForm',
model: {
prop: 'dataForm',
event: 'update',
},
emits: ['update'],
components: { SmallTitle, Editor, attrAdd },
props: {
// dataForm: {
// type: Object,
// default: () => ({}),
// },
// disabled: {
// type: Boolean,
// default: false
// },
},
data() {
return {
tableBtn,
tableProps,
addOrUpdateVisible: false,
formLoading: true,
visible: false,
disabled: false,
dataForm: {},
list: [],
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
},
};
},
mounted() {},
methods: {
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);
},
init(id, isdetail) {
// this.initData();
this.disabled = isdetail || false;
this.dataForm.id = id || undefined;
this.visible = true;
this.$nextTick(() => {
this.$refs['form'].resetFields();
if (this.dataForm.id) {
//
getSparePartConfig(this.dataForm.id).then(response => {
this.formLoading = false
this.dataForm = response.data;
});
} else {
// if (this.urlOptions.isGetCode) {
// this.getCode()
// }
}
});
this.formLoading = false
},
handleClick(raw) {
if (raw.type === 'delete') {
this.$confirm(
`确定要删除名称为${raw.data.sparePartName}的数据?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
deleteConfigDet(raw.data.id).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getList();
},
});
});
})
.catch(() => {});
} else {
this.addNew(raw.data.id);
}
},
getList() {
//
getConfigDetPage({
...this.listQuery,
configId: this.dataForm.id,
}).then((response) => {
this.list = response.data.list;
this.listQuery.total = response.data.total;
});
},
// /
addNew(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
}
},
};
</script>
<style scoped>
.el-date-editor,
.el-select {
width: 100%;
}
.drawer-body__footer {
display: flex;
justify-content: flex-end;
padding: 18px;
}
.action_btn {
float: right;
margin: 5px 15px;
font-size: 14px;
}
.add {
color: #0b58ff;
}
.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;
}
</style>

View File

@ -0,0 +1,148 @@
<template>
<el-dialog
:visible.sync="visible"
:width="'35%'"
:append-to-body="true"
:close-on-click-modal="false"
class="dialog">
<template #title>
<slot name="title">
<div class="titleStyle">
{{ !dataForm.id ? '新增' : '编辑' }}
</div>
</slot>
</template>
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="备品备件" prop="sparePartId">
<el-select
v-model="dataForm.sparePartId"
filterable
style="width: 100%"
placeholder="请选择备品备件">
<el-option
v-for="dict in partList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-form>
<el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row>
</el-dialog>
</template>
<script>
import {
createConfigDet,
getSparePartList
} from '@/api/equipment/base/spare-parts/config';
export default {
props: {
configId: {
type: String,
default: '',
},
},
data() {
return {
visible: false,
dataForm: {
id: undefined,
sparePartId: ''
},
partList: [],
dataRule: {
sparePartId: [{ required: true, message: '备品备件不能为空', trigger: 'change' }]
},
};
},
mounted() {
this.getDict()
},
methods: {
async getDict() {
const res = await getSparePartList()
this.partList = res.data
},
init(id) {
this.dataForm.id = id || '';
this.visible = true;
// this.$nextTick(() => {
// this.$refs['dataForm'].resetFields();
// if (this.dataForm.id) {
// getCoreProductAttr({
// id: this.dataForm.id
// }).then((res) => {
// const { name, value } = res.data;
// this.dataForm.name = name;
// this.dataForm.value = value;
// });
// }
// });
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
// if (this.dataForm.id) {
// updateCoreProductAttr({
// ...this.dataForm,
// productId: this.productId,
// }).then((response) => {
// this.$modal.msgSuccess('');
// this.visible = false;
// this.$emit('refreshDataList');
// });
// return;
// }
//
createConfigDet({
...this.dataForm,
configId: this.configId,
}).then((response) => {
this.$modal.msgSuccess('新增成功');
this.visible = false;
this.$emit('refreshDataList');
});
}
});
},
},
};
</script>
<style scoped>
.dialog >>> .el-dialog__body {
padding: 30px 24px;
}
.dialog >>> .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.dialog >>> .el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
</style>

View File

@ -17,7 +17,7 @@
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:width="120"
:width="250"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
@ -46,6 +46,10 @@
:has-files="false"
:rows="rows" />
</base-dialog>
<addSparts
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getList" />
</div>
</template>
@ -53,15 +57,18 @@
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { publicFormatter } from '@/utils/dict';
import Editor from '@/components/Editor';
import addSparts from './addSparts.vue';
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
export default {
name: 'EquipmentSparePartsConfig',
components: {},
components: { addSparts },
mixins: [basicPageMixin],
data() {
return {
addOrUpdateVisible: false,
searchBarKeys: ['name', 'equipmentId', 'equipmentIdList'],
tableBtn: [
// this.$auth.hasPermi('equipment:spare-parts-config:update')
@ -76,6 +83,18 @@ export default {
btnName: '修改',
}
: undefined,
this.$auth.hasPermi('equipment:spare-parts-config:queryParts')
? {
type: 'queryParts',
btnName: '查看备件',
}
: undefined,
this.$auth.hasPermi('equipment:spare-parts-config:addParts')
? {
type: 'addParts',
btnName: '添加备件',
}
: undefined,
this.$auth.hasPermi('equipment:spare-parts-config:delete')
? {
type: 'delete',
@ -162,18 +181,23 @@ export default {
select: true, // TODO: or INPUT instead of SELECT
label: '负责人',
prop: 'responsible',
url: '/base/core-equipment/listAll', // TODO:
url: '/base/core-worker/listAll', // TODO:
valueKey: 'name',
bind: {
filterable: true,
clearable: true,
multiple: true
},
},
],
[
{
input: true,
label: '描述',
prop: 'description', // TODO:
subcomponent: Editor,
bind: {
'min-height': 192
}
},
],
],
@ -258,6 +282,7 @@ export default {
const id = row.id;
this.info({ id }).then((response) => {
this.form = response.data;
this.form.responsible = this.form.responsible.split(',')
this.open = true;
this.title = '修改备品备件配置';
});
@ -268,6 +293,7 @@ export default {
if (!valid) {
return;
}
this.form.responsible = this.form.responsible.join(',')
//
if (this.form.id != null) {
this.put(this.form).then((response) => {
@ -300,12 +326,15 @@ export default {
.catch(() => {});
},
handleDetail({ id }) {
this.reset();
this.mode = 'detail';
this.info({ id }).then((response) => {
this.form = response.data;
this.open = true;
this.title = '修改备品备件配置';
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id, true);
});
},
handlAddParts({ id }) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
},
/** 导出按钮操作 */
@ -326,6 +355,23 @@ export default {
})
.catch(() => {});
},
//
handleTableBtnClick({ data, type }) {
switch (type) {
case 'edit':
this.handleUpdate(data);
break;
case 'delete':
this.handleDelete(data);
break;
case 'queryParts':
this.handleDetail(data);
break;
case 'addParts':
this.handlAddParts(data);
break;
}
},
},
};
</script>

View File

@ -148,7 +148,7 @@ export default {
select: true,
label: '供应商',
prop: 'supplierId',
url: '/base/core-supplier/listAll', // TODO:
url: '/base/core-supplier/listAll', // TODO:
bind: {
filterable: true,
clearable: true,
@ -161,12 +161,13 @@ export default {
select: true,
label: '物料类型',
prop: 'type',
url: '/base/core-equipment/listAll', // TODO:
options: this.getDictDatas('material_type'),
// url: '/base/core-equipment/listAll', // TODO:
bind: {
filterable: true,
clearable: true,
},
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
rules: [{ required: true, message: '物料类型不能为空', trigger: 'blur' }],
},
{
input: true,

View File

@ -0,0 +1,431 @@
<!--
filename: dialogForm.vue
author: liubin
date: 2023-10-31 15:55:13
description:
-->
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="false"
class="drawer"
size="60%">
<small-title slot="title" :no-padding="true">
{{ !isLog ? '操作页面' : '更换记录' }}
</small-title>
<el-form
ref="form"
:model="dataForm"
label-width="100px"
v-loading="formLoading">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item v-if="!isLog" label="配置名" prop="name">
<span>{{ dataForm.name }}</span>
</el-form-item>
<el-form-item v-else label="产线名称" prop="lineName">
<span>{{ dataForm.lineName }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备名称" prop="equipmentName">
<span>{{ dataForm.equipmentName }}</span>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="描述" prop="faultTime">
<editor v-model="dataForm.description" read-only :min-height="200"/>
</el-form-item>
</el-form>
<div v-if="!isLog">
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="list">
<method-btn
v-if="!isLog"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
v-show="listQuery.total > 0"
:total="listQuery.total"
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:page-sizes="[5, 10, 15]"
@pagination="getList" />
</div>
<div v-else>
<!-- 搜索工作栏 -->
<SearchBar
:formConfigs="formConfig"
ref="search-bar"
@headBtnClick="buttonClick" />
<base-table
:table-props="tableProps1"
:page="listQuery1.pageNo"
:limit="listQuery1.pageSize"
:table-data="list1" />
<pagination
v-show="listQuery1.total > 0"
:total="listQuery1.total"
:page.sync="listQuery1.pageNo"
:limit.sync="listQuery1.pageSize"
:page-sizes="[5, 10, 15]"
@pagination="getList1" />
</div>
<div class="drawer-body__footer">
<el-button type="primary" @click="goback()">关闭</el-button>
</div>
<attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
:config-id="dataForm.id"
@refreshDataList="getList" />
</el-drawer>
</template>
<script>
import SmallTitle from '../../../base/alarm/Record/SmallTitle.vue';
import { getSparePartConfig } from '@/api/equipment/base/spare-parts/config'
import { getConfigDetMonitorPage, getSparePartLogPage, exportSparePartLogExcel } from '@/api/equipment/base/spare-parts/monitor'
import Editor from "@/components/Editor";
// import FileUpload from "@/components/FileUpload";
import { parseTime } from '../../../../core/mixins/code-filter';
import attrAdd from './attr-add';
const tableBtn = [
{
type: 'change',
btnName: '更换',
},
];
const tableProps = [
{
prop: 'sparePartName',
label: '备品备件',
},
{
prop: 'life',
label: '使用寿命(h)',
},
{
prop: 'timeUsed',
label: '更换耗时(min)',
},
{
prop: 'replacementTime',
label: '更换时间',
filter: parseTime
},
{
prop: 'nextReplacementTime',
label: '下次更换时间',
filter: parseTime
},
{
prop: 'color',
label: '是否超期',
},
{
prop: 'responsible',
label: '操作人',
},
{
prop: 'description',
label: '备注'
},
];
const tableProps1 = [
{
prop: 'sparePartName',
label: '备品备件',
},
{
prop: 'life',
label: '使用寿命(h)',
},
{
prop: 'timeUsed',
label: '更换耗时(min)',
},
{
prop: 'replacementTime',
label: '更换时间',
filter: parseTime
},
{
prop: 'nextReplacementTime',
label: '下次更换时间',
filter: parseTime
},
{
prop: 'responsible',
label: '操作人',
},
{
prop: 'description',
label: '备注'
},
];
export default {
name: 'DialogForm',
model: {
prop: 'dataForm',
event: 'update',
},
emits: ['update'],
components: { SmallTitle, Editor, attrAdd },
props: {
// dataForm: {
// type: Object,
// default: () => ({}),
// },
// disabled: {
// type: Boolean,
// default: false
// },
},
data() {
return {
tableBtn,
tableProps,
tableProps1,
addOrUpdateVisible: false,
formLoading: true,
visible: false,
isLog: false,
dataForm: {},
list: [],
list1: [],
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
},
listQuery1: {
pageSize: 10,
pageNo: 1,
total: 0,
replacementTime: undefined
},
formConfig: [
{
type: 'datePicker',
label: '更换时间段',
dateType: 'daterange', // datetimerange
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始日期',
endPlaceholder: '结束日期',
defaultTime: ['00:00:00', '23:59:59'],
param: 'replacementTime',
// width: 350,
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: 'button',
btnName: '导出',
name: 'export',
color: 'warning',
plain: true
},
],
};
},
mounted() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery1.pageNo = 1;
this.listQuery1.pageSize = 10;
this.listQuery1.replacementTime = val.replacementTime ? val.replacementTime : undefined;
this.getList1();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
goback() {
this.$emit('refreshDataList');
this.visible = false;
},
/** 模拟透传 ref */
validate(cb) {
return this.$refs.form.validate(cb);
},
resetFields(args) {
return this.$refs.form.resetFields(args);
},
init(id, isLog) {
// this.initData();
this.isLog = isLog || false;
this.dataForm.id = id || undefined;
this.visible = true;
this.$nextTick(() => {
this.$refs['form'].resetFields();
if (this.dataForm.id) {
//
getSparePartConfig(this.dataForm.id).then(response => {
this.formLoading = false
this.dataForm = response.data;
});
} else {
// if (this.urlOptions.isGetCode) {
// this.getCode()
// }
}
});
this.getList()
this.formLoading = false
},
handleClick(raw) {
if (raw.type === 'change') {
//
this.addNew();
} else {}
},
getList() {
//
getConfigDetMonitorPage({
...this.listQuery,
configId: this.dataForm.id,
}).then((response) => {
this.list = response.data;
this.listQuery.total = response.data.total;
});
},
getList1() {
// log
getSparePartLogPage({
...this.listQuery1,
configId: this.dataForm.id,
}).then((response) => {
this.list1 = response.data.list;
this.listQuery1.total = response.data.total;
});
},
// /
addNew(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
},
/** 导出按钮操作 */
handleExport() {
//
let params = { ...this.listQuery1 };
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal
.confirm('是否确认导出所有设备备品备件更换log数据项?')
.then(() => {
this.exportLoading = true;
return exportSparePartLogExcel(params);
})
.then((response) => {
this.$download.excel(response, '设备备品备件更换log.xls');
this.exportLoading = false;
})
.catch(() => {});
},
},
};
</script>
<style scoped>
.el-date-editor,
.el-select {
width: 100%;
}
.drawer-body__footer {
display: flex;
justify-content: flex-end;
padding: 18px;
}
.action_btn {
float: right;
margin: 5px 15px;
font-size: 14px;
}
.add {
color: #0b58ff;
}
.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;
}
</style>

View File

@ -0,0 +1,126 @@
<template>
<el-dialog
:visible.sync="visible"
:width="'35%'"
:append-to-body="true"
:close-on-click-modal="false"
class="dialog">
<template #title>
<slot name="title">
<div class="titleStyle">
{{ !dataForm.id ? '新增' : '编辑' }}
</div>
</slot>
</template>
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
@keyup.enter.native="dataFormSubmit()">
<el-form-item label="操作人" prop="responsible">
<el-input
v-model="dataForm.responsible"
clearable
placeholder="请输入操作人" />
</el-form-item>
</el-form>
<el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row>
</el-dialog>
</template>
<script>
import { createSparePartLog } from '@/api/equipment/base/spare-parts/monitor';
export default {
props: {
configId: {
type: String,
default: '',
},
},
data() {
return {
visible: false,
dataForm: {
id: undefined,
responsible: ''
},
partList: [],
dataRule: {
responsible: [{ required: true, message: '操作人不能为空', trigger: 'blur' }]
},
};
},
mounted() {
// this.getDict()
},
methods: {
// async getDict() {
// const res = await getSparePartList()
// this.partList = res.data
// },
init(id) {
this.dataForm.id = id || '';
this.visible = true;
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
// if (this.dataForm.id) {
// updateCoreProductAttr({
// ...this.dataForm,
// productId: this.productId,
// }).then((response) => {
// this.$modal.msgSuccess('');
// this.visible = false;
// this.$emit('refreshDataList');
// });
// return;
// }
//
createSparePartLog({
...this.dataForm,
configId: this.configId,
}).then((response) => {
this.$modal.msgSuccess('新增成功');
this.visible = false;
this.$emit('refreshDataList');
});
}
});
},
},
};
</script>
<style scoped>
.dialog >>> .el-dialog__body {
padding: 30px 24px;
}
.dialog >>> .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.dialog >>> .el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
</style>

View File

@ -31,7 +31,7 @@
@pagination="getList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
<!-- <base-dialog
:dialogTitle="title"
:dialogVisible="open"
width="35%"
@ -45,13 +45,20 @@
:disabled="mode == 'detail'"
:has-files="false"
:rows="rows" />
</base-dialog>
</base-dialog> -->
<addSparts
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getList" />
</div>
</template>
<script>
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { getCorePLList } from '@/api/base/coreProductionLine';
import addSparts from './addSparts.vue';
// import { publicFormatter } from '@/utils/dict';
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
@ -65,12 +72,18 @@ const remainBox = {
},
computed: {
value() {
const temp = this.injectData[this.injectData.prop] || null
if (temp) {
console.log('12', temp)
return temp === 'Green' ? 'green' : 'red'
}
return this.injectData[this.injectData.prop] || null;
},
color() {
if (this.value) {
const v = +this.value;
return v < 0 ? 'red' : v >= 0 && v < 2 ? 'yellow' : 'green';
// const v = +this.value;
// return v < 0 ? 'red' : v >= 0 && v < 2 ? 'yellow' : 'green';
return this.value
}
return 'unset';
},
@ -80,8 +93,10 @@ const remainBox = {
<div
style={`background: ${
this.color
// this.color == 'Green' ? 'green' : this.color == 'Red' ? 'red' : 'yellow'
}; position:absolute; inset: 0; padding: 0 10px; display: flex; align-items: center; color: ${
this.color == 'red' ? '#fff' : 'unset'
'unset'
// this.color == 'red' ? '#fff' : 'unset'
}`}>
{this.injectData[this.injectData.prop] || ''}
</div>
@ -97,13 +112,13 @@ const btn = {
},
methods: {
handleClick() {
this.$emit('emitData', { action: this.injectData.label, value: null });
this.$emit('emitData', { action: this.injectData.name, value: this.injectData });
},
},
render: function (h) {
return (
<el-button type="text" onClick={this.handleClick}>
{this.injectData.label}
{this.injectData.name}
</el-button>
);
},
@ -113,11 +128,12 @@ const btn = {
export default {
name: 'EquipmentSparePartsMonitor',
components: {},
components: { addSparts },
mixins: [basicPageMixin],
data() {
return {
searchBarKeys: ['name', 'equipmentId', 'equipmentIdList'],
addOrUpdateVisible: false,
searchBarKeys: ['lineId', 'equipmentId'],
tableBtn: [
// this.$auth.hasPermi('equipment:spare-parts-config:update')
// ? {
@ -125,36 +141,36 @@ export default {
// btnName: '',
// }
// : undefined,
this.$auth.hasPermi('equipment:spare-parts-config:update')
? {
type: 'edit',
btnName: '修改',
}
: undefined,
this.$auth.hasPermi('equipment:spare-parts-config:delete')
? {
type: 'delete',
btnName: '删除',
}
: undefined,
// this.$auth.hasPermi('equipment:spare-parts-config:update')
// ? {
// type: 'edit',
// btnName: '',
// }
// : undefined,
// this.$auth.hasPermi('equipment:spare-parts-config:delete')
// ? {
// type: 'delete',
// btnName: '',
// }
// : undefined,
].filter((v) => v),
tableProps: [
{ prop: 'name', label: '配置名' },
{ prop: 'lineName', label: '产线' },
{ prop: 'sectionName', label: '工段' },
{ prop: 'equipmentName', label: '设备' },
{ prop: 'lineName', label: '产线名称' },
{ prop: 'sectionName', label: '工段' },
{ prop: 'equipmentName', label: '设备名称' },
{ prop: 'responsible', label: '负责人' },
{ prop: 'equipmentCode', label: '是否超期', subcomonent: remainBox },
{ prop: 'opt1', label: '备件更换' },
{ prop: 'opt2', label: '更新记录' }, // TODO:
{ prop: 'color', label: '是否超期', subcomponent: remainBox },
{ prop: 'opt1', label: '备件更换', name: '操作', subcomponent: btn },
{ prop: 'opt2', label: '更换记录', name: '更新记录', subcomponent: btn }, // TODO:
// { prop: 'remark', label: '' },
],
searchBarFormConfig: [
{
type: 'input',
type: 'select',
label: '产线',
placeholder: '请选择产线',
param: 'name',
param: 'lineId',
},
{
type: 'select',
@ -237,7 +253,7 @@ export default {
queryParams: {
pageNo: 1,
pageSize: 10,
name: null,
lineId: null,
equipmentId: null,
},
//
@ -251,7 +267,43 @@ export default {
this.getList();
},
methods: {
handleEmitFun(val) {
console.log('emit unf', val);
switch (val.action) {
//
case '操作':
this.eqOperation(val.value); //
break;
//
case '更新记录':
this.updateLog(val.value);
break;
}
},
eqOperation({ id }) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
},
updateLog({ id }) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id, true);
});
},
initSearchBar() {
// 线
getCorePLList().then(res => {
this.$set(
this.searchBarFormConfig[0],
'selectOptions',
res.data.map((item) => ({
name: item.name,
id: item.id
}))
);
})
this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
this.$set(
this.searchBarFormConfig[1],
@ -267,7 +319,7 @@ export default {
getList() {
this.loading = true;
//
this.recv(this.queryParams).then((response) => {
this.http('/base/equipment-spare-part-config/monitor', 'get', this.queryParams).then((response) => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;

View File

@ -0,0 +1,338 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<SearchBar
:formConfigs="searchBarFormConfig"
ref="search-bar"
@headBtnClick="handleSearchBarBtnClick" />
<!-- 列表 -->
<base-table
:table-props="tableProps"
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-data="list"
@emitFun="handleEmitFun">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:width="120"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
<!-- 分页组件 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 对话框(添加 / 修改) -->
<base-dialog
:dialogTitle="title"
:dialogVisible="open"
width="60%"
@close="cancel"
@cancel="cancel"
@confirm="submitForm">
<!-- <DialogForm
v-if="open"
ref="form"
v-model="form"
:disabled="mode == 'detail'"
:has-files="false"
:rows="rows" /> -->
</base-dialog>
</div>
</template>
<script>
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { publicFormatter } from '@/utils/dict';
import { parseTime } from '@/utils/ruoyi'
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
const btn = {
name: 'tableBtn',
props: ['injectData'],
data() {
return {};
},
methods: {
handleClick() {
this.$emit('emitData', { action: this.injectData.label, value: this.injectData });
},
},
render: function (h) {
return (
<el-button type="text" onClick={this.handleClick}>
{this.injectData.name}
</el-button>
);
},
};
export default {
name: 'StatusAndParams',
mixins: [basicPageMixin],
data() {
return {
searchBarKeys: ['equipmentName', 'recordTime'],
tableBtn: [
// this.$auth.hasPermi('equipment:spare-parts-config:update')
// ? {
// type: 'detail',
// btnName: '',
// }
// : undefined,
// this.$auth.hasPermi('equipment:spare-parts-config:update')
// ? {
// type: 'edit',
// btnName: '',
// }
// : undefined,
// this.$auth.hasPermi('equipment:spare-parts-config:delete')
// ? {
// type: 'delete',
// btnName: '',
// }
// : undefined,
].filter((v) => v),
tableProps: [
{ prop: 'productionLine', label: '设备名称' },
{ prop: 'workshopSection', label: '设备编码' },
{ prop: 'equipment', label: '投入数' },
{ prop: 'productionLine', label: '产出数' },
{ prop: 'workshopSection', label: '是否运行' },
{ prop: 'equipment22', label: '状态' },
// { prop: 'alarmGrade', label: '', filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL) },
{ prop: 'productionLine', label: '是否故障' },
{ prop: 'workshopSection', label: '生产量记录时间', filter: parseTime },
{ prop: 'equipment1', label: '状态记录时间', filter: parseTime },
{ prop: 'opt1', label: '状态可视化', name: '查看', subcomponent: btn },
{ prop: 'opt2', label: '参数监控', name: '查看', subcomponent: btn } // TODO:
// { prop: 'remark', label: '' },
],
searchBarFormConfig: [
{
type: 'input',
label: '设备名',
placeholder: '请输入设备名称',
param: 'equipmentName',
},
//
{
type: 'datePicker',
label: '时间段',
dateType: 'daterange', // datetimerange
// format: 'yyyy-MM-dd HH:mm:ss',
format: 'yyyy-MM-dd',
// valueFormat: 'timestamp',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始日期',
endPlaceholder: '结束日期',
defaultTime: ['00:00:00', '23:59:59'],
param: 'recordTime',
// defaultSelect: [
// new Date(y, m, d)
// .toLocaleString()
// .split('/')
// .map((item, index) => {
// if (index == 1 || index == 2) return item.padStart(2, '0');
// return item;
// })
// .join('-'),
// new Date(y, m, d, 23, 59, 59)
// .toLocaleString()
// .split('/')
// .map((item, index) => {
// if (index == 1 || index == 2) return item.padStart(2, '0');
// return item;
// })
// .join('-'),
// ],
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
// {
// type: 'separate',
// },
// {
// type: this.$auth.hasPermi('equipment:spare-parts-config:create')
// ? 'button'
// : '',
// btnName: '',
// name: 'add',
// plain: true,
// color: 'success',
// },
// {
// type: this.$auth.hasPermi('equipment:spare-parts-config:export')
// ? 'button'
// : '',
// btnName: '',
// name: 'export',
// color: 'warning',
// },
],
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
lineId: null,
equipmentId: null,
},
basePath: '/base/equipment-alarm-log',
list: []
};
},
created() {
// this.getList();
},
methods: {
handleEmitFun(val) {
console.log('你好', val)
if (val.action === '状态可视化') {
//
} else {
//
}
},
/** 查询列表 */
getList() {
this.loading = true;
//
this.recv(this.queryParams).then((response) => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
successSubmit() {
this.cancel()
this.getList()
},
/** 取消按钮 */
cancel() {
this.open = false;
// this.mode = null;
// this.reset();
},
/** 表单重置 */
// reset() {
// this.form = {
// id: null,
// name: null,
// equipmentId: null,
// description: null,
// responsible: null
// };
// this.resetForm('form');
// },
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm');
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = '添加备品备件配置';
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
this.info({ id }).then((response) => {
this.form = response.data;
this.open = true;
this.title = '修改备品备件配置';
});
},
/** 提交按钮 */
submitForm() {
this.$refs.addOrUpdate.dataFormSubmit()
// this.$refs['form'].validate((valid) => {
// if (!valid) {
// return;
// }
// //
// if (this.form.id != null) {
// this.put(this.form).then((response) => {
// this.$modal.msgSuccess('');
// this.open = false;
// this.getList();
// });
// return;
// }
// //
// this.post(this.form).then((response) => {
// this.$modal.msgSuccess('');
// this.open = false;
// this.getList();
// });
// });
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal
.confirm('是否确认删除记录"' + row.name + '"?')
.then(function () {
return this.delete({ id });
})
.then(() => {
this.getList();
this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
},
handleDetail({ id }) {
this.reset();
this.mode = 'detail';
this.info({ id }).then((response) => {
this.form = response.data;
this.open = true;
this.title = '修改备品备件配置';
});
},
/** 导出按钮操作 */
handleExport() {
//
let params = { ...this.queryParams };
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal
.confirm('是否确认导出所有备品备件配置?')
.then(() => {
this.exportLoading = true;
return exportEquipmentTypeExcel(params);
})
.then((response) => {
this.$download.excel(response, '备品备件配置.xls');
this.exportLoading = false;
})
.catch(() => {});
},
},
};
</script>

View File

@ -432,7 +432,7 @@ export default {
/** 准备产线数据 */
async initProductline() {
const { code, data } = await this.$axios({
url: '/base/production-line/listAll',
url: '/base/core-production-line/listAll',
method: 'get',
});
if (code == 0) {
@ -448,7 +448,7 @@ export default {
/** 准备工段数据 */
async initWorksection() {
const { code, data } = await this.$axios({
url: '/base/workshop-section/listAll',
url: '/base/core-workshop-section/listAll',
method: 'get',
});
if (code == 0) {
@ -464,7 +464,7 @@ export default {
/** 根据产线获取工段 */
async getWorksectionById(lineId) {
const { code, data } = await this.$axios({
url: '/base/workshop-section/listByParentId',
url: '/base/core-workshop-section/listByParentId',
method: 'get',
params: {
id: lineId,

View File

@ -239,7 +239,7 @@ export default {
/** 准备产线数据 */
async initProductline() {
const { code, data } = await this.$axios({
url: '/base/production-line/listAll',
url: '/base/core-production-line/listAll',
method: 'get',
});
if (code == 0) {
@ -255,7 +255,7 @@ export default {
/** 准备工段数据 */
async initWorksection() {
const { code, data } = await this.$axios({
url: '/base/workshop-section/listAll',
url: '/base/core-workshop-section/listAll',
method: 'get',
});
if (code == 0) {
@ -276,7 +276,7 @@ export default {
switch (param) {
case 'lineId':
this.$axios({
url: '/base/workshop-section/listByParentId',
url: '/base/core-workshop-section/listByParentId',
method: 'get',
params: {
id: value,

View File

@ -34,7 +34,7 @@
<el-button type="primary" size="small" plain v-show="showSetting" @click="cancelSetting">取消</el-button>
</el-form-item>
<el-form-item label="请先选择查询的班组" class="rightItem">
<el-button type="primary" size="small" :disabled="jumpDisabled" @click="toOtherPage('1')">班组上下片查询</el-button>
<!-- <el-button type="primary" size="small" :disabled="jumpDisabled" @click="toOtherPage('1')">班组上下片查询</el-button> -->
<el-button type="primary" size="small" :disabled="jumpDisabled" @click="toOtherPage('2')">班组能源查询</el-button>
<el-button type="primary" size="small" :disabled="jumpDisabled" @click="toOtherPage('3')">班组检测查询</el-button>
</el-form-item>
@ -286,22 +286,18 @@ export default {
case '1':
this.$router.push({
path: '/core/enhance/product-line-24h?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime,
// name: 'ProductionLineData',
// params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime }
})
break;
case '2': //
this.$router.push({
path: '/energy/monitoring/energy-report-search?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime
// name: 'EnergyReportSearch',
// params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime }
})
break;
default:
this.$router.push({
path: '/quality/monitoring/quality-statistics',
path: '/quality/base/quality-inspection-data/detection-information/statistical-data?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime,
// name: 'QualityStatistics',
params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime }
// params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime }
})
}
}

View File

@ -1,81 +1,238 @@
<template xmlns="">
<div class="container">
<div class="logo"></div>
<!-- 登录区域 -->
<div class="content">
<!-- 配图 -->
<div class="pic"></div>
<!-- 表单 -->
<div class="field">
<!-- [移动端]标题 -->
<h2 class="mobile-title">
<h3 class="title">芋道后台管理系统</h3>
</h2>
<div class="container">
<div class="logo"></div>
<!-- 登录区域 -->
<div class="content">
<!-- 配图 -->
<div class="pic">
<div
class="welcome"
style="
position: absolute;
top: 15%;
left: 20%;
user-select: none;
display: flex;
flex-direction: column;
align-items: flex-start;
">
<strong
style="
letter-spacing: 1px;
font-family: Arial, Helvetica, sans-serif;
font-weight: 500;
font-size: 88px;
">
<span style="color: #26b9de">Wel</span>
<span style="color: #fff">come</span>
</strong>
<p
style="
margin: 0;
font-size: 26px;
letter-spacing: 1px;
color: #26b9de;
opacity: 75%;
">
<span
style="
display: inline-block;
height: 20px;
width: 20px;
margin-left: 8px;
margin-right: 12px;
border-radius: 100%;
background: #26b9de;
"></span>
产线生产监控系统
</p>
</div>
<video
src="/static/videos/login.webm"
muted
autoplay
loop
style="
user-select: none;
position: absolute;
top: 28%;
width: 100%;
height: 70%;
"></video>
</div>
<!-- 表单 -->
<div class="field">
<!-- [移动端]标题 -->
<h2 class="mobile-title">
<h3 class="title">中建材智能自动化研究院有限公司</h3>
</h2>
<h2 class="pc-title" style="">
<h3
class="title"
style="
margin: 0;
margin-left: 32px;
font-weight: 400;
user-select: none;
color: #000;
font-size: 36px;
line-height: 54px;
letter-spacing: 2px;
">
<img
src="../assets/logo/cnbm.png"
alt="cnbm_logo"
style="
height: 48px;
width: 48px;
position: relative;
top: 12px;
right: 8px;
" />
<span>中建材智能自动化研究院有限公司</span>
</h3>
<h3
class="sub-title"
style="
margin: 0;
margin-left: 32px;
font-weight: 400;
user-select: none;
color: #000;
font-size: 36px;
line-height: 54px;
letter-spacing: 2px;
">
产线生产监控系统
</h3>
</h2>
<!-- 表单 -->
<div class="form-cont">
<el-tabs class="form" v-model="loginForm.loginType" style=" float:none;">
<el-tab-pane label="账号密码登录" name="uname">
</el-tab-pane>
<el-tab-pane label="短信验证码登录" name="sms">
</el-tab-pane>
</el-tabs>
<div>
<el-form ref="loginForm" :model="loginForm" :rules="LoginRules" class="login-form">
<el-form-item prop="tenantName" v-if="tenantEnable">
<el-input v-model="loginForm.tenantName" type="text" auto-complete="off" placeholder='租户'>
<svg-icon slot="prefix" icon-class="tree" class="el-input__icon input-icon" />
</el-input>
</el-form-item>
<!-- 账号密码登录 -->
<div v-if="loginForm.loginType === 'uname'">
<el-form-item prop="username">
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-input v-model="loginForm.password" type="password" auto-complete="off" placeholder="密码"
@keyup.enter.native="getCode">
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
</el-input>
</el-form-item>
<el-checkbox v-model="loginForm.rememberMe" style="margin:0 0 25px 0;">记住密码</el-checkbox>
</div>
<!-- 表单 -->
<div class="form-cont">
<el-tabs
class="form"
v-model="loginForm.loginType"
style="float: none">
<el-tab-pane label="账号密码登录" name="uname"></el-tab-pane>
<el-tab-pane label="短信验证码登录" name="sms"></el-tab-pane>
</el-tabs>
<div style="">
<el-form
ref="loginForm"
:model="loginForm"
:rules="LoginRules"
class="login-form">
<el-form-item prop="tenantName" v-if="tenantEnable">
<el-input
v-model="loginForm.tenantName"
type="text"
auto-complete="off"
placeholder="租户">
<!-- <svg-icon
slot="prefix"
icon-class="tree"
class="el-input__icon input-icon" /> -->
</el-input>
</el-form-item>
<!-- 账号密码登录 -->
<div v-if="loginForm.loginType === 'uname'">
<el-form-item prop="username">
<el-input
v-model="loginForm.username"
type="text"
auto-complete="off"
placeholder="账号">
<!-- <svg-icon
slot="prefix"
icon-class="user"
class="el-input__icon input-icon" /> -->
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
v-model="loginForm.password"
type="password"
auto-complete="off"
placeholder="密码"
@keyup.enter.native="getCode">
<!-- <svg-icon
slot="prefix"
icon-class="password"
class="el-input__icon input-icon" /> -->
</el-input>
</el-form-item>
<el-checkbox
v-model="loginForm.rememberMe"
style="margin: 0 0 25px 0">
记住密码
</el-checkbox>
</div>
<!-- 短信验证码登录 -->
<div v-if="loginForm.loginType === 'sms'">
<el-form-item prop="mobile">
<el-input v-model="loginForm.mobile" type="text" auto-complete="off" placeholder="请输入手机号">
<svg-icon slot="prefix" icon-class="phone" class="el-input__icon input-icon" />
</el-input>
</el-form-item>
<el-form-item prop="mobileCode">
<el-input v-model="loginForm.mobileCode" type="text" auto-complete="off" placeholder="短信验证码"
class="sms-login-mobile-code-prefix" @keyup.enter.native="handleLogin">
<template>
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
</template>
<template slot="append">
<span v-if="mobileCodeTimer <= 0" class="getMobileCode" @click="getSmsCode"
style="cursor: pointer;">获取验证码</span>
<span v-if="mobileCodeTimer > 0" class="getMobileCode">{{ mobileCodeTimer }}秒后可重新获取</span>
</template>
</el-input>
</el-form-item>
</div>
<!-- 短信验证码登录 -->
<div v-if="loginForm.loginType === 'sms'">
<el-form-item prop="mobile">
<el-input
v-model="loginForm.mobile"
type="text"
auto-complete="off"
placeholder="请输入手机号">
<!-- <svg-icon
slot="prefix"
icon-class="phone"
class="el-input__icon input-icon" /> -->
</el-input>
</el-form-item>
<el-form-item prop="mobileCode">
<el-input
v-model="loginForm.mobileCode"
type="text"
auto-complete="off"
placeholder="短信验证码"
class="sms-login-mobile-code-prefix"
@keyup.enter.native="handleLogin">
<!-- <template>
<svg-icon
slot="prefix"
icon-class="password"
class="el-input__icon input-icon" />
</template> -->
<template slot="suffix">
<span
v-if="mobileCodeTimer <= 0"
class="getMobileCode"
@click="getSmsCode"
style="
cursor: pointer;
color: #0b58ff;
font-size: 18px;
line-height: 66px;
padding-right: 12px;
">
获取验证码
</span>
<span v-if="mobileCodeTimer > 0" class="getMobileCode">
{{ mobileCodeTimer }}秒后可重新获取
</span>
</template>
</el-input>
</el-form-item>
</div>
<!-- 下方的登录按钮 -->
<el-form-item style="width:100%;">
<el-button :loading="loading" size="medium" type="primary" style="width:100%;"
@click.native.prevent="getCode">
<span v-if="!loading"> </span>
<span v-else> 中...</span>
</el-button>
</el-form-item>
<!-- 下方的登录按钮 -->
<el-form-item id="button-form-item" style="width: 100%; margin-top: 32px">
<el-button
:loading="loading"
size="medium"
type="primary"
style="width: 100%; height: 66px; font-size: 18px;"
@click.native.prevent="getCode">
<span v-if="!loading"> </span>
<span v-else> 中...</span>
</el-button>
</el-form-item>
<!-- 社交登录 -->
<!-- <el-form-item style="width:100%;">
<!-- 社交登录 -->
<!-- <el-form-item style="width:100%;">
<div class="oauth-login" style="display:flex">
<div class="oauth-login-item" v-for="item in SysUserSocialTypeEnum" :key="item.type" @click="doSocialLogin(item)">
<img :src="item.img" height="25px" width="25px" alt="登录" >
@ -83,265 +240,305 @@
</div>
</div>
</el-form-item> -->
</el-form>
</div>
</div>
</div>
</div>
</el-form>
</div>
</div>
<!-- 图形验证码 -->
<Verify ref="verify" :captcha-type="'blockPuzzle'" :img-size="{ width: '400px', height: '200px' }"
@success="handleLogin" />
<!-- footer -->
<div class="footer">
Copyright © 2023 中建材智能自动化院 All Rights Reserved.
</div>
</div>
</div>
<!-- footer -->
<div class="footer">
Copyright © 2023 中建材智能自动化院 All Rights Reserved.
</div>
</div>
<!-- 图形验证码 -->
<Verify
ref="verify"
:captcha-type="'blockPuzzle'"
:img-size="{ width: '400px', height: '200px' }"
@success="handleLogin" />
</div>
</template>
<script>
import { sendSmsCode, socialAuthRedirect } from "@/api/login";
import { getTenantIdByName } from "@/api/system/tenant";
import { SystemUserSocialTypeEnum } from "@/utils/constants";
import { getCaptchaEnable, getTenantEnable } from "@/utils/ruoyi";
import { sendSmsCode, socialAuthRedirect } from '@/api/login';
import { getTenantIdByName } from '@/api/system/tenant';
import { SystemUserSocialTypeEnum } from '@/utils/constants';
import { getCaptchaEnable, getTenantEnable } from '@/utils/ruoyi';
import {
getPassword,
getRememberMe, getTenantName,
getUsername,
removePassword, removeRememberMe, removeTenantName,
removeUsername,
setPassword, setRememberMe, setTenantId, setTenantName,
setUsername
} from "@/utils/auth";
getPassword,
getRememberMe,
getTenantName,
getUsername,
removePassword,
removeRememberMe,
removeTenantName,
removeUsername,
setPassword,
setRememberMe,
setTenantId,
setTenantName,
setUsername,
} from '@/utils/auth';
import Verify from '@/components/Verifition/Verify';
import { resetUserPwd } from "@/api/system/user";
import { resetUserPwd } from '@/api/system/user';
export default {
name: "Login",
components: {
Verify
},
data() {
return {
codeUrl: "",
captchaEnable: true,
tenantEnable: true,
mobileCodeTimer: 0,
loginForm: {
loginType: "uname",
username: "admin",
password: "admin123",
captchaVerification: "",
mobile: "",
mobileCode: "",
rememberMe: false,
tenantName: "技术中心",
},
scene: 21,
name: 'Login',
components: {
Verify,
},
data() {
return {
codeUrl: '',
captchaEnable: true,
tenantEnable: true,
mobileCodeTimer: 0,
loginForm: {
loginType: 'uname',
username: 'admin',
password: 'admin123',
captchaVerification: '',
mobile: '',
mobileCode: '',
rememberMe: false,
tenantName: '技术中心',
},
scene: 21,
LoginRules: {
username: [
{ required: true, trigger: "blur", message: "用户名不能为空" }
],
password: [
{ required: true, trigger: "blur", message: "密码不能为空" }
],
mobile: [
{ required: true, trigger: "blur", message: "手机号不能为空" },
{
validator: function (rule, value, callback) {
if (/^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/.test(value) === false) {
callback(new Error("手机号格式错误"));
} else {
callback();
}
}, trigger: "blur"
}
],
tenantName: [
{ required: true, trigger: "blur", message: "租户不能为空" },
{
validator: (rule, value, callback) => {
// debugger
getTenantIdByName(value).then(res => {
const tenantId = res.data;
if (tenantId && tenantId >= 0) {
//
setTenantId(tenantId)
callback();
} else {
callback('租户不存在');
}
});
},
trigger: 'blur'
}
]
},
loading: false,
redirect: undefined,
//
SysUserSocialTypeEnum: SystemUserSocialTypeEnum,
};
},
created() {
//
this.tenantEnable = getTenantEnable();
if (this.tenantEnable) {
getTenantIdByName(this.loginForm.tenantName).then(res => { //
const tenantId = res.data;
if (tenantId && tenantId >= 0) {
setTenantId(tenantId)
}
});
}
//
this.captchaEnable = getCaptchaEnable();
//
this.redirect = this.$route.query.redirect ? decodeURIComponent(this.$route.query.redirect) : undefined;
this.getCookie();
},
methods: {
getCode() {
//
if (!this.captchaEnable) {
this.handleLogin({})
return;
}
LoginRules: {
username: [
{ required: true, trigger: 'blur', message: '用户名不能为空' },
],
password: [
{ required: true, trigger: 'blur', message: '密码不能为空' },
],
mobile: [
{ required: true, trigger: 'blur', message: '手机号不能为空' },
{
validator: function (rule, value, callback) {
if (
/^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/.test(
value
) === false
) {
callback(new Error('手机号格式错误'));
} else {
callback();
}
},
trigger: 'blur',
},
],
tenantName: [
{ required: true, trigger: 'blur', message: '租户不能为空' },
{
validator: (rule, value, callback) => {
// debugger
getTenantIdByName(value).then((res) => {
const tenantId = res.data;
if (tenantId && tenantId >= 0) {
//
setTenantId(tenantId);
callback();
} else {
callback('租户不存在');
}
});
},
trigger: 'blur',
},
],
},
loading: false,
redirect: undefined,
//
SysUserSocialTypeEnum: SystemUserSocialTypeEnum,
};
},
created() {
//
this.tenantEnable = getTenantEnable();
if (this.tenantEnable) {
getTenantIdByName(this.loginForm.tenantName).then((res) => {
//
const tenantId = res.data;
if (tenantId && tenantId >= 0) {
setTenantId(tenantId);
}
});
}
//
this.captchaEnable = getCaptchaEnable();
//
this.redirect = this.$route.query.redirect
? decodeURIComponent(this.$route.query.redirect)
: undefined;
this.getCookie();
},
methods: {
getCode() {
//
if (!this.captchaEnable) {
this.handleLogin({});
return;
}
//
//
this.$refs.verify.show()
},
getCookie() {
const username = getUsername();
const password = getPassword();
const rememberMe = getRememberMe();
const tenantName = getTenantName();
this.loginForm = {
...this.loginForm,
username: username ? username : this.loginForm.username,
password: password ? password : this.loginForm.password,
rememberMe: rememberMe ? getRememberMe() : false,
tenantName: tenantName ? tenantName : this.loginForm.tenantName,
};
},
handleLogin(captchaParams) {
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loading = true;
// Cookie
if (this.loginForm.rememberMe) {
setUsername(this.loginForm.username)
setPassword(this.loginForm.password)
setRememberMe(this.loginForm.rememberMe)
setTenantName(this.loginForm.tenantName)
} else {
removeUsername()
removePassword()
removeRememberMe()
removeTenantName()
}
this.loginForm.captchaVerification = captchaParams.captchaVerification
//
// console.log("", this.loginForm);
this.$store.dispatch(this.loginForm.loginType === "sms" ? "SmsLogin" : "Login", this.loginForm).then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(() => {
});
}).catch(() => {
this.loading = false;
});
}
});
},
async doSocialLogin(socialTypeEnum) {
//
this.loading = true;
let tenant = false;
if (this.tenantEnable) {
await this.$prompt('请输入租户名称', "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消"
}).then(async ({ value }) => {
await getTenantIdByName(value).then(res => {
const tenantId = res.data;
tenant = true
if (tenantId && tenantId >= 0) {
setTenantId(tenantId)
}
});
}).catch(() => {
// loading
this.loading = false;
//
//
this.$refs.verify.show();
},
getCookie() {
const username = getUsername();
const password = getPassword();
const rememberMe = getRememberMe();
const tenantName = getTenantName();
this.loginForm = {
...this.loginForm,
username: username ? username : this.loginForm.username,
password: password ? password : this.loginForm.password,
rememberMe: rememberMe ? getRememberMe() : false,
tenantName: tenantName ? tenantName : this.loginForm.tenantName,
};
},
handleLogin(captchaParams) {
this.$refs.loginForm.validate((valid) => {
if (valid) {
this.loading = true;
// Cookie
if (this.loginForm.rememberMe) {
setUsername(this.loginForm.username);
setPassword(this.loginForm.password);
setRememberMe(this.loginForm.rememberMe);
setTenantName(this.loginForm.tenantName);
} else {
removeUsername();
removePassword();
removeRememberMe();
removeTenantName();
}
this.loginForm.captchaVerification =
captchaParams.captchaVerification;
//
// console.log("", this.loginForm);
this.$store
.dispatch(
this.loginForm.loginType === 'sms' ? 'SmsLogin' : 'Login',
this.loginForm
)
.then(() => {
this.$router.push({ path: this.redirect || '/' }).catch(() => {});
})
.catch(() => {
this.loading = false;
});
}
});
},
async doSocialLogin(socialTypeEnum) {
//
this.loading = true;
let tenant = false;
if (this.tenantEnable) {
await this.$prompt('请输入租户名称', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
})
.then(async ({ value }) => {
await getTenantIdByName(value).then((res) => {
const tenantId = res.data;
tenant = true;
if (tenantId && tenantId >= 0) {
setTenantId(tenantId);
}
});
})
.catch(() => {
// loading
this.loading = false;
return false
});
} else {
tenant = true
}
if (tenant) {
// redirectUri
const redirectUri = location.origin + '/social-login?'
+ encodeURIComponent('type=' + socialTypeEnum.type + '&redirect=' + (this.redirect || "/")); //
// const redirectUri = 'http://127.0.0.1:48080/api/gitee/callback';
// const redirectUri = 'http://127.0.0.1:48080/api/dingtalk/callback';
//
socialAuthRedirect(socialTypeEnum.type, encodeURIComponent(redirectUri)).then((res) => {
// console.log(res.url);
window.location.href = res.data;
});
}
},
/** ========== 以下为升级短信登录 ========== */
getSmsCode() {
if (this.mobileCodeTimer > 0) return;
this.$refs.loginForm.validate(valid => {
if (!valid) return;
sendSmsCode(this.loginForm.mobile, this.scene, this.loginForm.uuid, this.loginForm.code).then(res => {
this.$modal.msgSuccess("获取验证码成功")
this.mobileCodeTimer = 60;
let msgTimer = setInterval(() => {
this.mobileCodeTimer = this.mobileCodeTimer - 1;
if (this.mobileCodeTimer <= 0) {
clearInterval(msgTimer);
}
}, 1000);
});
});
}
}
return false;
});
} else {
tenant = true;
}
if (tenant) {
// redirectUri
const redirectUri =
location.origin +
'/social-login?' +
encodeURIComponent(
'type=' +
socialTypeEnum.type +
'&redirect=' +
(this.redirect || '/')
); //
// const redirectUri = 'http://127.0.0.1:48080/api/gitee/callback';
// const redirectUri = 'http://127.0.0.1:48080/api/dingtalk/callback';
//
socialAuthRedirect(
socialTypeEnum.type,
encodeURIComponent(redirectUri)
).then((res) => {
// console.log(res.url);
window.location.href = res.data;
});
}
},
/** ========== 以下为升级短信登录 ========== */
getSmsCode() {
if (this.mobileCodeTimer > 0) return;
this.$refs.loginForm.validate((valid) => {
if (!valid) return;
sendSmsCode(
this.loginForm.mobile,
this.scene,
this.loginForm.uuid,
this.loginForm.code
).then((res) => {
this.$modal.msgSuccess('获取验证码成功');
this.mobileCodeTimer = 60;
let msgTimer = setInterval(() => {
this.mobileCodeTimer = this.mobileCodeTimer - 1;
if (this.mobileCodeTimer <= 0) {
clearInterval(msgTimer);
}
}, 1000);
});
});
},
},
};
</script>
<style lang="scss" scoped>
@import "~@/assets/styles/login.scss";
@import '~@/assets/styles/login.scss';
.oauth-login {
display: flex;
align-items: center;
cursor: pointer;
display: flex;
align-items: center;
cursor: pointer;
}
.oauth-login-item {
display: flex;
align-items: center;
margin-right: 10px;
display: flex;
align-items: center;
margin-right: 10px;
}
.oauth-login-item img {
height: 25px;
width: 25px;
height: 25px;
width: 25px;
}
.oauth-login-item span:hover {
text-decoration: underline red;
color: red;
text-decoration: underline red;
color: red;
}
.sms-login-mobile-code-prefix {
:deep(.el-input__prefix) {
top: 22%;
}
}</style>
:deep(.el-input__prefix) {
top: 22%;
}
}
</style>

View File

@ -323,7 +323,7 @@ export default {
},
async getTree() {
const { data } = await this.$axios('/base/factory/getTree');
const { data } = await this.$axios('/base/core-factory/getTree');
this.sidebarContent = data;
this.buildTree(data);
console.log('tree', this.sidebarContent);

View File

@ -6,9 +6,24 @@
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<el-tabs v-model="activeName" @tab-click="handleClick">
<base-table
:page="1"
:limit="5000"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="250"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<!-- <el-tabs v-model="activeName" @tab-click="toggleTab">
<el-tab-pane label="数据列表" name="dataList">
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
@ -26,7 +41,7 @@
/>
</base-table>
</el-tab-pane>
<el-tab-pane label="柱状图" name="barChart">
<el-tab-pane label="环形图" name="barChart">
<div class="boxTitle">
<span class="blueTitle"></span>
<span>各订单环形图</span>
@ -36,7 +51,7 @@
style="width: 182px; height: 180px;"
></div>
</el-tab-pane>
</el-tabs>
</el-tabs> -->
</div>
</template>
<script>
@ -147,14 +162,15 @@ export default {
activeName: 'dataList',
//
queryParams: {
pageNo: 1,
pageSize: 20,
// pageNo: 1,
// pageSize: 5000,
name: null,
startProduceTime: []
},
tableProps,
list: [],
tableH: this.tableHeight(270),
// tableH: this.tableHeight(270),
tableH: this.tableHeight(230),
total: 0,
tableBtn: [
this.$auth.hasPermi('base:order-completion-monitoring:orderDet')
@ -175,12 +191,13 @@ export default {
btnName: '发货详情'
}
: undefined
].filter((v) => v),
].filter((v) => v)
}
},
mounted() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(270)
// this.tableH = this.tableHeight(270)
this.tableH = this.tableHeight(230)
})
this.getOrderList()
this.getPage()
@ -332,17 +349,26 @@ export default {
console.log(val)
switch (val.type) {
case 'orderDetail':
this.$router.push({
path: '/base/coreWorkOrder/detail?orderId='+val.data.orderid
})
break
case 'qualityDetail':
this.$router.push({
path: '/quality/base/quality-inspection-data/detection-information/statistical-data?woIdString='+val.data.woIdString,
})
break
default:
this.$router.push({
path: '/delivery/delivery-log?orderId='+encodeURI(val.data.name)
})
}
},
toggleTab() {
if (this.activeName === 'barChart') {
this.getPieChart()
}
}
}
}
}
</script>

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2023-08-21 14:26:23
* @LastEditors: zwq
* @LastEditTime: 2023-11-06 11:25:34
* @LastEditTime: 2023-11-14 09:40:33
* @Description:
-->
<template>
@ -11,11 +11,35 @@
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<div class="tips">
<el-tag effect="dark" color="#7362F3" style="border: none">缓存</el-tag>
<el-tag effect="dark" color="#16DC09" style="border: none">活动</el-tag>
<el-tag effect="dark" color="#FFA08F" style="border: none">其它</el-tag>
</div>
<!-- <div class="tips">
<el-tag color="#D7DBE5" style="border: none; color: black">停用</el-tag>
<el-tag color="#D8E5FF" style="border: none; color: black">启用</el-tag>
<el-divider direction="vertical" />
<el-tag effect="dark" color="#16DC09" style="border: none">可用</el-tag>
<el-tag effect="dark" color="#FFD781" style="border: none">
占用-待入库
</el-tag>
<el-tag effect="dark" color="#7362F3" style="border: none">
占用-有货
</el-tag>
<el-tag effect="dark" color="#FFA08F" style="border: none">
占用-待出库
</el-tag>
</div> -->
<el-row class="dashboard-legend">
<div
v-for="item in cassetteStatusList"
:key="'cassette' + item.id"
class="dashboard-legend-cassette">
<div
class="dashboard-legend-cassette-cricle"
:style="{ background: item.color }" />
{{ item.name }}
</div>
|
<div class="dashboard-legend-port" style="background: #d7dbe5">停用</div>
<div class="dashboard-legend-port" style="background: #d8e5ff">启用</div>
</el-row>
<div class="mainbody">
<div v-for="i in total" :key="i">
<el-row>
@ -26,11 +50,14 @@
v-for="a in wareData.one.slice((i - 1) * 10, i * 10)"
:key="a.id + a.code"
:title="a.name"
style="background: #fff8e8; float: left">
:style="{
background: bgColor[a.enabled],
float: 'left',
}">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[a.type - 1],
background: dotColor[a.status],
}" />
<p class="p-name">{{ a.name }}</p>
</div>
@ -41,11 +68,14 @@
v-for="b in wareData.two.slice((i - 1) * 10, i * 10)"
:key="b.id + b.code"
:title="b.name"
style="background: #fff8e8; float: left">
:style="{
background: bgColor[b.enabled],
float: 'left',
}">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[b.type - 1],
background: dotColor[b.status],
}" />
<p class="p-name">{{ b.name }}</p>
</div>
@ -61,11 +91,14 @@
v-for="c in wareData.there.slice((i - 1) * 10, i * 10)"
:key="c.id + c.code"
:title="c.name"
style="background: #fff8e8; float: left">
:style="{
background: bgColor[c.enabled],
float: 'left',
}">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[c.type - 1],
background: dotColor[c.status],
}" />
<p class="p-name">{{ c.name }}</p>
</div>
@ -76,11 +109,14 @@
v-for="d in wareData.four.slice((i - 1) * 10, i * 10)"
:key="d.id + d.code"
:title="d.name"
style="background: #fff8e8; float: left">
:style="{
background: bgColor[d.enabled],
float: 'left',
}">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[d.type - 1],
background: dotColor[d.status],
}" />
<p class="p-name">{{ d.name }}</p>
</div>
@ -106,7 +142,14 @@ export default {
four: [],
},
total: 0,
bgColor: ['#7362F3', '#16DC09', '#FFA08F'],
bgColor: ['#D7DBE5', '#D8E5FF'],
dotColor: ['#16DC09', '#FFD781', '#7362F3', '#FFA08F'],
cassetteStatusList: [
{ id: '1', name: '可用', color: '#16DC09' },
{ id: '2', name: '占用-待入库', color: '#FFD781' },
{ id: '3', name: '占用-有货', color: '#7362F3' },
{ id: '4', name: '占用-待出库', color: '#FFA08F' },
],
formConfig: [
{
type: 'button',
@ -130,26 +173,26 @@ export default {
there: [],
four: [],
}),
getWarehouseList().then((response) => {
response.data.forEach((item) => {
if (item.storageType === 2) {
listByWarehouse(item.id).then((response) => {
response.data.forEach((a, b) => {
if (b % 4 === 0) {
this.wareData.one.push(a);
} else if (b % 4 === 1) {
this.wareData.two.push(a);
} else if (b % 4 === 2) {
this.wareData.there.push(a);
} else if (b % 4 === 3) {
this.wareData.four.push(a);
getWarehouseList().then((response) => {
response.data.forEach((item) => {
if (item.storageType === 2) {
listByWarehouse(item.id).then((response) => {
response.data.forEach((a, b) => {
if (b % 4 === 0) {
this.wareData.one.push(a);
} else if (b % 4 === 1) {
this.wareData.two.push(a);
} else if (b % 4 === 2) {
this.wareData.there.push(a);
} else if (b % 4 === 3) {
this.wareData.four.push(a);
}
});
this.total = Math.ceil(response.data.length / 40);
});
}
});
this.total = Math.ceil(response.data.length / 40);
});
}
});
});
});
},
buttonClick(val) {
switch (val.btnName) {
@ -225,4 +268,25 @@ export default {
top: 22px;
right: 120px;
}
.dashboard-legend {
margin: 5px 5px 10px 5px;
.dashboard-legend-cassette {
display: inline-block;
margin-right: 24px;
.dashboard-legend-cassette-cricle {
display: inline-block;
width: 12px;
height: 12px;
border-radius: 6px;
}
}
.dashboard-legend-port {
display: inline-block;
height: 24px;
line-height: 24px;
border-radius: 4px;
padding: 0 16px;
margin-left: 24px;
}
}
</style>

View File

@ -17,7 +17,7 @@
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
:width="140"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2022-08-24 11:19:43
* @LastEditors: zwq
* @LastEditTime: 2023-11-03 16:06:21
* @LastEditTime: 2023-11-14 15:59:53
* @Description:
*/
export default {
@ -38,8 +38,10 @@ export default {
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.tableData = response.data.list;
this.listQuery.total = response.data.total;
if(response.hasOwnProperty('data')){
this.tableData = response.data.list;
this.listQuery.total = response.data.total;
}
this.dataListLoading = false;
});
},

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2023-08-21 14:26:23
* @LastEditors: zwq
* @LastEditTime: 2023-11-06 11:32:23
* @LastEditTime: 2023-11-14 09:40:21
* @Description:
-->
<template>
@ -11,11 +11,35 @@
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<div class="tips">
<el-tag effect="dark" color="#7362F3" style="border: none">缓存</el-tag>
<el-tag effect="dark" color="#16DC09" style="border: none">活动</el-tag>
<el-tag effect="dark" color="#FFA08F" style="border: none">其它</el-tag>
</div>
<!-- <div class="tips">
<el-tag color="#D7DBE5" style="border: none; color: black">停用</el-tag>
<el-tag color="#D8E5FF" style="border: none; color: black">启用</el-tag>
<el-divider direction="vertical" />
<el-tag effect="dark" color="#16DC09" style="border: none">可用</el-tag>
<el-tag effect="dark" color="#FFD781" style="border: none">
占用-待入库
</el-tag>
<el-tag effect="dark" color="#7362F3" style="border: none">
占用-有货
</el-tag>
<el-tag effect="dark" color="#FFA08F" style="border: none">
占用-待出库
</el-tag>
</div> -->
<el-row class="dashboard-legend">
<div
v-for="item in cassetteStatusList"
:key="'cassette' + item.id"
class="dashboard-legend-cassette">
<div
class="dashboard-legend-cassette-cricle"
:style="{ background: item.color }" />
{{ item.name }}
</div>
|
<div class="dashboard-legend-port" style="background: #d7dbe5">停用</div>
<div class="dashboard-legend-port" style="background: #d8e5ff">启用</div>
</el-row>
<div class="mainbody">
<div v-for="i in total" :key="i">
<el-row>
@ -26,11 +50,14 @@
v-for="a in wareData.one.slice((i - 1) * 10, i * 10)"
:key="a.id + a.code"
:title="a.name"
style="background: #fff8e8; float: left">
:style="{
background: bgColor[a.enabled],
float: 'left',
}">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[a.type - 1],
background: dotColor[a.status],
}" />
<p class="p-name">{{ a.name }}</p>
</div>
@ -41,11 +68,14 @@
v-for="b in wareData.two.slice((i - 1) * 10, i * 10)"
:key="b.id + b.code"
:title="b.name"
style="background: #fff8e8; float: left">
:style="{
background: bgColor[b.enabled],
float: 'left',
}">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[b.type - 1],
background: dotColor[b.status],
}" />
<p class="p-name">{{ b.name }}</p>
</div>
@ -61,11 +91,14 @@
v-for="c in wareData.there.slice((i - 1) * 10, i * 10)"
:key="c.id + c.code"
:title="c.name"
style="background: #fff8e8; float: left">
:style="{
background: bgColor[c.enabled],
float: 'left',
}">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[c.type - 1],
background: dotColor[c.status],
}" />
<p class="p-name">{{ c.name }}</p>
</div>
@ -76,11 +109,14 @@
v-for="d in wareData.four.slice((i - 1) * 10, i * 10)"
:key="d.id + d.code"
:title="d.name"
style="background: #fff8e8; float: left">
:style="{
background: bgColor[d.enabled],
float: 'left',
}">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[d.type - 1],
background: dotColor[d.status],
}" />
<p class="p-name">{{ d.name }}</p>
</div>
@ -106,7 +142,14 @@ export default {
four: [],
},
total: 0,
bgColor: ['#7362F3', '#16DC09', '#FFA08F'],
bgColor: ['#D7DBE5', '#D8E5FF'],
dotColor: ['#16DC09', '#FFD781', '#7362F3', '#FFA08F'],
cassetteStatusList: [
{ id: '1', name: '可用', color: '#16DC09' },
{ id: '2', name: '占用-待入库', color: '#FFD781' },
{ id: '3', name: '占用-有货', color: '#7362F3' },
{ id: '4', name: '占用-待出库', color: '#FFA08F' },
],
formConfig: [
{
type: 'button',
@ -130,26 +173,26 @@ export default {
there: [],
four: [],
}),
getWarehouseList().then((response) => {
response.data.forEach((item) => {
if (item.storageType === 5) {
listByWarehouse(item.id).then((response) => {
response.data.forEach((a, b) => {
if (b % 4 === 0) {
this.wareData.one.push(a);
} else if (b % 4 === 1) {
this.wareData.two.push(a);
} else if (b % 4 === 2) {
this.wareData.there.push(a);
} else if (b % 4 === 3) {
this.wareData.four.push(a);
getWarehouseList().then((response) => {
response.data.forEach((item) => {
if (item.storageType === 5) {
listByWarehouse(item.id).then((response) => {
response.data.forEach((a, b) => {
if (b % 4 === 0) {
this.wareData.one.push(a);
} else if (b % 4 === 1) {
this.wareData.two.push(a);
} else if (b % 4 === 2) {
this.wareData.there.push(a);
} else if (b % 4 === 3) {
this.wareData.four.push(a);
}
});
this.total = Math.ceil(response.data.length / 40);
});
}
});
this.total = Math.ceil(response.data.length / 40);
});
}
});
});
});
},
buttonClick(val) {
switch (val.btnName) {
@ -225,4 +268,25 @@ export default {
top: 22px;
right: 120px;
}
.dashboard-legend {
margin: 5px 5px 10px 5px;
.dashboard-legend-cassette {
display: inline-block;
margin-right: 24px;
.dashboard-legend-cassette-cricle {
display: inline-block;
width: 12px;
height: 12px;
border-radius: 6px;
}
}
.dashboard-legend-port {
display: inline-block;
height: 24px;
line-height: 24px;
border-radius: 4px;
padding: 0 16px;
margin-left: 24px;
}
}
</style>

View File

@ -17,7 +17,7 @@
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
:width="140"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2023-08-21 14:26:23
* @LastEditors: zwq
* @LastEditTime: 2023-11-06 11:31:52
* @LastEditTime: 2023-11-14 09:40:08
* @Description:
-->
<template>
@ -11,11 +11,35 @@
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<div class="tips">
<el-tag effect="dark" color="#7362F3" style="border: none">缓存</el-tag>
<el-tag effect="dark" color="#16DC09" style="border: none">活动</el-tag>
<el-tag effect="dark" color="#FFA08F" style="border: none">其它</el-tag>
</div>
<!-- <div class="tips">
<el-tag color="#D7DBE5" style="border: none; color: black">停用</el-tag>
<el-tag color="#D8E5FF" style="border: none; color: black">启用</el-tag>
<el-divider direction="vertical" />
<el-tag effect="dark" color="#16DC09" style="border: none">可用</el-tag>
<el-tag effect="dark" color="#FFD781" style="border: none">
占用-待入库
</el-tag>
<el-tag effect="dark" color="#7362F3" style="border: none">
占用-有货
</el-tag>
<el-tag effect="dark" color="#FFA08F" style="border: none">
占用-待出库
</el-tag>
</div> -->
<el-row class="dashboard-legend">
<div
v-for="item in cassetteStatusList"
:key="'cassette' + item.id"
class="dashboard-legend-cassette">
<div
class="dashboard-legend-cassette-cricle"
:style="{ background: item.color }" />
{{ item.name }}
</div>
|
<div class="dashboard-legend-port" style="background: #d7dbe5">停用</div>
<div class="dashboard-legend-port" style="background: #d8e5ff">启用</div>
</el-row>
<div class="mainbody">
<div v-for="i in total" :key="i">
<el-row>
@ -26,11 +50,14 @@
v-for="a in wareData.one.slice((i - 1) * 10, i * 10)"
:key="a.id + a.code"
:title="a.name"
style="background: #fff8e8; float: left">
:style="{
background: bgColor[a.enabled],
float: 'left',
}">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[a.type - 1],
background: dotColor[a.status],
}" />
<p class="p-name">{{ a.name }}</p>
</div>
@ -41,11 +68,14 @@
v-for="b in wareData.two.slice((i - 1) * 10, i * 10)"
:key="b.id + b.code"
:title="b.name"
style="background: #fff8e8; float: left">
:style="{
background: bgColor[b.enabled],
float: 'left',
}">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[b.type - 1],
background: dotColor[b.status],
}" />
<p class="p-name">{{ b.name }}</p>
</div>
@ -61,11 +91,14 @@
v-for="c in wareData.there.slice((i - 1) * 10, i * 10)"
:key="c.id + c.code"
:title="c.name"
style="background: #fff8e8; float: left">
:style="{
background: bgColor[c.enabled],
float: 'left',
}">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[c.type - 1],
background: dotColor[c.status],
}" />
<p class="p-name">{{ c.name }}</p>
</div>
@ -76,11 +109,14 @@
v-for="d in wareData.four.slice((i - 1) * 10, i * 10)"
:key="d.id + d.code"
:title="d.name"
style="background: #fff8e8; float: left">
:style="{
background: bgColor[d.enabled],
float: 'left',
}">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[d.type - 1],
background: dotColor[d.status],
}" />
<p class="p-name">{{ d.name }}</p>
</div>
@ -106,7 +142,14 @@ export default {
four: [],
},
total: 0,
bgColor: ['#7362F3', '#16DC09', '#FFA08F'],
bgColor: ['#D7DBE5', '#D8E5FF'],
dotColor: ['#16DC09', '#FFD781', '#7362F3', '#FFA08F'],
cassetteStatusList: [
{ id: '1', name: '可用', color: '#16DC09' },
{ id: '2', name: '占用-待入库', color: '#FFD781' },
{ id: '3', name: '占用-有货', color: '#7362F3' },
{ id: '4', name: '占用-待出库', color: '#FFA08F' },
],
formConfig: [
{
type: 'button',
@ -130,26 +173,26 @@ export default {
there: [],
four: [],
}),
getWarehouseList().then((response) => {
response.data.forEach((item) => {
if (item.storageType === 3) {
listByWarehouse(item.id).then((response) => {
response.data.forEach((a, b) => {
if (b % 4 === 0) {
this.wareData.one.push(a);
} else if (b % 4 === 1) {
this.wareData.two.push(a);
} else if (b % 4 === 2) {
this.wareData.there.push(a);
} else if (b % 4 === 3) {
this.wareData.four.push(a);
getWarehouseList().then((response) => {
response.data.forEach((item) => {
if (item.storageType === 3) {
listByWarehouse(item.id).then((response) => {
response.data.forEach((a, b) => {
if (b % 4 === 0) {
this.wareData.one.push(a);
} else if (b % 4 === 1) {
this.wareData.two.push(a);
} else if (b % 4 === 2) {
this.wareData.there.push(a);
} else if (b % 4 === 3) {
this.wareData.four.push(a);
}
});
this.total = Math.ceil(response.data.length / 40);
});
}
});
this.total = Math.ceil(response.data.length / 40);
});
}
});
});
});
},
buttonClick(val) {
switch (val.btnName) {
@ -225,4 +268,25 @@ export default {
top: 22px;
right: 120px;
}
.dashboard-legend {
margin: 5px 5px 10px 5px;
.dashboard-legend-cassette {
display: inline-block;
margin-right: 24px;
.dashboard-legend-cassette-cricle {
display: inline-block;
width: 12px;
height: 12px;
border-radius: 6px;
}
}
.dashboard-legend-port {
display: inline-block;
height: 24px;
line-height: 24px;
border-radius: 4px;
padding: 0 16px;
margin-left: 24px;
}
}
</style>

View File

@ -17,7 +17,7 @@
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
:width="140"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2023-08-21 14:26:23
* @LastEditors: zwq
* @LastEditTime: 2023-11-06 11:31:14
* @LastEditTime: 2023-11-14 09:39:54
* @Description:
-->
<template>
@ -11,11 +11,35 @@
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<div class="tips">
<el-tag effect="dark" color="#7362F3" style="border: none">缓存</el-tag>
<el-tag effect="dark" color="#16DC09" style="border: none">活动</el-tag>
<el-tag effect="dark" color="#FFA08F" style="border: none">其它</el-tag>
</div>
<!-- <div class="tips">
<el-tag color="#D7DBE5" style="border: none; color: black">停用</el-tag>
<el-tag color="#D8E5FF" style="border: none; color: black">启用</el-tag>
<el-divider direction="vertical" />
<el-tag effect="dark" color="#16DC09" style="border: none">可用</el-tag>
<el-tag effect="dark" color="#FFD781" style="border: none">
占用-待入库
</el-tag>
<el-tag effect="dark" color="#7362F3" style="border: none">
占用-有货
</el-tag>
<el-tag effect="dark" color="#FFA08F" style="border: none">
占用-待出库
</el-tag>
</div> -->
<el-row class="dashboard-legend">
<div
v-for="item in cassetteStatusList"
:key="'cassette' + item.id"
class="dashboard-legend-cassette">
<div
class="dashboard-legend-cassette-cricle"
:style="{ background: item.color }" />
{{ item.name }}
</div>
|
<div class="dashboard-legend-port" style="background: #d7dbe5">停用</div>
<div class="dashboard-legend-port" style="background: #d8e5ff">启用</div>
</el-row>
<div class="mainbody">
<div v-for="i in total" :key="i">
<el-row>
@ -26,11 +50,14 @@
v-for="a in wareData.one.slice((i - 1) * 10, i * 10)"
:key="a.id + a.code"
:title="a.name"
style="background: #fff8e8; float: left">
:style="{
background: bgColor[a.enabled],
float: 'left',
}">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[a.type - 1],
background: dotColor[a.status],
}" />
<p class="p-name">{{ a.name }}</p>
</div>
@ -41,11 +68,14 @@
v-for="b in wareData.two.slice((i - 1) * 10, i * 10)"
:key="b.id + b.code"
:title="b.name"
style="background: #fff8e8; float: left">
:style="{
background: bgColor[b.enabled],
float: 'left',
}">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[b.type - 1],
background: dotColor[b.status],
}" />
<p class="p-name">{{ b.name }}</p>
</div>
@ -61,11 +91,14 @@
v-for="c in wareData.there.slice((i - 1) * 10, i * 10)"
:key="c.id + c.code"
:title="c.name"
style="background: #fff8e8; float: left">
:style="{
background: bgColor[c.enabled],
float: 'left',
}">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[c.type - 1],
background: dotColor[c.status],
}" />
<p class="p-name">{{ c.name }}</p>
</div>
@ -76,11 +109,14 @@
v-for="d in wareData.four.slice((i - 1) * 10, i * 10)"
:key="d.id + d.code"
:title="d.name"
style="background: #fff8e8; float: left">
:style="{
background: bgColor[d.enabled],
float: 'left',
}">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[d.type - 1],
background: dotColor[d.status],
}" />
<p class="p-name">{{ d.name }}</p>
</div>
@ -106,7 +142,14 @@ export default {
four: [],
},
total: 0,
bgColor: ['#7362F3', '#16DC09', '#FFA08F'],
bgColor: ['#D7DBE5', '#D8E5FF'],
dotColor: ['#16DC09', '#FFD781', '#7362F3', '#FFA08F'],
cassetteStatusList: [
{ id: '1', name: '可用', color: '#16DC09' },
{ id: '2', name: '占用-待入库', color: '#FFD781' },
{ id: '3', name: '占用-有货', color: '#7362F3' },
{ id: '4', name: '占用-待出库', color: '#FFA08F' },
],
formConfig: [
{
type: 'button',
@ -130,26 +173,26 @@ export default {
there: [],
four: [],
}),
getWarehouseList().then((response) => {
response.data.forEach((item) => {
if (item.storageType === 4) {
listByWarehouse(item.id).then((response) => {
response.data.forEach((a, b) => {
if (b % 4 === 0) {
this.wareData.one.push(a);
} else if (b % 4 === 1) {
this.wareData.two.push(a);
} else if (b % 4 === 2) {
this.wareData.there.push(a);
} else if (b % 4 === 3) {
this.wareData.four.push(a);
getWarehouseList().then((response) => {
response.data.forEach((item) => {
if (item.storageType === 4) {
listByWarehouse(item.id).then((response) => {
response.data.forEach((a, b) => {
if (b % 4 === 0) {
this.wareData.one.push(a);
} else if (b % 4 === 1) {
this.wareData.two.push(a);
} else if (b % 4 === 2) {
this.wareData.there.push(a);
} else if (b % 4 === 3) {
this.wareData.four.push(a);
}
});
this.total = Math.ceil(response.data.length / 40);
});
}
});
this.total = Math.ceil(response.data.length / 40);
});
}
});
});
});
},
buttonClick(val) {
switch (val.btnName) {
@ -225,4 +268,25 @@ export default {
top: 22px;
right: 120px;
}
.dashboard-legend {
margin: 5px 5px 10px 5px;
.dashboard-legend-cassette {
display: inline-block;
margin-right: 24px;
.dashboard-legend-cassette-cricle {
display: inline-block;
width: 12px;
height: 12px;
border-radius: 6px;
}
}
.dashboard-legend-port {
display: inline-block;
height: 24px;
line-height: 24px;
border-radius: 4px;
padding: 0 16px;
margin-left: 24px;
}
}
</style>

View File

@ -17,7 +17,7 @@
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
:width="140"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2023-08-21 14:26:23
* @LastEditors: zwq
* @LastEditTime: 2023-11-06 11:30:20
* @LastEditTime: 2023-11-14 09:39:02
* @Description:
-->
<template>
@ -11,11 +11,35 @@
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<div class="tips">
<el-tag effect="dark" color="#7362F3" style="border: none">缓存</el-tag>
<el-tag effect="dark" color="#16DC09" style="border: none">活动</el-tag>
<el-tag effect="dark" color="#FFA08F" style="border: none">其它</el-tag>
</div>
<!-- <div class="tips">
<el-tag color="#D7DBE5" style="border: none; color: black">停用</el-tag>
<el-tag color="#D8E5FF" style="border: none; color: black">启用</el-tag>
<el-divider direction="vertical" />
<el-tag effect="dark" color="#16DC09" style="border: none">可用</el-tag>
<el-tag effect="dark" color="#FFD781" style="border: none">
占用-待入库
</el-tag>
<el-tag effect="dark" color="#7362F3" style="border: none">
占用-有货
</el-tag>
<el-tag effect="dark" color="#FFA08F" style="border: none">
占用-待出库
</el-tag>
</div> -->
<el-row class="dashboard-legend">
<div
v-for="item in cassetteStatusList"
:key="'cassette' + item.id"
class="dashboard-legend-cassette">
<div
class="dashboard-legend-cassette-cricle"
:style="{ background: item.color }" />
{{ item.name }}
</div>
|
<div class="dashboard-legend-port" style="background: #d7dbe5">停用</div>
<div class="dashboard-legend-port" style="background: #d8e5ff">启用</div>
</el-row>
<div class="mainbody">
<div v-for="i in total" :key="i">
<el-row>
@ -26,11 +50,14 @@
v-for="a in wareData.one.slice((i - 1) * 10, i * 10)"
:key="a.id + a.code"
:title="a.name"
style="background: #fff8e8; float: left">
:style="{
background: bgColor[a.enabled],
float: 'left',
}">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[a.type - 1],
background: dotColor[a.status],
}" />
<p class="p-name">{{ a.name }}</p>
</div>
@ -41,11 +68,14 @@
v-for="b in wareData.two.slice((i - 1) * 10, i * 10)"
:key="b.id + b.code"
:title="b.name"
style="background: #fff8e8; float: left">
:style="{
background: bgColor[b.enabled],
float: 'left',
}">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[b.type - 1],
background: dotColor[b.status],
}" />
<p class="p-name">{{ b.name }}</p>
</div>
@ -61,11 +91,14 @@
v-for="c in wareData.there.slice((i - 1) * 10, i * 10)"
:key="c.id + c.code"
:title="c.name"
style="background: #fff8e8; float: left">
:style="{
background: bgColor[c.enabled],
float: 'left',
}">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[c.type - 1],
background: dotColor[c.status],
}" />
<p class="p-name">{{ c.name }}</p>
</div>
@ -76,11 +109,14 @@
v-for="d in wareData.four.slice((i - 1) * 10, i * 10)"
:key="d.id + d.code"
:title="d.name"
style="background: #fff8e8; float: left">
:style="{
background: bgColor[d.enabled],
float: 'left',
}">
<div
class="dashboard-layout-item-cricle"
:style="{
background: bgColor[d.type - 1],
background: dotColor[d.status],
}" />
<p class="p-name">{{ d.name }}</p>
</div>
@ -106,7 +142,14 @@ export default {
four: [],
},
total: 0,
bgColor: ['#7362F3', '#16DC09', '#FFA08F'],
bgColor: ['#D7DBE5', '#D8E5FF'],
dotColor: ['#16DC09', '#FFD781', '#7362F3', '#FFA08F'],
cassetteStatusList: [
{ id: '1', name: '可用', color: '#16DC09' },
{ id: '2', name: '占用-待入库', color: '#FFD781' },
{ id: '3', name: '占用-有货', color: '#7362F3' },
{ id: '4', name: '占用-待出库', color: '#FFA08F' },
],
formConfig: [
{
type: 'button',
@ -130,26 +173,26 @@ export default {
there: [],
four: [],
}),
getWarehouseList().then((response) => {
response.data.forEach((item) => {
if (item.storageType === 1) {
listByWarehouse(item.id).then((response) => {
response.data.forEach((a, b) => {
if (b % 4 === 0) {
this.wareData.one.push(a);
} else if (b % 4 === 1) {
this.wareData.two.push(a);
} else if (b % 4 === 2) {
this.wareData.there.push(a);
} else if (b % 4 === 3) {
this.wareData.four.push(a);
getWarehouseList().then((response) => {
response.data.forEach((item) => {
if (item.storageType === 1) {
listByWarehouse(item.id).then((response) => {
response.data.forEach((a, b) => {
if (b % 4 === 0) {
this.wareData.one.push(a);
} else if (b % 4 === 1) {
this.wareData.two.push(a);
} else if (b % 4 === 2) {
this.wareData.there.push(a);
} else if (b % 4 === 3) {
this.wareData.four.push(a);
}
});
this.total = Math.ceil(response.data.length / 40);
});
}
});
this.total = Math.ceil(response.data.length / 40);
});
}
});
});
});
},
buttonClick(val) {
switch (val.btnName) {
@ -225,4 +268,25 @@ export default {
top: 22px;
right: 120px;
}
.dashboard-legend {
margin: 5px 5px 10px 5px;
.dashboard-legend-cassette {
display: inline-block;
margin-right: 24px;
.dashboard-legend-cassette-cricle {
display: inline-block;
width: 12px;
height: 12px;
border-radius: 6px;
}
}
.dashboard-legend-port {
display: inline-block;
height: 24px;
line-height: 24px;
border-radius: 4px;
padding: 0 16px;
margin-left: 24px;
}
}
</style>

View File

@ -17,7 +17,7 @@
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
:width="140"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />