Merge branch 'projects/mes-test' of git.picaiba.com:mt-fe-group/yudao-dev into projects/mes-test

This commit is contained in:
gtz 2023-11-27 09:31:52 +08:00
commit d9f3434712
171 changed files with 3312 additions and 2425 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -113,6 +113,15 @@ export function orderMonitor(query) {
}) })
} }
// 获取订单绑定的工单和数量信息可传订单id列表map索引为订单id
export function orderAssignmentList(query) {
return request({
url: '/base/order/orderAssignmentList',
method: 'get',
params: query
})
}
// 获得所有客户列表 // 获得所有客户列表
export function customerList() { export function customerList() {
return request({ return request({

View File

@ -1,7 +1,7 @@
/* /*
* @Author: Do not edit * @Author: Do not edit
* @Date: 2023-11-08 15:56:52 * @Date: 2023-11-08 15:56:52
* @LastEditTime: 2023-11-21 10:50:55 * @LastEditTime: 2023-11-23 19:10:07
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
*/ */
@ -32,3 +32,13 @@ export function exportMaintainMonitorExcel(query) {
responseType: 'blob' responseType: 'blob'
}) })
} }
// 导出设备保养记录
export function exportMaintainLogExcel(query) {
return request({
url: '/base/equipment-maintain-log/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -1,7 +1,7 @@
/* /*
* @Author: Do not edit * @Author: Do not edit
* @Date: 2023-11-10 16:09:33 * @Date: 2023-11-10 16:09:33
* @LastEditTime: 2023-11-16 18:57:08 * @LastEditTime: 2023-11-23 20:29:28
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
*/ */
@ -31,3 +31,13 @@ export function deleteRepair(id) {
method: 'delete' method: 'delete'
}) })
} }
// 导出设备维修
export function exportRepairLogExcel(query) {
return request({
url: '/base/equipment-repair-log/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -1,7 +1,7 @@
/* /*
* @Author: zhp * @Author: zhp
* @Date: 2023-11-07 19:47:48 * @Date: 2023-11-07 19:47:48
* @LastEditTime: 2023-11-16 17:49:23 * @LastEditTime: 2023-11-23 13:57:41
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
*/ */
@ -104,3 +104,18 @@ export function getMaterialList(data) {
data: data data: data
}) })
} }
export function getMaterialCode(data) {
return request({
url: '/extend/process-equ-material-bom/getCode',
method: 'get',
params: data
})
}
export function createProcessEquMaterialBomDetList(data) {
return request({
url: '/extend/process-equ-material-bom-det/createByList',
method: 'post',
data: data
})
}

View File

@ -1,7 +1,7 @@
/* /*
* @Author: zhp * @Author: zhp
* @Date: 2023-11-09 09:37:14 * @Date: 2023-11-09 09:37:14
* @LastEditTime: 2023-11-16 17:47:21 * @LastEditTime: 2023-11-23 14:15:45
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
*/ */
@ -104,3 +104,19 @@ export function getValueList(data) {
params: data params: data
}) })
} }
export function getValueCode(data) {
return request({
url: '/extend/process-equ-value-bom/getCode',
method: 'get',
params: data
})
}
export function createProcessEquValueBomDetList(data) {
return request({
url: '/extend/process-equ-value-bom-det/createByList',
method: 'post',
data: data
})
}

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

View File

@ -0,0 +1,14 @@
<?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>rollback</title>
<g id="页面" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="按钮与选择" transform="translate(-135.000000, -282.000000)" fill-rule="nonzero">
<g id="编组-3" transform="translate(127.000000, 274.000000)">
<g id="rollback" transform="translate(8.000000, 8.000000)">
<rect id="矩形" fill="#000000" opacity="0" x="0" y="0" width="16" height="16"></rect>
<path d="M11.390625,3.78125 L5.71875,3.78125 L5.71875,2.625 C5.71875,2.5203125 5.5984375,2.4625 5.5171875,2.5265625 L3.2984375,4.2765625 C3.234375,4.3265625 3.234375,4.4234375 3.2984375,4.4734375 L5.5171875,6.2234375 C5.5984375,6.2875 5.71875,6.2296875 5.71875,6.125 L5.71875,4.96875 L11.203125,4.96875 C11.7554097,4.96875 12.203125,5.41646525 12.203125,5.96875 L12.203125,11.3125 C12.203125,11.8647847 11.7554097,12.3125 11.203125,12.3125 L2.93775156,12.3125 L2.93775156,12.3125 C2.55569144,12.3125 2.36466138,12.4938859 2.36466138,12.8566576 C2.36466138,13.5 2.93775156,13.5 2.93775156,13.5 C2.93775156,13.5 5.75537604,13.5 11.390625,13.5 C13,13.5 13.390625,12.8986083 13.390625,11.9909216 L13.390625,4.96875 C13.390625,4.06071182 13,3.78125 11.390625,3.78125 Z" id="路径" fill="currentColor"></path>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -37,6 +37,9 @@ $tabWidth: $tabW * 1px;
$rowHeight: $rowH * 1px; $rowHeight: $rowH * 1px;
$buttonHeight: $buttonH * 1px; $buttonHeight: $buttonH * 1px;
// 1080px 高度为基准的 1px
$base1px: 0.15vh; // 1px / 1080px;
// - - - - - 页面基础设置 // - - - - - 页面基础设置
.container { .container {
.login-code { .login-code {
@ -87,7 +90,7 @@ $buttonHeight: $buttonH * 1px;
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: #ffffff; background-color: #ffffff;
// box-shadow: 0px 16px 40px rgba(0, 0, 0, 0.07); // box-shadow: 0px calc(16 * 0.12vh) 40px rgba(0, 0, 0, 0.07);
// border-radius: 20px; // border-radius: 20px;
// 定位 // 定位
position: relative; position: relative;
@ -100,6 +103,7 @@ $buttonHeight: $buttonH * 1px;
// 元素 // 元素
// width: $picWidth; // width: $picWidth;
height: $picHeight; height: $picHeight;
// height: 10vh;
background-image: url($picImage); background-image: url($picImage);
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
@ -118,7 +122,7 @@ $buttonHeight: $buttonH * 1px;
} }
.field { .field {
position: relative; position: relative;
margin-top: 8%; margin-top: 14vh;
flex: 2; flex: 2;
// width: 800px; // width: 800px;
display: flex; display: flex;
@ -130,17 +134,36 @@ $buttonHeight: $buttonH * 1px;
text-align: center; text-align: center;
clear: both; clear: both;
position: relative; position: relative;
top: -36px; top: calc(-32 * $base1px);
height: 128px; height: calc(128 * $base1px);
.title { .title {
margin: 0; margin: 0;
margin-left: 32px; margin-left: calc(28 * 0.12vh);
font-weight: 400; font-weight: 400;
user-select: none; user-select: none;
color: #000; color: #000;
font-size: 36px; font-size: calc(28 * 0.12vh);
line-height: 54px; line-height: calc(40 * 0.12vh);
letter-spacing: calc(2 * 0.12vh);
.cnbm_logo {
height: calc(40 * 0.12vh);
width: calc(40 * 0.12vh);
position: relative;
top: calc(8 * 0.12vh);
right: calc(8 * 0.12vh);
}
}
.sub-title {
margin: 0;
margin-left: calc(28 * 0.12vh);
font-weight: 400;
user-select: none;
color: #000;
font-size: calc(28 * 0.12vh);
line-height: calc(48 * 0.12vh);
letter-spacing: 2px; letter-spacing: 2px;
} }
} }
@ -159,10 +182,10 @@ $buttonHeight: $buttonH * 1px;
.footer { .footer {
user-select: none; user-select: none;
// 元素 // 元素
margin: 12px 0; margin: calc(12 * 0.12vh) 0;
height: 16px; height: calc(16 * 0.12vh);
line-height: 16px; line-height: calc(16 * 0.12vh);
font-size: 12px; font-size: calc(12 * 0.12vh);
color: #8c8c8c; color: #8c8c8c;
a, a,
@ -176,12 +199,8 @@ $buttonHeight: $buttonH * 1px;
.form { .form {
margin-top: 0; margin-top: 0;
box-sizing: border-box; box-sizing: border-box;
// width: $formWidth;
width: 100%; width: 100%;
// - - - tab
:deep(.el-tabs__nav) {
// background: #f0f3;
}
:deep(.el-tabs__content) { :deep(.el-tabs__content) {
padding: 20px 0 0; padding: 20px 0 0;
} }
@ -189,12 +208,13 @@ $buttonHeight: $buttonH * 1px;
user-select: none; user-select: none;
// 元素 // 元素
width: $tabWidth; width: $tabWidth;
height: $rowHeight; // height: $rowHeight;
height: calc(54 * 0.12vh);
padding: 0; padding: 0;
// 文字 // 文字
line-height: $rowHeight; line-height: $rowHeight;
color: #666666; color: #666666;
font-size: 18px; font-size: calc(14 * 0.12vh);
font-weight: 400; font-weight: 400;
text-align: center; text-align: center;
} }
@ -210,7 +230,8 @@ $buttonHeight: $buttonH * 1px;
:deep(.el-input__inner) { :deep(.el-input__inner) {
// 元素 // 元素
width: 100%; width: 100%;
height: $rowHeight; // height: $rowHeight;
height: calc(72 * 0.12vh);
background: #f5f5f5; background: #f5f5f5;
border: 0; border: 0;
border-radius: 28px; border-radius: 28px;
@ -280,7 +301,7 @@ $buttonHeight: $buttonH * 1px;
margin-bottom: 20px; margin-bottom: 20px;
// 文字 // 文字
line-height: 26px; line-height: 26px;
font-size: 20px; font-size: calc(18 * 0.12vh);
color: #ffffff; color: #ffffff;
} }
.button-active { .button-active {
@ -299,13 +320,14 @@ $buttonHeight: $buttonH * 1px;
:deep(.el-input__inner) { :deep(.el-input__inner) {
// 元素 // 元素
width: 420px; width: 420px;
height: 66px; height: calc(52 * 0.12vh);
// height: 66px;
color: #262626; color: #262626;
font-size: 18px; font-size: calc(14 * 0.12vh);
} }
:deep(.el-checkbox__label) { :deep(.el-checkbox__label) {
font-size: 18px; font-size: calc(14 * 0.12vh);
line-height: 14px; line-height: calc(12 * 0.12vh);
} }
} }
} }
@ -314,19 +336,42 @@ $buttonHeight: $buttonH * 1px;
@media screen and (min-width: 1920px) { @media screen and (min-width: 1920px) {
.container { .container {
.content { .content {
.field { .field {
flex: initial; flex: initial;
width: 800px; // width: 800px;
width: 40vw;
}
}
}
}
@media screen and (min-height: 1024px) {
.container {
.content {
.field {
margin-top: 16vh;
}
}
}
}
@media screen and (max-height: 1024px) {
.container {
.content {
.field {
margin-top: 8vh;
} }
} }
} }
} }
@media screen and (min-width: 599px) and (max-width: 1366px) { @media screen and (min-width: 599px) and (max-width: 1366px) {
.container { .container {
min-width: 599px; // min-width: 599px;
min-width: 42vw;
.content { .content {
// width: 710px; // width: 710px;
// height: 397px; // height: 397px;
@ -337,6 +382,7 @@ $buttonHeight: $buttonH * 1px;
display: none; display: none;
} }
.field { .field {
// margin-top: 6vh;
// width: calc(710px - 314px); // width: calc(710px - 314px);
// left: 314px; // left: 314px;
// justify-content: center; // justify-content: center;
@ -363,6 +409,14 @@ $buttonHeight: $buttonH * 1px;
} }
} }
// @media screen and (max-height: 1080px) {
// .container {
// .field {
// transform: scale(0.74);
// }
// }
// }
/* ===== MOBILE DESIGN ===== */ /* ===== MOBILE DESIGN ===== */
$mobileW: 375; $mobileW: 375;
$mobileH: 812; $mobileH: 812;
@ -503,7 +557,7 @@ $iconBgImage: '../assets/images/icon.png';
.footer { .footer {
// 元素 // 元素
font-size: 12px; font-size: calc(12 * 0.12vh);
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 400; font-weight: 400;
line-height: 17px; line-height: 17px;
@ -511,7 +565,7 @@ $iconBgImage: '../assets/images/icon.png';
opacity: 0.6; opacity: 0.6;
// 定位 // 定位
// position: absolute; // position: absolute;
bottom: -32px; bottom: -calc(32 * 0.12vh);
} }
} }
} }

View File

@ -347,6 +347,8 @@ export default {
console.log('setting code: ', response.data); console.log('setting code: ', response.data);
// //
this.form[opt.prop] = response.data; this.form[opt.prop] = response.data;
// dataFormcodebug
this.$emit('update', this.form)
} }
}); });
} }

View File

@ -33,6 +33,7 @@ export default {
addUrl: '', addUrl: '',
pageUrl: '', pageUrl: '',
infoUrl: '', infoUrl: '',
deleteUrl: '',
basePath: '', basePath: '',
form: {} form: {}
}; };
@ -60,7 +61,7 @@ export default {
return this.$axios({ return this.$axios({
url, url,
method, method,
params: method === 'get' ? payload : null, params: (method === 'get' || method === 'delete') ? payload : null,
data: method !== 'get' ? payload : null, data: method !== 'get' ? payload : null,
}) })
}, },
@ -77,6 +78,7 @@ export default {
return this.http(this.infoUrl == '' ? this.infoPath : this.infoUrl, 'get', payload); return this.http(this.infoUrl == '' ? this.infoPath : this.infoUrl, 'get', payload);
}, },
del(payload) { del(payload) {
debugger;
return this.http(this.deleteUrl == '' ? this.deletePath : this.deleteUrl, 'delete', payload); return this.http(this.deleteUrl == '' ? this.deletePath : this.deleteUrl, 'delete', payload);
}, },

View File

