Merge branch 'projects/mesxc-test' into projects/mesxc-dy
9
.env.dev
@ -1,12 +1,12 @@
|
||||
###
|
||||
# @Author: Do not edit
|
||||
# @Date: 2023-08-29 09:40:39
|
||||
# @LastEditTime: 2023-12-14 14:02:40
|
||||
# @LastEditors: DY
|
||||
# @LastEditTime: 2023-12-18 13:35:00
|
||||
# @LastEditors: zhp
|
||||
# @Description:
|
||||
###
|
||||
# 开发环境配置
|
||||
ENV = 'development'
|
||||
ENV = 'development'
|
||||
|
||||
# 页面标题
|
||||
VUE_APP_TITLE = MES系统
|
||||
@ -14,13 +14,14 @@ VUE_APP_TITLE = MES系统
|
||||
# 芋道管理系统/开发环境
|
||||
# VUE_APP_BASE_API = 'http://100.64.0.26:48082'
|
||||
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.78:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.4.173:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.49:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.8:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.4.159:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.56:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.62:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.78:48082'
|
||||
|
||||
# 积木报表指向地址
|
||||
VUE_APP_JIMU_API = 'http://192.168.0.33:48082'
|
||||
|
@ -15,7 +15,7 @@ VUE_APP_TITLE = MES系统
|
||||
VUE_APP_BASE_API = '/prod-api'
|
||||
|
||||
# 积木报表指向地址
|
||||
VUE_APP_JIMU_API = 'http://10.70.2.2:8080'
|
||||
VUE_APP_JIMU_API = 'http://10.70.2.22:8080'
|
||||
|
||||
|
||||
# 根据服务器或域名修改
|
||||
|
@ -2,7 +2,7 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2023-11-06 15:38:12
|
||||
* @LastEditTime: 2023-12-08 16:08:35
|
||||
* @LastEditTime: 2023-12-15 15:29:16
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
@ -99,3 +99,27 @@ export function getMaterialCheckList(query) {
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function createQualityHotMaterialDet(query){
|
||||
return request({
|
||||
url: '/base/quality-hot-material-det/create',
|
||||
method: 'post',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
||||
export function updateQualityHotMaterialDet(query){
|
||||
return request({
|
||||
url: '/base/quality-hot-material-det/listbyfilter',
|
||||
method: 'put',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getQualityHotMaterialDetList(query){
|
||||
return request({
|
||||
url: '/base/quality-hot-material-det/listbyfilter',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-04 14:10:37
|
||||
* @LastEditTime: 2023-12-13 16:03:46
|
||||
* @LastEditTime: 2023-12-14 10:06:03
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
@ -19,7 +19,7 @@ export function createQualityInspectionBoxBtn(data) {
|
||||
// 更新安灯按钮16键对应
|
||||
export function updateQualityInspectionBoxBtn(data) {
|
||||
return request({
|
||||
url: '/base/quality-inspection-box-btn/update',
|
||||
url: '/base/quality-inspection-box-btn/updateBatch',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
@ -44,7 +44,7 @@ export function getQualityInspectionBoxBtn(id) {
|
||||
// 获得安灯按钮16键对应分页
|
||||
export function getQualityInspectionBoxBtnPage(query) {
|
||||
return request({
|
||||
url: '/base/quality-inspection-box-btn/page',
|
||||
url: '/base/quality-inspection-box-btn/listGroupByLineSection',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:49:02
|
||||
* @LastEditTime: 2023-12-13 15:52:11
|
||||
* @LastEditTime: 2023-12-14 14:21:43
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
@ -39,3 +39,19 @@ export function getAutoDeliveDataList(query) {
|
||||
data: query,
|
||||
})
|
||||
}
|
||||
|
||||
export function updateAutoDeliveDataList(query) {
|
||||
return request({
|
||||
url: '/base/report-auto-delive/update',
|
||||
method: 'put',
|
||||
data: query,
|
||||
})
|
||||
}
|
||||
|
||||
export function updateSumAutoDeliveDataList(query) {
|
||||
return request({
|
||||
url: '/base/report-auto-delive/updatePlus',
|
||||
method: 'put',
|
||||
data: query,
|
||||
})
|
||||
}
|
||||
|
12
src/assets/icons/svg/menuIcon.svg
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>制度流程</title>
|
||||
<g id="页面" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="栏" transform="translate(-383.000000, -639.000000)" fill="#FFFFFF" fill-rule="nonzero">
|
||||
<g id="制度流程" transform="translate(383.000000, 639.000000)">
|
||||
<rect id="矩形" opacity="0" x="0" y="0" width="24" height="24"></rect>
|
||||
<path d="M4.37117174,17.071929 L2.37885068,17.071929 C2.0028361,17.071929 1.69692899,17.3771995 1.69692899,17.7524526 L1.69692899,19.7475474 C1.69692899,20.1227781 2.00283612,20.428071 2.37885068,20.428071 L4.37117174,20.428071 C4.74718632,20.428071 5.05307101,20.1228005 5.05307101,19.7475474 L5.05307101,17.7524526 C5.05307101,17.3771996 4.74718632,17.071929 4.37117174,17.071929 Z M7.36536289,6.40073051 L21.8846371,6.40073051 C22.2245029,6.40073051 22.5,6.06492662 22.5,5.65073051 C22.5,5.2365344 22.2245029,4.90073051 21.8846371,4.90073051 L7.36536289,4.90073051 C7.02549709,4.90073051 6.75,5.23653442 6.75,5.65073054 C6.75,6.06492665 7.02549711,6.40073051 7.36536289,6.40073051 Z M3.14077284,5.95492436 L2.03265569,4.84248673 C1.8767502,4.68597337 1.62348469,4.6854806 1.46697133,4.84138609 C1.4665023,4.8418533 1.46603442,4.84232168 1.46556772,4.84279121 L1.18448184,5.12557972 C1.0295067,5.28149361 1.02939503,5.5332514 1.1842318,5.6893027 L2.85590574,7.37408916 C3.01150401,7.53090793 3.26476807,7.53189735 3.42158685,7.37629907 C3.42263304,7.37526103 3.42367349,7.3742172 3.42470814,7.37316765 L5.7220224,5.04277966 C5.87599957,4.88658572 5.87547971,4.63552909 5.72085699,4.47997417 L5.4403523,4.19777835 C5.28461275,4.04109986 5.0313479,4.04033871 4.87466942,4.19607825 C4.87370895,4.19703297 4.87275333,4.19799256 4.8718026,4.19895698 L3.14077284,5.95492436 L3.14077284,5.95492436 Z M21.8846371,11.25 L7.36536289,11.25 C7.02549709,11.25 6.75,11.5857972 6.75,11.999985 C6.75,12.4141729 7.02552167,12.75 7.36536289,12.75 L21.8846371,12.75 C22.2245029,12.75 22.5,12.4142028 22.5,11.999985 C22.5,11.5857672 22.2245029,11.25 21.8846371,11.25 Z M21.8846371,17.972656 L7.36536289,17.972656 C7.02549709,17.972656 6.75,18.30843 6.75,18.722656 C6.75,19.1368821 7.02552167,19.472656 7.36536289,19.472656 L21.8846371,19.472656 C22.2245029,19.472656 22.5,19.1368821 22.5,18.722656 C22.5,18.30843 22.2245029,17.972656 21.8846371,17.972656 Z M4.37117174,10.321929 L2.37885068,10.321929 C2.0028361,10.321929 1.69692899,10.6271975 1.69692899,11.0024481 L1.69692899,12.9975519 C1.69692899,13.3727801 2.00283612,13.678071 2.37885068,13.678071 L4.37117174,13.678071 C4.74718632,13.678071 5.05307101,13.3728025 5.05307101,12.9975519 L5.05307101,11.0024481 C5.05307101,10.6271975 4.74718632,10.321929 4.37117174,10.321929 Z" id="形状"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.9 KiB |
1
src/assets/icons/svg/noStandards.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1702606455297" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1590" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><path d="M614.4 59.136l238.592 137.728a204.8 204.8 0 0 1 102.4 177.3568v275.5584a204.8 204.8 0 0 1-102.4 177.3568L614.4 964.864a204.8 204.8 0 0 1-204.8 0l-238.592-137.728a204.8 204.8 0 0 1-102.4-177.3568V374.2208a204.8 204.8 0 0 1 102.4-177.3568L409.6 59.136a204.8 204.8 0 0 1 204.8 0z" fill="#EE1609" p-id="1591"></path><path d="M471.04 261.9904v315.392a40.96 40.96 0 1 0 81.92 0v-315.392a40.96 40.96 0 1 0-81.92 0z" fill="#FFFFFF" p-id="1592"></path><path d="M512 706.56m-51.2 0a51.2 51.2 0 1 0 102.4 0 51.2 51.2 0 1 0-102.4 0Z" fill="#FFFFFF" p-id="1593"></path></svg>
|
After Width: | Height: | Size: 895 B |
1
src/assets/icons/svg/standards.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1702606467176" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1824" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><path d="M622.812817 29.238717l258.222014 146.7694A217.658893 217.658893 0 0 1 991.847648 365.004111v293.666761c0 77.991238-42.226593 150.032365-110.812817 188.995994l-258.222014 146.7694a224.568699 224.568699 0 0 1-221.625634 0l-258.222014-146.7694A217.658893 217.658893 0 0 1 32.152352 658.670872v-293.666761c0-77.991238 42.226593-150.032365 110.812817-188.995994L401.187183 29.238717a224.568699 224.568699 0 0 1 221.625634 0z" fill="#4AA468" p-id="1825"></path><path d="M448.852049 592.899754l-124.120591-140.883269a37.108218 37.108218 0 0 0-56.877941 1.087654 51.631607 51.631607 0 0 0-0.447858 65.067342l151.567877 172.105356c15.355125 17.466454 39.987304 18.042272 55.982226 1.407553l279.39929-290.403797a50.863851 50.863851 0 0 0 12.667978-44.529861 44.84976 44.84976 0 0 0-27.511265-34.67699 36.980259 36.980259 0 0 0-39.859345 10.17277l-250.800371 260.653242z" fill="#FFFFFF" p-id="1826"></path></svg>
|
After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 5.6 KiB |
BIN
src/assets/logo/logo1.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
src/assets/logo/xcac.png
Normal file
After Width: | Height: | Size: 1.2 MiB |
@ -139,7 +139,7 @@ $base1px: 0.15vh; // 1px / 1080px;
|
||||
|
||||
.title {
|
||||
margin: 0;
|
||||
margin-left: calc(28 * 0.12vh);
|
||||
margin-left: calc(18px * 0.12vh);
|
||||
font-weight: 400;
|
||||
user-select: none;
|
||||
color: #000;
|
||||
@ -148,8 +148,8 @@ $base1px: 0.15vh; // 1px / 1080px;
|
||||
letter-spacing: calc(2 * 0.12vh);
|
||||
|
||||
.cnbm_logo {
|
||||
height: calc(40 * 0.12vh);
|
||||
width: calc(40 * 0.12vh);
|
||||
height: calc(160 * 0.12vh);
|
||||
width: calc(182 * 0.12vh);
|
||||
position: relative;
|
||||
top: calc(8 * 0.12vh);
|
||||
right: calc(8 * 0.12vh);
|
||||
|
@ -86,8 +86,8 @@
|
||||
</span>
|
||||
<!-- :file-list="uploadedFileList" -->
|
||||
<el-upload
|
||||
class="upload-in-dialog"
|
||||
v-if="col.upload"
|
||||
class="upload-in-dialog"
|
||||
:key="col.prop + '__el-upload'"
|
||||
:action="uploadUrl"
|
||||
:headers="uploadHeaders"
|
||||
@ -101,7 +101,9 @@
|
||||
}
|
||||
"
|
||||
v-bind="col.bind">
|
||||
<el-button size="mini" :disabled="col.bind?.disabled || false">
|
||||
<el-button
|
||||
size="mini"
|
||||
:disabled="disabled || col.bind?.disabled || false">
|
||||
<svg-icon
|
||||
icon-class="icon-upload"
|
||||
style="color: inherit"></svg-icon>
|
||||
@ -117,6 +119,7 @@
|
||||
v-for="file in form[col.prop]"
|
||||
:file="file"
|
||||
:key="file.fileUrl"
|
||||
:disabled="disabled"
|
||||
@delete="!disabled && handleDeleteFile(file, col.prop)" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
@ -142,6 +145,9 @@ function findMaxLabelWidth(rows) {
|
||||
if (!opt.label) return 0;
|
||||
if (opt.label.length > max) {
|
||||
max = opt.label.length;
|
||||
if (opt.label.includes('(')) {
|
||||
max = max - 3;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -150,7 +156,7 @@ function findMaxLabelWidth(rows) {
|
||||
|
||||
const uploadedFile = {
|
||||
name: 'UploadedFile',
|
||||
props: ['file'],
|
||||
props: ['file', 'disabled'],
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
@ -195,13 +201,15 @@ const uploadedFile = {
|
||||
display: 'inline-block',
|
||||
}}>
|
||||
{this.file.fileName}
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-close"
|
||||
style="float: right; position: relative; top: 2px; left: 8px; z-index: 100"
|
||||
class="dialog__upload_component__close"
|
||||
onClick={this.handleDelete}
|
||||
/>
|
||||
{!this.disabled && (
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-close"
|
||||
style="float: right; position: relative; top: 2px; left: 8px; z-index: 100"
|
||||
class="dialog__upload_component__close"
|
||||
onClick={this.handleDelete}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
@ -404,8 +412,26 @@ export default {
|
||||
}
|
||||
if (!promiseList.length) this.formLoading = false;
|
||||
},
|
||||
|
||||
// 上传成功的特殊处理
|
||||
beforeUpload() {},
|
||||
beforeUpload(file) {
|
||||
const checkFileSize = () => {
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
if (!isLt2M) {
|
||||
this.$modal.msgError('上传文件大小不能超过 2MB!');
|
||||
}
|
||||
return isLt2M;
|
||||
};
|
||||
const checkFileType = () => {
|
||||
const isJPG =
|
||||
file.type === 'image/jpeg' ||
|
||||
file.type === 'image/png' ||
|
||||
file.type === 'image/jpg';
|
||||
return isJPG;
|
||||
};
|
||||
return checkFileSize() && checkFileType();
|
||||
},
|
||||
|
||||
// 上传前的验证规则可通过 bind 属性传入
|
||||
handleUploadSuccess(response, file, prop) {
|
||||
console.log('[handleUploadSuccess]', response, file, prop);
|
||||
|
@ -17,7 +17,9 @@ export default {
|
||||
const vnodes = []
|
||||
|
||||
if (icon) {
|
||||
vnodes.push(<svg-icon icon-class={icon}/>)
|
||||
vnodes.push(<svg-icon style="font-size: 18px;margin-right: 10px;vertical-align: middle;" icon-class={icon}/>)
|
||||
} else {
|
||||
vnodes.push(<span style="display: inline-block; width: 10px;"/>)
|
||||
}
|
||||
|
||||
if (title) {
|
||||
|
@ -15,7 +15,7 @@
|
||||
key="collapse"
|
||||
class="sidebar-logo-link"
|
||||
to="/">
|
||||
<img v-if="logo" :src="logo" class="sidebar-logo" />
|
||||
<img v-if="logo" :src="logo" class="sidebar-logo-close" />
|
||||
<h1
|
||||
v-else
|
||||
class="sidebar-title"
|
||||
@ -67,7 +67,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '中建材智能化院',
|
||||
title: '许昌安彩新能科技有限公司',
|
||||
logo: logoImg,
|
||||
};
|
||||
},
|
||||
@ -98,8 +98,8 @@ export default {
|
||||
width: 100%;
|
||||
|
||||
& .sidebar-logo {
|
||||
width: 32px;
|
||||
height: 40px;
|
||||
width: 67px;
|
||||
height: 24px;
|
||||
vertical-align: middle;
|
||||
margin-right: 12px;
|
||||
}
|
||||
@ -108,17 +108,23 @@ export default {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
line-height: 50px;
|
||||
font-size: 18px;
|
||||
letter-spacing: 1px;
|
||||
font-weight: 500;
|
||||
width: 147px;
|
||||
letter-spacing: 2px;
|
||||
font-size: 10px;
|
||||
font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
|
||||
&.collapse {
|
||||
.sidebar-logo {
|
||||
// .sidebar-logo {
|
||||
// margin-right: 0px;
|
||||
// }
|
||||
.sidebar-logo-close {
|
||||
width: 54px;
|
||||
height: 19px;
|
||||
vertical-align: middle;
|
||||
margin-right: 0px;
|
||||
}
|
||||
}
|
||||
|
@ -3,16 +3,16 @@
|
||||
<template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
|
||||
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)">
|
||||
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
|
||||
<item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" />
|
||||
<item icon="menuIcon" :title="onlyOneChild.meta.title" />
|
||||
</el-menu-item>
|
||||
</app-link>
|
||||
</template>
|
||||
|
||||
<el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body>
|
||||
<template slot="title">
|
||||
<item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
|
||||
<item v-if="item.meta" icon="menuIcon" :title="item.meta.title" />
|
||||
</template>
|
||||
<sidebar-item
|
||||
<sidebar-item-sub
|
||||
v-for="(child, index) in item.children"
|
||||
:key="child.path + index"
|
||||
:is-nest="true"
|
||||
@ -30,10 +30,11 @@ import { isExternal } from '@/utils/validate'
|
||||
import Item from './Item'
|
||||
import AppLink from './Link'
|
||||
import FixiOSBug from './FixiOSBug'
|
||||
import SidebarItemSub from './SidebarItemSub'
|
||||
|
||||
export default {
|
||||
name: 'SidebarItem',
|
||||
components: { Item, AppLink },
|
||||
components: { Item, AppLink, SidebarItemSub },
|
||||
mixins: [FixiOSBug],
|
||||
props: {
|
||||
// route object
|
||||
|
@ -3,16 +3,16 @@
|
||||
<template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
|
||||
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)">
|
||||
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
|
||||
<item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" />
|
||||
<item icon="" :title="onlyOneChild.meta.title" />
|
||||
</el-menu-item>
|
||||
</app-link>
|
||||
</template>
|
||||
|
||||
<el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body>
|
||||
<template slot="title">
|
||||
<item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
|
||||
<item v-if="item.meta" icon="" :title="item.meta.title" />
|
||||
</template>
|
||||
<sidebar-item
|
||||
<sidebar-item-sub
|
||||
v-for="(child, index) in item.children"
|
||||
:key="child.path + index"
|
||||
:is-nest="true"
|
||||
@ -32,7 +32,7 @@ import AppLink from './Link'
|
||||
import FixiOSBug from './FixiOSBug'
|
||||
|
||||
export default {
|
||||
name: 'SidebarItem',
|
||||
name: 'SidebarItemSub',
|
||||
components: { Item, AppLink },
|
||||
mixins: [FixiOSBug],
|
||||
props: {
|
@ -1,71 +0,0 @@
|
||||
<template>
|
||||
<div
|
||||
:class="{ 'has-logo': showLogo }"
|
||||
:style="{
|
||||
backgroundColor:
|
||||
settings.sideTheme === 'theme-dark'
|
||||
? variables.menuBackground
|
||||
: variables.menuLightBackground,
|
||||
}">
|
||||
<logo v-if="showLogo" :collapse="isCollapse" />
|
||||
<el-scrollbar :class="settings.sideTheme" wrap-class="scrollbar-wrapper">
|
||||
<el-menu
|
||||
:default-active="activeMenu"
|
||||
:collapse="isCollapse"
|
||||
:background-color="
|
||||
settings.sideTheme === 'theme-dark'
|
||||
? variables.menuBackground
|
||||
: variables.menuLightBackground
|
||||
"
|
||||
:text-color="
|
||||
settings.sideTheme === 'theme-dark'
|
||||
? variables.menuColor
|
||||
: variables.menuLightColor
|
||||
"
|
||||
:unique-opened="true"
|
||||
active-text-color="#fff"
|
||||
:collapse-transition="false"
|
||||
mode="vertical">
|
||||
<!-- 根据 sidebarRouters 路由,生成菜单 -->
|
||||
<sidebar-item
|
||||
v-for="(route, index) in sidebarRouters"
|
||||
:key="route.path + index"
|
||||
:item="route"
|
||||
:base-path="route.path" />
|
||||
</el-menu>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters, mapState } from 'vuex';
|
||||
import Logo from './Logo';
|
||||
import SidebarItem from './SidebarItem';
|
||||
import variables from '@/assets/styles/variables.scss';
|
||||
|
||||
export default {
|
||||
components: { SidebarItem, Logo },
|
||||
computed: {
|
||||
...mapState(['settings']),
|
||||
...mapGetters(['sidebarRouters', 'sidebar']),
|
||||
activeMenu() {
|
||||
const route = this.$route;
|
||||
const { meta, path } = route;
|
||||
// if set path, the sidebar will highlight the path you set
|
||||
if (meta.activeMenu) {
|
||||
return meta.activeMenu;
|
||||
}
|
||||
return path;
|
||||
},
|
||||
showLogo() {
|
||||
return this.$store.state.settings.sidebarLogo;
|
||||
},
|
||||
variables() {
|
||||
return variables;
|
||||
},
|
||||
isCollapse() {
|
||||
return !this.sidebar.opened;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
@ -28,10 +28,10 @@
|
||||
mode="vertical">
|
||||
<!-- 根据 sidebarRouters 路由,生成菜单 -->
|
||||
<sidebar-item
|
||||
v-for="(route, index) in routeList"
|
||||
v-for="(route, index) in routeList.children"
|
||||
:key="route.path + index"
|
||||
:item="route"
|
||||
:base-path="route.path" />
|
||||
:base-path="routeList.path+ '/'+ route.path" />
|
||||
</el-menu>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
@ -49,9 +49,7 @@ export default {
|
||||
...mapState(['settings']),
|
||||
...mapGetters(['sidebarRouters', 'sidebar', 'choicepart']),
|
||||
routeList() {
|
||||
// return [this.partList[this.choicepart]]
|
||||
// return [this.sidebarRouters[29]]
|
||||
return [this.sidebarRouters[this.choicepart]]
|
||||
return this.sidebarRouters[this.choicepart]
|
||||
},
|
||||
activeMenu() {
|
||||
const route = this.$route;
|
||||
|
@ -102,6 +102,7 @@ export const DICT_TYPE = {
|
||||
ORDER_ORIGIN: 'order_Origin',
|
||||
ORDER_PRIORITY: 'order_priority',
|
||||
PACK_SPEC: 'pack_spec',
|
||||
WORK_ORDER_STATUS: 'work_order_status',
|
||||
|
||||
// ============== EQUIPMENT - 设备模块 =============
|
||||
MAINTAIN_TYPE: 'maintain_type',
|
||||
|
@ -7,6 +7,8 @@
|
||||
}">
|
||||
<img src="../../assets/img/logo.png" style="width:1.1em;position:relative;top:.4em" alt="">
|
||||
许昌安彩冷端看板
|
||||
<h3 class="unit">单位:河南汇融科技服务有限公司</h3>
|
||||
<h3 class="time">{{ times }}</h3>
|
||||
<!-- <el-button type="text" class="title-button" :style="{ right: 33 + 'px', top: 37 + 'px' }"
|
||||
@click="changeFullScreen">
|
||||
<svg-icon v-if="isFullScreen" icon-class="unFullScreenView" />
|
||||
@ -616,6 +618,7 @@ export default {
|
||||
modelMonth: '',
|
||||
cplNameList,
|
||||
cplDataList,
|
||||
times:'',
|
||||
plInput: {},
|
||||
plOutput: {},
|
||||
plRate: {},
|
||||
@ -658,7 +661,7 @@ export default {
|
||||
this.windowWidth(document.documentElement.clientWidth)
|
||||
},
|
||||
mounted() {
|
||||
console.log(1111);
|
||||
this.getTimes()
|
||||
const _this = this;
|
||||
_this.beilv2 = document.documentElement.clientWidth / 1920
|
||||
window.onresize = () => {
|
||||
@ -685,6 +688,30 @@ export default {
|
||||
// removeEventListener('resize', resizeFun)
|
||||
// },
|
||||
methods: {
|
||||
getTimes() {
|
||||
setInterval(this.getTimesInterval, 1000);
|
||||
},
|
||||
getTimesInterval: function () {
|
||||
let _this = this;
|
||||
let year = new Date().getFullYear(); //获取当前时间的年份
|
||||
let month = new Date().getMonth() + 1; //获取当前时间的月份
|
||||
let day = new Date().getDate(); //获取当前时间的天数
|
||||
let hours = new Date().getHours(); //获取当前时间的小时
|
||||
let minutes = new Date().getMinutes(); //获取当前时间的分数
|
||||
let seconds = new Date().getSeconds(); //获取当前时间的秒数
|
||||
//当小于 10 的是时候,在前面加 0
|
||||
if (hours < 10) {
|
||||
hours = "0" + hours;
|
||||
}
|
||||
if (minutes < 10) {
|
||||
minutes = "0" + minutes;
|
||||
}
|
||||
if (seconds < 10) {
|
||||
seconds = "0" + seconds;
|
||||
}
|
||||
//拼接格式化当前时间
|
||||
this.times = year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
|
||||
},
|
||||
windowWidth(value) {
|
||||
this.clientWidth = value
|
||||
this.beilv2 = this.clientWidth / 1920
|
||||
@ -1010,7 +1037,18 @@ export default {
|
||||
background-size: 100% 100%;
|
||||
color: #00fff0;
|
||||
text-align: center;
|
||||
|
||||
.unit {
|
||||
position: absolute;
|
||||
left: 260px;
|
||||
top: 25px;
|
||||
font-size: 20px;
|
||||
}
|
||||
.time {
|
||||
position: absolute;
|
||||
left: 1360px;
|
||||
top: 25px;
|
||||
font-size: 20px;
|
||||
}
|
||||
.title-button {
|
||||
color: #00fff0;
|
||||
font-size: 20px;
|
||||
|
@ -2,21 +2,20 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-07-19 15:18:30
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-11-23 11:11:35
|
||||
* @LastEditTime: 2023-12-19 14:25:07
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div id="container" ref="container" class="visual-container" :style="styles">
|
||||
<el-row
|
||||
class="container-title"
|
||||
:style="{
|
||||
<el-row class="container-title" :style="{
|
||||
height: 88 + 'px',
|
||||
lineHeight: 88 + 'px',
|
||||
fontSize: 31 + 'px'
|
||||
}"
|
||||
>
|
||||
}">
|
||||
<img src="../../assets/img/logo.png" style="width:1.1em;position:relative;top:.4em" alt="">
|
||||
许昌安彩深加工看板
|
||||
<h3 class="unit">单位:河南汇融科技服务有限公司</h3>
|
||||
<h3 class="time">{{ times }}</h3>
|
||||
<!-- <el-button
|
||||
type="text"
|
||||
class="title-button"
|
||||
@ -30,14 +29,9 @@
|
||||
<el-row class="container-main flex-col" type="flex">
|
||||
<el-row :style="{ padding: '0 ' + 9 + 'px' }" :gutter="15" type="flex" class="flex-1">
|
||||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="8">
|
||||
<base-container :title="'设备报警'" :title-icon="'5_1'">
|
||||
<base-table1
|
||||
:page="1"
|
||||
:limit="9"
|
||||
:show-index="false"
|
||||
:table-config="qualityYearTableProps"
|
||||
:table-data="qualityYearList"
|
||||
/>
|
||||
<base-container :title="'设备报警'" :title-icon="'5_1'">
|
||||
<base-table1 :page="1" :limit="9" :show-index="false" :table-config="qualityYearTableProps"
|
||||
:table-data="qualityYearList" />
|
||||
</base-container>
|
||||
</el-col>
|
||||
|
||||
@ -48,19 +42,13 @@
|
||||
<el-option key="1" value="钢1线" label="钢1线" default />
|
||||
</el-select>
|
||||
</div>
|
||||
<base-table1
|
||||
:page="1"
|
||||
:limit="9"
|
||||
:show-index="false"
|
||||
|
||||
:table-config="qualityMonthTableProps"
|
||||
:table-data="qualityMonthList"
|
||||
/>
|
||||
<base-table1 :page="1" :limit="9" :show-index="false" :table-config="qualityMonthTableProps"
|
||||
:table-data="qualityMonthList" />
|
||||
</base-container>
|
||||
</el-col>
|
||||
|
||||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="8">
|
||||
<base-container :title="'设备监控'" :title-icon="'5_3'">
|
||||
<base-container :title="'设备监控'" :title-icon="'5_3'">
|
||||
<!-- <div style="width: 45%;position: absolute; top: 3em; right: 3em;">
|
||||
<top-radio-group />
|
||||
</div> -->
|
||||
@ -110,19 +98,13 @@
|
||||
|
||||
<el-row :style="{ padding: '0 ' + 9 + 'px' }" :gutter="12" type="flex" class="flex-1">
|
||||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="12">
|
||||
<base-container :height="256" :title="'能源监控'" :title-icon="'5_5'">
|
||||
<base-container :height="256" :title="'能源监控'" :title-icon="'5_5'">
|
||||
<div style="width: 45%;position: absolute; top: 3em; right: 3em;">
|
||||
<top-radio-group />
|
||||
</div>
|
||||
<el-row :gutter="9">
|
||||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="24">
|
||||
<linear-bar-chart
|
||||
:name-list="cxNameList"
|
||||
:data-list="cxDataList"
|
||||
:height="359"
|
||||
|
||||
:show-legend="true"
|
||||
/>
|
||||
<linear-bar-chart :name-list="cxNameList" :data-list="cxDataList" :height="359" :show-legend="true" />
|
||||
</el-col>
|
||||
<!-- <el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="12">
|
||||
<base-table3
|
||||
@ -137,19 +119,13 @@
|
||||
</base-container>
|
||||
</el-col>
|
||||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="12">
|
||||
<base-container :height="318 + 338 + 16" :title="'产线产量及良品率'" :title-icon="'5_4'">
|
||||
<base-container :height="318 + 338 + 16" :title="'产线产量及良品率'" :title-icon="'5_4'">
|
||||
<div style="width: 45%;position: absolute; top: 3em; right: 3em;">
|
||||
<top-radio-group />
|
||||
</div>
|
||||
<!-- 像下面这样表格里的limit值,也许可以用js动态计算出来 -->
|
||||
<double-y-chart
|
||||
:id=" 'doubleYChart' "
|
||||
:name-list="cxNameList"
|
||||
:data-list="cxDataList"
|
||||
:height="359"
|
||||
|
||||
:show-legend="true"
|
||||
/>
|
||||
<double-y-chart :id=" 'doubleYChart' " :name-list="cxNameList" :data-list="cxDataList" :height="359"
|
||||
:show-legend="true" />
|
||||
</base-container>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -685,6 +661,7 @@ export default {
|
||||
beilv2: 1,
|
||||
beilv: 1,
|
||||
value: 100,
|
||||
times:'',
|
||||
// offsetWidth: null,
|
||||
qualityYearTableProps,
|
||||
cxNameList,
|
||||
@ -742,6 +719,7 @@ export default {
|
||||
this.init()
|
||||
},
|
||||
mounted() {
|
||||
this.getTimes()
|
||||
this.windowWidth(document.documentElement.clientWidth)
|
||||
// const _this = this;
|
||||
// window.onresize = () => {
|
||||
@ -768,6 +746,30 @@ export default {
|
||||
// removeEventListener('resize', resizeFun)
|
||||
// },
|
||||
methods: {
|
||||
getTimes() {
|
||||
setInterval(this.getTimesInterval, 1000);
|
||||
},
|
||||
getTimesInterval: function () {
|
||||
let _this = this;
|
||||
let year = new Date().getFullYear(); //获取当前时间的年份
|
||||
let month = new Date().getMonth() + 1; //获取当前时间的月份
|
||||
let day = new Date().getDate(); //获取当前时间的天数
|
||||
let hours = new Date().getHours(); //获取当前时间的小时
|
||||
let minutes = new Date().getMinutes(); //获取当前时间的分数
|
||||
let seconds = new Date().getSeconds(); //获取当前时间的秒数
|
||||
//当小于 10 的是时候,在前面加 0
|
||||
if (hours < 10) {
|
||||
hours = "0" + hours;
|
||||
}
|
||||
if (minutes < 10) {
|
||||
minutes = "0" + minutes;
|
||||
}
|
||||
if (seconds < 10) {
|
||||
seconds = "0" + seconds;
|
||||
}
|
||||
//拼接格式化当前时间
|
||||
this.times = year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
|
||||
},
|
||||
windowWidth(value) {
|
||||
this.clientWidth = value
|
||||
this.beilv2 = this.clientWidth / 1920
|
||||
@ -838,7 +840,19 @@ export default {
|
||||
background-size: 100% 100%;
|
||||
color: #00fff0;
|
||||
text-align: center;
|
||||
.unit {
|
||||
position: absolute;
|
||||
left: 260px;
|
||||
top: 25px;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.time {
|
||||
position: absolute;
|
||||
left: 1360px;
|
||||
top: 25px;
|
||||
font-size: 20px;
|
||||
}
|
||||
.title-button {
|
||||
color: #00fff0;
|
||||
font-size: 20px;
|
||||
|
@ -268,7 +268,7 @@ export default {
|
||||
// })
|
||||
// } else {
|
||||
$('.hiprintEpContainer').empty()
|
||||
console.log(this.modelData);
|
||||
console.log(this.modelData || {});
|
||||
hiprint.PrintElementTypeManager.build('.hiprintEpContainer', provider.value)
|
||||
$('.hiprint-printTemplate').empty()
|
||||
// const templates = this.$ls.get('KEY_TEMPLATES', {})
|
||||
|
@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div class="navbar">
|
||||
<div style="color: #fff;font-size: 22px; float: left; letter-spacing: 1px; font-weight: 500; padding-left: 24px; marginTop: 13px">
|
||||
<img src="../../../assets/images/cnbm.png" style="width: 26px; height: 26px; position: relative; top: 6px; marginRight: 14px" alt="">
|
||||
MES
|
||||
<div style="color: #fff;font-size: 22px; float: left; letter-spacing: 2px; font-weight: 500; padding-left: 24px; marginTop: 13px">
|
||||
<img src="../../../assets/logo/logo.png" style="width: 79px; height: 28px; position: relative; top: 6px; marginRight: 14px" alt="">
|
||||
许昌安彩新能科技有限公司
|
||||
</div>
|
||||
<div style="padding-top: 15px; padding-right: 38px;">
|
||||
<navbar-right />
|
||||
|
@ -30,6 +30,7 @@ import {
|
||||
} from '@/api/cost/costEneryAutoReport';
|
||||
import { getEnergyTypeListAll } from '@/api/base/energyType';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import moment from 'moment';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
@ -79,9 +80,6 @@ export default {
|
||||
tableData: [],
|
||||
tableProps,
|
||||
drawerVisible: false,
|
||||
listQuery: {
|
||||
reportType: 2,
|
||||
},
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
@ -94,7 +92,6 @@ export default {
|
||||
],
|
||||
param: 'reportType',
|
||||
filterable: true,
|
||||
defaultSelect: 2, // 默认值
|
||||
clearable: false,
|
||||
},
|
||||
{
|
||||
@ -109,7 +106,7 @@ export default {
|
||||
label: '时间范围',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'timestamp',
|
||||
valueFormat: 'yyyy-MM-dd',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
@ -147,15 +144,25 @@ export default {
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.reportType = val.reportType;
|
||||
this.listQuery.energyTypeId = val.energyTypeId;
|
||||
this.listQuery.reportTime = val.searchTime ? val.searchTime : null;
|
||||
this.listQuery.reportTime = val.searchTime
|
||||
? [
|
||||
moment(val.searchTime[0]).startOf('day').format('x'),
|
||||
moment(val.searchTime[1]).endOf('day').format('x'),
|
||||
]
|
||||
: null;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'export':
|
||||
const data = {
|
||||
reportType: val.reportType,
|
||||
energyTypeId: val.energyTypeId,
|
||||
reportTime: val.searchTime ? val.searchTime : null
|
||||
}
|
||||
const data = {
|
||||
reportType: val.reportType,
|
||||
energyTypeId: val.energyTypeId,
|
||||
reportTime: val.searchTime
|
||||
? [
|
||||
moment(val.searchTime[0]).startOf('day').format('x'),
|
||||
moment(val.searchTime[1]).endOf('day').format('x'),
|
||||
]
|
||||
: null,
|
||||
};
|
||||
this.handleExport(data);
|
||||
break;
|
||||
default:
|
||||
|
@ -70,7 +70,7 @@ const tableProps = [
|
||||
},
|
||||
{
|
||||
prop: 'dailyUse',
|
||||
label: '单日消耗量(天)吨',
|
||||
label: '单日消耗量(吨)',
|
||||
width: 130,
|
||||
},
|
||||
{
|
||||
|
@ -30,6 +30,7 @@ import {
|
||||
} from '@/api/cost/costMaterialAutoReport';
|
||||
import { getHotMaterialList } from '@/api/base/coreHotMaterial';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import moment from 'moment';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
@ -87,7 +88,7 @@ export default {
|
||||
label: '时间范围',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'timestamp',
|
||||
valueFormat: 'yyyy-MM-dd',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
@ -140,8 +141,12 @@ export default {
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.materialId = val.materialId;
|
||||
this.listQuery.searchTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
|
||||
this.listQuery.startTime = val.searchTime
|
||||
? moment(val.searchTime[0]).startOf('day').format('x')
|
||||
: null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? moment(val.searchTime[1]).endOf('day').format('x')
|
||||
: null;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'export':
|
||||
|
@ -30,6 +30,7 @@ import {
|
||||
} from '@/api/cost/costMaterialAutoReport';
|
||||
import { getHotMaterialList } from '@/api/base/coreHotMaterial';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import moment from 'moment';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
@ -73,14 +74,11 @@ export default {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getCostMaterialAutoReportPage,
|
||||
exportURL: exportCostMaterialAutoReportExcel
|
||||
exportURL: exportCostMaterialAutoReportExcel,
|
||||
},
|
||||
tableData: [],
|
||||
tableProps,
|
||||
drawerVisible: false,
|
||||
listQuery: {
|
||||
reportType: 2,
|
||||
},
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
@ -93,7 +91,6 @@ export default {
|
||||
],
|
||||
param: 'reportType',
|
||||
filterable: true,
|
||||
defaultSelect: 2, // 默认值
|
||||
clearable: false,
|
||||
},
|
||||
{
|
||||
@ -108,7 +105,7 @@ export default {
|
||||
label: '时间范围',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'timestamp',
|
||||
valueFormat: 'yyyy-MM-dd',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
@ -146,13 +143,23 @@ export default {
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.reportType = val.reportType;
|
||||
this.listQuery.materialId = val.materialId;
|
||||
this.listQuery.times = val.searchTime ? val.searchTime : null;
|
||||
this.listQuery.times = val.searchTime
|
||||
? [
|
||||
moment(val.searchTime[0]).startOf('day').format('x'),
|
||||
moment(val.searchTime[1]).endOf('day').format('x'),
|
||||
]
|
||||
: null;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'export':
|
||||
this.listQuery.reportType = val.reportType;
|
||||
this.listQuery.materialId = val.materialId;
|
||||
this.listQuery.times = val.searchTime ? val.searchTime : null;
|
||||
this.listQuery.times = val.searchTime
|
||||
? [
|
||||
moment(val.searchTime[0]).startOf('day').format('x'),
|
||||
moment(val.searchTime[1]).endOf('day').format('x'),
|
||||
]
|
||||
: null;
|
||||
this.handleExport();
|
||||
break;
|
||||
default:
|
||||
|
BIN
src/views/databoard/assets/bg.png
Normal file
After Width: | Height: | Size: 2.7 MiB |
BIN
src/views/databoard/assets/flow.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
src/views/databoard/assets/full.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
src/views/databoard/assets/gas.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
src/views/databoard/assets/head.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
src/views/databoard/assets/high.png
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
src/views/databoard/assets/middle.png
Normal file
After Width: | Height: | Size: 49 KiB |
BIN
src/views/databoard/assets/middle2.png
Normal file
After Width: | Height: | Size: 49 KiB |
BIN
src/views/databoard/assets/move.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
src/views/databoard/assets/short.png
Normal file
After Width: | Height: | Size: 41 KiB |
97
src/views/databoard/components/Container.vue
Normal file
@ -0,0 +1,97 @@
|
||||
<!--
|
||||
filename: Container.vue
|
||||
author: liubin
|
||||
date: 2023-12-05 14:29:53
|
||||
description: 窑炉容器
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="kiln-container" :class="['kiln-container__' + size]">
|
||||
<div class="container-hd" style="display: flex; align-items: center">
|
||||
<i
|
||||
class=""
|
||||
style="display: inline-block; margin-left: 12px; padding-top: 4px">
|
||||
<img :src="imgSrc" width="18" height="16" alt="" />
|
||||
</i>
|
||||
<span
|
||||
style="
|
||||
color: #fff;
|
||||
font-size: 20px;
|
||||
line-height: 2;
|
||||
margin-left: 6px;
|
||||
display: inline-block;
|
||||
">
|
||||
{{ name }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="container-body">
|
||||
<slot>
|
||||
<div class="test-body">something test....</div>
|
||||
</slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'KilnContainer',
|
||||
components: {},
|
||||
props: ['name', 'width', 'size'],
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {
|
||||
imgSrc() {
|
||||
switch (this.name) {
|
||||
case '原料用量统计':
|
||||
return require('../assets/move.png');
|
||||
case '风机运行频率':
|
||||
return require('../assets/flow.png');
|
||||
case 'ISRA缺陷检测':
|
||||
return require('../assets/gas.png');
|
||||
case '能耗':
|
||||
return require('../assets/gas.png');
|
||||
case '窑炉信息':
|
||||
return require('../assets/gas.png');
|
||||
case '烟气处理':
|
||||
return require('../assets/gas.png');
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.kiln-container {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
|
||||
&__small {
|
||||
background: url(../assets/short.png) no-repeat;
|
||||
background-size: 100% 100%;
|
||||
background-position: 0 0;
|
||||
}
|
||||
|
||||
&__middle {
|
||||
background: url(../assets/middle.png) no-repeat;
|
||||
background-size: 100% 100%;
|
||||
background-position: 0 0;
|
||||
}
|
||||
|
||||
&__large {
|
||||
background: url(../assets/high.png) no-repeat;
|
||||
background-size: 100% 100%;
|
||||
background-position: 0 0;
|
||||
}
|
||||
}
|
||||
|
||||
.container-body {
|
||||
flex: 1;
|
||||
}
|
||||
</style>
|
84
src/views/databoard/components/DateBtnGroup.vue
Normal file
@ -0,0 +1,84 @@
|
||||
<!--
|
||||
filename: DateBtnGroup.vue
|
||||
author: liubin
|
||||
date: 2023-12-05 14:35:14
|
||||
description: 日期按钮组
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="date-btn-group">
|
||||
<button
|
||||
class="btn"
|
||||
:class="{ 'btn-active': active == '日' }"
|
||||
@click="handleClick('日')">
|
||||
日
|
||||
</button>
|
||||
<button
|
||||
class="btn"
|
||||
:class="{ 'btn-active': active == '周' }"
|
||||
@click="handleClick('周')">
|
||||
周
|
||||
</button>
|
||||
<button
|
||||
class="btn"
|
||||
:class="{ 'btn-active': active == '月' }"
|
||||
@click="handleClick('月')">
|
||||
月
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'DateBtnGroup',
|
||||
data() {
|
||||
return {
|
||||
active: '日',
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handleClick(v) {
|
||||
this.active = v;
|
||||
this.$emit('change', v);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
button {
|
||||
appearance: none;
|
||||
border: none;
|
||||
outline: none;
|
||||
background: none;
|
||||
padding: 6px 8px;
|
||||
}
|
||||
.date-btn-group {
|
||||
// position: absolute;
|
||||
// top: 40px;
|
||||
// right: 100px;
|
||||
// border: 1px solid #ccc;
|
||||
// padding: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.btn {
|
||||
cursor: pointer;
|
||||
border: 1px solid #11e8e4;
|
||||
border-radius: 4px;
|
||||
color: #11e8e4;
|
||||
transition: all 0.3s ease-in-out;
|
||||
|
||||
&:hover {
|
||||
background: #11e8e4;
|
||||
color: #013433;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-active {
|
||||
background: #11e8e4;
|
||||
color: #013433;
|
||||
}
|
||||
</style>
|
150
src/views/databoard/components/GasChart.vue
Normal file
@ -0,0 +1,150 @@
|
||||
<!--
|
||||
filename: GasChart.vue
|
||||
author: liubin
|
||||
date: 2023-12-12 10:53:49
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="gas-chart"></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as echarts from 'echarts';
|
||||
|
||||
export default {
|
||||
name: 'GasChart',
|
||||
components: {},
|
||||
props: {},
|
||||
data() {
|
||||
const colors = [
|
||||
'#12FFF5',
|
||||
'#2760FF',
|
||||
'#FFD160',
|
||||
'#E80091',
|
||||
'#8064ff',
|
||||
'#ff8a3b',
|
||||
'#8cd26d',
|
||||
'#2aa1ff',
|
||||
];
|
||||
return {
|
||||
chart: null,
|
||||
option: {
|
||||
color: colors,
|
||||
grid: { top: 32, right: 12, bottom: 20, left: 48 },
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: Array(7)
|
||||
.fill(1)
|
||||
.map((_, index) => {
|
||||
const today = new Date();
|
||||
const dtimestamp = today - index * 24 * 60 * 60 * 1000;
|
||||
return `${new Date(dtimestamp).getMonth() + 1}.${new Date(
|
||||
dtimestamp
|
||||
).getDate()}`;
|
||||
})
|
||||
.reverse(),
|
||||
axisLabel: {
|
||||
color: '#fff',
|
||||
fontSize: 12,
|
||||
},
|
||||
axisTick: { show: false },
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
width: 1,
|
||||
color: '#213259',
|
||||
},
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
name: '单位m³/h',
|
||||
nameTextStyle: {
|
||||
color: '#fff',
|
||||
fontSize: 10,
|
||||
align: 'right',
|
||||
},
|
||||
type: 'value',
|
||||
axisLabel: {
|
||||
color: '#fff',
|
||||
fontSize: 12,
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#213259',
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: '#213259a0',
|
||||
},
|
||||
},
|
||||
},
|
||||
series: [
|
||||
Array(7)
|
||||
.fill(1)
|
||||
.map((_) => Math.ceil(Math.random() * 100)),
|
||||
Array(7)
|
||||
.fill(1)
|
||||
.map((_) => Math.ceil(Math.random() * 100)),
|
||||
Array(7)
|
||||
.fill(1)
|
||||
.map((_) => Math.ceil(Math.random() * 100)),
|
||||
].map((v, i) => ({
|
||||
name: ['总量', '白班', '夜班'][i],
|
||||
data: v,
|
||||
type: 'line',
|
||||
symbol: 'circle',
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
// i % 8 避免超过8个数据时无颜色的问题
|
||||
{ offset: 0, color: colors[i % 8] + '40' },
|
||||
{ offset: 0.5, color: colors[i % 8] + '20' },
|
||||
{ offset: 1, color: colors[i % 8] + '00' },
|
||||
]),
|
||||
},
|
||||
})),
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
inject: ['resizeChart'],
|
||||
computed: {
|
||||
sidebarStatus() {
|
||||
return this.$store.state.app.sidebar.opened;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
sidebarStatus(val) {
|
||||
console.log('sidebarStatus', val);
|
||||
this.chart && this.chart.dispose();
|
||||
|
||||
setTimeout(() => {
|
||||
this.chart = echarts.init(this.$el);
|
||||
this.chart.setOption(this.option);
|
||||
}, 500);
|
||||
},
|
||||
// resizeChart(val) {
|
||||
// console.log('resizeChart', val);
|
||||
// val && this.chart && this.chart.resize();
|
||||
// },
|
||||
},
|
||||
mounted() {
|
||||
this.$el.addEventListener('resize', () => {
|
||||
console.log('resziing.....');
|
||||
});
|
||||
this.chart = echarts.init(this.$el);
|
||||
this.chart.setOption(this.option);
|
||||
},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.gas-chart {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
75
src/views/databoard/components/Header.vue
Normal file
@ -0,0 +1,75 @@
|
||||
<!--
|
||||
filename: Header.vue
|
||||
author: liubin
|
||||
date: 2023-12-05 14:30:46
|
||||
description: 顶部标题
|
||||
-->
|
||||
|
||||
<template>
|
||||
<header class="kiln-header">
|
||||
<h1
|
||||
style="
|
||||
font-size: 32px;
|
||||
margin-bottom: 36px;
|
||||
color: #0ee8e4;
|
||||
letter-spacing: 5px;
|
||||
">
|
||||
窑炉生产运行驾驶舱
|
||||
</h1>
|
||||
<!-- left: 312px; -->
|
||||
<div
|
||||
class="firm"
|
||||
style="
|
||||
position: absolute;
|
||||
bottom: 24px;
|
||||
left: 16.5vw;
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
letter-spacing: 1px;
|
||||
">
|
||||
单位: 河南汇融科技服务有限公司
|
||||
</div>
|
||||
<div
|
||||
class="datetime"
|
||||
style="
|
||||
position: absolute;
|
||||
bottom: 18px;
|
||||
right: 15.5vw;
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
letter-spacing: 1px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
">
|
||||
<DateBtnGroup />
|
||||
{{ new Date().toLocaleString() }}
|
||||
</div>
|
||||
</header>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DateBtnGroup from './DateBtnGroup.vue';
|
||||
export default {
|
||||
name: 'KilnHeader',
|
||||
components: { DateBtnGroup },
|
||||
props: {},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.kiln-header {
|
||||
background: url('../assets/head.png') no-repeat;
|
||||
height: 88px;
|
||||
background-size: 100%;
|
||||
background-position: 0 0;
|
||||
display: grid;
|
||||
place-content: center;
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
235
src/views/databoard/components/ISRAChart.vue
Normal file
@ -0,0 +1,235 @@
|
||||
<!--
|
||||
filename: ISRAChart.vue
|
||||
author: liubin
|
||||
date: 2023-12-12 09:05:25
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="isra-chart"></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as echarts from 'echarts';
|
||||
|
||||
export default {
|
||||
name: 'ISRAChart',
|
||||
components: {},
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
chart: null,
|
||||
option: {
|
||||
color: ['#2760ff', '#518eec', '#0ee8e4', '#ddb523'],
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
},
|
||||
title: {
|
||||
text: 11234,
|
||||
subtext: '总数',
|
||||
top: '43%',
|
||||
left: '49%',
|
||||
textAlign: 'center',
|
||||
textStyle: {
|
||||
fontSize: 32,
|
||||
lineHeight: 16,
|
||||
color: '#fff',
|
||||
},
|
||||
subtextStyle: {
|
||||
fontSize: 16,
|
||||
color: '#fff7',
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: 'Access From',
|
||||
type: 'pie',
|
||||
radius: ['60%', '85%'],
|
||||
avoidLabelOverlap: true,
|
||||
label: {
|
||||
show: true,
|
||||
position: 'outside',
|
||||
formatter: ({ dataIndex, percent }) => {
|
||||
// console.log(
|
||||
// ['#2760ff', '#518eec', '#0ee8e4', '#ddb523'][dataIndex % 4],
|
||||
// percent
|
||||
// );
|
||||
const styleName = ['a', 'b', 'c', 'd'][dataIndex % 4];
|
||||
return `{${styleName}|${percent}%}`;
|
||||
},
|
||||
rich: {
|
||||
a: {
|
||||
color: '#2760ff',
|
||||
fontSize: 18,
|
||||
borderWidth: 0,
|
||||
textBorderWidth: 0,
|
||||
},
|
||||
b: {
|
||||
color: '#518eec',
|
||||
fontSize: 18,
|
||||
borderWidth: 0,
|
||||
textBorderWidth: 0,
|
||||
},
|
||||
c: {
|
||||
color: '#0ee8e4',
|
||||
fontSize: 18,
|
||||
borderWidth: 0,
|
||||
textBorderWidth: 0,
|
||||
},
|
||||
d: {
|
||||
color: '#ddb523',
|
||||
fontSize: 18,
|
||||
borderWidth: 0,
|
||||
textBorderWidth: 0,
|
||||
},
|
||||
},
|
||||
},
|
||||
labelLine: {
|
||||
show: true,
|
||||
},
|
||||
itemStyle: {
|
||||
borderRadius: 12,
|
||||
// borderColor: 'transparent',
|
||||
// borderWidth: 20
|
||||
},
|
||||
data: [
|
||||
{
|
||||
value: 1048,
|
||||
name: '缺陷1',
|
||||
itemStyle: {
|
||||
color: {
|
||||
type: 'linear',
|
||||
x: 1,
|
||||
y: 1,
|
||||
x2: 0,
|
||||
y2: 0,
|
||||
colorStops: [
|
||||
{
|
||||
offset: 0,
|
||||
color: '#2760ff', // 0% 处的颜色
|
||||
},
|
||||
// {
|
||||
// offset: 0.6,
|
||||
// color: 'transparent', // 80% 处的颜色
|
||||
// },
|
||||
{
|
||||
offset: 1,
|
||||
color: '#2760ff33', // 100% 处的颜色
|
||||
},
|
||||
],
|
||||
global: false, // 缺省为 false
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
value: 735,
|
||||
name: '缺陷2',
|
||||
itemStyle: {
|
||||
color: {
|
||||
type: 'linear',
|
||||
x: 0,
|
||||
y: 0,
|
||||
x2: 1,
|
||||
y2: 0,
|
||||
colorStops: [
|
||||
{
|
||||
offset: 0,
|
||||
color: '#518eec', // 0% 处的颜色
|
||||
},
|
||||
// {
|
||||
// offset: 0.6,
|
||||
// color: 'transparent', // 80% 处的颜色
|
||||
// },
|
||||
{
|
||||
offset: 1,
|
||||
color: '#518eec33', // 100% 处的颜色
|
||||
},
|
||||
],
|
||||
global: false, // 缺省为 false
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
value: 580,
|
||||
name: '缺陷3',
|
||||
itemStyle: {
|
||||
color: {
|
||||
type: 'linear',
|
||||
x: 0,
|
||||
y: 0,
|
||||
x2: 1,
|
||||
y2: 1,
|
||||
colorStops: [
|
||||
{
|
||||
offset: 0,
|
||||
color: '#0ee8e4', // 0% 处的颜色
|
||||
},
|
||||
// {
|
||||
// offset: 0.6,
|
||||
// color: 'transparent', // 80% 处的颜色
|
||||
// },
|
||||
{
|
||||
offset: 1,
|
||||
color: '#0ee8e433', // 100% 处的颜色
|
||||
},
|
||||
],
|
||||
global: false, // 缺省为 false
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
value: 484,
|
||||
name: '缺陷4',
|
||||
itemStyle: {
|
||||
color: {
|
||||
type: 'linear',
|
||||
x: 1,
|
||||
y: 0,
|
||||
x2: 0,
|
||||
y2: 0,
|
||||
colorStops: [
|
||||
{
|
||||
offset: 0,
|
||||
color: '#ddb523', // 0% 处的颜色
|
||||
},
|
||||
// {
|
||||
// offset: 0.6,
|
||||
// color: 'transparent', // 70% 处的颜色
|
||||
// },
|
||||
{
|
||||
offset: 1,
|
||||
color: '#ddb52333', // 100% 处的颜色
|
||||
},
|
||||
],
|
||||
global: false, // 缺省为 false
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.initChart();
|
||||
},
|
||||
activated() {
|
||||
// this.initChart();
|
||||
},
|
||||
computed: {},
|
||||
methods: {
|
||||
initChart() {
|
||||
this.chart = echarts.init(this.$el);
|
||||
this.chart.setOption(this.option);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.isra-chart {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
69
src/views/databoard/components/SelectorBtnGroup.vue
Normal file
@ -0,0 +1,69 @@
|
||||
<!--
|
||||
filename: SelectorBtnGroup.vue
|
||||
author: liubin
|
||||
date: 2023-12-05 14:28:24
|
||||
description: 选项按钮组
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="selector-btn-group">
|
||||
<button
|
||||
class="btn"
|
||||
v-for="opt in options"
|
||||
:key="opt"
|
||||
@click="active = opt"
|
||||
:class="active == opt ? 'btn-active' : ''">
|
||||
{{ opt }}
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'SelectorBtnGroup',
|
||||
components: {},
|
||||
props: ['options'],
|
||||
data() {
|
||||
return {
|
||||
active: this.options[0] || 'default'
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
button {
|
||||
border: none;
|
||||
appearance: none;
|
||||
outline: none;
|
||||
color: red;
|
||||
font-size: 14px;
|
||||
padding: 8px 12px;
|
||||
}
|
||||
|
||||
button:first-child {
|
||||
border-top-left-radius: 8px;
|
||||
border-bottom-left-radius: 8px;
|
||||
}
|
||||
|
||||
button:last-child {
|
||||
border-top-right-radius: 8px;
|
||||
border-bottom-right-radius: 8px;
|
||||
}
|
||||
.selector-btn-group {
|
||||
}
|
||||
|
||||
.btn {
|
||||
background: #03233c;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease-out;
|
||||
|
||||
&.btn-active,
|
||||
&:hover {
|
||||
background: #0f3d5c;
|
||||
}
|
||||
}
|
||||
</style>
|
71
src/views/databoard/components/ShadowRect.vue
Normal file
@ -0,0 +1,71 @@
|
||||
<!--
|
||||
filename: ShadowRect.vue
|
||||
author: liubin
|
||||
date: 2023-12-05 14:28:57
|
||||
description: 阴影矩形
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="shadow-rect" :style="{ borderRadius: rounded ? '8px' : '2px' }">
|
||||
<slot>
|
||||
<div
|
||||
class="test-data"
|
||||
style="flex: 1; display: flex; align-items: center">
|
||||
<span
|
||||
style="
|
||||
flex: 7;
|
||||
color: #fff;
|
||||
text-align: right;
|
||||
font-size: 18px;
|
||||
line-height: 1.12;
|
||||
letter-spacing: 1px;
|
||||
padding-right: 12px;
|
||||
">
|
||||
窑炉压力碹顶加权
|
||||
</span>
|
||||
<span
|
||||
style="
|
||||
flex: 3;
|
||||
color: #fff;
|
||||
text-align: left;
|
||||
font-size: 18px;
|
||||
line-height: 1.12;
|
||||
padding-right: 8px;
|
||||
">
|
||||
92Kpa
|
||||
</span>
|
||||
</div>
|
||||
</slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: '',
|
||||
components: {},
|
||||
props: ['rounded'],
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
watch: {
|
||||
rounded(val) {
|
||||
if (val) {
|
||||
console.log('val', val);
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.shadow-rect {
|
||||
padding: 8px;
|
||||
border-radius: 2px;
|
||||
box-shadow: inset 0 0 8px 2px #ccc3;
|
||||
color: white;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
57
src/views/databoard/components/Switcher.vue
Normal file
@ -0,0 +1,57 @@
|
||||
<!--
|
||||
filename: Switcher.vue
|
||||
author: liubin
|
||||
date: 2023-12-05 14:29:29
|
||||
description: 开关
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="switcher" style="display: flex; align-items: center; gap: 12px">
|
||||
<el-switch v-model="value"></el-switch>
|
||||
<span style="color: #fff; font-size: 16px">{{ mode }}</span>
|
||||
;
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'Switcher',
|
||||
components: {},
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
value: true,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
mode() {
|
||||
return this.value ? '历史详情' : '实时数据';
|
||||
},
|
||||
},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.switcher {
|
||||
:deep(.el-switch__core) {
|
||||
border: none;
|
||||
background-color: #213d566b;
|
||||
|
||||
&::after {
|
||||
background-color: #02457e;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.is-checked) {
|
||||
.el-switch__core {
|
||||
border: none;
|
||||
background-color: #b4fffc;
|
||||
|
||||
&::after {
|
||||
background-color: #08d8cd;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
16
src/views/databoard/components/line.js
Normal file
@ -0,0 +1,16 @@
|
||||
export default {
|
||||
name: 'KilnLine',
|
||||
props: ['horizontal'],
|
||||
render: function (h) {
|
||||
return (
|
||||
<div
|
||||
class="line"
|
||||
style={{
|
||||
width: this.horizontal ? '100%' : '4px',
|
||||
height: this.horizontal ? '4px' : '100%',
|
||||
background:
|
||||
'radial-gradient(ellipse at center, #3CE7FF, #3CE7FF66, transparent, transparent)',
|
||||
}}></div>
|
||||
);
|
||||
},
|
||||
};
|
101
src/views/databoard/kiln/EnergeCost.vue
Normal file
@ -0,0 +1,101 @@
|
||||
<!--
|
||||
filename: MaterialCost.vue
|
||||
author: liubin
|
||||
date: 2023-12-06 09:09:27
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<Container name="能耗" size="middle" style="">
|
||||
<EnergeTop />
|
||||
<SplitLine :horizontal="true" />
|
||||
<div class="" style="flex: 2; padding: 8px">
|
||||
<div
|
||||
class="header-line"
|
||||
style="margin-bottom: 8px; display: flex; align-items: center">
|
||||
<h2 class="" style="margin: 0; color: #0ee8fe; margin-right: 12px">
|
||||
烟气趋势图
|
||||
</h2>
|
||||
<Switcher />
|
||||
<div>
|
||||
<span class="lgd lgd-total">总量</span>
|
||||
<!-- <span class="lgd lgd-day">白班</span>
|
||||
<span class="lgd lgd-night">夜班</span> -->
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="select-line"
|
||||
style="
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
">
|
||||
<SelectorBtnGroup
|
||||
:options="['氧气含量', '二氧化硫', '一氧化氢', '二氧化氢']" />
|
||||
<SelectorBtnGroup :options="['日', '周', '月', '年']" />
|
||||
</div>
|
||||
<div class="chart" style="height: 150px; margin-top: 8px;">
|
||||
<GasChart />
|
||||
</div>
|
||||
</div>
|
||||
</Container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Container from '../components/Container.vue';
|
||||
import ShadowRect from '../components/ShadowRect.vue';
|
||||
import SplitLine from '../components/line';
|
||||
import Switcher from '../components/Switcher.vue';
|
||||
import EnergeTop from './EnergeTop.vue';
|
||||
import GasChart from '../components/GasChart.vue';
|
||||
import SelectorBtnGroup from '../components/SelectorBtnGroup.vue';
|
||||
export default {
|
||||
name: 'EnergeCost',
|
||||
components: {
|
||||
Container,
|
||||
ShadowRect,
|
||||
SplitLine,
|
||||
Switcher,
|
||||
EnergeTop,
|
||||
GasChart,
|
||||
SelectorBtnGroup,
|
||||
},
|
||||
props: {},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.lgd {
|
||||
color: #fff;
|
||||
|
||||
&:not(:last-child) {
|
||||
margin-right: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.lgd::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
margin-right: 4px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.lgd.lgd-total::before {
|
||||
background-color: #ff9e00;
|
||||
}
|
||||
|
||||
.lgd.lgd-day::before {
|
||||
background-color: #08d8cd;
|
||||
}
|
||||
|
||||
.lgd.lgd-night::before {
|
||||
background-color: #0b58ff;
|
||||
}
|
||||
</style>
|
123
src/views/databoard/kiln/EnergeTop.vue
Normal file
@ -0,0 +1,123 @@
|
||||
<!--
|
||||
filename: EnergeTop.vue
|
||||
author: liubin
|
||||
date: 2023-12-11 09:31:41
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div
|
||||
class="energe-top"
|
||||
style="
|
||||
flex: 1;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
grid-template-rows: auto;
|
||||
gap: 8px;
|
||||
padding: 4px;
|
||||
">
|
||||
<ShadowRect
|
||||
style="grid-row: 1 / 3; flex-direction: column; justify-content: center">
|
||||
<span
|
||||
style="
|
||||
font-size: 16px;
|
||||
line-height: 1.55;
|
||||
text-align: right;
|
||||
padding-right: 8px;
|
||||
letter-spacing: 1px;
|
||||
">
|
||||
余热发电
|
||||
</span>
|
||||
<span
|
||||
style="
|
||||
font-size: 16px;
|
||||
line-height: 1.55;
|
||||
text-align: right;
|
||||
padding-right: 8px;
|
||||
letter-spacing: 1px;
|
||||
">
|
||||
1023kWh
|
||||
</span>
|
||||
</ShadowRect>
|
||||
|
||||
<ShadowRect>
|
||||
<div
|
||||
style="
|
||||
font-size: 16px;
|
||||
line-height: 1.25;
|
||||
flex: 1.2;
|
||||
text-align: right;
|
||||
padding-right: 8px;
|
||||
letter-spacing: 3px;
|
||||
">
|
||||
<p style="margin: 0; line-height: inherit">水耗量</p>
|
||||
</div>
|
||||
<span style="font-size: 16px; line-height: 1.24; flex: 1">32Km³</span>
|
||||
</ShadowRect>
|
||||
|
||||
<ShadowRect>
|
||||
<div
|
||||
style="
|
||||
font-size: 16px;
|
||||
line-height: 1.25;
|
||||
flex: 1.2;
|
||||
text-align: right;
|
||||
padding-right: 8px;
|
||||
letter-spacing: 3px;
|
||||
">
|
||||
<p style="margin: 0; line-height: inherit">天然气I</p>
|
||||
</div>
|
||||
<span style="font-size: 16px; line-height: 1.24; flex: 1">322Km³</span>
|
||||
</ShadowRect>
|
||||
|
||||
<ShadowRect>
|
||||
<div
|
||||
style="
|
||||
font-size: 16px;
|
||||
line-height: 1.25;
|
||||
flex: 1.2;
|
||||
text-align: right;
|
||||
padding-right: 8px;
|
||||
letter-spacing: 3px;
|
||||
">
|
||||
<p style="margin: 0; line-height: inherit">电耗量</p>
|
||||
</div>
|
||||
<span style="font-size: 16px; line-height: 1.24; flex: 1">132kWh</span>
|
||||
</ShadowRect>
|
||||
|
||||
<ShadowRect>
|
||||
<div
|
||||
style="
|
||||
font-size: 16px;
|
||||
line-height: 1.25;
|
||||
flex: 1.2;
|
||||
text-align: right;
|
||||
padding-right: 8px;
|
||||
letter-spacing: 3px;
|
||||
">
|
||||
<p style="margin: 0; line-height: inherit">天然气II</p>
|
||||
</div>
|
||||
<span style="font-size: 16px; line-height: 1.24; flex: 1">992Km³</span>
|
||||
</ShadowRect>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ShadowRect from '../components/ShadowRect.vue';
|
||||
|
||||
export default {
|
||||
name: 'EnergeTop',
|
||||
components: { ShadowRect },
|
||||
props: {},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.energe-top {
|
||||
}
|
||||
</style>
|
58
src/views/databoard/kiln/FanSequence.vue
Normal file
@ -0,0 +1,58 @@
|
||||
<!--
|
||||
filename: FanSequence.vue
|
||||
author: liubin
|
||||
date: 2023-12-06 09:40:51
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<Container name="风机运行频率" size="middle" style="">
|
||||
<div class="" style="position: absolute; top: 18px; left: 180px">
|
||||
<Switcher />
|
||||
</div>
|
||||
<div
|
||||
class="absolute"
|
||||
style="
|
||||
padding: 12px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
grid-auto-rows: auto;
|
||||
gap: 8px;
|
||||
">
|
||||
<ShadowRect v-for="n in 14" :key="n" :rounded="false">
|
||||
<span
|
||||
style="
|
||||
font-size: 16px;
|
||||
line-height: 1.24;
|
||||
flex: 1.2;
|
||||
text-align: right;
|
||||
padding-right: 8px;
|
||||
letter-spacing: 1px;
|
||||
">
|
||||
{{ n }}#风机
|
||||
</span>
|
||||
<span style="font-size: 16px; line-height: 1.24; flex: 1">
|
||||
{{ Math.floor(Math.random() * 100) }}Hz
|
||||
</span>
|
||||
</ShadowRect>
|
||||
</div>
|
||||
</Container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Container from '../components/Container.vue';
|
||||
import ShadowRect from '../components/ShadowRect.vue';
|
||||
import Switcher from '../components/Switcher.vue';
|
||||
export default {
|
||||
name: 'FanSequence',
|
||||
components: { Container, ShadowRect, Switcher },
|
||||
props: {},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
176
src/views/databoard/kiln/GasHandle.vue
Normal file
@ -0,0 +1,176 @@
|
||||
<!--
|
||||
filename: GasHandle.vue
|
||||
author: liubin
|
||||
date: 2023-12-11 09:02:40
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="gas-handle" style="flex: 2">
|
||||
<Container name="烟气处理" size="large" style="">
|
||||
<div
|
||||
class=""
|
||||
style="
|
||||
flex: 1;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
grid-template-rows: auto;
|
||||
gap: 8px;
|
||||
padding: 8px;
|
||||
">
|
||||
<ShadowRect>
|
||||
<span
|
||||
style="
|
||||
font-size: 16px;
|
||||
line-height: 1.24;
|
||||
flex: 1.2;
|
||||
text-align: right;
|
||||
padding-right: 8px;
|
||||
letter-spacing: 1px;
|
||||
">
|
||||
氧气含量
|
||||
</span>
|
||||
<span style="font-size: 16px; line-height: 1.24; flex: 1">82%</span>
|
||||
</ShadowRect>
|
||||
<ShadowRect>
|
||||
<div
|
||||
style="
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
flex: 1.2;
|
||||
text-align: right;
|
||||
padding-right: 8px;
|
||||
letter-spacing: 3px;
|
||||
">
|
||||
<p style="margin: 0; line-height: inherit">一氧化氮</p>
|
||||
<p style="margin: 0; line-height: inherit">排放浓度</p>
|
||||
</div>
|
||||
<span style="font-size: 16px; line-height: 1.24; flex: 1">82%</span>
|
||||
</ShadowRect>
|
||||
|
||||
<ShadowRect>
|
||||
<div
|
||||
style="
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
flex: 1.2;
|
||||
text-align: right;
|
||||
padding-right: 8px;
|
||||
letter-spacing: 3px;
|
||||
">
|
||||
<p style="margin: 0; line-height: inherit">二氧化硫</p>
|
||||
<p style="margin: 0; line-height: inherit">排放浓度</p>
|
||||
</div>
|
||||
<span style="font-size: 16px; line-height: 1.24; flex: 1">82%</span>
|
||||
</ShadowRect>
|
||||
|
||||
<ShadowRect>
|
||||
<div
|
||||
style="
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
flex: 1.2;
|
||||
text-align: right;
|
||||
padding-right: 8px;
|
||||
letter-spacing: 3px;
|
||||
">
|
||||
<p style="margin: 0; line-height: inherit">二氧化氮</p>
|
||||
<p style="margin: 0; line-height: inherit">排放浓度</p>
|
||||
</div>
|
||||
<span style="font-size: 16px; line-height: 1.24; flex: 1">82%</span>
|
||||
</ShadowRect>
|
||||
</div>
|
||||
<KilnLine :horizontal="true" />
|
||||
<div class="" style="flex: 2; padding: 8px">
|
||||
<div
|
||||
class="header-line"
|
||||
style="margin-bottom: 8px; display: flex; align-items: center">
|
||||
<h2 class="" style="margin: 0; color: #0ee8fe; margin-right: 12px">
|
||||
烟气趋势图
|
||||
</h2>
|
||||
<Switcher />
|
||||
<div>
|
||||
<span class="lgd lgd-total">总量</span>
|
||||
<span class="lgd lgd-day">白班</span>
|
||||
<span class="lgd lgd-night">夜班</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="select-line"
|
||||
style="
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
">
|
||||
<SelectorBtnGroup
|
||||
:options="['氧气含量', '二氧化硫', '一氧化氢', '二氧化氢']" />
|
||||
<SelectorBtnGroup :options="['日', '周', '月', '年']" />
|
||||
</div>
|
||||
<div class="chart" style="height: 220px">
|
||||
<GasChart />
|
||||
</div>
|
||||
</div>
|
||||
</Container>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Container from '../components/Container.vue';
|
||||
import ShadowRect from '../components/ShadowRect.vue';
|
||||
import KilnLine from '../components/line';
|
||||
import Switcher from '../components/Switcher.vue';
|
||||
import SelectorBtnGroup from '../components/SelectorBtnGroup.vue';
|
||||
import GasChart from '../components/GasChart.vue';
|
||||
|
||||
export default {
|
||||
name: 'GasHandle',
|
||||
components: {
|
||||
Container,
|
||||
ShadowRect,
|
||||
KilnLine,
|
||||
Switcher,
|
||||
SelectorBtnGroup,
|
||||
GasChart,
|
||||
},
|
||||
props: {},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.gas-handle {
|
||||
}
|
||||
|
||||
.lgd {
|
||||
color: #fff;
|
||||
|
||||
&:not(:last-child) {
|
||||
margin-right: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.lgd::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
margin-right: 4px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.lgd.lgd-total::before {
|
||||
background-color: #ff9e00;
|
||||
}
|
||||
|
||||
.lgd.lgd-day::before {
|
||||
background-color: #08d8cd;
|
||||
}
|
||||
|
||||
.lgd.lgd-night::before {
|
||||
background-color: #0b58ff;
|
||||
}
|
||||
</style>
|
84
src/views/databoard/kiln/IsraCheck.vue
Normal file
@ -0,0 +1,84 @@
|
||||
<!--
|
||||
filename: IsraCheck.vue
|
||||
author: liubin
|
||||
date: 2023-12-06 09:50:13
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<Container name="ISRA缺陷检测" size="middle" style="">
|
||||
<div style="padding: 12px; display: flex; flex-direction: column; gap: 8px; height: 100%;">
|
||||
<div class="f" style="flex: 9;">
|
||||
<ISRAChart />
|
||||
</div>
|
||||
<ul
|
||||
class="legend"
|
||||
style="
|
||||
flex: 1;
|
||||
padding: 8px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 20px;
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
">
|
||||
<li class="fault-1">缺陷1</li>
|
||||
<li class="fault-2">缺陷2</li>
|
||||
<li class="fault-3">缺陷3</li>
|
||||
<li class="fault-4">缺陷4</li>
|
||||
</ul>
|
||||
</div>
|
||||
</Container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Container from '../components/Container.vue';
|
||||
import ShadowRect from '../components/ShadowRect.vue';
|
||||
import ISRAChart from '../components/ISRAChart.vue';
|
||||
|
||||
export default {
|
||||
name: 'IsraCheck',
|
||||
components: { Container, ShadowRect, ISRAChart },
|
||||
props: {},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
ul,
|
||||
li {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
li::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background: #ccc;
|
||||
position: absolute;
|
||||
top: 30%;
|
||||
left: -12px;
|
||||
}
|
||||
|
||||
li.fault-1::before {
|
||||
background: #2760ff;
|
||||
}
|
||||
li.fault-2::before {
|
||||
background: #518eec;
|
||||
}
|
||||
li.fault-3::before {
|
||||
background: #0ee8e4;
|
||||
}
|
||||
li.fault-4::before {
|
||||
background: #ddb523;
|
||||
}
|
||||
</style>
|
71
src/views/databoard/kiln/KilnInfo.vue
Normal file
@ -0,0 +1,71 @@
|
||||
<!--
|
||||
filename: KilnInfo.vue
|
||||
author: liubin
|
||||
date: 2023-12-11 09:01:15
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="kiln-info" style="flex: 1">
|
||||
<Container name="窑炉信息" size="small" style="">
|
||||
<div
|
||||
class="absolute"
|
||||
style="
|
||||
padding: 12px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
grid-auto-rows: auto;
|
||||
gap: 8px;
|
||||
">
|
||||
<ShadowRect v-for="info in kilnInfo" :key="info.name" :rounded="false">
|
||||
<span
|
||||
style="
|
||||
font-size: 16px;
|
||||
line-height: 1.45;
|
||||
flex: 1.2;
|
||||
text-align: right;
|
||||
padding-right: 8px;
|
||||
letter-spacing: 1px;
|
||||
">
|
||||
{{ info.name }}
|
||||
</span>
|
||||
<span style="font-size: 16px; line-height: 1.45; flex: 1">
|
||||
{{ info.value }}
|
||||
<!-- {{ Math.floor(Math.random() * 100) }}Hz -->
|
||||
</span>
|
||||
</ShadowRect>
|
||||
</div>
|
||||
</Container>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Container from '../components/Container.vue';
|
||||
import ShadowRect from '../components/ShadowRect.vue';
|
||||
export default {
|
||||
name: 'KilnInfo',
|
||||
components: { Container, ShadowRect },
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
kilnInfo: [
|
||||
{ name: '窑炉压力', value: '83Kpa' },
|
||||
{ name: '循环水温度', value: '53℃' },
|
||||
{ name: '循环水流量', value: '23m³/h' },
|
||||
{ name: '循环水压力', value: '33Kpa' },
|
||||
{ name: '助燃风压力', value: '12Kpa' },
|
||||
{ name: '碹顶加权温度', value: '32℃' },
|
||||
{ name: '压缩气压力', value: '83Kpa' },
|
||||
{ name: '融化加权温度', value: '123℃' },
|
||||
],
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.kiln-info {
|
||||
}
|
||||
</style>
|
41
src/views/databoard/kiln/LeftFour.vue
Normal file
@ -0,0 +1,41 @@
|
||||
<!--
|
||||
filename: LeftFour.vue
|
||||
author: liubin
|
||||
date: 2023-12-06 09:35:30
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div
|
||||
class="left-four"
|
||||
style="
|
||||
display: grid;
|
||||
gap: 16px;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
grid-template-rows: 1fr 1fr;
|
||||
">
|
||||
<MaterialCost />
|
||||
<IsraCheck />
|
||||
<EnergeCost />
|
||||
<FanSequence />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MaterialCost from './MaterialCost.vue';
|
||||
import FanSequence from './FanSequence.vue';
|
||||
import IsraCheck from './IsraCheck.vue';
|
||||
import EnergeCost from './EnergeCost.vue';
|
||||
export default {
|
||||
name: 'LeftFour',
|
||||
components: { MaterialCost, EnergeCost, IsraCheck, FanSequence },
|
||||
props: {},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
58
src/views/databoard/kiln/MaterialCost.vue
Normal file
@ -0,0 +1,58 @@
|
||||
<!--
|
||||
filename: MaterialCost.vue
|
||||
author: liubin
|
||||
date: 2023-12-06 09:09:27
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<Container name="原料用量统计" size="middle" style="">
|
||||
<div
|
||||
class="absolute"
|
||||
style="
|
||||
padding: 12px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
grid-auto-rows: auto;
|
||||
gap: 8px;
|
||||
">
|
||||
<ShadowRect v-for="n in 9" :key="n" :rounded="false">
|
||||
<div
|
||||
class="material"
|
||||
style="
|
||||
flex: 1;
|
||||
padding: 6px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
">
|
||||
<span style="color: #0ee8e4; font-weight: 500; font-size: 32px">
|
||||
234
|
||||
</span>
|
||||
<span style="color: #fff; font-size: 14px; letter-spacing: 1px">
|
||||
- 原料1/吨 -
|
||||
</span>
|
||||
</div>
|
||||
</ShadowRect>
|
||||
</div>
|
||||
</Container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Container from '../components/Container.vue';
|
||||
import ShadowRect from '../components/ShadowRect.vue';
|
||||
export default {
|
||||
name: 'MaterialCost',
|
||||
components: { Container, ShadowRect },
|
||||
props: {},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
37
src/views/databoard/kiln/RightTwo.vue
Normal file
@ -0,0 +1,37 @@
|
||||
<!--
|
||||
filename: RightTwo.vue
|
||||
author: liubin
|
||||
date: 2023-12-06 10:19:00
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div
|
||||
class="right-two"
|
||||
style="display: flex; gap: 16px; flex-direction: column">
|
||||
<KilnInfo />
|
||||
<GasHandle />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Container from '../components/Container.vue';
|
||||
import ShadowRect from '../components/ShadowRect.vue';
|
||||
import KilnLine from '../components/line';
|
||||
import Switcher from '../components/Switcher.vue';
|
||||
import SelectorBtnGroup from '../components/SelectorBtnGroup.vue';
|
||||
import KilnInfo from './KilnInfo.vue';
|
||||
import GasHandle from './GasHandle.vue';
|
||||
export default {
|
||||
name: 'RightTwo',
|
||||
components: { Container, Switcher, SelectorBtnGroup, KilnLine, ShadowRect, KilnInfo, GasHandle },
|
||||
props: {},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
70
src/views/databoard/kiln/index.vue
Normal file
@ -0,0 +1,70 @@
|
||||
<!--
|
||||
filename: KilnDataBoard.vue
|
||||
author: liubin
|
||||
date: 2023-12-04 16:51:00
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div
|
||||
class="KilnDataBoard"
|
||||
style="
|
||||
position: absolute;
|
||||
top: -8px;
|
||||
left: -16px;
|
||||
width: calc(100% + 28px);
|
||||
height: calc(100% + 38px);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
">
|
||||
<KHeader />
|
||||
<div
|
||||
class="main-body"
|
||||
style="flex: 1; display: flex; gap: 16px; padding: 8px 16px">
|
||||
<div class="left-side" style="flex: 2">
|
||||
<LeftFour />
|
||||
</div>
|
||||
<div class="right-side" style="flex: 1">
|
||||
<RightTwo />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import KHeader from '../components/Header.vue';
|
||||
import LeftFour from './LeftFour.vue';
|
||||
import RightTwo from './RightTwo.vue';
|
||||
|
||||
export default {
|
||||
name: 'KilnDataBoard',
|
||||
components: {
|
||||
KHeader,
|
||||
LeftFour,
|
||||
RightTwo,
|
||||
},
|
||||
// provide() {
|
||||
// return {
|
||||
// resizeChart: null,
|
||||
// };
|
||||
// },
|
||||
mounted() {
|
||||
// this.$el.addEventListener('resize', () => {
|
||||
// console.log('resizzzze...')
|
||||
// this.resizeChart = Math.random();
|
||||
// });
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.KilnDataBoard {
|
||||
background: url(../assets/bg.png) no-repeat;
|
||||
background-size: cover;
|
||||
background-position: 0 0;
|
||||
}
|
||||
</style>
|
@ -106,7 +106,7 @@ export default {
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间',
|
||||
label: '抄表日期',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: "timestamp",
|
||||
|
@ -118,8 +118,8 @@ export default {
|
||||
type: '',
|
||||
plcParamId: '',
|
||||
limitType: '',
|
||||
minValue: null,
|
||||
maxValue: null
|
||||
minValue: 0,
|
||||
maxValue: 0
|
||||
},
|
||||
objIds: [],// 回显数组
|
||||
isEdit: false, //是否是编辑
|
||||
@ -239,7 +239,8 @@ export default {
|
||||
return false
|
||||
}
|
||||
}
|
||||
// this.form.limitType = Number(this.form.limitType)
|
||||
this.form.minValue = this.form.minValue || 0
|
||||
this.form.maxValue = this.form.maxValue || 0
|
||||
if (this.isEdit) {
|
||||
// 编辑
|
||||
updateEnergyLimit({...this.form}).then((res) => {
|
||||
|
@ -116,7 +116,7 @@
|
||||
style="position: absolute; top: -40px; right: 0">
|
||||
<el-button @click="handleAddAttr" type="text">
|
||||
<i class="el-icon-plus"></i>
|
||||
添加属性
|
||||
添加参数
|
||||
</el-button>
|
||||
</div>
|
||||
<base-table
|
||||
|
@ -116,7 +116,16 @@ export default {
|
||||
getGroupClasses(id).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.form = res.data
|
||||
this.form.disableTime = res.data.disableTime || ''
|
||||
this.form.name = res.data.name
|
||||
this.form.code = res.data.code
|
||||
this.form.enableTime = res.data.enableTime
|
||||
// this.form.disableTime = res.data.disableTime || null
|
||||
this.$set(this.form, 'disableTime', res.data.disableTime || null)
|
||||
this.form.startTime = res.data.startTime
|
||||
this.form.endTime = res.data.endTime
|
||||
this.form.daySpan = res.data.daySpan
|
||||
this.form.remark = res.data.remark
|
||||
console.log(this.form)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
@ -44,7 +44,7 @@
|
||||
border-radius: 100%;
|
||||
background: #26b9de;
|
||||
"></span>
|
||||
MES
|
||||
向世界先进水平挑战,为人类社会文明做贡献
|
||||
</p>
|
||||
</div>
|
||||
<video
|
||||
@ -64,18 +64,18 @@
|
||||
<div class="field">
|
||||
<!-- [移动端]标题 -->
|
||||
<h2 class="mobile-title">
|
||||
<h3 class="title">中建材智能自动化研究院有限公司</h3>
|
||||
<h3 class="title">许昌安彩新能科技有限公司</h3>
|
||||
</h2>
|
||||
<h2 class="pc-title" style="">
|
||||
<h3 class="title" style="">
|
||||
<h3 class="title" style="display: flex; flex-direction: column; align-items: center;">
|
||||
<img
|
||||
src="../assets/logo/cnbm.png"
|
||||
src="../assets/logo/xcac.png"
|
||||
alt="cnbm_logo"
|
||||
style=""
|
||||
class="cnbm_logo" />
|
||||
<span>中建材智能自动化研究院有限公司</span>
|
||||
<span>许昌安彩新能科技有限公司</span>
|
||||
</h3>
|
||||
<h3 class="sub-title" style="">MES</h3>
|
||||
<!-- <h3 class="sub-title" style="">向世界先进水平挑战,为人类社会文明做贡献</h3> -->
|
||||
</h2>
|
||||
|
||||
<!-- 表单 -->
|
||||
@ -166,7 +166,7 @@
|
||||
|
||||
<!-- footer -->
|
||||
<div class="footer">
|
||||
Copyright © 2023 中建材智能自动化院 All Rights Reserved.
|
||||
Copyright © 2023 中建材智能自动化研究院有限公司 All Rights Reserved.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -165,7 +165,7 @@ const tableProps1 = [
|
||||
{
|
||||
prop: 'status',
|
||||
label: '状态',
|
||||
filter: publicFormatter('order_status')
|
||||
filter: publicFormatter('work_order_status')
|
||||
},
|
||||
{
|
||||
prop: 'startProduceTime',
|
||||
|
@ -22,7 +22,7 @@
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="140"
|
||||
:width="100"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
@ -190,24 +190,24 @@ export default {
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-completion-monitoring:sendOut')
|
||||
? {
|
||||
type: 'sendOutDetail',
|
||||
btnName: '发货',
|
||||
showTip: '发货详情',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'more',
|
||||
name: 'workOrderNum',
|
||||
value: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
: undefined
|
||||
// this.$auth.hasPermi('base:order-completion-monitoring:sendOut')
|
||||
// ? {
|
||||
// type: 'sendOutDetail',
|
||||
// btnName: '发货',
|
||||
// showTip: '发货详情',
|
||||
// showParam: {
|
||||
// type: '&',
|
||||
// data: [
|
||||
// {
|
||||
// type: 'more',
|
||||
// name: 'workOrderNum',
|
||||
// value: 1
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// }
|
||||
// : undefined
|
||||
].filter((v) => v),
|
||||
chartList: []
|
||||
}
|
||||
|
@ -142,7 +142,9 @@ export default {
|
||||
console.log(obj);
|
||||
this.visible = true;
|
||||
// if(obj.id)
|
||||
this.dataForm.id = obj.id ? obj.id : ""
|
||||
if (obj) {
|
||||
this.dataForm.id = obj.id ? obj.id : ""
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs["dataForm"].resetFields()
|
||||
if (obj) {
|
||||
|
@ -10,8 +10,8 @@
|
||||
</base-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
<!-- <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
|
||||
@pagination="getDataList" /> -->
|
||||
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="addOrUpdateVisible" width="50%" @cancel="handleCancel"
|
||||
@ -168,7 +168,10 @@ export default {
|
||||
case 'add':
|
||||
this.addOrEditTitle = '新增';
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle();
|
||||
// this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init();
|
||||
});
|
||||
break;
|
||||
case 'export':
|
||||
this.handleExport();
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2022-08-24 11:19:43
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-12-13 16:19:04
|
||||
* @LastEditTime: 2023-12-14 09:36:05
|
||||
* @Description:
|
||||
*/
|
||||
export default {
|
||||
@ -54,10 +54,10 @@ export default {
|
||||
this.getDataList();
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle(id) {
|
||||
addOrUpdateHandle() {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id);
|
||||
this.$refs.addOrUpdate.init();
|
||||
});
|
||||
},
|
||||
cancel(id) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-08 13:46:17
|
||||
* @LastEditTime: 2023-12-08 16:09:13
|
||||
* @LastEditTime: 2023-12-15 16:12:08
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -13,26 +13,28 @@
|
||||
<div class="content">
|
||||
<!-- <div class="visual-part"> -->
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
|
||||
label-width="100px" label-position="top">
|
||||
label-width="auto">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商" prop="supplierId">
|
||||
<el-select v-model="dataForm.supplierId" filterable :disabled="isdetail" style="width: 100%"
|
||||
placeholder="请选择供应商">
|
||||
<el-form-item label="供应商" prop="supplierId"
|
||||
:rules="[{ required: true, message: '供应商不能为空', trigger: 'change' }]">
|
||||
<el-select v-model="dataForm.supplierId" filterable :disabled="isdetail" placeholder="请选择供应商">
|
||||
<el-option v-for="dict in supplierList" :key=" dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="原料" prop="materialId">
|
||||
<el-select v-model="dataForm.materialId" filterable :disabled="isdetail" style="width: 100%"
|
||||
@change="getData" placeholder="请选择原料">
|
||||
<el-form-item label="原料" prop="materialId"
|
||||
:rules="[{ required: true, message: '原料不能为空', trigger: 'change' }]">
|
||||
<el-select v-model="dataForm.materialId" filterable :disabled="isdetail" @change="getData"
|
||||
placeholder="请选择原料">
|
||||
<el-option v-for="dict in materialList" :key=" dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="样品编码" prop="sampleCode">
|
||||
<el-form-item label="样品编码" prop="sampleCode"
|
||||
:rules="[{ required: true, message: '样品编号不能为空', trigger: 'blur' }]">
|
||||
<el-input v-model="dataForm.sampleCode" clearable :disabled="isdetail" placeholder="请输入样品编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -40,28 +42,79 @@
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="取样人" prop="samplerId">
|
||||
<el-select v-model="dataForm.samplerId" filterable :disabled="isdetail" style="width: 100%"
|
||||
placeholder="请选择取样人">
|
||||
<el-select v-model="dataForm.samplerId" filterable :disabled="isdetail" placeholder="请选择取样人">
|
||||
<el-option v-for="dict in workerList" :key=" dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="检测人" prop="checkerId">
|
||||
<el-select v-model="dataForm.checkerId" filterable :disabled="isdetail" style="width: 100%"
|
||||
placeholder="请选择检测人">
|
||||
<el-form-item label="检测人" prop="checkerId"
|
||||
:rules="[{ required: true, message: '检测人不能为空', trigger: 'change' }]">
|
||||
<el-select v-model="dataForm.checkerId" filterable :disabled="isdetail" placeholder="请选择检测人">
|
||||
<el-option v-for="dict in workerList" :key=" dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="检测时间" prop="checkTime">
|
||||
<el-form-item label="检测时间" prop="checkTime"
|
||||
:rules="[{ required: true, message: '检测时间不能为空', trigger: 'change' }]">
|
||||
<el-date-picker v-model="dataForm.checkTime" type="datetime" placeholder="选择检测时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-divider content-position="center">检测结果</el-divider>
|
||||
<el-row :gutter="24">
|
||||
<el-form-item label="外观合格" prop="appearance">
|
||||
<el-radio :disabled="isdetail" v-model="dataForm.appearance" :label="true">合格</el-radio>
|
||||
<el-radio :disabled="isdetail" v-model="dataForm.appearance" :label="false">不合格</el-radio>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row :gutter="24" v-for="(item,index) in ingredientList" :key="item.id">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="成分">
|
||||
{{ item.name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item :prop="'checkValueList.' + index + '.checkValue'" label="成分含量"
|
||||
:rules="[{ required: true, message: '成分含量不能为空', trigger: 'blur' }]">
|
||||
<el-input :disabled="isdetail" style="width: 90%;margin-right: 10px;" :max="item.maxValue"
|
||||
:min='item.minValue' v-model="dataForm.checkValueList[index].checkValue"
|
||||
@change="judgeValue(arguments[0],item.minValue,item.maxValue,index)"></el-input>
|
||||
<span v-if="dataForm.checkValueList[index].showIcon">
|
||||
<!-- <i class="el-icon-success"></i> -->
|
||||
<svg-icon v-if="dataForm.checkValueList[index].isStandard" icon-class="standards" />
|
||||
<svg-icon v-else icon-class="noStandards" />
|
||||
</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="判断结果" prop="checkResult">
|
||||
<el-select :disabled="isdetail" v-model="dataForm.checkResult" placeholder="请选择">
|
||||
<el-option v-for="item in checkResultList" :key="item.id" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="原料等级" prop="materialGrade">
|
||||
<el-select :disabled="isdetail" v-model="dataForm.materialGrade" placeholder="请选择" style="width: 100%;">
|
||||
<el-option v-for="item in gradeList" :key="item.value" :label="item.label" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input :disabled="isdetail" v-model="dataForm.remark" placeholder="请填写备注" style="width: 100%;">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- </div> -->
|
||||
<div class="attr-list" v-if="idAttrShow">
|
||||
<!-- <small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
|
||||
@ -101,9 +154,15 @@ import {
|
||||
getHotMaterialAllList,
|
||||
getSupplierList,
|
||||
getWorkerList,
|
||||
getMaterialCheckList
|
||||
getMaterialCheckList,
|
||||
createQualityHotMaterialDet,
|
||||
updateQualityHotMaterialDet,
|
||||
getQualityHotMaterialDetList
|
||||
} from '@/api/base/qualityHotMaterial';
|
||||
import SmallTitle from './SmallTitle';
|
||||
import { DICT_TYPE, getDictDatas } from "@/utils/dict";
|
||||
import { create } from 'domain';
|
||||
|
||||
// import { parseTime } from '../../core/mixins/code-filter';
|
||||
// import attrAdd from './attr-add';
|
||||
// import {DICT_TYPE, getDictDatas} from "@/utils/dict";
|
||||
@ -130,7 +189,17 @@ export default {
|
||||
createURL: createQualityHotMaterial,
|
||||
updateURL: updateQualityHotMaterial,
|
||||
infoURL: getQualityHotMaterial,
|
||||
},
|
||||
},
|
||||
gradeList:[],
|
||||
checkResultList: [{
|
||||
id: true,
|
||||
name:'合格',
|
||||
},
|
||||
{
|
||||
id: false,
|
||||
name: '不合格',
|
||||
}
|
||||
],
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
@ -139,7 +208,9 @@ export default {
|
||||
materialList: [],
|
||||
workerList: [],
|
||||
supplierList:[],
|
||||
equipmentList:[],
|
||||
equipmentList: [],
|
||||
ingredientFlag:false,
|
||||
ingredientList:[],
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
materialId:null,
|
||||
@ -151,6 +222,10 @@ export default {
|
||||
appearance: null,
|
||||
checkResult: null,
|
||||
materialGrade: null,
|
||||
checkValueList: [],
|
||||
checkResult: '',
|
||||
materialGrade: undefined,
|
||||
remark:null,
|
||||
},
|
||||
productAttrList: [],
|
||||
visible: false,
|
||||
@ -168,6 +243,15 @@ export default {
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
judgeValue(val, minValue, maxValue, index) {
|
||||
if (val >= minValue && val <= maxValue) {
|
||||
this.dataForm.checkValueList[index].showIcon = true
|
||||
this.dataForm.checkValueList[index].isStandard = true
|
||||
} else {
|
||||
this.dataForm.checkValueList[index].showIcon = true
|
||||
this.dataForm.checkValueList[index].isStandard = false
|
||||
}
|
||||
},
|
||||
dataFormSubmit() {
|
||||
this.$refs["dataForm"].validate((valid) => {
|
||||
if (!valid) {
|
||||
@ -175,28 +259,111 @@ export default {
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.updateURL(this.dataForm).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
let obj = {
|
||||
id: this.dataForm.id,
|
||||
materialId: this.dataForm.materialId,
|
||||
supplierId: this.dataForm.supplierId,
|
||||
sampleCode: this.dataForm.sampleCode,
|
||||
samplerId: this.dataForm.samplerId,
|
||||
checkerId: this.dataForm.checkerId,
|
||||
checkTime: this.dataForm.checkTime,
|
||||
appearance: this.dataForm.appearance,
|
||||
checkResult: this.dataForm.checkResult,
|
||||
materialGrade: this.dataForm.materialGrade,
|
||||
// checkValueList: [],
|
||||
checkResult: this.dataForm.checkResult,
|
||||
materialGrade: this.dataForm.materialGrade,
|
||||
remark: this.dataForm.remark
|
||||
}
|
||||
this.urlOptions.updateURL(obj).then(response => {
|
||||
let array = []
|
||||
this.dataForm.checkValueList.forEach(ele => {
|
||||
array.push(this.updateDet({
|
||||
mainId: this.dataForm.id,
|
||||
id:ele.id,
|
||||
checkDetId: ele.checkDetId,
|
||||
checkValue: ele.checkValue
|
||||
}))
|
||||
})
|
||||
Promise.all(array).then(res => {
|
||||
console.log(res)
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
}).catch(error => {
|
||||
// 如果任何一个请求失败,将会进入这个 catch 块
|
||||
console.log(error)
|
||||
})
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
this.urlOptions.createURL(this.dataForm).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.idAttrShow = true;
|
||||
this.dataForm.id = res.data
|
||||
this.$emit("refreshDataList");
|
||||
let obj = {
|
||||
// id: this.dataForm.id,
|
||||
materialId: this.dataForm.materialId,
|
||||
supplierId: this.dataForm.supplierId,
|
||||
sampleCode: this.dataForm.sampleCode,
|
||||
samplerId: this.dataForm.samplerId,
|
||||
checkerId: this.dataForm.checkerId,
|
||||
checkTime: this.dataForm.checkTime,
|
||||
appearance: this.dataForm.appearance,
|
||||
checkResult: this.dataForm.checkResult,
|
||||
materialGrade: this.dataForm.materialGrade,
|
||||
// checkValueList: [],
|
||||
checkResult: this.dataForm.checkResult,
|
||||
materialGrade: this.dataForm.materialGrade,
|
||||
remark:this.dataForm.remark
|
||||
}
|
||||
this.urlOptions.createURL(obj).then(response => {
|
||||
// this.idAttrShow = true;
|
||||
let array = []
|
||||
this.dataForm.checkValueList.forEach(ele => {
|
||||
array.push(this.createDet({
|
||||
mainId: response.data,
|
||||
checkDetId: ele.checkDetId,
|
||||
checkValue: ele.checkValue
|
||||
}))
|
||||
})
|
||||
Promise.all(array).then(res => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
}).catch(error => {
|
||||
// 如果任何一个请求失败,将会进入这个 catch 块
|
||||
console.log(error)
|
||||
})
|
||||
|
||||
// this.dataForm.id = res.data
|
||||
});
|
||||
});
|
||||
},
|
||||
createDet(obj) {
|
||||
return createQualityHotMaterialDet(obj).then((response) => {
|
||||
return response.data
|
||||
})
|
||||
},
|
||||
updateDet(obj) {
|
||||
return updateQualityHotMaterialDet(obj).then((response) => {
|
||||
return response.data
|
||||
})
|
||||
},
|
||||
getData(val) {
|
||||
console.log(val);
|
||||
getMaterialCheckList({
|
||||
materialId:val
|
||||
}).then((res) => {
|
||||
console.log(res);
|
||||
this.ingredientList = res.data
|
||||
this.ingredientFlag = true
|
||||
this.dataForm.checkValueList = res.data.map((ele) => {
|
||||
return {
|
||||
mainId: null,
|
||||
checkDetId: ele.id,
|
||||
checkValue: null,
|
||||
isStandard: true,
|
||||
showIcon:false,
|
||||
}
|
||||
})
|
||||
// this.$set()
|
||||
console.log(this.dataForm);
|
||||
})
|
||||
},
|
||||
// clickTopBtn(val) {
|
||||
@ -208,7 +375,7 @@ export default {
|
||||
this.productAttrList.splice(0);
|
||||
this.listQuery.total = 0;
|
||||
},
|
||||
getDict() {
|
||||
async getDict() {
|
||||
getHotMaterialAllList().then((res) => {
|
||||
this.materialList = res.data
|
||||
})
|
||||
@ -218,49 +385,52 @@ export default {
|
||||
getSupplierList().then(res => {
|
||||
this.supplierList = res.data
|
||||
})
|
||||
const res = await getDictDatas(this.DICT_TYPE.EQU_ALARM_LEVEL)
|
||||
console.log('111', res)
|
||||
this.gradeList = res
|
||||
},
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(
|
||||
`确定对${
|
||||
raw.data.materialName
|
||||
? '[物料名称为' + raw.data.materialName + ']'
|
||||
: '[序号为' + raw.data.materialName + ']'
|
||||
}进行删除操作?`,
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
deleteProcessEquMaterialBomDet(raw.data.id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
} else {
|
||||
this.addNew(raw.data.id);
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
// 获取产品属性列表
|
||||
processEquMaterialBomDetPage({
|
||||
...this.listQuery,
|
||||
bomId: this.dataForm.id,
|
||||
}).then((response) => {
|
||||
this.productAttrList = response.data.list;
|
||||
this.listQuery.total = response.data.total;
|
||||
});
|
||||
},
|
||||
// handleClick(raw) {
|
||||
// if (raw.type === 'delete') {
|
||||
// this.$confirm(
|
||||
// `确定对${
|
||||
// raw.data.materialName
|
||||
// ? '[物料名称为' + raw.data.materialName + ']'
|
||||
// : '[序号为' + raw.data.materialName + ']'
|
||||
// }进行删除操作?`,
|
||||
// '提示',
|
||||
// {
|
||||
// confirmButtonText: '确定',
|
||||
// cancelButtonText: '取消',
|
||||
// type: 'warning',
|
||||
// }
|
||||
// )
|
||||
// .then(() => {
|
||||
// deleteProcessEquMaterialBomDet(raw.data.id).then(({ data }) => {
|
||||
// this.$message({
|
||||
// message: '操作成功',
|
||||
// type: 'success',
|
||||
// duration: 1500,
|
||||
// onClose: () => {
|
||||
// this.getList();
|
||||
// },
|
||||
// });
|
||||
// });
|
||||
// })
|
||||
// .catch(() => {});
|
||||
// } else {
|
||||
// this.addNew(raw.data.id);
|
||||
// }
|
||||
// },
|
||||
// getList() {
|
||||
// // 获取产品属性列表
|
||||
// processEquMaterialBomDetPage({
|
||||
// ...this.listQuery,
|
||||
// bomId: this.dataForm.id,
|
||||
// }).then((response) => {
|
||||
// this.productAttrList = response.data.list;
|
||||
// this.listQuery.total = response.data.total;
|
||||
// });
|
||||
// },
|
||||
init(id, isdetail) {
|
||||
this.initData()
|
||||
this.getDict()
|
||||
@ -277,19 +447,51 @@ export default {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
|
||||
if (this.dataForm.id) {
|
||||
// 获取产品详情
|
||||
this.urlOptions.infoURL({
|
||||
bomId: id,
|
||||
pageNo: 1,
|
||||
pageSize:10
|
||||
}).then(response => {
|
||||
// 获取产品详情
|
||||
let valueList = []
|
||||
this.urlOptions.infoURL(id).then(response => {
|
||||
this.dataForm = response.data
|
||||
this.dataForm.unit = String(this.dataForm.unit)
|
||||
this.dataForm.materialType = String(this.dataForm.materialType)
|
||||
this.dataForm.productType = String(this.dataForm.productType)
|
||||
});
|
||||
getMaterialCheckList({
|
||||
materialId: response.data.materialId
|
||||
}).then((res) => {
|
||||
console.log(res.data);
|
||||
this.ingredientList = res.data
|
||||
valueList = this.ingredientList.map((ele) => {
|
||||
// console.log(ele)
|
||||
return {
|
||||
maxValue: ele.maxValue,
|
||||
minValue: ele.minValue
|
||||
}
|
||||
})
|
||||
getQualityHotMaterialDetList({
|
||||
mainId: response.data.id
|
||||
}).then((result) => {
|
||||
this.dataForm.checkValueList = result.data.map((ele) => {
|
||||
return {
|
||||
mainId: ele.mainId,
|
||||
id: ele.id,
|
||||
checkDetId: ele.id,
|
||||
checkValue: ele.checkValue,
|
||||
isStandard: true,
|
||||
showIcon: false,
|
||||
}
|
||||
})
|
||||
valueList.forEach((ele,index) => {
|
||||
console.log(ele);
|
||||
if (this.dataForm.checkValueList[index].checkValue >= ele.minValue && this.dataForm.checkValueList[index].checkValue <= ele.maxValue) {
|
||||
this.dataForm.checkValueList[index].showIcon = true
|
||||
this.dataForm.checkValueList[index].isStandard = true
|
||||
} else {
|
||||
this.dataForm.checkValueList[index].showIcon = true
|
||||
this.dataForm.checkValueList[index].isStandard = false
|
||||
}
|
||||
// })
|
||||
})
|
||||
})
|
||||
});
|
||||
})
|
||||
// 获取产品属性列表
|
||||
this.getList();
|
||||
// this.getList();
|
||||
} else {
|
||||
if (this.urlOptions.isGetCode) {
|
||||
this.getCode()
|
||||
@ -322,10 +524,6 @@ export default {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.drawer >>> .el-form-item__label {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.drawer >>> .el-drawer__header {
|
||||
margin: 0;
|
||||
padding: 32px 32px 24px;
|
||||
|
@ -77,13 +77,19 @@ export default {
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`base:quality-inspection-det:update`)
|
||||
this.$auth.hasPermi(`base:quality-hot-material:update`)
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:quality-inspection-det:delete`)
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:quality-hot-material:detail`)
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:quality-hot-material:delete`)
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
@ -132,7 +138,16 @@ export default {
|
||||
mounted () {
|
||||
this.getDict();
|
||||
},
|
||||
methods: {
|
||||
methods: {
|
||||
otherMethods(val) {
|
||||
if (val.type === 'detail') {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle = "详情";
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data.id, true);
|
||||
});
|
||||
}
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
|
@ -99,7 +99,8 @@ export default {
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始日期',
|
||||
endPlaceholder: '结束日期',
|
||||
defaultTime: ['00:00:00', '23:59:59'],
|
||||
defaultTime: ['00:00:00', '23:59:59'],
|
||||
defaultSelect: [],
|
||||
param: 'checkTime',
|
||||
// width: 350,
|
||||
},
|
||||
@ -263,6 +264,12 @@ export default {
|
||||
this.searchBarFormConfig[0].defaultSelect = this.$route.query.woIdString.split(',')
|
||||
console.log(this.searchBarFormConfig[0].defaultSelect);
|
||||
}
|
||||
if (this.$route.query.startTime && this.$route.query.endTime) {
|
||||
// console.log(this.$route.query.startTime);
|
||||
this.searchBarFormConfig[2].defaultSelect = [moment(Number(this.$route.query.startTime)).format('yyyy-MM-DD HH:mm:ss'), moment(Number(this.$route.query.endTime)).format('yyyy-MM-DD HH:mm:ss'),]
|
||||
this.queryParams.startTime = moment(Number(this.$route.query.startTime)).format('yyyy-MM-DD HH:mm:ss')
|
||||
this.queryParams.endTime = moment(Number(this.$route.query.endTime)).format('yyyy-MM-DD HH:mm:ss')
|
||||
}
|
||||
// if (this.$route.params.startTime && this.$route.params.endTime) {
|
||||
// this.searchBarFormConfig[0].defaultSelect = [
|
||||
// this.$route.params.startTime,
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:45:25
|
||||
* @LastEditTime: 2023-12-13 15:17:53
|
||||
* @LastEditTime: 2023-12-14 14:56:38
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -483,7 +483,7 @@ export default {
|
||||
await updateProductionDataList(updateArr),
|
||||
]);
|
||||
if (result[0] == true && result[1] == true) {
|
||||
console.log(res)
|
||||
// console.log(res)
|
||||
this.disabled = true
|
||||
this.isSave = false
|
||||
this.getDataList()
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:45:25
|
||||
* @LastEditTime: 2023-12-13 16:55:27
|
||||
* @LastEditTime: 2023-12-14 14:56:40
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -24,100 +24,132 @@
|
||||
color: '#606266'
|
||||
}">
|
||||
<el-table-column :label="'许昌安彩月成品生产汇总' + timeTips" align="center">
|
||||
<el-table-column prop="glassType" label="品种">
|
||||
<el-table-column prop="glassType" label="品种" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.glassType" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.glassType }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格">
|
||||
<el-table-column prop="inputNow" label="本周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.inputNow }} </span>
|
||||
</template>
|
||||
<el-table-column label="规格" align="center">
|
||||
<el-table-column label="成品" align="center">
|
||||
<el-table-column :show-header="false">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.productionL" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.productionL }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-header="false">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.productionW" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.productionW }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-header="false">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.productionH" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.productionH }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="inputHis" label="上周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.inputHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="inputTrend" label="增减">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.inputTrend }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="完成良品产量">
|
||||
<el-table-column prop="goodProductNow" label="本周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductNow" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductHis" label="上周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductHis" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductTrend" label="增减">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductTrend }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="原片漏检率">
|
||||
<el-table-column prop="missCheckNow" label="本周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckHis" label="上周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
|
||||
<span v-else>{{ scope.row.missCheckHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="missCheckTrend" label="增减">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.missCheckTrend }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="综合良品率">
|
||||
<el-table-column prop="goodProductPassNow" label="本周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassNow" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassNow }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassHis" label="上周">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassHis" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassHis }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodProductPassTrend" label="增减">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.goodProductPassTrend }} </span>
|
||||
</template>
|
||||
<el-table-column label="原片">
|
||||
<el-table-column prop="originalGlassSize">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.originalGlassSize" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.originalGlassSize }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column label="完成良品产量"> -->
|
||||
<el-table-column prop="customerId" label="用户">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.customerId" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.customerId }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="packageType" label="包装形式">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.packageType" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.packageType }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="orderNum" label="订单数量">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.orderNum" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.orderNum }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="orderFinish" label="订单完成">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.orderFinish" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.orderFinish }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="orderRemaining" label="未完成订单">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.orderRemaining" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.orderRemaining }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="stockLastMonth" label="上月库存">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.stockLastMonth" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.stockLastMonth }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="productNumThisMonth" label="本月生产成品">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.productNumThisMonth" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.productNumThisMonth }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="deliveNum" label="发货量">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.deliveNum" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.deliveNum }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="undeliveNum" label="未发货量">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.undeliveNum" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.undeliveNum }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="undeliveArea" label="未发货面积">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.undeliveArea" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.undeliveArea }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="deliveArea" label="发货面积">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.deliveArea" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.deliveArea }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="productAreaThisMonth" label="本月生产面积">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.det === true" v-model="scope.row.productAreaThisMonth" :disabled="disabled">
|
||||
</el-input>
|
||||
<span v-else>{{ scope.row.productAreaThisMonth }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- </el-table-column> -->
|
||||
<div style="height: 50px;" class="remark" slot="append">
|
||||
<h3 style="float: left;text-align: center;margin-left: 20px;">备注:</h3>
|
||||
<el-input :disabled="disabled" style="float:right;width: 96%;margin-top: 8px;" v-model="remark"></el-input>
|
||||
@ -143,8 +175,8 @@
|
||||
<script>
|
||||
import {
|
||||
getAutoDeliveDataList,
|
||||
updateProductionDataList,
|
||||
updateSumProductionDataList
|
||||
updateSumAutoDeliveDataList,
|
||||
updateAutoDeliveDataList
|
||||
} from '@/api/report/production';
|
||||
// import Editor from '@/components/Editor';
|
||||
import moment from 'moment';
|
||||
@ -482,10 +514,10 @@ export default {
|
||||
// console.log(JSON.stringify(updateArr[1]))
|
||||
const result = await Promise.all([
|
||||
await updateSumProductionDataList(obj),
|
||||
await updateProductionDataList(updateArr),
|
||||
await updateAutoDeliveDataList(updateArr),
|
||||
]);
|
||||
if (result[0] == true && result[1] == true) {
|
||||
console.log(res)
|
||||
// console.log(res)
|
||||
this.disabled = true
|
||||
this.isSave = false
|
||||
this.getDataList()
|
||||
@ -519,12 +551,12 @@ export default {
|
||||
// sum = res.data.list.splice(index, 1)
|
||||
// }
|
||||
// })
|
||||
// res.data.forEach((ele,index) => {
|
||||
// if (ele.det === false) {
|
||||
// res.data.list[index].lineId = '合计'
|
||||
// this.remark = res.data.list[index].remark
|
||||
// }
|
||||
// });
|
||||
res.data.forEach((ele,index) => {
|
||||
if (ele.det === false) {
|
||||
res.data[index].glassType = '合计'
|
||||
this.remark = res.data[index].remark
|
||||
}
|
||||
});
|
||||
this.list = res.data
|
||||
},
|
||||
},
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:45:25
|
||||
* @LastEditTime: 2023-12-13 15:17:39
|
||||
* @LastEditTime: 2023-12-14 14:56:37
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -410,8 +410,8 @@ export default {
|
||||
await updateSumProductionDataList(obj),
|
||||
await updateProductionDataList(updateArr),
|
||||
]);
|
||||
if (result[0] == true && result[1] == true) {
|
||||
console.log(res)
|
||||
if (result[0].data == true && result[1].data == true) {
|
||||
// console.log(res)
|
||||
this.disabled = true
|
||||
this.isSave = false
|
||||
this.getDataList()
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:45:25
|
||||
* @LastEditTime: 2023-12-13 15:16:03
|
||||
* @LastEditTime: 2023-12-14 14:56:45
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@ -405,8 +405,8 @@ export default {
|
||||
await updateSumProductionDataList(obj),
|
||||
await updateProductionDataList(updateArr),
|
||||
]);
|
||||
if (result[0] == true && result[1] == true) {
|
||||
console.log(res)
|
||||
if (result[0].data == true && result[1].data == true) {
|
||||
// console.log(res)
|
||||
this.disabled = true
|
||||
this.isSave = false
|
||||
this.getDataList()
|
||||
|
@ -68,7 +68,6 @@ export default {
|
||||
}
|
||||
obj.name = item
|
||||
obj.type = 'line'
|
||||
obj.stack = 'Total'
|
||||
obj.symbol = 'none'
|
||||
obj.data = data
|
||||
seriesData.push(obj)
|
||||
@ -118,7 +117,7 @@ export default {
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
left: '4%',
|
||||
right: '2%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
|
@ -56,7 +56,7 @@ const tableProps = [
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '指示编码',
|
||||
label: '指标编码',
|
||||
minWidth: 120
|
||||
},
|
||||
{
|
||||
|
@ -35,13 +35,14 @@
|
||||
import { environmentalCheckRealtime, environmentalCheckRealtimeTrend } from '@/api/safetyEnvironmental/environmental'
|
||||
import LineChart from './../../components/lineChart'
|
||||
import SearchArea from './../../components/searchArea'
|
||||
import moment from 'moment'
|
||||
export default {
|
||||
name: 'Voc',
|
||||
data(){
|
||||
return {
|
||||
realtimeList:[],
|
||||
queryParams:{
|
||||
checkType: 1,
|
||||
checkType: 3,
|
||||
timeDim: null,
|
||||
timeRange: []
|
||||
},
|
||||
@ -51,6 +52,9 @@ export default {
|
||||
components: { LineChart, SearchArea },
|
||||
mounted() {
|
||||
this.getMsg()
|
||||
this.queryParams.timeDim = this.getDictDatas(this.DICT_TYPE.TIME_DIM)[0].value // 默认时
|
||||
this.queryParams.timeRange = [moment().startOf('day')+0, moment().endOf('day')-59*61*1000]
|
||||
this.getTrend()
|
||||
},
|
||||
methods: {
|
||||
getMsg() {
|
||||
@ -59,19 +63,21 @@ export default {
|
||||
this.realtimeList = res.data || []
|
||||
})
|
||||
},
|
||||
getTrend(params) {
|
||||
console.log(params)
|
||||
this.queryParams.timeDim = params.timeDim
|
||||
this.queryParams.timeRange[0] = params.startTime
|
||||
this.queryParams.timeRange[1] = params.endTime
|
||||
getTrend() {
|
||||
environmentalCheckRealtimeTrend({...this.queryParams}).then(res => {
|
||||
console.log(res)
|
||||
if (res.code === 0) {
|
||||
this.chartData = res.data
|
||||
} else {
|
||||
this.chartData = {}
|
||||
}
|
||||
})
|
||||
},
|
||||
submitClick(params) {
|
||||
console.log(params)
|
||||
this.queryParams.timeDim = params.timeDim
|
||||
this.queryParams.timeRange[0] = params.startTime
|
||||
this.queryParams.timeRange[1] = params.endTime
|
||||
this.getTrend()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ const tableProps = [
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '指示编码',
|
||||
label: '指标编码',
|
||||
minWidth: 120
|
||||
},
|
||||
{
|
||||
|
@ -35,6 +35,7 @@
|
||||
import { environmentalCheckRealtime, environmentalCheckRealtimeTrend } from '@/api/safetyEnvironmental/environmental'
|
||||
import LineChart from './../../components/lineChart'
|
||||
import SearchArea from './../../components/searchArea'
|
||||
import moment from 'moment'
|
||||
export default {
|
||||
name: 'WasteGasManagement',
|
||||
data(){
|
||||
@ -51,6 +52,9 @@ export default {
|
||||
components: { LineChart, SearchArea },
|
||||
mounted() {
|
||||
this.getMsg()
|
||||
this.queryParams.timeDim = this.getDictDatas(this.DICT_TYPE.TIME_DIM)[0].value // 默认时
|
||||
this.queryParams.timeRange = [moment().startOf('day')+0, moment().endOf('day')-59*61*1000]
|
||||
this.getTrend()
|
||||
},
|
||||
methods: {
|
||||
getMsg() {
|
||||
@ -59,19 +63,21 @@ export default {
|
||||
this.realtimeList = res.data || []
|
||||
})
|
||||
},
|
||||
getTrend(params) {
|
||||
console.log(params)
|
||||
this.queryParams.timeDim = params.timeDim
|
||||
this.queryParams.timeRange[0] = params.startTime
|
||||
this.queryParams.timeRange[1] = params.endTime
|
||||
getTrend() {
|
||||
environmentalCheckRealtimeTrend({...this.queryParams}).then(res => {
|
||||
console.log(res)
|
||||
if (res.code === 0) {
|
||||
this.chartData = res.data
|
||||
} else {
|
||||
this.chartData = {}
|
||||
}
|
||||
})
|
||||
},
|
||||
submitClick(params) {
|
||||
console.log(params)
|
||||
this.queryParams.timeDim = params.timeDim
|
||||
this.queryParams.timeRange[0] = params.startTime
|
||||
this.queryParams.timeRange[1] = params.endTime
|
||||
this.getTrend()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ const tableProps = [
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '指示编码',
|
||||
label: '指标编码',
|
||||
minWidth: 120
|
||||
},
|
||||
{
|
||||
|
@ -22,7 +22,7 @@
|
||||
<span>检测指标趋势图</span>
|
||||
</div>
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-area @submit="getTrend"/>
|
||||
<search-area @submit="submitClick"/>
|
||||
<line-chart :chartData="chartData" v-show='Object.keys(chartData).length !== 0' :timeDim="queryParams.timeDim"/>
|
||||
<!-- 没有数据 -->
|
||||
<div class="no-data-bg" v-show='Object.keys(chartData).length === 0'></div>
|
||||
@ -33,6 +33,7 @@
|
||||
import { environmentalCheckRealtime, environmentalCheckRealtimeTrend } from '@/api/safetyEnvironmental/environmental'
|
||||
import LineChart from './../../components/lineChart'
|
||||
import SearchArea from './../../components/searchArea'
|
||||
import moment from 'moment'
|
||||
export default {
|
||||
name: 'WasteWaterManagement',
|
||||
data(){
|
||||
@ -49,27 +50,31 @@ export default {
|
||||
components: { LineChart, SearchArea },
|
||||
mounted() {
|
||||
this.getMsg()
|
||||
this.queryParams.timeDim = this.getDictDatas(this.DICT_TYPE.TIME_DIM)[0].value // 默认时
|
||||
this.queryParams.timeRange = [moment().startOf('day')+0, moment().endOf('day')-59*61*1000]
|
||||
this.getTrend()
|
||||
},
|
||||
methods: {
|
||||
getMsg() {
|
||||
environmentalCheckRealtime({checkType: 1}).then(res => {
|
||||
console.log(res)
|
||||
this.realtimeList = res.data || []
|
||||
})
|
||||
},
|
||||
getTrend(params) {
|
||||
console.log(params)
|
||||
this.queryParams.timeDim = params.timeDim
|
||||
this.queryParams.timeRange[0] = params.startTime
|
||||
this.queryParams.timeRange[1] = params.endTime
|
||||
getTrend() {
|
||||
environmentalCheckRealtimeTrend({...this.queryParams}).then(res => {
|
||||
console.log(res)
|
||||
if (res.code === 0) {
|
||||
this.chartData = res.data
|
||||
} else {
|
||||
this.chartData = {}
|
||||
}
|
||||
})
|
||||
},
|
||||
submitClick(params) {
|
||||
console.log(params)
|
||||
this.queryParams.timeDim = params.timeDim
|
||||
this.queryParams.timeRange[0] = params.startTime
|
||||
this.queryParams.timeRange[1] = params.endTime
|
||||
this.getTrend()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
522
src/views/specialEquipment/basic/FireFighthing.vue
Normal file
@ -0,0 +1,522 @@
|
||||
<!--
|
||||
filename: SpecialEquipmentForFireFighting.vue
|
||||
author: liubin
|
||||
date: 2023-12-12 13:51:23
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="app-container SpecialEquipmentForFireFighting">
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="search-bar"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="120"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 对话框(添加) -->
|
||||
<base-dialog
|
||||
:dialogTitle="title"
|
||||
:dialogVisible="open"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
width="45%"
|
||||
@confirm="submitForm">
|
||||
<DialogForm
|
||||
v-if="open"
|
||||
key="index-dialog-form"
|
||||
ref="form"
|
||||
label-position="top"
|
||||
size="small"
|
||||
v-model="form"
|
||||
:has-files="true"
|
||||
:disabled="editMode === 'detail'"
|
||||
:rows="computedRows" />
|
||||
<!-- :has-files="['files', 'files2']" -->
|
||||
</base-dialog>
|
||||
|
||||
<!-- 设备 详情 - 编辑 -->
|
||||
<!-- <EquipmentDrawer
|
||||
v-if="editVisible"
|
||||
ref="drawer"
|
||||
:mode="editMode"
|
||||
@update-mode="editMode = $event"
|
||||
:data-id="form.id"
|
||||
:sections="[
|
||||
{
|
||||
name: '基本信息',
|
||||
key: 'base',
|
||||
rows: computedRows,
|
||||
url: '/base/core-equipment/get',
|
||||
urlUpdate: '/base/core-equipment/update',
|
||||
urlCreate: '/base/core-equipment/create',
|
||||
queryParams: { id: form.id },
|
||||
},
|
||||
{
|
||||
name: '属性列表',
|
||||
key: 'attrs',
|
||||
props: drawerListProps,
|
||||
url: '/base/core-equipment-attr/page',
|
||||
urlCreate: '/base/core-equipment-attr/create',
|
||||
urlUpdate: '/base/core-equipment-attr/update',
|
||||
urlDelete: '/base/core-equipment-attr/delete',
|
||||
urlDetail: '/base/core-equipment-attr/get',
|
||||
queryParams: {
|
||||
equipmentId: form.id,
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:core-equipment-attr:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:core-equipment-attr:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
allowAdd: true,
|
||||
},
|
||||
]"
|
||||
@refreshDataList="getList"
|
||||
@cancel="cancelEdit"
|
||||
@destroy="cancelEdit" /> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import EquipmentDrawer from '../components/EquipmentDrawer';
|
||||
|
||||
import {
|
||||
createEquipment,
|
||||
updateEquipment,
|
||||
deleteEquipment,
|
||||
getEquipment,
|
||||
getEquipmentPage,
|
||||
exportEquipmentExcel,
|
||||
} from '@/api/base/equipment';
|
||||
import Editor from '@/components/Editor';
|
||||
import AssetsUpload from '../components/AssetsUpload.vue';
|
||||
|
||||
export default {
|
||||
name: 'SpecialEquipmentForFireFighting',
|
||||
components: {
|
||||
Editor,
|
||||
EquipmentDrawer,
|
||||
},
|
||||
mixins: [basicPageMixin],
|
||||
data() {
|
||||
return {
|
||||
searchBarKeys: ['name', 'code'],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`base:core-equipment:update`)
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:core-equipment:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:core-equipment:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
tableProps: [
|
||||
// {
|
||||
// prop: 'createTime',
|
||||
// label: '添加时间',
|
||||
// fixed: true,
|
||||
// width: 180,
|
||||
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
// },
|
||||
{ prop: 'name', label: '设备名称' },
|
||||
{ width: 256, prop: 'code', label: '设备编码' },
|
||||
{ prop: 'location', label: '位置' },
|
||||
{ prop: 'responsiblePeopleName', label: '负责人' },
|
||||
{ prop: 'dueTime', label: '有效期至' },
|
||||
{ prop: 'remark', label: '备注' },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '设备名称',
|
||||
placeholder: '请输入设备名称',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '设备编码',
|
||||
placeholder: '请输入设备编码',
|
||||
param: 'code',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:core-equipment:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
plain: true,
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:core-equipment:create')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
plain: true,
|
||||
color: 'success',
|
||||
},
|
||||
],
|
||||
rows: [
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '设备名称',
|
||||
prop: 'name',
|
||||
rules: [
|
||||
{ required: true, message: '设备名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '设备编码',
|
||||
prop: 'code',
|
||||
url: '/base/core-equipment/getCode',
|
||||
rules: [
|
||||
{ required: true, message: '设备编码不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '所在区域',
|
||||
prop: 'location',
|
||||
},
|
||||
{
|
||||
select: true,
|
||||
label: '负责人',
|
||||
prop: 'responsiblePeopleId',
|
||||
url: '/base/core-worker/listAll',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
datetime: true,
|
||||
label: '有效期至',
|
||||
prop: 'dueTime',
|
||||
bind: { clearable: true },
|
||||
},
|
||||
{},
|
||||
],
|
||||
[{ input: true, label: '备注', prop: 'remark' }],
|
||||
[
|
||||
{
|
||||
upload: true,
|
||||
label: '设备图片',
|
||||
prop: 'files',
|
||||
fileType: 1,
|
||||
},
|
||||
],
|
||||
],
|
||||
editVisible: false,
|
||||
editMode: 'edit', // 'edit', 'detail'
|
||||
// drawer 里的设备属性列表配置项
|
||||
drawerListProps: [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
fixed: true,
|
||||
width: 180,
|
||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
},
|
||||
{ prop: 'name', label: '属性名称' },
|
||||
{ prop: 'value', label: '属性值' },
|
||||
],
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
code: '',
|
||||
name: '',
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
id: null,
|
||||
files: [],
|
||||
},
|
||||
showUploadComponents: false, // 是否显示上传组件
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
computedRows() {
|
||||
return this.showUploadComponents
|
||||
? [
|
||||
...this.rows,
|
||||
[
|
||||
{
|
||||
assetUpload: true,
|
||||
key: 'eq-assets', // 用于区分不同的上传组件
|
||||
label: '上传资料',
|
||||
fieldName: 'assets',
|
||||
subcomponent: AssetsUpload,
|
||||
prop: 'uploadedAssets',
|
||||
default: [],
|
||||
bind: {
|
||||
'is-pic-mode': false,
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
assetUpload: true,
|
||||
key: 'eq-pics', // 用于区分不同的上传组件
|
||||
label: '上传图片',
|
||||
fieldName: 'images',
|
||||
subcomponent: AssetsUpload,
|
||||
// prop: '',
|
||||
// default: [],
|
||||
bind: {
|
||||
'is-pic-mode': true,
|
||||
},
|
||||
},
|
||||
],
|
||||
]
|
||||
: this.rows;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getList();
|
||||
},
|
||||
activated() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
getEquipmentPage({
|
||||
...this.queryParams,
|
||||
specialType: 2,
|
||||
special: true,
|
||||
}).then((response) => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
cancelEdit() {
|
||||
this.showUploadComponents = false;
|
||||
this.editVisible = false;
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
code: undefined,
|
||||
name: undefined,
|
||||
enName: undefined,
|
||||
abbr: undefined,
|
||||
enterTime: undefined,
|
||||
productionTime: undefined,
|
||||
equipmentTypeId: undefined,
|
||||
groupId: undefined,
|
||||
tvalue: undefined,
|
||||
processingTime: undefined,
|
||||
manufacturer: undefined,
|
||||
spec: undefined,
|
||||
description: undefined,
|
||||
remark: undefined,
|
||||
files: [],
|
||||
files2: [],
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.showUploadComponents = false;
|
||||
this.title = '添加设备';
|
||||
this.editMode = 'add';
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.showUploadComponents = false;
|
||||
this.editMode = 'edit';
|
||||
const id = row.id;
|
||||
getEquipment(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = '修改设备';
|
||||
});
|
||||
},
|
||||
handleDetail(row) {
|
||||
this.reset();
|
||||
this.showUploadComponents = false;
|
||||
const id = row.id;
|
||||
this.editMode = 'detail';
|
||||
getEquipment(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = '查看详情';
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
const payload = Object.assign(
|
||||
{ special: true, specialType: 2 },
|
||||
this.form
|
||||
);
|
||||
// payload.files = [...payload.files, ...payload.files2];
|
||||
// delete payload.files2;
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
updateEquipment(payload).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createEquipment(payload).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal
|
||||
.confirm('是否确认删除设备名称为"' + row.name + '"的数据项?')
|
||||
.then(function () {
|
||||
return deleteEquipment(id);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.queryParams, special: true, specialType: 2 };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal
|
||||
.confirm('是否确认导出所有设备数据项?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportEquipmentExcel(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '消防设备.xls');
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
// 查看详情
|
||||
viewDetail(id) {
|
||||
this.reset();
|
||||
this.editMode = 'detail';
|
||||
this.showUploadComponents = true;
|
||||
this.form.id = id;
|
||||
this.editVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['drawer'].init();
|
||||
});
|
||||
},
|
||||
// overwrite basicPageMixin 里的 处理表格按钮 方法
|
||||
// handleTableBtnClick({ data, type }) {
|
||||
// switch (type) {
|
||||
// case 'edit':
|
||||
// this.reset();
|
||||
// this.editMode = 'edit';
|
||||
// this.showUploadComponents = true;
|
||||
// this.form.id = data.id;
|
||||
// this.editVisible = true;
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs['drawer'].init();
|
||||
// });
|
||||
// break;
|
||||
// case 'delete':
|
||||
// this.handleDelete(data);
|
||||
// break;
|
||||
// case 'detail':
|
||||
// const { id } = data;
|
||||
// this.viewDetail(id);
|
||||
// break;
|
||||
// }
|
||||
// },
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.SpecialEquipmentForFireFighting {
|
||||
}
|
||||
</style>
|
512
src/views/specialEquipment/basic/Manage.vue
Normal file
@ -0,0 +1,512 @@
|
||||
<!--
|
||||
filename: SpecialEquipmentManagement.vue
|
||||
author: liubin
|
||||
date: 2023-12-12 13:51:23
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="app-container SpecialEquipmentManagement">
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="search-bar"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="120"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 对话框(添加) -->
|
||||
<base-dialog
|
||||
:dialogTitle="title"
|
||||
:dialogVisible="open"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
width="45%"
|
||||
@confirm="submitForm">
|
||||
<DialogForm
|
||||
v-if="open"
|
||||
key="index-dialog-form"
|
||||
ref="form"
|
||||
label-position="top"
|
||||
size="small"
|
||||
v-model="form"
|
||||
:has-files="true"
|
||||
:disabled="editMode === 'detail'"
|
||||
:rows="computedRows" />
|
||||
<!-- :has-files="['files', 'files2']" -->
|
||||
</base-dialog>
|
||||
|
||||
<!-- 设备 详情 - 编辑 -->
|
||||
<!-- <EquipmentDrawer
|
||||
v-if="editVisible"
|
||||
ref="drawer"
|
||||
:mode="editMode"
|
||||
@update-mode="editMode = $event"
|
||||
:data-id="form.id"
|
||||
:sections="[
|
||||
{
|
||||
name: '基本信息',
|
||||
key: 'base',
|
||||
rows: computedRows,
|
||||
url: '/base/core-equipment/get',
|
||||
urlUpdate: '/base/core-equipment/update',
|
||||
urlCreate: '/base/core-equipment/create',
|
||||
queryParams: { id: form.id },
|
||||
},
|
||||
{
|
||||
name: '属性列表',
|
||||
key: 'attrs',
|
||||
props: drawerListProps,
|
||||
url: '/base/core-equipment-attr/page',
|
||||
urlCreate: '/base/core-equipment-attr/create',
|
||||
urlUpdate: '/base/core-equipment-attr/update',
|
||||
urlDelete: '/base/core-equipment-attr/delete',
|
||||
urlDetail: '/base/core-equipment-attr/get',
|
||||
queryParams: {
|
||||
equipmentId: form.id,
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:core-equipment-attr:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:core-equipment-attr:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
allowAdd: true,
|
||||
},
|
||||
]"
|
||||
@refreshDataList="getList"
|
||||
@cancel="cancelEdit"
|
||||
@destroy="cancelEdit" /> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import EquipmentDrawer from '../components/EquipmentDrawer';
|
||||
|
||||
import {
|
||||
createEquipment,
|
||||
updateEquipment,
|
||||
deleteEquipment,
|
||||
getEquipment,
|
||||
getEquipmentPage,
|
||||
exportEquipmentExcel,
|
||||
} from '@/api/base/equipment';
|
||||
import Editor from '@/components/Editor';
|
||||
import AssetsUpload from '../components/AssetsUpload.vue';
|
||||
|
||||
export default {
|
||||
name: 'SpecialEquipmentManagement',
|
||||
components: {
|
||||
Editor,
|
||||
EquipmentDrawer,
|
||||
},
|
||||
mixins: [basicPageMixin],
|
||||
data() {
|
||||
return {
|
||||
searchBarKeys: ['name', 'code'],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`base:core-equipment:update`)
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:core-equipment:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:core-equipment:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
tableProps: [
|
||||
// {
|
||||
// prop: 'createTime',
|
||||
// label: '添加时间',
|
||||
// fixed: true,
|
||||
// width: 180,
|
||||
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
// },
|
||||
{ prop: 'name', label: '设备名称' },
|
||||
{ width: 256, prop: 'code', label: '设备编码' },
|
||||
{ prop: 'location', label: '位置' },
|
||||
{ prop: 'responsiblePeopleName', label: '负责人' },
|
||||
{ prop: 'remark', label: '备注' },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '名称',
|
||||
placeholder: '请输入设备名称',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '编码',
|
||||
placeholder: '请输入设备编码',
|
||||
param: 'code',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:core-equipment:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
plain: true,
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:core-equipment:create')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
plain: true,
|
||||
color: 'success',
|
||||
},
|
||||
],
|
||||
rows: [
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '设备名称',
|
||||
prop: 'name',
|
||||
rules: [
|
||||
{ required: true, message: '设备名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '设备编码',
|
||||
prop: 'code',
|
||||
url: '/base/core-equipment/getCode',
|
||||
rules: [
|
||||
{ required: true, message: '设备编码不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '所在区域',
|
||||
prop: 'location',
|
||||
},
|
||||
{
|
||||
select: true,
|
||||
label: '负责人',
|
||||
prop: 'responsiblePeopleId',
|
||||
url: '/base/core-worker/listAll',
|
||||
},
|
||||
],
|
||||
[{ input: true, label: '备注', prop: 'remark' }],
|
||||
[
|
||||
{
|
||||
upload: true,
|
||||
label: '设备图片',
|
||||
prop: 'files',
|
||||
fileType: 1,
|
||||
},
|
||||
],
|
||||
],
|
||||
editVisible: false,
|
||||
editMode: 'edit', // 'edit', 'detail'
|
||||
// drawer 里的设备属性列表配置项
|
||||
drawerListProps: [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
fixed: true,
|
||||
width: 180,
|
||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
},
|
||||
{ prop: 'name', label: '属性名称' },
|
||||
{ prop: 'value', label: '属性值' },
|
||||
],
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
code: '',
|
||||
name: '',
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
id: null,
|
||||
files: [],
|
||||
},
|
||||
showUploadComponents: false, // 是否显示上传组件
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
computedRows() {
|
||||
return this.showUploadComponents
|
||||
? [
|
||||
...this.rows,
|
||||
[
|
||||
{
|
||||
assetUpload: true,
|
||||
key: 'eq-assets', // 用于区分不同的上传组件
|
||||
label: '上传资料',
|
||||
fieldName: 'assets',
|
||||
subcomponent: AssetsUpload,
|
||||
prop: 'uploadedAssets',
|
||||
default: [],
|
||||
bind: {
|
||||
'is-pic-mode': false,
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
assetUpload: true,
|
||||
key: 'eq-pics', // 用于区分不同的上传组件
|
||||
label: '上传图片',
|
||||
fieldName: 'images',
|
||||
subcomponent: AssetsUpload,
|
||||
// prop: '',
|
||||
// default: [],
|
||||
bind: {
|
||||
'is-pic-mode': true,
|
||||
},
|
||||
},
|
||||
],
|
||||
]
|
||||
: this.rows;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getList();
|
||||
},
|
||||
activated() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
getEquipmentPage({
|
||||
...this.queryParams,
|
||||
specialType: 3,
|
||||
special: true,
|
||||
}).then((response) => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
cancelEdit() {
|
||||
this.showUploadComponents = false;
|
||||
this.editVisible = false;
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
code: undefined,
|
||||
name: undefined,
|
||||
enName: undefined,
|
||||
abbr: undefined,
|
||||
enterTime: undefined,
|
||||
productionTime: undefined,
|
||||
equipmentTypeId: undefined,
|
||||
groupId: undefined,
|
||||
tvalue: undefined,
|
||||
processingTime: undefined,
|
||||
manufacturer: undefined,
|
||||
spec: undefined,
|
||||
description: undefined,
|
||||
remark: undefined,
|
||||
files: [],
|
||||
files2: [],
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.showUploadComponents = false;
|
||||
this.title = '添加设备';
|
||||
this.editMode = 'add';
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.showUploadComponents = false;
|
||||
this.editMode = 'edit';
|
||||
const id = row.id;
|
||||
getEquipment(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = '修改设备';
|
||||
});
|
||||
},
|
||||
handleDetail(row) {
|
||||
this.reset();
|
||||
this.showUploadComponents = false;
|
||||
const id = row.id;
|
||||
this.editMode = 'detail';
|
||||
getEquipment(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = '查看详情';
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
const payload = Object.assign(
|
||||
{ special: true, specialType: 3 },
|
||||
this.form
|
||||
);
|
||||
// payload.files = [...payload.files, ...payload.files2];
|
||||
// delete payload.files2;
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
updateEquipment(payload).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createEquipment(payload).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal
|
||||
.confirm('是否确认删除设备名称为"' + row.name + '"的数据项?')
|
||||
.then(function () {
|
||||
return deleteEquipment(id);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.queryParams, special: true, specialType: 3 };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal
|
||||
.confirm('是否确认导出所有设备数据项?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportEquipmentExcel(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '特种设备.xls');
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
// 查看详情
|
||||
viewDetail(id) {
|
||||
this.reset();
|
||||
this.editMode = 'detail';
|
||||
this.showUploadComponents = true;
|
||||
this.form.id = id;
|
||||
this.editVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['drawer'].init();
|
||||
});
|
||||
},
|
||||
// overwrite basicPageMixin 里的 处理表格按钮 方法
|
||||
// handleTableBtnClick({ data, type }) {
|
||||
// switch (type) {
|
||||
// case 'edit':
|
||||
// this.reset();
|
||||
// this.editMode = 'edit';
|
||||
// this.showUploadComponents = true;
|
||||
// this.form.id = data.id;
|
||||
// this.editVisible = true;
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs['drawer'].init();
|
||||
// });
|
||||
// break;
|
||||
// case 'delete':
|
||||
// this.handleDelete(data);
|
||||
// break;
|
||||
// case 'detail':
|
||||
// const { id } = data;
|
||||
// this.viewDetail(id);
|
||||
// break;
|
||||
// }
|
||||
// },
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.SpecialEquipmentManagement {
|
||||
}
|
||||
</style>
|
512
src/views/specialEquipment/basic/Safety.vue
Normal file
@ -0,0 +1,512 @@
|
||||
<!--
|
||||
filename: Safety.vue
|
||||
author: liubin
|
||||
date: 2023-12-12 13:51:23
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="app-container SpecialEquipmentForSafety">
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="search-bar"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="120"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 对话框(添加) -->
|
||||
<base-dialog
|
||||
:dialogTitle="title"
|
||||
:dialogVisible="open"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
width="45%"
|
||||
@confirm="submitForm">
|
||||
<DialogForm
|
||||
v-if="open"
|
||||
key="index-dialog-form"
|
||||
ref="form"
|
||||
label-position="top"
|
||||
size="small"
|
||||
v-model="form"
|
||||
:has-files="true"
|
||||
:disabled="editMode === 'detail'"
|
||||
:rows="computedRows" />
|
||||
<!-- :has-files="['files', 'files2']" -->
|
||||
</base-dialog>
|
||||
|
||||
<!-- 设备 详情 - 编辑 -->
|
||||
<!-- <EquipmentDrawer
|
||||
v-if="editVisible"
|
||||
ref="drawer"
|
||||
:mode="editMode"
|
||||
@update-mode="editMode = $event"
|
||||
:data-id="form.id"
|
||||
:sections="[
|
||||
{
|
||||
name: '基本信息',
|
||||
key: 'base',
|
||||
rows: computedRows,
|
||||
url: '/base/core-equipment/get',
|
||||
urlUpdate: '/base/core-equipment/update',
|
||||
urlCreate: '/base/core-equipment/create',
|
||||
queryParams: { id: form.id },
|
||||
},
|
||||
{
|
||||
name: '属性列表',
|
||||
key: 'attrs',
|
||||
props: drawerListProps,
|
||||
url: '/base/core-equipment-attr/page',
|
||||
urlCreate: '/base/core-equipment-attr/create',
|
||||
urlUpdate: '/base/core-equipment-attr/update',
|
||||
urlDelete: '/base/core-equipment-attr/delete',
|
||||
urlDetail: '/base/core-equipment-attr/get',
|
||||
queryParams: {
|
||||
equipmentId: form.id,
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:core-equipment-attr:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:core-equipment-attr:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
allowAdd: true,
|
||||
},
|
||||
]"
|
||||
@refreshDataList="getList"
|
||||
@cancel="cancelEdit"
|
||||
@destroy="cancelEdit" /> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import EquipmentDrawer from '../components/EquipmentDrawer';
|
||||
|
||||
import {
|
||||
createEquipment,
|
||||
updateEquipment,
|
||||
deleteEquipment,
|
||||
getEquipment,
|
||||
getEquipmentPage,
|
||||
exportEquipmentExcel,
|
||||
} from '@/api/base/equipment';
|
||||
import Editor from '@/components/Editor';
|
||||
import AssetsUpload from '../components/AssetsUpload.vue';
|
||||
|
||||
export default {
|
||||
name: 'SpecialEquipmentForSafety',
|
||||
components: {
|
||||
Editor,
|
||||
EquipmentDrawer,
|
||||
},
|
||||
mixins: [basicPageMixin],
|
||||
data() {
|
||||
return {
|
||||
searchBarKeys: ['name', 'code'],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`base:core-equipment:update`)
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:core-equipment:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:core-equipment:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
tableProps: [
|
||||
// {
|
||||
// prop: 'createTime',
|
||||
// label: '添加时间',
|
||||
// fixed: true,
|
||||
// width: 180,
|
||||
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
// },
|
||||
{ prop: 'name', label: '设备名称' },
|
||||
{ width: 256, prop: 'code', label: '设备编码' },
|
||||
{ prop: 'location', label: '位置' },
|
||||
{ prop: 'responsiblePeopleName', label: '负责人' },
|
||||
{ prop: 'remark', label: '备注' },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '设备名称',
|
||||
placeholder: '请输入设备名称',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '设备编码',
|
||||
placeholder: '请输入设备编码',
|
||||
param: 'code',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:core-equipment:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
plain: true,
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:core-equipment:create')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
plain: true,
|
||||
color: 'success',
|
||||
},
|
||||
],
|
||||
rows: [
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '设备名称',
|
||||
prop: 'name',
|
||||
rules: [
|
||||
{ required: true, message: '设备名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '设备编码',
|
||||
prop: 'code',
|
||||
url: '/base/core-equipment/getCode',
|
||||
rules: [
|
||||
{ required: true, message: '设备编码不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '所在区域',
|
||||
prop: 'location',
|
||||
},
|
||||
{
|
||||
select: true,
|
||||
label: '负责人',
|
||||
prop: 'responsiblePeopleId',
|
||||
url: '/base/core-worker/listAll',
|
||||
},
|
||||
],
|
||||
[{ input: true, label: '备注', prop: 'remark' }],
|
||||
[
|
||||
{
|
||||
upload: true,
|
||||
label: '设备图片',
|
||||
prop: 'files',
|
||||
fileType: 1,
|
||||
},
|
||||
],
|
||||
],
|
||||
editVisible: false,
|
||||
editMode: 'edit', // 'edit', 'detail'
|
||||
// drawer 里的设备属性列表配置项
|
||||
drawerListProps: [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
fixed: true,
|
||||
width: 180,
|
||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
},
|
||||
{ prop: 'name', label: '属性名称' },
|
||||
{ prop: 'value', label: '属性值' },
|
||||
],
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
code: '',
|
||||
name: '',
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
id: null,
|
||||
files: [],
|
||||
},
|
||||
showUploadComponents: false, // 是否显示上传组件
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
computedRows() {
|
||||
return this.showUploadComponents
|
||||
? [
|
||||
...this.rows,
|
||||
[
|
||||
{
|
||||
assetUpload: true,
|
||||
key: 'eq-assets', // 用于区分不同的上传组件
|
||||
label: '上传资料',
|
||||
fieldName: 'assets',
|
||||
subcomponent: AssetsUpload,
|
||||
prop: 'uploadedAssets',
|
||||
default: [],
|
||||
bind: {
|
||||
'is-pic-mode': false,
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
assetUpload: true,
|
||||
key: 'eq-pics', // 用于区分不同的上传组件
|
||||
label: '上传图片',
|
||||
fieldName: 'images',
|
||||
subcomponent: AssetsUpload,
|
||||
// prop: '',
|
||||
// default: [],
|
||||
bind: {
|
||||
'is-pic-mode': true,
|
||||
},
|
||||
},
|
||||
],
|
||||
]
|
||||
: this.rows;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getList();
|
||||
},
|
||||
activated() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
getEquipmentPage({
|
||||
...this.queryParams,
|
||||
specialType: 1,
|
||||
special: true,
|
||||
}).then((response) => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
cancelEdit() {
|
||||
this.showUploadComponents = false;
|
||||
this.editVisible = false;
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
code: undefined,
|
||||
name: undefined,
|
||||
enName: undefined,
|
||||
abbr: undefined,
|
||||
enterTime: undefined,
|
||||
productionTime: undefined,
|
||||
equipmentTypeId: undefined,
|
||||
groupId: undefined,
|
||||
tvalue: undefined,
|
||||
processingTime: undefined,
|
||||
manufacturer: undefined,
|
||||
spec: undefined,
|
||||
description: undefined,
|
||||
remark: undefined,
|
||||
files: [],
|
||||
files2: [],
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.showUploadComponents = false;
|
||||
this.title = '添加设备';
|
||||
this.editMode = 'add';
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.showUploadComponents = false;
|
||||
this.editMode = 'edit';
|
||||
const id = row.id;
|
||||
getEquipment(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = '修改设备';
|
||||
});
|
||||
},
|
||||
handleDetail(row) {
|
||||
this.reset();
|
||||
this.showUploadComponents = false;
|
||||
const id = row.id;
|
||||
this.editMode = 'detail';
|
||||
getEquipment(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = '查看详情';
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
const payload = Object.assign(
|
||||
{ special: true, specialType: 1 },
|
||||
this.form
|
||||
);
|
||||
// payload.files = [...payload.files, ...payload.files2];
|
||||
// delete payload.files2;
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
updateEquipment(payload).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createEquipment(payload).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal
|
||||
.confirm('是否确认删除设备名称为"' + row.name + '"的数据项?')
|
||||
.then(function () {
|
||||
return deleteEquipment(id);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.queryParams, special: true, specialType: 1 };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal
|
||||
.confirm('是否确认导出所有设备数据项?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportEquipmentExcel(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '安全设备.xls');
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
// 查看详情
|
||||
viewDetail(id) {
|
||||
this.reset();
|
||||
this.editMode = 'detail';
|
||||
this.showUploadComponents = true;
|
||||
this.form.id = id;
|
||||
this.editVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['drawer'].init();
|
||||
});
|
||||
},
|
||||
// overwrite basicPageMixin 里的 处理表格按钮 方法
|
||||
// handleTableBtnClick({ data, type }) {
|
||||
// switch (type) {
|
||||
// case 'edit':
|
||||
// this.reset();
|
||||
// this.editMode = 'edit';
|
||||
// this.showUploadComponents = true;
|
||||
// this.form.id = data.id;
|
||||
// this.editVisible = true;
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs['drawer'].init();
|
||||
// });
|
||||
// break;
|
||||
// case 'delete':
|
||||
// this.handleDelete(data);
|
||||
// break;
|
||||
// case 'detail':
|
||||
// const { id } = data;
|
||||
// this.viewDetail(id);
|
||||
// break;
|
||||
// }
|
||||
// },
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.SpecialEquipmentForSafety {
|
||||
}
|
||||
</style>
|
436
src/views/specialEquipment/check/Config.vue
Normal file
@ -0,0 +1,436 @@
|
||||
<!--
|
||||
filename: Content.vue
|
||||
author: liubin
|
||||
date: 2023-12-12 13:53:22
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="app-container SpecialEquipmentCheckConfig">
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="search-bar"
|
||||
@select-changed="handleSearchBarChange"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:width="180"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<base-dialog
|
||||
:dialogTitle="title"
|
||||
:dialogVisible="open"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="handleConfirm">
|
||||
<add ref="add" @refreshDataList="successSubmit" />
|
||||
</base-dialog>
|
||||
<!-- 添加巡检,查看详情 -->
|
||||
<addOrUpdata
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import addOrUpdata from './add-or-updata.vue';
|
||||
import add from './add.vue';
|
||||
|
||||
export default {
|
||||
name: 'SpecialEquipmentCheckConfig',
|
||||
components: { addOrUpdata, add },
|
||||
mixins: [basicPageMixin],
|
||||
data() {
|
||||
return {
|
||||
addOrUpdateVisible: false,
|
||||
addOrEditTitle: '',
|
||||
searchBarKeys: ['equipmentId', 'name', 'specialType'],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('equipment:check-setting:addInsp')
|
||||
? {
|
||||
type: 'add',
|
||||
btnName: '添加',
|
||||
showTip: '添加巡检',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('equipment:check-setting:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('equipment:check-setting:update')
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '查看详情',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('equipment:check-setting:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
tableProps: [
|
||||
{
|
||||
prop: 'name',
|
||||
label: '配置名',
|
||||
width: 110,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{ prop: 'lineName', label: '产线', showOverflowtooltip: true },
|
||||
{
|
||||
prop: 'equipmentCategory',
|
||||
label: '设备大类',
|
||||
filter: (val) =>
|
||||
val != null ? ['-', '安全', '消防', '特种'][val] : '-',
|
||||
},
|
||||
{ prop: 'equipmentName', label: '设备', showOverflowtooltip: true },
|
||||
{
|
||||
prop: 'equipmentCode',
|
||||
label: '设备编码',
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{ prop: 'responsible', label: '负责人' },
|
||||
{ prop: 'remark', label: '描述' },
|
||||
{ prop: 'checkNumber', label: '巡检条数' }, // TODO: 操作 选项,四个,群里询问
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '配置名称',
|
||||
placeholder: '请输入配置名称',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '设备大类',
|
||||
placeholder: '请选择设备大类',
|
||||
param: 'specialType',
|
||||
onchange: true,
|
||||
selectOptions: [
|
||||
{ id: 1, name: '安全设备' },
|
||||
{ id: 2, name: '消防设备' },
|
||||
{ id: 3, name: '特种设备' },
|
||||
],
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '设备名称',
|
||||
placeholder: '请选择设备',
|
||||
param: 'equipmentId',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('equipment:check-setting:create')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
plain: true,
|
||||
color: 'success',
|
||||
},
|
||||
// {
|
||||
// type: this.$auth.hasPermi('equipment:check-setting:export')
|
||||
// ? 'button'
|
||||
// : '',
|
||||
// btnName: '导出',
|
||||
// name: 'export',
|
||||
// color: 'warning',
|
||||
// },
|
||||
],
|
||||
rows: [
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '配置名称',
|
||||
prop: 'name',
|
||||
rules: [
|
||||
{ required: true, message: '配置名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '配置编码',
|
||||
prop: 'code',
|
||||
url: '/base/equipment-check-config/getCode',
|
||||
rules: [
|
||||
{ required: true, message: '配置编码不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
label: '设备名称',
|
||||
prop: 'equipmentId',
|
||||
url: '/base/core-equipment/listAll',
|
||||
bind: {
|
||||
filterable: true,
|
||||
clearable: true,
|
||||
},
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '设备名称不能为空',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '设备编码', // TODO: 和设备名称联动估计
|
||||
prop: 'equipmentCode',
|
||||
},
|
||||
],
|
||||
],
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
equipmentId: null,
|
||||
name: null,
|
||||
special: true,
|
||||
specialType: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
basePath: '/base/equipment-check-config',
|
||||
mode: null,
|
||||
allSpecialEquipments: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.initSearchBar();
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
handleConfirm() {
|
||||
this.$refs.add.dataFormSubmit();
|
||||
},
|
||||
successSubmit() {
|
||||
this.cancel();
|
||||
this.getList();
|
||||
},
|
||||
initSearchBar() {
|
||||
this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
|
||||
this.allSpecialEquipments = data.filter((item) => item.special);
|
||||
this.setSearchBarEquipmentList(data.filter((item) => item.special));
|
||||
});
|
||||
},
|
||||
// 设备大类改变
|
||||
handleSearchBarChange({ param, value }) {
|
||||
if ('specialType' === param) {
|
||||
if (!value) {
|
||||
this.setSearchBarEquipmentList(this.allSpecialEquipments);
|
||||
return;
|
||||
}
|
||||
this.setSearchBarEquipmentList(
|
||||
this.allSpecialEquipments.filter((item) => item.specialType == value)
|
||||
);
|
||||
}
|
||||
},
|
||||
setSearchBarEquipmentList(eqList) {
|
||||
this.$set(
|
||||
this.searchBarFormConfig[2],
|
||||
'selectOptions',
|
||||
eqList.map((item) => ({
|
||||
name: item.name,
|
||||
id: item.id,
|
||||
}))
|
||||
);
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
this.recv(this.queryParams).then((response) => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.$refs.add.formClear();
|
||||
this.open = false;
|
||||
this.title = '';
|
||||
// this.reset();
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
name: null,
|
||||
content: null,
|
||||
program: null,
|
||||
remark: null,
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm');
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
// this.reset();
|
||||
this.open = true;
|
||||
this.title = '添加巡检设置';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.add.init();
|
||||
});
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
// this.reset();
|
||||
// const id = row.id;
|
||||
// this.info({ id }).then((response) => {
|
||||
// this.form = response.data;
|
||||
// this.open = true;
|
||||
// this.title = '修改巡检设置';
|
||||
// });
|
||||
this.open = true;
|
||||
this.title = '修改巡检设置';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.add.init(row.id);
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
this.put(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
this.post(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal
|
||||
.confirm('是否确认删除配置名为"' + row.name + '"的数据项?')
|
||||
.then(() => {
|
||||
return this.del({ id });
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
// 处理表格按钮
|
||||
handleTableBtnClick({ data, type }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
this.handleUpdate(data);
|
||||
break;
|
||||
case 'delete':
|
||||
this.handleDelete(data);
|
||||
break;
|
||||
case 'detail':
|
||||
this.handleDetail(data);
|
||||
break;
|
||||
case 'add':
|
||||
this.handleAddDetail(data);
|
||||
break;
|
||||
}
|
||||
},
|
||||
handleDetail({ id }) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle = '详情';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id, true);
|
||||
});
|
||||
},
|
||||
handleAddDetail({ id }) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle = '添加巡检';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id);
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.queryParams };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal
|
||||
.confirm('是否确认导出所有巡检设置?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportEquipmentTypeExcel(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '巡检设置.xls');
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.SpecialEquipmentCheckConfig {
|
||||
}
|
||||
</style>
|
334
src/views/specialEquipment/check/Content.vue
Normal file
@ -0,0 +1,334 @@
|
||||
<!--
|
||||
filename: Content.vue
|
||||
author: liubin
|
||||
date: 2023-12-12 13:53:22
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="app-container SpecialEquipmentCheckContent">
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="search-bar"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:width="120"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<base-dialog
|
||||
:dialogTitle="title"
|
||||
:dialogVisible="open"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<DialogForm
|
||||
v-if="open"
|
||||
ref="form"
|
||||
v-model="form"
|
||||
:disabled="mode == 'detail'"
|
||||
:has-files="false"
|
||||
:rows="rows" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import { deleteCheck } from '@/api/equipment/base/inspection/settings';
|
||||
|
||||
export default {
|
||||
name: 'SpecialEquipmentCheckContent',
|
||||
components: {},
|
||||
mixins: [basicPageMixin],
|
||||
data() {
|
||||
return {
|
||||
searchBarKeys: ['content'],
|
||||
tableBtn: [
|
||||
// this.$auth.hasPermi('equipment:check:update')
|
||||
// ? {
|
||||
// type: 'detail',
|
||||
// btnName: '详情',
|
||||
// }
|
||||
// : undefined,
|
||||
this.$auth.hasPermi('equipment:check:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('equipment:check:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
tableProps: [
|
||||
{ prop: 'program', label: '巡检项目', showOverflowtooltip: true },
|
||||
{
|
||||
prop: 'content',
|
||||
label: '巡检内容',
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{ prop: 'code', label: '巡检内容编码', showOverflowtooltip: true },
|
||||
{ prop: 'remark', label: '备注', showOverflowtooltip: true },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '巡检内容',
|
||||
placeholder: '请输入巡检内容',
|
||||
param: 'content',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('equipment:check:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
plain: true,
|
||||
color: 'success',
|
||||
},
|
||||
// {
|
||||
// type: this.$auth.hasPermi('equipment:check:export')
|
||||
// ? 'button'
|
||||
// : '',
|
||||
// btnName: '导出',
|
||||
// name: 'export',
|
||||
// color: 'warning',
|
||||
// },
|
||||
],
|
||||
rows: [
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '巡检内容编号',
|
||||
prop: 'code',
|
||||
url: '/base/equipment-check/getCode',
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '巡检内容编号不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '巡检项目',
|
||||
prop: 'program',
|
||||
rules: [
|
||||
{ required: true, message: '巡检项目不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '巡检内容',
|
||||
prop: 'content',
|
||||
rules: [
|
||||
{ required: true, message: '巡检内容不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '备注',
|
||||
prop: 'remark',
|
||||
},
|
||||
],
|
||||
],
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
content: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
code: '',
|
||||
program: '',
|
||||
id: undefined,
|
||||
content: '',
|
||||
},
|
||||
basePath: '/base/equipment-check',
|
||||
mode: null,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// this.initSearchBar();
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
// initSearchBar() {
|
||||
// this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
|
||||
// this.$set(
|
||||
// this.searchBarFormConfig[0],
|
||||
// 'selectOptions',
|
||||
// data.map((item) => ({
|
||||
// name: item.name,
|
||||
// id: item.id,
|
||||
// }))
|
||||
// );
|
||||
// });
|
||||
// },
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
this.recv(this.queryParams).then((response) => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.mode = null;
|
||||
this.reset();
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
name: null,
|
||||
content: null,
|
||||
program: null,
|
||||
remark: null,
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm');
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
// this.reset();
|
||||
this.open = true;
|
||||
this.title = '添加巡检内容';
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id;
|
||||
this.info({ id }).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = '修改巡检内容';
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
this.put(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
this.post(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal
|
||||
.confirm('是否确认删除该巡检项目?')
|
||||
.then(function () {
|
||||
// return this.del({ id });
|
||||
return deleteCheck(id);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
handleDetail({ id }) {
|
||||
this.reset();
|
||||
this.mode = 'detail';
|
||||
this.info({ id }).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = '修改巡检内容';
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.queryParams };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal
|
||||
.confirm('是否确认导出所有巡检内容?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportEquipmentTypeExcel(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '巡检内容.xls');
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.SpecialEquipmentCheckContent {
|
||||
}
|
||||
</style>
|
504
src/views/specialEquipment/check/Record-add.vue
Normal file
@ -0,0 +1,504 @@
|
||||
<!--
|
||||
filename: dialogForm.vue
|
||||
author: liubin
|
||||
date: 2023-10-31 15:55:13
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-drawer
|
||||
ref="drawer"
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="isdetail"
|
||||
class="drawer"
|
||||
size="55%"
|
||||
@closed="$emit('destroy')">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
{{ isdetail ? '查看详情' : !dataForm.id ? '新增' : '编辑' }}
|
||||
</small-title>
|
||||
|
||||
<el-form
|
||||
ref="dataForm"
|
||||
style="margin: 0 16px; padding: 0 16px"
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
label-width="100px"
|
||||
label-position="top"
|
||||
v-loading="formLoading">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="设备大类"
|
||||
prop="equipmentCategory"
|
||||
:rules="[
|
||||
{ required: true, message: '请选择设备大类', trigger: 'blur' },
|
||||
]">
|
||||
<el-select
|
||||
v-model="dataForm.equipmentCategory"
|
||||
:disabled="isdetail"
|
||||
:placeholder="`请选择设备大类`"
|
||||
filterable
|
||||
@change="handleEqTypeChange">
|
||||
<el-option
|
||||
v-for="opt in equipmentTypeOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="设备名称"
|
||||
prop="equipmentId"
|
||||
:rules="[
|
||||
{ required: true, message: '设备不能为空', trigger: 'blur' },
|
||||
]">
|
||||
<el-select
|
||||
v-model="dataForm.equipmentId"
|
||||
filterable
|
||||
clearable
|
||||
:disabled="isdetail"
|
||||
style="width: 100%"
|
||||
placeholder="请选择设备名称"
|
||||
@change="setConfig">
|
||||
<el-option
|
||||
v-for="dict in equipmentOptions"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<!-- <el-form-item label="物料名称" prop="name">
|
||||
<el-input v-model="dataForm.name" :disabled="isdetail" clearable placeholder="请输入物料名称" />
|
||||
</el-form-item> -->
|
||||
<el-form-item
|
||||
label="巡检配置名称"
|
||||
prop="configId"
|
||||
:rules="[
|
||||
{ required: true, message: '巡检配置不能为空', trigger: 'blur' },
|
||||
]">
|
||||
<el-select
|
||||
v-model="dataForm.configId"
|
||||
filterable
|
||||
clearable
|
||||
:disabled="isdetail"
|
||||
style="width: 100%"
|
||||
placeholder="请选择巡检配置"
|
||||
@change="setInspectionContet">
|
||||
<el-option
|
||||
v-for="dict in configList"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备编码" prop="equipmentCode">
|
||||
<el-input
|
||||
v-model="dataForm.equipmentCode"
|
||||
disabled
|
||||
clearable
|
||||
placeholder="请输入设备编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="巡检人" prop="responsible">
|
||||
<el-input
|
||||
v-model="dataForm.responsible"
|
||||
:disabled="isdetail"
|
||||
clearable
|
||||
placeholder="请输入巡检人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="巡检时间" prop="actualTime">
|
||||
<el-date-picker
|
||||
v-model="dataForm.actualTime"
|
||||
type="datetime"
|
||||
:disabled="isdetail"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
value-format="timestamp"
|
||||
placeholder="选择巡检时间" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="数据来源" prop="origin">
|
||||
<el-select
|
||||
v-model="dataForm.origin"
|
||||
filterable
|
||||
clearable
|
||||
:disabled="isdetail"
|
||||
style="width: 100%"
|
||||
placeholder="请选择数据来源">
|
||||
<el-option key="1" label="手动" :value="1" />
|
||||
<el-option key="2" label="PDA" :value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="巡检内容">
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:table-data="list" />
|
||||
</el-form-item>
|
||||
<el-form-item label="巡检详情" prop="description">
|
||||
<editor
|
||||
v-if="!isdetail"
|
||||
v-model="dataForm.description"
|
||||
:min-height="150" />
|
||||
<div
|
||||
v-else
|
||||
v-html="dataForm.description"
|
||||
style="padding: 5px; margin-left: 5px; border: 1px solid #dfdfdf" />
|
||||
</el-form-item>
|
||||
<el-form-item label="附件">
|
||||
<FileUpload
|
||||
v-model="file"
|
||||
:limit="1"
|
||||
:f-name="fileName"
|
||||
:disabled="isdetail"
|
||||
@name="setFileName" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div v-if="!isdetail" class="drawer-body__footer">
|
||||
<el-button @click="goback()">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SmallTitle from './SmallTitle.vue';
|
||||
import {
|
||||
createCheckLog,
|
||||
updateCheckLog,
|
||||
getcheckConfigByEqList,
|
||||
getEqCheckLog,
|
||||
} from '@/api/equipment/base/inspection/record';
|
||||
import { getEquipmentAll } from '@/api/base/equipment';
|
||||
import Editor from '@/components/Editor';
|
||||
import { getCheckDetPage } from '@/api/equipment/base/inspection/settings';
|
||||
// import FileUpload from "@/components/FileUpload";
|
||||
// import { parseTime } from '../../../../core/mixins/code-filter';
|
||||
// import attrAdd from './attr-add';
|
||||
import FileUpload from '@/components/FileUpload';
|
||||
|
||||
const tableBtn = [
|
||||
{
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
},
|
||||
];
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'program',
|
||||
label: '巡检项目',
|
||||
},
|
||||
{
|
||||
prop: 'content',
|
||||
label: '巡检内容',
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
name: 'AddRecord',
|
||||
model: {
|
||||
prop: 'dataForm',
|
||||
event: 'update',
|
||||
},
|
||||
emits: ['update'],
|
||||
components: { SmallTitle, Editor, FileUpload },
|
||||
props: {
|
||||
// dataForm: {
|
||||
// type: Object,
|
||||
// default: () => ({}),
|
||||
// },
|
||||
// disabled: {
|
||||
// type: Boolean,
|
||||
// default: false
|
||||
// },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableBtn,
|
||||
tableProps,
|
||||
addOrUpdateVisible: false,
|
||||
formLoading: true,
|
||||
visible: false,
|
||||
isdetail: false,
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
configId: undefined,
|
||||
equipmentId: undefined,
|
||||
actualTime: undefined,
|
||||
responsible: undefined,
|
||||
description: undefined,
|
||||
equipmentCode: undefined,
|
||||
equipmentCategory: undefined,
|
||||
origin: 1,
|
||||
files: [],
|
||||
},
|
||||
equipmentTypeOptions: [
|
||||
{ label: '安全设备', value: 1 },
|
||||
{ label: '消防设备', value: 2 },
|
||||
{ label: '特种设备', value: 3 },
|
||||
],
|
||||
list: [],
|
||||
eqList: [],
|
||||
configList: [],
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
total: 0,
|
||||
},
|
||||
file: '',
|
||||
fileName: '',
|
||||
dataRule: {
|
||||
responsible: [
|
||||
{ required: true, message: '巡检人不能为空', trigger: 'blur' },
|
||||
],
|
||||
actualTime: [
|
||||
{ required: true, message: '巡检时间不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getDict();
|
||||
},
|
||||
methods: {
|
||||
setFileName(val) {
|
||||
this.fileName = val;
|
||||
},
|
||||
async getDict() {
|
||||
const res = await getEquipmentAll();
|
||||
this.eqList = res.data;
|
||||
this.handleEqTypeChange();
|
||||
|
||||
const configres = await getcheckConfigByEqList();
|
||||
this.configList = configres.data;
|
||||
},
|
||||
async setConfig() {
|
||||
const configres = await getcheckConfigByEqList({
|
||||
equipmentId: this.dataForm.equipmentId,
|
||||
});
|
||||
this.configList = configres.data;
|
||||
this.dataForm.configId =
|
||||
this.configList.filter((it) => {
|
||||
return it.id === this.dataForm.configId;
|
||||
})[0]?.id ?? undefined;
|
||||
this.dataForm.equipmentCode =
|
||||
this.eqList.filter((item) => {
|
||||
return item.id === this.dataForm.equipmentId;
|
||||
})[0]?.code ?? undefined;
|
||||
},
|
||||
goback() {
|
||||
this.$emit('refreshDataList');
|
||||
this.visible = false;
|
||||
},
|
||||
goEdit() {
|
||||
this.isdetail = false;
|
||||
},
|
||||
/** 模拟透传 ref */
|
||||
validate(cb) {
|
||||
return this.$refs.dataForm.validate(cb);
|
||||
},
|
||||
resetFields(args) {
|
||||
return this.$refs.dataForm.resetFields(args);
|
||||
},
|
||||
initData() {
|
||||
this.list = [];
|
||||
this.file = '';
|
||||
this.fileName = '';
|
||||
},
|
||||
init(id, isdetail) {
|
||||
this.initData();
|
||||
this.isdetail = isdetail || false;
|
||||
this.dataForm.id = id || undefined;
|
||||
this.visible = true;
|
||||
|
||||
// const scrollContainer = this.$refs.dataForm;
|
||||
// const scrollPosition = scrollContainer.scrollTop;
|
||||
// console.log('12', scrollPosition);
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
|
||||
if (this.dataForm.id) {
|
||||
// 获取巡检记录
|
||||
getEqCheckLog(this.dataForm.id).then((response) => {
|
||||
this.formLoading = false;
|
||||
this.dataForm = response.data;
|
||||
if (this.dataForm.files.length > 0) {
|
||||
this.file = this.dataForm.files[0].fileUrl;
|
||||
this.fileName = this.dataForm.files[0].fileName;
|
||||
}
|
||||
this.dataForm.description = this.dataForm.description || '无';
|
||||
this.setConfig();
|
||||
this.setInspectionContet();
|
||||
});
|
||||
} else {
|
||||
// if (this.urlOptions.isGetCode) {
|
||||
// this.getCode()
|
||||
// }
|
||||
}
|
||||
});
|
||||
this.formLoading = false;
|
||||
},
|
||||
setInspectionContet() {
|
||||
// 根据巡检配置名称获得巡检配置详细对应巡检内容
|
||||
getCheckDetPage({
|
||||
pageNo: 1,
|
||||
pageSize: 99,
|
||||
configId: this.dataForm.configId,
|
||||
}).then((response) => {
|
||||
this.list = response.data.list;
|
||||
this.listQuery.total = response.data.total;
|
||||
});
|
||||
},
|
||||
// 新增 / 修改
|
||||
addNew(id) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id);
|
||||
});
|
||||
},
|
||||
handleEqTypeChange(type) {
|
||||
this.dataForm.equipmentId = null;
|
||||
this.dataForm.equipmentCode = null;
|
||||
if (type) {
|
||||
this.equipmentOptions = this.eqList
|
||||
.filter((item) => item.special)
|
||||
.filter((item) => item.specialType === type)
|
||||
.map((item) => ({ label: item.name, value: item.id }));
|
||||
} else
|
||||
this.equipmentOptions = this.eqList
|
||||
// .filter((item) => item.special)
|
||||
.map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
// this.$emit('update', this.form)
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
if (this.file) {
|
||||
const temp = this.file.split(','); // 获取文件个数
|
||||
let arry = [];
|
||||
temp.forEach((item, index) => {
|
||||
arry.push({
|
||||
fileName: this.fileName,
|
||||
fileType: 2,
|
||||
fileUrl: item,
|
||||
});
|
||||
});
|
||||
this.dataForm.files = arry;
|
||||
} else {
|
||||
this.dataForm.files = [];
|
||||
}
|
||||
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
updateCheckLog(this.dataForm).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createCheckLog(this.dataForm).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-date-editor,
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
.drawer-body__footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 18px;
|
||||
}
|
||||
.action_btn {
|
||||
float: right;
|
||||
margin: 5px 15px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.add {
|
||||
color: #0b58ff;
|
||||
}
|
||||
.drawer >>> .el-drawer {
|
||||
border-radius: 8px 0 0 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.drawer >>> .el-form-item__label {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.drawer >>> .el-drawer__header {
|
||||
margin: 0;
|
||||
padding: 32px 32px 24px;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
}
|
||||
.drawer >>> .el-drawer__body {
|
||||
flex: 1;
|
||||
height: 1px;
|
||||
margin: 10px 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.drawer >>> .content {
|
||||
padding: 30px 24px;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/* height: 100%; */
|
||||
}
|
||||
|
||||
.drawer >>> .visual-part {
|
||||
flex: 1 auto;
|
||||
max-height: 76vh;
|
||||
overflow: hidden;
|
||||
overflow-y: scroll;
|
||||
padding-right: 10px; /* 调整滚动条样式 */
|
||||
}
|
||||
|
||||
.drawer >>> .el-form,
|
||||
.drawer >>> .attr-list {
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
.drawer-body__footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 18px;
|
||||
}
|
||||
</style>
|
449
src/views/specialEquipment/check/Record.vue
Normal file
@ -0,0 +1,449 @@
|
||||
<!--
|
||||
filename: Record.vue
|
||||
author: liubin
|
||||
date: 2023-12-12 13:53:22
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="app-container SpecialEquipmentCheckRecord">
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="search-bar"
|
||||
@select-changed="handleSearchBarChange"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:width="120"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<base-dialog
|
||||
:dialogTitle="title"
|
||||
:dialogVisible="open"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<DialogForm
|
||||
v-if="open"
|
||||
ref="form"
|
||||
v-model="form"
|
||||
:disabled="mode == 'detail'"
|
||||
:has-files="true"
|
||||
:rows="rows" />
|
||||
</base-dialog>
|
||||
|
||||
<addRecord
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="getList"
|
||||
@destroy="addOrUpdateVisible = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import addRecord from './Record-add.vue';
|
||||
import {
|
||||
exportCheckLogExcel,
|
||||
deleteEqCheckLog,
|
||||
} from '@/api/equipment/base/inspection/record';
|
||||
import { parseTime } from '../../core/mixins/code-filter';
|
||||
|
||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
export default {
|
||||
name: 'SpecialEquipmentCheckRecord',
|
||||
components: { addRecord },
|
||||
mixins: [basicPageMixin],
|
||||
data() {
|
||||
return {
|
||||
addOrUpdateVisible: false,
|
||||
searchBarKeys: ['equipmentId', 'actualTime', 'specialType'],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('equipment:check-record:detail')
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('equipment:check-record:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('equipment:check-record:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
tableProps: [
|
||||
{ prop: 'configName', label: '配置名称' },
|
||||
{ prop: 'equipmentName', label: '设备名称' },
|
||||
{
|
||||
prop: 'origin',
|
||||
label: '数据来源',
|
||||
filter: (val) => ['', '手动', 'PDA'][val],
|
||||
},
|
||||
// { prop: 'sectionName', label: '计划巡检时间' },
|
||||
{ prop: 'actualTime', label: '实际巡检时间', filter: parseTime },
|
||||
// { prop: 'maintenanceDetail', label: '完成状态' },
|
||||
{ prop: 'responsible', label: '巡检人' },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '设备大类',
|
||||
placeholder: '请选择设备大类',
|
||||
param: 'specialType',
|
||||
onchange: true,
|
||||
selectOptions: [
|
||||
{ id: 1, name: '安全设备' },
|
||||
{ id: 2, name: '消防设备' },
|
||||
{ id: 3, name: '特种设备' },
|
||||
],
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '设备',
|
||||
placeholder: '请选择设备',
|
||||
param: 'equipmentId',
|
||||
filterable: true,
|
||||
},
|
||||
// 开始结束时间
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间段',
|
||||
dateType: 'daterange', // datetimerange
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始日期',
|
||||
endPlaceholder: '结束日期',
|
||||
defaultTime: ['00:00:00', '23:59:59'],
|
||||
param: 'actualTime',
|
||||
// width: 350,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('equipment:check-record:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
plain: true,
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('equipment:check-record:create')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
rows: [
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '维修单号',
|
||||
prop: 'repairOrderNumber',
|
||||
},
|
||||
{
|
||||
select: true,
|
||||
label: '设备名称',
|
||||
prop: 'equipmentId',
|
||||
url: '/base/core-equipment/listAll',
|
||||
bind: {
|
||||
filterable: true,
|
||||
clearable: true,
|
||||
},
|
||||
rules: [
|
||||
{ required: true, message: '设备名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
// TODO: 和班组联动
|
||||
select: true,
|
||||
label: '维修工',
|
||||
prop: 'repairman',
|
||||
// url: '/base/core-equipment/listAll',
|
||||
bind: {
|
||||
filterable: true,
|
||||
clearable: true,
|
||||
multiple: true,
|
||||
},
|
||||
rules: [
|
||||
{ required: true, message: '维修工不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '联系方式',
|
||||
prop: 'repairmanPhone',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
datetime: true,
|
||||
label: '故障发生时间',
|
||||
prop: 'faultTime',
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '故障发生时间不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
bind: {
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
'value-format': 'timestamp',
|
||||
// 'value-format': 'yyyy-MM-dd HH:mm:ss',
|
||||
clearable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
select: true,
|
||||
label: '故障级别',
|
||||
prop: 'faultLevel', // 数据字典
|
||||
options: this.getDictDatas(this.DICT_TYPE.FAULT_LEVEL),
|
||||
},
|
||||
],
|
||||
],
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
maintenanceStatus: null,
|
||||
createTime: null,
|
||||
equipmentId: null,
|
||||
special: true,
|
||||
specialType: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
basePath: '/base/equipment-check-log',
|
||||
mode: null,
|
||||
allSpecialEquipments: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.initSearchBar();
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
initSearchBar() {
|
||||
this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
|
||||
this.allSpecialEquipments = data.filter((item) => item.special);
|
||||
this.setSearchBarEquipmentList(data.filter((item) => item.special));
|
||||
});
|
||||
},
|
||||
// 设备大类改变
|
||||
handleSearchBarChange({ param, value }) {
|
||||
if ('specialType' === param) {
|
||||
if (!value) {
|
||||
this.setSearchBarEquipmentList(this.allSpecialEquipments);
|
||||
return;
|
||||
}
|
||||
this.setSearchBarEquipmentList(
|
||||
this.allSpecialEquipments.filter((item) => item.specialType == value)
|
||||
);
|
||||
}
|
||||
},
|
||||
setSearchBarEquipmentList(eqList) {
|
||||
this.$set(
|
||||
this.searchBarFormConfig[1],
|
||||
'selectOptions',
|
||||
eqList.map((item) => ({
|
||||
name: item.name,
|
||||
id: item.id,
|
||||
}))
|
||||
);
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
this.recv(this.queryParams).then((response) => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.mode = null;
|
||||
this.reset();
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
repairOrderNumber: null,
|
||||
equipmentId: null,
|
||||
repairman: null,
|
||||
repairmanPhone: null,
|
||||
faultTime: null,
|
||||
faultLevel: null,
|
||||
maintenanceStartTime: null,
|
||||
maintenanceFinishTime: null,
|
||||
faultType: null,
|
||||
repairMode: null,
|
||||
maintenanceStatus: null,
|
||||
faultDetail: null,
|
||||
maintenanceDetail: null,
|
||||
remark: null,
|
||||
files: [
|
||||
// {
|
||||
// fileName: '',
|
||||
// fileType: '',
|
||||
// fileUrl: '',
|
||||
// },
|
||||
],
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm');
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
// this.reset();
|
||||
// this.open = true;
|
||||
// this.title = '添加维修记录';
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init();
|
||||
});
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
// this.reset();
|
||||
// const id = row.id;
|
||||
// this.info({ id }).then((response) => {
|
||||
// this.form = response.data;
|
||||
// this.open = true;
|
||||
// this.title = '修改维修记录';
|
||||
// });
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(row.id);
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
this.put(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
this.post(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal
|
||||
.confirm(
|
||||
'是否删除设备巡检记录配置名称为"' + row.configName + '"的数据项?'
|
||||
)
|
||||
.then(function () {
|
||||
return deleteEqCheckLog(id);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
handleDetail({ id }) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id, true);
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.queryParams };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal
|
||||
.confirm('是否确认导出所有设备巡检记录?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportCheckLogExcel(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '设备巡检记录.xls');
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.SpecialEquipmentCheckRecord {
|
||||
}
|
||||
</style>
|
65
src/views/specialEquipment/check/SmallTitle.vue
Normal file
@ -0,0 +1,65 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-01 15:27:31
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-08-01 16:25:54
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div :class="[className, { 'p-0': noPadding }]">
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
size: {
|
||||
// 取值范围: xl lg md sm
|
||||
type: String,
|
||||
default: 'de',
|
||||
validator: function (val) {
|
||||
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
|
||||
},
|
||||
},
|
||||
noPadding: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
className: function () {
|
||||
return `${this.size}-title`;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
|
||||
$mgr: 8px;
|
||||
@each $size, $height in $pxls {
|
||||
.#{$size}-title {
|
||||
font-size: 18px;
|
||||
line-height: $height;
|
||||
color: #000;
|
||||
font-weight: 500;
|
||||
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: 4px;
|
||||
height: $height + 2px;
|
||||
border-radius: 1px;
|
||||
margin-right: $mgr;
|
||||
background-color: #0b58ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.p-0 {
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
341
src/views/specialEquipment/check/add-or-updata.vue
Normal file
@ -0,0 +1,341 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-12-01 11:02:43
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="true"
|
||||
class="drawer"
|
||||
size="50%">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
{{ isdetail ? '详情' : '添加巡检' }}
|
||||
</small-title>
|
||||
<div class="content">
|
||||
<div class="visual-part">
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-position="top">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备大类" prop="equipmentCategory">
|
||||
<span>
|
||||
{{
|
||||
['-', '安全设备', '消防设备', '特种设备'][
|
||||
dataForm.equipmentCategory || 0
|
||||
]
|
||||
}}
|
||||
</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备名称" prop="equipmentName">
|
||||
{{ dataForm.equipmentName }}
|
||||
<!-- <el-input v-model="dataForm.equipmentName" disabled clearable placeholder="请输入设备名称" /> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备编码" prop="equipmentCode">
|
||||
{{ dataForm.equipmentCode }}
|
||||
<!-- <el-input
|
||||
v-model="dataForm.equipmentCode"
|
||||
clearable
|
||||
disabled
|
||||
placeholder="请输入设备编码" /> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<el-divider />
|
||||
|
||||
<div class="attr-list">
|
||||
<small-title
|
||||
style="margin: 16px 0; padding-left: 8px"
|
||||
:no-padding="true">
|
||||
巡检项目
|
||||
</small-title>
|
||||
|
||||
<div v-if="!isdetail" class="action_btn">
|
||||
<template>
|
||||
<span style="display: inline-block">
|
||||
<el-button type="text" @click="addNew()" icon="el-icon-plus">
|
||||
添加
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</div>
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:table-data="checkDetList">
|
||||
<method-btn
|
||||
v-if="!isdetail"
|
||||
slot="handleBtn"
|
||||
:width="120"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<pagination
|
||||
v-show="listQuery.total > 0"
|
||||
:total="listQuery.total"
|
||||
:page.sync="listQuery.pageNo"
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:page-sizes="[5, 10, 15]"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- <div class="drawer-body__footer">
|
||||
<el-button type="primary" @click="goback()">关闭</el-button>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<attr-add
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
:config-id="dataForm.id"
|
||||
@refreshDataList="getList" />
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getEqCheck,
|
||||
getCheckDetPage,
|
||||
deleteCheckDet,
|
||||
} from '@/api/equipment/base/inspection/settings';
|
||||
import SmallTitle from './SmallTitle';
|
||||
import attrAdd from './attr-add';
|
||||
import { DICT_TYPE, getDictDatas } from '@/utils/dict';
|
||||
|
||||
const tableBtn = [
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
},
|
||||
{
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
},
|
||||
];
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'program',
|
||||
label: '巡检项目',
|
||||
},
|
||||
{
|
||||
prop: 'content',
|
||||
label: '巡检内容',
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '巡检内容编码',
|
||||
},
|
||||
{
|
||||
prop: 'description',
|
||||
label: '备注',
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
components: { SmallTitle, attrAdd },
|
||||
data() {
|
||||
return {
|
||||
tableBtn,
|
||||
tableProps,
|
||||
addOrUpdateVisible: false,
|
||||
urlOptions: {
|
||||
infoURL: getEqCheck,
|
||||
},
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
total: 0,
|
||||
},
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
code: undefined,
|
||||
name: '',
|
||||
materialType: undefined,
|
||||
productType: undefined,
|
||||
area: undefined,
|
||||
specifications: undefined,
|
||||
processTime: 0,
|
||||
remark: undefined,
|
||||
unit: undefined,
|
||||
},
|
||||
checkDetList: [],
|
||||
visible: false,
|
||||
isdetail: false,
|
||||
dataRule: {
|
||||
code: [
|
||||
{ required: true, message: '物料编码不能为空', trigger: 'blur' },
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '物料名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
materialType: [
|
||||
{ required: true, message: '物料类型不能为空', trigger: 'change' },
|
||||
],
|
||||
productType: [
|
||||
{ required: true, message: '产品类型不能为空', trigger: 'change' },
|
||||
],
|
||||
processTime: [
|
||||
{
|
||||
required: true,
|
||||
message: '产线生产单位用时不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
initData() {
|
||||
this.checkDetList.splice(0);
|
||||
this.listQuery.total = 0;
|
||||
},
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(
|
||||
`是否确认删除巡检项目名称为"${raw.data.program}"的数据项?`,
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
deleteCheckDet(raw.data.id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
} else {
|
||||
this.addNew(raw.data.id);
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
// 获取巡检项目分页
|
||||
getCheckDetPage({
|
||||
...this.listQuery,
|
||||
configId: this.dataForm.id,
|
||||
}).then((response) => {
|
||||
this.checkDetList = response.data.list;
|
||||
this.listQuery.total = response.data.total;
|
||||
});
|
||||
},
|
||||
init(id, isdetail) {
|
||||
this.initData();
|
||||
this.isdetail = isdetail || false;
|
||||
this.dataForm.id = id || undefined;
|
||||
this.visible = true;
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
|
||||
if (this.dataForm.id) {
|
||||
// 获取设备巡检详情
|
||||
this.urlOptions.infoURL(id).then((response) => {
|
||||
this.dataForm = response.data;
|
||||
});
|
||||
// 获取设备项目列表
|
||||
this.getList();
|
||||
} else {
|
||||
if (this.urlOptions.isGetCode) {
|
||||
this.getCode();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
goback() {
|
||||
this.$emit('refreshDataList');
|
||||
this.visible = false;
|
||||
// this.initData();
|
||||
},
|
||||
goEdit() {
|
||||
this.isdetail = false;
|
||||
},
|
||||
// 新增 / 修改
|
||||
addNew(id) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id);
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.drawer >>> .el-drawer {
|
||||
border-radius: 8px 0 0 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.drawer >>> .el-form-item__label {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.drawer >>> .el-drawer__header {
|
||||
margin: 0;
|
||||
padding: 32px 32px 24px;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
}
|
||||
.drawer >>> .el-drawer__body {
|
||||
flex: 1;
|
||||
height: 1px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.drawer >>> .content {
|
||||
padding: 30px 24px;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/* height: 100%; */
|
||||
}
|
||||
|
||||
.drawer >>> .visual-part {
|
||||
/* flex: 1 auto; */
|
||||
padding-right: 10px; /* 调整滚动条样式 */
|
||||
}
|
||||
|
||||
.drawer >>> .el-form {
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
.drawer-body__footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 18px;
|
||||
}
|
||||
.action_btn {
|
||||
float: right;
|
||||
margin: -40px 15px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.add {
|
||||
color: #0b58ff;
|
||||
}
|
||||
</style>
|
167
src/views/specialEquipment/check/add.vue
Normal file
@ -0,0 +1,167 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-25 16:23:13
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="配置名称" prop="name">
|
||||
<el-input v-model="dataForm.name" placeholder="请输入配置名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="配置编码" prop="code">
|
||||
<el-input v-model="dataForm.code" placeholder="请输入配置编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="设备大类"
|
||||
prop="equipmentCategory"
|
||||
:rules="[
|
||||
{ required: true, message: '请选择设备大类', trigger: 'blur' },
|
||||
]">
|
||||
<el-select
|
||||
v-model="dataForm.equipmentCategory"
|
||||
:placeholder="`请选择设备大类`"
|
||||
@change="handleEqTypeChange">
|
||||
<el-option
|
||||
v-for="opt in equipmentTypeOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设备名称" prop="equipmentId">
|
||||
<el-select
|
||||
v-model="dataForm.equipmentId"
|
||||
filterable
|
||||
style="width: 100%"
|
||||
placeholder="请选择设备名称"
|
||||
@change="setCode">
|
||||
<el-option
|
||||
v-for="d in equipmentOptions"
|
||||
:key="d.value"
|
||||
:label="d.label"
|
||||
:value="d.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设备编码" prop="equipmentCode">
|
||||
<el-input
|
||||
v-model="dataForm.equipmentCode"
|
||||
disabled
|
||||
placeholder="请输入设备编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from '../../core/mixins/basic-add';
|
||||
import {
|
||||
getEqCheck,
|
||||
getCode,
|
||||
createCheckConfig,
|
||||
updateCheckConfig,
|
||||
} from '@/api/equipment/base/inspection/settings';
|
||||
import { getEquipmentAll } from '@/api/base/equipment';
|
||||
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
isGetCode: true,
|
||||
codeURL: getCode,
|
||||
createURL: createCheckConfig,
|
||||
updateURL: updateCheckConfig,
|
||||
infoURL: getEqCheck,
|
||||
},
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
code: undefined,
|
||||
name: undefined,
|
||||
equipmentId: undefined,
|
||||
equipmentCode: undefined,
|
||||
equipmentCategory: undefined,
|
||||
},
|
||||
eqList: [],
|
||||
dataRule: {
|
||||
equipmentId: [
|
||||
{ required: true, message: '设备不能为空', trigger: 'blur' },
|
||||
],
|
||||
code: [
|
||||
{ required: true, message: '配置编码不能为空', trigger: 'blur' },
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '配置名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
equipmentOptions: [],
|
||||
equipmentTypeOptions: [
|
||||
{ label: '安全设备', value: 1 },
|
||||
{ label: '消防设备', value: 2 },
|
||||
{ label: '特种设备', value: 3 },
|
||||
],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getDict();
|
||||
},
|
||||
methods: {
|
||||
async getDict() {
|
||||
// 设备列表
|
||||
const res = await getEquipmentAll();
|
||||
this.eqList = res.data;
|
||||
this.$nextTick(() => {
|
||||
this.handleEqTypeChange();
|
||||
});
|
||||
},
|
||||
setCode() {
|
||||
const chooseM = this.eqList.filter((item) => {
|
||||
return item.id === this.dataForm.equipmentId;
|
||||
});
|
||||
this.dataForm.equipmentCode = chooseM[0].code;
|
||||
},
|
||||
// handlers
|
||||
handleEqTypeChange(type) {
|
||||
this.dataForm.equipmentId = null;
|
||||
this.dataForm.equipmentCode = null;
|
||||
if (type) {
|
||||
this.equipmentOptions = this.eqList
|
||||
.filter((item) => item.special)
|
||||
.filter((item) => item.specialType === type)
|
||||
.map((item) => ({ label: item.name, value: item.id }));
|
||||
} else
|
||||
this.equipmentOptions = this.eqList
|
||||
.filter((item) => item.special)
|
||||
.map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
// this.$emit('update', this.form)
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.el-date-editor,
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
145
src/views/specialEquipment/check/attr-add.vue
Normal file
@ -0,0 +1,145 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:visible.sync="visible"
|
||||
:width="'30%'"
|
||||
:append-to-body="true"
|
||||
:close-on-click-modal="false"
|
||||
class="dialog">
|
||||
<template #title>
|
||||
<slot name="title">
|
||||
<div class="titleStyle">
|
||||
{{ !dataForm.id ? '新增' : '编辑' }}
|
||||
</div>
|
||||
</slot>
|
||||
</template>
|
||||
|
||||
<el-form
|
||||
ref="dataForm"
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
label-width="60px"
|
||||
@keyup.enter.native="dataFormSubmit()">
|
||||
<el-form-item label="巡检" prop="checkId">
|
||||
<el-select v-model="dataForm.checkId" filterable placeholder="请选择巡检" style="width: 100%">
|
||||
<el-option v-for="dict in checkList" :key="dict.id" :label="dict.content"
|
||||
:value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="description">
|
||||
<el-input
|
||||
v-model="dataForm.description"
|
||||
placeholder="请输入备注"
|
||||
clearable />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row style="text-align: right">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getCheckDet, createCheckDet, updateCheckDet, getcheckList } from "@/api/equipment/base/inspection/settings";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
configId: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
checkId: undefined,
|
||||
configId: undefined,
|
||||
description: ''
|
||||
},
|
||||
checkList: [],
|
||||
dataRule: {
|
||||
checkId: [{ required: true, message: '巡检不能为空', trigger: 'blur' }],
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
async getDict() {
|
||||
const res = await getcheckList()
|
||||
this.checkList = res.data
|
||||
},
|
||||
init(id) {
|
||||
this.dataForm.id = id || '';
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
getCheckDet(this.dataForm.id).then((res) => {
|
||||
// const { name, value } = res.data;
|
||||
// this.dataForm.name = name;
|
||||
// this.dataForm.value = value;
|
||||
this.dataForm = res.data
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
updateCheckDet({
|
||||
...this.dataForm,
|
||||
configId: this.configId
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createCheckDet({
|
||||
...this.dataForm,
|
||||
configId: this.configId,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.dialog >>> .el-dialog__body {
|
||||
padding: 30px 24px;
|
||||
}
|
||||
.dialog >>> .el-dialog__header {
|
||||
font-size: 16px;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
font-weight: 500;
|
||||
padding: 13px 24px;
|
||||
border-bottom: 1px solid #e9e9e9;
|
||||
}
|
||||
.dialog >>> .el-dialog__header .titleStyle::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
background-color: #0b58ff;
|
||||
border-radius: 1px;
|
||||
margin-right: 8px;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
</style>
|
399
src/views/specialEquipment/components/AssetsUpload.vue
Normal file
@ -0,0 +1,399 @@
|
||||
<!--
|
||||
filename: AssetsUpload.vue
|
||||
author: liubin
|
||||
date: 2023-10-12 16:40:14
|
||||
description: 上传资料/图片 组件
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="assets-upload">
|
||||
<section class="operations">
|
||||
<el-button type="text" class="expand-btn" @click="expand = !expand">
|
||||
<i class="el-icon-folder-opened" v-if="expand"></i>
|
||||
<i class="el-icon-folder" v-else></i>
|
||||
展开
|
||||
</el-button>
|
||||
<!-- <div class="preview-btn">
|
||||
<i class="el-icon-view"></i>
|
||||
预览
|
||||
</div> -->
|
||||
</section>
|
||||
<section
|
||||
class="file-area"
|
||||
:style="{
|
||||
height: expand ? 'auto' : isPicMode ? '180px' : '152px',
|
||||
gap: isPicMode ? '0 24px' : '24px',
|
||||
gridAutoRows: isPicMode ? '180px' : '152px',
|
||||
}">
|
||||
<el-upload
|
||||
class="equipment-upload"
|
||||
:disabled="disabled"
|
||||
drag
|
||||
:action="uploadUrl"
|
||||
:headers="headers"
|
||||
multiple
|
||||
:show-file-list="false"
|
||||
:before-upload="beforeUpload"
|
||||
:on-success="handleSuccess">
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">
|
||||
<span>将文件拖到此处或</span>
|
||||
<em>点击上传</em>
|
||||
</div>
|
||||
<div class="el-upload__tip" slot="tip">
|
||||
{{
|
||||
isPicMode ? '仅支持上传 .jpg .png 格式文件, 且' : ''
|
||||
}}文件大小不超过2MB
|
||||
</div>
|
||||
</el-upload>
|
||||
<div
|
||||
v-for="(file, index) in files"
|
||||
:key="file.fileName"
|
||||
style="width: 100%">
|
||||
<div
|
||||
class="file-list__item"
|
||||
v-if="!isPicMode"
|
||||
:style="{
|
||||
background: isPicMode
|
||||
? `url(${file.fileUrl}) no-repeat`
|
||||
: `url(${defaultBg}) no-repeat`,
|
||||
backgroundSize: isPicMode ? '100% 100%' : '64px',
|
||||
backgroundPosition: isPicMode ? '0% 0%' : 'center',
|
||||
}"
|
||||
@click="handleDownload(file)"
|
||||
:data-name="file.fileName">
|
||||
<el-button
|
||||
v-if="!disabled"
|
||||
type="text"
|
||||
class="el-icon-delete"
|
||||
style="padding: 0"
|
||||
@click="(e) => handleDelete(file)" />
|
||||
</div>
|
||||
|
||||
<el-image
|
||||
v-else
|
||||
class="file-list__item"
|
||||
style="width: 100%"
|
||||
:src="file.fileUrl"
|
||||
:preview-src-list="files.map((item) => item.fileUrl)"></el-image>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getAccessToken } from '@/utils/auth';
|
||||
import defaultBg from '../../../assets/images/default-file-icon.png';
|
||||
|
||||
function checkSize(file, message) {
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
if (!isLt2M) {
|
||||
message.error('上传文件大小不能超过 2MB!');
|
||||
}
|
||||
return isLt2M;
|
||||
}
|
||||
|
||||
function checkPic(file, message) {
|
||||
const isJPG = file.type === 'image/jpeg';
|
||||
const isPNG = file.type === 'image/png';
|
||||
const isPic = isJPG || isPNG;
|
||||
if (!isPic) {
|
||||
message.error('上传图片只能是 JPG/PNG 格式!');
|
||||
}
|
||||
return isPic;
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'AssetsUpload',
|
||||
components: {},
|
||||
model: {
|
||||
prop: 'dataSource',
|
||||
event: 'update',
|
||||
},
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
default: 'image',
|
||||
},
|
||||
dataSource: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
equipmentId: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
isPicMode: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
emits: ['update-filelist'],
|
||||
data() {
|
||||
return {
|
||||
defaultBg,
|
||||
expand: false,
|
||||
headers: { Authorization: 'Bearer ' + getAccessToken() }, // 设置上传的请求头部
|
||||
fileList: [],
|
||||
uploadUrl: process.env.VUE_APP_BASE_API + '/admin-api/infra/file/upload',
|
||||
files: [],
|
||||
updateTimer: null,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
dataSource: {
|
||||
handler(val) {
|
||||
this.files = JSON.parse(JSON.stringify(val));
|
||||
},
|
||||
immediate: true,
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
// handle success, per file!
|
||||
handleSuccess(response, file, fileList) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: '上传成功! 点击确认保存上传结果',
|
||||
type: 'success',
|
||||
});
|
||||
if (
|
||||
response == null ||
|
||||
!('data' in response) ||
|
||||
response.data == null ||
|
||||
response.data.trim() == ''
|
||||
) {
|
||||
this.$message.error('上传出错了!');
|
||||
return;
|
||||
}
|
||||
this.files.push({
|
||||
fileName: file.name,
|
||||
fileUrl: response.data,
|
||||
fileType: this.isPicMode ? 1 : 2,
|
||||
});
|
||||
// debugger;
|
||||
|
||||
// 延时更新
|
||||
if (this.updateTimer) {
|
||||
clearTimeout(this.updateTimer);
|
||||
}
|
||||
this.updateTimer = setTimeout(() => {
|
||||
// console.log('[AssetsUpload] 更新上传列表');
|
||||
this.emitFilelist();
|
||||
clearTimeout(this.updateTimer);
|
||||
this.updateTimer = null;
|
||||
}, 500);
|
||||
},
|
||||
|
||||
async handleDownload(file) {
|
||||
if (this.isPicMode) {
|
||||
// this.$emit('preview', file);
|
||||
const link = document.createElement('a');
|
||||
link.href = file.fileUrl;
|
||||
link.target = '_blank';
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
} else {
|
||||
// this.$emit('download', file);
|
||||
const data = await this.$axios({
|
||||
url: file.fileUrl,
|
||||
method: 'get',
|
||||
responseType: 'blob',
|
||||
});
|
||||
const link = document.createElement('a');
|
||||
link.href = window.URL.createObjectURL(new Blob([data]));
|
||||
link.download = file.fileName;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
window.URL.revokeObjectURL(link.href);
|
||||
}
|
||||
},
|
||||
|
||||
emitFilelist() {
|
||||
this.$emit('update', this.files);
|
||||
},
|
||||
|
||||
handleRemove(file, fileList) {
|
||||
debugger;
|
||||
},
|
||||
|
||||
handleDelete(file) {
|
||||
// fileName fileType 都可能一样,但 fileUrl 一定不一样
|
||||
this.files = this.files.filter((item) => item.fileUrl != file.fileUrl);
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: '删除成功! 需点击确认保存删除结果',
|
||||
type: 'success',
|
||||
});
|
||||
this.emitFilelist();
|
||||
},
|
||||
|
||||
beforeUpload(file) {
|
||||
if (this.isPicMode) {
|
||||
return checkPic(file, this.$message) && checkSize(file, this.$message);
|
||||
}
|
||||
return checkSize(file, this.$message);
|
||||
},
|
||||
|
||||
handleUpload() {
|
||||
switch (this.type) {
|
||||
case 'image':
|
||||
break;
|
||||
case 'asset':
|
||||
break;
|
||||
}
|
||||
},
|
||||
updateFileList(appendFilelist) {
|
||||
// Array
|
||||
this.$emit('update-filelist', this.appendFilelist);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.assets-upload {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.operations {
|
||||
position: absolute;
|
||||
top: -36px;
|
||||
right: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.expand-btn,
|
||||
.preview-btn {
|
||||
font-size: 14px;
|
||||
line-height: 1.2;
|
||||
display: inline-block;
|
||||
padding-left: 20px;
|
||||
cursor: pointer;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.expand-btn {
|
||||
margin-right: 12px;
|
||||
}
|
||||
|
||||
.preview-btn {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.expand-btn,
|
||||
.preview-btn:hover,
|
||||
.preview-btn.active {
|
||||
// color: #0042d0;
|
||||
color: #0b58ff;
|
||||
}
|
||||
|
||||
:deep(.equipment-upload) {
|
||||
.el-upload-dragger {
|
||||
width: 188px;
|
||||
height: 128px;
|
||||
}
|
||||
|
||||
.el-icon-upload {
|
||||
margin: 12px 0;
|
||||
font-size: 48px;
|
||||
}
|
||||
|
||||
.el-upload__text {
|
||||
font-size: 12px;
|
||||
line-height: 2px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
em {
|
||||
margin-top: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.el-upload__tip {
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
color: #d1d1d1;
|
||||
margin: 0 0 12px;
|
||||
transform: translateY(-12px);
|
||||
user-select: none;
|
||||
}
|
||||
}
|
||||
|
||||
.equipment-upload {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.file-list {
|
||||
padding: 12px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
// custom
|
||||
.file-area {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, 188px);
|
||||
grid-auto-rows: 152px;
|
||||
gap: 48px 24px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.file-list__item {
|
||||
height: 128px;
|
||||
background-color: #fff;
|
||||
border: 1px dashed #d9d9d9;
|
||||
border-radius: 6px;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
// overflow: hidden;
|
||||
|
||||
&:hover {
|
||||
.el-icon-delete {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.el-icon-delete {
|
||||
color: #ccc;
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
right: 8px;
|
||||
display: none;
|
||||
|
||||
&:hover {
|
||||
color: rgb(210, 41, 41);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.file-list__item:hover {
|
||||
border-color: #0b58ff;
|
||||
}
|
||||
|
||||
.file-list__item::after {
|
||||
content: attr(data-name);
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: -26px;
|
||||
font-size: 14px;
|
||||
line-height: 2;
|
||||
color: #616161;
|
||||
}
|
||||
|
||||
.default-icon {
|
||||
background: url(../../../assets/images/default-file-icon.png) no-repeat;
|
||||
background-position: center;
|
||||
background-size: 64px;
|
||||
}
|
||||
</style>
|
313
src/views/specialEquipment/components/DialogForm.vue
Normal file
@ -0,0 +1,313 @@
|
||||
<!--
|
||||
filename: dialogForm.vue
|
||||
author: liubin
|
||||
date: 2023-08-15 10:32:36
|
||||
description: 弹窗的表单组件
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:label-width="`${labelWidth}px`"
|
||||
:size="size"
|
||||
:label-position="labelPosition"
|
||||
v-loading="formLoading">
|
||||
<el-row :gutter="20" v-for="(row, rindex) in rows" :key="rindex">
|
||||
<el-col v-for="col in row" :key="col.label" :span="24 / row.length">
|
||||
<el-form-item :label="col.label" :prop="col.prop" :rules="col.rules">
|
||||
<el-input
|
||||
v-if="col.input"
|
||||
v-model="form[col.prop]"
|
||||
@change="$emit('update', form)"
|
||||
:placeholder="`请输入${col.label}`"
|
||||
v-bind="col.bind" />
|
||||
<el-input
|
||||
v-if="col.textarea"
|
||||
type="textarea"
|
||||
v-model="form[col.prop]"
|
||||
@change="$emit('update', form)"
|
||||
:placeholder="`请输入${col.label}`"
|
||||
v-bind="col.bind" />
|
||||
<el-select
|
||||
v-if="col.select"
|
||||
v-model="form[col.prop]"
|
||||
:placeholder="`请选择${col.label}`"
|
||||
@change="$emit('update', form)"
|
||||
v-bind="col.bind">
|
||||
<el-option
|
||||
v-for="opt in optionListOf[col.prop]"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
<el-date-picker
|
||||
v-if="col.datetime"
|
||||
v-model="form[col.prop]"
|
||||
type="datetime"
|
||||
:placeholder="`请选择${col.label}`"
|
||||
value-format="timestamp"
|
||||
v-bind="col.bind"></el-date-picker>
|
||||
<el-upload
|
||||
class="upload-in-dialog"
|
||||
v-if="col.upload"
|
||||
:file-list="uploadedFileList"
|
||||
:action="col.url"
|
||||
:on-success="handleUploadSuccess"
|
||||
v-bind="col.bind">
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
:disabled="col.bind?.disabled || false">
|
||||
点击上传
|
||||
</el-button>
|
||||
<div class="el-upload__tip" slot="tip" v-if="col.uploadTips">
|
||||
{{ col.uploadTips || '只能上传jpg/png文件,大小不超过2MB' }}
|
||||
</div>
|
||||
</el-upload>
|
||||
<el-switch
|
||||
v-if="col.switch"
|
||||
v-model="form[col.prop]"
|
||||
active-color="#0b58ff"
|
||||
inactive-color="#e1e1e1"
|
||||
v-bind="col.bind"></el-switch>
|
||||
<component
|
||||
v-if="col.subcomponent"
|
||||
:key="col.key"
|
||||
:is="col.subcomponent"
|
||||
v-bind="col.bind"
|
||||
:inlineStyle="col.style"></component>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* 找到最长的label
|
||||
* @param {*} options
|
||||
*/
|
||||
function findMaxLabelWidth(rows) {
|
||||
let max = 0;
|
||||
rows.forEach((row) => {
|
||||
row.forEach((opt) => {
|
||||
// debugger;
|
||||
if (!opt.label) return 0;
|
||||
if (opt.label.length > max) {
|
||||
max = opt.label.length;
|
||||
}
|
||||
});
|
||||
});
|
||||
return max;
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'DialogForm',
|
||||
model: {
|
||||
prop: 'dataForm',
|
||||
event: 'update',
|
||||
},
|
||||
emits: ['update'],
|
||||
components: {},
|
||||
props: {
|
||||
rows: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
dataForm: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
labelPosition: {
|
||||
type: String,
|
||||
default: 'right',
|
||||
},
|
||||
size: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formLoading: true,
|
||||
optionListOf: {},
|
||||
uploadedFileList: [],
|
||||
dataLoaded: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
labelWidth() {
|
||||
let max = findMaxLabelWidth(this.rows);
|
||||
// 每个汉字占20px
|
||||
return max * 20;
|
||||
// return max * 20 + 'px';
|
||||
},
|
||||
form: {
|
||||
get() {
|
||||
// if (this.dataLoaded) return this.dataForm;
|
||||
// else return {}
|
||||
return this.dataForm;
|
||||
},
|
||||
set(val) {
|
||||
console.log('set form', val);
|
||||
},
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
rows: {
|
||||
handler() {
|
||||
console.log('watch triggered!');
|
||||
this.$nextTick(() => {
|
||||
this.handleOptions('watch');
|
||||
});
|
||||
},
|
||||
deep: true,
|
||||
immediate: false,
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
// 处理 options
|
||||
this.handleOptions();
|
||||
},
|
||||
methods: {
|
||||
/** 模拟透传 ref */
|
||||
validate(cb) {
|
||||
return this.$refs.form.validate(cb);
|
||||
},
|
||||
resetFields(args) {
|
||||
return this.$refs.form.resetFields(args);
|
||||
},
|
||||
// getCode
|
||||
async getCode(url) {
|
||||
const response = await this.$axios(url);
|
||||
return response.data;
|
||||
},
|
||||
async handleOptions(trigger = 'monuted') {
|
||||
console.log('[dialogForm:handleOptions]');
|
||||
const promiseList = [];
|
||||
this.rows.forEach((cols) => {
|
||||
cols.forEach((opt) => {
|
||||
if (opt.value && !this.form[opt.prop]) {
|
||||
// 默认值
|
||||
this.form[opt.prop] = opt.value;
|
||||
}
|
||||
|
||||
if (opt.options) {
|
||||
this.$set(this.optionListOf, opt.prop, opt.options);
|
||||
} else if (opt.url) {
|
||||
// 如果有 depends,则暂时先不获取,注册一个watcher
|
||||
if (opt.depends) {
|
||||
console.log('[handleOptions] setting watch');
|
||||
this.$watch(
|
||||
() => this.form[opt.depends],
|
||||
(id) => {
|
||||
console.log('<', opt.depends, '>', 'changed', id);
|
||||
if (id == null) return;
|
||||
// 清空原有选项
|
||||
this.form[opt.prop] = null;
|
||||
// 获取新的选项
|
||||
this.$axios({
|
||||
url: `${opt.url}?id=${id}`,
|
||||
}).then((res) => {
|
||||
this.$set(
|
||||
this.optionListOf,
|
||||
opt.prop,
|
||||
res.data.map((item) => ({
|
||||
label: item[opt.labelKey ?? 'name'],
|
||||
value: item[opt.valueKey ?? 'id'],
|
||||
}))
|
||||
);
|
||||
});
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
}
|
||||
);
|
||||
return;
|
||||
}
|
||||
// 如果是下拉框,或者新增模式下的输入框,才去请求
|
||||
if (opt.select || (opt.input && !this.form?.id)) {
|
||||
promiseList.push(async () => {
|
||||
const response = await this.$axios(opt.url, {
|
||||
method: opt.method ?? 'get',
|
||||
});
|
||||
console.log('[dialogForm:handleOptions:response]', response);
|
||||
if (opt.select) {
|
||||
// 处理下拉框选项
|
||||
const list =
|
||||
'list' in response.data
|
||||
? response.data.list
|
||||
: response.data;
|
||||
this.$set(
|
||||
this.optionListOf,
|
||||
opt.prop,
|
||||
list.map((item) => ({
|
||||
label: item[opt.labelKey ?? 'name'],
|
||||
value: item[opt.valueKey ?? 'id'],
|
||||
}))
|
||||
);
|
||||
} else if (opt.input) {
|
||||
console.log('setting code: ', response.data);
|
||||
// 处理输入框数据
|
||||
this.form[opt.prop] = response.data;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
console.log('[dialogForm:handleOptions] done!');
|
||||
|
||||
// 如果是 watch 触发的,不需要执行进一步的请求
|
||||
if (trigger == 'watch') {
|
||||
this.formLoading = false;
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await Promise.all(promiseList.map((fn) => fn()));
|
||||
this.formLoading = false;
|
||||
this.dataLoaded = true;
|
||||
// console.log("[dialogForm:handleOptions:optionListOf]", this.optionListOf)
|
||||
} catch (error) {
|
||||
console.log('[dialogForm:handleOptions:error]', error);
|
||||
this.formLoading = false;
|
||||
}
|
||||
if (!promiseList.length) this.formLoading = false;
|
||||
},
|
||||
// 上传成功的特殊处理
|
||||
beforeUpload() {},
|
||||
// 上传前的验证规则可通过 bind 属性传入
|
||||
handleUploadSuccess(response, file, fileList) {
|
||||
console.log(
|
||||
'[dialogForm:handleUploadSuccess]',
|
||||
response,
|
||||
file,
|
||||
fileList,
|
||||
this.form
|
||||
);
|
||||
// 保存原始文件名
|
||||
if ('fileNames' in this.form) this.form.fileNames.push(file.name);
|
||||
// 保存完整地址
|
||||
if ('fileUrls' in this.form) this.form.fileUrls.push(response.data);
|
||||
this.$modal.msgSuccess('上传成功');
|
||||
},
|
||||
|
||||
getFileName(fileUrl) {
|
||||
return fileUrl.split('/').pop();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.el-date-editor,
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
550
src/views/specialEquipment/components/EquipmentDrawer.vue
Normal file
@ -0,0 +1,550 @@
|
||||
<!--
|
||||
filename: EquipmentDrawer.vue
|
||||
author: liubin
|
||||
date: 2023-08-22 14:38:56
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="false"
|
||||
class="drawer"
|
||||
custom-class="mes-drawer"
|
||||
size="60%"
|
||||
@closed="$emit('destroy')">
|
||||
<SmallTitle slot="title">
|
||||
{{
|
||||
mode.includes('detail')
|
||||
? '详情'
|
||||
: mode.includes('edit')
|
||||
? '编辑'
|
||||
: '新增'
|
||||
}}
|
||||
</SmallTitle>
|
||||
|
||||
<div class="drawer-body flex">
|
||||
<div class="drawer-body__content">
|
||||
<section v-for="(section, index) in sections" :key="section.key">
|
||||
<SmallTitle v-if="index != 0">{{ section.name }}</SmallTitle>
|
||||
|
||||
<div
|
||||
class="form-part"
|
||||
v-if="section.key == 'base'"
|
||||
style="margin-bottom: 32px">
|
||||
<el-skeleton v-if="!showForm" animated />
|
||||
<EquipmentInfoForm
|
||||
key="drawer-dialog-form"
|
||||
v-if="showForm"
|
||||
:disabled="mode.includes('detail')"
|
||||
:sync-filelist="syncFileListFlag"
|
||||
v-model="form" />
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="section.key == 'attrs'"
|
||||
style="margin-top: 12px; position: relative">
|
||||
<div
|
||||
v-if="!mode.includes('detail')"
|
||||
style="position: absolute; top: -40px; right: 0">
|
||||
<el-button @click="handleAddAttr" type="text">
|
||||
<i class="el-icon-plus"></i>
|
||||
添加属性
|
||||
</el-button>
|
||||
</div>
|
||||
<base-table
|
||||
v-loading="attrListLoading"
|
||||
:table-props="section.props"
|
||||
:page="attrQuery?.params.pageNo || 1"
|
||||
:limit="attrQuery?.params.pageSize || 10"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'"
|
||||
@emitButtonClick="handleAddAttr" -->
|
||||
<method-btn
|
||||
v-if="section.tableBtn"
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="attrQuery.params.pageNo"
|
||||
:limit.sync="attrQuery.params.pageSize"
|
||||
@pagination="getAttrList" />
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="handleCancel">取消</el-button>
|
||||
<el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-else type="primary" @click="handleConfirm">保存</el-button>
|
||||
<!-- sections的第二项必须是 属性列表 -->
|
||||
<!-- <el-button
|
||||
v-if="sections[1].allowAdd"
|
||||
type="primary"
|
||||
@click="handleAddAttr">
|
||||
添加属性
|
||||
</el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 属性对话框 -->
|
||||
<base-dialog
|
||||
v-if="sections[1].allowAdd"
|
||||
:dialogTitle="attrTitle"
|
||||
:dialogVisible="attrFormVisible"
|
||||
width="35%"
|
||||
:append-to-body="true"
|
||||
custom-class="baseDialog"
|
||||
@close="closeAttrForm"
|
||||
@cancel="closeAttrForm"
|
||||
@confirm="submitAttrForm">
|
||||
<DialogForm
|
||||
v-if="attrFormVisible"
|
||||
ref="attrForm"
|
||||
:dataForm="attrForm"
|
||||
:rows="attrRows" />
|
||||
</base-dialog>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DialogForm from './DialogForm';
|
||||
import EquipmentInfoForm from './EquipmentInfoForm.vue';
|
||||
|
||||
const SmallTitle = {
|
||||
name: 'SmallTitle',
|
||||
props: ['size'],
|
||||
components: {},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {},
|
||||
render: function (h) {
|
||||
return h(
|
||||
'span',
|
||||
{
|
||||
class: 'small-title',
|
||||
style: {
|
||||
fontSize: '18px',
|
||||
lineHeight:
|
||||
this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
|
||||
fontWeight: 500,
|
||||
fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
|
||||
},
|
||||
},
|
||||
this.$slots.default
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
components: { SmallTitle, DialogForm, EquipmentInfoForm },
|
||||
props: ['sections', 'mode', 'dataId'], // dataId 作为一个通用的存放id的字段
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
showForm: false,
|
||||
btnLoading: false,
|
||||
total: 0,
|
||||
form: {},
|
||||
list: [],
|
||||
attrTitle: '',
|
||||
attrForm: {
|
||||
id: null,
|
||||
equipmentId: null,
|
||||
name: '',
|
||||
value: '',
|
||||
},
|
||||
attrFormVisible: false,
|
||||
attrRows: [
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '属性名称',
|
||||
prop: 'name',
|
||||
rules: [
|
||||
{ required: true, message: '属性名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '属性值',
|
||||
prop: 'value',
|
||||
},
|
||||
],
|
||||
],
|
||||
attrQuery: {
|
||||
params: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
}, // 属性列表的请求
|
||||
infoQuery: null, // 基本信息的请求
|
||||
attrFormSubmitting: false,
|
||||
attrListLoading: false,
|
||||
syncFileListFlag: null,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
formRows() {
|
||||
return this.sections[0].rows.map((row) => {
|
||||
return row.map((col) => {
|
||||
if (col.key == 'eq-pics') {
|
||||
// 重置图片的位置
|
||||
return {
|
||||
...col,
|
||||
bind: {
|
||||
...col.bind,
|
||||
},
|
||||
style: {
|
||||
left: 0,
|
||||
right: 'unset',
|
||||
},
|
||||
};
|
||||
}
|
||||
return {
|
||||
...col,
|
||||
bind: {
|
||||
...col.bind,
|
||||
// 详情 模式下,禁用各种输入
|
||||
disabled: this.mode == 'detail',
|
||||
},
|
||||
};
|
||||
});
|
||||
});
|
||||
},
|
||||
tableBtn() {
|
||||
return this.mode == 'detail' ? [] : this.sections[1].tableBtn;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
for (const section of this.sections) {
|
||||
// 请求具体信息
|
||||
if ('url' in section) {
|
||||
const query = {
|
||||
url: section.url,
|
||||
method: section.method || 'get',
|
||||
params: section.queryParams || null,
|
||||
data: section.data || null,
|
||||
};
|
||||
this.$axios(query).then(({ data }) => {
|
||||
if (section.key == 'base') {
|
||||
this.form = data;
|
||||
// this.form = {
|
||||
// code: 'gj',
|
||||
// name: '下片机',
|
||||
// enName: 'unload',
|
||||
// abbr: '',
|
||||
// equipmentTypeId: 21084,
|
||||
// remark: '备注',
|
||||
// id: '1712367395052384257',
|
||||
// createTime: 1697095176000,
|
||||
// enterTime: 0,
|
||||
// productionTime: 0,
|
||||
// files: [
|
||||
// {
|
||||
// fileName: '测试.xlsx',
|
||||
// fileUrl: 'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2022%2F0108%2F0f0c6f30j00r5cle9000sc000hs00gtc.jpg&thumbnail=660x2147483647&quality=80&type=jpg',
|
||||
// fileType: 1
|
||||
// },
|
||||
// {
|
||||
// fileName: '测试2.xlsx',
|
||||
// fileUrl: 'https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2022%2F0415%2F2cd23619j00racb96000kc000hs00hsc.jpg&thumbnail=660x2147483647&quality=80&type=jpg',
|
||||
// fileType: 1
|
||||
// },
|
||||
// {
|
||||
// fileName: '测试3.xlsx',
|
||||
// fileUrl: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2F1fea91a0-d088-409e-b145-e0e61254b28b%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1700031689&t=2e0fe7d1de7f54adff3007efe133d67c',
|
||||
// fileType: 1
|
||||
// },
|
||||
// {
|
||||
// fileName: '测试4.xlsx',
|
||||
// fileUrl: 'https://pics5.baidu.com/feed/b7003af33a87e950cdfb4b4546eed044faf2b40d.jpeg?token=1d7484cfe4b014dd201f8c8725cab945',
|
||||
// fileType: 2
|
||||
// },
|
||||
// {
|
||||
// fileName: '测试5.xlsx',
|
||||
// fileUrl: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2Fe3500876-9c46-4b70-8d37-4799520cdd13%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1700031689&t=4abc1df930e62730e5361a7d3765e0f2',
|
||||
// fileType: 2
|
||||
// },
|
||||
// ],
|
||||
// tvalue: 0,
|
||||
// processingTime: 0,
|
||||
// manufacturer: '',
|
||||
// spec: '',
|
||||
// description: '描述',
|
||||
// };
|
||||
this.showForm = true;
|
||||
this.infoQuery = query;
|
||||
} else if (section.key == 'attrs') {
|
||||
this.attrQuery = query;
|
||||
this.list = data.list;
|
||||
this.total = data.total;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleTableBtnClick({ type, data }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
this.handleEditAttr(data.id);
|
||||
break;
|
||||
case 'delete':
|
||||
this.handleDeleteAttr(data.id);
|
||||
break;
|
||||
}
|
||||
},
|
||||
async handleConfirm() {
|
||||
this.btnLoading = true;
|
||||
this.syncFileListFlag = Math.random();
|
||||
|
||||
this.$nextTick(async () => {
|
||||
const { code, data } = await this.$axios({
|
||||
url: this.sections[0].urlUpdate,
|
||||
method: 'put',
|
||||
data: this.form,
|
||||
});
|
||||
if (code == 0) {
|
||||
this.$modal.msgSuccess('更新成功');
|
||||
}
|
||||
|
||||
this.btnLoading = false;
|
||||
this.handleCancel();
|
||||
});
|
||||
},
|
||||
|
||||
handleEmitFun(val) {
|
||||
console.log('handleEmitFun', val);
|
||||
},
|
||||
|
||||
init() {
|
||||
this.visible = true;
|
||||
},
|
||||
|
||||
async getAttrList() {
|
||||
this.attrListLoading = true;
|
||||
const res = await this.$axios(this.attrQuery);
|
||||
if (res.code == 0) {
|
||||
this.list = res.data.list;
|
||||
this.total = res.data.total;
|
||||
}
|
||||
this.attrListLoading = false;
|
||||
},
|
||||
|
||||
// 保存表单
|
||||
handleSave() {
|
||||
this.$refs['form'][0].validate(async (valid) => {
|
||||
if (valid) {
|
||||
const isEdit = this.mode == 'edit';
|
||||
await this.$axios({
|
||||
url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
|
||||
method: isEdit ? 'put' : 'post',
|
||||
data: this.form,
|
||||
});
|
||||
this.$modal.msgSuccess(`${isEdit ? '更新' : '创建'}成功`);
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
handleCancel() {
|
||||
this.visible = false;
|
||||
},
|
||||
|
||||
// 开启编辑
|
||||
toggleEdit() {
|
||||
this.$emit('update-mode', 'edit');
|
||||
},
|
||||
|
||||
// 新增属性
|
||||
handleAddAttr() {
|
||||
if (!this.dataId) return this.$message.error('请先创建设备信息');
|
||||
this.attrForm = {
|
||||
id: null,
|
||||
equipmentId: this.dataId,
|
||||
name: '',
|
||||
value: '',
|
||||
};
|
||||
this.attrTitle = '添加设备属性';
|
||||
this.attrFormVisible = true;
|
||||
},
|
||||
|
||||
// 编辑属性
|
||||
async handleEditAttr(attrId) {
|
||||
const res = await this.$axios({
|
||||
url: this.sections[1].urlDetail,
|
||||
method: 'get',
|
||||
params: { id: attrId },
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.attrForm = res.data;
|
||||
this.attrTitle = '编辑设备属性';
|
||||
this.attrFormVisible = true;
|
||||
}
|
||||
},
|
||||
|
||||
// 删除属性
|
||||
handleDeleteAttr(attrId) {
|
||||
this.$confirm('确定删除该属性?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(async () => {
|
||||
const res = await this.$axios({
|
||||
url: this.sections[1].urlDelete,
|
||||
method: 'delete',
|
||||
params: { id: attrId },
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getAttrList();
|
||||
},
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
|
||||
// 提交属性表
|
||||
submitAttrForm() {
|
||||
this.$refs['attrForm'].validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const isEdit = this.attrForm.id != null;
|
||||
this.attrFormSubmitting = true;
|
||||
const res = await this.$axios({
|
||||
url: isEdit
|
||||
? this.sections[1].urlUpdate
|
||||
: this.sections[1].urlCreate,
|
||||
method: isEdit ? 'put' : 'post',
|
||||
data: this.attrForm,
|
||||
});
|
||||
|
||||
if (res.code == 0) {
|
||||
this.closeAttrForm();
|
||||
this.$message({
|
||||
message: `${isEdit ? '更新' : '创建'}成功`,
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getAttrList();
|
||||
},
|
||||
});
|
||||
}
|
||||
this.attrFormSubmitting = false;
|
||||
} catch (err) {
|
||||
this.$message({
|
||||
message: err,
|
||||
type: 'error',
|
||||
duration: 1500,
|
||||
});
|
||||
this.attrFormSubmitting = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
closeAttrForm() {
|
||||
this.attrFormVisible = false;
|
||||
},
|
||||
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(
|
||||
`确定对${
|
||||
raw.data.name
|
||||
? '[名称=' + raw.data.name + ']'
|
||||
: '[序号=' + raw.data._pageIndex + ']'
|
||||
}进行删除操作?`,
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
deleteProductAttr(raw.data.id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
} else {
|
||||
this.addNew(raw.data.id);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.drawer >>> .el-drawer {
|
||||
border-radius: 8px 0 0 8px;
|
||||
}
|
||||
|
||||
.drawer >>> .el-drawer__header {
|
||||
margin: 0;
|
||||
padding: 32px 32px 24px;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.small-title::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: 4px;
|
||||
height: 22px;
|
||||
border-radius: 1px;
|
||||
margin-right: 8px;
|
||||
background-color: #0b58ff;
|
||||
}
|
||||
|
||||
.drawer-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.drawer-body__content {
|
||||
flex: 1;
|
||||
/* background: #eee; */
|
||||
padding: 20px 30px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.drawer-body__footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 18px;
|
||||
}
|
||||
</style>
|
288
src/views/specialEquipment/components/EquipmentInfoForm.vue
Normal file
@ -0,0 +1,288 @@
|
||||
<!--
|
||||
filename: dialogForm.vue
|
||||
author: liubin
|
||||
date: 2023-08-15 10:32:36
|
||||
description: 弹窗的表单组件
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-form class="equipment-info-form" ref="form" :model="form" label-width="200px" label-position="top"
|
||||
v-loading="formLoading">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备名称" prop="name" :rules="[{ required: true, message: '设备名称不能为空', trigger: 'blur' }]">
|
||||
<el-input v-model="form.name" :disabled="disabled" placeholder="请输入设备名称"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备编码" prop="code" :rules="[]">
|
||||
<el-input v-model="form.code" :disabled="disabled" placeholder="请输入设备编码"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="英文名称" prop="enName" :rules="[]">
|
||||
<el-input v-model="form.enName" :disabled="disabled" placeholder="请输入英文名称"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="缩写" prop="abbr" :rules="[]">
|
||||
<el-input v-model="form.abbr" :disabled="disabled" placeholder="请输入名称缩写"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备类型" prop="equipmentTypeId"
|
||||
:rules="[{ required: true, message: '设备类型不能为空', trigger: 'blur' }]">
|
||||
<el-select v-model="form.equipmentTypeId" :disabled="disabled" filterable placeholder="请选择设备类型">
|
||||
<el-option v-for="eqType in eqTypeList" :key="eqType.id" :label="eqType.name"
|
||||
:value="eqType.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="预计生产时间(min/天)" prop="workTime" :rules="[
|
||||
{ required: true, message: '预计生产时间不能为空', trigger: 'blur' },
|
||||
{
|
||||
type: 'number',
|
||||
message: '请输入正确的数字值',
|
||||
trigger: 'blur',
|
||||
transform: (val) => Number(val),
|
||||
},
|
||||
]">
|
||||
<el-input v-model="form.workTime" :disabled="disabled" placeholder="请输入预计生产时间"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="生产日期" prop="productionTime" :rules="[]">
|
||||
<el-date-picker v-model="form.enterTime" :disabled="disabled" type="datetime" placeholder="请选择生产日期"
|
||||
value-format="timestamp"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="进场日期" prop="enterTime" :rules="[]">
|
||||
<el-date-picker v-model="form.enterTime" :disabled="disabled" type="datetime" placeholder="请选择进场日期"
|
||||
value-format="timestamp"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备TT值" prop="tvalue" :rules="[
|
||||
{ required: true, message: '设备TT值不能为空', trigger: 'blur' },
|
||||
{
|
||||
type: 'number',
|
||||
message: '请输入正确的数字值',
|
||||
trigger: 'blur',
|
||||
transform: (val) => Number(val),
|
||||
},
|
||||
]">
|
||||
<el-input v-model="form.tvalue" :disabled="disabled" placeholder="请输入设备TT值"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="产品加工时间(s)" prop="processingTime" :rules="[
|
||||
{ required: true, message: '产品加工时间不能为空', trigger: 'blur' },
|
||||
{
|
||||
type: 'number',
|
||||
message: '请输入正确的数字值',
|
||||
trigger: 'blur',
|
||||
transform: (val) => Number(val),
|
||||
},
|
||||
]">
|
||||
<el-input v-model="form.processingTime" :disabled="disabled" placeholder="请输入产品加工时间"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="制造商" prop="manufacturer" :rules="[]">
|
||||
<el-input v-model="form.manufacturer" :disabled="disabled" placeholder="请输入制造商"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备规格" prop="spec" :rules="[]">
|
||||
<el-input v-model="form.spec" :disabled="disabled" placeholder="请输入设备规格"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<!-- 功能描述 -->
|
||||
<el-col>
|
||||
<el-form-item label="功能描述" prop="description" :rules="[]">
|
||||
<el-input type="textarea" :disabled="disabled" v-model="form.description"
|
||||
placeholder="请填写功能描述"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<!-- 功能描述 -->
|
||||
<el-col>
|
||||
<el-form-item label="备注" prop="remark" :rules="[]">
|
||||
<el-input v-model="form.remark" :disabled="disabled" placeholder="请输入备注"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<!-- 上传资料 -->
|
||||
<el-col>
|
||||
<el-form-item label="上传资料" prop="assets" :rules="[]">
|
||||
<AssetsUpload v-model="form.assets" :disabled="disabled" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<!-- 上传图片 -->
|
||||
<el-col>
|
||||
<el-form-item label="上传图片" prop="pics" :rules="[]">
|
||||
<AssetsUpload :is-pic-mode="true" v-model="form.pics" :disabled="disabled" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AssetsUpload from './AssetsUpload.vue';
|
||||
|
||||
export default {
|
||||
name: 'EquipmentInfoForm',
|
||||
|
||||
model: {
|
||||
prop: 'dataForm',
|
||||
event: 'update',
|
||||
},
|
||||
|
||||
emits: ['update'],
|
||||
|
||||
components: { AssetsUpload },
|
||||
|
||||
props: {
|
||||
dataForm: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
syncFilelist: {
|
||||
type: Number,
|
||||
default: null,
|
||||
required: false,
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
formLoading: false,
|
||||
form: {
|
||||
name: '',
|
||||
code: '',
|
||||
enName: '',
|
||||
abbr: '',
|
||||
equipmentTypeId: '',
|
||||
remark: '',
|
||||
productionTime: '',
|
||||
workTime: '',
|
||||
enterTime: '',
|
||||
tvalue: '',
|
||||
processingTime: '',
|
||||
manufacturer: '',
|
||||
spec: '',
|
||||
description: '',
|
||||
assets: [],
|
||||
pics: [],
|
||||
},
|
||||
eqTypeList: [],
|
||||
dataLoaded: false,
|
||||
};
|
||||
},
|
||||
|
||||
watch: {
|
||||
dataForm: {
|
||||
handler(val) {
|
||||
// debugger;
|
||||
this.form = JSON.parse(JSON.stringify(val));
|
||||
this.form.assets =
|
||||
this.form.files?.filter((item) => item.fileType == '2') || [];
|
||||
this.form.pics =
|
||||
this.form.files?.filter((item) => item.fileType == '1') || [];
|
||||
delete this.form.files;
|
||||
},
|
||||
immediate: true,
|
||||
deep: true,
|
||||
},
|
||||
syncFilelist: {
|
||||
handler(val) {
|
||||
if (val != null) {
|
||||
this.updateForm();
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.getEqTypeList();
|
||||
},
|
||||
|
||||
methods: {
|
||||
updateForm() {
|
||||
console.log('update form ==> ');
|
||||
this.form.files = [...this.form.assets, ...this.form.pics];
|
||||
delete this.form.assets;
|
||||
delete this.form.pics;
|
||||
this.$emit('update', this.form);
|
||||
},
|
||||
|
||||
async getEqTypeList() {
|
||||
this.formLoading = true;
|
||||
const { code, data } = await this.$axios(
|
||||
'/base/core-equipment-type/page?pageNo=1&pageSize=100'
|
||||
);
|
||||
// debugger;
|
||||
if (code == 0) {
|
||||
this.eqTypeList = data.list;
|
||||
}
|
||||
this.formLoading = false;
|
||||
},
|
||||
|
||||
/** 模拟透传 ref */
|
||||
validate(cb) {
|
||||
return this.$refs.form.validate(cb);
|
||||
},
|
||||
resetFields(args) {
|
||||
return this.$refs.form.resetFields(args);
|
||||
},
|
||||
// getCode
|
||||
async getCode(url) {
|
||||
const response = await this.$axios(url);
|
||||
return response.data;
|
||||
},
|
||||
// 上传成功的特殊处理
|
||||
beforeUpload() { },
|
||||
// 上传前的验证规则可通过 bind 属性传入
|
||||
handleUploadSuccess(response, file, fileList) {
|
||||
// 保存原始文件名
|
||||
if ('fileNames' in this.form) this.form.fileNames.push(file.name);
|
||||
// 保存完整地址
|
||||
if ('fileUrls' in this.form) this.form.fileUrls.push(response.data);
|
||||
this.$modal.msgSuccess('上传成功');
|
||||
},
|
||||
|
||||
getFileName(fileUrl) {
|
||||
return fileUrl.split('/').pop();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.el-date-editor,
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
399
src/views/specialEquipment/maintain/CustomDialogForm.vue
Normal file
@ -0,0 +1,399 @@
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="disabled"
|
||||
class="drawer"
|
||||
custom-class="mes-drawer"
|
||||
size="65%"
|
||||
@closed="$emit('destroy')">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
{{
|
||||
disabled ? '查看详情' : !dataForm.maintenanceStatus ? '修改' : '完成'
|
||||
}}
|
||||
</small-title>
|
||||
<div class="drawer-body flex">
|
||||
<div class="drawer-body__content">
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="dataForm"
|
||||
label-width="100px"
|
||||
label-position="top"
|
||||
v-loading="formLoading">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="维修单号" prop="repairOrderNumber">
|
||||
<span>{{ dataForm.repairOrderNumber }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备大类" prop="equipmentCategory">
|
||||
<span>
|
||||
{{
|
||||
['-', '安全设备', '消防设备', '特种设备'][
|
||||
dataForm.equipmentCategory || 0
|
||||
]
|
||||
}}
|
||||
</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备名称" prop="equipmentName">
|
||||
<span>{{ dataForm.equipmentName }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="维修工" prop="repairman">
|
||||
<span>{{ dataForm.repairman }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="故障发生时间" prop="faultTime">
|
||||
<span>{{ parseTime(dataForm.faultTime) }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="故障级别" prop="faultLevel">
|
||||
<span>
|
||||
{{ getDictDataLabel('fault-level', dataForm.faultLevel) }}
|
||||
</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系方式" prop="repairmanPhone">
|
||||
<span>{{ dataForm.repairmanPhone }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-divider />
|
||||
|
||||
<div
|
||||
v-if="
|
||||
disabled && dataForm.maintenanceStatus === 1
|
||||
? true
|
||||
: !disabled
|
||||
? true
|
||||
: false
|
||||
">
|
||||
<small-title
|
||||
style="margin: 16px 0; padding-left: 8px"
|
||||
:no-padding="true">
|
||||
{{ '设备维修信息' }}
|
||||
</small-title>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item
|
||||
label="维修开始时间"
|
||||
prop="maintenanceStartTime"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: '维修开始时间不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]">
|
||||
<el-date-picker
|
||||
v-model="dataForm.maintenanceStartTime"
|
||||
type="datetime"
|
||||
:disabled="disabled"
|
||||
placeholder="请选择维修开始时间"
|
||||
value-format="timestamp" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item
|
||||
label="维修结束时间"
|
||||
prop="maintenanceFinishTime"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: '维修结束时间不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]">
|
||||
<el-date-picker
|
||||
v-model="dataForm.maintenanceFinishTime"
|
||||
type="datetime"
|
||||
:disabled="disabled"
|
||||
placeholder="请选择维修开始时间"
|
||||
value-format="timestamp" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item
|
||||
label="维修方式"
|
||||
prop="repairMode"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: '维修方式不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]">
|
||||
<el-select
|
||||
:disabled="disabled"
|
||||
v-model="dataForm.repairMode"
|
||||
placeholder="请选择维修方式">
|
||||
<el-option
|
||||
v-for="opt in getDictDatas('repair-mode')"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="故障类型" prop="faultType">
|
||||
<el-select
|
||||
:disabled="disabled"
|
||||
v-model="dataForm.faultType"
|
||||
placeholder="请选择故障类型">
|
||||
<el-option
|
||||
v-for="opt in getDictDatas('fault-type')"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col>
|
||||
<el-form-item
|
||||
label="故障明细"
|
||||
prop="faultDetail"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: '故障明细不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]">
|
||||
<!-- // 富文本 -->
|
||||
<editor
|
||||
v-model="dataForm.faultDetail"
|
||||
:read-only="disabled"
|
||||
:min-height="150" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col>
|
||||
<el-form-item label="维修记录" prop="maintenanceDetail">
|
||||
<!-- // 富文本 -->
|
||||
<editor
|
||||
v-model="dataForm.maintenanceDetail"
|
||||
:read-only="disabled"
|
||||
:min-height="150" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col>
|
||||
<el-form-item label="维修附件" prop="file">
|
||||
<FileUpload
|
||||
v-model="file"
|
||||
:limit="1"
|
||||
:f-name="fileName"
|
||||
:disabled="disabled"
|
||||
@name="setFileName" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="dataForm.remark"
|
||||
:placeholder="`请输入备注`"
|
||||
:disabled="disabled" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<div v-if="!disabled" class="drawer-body__footer">
|
||||
<el-button style="" @click="goback()">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SmallTitle from './SmallTitle.vue';
|
||||
import { getEqRepair, updateEqRepair } from '@/api/equipment/base/repair';
|
||||
import Editor from '@/components/Editor';
|
||||
import FileUpload from '@/components/FileUpload';
|
||||
import { getDictDatas } from '@/utils/dict';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import { getDictDataLabel } from '@/utils/dict';
|
||||
|
||||
export default {
|
||||
name: 'DialogForm',
|
||||
model: {
|
||||
prop: 'dataForm',
|
||||
event: 'update',
|
||||
},
|
||||
emits: ['update'],
|
||||
components: { SmallTitle, Editor, FileUpload },
|
||||
props: {
|
||||
// dataForm: {
|
||||
// type: Object,
|
||||
// default: () => ({}),
|
||||
// },
|
||||
// disabled: {
|
||||
// type: Boolean,
|
||||
// default: false
|
||||
// },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formLoading: true,
|
||||
visible: false,
|
||||
disabled: false,
|
||||
dataForm: {},
|
||||
file: '',
|
||||
fileName: '',
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
setFileName(val) {
|
||||
this.fileName = val;
|
||||
},
|
||||
goback() {
|
||||
this.$emit('refreshDataList');
|
||||
this.visible = false;
|
||||
},
|
||||
goEdit() {
|
||||
this.disabled = false;
|
||||
},
|
||||
/** 模拟透传 ref */
|
||||
validate(cb) {
|
||||
return this.$refs.form.validate(cb);
|
||||
},
|
||||
resetFields(args) {
|
||||
return this.$refs.form.resetFields(args);
|
||||
},
|
||||
initData() {
|
||||
this.file = '';
|
||||
this.fileName = '';
|
||||
},
|
||||
init(row, isdetail) {
|
||||
this.initData();
|
||||
this.disabled = isdetail || false;
|
||||
this.dataForm.id = row.id || undefined;
|
||||
this.visible = true;
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form'].resetFields();
|
||||
|
||||
if (this.dataForm.id) {
|
||||
// 获取设备维修
|
||||
getEqRepair(this.dataForm.id).then((response) => {
|
||||
this.formLoading = false;
|
||||
this.dataForm = response.data;
|
||||
debugger;
|
||||
this.dataForm.maintenanceStatus =
|
||||
this.dataForm.maintenanceStatus || 0;
|
||||
if (this.dataForm.files.length > 0) {
|
||||
this.file = this.dataForm.files[0].fileUrl;
|
||||
this.fileName = this.dataForm.files[0].fileName;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// if (this.urlOptions.isGetCode) {
|
||||
// this.getCode()
|
||||
// }
|
||||
}
|
||||
});
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.file) {
|
||||
const temp = this.file.split(','); // 获取文件个数
|
||||
let arry = [];
|
||||
temp.forEach((item) => {
|
||||
arry.push({
|
||||
fileName: this.fileName,
|
||||
fileType: 2,
|
||||
fileUrl: item,
|
||||
});
|
||||
});
|
||||
this.dataForm.files = arry;
|
||||
}
|
||||
if (this.dataForm.id) {
|
||||
updateEqRepair(this.dataForm).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
// this.urlOptions.createURL(this.dataForm).then(response => {
|
||||
// this.$modal.msgSuccess("新增成功");
|
||||
// this.visible = false;
|
||||
// this.$emit("refreshDataList");
|
||||
// });
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.drawer >>> .el-drawer {
|
||||
border-radius: 8px 0 0 8px;
|
||||
}
|
||||
|
||||
.drawer >>> .el-drawer__header {
|
||||
margin: 0;
|
||||
padding: 32px 32px 24px;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.small-title::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: 4px;
|
||||
height: 22px;
|
||||
border-radius: 1px;
|
||||
margin-right: 8px;
|
||||
background-color: #0b58ff;
|
||||
}
|
||||
|
||||
.drawer-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.drawer-body__content {
|
||||
flex: 1;
|
||||
/* background: #eee; */
|
||||
padding: 20px 30px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.drawer-body__footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 18px;
|
||||
}
|
||||
</style>
|
465
src/views/specialEquipment/maintain/Monitor.vue
Normal file
@ -0,0 +1,465 @@
|
||||
<!--
|
||||
filename: Monitor.vue
|
||||
author: liubin
|
||||
date: 2023-12-12 13:54:53
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="app-container SpecialEquipmentMaintainMonitor">
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="search-bar"
|
||||
@select-changed="handleSearchBarChange"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
<!-- <method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:width="120"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" /> -->
|
||||
</base-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<base-dialog
|
||||
:dialogTitle="title"
|
||||
:dialogVisible="open"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<DialogForm
|
||||
v-if="open"
|
||||
ref="form"
|
||||
v-model="form"
|
||||
:has-files="false"
|
||||
:rows="rows" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
// import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import { exportMaintainMonitorExcel } from '@/api/equipment/base/maintain/record';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
|
||||
const remainBox = {
|
||||
name: 'RemainBox',
|
||||
props: ['injectData'],
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {
|
||||
value() {
|
||||
return this.injectData[this.injectData.prop] || null;
|
||||
},
|
||||
color() {
|
||||
if (this.value) {
|
||||
const v = +this.value;
|
||||
return v < 0 ? '#FF5454' : v >= 0 && v < 2 ? '#FFD767' : '#37D97F';
|
||||
}
|
||||
return 'unset';
|
||||
},
|
||||
},
|
||||
render: function (h) {
|
||||
return (
|
||||
<div
|
||||
style={`background: ${
|
||||
this.color
|
||||
}; position:absolute; inset: 0; padding: 0 10px; display: flex; align-items: center; color: ${
|
||||
// this.color == 'red' ? '#fff' : 'unset'
|
||||
'#fff'
|
||||
}`}>
|
||||
{this.injectData[this.injectData.prop]?.toFixed(0) || ''}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
const btn = {
|
||||
name: 'tableBtn',
|
||||
props: ['injectData'],
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
handleClick() {
|
||||
this.$emit('emitData', {
|
||||
action: this.injectData.label,
|
||||
value: this.injectData,
|
||||
});
|
||||
},
|
||||
},
|
||||
render: function (h) {
|
||||
return (
|
||||
<el-button type="text" onClick={this.handleClick}>
|
||||
{this.injectData.name}
|
||||
</el-button>
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'SpecialEquipmentMaintainMonitor',
|
||||
components: {},
|
||||
mixins: [basicPageMixin],
|
||||
data() {
|
||||
return {
|
||||
searchBarKeys: ['planId', 'specialType', 'equipmentId'],
|
||||
tableProps: [
|
||||
// {
|
||||
// prop: 'createTime',
|
||||
// label: '添加时间',
|
||||
// fixed: true,
|
||||
// width: 180,
|
||||
// filter: parseTime(createTime),
|
||||
// },
|
||||
{
|
||||
prop: 'name',
|
||||
label: '保养计划',
|
||||
minWidth: 100,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'lineName',
|
||||
label: '产线名',
|
||||
minWidth: 100,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'equipmentCategory',
|
||||
label: '设备大类',
|
||||
minWidth: 100,
|
||||
showOverflowtooltip: true,
|
||||
filter: (val) =>
|
||||
val != null ? ['-', '安全设备', '消防设备', '特种设备'][val] : '-',
|
||||
},
|
||||
{
|
||||
prop: 'equipmentName',
|
||||
label: '设备名称',
|
||||
minWidth: 100,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{ prop: 'maintenancePeriod', label: '保养频率' },
|
||||
{
|
||||
prop: 'maintainType',
|
||||
label: '保养类型',
|
||||
showOverflowtooltip: true,
|
||||
filter: publicFormatter(this.DICT_TYPE.MAINTAIN_TYPE),
|
||||
},
|
||||
{
|
||||
prop: 'lastMaintainTime',
|
||||
label: '上次保养时间',
|
||||
filter: parseTime,
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'nextMaintainTime',
|
||||
label: '计划下次保养时间',
|
||||
filter: parseTime,
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'remainDays',
|
||||
label: '距离保养时间(天)',
|
||||
subcomponent: remainBox,
|
||||
minWidth: 150,
|
||||
// showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'opt1',
|
||||
label: '设备保养',
|
||||
name: '操作',
|
||||
subcomponent: btn,
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
prop: 'opt2',
|
||||
label: '保养记录',
|
||||
name: '查看详情',
|
||||
subcomponent: btn,
|
||||
width: 100,
|
||||
},
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '保养计划',
|
||||
placeholder: '请选择保养计划',
|
||||
param: 'planId',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '设备大类',
|
||||
placeholder: '请选择设备大类',
|
||||
param: 'specialType',
|
||||
onchange: true,
|
||||
selectOptions: [
|
||||
{ id: 1, name: '安全设备' },
|
||||
{ id: 2, name: '消防设备' },
|
||||
{ id: 3, name: '特种设备' },
|
||||
],
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '设备名',
|
||||
placeholder: '请选择设备',
|
||||
param: 'equipmentId',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:quality-inspection-type:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
plain: true,
|
||||
color: 'primary',
|
||||
},
|
||||
],
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
equipmentName: null,
|
||||
createTime: null,
|
||||
special: true,
|
||||
specialType: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
allSpecialEquipments: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.initSearchBar();
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.queryParams };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal
|
||||
.confirm('是否确认导出所有设备保养监控数据项?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportMaintainMonitorExcel(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '设备保养监控.xls');
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
handleSearchBarChange({ param, value }) {
|
||||
if ('specialType' === param) {
|
||||
if (!value) {
|
||||
this.setSearchBarEquipmentList(this.allSpecialEquipments);
|
||||
return;
|
||||
}
|
||||
this.setSearchBarEquipmentList(
|
||||
this.allSpecialEquipments.filter((item) => item.specialType == value)
|
||||
);
|
||||
}
|
||||
},
|
||||
setSearchBarEquipmentList(eqList) {
|
||||
this.$set(
|
||||
this.searchBarFormConfig[2],
|
||||
'selectOptions',
|
||||
eqList.map((item) => ({
|
||||
name: item.name,
|
||||
id: item.id,
|
||||
}))
|
||||
);
|
||||
},
|
||||
initSearchBar() {
|
||||
this.$watch('current', {});
|
||||
this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
|
||||
this.allSpecialEquipments = data.filter((item) => item.special);
|
||||
this.setSearchBarEquipmentList(data.filter((item) => item.special));
|
||||
});
|
||||
this.http('/base/equipment-maintain-plan/page', 'get', {
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
special: true,
|
||||
}).then(({ data }) => {
|
||||
this.$set(
|
||||
this.searchBarFormConfig[0],
|
||||
'selectOptions',
|
||||
(data?.list || []).map((item) => ({
|
||||
name: item.name,
|
||||
id: item.id,
|
||||
}))
|
||||
);
|
||||
});
|
||||
},
|
||||
handleEmitFun({ action, value }) {
|
||||
switch (action) {
|
||||
// 查看详情
|
||||
case '设备保养':
|
||||
this.$router.push({
|
||||
path: '/equipment/base/maintain/record',
|
||||
query: {
|
||||
addRecord: 1,
|
||||
row: value,
|
||||
},
|
||||
});
|
||||
break;
|
||||
case '保养记录':
|
||||
const queryData = {
|
||||
equipmentId: value.equipmentId,
|
||||
maintainPlanId: value.id,
|
||||
relatePlan: value.lastMaintainTime ? 1 : 2,
|
||||
};
|
||||
this.$router.push({
|
||||
path: '/equipment/base/maintain/record',
|
||||
query: queryData,
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
this.http(
|
||||
'/base/equipment-maintain-plan/monitor',
|
||||
'get',
|
||||
this.queryParams
|
||||
).then((response) => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
code: null,
|
||||
name: null,
|
||||
equipmentId: null,
|
||||
enabled: null,
|
||||
maintenancePeriod: null,
|
||||
maintainDuration: null,
|
||||
maintainType: null,
|
||||
remark: null,
|
||||
enabled: 1,
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm');
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = '添加保养计划';
|
||||
},
|
||||
handleDetail(id) {
|
||||
alert('跳转到 保养记录');
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id;
|
||||
this.info({ id }).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = '修改保养计划';
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
this.put(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
this.post(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal
|
||||
.confirm('是否确认删除设备类型"' + row.name + '"?')
|
||||
.then(function () {
|
||||
return this.del(id);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.SpecialEquipmentMaintainMonitor {
|
||||
}
|
||||
</style>
|
281
src/views/specialEquipment/maintain/PlanConfig--add.vue
Normal file
@ -0,0 +1,281 @@
|
||||
<!--
|
||||
filename: dialogForm.vue
|
||||
author: liubin
|
||||
date: 2023-08-15 10:32:36
|
||||
description: 弹窗的表单组件
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:size="size"
|
||||
:label-position="labelPosition"
|
||||
v-loading="formLoading">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="计划名称"
|
||||
prop="name"
|
||||
:rules="[
|
||||
{ required: true, message: '请输入计划名称', trigger: 'blur' },
|
||||
]">
|
||||
<el-input
|
||||
v-model="form.name"
|
||||
@change="$emit('update', form)"
|
||||
:placeholder="`请输入计划名称`"
|
||||
:disabled="disabled" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="计划编号"
|
||||
prop="code"
|
||||
:rules="[
|
||||
{ required: true, message: '请输入计划编号', trigger: 'blur' },
|
||||
]">
|
||||
<el-input
|
||||
v-model="form.code"
|
||||
@change="$emit('update', form)"
|
||||
:placeholder="`请输入计划编号`"
|
||||
:disabled="disabled" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="设备大类"
|
||||
prop="equipmentCategory"
|
||||
:rules="[
|
||||
{ required: true, message: '请选择设备大类', trigger: 'blur' },
|
||||
]">
|
||||
<el-select
|
||||
v-model="form.equipmentCategory"
|
||||
:placeholder="`请选择设备大类`"
|
||||
:disabled="disabled"
|
||||
@change="handleEqTypeChange">
|
||||
<el-option
|
||||
v-for="opt in equipmentTypeOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="设备"
|
||||
prop="equipmentId"
|
||||
:rules="[{ required: true, message: '请选择设备', trigger: 'blur' }]">
|
||||
<el-select
|
||||
v-model="form.equipmentId"
|
||||
:placeholder="`请选择设备`"
|
||||
:disabled="disabled"
|
||||
@change="$emit('update', form)">
|
||||
<el-option
|
||||
v-for="opt in equipmentOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="保养类型" prop="maintainType">
|
||||
<el-select
|
||||
v-model="form.maintainType"
|
||||
:placeholder="`请选择保养类型`"
|
||||
:disabled="disabled"
|
||||
@change="$emit('update', form)">
|
||||
<el-option
|
||||
v-for="opt in getDictDatas(DICT_TYPE.MAINTAIN_TYPE)"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="+opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="保养时长(h)"
|
||||
prop="maintainDuration"
|
||||
:rules="[
|
||||
{
|
||||
type: 'number',
|
||||
message: '请输入正确的数字',
|
||||
trigger: 'blur',
|
||||
transform: (val) => Number(val),
|
||||
},
|
||||
]">
|
||||
<el-input
|
||||
v-model="form.maintainDuration"
|
||||
@change="$emit('update', form)"
|
||||
:placeholder="`请输入保养时长`"
|
||||
:disabled="disabled" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="保养频率(天/次)"
|
||||
prop="maintenancePeriod"
|
||||
:rules="[
|
||||
{
|
||||
type: 'number',
|
||||
message: '请输入正确的数字',
|
||||
trigger: 'blur',
|
||||
transform: (val) => Number(val),
|
||||
},
|
||||
{ required: true, message: '保养频率不能为空', trigger: 'blur' },
|
||||
]">
|
||||
<el-input
|
||||
v-model="form.maintenancePeriod"
|
||||
@change="$emit('update', form)"
|
||||
:placeholder="`请输入保养频率`"
|
||||
:disabled="disabled" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
@change="$emit('update', form)"
|
||||
:placeholder="`请输入备注`"
|
||||
:disabled="disabled" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'DialogForm',
|
||||
model: {
|
||||
prop: 'dataForm',
|
||||
event: 'update',
|
||||
},
|
||||
emits: ['update'],
|
||||
components: {},
|
||||
props: {
|
||||
rows: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
dataForm: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
hasFiles: {
|
||||
type: Boolean | Array,
|
||||
default: false,
|
||||
},
|
||||
labelPosition: {
|
||||
type: String,
|
||||
default: 'right',
|
||||
},
|
||||
size: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: {},
|
||||
formLoading: true,
|
||||
dataLoaded: false,
|
||||
equipmentList: [],
|
||||
equipmentOptions: [],
|
||||
equipmentTypeOptions: [
|
||||
{ label: '安全设备', value: 1 },
|
||||
{ label: '消防设备', value: 2 },
|
||||
{ label: '特种设备', value: 3 },
|
||||
],
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
dataForm: {
|
||||
handler(val) {
|
||||
this.form = JSON.parse(JSON.stringify(val));
|
||||
if (this.form.equipmentCategory != null) {
|
||||
setTimeout(() => {
|
||||
this.equipmentOptions = this.equipmentList
|
||||
.filter((item) => item.special)
|
||||
.filter(
|
||||
(item) => item.specialType === this.form.equipmentCategory
|
||||
)
|
||||
.map((item) => ({ label: item.name, value: item.id }));
|
||||
}, 1000);
|
||||
}
|
||||
if (this.hasFiles) {
|
||||
if (typeof this.hasFiles == 'boolean' && this.hasFiles) {
|
||||
this.form.files = this.form.files ?? [];
|
||||
} else if (Array.isArray(this.hasFiles)) {
|
||||
this.hasFiles.forEach((prop) => {
|
||||
this.form[prop] = this.form[prop] ?? [];
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getEquipmentList();
|
||||
this.getCode('/base/equipment-maintain-plan/getCode');
|
||||
},
|
||||
methods: {
|
||||
/** 模拟透传 ref */
|
||||
validate(cb) {
|
||||
return this.$refs.form.validate(cb);
|
||||
},
|
||||
resetFields(args) {
|
||||
return this.$refs.form.resetFields(args);
|
||||
},
|
||||
// getCode
|
||||
async getCode(url) {
|
||||
this.formLoading = true;
|
||||
const response = await this.$axios(url);
|
||||
this.formLoading = false;
|
||||
this.form.code = response.data || '';
|
||||
},
|
||||
// initialize
|
||||
async getEquipmentList() {
|
||||
this.formLoading = true;
|
||||
const response = await this.$axios('/base/core-equipment/listAll');
|
||||
this.equipmentList = response.data || [];
|
||||
this.equipmentOptions = (response.data || []).map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
this.formLoading = false;
|
||||
},
|
||||
|
||||
// handlers
|
||||
handleEqTypeChange(type) {
|
||||
this.form.equipmentId = null;
|
||||
if (type) {
|
||||
this.equipmentOptions = this.equipmentList
|
||||
.filter((item) => item.special)
|
||||
.filter((item) => item.specialType === type)
|
||||
.map((item) => ({ label: item.name, value: item.id }));
|
||||
} else
|
||||
this.equipmentOptions = this.equipmentList.map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
// this.$emit('update', this.form)
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.el-date-editor,
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
416
src/views/specialEquipment/maintain/PlanConfig.vue
Normal file
@ -0,0 +1,416 @@
|
||||
<!--
|
||||
filename: PlanConfig.vue
|
||||
author: liubin
|
||||
date: 2023-12-12 13:54:53
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="app-container SpecialEquipmentPlanConfig">
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="search-bar"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:width="120"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<base-dialog
|
||||
:dialogTitle="title"
|
||||
:dialogVisible="open"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<DialogForm v-if="open" ref="form" v-model="form" :has-files="false" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import { deleteEqMaintainPlan } from '@/api/equipment/base/maintain/record';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import PlanConfigAdd from './PlanConfig--add.vue';
|
||||
|
||||
export default {
|
||||
name: 'SpecialEquipmentPlanConfig',
|
||||
components: { DialogForm: PlanConfigAdd },
|
||||
mixins: [basicPageMixin],
|
||||
data() {
|
||||
const t = new Date();
|
||||
const [y, m, d] = [t.getFullYear(), t.getMonth(), t.getDate()];
|
||||
return {
|
||||
searchBarKeys: ['equipmentName', 'specialType', 'createTime'],
|
||||
tableBtn: [
|
||||
{
|
||||
type: 'detail',
|
||||
btnName: '保养记录',
|
||||
},
|
||||
this.$auth.hasPermi('equipment:plan-config:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('equipment:plan-config:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
tableProps: [
|
||||
// {
|
||||
// prop: 'createTime',
|
||||
// label: '添加时间',
|
||||
// fixed: true,
|
||||
// width: 180,
|
||||
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
// },
|
||||
{ prop: 'name', label: '计划名称' },
|
||||
{ prop: 'code', label: '计划编号' },
|
||||
{
|
||||
prop: 'enabled',
|
||||
label: '启用状态',
|
||||
filter: (val) => ['停用', '启用'][val],
|
||||
},
|
||||
{ prop: 'lineName', label: '产线' },
|
||||
{
|
||||
prop: 'equipmentCategory',
|
||||
label: '设备大类',
|
||||
filter: (val) =>
|
||||
val != null ? ['-', '安全', '消防', '特种'][val] : '-',
|
||||
},
|
||||
{ prop: 'equipmentName', label: '设备名称' },
|
||||
{ width: 144, prop: 'maintainDuration', label: '计划保养用时(h)' },
|
||||
{ width: 144, prop: 'maintenancePeriod', label: '保养频率(天/次)' },
|
||||
{
|
||||
prop: 'maintainType',
|
||||
label: '保养类型',
|
||||
filter: publicFormatter('maintain_type'),
|
||||
},
|
||||
{ prop: 'remark', label: '备注' },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '设备大类',
|
||||
selectOptions: [
|
||||
{ id: 1, name: '安全设备' },
|
||||
{ id: 2, name: '消防设备' },
|
||||
{ id: 3, name: '特种设备' },
|
||||
],
|
||||
placeholder: '请选择设备大类',
|
||||
param: 'specialType',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '设备名',
|
||||
placeholder: '请输入设备名称',
|
||||
param: 'equipmentName',
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间段',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'createTime',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('equipment:plan-config:create')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
plain: true,
|
||||
color: 'success',
|
||||
},
|
||||
// {
|
||||
// type: this.$auth.hasPermi('base:quality-inspection-type:export')
|
||||
// ? 'button'
|
||||
// : '',
|
||||
// btnName: '导出',
|
||||
// name: 'export',
|
||||
// color: 'warning',
|
||||
// },
|
||||
],
|
||||
rows: [
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '计划名称',
|
||||
prop: 'name',
|
||||
rules: [
|
||||
{ required: true, message: '计划名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '计划编号',
|
||||
prop: 'code',
|
||||
url: '/base/equipment-maintain-plan/getCode',
|
||||
rules: [
|
||||
{ required: true, message: '计划编号不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
label: '设备大类',
|
||||
prop: 'equipmentCategory',
|
||||
options: [
|
||||
{ value: 1, label: '安全设备' },
|
||||
{ value: 2, label: '消防设备' },
|
||||
{ value: 3, label: '特种设备' },
|
||||
],
|
||||
rules: [
|
||||
{ required: true, message: '设备名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
select: true,
|
||||
label: '设备名称',
|
||||
prop: 'equipmentId',
|
||||
url: '/base/core-equipment/listAll',
|
||||
rules: [
|
||||
{ required: true, message: '设备名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
select: true,
|
||||
label: '保养类型',
|
||||
prop: 'maintainType',
|
||||
options: this.getDictDatas(this.DICT_TYPE.MAINTAIN_TYPE),
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '保养时长(h)',
|
||||
prop: 'maintainDuration',
|
||||
rules: [
|
||||
{
|
||||
type: 'number',
|
||||
trigger: 'blur',
|
||||
message: '请输入正确的数字',
|
||||
transform: (val) => Number(val),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '保养频率(天/次)',
|
||||
prop: 'maintenancePeriod',
|
||||
rules: [
|
||||
{
|
||||
type: 'number',
|
||||
trigger: 'blur',
|
||||
message: '请输入正确的数字',
|
||||
transform: (val) => Number(val),
|
||||
},
|
||||
],
|
||||
rules: [
|
||||
{ required: true, message: '保养频率不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
switch: true,
|
||||
label: '启用状态',
|
||||
prop: 'enabled',
|
||||
bind: {
|
||||
'active-value': 1,
|
||||
'inactive-value': 0,
|
||||
},
|
||||
},
|
||||
],
|
||||
[{ input: true, label: '备注', prop: 'remark' }],
|
||||
],
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
equipmentName: null,
|
||||
createTime: null,
|
||||
specialType: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
basePath: '/base/equipment-maintain-plan',
|
||||
};
|
||||
},
|
||||
created() {
|
||||
if (this.$route.query) {
|
||||
this.queryParams.equipmentId =
|
||||
this.$route.query?.equipmentId ?? undefined;
|
||||
this.searchBarFormConfig[0].defaultSelect =
|
||||
this.$route.query.equipmentName ?? undefined;
|
||||
}
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
this.recv({
|
||||
...this.queryParams,
|
||||
special: true,
|
||||
}).then((response) => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
code: null,
|
||||
name: null,
|
||||
equipmentId: null,
|
||||
enabled: null,
|
||||
maintenancePeriod: null,
|
||||
maintainDuration: null,
|
||||
maintainType: null,
|
||||
remark: null,
|
||||
enabled: 1,
|
||||
equipmentCategory: null,
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm');
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = '添加保养计划';
|
||||
},
|
||||
handleDetail(row) {
|
||||
// alert('跳转到 保养记录')
|
||||
// console.log(row)
|
||||
const queryData = {
|
||||
equipmentId: row.equipmentId,
|
||||
maintainPlanId: row.id,
|
||||
isAdd: 1,
|
||||
// relatePlan: row.enabled
|
||||
};
|
||||
if (this.queryParams.createTime) {
|
||||
queryData.createTime = this.queryParams.createTime;
|
||||
}
|
||||
this.$router.push({
|
||||
path: '/safety-environmental/special-equipment/equipment-maintain/maintain-record',
|
||||
query: queryData,
|
||||
});
|
||||
// this.$router.push({ path: '/equipment/base/maintain/record', query: { orderNo: row.orderNo }})
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id;
|
||||
this.info({ id }).then((response) => {
|
||||
this.form = response.data;
|
||||
debugger;
|
||||
this.open = true;
|
||||
this.title = '修改保养计划';
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
this.put(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
this.post(this.form).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal
|
||||
.confirm('是否确认删除计划名称为"' + row.name + '"的数据项?')
|
||||
.then(function () {
|
||||
return deleteEqMaintainPlan(id);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.SpecialEquipmentPlanConfig {
|
||||
}
|
||||
</style>
|