@ -163,7 +163,7 @@ input, textarea{
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
background-color: rgba(144,147,153,.5); background-color: #EDEDED;
background-clip: padding-box; background-clip: padding-box;
min-height: 28px; min-height: 28px;
-webkit-border-radius: 2em; -webkit-border-radius: 2em;
@ -174,7 +174,7 @@ input, textarea{
} }
::-webkit-scrollbar-thumb:hover { ::-webkit-scrollbar-thumb:hover {
background-color: rgba(144,147,153,.3); background-color: #D9D9D9;
} }
// 抽屉head区域---start // 抽屉head区域---start

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-07-19 15:18:30 * @Date: 2021-07-19 15:18:30
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2023-11-22 13:58:30 * @LastEditTime: 2023-11-23 11:14:30
* @Description: * @Description:
--> -->
<template> <template>
@ -730,21 +730,21 @@ export default {
} }
}, },
// watch: { watch: {
// clientWidth(val) { clientWidth(val) {
// if (!this.timer) { if (!this.timer) {
// this.clientWidth = val this.clientWidth = val
// this.beilv2 = this.clientWidth / 1920 this.beilv2 = this.clientWidth / 1920
// this.timer = true this.timer = true
// let _this = this let _this = this
// setTimeout(function () { setTimeout(function () {
// _this.timer = false _this.timer = false
// }, 500) }, 500)
// } }
// // //
// this.windowWidth(val); this.windowWidth(val);
// } }
// }, },
created() { created() {
// this.fetchList('exception-alarm') // this.fetchList('exception-alarm')
// this.fetchList('inAndOutOfEachLine') // this.fetchList('inAndOutOfEachLine')
@ -941,7 +941,7 @@ export default {
</style> </style>
<style lang="scss"> <style lang="scss" >
.visual-container { .visual-container {
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 8px; width: 8px;

View File

@ -60,7 +60,7 @@
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="24"> <el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="24">
<base-container1 :beilv="1" :title="'设备状态监控'" :title-icon="'1_5'"> <base-container1 :beilv="1" :title="'设备状态监控'" :title-icon="'1_5'">
<div class="visual-select"> <div class="visual-select">
<el-select v-model="modelMonth" size="mini" placeholder=""> <el-select class="coldSelect" v-model="modelMonth" size="mini" placeholder="">
<el-option key="1" value="钢1线" label="钢1线" default /> <el-option key="1" value="钢1线" label="钢1线" default />
</el-select> </el-select>
</div> </div>
@ -634,21 +634,21 @@ export default {
} }
} }
}, },
watch: { // watch: {
clientWidth(val) { // clientWidth(val) {
if (!this.timer) { // if (!this.timer) {
this.clientWidth = val // this.clientWidth = val
this.beilv2 = this.clientWidth / 1920 // this.beilv2 = this.clientWidth / 1920
this.timer = true // this.timer = true
let _this = this // let _this = this
setTimeout(function () { // setTimeout(function () {
_this.timer = false // _this.timer = false
}, 500) // }, 500)
} // }
// // //
this.windowWidth(val); // this.windowWidth(val);
} // }
}, // },
created() { created() {
// this.fetchList('exception-alarm') // this.fetchList('exception-alarm')
// this.fetchList('inAndOutOfEachLine') // this.fetchList('inAndOutOfEachLine')
@ -658,6 +658,7 @@ export default {
this.windowWidth(document.documentElement.clientWidth) this.windowWidth(document.documentElement.clientWidth)
}, },
mounted() { mounted() {
console.log(1111);
const _this = this; const _this = this;
_this.beilv2 = document.documentElement.clientWidth / 1920 _this.beilv2 = document.documentElement.clientWidth / 1920
window.onresize = () => { window.onresize = () => {
@ -686,6 +687,7 @@ export default {
methods: { methods: {
windowWidth(value) { windowWidth(value) {
this.clientWidth = value this.clientWidth = value
this.beilv2 = this.clientWidth / 1920
}, },
// erd.listenTo(document.getElementById("box"), (element) => { // erd.listenTo(document.getElementById("box"), (element) => {
// var width = element.offsetWidth; // var width = element.offsetWidth;
@ -1057,7 +1059,7 @@ export default {
} }
</style> </style>
<style lang="scss"> <style lang="scss" >
.visual-container { .visual-container {
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 8px; width: 8px;
@ -1096,23 +1098,25 @@ export default {
background-color: rgba($color: #5bc4be, $alpha: 1); background-color: rgba($color: #5bc4be, $alpha: 1);
} }
} }
.el-input { .coldSelect{
min-height: 10px; .el-input {
} min-height: 10px;
}
.el-input__inner { .el-input__inner {
background-color: rgba($color: #31878c, $alpha: 0.29); background-color: rgba($color: #31878c, $alpha: 0.29);
border: rgba($color: #31878c, $alpha: 0.29); border: rgba($color: #31878c, $alpha: 0.29);
color: aliceblue; color: aliceblue;
} }
.el-divider--vertical { .el-divider--vertical {
height: 174px; height: 174px;
width: 1px; width: 1px;
border: rgba(255, 255, 255, 0.15); border: rgba(255, 255, 255, 0.15);
color: rgba(255, 255, 255, 0.15); color: rgba(255, 255, 255, 0.15);
margin-left: 3em; margin-left: 3em;
} }
}
</style> </style>
<style scoped> <style scoped>

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-07-19 15:18:30 * @Date: 2021-07-19 15:18:30
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2023-10-17 11:10:22 * @LastEditTime: 2023-11-23 11:11:35
* @Description: * @Description:
--> -->
<template> <template>
@ -44,7 +44,7 @@
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="8"> <el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="8">
<base-container :title="'各工序缺陷汇总'" :title-icon="'5_2'"> <base-container :title="'各工序缺陷汇总'" :title-icon="'5_2'">
<div class="visual-select"> <div class="visual-select">
<el-select v-model="modelMonth" size="mini" placeholder=""> <el-select class="coldSelect" v-model="modelMonth" size="mini" placeholder="">
<el-option key="1" value="钢1线" label="钢1线" default /> <el-option key="1" value="钢1线" label="钢1线" default />
</el-select> </el-select>
</div> </div>
@ -740,16 +740,16 @@ export default {
// this.fetchList('order-process') // this.fetchList('order-process')
// this.fetchList('line-chart-data') // this.fetchList('line-chart-data')
this.init() this.init()
this.windowWidth(document.documentElement.clientWidth)
}, },
mounted() { mounted() {
const _this = this; this.windowWidth(document.documentElement.clientWidth)
window.onresize = () => { // const _this = this;
return (() => { // window.onresize = () => {
_this.clientWidth = `${document.documentElement.clientWidth}` // return (() => {
this.beilv2 = _this.clientWidth / 1920 // _this.clientWidth = `${document.documentElement.clientWidth}`
})() // this.beilv2 = _this.clientWidth / 1920
} // })()
// }
// this.beilv2 = window.innerWidth / 1920 // this.beilv2 = window.innerWidth / 1920
// addEventListener('resize', resizeFun = () => { // addEventListener('resize', resizeFun = () => {
// this.beilv2 = window.innerWidth / 1920 // this.beilv2 = window.innerWidth / 1920
@ -770,6 +770,7 @@ export default {
methods: { methods: {
windowWidth(value) { windowWidth(value) {
this.clientWidth = value this.clientWidth = value
this.beilv2 = this.clientWidth / 1920
}, },
// fetchList(type) { // fetchList(type) {
// switch (type) { // switch (type) {
@ -932,7 +933,8 @@ export default {
background-color: rgba($color: #5bc4be, $alpha: 1); background-color: rgba($color: #5bc4be, $alpha: 1);
} }
} }
.el-input { .coldSelect{
.el-input {
min-height: 10px; min-height: 10px;
} }
@ -949,6 +951,7 @@ export default {
color: rgba(255, 255, 255, 0.15); color: rgba(255, 255, 255, 0.15);
margin-left: 3em; margin-left: 3em;
} }
}
</style> </style>

View File

@ -288,10 +288,10 @@ export default {
[ [
{ {
input: true, input: true,
label: '产品加工时间(s)', label: '单件产品加工时间(s)',
prop: 'processingTime', prop: 'processingTime',
rules: [ rules: [
{ required: true, message: '产品加工时间不能为空', trigger: 'blur' }, { required: true, message: '单件产品加工时间不能为空', trigger: 'blur' },
{ {
type: 'number', type: 'number',
message: '请输入正确的数字值', message: '请输入正确的数字值',
@ -319,9 +319,16 @@ export default {
prop: 'description', prop: 'description',
}, },
], ],
[
{
upload: true,
label: '上传资料',
prop: 'files',
},
],
[ [
{ input: true, label: '备注', prop: 'remark' } { input: true, label: '备注', prop: 'remark' }
] ],
// [ // [
// { // {
// assetUpload: true, // assetUpload: true,

View File

@ -189,6 +189,10 @@ export default {
], ],
label: '产线统计类型', label: '产线统计类型',
prop: 'lineDataType', prop: 'lineDataType',
bind: {
clearable: true, filterable: true
},
rules: [{ required: true, message: '产线统计类型不能为空', trigger: 'change' }],
}, },
{ {
select: true, select: true,
@ -199,6 +203,10 @@ export default {
], ],
label: '工段统计类型', label: '工段统计类型',
prop: 'sectionDataType', prop: 'sectionDataType',
bind: {
clearable: true, filterable: true
},
rules: [{ required: true, message: '工段统计类型不能为空', trigger: 'change' }],
}, },
], ],
], ],

View File

@ -144,8 +144,8 @@ export default {
getDataList() { getDataList() {
this.dataListLoading = true; this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then(response => { this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.tableData = response.data.list; // this.tableData = response.data.list;
// this.getStatus(response.data.list) this.getStatus(response.data.list)
this.listQuery.total = response.data.total; this.listQuery.total = response.data.total;
this.dataListLoading = false; this.dataListLoading = false;
}); });

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-11-20 16:51:24 * @LastEditTime: 2023-11-24 18:20:26
* @Description: * @Description:
--> -->
<template> <template>
@ -29,11 +29,10 @@
<div class="action_btn"> <div class="action_btn">
<template> <template>
<span style="display: inline-block;" @click="addNew()"> <span style="display: inline-block;">
<svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" /> <el-button type="text" @click="addNew()" icon="el-icon-plus">添加</el-button>
<span class="add">添加</span> </span>
</span> </template>
</template>
</div> </div>
<base-table <base-table
:table-props="tableProps" :table-props="tableProps"
@ -298,7 +297,7 @@ export default {
} }
.action_btn { .action_btn {
float: right; float: right;
margin: 5px 15px; margin: -40px 15px;
font-size: 14px; font-size: 14px;
} }
.add { .add {

View File

@ -311,11 +311,11 @@ export default {
if (val) { if (val) {
this.productList.map(item => { this.productList.map(item => {
if (val === item.id) { if (val === item.id) {
this.dataForm.productSpec = item.specifications this.dataForm.specifications = item.specifications
} }
}) })
} else { } else {
this.dataForm.productSpec = '' this.dataForm.specifications = ''
} }
} }
} }

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-11-22 09:47:53 * @LastEditTime: 2023-11-23 18:45:15
* @Description: * @Description:
--> -->
<template> <template>
@ -49,7 +49,9 @@
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8">负责人:{{ dataForm.workers }}</el-col> <el-col :span="8">负责人:{{ dataForm.workers }}</el-col>
<el-col :span="8">关联产线:{{ dataForm.productLineNames }}</el-col> <el-col :span="8">关联产线:
<span v-for="(item, index) in dataForm.productLineNames" :key="index" style="margin-right: 10px">{{ item }}</span>
</el-col>
<el-col :span="8">物料计算方式:{{ dataForm.materialMethod === 1 ? '产品基础' : dataForm.materialMethod === 2 ? '工艺扩展' : '' }}</el-col> <el-col :span="8">物料计算方式:{{ dataForm.materialMethod === 1 ? '产品基础' : dataForm.materialMethod === 2 ? '工艺扩展' : '' }}</el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-11-22 10:26:58 * @LastEditTime: 2023-11-24 18:13:02
* @Description: * @Description:
--> -->
<template> <template>
@ -196,7 +196,7 @@ export default {
workCost: undefined, workCost: undefined,
remark: undefined, remark: undefined,
}, },
majorIdList: undefined, majorIdList: [],
departmentlList: [], departmentlList: [],
menuOptions: [], menuOptions: [],
bindIds: [], bindIds: [],
@ -267,7 +267,7 @@ export default {
workCost: undefined, workCost: undefined,
remark: undefined remark: undefined
} }
this.majorIdList = undefined this.majorIdList = []
}, },
// //
dataFormSubmit() { dataFormSubmit() {
@ -288,24 +288,28 @@ export default {
this.visible = false; this.visible = false;
this.$emit("refreshDataList"); this.$emit("refreshDataList");
}); });
this.majorIdList.forEach(majorId => { if (this.majorIdList.length > 0) {
createWoBindMa({ this.majorIdList.forEach(majorId => {
workerId: this.dataForm.id, createWoBindMa({
majorId: majorId workerId: this.dataForm.id,
}).then(res => {}) majorId: majorId
}); }).then(res => {})
});
}
return; return;
} }
// //
this.urlOptions.createURL(this.dataForm).then(response => { this.urlOptions.createURL(this.dataForm).then(response => {
// response.data = id // response.data = id
this.workerId = response.data this.workerId = response.data
this.majorIdList.forEach(majorId => { if (this.majorIdList.length > 0) {
createWoBindMa({ this.majorIdList.forEach(majorId => {
workerId: this.workerId, createWoBindMa({
majorId: majorId workerId: this.workerId,
}).then(res => {}) majorId: majorId
}); }).then(res => {})
});
}
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.visible = false; this.visible = false;
this.$emit("refreshDataList"); this.$emit("refreshDataList");
@ -324,6 +328,7 @@ export default {
if (this.dataForm.id) { if (this.dataForm.id) {
this.urlOptions.infoURL(id).then(response => { this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data; this.dataForm = response.data;
this.dataForm.departmentName = undefined
}); });
// -- // --
getWoBindMaPage({ getWoBindMaPage({

View File

@ -202,12 +202,11 @@ export default {
} }
}, },
created() { created() {
// this.init() // $('.hiprintEpContainer').empty()
// console.log('aaaaaa')
// this.otherPaper()
}, },
destroyed () { destroyed () {
$('.hiprintEpContainer').empty() $('.hiprintEpContainer').empty()
console.log(11111)
}, },
methods: { methods: {
// handleClose() { // handleClose() {
@ -215,6 +214,7 @@ export default {
// }, // },
closed() { closed() {
$('.hiprintEpContainer').empty() $('.hiprintEpContainer').empty()
$('.hiprint-printTemplate').empty()
}, },
init(data) { init(data) {
this.drawer = true this.drawer = true
@ -256,17 +256,17 @@ export default {
// console.log(this.modelData) // console.log(this.modelData)
// console.log($('#hiprint-printTemplate').empty()) // console.log($('#hiprint-printTemplate').empty())
if (this.modelData != {}) { // if () {
console.log(this.modelData); // console.log(this.modelData);
$('.hiprintEpContainer').empty() // $('.hiprintEpContainer').empty()
hiprint.PrintElementTypeManager.build('.hiprintEpContainer', provider.value) // hiprint.PrintElementTypeManager.build('.hiprintEpContainer', provider.value)
$('.hiprint-printTemplate').empty() // $('.hiprint-printTemplate').empty()
hiprintTemplate = new hiprint.PrintTemplate({ // hiprintTemplate = new hiprint.PrintTemplate({
template: JSON.parse(this.modelData), // template: JSON.parse(this.modelData),
settingContainer: '#PrintElementOptionSetting', // settingContainer: '#PrintElementOptionSetting',
paginationContainer: '.hiprint-printPagination' // paginationContainer: '.hiprint-printPagination'
}) // })
} else { // } else {
$('.hiprintEpContainer').empty() $('.hiprintEpContainer').empty()
console.log(this.modelData); console.log(this.modelData);
hiprint.PrintElementTypeManager.build('.hiprintEpContainer', provider.value) hiprint.PrintElementTypeManager.build('.hiprintEpContainer', provider.value)
@ -275,11 +275,11 @@ export default {
const template = provider.value const template = provider.value
// console.log(template) // console.log(template)
hiprintTemplate = new hiprint.PrintTemplate({ hiprintTemplate = new hiprint.PrintTemplate({
template: template, template: this.modelData != '' ? JSON.parse(this.modelData) : {},
settingContainer: '#PrintElementOptionSetting', settingContainer: '#PrintElementOptionSetting',
paginationContainer: '.hiprint-printPagination' paginationContainer: '.hiprint-printPagination'
}) })
} // }
hiprintTemplate.design('#hiprint-printTemplate') hiprintTemplate.design('#hiprint-printTemplate')
// console.log(hiprintTemplate) // console.log(hiprintTemplate)
console.log(hiprintTemplate); console.log(hiprintTemplate);

View File

@ -236,212 +236,10 @@ export const aProvider = function (ops) {
}; };
}; };
// 自定义设计元素2
export const bProvider = function (ops) {
var addElementTypes = function (context) {
context.removePrintElementTypes("bProviderModule");
context.addPrintElementTypes(
"bProviderModule",
[
new hiprint.PrintElementTypeGroup("常规", [
{
tid: 'bProviderModule.header', title: '单据表头', data: '单据表头', type: 'text',
options: {
testData: '单据表头',
height: 17,
fontSize: 16.5,
fontWeight: "700",
textAlign: "center",
hideTitle: true
}
},
{
tid: 'bProviderModule.type', title: '单据类型', data: '单据类型', type: 'text',
options: {
testData: '单据类型',
height: 16,
fontSize: 15,
fontWeight: "700",
textAlign: "center",
hideTitle: true
}
},
{
tid: 'bProviderModule.order', title: '订单编号', data: 'XS888888888', type: 'text',
options: {
field: 'orderId',
testData: 'XS888888888',
height: 16,
fontSize: 6.75,
fontWeight: "700",
textAlign: "left",
textContentVerticalAlign: "middle"
}
},
{
tid: 'bProviderModule.date', title: '业务日期', data: '2020-01-01', type: 'text',
options: {
field: 'date',
testData: '2020-01-01',
height: 16,
fontSize: 6.75,
fontWeight: "700",
textAlign: "left",
textContentVerticalAlign: "middle"
}
},
{
tid: 'bProviderModule.barcode', title: '条形码', data: 'XS888888888', type: 'text',
options: {
field: 'barcode',
testData: 'XS888888888',
height: 32,
fontSize: 12,
lineHeight: 18,
textType: "barcode"
}
},
{
tid: 'bProviderModule.qrcode', title: '二维码', data: 'XS888888888', type: 'text',
options: {
field: 'qrcode',
testData: 'XS888888888',
height: 32,
fontSize: 12,
lineHeight: 18,
textType: "qrcode"
}
},
{
tid: 'bProviderModule.platform', title: '平台名称', data: '平台名称', type: 'text',
options: {
testData: '平台名称',
height: 17,
fontSize: 16.5,
fontWeight: "700",
textAlign: "center",
hideTitle: true
}
},
{tid: 'bProviderModule.image', title: 'Logo', data: 'data: image/png;base64iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAHVklEQVR4nO2dT2wUVRzHv2/2T5eSAlvFilwgQUH+eLACaUxEiJLAxdh44MDZi2ChUIrSFtoCgbbSP4GDdwgeEA8kRTAI0iIGBL1ITLxgLAlCsCKBYndnx7zd35pl2+7On/de387OJ9l00515/z7z/szMmzfs7869mD0yCjw2gZAB4VhAiln4/dUaRGdU18aOnzw9dn24ioGJj0soFsJr1z2yNm+qN2/fvRFL8XyMYqTmFfxZ+TwMc1xKDsL/f2Ms8xGeLwuIRpCKx99MHf/i4uPrw5GQ9jIAfsCMXfw2HkuOX03Wb1qLh4+uIGFJjzecPoS5iEhUTg1hDMaM2GuRk6cGMTQUCYmPQQq86CMAkkPDkQirGAzXf7Du34ejN9IHmETCRjQGPL6D+4NnYDEJDQmXbaY6on/dm2Vm/jHdZe0Almm6Ll+YNQbzasX7765BNHI1o0sOYRghwExg7MG9dDQSiqsdwHuZmlFKMjLwQ3QcFtjlSxHTenLO3Lp7vfU09AOS41Ka+HC6CjIDIaqmguvIPgBtIgOcDhjVlMTQtarKOScumR/teCdpxoeNZGJCapjFt7Rcywrb2MYtnQBatCpZTzCkYCF+5suKRXf+6EvOmv0GSzwrhB/QpmGkBYZSpqvIZAlp8ZeMLFwKUH3z2gqWyd/+3F/5b1yRQQMCN8gQspeaKt+SAItSCxCiPjIjhDEkjRAMxmCZSbgZkYke537qdxl57KM8C0OkkD0ADohMXIlwgPIuBFFC9uS3p2XGflFSRAgpdxlZeBl84jUQr0ImjDTKGWZZBwE0eCkCL0J20UgjgGCwEDHNPjB86PbiilshfGRxOBCRD0tLCSWTnzMLO9yE4EbIzjIdTdmGpc8/rB4qK0c4FcKbqe7pyWZJ0k1lZhsnQnZq3EzV00dHDjupKXaFNGtcM7YA+Io+WzRIz2R0UxkWxY6QJgCHlCbfPlzAsZytj2ks5RCVZUGKCdkOoEt+Wl3RkCcjyzGv5wIS6aIynZJCQni7d0TTjPFaMFDg9wGNa8qRQn3KVEI+1rjPmKpm5KNzTemmMp7AZEK2AehXmz7bbC1SM/IZoH10pJ/K+hnyhXBrvZpmoBHAURf7HaV9daQ3v6Zk7hhWVr4AYDOAzzRNeKPHAyW7r459Yj/deUynMcyqqpY9/fXW+RTwkiF/ms5pADcd7nMbwAkBcfMM3wOwwOF+rys46TxCt+T72d2NG0YSg2fnC58ANDkbAZyVH41QNgAYVBTXNiMxeLYG6qawvagmGqGoTHOfwcAe6T8TvWwYlTC7OsALgRDNCIRoRiBEMwIhmhEI0YxAiGYEQjRDtZCY9iUyEaVpVi3kvuL4RKA0zSqF8Ad5TimMTxSnKO1KUCWEZ6hDVaYk0KFKigohbSUuI0uHiieKZQtp89kM+U7ZUmQKafHp4wpSH/eWJaTT5zPkD8g62GQI8cXqDTZok/HEsWgh+3Of2y4D2kU/0idKyEOaJdgqKLxSotXlfLFJESXkicKZGTrys6g0iRIyD8AvAFYLCq+UWC1yACOyD+Hrf1wAUCcwTN2pozzXiEqn6E59JoBvANQKDldHaimvM0WmTcawlydw2Oc1pY7yKFQGJJ4YxqiTXyEp/OlkBeVNyn0SmZdO5gC47rOOfjXlaY6sCGRfXKwA8LVP+pRaykuFzEhUXH7nR9P3AFYqiEsWKykP0mpGFlU3qKI0IlmlKD6RrKK0R1VEpvIW7uwSHXnVUdqVoHqSwz+K4xOB0jQH87I0IxCiGYEQzQiEaEYgRDMCIZoRCNGMQIhmBEI0gwuJK0xScKZemHiY1mzqUxThYgBLHO7zQOAzGnMBPOdwn8WC4rbDNjaSWVajQaEUp9wBsB7ALY/hLAVwHsB89VmwRXrhuGwf0q/xIl/z6f6105qVyxIKQ1cZjdlV/HI79V6N1yjk/dxlAMtc7LuM9lXZVzqhIXdxtvxR1kCxZUynkbl0o2ihgyQspH3mapqn7flrSE427O3TuKbwGZI/AlhuY9vltO08Belyw6T99lTnIQN2VmGeJqppskGhpfoW0DbVmuahaarVVQudGPZo3tH/RCOnfJbSbzp34D1T/VjsTL3X6esWFMJngJwDsCgnykX0P+mzQ1yyq9jqqtnzkGI0a7wgPz9pfJm+/6ZxB77bzus+7L7pkwdkarr8OBdwJee7jjQVaqZysVtDsuwK3j3lmGYnb5hwerW3S+PRl440OX3dh5vL7z0iXzXqY/bYbaZycXs/5KDdV/iUKc1URo7xcoOqq0yfui1Gq5e3EoUava1qzS/aJQGs8xKIj2jx+gCoVyGcoUBKGs8yIEgIAiliZEDwJAehL3ovIYS+2F9UDckyRH/fFhmoxuwTvdaJaCGc7+gyi9+br1YZSzTJEAIaffHrZG/JCFwDpK16JEsI5yK9uMdvzVe7zAUxZQrhXKKBwxqZkSikQ8aiZbnIFgKS4oea0i5bBhQJgQ+kKJEBhUJAUkqxo+cduJqVrQH8B6xBgBhvJFNDAAAAAElFTkSuQmCC', type: 'image', options: {
src: 'data: image/png;base64iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAHVklEQVR4nO2dT2wUVRzHv2/2T5eSAlvFilwgQUH+eLACaUxEiJLAxdh44MDZi2ChUIrSFtoCgbbSP4GDdwgeEA8kRTAI0iIGBL1ITLxgLAlCsCKBYndnx7zd35pl2+7On/de387OJ9l00515/z7z/szMmzfs7869mD0yCjw2gZAB4VhAiln4/dUaRGdU18aOnzw9dn24ioGJj0soFsJr1z2yNm+qN2/fvRFL8XyMYqTmFfxZ+TwMc1xKDsL/f2Ms8xGeLwuIRpCKx99MHf/i4uPrw5GQ9jIAfsCMXfw2HkuOX03Wb1qLh4+uIGFJjzecPoS5iEhUTg1hDMaM2GuRk6cGMTQUCYmPQQq86CMAkkPDkQirGAzXf7Du34ejN9IHmETCRjQGPL6D+4NnYDEJDQmXbaY6on/dm2Vm/jHdZe0Almm6Ll+YNQbzasX7765BNHI1o0sOYRghwExg7MG9dDQSiqsdwHuZmlFKMjLwQ3QcFtjlSxHTenLO3Lp7vfU09AOS41Ka+HC6CjIDIaqmguvIPgBtIgOcDhjVlMTQtarKOScumR/teCdpxoeNZGJCapjFt7Rcywrb2MYtnQBatCpZTzCkYCF+5suKRXf+6EvOmv0GSzwrhB/QpmGkBYZSpqvIZAlp8ZeMLFwKUH3z2gqWyd/+3F/5b1yRQQMCN8gQspeaKt+SAItSCxCiPjIjhDEkjRAMxmCZSbgZkYke537qdxl57KM8C0OkkD0ADohMXIlwgPIuBFFC9uS3p2XGflFSRAgpdxlZeBl84jUQr0ImjDTKGWZZBwE0eCkCL0J20UgjgGCwEDHNPjB86PbiilshfGRxOBCRD0tLCSWTnzMLO9yE4EbIzjIdTdmGpc8/rB4qK0c4FcKbqe7pyWZJ0k1lZhsnQnZq3EzV00dHDjupKXaFNGtcM7YA+Io+WzRIz2R0UxkWxY6QJgCHlCbfPlzAsZytj2ks5RCVZUGKCdkOoEt+Wl3RkCcjyzGv5wIS6aIynZJCQni7d0TTjPFaMFDg9wGNa8qRQn3KVEI+1rjPmKpm5KNzTemmMp7AZEK2AehXmz7bbC1SM/IZoH10pJ/K+hnyhXBrvZpmoBHAURf7HaV9daQ3v6Zk7hhWVr4AYDOAzzRNeKPHAyW7r459Yj/deUynMcyqqpY9/fXW+RTwkiF/ms5pADcd7nMbwAkBcfMM3wOwwOF+rys46TxCt+T72d2NG0YSg2fnC58ANDkbAZyVH41QNgAYVBTXNiMxeLYG6qawvagmGqGoTHOfwcAe6T8TvWwYlTC7OsALgRDNCIRoRiBEMwIhmhEI0YxAiGYEQjRDtZCY9iUyEaVpVi3kvuL4RKA0zSqF8Ad5TimMTxSnKO1KUCWEZ6hDVaYk0KFKigohbSUuI0uHiieKZQtp89kM+U7ZUmQKafHp4wpSH/eWJaTT5zPkD8g62GQI8cXqDTZok/HEsWgh+3Of2y4D2kU/0idKyEOaJdgqKLxSotXlfLFJESXkicKZGTrys6g0iRIyD8AvAFYLCq+UWC1yACOyD+Hrf1wAUCcwTN2pozzXiEqn6E59JoBvANQKDldHaimvM0WmTcawlydw2Oc1pY7yKFQGJJ4YxqiTXyEp/OlkBeVNyn0SmZdO5gC47rOOfjXlaY6sCGRfXKwA8LVP+pRaykuFzEhUXH7nR9P3AFYqiEsWKykP0mpGFlU3qKI0IlmlKD6RrKK0R1VEpvIW7uwSHXnVUdqVoHqSwz+K4xOB0jQH87I0IxCiGYEQzQiEaEYgRDMCIZoRCNGMQIhmBEI0gwuJK0xScKZemHiY1mzqUxThYgBLHO7zQOAzGnMBPOdwn8WC4rbDNjaSWVajQaEUp9wBsB7ALY/hLAVwHsB89VmwRXrhuGwf0q/xIl/z6f6105qVyxIKQ1cZjdlV/HI79V6N1yjk/dxlAMtc7LuM9lXZVzqhIXdxtvxR1kCxZUynkbl0o2ihgyQspH3mapqn7flrSE427O3TuKbwGZI/AlhuY9vltO08Belyw6T99lTnIQN2VmGeJqppskGhpfoW0DbVmuahaarVVQudGPZo3tH/RCOnfJbSbzp34D1T/VjsTL3X6esWFMJngJwDsCgnykX0P+mzQ1yyq9jqqtnzkGI0a7wgPz9pfJm+/6ZxB77bzus+7L7pkwdkarr8OBdwJee7jjQVaqZysVtDsuwK3j3lmGYnb5hwerW3S+PRl440OX3dh5vL7z0iXzXqY/bYbaZycXs/5KDdV/iUKc1URo7xcoOqq0yfui1Gq5e3EoUava1qzS/aJQGs8xKIj2jx+gCoVyGcoUBKGs8yIEgIAiliZEDwJAehL3ovIYS+2F9UDckyRH/fFhmoxuwTvdaJaCGc7+gyi9+br1YZSzTJEAIaffHrZG/JCFwDpK16JEsI5yK9uMdvzVe7zAUxZQrhXKKBwxqZkSikQ8aiZbnIFgKS4oea0i5bBhQJgQ+kKJEBhUJAUkqxo+cduJqVrQH8B6xBgBhvJFNDAAAAAElFTkSuQmCC',
fit: 'none'
}},
]),
new hiprint.PrintElementTypeGroup("客户", [
{
tid: 'bProviderModule.khname', title: '客户名称', data: '高级客户', type: 'text',
options: {
field: 'name',
testData: '高级客户',
height: 16,
fontSize: 6.75,
fontWeight: "700",
textAlign: "left",
textContentVerticalAlign: "middle"
}
},
{
tid: 'bProviderModule.tel', title: '客户电话', data: '18888888888', type: 'text',
options: {
field: 'tel',
testData: '18888888888',
height: 16,
fontSize: 6.75,
fontWeight: "700",
textAlign: "left",
textContentVerticalAlign: "middle"
}
},
]),
new hiprint.PrintElementTypeGroup("表格/其他", [
{
tid: 'bProviderModule.table', title: '订单数据',
type: 'table',
options: {
field: 'table',
fields: [
{text: '名称', field: 'NAME'},
{text: '数量', field: 'SL'},
{text: '规格', field: 'GG'},
{text: '条码', field: 'TM'},
{text: '单价', field: 'DJ'},
{text: '金额', field: 'JE'},
{text: '备注', field: 'DETAIL'},
],
},
editable: true,
columnDisplayEditable: true,//列显示是否能编辑
columnDisplayIndexEditable: true,//列顺序显示是否能编辑
columnTitleEditable: true,//列标题是否能编辑
columnResizable: true, //列宽是否能调整
columnAlignEditable: true,//列对齐是否调整
columns: [
[
{title: '名称', align: 'center', field: 'NAME', width: 100},
{title: '数量', align: 'center', field: 'SL', width: 100},
{title: '条码', align: 'center', field: 'TM', width: 100},
{title: '规格', align: 'center', field: 'GG', width: 100},
{title: '单价', align: 'center', field: 'DJ', width: 100},
{title: '金额', align: 'center', field: 'JE', width: 100},
{title: '备注', align: 'center', field: 'DETAIL', width: 100},
]
],
footerFormatter: function (options, rows, data, currentPageGridRowsData) {
if (data && data['totalCap']) {
return `<td style="padding:0 10px" colspan="100">${'应收金额大写: ' + data['totalCap']}</td>`
}
return '<td style="padding:0 10px" colspan="100">应收金额大写: </td>'
},
},
{tid: 'bProviderModule.customText', title: '文本', customText: '自定义文本', custom: true, type: 'text'},
{
tid: 'bProviderModule.longText', title: '长文本', type: 'longText', options: {
field: 'test.longText',
width: 200,
testData: '长文本分页/不分页测试'
},
}
]),
new hiprint.PrintElementTypeGroup("辅助", [
{
tid: 'bProviderModule.hline',
title: '横线',
type: 'hline'
},
{
tid: 'bProviderModule.vline',
title: '竖线',
type: 'vline'
},
{
tid: 'bProviderModule.rect',
title: '矩形',
type: 'rect'
},
{
tid: 'bProviderModule.oval',
title: '椭圆',
type: 'oval'
}
])
]
);
};
return {
addElementTypes: addElementTypes
};
};
// type: 1供货商 2经销商 // type: 1供货商 2经销商
export default [{ export default [{
name: 'A设计', name: 'A设计',
value: 'aProviderModule', value: 'aProviderModule',
type: 1, type: 1,
f: aProvider() f: aProvider()
}, {
name: 'B设计',
value: 'bProviderModule',
type: 2,
f: bProvider()
}] }]

View File

@ -166,13 +166,17 @@ export default {
input: true, input: true,
label: '参数列名', label: '参数列名',
prop: 'plcParamName', prop: 'plcParamName',
rules: [{ required: true, message: '参数列名不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '参数列名不能为空', trigger: 'blur' },
],
}, },
{ {
input: true, input: true,
label: '参数名称', label: '参数名称',
prop: 'name', prop: 'name',
rules: [{ required: true, message: '参数名称不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '参数名称不能为空', trigger: 'blur' },
],
}, },
], ],
[ [
@ -419,35 +423,35 @@ export default {
}, },
// //
async submitAttrForm() { submitAttrForm() {
this.$refs['attrForm'].validate((valid) => { this.$refs['attrForm'].validate(async (valid) => {
if (!valid) { if (!valid) {
return; return;
} }
}); const isEdit = this.attrForm.id != null;
const isEdit = this.attrForm.id != null; this.attrFormSubmitting = true;
this.attrFormSubmitting = true; const res = await this.$axios({
const res = await this.$axios({ url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate,
url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate, method: isEdit ? 'put' : 'post',
method: isEdit ? 'put' : 'post', data: {
data: { ...this.attrForm,
...this.attrForm, connectId: this.infoData.id,
connectId: this.infoData.id
},
});
if (res.code == 0) {
this.closeAttrForm();
this.$message({
message: `${isEdit ? '更新' : '创建'}成功`,
type: 'success',
duration: 1500,
onClose: () => {
this.getAttrList();
}, },
}); });
}
this.attrFormSubmitting = false; if (res.code == 0) {
this.closeAttrForm();
this.$message({
message: `${isEdit ? '更新' : '创建'}成功`,
type: 'success',
duration: 1500,
onClose: () => {
this.getAttrList();
},
});
}
this.attrFormSubmitting = false;
});
}, },
closeAttrForm() { closeAttrForm() {

View File

@ -39,6 +39,7 @@ import {
deleteMaterial deleteMaterial
} from '@/api/base/material'; } from '@/api/base/material';
import { listData } from "@/api/system/dict/data"; import { listData } from "@/api/system/dict/data";
import { publicFormatter } from '@/utils/dict';
const tableProps = [ const tableProps = [
{ {
@ -59,8 +60,9 @@ const tableProps = [
label: '英文名称' label: '英文名称'
}, },
{ {
prop: 'materialType', prop: 'type',
label: '物料类型' label: '物料类型',
filter: publicFormatter('material_type')
}, },
{ {
prop: 'supplierName', prop: 'supplierName',

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-11-22 11:09:44 * @LastEditTime: 2023-11-23 15:00:00
* @Description: * @Description:
--> -->
<template> <template>
@ -311,6 +311,9 @@ export default {
row.mUnit = u.label row.mUnit = u.label
} }
}) })
} else {
row.unit = null
row.mUnit = ''
} }
// row.materialCode = tempList[0].code // row.materialCode = tempList[0].code
// row.unit = tempList[0].unit // row.unit = tempList[0].unit

View File

@ -215,12 +215,33 @@ export default {
this.$refs.addOrUpdate.init(val.data.id); this.$refs.addOrUpdate.init(val.data.id);
}); });
} else if (val.type === "delete") { } else if (val.type === "delete") {
this.deleteHandle(val.data.id, val.data.materialName, val.data._pageIndex) this.deleteHandle(val.data.id, val.data.materialName)
} else if (val.type === "change") { } else if (val.type === "change") {
this.changeStatus(val.data.id) this.changeStatus(val.data.id)
} else { } else {
this.otherMethods(val) this.otherMethods(val)
} }
},
//
deleteHandle(id, name) {
this.$confirm(`是否确认删除物料名称为${name}的数据项?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.urlOptions.deleteURL(id).then(({ data }) => {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => { });
} }
}, },
}; };

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 14:55:51 * @Date: 2023-08-01 14:55:51
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2023-11-07 19:28:18 * @LastEditTime: 2023-11-22 14:40:59
* @Description: * @Description:
--> -->
<template> <template>
@ -77,7 +77,7 @@ const tableProps = [
{ {
prop: 'printStatus', prop: 'printStatus',
label: '打印状态', label: '打印状态',
// subcomponent: unitDict, filter: (val) => val == 1 ? '未打印' : '已打印',
}, },
{ {
prop: 'createTime', prop: 'createTime',
@ -96,7 +96,11 @@ export default {
exportURL: exportPackingExcel, exportURL: exportPackingExcel,
}, },
tableProps, tableProps,
tableBtn: [ tableBtn: [
{
type: 'print',
btnName: '打印',
},
this.$auth.hasPermi(`base:packaging-print-log:update`) this.$auth.hasPermi(`base:packaging-print-log:update`)
? { ? {
type: 'edit', type: 'edit',
@ -109,10 +113,6 @@ export default {
btnName: '删除', btnName: '删除',
} }
: undefined, : undefined,
{
type: 'print',
btnName: '打印',
},
].filter((v) => v), ].filter((v) => v),
tableData: [], tableData: [],
formConfig: [ formConfig: [

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 14:55:51 * @Date: 2023-08-01 14:55:51
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2023-11-01 10:28:29 * @LastEditTime: 2023-11-22 14:40:07
* @Description: * @Description:
--> -->
<template> <template>
@ -33,6 +33,11 @@ import {
} from '@/api/base/printModel'; } from '@/api/base/printModel';
const tableProps = [ const tableProps = [
{
prop: 'createTime',
label: '创建时间',
filter: parseTime
},
{ {
prop: 'name', prop: 'name',
label: '模板名称' label: '模板名称'
@ -64,7 +69,11 @@ export default {
}, },
tableProps, tableProps,
modelShow:false, modelShow:false,
tableBtn: [ tableBtn: [
{
type: 'print',
btnName: '查看',
},
this.$auth.hasPermi(`base:packaging-print-model:update`) this.$auth.hasPermi(`base:packaging-print-model:update`)
? { ? {
type: 'edit', type: 'edit',
@ -77,10 +86,6 @@ export default {
btnName: '删除', btnName: '删除',
} }
: undefined, : undefined,
{
type: 'print',
btnName: '查看',
},
].filter((v) => v), ].filter((v) => v),
tableData: [], tableData: [],
formConfig: [ formConfig: [

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 14:55:51 * @Date: 2023-08-01 14:55:51
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2023-10-18 16:11:22 * @LastEditTime: 2023-11-22 14:36:33
* @Description: * @Description:
--> -->
<template> <template>
@ -107,12 +107,12 @@ export default {
// valueFormat: 'yyyy-MM-dd', // valueFormat: 'yyyy-MM-dd',
// param: 'createTime', // param: 'createTime',
// }, // },
{ // {
type: 'button', // type: 'button',
btnName: '搜索', // btnName: '',
name: 'search', // name: 'search',
color: 'primary', // color: 'primary',
}, // },
// { // {
// type: 'separate', // type: 'separate',
// }, // },
@ -125,7 +125,7 @@ export default {
type: 'separate', type: 'separate',
}, },
{ {
type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '', type: this.$auth.hasPermi('base:packaging-print-type:create') ? 'button' : '',
btnName: '新增', btnName: '新增',
name: 'add', name: 'add',
color: 'success', color: 'success',

View File

@ -6,131 +6,150 @@
* @Description: * @Description:
--> -->
<template> <template>
<div> <div class="balace-chart">
<div style="margin: 20px"> <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> <el-button
</div> v-for="(item, index) in buttonList"
<div id="chart" ref="chartDiv" :class="className" :style="{height:height,width:width}" /> :key="index"
</div> :class="[item.actived ? 'activeButton' : '']"
@click="changeChart(index)">
{{ item.name }}
</el-button>
</div>
<div
id="chart"
ref="chartDiv"
:class="className"
:style="{ height: height, width: width }" />
</div>
</template> </template>
<script> <script>
import * as echarts from 'echarts' import * as echarts from 'echarts';
require('echarts/theme/macarons') // echarts theme require('echarts/theme/macarons'); // echarts theme
// import resize from './mixins/resize' // import resize from './mixins/resize'
export default { export default {
// mixins: [resize], // mixins: [resize],
props: { props: {
className: { className: {
type: String, type: String,
default: 'chart' default: 'chart',
}, },
width: { width: {
type: String, type: String,
default: '100%' default: '100%',
}, },
height: { height: {
type: String, type: String,
default: '350px' default: '350px',
}, },
// autoResize: { // autoResize: {
// type: Boolean, // type: Boolean,
// default: true // default: true
// } // }
}, },
data() { data() {
return { return {
chart: null, chart: null,
dataArray: [], dataArray: [],
xDatas: [], xDatas: [],
buttonList: [] buttonList: [],
} };
}, },
mounted() { mounted() {
// this.initChart() // this.initChart()
}, this.$nextTick(() => {
methods: { this.changeChart(0);
changeChart(index) { });
this.setOptions(this.xDatas, this.dataArray[index]) },
this.buttonList.forEach((item, s) => { methods: {
if (index === s) { changeChart(index) {
// item.actived = true this.setOptions(this.xDatas, this.dataArray[index]);
this.$nextTick(() =>{ this.buttonList.forEach((item, s) => {
// item.actived = true if (index === s) {
this.$set(item, 'actived', true) // item.actived = true
}) this.$nextTick(() => {
} else { // item.actived = true
// item.actived = false this.$set(item, 'actived', true);
this.$nextTick(() =>{ });
// item.actived = false } else {
this.$set(item, 'actived', false) // item.actived = false
}) this.$nextTick(() => {
// this.$set(item, 'actived', false) // item.actived = false
} this.$set(item, 'actived', false);
}) });
console.log('看一下数22222据', this.dataArray) // this.$set(item, 'actived', false)
}, }
initChart(xData, yData, lineName) { });
this.dataArray = yData console.log('看一下数22222据', this.dataArray);
this.buttonList = this.dataArray.map((item, index) => { },
return { initChart(xData, yData, lineName) {
'name': item.name, this.dataArray = yData;
'actived': index === 0 ? true : false this.buttonList = this.dataArray.map((item, index) => {
} return {
}) name: item.name,
console.log('看一下数据', this.dataArray) actived: index === 0 ? true : false,
this.xDatas = xData };
this.chart = echarts.init(this.$refs.chartDiv, 'macarons') });
// this.chart = echarts.init(document.getElementById('chart'), 'macarons') console.log('看一下数据', this.dataArray);
// this.setOptions(xData, yData[0], lineName) this.xDatas = xData;
}, this.chart = echarts.init(this.$refs.chartDiv, 'macarons');
setOptions(xData, dataList, lineName) { // this.chart = echarts.init(document.getElementById('chart'), 'macarons')
// let seriesData = [] // this.setOptions(xData, yData[0], lineName)
// lineName.forEach((item,index) => { },
// seriesData.push({ setOptions(xData, dataList, lineName) {
// name: item, // let seriesData = []
// data: yData[index], // lineName.forEach((item,index) => {
// type: 'line', // seriesData.push({
// }) // name: item,
// }) // data: yData[index],
this.chart.setOption({ // type: 'line',
xAxis: { // })
type: 'category', // })
data: xData this.chart.setOption({
}, xAxis: {
tooltip: { type: 'category',
trigger: 'axis' data: xData,
}, },
legend: { tooltip: {
data:lineName trigger: 'axis',
}, },
yAxis: { legend: {
type: 'value' data: lineName,
}, },
series: [ yAxis: {
{ type: 'value',
name: '设备CT', },
data: dataList.eqData, series: [
type: 'line', {
}, name: '设备CT',
{ data: dataList.eqData,
name: '产线CT', type: 'line',
data: dataList.plData, },
type: 'line', {
} name: '产线CT',
] data: dataList.plData,
}) type: 'line',
} },
} ],
} });
},
},
};
</script> </script>
<style scoped> <style scoped>
.activeButton { .balace-chart >>> .el-button {
background-color: rgb(93,159,255); background: #e3e3e3;
} color: #333;
.normalButton { transition: all 0.3s;
background-color: none; border: none;
&.activeButton,
&:hover {
background: #0b58ff;
color: #fff;
}
} }
</style> </style>

View File

@ -1,7 +1,7 @@
<template> <template>
<el-form ref="addOrUpdate" :rules="rules" label-width="130px" :model="form"> <el-form ref="addOrUpdate" :rules="rules" label-width="130px" :model="form" label-position='top'>
<el-row> <el-row :gutter="20">
<el-col :span='12'> <el-col :span='6'>
<el-form-item label="订单名" prop="orderId"> <el-form-item label="订单名" prop="orderId">
<el-select v-model="form.orderId" placeholder="请选择" style="width: 100%;"> <el-select v-model="form.orderId" placeholder="请选择" style="width: 100%;">
<el-option <el-option
@ -13,14 +13,12 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='12'> <el-col :span='6'>
<el-form-item label="发货单名称" prop="name"> <el-form-item label="发货单名称" prop="name">
<el-input v-model="form.name"></el-input> <el-input v-model="form.name"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span='6'>
<el-row>
<el-col :span='12'>
<el-form-item label="发货时间" prop="deliveryTime"> <el-form-item label="发货时间" prop="deliveryTime">
<el-date-picker <el-date-picker
v-model="form.deliveryTime" v-model="form.deliveryTime"
@ -32,14 +30,14 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='12'> <el-col :span='6'>
<el-form-item label="发货单号" prop="code"> <el-form-item label="发货单号" prop="code">
<el-input v-model="form.code"></el-input> <el-input v-model="form.code"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row :gutter="20">
<el-col :span='12'> <el-col :span='6'>
<el-form-item label="发货负责人" prop="deliveryPersonId"> <el-form-item label="发货负责人" prop="deliveryPersonId">
<el-select v-model="form.deliveryPersonId" placeholder="请选择" style="width: 100%;"> <el-select v-model="form.deliveryPersonId" placeholder="请选择" style="width: 100%;">
<el-option <el-option
@ -51,21 +49,19 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='12'> <el-col :span='6'>
<el-form-item label="运输负责人" prop="principal"> <el-form-item label="运输负责人" prop="principal">
<el-input v-model="form.principal"></el-input> <el-input v-model="form.principal"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span='6'>
<el-row>
<el-col :span='12'>
<el-form-item label="运输联系方式" prop="principalCall"> <el-form-item label="运输联系方式" prop="principalCall">
<el-input v-model="form.principalCall"></el-input> <el-input v-model="form.principalCall"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='12'> <el-col :span='6'>
<el-form-item label="运输费用" prop="principalCost"> <el-form-item label="运输费用" prop="principalCost">
<el-input-number v-model="form.principalCost" :min="0" :max='9999999999' :precision='2'></el-input-number> <el-input-number v-model="form.principalCost" :min="0" :max='9999999999' :precision='2' style='width: 100%;'></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>

View File

@ -2,10 +2,11 @@
<div> <div>
<el-drawer <el-drawer
title="发货清单详情" title="发货清单详情"
size="60%" size="65%"
:append-to-body="true" :append-to-body="true"
:visible.sync="centervisible" :visible.sync="centervisible"
@close='close'> @close='close'
:show-close='false'>
<div class="box1"> <div class="box1">
<el-row> <el-row>
<el-col :span='12'> <el-col :span='12'>
@ -69,7 +70,7 @@ const tableProps = [
prop: 'createTime', prop: 'createTime',
label: '添加时间', label: '添加时间',
filter: parseTime, filter: parseTime,
minWidth: 150 minWidth: 160
}, },
{ {
prop: 'deliveryCarCode', prop: 'deliveryCarCode',
@ -81,7 +82,7 @@ const tableProps = [
prop: 'loadTime', prop: 'loadTime',
label: '装车时间', label: '装车时间',
filter: parseTime, filter: parseTime,
minWidth: 150 minWidth: 160
}, },
{ {
prop: 'productName', prop: 'productName',
@ -90,7 +91,7 @@ const tableProps = [
{ {
prop: 'packagingSize', prop: 'packagingSize',
label: '装箱规格(片/箱)', label: '装箱规格(片/箱)',
width: 120 width: 150
}, },
{ {
prop: 'packagingNum', prop: 'packagingNum',

View File

@ -1,19 +1,17 @@
<template> <template>
<el-form ref="addOrUpdate" :rules="rules" label-width="130px" :model="form"> <el-form ref="addOrUpdate" :rules="rules" label-width="130px" :model="form" label-position='top'>
<el-row> <el-row :gutter="20">
<el-col :span='12'> <el-col :span='6'>
<el-form-item label="发货单号"> <el-form-item label="发货单号">
<el-input v-model="code" disabled></el-input> <el-input v-model="code" disabled></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='12'> <el-col :span='6'>
<el-form-item label="装车单号" prop="deliveryCarCode"> <el-form-item label="装车单号" prop="deliveryCarCode">
<el-input v-model="form.deliveryCarCode"></el-input> <el-input v-model="form.deliveryCarCode"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span='6'>
<el-row>
<el-col :span='12'>
<el-form-item label="装车时间" prop="loadTime"> <el-form-item label="装车时间" prop="loadTime">
<el-date-picker <el-date-picker
v-model="form.loadTime" v-model="form.loadTime"
@ -25,19 +23,19 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='12'> <el-col :span='6'>
<el-form-item label="车辆联系人" prop="contactPerson"> <el-form-item label="车辆联系人" prop="contactPerson">
<el-input v-model="form.contactPerson"></el-input> <el-input v-model="form.contactPerson"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row :gutter="20">
<el-col :span='12'> <el-col :span='6'>
<el-form-item label="联系方式" prop="contactPersonCall"> <el-form-item label="联系方式" prop="contactPersonCall">
<el-input v-model="form.contactPersonCall"></el-input> <el-input v-model="form.contactPersonCall"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='12'> <el-col :span='6'>
<el-form-item label="装车产品" prop="productId"> <el-form-item label="装车产品" prop="productId">
<el-select v-model="form.productId" disabled placeholder="请选择" style="width: 100%;"> <el-select v-model="form.productId" disabled placeholder="请选择" style="width: 100%;">
<el-option <el-option
@ -49,26 +47,24 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span='6'>
<el-row>
<el-col :span='12'>
<el-form-item label="装箱规格(片/箱)" prop="packagingSize"> <el-form-item label="装箱规格(片/箱)" prop="packagingSize">
<el-input-number v-model="form.packagingSize" :min="0" :max='9999999999' style="width:100%"></el-input-number> <el-input-number v-model="form.packagingSize" :min="0" :max='9999999999' style="width:100%"></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='12'> <el-col :span='6'>
<el-form-item label="产品批次" prop="productDate"> <el-form-item label="产品批次" prop="productDate">
<el-input v-model="form.productDate" placeholder="多个批次用','隔开"></el-input> <el-input v-model="form.productDate" placeholder="多个批次用','隔开"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row :gutter="20">
<el-col :span='12'> <el-col :span='6'>
<el-form-item label="箱/托数" prop="packagingNum"> <el-form-item label="箱/托数" prop="packagingNum">
<el-input-number v-model="form.packagingNum" :min="0" :max='9999999999' style="width:100%"></el-input-number> <el-input-number v-model="form.packagingNum" :min="0" :max='9999999999' style="width:100%"></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='12'> <el-col :span='6'>
<el-form-item label="装车总量" prop="quantity"> <el-form-item label="装车总量" prop="quantity">
<el-input-number v-model="form.quantity" :min="0" :max='9999999999' style="width:100%"></el-input-number> <el-input-number v-model="form.quantity" :min="0" :max='9999999999' style="width:100%"></el-input-number>
</el-form-item> </el-form-item>

View File

@ -78,7 +78,7 @@ const tableProps = [
prop: 'deliveryTime', prop: 'deliveryTime',
label: '发货时间', label: '发货时间',
filter: parseTime, filter: parseTime,
minWidth: 150 minWidth: 160
}, },
{ {
prop: 'code', prop: 'code',
@ -103,7 +103,8 @@ const tableProps = [
}, },
{ {
prop: 'principalCost', prop: 'principalCost',
label: '运输费用' label: '运输费用',
align: 'right'
}, },
{ {
prop: 'remark', prop: 'remark',
@ -225,7 +226,11 @@ export default {
}, },
getList() { getList() {
deliveryLogPage({...this.queryParams}).then(res => { deliveryLogPage({...this.queryParams}).then(res => {
this.list = res.data.list || [] let arr = res.data.list || []
arr && arr.map(item => {
item.principalCost = item.principalCost.toFixed(2)
})
this.list = arr
this.total = res.data.total || 0 this.total = res.data.total || 0
}) })
}, },

View File

@ -2,9 +2,10 @@
<el-drawer <el-drawer
title="发货进度" title="发货进度"
:visible.sync="centervisible" :visible.sync="centervisible"
size="80%" size="50%"
class="deliveryLogDetail" class="deliveryLogDetail"
@close='closeA'> @close='closeA'
:show-close='false'>
<div class="box1"> <div class="box1">
<div class="box_col"> <div class="box_col">
<div class="blodTip">订单名</div> <div class="blodTip">订单名</div>
@ -46,7 +47,7 @@
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
:width="150" :width="80"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="viewDetDetail" @clickBtn="viewDetDetail"
@ -64,7 +65,7 @@
<div v-if="activeName === 'barChart'"> <div v-if="activeName === 'barChart'">
<div <div
id="logDetPieBar" id="logDetPieBar"
style="width: 100%" style="width: 60%"
:style="{ height: chartHeight + 'px' }" :style="{ height: chartHeight + 'px' }"
></div> ></div>
</div> </div>
@ -74,10 +75,11 @@
<!-- 详情抽屉 --> <!-- 详情抽屉 -->
<el-drawer <el-drawer
title="发货详情" title="发货详情"
size="60%" size="50%"
:append-to-body="true" :append-to-body="true"
:visible.sync="innerDrawer" :visible.sync="innerDrawer"
@close='closeB'> @close='closeB'
:show-close='false'>
<div class="box3"> <div class="box3">
<el-row> <el-row>
<el-col :span='12'> <el-col :span='12'>
@ -122,7 +124,7 @@ const tableProps = [
prop: 'deliveryTime', prop: 'deliveryTime',
label: '发货时间', label: '发货时间',
filter: parseTime, filter: parseTime,
minWidth: 150 minWidth: 160
}, },
{ {
prop: 'code', prop: 'code',
@ -139,7 +141,8 @@ const tableProps = [
}, },
{ {
prop: 'rate', prop: 'rate',
label: '发货比列(%)' label: '发货比列(%)',
width: 110
}, },
{ {
prop: 'principalCost', prop: 'principalCost',
@ -151,7 +154,7 @@ const tableProps2 = [
prop: 'createTime', prop: 'createTime',
label: '添加时间', label: '添加时间',
filter: parseTime, filter: parseTime,
minWidth: 150 minWidth: 160
}, },
{ {
prop: 'deliveryCarCode', prop: 'deliveryCarCode',
@ -162,7 +165,7 @@ const tableProps2 = [
prop: 'loadTime', prop: 'loadTime',
label: '装车时间', label: '装车时间',
filter: parseTime, filter: parseTime,
minWidth: 150 minWidth: 160
}, },
{ {
prop: 'productName', prop: 'productName',
@ -171,7 +174,8 @@ const tableProps2 = [
}, },
{ {
prop: 'packagingSize', prop: 'packagingSize',
label: '装箱规格(片/箱)' label: '装箱规格(片/箱)',
minWidth: 140
}, },
{ {
prop: 'packagingNum', prop: 'packagingNum',
@ -208,8 +212,8 @@ export default {
tableBtn: [ tableBtn: [
this.$auth.hasPermi('base:group-team:update') this.$auth.hasPermi('base:group-team:update')
? { ? {
type: 'detDetail', type: 'detail',
btnName: '查看发货详情' btnName: '详情'
} }
: undefined : undefined
].filter((v) => v), ].filter((v) => v),
@ -228,7 +232,7 @@ export default {
// //
chartDom: '', chartDom: '',
chart: '', chart: '',
chartHeight: this.tableHeight(300) chartHeight: this.tableHeight(300)*0.6
} }
}, },
// watch: { // watch: {
@ -268,6 +272,8 @@ export default {
} }
}, },
getBar() { getBar() {
let color = ['#7164FF','#288AFF','#63BDFF','#8EF0AB','#FFCE6A']
let colorList = []
if ( if (
this.chart !== null && this.chart !== null &&
this.chart !== '' && this.chart !== '' &&
@ -278,64 +284,90 @@ export default {
this.chartDom = document.getElementById('logDetPieBar') this.chartDom = document.getElementById('logDetPieBar')
this.chart = echarts.init(this.chartDom) this.chart = echarts.init(this.chartDom)
let seriesData = [] let seriesData = []
let sumData = 0 if (this.tableData.length > 0) {
this.tableData && this.tableData.map(item =>{ for (let i = 0; i < this.tableData.length; i++) {
let obj = {}
obj.value = this.tableData[i].num
obj.name = this.tableData[i].name
seriesData.push(obj)
if (i < 5) {
colorList.push(color[i])
} else {
colorList.push(color[i%5])
}
}
}
if (this.orderMsg.num < this.orderMsg.orderNum) {
let obj = {} let obj = {}
obj.value = item.rate obj.value = this.orderMsg.orderNum - this.orderMsg.num
obj.name = item.name
seriesData.push(obj)
sumData+=item.rate
})
if (sumData < 100) {
let obj = {}
obj.value = 100 - sumData
obj.name = "未发货" obj.name = "未发货"
seriesData.push(obj) seriesData.push(obj)
colorList.push('#F5F5F5')
}else {
let obj = {}
obj.value = 0
obj.name = "未发货"
seriesData.push(obj)
colorList.push('#F5F5F5')
} }
var option = { var option = {
color: ['#B0EB42', '#FF9747', '#FF6860', '#7164FF', '#288AFF', '#63BDFF', '#73DE93', '#FFCE6A'], color: colorList,
tooltip: {
trigger: 'item',
formatter: function(params) {
let str = `<span style="display:inline-block;width:8px;height:8px;margin: 0 8px 0 -3px;border-radius:2px;background-color:${params.color};"></span>`
return `<span>
<span style="color:rgba(0,0,0,0.85);">${str}${params.name}</span>
<span style="display:inline-block;margin-left:10px;color:rgba(0,0,0,0.45);">${params.percent}</span>
</span>`
}
},
legend: { legend: {
type: 'scroll', bottom: '5%',
orient: 'vertical', left: 'center',
right: '10%', itemWidth: 8,
top: 20, itemHeight: 8
bottom: 20,
icon: 'rect',
itemHeight: 8,
itemWidth: 8
}, },
series: [ series: [
{ {
type: 'pie', type: 'pie',
radius: ['60%', '80%'], radius: ['40%', '55%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
emphasis: { emphasis: {
label: { scale: false
show: true,
fontSize: 40,
fontWeight: 'bold'
},
scale: true ,
scaleSize: 20 ,
}, },
labelLine: { label: {
show: false alignTo: 'edge',
formatter: '{name|{b}}\n{value|{c}}',
minMargin: 5,
edgeDistance: 10,
lineHeight: 15,
rich: {
name: {
fontSize: 14,
color: 'rgba(0,0,0,0.65)'
},
value: {
fontSize: 14,
color: 'rgba(0,0,0,0.65)'
}
}
}, },
data: seriesData data: seriesData
},
{
type: 'pie',
radius: ['40%', '40%'],
label: {
show: true,
position: 'center',
color: '#000',
formatter: [
'{a|'+this.orderMsg.orderNum+'}',
'{b|总数}'
].join('\n\n'),
rich: {
a: {
fontSize: 26 +'px'
},
b: {
fontSize: 16 +'px'
}
}
},
emphasis: {
scale: false
},
data: [100]
} }
] ]
}; };
@ -375,11 +407,13 @@ export default {
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
.box1 { .box1 {
height: 56px; height: 76px;
border-bottom: 1px solid #E9E9E9;
margin: 0px 8px 20px 30px;
.box_col { .box_col {
display: inline-block; display: inline-block;
width: 20%; width: 20%;
padding: 8px 8px 8px 40px; padding: 8px 8px 8px 8px;
.blodTip { .blodTip {
height: 16px; height: 16px;
font-size: 14px; font-size: 14px;
@ -396,7 +430,7 @@ export default {
} }
} }
.box2 { .box2 {
padding:32px 32px 30px 30px; padding:0px 32px 30px 30px;
height: calc(100vh - 150px); height: calc(100vh - 150px);
} }
.boxTitle { .boxTitle {

View File

@ -2,7 +2,7 @@
<div class="searchBarBox divHeight" ref="searchBarRef" :style="{ paddingRight: isFold ? '55px' : '0px' }"> <div class="searchBarBox divHeight" ref="searchBarRef" :style="{ paddingRight: isFold ? '55px' : '0px' }">
<el-form :inline="true" class="demo-form-inline"> <el-form :inline="true" class="demo-form-inline">
<span class="blue-block"></span> <span class="blue-block"></span>
<el-form-item label="能源类型"> <el-form-item label="能源类型" required>
<el-select v-model="queryParams.energyTypeId" placeholder="请选择" style="width: 100px;" size="small"> <el-select v-model="queryParams.energyTypeId" placeholder="请选择" style="width: 100px;" size="small">
<el-option <el-option
v-for="item in energyTypeList" v-for="item in energyTypeList"
@ -12,7 +12,7 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="时间维度"> <el-form-item label="时间维度" required>
<el-select v-model="queryParams.timeDim" placeholder="请选择" style="width: 80px;" size="small"> <el-select v-model="queryParams.timeDim" placeholder="请选择" style="width: 80px;" size="small">
<el-option <el-option
v-for="item in getDictDatas(this.DICT_TYPE.TIME_DIM)" v-for="item in getDictDatas(this.DICT_TYPE.TIME_DIM)"
@ -22,7 +22,7 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="时间范围"> <el-form-item label="时间范围" required>
<div v-show="queryParams.timeDim === '1'"> <div v-show="queryParams.timeDim === '1'">
<el-date-picker <el-date-picker
v-model="timeValue" v-model="timeValue"
@ -124,7 +124,7 @@
</el-date-picker> </el-date-picker>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="对象维度"> <el-form-item label="对象维度" required>
<el-select v-model="queryParams.objType" placeholder="请选择" style="width: 80px;" @change="selectObjs" size="small"> <el-select v-model="queryParams.objType" placeholder="请选择" style="width: 80px;" @change="selectObjs" size="small">
<el-option <el-option
v-for="item in getDictDatas(this.DICT_TYPE.OBJECT_TYPE)" v-for="item in getDictDatas(this.DICT_TYPE.OBJECT_TYPE)"
@ -134,7 +134,7 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="对象选择"> <el-form-item label="对象选择" required>
<el-select v-model="queryParams.objIds" placeholder="请选择" multiple :multiple-limit='5' collapse-tags style="width: 200px;" size="small"> <el-select v-model="queryParams.objIds" placeholder="请选择" multiple :multiple-limit='5' collapse-tags style="width: 200px;" size="small">
<el-option <el-option
v-for="item in objectList" v-for="item in objectList"
@ -148,6 +148,8 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<span class="separateStyle"></span>
<el-button size="small" @click="resetBtn">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span v-if="isFold" class="foldClass" @click='switchMode'> <span v-if="isFold" class="foldClass" @click='switchMode'>
@ -400,6 +402,19 @@ export default {
console.log(this.queryParams) console.log(this.queryParams)
this.$emit('submit', this.queryParams) this.$emit('submit', this.queryParams)
}, },
resetBtn() {
this.queryParams.energyTypeId = null
this.queryParams.timeDim = this.getDictDatas(this.DICT_TYPE.TIME_DIM)[0].value //
this.queryParams.objIds = []
this.queryParams.objType = ''
this.timeValue = []
this.dateValue = []
this.weekValue1 = null
this.weekValue2 = null
this.monthValue = []
this.yearValue1 = null
this.yearValue2 = null
},
transformTime(timeStamp) {// transformTime(timeStamp) {//
let year = moment(timeStamp).format('YYYY') let year = moment(timeStamp).format('YYYY')
let month = moment(timeStamp).format('MM') let month = moment(timeStamp).format('MM')
@ -471,4 +486,12 @@ export default {
height: 45px; height: 45px;
overflow: hidden; overflow: hidden;
} }
.separateStyle {
display: inline-block;
width: 1px;
height: 24px;
background: #E8E8E8;
vertical-align: middle;
margin: 0 10px;
}
</style> </style>

View File

@ -34,10 +34,10 @@ export default {
mounted() { mounted() {
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260) this.tableH = this.tableHeight(260)
this.isFold = this.searchBarWidth('contrastAnalysisBox', 1310) this.isFold = this.searchBarWidth('contrastAnalysisBox', 1437)
// console.log(document.getElementById("contrastAnalysisBox").offsetWidth) // console.log(document.getElementById("contrastAnalysisBox").offsetWidth)
}) })
this.isFold = this.searchBarWidth('contrastAnalysisBox', 1310) this.isFold = this.searchBarWidth('contrastAnalysisBox', 1437)
}, },
methods: { methods: {
getList(params) { getList(params) {

View File

@ -1,7 +1,7 @@
<template> <template>
<el-form :inline="true" class="demo-form-inline"> <el-form :inline="true" class="demo-form-inline">
<span class="blue-block"></span> <span class="blue-block"></span>
<el-form-item label="对象选择"> <el-form-item label="对象选择" required>
<el-cascader <el-cascader
v-model="objArr" v-model="objArr"
:options="objList" :options="objList"
@ -11,7 +11,7 @@
style="width: 250px;" style="width: 250px;"
clearable></el-cascader> clearable></el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="时间维度"> <el-form-item label="时间维度" required>
<el-select v-model="queryParams.type" placeholder="请选择" style="width: 80px;" size="small"> <el-select v-model="queryParams.type" placeholder="请选择" style="width: 80px;" size="small">
<el-option <el-option
v-for="item in timeType" v-for="item in timeType"
@ -22,7 +22,7 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="时间"> <el-form-item label="时间" required>
<div v-show="queryParams.type === 1"> <div v-show="queryParams.type === 1">
<el-date-picker <el-date-picker
v-model="monthValue" v-model="monthValue"
@ -129,7 +129,7 @@ export default {
}, },
// //
search() { search() {
if (!this.objArr.length === 0) { if (this.objArr.length === 0) {
this.$modal.msgError('请选择对象') this.$modal.msgError('请选择对象')
return false return false
} else { } else {

View File

@ -2,7 +2,7 @@
<div class="searchBarBox divHeight" ref="searchBarRef" :style="{ paddingRight: isFold ? '55px' : '0px' }"> <div class="searchBarBox divHeight" ref="searchBarRef" :style="{ paddingRight: isFold ? '55px' : '0px' }">
<el-form :inline="true" class="demo-form-inline"> <el-form :inline="true" class="demo-form-inline">
<span class="blue-block"></span> <span class="blue-block"></span>
<el-form-item label="能源类型"> <el-form-item label="能源类型" required>
<el-select v-model="queryParams.energyTypeId" placeholder="请选择" style="width: 100px;" size="small"> <el-select v-model="queryParams.energyTypeId" placeholder="请选择" style="width: 100px;" size="small">
<el-option <el-option
v-for="item in energyTypeList" v-for="item in energyTypeList"
@ -12,7 +12,7 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="对象选择"> <el-form-item label="对象选择" required>
<el-cascader <el-cascader
v-model="objArr" v-model="objArr"
:options="objList" :options="objList"
@ -21,7 +21,7 @@
size="small" size="small"
clearable></el-cascader> clearable></el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="时间维度"> <el-form-item label="时间维度" required>
<el-select v-model="queryParams.timeDim" placeholder="请选择" style="width: 80px;" size="small"> <el-select v-model="queryParams.timeDim" placeholder="请选择" style="width: 80px;" size="small">
<el-option <el-option
v-for="item in getDictDatas(this.DICT_TYPE.TIME_DIM)" v-for="item in getDictDatas(this.DICT_TYPE.TIME_DIM)"
@ -32,7 +32,7 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="时间范围"> <el-form-item label="时间范围" required>
<div v-show="queryParams.timeDim === '1'"> <div v-show="queryParams.timeDim === '1'">
<el-date-picker <el-date-picker
v-model="timeValue" v-model="timeValue"
@ -129,6 +129,8 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<span class="separateStyle"></span>
<el-button size="small" @click="resetBtn">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span v-if="isFold" class="foldClass" @click='switchMode'> <span v-if="isFold" class="foldClass" @click='switchMode'>
@ -360,6 +362,14 @@ export default {
this.queryParams.endTime = this.queryParams.endTime + '' this.queryParams.endTime = this.queryParams.endTime + ''
this.$emit('submit', this.queryParams) this.$emit('submit', this.queryParams)
}, },
//
resetBtn() {
this.queryParams.energyTypeId = null
this.queryParams.objId = null
this.objArr = []
this.queryParams.timeDim = this.getDictDatas(this.DICT_TYPE.TIME_DIM)[0].value //
this.timeValue = [moment().startOf('day'), moment().endOf('day')-59*61*1000]
},
transformTime(timeStamp) {// transformTime(timeStamp) {//
let year = moment(timeStamp).format('YYYY') let year = moment(timeStamp).format('YYYY')
let month = moment(timeStamp).format('MM') let month = moment(timeStamp).format('MM')
@ -435,4 +445,12 @@ export default {
height: 45px; height: 45px;
overflow: hidden; overflow: hidden;
} }
.separateStyle {
display: inline-block;
width: 1px;
height: 24px;
background: #E8E8E8;
vertical-align: middle;
margin: 0 10px;
}
</style> </style>

View File

@ -34,9 +34,9 @@ export default {
mounted() { mounted() {
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260) this.tableH = this.tableHeight(260)
this.isFold = this.searchBarWidth('trendAnalysisBox', 1146) this.isFold = this.searchBarWidth('trendAnalysisBox', 1263)
}) })
this.isFold = this.searchBarWidth('trendAnalysisBox', 1146) this.isFold = this.searchBarWidth('trendAnalysisBox', 1263)
}, },
methods: { methods: {
getList(params) { getList(params) {

View File

@ -1,7 +1,7 @@
<template> <template>
<el-form :inline="true" class="demo-form-inline"> <el-form :inline="true" class="demo-form-inline">
<span class="blue-block"></span> <span class="blue-block"></span>
<el-form-item label="对象选择"> <el-form-item label="对象选择" required>
<el-cascader <el-cascader
v-model="objArr" v-model="objArr"
:options="objList" :options="objList"
@ -10,7 +10,7 @@
size="small" size="small"
clearable></el-cascader> clearable></el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="时间维度"> <el-form-item label="时间维度" required>
<el-select v-model="queryParams.type" placeholder="请选择" style="width: 80px;" size="small"> <el-select v-model="queryParams.type" placeholder="请选择" style="width: 80px;" size="small">
<el-option <el-option
v-for="item in timeType" v-for="item in timeType"
@ -21,7 +21,7 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="时间"> <el-form-item label="时间" required>
<div v-show="queryParams.type === 1 || queryParams.type === 2"> <div v-show="queryParams.type === 1 || queryParams.type === 2">
<el-date-picker <el-date-picker
v-model="yearValue" v-model="yearValue"
@ -103,7 +103,7 @@ export default {
}, },
// //
search() { search() {
if (!this.objArr.length === 0) { if (this.objArr.length === 0) {
this.$modal.msgError('请选择对象') this.$modal.msgError('请选择对象')
return false return false
} else { } else {

View File

@ -25,18 +25,16 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="12">
<el-form-item label="描述" prop="description">
<el-input v-model="form.description"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="是否采集" prop="collection"> <el-form-item label="是否采集" prop="collection">
<el-switch v-model="form.collection"></el-switch> <el-switch v-model="form.collection"></el-switch>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="描述" prop="description">
<el-input v-model="form.description"></el-input>
</el-form-item>
</el-col>
</el-row> </el-row>
</el-form> </el-form>
</template> </template>

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<el-drawer :title="drawerTitle" :visible.sync="visible" size="70%" @close='closeD'> <el-drawer :title="drawerTitle" :visible.sync="visible" size="70%" @close='closeD' :show-close='false'>
<div class="box"> <div class="box">
<el-form :inline="true"> <el-form :inline="true">
<el-form-item label="关联表名"> <el-form-item label="关联表名">

View File

@ -39,14 +39,12 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="12">
<el-form-item label="是否采集" prop="collection"> <el-form-item label="是否采集" prop="collection">
<el-switch v-model="form.collection"></el-switch> <el-switch v-model="form.collection"></el-switch>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span="12">
<el-row>
<el-col :span="24">
<el-form-item label="描述" prop="description"> <el-form-item label="描述" prop="description">
<el-input v-model="form.description"></el-input> <el-input v-model="form.description"></el-input>
</el-form-item> </el-form-item>

View File

@ -37,6 +37,7 @@
@cancel="handleCancel" @cancel="handleCancel"
@confirm="handleConfirm" @confirm="handleConfirm"
:before-close="handleCancel" :before-close="handleCancel"
width='30%'
> >
<energy-plc-connect-add ref="energyPlcConnect" :objList="objList" @successSubmit="successSubmit" /> <energy-plc-connect-add ref="energyPlcConnect" :objList="objList" @successSubmit="successSubmit" />
</base-dialog> </base-dialog>

View File

@ -27,7 +27,7 @@
</template> </template>
<script> <script>
import { getEnergyQuantityRealtimePage, exportEnergyQuantityRealtimeExcel } from "@/api/base/energyQuantityRealtime" import { getEnergyQuantityRealtimePage } from "@/api/base/energyQuantityRealtime"
import { getEnergyTypeListAll } from "@/api/base/energyType" import { getEnergyTypeListAll } from "@/api/base/energyType"
// import { publicFormatter } from '@/utils/dict' // import { publicFormatter } from '@/utils/dict'
import FileSaver from "file-saver" import FileSaver from "file-saver"
@ -140,18 +140,16 @@ export default {
break break
default: default:
this.exportTable() this.exportTable()
// this.$modal.confirm('').then(() => {
// return exportEnergyQuantityRealtimeExcel({...this.queryParams});
// }).then(response => {
// console.log(response)
// this.$download.excel(response, '.xls');
// }).catch(() => {})
} }
}, },
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
getEnergyQuantityRealtimePage(this.queryParams).then(response => { getEnergyQuantityRealtimePage(this.queryParams).then(response => {
this.list = response.data.list || [] let arr = response.data.list || []
arr && arr.map(item => {
item.amount = item.amount ? (!isNaN(parseFloat(item.amount)) && isFinite(item.amount) ? item.amount.toFixed(2) : '') : ''
})
this.list = arr
this.total = response.data.total; this.total = response.data.total;
this.exportList = [] this.exportList = []
}); });

View File

@ -6,10 +6,11 @@
:key="item.prop" :key="item.prop"
:prop="item.prop" :prop="item.prop"
:label="item.label" :label="item.label"
:align="item.align ? item.align : 'left'"
width="120"> width="120">
</el-table-column> </el-table-column>
</el-table> </el-table>
<span v-if='singlePrice'><span class='priceTitle'>单价(): </span>{{ singlePrice }}</span> <span v-if='singlePrice'><span class='priceTitle'>单价(): </span>{{ singlePrice.toFixed(2) }}</span>
<el-button <el-button
slot="reference" slot="reference"
type="text" type="text"
@ -32,7 +33,8 @@ const temp1 = [
}, },
{ {
prop: 'price', prop: 'price',
label: '单价(元)' label: '单价(元)',
align: 'right'
} }
] ]
const temp2 = [ const temp2 = [
@ -46,7 +48,8 @@ const temp2 = [
}, },
{ {
prop: 'price', prop: 'price',
label: '单价(元)' label: '单价(元)',
align: 'right'
} }
] ]
export default { export default {
@ -78,12 +81,20 @@ export default {
console.log(res) console.log(res)
if (res.data.pricingMethod === 0) { if (res.data.pricingMethod === 0) {
this.tableProps = this.temp1 this.tableProps = this.temp1
this.tableData = res.data.segPriceList
this.singlePrice = '' this.singlePrice = ''
let arr1 = res.data.segPriceList
for (let item of arr1) {
item.price = item.price.toFixed(2)
}
this.tableData = arr1
} else if (res.data.pricingMethod === 1) { } else if (res.data.pricingMethod === 1) {
this.tableProps = this.temp2 this.tableProps = this.temp2
this.tableData = res.data.usedPriceList
this.singlePrice = '' this.singlePrice = ''
let arr2 = res.data.usedPriceList
for (let item of arr2) {
item.price = item.price.toFixed(2)
}
this.tableData = arr2
} else { } else {
this.tableProps = [] this.tableProps = []
this.tableData = [] this.tableData = []

View File

@ -1,5 +1,5 @@
<template> <template>
<el-form ref="form" :rules="rules" label-width="80px" :model="form"> <el-form ref="form" :rules="rules" label-width="100px" :model="form">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="能源类型" prop="name"> <el-form-item label="能源类型" prop="name">

View File

@ -26,28 +26,6 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :span="12">
<el-form-item label="监控模式" prop="type">
<el-select v-model="form.type" placeholder="请选择" style="width: 100%;" @change="typeChange">
<el-option label="合并" :value= "1" ></el-option>
<el-option label="详细" :value= "2" ></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="监控详细参数" prop="type" v-if="form.type === 2">
<el-select v-model="form.plcParamId" placeholder="请选择" style="width: 100%;" @change="selectDetail">
<el-option
v-for="item in detailList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="指标类型" prop="limitType"> <el-form-item label="指标类型" prop="limitType">
@ -61,10 +39,32 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="监控模式" prop="type">
<el-select v-model="form.type" placeholder="请选择" style="width: 100%;" @change="typeChange">
<el-option label="合并" :value= "1" ></el-option>
<el-option label="详细" :value= "2" ></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="消耗量阈值"> <el-form-item label="消耗量阈值">
<el-input-number v-model="form.minValue" placeholder="最小值" :max="10000000000000000" style="width: 50%;"></el-input-number> <el-input-number v-model="form.minValue" placeholder="最小值" :max="9999999" style="width: 50%;"></el-input-number>
<el-input-number v-model="form.maxValue" placeholder="最大值" :max="10000000000000000" style="width: 50%;"></el-input-number> <el-input-number v-model="form.maxValue" placeholder="最大值" :max="9999999" style="width: 50%;"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="监控详细参数" prop="type" v-if="form.type === 2">
<el-select v-model="form.plcParamId" placeholder="请选择" style="width: 100%;" @change="selectDetail">
<el-option
v-for="item in detailList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>

View File

@ -37,7 +37,7 @@
@cancel="handleCancel" @cancel="handleCancel"
@confirm="handleConfirm" @confirm="handleConfirm"
:before-close="handleCancel" :before-close="handleCancel"
width='60%' width='50%'
> >
<energy-limit-add ref="energyLimit" @successSubmit="successSubmit" :energyTypeList="energyTypeList" :objList="objList"/> <energy-limit-add ref="energyLimit" @successSubmit="successSubmit" :energyTypeList="energyTypeList" :objList="objList"/>
</base-dialog> </base-dialog>

View File

@ -40,13 +40,13 @@ const tableProps = [
prop: 'startTime', prop: 'startTime',
label: '开始时间', label: '开始时间',
filter: parseTime, filter: parseTime,
minWidth: 150 minWidth: 160
}, },
{ {
prop: 'endTime', prop: 'endTime',
label: '结束时间', label: '结束时间',
filter: parseTime, filter: parseTime,
minWidth: 150 minWidth: 160
}, },
{ {
prop: 'statisticName', prop: 'statisticName',

View File

@ -70,7 +70,7 @@ export default {
}, },
{ {
type: 'datePicker', type: 'datePicker',
label: '时间(必填)', label: '时间',
dateType: 'datetimerange', dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss', format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: "timestamp", valueFormat: "timestamp",
@ -80,7 +80,8 @@ export default {
param: 'timeVal', param: 'timeVal',
defaultSelect: [], defaultSelect: [],
width: 350, width: 350,
clearable: false clearable: false,
required:true
}, },
{ {
type: 'button', type: 'button',

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<el-drawer :title="drawerTitle" :visible.sync="visible" size="70%" @close='closeD'> <el-drawer :title="drawerTitle" :visible.sync="visible" size="70%" @close='closeD' :show-close='false'>
<div class="box"> <div class="box">
<el-form :inline="true"> <el-form :inline="true">
<el-form-item label="方案名称"> <el-form-item label="方案名称">

View File

@ -3,7 +3,8 @@
title="新增" title="新增"
:visible.sync="centervisible" :visible.sync="centervisible"
size="60%" size="60%"
@close='closeA'> @close='closeA'
:show-close='false'>
<div class="box"> <div class="box">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar

View File

@ -172,11 +172,11 @@ export default {
this.$modal.msgWarning('工单不能为空') this.$modal.msgWarning('工单不能为空')
return false return false
} }
if (!val.objType) { if (!val.energyTypeId) {
this.$modal.msgWarning('能源类型不能为空') this.$modal.msgWarning('能源类型不能为空')
return false return false
} }
if (!val.energyTypeId) { if (!val.objType) {
this.$modal.msgWarning('对象维度不能为空') this.$modal.msgWarning('对象维度不能为空')
return false return false
} }

View File

@ -28,59 +28,96 @@
<script> <script>
import basicPage from '../../../core/mixins/basic-page'; import basicPage from '../../../core/mixins/basic-page';
import { parseTime } from '../../../core/mixins/code-filter'; import moment from 'moment';
import { import {
getEqAnalysis, getEqAnalysis,
exportEqAnalysisExcel exportEqAnalysisExcel,
} from '@/api/equipment/analysis/statistics'; } from '@/api/equipment/analysis/statistics';
const tableProps = [ const tableProps = [
{ {
prop: 'recordTime', prop: 'recordTime',
label: '时间段', label: '时间段',
filter: parseTime filter: (val) => {
if (val && val.length > 0) {
return (
moment(val[0]).format('YYYY-MM-DD HH:mm:ss') +
' ~ ' +
moment(val[1]).format('YYYY-MM-DD HH:mm:ss')
);
}
return '-';
},
}, },
{ {
prop: 'lineName', prop: 'lineName',
label: '产线' label: '产线',
}, },
{ {
prop: 'sectionName', prop: 'sectionName',
label: '工段' label: '工段',
}, },
{ {
prop: 'equipmentName', prop: 'equipmentName',
label: '设备名称' label: '设备名称',
}, },
{ {
prop: 'equipmentType', prop: 'equipmentType',
label: '设备类型' label: '设备类型',
}, },
{ {
prop: 'workTime', prop: 'workTime',
label: '工作时间累积(h)' label: '工作时间累积(h)',
}, },
{ {
prop: 'repairCount', prop: 'repairCount',
label: '维修次数' label: '维修次数',
}, },
{ {
prop: 'maintainCount', prop: 'maintainCount',
label: '保养次数' label: '保养次数',
} },
]; ];
export default { export default {
mixins: [basicPage], mixins: [basicPage],
data() { data() {
const today = new Date();
const todayStart = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate(),
0,
0,
0
);
const todayEnd = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate(),
23,
59,
59
);
return { return {
urlOptions: { urlOptions: {
getDataListURL: getEqAnalysis, getDataListURL: getEqAnalysis,
exportURL: exportEqAnalysisExcel, exportURL: exportEqAnalysisExcel,
}, },
tableProps, tableProps,
tableBtn: [].filter((v)=>v), tableBtn: [].filter((v) => v),
tableData: [], tableData: [],
listQuery: {
pageSize: 10,
pageNo: 1,
total: 1,
recordTime: [
moment(todayStart).format('YYYY-MM-DD HH:mm:ss'),
moment(todayEnd).format('YYYY-MM-DD HH:mm:ss'),
],
},
formConfig: [ formConfig: [
{ {
type: 'input', type: 'input',
@ -101,7 +138,10 @@ export default {
endPlaceholder: '结束日期', endPlaceholder: '结束日期',
defaultTime: ['00:00:00', '23:59:59'], defaultTime: ['00:00:00', '23:59:59'],
param: 'recordTime', param: 'recordTime',
defaultSelect: [], defaultSelect: [
moment(todayStart).format('YYYY-MM-DD HH:mm:ss'),
moment(todayEnd).format('YYYY-MM-DD HH:mm:ss'),
],
}, },
{ {
type: 'button', type: 'button',
@ -113,33 +153,38 @@ export default {
type: 'separate', type: 'separate',
}, },
{ {
type: this.$auth.hasPermi('equipment:analysis-statistics:export') ? 'button' : '', type: this.$auth.hasPermi('equipment:analysis-statistics:export')
? 'button'
: '',
btnName: '导出', btnName: '导出',
name: 'export', name: 'export',
color: 'warning', color: 'warning',
plain: true plain: true,
}, },
], ],
}; };
}, },
created() {}, created() {},
mounted() {},
methods: { methods: {
// //
getDataList() { getDataList() {
this.dataListLoading = true; this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then(response => { this.urlOptions.getDataListURL(this.listQuery).then((response) => {
this.tableData = response.data.list; this.tableData = response.data.list;
this.listQuery.total = response.data.total; this.listQuery.total = response.data.total;
this.dataListLoading = false; this.dataListLoading = false;
}); });
}, },
buttonClick(val) { buttonClick(val) {
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':
this.listQuery.pageNo = 1; this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10; this.listQuery.pageSize = 10;
this.listQuery.equipmentName = val.name ? val.name : undefined; this.listQuery.equipmentName = val.name ? val.name : undefined;
this.listQuery.recordTime = val.recordTime ? val.recordTime : undefined; this.listQuery.recordTime = val.recordTime
? val.recordTime
: undefined;
this.getDataList(); this.getDataList();
break; break;
case 'reset': case 'reset':
@ -158,20 +203,24 @@ export default {
console.log(val); console.log(val);
} }
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
// //
let params = { ...this.listQuery }; let params = { ...this.listQuery };
params.pageNo = undefined; params.pageNo = undefined;
params.pageSize = undefined; params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有数据项?').then(() => { this.$modal
this.exportLoading = true; .confirm('是否确认导出所有数据项?')
return this.urlOptions.exportURL(params); .then(() => {
}).then(response => { this.exportLoading = true;
this.$download.excel(response, '设备统计分析.xls'); return this.urlOptions.exportURL(params);
this.exportLoading = false; })
}).catch(() => { }); .then((response) => {
} this.$download.excel(response, '设备统计分析.xls');
this.exportLoading = false;
})
.catch(() => {});
},
}, },
}; };
</script> </script>

View File

@ -237,6 +237,7 @@ export default {
label: '工厂', label: '工厂',
placeholder: '请选择工厂', placeholder: '请选择工厂',
param: 'factoryId', param: 'factoryId',
filterable: true,
selectOptions: [], selectOptions: [],
}, },
{ {
@ -244,6 +245,7 @@ export default {
label: '产线', label: '产线',
placeholder: '请选择产线', placeholder: '请选择产线',
param: 'lineId', param: 'lineId',
filterable: true,
selectOptions: [], selectOptions: [],
}, },
// //

View File

@ -0,0 +1,281 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-11 20:33:12
* @Description:
-->
<template>
<div class="alarm-handle">
<DialogForm
ref="orderForm"
key="orderForm"
v-model="orderForm"
:disabled="readOnly"
:has-files="false"
label-position="top"
:rows="orderFormRows" />
<small-title style="margin: 16px 0" :no-padding="true" size="sm">
处理方式
</small-title>
<DialogForm
key="handleMethodForm"
ref="handleMethodForm"
v-model="handleMethodForm"
:disabled="readOnly"
:has-files="true"
label-position="top"
:rows="handleMethodFormRows" />
</div>
</template>
<script>
import SmallTitle from './SmallTitle';
import { getworkerAll } from '@/api/base/materialUseLog';
import Editor from '@/components/Editor';
import DialogForm from '@/components/DialogForm';
export default {
name: 'AlarmHandle',
props: ['readOnly', 'logId'],
components: { SmallTitle, DialogForm, Editor },
data() {
return {
orderForm: {
id: null,
equipment: null,
createTime: null,
alarmContent: null,
alarmValue: null,
// , alarmValue
},
orderFormRows: [
[
{
input: true,
label: '设备编码',
prop: 'equipment',
},
{
datetime: true,
label: '报警时间',
prop: 'createTime',
},
{
input: true,
label: '报警编号',
prop: 'alarmValue',
},
{
input: true,
label: '报警内容',
prop: 'alarmContent',
},
],
],
handleMethodFormRows: [
[
{
select: true,
label: '处理人',
prop: 'hander',
url: '/base/core-worker/listAll',
rules: [
{ required: true, message: '类型名称不能为空', trigger: 'blur' },
],
},
{
upload: true,
label: '上传资料',
prop: 'files',
},
],
[
{
key: 'handerMode',
subcomponent: Editor,
label: '处理方式',
prop: 'handerMode',
bind: {
'min-height': 200,
},
},
],
],
handleMethodForm: {
id: null,
logId: null,
hander: null,
handerMode: null,
remark: null,
files: [
// {
// fileName: '',
// fileType: '',
// fileUrl: ''
// }
],
},
workersList: [],
};
},
mounted() {
this.getDict().then(() => {
this.init();
});
},
methods: {
/**
* 获取员工数据
*/
async getDict() {
const workerRes = await getworkerAll();
this.workersList = workerRes.data;
},
/**
* 初始化
*/
async init() {
this.initTop();
this.initDown();
},
/**
* 初始化上部表单
*/
async initTop() {
if (!this.logId) {
this.$msgError('缺少报警日志id');
this.$emit('close');
}
const url = '/base/equipment-alarm-log/get';
const { data, code } = await this.$axios({
url: url,
method: 'get',
params: {
id: this.logId,
},
});
if (code == 0) {
this.orderForm = data;
}
},
/**
* 初始化下部表单
*/
async initDown() {
if (!this.logId) {
this.$msgError('缺少报警日志id');
this.$emit('close');
}
const url = '/base/equipment-alarm-hand/get';
const { data, code } = await this.$axios({
url: url,
method: 'get',
params: {
id: this.logId,
},
});
if (code == 0) {
this.handleMethodForm = data;
}
},
/**
* 更新表单
*/
async submit() {
const result = await Promise.all([
await this.updateTop(),
await this.updateHandleMethod(),
]);
if (result[0] == true && result[1] == true) {
this.$modal.msgSuccess('更新成功');
this.$emit('refreshDataList');
} else {
this.$modal.msgError('更新失败');
}
},
/**
* 更新下部表单
*/
async updateHandleMethod() {
const url = '/base/equipment-alarm-hand';
const valid = await this.$refs.orderForm.validate();
if (!valid) {
return false;
}
const { code, data } = await this.$axios({
url: url + (this.handleMethodForm.id ? '/update' : '/create'),
method: this.handleMethodForm.id ? 'put' : 'post',
data: { ...this.handleMethodForm, logId: this.logId },
});
if (code == 0) {
return true;
}
return false;
},
/**
* 更新上部分表单
*/
async updateTop() {
const url = '/base/equipment-alarm-log';
const valid = await this.$refs.handleMethodForm.validate();
if (!valid) {
return false;
}
const { code, data } = await this.$axios({
url: url + '/update',
method: 'put',
data: this.orderForm,
});
if (code == 0) {
return true;
}
return false;
},
//
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;
}
this.urlOptions.createURL(this.dataForm).then((response) => {
this.$modal.msgSuccess('新增成功');
this.visible = false;
this.$emit('refreshDataList');
});
});
},
},
};
</script>
<style scoped>
.alarm-handle {
padding: 0;
}
.alarm-handle__method >>> .el-select {
width: 100% !important;
}
</style>

View File

@ -40,7 +40,7 @@ $pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
$mgr: 8px; $mgr: 8px;
@each $size, $height in $pxls { @each $size, $height in $pxls {
.#{$size}-title { .#{$size}-title {
font-size: 18px; font-size: $height;
line-height: $height; line-height: $height;
color: #000; color: #000;
font-weight: 500; font-weight: 500;
@ -53,7 +53,7 @@ $mgr: 8px;
width: 4px; width: 4px;
height: $height + 2px; height: $height + 2px;
border-radius: 1px; border-radius: 1px;
margin-right: $mgr; margin-right: 4px;
background-color: #0b58ff; background-color: #0b58ff;
} }
} }

View File

@ -1,195 +0,0 @@
<!--
* @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

@ -45,20 +45,23 @@
:disabled="mode == 'detail'" :disabled="mode == 'detail'"
:has-files="false" :has-files="false"
:rows="rows" /> --> :rows="rows" /> -->
<add-or-update <AddOrUpdate
ref="addOrUpdate" v-if="open"
@refreshDataList="successSubmit" /> ref="addOrUpdate"
:read-only="readOnly"
:log-id="chosedLogId"
@close="cancel"
@refreshDataList="successSubmit" />
</base-dialog> </base-dialog>
</div> </div>
</template> </template>
<script> <script>
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import AddOrUpdate from './add-or-updata.vue'
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'); import AddOrUpdate from './AddOrUpdate.vue';
import moment from 'moment';
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
const btn = { const btn = {
name: 'tableBtn', name: 'tableBtn',
@ -68,7 +71,10 @@ const btn = {
}, },
methods: { methods: {
handleClick() { handleClick() {
this.$emit('emitData', { action: this.injectData.name, value: this.injectData }); this.$emit('emitData', {
action: this.injectData.name,
value: this.injectData,
});
}, },
}, },
render: function (h) { render: function (h) {
@ -80,14 +86,14 @@ const btn = {
}, },
}; };
export default { export default {
name: 'Record', name: 'Record',
components: { AddOrUpdate }, components: { AddOrUpdate },
mixins: [basicPageMixin], mixins: [basicPageMixin],
data() { data() {
return { return {
readOnly: false,
chosedLogId: false,
searchBarKeys: ['equipmentName', 'recordTime'], searchBarKeys: ['equipmentName', 'recordTime'],
tableBtn: [ tableBtn: [
// this.$auth.hasPermi('equipment:spare-parts-config:update') // this.$auth.hasPermi('equipment:spare-parts-config:update')
@ -113,12 +119,16 @@ export default {
{ prop: 'productionLine', label: '产线' }, { prop: 'productionLine', label: '产线' },
{ prop: 'workshopSection', label: '工段' }, { prop: 'workshopSection', label: '工段' },
{ prop: 'equipment', label: '设备名称' }, { prop: 'equipment', label: '设备名称' },
{ prop: 'alarmGrade', label: '报警级别', filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL) }, {
{ prop: 'responsible', label: '报警时间' }, // prop: 'alarmGrade',
{ prop: 'responsible1', label: '设备报警码' }, // label: '报警级别',
filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL),
},
{ prop: 'createTime', label: '报警时间', filter: timeFilter }, //
{ prop: 'alarmCode', label: '设备报警码' }, //
{ prop: 'alarmContent', label: '报警内容' }, { prop: 'alarmContent', label: '报警内容' },
{ prop: 'opt1', label: '处理记录', name: '查看', subcomponent: btn }, { prop: 'opt1', label: '处理记录', name: '查看', subcomponent: btn },
{ prop: 'opt2', label: '处理', name: '报警处理', subcomponent: btn }, // TODO: { prop: 'opt2', label: '处理', name: '报警处理', subcomponent: btn }, // TODO:
// { prop: 'remark', label: '' }, // { prop: 'remark', label: '' },
], ],
searchBarFormConfig: [ searchBarFormConfig: [
@ -135,8 +145,8 @@ export default {
dateType: 'daterange', // datetimerange dateType: 'daterange', // datetimerange
// format: 'yyyy-MM-dd HH:mm:ss', // format: 'yyyy-MM-dd HH:mm:ss',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
// valueFormat: 'timestamp', valueFormat: 'timestamp',
valueFormat: 'yyyy-MM-dd HH:mm:ss', // valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始日期', startPlaceholder: '开始日期',
endPlaceholder: '结束日期', endPlaceholder: '结束日期',
@ -196,9 +206,10 @@ export default {
pageSize: 10, pageSize: 10,
lineId: null, lineId: null,
equipmentId: null, equipmentId: null,
recordTime: []
}, },
basePath: '/base/equipment-alarm-log', basePath: '/base/equipment-alarm-log',
list: [] list: [],
}; };
}, },
created() { created() {
@ -206,21 +217,20 @@ export default {
}, },
methods: { methods: {
handleEmitFun(val) { handleEmitFun(val) {
console.log('你好', val)
if (val.action === '报警处理') { if (val.action === '报警处理') {
// this.chosedLogId = val.value.alarmId;
this.chosedLogId = val.value.id;
// //
this.open = true this.open = true;
this.title = '报警处理' this.title = '报警处理';
this.$nextTick(() => { this.readOnly = false;
this.$refs.addOrUpdate.init(val.value.id);
});
} else { } else {
// this.chosedLogId = val.value.alarmId;
this.chosedLogId = val.value.id;
// //
this.open = true this.open = true;
this.title = '查看' this.title = '查看';
this.$nextTick(() => { this.readOnly = true;
this.$refs.addOrUpdate.init(val.value.id, true);
});
} }
}, },
/** 查询列表 */ /** 查询列表 */
@ -234,9 +244,9 @@ export default {
}); });
}, },
successSubmit() { successSubmit() {
this.cancel() this.cancel();
this.getList() this.getList();
}, },
/** 取消按钮 */ /** 取消按钮 */
cancel() { cancel() {
this.open = false; this.open = false;
@ -282,7 +292,7 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs.addOrUpdate.dataFormSubmit() this.$refs.addOrUpdate.submit();
// this.$refs['form'].validate((valid) => { // this.$refs['form'].validate((valid) => {
// if (!valid) { // if (!valid) {
// return; // return;
@ -310,7 +320,7 @@ export default {
this.$modal this.$modal
.confirm('是否确认删除记录"' + row.name + '"?') .confirm('是否确认删除记录"' + row.name + '"?')
.then(function () { .then(function () {
return this.delete({ id }); return this.del({ id });
}) })
.then(() => { .then(() => {
this.getList(); this.getList();

View File

@ -12,7 +12,7 @@
:wrapper-closable="false" :wrapper-closable="false"
class="drawer" class="drawer"
custom-class="mes-drawer" custom-class="mes-drawer"
size="60%" :size="size || '50%'"
@closed="$emit('destroy')"> @closed="$emit('destroy')">
<SmallTitle slot="title"> <SmallTitle slot="title">
{{ {{
@ -42,7 +42,8 @@
:dataForm="form" :dataForm="form"
:rows="formRows" /> --> :rows="formRows" /> -->
<el-row style="margin-bottom: 24px"> <!-- if -->
<el-row v-if="mode.includes('detail')" style="margin-bottom: 24px">
<el-col :span="8"> <el-col :span="8">
<div <div
class="title" class="title"
@ -62,13 +63,39 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<!-- else -->
<el-row v-else style="margin-bottom: 24px" :gutter="20">
<el-form ref="form" :model="form">
<el-col :span="8">
<el-form-item
class="title"
label="设备分组名称"
style="font-size: 16px; margin: 8px 0">
<el-input
v-model="form.name"
placeholder="请输入设备分组名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item
class="title"
label="设备分组编码"
style="font-size: 16px; margin: 8px 0">
<el-input
v-model="form.code"
placeholder="请输入设备分组编码"></el-input>
</el-form-item>
</el-col>
</el-form>
</el-row>
</div> </div>
<div <div
v-if="section.key == 'attrs'" v-if="section.key == 'attrs'"
style="position: relative; margin-top: 12px"> style="position: relative; margin-top: 12px">
<!-- v-if="!mode.includes('detail')" --> <div
<div style="position: absolute; top: -40px; right: 0"> v-if="!mode.includes('detail')"
style="position: absolute; top: -40px; right: 0">
<el-button @click="handleAddAttr" type="text"> <el-button @click="handleAddAttr" type="text">
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
添加报警 添加报警
@ -84,7 +111,7 @@
<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'" <!-- :add-button-show="mode.includes('detail') ? null : '添加属性'"
@emitButtonClick="handleAddAttr" --> @emitButtonClick="handleAddAttr" -->
<method-btn <method-btn
v-if="section.tableBtn" v-if="section.tableBtn && !mode.includes('detail')"
slot="handleBtn" slot="handleBtn"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@ -103,11 +130,13 @@
</div> </div>
<div class="drawer-body__footer"> <div class="drawer-body__footer">
<el-button style="" @click="handleCancel">取消</el-button> <el-button style="" @click="handleCancel">返回</el-button>
<!-- <el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit"> <el-button
编辑 type="primary"
</el-button> --> v-if="!mode.includes('detail')"
<!-- <el-button v-else type="primary" @click="handleCancel">确定</el-button> --> @click="handleSave">
保存
</el-button>
</div> </div>
</div> </div>
@ -163,7 +192,7 @@ const SmallTitle = {
export default { export default {
components: { SmallTitle, DialogForm, BaseInfoForm }, components: { SmallTitle, DialogForm, BaseInfoForm },
props: ['sections', 'defaultMode', 'dataId'], // dataId id props: ['sections', 'defaultMode', 'dataId', 'size'], // dataId id
data() { data() {
return { return {
mode: '', mode: '',
@ -191,7 +220,9 @@ export default {
label: '报警编码', // label: '报警编码', //
prop: 'code', prop: 'code',
url: '/base/equipment-group-alarm/getCode', url: '/base/equipment-group-alarm/getCode',
rules: [{ required: true, message: '报警编码不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '报警编码不能为空', trigger: 'blur' },
],
}, },
{ {
select: true, select: true,
@ -205,13 +236,17 @@ export default {
input: true, input: true,
label: '参数列名', // label: '参数列名', //
prop: 'plcParamName', prop: 'plcParamName',
rules: [{ required: true, message: '参数列名不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '参数列名不能为空', trigger: 'blur' },
],
}, },
{ {
input: true, input: true,
label: '报警内容', label: '报警内容',
prop: 'alarmContent', prop: 'alarmContent',
rules: [{ required: true, message: '报警内容不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '报警内容不能为空', trigger: 'blur' },
],
}, },
], ],
[ [
@ -223,7 +258,9 @@ export default {
{ label: '布尔型', value: 2 }, { label: '布尔型', value: 2 },
{ label: '字符型', value: 1 }, { label: '字符型', value: 1 },
], ],
rules: [{ required: true, message: '报警类型不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '报警类型不能为空', trigger: 'blur' },
],
}, },
{ {
input: true, input: true,
@ -322,7 +359,7 @@ export default {
handleSave() { handleSave() {
this.$refs['form'][0].validate(async (valid) => { this.$refs['form'][0].validate(async (valid) => {
if (valid) { if (valid) {
const isEdit = this.mode == 'edit'; const isEdit = !this.mode.includes('detail');
await this.$axios({ await this.$axios({
url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'], url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
method: isEdit ? 'put' : 'post', method: isEdit ? 'put' : 'post',
@ -403,32 +440,32 @@ export default {
}, },
// //
async submitAttrForm() { submitAttrForm() {
this.$refs['attrForm'].validate((valid) => { this.$refs['attrForm'].validate(async (valid) => {
if (!valid) { if (!valid) {
return; return;
} }
}); const isEdit = this.attrForm.id != null;
const isEdit = this.attrForm.id != null; this.attrFormSubmitting = true;
this.attrFormSubmitting = true; const res = await this.$axios({
const res = await this.$axios({ url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate,
url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate, method: isEdit ? 'put' : 'post',
method: isEdit ? 'put' : 'post', data: this.attrForm,
data: this.attrForm,
});
if (res.code == 0) {
this.closeAttrForm();
this.$message({
message: `${isEdit ? '更新' : '创建'}成功`,
type: 'success',
duration: 1500,
onClose: () => {
this.getAttrList();
},
}); });
}
this.attrFormSubmitting = false; if (res.code == 0) {
this.closeAttrForm();
this.$message({
message: `${isEdit ? '更新' : '创建'}成功`,
type: 'success',
duration: 1500,
onClose: () => {
this.getAttrList();
},
});
}
this.attrFormSubmitting = false;
});
}, },
closeAttrForm() { closeAttrForm() {

View File

@ -45,6 +45,7 @@
<BasicDrawer <BasicDrawer
v-if="editVisible" v-if="editVisible"
ref="drawer" ref="drawer"
size="45%"
:default-mode="editMode" :default-mode="editMode"
:data-id="alarmForm.id" :data-id="alarmForm.id"
:sections="[ :sections="[
@ -198,26 +199,23 @@ export default {
prop: 'createTime', prop: 'createTime',
label: '添加时间', label: '添加时间',
fixed: true, fixed: true,
width: 180,
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
}, },
{ width: 240, prop: 'code', label: '报警编码' }, { prop: 'code', label: '报警编码' },
{ {
width: 100,
prop: 'type', prop: 'type',
label: '报警类型', label: '报警类型',
filter: (val) => filter: (val) =>
val != null ? ['-', '字符型', '布尔型', '-'][val] : '-', val != null ? ['-', '字符型', '布尔型', '-'][val] : '-',
}, },
{ {
width: 90,
prop: 'grade', prop: 'grade',
label: '报警级别', label: '报警级别',
filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL), filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL),
}, },
{ width: 180, prop: 'alarmCode', label: '设备报警编码' }, { prop: 'alarmCode', label: '设备报警编码' },
{ width: 128, prop: 'plcParamName', label: '参数列名' }, { prop: 'plcParamName', label: '参数列名' },
{ width: 128, prop: 'alarmContent', label: '报警内容' }, { prop: 'alarmContent', label: '报警内容' },
], ],
alarmForm: { alarmForm: {
id: undefined, id: undefined,
@ -406,12 +404,25 @@ export default {
}); });
}); });
}, },
handleTableBtnClick({ data, type }) {
switch (type) {
case 'edit':
this.handleDetail(data, 'edit');
break;
case 'delete':
this.handleDelete(data);
break;
case 'detail':
this.handleDetail(data);
break;
}
},
// //
handleDetail(row) { handleDetail(row, mode = 'detail') {
// debugger; // debugger;
const { id, code, name, createTime } = row; const { id, code, name, createTime } = row;
// //
this.editMode = 'detail'; this.editMode = mode;
this.alarmForm.id = id; this.alarmForm.id = id;
this.alarmForm.equipmentGroupCode = code; this.alarmForm.equipmentGroupCode = code;
this.alarmForm.equipmentGroupName = name; this.alarmForm.equipmentGroupName = name;

View File

@ -12,7 +12,7 @@
:wrapper-closable="false" :wrapper-closable="false"
class="drawer" class="drawer"
custom-class="mes-drawer" custom-class="mes-drawer"
size="60%" :size="size || '50%'"
@closed="$emit('destroy')"> @closed="$emit('destroy')">
<SmallTitle slot="title"> <SmallTitle slot="title">
{{ {{
@ -42,7 +42,7 @@
:dataForm="form" :dataForm="form"
:rows="formRows" /> --> :rows="formRows" /> -->
<el-row style="margin-bottom: 24px"> <el-row v-if="mode.includes('detail')" style="margin-bottom: 24px">
<el-col :span="8"> <el-col :span="8">
<div <div
class="title" class="title"
@ -62,13 +62,38 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-row v-else style="margin-bottom: 24px" :gutter="20">
<el-form ref="form" :model="form">
<el-col :span="8">
<el-form-item
class="title"
label="设备分组名称"
style="font-size: 16px; margin: 8px 0">
<el-input
v-model="form.name"
placeholder="请输入设备分组名称"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item
class="title"
label="设备分组编码"
style="font-size: 16px; margin: 8px 0">
<el-input
v-model="form.code"
placeholder="请输入设备分组编码"></el-input>
</el-form-item>
</el-col>
</el-form>
</el-row>
</div> </div>
<div <div
v-if="section.key == 'attrs'" v-if="section.key == 'attrs'"
style="position: relative; margin-top: 12px"> style="position: relative; margin-top: 12px">
<!-- v-if="!mode.includes('detail')" --> <div
<div style="position: absolute; top: -40px; right: 0"> v-if="!mode.includes('detail')"
style="position: absolute; top: -40px; right: 0">
<el-button @click="handleAddAttr" type="text"> <el-button @click="handleAddAttr" type="text">
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
添加属性 添加属性
@ -84,7 +109,7 @@
<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'" <!-- :add-button-show="mode.includes('detail') ? null : '添加属性'"
@emitButtonClick="handleAddAttr" --> @emitButtonClick="handleAddAttr" -->
<method-btn <method-btn
v-if="section.tableBtn" v-if="section.tableBtn && !mode.includes('detail')"
slot="handleBtn" slot="handleBtn"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@ -104,10 +129,12 @@
<div class="drawer-body__footer"> <div class="drawer-body__footer">
<el-button style="" @click="handleCancel">取消</el-button> <el-button style="" @click="handleCancel">取消</el-button>
<!-- <el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit"> <el-button
编辑 type="primary"
</el-button> --> v-if="!mode.includes('detail')"
<!-- <el-button v-else type="primary" @click="handleCancel">确定</el-button> --> @click="handleSave">
保存
</el-button>
</div> </div>
</div> </div>
@ -163,7 +190,7 @@ const SmallTitle = {
export default { export default {
components: { SmallTitle, DialogForm, BaseInfoForm }, components: { SmallTitle, DialogForm, BaseInfoForm },
props: ['sections', 'defaultMode', 'dataId'], // dataId id props: ['sections', 'defaultMode', 'dataId', 'size'], // dataId id
data() { data() {
return { return {
mode: '', mode: '',
@ -191,7 +218,9 @@ export default {
label: '报警编码', // label: '报警编码', //
prop: 'code', prop: 'code',
url: '/base/equipment-group-alarm/getCode', url: '/base/equipment-group-alarm/getCode',
rules: [{ required: true, message: '报警编码不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '报警编码不能为空', trigger: 'blur' },
],
}, },
{ {
select: true, select: true,
@ -201,7 +230,9 @@ export default {
{ label: '布尔型', value: 2 }, { label: '布尔型', value: 2 },
{ label: '字符型', value: 1 }, { label: '字符型', value: 1 },
], ],
rules: [{ required: true, message: '报警类型不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '报警类型不能为空', trigger: 'blur' },
],
}, },
], ],
[ [
@ -222,13 +253,17 @@ export default {
input: true, input: true,
label: '参数列名', // label: '参数列名', //
prop: 'plcParamName', prop: 'plcParamName',
rules: [{ required: true, message: '参数列名不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '参数列名不能为空', trigger: 'blur' },
],
}, },
{ {
input: true, input: true,
label: '报警内容', label: '报警内容',
prop: 'alarmContent', prop: 'alarmContent',
rules: [{ required: true, message: '报警内容不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '报警内容不能为空', trigger: 'blur' },
],
}, },
], ],
], ],
@ -322,7 +357,7 @@ export default {
handleSave() { handleSave() {
this.$refs['form'][0].validate(async (valid) => { this.$refs['form'][0].validate(async (valid) => {
if (valid) { if (valid) {
const isEdit = this.mode == 'edit'; const isEdit = !this.mode.includes('detail');
await this.$axios({ await this.$axios({
url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'], url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
method: isEdit ? 'put' : 'post', method: isEdit ? 'put' : 'post',
@ -403,33 +438,32 @@ export default {
}, },
// //
async submitAttrForm() { submitAttrForm() {
this.$refs['attrForm'].validate((valid) => { this.$refs['attrForm'].validate(async (valid) => {
if (!valid) { if (!valid) {
return; return;
} }
}); const isEdit = this.attrForm.id != null;
console.log('this.attrform', this.attrForm); this.attrFormSubmitting = true;
const isEdit = this.attrForm.id != null; const res = await this.$axios({
this.attrFormSubmitting = true; url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate,
const res = await this.$axios({ method: isEdit ? 'put' : 'post',
url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate, data: this.attrForm,
method: isEdit ? 'put' : 'post',
data: this.attrForm,
});
if (res.code == 0) {
this.closeAttrForm();
this.$message({
message: `${isEdit ? '更新' : '创建'}成功`,
type: 'success',
duration: 1500,
onClose: () => {
this.getAttrList();
},
}); });
}
this.attrFormSubmitting = false; if (res.code == 0) {
this.closeAttrForm();
this.$message({
message: `${isEdit ? '更新' : '创建'}成功`,
type: 'success',
duration: 1500,
onClose: () => {
this.getAttrList();
},
});
}
this.attrFormSubmitting = false;
});
}, },
closeAttrForm() { closeAttrForm() {

View File

@ -45,6 +45,7 @@
<BasicDrawer <BasicDrawer
v-if="editVisible" v-if="editVisible"
ref="drawer" ref="drawer"
size="45%"
:default-mode="editMode" :default-mode="editMode"
:data-id="alarmForm.id" :data-id="alarmForm.id"
:sections="[ :sections="[
@ -224,7 +225,9 @@ export default {
bind: { bind: {
filterable: true, filterable: true,
}, },
rules: [{ required: true, message: '设备不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '设备不能为空', trigger: 'blur' },
],
}, },
], ],
[ [
@ -238,7 +241,9 @@ export default {
bind: { bind: {
filterable: true, filterable: true,
}, },
rules: [{ required: true, message: '报警分组不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '报警分组不能为空', trigger: 'blur' },
],
}, },
], ],
], ],
@ -269,7 +274,13 @@ export default {
input: true, input: true,
label: '设备分组名称', label: '设备分组名称',
prop: 'name', prop: 'name',
rules: [{ required: true, message: '设备分组名称不能为空', trigger: 'blur' }], rules: [
{
required: true,
message: '设备分组名称不能为空',
trigger: 'blur',
},
],
// bind: { // bind: {
// disabled: this.editMode == 'detail', // some condition, like detail mode... // disabled: this.editMode == 'detail', // some condition, like detail mode...
// } // }
@ -287,26 +298,23 @@ export default {
prop: 'createTime', prop: 'createTime',
label: '添加时间', label: '添加时间',
fixed: true, fixed: true,
width: 180,
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
}, },
{ width: 240, prop: 'code', label: '报警编码' }, { prop: 'code', label: '报警编码' },
{ {
width: 100,
prop: 'type', prop: 'type',
label: '报警类型', label: '报警类型',
filter: (val) => filter: (val) =>
val != null ? ['-', '字符型', '布尔型', '-'][val] : '-', val != null ? ['-', '字符型', '布尔型', '-'][val] : '-',
}, },
{ {
width: 90,
prop: 'grade', prop: 'grade',
label: '报警级别', label: '报警级别',
filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL), filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL),
}, },
{ width: 180, prop: 'alarmCode', label: '设备报警编码' }, { prop: 'alarmCode', label: '设备报警编码' },
{ width: 128, prop: 'plcParamName', label: '参数列名' }, { prop: 'plcParamName', label: '参数列名' },
{ width: 128, prop: 'alarmContent', label: '报警内容' }, { prop: 'alarmContent', label: '报警内容' },
], ],
}; };
}, },
@ -361,6 +369,19 @@ export default {
}; };
this.resetForm('form'); this.resetForm('form');
}, },
handleTableBtnClick({ data, type }) {
switch (type) {
case 'edit':
this.handleDetail(data, 'edit');
break;
case 'delete':
this.handleDelete(data);
break;
case 'detail':
this.handleDetail(data);
break;
}
},
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1;
@ -411,11 +432,11 @@ export default {
}); });
}, },
// //
handleDetail(row) { handleDetail(row, mode = 'detail') {
const { equipmentId, equipmentName, groupCode, groupId, groupName, id } = const { equipmentId, equipmentName, groupCode, groupId, groupName, id } =
row; row;
// //
this.editMode = 'detail'; this.editMode = mode;
this.alarmForm.id = groupId; this.alarmForm.id = groupId;
this.alarmForm.equipmentGroupCode = groupCode; this.alarmForm.equipmentGroupCode = groupCode;
this.alarmForm.equipmentGroupName = groupName; this.alarmForm.equipmentGroupName = groupName;

View File

@ -52,6 +52,7 @@
<BasicDrawer <BasicDrawer
v-if="editVisible" v-if="editVisible"
ref="drawer" ref="drawer"
size="45%"
:default-mode="editMode" :default-mode="editMode"
:info-data="alarmForm" :info-data="alarmForm"
:sections="[ :sections="[
@ -59,9 +60,13 @@
name: '基本信息', name: '基本信息',
key: 'base', key: 'base',
rows: drawerBaseInfoRows, rows: drawerBaseInfoRows,
url: '/base/equipment-plc-connect/get',
urlUpdate: '/base/equipment-plc-connect/update',
urlCreate: '/base/equipment-plc-connect/create',
queryParams: { id: alarmForm.id },
}, },
{ {
name: '属性列表', name: '采集参数',
key: 'attrs', key: 'attrs',
props: drawerListProps, props: drawerListProps,
url: '/base/equipment-plc-param/page', url: '/base/equipment-plc-param/page',
@ -75,18 +80,26 @@
pageSize: 10, pageSize: 10,
}, },
tableBtn: [ tableBtn: [
this.$auth.hasPermi('equipment:collection-config-param:update') {
? { type: 'edit',
type: 'edit', btnName: '修改',
btnName: '修改', },
} {
: undefined, type: 'delete',
this.$auth.hasPermi('equipment:collection-config-param:delete') btnName: '删除',
? { },
type: 'delete', // this.$auth.hasPermi('equipment:collection-config-param:update')
btnName: '删除', // ? {
} // type: 'edit',
: undefined, // btnName: '',
// }
// : undefined,
// this.$auth.hasPermi('equipment:collection-config-param:delete')
// ? {
// type: 'delete',
// btnName: '',
// }
// : undefined,
].filter((v) => v), ].filter((v) => v),
allowAdd: true, allowAdd: true,
}, },
@ -106,7 +119,6 @@ import {
getEquipmentPlcConnectPage, getEquipmentPlcConnectPage,
exportEquipmentPlcConnectExcel, exportEquipmentPlcConnectExcel,
} from '@/api/base/equipmentPlcConnect'; } from '@/api/base/equipmentPlcConnect';
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
// import './http'; // import './http';
import BasicDrawer from './components/BasicDrawer.vue'; import BasicDrawer from './components/BasicDrawer.vue';
@ -182,13 +194,15 @@ export default {
placeholder: '请选择设备', placeholder: '请选择设备',
param: 'equipmentId', param: 'equipmentId',
selectOptions: [], selectOptions: [],
filterable: true,
}, },
{ {
type: 'select', type: 'select',
label: '编码', label: '关联表编码',
placeholder: '请选择编码', placeholder: '请选择关联表编码',
param: 'plcId', param: 'plcId',
selectOptions: [], selectOptions: [],
filterable: true,
}, },
{ {
type: 'button', type: 'button',
@ -224,7 +238,9 @@ export default {
prop: 'plcId', prop: 'plcId',
labelKey: `plcTableName`, labelKey: `plcTableName`,
url: '/base/equipment-plc/listAll', url: '/base/equipment-plc/listAll',
rules: [{ required: true, message: '关联表名不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '关联表名不能为空', trigger: 'blur' },
],
bind: { bind: {
filterable: true, filterable: true,
}, },
@ -236,7 +252,9 @@ export default {
label: '设备', label: '设备',
prop: 'equipmentId', prop: 'equipmentId',
url: '/base/core-equipment/page?pageNo=1&pageSize=99', url: '/base/core-equipment/page?pageNo=1&pageSize=99',
rules: [{ required: true, message: '设备不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '设备不能为空', trigger: 'blur' },
],
bind: { bind: {
filterable: true, filterable: true,
}, },
@ -262,7 +280,9 @@ export default {
input: true, input: true,
label: '设备名', label: '设备名',
prop: 'equipmentName', prop: 'equipmentName',
rules: [{ required: true, message: '设备名不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '设备名不能为空', trigger: 'blur' },
],
// bind: { // bind: {
// disabled: this.editMode == 'detail', // some condition, like detail mode... // disabled: this.editMode == 'detail', // some condition, like detail mode...
// } // }
@ -296,7 +316,8 @@ export default {
label: '生产参数类型', label: '生产参数类型',
filter: (val) => filter: (val) =>
val != null val != null
? ['', '进片数量', '出片数量', '破损数量', '无类型', ''][val] ? // ? ['', '', '', '', '', ''][val]
['', '进口计数', '出口计数', '损耗计数', '无类型', ''][val]
: '-', : '-',
}, },
{ {
@ -407,6 +428,19 @@ export default {
}; };
this.resetForm('form'); this.resetForm('form');
}, },
handleTableBtnClick({ data, type }) {
switch (type) {
case 'edit':
this.handleDetail(data, 'edit');
break;
case 'delete':
this.handleDelete(data);
break;
case 'detail':
this.handleDetail(data);
break;
}
},
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1;
@ -458,7 +492,7 @@ export default {
}, },
// //
handleDetail(row) { handleDetail(row, mode = 'detail') {
// debugger; // debugger;
const { const {
id, id,
@ -474,7 +508,7 @@ export default {
workshopSection, workshopSection,
} = row; } = row;
// //
this.editMode = 'detail'; this.editMode = mode;
this.alarmForm.id = id; this.alarmForm.id = id;
this.alarmForm.plcTableName = plcTableName; // this.alarmForm.plcTableName = plcTableName; //
this.alarmForm.equipmentName = equipmentName; this.alarmForm.equipmentName = equipmentName;

View File

@ -59,7 +59,6 @@ import {
getEquipmentPlcPage, getEquipmentPlcPage,
exportEquipmentPlcExcel, exportEquipmentPlcExcel,
} from '@/api/base/equipmentPlc'; } from '@/api/base/equipmentPlc';
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
const switchBtn = { const switchBtn = {
@ -352,7 +351,7 @@ export default {
handleDelete(row) { handleDelete(row) {
const id = row.id; const id = row.id;
this.$modal this.$modal
.confirm('是否确认删除实时数据采集配置编号为"' + id + '"的数据项?') .confirm('是否确认删除该配置?')
.then(function () { .then(function () {
return deleteEquipmentPlc(id); return deleteEquipmentPlc(id);
}) })

View File

@ -12,7 +12,7 @@
:wrapper-closable="false" :wrapper-closable="false"
class="drawer" class="drawer"
custom-class="mes-drawer" custom-class="mes-drawer"
size="60%" :size="size || '50%'"
@closed="$emit('destroy')"> @closed="$emit('destroy')">
<SmallTitle slot="title"> <SmallTitle slot="title">
{{ {{
@ -42,7 +42,8 @@
v-model="form" v-model="form"
:rows="formRows" /> --> :rows="formRows" /> -->
<el-row style="margin-bottom: 24px"> <!-- if -->
<el-row v-if="mode.includes('detail')" style="margin-bottom: 24px">
<el-col :span="8"> <el-col :span="8">
<div <div
class="title" class="title"
@ -64,13 +65,39 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<!-- else -->
<el-row v-else style="margin-bottom: 24px" :gutter="20">
<el-form ref="form" :model="form">
<el-col :span="8">
<el-form-item
class="title"
label="设备名"
style="font-size: 16px; margin: 8px 0">
<el-input
v-model="form.equipmentName"
placeholder="请输入设备名"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item
class="title"
label="设备关联表名"
style="font-size: 16px; margin: 8px 0">
<el-input
v-model="form.plcTableName"
placeholder="请输入关联表名"></el-input>
</el-form-item>
</el-col>
</el-form>
</el-row>
</div> </div>
<div <div
v-if="section.key == 'attrs'" v-if="section.key == 'attrs'"
style="position: relative; margin-top: 12px"> style="position: relative; margin-top: 12px">
<!-- v-if="!mode.includes('detail')" --> <div
<div style="position: absolute; top: -40px; right: 0"> v-if="!mode.includes('detail')"
style="position: absolute; top: -40px; right: 0">
<el-button @click="handleAddAttr" type="text"> <el-button @click="handleAddAttr" type="text">
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
添加属性 添加属性
@ -86,7 +113,7 @@
<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'" <!-- :add-button-show="mode.includes('detail') ? null : '添加属性'"
@emitButtonClick="handleAddAttr" --> @emitButtonClick="handleAddAttr" -->
<method-btn <method-btn
v-if="section.tableBtn" v-if="section.tableBtn && !mode.includes('detail')"
slot="handleBtn" slot="handleBtn"
label="操作" label="操作"
:method-list="tableBtn" :method-list="tableBtn"
@ -106,10 +133,12 @@
<div class="drawer-body__footer"> <div class="drawer-body__footer">
<el-button style="" @click="handleCancel">取消</el-button> <el-button style="" @click="handleCancel">取消</el-button>
<!-- <el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit"> <el-button
编辑 type="primary"
</el-button> --> v-if="!mode.includes('detail')"
<!-- <el-button v-else type="primary" @click="handleCancel">确定</el-button> --> @click="handleSave">
保存
</el-button>
</div> </div>
</div> </div>
@ -164,7 +193,7 @@ const SmallTitle = {
export default { export default {
components: { SmallTitle, DialogForm: BaseInfoForm, BaseInfoForm }, components: { SmallTitle, DialogForm: BaseInfoForm, BaseInfoForm },
props: ['sections', 'defaultMode', 'infoData'], props: ['sections', 'defaultMode', 'infoData', 'size'],
data() { data() {
return { return {
mode: '', mode: '',
@ -194,13 +223,17 @@ export default {
input: true, input: true,
label: '参数列名', label: '参数列名',
prop: 'plcParamName', prop: 'plcParamName',
rules: [{ required: true, message: '参数列名不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '参数列名不能为空', trigger: 'blur' },
],
}, },
{ {
input: true, input: true,
label: '参数名称', label: '参数名称',
prop: 'name', prop: 'name',
rules: [{ required: true, message: '参数名称不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '参数名称不能为空', trigger: 'blur' },
],
}, },
], ],
[ [
@ -230,19 +263,35 @@ export default {
{ label: '工艺参数', value: 2 }, { label: '工艺参数', value: 2 },
{ label: '报警参数', value: 3 }, { label: '报警参数', value: 3 },
], ],
rules: [{ required: true, message: '设备参数类型不能为空', trigger: 'blur' }], rules: [
{
required: true,
message: '设备参数类型不能为空',
trigger: 'blur',
},
],
}, },
{ {
select: true, select: true,
label: '生产参数类型', label: '生产参数类型',
prop: 'production_param_type', prop: 'production_param_type',
options: [ options: [
{ label: '进片数量', value: 1 }, // { label: '', value: 1 },
{ label: '出片数量', value: 2 }, // { label: '', value: 2 },
{ label: '破损数量', value: 3 }, // { label: '', value: 3 },
// { label: '', value: 4 },
{ label: '进口计数', value: 1 },
{ label: '出口计数', value: 2 },
{ label: '损耗计数', value: 3 },
{ label: '无类型', value: 4 }, { label: '无类型', value: 4 },
], ],
rules: [{ required: true, message: '生产参数类型不能为空', trigger: 'blur' }], rules: [
{
required: true,
message: '生产参数类型不能为空',
trigger: 'blur',
},
],
}, },
], ],
[ [
@ -305,6 +354,7 @@ export default {
infoQuery: null, // infoQuery: null, //
attrFormSubmitting: false, attrFormSubmitting: false,
attrListLoading: false, attrListLoading: false,
shouldRefreshPageView: false,
}; };
}, },
computed: { computed: {
@ -323,10 +373,12 @@ export default {
}); });
}, },
tableBtn() { tableBtn() {
return this.mode == 'detail' ? [] : this.sections[1].tableBtn; return this.sections[1].tableBtn;
// return this.mode == 'detail' ? [] : this.sections[1].tableBtn;
}, },
}, },
mounted() { mounted() {
this.shouldRefreshPageView = false;
this.mode = this.defaultMode || 'detail'; this.mode = this.defaultMode || 'detail';
for (const section of this.sections) { for (const section of this.sections) {
// //
@ -389,7 +441,7 @@ export default {
handleSave() { handleSave() {
this.$refs['form'][0].validate(async (valid) => { this.$refs['form'][0].validate(async (valid) => {
if (valid) { if (valid) {
const isEdit = this.mode == 'edit'; const isEdit = !this.mode.includes('detail');
await this.$axios({ await this.$axios({
url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'], url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
method: isEdit ? 'put' : 'post', method: isEdit ? 'put' : 'post',
@ -403,6 +455,9 @@ export default {
}, },
handleCancel() { handleCancel() {
if (this.shouldRefreshPageView) {
this.$emit('refreshDataList');
}
this.visible = false; this.visible = false;
}, },
@ -426,7 +481,7 @@ export default {
remark: '', remark: '',
alarmContent: '', alarmContent: '',
}; };
this.attrTitle = '添加设备绑定信息'; this.attrTitle = '添加参数绑定信息';
this.attrFormVisible = true; this.attrFormVisible = true;
}, },
@ -439,14 +494,14 @@ export default {
}); });
if (res.code == 0) { if (res.code == 0) {
this.attrForm = res.data; this.attrForm = res.data;
this.attrTitle = '编辑设备绑定信息'; this.attrTitle = '编辑参数绑定信息';
this.attrFormVisible = true; this.attrFormVisible = true;
} }
}, },
// //
handleDeleteAttr(attrId) { handleDeleteAttr(attrId) {
this.$confirm('确定删除该分组报警?', '提示', { this.$confirm('确定删除该参数?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
@ -458,6 +513,7 @@ export default {
params: { id: attrId }, params: { id: attrId },
}); });
if (res.code == 0) { if (res.code == 0) {
this.shouldRefreshPageView = true;
this.$message({ this.$message({
message: '删除成功', message: '删除成功',
type: 'success', type: 'success',
@ -472,35 +528,37 @@ export default {
}, },
// //
async submitAttrForm() { submitAttrForm() {
this.$refs['attrForm'].validate((valid) => { this.$refs['attrForm'].validate(async (valid) => {
if (!valid) { if (!valid) {
return; return;
} }
});
const isEdit = this.attrForm.id != null;
this.attrFormSubmitting = true;
const res = await this.$axios({
url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate,
method: isEdit ? 'put' : 'post',
data: {
...this.attrForm,
connectId: this.infoData.id,
},
});
if (res.code == 0) { const isEdit = this.attrForm.id != null;
this.closeAttrForm(); this.attrFormSubmitting = true;
this.$message({ const res = await this.$axios({
message: `${isEdit ? '更新' : '创建'}成功`, url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate,
type: 'success', method: isEdit ? 'put' : 'post',
duration: 1500, data: {
onClose: () => { ...this.attrForm,
this.getAttrList(); connectId: this.infoData.id,
}, },
}); });
}
this.attrFormSubmitting = false; if (res.code == 0) {
this.closeAttrForm();
this.$message({
message: `${isEdit ? '更新' : '创建'}成功`,
type: 'success',
duration: 1500,
onClose: () => {
this.getAttrList();
this.shouldRefreshPageView = true;
},
});
}
this.attrFormSubmitting = false;
});
}, },
closeAttrForm() { closeAttrForm() {
@ -509,7 +567,7 @@ export default {
handleClick(raw) { handleClick(raw) {
if (raw.type === 'delete') { if (raw.type === 'delete') {
this.$confirm(`确定删除该报警?`, '提示', { this.$confirm(`确定删除该参数?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',

View File

@ -52,7 +52,7 @@
import moment from 'moment'; import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import { deleteCheck } from "@/api/equipment/base/inspection/settings"; import { deleteCheck } from '@/api/equipment/base/inspection/settings';
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'); const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
@ -128,15 +128,21 @@ export default {
label: '巡检内容编号', label: '巡检内容编号',
prop: 'code', prop: 'code',
url: '/base/equipment-check/getCode', url: '/base/equipment-check/getCode',
rules: [{ required: true, message: '巡检内容编号不能为空', trigger: 'blur' }], rules: [
{
required: true,
message: '巡检内容编号不能为空',
trigger: 'blur',
},
],
}, },
],
[
{ {
input: true, input: true,
label: '巡检项目', label: '巡检项目',
prop: 'program', prop: 'program',
rules: [{ required: true, message: '巡检项目不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '巡检项目不能为空', trigger: 'blur' },
],
}, },
], ],
[ [
@ -144,10 +150,10 @@ export default {
input: true, input: true,
label: '巡检内容', label: '巡检内容',
prop: 'content', prop: 'content',
rules: [{ required: true, message: '巡检内容不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '巡检内容不能为空', trigger: 'blur' },
],
}, },
],
[
{ {
input: true, input: true,
label: '备注', label: '备注',
@ -168,7 +174,7 @@ export default {
code: '', code: '',
program: '', program: '',
id: undefined, id: undefined,
content: '' content: '',
}, },
basePath: '/base/equipment-check', basePath: '/base/equipment-check',
mode: null, mode: null,
@ -271,10 +277,10 @@ export default {
handleDelete(row) { handleDelete(row) {
const id = row.id; const id = row.id;
this.$modal this.$modal
.confirm('是否确认删除巡检项目名称为"' + row.program + '"的数据项?') .confirm('是否确认删除巡检项目?')
.then(function () { .then(function () {
// return this.delete({ id }); // return this.del({ id });
return deleteCheck(id) return deleteCheck(id);
}) })
.then(() => { .then(() => {
this.getList(); this.getList();

View File

@ -77,9 +77,9 @@
<el-form-item label="巡检时间" prop="actualTime"> <el-form-item label="巡检时间" prop="actualTime">
<el-date-picker <el-date-picker
v-model="dataForm.actualTime" v-model="dataForm.actualTime"
type="date" type="datetime"
:disabled="isdetail" :disabled="isdetail"
format='yyyy-MM-dd' format='yyyy-MM-dd HH:mm:ss'
value-format="timestamp" value-format="timestamp"
placeholder="选择巡检时间" /> placeholder="选择巡检时间" />
</el-form-item> </el-form-item>

View File

@ -69,7 +69,7 @@ export default {
data() { data() {
return { return {
addOrUpdateVisible: false, addOrUpdateVisible: false,
searchBarKeys: ['equipmentId', 'createTime'], searchBarKeys: ['equipmentId', 'actualTime'],
tableBtn: [ tableBtn: [
this.$auth.hasPermi('equipment:check-record:detail') this.$auth.hasPermi('equipment:check-record:detail')
? { ? {
@ -105,6 +105,7 @@ export default {
label: '设备', label: '设备',
placeholder: '请选择设备', placeholder: '请选择设备',
param: 'equipmentId', param: 'equipmentId',
filterable: true
}, },
// //
{ {
@ -112,12 +113,12 @@ export default {
label: '时间段', label: '时间段',
dateType: 'daterange', // datetimerange dateType: 'daterange', // datetimerange
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
valueFormat: 'timestamp', valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始日期', startPlaceholder: '开始日期',
endPlaceholder: '结束日期', endPlaceholder: '结束日期',
defaultTime: ['00:00:00', '23:59:59'], defaultTime: ['00:00:00', '23:59:59'],
param: 'startTime', param: 'actualTime',
// width: 350, // width: 350,
}, },
{ {

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-11-09 11:09:26 * @LastEditTime: 2023-11-24 18:38:22
* @Description: * @Description:
--> -->
<template> <template>
@ -52,11 +52,10 @@
<div v-if="!isdetail" class="action_btn"> <div v-if="!isdetail" class="action_btn">
<template> <template>
<span style="display: inline-block;" @click="addNew()"> <span style="display: inline-block;">
<svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" /> <el-button type="text" @click="addNew()" icon="el-icon-plus">添加</el-button>
<span class="add">添加</span> </span>
</span> </template>
</template>
</div> </div>
<base-table <base-table
:table-props="tableProps" :table-props="tableProps"
@ -290,7 +289,7 @@ export default {
.drawer >>> .visual-part { .drawer >>> .visual-part {
flex: 1 auto; flex: 1 auto;
max-height: 76vh; max-height: 16vh;
overflow: hidden; overflow: hidden;
overflow-y: scroll; overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */ padding-right: 10px; /* 调整滚动条样式 */
@ -308,7 +307,7 @@ export default {
} }
.action_btn { .action_btn {
float: right; float: right;
margin: 5px 15px; margin: -40px 15px;
font-size: 14px; font-size: 14px;
} }
.add { .add {

View File

@ -54,7 +54,6 @@
</template> </template>
<script> <script>
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import addOrUpdata from './add-or-updata.vue'; import addOrUpdata from './add-or-updata.vue';
// import { publicFormatter } from '@/utils/dict'; // import { publicFormatter } from '@/utils/dict';
@ -101,9 +100,9 @@ export default {
{ prop: 'lineName', label: '产线' }, { prop: 'lineName', label: '产线' },
{ prop: 'sectionName', label: '工段' }, { prop: 'sectionName', label: '工段' },
{ prop: 'equipmentName', label: '设备' }, { prop: 'equipmentName', label: '设备' },
{ prop: 'responsible', label: '负责人' }, { prop: 'equipmentCode', label: '设备编码' },
{ prop: 'equipmentCode', label: '描述' }, // { prop: 'responsible', label: '' },
{ prop: 'checkNumber', label: '巡检条数' } // TODO: { prop: 'checkNumber', label: '巡检条数' }, // TODO:
], ],
searchBarFormConfig: [ searchBarFormConfig: [
{ {
@ -117,6 +116,7 @@ export default {
label: '设备名称', label: '设备名称',
placeholder: '请选择设备', placeholder: '请选择设备',
param: 'equipmentId', param: 'equipmentId',
filterable: true,
}, },
{ {
type: 'button', type: 'button',
@ -151,14 +151,18 @@ export default {
input: true, input: true,
label: '配置名称', label: '配置名称',
prop: 'name', prop: 'name',
rules: [{ required: true, message: '配置名称不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '配置名称不能为空', trigger: 'blur' },
],
}, },
{ {
input: true, input: true,
label: '配置编码', label: '配置编码',
prop: 'code', prop: 'code',
url: '/base/equipment-check-config/getCode', url: '/base/equipment-check-config/getCode',
rules: [{ required: true, message: '配置编码不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '配置编码不能为空', trigger: 'blur' },
],
}, },
], ],
[ [
@ -167,7 +171,13 @@ export default {
label: '设备名称', label: '设备名称',
prop: 'equipmentId', prop: 'equipmentId',
url: '/base/core-equipment/listAll', url: '/base/core-equipment/listAll',
rules: [{ required: true, message: '设备名称不能为空', trigger: 'blur' }], bind: {
filterable: true,
clearable: true,
},
rules: [
{ required: true, message: '设备名称不能为空', trigger: 'change' },
],
}, },
{ {
input: true, input: true,
@ -288,9 +298,9 @@ export default {
handleDelete(row) { handleDelete(row) {
const id = row.id; const id = row.id;
this.$modal this.$modal
.confirm('是否确认删除记录"' + row.name + '"?') .confirm('是否确认删除该巡检记录?')
.then(function () { .then(() => {
return this.delete({ id }); return this.del({ id });
}) })
.then(() => { .then(() => {
this.getList(); this.getList();
@ -317,14 +327,14 @@ export default {
}, },
handleDetail({ id }) { handleDetail({ id }) {
this.addOrUpdateVisible = true; this.addOrUpdateVisible = true;
this.addOrEditTitle = "详情"; this.addOrEditTitle = '详情';
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id, true); this.$refs.addOrUpdate.init(id, true);
}); });
}, },
handleAddDetail({ id }) { handleAddDetail({ id }) {
this.addOrUpdateVisible = true; this.addOrUpdateVisible = true;
this.addOrEditTitle = "添加巡检"; this.addOrEditTitle = '添加巡检';
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id); this.$refs.addOrUpdate.init(id);
}); });

View File

@ -52,6 +52,7 @@ import { publicFormatter } from '@/utils/dict';
import moment from 'moment'; import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { exportMaintainMonitorExcel } from '@/api/equipment/base/maintain/record' import { exportMaintainMonitorExcel } from '@/api/equipment/base/maintain/record'
import { parseTime } from '@/utils/ruoyi'
const remainBox = { const remainBox = {
name: 'RemainBox', name: 'RemainBox',
@ -99,7 +100,7 @@ const btn = {
render: function (h) { render: function (h) {
return ( return (
<el-button type="text" onClick={this.handleClick}> <el-button type="text" onClick={this.handleClick}>
{this.injectData.label} {this.injectData.name}
</el-button> </el-button>
); );
}, },
@ -113,16 +114,16 @@ export default {
return { return {
searchBarKeys: ['planId', 'equipmentId'], searchBarKeys: ['planId', 'equipmentId'],
tableProps: [ tableProps: [
{ // {
prop: 'createTime', // prop: 'createTime',
label: '添加时间', // label: '',
fixed: true, // fixed: true,
width: 180, // width: 180,
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), // filter: parseTime(createTime),
}, // },
{ prop: 'name', label: '保养计划' }, { prop: 'name', label: '保养计划' },
{ prop: 'lineName', label: '产线' }, { prop: 'lineName', label: '产线' },
{ prop: 'sectionName', label: '工段' }, { prop: 'sectionName', label: '工段' },
{ prop: 'equipmentName', label: '设备名称' }, { prop: 'equipmentName', label: '设备名称' },
{ prop: 'equipmentCode', label: '设备编码' }, { prop: 'equipmentCode', label: '设备编码' },
{ prop: 'maintenancePeriod', label: '保养频率' }, { prop: 'maintenancePeriod', label: '保养频率' },
@ -134,16 +135,16 @@ export default {
{ {
prop: 'lastMaintainTime', prop: 'lastMaintainTime',
label: '上次保养时间', label: '上次保养时间',
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), filter: parseTime,
}, },
{ prop: 'nextMaintainTime', label: '计划下次保养时间' }, { prop: 'nextMaintainTime', label: '计划下次保养时间', filter: parseTime },
{ {
prop: 'remainDays', prop: 'remainDays',
label: '距离保养时间(天)', label: '距离保养时间(天)',
subcomponent: remainBox, subcomponent: remainBox,
}, },
{ prop: 'opt1', label: '设备保养', subcomponent: btn }, { prop: 'opt1', label: '设备保养', name: '操作', subcomponent: btn },
{ prop: 'opt2', label: '保养记录', subcomponent: btn }, { prop: 'opt2', label: '保养记录', name: '查看详情', subcomponent: btn },
], ],
searchBarFormConfig: [ searchBarFormConfig: [
{ {
@ -243,15 +244,16 @@ export default {
switch (action) { switch (action) {
// //
case '设备保养': case '设备保养':
this.$router.push({ path: '/equipment/base/maintain/plan-config',query: { this.$router.push({ path: '/equipment/base/maintain/record',query: {
equipmentId: value.equipmentId, addRecord: 1,
equipmentName: value.equipmentName row: value
} }) } })
break; break;
case '保养记录': case '保养记录':
const queryData = { const queryData = {
equipmentId: value.equipmentId, equipmentId: value.equipmentId,
maintainPlanId: value.id maintainPlanId: value.id,
relatePlan: value.lastMaintainTime ? 1 : 2
} }
this.$router.push({ path: '/equipment/base/maintain/record',query: queryData }) this.$router.push({ path: '/equipment/base/maintain/record',query: queryData })
break; break;

View File

@ -51,6 +51,7 @@
import moment from 'moment'; import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { deleteEqMaintainPlan } from '@/api/equipment/base/maintain/record' import { deleteEqMaintainPlan } from '@/api/equipment/base/maintain/record'
import { publicFormatter } from '@/utils/dict';
export default { export default {
name: 'PlanConfig', name: 'PlanConfig',
@ -95,7 +96,7 @@ export default {
{ prop: 'equipmentName', label: '设备名称' }, { prop: 'equipmentName', label: '设备名称' },
{ prop: 'maintainDuration', label: '计划保养用时(h)' }, { prop: 'maintainDuration', label: '计划保养用时(h)' },
{ prop: 'maintenancePeriod', label: '保养频率(天/次)' }, { prop: 'maintenancePeriod', label: '保养频率(天/次)' },
{ prop: 'maintainType', label: '保养类型' }, { prop: 'maintainType', label: '保养类型', filter: publicFormatter('maintain_type') },
{ prop: 'remark', label: '备注' }, { prop: 'remark', label: '备注' },
], ],
searchBarFormConfig: [ searchBarFormConfig: [
@ -106,37 +107,37 @@ export default {
param: 'equipmentName', param: 'equipmentName',
}, },
// //
{ // {
type: 'datePicker', // type: 'datePicker',
label: '时间段', // label: '',
dateType: 'daterange', // datetimerange // dateType: 'daterange', // datetimerange
format: 'yyyy-MM-dd', // format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss', // valueFormat: 'yyyy-MM-dd HH:mm:ss',
// valueFormat: 'timestamp', // // valueFormat: 'timestamp',
rangeSeparator: '-', // rangeSeparator: '-',
startPlaceholder: '开始日期', // startPlaceholder: '',
endPlaceholder: '结束日期', // endPlaceholder: '',
defaultTime: ['00:00:00', '23:59:59'], // defaultTime: ['00:00:00', '23:59:59'],
param: 'createTime', // param: 'createTime',
// defaultSelect: [ // // defaultSelect: [
// new Date(y, m, d) // // new Date(y, m, d)
// .toLocaleString() // // .toLocaleString()
// .split('/') // // .split('/')
// .map((item, index) => { // // .map((item, index) => {
// if (index == 1 || index == 2) return item.padStart(2, '0'); // // if (index == 1 || index == 2) return item.padStart(2, '0');
// return item; // // return item;
// }) // // })
// .join('-'), // // .join('-'),
// new Date(y, m, d, 23, 59, 59) // // new Date(y, m, d, 23, 59, 59)
// .toLocaleString() // // .toLocaleString()
// .split('/') // // .split('/')
// .map((item, index) => { // // .map((item, index) => {
// if (index == 1 || index == 2) return item.padStart(2, '0'); // // if (index == 1 || index == 2) return item.padStart(2, '0');
// return item; // // return item;
// }) // // })
// .join('-'), // // .join('-'),
// ], // // ],
}, // },
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '查询',
@ -224,6 +225,17 @@ export default {
rules: [{ required: true, message: '保养频率不能为空', trigger: 'blur' }], rules: [{ required: true, message: '保养频率不能为空', trigger: 'blur' }],
}, },
], ],
[
{
switch: true,
label: '启用状态',
prop: 'enabled',
bind: {
'active-value': 1,
'inactive-value': 0,
},
}
],
[{ input: true, label: '备注', prop: 'remark' }], [{ input: true, label: '备注', prop: 'remark' }],
], ],
// //
@ -300,7 +312,8 @@ export default {
const queryData = { const queryData = {
equipmentId: row.equipmentId, equipmentId: row.equipmentId,
maintainPlanId: row.id, maintainPlanId: row.id,
relatePlan: row.enabled isAdd: 1
// relatePlan: row.enabled
} }
if (this.queryParams.createTime) { if (this.queryParams.createTime) {
queryData.createTime = this.queryParams.createTime queryData.createTime = this.queryParams.createTime

View File

@ -45,6 +45,11 @@
:disabled="mode == 'detail'" :disabled="mode == 'detail'"
:has-files="true" :has-files="true"
:rows="rows" /> :rows="rows" />
<el-row v-if="mode === 'detail'" slot="footer" type="flex" justify="end">
<el-col :span="12">
<el-button size="small" class="btnTextStyle" @click="cancel">关闭</el-button>
</el-col>
</el-row>
</base-dialog> </base-dialog>
</div> </div>
</template> </template>
@ -53,7 +58,7 @@
import moment from 'moment'; import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import Editor from '@/components/Editor'; import Editor from '@/components/Editor';
import { deleteEqMaintainLog } from '@/api/equipment/base/maintain/record'; import { deleteEqMaintainLog, exportMaintainLogExcel } from '@/api/equipment/base/maintain/record';
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'); const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
@ -121,14 +126,14 @@ export default {
}, },
{ {
type: 'select', type: 'select',
label: '保养计划', label: '计划名称',
placeholder: '请选择保养计划', placeholder: '请选择计划名称',
param: 'maintainPlanId', param: 'maintainPlanId',
}, },
// //
{ {
type: 'datePicker', type: 'datePicker',
label: '时间', label: '保养开始时间',
dateType: 'daterange', // datetimerange dateType: 'daterange', // datetimerange
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-dd HH:mm:ss',
@ -311,13 +316,16 @@ export default {
this.searchBarFormConfig[0].defaultSelect = this.searchBarFormConfig[0].defaultSelect =
this.$route.query.equipmentId ?? undefined; this.$route.query.equipmentId ?? undefined;
this.searchBarFormConfig[1].defaultSelect = this.searchBarFormConfig[1].defaultSelect =
Number(this.$route.query.maintainPlanId) ?? undefined; this.$route.query.maintainPlanId ?? undefined;
this.searchBarFormConfig[2].defaultSelect = this.searchBarFormConfig[2].defaultSelect =
this.$route.query?.createTime ?? undefined; this.$route.query?.createTime ?? undefined;
this.searchBarFormConfig[3].defaultSelect = this.searchBarFormConfig[3].defaultSelect =
Number(this.$route.query.relatePlan) ?? undefined; Number(this.$route.query.relatePlan) ?? undefined;
} }
this.getList(); this.getList();
if (this.$route.query.addRecord) {
this.handleAdd()
}
}, },
methods: { methods: {
initSearchBar() { initSearchBar() {
@ -398,6 +406,19 @@ export default {
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();
if (this.$route.query.addRecord) {
//
const tempRow = this.$route.query.row
this.form.equipmentId = tempRow.equipmentId
this.form.relatePlan = tempRow.nextMaintainTime ? 1 : 2
this.form.startTime = tempRow.nextMaintainTime
this.form.maintainPlanId = tempRow.id
}
if (this.$route.query.isAdd) {
//
this.form.equipmentId = this.$route.query.equipmentId
this.form.maintainPlanId = this.$route.query.maintainPlanId
}
this.open = true; this.open = true;
this.title = '添加保养记录'; this.title = '添加保养记录';
}, },
@ -440,7 +461,7 @@ export default {
handleDelete(row) { handleDelete(row) {
const id = row.id; const id = row.id;
this.$modal this.$modal
.confirm('是否删除设备名称为"' + row.equipmentName + '"的数据项?') .confirm('是否确认删除设备名称为"' + row.equipmentName + '"的数据项?')
.then(function () { .then(function () {
return deleteEqMaintainLog(id); return deleteEqMaintainLog(id);
}) })
@ -456,7 +477,7 @@ export default {
this.info({ id }).then((response) => { this.info({ id }).then((response) => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = '修改保养记录'; this.title = '查看保养记录详情';
}); });
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
@ -469,10 +490,10 @@ export default {
.confirm('是否确认导出所有保养记录?') .confirm('是否确认导出所有保养记录?')
.then(() => { .then(() => {
this.exportLoading = true; this.exportLoading = true;
return exportEquipmentTypeExcel(params); return exportMaintainLogExcel(params);
}) })
.then((response) => { .then((response) => {
this.$download.excel(response, '保养记录.xls'); this.$download.excel(response, '设备保养记录.xls');
this.exportLoading = false; this.exportLoading = false;
}) })
.catch(() => {}); .catch(() => {});

View File

@ -41,12 +41,12 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="故障发生时间" prop="faultTime"> <el-form-item label="故障发生时间" prop="faultTime">
<span>{{ dataForm.faultTime }}</span> <span>{{ parseTime(dataForm.faultTime) }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="故障级别" prop="faultLevel"> <el-form-item label="故障级别" prop="faultLevel">
<span>{{ dataForm.faultLevel }}</span> <span>{{ getDictDataLabel('fault-level', dataForm.faultLevel) }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
@ -164,11 +164,11 @@
</el-form> </el-form>
<div class="drawer-body__footer"> <div class="drawer-body__footer">
<el-button style="" @click="goback()">取消</el-button> <el-button style="" @click="goback()">{{ disabled ? '返回' : '取消' }}</el-button>
<el-button v-if="disabled" type="primary" @click="goEdit()"> <!-- <el-button v-if="disabled" type="primary" @click="goEdit()">
编辑 编辑
</el-button> </el-button> -->
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button> <el-button v-if="!disabled" type="primary" @click="dataFormSubmit()">确定</el-button>
</div> </div>
</el-drawer> </el-drawer>
</template> </template>
@ -179,6 +179,8 @@ import { getEqRepair, updateEqRepair } from '@/api/equipment/base/repair'
import Editor from "@/components/Editor"; import Editor from "@/components/Editor";
import FileUpload from "@/components/FileUpload"; import FileUpload from "@/components/FileUpload";
import { getDictDatas } from "@/utils/dict"; import { getDictDatas } from "@/utils/dict";
import { parseTime } from '@/utils/ruoyi'
import { getDictDataLabel } from '@/utils/dict';
export default { export default {
name: 'DialogForm', name: 'DialogForm',

View File

@ -53,12 +53,12 @@
</template> </template>
<script> <script>
import moment from 'moment'; // import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import CustomDialogForm from './CustomDialogForm.vue'; import CustomDialogForm from './CustomDialogForm.vue';
import { deleteRepair } from '@/api/equipment/base/repair' import { deleteRepair, exportRepairLogExcel } from '@/api/equipment/base/repair'
import { parseTime } from '@/utils/ruoyi'
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'); // const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
export default { export default {
name: 'EquipmentRepair', name: 'EquipmentRepair',
@ -100,14 +100,14 @@ export default {
label: '添加时间', label: '添加时间',
fixed: true, fixed: true,
width: 180, width: 180,
filter: timeFilter, filter: parseTime,
}, },
{ prop: 'repairOrderNumber', label: '设备维修单号' }, { prop: 'repairOrderNumber', label: '设备维修单号' },
{ prop: 'maintenanceStartTime', label: '开始时间', filter: timeFilter }, { prop: 'maintenanceStartTime', label: '开始时间', filter: parseTime },
{ {
prop: 'maintenanceFinishTime', prop: 'maintenanceFinishTime',
label: '结束时间', label: '结束时间',
filter: timeFilter, filter: parseTime,
}, },
{ {
prop: 'maintenanceStatus', prop: 'maintenanceStatus',
@ -129,6 +129,7 @@ export default {
label: '设备', label: '设备',
placeholder: '请选择设备', placeholder: '请选择设备',
param: 'equipmentId', param: 'equipmentId',
filterable: true,
}, },
{ {
type: 'select', type: 'select',
@ -417,10 +418,10 @@ export default {
.confirm('是否确认导出所有维修记录?') .confirm('是否确认导出所有维修记录?')
.then(() => { .then(() => {
this.exportLoading = true; this.exportLoading = true;
return exportEquipmentTypeExcel(params); return exportRepairLogExcel(params);
}) })
.then((response) => { .then((response) => {
this.$download.excel(response, '维修记录.xls'); this.$download.excel(response, '设备维修.xls');
this.exportLoading = false; this.exportLoading = false;
}) })
.catch(() => {}); .catch(() => {});

View File

@ -75,9 +75,6 @@
<div class="drawer-body__footer"> <div class="drawer-body__footer">
<el-button type="primary" @click="goback()">关闭</el-button> <el-button type="primary" @click="goback()">关闭</el-button>
<el-button v-if="disabled" type="primary" @click="goEdit()">
编辑
</el-button>
</div> </div>
<attr-add <attr-add

View File

@ -35,7 +35,7 @@
</el-form> </el-form>
<el-row style="text-align: right"> <el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button> <el-button @click="cancel">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row> </el-row>
</el-dialog> </el-dialog>
@ -79,21 +79,13 @@ export default {
this.partList = res.data.list; this.partList = res.data.list;
}) })
}, },
cancel() {
this.$refs['dataForm'].resetFields()
this.visible = false
},
init(id) { init(id) {
this.dataForm.id = id || ''; // this.dataForm.id = id || '';
this.visible = true; 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() { dataFormSubmit() {
@ -117,6 +109,7 @@ export default {
configId: this.configId, configId: this.configId,
}).then((response) => { }).then((response) => {
this.$modal.msgSuccess('新增成功'); this.$modal.msgSuccess('新增成功');
this.$refs['dataForm'].resetFields()
this.visible = false; this.visible = false;
this.$emit('refreshDataList'); this.$emit('refreshDataList');
}); });

View File

@ -0,0 +1,36 @@
<!--
* @Author: zhp
* @Date: 2023-11-08 14:00:52
* @LastEditTime: 2023-11-24 09:12:36
* @LastEditors: DY
* @Description:
-->
<template>
<div v-html="content" />
</template>
<script>
export default {
props: {
injectData: {
type: Object,
default: () => ({})
}
},
data() {
return {
content: ''
}
},
mounted() {
this.getContent()
console.log('12', this.injectData)
},
methods: {
getContent() {
this.content = this.injectData.description ?? ''
}
}
}
</script>

View File

@ -60,8 +60,9 @@ import { publicFormatter } from '@/utils/dict';
import Editor from '@/components/Editor'; import Editor from '@/components/Editor';
import addSparts from './addSparts.vue'; import addSparts from './addSparts.vue';
import { deleteConfig } from '@/api/equipment/base/spare-parts/config' import { deleteConfig } from '@/api/equipment/base/spare-parts/config'
import htmls from './htmls.vue'
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'); // const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
export default { export default {
name: 'EquipmentSparePartsConfig', name: 'EquipmentSparePartsConfig',
@ -111,7 +112,7 @@ export default {
{ prop: 'equipmentCode', label: '设备编码' }, { prop: 'equipmentCode', label: '设备编码' },
{ prop: 'responsible', label: '负责人' }, { prop: 'responsible', label: '负责人' },
// { prop: 'unit', label: '', filter: publicFormatter('unit_dict') }, // { prop: 'unit', label: '', filter: publicFormatter('unit_dict') },
{ prop: 'description', label: '描述' }, { prop: 'description', label: '描述', subcomponent: htmls },
{ prop: 'sparePartNumber', label: '备品备件数量' }, { prop: 'sparePartNumber', label: '备品备件数量' },
// { prop: 'remark', label: '' }, // { prop: 'remark', label: '' },
], ],

View File

@ -52,7 +52,7 @@
import moment from 'moment'; import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import { deleteSparePart } from '@/api/equipment/base/spare-parts/list' import { deleteSparePart } from '@/api/equipment/base/spare-parts/list';
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'); const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
@ -95,7 +95,7 @@ export default {
searchBarFormConfig: [ searchBarFormConfig: [
{ {
type: 'input', type: 'input',
label: '关键字', label: '备件名称',
placeholder: '请输入备件名称', placeholder: '请输入备件名称',
param: 'name', param: 'name',
}, },
@ -132,20 +132,33 @@ export default {
input: true, input: true,
label: '备件名称', label: '备件名称',
prop: 'name', prop: 'name',
rules: [{ required: true, message: '备件名称不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '备件名称不能为空', trigger: 'blur' },
],
}, },
{ {
input: true, input: true,
label: '备件型号', label: '备件编码',
prop: 'model', prop: 'code',
url: '/base/equipment-spare-part/getCode',
rules: [
{ required: true, message: '备件编码不能为空', trigger: 'blur' },
],
}, },
], ],
[ [
{
input: true,
label: '备件型号',
prop: 'model',
},
{ {
input: true, input: true,
label: '规格', label: '规格',
prop: 'specifications', prop: 'specifications',
}, },
],
[
{ {
select: true, select: true,
label: '供应商', label: '供应商',
@ -155,10 +168,10 @@ export default {
filterable: true, filterable: true,
clearable: true, clearable: true,
}, },
rules: [{ required: true, message: '供应商不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '供应商不能为空', trigger: 'blur' },
],
}, },
],
[
{ {
select: true, select: true,
label: '物料类型', label: '物料类型',
@ -169,8 +182,12 @@ export default {
filterable: true, filterable: true,
clearable: true, clearable: true,
}, },
rules: [{ required: true, message: '物料类型不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '物料类型不能为空', trigger: 'blur' },
],
}, },
],
[
{ {
input: true, input: true,
label: '使用寿命', label: '使用寿命',
@ -184,14 +201,14 @@ export default {
}, },
], ],
}, },
],
[
{ {
select: true, select: true,
label: '单位', label: '单位',
prop: 'unit', // prop: 'unit', //
options: this.getDictDatas(this.DICT_TYPE.UNIT_DICT), options: this.getDictDatas(this.DICT_TYPE.UNIT_DICT),
}, },
],
[
{ {
input: true, input: true,
label: '备注', label: '备注',
@ -284,6 +301,12 @@ export default {
const id = row.id; const id = row.id;
this.info({ id }).then((response) => { this.info({ id }).then((response) => {
this.form = response.data; this.form = response.data;
if (this.form.unit !== undefined) {
this.form.unit = String(this.form.unit)
}
if (this.form.type !== undefined) {
this.form.type = String(this.form.type)
}
this.open = true; this.open = true;
this.title = '修改备品备件'; this.title = '修改备品备件';
}); });

View File

@ -310,7 +310,8 @@ export default {
handleClick(raw) { handleClick(raw) {
if (raw.type === 'change') { if (raw.type === 'change') {
// //
this.addNew(); console.log(raw)
this.addNew(raw.data.sparePartId);
} else {} } else {}
}, },
getList() { getList() {
@ -320,7 +321,7 @@ export default {
configId: this.dataForm.id, configId: this.dataForm.id,
}).then((response) => { }).then((response) => {
this.list = response.data; this.list = response.data;
this.listQuery.total = response.data.total; this.listQuery.total = response.data.length;
}); });
}, },
getList1() { getList1() {
@ -334,10 +335,10 @@ export default {
}); });
}, },
// / // /
addNew(id) { addNew(sparePartId) {
this.addOrUpdateVisible = true; this.addOrUpdateVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id); this.$refs.addOrUpdate.init(sparePartId);
}); });
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */

View File

@ -25,10 +25,27 @@
clearable clearable
placeholder="请输入操作人" /> placeholder="请输入操作人" />
</el-form-item> </el-form-item>
<el-form-item label="更换耗时(min)" prop="timeUsed">
<el-input-number
v-model="dataForm.timeUsed"
controls-position="right"
clearable
placeholder="请输入更换耗时"
style="width: 100%" />
</el-form-item>
<el-form-item label="更换时间" prop="replacementTime">
<el-date-picker
v-model="dataForm.replacementTime"
type="date"
format='yyyy-MM-dd'
value-format='timestamp'
placeholder="选择入更换时间"
style="width: 100%" />
</el-form-item>
</el-form> </el-form>
<el-row style="text-align: right"> <el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button> <el-button @click="cancel">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</el-row> </el-row>
</el-dialog> </el-dialog>
@ -49,11 +66,15 @@ export default {
visible: false, visible: false,
dataForm: { dataForm: {
id: undefined, id: undefined,
responsible: '' responsible: '',
timeUsed: 0,
sparePartId: '',
replacementTime: undefined
}, },
partList: [], partList: [],
dataRule: { dataRule: {
responsible: [{ required: true, message: '操作人不能为空', trigger: 'blur' }] responsible: [{ required: true, message: '操作人不能为空', trigger: 'blur' }],
replacementTime: [{ required: true, message: '更换时间不能为空', trigger: 'blur' }]
}, },
}; };
}, },
@ -66,9 +87,13 @@ export default {
// this.partList = res.data // this.partList = res.data
// }, // },
init(id) { init(id) {
this.dataForm.id = id || ''; this.dataForm.sparePartId = id || undefined;
this.visible = true; this.visible = true;
}, },
cancel() {
this.$refs['dataForm'].resetFields();
this.visible = false;
},
// //
dataFormSubmit() { dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
@ -91,6 +116,7 @@ export default {
configId: this.configId, configId: this.configId,
}).then((response) => { }).then((response) => {
this.$modal.msgSuccess('新增成功'); this.$modal.msgSuccess('新增成功');
this.$refs['dataForm'].resetFields();
this.visible = false; this.visible = false;
this.$emit('refreshDataList'); this.$emit('refreshDataList');
}); });

View File

@ -72,10 +72,10 @@ const remainBox = {
}, },
computed: { computed: {
value() { value() {
const temp = this.injectData[this.injectData.prop] || null const temp = this.injectData[this.injectData.prop] || null;
if (temp) { if (temp) {
console.log('12', temp) console.log('12', temp);
return temp === 'Green' ? 'green' : 'red' return temp === 'Green' ? 'green' : 'red';
} }
return this.injectData[this.injectData.prop] || null; return this.injectData[this.injectData.prop] || null;
}, },
@ -83,7 +83,7 @@ const remainBox = {
if (this.value) { if (this.value) {
// const v = +this.value; // const v = +this.value;
// return v < 0 ? 'red' : v >= 0 && v < 2 ? 'yellow' : 'green'; // return v < 0 ? 'red' : v >= 0 && v < 2 ? 'yellow' : 'green';
return this.value return this.value;
} }
return 'unset'; return 'unset';
}, },
@ -95,8 +95,7 @@ const remainBox = {
this.color this.color
// this.color == 'Green' ? 'green' : this.color == 'Red' ? 'red' : 'yellow' // this.color == 'Green' ? 'green' : this.color == 'Red' ? 'red' : 'yellow'
}; position:absolute; inset: 0; padding: 0 10px; display: flex; align-items: center; color: ${ }; position:absolute; inset: 0; padding: 0 10px; display: flex; align-items: center; color: ${
'unset' this.color == 'red' || this.color == 'green' ? '#fff' : 'unset'
// this.color == 'red' ? '#fff' : 'unset'
}`}> }`}>
{this.injectData[this.injectData.prop] || ''} {this.injectData[this.injectData.prop] || ''}
</div> </div>
@ -112,7 +111,10 @@ const btn = {
}, },
methods: { methods: {
handleClick() { handleClick() {
this.$emit('emitData', { action: this.injectData.name, value: this.injectData }); this.$emit('emitData', {
action: this.injectData.name,
value: this.injectData,
});
}, },
}, },
render: function (h) { render: function (h) {
@ -124,8 +126,6 @@ const btn = {
}, },
}; };
export default { export default {
name: 'EquipmentSparePartsMonitor', name: 'EquipmentSparePartsMonitor',
components: { addSparts }, components: { addSparts },
@ -162,7 +162,12 @@ export default {
{ prop: 'responsible', label: '负责人' }, { prop: 'responsible', label: '负责人' },
{ prop: 'color', label: '是否超期', subcomponent: remainBox }, { prop: 'color', label: '是否超期', subcomponent: remainBox },
{ prop: 'opt1', label: '备件更换', name: '操作', subcomponent: btn }, { prop: 'opt1', label: '备件更换', name: '操作', subcomponent: btn },
{ prop: 'opt2', label: '更换记录', name: '更新记录', subcomponent: btn }, // TODO: {
prop: 'opt2',
label: '更换记录',
name: '更新记录',
subcomponent: btn,
}, // TODO:
// { prop: 'remark', label: '' }, // { prop: 'remark', label: '' },
], ],
searchBarFormConfig: [ searchBarFormConfig: [
@ -171,12 +176,14 @@ export default {
label: '产线', label: '产线',
placeholder: '请选择产线', placeholder: '请选择产线',
param: 'lineId', param: 'lineId',
filterable: true,
}, },
{ {
type: 'select', type: 'select',
label: '设备', label: '设备',
placeholder: '请选择设备', placeholder: '请选择设备',
param: 'equipmentId', param: 'equipmentId',
filterable: true,
}, },
{ {
type: 'button', type: 'button',
@ -211,7 +218,9 @@ export default {
input: true, input: true,
label: '配置名称', label: '配置名称',
prop: 'name', prop: 'name',
rules: [{ required: true, message: '配置名称不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '配置名称不能为空', trigger: 'blur' },
],
}, },
], ],
[ [
@ -224,7 +233,9 @@ export default {
filterable: true, filterable: true,
clearable: true, clearable: true,
}, },
rules: [{ required: true, message: '设备名称不能为空', trigger: 'blur' }], rules: [
{ required: true, message: '设备名称不能为空', trigger: 'blur' },
],
}, },
], ],
[ [
@ -281,29 +292,29 @@ export default {
} }
}, },
eqOperation({ id }) { eqOperation({ id }) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id); this.$refs.addOrUpdate.init(id);
}); });
}, },
updateLog({ id }) { updateLog({ id }) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id, true); this.$refs.addOrUpdate.init(id, true);
}); });
}, },
initSearchBar() { initSearchBar() {
// 线 // 线
getCorePLList().then(res => { getCorePLList().then((res) => {
this.$set( this.$set(
this.searchBarFormConfig[0], this.searchBarFormConfig[0],
'selectOptions', 'selectOptions',
res.data.map((item) => ({ res.data.map((item) => ({
name: item.name, name: item.name,
id: item.id id: item.id,
})) }))
); );
}) });
this.http('/base/core-equipment/listAll', 'get').then(({ data }) => { this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
this.$set( this.$set(
this.searchBarFormConfig[1], this.searchBarFormConfig[1],
@ -319,7 +330,11 @@ export default {
getList() { getList() {
this.loading = true; this.loading = true;
// //
this.http('/base/equipment-spare-part-config/monitor', 'get', this.queryParams).then((response) => { this.http(
'/base/equipment-spare-part-config/monitor',
'get',
this.queryParams
).then((response) => {
this.list = response.data.list; this.list = response.data.list;
this.total = response.data.total; this.total = response.data.total;
this.loading = false; this.loading = false;
@ -338,7 +353,7 @@ export default {
name: null, name: null,
equipmentId: null, equipmentId: null,
description: null, description: null,
responsible: null responsible: null,
}; };
this.resetForm('form'); this.resetForm('form');
}, },
@ -397,7 +412,7 @@ export default {
this.$modal this.$modal
.confirm('是否确认删除记录"' + row.name + '"?') .confirm('是否确认删除记录"' + row.name + '"?')
.then(function () { .then(function () {
return this.delete({ id }); return this.del({ id });
}) })
.then(() => { .then(() => {
this.getList(); this.getList();

View File

@ -0,0 +1,143 @@
<!--
filename: SearchBar.vue
author: liubin
date: 2023-11-23 14:01:17
description:
-->
<template>
<div class="search-bar">
<div class="vertical-blue-line"></div>
<el-form
:inline="true"
ref="search-bar__form"
:model="form"
class="search-bar__form">
<el-form-item :label="'产线'" prop="productionLineId">
<el-select
size="small"
placeholder="请选择产线"
@change="getEquipmentByLineId"
v-model="form.productionLineId">
<el-option
v-for="item in listLine"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="'设备'" prop="equipmentId">
<el-select
size="small"
placeholder="请选择设备"
v-model="form.equipmentId">
<el-option
v-for="item in listEq"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-form>
<el-button type="primary" @click="handleSearch" size="small">
查询
</el-button>
</div>
</template>
<script>
export default {
name: 'SearchBar',
model: {
prop: 'value',
event: 'change',
},
props: {
value: {
type: Object,
default: () => {},
},
},
data() {
return {
listLine: [],
listEq: [],
};
},
computed: {
form: {
set(val) {
this.emit(val);
},
get() {
return this.value;
},
},
},
mounted() {
this.getLine();
},
methods: {
emit(newValue) {
debugger;
this.$emit('update', { ...this.form, ...newValue });
},
async getLine() {
const { data, code } = await this.$axios({
url: '/base/core-production-line/listAll',
});
if (code == 0) {
this.listLine = data;
return;
}
this.listLine.splice(0);
},
async getEquipmentByLineId(id) {
const { data, code } = await this.$axios({
url: '/base/core-equipment/listByLine',
params: {
id,
},
});
if (code == 0) {
this.listEq = data;
return;
}
this.listEq.splice(0);
},
handleSearch() {
this.$emit('action', {
action: 'search',
payload: this.form,
});
},
},
};
</script>
<style scoped lang="scss">
.search-bar {
padding: 12px 0;
font-size: 16px;
position: relative;
display: flex;
align-items: center;
gap: 12px;
:deep(.el-form-item) {
margin-bottom: 0 !important;
margin-right: 0;
&:not(:last-child) {
margin-right: 18px;
}
}
}
.vertical-blue-line {
width: 4px;
height: 18px;
background: #0b58ff;
border-radius: 2px;
}
</style>

View File

@ -1,10 +1,7 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<SearchBar <SearchBarNew v-model="searchBarForm" @action="handleSearchBarActions" />
:formConfigs="searchBarFormConfig"
ref="search-bar"
@headBtnClick="handleSearchBarBtnClick" />
<!-- 列表 --> <!-- 列表 -->
<base-table <base-table
@ -13,13 +10,13 @@
:limit="queryParams.pageSize" :limit="queryParams.pageSize"
:table-data="list" :table-data="list"
@emitFun="handleEmitFun"> @emitFun="handleEmitFun">
<method-btn <!-- <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
label="操作" label="操作"
:width="120" :width="120"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleTableBtnClick" /> @clickBtn="handleTableBtnClick" /> -->
</base-table> </base-table>
<!-- 分页组件 --> <!-- 分页组件 -->
@ -50,22 +47,23 @@
</template> </template>
<script> <script>
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { publicFormatter } from '@/utils/dict'; import { parseTime } from '@/utils/ruoyi';
import { parseTime } from '@/utils/ruoyi' import SearchBarNew from '../SearchBar.vue';
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
const btn = { const btn = {
name: 'tableBtn', name: 'tableBtn',
props: ['injectData'], props: ['injectData'],
components: {},
data() { data() {
return {}; return {};
}, },
methods: { methods: {
handleClick() { handleClick() {
this.$emit('emitData', { action: this.injectData.label, value: this.injectData }); this.$emit('emitData', {
action: this.injectData.label,
value: this.injectData,
});
}, },
}, },
render: function (h) { render: function (h) {
@ -77,154 +75,104 @@ const btn = {
}, },
}; };
// monitoring/equipment-monitor/realtime-page
export default { export default {
name: 'StatusAndParams', name: 'StatusAndParams',
mixins: [basicPageMixin], mixins: [basicPageMixin],
components: { SearchBarNew },
data() { data() {
return { 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: [ tableProps: [
{ prop: 'productionLine', label: '设备名称' }, { prop: 'equipmentName', label: '设备名称' },
{ prop: 'workshopSection', label: '设备编码' }, { prop: 'equipmentCode', label: '设备编码' },
{ prop: 'equipment', label: '投入数' }, { prop: 'inQuantity', label: '投入数' },
{ prop: 'productionLine', label: '产出数' }, { prop: 'outQuantity', label: '产出数' },
{ prop: 'workshopSection', label: '是否运行' }, {
{ prop: 'equipment22', label: '状态' }, prop: 'run',
// { prop: 'alarmGrade', label: '', filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL) }, label: '是否运行',
{ prop: 'productionLine', label: '是否故障' }, filter: (val) => (val != null ? (val ? '是' : '否') : ''),
{ prop: 'workshopSection', label: '生产量记录时间', filter: parseTime }, },
{ prop: 'equipment1', label: '状态记录时间', filter: parseTime }, {
prop: 'status',
label: '状态',
filter: (val) =>
val != null ? ['正常', '计划停机', '故障'][val] : '',
},
{
prop: 'error',
label: '是否故障',
filter: (val) => (val != null ? (val ? '是' : '否') : ''),
},
{
prop: 'quantityRecordTime',
label: '生产量记录时间',
filter: parseTime,
},
{ prop: 'statusRecordTime', label: '状态记录时间', filter: parseTime },
{ prop: 'opt1', label: '状态可视化', name: '查看', subcomponent: btn }, { prop: 'opt1', label: '状态可视化', name: '查看', subcomponent: btn },
{ prop: 'opt2', label: '参数监控', name: '查看', subcomponent: btn } // TODO: { prop: 'opt2', label: '参数监控', name: '查看', subcomponent: btn },
// { 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',
// },
], ],
searchBarForm: {
productionLineId: null,
equipmentId: null,
},
// //
open: false, open: false,
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
lineId: null,
equipmentId: null, equipmentId: null,
productionLineId: null,
}, },
basePath: '/base/equipment-alarm-log', list: [],
list: []
}; };
}, },
created() { mounted() {
// this.getList(); this.getList();
}, },
methods: { methods: {
handleEmitFun(val) { /**
console.log('你好', val) * 处理表格按钮点击事件
if (val.action === '状态可视化') { * @param {string} action 按钮名称
* @param {object} value 按钮数据(行数据) { equipmentId, equipmentCode, equipmentName, inQuantity, outQuantity, run, status, error, quantityRecordTime, statusRecordTime}
*/
handleEmitFun({ action, value: row } = {}) {
if (action === '状态可视化') {
// //
} else { } else if (action === '参数监控') {
// //
// equipmentId recordTime workOrderId id
this.$router.push({
// path: '/equipment/monitor/full-params',
name: 'EquipmentFullParams',
params: {
equipmentId: row.equipmentId,
equipmentCode: row.equipmentCode,
equipmentName: row.equipmentName,
},
});
} else {
} }
}, },
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true;
// //
this.recv(this.queryParams).then((response) => { this.http(
'/monitoring/equipment-monitor/realtime-page',
'get',
this.queryParams
).then((response) => {
this.list = response.data.list; this.list = response.data.list;
this.total = response.data.total; this.total = response.data.total;
this.loading = false; this.loading = false;
}); });
}, },
successSubmit() { successSubmit() {
this.cancel() this.cancel();
this.getList() this.getList();
}, },
/** 取消按钮 */ /** 取消按钮 */
cancel() { cancel() {
this.open = false; this.open = false;
@ -242,9 +190,25 @@ export default {
// }; // };
// this.resetForm('form'); // this.resetForm('form');
// }, // },
handleSearchBarActions({ action, payload }) {
switch (action) {
case 'search':
this.handleQuery();
break;
case 'reset':
this.resetQuery();
break;
default:
break;
}
},
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNo = 1; this.queryParams = {
...this.queryParams,
...this.searchBarForm,
pageNo: 1,
};
this.getList(); this.getList();
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
@ -270,7 +234,7 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs.addOrUpdate.dataFormSubmit() this.$refs.addOrUpdate.dataFormSubmit();
// this.$refs['form'].validate((valid) => { // this.$refs['form'].validate((valid) => {
// if (!valid) { // if (!valid) {
// return; // return;
@ -297,8 +261,8 @@ export default {
const id = row.id; const id = row.id;
this.$modal this.$modal
.confirm('是否确认删除记录"' + row.name + '"?') .confirm('是否确认删除记录"' + row.name + '"?')
.then(function () { .then(() => {
return this.delete({ id }); return this.del({ id });
}) })
.then(() => { .then(() => {
this.getList(); this.getList();

View File

@ -61,6 +61,8 @@
v-if="open" v-if="open"
style="width: 100%" style="width: 100%"
v-model="queryParams.equipmentId" v-model="queryParams.equipmentId"
filterable
clearable
placeholder="请选择一个设备"> placeholder="请选择一个设备">
<el-option <el-option
v-for="eq in eqList" v-for="eq in eqList"
@ -482,7 +484,7 @@ export default {
async submitForm() { async submitForm() {
const { code, data } = await this.$axios({ const { code, data } = await this.$axios({
url: '/analysis/equipment-analysis/quantity', url: '/monitoring/equipment-monitor/quantity-series',
method: 'get', method: 'get',
params: this.queryParams, params: this.queryParams,
}); });

View File

@ -6,19 +6,29 @@
--> -->
<template> <template>
<div class="status-timegraph-container" style="background: #f2f4f9; flex: 1; display: flex; flex-direction: column"> <div
<el-row class="" style=" class="status-timegraph-container"
style="background: #f2f4f9; flex: 1; display: flex; flex-direction: column">
<el-row
class=""
style="
margin-bottom: 12px; margin-bottom: 12px;
background: #fff; background: #fff;
padding: 16px 16px 0; padding: 16px 16px 0;
border-radius: 8px; border-radius: 8px;
"> ">
<div class="blue-title">生产节拍时序图</div> <div class="blue-title">生产节拍时序图</div>
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" :remove-blue="true" <SearchBar
@select-changed="handleSearchBarSelectChange" @headBtnClick="handleSearchBarBtnClick" /> :formConfigs="searchBarFormConfig"
ref="search-bar"
:remove-blue="true"
@select-changed="handleSearchBarSelectChange"
@headBtnClick="handleSearchBarBtnClick" />
</el-row> </el-row>
<el-row class="" style=" <el-row
class=""
style="
height: 1px; height: 1px;
flex: 1; flex: 1;
margin-bottom: 12px; margin-bottom: 12px;
@ -47,17 +57,36 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<div class="main-area" style="flex: 1; display: flex; flex-direction: column"> <div
<div class="graphs" v-show="graphList.length" id="status-chart" style="height: 1px; flex: 1"></div> class="main-area"
style="flex: 1; display: flex; flex-direction: column">
<div
class="graphs"
v-show="graphList.length"
id="status-chart"
style="height: 1px; flex: 1"></div>
<h2 v-if="!graphList || graphList.length == 0" class="no-data-bg"></h2> <h2 v-if="!graphList || graphList.length == 0" class="no-data-bg"></h2>
</div> </div>
</el-row> </el-row>
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<base-dialog dialogTitle="添加设备" :dialogVisible="open" width="500px" @close="open = false" @cancel="open = false" <base-dialog
dialogTitle="添加设备"
:dialogVisible="open"
width="500px"
@close="open = false"
@cancel="open = false"
@confirm="submitForm"> @confirm="submitForm">
<el-select v-if="open" style="width: 100%" v-model="queryParams.equipmentId" placeholder="请选择一个设备"> <el-select
<el-option v-for="eq in eqList" :key="eq.id" :value="eq.id" :label="eq.name"></el-option> v-if="open"
style="width: 100%"
v-model="queryParams.equipmentId"
placeholder="请选择一个设备">
<el-option
v-for="eq in eqList"
:key="eq.id"
:value="eq.id"
:label="eq.name"></el-option>
</el-select> </el-select>
</base-dialog> </base-dialog>
</div> </div>
@ -65,12 +94,19 @@
<script> <script>
import Gantt from './chart'; import Gantt from './chart';
import moment from 'moment';
export default { export default {
name: 'SGStatus', name: 'SGStatus',
components: {}, components: {},
props: {}, props: {},
data() { data() {
const today = new Date();
const todayStart = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate()
);
return { return {
chart: null, chart: null,
searchBarFormConfig: [ searchBarFormConfig: [
@ -100,6 +136,7 @@ export default {
placeholder: '选择日期', placeholder: '选择日期',
param: 'recordTime', param: 'recordTime',
required: true, required: true,
defaultSelect: moment(todayStart).format('YYYY-MM-DD HH:mm:ss'),
}, },
{ {
type: 'button', type: 'button',
@ -129,7 +166,7 @@ export default {
open: false, open: false,
eqList: [], eqList: [],
startTime: null, startTime: null,
gantt: null gantt: null,
// demo: [ // demo: [
// [ // [
// { // {
@ -159,7 +196,7 @@ export default {
this.initEquipment(); this.initEquipment();
// this.getList(); // this.getList();
}, },
mounted() { }, mounted() {},
watch: { watch: {
graphList: { graphList: {
handler(val) { handler(val) {
@ -171,7 +208,6 @@ export default {
return; return;
} }
this.gantt.update(val); this.gantt.update(val);
}); });
} }
return; return;
@ -215,7 +251,9 @@ export default {
params: this.queryParams, params: this.queryParams,
}); });
if (code == 0) { if (code == 0) {
this.existingEquipments = Object.values(data).map((eq) => eq[0].equipmentId); this.existingEquipments = Object.values(data).map(
(eq) => eq[0].equipmentId
);
this.graphList = this.objectToArray(data); this.graphList = this.objectToArray(data);
} }
}, },
@ -302,26 +340,26 @@ export default {
return; return;
} }
this.startTime = new Date(payload.recordTime) this.startTime = new Date(payload.recordTime);
this.queryParams.lineId = payload.lineId || null; this.queryParams.lineId = payload.lineId || null;
this.queryParams.sectionId = payload.sectionId || null; this.queryParams.sectionId = payload.sectionId || null;
this.queryParams.equipmentId = payload.equipmentId || null; this.queryParams.equipmentId = payload.equipmentId || null;
this.queryParams.recordTime = payload.recordTime this.queryParams.recordTime = payload.recordTime
? [ ? [
payload.recordTime, payload.recordTime,
new Date( new Date(
new Date(payload.recordTime).getTime() + 24 * 3600 * 1000 new Date(payload.recordTime).getTime() + 24 * 3600 * 1000
) )
.toLocaleDateString() .toLocaleDateString()
.split('/') .split('/')
.map((value, index) => { .map((value, index) => {
if (index == 1 || index == 2) { if (index == 1 || index == 2) {
return value.padStart(2, '0'); return value.padStart(2, '0');
} }
return value; return value;
}) })
.join('-') + ' 00:00:00', .join('-') + ' 00:00:00',
] ]
: null; : null;
this.getList(); this.getList();
break; break;
@ -337,9 +375,12 @@ export default {
return; return;
} }
const { code, data } = await this.$axios({ const { code, data } = await this.$axios({
url: '/analysis/equipment-analysis/status', url: '/monitoring/equipment-monitor/status-series',
method: 'get', method: 'get',
params: this.queryParams, params: {
recordTime: this.queryParams.recordTime,
equipmentId: this.queryParams.equipmentId,
},
}); });
if (code == 0) { if (code == 0) {
const newEqlist = this.objectToArray(data); const newEqlist = this.objectToArray(data);
@ -444,7 +485,7 @@ export default {
} }
.running { .running {
background-color: #288AFF; background-color: #288aff;
// background-color: #84f04e; // background-color: #84f04e;
} }
@ -455,7 +496,7 @@ export default {
.fault { .fault {
// background-color: #ea5b5b; // background-color: #ea5b5b;
background-color: #FC9C91; background-color: #fc9c91;
} }
.full { .full {
@ -469,7 +510,7 @@ export default {
} }
.stop { .stop {
background-color: #FFDC94; background-color: #ffdc94;
} }
.legend-row { .legend-row {
@ -478,7 +519,7 @@ export default {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
>.legend:not(:last-child) { > .legend:not(:last-child) {
margin-right: 12px; margin-right: 12px;
} }
@ -521,7 +562,7 @@ export default {
background: #ccc; background: #ccc;
} }
.echarts__status-chart>div { .echarts__status-chart > div {
height: 100% !important; height: 100% !important;
width: 100% !important; width: 100% !important;
} }

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2023-11-10 16:26:08 * @LastEditTime: 2023-11-22 16:50:55
* @Description: * @Description:
--> -->
<template> <template>
@ -100,7 +100,8 @@ import {
updateProcessEquMaterialBom, updateProcessEquMaterialBom,
getEquipmentList, getEquipmentList,
processEquMaterialBomDetPage, processEquMaterialBomDetPage,
deleteProcessEquMaterialBomDet deleteProcessEquMaterialBomDet,
getMaterialCode
} from '@/api/extend/processEquMaterialBom'; } from '@/api/extend/processEquMaterialBom';
import SmallTitle from './SmallTitle'; import SmallTitle from './SmallTitle';
import { parseTime } from '../../core/mixins/code-filter'; import { parseTime } from '../../core/mixins/code-filter';
@ -197,7 +198,6 @@ export default {
}; };
}, },
mounted() { mounted() {
this.getDict()
}, },
methods: { methods: {
getCode(val) { getCode(val) {
@ -223,6 +223,9 @@ export default {
// console.log(response); // console.log(response);
this.equipmentList = res.data this.equipmentList = res.data
}) })
getMaterialCode().then(res => {
this.dataForm.code = res.data
})
}, },
handleClick(raw) { handleClick(raw) {
if (raw.type === 'delete') { if (raw.type === 'delete') {
@ -267,7 +270,8 @@ export default {
}); });
}, },
init(id, isdetail) { init(id, isdetail) {
this.initData(); this.initData()
this.getDict()
this.isdetail = isdetail || false; this.isdetail = isdetail || false;
this.dataForm.id = id || undefined; this.dataForm.id = id || undefined;
this.visible = true; this.visible = true;

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-11-08 15:30:27 * @Date: 2023-11-08 15:30:27
* @LastEditTime: 2023-11-09 14:11:02 * @LastEditTime: 2023-11-23 14:27:59
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -18,13 +18,16 @@
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px" <el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px"
@keyup.enter.native="dataFormSubmit()"> @keyup.enter.native="dataFormSubmit()">
<el-form-item label="物料名称" prop="materialId"> <el-form-item label="物料名称" prop="materialId">
<el-select v-model="dataForm.materialId" filterable placeholder="请选择物料名称"> <el-select v-model="dataForm.materialId" filterable placeholder="请选择物料名称" multiple>
<el-option v-for="dict in materialList" :key=" dict.id" :label="dict.name" :value="dict.id" /> <el-option v-for="dict in materialList" :key=" dict.id" :label="dict.name" :value="dict.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="数量" prop="num"> <el-form-item label="数量" prop="num">
<el-input v-model="dataForm.num" placeholder="请输入数量" clearable /> <el-input v-model="dataForm.num" placeholder="请输入数量" clearable />
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="请输入备注" clearable />
</el-form-item>
</el-form> </el-form>
<el-row style="text-align: right"> <el-row style="text-align: right">
@ -37,7 +40,7 @@
<script> <script>
import { import {
getProcessEquMaterialBomDet, getProcessEquMaterialBomDet,
createProcessEquMaterialBomDet, createProcessEquMaterialBomDetList,
updateProcessEquMaterialBomDet, updateProcessEquMaterialBomDet,
getMaterialList getMaterialList
} from '@/api/extend/processEquMaterialBom'; } from '@/api/extend/processEquMaterialBom';
@ -56,11 +59,13 @@ export default {
dataForm: { dataForm: {
id: undefined, id: undefined,
bomId: undefined, bomId: undefined,
materialId:null, materialId:[],
num: undefined, num: undefined,
remark:undefined
}, },
dataRule: { dataRule: {
attrName: [{ required: true, message: '名称不能为空', trigger: 'blur' }], materialId: [{ required: true, message: '名称不能为空', trigger: 'change' }],
num: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
}, },
}; };
}, },
@ -79,8 +84,11 @@ export default {
getProcessEquMaterialBomDet({ getProcessEquMaterialBomDet({
id: this.dataForm.id id: this.dataForm.id
}).then((res) => { }).then((res) => {
this.dataForm = res.data; this.dataForm = res.data
// this.dataForm.materialId = materialId; const arr = []
arr.push(res.data.materialId)
this.dataForm.materialId =arr
console.log(this.dataForm.materialId);
// this.dataForm.value = value; // this.dataForm.value = value;
}); });
} }
@ -97,10 +105,16 @@ export default {
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
if (valid) { if (valid) {
// //
if (this.dataForm.id) { if (this.dataForm.id) {
const dataObj = {
materialId: this.dataForm.materialId.toString(),
bomId: this.dataForm.bomId,
num: this.dataForm.num,
id: this.dataForm.id,
remark: this.dataForm.remark
}
updateProcessEquMaterialBomDet({ updateProcessEquMaterialBomDet({
...this.dataForm, ...dataObj
productId: this.productId,
}).then((response) => { }).then((response) => {
this.$modal.msgSuccess('修改成功'); this.$modal.msgSuccess('修改成功');
this.visible = false; this.visible = false;
@ -108,11 +122,16 @@ export default {
}); });
return; return;
} }
// //
createProcessEquMaterialBomDet({ const dataArr = this.dataForm.materialId.map(ele => {
...this.dataForm, return {
productId: this.productId, materialId: ele,
}).then((response) => { bomId: this.dataForm.bomId,
num: this.dataForm.num,
remark: this.dataForm.remark
}
});
createProcessEquMaterialBomDetList(dataArr).then((response) => {
this.$modal.msgSuccess('新增成功'); this.$modal.msgSuccess('新增成功');
this.visible = false; this.visible = false;
this.$emit('refreshDataList'); this.$emit('refreshDataList');

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2023-11-09 14:49:16 * @LastEditTime: 2023-11-23 09:20:12
* @Description: * @Description:
--> -->
<template> <template>
@ -53,7 +53,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div class="drawer-body__footer"> <div v-if="isdetail" class="drawer-body__footer">
<el-button style="" @click="goback()">取消</el-button> <el-button style="" @click="goback()">取消</el-button>
<el-button v-if="isdetail" type="primary" @click="goEdit()"> <el-button v-if="isdetail" type="primary" @click="goEdit()">
编辑 编辑
@ -63,7 +63,7 @@
<div class="attr-list" v-if="idAttrShow"> <div class="attr-list" v-if="idAttrShow">
<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true"> <small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
设备物料明细 设备参数
</small-title> </small-title>
<div v-if="!isdetail" class="action_btn"> <div v-if="!isdetail" class="action_btn">
@ -100,7 +100,8 @@ import {
updateProcessEquValueBom, updateProcessEquValueBom,
getEquipmentList, getEquipmentList,
processEquValueBomDetPage, processEquValueBomDetPage,
deleteProcessEquValueBomDet deleteProcessEquValueBomDet,
getValueCode
} from '@/api/extend/processEquValueBom'; } from '@/api/extend/processEquValueBom';
import SmallTitle from './SmallTitle'; import SmallTitle from './SmallTitle';
import { parseTime } from '../../core/mixins/code-filter'; import { parseTime } from '../../core/mixins/code-filter';
@ -208,7 +209,6 @@ export default {
}; };
}, },
mounted() { mounted() {
this.getDict()
}, },
methods: { methods: {
getCode(val) { getCode(val) {
@ -234,6 +234,9 @@ export default {
// console.log(response); // console.log(response);
this.equipmentList = res.data this.equipmentList = res.data
}) })
getValueCode().then(res => {
this.dataForm.code = res.data
})
}, },
handleClick(raw) { handleClick(raw) {
if (raw.type === 'delete') { if (raw.type === 'delete') {
@ -277,8 +280,9 @@ export default {
this.listQuery.total = response.data.total; this.listQuery.total = response.data.total;
}); });
}, },
init(id, isdetail) { init(id, isdetail) {
this.initData(); this.getDict()
this.initData()
console.log(isdetail); console.log(isdetail);
this.isdetail = isdetail || false; this.isdetail = isdetail || false;
this.dataForm.id = id || undefined; this.dataForm.id = id || undefined;

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-11-08 15:30:27 * @Date: 2023-11-08 15:30:27
* @LastEditTime: 2023-11-09 14:44:49 * @LastEditTime: 2023-11-23 14:26:54
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -18,19 +18,19 @@
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px" <el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px"
@keyup.enter.native="dataFormSubmit()"> @keyup.enter.native="dataFormSubmit()">
<el-form-item label="参数名称" prop="paramId"> <el-form-item label="参数名称" prop="paramId">
<el-select v-model="dataForm.paramId" filterable placeholder="参数名称" @change="getData"> <el-select v-model="dataForm.paramId" filterable placeholder="参数名称" @change="getData" multiple >
<el-option v-for="dict in materialList" :key=" dict.id" :label="dict.name" :value="dict.id" /> <el-option v-for="dict in materialList" :key=" dict.id" :label="dict.name" :value="dict.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item label="参数编码" prop="code"> <!-- <el-form-item label="参数编码" prop="code">
<el-input v-model="dataForm.code" placeholder="请输入参数编码" clearable /> <el-input v-model="dataForm.code" placeholder="请输入参数编码" clearable />
</el-form-item> --> </el-form-item> -->
<el-form-item label="标准最小值" prop="standardMinValue"> <!-- <el-form-item label="标准最小值" prop="standardMinValue">
<el-input v-model="dataForm.standardMinValue" placeholder="请输入标准最小值" clearable /> <el-input v-model="dataForm.standardMinValue" placeholder="请输入标准最小值" clearable />
</el-form-item> </el-form-item>
<el-form-item label="标准最大值" prop="standardMaxValue"> <el-form-item label="标准最大值" prop="standardMaxValue">
<el-input v-model="dataForm.standardMaxValue" placeholder="请输入标准最大值" clearable /> <el-input v-model="dataForm.standardMaxValue" placeholder="请输入标准最大值" clearable />
</el-form-item> </el-form-item> -->
<el-form-item label="工艺最小值" prop="minValue"> <el-form-item label="工艺最小值" prop="minValue">
<el-input v-model="dataForm.minValue" placeholder="请输入工艺最小值" clearable /> <el-input v-model="dataForm.minValue" placeholder="请输入工艺最小值" clearable />
</el-form-item> </el-form-item>
@ -55,7 +55,7 @@
<script> <script>
import { import {
getProcessEquValueBomDet, getProcessEquValueBomDet,
createProcessEquValueBomDet, createProcessEquValueBomDetList,
updateProcessEquValueBomDet, updateProcessEquValueBomDet,
getValueList getValueList
} from '@/api/extend/processEquValueBom'; } from '@/api/extend/processEquValueBom';
@ -74,7 +74,7 @@ export default {
dataForm: { dataForm: {
id: undefined, id: undefined,
bomId: undefined, bomId: undefined,
paramId:undefined, paramId:[],
minValue:undefined, minValue:undefined,
maxValue: undefined, maxValue: undefined,
defaultValue: undefined, defaultValue: undefined,
@ -117,6 +117,10 @@ export default {
id: this.dataForm.id id: this.dataForm.id
}).then((res) => { }).then((res) => {
this.dataForm = res.data; this.dataForm = res.data;
const arr = []
arr.push(res.data.paramId)
this.dataForm.paramId = arr
console.log(this.dataForm.paramId);
// this.dataForm.materialId = materialId; // this.dataForm.materialId = materialId;
// this.dataForm.value = value; // this.dataForm.value = value;
}); });
@ -137,22 +141,41 @@ export default {
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
if (valid) { if (valid) {
// //
if (this.dataForm.id) { if (this.dataForm.id) {
const dataObj = {
paramId: this.dataForm.paramId.toString(),
bomId: this.dataForm.bomId,
minValue: this.dataForm.minValue,
maxValue: this.dataForm.maxValue,
defaultValue: this.dataForm.defaultValue,
standardMinValue: this.dataForm.standardMinValue,
standardMaxValue: this.dataForm.standardMaxValue,
remark: this.dataForm.remark,
id: this.dataForm.id
}
updateProcessEquValueBomDet({ updateProcessEquValueBomDet({
...this.dataForm, ...dataObj,
productId: this.productId,
}).then((response) => { }).then((response) => {
this.$modal.msgSuccess('修改成功'); this.$modal.msgSuccess('修改成功');
this.visible = false; this.visible = false;
this.$emit('refreshDataList'); this.$emit('refreshDataList');
}); });
return; return;
} }
const dataArr = this.dataForm.paramId.map(ele => {
return {
paramId: ele,
bomId: this.dataForm.bomId,
minValue: this.dataForm.minValue,
maxValue: this.dataForm.maxValue,
defaultValue: this.dataForm.defaultValue,
standardMinValue: this.dataForm.standardMinValue,
standardMaxValue: this.dataForm.standardMaxValue,
remark: this.dataForm.remark
}
});
// //
createProcessEquValueBomDet({ createProcessEquValueBomDetList(dataArr).then((response) => {
...this.dataForm,
productId: this.productId,
}).then((response) => {
this.$modal.msgSuccess('新增成功'); this.$modal.msgSuccess('新增成功');
this.visible = false; this.visible = false;
this.$emit('refreshDataList'); this.$emit('refreshDataList');

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 14:55:51 * @Date: 2023-08-01 14:55:51
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2023-11-10 10:23:33 * @LastEditTime: 2023-11-22 14:23:40
* @Description: * @Description:
--> -->
<template> <template>
@ -70,7 +70,7 @@ const tableProps = [
}, },
{ {
prop: 'yield', prop: 'yield',
label: '成品率' label: '合格率'
} }
]; ];
@ -115,19 +115,19 @@ export default {
valueField: 'id', valueField: 'id',
param: 'orderName' param: 'orderName'
}, },
// { {
// type: 'datePicker', type: 'datePicker',
// label: '', label: '工单开始时间',
// dateType: 'daterange', dateType: 'daterange',
// format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
// valueFormat: "yyyy-MM-dd", valueFormat: "yyyy-MM-dd",
// rangeSeparator: '-', rangeSeparator: '-',
// startPlaceholder: '', startPlaceholder: '开始时间',
// endPlaceholder: '', endPlaceholder: '结束时间',
// param: 'timeVal', param: 'timeVal',
// defaultSelect: [], defaultSelect: [],
// width: 250 width: 250
// }, },
{ {
type: 'button', type: 'button',
btnName: '搜索', btnName: '搜索',
@ -238,13 +238,13 @@ export default {
if (val.btnName === 'search') { if (val.btnName === 'search') {
this.listQuery.orderName = val.orderName ? val.orderName :undefined this.listQuery.orderName = val.orderName ? val.orderName :undefined
// this.queryParams.status = val.status // this.queryParams.status = val.status
// if (val.timeVal && val.timeVal.length != 0 ) { if (val.timeVal && val.timeVal.length != 0 ) {
// this.listQuery.startTime = val.timeVal[0] + ' 00:00:00' this.listQuery.startTime = val.timeVal[0] + ' 00:00:00'
// this.listQuery.endTime = val.timeVal[1] + ' 23:59:59' this.listQuery.endTime = val.timeVal[1] + ' 23:59:59'
// } else { } else {
// this.listQuery.startTime = undefined this.listQuery.startTime = undefined
// this.listQuery.endTime = undefined this.listQuery.endTime = undefined
// } }
this.getList() this.getList()
} else { } else {
// this.handleExport() // this.handleExport()

View File

@ -156,7 +156,7 @@ export default {
} }
}) })
} else { } else {
createGroupClasses({ ...obj }).then((res) => { createGroupClasses({ ...this.form }).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.$modal.msgSuccess("操作成功"); this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit') this.$emit('successSubmit')

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<el-drawer :title="title" :visible.sync="visible" size="70%" @close='closeD'> <el-drawer :title="title" :visible.sync="visible" size="70%" @close='closeD' :show-close='false'>
<div class="box"> <div class="box">
<el-row class="topBox"> <el-row class="topBox">
<el-col :span="6"> <el-col :span="6">
@ -59,6 +59,7 @@
@cancel="handleCancel" @cancel="handleCancel"
@confirm="handleConfirm" @confirm="handleConfirm"
:before-close="handleCancel" :before-close="handleCancel"
width='40%'
> >
<worker-team-add ref="workerTeamAdd" @successSubmit="successSubmit" /> <worker-team-add ref="workerTeamAdd" @successSubmit="successSubmit" />
</base-dialog> </base-dialog>

View File

@ -38,6 +38,7 @@
@cancel="handleCancel" @cancel="handleCancel"
@confirm="handleConfirm" @confirm="handleConfirm"
:before-close="handleCancel" :before-close="handleCancel"
width='40%'
> >
<group-team-add ref="groupList" @successSubmit="successSubmit" /> <group-team-add ref="groupList" @successSubmit="successSubmit" />
</base-dialog> </base-dialog>
@ -50,15 +51,15 @@
import { getGroupTeamPage, deleteGroupTeam, updateGroupTeam } from "@/api/base/groupTeam"; import { getGroupTeamPage, deleteGroupTeam, updateGroupTeam } from "@/api/base/groupTeam";
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
import GroupTeamAdd from './components/groupTeamAdd' import GroupTeamAdd from './components/groupTeamAdd'
import StatusBtn from './components/statusBtn.vue' import StatusBtn from './components/statusBtn'
import WorkerOperate from './components/workerOperate.vue' import WorkerOperate from './components/workerOperate'
import WorkerEdit from './components/workerEdit.vue'; import WorkerEdit from './components/workerEdit'
const tableProps = [ const tableProps = [
{ {
prop: 'createTime', prop: 'createTime',
label: '创建时间', label: '创建时间',
filter: parseTime, filter: parseTime,
minWidth: 150 minWidth: 160
}, },
{ {
prop: 'name', prop: 'name',

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